import{R as dn,ad as ot,ae as Bi,af as bi,ag as ki,X as Ee,D as eA,$ as pn,ah as Fi,ai as Di,y as yi,aj as Ei}from"./cq4xQrr4.js";function st(e){const A=[];let t="",n=!1;for(let i=0;i0&&e[i-1]==="\\";r==="|"&&!o?(n&&t&&(A.push(t.length),t=""),n=!0):n&&(t+=r)}return n&&t&&A.push(t.length),A}function ct(e){const A=[];let t="",n=!1;for(let i=0;i0&&e[i-1]==="\\";r==="|"&&!o?(n&&(A.push(t.trim()),t=""),n=!0):n&&(t+=r)}return t.trim()&&A.push(t.trim()),A}function wi(e){const A=e.split(` `),t=[];let n=-1;for(let h=0;h"| "+Array(s).fill("---").join(" | ")+" |",l=r-i>=1?A[i+1].trim():"",a=l.startsWith("|")&&(l.includes("-")||l.includes(":")),u=A[r].trim();if(u.startsWith("|")&&(u.includes("-")||u.includes(":"))){const f=ct(u).map(d=>{const m=d.startsWith(":"),b=d.endsWith(":")&&d.length>1;let I=d.replace(/^:/,"").replace(/:$/,"");if(m&&b)return I.length<1&&(i="-"),":"+i+":";if(m)return I.length<1&&(i="-"),":"+i;if(b)return I.length<1&&(i="-"),i+":";for(;i.length<3;)i+="-";return I});for(;f.length{const I=f[b]||m.length+2,C=" ".repeat(Math.max(0,I-m.length-2));return m+C}).join(" | ")+" |"}return a||A.splice(i+1,0,c()),A.join(` `)}function xi(e,A={}){if(!e||e==="")return e;const t=A.syntax!==!1,n=e.split(` `),i=n.length;let r=!1,o=!1,s=!1,c=-1,l=null;const a=/^<(script|pre|style|textarea)(\s|>|$)/i,u=[];for(let f=0;f`,"i").test(d)&&(l=null);continue}const b=m.match(a);if(b){const I=b[1].toLowerCase();new RegExp(``,"i").test(d)||(l=I);continue}if(f===0&&A.frontmatter&&m==="---"){r=!0;continue}if(r){m==="---"?r=!1:m!==""&&(o=!0);continue}if(m==="$$"){s=!s;continue}if(m==="---"&&u.length>0){u[u.length-1].hasYamlProps=!u[u.length-1].hasYamlProps;continue}if(m.startsWith("|")?c=c===-1?f:c:c!==-1&&(c=-1),f===i-1&&t&&m[0]===":"&&u.length===0){let I=0;for(;I=2){let C=0;for(;C="a"&&k<="z"||k>="A"&&k<="z"||k==="$"){let S=I;for(;S="a"&&D<="z"||d>="A"&&D<="z"||d>="0"&&D<="9"||d==="$"||d==="."||d==="-"||d==="_"))break;s++}u.push({depth:i,name:m.slice(i,s),indent:b,hasyamlprops:!1})}else I===m.length&&u.length>0&&u[u.length-1].depth===I&&u.pop()}}}const g=i-1;!r&&!s&&n[g].trim()!=="$$"&&(n[g]=Qi(n[g],t));let h=n.join(` `);if(c!==-1&&(h=wi(h)),r&&o){const f=n[g].trim();f==="-"||f==="--"?h+="-".repeat(3-f.length):h+=h.endsWith(` `)?"---":` ---`}if(s&&(h+=h.endsWith(` `)?"$$":` $$`),t&&e.includes("::")){const f=h.lastIndexOf(` `)+1,d=h.slice(f);let m=-1;for(let b=d.length-1;b>=0&&d[b]!=="}";b--)if(d[b]==="{"){m=b;break}if(m>=0){const b=d.slice(m+1);let I=0,C=0;for(let k=0;k0){const b=u[u.length-1],I=h.lastIndexOf(` `)+1,C=h.slice(I).trim();b.hasYamlProps&&(C==="-"||C==="--")&&(h+="-".repeat(3-C.length),b.hasYamlProps=!1);const B=[];for(;u.length>0;){const k=u.pop();k.hasYamlProps&&B.push(k.indent+"---"),B.push(k.indent+":".repeat(k.depth))}h+=` `+B.join(` `)}}return h}function lt(e){return e===""||e===" "||e===" "}function dA(e,A,t){const n=e.length;let i=A;for(;i+10?e[A-1]:"",o=i+10&&(e[h-1]===" "||e[h-1]===" ");)h--;const f=h0?e[E-1]:"",w=e[E];if(w==="\\"){E++;continue}if(k){w==="`"&&(s++,k=!1);continue}if(F){w==="$"&&!(E+10&&b--;continue}if(!(b>0)){if(w==="["){a++,g=E,I++;continue}if(w==="]"){a--,g=E,I>0&&I--;continue}if(w==="("){g>=0&&E>g&&(u++,G==="]"&&C++);continue}if(w===")"){g>=0&&E>g&&(u--,C>0&&C--);continue}if(I>0){w==="`"&&B++;continue}if(!(C>0)){if(w==="`"){s++,k=!0;continue}if(w==="$"){E+1="a"&&G<="z"||g>="A"&&G<="z"||g>="0"&&G<="9",te=q.afterch>="a"&&Q.afterCh<="z"||q.afterch>="A"&&Q.afterCh<="z"||q.afterch>="0"&&Q.afterCh<="9";!(q&&te)&&!q.surroundedbyspace&&(i+=q.length,q.length===2&&m.push(e)),e=q.end}else if(w==="~"){const Q=dA(e,E,"~");Q.surroundedBySpace||(r+=Q.length>>1,Q.length&1&&o++),E=Q.end}}}}if(k)return e+"`";if(F)return e.trim()==="$$"?e:e+"$";const S=d.length>=2;let D="",_=!1;if(n>=3&&e[0]==="*"&&e[1]==="*"&&e[2]==="*"){const E=n%6;if(E===3)e[3]!=="*"&&(h>=3&&e[h-1]==="*"&&e[h-2]==="*"&&e[h-3]==="*"&&(h===3||e[h-4]===" ")||(D="***"));else if(E>3&&E<6){const G=6-E;D="*".repeat(G)}}if(!D&&n>=2){const E=n%4;if(E===2){if(d.length>0&&!(e[0]==="*"&&e[1]==="*"&&e[2]==="*")){const w=h>=2&&e[h-1]==="*"&&e[h-2]==="*";if(!(w&&(h===2||e[h-3]===" "))){const q=Math.floor(d.length/2)*4,te=n-q;if(!(S&&te%2===0)){const be=e[h-1],Ii=be>="a"&&be<="z"||be>="A"&&be<="z"||be>="0"&&be<="9";(!s||ii)&&(d="**",f&&!w&&(_=!0))}}}}else if(E>2&&E<4){const G=4-E;D="*".repeat(G)}}if(!D&&n%2===1&&(!(e[0]==="*"&&e[1]==="*")||S)){let G=!1;for(let w=0;w0?e[w-1]:"";if(Q!==" "||q===" "){G=!0;break}}if(G&&(!(h>=1&&e[h-1]==="*"&&(h===1||e[h-2]===" "))||n>1)){D="*";const Q=e[h-1]==="*";f&&!Q&&(_=!0)}}if(!D&&i>=2){const E=i%4;if(E===2){if(m.length>0){const G=m.length>=2,w=h>=2&&e[h-1]==="_"&&e[h-2]==="_";!(w&&(h===2||e[h-3]===" "))&&!G&&(D="__",f&&!w&&(_=!0))}}else if(E>2&&E<4){const G=4-E;D="_".repeat(G)}}if(!D&&i%2===1){let E=!1;for(let G=0;G0?e[G-1]:"";if(w!==" "||Q===" "){E=!0;break}}if(E&&!(h>=1&&e[h-1]==="_"&&(h===1||e[h-2]===" "))){D="_";const w=e[h-1]==="_";f&&!w&&(_=!0)}}if(!D&&r%2===1?(D=o===1?"~":"~~",f&&(_=!0)):!D&&o%2===1&&(D="~",f&&(_=!0)),!D&&s%2===1&&(D="`"),!D&&l%2===1&&e.trim()!=="$$"&&(D="$$"),!D&&c%2===1&&(D="$"),!D&&a>0&&(D=B%2===1?"`]":"]"),!D&&u>0&&(D=")"),_&&D){let E=t;for(;E>0&&(e[E-1]===" "||e[E-1]===" ");)E--;return e.slice(0,E)+D}return e+D}function mn(e){if(typeof e=="string"||e.length<2)return e;const[A,t,...n]=e,i=n.filter(s=>typeof s!="string"||s&&s.trim());if(i.length===0)return e;if(i.length>1||typeof i[0]=="string"||i[0][0]!=="p")return[A,t,...n.map(s=>mn(s))];const r=i[0][1],o=r&&Object.keys(r).length>0?{...r,...t}:t;return[A,o,...i[0].slice(2)]}var Si=Object.defineProperty,Ki=(e,A)=>{let t={};for(var n in e)Si(t,n,{get:e[n],enumerable:!0});return t},pA;const Gi=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),Ni=(pA=String.fromCodePoint)!==null&&pA!==void 0?pA:(e=>{let A="";return e>65535&&(e-=65536,A+=String.fromCharCode(e>>>10&1023|55296),e=56320|e&1023),A+=String.fromCharCode(e),A});function Wi(e){var A;return e>=55296&&e<=57343||e>1114111?65533:(A=Gi.get(e))!==null&&A!==void 0?A:e}function Yi(e){const A=typeof atob=="function"?atob(e):typeof Buffer.from=="function"?Buffer.from(e,"base64").toString("binary"):new Buffer(e,"base64").toString("binary"),t=A.length&-2,n=new Uint16Array(t/2);for(let i=0,r=0;i=Z.ZERO&&e<=z.nine}function Ji(e){return e>=Z.UPPER_A&&e<=z.upper_f||e>=Z.LOWER_A&&e<=z.lower_f}function Zi(e){return e>=Z.UPPER_A&&e<=z.upper_z||e>=Z.LOWER_A&&e<=z.lower_z||sa(e)}function Ri(e){return e===Z.EQUALS||Zi(e)}var H;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(H||(H={}));var le;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(le||(le={}));let Mi=class{constructor(A,t,n){this.decodeTree=A,this.emitCodePoint=t,this.errors=n,this.state=H.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=le.Strict,this.runConsumed=0}startEntity(A){this.decodeMode=A,this.state=H.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(A,t){switch(this.state){case H.EntityStart:return A.charCodeAt(t)===Z.NUM?(this.state=H.NumericStart,this.consumed+=1,this.stateNumericStart(A,t+1)):(this.state=H.NamedEntity,this.stateNamedEntity(A,t));case H.NumericStart:return this.stateNumericStart(A,t);case H.NumericDecimal:return this.stateNumericDecimal(A,t);case H.NumericHex:return this.stateNumericHex(A,t);case H.NamedEntity:return this.stateNamedEntity(A,t)}}stateNumericStart(A,t){return t>=A.length?-1:(A.charCodeAt(t)|at)===Z.LOWER_X?(this.state=H.NumericHex,this.consumed+=1,this.stateNumericHex(A,t+1)):(this.state=H.NumericDecimal,this.stateNumericDecimal(A,t))}stateNumericHex(A,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const c=i&X.JUMP_TABLE;if(A.charCodeAt(t)!==c)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=A.length)return-1;const c=this.runConsumed-1,l=n[this.treeIndex+1+(c>>1)],a=c%2===0?l&255:l>>8&255;if(A.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(s>>1),i=n[this.treeIndex],r=(i&X.VALUE_LENGTH)>>14}if(t>=A.length)break;const o=A.charCodeAt(t);if(o===Z.SEMI&&r!==0&&(i&X.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);if(this.treeIndex=Ui(n,i,this.treeIndex+Math.max(1,r),o),this.treeIndex<0)return this.result===0||this.decodeMode===le.Attribute&&(r===0||Ri(o))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],r=(i&X.VALUE_LENGTH)>>14,r!==0){if(o===Z.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==le.Strict&&(i&X.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){var A;const{result:t,decodeTree:n}=this,i=(n[t]&X.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,i,this.consumed),(A=this.errors)===null||A===void 0||A.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(A,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[A]&~(X.VALUE_LENGTH|X.FLAG13):i[A+1],n),t===3&&this.emitCodePoint(i[A+2],n),n}end(){var A;switch(this.state){case H.NamedEntity:return this.result!==0&&(this.decodeMode!==le.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case H.NumericDecimal:return this.emitNumericEntity(0,2);case H.NumericHex:return this.emitNumericEntity(0,3);case H.NumericStart:return(A=this.errors)===null||A===void 0||A.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case H.EntityStart:return 0}}};function Hi(e){let A="";const t=new Mi(e,n=>A+=Ni(n));return function(i,r){let o=0,s=0;for(;(s=i.indexOf("&",s))>=0;){A+=i.slice(o,s),t.startEntity(r);const l=t.write(i,s+1);if(l<0){o=s+t.end();break}o=s+l,s=l===0?o+1:o}const c=A+i.slice(o);return A="",c}}function Ui(e,A,t,n){const i=(A&X.BRANCH_LENGTH)>>7,r=A&X.JUMP_TABLE;if(i===0)return r!==0&&n===r?t:-1;if(r){const l=n-r;return l<0||l>=i?-1:e[t+l]-1}const o=i+1>>1;let s=0,c=i-1;for(;s<=c;){const l=s+c>>>1,a=l>>1,g=e[t+a]>>(l&1)*8&255;if(gn)c=l-1;else return e[t+o+l]}return-1}const Cn=Hi(_i);function vi(e,A=le.Legacy){return Cn(e,A)}function Oi(e){return Cn(e,le.Strict)}const ut={};function Ti(e){let A=ut[e];if(A)return A;A=ut[e]=[];for(let t=0;t<128;t++){const n=String.fromCharCode(t);A.push(n)}for(let t=0;t=55296&&a<=57343?i+="���":i+=string.fromcharcode(a),r+=6;continue}}if((s&248)===240&&r+91114111?i+="����":(u-=65536,i+=String.fromCharCode(55296+(u>>10),56320+(u&1023))),r+=9;continue}}i+="�"}return i})}Ke.defaultChars=";/?:@&=+,ドル#";Ke.componentChars="";const ht={};function Li(e){let A=ht[e];if(A)return A;A=ht[e]=[];for(let t=0;t<128;t++){const n=String.fromCharCode(t);/^[0-9a-z]$/i.test(n)?A.push(n):A.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t"u"&&(t=!0);const n=Li(A);let i="";for(let r=0,o=e.length;r=55296&&s<=57343){if(s>=55296&&s<=56319&&r+1=56320&&c<=57343){i+=encodeuricomponent(e[r]+e[r+1]),r++;continue}}i+="%ef%bf%bd";continue}i+=encodeuricomponent(e[r])}return i}Pe.defaultChars=";/?:@&=+,ドル-_.!~*'()#";Pe.componentChars="-_.!~*'()";function vA(e){let A="";return A+=e.protocol||"",A+=e.slashes?"//":"",A+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?A+="["+e.hostname+"]":A+=e.hostname||"",A+=e.port?":"+e.port:"",A+=e.pathname||"",A+=e.search||"",A+=e.hash||"",A}function AA(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Pi=/^([a-z0-9.+-]+:)/i,Xi=/:[0-9]*$/,Vi=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ji=["<",">",'"',"`"," ","\r",` `," "],zi=["{","}","|","\\","^","`"].concat(ji),qi=["'"].concat(zi),ft=["%","/","?",";","#"].concat(qi),gt=["/","?","#"],$i=255,dt=/^[+a-z0-9A-Z_-]{0,63}$/,er=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,pt={javascript:!0,"javascript:":!0},mt={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function OA(e,A){if(e&&e instanceof AA)return e;const t=new AA;return t.parse(e,A),t}AA.prototype.parse=function(e,A){let t,n,i,r=e;if(r=r.trim(),!A&&e.split("#").length===1){const l=Vi.exec(r);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let o=Pi.exec(r);if(o&&(o=o[0],t=o.toLowerCase(),this.protocol=o,r=r.substr(o.length)),(A||o||r.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=r.substr(0,2)==="//",i&&!(o&&pt[o])&&(r=r.substr(2),this.slashes=!0)),!pt[o]&&(i||o&&!mt[o])){let l=-1;for(let f=0;f127?I+="x":I+=b[C];if(!I.match(dt)){const C=f.slice(0,d),B=f.slice(d+1),k=b.match(er);k&&(C.push(k[1]),B.unshift(k[2])),B.length&&(r=B.join(".")+r),this.hostname=C.join(".");break}}}}this.hostname.length>$i&&(this.hostname=""),h&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const s=r.indexOf("#");s!==-1&&(this.hash=r.substr(s),r=r.slice(0,s));const c=r.indexOf("?");return c!==-1&&(this.search=r.substr(c),r=r.slice(0,c)),r&&(this.pathname=r),mt[t]&&this.hostname&&!this.pathname&&(this.pathname=""),this};AA.prototype.parseHost=function(e){let A=Xi.exec(e);A&&(A=A[0],A!==":"&&(this.port=A.substr(1)),e=e.substr(0,e.length-A.length)),e&&(this.hostname=e)};const Ar=Object.freeze(Object.defineProperty({__proto__:null,decode:Ke,encode:Pe,format:vA,parse:OA},Symbol.toStringTag,{value:"Module"})),In=/[0円-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Bn=/[0円-\x1F\x7F-\x9F]/,tr=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,TA=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,bn=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,kn=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,nr=Object.freeze(Object.defineProperty({__proto__:null,Any:In,Cc:Bn,Cf:tr,P:TA,S:bn,Z:kn},Symbol.toStringTag,{value:"Module"}));function ir(e){const A={};e=e||{},A.src_Any=In.source,A.src_Cc=Bn.source,A.src_Z=kn.source,A.src_P=TA.source,A.src_ZPCc=[A.src_Z,A.src_P,A.src_Cc].join("|"),A.src_ZCc=[A.src_Z,A.src_Cc].join("|");const t="[><|]";return A.src_pseudo_letter=`(?:(?!${t}|${A.src_ZPCc})${A.src_Any})`,A.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",A.src_auth=`(?:(?:(?!${A.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`,A.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",A.src_host_terminator=`(?=$|${t}|${A.src_ZPCc})(?!${e["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${A.src_ZPCc}))`,A.src_path=`(?:[/?#](?:(?!${A.src_ZCc}|${t}|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!${A.src_ZCc}|\\]).)*\\]|\\((?:(?!${A.src_ZCc}|[)]).)*\\)|\\{(?:(?!${A.src_ZCc}|[}]).)*\\}|\\"(?:(?!${A.src_ZCc}|["]).)+\\"|\\'(?:(?!${A.src_ZCc}|[']).)+\\'|\\'(?=${A.src_pseudo_letter}|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!${A.src_ZCc}|[.]|$)|`+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+`,(?!${A.src_ZCc}|$)|;(?!${A.src_ZCc}|$)|\\!+(?!${A.src_ZCc}|[!]|$)|\\?(?!${A.src_ZCc}|[?]|$))+|\\/)?`,A.src_email_name='[\\-;:&=\\+\\,ドル\\.a-zA-Z0-9_][\\-;:&=\\+\\,ドル\\"\\.a-zA-Z0-9_]{0,63}',A.src_xn="xn--[a-z0-9\\-]{1,59}",A.src_domain_root="(?:"+A.src_xn+`|${A.src_pseudo_letter}{1,63})`,A.src_domain="(?:"+A.src_xn+`|(?:${A.src_pseudo_letter})|(?:${A.src_pseudo_letter}(?:-|${A.src_pseudo_letter}){0,61}${A.src_pseudo_letter}))`,A.src_host=`(?:(?:(?:(?:${A.src_domain})\\.)*${A.src_domain}))`,A.tpl_host_fuzzy="(?:"+A.src_ip4+`|(?:(?:(?:${A.src_domain})\\.)+(?:%TLDS%)))`,A.tpl_host_no_ip_fuzzy=`(?:(?:(?:${A.src_domain})\\.)+(?:%TLDS%))`,A.src_host_strict=A.src_host+A.src_host_terminator,A.tpl_host_fuzzy_strict=A.tpl_host_fuzzy+A.src_host_terminator,A.src_host_port_strict=A.src_host+A.src_port+A.src_host_terminator,A.tpl_host_port_fuzzy_strict=A.tpl_host_fuzzy+A.src_port+A.src_host_terminator,A.tpl_host_port_no_ip_fuzzy_strict=A.tpl_host_no_ip_fuzzy+A.src_port+A.src_host_terminator,A.tpl_host_fuzzy_test=`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${A.src_ZPCc}|>|$))`,A.tpl_email_fuzzy=`(^|${t}|"|\\(|${A.src_ZCc})(${A.src_email_name}@${A.tpl_host_fuzzy_strict})`,A.tpl_link_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${A.src_ZPCc}))((?![$+<=>^\`||])${A.tpl_host_port_fuzzy_strict}${A.src_path})`,A.tpl_link_no_ip_fuzzy=`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${A.src_ZPCc}))((?![$+<=>^\`||])${A.tpl_host_port_no_ip_fuzzy_strict}${A.src_path})`,A}function KA(e){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(n){e[n]=t[n]})}),e}function sA(e){return Object.prototype.toString.call(e)}function rr(e){return sA(e)==="[object String]"}function or(e){return sA(e)==="[object Object]"}function sr(e){return sA(e)==="[object RegExp]"}function Ct(e){return sA(e)==="[object Function]"}function cr(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Fn={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function lr(e){return Object.keys(e||{}).reduce(function(A,t){return A||Fn.hasOwnProperty(t)},!1)}const ar={"http:":{validate:function(e,A,t){const n=e.slice(A);return t.re.http||(t.re.http=new RegExp(`^\\/\\/${t.re.src_auth}${t.re.src_host_port_strict}${t.re.src_path}`,"i")),t.re.http.test(n)?n.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,A,t){const n=e.slice(A);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+`(?:localhost|(?:(?:${t.re.src_domain})\\.)+${t.re.src_domain_root})`+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(n)?A>=3&&e[A-3]===":"||A>=3&&e[A-3]==="/"?0:n.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(e,A,t){const n=e.slice(A);return t.re.mailto||(t.re.mailto=new RegExp(`^${t.re.src_email_name}@${t.re.src_host_strict}`,"i")),t.re.mailto.test(n)?n.match(t.re.mailto)[0].length:0}}},ur="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",hr="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function fr(e){return function(A,t){const n=A.slice(t);return e.test(n)?n.match(e)[0].length:0}}function It(){return function(e,A){A.normalize(e)}}function tA(e){const A=e.re=ir(e.__opts__),t=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||t.push(ur),t.push(A.src_xn),A.src_tlds=t.join("|");function n(s){return s.replace("%TLDS%",A.src_tlds)}A.email_fuzzy=RegExp(n(A.tpl_email_fuzzy),"i"),A.email_fuzzy_global=RegExp(n(A.tpl_email_fuzzy),"ig"),A.link_fuzzy=RegExp(n(A.tpl_link_fuzzy),"i"),A.link_fuzzy_global=RegExp(n(A.tpl_link_fuzzy),"ig"),A.link_no_ip_fuzzy=RegExp(n(A.tpl_link_no_ip_fuzzy),"i"),A.link_no_ip_fuzzy_global=RegExp(n(A.tpl_link_no_ip_fuzzy),"ig"),A.host_fuzzy_test=RegExp(n(A.tpl_host_fuzzy_test),"i");const i=[];e.__compiled__={};function r(s,c){throw new Error(`(LinkifyIt) Invalid schema "${s}": ${c}`)}Object.keys(e.__schemas__).forEach(function(s){const c=e.__schemas__[s];if(c===null)return;const l={validate:null,link:null};if(e.__compiled__[s]=l,or(c)){sr(c.validate)?l.validate=fr(c.validate):Ct(c.validate)?l.validate=c.validate:r(s,c),Ct(c.normalize)?l.normalize=c.normalize:c.normalize?r(s,c):l.normalize=It();return}if(rr(c)){i.push(s);return}r(s,c)}),i.forEach(function(s){e.__compiled__[e.__schemas__[s]]&&(e.__compiled__[s].validate=e.__compiled__[e.__schemas__[s]].validate,e.__compiled__[s].normalize=e.__compiled__[e.__schemas__[s]].normalize)}),e.__compiled__[""]={validate:null,normalize:It()};const o=Object.keys(e.__compiled__).filter(function(s){return s.length>0&&e.__compiled__[s]}).map(cr).join("|");e.re.schema_test=RegExp(`(^|(?!_)(?:[><|]|${a.src_zpcc}))(${o})`,"i"),e.re.schema_search=regexp(`(^|(?!_)(?:[><|]|${a.src_zpcc}))(${o})`,"ig"),e.re.schema_at_start=regexp(`^${e.re.schema_search.source}`,"i"),e.re.pretest=regexp(`(${e.re.schema_test.source})|(${e.re.host_fuzzy_test.source})|@`,"i")}function Dn(e,A,t,n){const i=e.slice(t,n);this.schema=A.toLowerCase(),this.index=t,this.lastIndex=n,this.raw=i,this. z(e,A){if(!(this instanceof z))return new z(e,A);A||lr(e)&&(A=e,e={}),this.__opts__=KA({},Fn,A),this.__schemas__=KA({},ar,e),this.__compiled__={},this.__tlds__=hr,this.__tlds_replaced__=!1,this.re={},tA(this)}z.prototype.add=function(A,t){return this.__schemas__[A]=t,tA(this),this};z.prototype.set=function(A){return this.__opts__=KA(this.__opts__,A),this};z.prototype.test=function(A){if(!A.length)return!1;let t,n;if(this.re.schema_test.test(A)){for(n=this.re.schema_search,n.lastIndex=0;(t=n.exec(A))!==null;)if(this.testSchemaAt(A,t[2],n.lastIndex))return!0}return!!(this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&A.search(this.re.host_fuzzy_test)>=0&&A.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy)!==null||this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&A.indexOf("@")>=0&&A.match(this.re.email_fuzzy)!==null)};z.prototype.pretest=function(A){return this.re.pretest.test(A)};z.prototype.testSchemaAt=function(A,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(A,n,this):0};z.prototype.match=function(A){const t=[],n=[],i=[],r=[];let o,s,c;function l(g,h){return g?h?g.index!==h.index?g.index=h.lastIndex?g:h:g:h}if(!A.length)return null;if(this.re.schema_test.test(A))for(c=this.re.schema_search,c.lastIndex=0;(o=c.exec(A))!==null;)s=this.testSchemaAt(A,o[2],c.lastIndex),s&&n.push({schema:o[2],index:o.index+o[1].length,lastIndex:o.index+o[0].length+s});if(this.__opts__.fuzzyLink&&this.__compiled__["http:"])for(c=this.__opts__.fuzzyIP?this.re.link_fuzzy_global:this.re.link_no_ip_fuzzy_global,c.lastIndex=0;(o=c.exec(A))!==null;)i.push({schema:"",index:o.index+o[1].length,lastIndex:o.index+o[0].length});if(this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"])for(c=this.re.email_fuzzy_global,c.lastIndex=0;(o=c.exec(A))!==null;)r.push({schema:"mailto:",index:o.index+o[1].length,lastIndex:o.index+o[0].length});const a=[0,0,0];let u=0;for(;;){const g=[n[a[0]],r[a[1]],i[a[2]]],h=l(l(g[0],g[1]),g[2]);if(!h)break;if(h===g[0]?a[0]++:h===g[1]?a[1]++:a[2]++,h.index= 0x80 (not a basic code point)","invalid-input":"Invalid input"},mA=re-LA,oe=Math.floor,CA=String.fromCharCode;function fe(e){throw new RangeError(Ir[e])}function Br(e,A){const t=[];let n=e.length;for(;n--;)t[n]=A(e[n]);return t}function xn(e,A){const t=e.split("@");let n="";t.length>1&&(n=t[0]+"@",e=t[1]),e=e.replace(Cr,".");const i=e.split("."),r=Br(i,A).join(".");return n+r}function Qn(e){const A=[];let t=0;const n=e.length;for(;t=55296&&i<=56319&&tString.fromCodePoint(...e),kr=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:re},bt=function(e,a){return e+22+75*(e<26)-((a!=0)<<5)},sn=function(e,a,t){let n=0;for(e=t?oe(e/dr):e>>1,e+=oe(e/A);e>mA*He>>1;n+=re)e=oe(e/mA);return oe(n+(mA+1)*e/(e+gr))},Kn=function(e){const A=[],t=e.length;let n=0,i=En,r=yn,o=e.lastIndexOf(wn);o<0&&(o=0);for(let s=0;s=128&&fe("not-basic"),A.push(e.charCodeAt(s));for(let s=o>0?o+1:0;s=t&&fe("invalid-input");const g=kr(e.charCodeAt(s++));g>=re&&fe("invalid-input"),g>oe((we-n)/a)&&fe("overflow"),n+=g*a;const h=u<=r?la:u>=r+He?He:u-r;if(goe(we/f)&&fe("overflow"),a*=f}const l=A.length+1;r=Sn(n-c,l,c==0),oe(n/l)>we-i&&fe("overflow"),i+=oe(n/l),n%=l,A.splice(n++,0,i)}return String.fromCodePoint(...A)},Gn=function(e){const A=[];e=Qn(e);const t=e.length;let n=En,i=0,r=yn;for(const c of e)c<128&&a.push(ca(c));const o=A.length;let s=o;for(o&&A.push(wn);s=n&&aoe((we-i)/l)&&fe("overflow"),i+=(c-n)*l,n=c;for(const a of e)if(awe&&fe("overflow"),a===n){let u=i;for(let g=re;;g+=re){const h=g<=r?la:g>=r+He?He:g-r;if(uQr,asciiTrim:()=>lA,assign:()=>PA,escapeHtml:()=>ue,escapeRE:()=>Rr,fromCodePoint:()=>Ue,has:()=>xr,isMdAsciiPunct:()=>Te,isPromiseLike:()=>Le,isPunctChar:()=>Yn,isPunctCharCode:()=>Oe,isSpace:()=>J,isString:()=>Er,isValidEntityCode:()=>XA,isWhiteSpace:()=>ve,lib:()=>Mr,normalizeReference:()=>cA,unescapeAll:()=>Ge,unescapeMd:()=>Nr});function Er(e){return typeof e=="string"}const wr=Object.prototype.hasOwnProperty;function xr(e,A){return wr.call(e,A)}function PA(e,...A){for(const t of A)if(t){if(typeof t!="object")throw new TypeError("source must be object");Object.assign(e,t)}return e}function Qr(e,A,t){return e.slice(0,A).concat(t,e.slice(A+1))}function XA(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Ue(e){if(e>65535){e-=65536;const A=55296+(e>>10),t=56320+(e&1023);return String.fromCharCode(A,t)}return String.fromCharCode(e)}const Wn=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,Sr=new RegExp(`${Wn.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Kr=/^#(x[a-f0-9]{1,8}|\d{1,8})$/i;function Gr(e,A){if(A.charCodeAt(0)===35&&Kr.test(A)){const n=A[1].toLowerCase()==="x"?Number.parseInt(A.slice(2),16):Number.parseInt(A.slice(1),10);return XA(n)?Ue(n):e}const t=vi(e);return t!==e?t:e}function Nr(e){return e.includes("\\")?e.replace(Wn,"1ドル"):e}function Ge(e){return!e.includes("\\")&&!e.includes("&")?e:e.replace(Sr,(A,t,n)=>t||Gr(A,n))}const Wr=/[&"]/,Yr=/[&"]/g,_r={"&":"&","<":"<",">":">",'"':"""};function Jr(e){return _r[e]}function ue(e){return Wr.test(e)?e.replace(Yr,Jr):e}const Zr=/[.?*+^$[\]\\(){}|-]/g;function Rr(e){return e.replace(Zr,"\\$&")}function J(e){switch(e){case 9:case 32:return!0}return!1}function ve(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Yn(e){return TA.test(e)||bn.test(e)}function Oe(e){return Yn(Ue(e))}function Te(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function cA(e){return e=e.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}function bt(e){return e===32||e===9||e===10||e===13}function lA(e){let A=0;for(;A=A&&bt(e.charCodeAt(t));t--);return e.slice(A,t+1)}function Le(e){return typeof e?.then=="function"}const Mr={mdurl:Ar,ucmicro:nr};var ge=class{type;tag;attrs=null;map=null;nesting;level=0;children=null;content="";markup="";info="";meta=null;block=!1;hidden=!1;constructor(e,A,t){this.type=e,this.tag=A,this.nesting=t}attrIndex(e){if(!this.attrs)return-1;const A=this.attrs;for(let t=0,n=A.length;t=0&&(t=this.attrs[A][1]),t}attrJoin(e,A){const t=this.attrIndex(e);t<0?this.attrpush([e,a]):this.attrs[t][1]=`${this.attrs[t][1]} ${A}`}},Hr=class{src;md;env;tokens;bMarks=[];eMarks=[];tShift=[];sCount=[];bsCount=[];blkIndent=0;line=0;lineMax=0;tight=!1;ddIndent=-1;listIndent=-1;parentType="root";level=0;Token=ge;constructor(e,A,t,n){this.src="e,this.md=A,this.env=t,this.tokens=n;const" i=this.src,r=i.length;for(let o=0;o0&&this.level++,this.tokens.push(n),n}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let A=this.lineMax;eA;)if(!J(t.charCodeAt(--e)))return e+1;return e}skipChars(e,A){const t=this.src;for(let n=t.length;et;)if(A!==n.charCodeAt(--e))return e+1;return e}getLines(e,A,t,n){if(e>=A)return"";const i=new Array(A-e),r=this.src;for(let o=0,s=e;st?i[o]=" ".repeat(c-t)+this.src.slice(a,u):i[o]=this.src.slice(a,u)}return i.join("")}},Ur=class{src;env;tokens=[];inlineMode=!1;md;constructor(e,A,t){this.src=e,this.env=t,this.md=A}Token=ge},vr=class{src;env;md;tokens;tokens_meta;pos=0;posMax;level=0;pending="";pendingLevel=0;cache={};delimiters=[];_prev_delimiters=[];backticks={};backticksScanned=!1;linkLevel=0;constructor(e,A,t,n){this.src=e,this.env=t,this.md=A,this.tokens=n,this.tokens_meta=new Array(n.length),this.posMax=this.src.length}pushPending(){const e=new ge("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e}push(e,A,t){this.pending&&this.pushPending();const n=new ge(e,A,t);let i=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()??[]),n.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(n),this.tokens_meta.push(i),n}scanDelims(e,A){const t=this.src,n=this.posMax,i=t.charCodeAt(e);let r;if(e===0)r=32;else if(e===1)r=this.src.charCodeAt(0),(r&63488)===55296&&(r=65533);else if(r=this.src.charCodeAt(e-1),(r&64512)===56320){const d=this.src.charCodeAt(e-2);r=(d&64512)===55296?65536+(d-55296<<10)+(r-56320):65533}else(r&64512)===55296&&(r=65533);let o=e;for(;o=4||e.src.charCodeAt(i)!==62)return!1;if(n)return!0;const s=[],c=[],l=[],a=[],u=e.md.block.ruler.getRules("blockquote"),g=e.parentType;e.parentType="blockquote";let h=!1,f;for(f=A;f=r)break;if(e.src.charCodeAt(i++)===62&&!C){let k=e.sCount[f]+1,F,S;e.src.charCodeAt(i)===32?(i++,k++,S=!1,F=!0):e.src.charCodeAt(i)===9?(F=!0,(e.bsCount[f]+k)%4===3?(i++,k++,S=!1):S=!0):F=!1;let D=k;for(s.push(e.bMarks[f]),e.bMarks[f]=i;i=r,c.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(F?1:0),l.push(e.sCount[f]),e.sCount[f]=D-k,a.push(e.tShift[f]),e.tShift[f]=i-e.bMarks[f];continue}if(h)break;let B=!1;for(let k=0,F=u.length;k";const b=[A,0];m.map=b,e.md.block.tokenize(e,A,f);const I=e.push("blockquote_close","blockquote",-1);I.markup=">",e.lineMax=o,e.parentType=g,b[1]=e.line;for(let C=0;C=4){n++,i=n;continue}break}e.line=i;const r=e.push("code_block","code",0);return r.content=`${e.getLines(A,i,4+e.blkIndent,!1)} `,r.map=[A,e.line],!0}function Lr(e,A,t,n){let i=e.bMarks[A]+e.tShift[A],r=e.eMarks[A];if(e.sCount[A]-e.blkIndent>=4||i+3>r)return!1;const o=e.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let s=i;i=e.skipChars(i,o);let c=i-s;if(c<3)return!1;const l=e.src.slice(s,i),a=e.src.slice(i,r);if(o===96&&a.includes(String.fromCharCode(o)))return!1;if(n)return!0;let u=A,g=!1;for(;u++,!(u>=t||(i=s=e.bMarks[u]+e.tShift[u],r=e.eMarks[u],i=4)&&(i=e.skipChars(i,o),!(i-s=4)return!1;let o=e.src.charCodeAt(i);if(o!==35||i>=r)return!1;let s=1;for(o=e.src.charCodeAt(++i);o===35&&i6||ii&&J(e.src.charCodeAt(c-1))&&(r=c),e.line=A+1;const l=e.push("heading_open",`h${String(s)}`,1);l.markup="########".slice(0,s),l.map=[A,e.line];const a=e.push("inline","",0);a.content=lA(e.src.slice(i,r)),a.map=[A,e.line],a.children=[];const u=e.push("heading_close",`h${String(s)}`,-1);return u.markup="########".slice(0,s),!0}function Xr(e,A,t,n){const i=e.eMarks[A];if(e.sCount[A]-e.blkIndent>=4)return!1;let r=e.bMarks[A]+e.tShift[A];const o=e.src.charCodeAt(r++);if(o!==42&&o!==45&&o!==95)return!1;let s=1;for(;r\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Jn="<\\/[a-za-z][a-za-z0-9\\-]*\\s*>",jr=new RegExp(`^(?:${_n}|${Jn}||<\\?[\\s\\s]*?\\?>|]*>|)`),zr=new RegExp(`^(?:${_n}|${Jn})`),de=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${zr.source}\\s*$`),/^$/,!1]];function qr(e,A,t,n){let i=e.bMarks[A]+e.tShift[A],r=e.eMarks[A];if(e.sCount[A]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,r),s=0;for(;s=4)return!1;const i=e.parentType;e.parentType="paragraph";let r=0,o,s=A+1;for(;s3)continue;if(e.sCount[s]>=e.blkIndent){let h=e.bMarks[s]+e.tShift[s];const f=e.eMarks[s];if(h=f))){r=o===61?1:2;break}}if(e.sCount[s]<0)continue;let g=!1;for(let h=0,f=n.length;h=n)return-1;let r=e.src.charCodeAt(i++);if(r<48||r>57)return-1;for(;;){if(i>=n)return-1;if(r=e.src.charCodeAt(i++),r>=48&&r<=57){if(i-t>=10)return-1;continue}if(r===41||r===46)break;return-1}return i=4||e.listIndent>=0&&e.sCount[c]-e.listIndent>=4&&e.sCount[c]=e.blkIndent&&(a=!0);let u,g,h=Ft(e,c);if(h>=0){if(u=!0,o=e.bMarks[c]+e.tShift[c],g=Number(e.src.slice(o,h-1)),a&&g!==1)return!1}else if(h=kt(e,c),h>=0)u=!1;else return!1;if(a&&e.skipSpaces(h)>=e.eMarks[c])return!1;if(n)return!0;const f=e.src.charCodeAt(h-1),d=e.tokens.length;u?(s=e.push("ordered_list_open","ol",1),g!==1&&(s.attrs=[["start",g.toString()]])):s=e.push("bullet_list_open","ul",1);const m=[c,0];s.map=m,s.markup=String.fromCharCode(f);let b=!1;const I=e.md.block.ruler.getRules("list"),C=e.parentType;for(e.parentType="list";c=i?S=1:S=k-B,S>4&&(S=1);const D=B+S;s=e.push("list_item_open","li",1),s.markup=String.fromCharCode(f);const _=[c,0];s.map=_,u&&(s.info=e.src.slice(o,h-1));const E=e.tight,G=e.tShift[c],w=e.sCount[c],Q=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=D,e.tight=!0,e.tShift[c]=F-e.bMarks[c],e.sCount[c]=k,F>=i&&e.isEmpty(c+1)?e.line=Math.min(e.line+2,t):e.md.block.tokenize(e,c,t,!0),(!e.tight||b)&&(l=!1),b=e.line-c>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Q,e.tShift[c]=G,e.sCount[c]=w,e.tight=E,s=e.push("list_item_close","li",-1),s.markup=String.fromCharCode(f),c=e.line,_[1]=c,c>=t||e.sCount[c]=4)break;let q=!1;for(let te=0,rt=I.length;te3||e.sCount[r]<0)continue;let l=!1;for(let a=0,u=n.length;a=4||e.src.charCodeAt(i)!==91)return!1;function s(C){const B=e.lineMax;if(C>=B||e.isEmpty(C))return null;let k=!1;if(e.sCount[C]-e.blkIndent>3&&(k=!0),e.sCount[C]<0&&(k=!0),!k){const D=e.md.block.ruler.getRules("reference"),_=e.parentType;e.parentType="reference";let E=!1;for(let G=0,w=D.length;G"u"&&(e.env.references={}),typeof e.env.references[b]>"u"&&(e.env.references[b]={title:m,href:u}),e.line=o;const I=e.push("reference","",0);return I.map=[A,e.line],I.info=b,I.meta={title:m,href:u},!0}const io=65536;function IA(e,A){const t=e.bMarks[A]+e.tShift[A],n=e.eMarks[A];return e.src.slice(t,n)}function Dt(e){const A=[],t=e.length;let n=0,i=e.charCodeAt(n),r=!1,o=0,s="";for(;nt)return!1;let i=A+1;if(e.sCount[i]=4)return!1;let r=e.bMarks[i]+e.tShift[i];if(r>=e.eMarks[i])return!1;const o=e.src.charCodeAt(r++);if(o!==124&&o!==45&&o!==58||r>=e.eMarks[i])return!1;const s=e.src.charCodeAt(r++);if(s!==124&&s!==45&&s!==58&&!J(s)||o===45&&J(s))return!1;for(;r=4)return!1;l=Dt(c),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const u=l.length;if(u===0||u!==a.length)return!1;if(n)return!0;const g=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),f=e.push("table_open","table",1),d=[A,0];f.map=d;const m=e.push("thead_open","thead",1);m.map=[A,A+1];const b=e.push("tr_open","tr",1);b.map=[A,A+1];for(let B=0;B=4||(l=Dt(c),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),C+=u-l.length,C>io))break;if(i===A+2){const F=e.push("tbody_open","tbody",1);F.map=I=[A+2,0]}const k=e.push("tr_open","tr",1);k.map=[i,i+1];for(let F=0;F=t||e.sCount[s]=o){e.line=t;break}const l=e.line;let a=!1;for(let u=0;u=e.line)throw new Error("block rule didn't increment state.line");break}if(!a)throw new Error("none of the block rules matched");e.tight=!c,e.isEmpty(e.line-1)&&(c=!0),s=e.line,s\s]/i.test(e)}function ao(e){return/^<\/a\s*>/i.test(e)}function uo(e){if(!e.md.options.linkify)return;const A=e.tokens,t=e.md.linkify;for(let n=0,i=A.length;n=0;s--){const c=r[s];if(c.type==="link_close"){for(s--;r[s].level!==c.level&&r[s].type!=="link_open";)s--;continue}if(c.type==="html_inline"&&(lo(c.content)&&o>0&&o--,ao(c.content)&&o++),!(o>0)&&c.type==="text"){const l=c.content;if(!t.pretest(l))continue;const a=t.match(l);if(!a?.length)continue;const u=[];let g=c.level,h=0;const f=a[0].index===0&&s>0&&r[s-1].type==="text_special"?1:0;for(let d=f;dh){const S=new e.Token("text","",0);S.content=l.slice(h,C),S.level=g,u.push(S)}const B=new e.Token("link_open","a",1);B.attrs=[["href",b]],B.level=g++,B.markup="linkify",B.info="auto",u.push(B);const k=new e.Token("text","",0);k.content=I,k.level=g,u.push(k);const F=new e.Token("link_close","a",-1);F.level=--g,F.markup="linkify",F.info="auto",u.push(F),h=m.lastIndex}if(h=0;t--){const n=e[t];n.type==="text"&&!A&&(n.content=n.content.replace(mo,Io)),n.type==="link_open"&&n.info==="auto"&&A--,n.type==="link_close"&&n.info==="auto"&&A++}}function bo(e){let A=0;for(let t=e.length-1;t>=0;t--){const n=e[t];n.type==="text"&&!A&&Zn.test(n.content)&&(n.content=n.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"...").replace(/([?!]).../g,"1ドル..").replace(/([?!]){4,}/g,"1ドル1ドル1ドル").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"1ドル—").replace(/(^|\s)--(?=\s|$)/gm,"1ドル–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"1ドル–")),n.type==="link_open"&&n.info==="auto"&&A--,n.type==="link_close"&&n.info==="auto"&&A++}}function ko(e){let A;if(e.md.options.typographer)for(A=e.tokens.length-1;A>=0;A--)e.tokens[A].type==="inline"&&(po.test(e.tokens[A].content)&&Bo(e.tokens[A].children),Zn.test(e.tokens[A].content)&&bo(e.tokens[A].children))}const Fo=/['"]/,yt=/['"]/g,Et="’";function Ve(e,A,t,n){e[A]||(e[A]=[]),e[A].push({pos:t,ch:n})}function Do(e,A){let t="",n=0;A.sort((i,r)=>i.pos-r.pos);for(let i=0;i=0&&!(n[t].level<=s);t--);if(n.length=t+1,o.type!=="text")continue;const c=o.content;let l=0;const a=c.length;e:for(;l=0)d=c.charCodeAt(u.index-1);else for(t=r-1;t>=0&&!(e[t].type==="softbreak"||e[t].type==="hardbreak");t--)if(e[t].content){d=e[t].content.charCodeAt(e[t].content.length-1);break}let m=32;if(l=48&&d<=57&&(h=g=!1),g&&h&&(g=b,h=i),!g&&!h){f&&ve(i,r,u.index,et);continue}if(h)for(t=n.length-1;t>=0;t--){let k=n[t];if(n[t].level{e[r].content=Do(e[r].content,i[r])})}function Eo(e){if(e.md.options.typographer)for(let A=e.tokens.length-1;A>=0;A--)e.tokens[A].type!=="inline"||!Fo.test(e.tokens[A].content)||yo(e.tokens[A].children,e)}function wo(e){let A,t;const n=e.tokens,i=n.length;for(let r=0;r32))return r;if(n===41){if(o===0)break;o--}i++}return A===i||o!==0||(r.str=Ge(e.slice(A,i)),r.pos=i,r.ok=!0),r}function So(e,A,t=!1){let n,i=!1,r,o;const s=e.posMax,c=e.pos;for(e.pos=A+1,n=1;e.pos=t)return o;let s=e.charCodeAt(r);if(s!==34&&s!==39&&s!==40)return o;A++,r++,s===40&&(s=41),o.marker=s}for(;r\x00-\x20]*)$/i;function Yo(e,A){let t=e.pos;if(e.src.charCodeAt(t)!==60)return!1;const n=e.pos,i=e.posMax;for(;;){if(++t>=i)return!1;const o=e.src.charCodeAt(t);if(o===60)return!1;if(o===62)break}const r=e.src.slice(n+1,t);if(Wo.test(r)){const o=e.md.normalizeLink(r);if(!e.md.validateLink(o))return!1;if(!A){const s=e.push("link_open","a",1);s.attrs=[["href",o]],s.markup="autolink",s.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=r.length+2,!0}if(No.test(r)){const o=e.md.normalizeLink(`mailto:${r}`);if(!e.md.validateLink(o))return!1;if(!A){const s=e.push("link_open","a",1);s.attrs=[["href",o]],s.markup="autolink",s.info="auto";const c=e.push("text","",0);c.content=e.md.normalizeLinkText(r);const l=e.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return e.pos+=r.length+2,!0}return!1}function _o(e,A){let t=e.pos;const n=e.src;if(n.charCodeAt(t)!==96)return!1;const i=t;t++;const r=e.posMax;for(;tc;l-=r[l]+1){const u=e[l];if(u.marker===s.marker&&u.open&&u.end<0){let g=!1;if((u.close||s.open)&&(u.length+s.length)%3===0&&(u.length%3!==0||s.length%3!==0)&&(g=!0),!g){const h=l>0&&!e[l-1].open?r[l-1]+1:0;r[o]=o-l+h,r[l]=h,s.open=!1,u.end=o,u.close=!1,a=-1,i=-2;break}}}a!==-1&&(A[s.marker][(s.open?3:0)+(s.length||0)%3]=a)}}function Jo(e){const A=e.tokens_meta,t=e.tokens_meta.length;wt(e.delimiters);for(let n=0;n=0;n--){const i=A[n];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const r=A[i.end],o=n>0&&A[n-1].end===i.end+1&&A[n-1].marker===i.marker&&A[n-1].token===i.token-1&&A[i.end+1].token===r.token+1,s=String.fromCharCode(i.marker),c=e.tokens[i.token];c.type=o?"strong_open":"em_open",c.tag=o?"strong":"em",c.nesting=1,c.markup=o?s+s:s,c.content="";const l=e.tokens[r.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?s+s:s,l.content="",o&&(e.tokens[A[n-1].token].content="",e.tokens[A[i.end+1].token].content="",n--)}}function Ro(e){const A=e.tokens_meta,t=e.tokens_meta.length;xt(e,e.delimiters);for(let n=0;n=n)return!1;if(e.src.charCodeAt(t+1)===35){const i=e.src.slice(t).match(Mo);if(i){if(!A){const r=i[1][0].toLowerCase()==="x"?Number.parseInt(i[1].slice(1),16):Number.parseInt(i[1],10),o=e.push("text_special","",0);o.content=XA(r)?Ue(r):Ue(65533),o.markup=i[0],o.info="entity"}return e.pos+=i[0].length,!0}}else{const i=e.src.slice(t).match(Ho);if(i){const r=Oi(i[0]);if(r!==i[0]){if(!A){const o=e.push("text_special","",0);o.content=r,o.markup=i[0],o.info="entity"}return e.pos+=i[0].length,!0}}}return!1}const VA=[];for(let e=0;e<256;e++)va.push(0);for(const e of"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split(""))VA[e.charCodeAt(0)]=1;function vo(e,A){let t=e.pos;const n=e.posMax;if(e.src.charCodeAt(t)!==92||(t++,t>=n))return!1;let i=e.src.charCodeAt(t);if(i===10){for(A||e.push("hardbreak","br",0),t++;t=55296&&i<=56319&&t+1=56320&&s<=57343&&(r+=e.src[t+1],t++)}const o=`\\${r}`;if(!A){const s=e.push("text_special","",0);i<256&&va[i]!==0?s.content=r:s.content=o,s.markup=o,s.info="escape"}return e.pos=t+1,!0}function Oo(e){let A,t,n=0;const i=e.tokens,r=e.tokens.length;for(A=t=0;A0&&n++,i[A].type==="text"&&A+1\s]/i.test(e)}function Lo(e){return/^<\/a\s*>/i.test(e)}function Po(e){const A=e|32;return A>=97&&A<=122}function Xo(e,A){if(!e.md.options.html)return!1;const t=e.posMax,n=e.pos;if(e.src.charCodeAt(n)!==60||n+2>=t)return!1;const i=e.src.charCodeAt(n+1);if(i!==33&&i!==63&&i!==47&&!Po(i))return!1;const r=e.src.slice(n).match(jr);if(!r)return!1;if(!A){const o=e.push("html_inline","",0);o.content=r[0],To(o.content)&&e.linkLevel++,Lo(o.content)&&e.linkLevel--}return e.pos+=r[0].length,!0}function Vo(e,A){let t,n,i,r,o,s,c,l,a="";const u=e.pos,g=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if(r=f+1,r=g)return!1;for(l=r,s=e.md.helpers.parseLinkDestination(e.src,r,e.posMax),s.ok&&(a=e.md.normalizeLink(s.str),e.md.validateLink(a)?r=s.pos:a=""),l=r;r=g||e.src.charCodeAt(r)!==41)return e.pos=u,!1;r++}else{if(typeof e.env.references>"u")return!1;if(r=0?i=e.src.slice(l,r++):r=f+1):r=f+1,i||(i=e.src.slice(h,f)),o=e.env.references[cA(i)],!o)return e.pos=u,!1;a=o.href,c=o.title}if(!A){n=e.src.slice(h,f);const d=[];e.md.inline.parse(n,e.md,e.env,d);const m=e.push("image","img",0),b=[["src",a],["alt",""]];m.attrs=b,m.children=d,m.content=n,c&&b.push(["title",c])}return e.pos=r,e.posMax=g,!0}function jo(e,A){let t,n,i,r,o="",s="",c=e.pos,l=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const a=e.pos,u=e.posMax,g=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let f=h+1;if(f=u)return!1;if(c=f,i=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),i.ok){for(o=e.md.normalizeLink(i.str),e.md.validateLink(o)?f=i.pos:o="",c=f;f=u||e.src.charCodeAt(f)!==41)&&(l=!0),f++}if(l){if(typeof e.env.references>"u")return!1;if(f=0?n=e.src.slice(c,f++):f=h+1):f=h+1,n||(n=e.src.slice(g,h)),r=e.env.references[cA(n)],!r)return e.pos=a,!1;o=r.href,s=r.title}if(!A){e.pos=g,e.posMax=h;const d=e.push("link_open","a",1),m=[["href",o]];d.attrs=m,s&&m.push(["title",s]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=u,!0}const zo=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function qo(e,A){if(!e.md.options.linkify||e.linkLevel>0)return!1;const t=e.pos,n=e.posMax;if(t+3>n||e.src.charCodeAt(t)!==58||e.src.charCodeAt(t+1)!==47||e.src.charCodeAt(t+2)!==47)return!1;const i=e.pending.match(zo);if(!i)return!1;const r=i[1],o=e.md.linkify.matchAtStart(e.src.slice(t-r.length));if(!o)return!1;let s=o.url;if(s.length<=r.length)return!1;let c=s.length;for(;c>0&&s.charCodeAt(c-1)===42;)c--;c!==s.length&&(s=s.slice(0,c));const l=e.md.normalizeLink(s);if(!e.md.validateLink(l))return!1;if(!A){e.pending=e.pending.slice(0,-r.length);const a=e.push("link_open","a",1);a.attrs=[["href",l]],a.markup="linkify",a.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(s);const g=e.push("link_close","a",-1);g.markup="linkify",g.info="auto"}return e.pos+=s.length-r.length,!0}function $o(e,A){let t=e.pos;if(e.src.charCodeAt(t)!==10)return!1;const n=e.pending.length-1,i=e.posMax;if(!A)if(n>=0&&e.pending.charCodeAt(n)===32)if(n>=1&&e.pending.charCodeAt(n-1)===32){let r=n-1;for(;r>=1&&e.pending.charCodeAt(r-1)===32;)r--;e.pending=e.pending.slice(0,r),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(t++;t=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,r[A]=e.pos}tokenize(e){const A=this.ruler.getRules(""),t=A.length,n=e.posMax,i=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(e.pos>=n)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,A,t,n){const i=new this.State(e,A,t,n);this.tokenize(i);const r=this.ruler2.getRules(""),o=r.length;for(let s=0;s${ue(r.content)}`};Ae.code_block=function(e,A,t,n,i){const r=e[A];return`${ue(e[A].content)} `};Ae.fence=function(e,A,t,n,i){const r=e[A],o=r.info?Ge(r.info).trim():"";let s="",c="";if(o){const g=o.split(/(\s+)/g);s=g[0],c=g.slice(2).join("")}function l(g){if(g.indexOf("${g} `}return`
${g}
`}const u=(()=>{if(!t.highlight)return ue(r.content);const g=t.highlight(r.content,s,c,n);return Le(g)?g.then(h=>h||ue(r.content)):g||ue(r.content)})();return Le(u)?u.then(l):l(u)};Ae.image=function(e,A,t,n,i){const r=e[A];return r.attrs[r.attrIndex("alt")][1]=i.renderInlineAsText(r.children,t,n),i.renderToken(e,A,t)};Ae.hardbreak=function(e,A,t){return t.xhtmlOut?`
`:`
`};Ae.softbreak=function(e,A,t){return t.breaks?t.xhtmlOut?`
`:`
`:` `};Ae.text=function(e,A){return ue(e[A].content)};Ae.html_block=function(e,A){return e[A].content};Ae.html_inline=function(e,A){return e[A].content};Ae.reference=function(e,A){return e[A].content};var ms=class{rules=PA({},Ae);constructor(){}renderAttrs(e){const A=e.attrs;if(!A)return"";const t=A.length;if(t===0)return"";let n="";for(let i=0;i `:">",r}renderInline(e,A,t={}){let n="";const i=this.rules;for(let r=0,o=e.length;r!t.includes(i));if(n.length&&!A)throw new Error(`MarkdownExit. Failed to enable unknown rule(s): ${n}`);return this}disable(e,A){let t=[];Array.isArray(e)||(e=[e]);for(const i of["core","block","inline"])t=t.concat(this[i].ruler.disable(e,!0));t=t.concat(this.inline.ruler2.disable(e,!0));const n=e.filter(i=>!t.includes(i));if(n.length&&!A)throw new Error(`MarkdownExit. Failed to disable unknown rule(s): ${n}`);return this}use(e,...A){return e.apply(e,[this,...A]),this}render(e,A={}){return this.renderer.render(this.parse(e,A),this.options,A)}renderAsync(e,A={}){return this.renderer.renderAsync(this.parse(e,A),this.options,A)}renderInline(e,A={}){return this.renderer.render(this.parseInline(e,A),this.options,A)}renderInlineAsync(e,A={}){return this.renderer.renderAsync(this.parseInline(e,A),this.options,A)}};function Cs(e){function A(...t){return new e(...t)}return Object.setPrototypeOf(A,GA),A.prototype=GA.prototype,A.prototype.constructor=A,A}const Is=Cs(GA);var Bs=Is;function bs(e){let A=Promise.resolve(null);return(...t)=>(A=A.then(()=>e(...t)).catch(()=>null),A)}function ks(e){const A=new Set,t=[];for(const n of e)A.has(n.name)||(A.add(n.name),t.push(n));return t}function vn(e,A){if(e[A]!=="[")return-1;let t=A+1,n=0;for(;tString(t)),representTagName:A.representTagName??(()=>e)}}function jA(e,A){const t=A.finalize===void 0;return{tagName:e,nodeKind:"sequence",implicit:!1,matchByTagPrefix:A.matchByTagPrefix??!1,create:A.create,addItem:A.addItem,finalize:A.finalize??(n=>n),carrierIsResult:t,identify:A.identify,represent:A.represent??(n=>n),representTagName:A.representTagName??(()=>e)}}function aA(e,A){const t=A.finalize===void 0;return{tagName:e,nodeKind:"mapping",implicit:!1,matchByTagPrefix:A.matchByTagPrefix??!1,create:A.create,addPair:A.addPair,has:A.has,keys:A.keys,get:A.get,finalize:A.finalize??(n=>n),carrierIsResult:t,identify:A.identify,represent:A.represent??(n=>n),representTagName:A.representTagName??(()=>e)}}var Fs=P("tag:yaml.org,2002:str",{resolve:e=>e,identify:e=>typeof e=="string"}),Ds=["","~","null","Null","NULL"],ys=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>Ds.indexOf(e)!==-1?null:N,identify:e=>e===null,represent:()=>"null"}),Es=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["n"],resolve:(e,A)=>e==="null"||A&&e===""?null:N,identify:e=>e===null,represent:()=>"null"}),ws=["","~","null","Null","NULL"],xs=P("tag:yaml.org,2002:null",{implicit:!0,implicitFirstChars:["","~","n","N"],resolve:e=>ws.indexOf(e)!==-1?null:N,identify:e=>e===null,represent:()=>"null"}),Qs=["true","True","TRUE"],Ss=["false","False","FALSE"],Ks=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","T","f","F"],resolve:e=>Qs.indexOf(e)!==-1?!0:Ss.indexOf(e)!==-1?!1:N,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Gs=["true"],Ns=["false"],Ws=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["t","f"],resolve:e=>Gs.indexOf(e)!==-1?!0:Ns.indexOf(e)!==-1?!1:N,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Ys=["true","True","TRUE","y","Y","yes","Yes","YES","on","On","ON"],_s=["false","False","FALSE","n","N","no","No","NO","off","Off","OFF"],Js=P("tag:yaml.org,2002:bool",{implicit:!0,implicitFirstChars:["y","Y","n","N","t","T","f","F","o","O"],resolve:e=>Ys.indexOf(e)!==-1?!0:_s.indexOf(e)!==-1?!1:N,identify:e=>Object.prototype.toString.call(e)==="[object Boolean]",represent:e=>e?"true":"false"}),Zs=new RegExp("^(?:0o[0-7]+|0x[0-9a-fA-F]+|[-+]?[0-9]+)$"),Rs=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Ms(e){let A=e,t=1;return(A[0]==="-"||A[0]==="+")&&(A[0]==="-"&&(t=-1),A=A.slice(1)),A.startsWith("0b")?t*parseInt(A.slice(2),2):A.startsWith("0o")?t*parseInt(A.slice(2),8):A.startsWith("0x")?t*parseInt(A.slice(2),16):t*parseInt(A,10)}function Hs(e,A){if(A){if(!Rs.test(e))return N}else if(!Zs.test(e))return N;const t=Ms(e);return Number.isFinite(t)?t:N}var Tn=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Hs,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),Us=new RegExp("^-?(?:0|[1-9][0-9]*)$"),vs=new RegExp("^(?:[-+]?0b[0-1]+|[-+]?0o[0-7]+|[-+]?0x[0-9a-fA-F]+|[-+]?[0-9]+)$");function Os(e){let A=e,t=1;return(A[0]==="-"||A[0]==="+")&&(A[0]==="-"&&(t=-1),A=A.slice(1)),A.startsWith("0b")?t*parseInt(A.slice(2),2):A.startsWith("0o")?t*parseInt(A.slice(2),8):A.startsWith("0x")?t*parseInt(A.slice(2),16):t*parseInt(A,10)}function Ts(e,A){if(A){if(!vs.test(e))return N}else if(!Us.test(e))return N;const t=Os(e);return Number.isFinite(t)?t:N}var Ls=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:Ts,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),Ps=new RegExp("^(?:[-+]?0b[0-1_]+|[-+]?0[0-7_]+|[-+]?0x[0-9a-fA-F_]+|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+|[-+]?(?:0|[1-9][0-9_]*))$");function Xs(e){let A=e.replace(/_/g,""),t=1;if((A[0]==="-"||A[0]==="+")&&(A[0]==="-"&&(t=-1),A=A.slice(1)),A.startsWith("0b"))return t*parseInt(A.slice(2),2);if(A.startsWith("0x"))return t*parseInt(A.slice(2),16);if(A.includes(":")){let n=0;for(const i of A.split(":"))n=n*60+Number(i);return t*n}return A!=="0"&&A[0]==="0"?t*parseInt(A,8):t*parseInt(A,10)}function Vs(e){if(!Ps.test(e))return N;const A=Xs(e);return Number.isFinite(A)?A:N}var NA=P("tag:yaml.org,2002:int",{implicit:!0,implicitFirstChars:["-","+",..."0123456789"],resolve:Vs,identify:e=>Number.isInteger(e)&&!Object.is(e,-0)&&e.toString(10).indexOf("e")<0,represent:e=>e.toString(10)}),js=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),zs=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function qs(e){if(!js.test(e))return N;let A=e.toLowerCase();const t=A[0]==="-"?-1:1;if("+-".includes(A[0])&&(A=A.slice(1)),A===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(A===".nan")return NaN;const n=t*parseFloat(A);return Number.isFinite(n)||zs.test(e)?n:N}function $s(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const A=e.toString(10);return/^[-+]?[0-9]+e/.test(A)?A.replace("e",".e"):A}var Ln=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:qs,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:$s}),ec=new RegExp("^-?(?:0|[1-9][0-9]*)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$"),Ac=new RegExp("^(?:[-+]?[0-9]+(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|[-+]?\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function tc(e,A){if(A){if(!Ac.test(e))return N;let n=e.toLowerCase();const i=n[0]==="-"?-1:1;if("+-".includes(n[0])&&(n=n.slice(1)),n===".inf")return i===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(n===".nan")return NaN;const r=i*parseFloat(n);return Number.isFinite(r)?r:N}if(!ec.test(e))return N;const t=Number(e);return Number.isFinite(t)?t:N}function nc(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const A=e.toString(10);return/^[-+]?[0-9]+e/.test(A)?A.replace("e",".e"):A}var ic=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-",..."0123456789"],resolve:tc,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:nc}),rc=new RegExp("^(?:[-+]?(?:(?:[0-9][0-9_]*)?\\.[0-9_]*)(?:[eE][-+][0-9]+)?|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),oc=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function sc(e){if(!rc.test(e))return N;let A=e.toLowerCase().replace(/_/g,"");const t=A[0]==="-"?-1:1;if("+-".includes(A[0])&&(A=A.slice(1)),A===".inf")return t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;if(A===".nan")return NaN;let n=0;if(A.includes(":")){for(const i of A.split(":"))n=n*60+Number(i);n*=t}else n=t*parseFloat(A);return Number.isFinite(n)||oc.test(e)?n:N}function cc(e){if(isNaN(e))return".nan";if(e===Number.POSITIVE_INFINITY)return".inf";if(e===Number.NEGATIVE_INFINITY)return"-.inf";if(Object.is(e,-0))return"-0.0";const A=e.toString(10);return/^[-+]?[0-9]+e/.test(A)?A.replace("e",".e"):A}var WA=P("tag:yaml.org,2002:float",{implicit:!0,implicitFirstChars:["-","+",".",..."0123456789"],resolve:sc,identify:e=>typeof e=="number"&&(!Number.isInteger(e)||Object.is(e,-0)||e.toString(10).indexOf("e")>=0),represent:cc}),lc=P("tag:yaml.org,2002:merge",{implicit:!0,implicitFirstChars:["<"],resolve:(e,a)=>e==="<<"||a&&e===""?"<<":n,identify:()=>!1}),ac=/^[A-Za-z0-9+/]*={0,2}$/;function uc(e){const A=e.replace(/\s/g,"");if(A.length%4!==0||!ac.test(A))return N;const t=atob(A),n=new Uint8Array(t.length);for(let i=0;iObject.prototype.toString.call(e)==="[object Uint8Array]",represent:hc}),gc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),dc=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function Kt(e,A,t,n=0,i=0,r=0,o=0){const s=new Date(Date.UTC(e,A,t,n,i,r,o));return s.setUTCFullYear(e,A,t),s}function pc(e){let A=gc.exec(e);if(A===null&&(A=dc.exec(e)),A===null)return N;const t=+A[1],n=+A[2]-1,i=+A[3];if(!A[4]){const a=Kt(t,n,i);return a.getUTCFullYear()!==t||a.getUTCMonth()!==n||a.getUTCDate()!==i?N:a}const r=+A[4],o=+A[5],s=+A[6];let c=0;if(r>23||o>59||s>59)return N;if(A[7]){let a=A[7].slice(0,3);for(;a.length<3;)a+="0";c=+a}const l=Kt(t,n,i,r,o,s,c);if(l.getUTCFullYear()!==t||l.getUTCMonth()!==n||l.getUTCDate()!==i)return N;if(A[9]){const a=+A[10],u=+(A[11]||0);if(a>23||u>59)return N;const g=(a*60+u)*6e4;l.setTime(l.getTime()-(A[9]==="-"?-g:g))}return l}var mc=P("tag:yaml.org,2002:timestamp",{implicit:!0,implicitFirstChars:[..."0123456789"],resolve:pc,identify:e=>e instanceof Date,represent:e=>e.toISOString()}),Cc=jA("tag:yaml.org,2002:seq",{create:()=>[],addItem:(e,A)=>{e.push(A)},identify:Array.isArray});function uA(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;const A=Object.getPrototypeOf(e);return A===null||A===Object.prototype}function Gt(e,A){const t={};for(const n of A)e[n]!==void 0&&(t[n]=e[n]);return t}var Ic=jA("tag:yaml.org,2002:omap",{create:()=>({list:[],seen:new Set}),addItem:(e,A)=>{let t;if(A instanceof Map){if(A.size!==1)return"cannot resolve an ordered map item";t=A.keys().next().value}else if(uA(A)){const n=Object.keys(A);if(n.length!==1)return"cannot resolve an ordered map item";t=n[0]}else return"cannot resolve an ordered map item";return e.seen.has(t)?"duplicate key in ordered map":(e.seen.add(t),e.list.push(A),"")},finalize:e=>e.list,identify:()=>!1}),Bc=jA("tag:yaml.org,2002:pairs",{create:()=>[],addItem:(e,A)=>{if(A instanceof Map)return A.size!==1?"cannot resolve a pairs item":(e.push(A.entries().next().value),"");if(Object.prototype.toString.call(A)!=="[object Object]")return"cannot resolve a pairs item";const t=A,n=Object.keys(t);return n.length!==1?"cannot resolve a pairs item":(e.push([n[0],t[n[0]]]),"")},identify:()=>!1}),bc=aA("tag:yaml.org,2002:map",{create:()=>({}),identify:uA,represent:e=>{const A=new Map;for(const t of Object.keys(e))A.set(t,e[t]);return A},addPair:(e,A,t)=>{if(A!==null&&typeof A=="object")return"object-based map does not support complex keys";const n=String(A);return n==="__proto__"?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,""},has:(e,A)=>A!==null&&typeof A=="object"?!1:Object.prototype.hasOwnProperty.call(e,String(A)),keys:e=>Object.keys(e),get:(e,A)=>{const t=String(A);return Object.prototype.hasOwnProperty.call(e,t)?e[t]:null}}),kc=aA("tag:yaml.org,2002:set",{create:()=>new Set,identify:e=>e instanceof Set,represent:e=>{const A=new Map;for(const t of e)A.set(t,null);return A},addPair:(e,A,t)=>t!==null?"cannot resolve a set item":(e.add(A),""),has:(e,A)=>e.has(A),keys:e=>e.keys(),get:()=>null});function Fc(){return{scalar:Object.create(null),sequence:Object.create(null),mapping:Object.create(null)}}function Dc(){return{scalar:[],sequence:[],mapping:[]}}function yc(e){const A=[];for(const t of e){let n=A.length;for(let i=0;ia.implicitFirstChars===null),s=new Set;for(const a of n)if(a.implicitFirstChars!==null)for(const u of a.implicitFirstChars)s.add(u);const c=new Map;for(const a of s)c.set(a,n.filter(u=>u.implicitFirstChars===null||u.implicitFirstChars.indexOf(a)!==-1));const l=i.scalar["tag:yaml.org,2002:str"];if(!l)throw new Error("schema does not define the default scalar tag (tag:yaml.org,2002:str)");this.tags=t,this.implicitScalarTags=n,this.implicitScalarByFirstChar=c,this.implicitScalarAnyFirstChar=o,this.defaultScalarTag=l,this.defaultSequenceTag=i.sequence["tag:yaml.org,2002:seq"],this.defaultMappingTag=i.mapping["tag:yaml.org,2002:map"],this.exact=i,this.prefix=r}lookupScalarTag(A){const t=this.exact.scalar[A];if(t)return t;for(const n of this.prefix.scalar)if(A.startsWith(n.tagName))return n}lookupSequenceTag(A){const t=this.exact.sequence[A];if(t)return t;for(const n of this.prefix.sequence)if(A.startsWith(n.tagName))return n}lookupMappingTag(A){const t=this.exact.mapping[A];if(t)return t;for(const n of this.prefix.mapping)if(A.startsWith(n.tagName))return n}resolveImplicitScalarTag(A){const t=this.implicitScalarByFirstChar.get(A.charAt(0))??this.implicitScalarAnyFirstChar;for(const i of t){const r=i.resolve(A,!1,i.tagName);if(r!==N)return{value:r,tag:i}}const n=this.defaultScalarTag;return{value:n.resolve(A,!1,n.tagName),tag:n}}withTags(...A){let t=[];for(const n of A)t=t.concat(n);return new Pn([...this.tags,...t])}},zA=new hA([Fs,Cc,bc]),Ec=new hA([...zA.tags,Es,Ws,Ls,ic]),wc=new hA([...zA.tags,ys,Ks,Tn,Ln]),xc=new hA([...zA.tags,xs,Js,NA,WA,mc,lc,fc,Ic,Bc,kc]);xc.withTags({...NA,resolve:(e,A,t)=>{const n=NA.resolve(e,A,t);return n===N?Tn.resolve(e,A,t):n}},{...WA,resolve:(e,A,t)=>{const n=WA.resolve(e,A,t);return n===N?Ln.resolve(e,A,t):n}});aA("tag:yaml.org,2002:map",{create:()=>new Map,addPair:(e,A,t)=>(e.set(A,t),""),has:(e,A)=>e.has(A),keys:e=>e.keys(),get:(e,A)=>e.get(A),identify:e=>e instanceof Map||uA(e),represent:e=>{if(e instanceof Map)return e;const A=new Map,t=e;for(const n of Object.keys(t))A.set(n,t[n]);return A}});function Nt(e){if(Array.isArray(e)){const A=Array.prototype.slice.call(e);for(let t=0;t({}),identify:uA,represent:e=>{const A=new Map;for(const t of Object.keys(e))A.set(t,e[t]);return A},addPair:(e,A,t)=>{const n=Nt(A);return n===null?"nested arrays are not supported inside keys":(n==="__proto__"?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,"")},has:(e,A)=>{const t=Nt(A);return t!==null&&Object.prototype.hasOwnProperty.call(e,t)},keys:e=>Object.keys(e),get:(e,A)=>{const t=String(A);return Object.prototype.hasOwnProperty.call(e,t)?e[t]:null}});var Qc={maxLength:79,indent:1,linesBefore:3,linesAfter:2};function FA(e,A,t,n,i){let r="",o="";const s=Math.floor(i/2)-1;return n-A>s&&(r=" ... ",A=n-s+r.length),t-n>s&&(o=" ...",t=n+s-o.length),{str:r+e.slice(A,t).replace(/\t/g,"→")+o,pos:n-A+r.length}}function DA(e,A){return" ".repeat(Math.max(A-e.length,0))+e}function Sc(e,A){if(!e.buffer)return null;const t={...Qc,...A},n=/\r?\n|\r|0円/g,i=[0],r=[];let o,s=-1;for(;o=n.exec(e.buffer);)r.push(o.index),i.push(o.index+o[0].length),e.position<=o.index&&s<0&&(s=i.length-2);s<0&&(s=i.length-1);let c="";const l=Math.min(e.line+t.linesAfter,r.length).toString().length,a=t.maxLength-(t.indent+l+3);for(let g=1;g<=t.linesbefore&&!(s-g<0);g++){const h=FA(e.buffer,i[s-g],r[s-g],e.position-(i[s]-i[s-g]),a);c=`${" ".repeat(t.indent)}${DA((e.line-g+1).toString(),l)} | ${h.str} ${c}`}const u=FA(e.buffer,i[s],r[s],e.position,a);c+=`${" ".repeat(t.indent)}${DA((e.line+1).toString(),l)} | ${u.str} `,c+=`${"-".repeat(t.indent+l+3+u.pos)}^ `;for(let g=1;g<=t.linesafter&&!(s+g>=r.length);g++){const h=FA(e.buffer,i[s+g],r[s+g],e.position-(i[s]-i[s+g]),a);c+=`${" ".repeat(t.indent)}${DA((e.line+g+1).toString(),l)} | ${h.str} `}return c.replace(/\n$/,"")}function Wt(e,A){let t="";return e.mark?(e.mark.name&&(t+=`in "${e.mark.name}" `),t+=`(${e.mark.line+1}:${e.mark.column+1})`,!A&&e.mark.snippet&&(t+=` ${e.mark.snippet}`),`${e.reason} ${t}`):e.reason}var Ne=class Xn extends Error{reason;mark;constructor(A,t){super(),this.name="YAMLException",this.reason=A,this.mark=t,this.message=Wt(this,!1),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}toString(A){return`${this.name}: ${Wt(this,A)}`}static throwAt(A,t,n,i=""){let r=0,o=0;for(let c=0;c>10)+55296,(e-65536&1023)+56320)}function Nc(e){return e>=48&&e<=57?e-48:(e|32)-97+10}function Wc(e){return e===120?2:e===117?4:8}function iA(e,A,t){let n=0;for(;A0;l--){i++;const u=Nc(e.charCodeAt(i));a=(a<<4)+u}n+=gc(a),i++}r=o=i}else if(s===10||s===13){n+=e.slice(r,o);const c=iA(e,i,t);n+=qA(c.breaks),i=r=o=c.position}else i++,s!==32&&s!==9&&(o=i)}return n+e.slice(r,t)}function _t(e,A,t,n,i,r){const o=n<0?0:n,s=e.slice(a,t).replace(/\r\n?/g,` `),c=s===""?[]:(s.endsWith(` `)?s.slice(0,-1):s).split(` `);let l="",a=!1,u=0,g=!1;for(const h of c){let f=0;for(;f=h.length){u++;continue}const d=h.slice(o),m=d.charCodeAt(0);r?m===32||m===9?(g=!0,l+=` `.repeat(a?1+u:u)):g?(g=!1,l+=` `.repeat(u+1)):u===0?a&&(l+=" "):l+=` `.repeat(u):l+=` `.repeat(a?1+u:u),l+=d,a=!0,u=0}return i===se.KEEP?l+=` `.repeat(a?1+u:u):i!==se.STRIP&&a&&(l+=` `),l}function Zc(e,A){if(A.valueStart===Kc)return"";const{valueStart:t,valueEnd:n}=A;if(A.fast)return e.slice(t,n);switch(A.style){case Y.SINGLE_QUOTED:return _c(e,t,n);case Y.DOUBLE_QUOTED:return Jc(e,t,n);case Y.LITERAL_BLOCK:return _t(e,t,n,A.indent,A.chomping,!1);case Y.FOLDED_BLOCK:return _t(e,t,n,A.indent,A.chomping,!0);default:return Yc(e,t,n)}}var Rc=Object.assign(Object.create(null),{"!":"!","!!":"tag:yaml.org,2002:"});function zn(e,A){if(e.startsWith("!<")&&e.endswith(">"))return decodeURIComponent(e.slice(2,-1));const t=e.indexOf("!",1),n=t===-1?"!":e.slice(0,t+1),i=A?.[n]??Rc[n]??n;return decodeURIComponent(i)+decodeURIComponent(e.slice(n.length))}var xe=-1,Mc="tag:yaml.org,2002:merge",$A={filename:"",schema:wc,json:!1,maxTotalMergeKeys:1e4,maxAliases:-1};function Hc(e){return"tagStart"in e&&e.tagStart!==xe?e.tagStart:"anchorStart"in e&&e.anchorStart!==xe?e.anchorStart:"valueStart"in e&&e.valueStart!==xe?e.valueStart:"start"in e?e.start:0}function O(e,A){Ne.throwAt(e.source,e.position,A,e.filename)}function qn(e,A,t,n){try{return t.finalize(n)}catch(i){if(i instanceof Ne)throw i;Ne.throwAt(e.source,A,i instanceof Error?i.message:String(i),e.filename)}}function Uc(e,A){const t=Zc(e.source,A),n=A.tagStart===xe?"":e.source.slice(A.tagStart,A.tagEnd),i=e.schema.defaultScalarTag;if(n!==""){if(n==="!")return{value:t,tag:i};const r=zn(n,e.tagHandlers),o=e.schema.lookupScalarTag(r);if(o){const c=o.resolve(t,!0,r);return c===N&&O(e,`cannot resolve a node with !<${r}> explicit tag`),{value:c,tag:o}}const s=e.schema.lookupMappingTag(r)??e.schema.lookupSequenceTag(r);if(s){t!==""&&O(e,`cannot resolve a node with !<${r}> explicit tag`);const c=s.create(r);return{value:s.carrierIsResult?c:qn(e,e.position,s,c),tag:s}}O(e,`unknown scalar tag !<${r}>`)}return A.style===Y.PLAIN?e.schema.resolveImplicitScalarTag(t):{value:i.resolve(t,!1,i.tagName),tag:i}}function Jt(e,A,t){const n=A.tagStart===xe?"":e.source.slice(A.tagStart,A.tagEnd);return n===""||n==="!"?t:zn(n,e.tagHandlers)}function $n(e){return e.nodeKind==="mapping"}function Zt(e){e.totalMergeKeys++,e.maxTotalMergeKeys!==-1&&e.totalMergeKeys>e.maxTotalMergeKeys&&O(e,`merge keys exceeded maxTotalMergeKeys (${e.maxTotalMergeKeys})`)}function Rt(e,A,t,n){Zt(e);for(const i of n.keys(t)){if(Zt(e),A.tag.has(A.value,i))continue;const r=A.tag.addPair(A.value,i,n.get(t,i));r&&O(e,r),A.overridable??=new Set,A.overridable.add(i)}}function vc(e,A,t,n){if(e.position=A.keyPosition,$n(n))Rt(e,A,t,n);else if(n.nodeKind==="sequence"&&Array.isArray(t)){t.length>100&&O(e,"abnormal merge sequence size");for(const i of t){const r=e.nodeTags.get(i);r||O(e,"cannot merge mappings; the provided source object is unacceptable"),Rt(e,A,i,r)}}else O(e,"cannot merge mappings; the provided source object is unacceptable")}function Oc(e,A,t,n,i){if(e.position=A.keyPosition,A.keyIsMerge){vc(e,A,n,i);return}!e.json&&A.tag.has(A.value,t)&&!A.overridable?.has(t)&&O(e,"duplicated mapping key");const r=A.tag.addPair(A.value,t,n);r&&O(e,r),A.overridable?.delete(t)}function yA(e,A,t){const n=e.frames[e.frames.length-1];if(n.kind==="document")n.value=A,n.hasValue=!0;else if(n.kind==="sequence"){$n(t)&&e.nodeTags.set(A,t);const i=n.tag.addItem(n.value,A,n.index++);i&&O(e,i)}else if(n.hasKey){const i=n.key;n.key=void 0,n.hasKey=!1,Oc(e,n,i,A,t)}else n.key=A,n.keyPosition=e.position,n.hasKey=!0,n.keyIsMerge=t.tagName===Mc}function EA(e,A,t,n,i){if(A.anchorStart!==xe){const r={value:t,tag:n,isValueFinal:i};return e.anchors.set(e.source.slice(A.anchorStart,A.anchorEnd),r),r}return null}function Tc(e,A){const t={...$A,...A,events:e,documents:[],eventIndex:0,position:0,frames:[],anchors:new Map,nodeTags:new Map,tagHandlers:Object.create(null),totalMergeKeys:0,aliasCount:0};for(;t.eventIndex`);const o=r.create(i),s=EA(t,n,o,r,r.carrierIsResult);t.frames.push({kind:"sequence",position:t.position,value:o,tag:r,anchor:s,index:0});break}case T.MAPPING:{const i=Jt(t,n,"tag:yaml.org,2002:map"),r=t.schema.lookupMappingTag(i);r||O(t,`unknown mapping tag !<${i}>`);const o=r.create(i),s=EA(t,n,o,r,r.carrierIsResult);t.frames.push({kind:"mapping",position:t.position,value:o,tag:r,anchor:s,key:void 0,keyPosition:t.position,hasKey:!1,keyIsMerge:!1,overridable:null});break}case T.ALIAS:{t.maxAliases!==-1&&++t.aliasCount>t.maxAliases&&O(t,`aliases exceeded maxAliases (${t.maxAliases})`);const i=t.source.slice(n.anchorStart,n.anchorEnd),r=t.anchors.get(i);r||O(t,`unidentified alias "${i}"`),r.isValueFinal||O(t,`recursive alias "${i}" is not supported for tag ${r.tag.tagName} because it uses finalize()`),yA(t,r.value,r.tag);break}case T.POP:{const i=t.frames.pop();if(i.kind==="mapping"&&i.hasKey&&(t.position=i.keyPosition,O(t,"incomplete mapping pair in event stream")),i.kind==="document")t.documents.push(i.value);else{const r=i.tag.carrierIsResult?i.value:qn(t,i.position,i.tag,i.value);i.anchor&&(i.anchor.value=r,i.anchor.isValueFinal=!0),yA(t,r,i.tag)}break}}}return t.documents}var W=-1,ei=Object.prototype.hasOwnProperty,Ye=1,YA=2,Ai=3,rA=4,Lc=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Pc=/[,\[\]{}]/,ti=/^(?:!|!!|![0-9A-Za-z-]+!)$/,_A=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+,ドル_.!~*'()\[\]])`,ni=String.raw`(?:%[0-9A-Fa-f]{2}|[0-9A-Za-z\-#;/?:@&=+$.~*'()_])`,Xc=new RegExp(`^(?:${_A})*$`),Vc=new RegExp(`^(?:${ni})+$`),jc=new RegExp(`^(?:!(?:${_A})*|${ni}(?:${_A})*)$`),et={filename:"",maxDepth:100};function zc(e,A,t){e.events.push({type:T.DOCUMENT,explicitStart:A,explicitEnd:t,directives:e.directives})}function ii(e,A,t,n,i,r,o){e.events.push({type:T.SEQUENCE,start:A,anchorStart:t,anchorEnd:n,tagStart:i,tagEnd:r,style:o})}function JA(e,A,t,n,i,r,o){e.events.push({type:T.MAPPING,start:A,anchorStart:t,anchorEnd:n,tagStart:i,tagEnd:r,style:o})}function Mt(e,A){e.events.splice(A.eventsLength,0,{type:T.MAPPING,start:A.position,anchorStart:W,anchorEnd:W,tagStart:W,tagEnd:W,style:We.FLOW})}function Je(e,A,t,n,i,r,o,s,c=se.CLIP,l=-1,a=!1){e.events.push({type:T.SCALAR,valueStart:A,valueEnd:t,anchorStart:n,anchorEnd:i,tagStart:r,tagEnd:o,style:s,chomping:c,indent:l,fast:a})}function qc(e,A,t){e.events.push({type:T.ALIAS,anchorStart:A,anchorEnd:t})}function Qe(e){e.events.push({type:T.POP})}function j(e){Je(e,W,W,W,W,W,W,Y.PLAIN)}function Ht(){return{anchorStart:W,anchorEnd:W,tagStart:W,tagEnd:W}}function Se(e){return{position:e.position,line:e.line,lineStart:e.lineStart,lineIndent:e.lineIndent,firstTabInLine:e.firstTabInLine,eventsLength:e.events.length}}function me(e,A){e.position=A.position,e.line=A.line,e.lineStart=A.lineStart,e.lineIndent=A.lineIndent,e.firstTabInLine=A.firstTabInLine,e.events.length=A.eventsLength}function x(e,A){Ne.throwAt(e.input.slice(0,e.length),e.position,A,e.filename)}function v(e){return e===10||e===13}function Ie(e){return e===9||e===32}function ee(e){return Ie(e)||v(e)}function ae(e){return e===0||ee(e)}function Be(e){return e===44||e===91||e===93||e===123||e===125}function $c(e){return e>=48&&e<=57?e-48:-1}function el(e){if(e>=48&&e<=57)return e-48;const A=e|32;return A>=97&&A<=102?a-97+10:-1}function Al(e){return e===120?2:e===117?4:e===85?8:0}function tl(e){return e===48||e===97||e===98||e===116||e===9||e===110||e===118||e===102||e===114||e===101||e===32||e===34||e===47||e===92||e===78||e===95||e===76||e===80}function oA(e){e.input.charCodeAt(e.position)===10?e.position++:(e.position++,e.input.charCodeAt(e.position)===10&&e.position++),e.line++,e.lineStart=e.position,e.lineIndent=0,e.firstTabInLine=-1}function L(e,A){let t=0,n=e.input.charCodeAt(e.position),i=e.position===e.lineStart||ee(e.input.charCodeAt(e.position-1));for(;n!==0;){for(;Ie(n);)i=!0,n===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),n=e.input.charCodeAt(++e.position);if(A&&i&&n===35)do n=e.input.charCodeAt(++e.position);while(!v(n)&&n!==0);if(!v(n))break;for(oA(e),t++,i=!0,n=e.input.charCodeAt(e.position);n===32;)e.lineIndent++,n=e.input.charCodeAt(++e.position)}return t}function _e(e,A=e.position){const t=e.input.charCodeAt(A);if((t===45||t===46)&&t===e.input.charCodeAt(A+1)&&t===e.input.charCodeAt(A+2)){const n=e.input.charCodeAt(A+3);return n===0||ee(n)}return!1}function ri(e){e.position===e.lineStart&&e.input.charCodeAt(e.position)===65279&&(e.position++,e.lineStart=e.position)}function At(e){if(e.position!==e.lineStart)return!1;if(_e(e))return!0;if(e.input.charCodeAt(e.position)!==65279)return!1;const A=Se(e);ri(e),L(e,!0);const t=e.input.charCodeAt(e.position),n=e.position===e.lineStart&&(t===37||t===45&&_e(e));return me(e,A),n}function Ut(e){let A=e.input.charCodeAt(e.position);for(;A!==0&&!v(A);)A=e.input.charCodeAt(++e.position)}function oi(e,A,t){Lc.test(e.input.slice(A,t))&&x(e,"the stream contains non-printable characters")}function nl(e,A,t){if(e.input.charCodeAt(e.position)!==33)return!1;A.tagStart!==W&&x(e,"duplication of a tag property");const n=e.position;let i=!1,r=!1,o="!",s=e.input.charCodeAt(++e.position);s===60?(i=!0,s=e.input.charCodeAt(++e.position)):s===33&&(r=!0,o="!!",s=e.input.charCodeAt(++e.position));let c=e.position,l;if(i){for(;s!==0&&s!==62;)s=e.input.charCodeAt(++e.position);s!==62&&x(e,"unexpected end of the stream within a verbatim tag"),l=e.input.slice(c,e.position),e.position++}else{for(;s!==0&&!ee(s)&&!(t&&Be(s));)s===33&&(r?x(e,"tag suffix cannot contain exclamation marks"):(o=e.input.slice(c-1,e.position+1),ti.test(o)||x(e,"named tag handle cannot contain such characters"),r=!0,c=e.position+1)),s=e.input.charCodeAt(++e.position);l=e.input.slice(c,e.position),Pc.test(l)&&x(e,"tag suffix cannot contain flow indicator characters")}return l&&!(i?Xc.test(l):Vc.test(l))&&x(e,`tag name cannot contain such characters: ${l}`),!i&&o!=="!"&&o!=="!!"&&!ei.call(e.tagHandlers,o)&&x(e,`undeclared tag handle "${o}"`),A.tagStart=n,A.tagEnd=e.position,!0}function il(e,A){if(e.input.charCodeAt(e.position)!==38)return!1;A.anchorStart!==W&&x(e,"duplication of an anchor property"),e.position++;const t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!ee(e.input.charCodeAt(e.position))&&!Be(e.input.charCodeAt(e.position));)e.position++;return e.position===t&&x(e,"name of an anchor node must contain at least one character"),A.anchorStart=t,A.anchorEnd=e.position,!0}function rl(e,A){if(e.input.charCodeAt(e.position)!==42)return!1;(A.anchorStart!==W||A.tagStart!==W)&&x(e,"alias node should not have any properties"),e.position++;const t=e.position;for(;e.input.charCodeAt(e.position)!==0&&!ee(e.input.charCodeAt(e.position))&&!Be(e.input.charCodeAt(e.position));)e.position++;return e.position===t&&x(e,"name of an alias node must contain at least one character"),qc(e,t,e.position),!0}function ZA(e,A){L(e,!1),e.lineIndent0;)e.position++,el(e.input.charCodeAt(e.position))<0&&x(e,"expected hexadecimal character");e.position++}}else v(r)?(i=!1,ZA(e,A)):e.position===e.lineStart&&_e(e)?x(e,"unexpected end of the document within a double quoted scalar"):r!==9&&r<32?x(e,"expected valid JSON character"):e.position++}x(e,"unexpected end of the stream within a double quoted scalar")}function cl(e,A,t){const n=e.input.charCodeAt(e.position);let i=se.CLIP,r=-1,o=!1;if(n!==124&&n!==62)return!1;const s=n===124?Y.LITERAL_BLOCK:Y.FOLDED_BLOCK;for(e.position++;e.input.charCodeAt(e.position)!==0;){const h=e.input.charCodeAt(e.position),f=$c(h);if(h===43||h===45)i!==se.CLIP&&x(e,"repeat of a chomping mode identifier"),i=h===43?se.KEEP:se.STRIP,e.position++;else if(f>=0)f===0&&x(e,"bad explicit indentation width of a block scalar; it cannot be less than one"),o&&x(e,"repeat of an indentation width identifier"),r=A+f-1,o=!0,e.position++;else break}let c=!1;for(;Ie(e.input.charCodeAt(e.position));)c=!0,e.position++;c&&e.input.charCodeAt(e.position)===35&&Ut(e),v(e.input.charCodeAt(e.position))?oA(e):e.input.charCodeAt(e.position)!==0&&x(e,"a line break is expected");let l=o?r:-1,a=0;const u=e.position;let g=e.position;for(;e.input.charCodeAt(e.position)!==0;){const h=e.position;let f=0;for(;e.input.charCodeAt(h+f)===32;)f++;const d=e.input.charCodeAt(h+f);if(d===0){l>=0?f>l&&(g=h+f):f>0&&(g=h+f);break}if(At(e))break;if(!o&&l===-1&&v(d)&&(a=Math.max(a,f)),!o&&l===-1&&!v(d)&&(d===9&&f=A){c=!0,o=e.input.charCodeAt(e.position);continue}e.position=l,e.line=a,e.lineStart=u,e.lineIndent=g;break}}Ie(o)||(r=e.position+1),o=e.input.charCodeAt(++e.position)}return r===i?!1:(oi(e,i,r),Je(e,i,r,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,Y.PLAIN,se.CLIP,-1,!c),!0)}function Ze(e,A){const t=e.line;L(e,!0),(e.line>t&&e.lineIndent0;if(e.firstTabInLine!==-1&&e.input.charCodeAt(e.position)===45&&ae(e.input.charCodeAt(e.position+1))&&x(e,"bad indentation of a sequence entry"),i&&e.lineIndent<=a?j(e):ce(e,a,ai,!1,!0),l(e,!0),e.lineindent=e.length)break;e.lineIndent>A&&x(e,"bad indentation of a sequence entry"),e.line===n&&e.input.charCodeAt(e.position)===45&&ae(e.input.charCodeAt(e.position+1))&&x(e,"bad indentation of a sequence entry")}return Qe(e),!0}function wA(e,A,t,n){let i=!1,r=!1,o=!1,s=!1;if(e.firstTabInLine!==-1)return!1;let c=e.input.charCodeAt(e.position);for(;c!==0;){!i&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,x(e,"tab characters must not be used in indentation"));const l=e.input.charCodeAt(e.position+1),a=e.line;if((c===63||c===58)&&ae(l))o||(JA(e,e.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,We.BLOCK),o=!0),c===63?(i&&j(e),r=!0,i=!0):(i||(j(e),r=!0),i=!1),e.position+=1,s=!0;else{i&&(j(e),i=!1);const u=Se(e);if(!Ce(e,t,YA,!1,!0))break;if(e.line===a){for(c=e.input.charCodeAt(e.position);Ie(c);)c=e.input.charCodeAt(++e.position);if(c===58){if(c=e.input.charCodeAt(++e.position),ae(c)||x(e,"a whitespace character is expected after the key-value separator within a block mapping"),!o){for(me(e,u),JA(e,u.position,n.anchorStart,n.anchorEnd,n.tagStart,n.tagEnd,We.BLOCK),o=!0,Ce(e,t,YA,!1,!0),c=e.input.charCodeAt(e.position);Ie(c);)c=e.input.charCodeAt(++e.position);e.position++}r=!0,i=!1,s=!1}else if(r)x(e,"expected ':' after a mapping key");else return n.anchorStart!==W||n.tagStart!==W?(me(e,u),!1):!0}else if(r)x(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return n.anchorStart!==W||n.tagStart!==W?(me(e,u),!1):!0}if(Ce(e,A,rA,!0,s)&&(s=!1),i||s&&(j(e),s=!1),L(e,!0),c=e.input.charCodeAt(e.position),(e.line===a||e.lineIndent>A)&&c!==0)x(e,"bad indentation of a mapping entry");else if(e.lineIndent=e.maxDepth&&x(e,`nesting exceeded maxDepth (${e.maxDepth})`),e.depth++;let o=1,s=!1,c=!1,l=null;const a=Ht();let u=t===rA||t===Ai,g=u;const h=u;if(n&&L(e,!0)&&(s=!0,e.lineIndent>A?o=1:e.lineIndent===A?o=0:o=-1),o===1)for(;;){const f=e.input.charCodeAt(e.position),d=Se(e);if(s&&o!==1&&(f===33||f===38))break;if(s&&h&&(a.tagStart!==W||a.anchorStart!==W)&&(f===33||f===38)){const m=Se(e),b=A+1;if(wA(e,e.position-e.lineStart,b,a)&&e.events[m.eventsLength]?.type===T.MAPPING)return e.depth--,!0;me(e,m)}if(s&&(f===33&&a.tagStart!==W||f===38&&a.anchorStart!==W)||!nl(e,a,t===Ye)&&!il(e,a))break;l===null&&(l=d),L(e,!0)?(s=!0,g=h,e.lineIndent>A?o=1:e.lineIndent===A?o=0:o=-1):g=!1}if(g&&(g=s||i),o===1||t===rA){const f=t===Ye||t===YA?A:A+1,d=e.position-e.lineStart;if(o===1)if(g&&(vt(e,d,a)||wA(e,d,f,a))||ul(e,f,a))c=!0;else{const m=e.input.charCodeAt(e.position);if(l!==null&&r&&h&&!g&&m!==124&&m!==62){const b=Se(e),I=l.position-l.lineStart;me(e,l),wA(e,I,f,Ht())&&e.events[b.eventsLength]?.type===T.MAPPING?c=!0:me(e,b)}!c&&(u&&cl(e,f,a)||ol(e,f,a)||sl(e,f,a)||rl(e,a)||al(e,f,t,a))&&(c=!0)}else o===0&&(c=g&&vt(e,d,a))}return u=u&&!c,!c&&(a.anchorStart!==W||a.tagStart!==W||u)&&(Je(e,W,W,a.anchorStart,a.anchorEnd,a.tagStart,a.tagEnd,Y.PLAIN),c=!0),e.depth--,c||a.anchorStart!==W||a.tagStart!==W}function hl(e){if(e.lineIndent>0||e.input.charCodeAt(e.position)!==37)return!1;e.position++;const A=e.position;for(;e.input.charCodeAt(e.position)!==0&&!ee(e.input.charCodeAt(e.position));)e.position++;const t=e.input.slice(A,e.position),n=[];for(t.length===0&&x(e,"directive name must not be less than one character in length");e.input.charCodeAt(e.position)!==0&&!v(e.input.charCodeAt(e.position));){for(;Ie(e.input.charCodeAt(e.position));)e.position++;if(e.input.charCodeAt(e.position)===35||v(e.input.charCodeAt(e.position))||e.input.charCodeAt(e.position)===0)break;const i=e.position;for(;e.input.charCodeAt(e.position)!==0&&!ee(e.input.charCodeAt(e.position));)e.position++;n.push(e.input.slice(i,e.position))}if(v(e.input.charCodeAt(e.position))&&oA(e),t==="YAML"){e.directives.some(r=>r.kind==="yaml")&&x(e,"duplication of %YAML directive"),n.length!==1&&x(e,"YAML directive accepts exactly one argument");const i=/^([0-9]+)\.([0-9]+)$/.exec(n[0]);i===null&&x(e,"ill-formed argument of the YAML directive"),parseInt(i[1],10)!==1&&x(e,"unacceptable YAML version of the document"),e.directives.push({kind:"yaml",version:n[0]})}else if(t==="TAG"){n.length!==2&&x(e,"TAG directive accepts exactly two arguments");const[i,r]=n;ti.test(i)||x(e,"ill-formed tag handle (first argument) of the TAG directive"),ei.call(e.tagHandlers,i)&&x(e,`there is a previously declared suffix for "${i}" tag handle`),jc.test(r)||x(e,"ill-formed tag prefix (second argument) of the TAG directive"),e.tagHandlers[i]=r,e.directives.push({kind:"tag",handle:i,prefix:r})}return!0}function fl(e){e.directives=[],e.tagHandlers=Object.create(null);let A=!1;for(L(e,!0);hl(e);)A=!0,L(e,!0);let t=!1,n=!1,i=!0;if(e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45&&ae(e.input.charCodeAt(e.position+3))){t=!0;const s=e.line;e.position+=3,L(e,!0),i=e.line>s}else A&&x(e,"directives end mark is expected");const r=e.events.length;if(!t&&e.position===e.lineStart&&e.input.charCodeAt(e.position)===46&&_e(e)){e.position+=3,L(e,!0);return}if(zc(e,t,!1),Ce(e,e.lineIndent-1,rA,!1,i,i)||j(e),L(e,!0),e.position===e.lineStart&&_e(e)&&(n=e.input.charCodeAt(e.position)===46,n)){const s=e.line;e.position+=3,L(e,!0),e.line===s&&e.position=n.length));){const r=n.position;fl(n),n.position===r&&x(n,"can not read a document")}return n.events}var dl={...et,...$A};function pl(e,A={}){const t={...dl,...A},n=String(e),i=Object.keys(et),r=Object.keys($A);return Tc(gl(n,Gt(t,i)),{...Gt(t,r),source:n})}function ml(e,A,t){let n=null;typeof A=="function"?n=A:A!==null&&typeof A=="object"&&(t=A);const i=pl(e,t);if(n===null)return i;for(const r of i)n(r)}function fA(e,A){return(e&1<i&&l[0]!==" "&&/ [^ \t]/.test(l)&&(o=!0),c===-1)break;r=c+1}o?e.style=Y.FOLDED_BLOCK:t&&(e.style=Y.LITERAL_BLOCK)}function Fl(e){e.style===Y.PLAIN&&!fA(e.allowedStylesMask,Y.PLAIN)&&(e.style=si(e))}function Dl(e){fA(e.allowedStylesMask,e.style)||(e.style=Y.DOUBLE_QUOTED)}Object.keys(Ot).map(e=>Reflect.get(Ot,e));function ci(e){const A=ml(e,{schema:Ec});if(A.length>1)throw new Ne("expected a single document in the stream, but found more");return A[0]}function yl(e,A,t={}){const n={};for(const i in e){if(i==="$")continue;const r=e[i],o=i.charCodeAt(0)===58;if(t.parseJson&&o){if(typeof r=="string"){try{n[i.slice(1)]=JSON.parse(r);continue}catch{}n[i.slice(1)]=Tt(A,r);continue}n[i.slice(1)]=r;continue}if(o&&typeof r=="string"){const s=Tt(A,r);if(s!==void 0){n[i.slice(1)]=s;continue}}n[i]=r}return n}function je(e){return!!e&&typeof e=="object"&&Array.isArray(e.nodes)}function*El(e,A){function*t(i,r,o){let s=i;if(A(i)){const c=yield i;if(c===!1)return r.splice(o,1),!0;c!==void 0&&(r[o]=c,s=c)}if(Array.isArray(s)&&s.length>2){let c=2;for(;cA?A[0].toUpperCase()+A.slice(1):"").join(""):""}function Ql(e){return e?li(e).map(A=>A.toLowerCase()).join("-"):""}function li(e){const A=[];if(!e)return A;let t="",n,i;for(let r=0;r=48&&c<=57?void 0:c>=65&&c<=90;if(i===!1){if(n===!1&&a===!0){a.push(t),t=o,n=a;continue}if(n===!0&&a===!1&&t.length>1){const u=t[t.length-1];A.push(t.slice(0,t.length-1)),t=u+o,n=a;continue}}t+=o,n=a,i=s}return A.push(t),A}function Tt(e,A){const t=A.split(".");let n=e;for(const i of t)if(n&&typeof n=="object"&&i in n)n=n[i];else return;return n}const ze={"[":"]","{":"}","(":")"},qe={"'":"'",'"':'"',"`":"`"};function ai(e,A=0){if(e[A]!=="{")throw new Error(`Invalid props, expected \`{\` but got '${e[A]}'`);const t=[];if(e[A+1]==="{")return;for(A+=1;A{/^(['"`]).*1円$/.test(s[1])&&(s[1]=s[1].slice(1,-1))}),{props:t,index:A}}const Sl=/^[a-z$][$\w.-]*/i;function xA(e){if(e=e.trim(),!e)return{name:""};const A=e.match(Sl)?.[0];if(!A)throw new Error(`Invalid block params: ${e}`);let t=e.slice(A.length).trim(),n,i,r;if(t.startsWith("[")){const s=On(t,0);s&&(n=s.content,t=t.slice(s.endIndex).trim())}if(t.startsWith("{")){const s=ai(t,0);if(s){i=s.props;const c=t.slice(s.index).trim();c&&(r=c)}}else t&&(r=t);const o={name:Ql(A)};return n!==void 0&&(o.content=n),i!==void 0&&(o.props=i),r&&(o.remaining=r),o}const Kl=/^[a-z$][\w$-]*/i;function RA(e){return Kl.test(e)}const Gl={"---":"---","```yaml [props]":"```","~~~yaml [props]":"~~~","```yml [props]":"```","~~~yml [props]":"~~~"},Nl=e=>{e.block.ruler.before("fence","comark_block_shorthand",function(r,o,s,c){const l=r.src.slice(r.bMarks[o]+r.tShift[o],r.eMarks[o]);if(l[0]!==":"||!RA(l.slice(1)))return!1;const{name:a,content:u,props:g,remaining:h}=xA(l.slice(1));if(h)return!1;if(!c)if(u!==void 0){const f=r.push("mdc_block_shorthand",a,1);g?.forEach(([b,I])=>{b==="class"?f.attrJoin(b,I):f.attrSet(b,I)}),f.map=[o,o+1];const d=r.push("inline","",0);d.content=u,d.children=[];const m=r.push("mdc_block_shorthand",a,-1);m.map=[o,o+1]}else{const f=r.push("mdc_block_shorthand",a,0);f.map=[o,o+1],g?.forEach(([d,m])=>{d==="class"?f.attrJoin(d,m):f.attrSet(d,m)})}return r.line=o+1,!0}),e.block.ruler.before("fence","comark_block",function(r,o,s,c){let l,a,u=!1,g=r.bMarks[o]+r.tShift[o],h=r.eMarks[o];const f=r.sCount[o];let d=!1,m=0,b=0,I=0;if(r.src[g]!==":")return!1;for(l=g+1;l<=h&&r.src[l]===":";l++);const C=Math.floor(l-g);if(C<2)return!1;const B=r.src.slice(g,l),k=r.skipSpaces(l);if(k=s||(g=r.bMarks[a]+r.tShift[a],h=r.eMarks[a],g=b&&r.skipSpaces(Q)>=h&&(d=!1)}continue}if(w===96||w===126){let Q=g+1;for(;Q=3){d=!0,m=w,b=Q-g;continue}}if(w===58){for(l=g+1;l<=h&&r.src[l]===":";l++);if(l-g===c){if(l=r.skipspaces(l),l0){I--;continue}u=!0;break}}}const S=r.parentType,D=r.lineMax;r.parentType="comark_block",r.lineMax=a;const _=r.push("mdc_block_open",F.name,1);if(_.markup=B,_.block=!0,_.info=F.name,_.map=[o,a],F.props?.forEach(([w,Q])=>{w==="class"?_.attrJoin(w,Q):_.attrSet(w,Q)}),F.content!==void 0){const w=r.push("paragraph_open","p",1);w.map=[o,o+1];const Q=r.push("inline","",0);Q.content=F.content,Q.children=[],r.push("paragraph_close","p",-1)}const E=r.blkIndent;r.blkIndent=f,r.env.comarkBlockTokens||=[],r.env.comarkBlockTokens.unshift(_),r.md.block.tokenize(r,o+1,a),r.blkIndent=E,r.env.comarkBlockTokens.shift();const G=r.push("mdc_block_close",F.name,-1);return G.map=[o,a],G.markup=r.src.slice(g,l),G.block=!0,r.tokens.slice(r.tokens.indexOf(_)+1,r.tokens.indexOf(G)).filter(w=>w.level===_.level+1).forEach((w,Q,q)=>{q.length<=2&&w.tag==="p"&&(w.hidden=!0)}),r.parenttype=s,r.linemax=d,r.line=a+(u?1:0),!0},{alt:["paragraph","reference","blockquote","list"]}),e.block.ruler.after("code","comark_block_yaml",function(r,o,s,c){if(!r.env.comarkblocktokens?.length)return!1;const l=r.bMarks[o]+r.tShift[o],a=r.eMarks[o],u=r.src.slice(l,a),g=Gl[u]||"";if(!g)return!1;if(u==="---"){const d=r.env.comarkBlockTokens[0].map?.[0];if(d===void 0||o!==d+1)return!1}let h=o+1,f=!1;for(;h{I==="class"?b.attrJoin(I,C):b.attrSet(I,typeof C=="string"?C:JSON.stringify(C))})}return r.line=h+1,!0}),e.block.ruler.after("code","comark_block_slots",function(r,o,s,c){if(!r.env.comarkBlockTokens?.length)return!1;const l=r.bMarks[o]+r.tShift[o];if(!(r.src[l]==="#"&&r.src[l+1]!==" "&&r.src[l+1]!=="#"))return!1;const a=r.src.slice(l,r.eMarks[o]),{name:u,props:g}=xA(a.slice(1));let h=o+1,f=!1,d="",m=0;for(;h=m&&C.slice(B).trim()===""&&(f=!1)}h+=1;continue}if(C[0]==="`"||C[0]==="~"){const B=C[0];let k=1;for(;k=3){f=!0,d=B,m=k,h+=1;continue}}if(/^#\w+/.test(C)||C.startsWith("::"))break;h+=1}if(c)return r.line=h,!0;const b=r.lineMax,I=r.push("mdc_block_slot","template",1);return I.attrSet(`#${u}`,""),g?.forEach(([C,B])=>{C==="class"?I.attrJoin(C,B):I.attrSet(C,B)}),r.line=o+1,r.lineMax=h,r.md.block.tokenize(r,o+1,h),r.push("mdc_block_slot","template",-1),r.line=h,r.lineMax=b,!0})},Wl=new Set([" "," ",` `,"*","_","["]),Yl=e=>{e.inline.ruler.after("entity","comark_inline_component",(A,t)=>{const n=A.pos;if(A.src[n]!==":")return!1;const i=A.src[n-1];if(n>0&&!Wl.has(i))return!1;let r=n+1,o=-1,s=-1,c=-1;for(;r{e.inline.ruler.before("link","comark_inline_span",(A,t)=>{const n=A.pos;if(A.src[n]!=="[")return!1;const i=vn(A.src,n),r=i===-1?A.src.length:i,o=A.src[r+1];if(o==="("||o==="["||A.linkLevel>0&&o!=="{"||t)return!1;A.push("mdc_inline_span","span",1);const s=A.pos,c=A.posMax;return A.pos=n+1,A.posMax=r,A.md.inline.tokenize(A),A.pos=s,A.posMax=c,A.push("mdc_inline_span","span",-1),A.pos=r+1,!0})},Jl=e=>{e.use(Nl),e.use(_l),e.use(Yl)},Zl=()=>({name:"components",markdownItPlugins:[Jl]}),Rl=e=>{e.inline.ruler.after("entity","comark_inline_props",(t,n)=>{const i=t.pos;if(t.src[i]!=="{"||t.src[i+1]==="{"||t.src[i-1]==="{"||t.src[i-1]==="$")return!1;const r=ai(t.src,i);if(!r)return!1;const{props:o,index:s}=r;if(s===i)return!1;if(t.pos=s,n)return!0;const c=t.push("mdc_inline_props","span",0);return c.attrs=o,c.hidden=!0,!0}),e.renderer.rules.mdc_inline_props=()=>"";const A=e.parse;e.parse=function(t,n){const i=A.call(this,t,n);return i.forEach((r,o)=>{const s=i[o-1],c=i[o+1];if(!s||!["heading_open","paragraph_open","list_item_open"].includes(s.type)||s.hidden||(r.hidden&&c?.type==="inline"&&(r=c),r.type!=="inline"||!r.children?.length))return;const l=r.children[r.children.length-1];if(l.type!=="mdc_inline_props")return;let a=r.children.length-2;for(;a>=0;){const h=r.children[a];if(h.type==="text"&&!h.content){a--;continue}break}const u=a>=0?r.children[a]:void 0;if(!u||u.type!=="text")return;typeof u.content=="string"&&(u.content=u.content.replace(/[ \t]+$/,""));const g=l.attrs;r.children.length=u.content?a+1:a,g?.forEach(([h,f])=>{h==="class"?s.attrJoin("class",f):s.attrSet(h,f)})}),i},e.renderer.renderInline=Lt(e.renderer.renderInline),"renderInlineAsync"in e.renderer&&(e.renderer.renderInlineAsync=Lt(e.renderer.renderInlineAsync))};function Lt(e){return function(A,t,n){return A=[...A],A.forEach((i,r)=>{if(i.type!=="mdc_inline_props")return;let o=r-1,s=A[o];for(;o>=0&&(s.type==="text"&&!s.content.trim());)o--,s=A[o];if(!s.tag&&s.type==="text"){s=new ge("mdc_inline_span","span",1),A.splice(r-1,0,s);const c=new ge("mdc_inline_span","span",-1);A.splice(r+2,0,c)}else if(s.nesting===-1){let c=r-1;for(;c>=0;){const l=A[c];if(l.nesting===1&&l.tag===s.tag&&l.level===s.level){s=l;break}c--}}if(s.nesting===-1)throw new Error(`No matching opening tag found for ${JSON.stringify(s)}`);i.attrs?.forEach(([c,l])=>{c==="class"?s.attrJoin("class",l):s.attrSet(c,l)})}),e.call(this,A,t,n)}}const Ml=Rl,Hl=()=>({name:"attributes",markdownItPlugins:[Ml]});function Pt(e,A,t){const n=e.attrIndex(A),i=[A,t];n<0?(e.attrs||(e.attrs=[]),e.attrs.push(i)):e.attrs[n]=i}function Ul(e,A){for(let t=A-1;t>=0;t--){if(e[t].type==="list_item_open")return t;if(e[t].type==="list_item_close")return-1}return-1}function vl(e,A){const t=e[A].level-1;for(let n=A-1;n>=0;n--)if(e[n].level===t&&(e[n].type==="bullet_list_open"||e[n].type==="ordered_list_open"))return n;return-1}function Ol(e,A){const t=!(A?.enabled??!1);e.core.ruler.before("inline","task-lists-mdc",n=>{const i=n.tokens;for(let r=0;r=0){const c=o.content.match(/^(\[[ x]\])\s+/i);if(c){const l=c[1].toLowerCase()==="[x]";Pt(i[s],"class","task-list-item");const a=vl(i,s);a>=0&&Pt(i[a],"class","contains-task-list");const u=`TASK_CHECKBOX_${l?"CHECKED":"UNCHECKED"} `;o.content=o.content.replace(/^\[[ x]\]\s+/i,u)}}}}}),e.core.ruler.after("inline","task-lists-mdc-post",n=>{const i=n.tokens;for(let r=0;r({name:"task-list",markdownItPlugins:[Ol]}),Xt={"!TIP":{type:"tip",title:"Tip",color:"#238636"},"!NOTE":{type:"note",title:"Note",color:"#1f6feb"},"!IMPORTANT":{type:"important",title:"Important",color:"#8957e5"},"!WARNING":{type:"warning",title:"Warning",color:"#9e6a03"},"!CAUTION":{type:"caution",title:"Caution",color:"#da3633"}},Ll=()=>({name:"alert",post(e){wl(e.tree,A=>Array.isArray(A)&&A[0]==="blockquote",A=>{const t=A;if(A[2]?.[0]==="span"){const n=String(A[2][2]).toUpperCase(),i=Xt[n];i&&(typeof A[3]=="string"&&(t[3]=String(t[3]).trimStart()),t.splice(2,1),t[1].as=i.type)}else if(A[2]?.[0]==="p"){const n=A[2];if(n[2]?.[0]==="span"){const i=String(n[2][2]).toUpperCase(),r=Xt[i];r&&(typeof n[3]=="string"&&(n[3]=String(n[3]).trimStart()),n.splice(2,1),t[1].as=r.type)}}})}}),Pl=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Xl="[a-zA-Z_:][a-zA-Z0-9:._-]*",Vl="[^\"'=`\\x00-\\x20]+",jl="'[^']*'",zl='"[^"]*"',ql=`(?:${Vl}|${jl}|${zl})`,$l=`(?:\\s+${Xl}(?:\\s*=\\s*${ql})?)`,ui=`<[a-za-z][a-za-z0-9\\-]*${$l}*\\s*\\/?>`,hi="<\\/[a-za-z][a-za-z0-9\\-]*\\s*>",ea="",Aa="<\\?[\\s\\s]*?\\?>",ta="]*>",na="",ia=new RegExp(`^(?:${ui}|${hi}|${ea}|${Aa}|${ta}|${na})`),ra=new RegExp(`^(?:${ui}|${hi})`),ke=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${ra.source}\\s*$`),/^$/,!1]];function oa(e,A,t,n){let i=e.bMarks[A]+e.tShift[A],r=e.eMarks[A];if(e.sCount[A]-e.blkIndent>=4||e.src.charCodeAt(i)!==60)return!1;let o=e.src.slice(i,r),s=0;for(;s\s]/i.test(e)}function ca(e){return/^<\/a\s*>/i.test(e)}function la(e){const A=e|32;return A>=97&&A<=122}function aa(e,A){const t=e.posMax,n=e.pos;if(e.src.charCodeAt(n)!==60||n+2>=t)return!1;const i=e.src.charCodeAt(n+1);if(i!==33&&i!==63&&i!==47&&!la(i))return!1;const r=e.src.slice(n).match(ia);if(!r)return!1;if(!A){const o=e.push("html_inline","",0);o.content=r[0],sa(o.content)&&e.linkLevel++,ca(o.content)&&e.linkLevel--}return e.pos+=r[0].length,!0}function ua(e){e.set({html:!0}),e.inline.ruler.before("text","comark_html_inline",aa),e.block.ruler.before("html_block","comark_html_block",oa,{alt:["paragraph","reference","blockquote"]})}const ha=()=>({name:"html",markdownItPlugins:[ua]}),Vt="---",fa=` `,ga="\r";function da(e){let A={},t="";if(e.startsWith(Vt)){const n=e.indexOf(fa+Vt);if(n!==-1){const i=e[n-1]===ga;t=e.slice(4,n-(i?1:0)),t&&(A=ci(t)??{},e=e.slice(n+4+(i?1:0)))}}return{content:e,data:A,frontmatterText:t}}const pa=()=>({name:"frontmatter",pre(e){const{content:A,data:t,frontmatterText:n}=da(e.markdown);e.markdown=A,e.frontmatter=t,e.frontmatterText=n,A&&n&&(e.parsedLines=(e.parsedLines??0)+n.split(` `).length+1)}});function ma(e){return e?e===!0?["p"]:typeof e=="string"?e.split(/[,\s]/).map(A=>A.trim()).filter(Boolean):e.filter(Boolean):[]}function Ca(e){return Array.isArray(e)&&typeof e[0]=="string"}function Ia(e,A){return Ca(e)&&(A==="*"||e[0]===A)}function fi(e,A){if(A.length===0)return e;const[t,...n]=A,i=[];for(const r of e){const o=Ia(r,t)?r.slice(2):[r];for(const s of fi(o,n))i.push(s)}return i.filter(r=>!(typeof r=="string"&&r.trim()===""))}function Ba(e,A){if(A.length===0)return e;const t=fi(e,A),n=[];for(const i of t)typeof i=="string"&&typeof n[n.length-1]=="string"?n[n.length-1]=n[n.length-1]+i:n.push(i);return n}const ba=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function ka(e){return e>=55296&&e<=57343||e>1114111?65533:ba.get(e)??e}function gi(e){const A=atob(e),t=A.length&-2,n=new Uint16Array(t/2);for(let i=0,r=0;i=R.ZERO&&e<=r.nine}function ya(e){return e>=R.UPPER_A&&e<=r.upper_f||e>=R.LOWER_A&&e<=r.lower_f}function Ea(e){return e>=R.UPPER_A&&e<=r.upper_z||e>=R.LOWER_A&&e<=r.lower_z||ma(e)}function wa(e){return e===R.EQUALS||Ea(e)}var U;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(U||(U={}));var ne;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(ne||(ne={}));class xa{decodeTree;emitCodePoint;errors;constructor(A,t,n){this.decodeTree=A,this.emitCodePoint=t,this.errors=n}state=U.EntityStart;consumed=1;result=0;treeIndex=0;excess=1;decodeMode=ne.Strict;runConsumed=0;startEntity(A){this.decodeMode=A,this.state=U.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1,this.runConsumed=0}write(A,t){switch(this.state){case U.EntityStart:return A.charCodeAt(t)===R.NUM?(this.state=U.NumericStart,this.consumed+=1,this.stateNumericStart(A,t+1)):(this.state=U.NamedEntity,this.stateNamedEntity(A,t));case U.NumericStart:return this.stateNumericStart(A,t);case U.NumericDecimal:return this.stateNumericDecimal(A,t);case U.NumericHex:return this.stateNumericHex(A,t);case U.NamedEntity:return this.stateNamedEntity(A,t)}}stateNumericStart(A,t){return t>=A.length?-1:(A.charCodeAt(t)|jt)===R.LOWER_X?(this.state=U.NumericHex,this.consumed+=1,this.stateNumericHex(A,t+1)):(this.state=U.NumericDecimal,this.stateNumericDecimal(A,t))}stateNumericHex(A,t){for(;t>14;for(;t>7;if(this.runConsumed===0){const c=i&V.JUMP_TABLE;if(A.charCodeAt(t)!==c)return this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}for(;this.runConsumed=A.length)return-1;const c=this.runConsumed-1,l=n[this.treeIndex+1+(c>>1)],a=c%2===0?l&255:l>>8&255;if(A.charCodeAt(t)!==a)return this.runConsumed=0,this.result===0?0:this.emitNotTerminatedNamedEntity();t++,this.excess++,this.runConsumed++}this.runConsumed=0,this.treeIndex+=1+(s>>1),i=n[this.treeIndex],r=(i&V.VALUE_LENGTH)>>14}if(t>=A.length)break;const o=A.charCodeAt(t);if(o===R.SEMI&&r!==0&&(i&V.FLAG13)!==0)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);if(this.treeIndex=Qa(n,i,this.treeIndex+Math.max(1,r),o),this.treeIndex<0)return this.result===0||this.decodeMode===ne.Attribute&&(r===0||wa(o))?0:this.emitNotTerminatedNamedEntity();if(i=n[this.treeIndex],r=(i&V.VALUE_LENGTH)>>14,r!==0){if(o===R.SEMI)return this.emitNamedEntityData(this.treeIndex,r,this.consumed+this.excess);this.decodeMode!==ne.Strict&&(i&V.FLAG13)===0&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}t++,this.excess++}return-1}emitNotTerminatedNamedEntity(){const{result:A,decodeTree:t}=this,n=(t[A]&V.VALUE_LENGTH)>>14;return this.emitNamedEntityData(A,n,this.consumed),this.errors?.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(A,t,n){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[A]&~(V.VALUE_LENGTH|V.FLAG13):i[A+1],n),t===3&&this.emitCodePoint(i[A+2],n),n}end(){switch(this.state){case U.NamedEntity:return this.result!==0&&(this.decodeMode!==ne.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case U.NumericDecimal:return this.emitNumericEntity(0,2);case U.NumericHex:return this.emitNumericEntity(0,3);case U.NumericStart:return this.errors?.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case U.EntityStart:return 0}}}function Qa(e,A,t,n){const i=(A&V.BRANCH_LENGTH)>>7,r=A&V.JUMP_TABLE;if(i===0)return r!==0&&n===r?t:-1;if(r){const l=n-r;return l<0||l>=i?-1:e[t+l]-1}const o=i+1>>1;let s=0,c=i-1;for(;s<=c;){const l=s+c>>>1,a=l>>1,g=e[t+a]>>(l&1)*8&255;if(gn)c=l-1;else return e[t+o+l]}return-1}var y;(function(e){e[e.Tab=9]="Tab",e[e.NewLine=10]="NewLine",e[e.FormFeed=12]="FormFeed",e[e.CarriageReturn=13]="CarriageReturn",e[e.Space=32]="Space",e[e.ExclamationMark=33]="ExclamationMark",e[e.Number=35]="Number",e[e.Amp=38]="Amp",e[e.SingleQuote=39]="SingleQuote",e[e.DoubleQuote=34]="DoubleQuote",e[e.Dash=45]="Dash",e[e.Slash=47]="Slash",e[e.Zero=48]="Zero",e[e.Nine=57]="Nine",e[e.Semi=59]="Semi",e[e.Lt=60]="Lt",e[e.Eq=61]="Eq",e[e.Gt=62]="Gt",e[e.Questionmark=63]="Questionmark",e[e.UpperA=65]="UpperA",e[e.LowerA=97]="LowerA",e[e.UpperF=70]="UpperF",e[e.LowerF=102]="LowerF",e[e.UpperZ=90]="UpperZ",e[e.LowerZ=122]="LowerZ",e[e.LowerX=120]="LowerX",e[e.OpeningSquareBracket=91]="OpeningSquareBracket"})(y||(y={}));var p;(function(e){e[e.Text=1]="Text",e[e.BeforeTagName=2]="BeforeTagName",e[e.InTagName=3]="InTagName",e[e.InSelfClosingTag=4]="InSelfClosingTag",e[e.BeforeClosingTagName=5]="BeforeClosingTagName",e[e.InClosingTagName=6]="InClosingTagName",e[e.AfterClosingTagName=7]="AfterClosingTagName",e[e.BeforeAttributeName=8]="BeforeAttributeName",e[e.InAttributeName=9]="InAttributeName",e[e.AfterAttributeName=10]="AfterAttributeName",e[e.BeforeAttributeValue=11]="BeforeAttributeValue",e[e.InAttributeValueDq=12]="InAttributeValueDq",e[e.InAttributeValueSq=13]="InAttributeValueSq",e[e.InAttributeValueNq=14]="InAttributeValueNq",e[e.BeforeDeclaration=15]="BeforeDeclaration",e[e.InDeclaration=16]="InDeclaration",e[e.InProcessingInstruction=17]="InProcessingInstruction",e[e.BeforeComment=18]="BeforeComment",e[e.CDATASequence=19]="CDATASequence",e[e.DeclarationSequence=20]="DeclarationSequence",e[e.InSpecialComment=21]="InSpecialComment",e[e.InCommentLike=22]="InCommentLike",e[e.SpecialStartSequence=23]="SpecialStartSequence",e[e.InSpecialTag=24]="InSpecialTag",e[e.InPlainText=25]="InPlainText",e[e.InEntity=26]="InEntity"})(p||(p={}));function pe(e){return e===y.Space||e===y.NewLine||e===y.Tab||e===y.FormFeed||e===y.CarriageReturn}function Fe(e){return e===y.Slash||e===y.Gt||pe(e)}function Sa(e){return e>=y.LowerA&&e<=y.lowerz||e>=y.UpperA&&e<=y.upperz}var ie;(function(e){e[e.NoValue=0]="NoValue",e[e.Unquoted=1]="Unquoted",e[e.Single=2]="Single",e[e.Double=3]="Double"})(ie||(ie={}));const K={Empty:new Uint8Array(0),Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,33,62]),Doctype:new Uint8Array([100,111,99,116,121,112,101]),IframeEnd:new Uint8Array([60,47,105,102,114,97,109,101]),NoembedEnd:new Uint8Array([60,47,110,111,101,109,98,101,100]),NoframesEnd:new Uint8Array([60,47,110,111,102,114,97,109,101,115]),Plaintext:new Uint8Array([60,47,112,108,97,105,110,116,101,120,116]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97]),XmpEnd:new Uint8Array([60,47,120,109,112])},Ka=new Map([[K.IframeEnd[2],K.IframeEnd],[K.NoembedEnd[2],K.NoembedEnd],[K.Plaintext[2],K.Plaintext],[K.ScriptEnd[2],K.ScriptEnd],[K.TitleEnd[2],K.TitleEnd],[K.XmpEnd[2],K.XmpEnd]]);class Ga{cbs;state=p.Text;buffer="";sectionStart=0;index=0;entityStart=0;baseState=p.Text;isSpecial=!1;running=!0;offset=0;xmlMode;decodeEntities;recognizeSelfClosing;entityDecoder;constructor({xmlMode:A=!1,decodeEntities:t=!0,recognizeSelfClosing:n=A},i){this.cbs=i,this.xmlMode=A,this.decodeEntities=t,this.recognizeSelfClosing=n,this.entityDecoder=new xa(A?Da:Fa,(r,o)=>this.emitCodePoint(r,o))}reset(){this.state=p.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=p.Text,this.isSpecial=!1,this.currentSequence=K.Empty,this.sequenceIndex=0,this.running=!0,this.offset=0}write(A){this.offset+=this.buffer.length,this.buffer=A,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=p.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&A===y.Amp&&this.startEntity()}currentSequence=K.Empty;sequenceIndex=0;enterTagBody(){this.currentSequence===K.Plaintext?(this.currentSequence=K.Empty,this.state=p.InPlainText):this.isSpecial?(this.state=p.InSpecialTag,this.sequenceIndex=0):this.state=p.Text}stateSpecialStartSequence(A){const t=A|32;if(this.sequenceIndex=0)this.state=this.baseState,t===0&&(this.index-=1);else{if(A=A))switch(this.state){case p.InTagName:case p.BeforeAttributeName:case p.BeforeAttributeValue:case p.AfterAttributeName:case p.InAttributeName:case p.InAttributeValueSq:case p.InAttributeValueDq:case p.InAttributeValueNq:case p.InClosingTagName:break;default:this.cbs.ontext(this.sectionStart,A)}}emitCodePoint(A,t){this.baseState!==p.Text&&this.baseState!==p.InSpecialTag?(this.sectionStart1){const i=nn.get(n);if(i!==void 0&&this.stack.includes(i))return i}return this.isInForeignContext()?n:n==="image"?"img":n}onopentagname(A,t){this.endIndex=t,this.emitOpenTag(this.readTagName(A,t))}emitOpenTag(A){if(this.openTagStart=this.startIndex,this.tagname=A,this.htmlMode&&A==="form"&&this.stack.includes("form")){this.tagname="";return}const t=this.htmlMode&&Na.get(A);if(t)for(;this.stack.length>0&&t.has(this.stack[0]);)this.popElement(!0);this.isVoidElement(A)||(this.stack.unshift(A),this.htmlMode&&(A==="svg"?this.foreignContext.unshift(ce.Svg):A==="math"?this.foreignContext.unshift(ce.MathML):tn.has(A)&&this.foreignContext.unshift(ce.None))),this.cbs.onopentagname?.(A),this.cbs.onopentag&&(this.attribs={})}endOpenTag(A){this.startIndex=this.openTagStart,this.attribs&&(this.cbs.onopentag?.(this.tagname,this.attribs,A),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(A){this.endIndex=A,this.endOpenTag(!1),this.startIndex=A+1}onclosetag(A,t){this.endIndex=t;const n=this.readTagName(A,t);if(this.isVoidElement(n))this.htmlMode&&n==="br"&&(this.cbs.onopentagname?.("br"),this.cbs.onopentag?.("br",{},!0),this.cbs.onclosetag?.("br",!1));else{const i=this.stack.indexOf(n);if(i!==-1){for(let r=0;r=this.buffers[0].length;)this.shiftBuffer();let n=this.buffers[0].slice(A-this.bufferOffset,t-this.bufferOffset);for(;t-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),n+=this.buffers[0].slice(0,t-this.bufferOffset);return n}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(A){if(this.ended){this.cbs.onerror?.(new Error(".write() after done!"));return}this.buffers.push(A),this.tokenizer.running&&(this.tokenizer.write(A),this.writeIndex++)}end(A){if(this.ended){this.cbs.onerror?.(new Error(".end() after done!"));return}A&&this.write(A),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex/i);if(t)return{tag:t[1].toLowerCase(),attrs:{},isVoid:!1,isClose:!0};let n=null;const i=new di({onopentag(r,o){n={tag:r,attrs:pi(o,!0),isVoid:HA.has(r),isClose:!1}}},{decodeEntities:!1});return i.write(A),i.end(),n}function Ja(e){const A=[],t=[],n=new di({onopentag(i,r){const o=pi(r);if(HA.has(i)){const s=[i,o];t.length>0?t[t.length-1].children.push(s):A.push(s);return}t.push({tag:i,attrs:o,children:[]})},ontext(i){const r=i.trim();r&&(t.length>0?t[t.length-1].children.push(r):A.push(r))},onclosetag(i){if(HA.has(i))return;let r=t.length-1;for(;r>=0&&t[r].tag!==i;)r--;if(r>=0)for(;t.length>r;){const o=t.pop(),s=o.children.length>0?[o.tag,o.attrs,...o.children]:[o.tag,o.attrs];t.length>0?t[t.length-1].children.push(s):A.push(s)}},oncomment(i){const r=[null,{},i];t.length>0?t[t.length-1].children.push(r):A.push(r)}},{decodeEntities:!0});return n.write(e.trim()),n.end(),A}const Za=new Set(["ul","ol","table","blockquote","pre"]),Ra={blockquote_open:"blockquote",ordered_list_open:"ol",bullet_list_open:"ul",list_item_open:"li",paragraph_open:"p",table_open:"table",thead_open:"thead",tbody_open:"tbody",tr_open:"tr",th_open:"th",td_open:"td"},Ma={strong_open:"strong",em_open:"em",s_open:"del",sub_open:"sub",sup_open:"sup"};function Ha(e,A){const t={startLine:0,preservePositions:!1,headingIds:!0,...A},n={headingSlugCounts:new Map,headingStack:[],headingIds:t.headingIds??!0},i=[];let r=0,o=t.startLine;for(;r=2){const[o]=r;let s=r[1];if(n&&(s===""||s===null||s===void 0))continue;if(t&&typeof s=="string"){if(s.startsWith("{")&&s.endsWith("}"))try{s=JSON.parse(s)}catch{}else if(s.startsWith("[")&&s.endsWith("]"))try{s=JSON.parse(s)}catch{}}o==="class"&&typeof i[o]=="string"?i[o]=`${i[o]} ${s}`:i[o]=s}return i}function Ua(e){if(!e)return{language:""};const A={language:""};let t=e.trim();const n=t.match(/^([^\s[{]+)/);for(n&&(A.language=n[1],t=t.slice(n[1].length).trim());t&&(t.startsWith("{")||t.startsWith("["));)if(t.startsWith("{")){const i=t.match(/^\{([^}]+)\}/);if(i){const r=i[1];t=t.slice(i[0].length).trim();const o=[],s=r.split(",");for(const c of s){const l=c.trim();if(l.includes("-")){const[a,u]=l.split("-").map(g=>Number.parseInt(g.trim(),10));if(!Number.isNaN(a)&&!Number.isNaN(u))for(let g=a;g<=u;g++)o.push(g)}else{const a=Number.parseInt(l,10);Number.isNaN(a)||o.push(a)}}o.length>0&&(A.highlights=o)}else break}else if(t.startsWith("[")){let i=0,r=0;for(;r0){let g;if(n?.headingIds){const h=mi(u.nodes);g={id:La(Ta(h),c,n),...a}}else g=a;return{node:[l,g,...u.nodes],nextIndex:u.nextIndex+1}}return{node:null,nextIndex:u.nextIndex+1}}if(i.type==="list_item_open"){const c=$(i.attrs,{handleJSON:!1}),l=QA(e,A+1,"list_item_close",!1,!1,!0,n);return l.nodes.length>0?{node:["li",c,...l.nodes],nextIndex:l.nextIndex+1}:{node:null,nextIndex:l.nextIndex+1}}const r=Ra[i.type];if(r){const c=$(i.attrs,{handleJSON:!1}),l=i.type.replace("_open","_close"),a=["td","th"].includes(r),u=QA(e,A+1,l,!1,!1,a,n);return{node:[r,c,...u.nodes],nextIndex:u.nextIndex+1}}const o=i.tag||"component",s=$(i.attrs,{handleJSON:!1});return{node:[o,s],nextIndex:A+1}}function va(e,A,t,n){const i=[];let r=A,o=null,s={},c=[];for(;r0){const u=l.attrs[0];if(Array.isArray(u)&&u.length>0){const g=u[0];if(g.startsWith("#")){const h=g.substring(1),f=$(l.attrs.slice(1));o!==null&&c.length>0&&(i.push(["template",{name:o,...s},...c]),c=[]),o=h,s=f,r++;continue}}}r++;continue}const a=tt(e,r,!1,n);r=a.nextIndex,a.node&&(o!==null?c.push(a.node):i.push(a.node))}return o!==null&&c.length>0&&i.push(["template",{name:o,...s},...c]),{nodes:i,nextIndex:r}}function QA(e,A,t,n,i=!1,r=!1,o){const s=[];let c=A;for(;c0&&(A+=mi(i))}return A}function Ta(e){let A=e.toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/-{2,}/g,"-").replace(/^-+|-+$/g,"");return/^\d/.test(A)&&(A="_"+A),A}function La(e,A,t){if(!t)return e;for(;t.headingStack.length>0&&t.headingStack[t.headingStack.length-1].level>=A;)t.headingStack.pop();if(t.headingStack.length>0){const i=t.headingStack[t.headingStack.length-1];i.level>=2&&(e=i.id+"-"+e)}t.headingStack.push({level:A,id:e});const n=t.headingSlugCounts.get(e)??0;return t.headingSlugCounts.set(e,n+1),n===0?e:`${e}-${n}`}function it(e,A=!1){const t=[];let n=0;for(;n0?[o.tag,o.attrs,...s]:[o.tag,o.attrs],nextIndex:c}}if(n.type==="mdc_inline_span"&&n.nesting===1){const r={};let o=A+1;const s=[];for(;o0||Object.keys(r).length>0?{node:["span",r,...s],nextIndex:l}:{node:null,nextIndex:l}}if(n.type==="mdc_inline_span"&&n.nesting===-1)return{node:null,nextIndex:A+1};if(n.type==="code_inline"){const{attrs:r,nextIndex:o}=he(e,A+1);return n.content?{node:["code",r,n.content],nextIndex:o}:{node:null,nextIndex:o}}if(n.type==="hardbreak"||n.type==="hard_break")return{node:["br",{}],nextIndex:A+1};if(n.type==="softbreak")return{node:` `,nextIndex:A+1};if(n.type==="mdc_inline_component"){const r=n.tag||"component";if(n.nesting===1){const o=[];let s=A+1;for(;s0?c:A+1;return{node:[r,o],nextIndex:a}}}}if(n.type==="image"){const r=$(n.attrs,{handleJSON:!1,filterEmpty:!0});n.content&&(r.alt=n.content);const{attrs:o,nextIndex:s}=he(e,A+1);return Object.assign(r,o),{node:["img",r],nextIndex:s}}if(n.type==="link_open"){const r=$(n.attrs,{handleJSON:!1}),o=on(e,A+1,"link_close",t),{attrs:s,nextIndex:c}=he(e,o.nextIndex+1);return Object.assign(r,s),o.nodes.length>0?{node:["a",r,...o.nodes],nextIndex:c}:{node:null,nextIndex:c}}if(n.type==="math_inline")return{node:["math",{class:"math inline",content:n.content},n.content],nextIndex:A+1};const i=Ma[n.type];if(i){const r=n.type.replace("_open","_close"),o=on(e,A+1,r,t),{attrs:s,nextIndex:c}=he(e,o.nextIndex+1);return o.nodes.length>0?{node:[i,s,...o.nodes],nextIndex:c}:{node:null,nextIndex:c}}if(n.children){const r=it(n.children,t);return{node:r.length===1?r[0]:null,nextIndex:A+1}}return{node:null,nextIndex:A+1}}function on(e,A,t,n=!1){const i=[];let r=A;for(;r0?r=u:r++,i.push([c,l]);continue}const s=Me(e,r,n);r=s.nextIndex,s.node&&i.push(s.node)}return{nodes:nt(i),nextIndex:r}}function Pa(e,A){let t=-1,n=A.nodes.length-1,i=!1;for(;n>=0;){const o=A.nodes[n];if(o[1]&&o[1].$?.line)if(i){t=n;break}else i=!0;n--}const r=t!==-1?A.nodes[t]:null;if(r){const o=r[1].$?.line??0;return{remainingMarkdownStartLine:o,reusedNodes:A.nodes.slice(0,t+1),remainingMarkdown:e.split(` `).slice(o).join(` `)||""}}return{remainingMarkdownStartLine:0,remainingMarkdown:e,reusedNodes:[]}}const sn={end:()=>{}},Xa={startSpan:()=>sn,startActiveSpan:(e,A,t)=>(typeof A=="function"?A:t)(sn)};function Re(e,A,t,n){return e.startActiveSpan(A,{},i=>{try{const r=t();return r instanceof Promise?r.finally(()=>i.end()):(i.end(),r)}catch(r){throw i.end(),r}})}function Va(e={}){const{autoUnwrap:A=!0,autoClose:t=!0,tracer:n=Xa}=e,i=ma(e.unwrap),r=e.plugins??[];e.html!==void 0&&console.warn("[comark] `ParserOptions.html` is deprecated and will be removed in a future major version. Use `registerDefaultPlugins: false` and register `html()` from `comark/plugins/html` only when needed.");const o=e.registerDefaultPlugins!==!1?[pa(),...e.html!==!1?[ha()]:[],Ll(),Tl(),Zl(),Hl()]:[],s=ks([...r,...o]),c=h=>s.some(f=>f.name===h),l=new Bs({linkify:e.linkify??!0}).enable(["table","strikethrough"]);for(const h of s)for(const f of h.markdownItPlugins||[])l.use(f);let a=null,u=null;return async(h,f={})=>await Re(n,"comark:parse",async()=>{const d={options:e,tokens:[],markdown:h,tree:null,parsedLines:0,reusableNodes:[],frontmatterText:"",frontmatter:{}},m=a,b=h.startsWith(u??"");if(f.streaming&&m&&b){const{remainingMarkdownStartLine:F,reusedNodes:S,remainingMarkdown:D}=Pa(h,m);if(!D)return m;d.parsedLines=F,d.markdown=D,d.reusableNodes=S}t&&(d.markdown=Re(n,"comark:autoclose",()=>xi(d.markdown,{frontmatter:c("frontmatter")&&f.streaming,syntax:c("components")})));for(const F of s)F.pre&&await Re(n,`comark:pre:${F.name}`,()=>F.pre(d));try{d.tokens=Re(n,"comark:tokenize",()=>l.parse(d.markdown,{}))}catch(F){if(f.streaming&&m)return m;throw F}const I=n.startSpan("comark:nodes");let C=Ha(d.tokens,{startLine:d.parsedLines,preservePositions:f.streaming??!1,headingIds:e.headingIds??!0});A&&(C=C.map(F=>mn(F))),i.length>0&&(C=Ba(C,i)),I.end();const B=d.frontmatter??{},k=d.frontmatterText??"";f.streaming?(d.tree={frontmatter:k?B:m?.frontmatter??B,meta:{},nodes:[...d.reusableNodes,...C]},a=d.tree,u=h):(d.tree={frontmatter:B,meta:{},nodes:C},a=null,u=null);for(const F of s)F.post&&await Re(n,`comark:post:${F.name}`,()=>F.post(d));return d.tree})}function ja(e={}){return bs(Va(e))}const cn=" ",ln="background-color: currentColor; display: inline-block; margin-left: 0.25rem; margin-right: 0.25rem; animation: pulse 0.75s cubic-bezier(0.4,0,0.6,1) infinite;";function za(e){if(e===!0)return["span",{key:"stream-caret",style:ln},cn];if(typeof e=="object"){const A=e?.class||"";return["span",{key:"stream-caret",style:ln,...A?{class:A}:{}},cn]}return null}function Ci(e,A){for(let t=e.length-1;t>=2;t--){const n=e[t];if(typeof n=="string"&&e[1]?.key!=="stream-caret")return e.push(A),!0;if(Array.isArray(n)&&Ci(n,A))return!0}return!1}const $e=new Map;function qa(e){return!!e&&typeof e.then=="function"}function $a(e){return e&&typeof e=="object"&&"default"in e?e.default:e}function an(e){return Array.isArray(e)&&e.length>=1?e[0]:null}function un(e){return Array.isArray(e)&&e.length>=2?e[1]||{}:{}}function hn(e){return Array.isArray(e)&&e.length>2?e.slice(2):[]}function fn(e,A,t){const n=Fi()?.appContext?.components,i=xl(e),r=`Prose${i}`;let o=A[r]||A[e]||A[i]||n?.[r]||n?.[i];if(!o&&t){const s=e;if(!$e.has(s)){const c=t(e);qa(c)?$e.set(s,Di(()=>c)):c&&$e.set(s,$a(c))}o=$e.get(s)}return o}function UA(e,A={},t,n,i,r={frontmatter:{},meta:{},data:{},props:{}}){if(typeof e=="string")return e;if(Array.isArray(e)){const o=an(e);if(!o)return null;const s=un(e),c=hn(e);let l;i?.[0]!=="pre"&&(s.as&&(l=fn(s.as,A,n)),l||(l=fn(o,A,n)));const a=l||o,u=yl(s,r,{parseJson:!0}),g={};for(const b in u)b==="className"?g.class=u[b]:g[b]=u[b];if((a?.props?.__node||a?.__asyncResolved?.props?.__node)&&(g.__node=e),t!==void 0&&(g.key=t),e.length===2)return Ee(a,g);const f=Object.keys(u).length>0?{...r,props:g}:r,d={},m=[];for(let b=0;bS.map((D,_)=>UA(D,A,_,n,e,f)).filter(D=>D!==null);continue}}const k=UA(I,A,b,n,e,f);k!==null&&m.push(k)}return l?(m.length>0&&(d.default=()=>m),Ee(a,g,d)):Ee(a,g,m)}return null}const gn=dn({name:"MarkdownDocument",props:{value:{type:Object,default:void 0},components:{type:Object,default:()=>({})},componentsManifest:{type:Function,default:void 0},streaming:{type:Boolean,default:!1},caret:{type:[Boolean,Object],default:!1},data:{type:Object,default:()=>({})},documentKey:{type:String,default:void 0}},async setup(e){const A=eA(()=>e.value??{nodes:[],frontmatter:{},meta:{}}),t=yi(new Set),n=pn(null),i=A.value.meta?.key||e.documentKey;if(i&&globalThis.comarkContext){const l=globalThis.comarkContext.get(i,ot(A.value)).listen(a=>{n.value=a});Bi(()=>l(!0))}bi((l,a,u)=>{const g=a?.$?.type?.name||a?.type?.name||"unknown";return t.value.add(g),!1});const r=ki("comark",{components:{},componentManifest:()=>null}),o=eA(()=>({...r?.components,...e.components})),s=l=>{let a=e.componentsManifest?.(l);return a||(a=r?.componentManifest(l)),a||null},c=eA(()=>za(e.caret||!1));return()=>{const l=ot(n.value??A.value),a=[...l.nodes||[]];e.streaming&&c.value&&a.length>0&&(Ci(a[a.length-1],c.value)||a.push(c.value));const u={frontmatter:l.frontmatter||l.data||{},meta:l.meta||{},data:e.data||{},props:{}},g=a.map((h,f)=>UA(h,o.value,f,s,void 0,u)).filter(h=>h!==null);return Ee("div",{class:"comark-content"},g)}}}),nu=dn({name:"Markdown",props:{value:{type:[String,Object],default:void 0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},unwrap:{type:[Boolean,String,Array],default:!1},components:{type:Object,default:()=>({})},componentsManifest:{type:Function,default:void 0},streaming:{type:Boolean,default:!1},summary:{type:Boolean,default:!1},caret:{type:[Boolean,Object],default:!1},data:{type:Object,default:()=>({})}},async setup(e,A){const t=eA(()=>{if(je(e.value))return"";let r=e.value;const o=A.slots.default?.();return o&&o.length>0&&typeof o[0].children=="string"&&(r=o[0].children),e.summary&&(r=r?.split("")[0]),(r||"").trim()}),n=pn(null),i=ja({...e.options,...e.unwrap?{unwrap:e.unwrap}:{},plugins:e.plugins});return Ei(()=>[t.value,e.streaming],()=>{je(e.value)||i(t.value,{streaming:e.streaming}).then(r=>n.value=r)}),je(e.value)||await i(t.value,{streaming:e.streaming}).then(r=>n.value=r),()=>je(e.value)?Ee(gn,{value:e.value,components:e.components,streaming:e.streaming,componentsManifest:e.componentsManifest,class:e.streaming?"comark-stream":"",caret:e.caret,data:e.data}):Ee(gn,{value:n.value||{nodes:[],frontmatter:{},meta:{}},components:e.components,streaming:e.streaming,componentsManifest:e.componentsManifest,class:e.streaming?"comark-stream":"",caret:e.caret,data:e.data})}});export{nu as M};

AltStyle によって変換されたページ (->オリジナル) /