import{h as Z$,provide as JJ,inject as QJ,computed as c6}from"vue";var b=32,w=9,H9=13,g=10,a=96,M0=126,W0=91,a0=94,d=62,Y9=35,X$=37,u=45,g0=61,_0=92,O0=42,K0=95,e=60,Y$=64,u0=93,S0=33,S$=38,E0=58,E$=70,D9=102,f9=104,F9=119,h9=116,O$=112,x$=115,$6=160,Z6=12,J6=44,g$=59,i9=63,p0=46,H0=47,k9=39,j9=34,B9=43,v0=124,L9=123,H$=125,n0=40,s0=41,a9=30,D$=31,o=48,r=57,p=65,c=90,Y0=97,q0=122,n9=128,o0=32,_Z={blockQuote:0,breakLine:1,breakThematic:2,codeBlock:3,codeInline:4,footnote:5,footnoteReference:6,frontmatter:7,gfmTask:8,heading:9,htmlBlock:10,htmlComment:11,htmlSelfClosing:12,image:13,link:14,orderedList:15,paragraph:16,ref:17,refCollection:18,table:19,text:20,textFormatted:21,unorderedList:22},_=_Z;import{decodeEntity as NZ}from"markdown-to-jsx/entities";function q6($){if(!V6($,"---"))return null;let J=3;for(;J<$.length&&($[J]===" "||$[J]==="	");)J++;if(J<$.length&&$[J]==="\r"&&J++,J>=$.length||$[J]!==`
`)return null;J++;let Z=!1;for(;J<$.length;){let Q=J;for(;J<$.length&&$[J]!==`
`&&$[J]!=="\r";)J++;if(J>=$.length)break;let V=J;if($[J]==="\r"&&J++,J<$.length&&$[J]===`
`&&J++,V6($,"---",Q))return{endPos:J,hasValidYaml:Z};if(!Z){let X=yZ($,Q,V);if(X<V){let Y=$.charCodeAt(X);if(Y>=Y0&&Y<=q0||Y>=p&&Y<=c||Y>=o&&Y<=r||Y===K0){for(X++;X<V&&(Y=$.charCodeAt(X),Y>=Y0&&Y<=q0||Y>=p&&Y<=c||Y>=o&&Y<=r||Y===K0||Y===u||Y===p0);)X++;X<V&&$.charCodeAt(X)===E0&&(X++,X>=V?Z=!0:(Y=$.charCodeAt(X),(Y===b||Y===w)&&(Z=!0)))}}}}return null}var vZ=/&([a-zA-Z0-9]+|#[0-9]{1,7}|#x[0-9a-fA-F]{1,6});/gi,IZ={class:"className",for:"htmlFor",allowfullscreen:"allowFullScreen",allowtransparency:"allowTransparency",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",classid:"classId",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",crossorigin:"crossOrigin",enctype:"encType",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap",viewbox:"viewBox"};function HJ($){var J={};for(var Z in $){var Q=Z.toLowerCase(),V=IZ[Q];if(V)J[V]=$[Z];else{var X=Z.indexOf(":");X!==-1?J[Z.slice(0,X)+Z[X+1].toUpperCase()+Z.slice(X+2)]=$[Z]:J[Z]=$[Z]}}return J}var U6=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s|^<(div|p|h[1-6]|ul|ol|li|blockquote|pre|table|thead|tbody|tr|td|th|dl|dt|dd|hr|address|article|aside|details|dialog|figure|figcaption|footer|form|header|main|menu|nav|section|summary|textarea|fieldset|legend|center|dir|hgroup|marquee|search|output|template)\b)/i;function s9($){return $.indexOf("&")===-1?$:$.replace(vZ,(J,Z)=>{var Q=NZ(Z);if(Q)return Q;if(Z[0]==="#"){var V=Z[1]==="x"||Z[1]==="X"?parseInt(Z.slice(2),16):parseInt(Z.slice(1),10);return V===0||V>=55296&&V<=57343||V>1114111?"\uFFFD":V<=65535?String.fromCharCode(V):String.fromCharCode(55296+(V-65536>>10),56320+(V-65536&1023))}return J})}var Q6=/(javascript|vbscript|data(?!:image)):/i;function u9($){if(Q6.test($))return null;if($.indexOf("%")===-1)return $;try{let J=decodeURIComponent($).replace(/[^A-Za-z0-9/:]/g,"");if(Q6.test(J))return null}catch{return null}return $}var x0={},T0,w0;for(T0=[192,193,194,195,196,197,224,225,226,227,228,229,230,198],w0=0;w0<T0.length;w0++)x0[T0[w0]]="a";for(x0[231]=x0[199]="c",x0[240]=x0[208]="d",T0=[200,201,202,203,233,232,234,235],w0=0;w0<T0.length;w0++)x0[T0[w0]]="e";for(T0=[207,239,206,238,205,237,204,236],w0=0;w0<T0.length;w0++)x0[T0[w0]]="i";for(x0[209]=x0[241]="n",T0=[248,216,339,338,213,245,212,244,211,243,210,242],w0=0;w0<T0.length;w0++)x0[T0[w0]]="o";for(T0=[220,252,219,251,218,250,217,249],w0=0;w0<T0.length;w0++)x0[T0[w0]]="u";x0[376]=x0[255]=x0[221]=x0[253]="y";function f0($){for(var J="",Z=-1,Q=$.length,V=0;V<Q;V++){var X=$.charCodeAt(V);if(X>=Y0&&X<=q0||X>=o&&X<=r){Z<0&&(Z=V);continue}if(X>=p&&X<=c){Z>=0&&(J+=$.slice(Z,V),Z=-1),J+=String.fromCharCode(X+o0);continue}if(X===b||X===u){Z>=0&&(J+=$.slice(Z,V),Z=-1),J+="-";continue}Z>=0&&(J+=$.slice(Z,V),Z=-1);var Y=x0[X];Y&&(J+=Y)}return Z>=0&&(J+=$.slice(Z)),J}function V6($,J,Z){return $.startsWith(J,Z)}var X6=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr","circle","ellipse","line","path","polygon","polyline","rect","use","stop","animate","set"]);function p9($){let J=$.toLowerCase();if(X6.has(J))return!0;let Z=J.indexOf(":");return Z!==-1?(J=J.slice(Z+1),X6.has(J)):!1}var M9=1,Y6=2,m9=4,G6=8,bZ=16,t0=32,A9=64,K6=1,PZ=2,wZ=3,RZ=4,F6=(function(){var $=new Uint8Array(128),J;for($[w]=M9,$[g]=M9|Y6,$[Z6]=M9,$[H9]=M9|Y6,$[b]=M9,J=S0;J<=H0;J++)$[J]=m9;for(J=E0;J<=Y$;J++)$[J]=m9;for(J=W0;J<=a;J++)$[J]=m9;for(J=L9;J<=M0;J++)$[J]=m9;for(J=o;J<=r;J++)$[J]=bZ;for(J=p;J<=c;J++)$[J]=G6;for(J=Y0;J<=q0;J++)$[J]=G6;return $})(),DJ=(function(){let $=new Uint8Array(128);return $[_0]=PZ,$[W0]=RZ,$[O0]=$[K0]=$[M0]=$[g0]=wZ,$[a]=$[e]=$[Y$]=$[u0]=$[g]=$[b]=$[S0]=K6,$[D9]=$[f9]=$[F9]=K6,$})(),W6=/[\p{P}\p{S}]/u,z6=/\p{Zs}/u,C9=[];function f$($){var J=$.indexOf("\r"),Z=$.indexOf("\0");if(J===-1&&Z===-1)return $;var Q=$.length;C9.length=0;var V=0,X=0;for(J===-1?X=Z:Z===-1?X=J:X=J<Z?J:Z;X<Q;X++){var Y=$.charCodeAt(X);Y===H9?(V<X&&C9.push($.slice(V,X)),X+1<Q&&$.charCodeAt(X+1)===g&&X++,C9.push(`
`),V=X+1):Y===0&&(V<X&&C9.push($.slice(V,X)),C9.push("\uFFFD"),V=X+1)}return V<Q&&C9.push($.slice(V)),C9.join("")}function yZ($,J,Z){let Q=Z??$.length;for(;J<Q&&($[J]===" "||$[J]==="	");)J++;return J}function jJ($){if(!$)return!1;for(var J in $)return!0;return!1}function t9($,J,Z){for(var Q=$,V=J.split("."),X=0;X<V.length&&(Q=Q?.[V[X]],Q!==void 0);)X++;return Q||Z}function O6($){for(var J=!1,Z=0;Z<$.length;Z++){var Q=$.charCodeAt(Z);if(Q<=b||Q===j9||Q===X$||Q===e||Q===d||Q===W0||Q===_0||Q===u0||Q===a0||Q===a||Q>=123){J=!0;break}}if(!J)return $;for(var V="",Z=0;Z<$.length;Z++){var Q=$.charCodeAt(Z);if(Q===X$&&Z+2<$.length){var X=$.charCodeAt(Z+1),Y=$.charCodeAt(Z+2);if((X>=o&&X<=r||X>=p&&X<=E$||X>=Y0&&X<=D9)&&(Y>=o&&Y<=r||Y>=p&&Y<=E$||Y>=Y0&&Y<=D9)){V+=$[Z]+$[Z+1]+$[Z+2],Z+=2;continue}}V+=encodeURI($[Z])}return V}function BJ(...$){return $.filter(Boolean).join(" ")}function MJ($,J){if(!J)return $;let Z=t9(J,$,void 0);return typeof Z=="string"?Z:typeof Z=="object"&&Z.component?Z.component:$}function AJ($,J){if(!J)return{};let Z=t9(J,$,void 0);return typeof Z=="object"&&Z.props?Z.props:{}}var kZ=new Set(["title","textarea","style","xmp","iframe","noembed","noframes","script","plaintext"]),j$=/<(\/?)(title|textarea|style|xmp|iframe|noembed|noframes|script|plaintext)(\s|>|\/)/gi;function h$($){return kZ.has($.toLowerCase())}function _J($){return j$.lastIndex=0,j$.test($)}function C$($){return j$.lastIndex=0,$.replace(j$,function(J,Z,Q,V){return"&lt;"+Z+Q+V})}var R6=/^<([a-zA-Z][a-zA-Z0-9-]*)\s[^>]*>/,y6=/^<[A-Z]/,m$=["script","pre","style","textarea"],q$=new Set(m$),LZ=/<(?:pre|script|style|textarea)\b/i,D6=/<(?:pre|script|style|textarea)\b/iy,j6=/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m,B6=/^<([a-z][^ >/\n\r]*) ?([^>]*?)>/im,k6=new Uint8Array(128);(function(){for(var $=[a,O0,K0,M0,g0,W0,S0,e,_0,D$,f9,F9,D9],J=0;J<$.length;J++)k6[$[J]]=1})();var M6=/([a-zA-Z_][a-zA-Z0-9_-]*)=(?:"([^"]*)"|'([^']*)')/g;function L6($){return q$.has($)}function wJ($){return LZ.test($)}function S6($,J,Z){for(var Q=J,V=Z;Q<V&&($.charCodeAt(Q)===b||$.charCodeAt(Q)===w);)Q++;if(Q>=V)return!1;$.charCodeAt(Q)===v0&&Q++;for(var X=0;Q<V;){for(;Q<V&&($.charCodeAt(Q)===b||$.charCodeAt(Q)===w);)Q++;if(Q>=V)break;if($.charCodeAt(Q)===v0&&X>0){for(var Y=Q+1;Y<V&&($.charCodeAt(Y)===b||$.charCodeAt(Y)===w);)Y++;if(Y>=V)return!0}if($.charCodeAt(Q)===E0&&Q++,Q>=V||$.charCodeAt(Q)!==u)return!1;for(;Q<V&&$.charCodeAt(Q)===u;)Q++;for(Q<V&&$.charCodeAt(Q)===E0&&Q++,X++;Q<V&&($.charCodeAt(Q)===b||$.charCodeAt(Q)===w);)Q++;if(Q<V)if($.charCodeAt(Q)===v0)Q++;else return!1}return X>0}function N9($,J){if($.charCodeAt(J)!==e)return null;let Z=J+1,Q=$.length,V=!1;$.charCodeAt(Z)===H0&&(Z++,V=!0);let X=Z,Y=$.charCodeAt(Z);if(!(Y>=Y0&&Y<=q0||Y>=p&&Y<=c))return null;for(;Z<Q&&($.charCodeAt(Z)>=Y0&&$.charCodeAt(Z)<=q0||$.charCodeAt(Z)>=p&&$.charCodeAt(Z)<=c||$.charCodeAt(Z)>=o&&$.charCodeAt(Z)<=r||$.charCodeAt(Z)===u);)Z++;let G=$.slice(X,Z);if(!G)return null;let K=Z;for(;Z<Q&&($.charCodeAt(Z)===b||$.charCodeAt(Z)===w||$.charCodeAt(Z)===g);)Z++;let q=$.slice(K,Z);if(Z===K&&Z<Q){var U=$.charCodeAt(Z);if(U!==d&&U!==H0)return null}let F=Z,O={},z=!1;for(;Z<Q;){let S=$.charCodeAt(Z);if(S===d){let L=$.slice(F,Z);return{tag:G,attrs:O,selfClosing:!1,end:Z+1,rawAttrs:L,whitespaceBeforeAttrs:q,isClosing:V,hasSpaceBeforeSlash:z}}if(S===b||S===w||S===g){Z++;continue}if(S===H0&&Z+1<Q&&$.charCodeAt(Z+1)===d){let L=$.slice(F,Z);return z=Z>F&&$.charCodeAt(Z-1)===b,{tag:G,attrs:O,selfClosing:!0,end:Z+2,rawAttrs:L,whitespaceBeforeAttrs:q,isClosing:V,hasSpaceBeforeSlash:z}}var H=Z,j=$.charCodeAt(Z);if(!(j>=Y0&&j<=q0||j>=p&&j<=c||j===K0||j===E0))return null;for(Z++;Z<Q;){var W=$.charCodeAt(Z);if(W>=Y0&&W<=q0||W>=p&&W<=c||W>=o&&W<=r||W===K0||W===p0||W===E0||W===u)Z++;else break}for(var M=$.slice(H,Z);Z<Q&&($.charCodeAt(Z)===b||$.charCodeAt(Z)===w);)Z++;if($.charCodeAt(Z)!==g0){O[M]="";continue}for(Z++;Z<Q&&($.charCodeAt(Z)===b||$.charCodeAt(Z)===w);)Z++;var D=$.charCodeAt(Z);if(D===j9||D===k9){Z++;for(var N=Z;Z<Q&&$.charCodeAt(Z)!==D;)Z++;if(Z>=Q)return null;if(O[M]=$.slice(N,Z),Z++,Z<Q){var I=$.charCodeAt(Z);if(I!==b&&I!==w&&I!==g&&I!==d&&I!==H0)return null}}else if(D===L9){var v=1,N=Z;for(Z++;Z<Q&&v>0;){var W=$.charCodeAt(Z);W===L9?v++:W===H$&&v--,Z++}O[M]=$.slice(N,Z)}else{for(var N=Z;Z<Q;){var B=$.charCodeAt(Z);if(B===b||B===w||B===d||B===g||B===j9||B===k9||B===g0||B===e||B===a)break;Z++}if(Z===N)return null;O[M]=$.slice(N,Z)}}return null}function E6($,J,Z){if(!Z.streaming&&!Z.optimizeForStreaming&&$.indexOf("[")===-1)return!1;for(var Q=0,V=$.length,X=!1,Y=!1;Q<V;){for(var G=$.indexOf(`
`,Q),K=G<0?V:G,q=Q,U=0;q<K&&U<4;)if($.charCodeAt(q)===b)U++,q++;else if($.charCodeAt(q)===w)U+=4,q++;else break;if(q>=K){X=!1,Q=G<0?V:G+1;continue}if(U<4){var F=$.charCodeAt(q);if(F===a||F===M0){for(var O=F,z=0,H=q;H<K&&$.charCodeAt(H)===O;)z++,H++;if(z>=3){var j=!0;if(O===a){for(var W=H;W<K;W++)if($.charCodeAt(W)===a){j=!1;break}}if(j){X=!1;for(var M=G<0?V:G+1;M<V;){for(var D=M,N=0;D<V&&N<4;){var I=$.charCodeAt(D);if(I===b)N++,D++;else if(I===w)N+=4,D++;else break}if(N<4&&D<V&&$.charCodeAt(D)===O){for(var v=0;D<V&&$.charCodeAt(D)===O;)v++,D++;if(v>=z){for(;D<V&&($.charCodeAt(D)===b||$.charCodeAt(D)===w);)D++;if(D>=V||$.charCodeAt(D)===g){Q=D>=V?V:D+1;break}}}for(;M<V&&$.charCodeAt(M)!==g;)M++;M<V&&M++}M>=V&&(Q=V,Y=!0);continue}}}}for(var B=q;B<K&&$.charCodeAt(B)===d;){B++,B<K&&$.charCodeAt(B)===b&&B++;for(var S=0;B<K&&S<4;)if($.charCodeAt(B)===b)S++,B++;else if($.charCodeAt(B)===w)S+=4,B++;else break;if(S>=4)break;X=!1}if(!X&&U<4&&B<K&&$.charCodeAt(B)===W0&&!(B+1<V&&$.charCodeAt(B+1)===a0)){var L=x6($,B,J);if(L){Q=L,X=!1;continue}}var R=$.charCodeAt(q);if(R===Y9&&U<4)X=!1;else if(U<4&&(R===u||R===O0||R===K0)){for(var P=q,y=0;P<K;){var k=$.charCodeAt(P);if(k===R)y++;else if(k!==b&&k!==w)break;P++}X=!(y>=3&&P>=K)}else X=!0;Q=G<0?V:G+1}return Y}function x6($,J,Z){let Q=$.length;if($.charCodeAt(J)!==W0)return null;let V=J+1<Q&&$.charCodeAt(J+1)===a0,X=J+1;for(;X<Q;){var Y=$.charCodeAt(X);if(Y===u0){X++;break}if(Y===W0)return null;Y===_0&&X+1<Q&&X++,X++}if(X>Q||$.charCodeAt(X-1)!==u0)return null;let G=$.slice(J+1,X-1);if(G.length>999)return null;let K=B$(G);if(!K||X>=Q||$.charCodeAt(X)!==E0)return null;X++;let q=!1;for(;X<Q;){let E=$.charCodeAt(X);if(E===b||E===w)X++;else if(E===g&&!q)q=!0,X++;else break}if(V){let E=$.indexOf(`
`,X),h=E<0?Q:E,f=$.slice(X,h).trim();return Z[K]={target:f,title:void 0},E<0?Q:E+1}var U;if(X<Q&&$.charCodeAt(X)===e){X++;for(var F=X;X<Q&&$.charCodeAt(X)!==d&&$.charCodeAt(X)!==g;)$.charCodeAt(X)===_0&&X+1<Q&&X++,X++;if(X>=Q||$.charCodeAt(X)!==d)return null;U=$.slice(F,X),X++;for(var O=$.indexOf(`
`,X),z=O<0?Q:O,H=X;H<z&&($.charCodeAt(H)===b||$.charCodeAt(H)===w);)H++;if(H<z){if(H===X)return null;var j=$.charCodeAt(H);if(j!==j9&&j!==k9&&j!==n0)return null}}else{for(var F=X,W=0;X<Q;){var Y=$.charCodeAt(X);if(Y===n0)W++;else if(Y===s0){if(W===0)break;W--}else{if(Y===b||Y===w||Y===g)break;Y===_0&&X+1<Q&&X++}X++}if(U=$.slice(F,X),!U)return null}for(;X<Q&&($.charCodeAt(X)===b||$.charCodeAt(X)===w);)X++;var M=$.indexOf(`
`,X),D=M<0?Q:M,N,I=!1,v=X,B=X;if(X===D&&X<Q)for(B=X+1;B<Q&&($.charCodeAt(B)===b||$.charCodeAt(B)===w);)B++;if(B<Q){var S=$.charCodeAt(B);if(S===j9||S===k9||S===n0){for(var L=S===n0?41:S,R=B+1,P=R;R<Q;){var y=$.charCodeAt(R);if(y===L){for(var k=R+1;k<Q&&($.charCodeAt(k)===b||$.charCodeAt(k)===w);)k++;(k>=Q||$.charCodeAt(k)===g)&&(N=$.slice(P,R),I=!0,v=k<Q?k+1:Q);break}if(y===_0&&R+1<Q){R+=2;continue}if(y===g&&R+1<Q&&$.charCodeAt(R+1)===g)break;R++}if(!I&&B===X)return null}}if(I)return Z[K]||(Z[K]={target:$$(U),title:N!==void 0?s9($$(N)):N}),v;for(;X<D&&($.charCodeAt(X)===b||$.charCodeAt(X)===w);)X++;return X<D?null:(Z[K]||(Z[K]={target:$$(U),title:N}),M<0?Q:M+1)}var C0=new Uint8Array(F6);for(C0[D$]=M9,C0[Y9]|=t0,C0[d]|=t0,C0[u]|=t0|A9,C0[B9]|=t0,C0[O0]|=t0|A9,C0[K0]|=t0|A9,C0[a]|=t0|A9,C0[M0]|=t0|A9,C0[e]|=t0|A9,C0[W0]|=A9,C0[S0]|=A9,C0[v0]|=t0,G$=o;G$<=r;G$++)C0[G$]|=t0;var G$;function A6($){if($.indexOf("[")<0&&$.indexOf("]")<0)return!1;for(var J=0;J<$.length;J++){if($.charCodeAt(J)===_0){J++;continue}if($.charCodeAt(J)===W0||$.charCodeAt(J)===u0)return!0}return!1}function B$($){var J=$.replace(/\s+/g," ").trim();return J.indexOf("\u1E9E")!==-1?J.replace(/\u1E9E/g,"ss").toLowerCase():J.toLowerCase()}function d$($){return $<n9?C0[$]:$===$6?M9:0}function $$($){return $.replace(/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,"$1")}var g6=null,T6=-1,f6=-1;function J0($,J){if(J===T6&&$===g6)return f6;var Z=$.indexOf(`
`,J);return Z<0?$.length:Z}function i($,J){let Z=J0($,J);return Z<$.length?Z+1:Z}function K$($,J,Z){for(;J<Z;){let Q=$.charCodeAt(J);if(Q!==b&&Q!==w)break;J++}return J}function _6($,J){let Z=i($,J);for(;Z<$.length;){let Q=J0($,Z);if(d0($,Z,Q))return Z;Z=i($,Z)}return $.length}function I9($,J,Z,Q){let V=0;for(;J+V<Z&&$.charCodeAt(J+V)===Q;)V++;return V}var $0=0,t=0;function A0($,J,Z){for($0=0,t=0;J+t<Z;){let Q=$.charCodeAt(J+t);if(Q===w)$0+=4-$0%4;else if(Q===b)$0++;else break;t++}}function d0($,J,Z){return K$($,J,Z)>=Z}function h6($,J,Z,Q){let V=J0($,J);if(A0($,J,V),$0>3)return null;let X=J+t;if($.charCodeAt(X)!==Y9)return null;let Y=I9($,X,V,35);if(Y<1||Y>6||(X+=Y,X<V&&$.charCodeAt(X)!==b&&$.charCodeAt(X)!==w))return null;X=K$($,X,V);for(var G=V;G>X&&$.charCodeAt(G-1)===b;)G--;for(var K=G;G>X&&$.charCodeAt(G-1)===Y9;)G--;if(G<K)if(G===X||$.charCodeAt(G-1)===b)for(;G>X&&$.charCodeAt(G-1)===b;)G--;else G=K;let q=$.slice(X,G),U=h0(q,0,q.length,Z,Q),O=(Q?.slugify||f0)(q);return{node:{type:_.heading,level:Y,children:U,id:O},end:i($,V)}}function SZ($,J,Z){var Q=$.charCodeAt(J);if(Q!==g0&&Q!==u)return!1;for(var V=J;V<Z&&$.charCodeAt(V)===Q;)V++;for(;V<Z&&($.charCodeAt(V)===b||$.charCodeAt(V)===w);)V++;return V>=Z}function x9($,J){let Z=J0($,J);if(A0($,J,Z),$0>3)return null;let Q=J+t,V=$.charCodeAt(Q);if(V!==u&&V!==O0&&V!==K0)return null;let X=0;for(;Q<Z;){let Y=$.charCodeAt(Q);if(Y===V)X++;else if(Y!==b&&Y!==w)return null;Q++}return X<3?null:{node:{type:_.breakThematic},end:i($,Z)}}function EZ($,J,Z){let Q=J0($,J);if(A0($,J,Q),$0>3)return null;let V=$0,X=t,Y=J+t,G=$.charCodeAt(Y);if(G!==a&&G!==M0)return null;let K=I9($,Y,Q,G);if(K<3)return null;Y+=K;let q=K$($,Y,Q),U=Q;if(G===a){for(let R=q;R<Q;R++)if($.charCodeAt(R)===a)return null}for(;U>q&&($.charCodeAt(U-1)===b||$.charCodeAt(U-1)===w);)U--;let F=$.slice(q,U),O="",z="",H=F.indexOf(" ");H===-1?O=F:(O=F.slice(0,H),z=F.slice(H+1).trim()),O=$$(O);var j=void 0;if(z){M6.lastIndex=0;for(var W;(W=M6.exec(z))!==null;)j||(j={}),j[W[1]]=W[2]!==void 0?W[2]:W[3]}let M=i($,Q),D=M,N=$.length;for(;D<$.length;){let R=J0($,D);if(A0($,D,R),$0<4){let P=D+t;var I=I9($,P,R,G);if(I>=K){let y=P+I;if(d0($,y,R)){N=i($,R);break}}}D=i($,R)}var v;if(V===0)v=D>M&&$.charCodeAt(D-1)===g?$.slice(M,D-1):$.slice(M,D);else{v="";for(var B=M;B<D;){var S=J0($,B);A0($,B,S);var L=Math.min(t,V);v+=$.slice(B+L,S)+`
`,B=i($,S)}v.length>0&&v.charCodeAt(v.length-1)===g&&(v=v.slice(0,-1))}return{node:{type:_.codeBlock,lang:O||void 0,text:v,infoString:z||void 0,attrs:j},end:N}}function xZ($,J){let Z=J0($,J);if(A0($,J,Z),$0<4)return null;let Q="",V=J;for(;V<$.length;){let z=J0($,V);if(A0($,V,z),d0($,V,z)){for(var X=0,Y=i($,z);Y<$.length;){var G=J0($,Y);if(d0($,Y,G)){X++,Y=i($,G);continue}if(A0($,Y,G),$0>=4){for(var K=0;K<=X;K++)Q+=`
`;V=Y;break}break}if(V!==Y)break;continue}if($0<4)break;let H=0,j=0;var q=0;for(let W=V;W<z&&j<4;W++){if($.charCodeAt(W)===w){var U=4-j%4;j+U>4&&(q=j+U-4),j+=U}else j++;H++}var F="";if(q>0)for(var O=0;O<q;O++)F+=" ";F+=$.slice(V+H,z),Q+=F+`
`,V=i($,z)}for(;Q.length>0&&Q.charCodeAt(Q.length-1)===g;)Q=Q.slice(0,-1);for(;Q.length>0&&Q.charCodeAt(Q.length-1)===g;)Q=Q.slice(0,-1);return Q?{node:{type:_.codeBlock,lang:void 0,text:Q,infoString:void 0,attrs:void 0},end:V}:null}function gZ($,J,Z,Q){let V=J0($,J);if(A0($,J,V),$0>3)return null;let X=J+t;if($.charCodeAt(X)!==d)return null;let Y="",G=J,K,q=!1,U=!1,F=!1;for(;G<$.length;){let x=J0($,G);A0($,G,x);let D0=G+t;if($.charCodeAt(D0)===d){let Q0=D0+1;var O=$0+1,z=!1;if(Q0<x){var H=$.charCodeAt(Q0);H===b?(Q0++,O++,z=!0):H===w&&(z=!0)}for(var j="",W=!1,M=Q0;M<x;M++)if($.charCodeAt(M)===w){W=!0;break}if(W){var D=O;if(z&&Q0<x&&$.charCodeAt(Q0)===w){for(var N=4-D%4,I=0;I<N-1;I++)j+=" ";D+=N,Q0++}for(var v=Q0;v<x;v++)if($.charCodeAt(v)===w){for(var B=4-D%4,S=0;S<B;S++)j+=" ";D+=B}else j+=$[v],D++}else j=$.slice(Q0,x);if(!Y&&!K){let m=j.match(/^\[!([A-Za-z]+)\]\s*$/);if(m){K=m[1].toUpperCase(),G=i($,x);continue}}Y+=j+`
`;var L=j.trimStart();L.startsWith("```")||L.startsWith("~~~")?F=!F:j.startsWith("    ")||j.startsWith("	")?F=!0:L.length>0&&!F&&(F=!1),U=L.length>0,G=i($,x)}else if(Y&&!d0($,G,x)&&U){if($0<4){var R=G+t,P=R<x?$.charCodeAt(R):0;if(P===Y9||P===d||P===a||P===M0||P===e||(P===u||P===O0||P===K0)&&x9($,G)||(P===u||P===O0||P===B9)&&R+1<x&&($.charCodeAt(R+1)===b||$.charCodeAt(R+1)===w))break;if(P>=o&&P<=r){for(var y=R;y<x&&$.charCodeAt(y)>=o&&$.charCodeAt(y)<=r;)y++;if(y<x&&($.charCodeAt(y)===p0||$.charCodeAt(y)===s0))break}}if(F)break;Y+=$.slice(G,x)+`
`,q=!0,G=i($,x)}else break}if(!Y&&!K)return null;var{inBlockQuote:k,g:E}=Z;Z.inBlockQuote=!0,q&&(Z.g=!0);let h=v9(Y||"",Z,Q);return Z.inBlockQuote=k,Z.g=E,{node:{type:_.blockQuote,children:h,alert:K||void 0},end:G}}function C6($,J,Z){for(var Q=0,V=J;V<Z;V++)$.charCodeAt(V)===w?Q+=4-Q%4:Q++;return Q}function S9($,J,Z){if(A0($,J,Z),$0>3)return null;var Q=J+t;if(Q>=Z)return null;var V=$.charCodeAt(Q),X=$0,Y=Q;if(V===u||V===O0||V===B9){if(Y=Q+1,Y<Z&&$.charCodeAt(Y)!==b&&$.charCodeAt(Y)!==w&&$.charCodeAt(Y)!==g)return null}else if(V>=o&&V<=r){for(var G=Q;G<Z&&G-Q<9;){var K=$.charCodeAt(G);if(K<o||K>r)break;G++}if(G>Q&&G<Z){var q=$.charCodeAt(G);if(q===p0||q===s0){if(Y=G+1,Y<Z&&$.charCodeAt(Y)!==b&&$.charCodeAt(Y)!==w&&$.charCodeAt(Y)!==g)return null}else return null}else return null}else return null;var U=Y,F=C6($,J,Y),O=0,z=U,H=F;if(U>=Z)return{ordered:V>=o&&V<=r,marker:V>=o&&V<=r?$[G]:$[Q],start:V>=o&&V<=r?parseInt($.slice(Q,G),10):void 0,contentStart:U,contentCol:F+1,markerCol:X,isEmpty:!0};for(;z<Z&&($.charCodeAt(z)===b||$.charCodeAt(z)===w);){if($.charCodeAt(z)===w){var j=4-H%4;H+=j}else H++;z++,O++}var W=z>=Z,M=H-F;return W||M>4?(H=F+1,z=U+1,O=1):O===0&&(H=F+1,z=U,O=1),{ordered:V>=o&&V<=r,marker:V>=o&&V<=r?$[G]:$[Q],start:V>=o&&V<=r?parseInt($.slice(Q,G),10):void 0,contentStart:z,contentCol:H,markerCol:X,isEmpty:W}}var M$=0;function TZ($,J,Z,Q){var V=0,X=J;for(M$=0;X<Z&&V<Q;){var Y=$.charCodeAt(X);if(Y===w){var G=4-V%4;if(V+G>Q){M$=V+G-Q,X++,V=Q;break}V+=G}else if(Y===b)V++;else break;X++}return X}function N6($,J,Z,Q){var V=J0($,J),X=S9($,J,V);if(!X)return null;var Y=[],G=J,K=X.contentCol,q="",U=X.isEmpty,F=!1,O=!1;if(!X.isEmpty){for(var z=!1,H=X.contentStart;H<V;H++)if($.charCodeAt(H)===w){z=!0;break}if(z){var j="",W=C6($,J,X.contentStart),M=W-X.contentCol;if(M>0)for(var D=0;D<M;D++)j+=" ";for(var N=X.contentStart;N<V;N++)if($.charCodeAt(N)===w){for(var I=4-W%4,v=0;v<I;v++)j+=" ";W+=I}else j+=$[N],W++;q=j+`
`}else q=$.slice(X.contentStart,V)+`
`}for(G=i($,V);G<$.length;){var B=J0($,G);A0($,G,B);var S=$.charCodeAt(G+t);if($0<K&&(S===u||S===O0||S===K0)&&$0<=3&&x9($,G))break;var L=S9($,G,B);if(L&&L.ordered===X.ordered&&L.marker===X.marker&&L.markerCol<K){Y.push({contentCol:K,raw:q,hasBlankAfter:F,isEmpty:U}),F&&(O=!0),K=L.contentCol,U=L.isEmpty,F=!1,q=L.isEmpty?"":$.slice(L.contentStart,B)+`
`,G=i($,B);continue}if(d0($,G,B)){q+=`
`,G=i($,B);for(var R=!1,P=0;P<q.length;P++){var y=q.charCodeAt(P);if(y!==g&&y!==H9&&y!==b&&y!==w){R=!0;break}}if(U&&!R)if(G<$.length){var k=J0($,G),E=S9($,G,k);if(!E||E.ordered!==X.ordered||E.marker!==X.marker)break;F=!0}else break;if(G<$.length){var h=J0($,G);A0($,G,h);var f=$.charCodeAt(G+t);if((f===u||f===O0||f===K0)&&$0<=3&&x9($,G))break;var x=S9($,G,h);if(x&&x.ordered===X.ordered&&x.marker===X.marker&&x.markerCol<K){F=!0;continue}if(!d0($,G,h)&&$0<K)break}continue}if($0>=K){var D0=TZ($,G,B,K);if(M$>0){for(var Q0="",m=K,n=0;n<M$;n++)Q0+=" ",m++;for(var y0=D0;y0<B;y0++)if($.charCodeAt(y0)===w){for(var c0=4-m%4,m0=0;m0<c0;m0++)Q0+=" ";m+=c0}else Q0+=$[y0],m++;q+=Q0+`
`}else q+=$.slice(D0,B)+`
`;G=i($,B);continue}for(var z0=!1,C=0;C<q.length;C++){var j0=q.charCodeAt(C);if(j0!==g&&j0!==H9&&j0!==b&&j0!==w){z0=!0;break}}if(!F&&z0&&!U){var Z0=G+t,G0=$.charCodeAt(Z0),G9=G0===Y9||G0===d||G0===e||G0===a||G0===M0||(G0===u||G0===O0||G0===K0||G0===B9)&&(x9($,G)!==null||S9($,G,B)!==null)||G0>=o&&G0<=r&&S9($,G,B)!==null;if(!G9){q+=""+$.slice(Z0,B)+`
`,G=i($,B);continue}}break}if(Y.push({contentCol:K,raw:q,hasBlankAfter:F,isEmpty:U}),Y.length===0)return null;var V0=O;if(!V0)for(var B0=0;B0<Y.length;B0++){if(Y[B0].hasBlankAfter&&B0<Y.length-1){V0=!0;break}if(!Y[B0].isEmpty){for(var N0=Y[B0].raw,s=N0.length,U0=0,A=!1,l=!1,I0=!1,b0=!1,$9=0,k0=0,X0=-1;U0<s;){var T=N0.indexOf(`
`,U0);if(T<0&&(T=s),b0){A0(N0,U0,T);for(var R0=N0.slice(U0+t,T),F0=0;F0<R0.length&&R0.charCodeAt(F0)===$9;)F0++;F0>=k0&&R0.slice(F0).trim()===""&&(b0=!1),U0=T<s?T+1:s;continue}if(d0(N0,U0,T)){X0>=0?I0=!0:A&&(l=!0),U0=T<s?T+1:s;continue}if(A0(N0,U0,T),X0>=0){if($0>=X0){U0=T<s?T+1:s;continue}var K9=S9(N0,U0,T);if(K9&&K9.markerCol<X0&&K9.contentCol<=X0){U0=T<s?T+1:s;continue}if(K9){U0=T<s?T+1:s;continue}X0=-1,I0&&(l=!0,I0=!1)}var c9=N0.slice(U0+t,T),b9=c9.charCodeAt(0);if((b9===a||b9===M0)&&$0<=3){for(var W9=0;W9<c9.length&&c9.charCodeAt(W9)===b9;)W9++;if(W9>=3){if(l&&A){V0=!0;break}b0=!0,$9=b9,k0=W9,A=!0,U0=T<s?T+1:s;continue}}var q9=$0<=3?S9(N0,U0,T):null;if(q9&&A){if(l){V0=!0;break}X0=q9.contentCol,I0=!1,U0=T<s?T+1:s,A=!0;continue}if(l){V0=!0;break}A=!0,U0=T<s?T+1:s}if(V0)break}}for(var z9=[],g9=0;g9<Y.length;g9++){for(var J$=Y[g9],O9=J$.raw,Z9=O9.length;Z9>0&&O9.charCodeAt(Z9-1)===g;)Z9--;var J9=Z9<O9.length?O9.slice(0,Z9):O9,Q9=null;if(J9.length>=3&&J9.charCodeAt(0)===W0){var r0=J9[1];(r0===" "||r0==="x"||r0==="X")&&J9.charCodeAt(2)===u0&&(Q9={type:_.gfmTask,completed:r0==="x"||r0==="X"},J9=J9.slice(3))}var P0;if(J$.isEmpty&&J9.trim()==="")P0=[];else if(V0){var P9=Z.inList;Z.inList=!0,P0=v9(J9,Z,Q),Z.inList=P9}else{var U9=Z.inList;if(Z.inList=!0,P0=v9(J9,Z,Q),Z.inList=U9,P0.length===1&&P0[0].type===_.paragraph)P0=P0[0].children;else{for(var V9=[],w9=0;w9<P0.length;w9++)if(P0[w9].type===_.paragraph)for(var l9=P0[w9].children,X9=0;X9<l9.length;X9++)V9.push(l9[X9]);else V9.push(P0[w9]);P0=V9}}Q9?z9.push([Q9,{type:_.text,text:" "},...P0]):z9.push(P0)}return{node:{type:X.ordered?_.orderedList:_.unorderedList,start:X.ordered?X.start:void 0,items:z9},end:G}}var A$=new Set(["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"]);function _9($,J,Z){let Q={};for(let[Y,G]of Object.entries($)){let K=Y,q=Y.toLowerCase();if(q==="style"&&typeof G=="string"){let U={},F=[],O=0,z=0;for(let j=0;j<G.length;j++){let W=G.charCodeAt(j);W===n0?O++:W===s0?O--:W===g$&&O===0&&(F.push(G.slice(z,j)),z=j+1)}z<G.length&&F.push(G.slice(z));let H=!1;F.forEach(j=>{let W=j.indexOf(":");if(W===-1)return;let M=j.slice(0,W).trim(),D=j.slice(W+1).trim();if(M&&D){if(/url\s*\(\s*(javascript|vbscript|data:(?!image\/))/i.test(D)){H=!0;return}let N=M.indexOf("-")!==-1?M.replace(/-([a-z])/g,(I,v)=>v.toUpperCase()):M;U[N]=D}}),!H&&Object.keys(U).length>0&&(Q[K]=U)}else if((q==="href"||q==="src")&&Z?.sanitizer){let U=Z.sanitizer(G,J,q);U!==null&&(Q[K]=U)}else if(G==="")Q[K]=!0;else if(G.length>=2&&G.charCodeAt(0)===L9&&G.charCodeAt(G.length-1)===H$){var V=G.slice(1,-1);if(V.length>0){var X=V.charCodeAt(0);if(X===W0||X===L9)try{Q[K]=JSON.parse(V);continue}catch{}}if(V==="true"){Q[K]=!0;continue}if(V==="false"){Q[K]=!1;continue}if(Z?.evalUnserializableExpressions)try{Q[K]=(0,eval)("("+V+")");continue}catch{}Q[K]=V}else Q[K]=G}return Q}function E9($,J,Z){let Q=J.length;if(Q===0)return Z;var V=J.charCodeAt(0),X=V>=p&&V<=c||V>=Y0&&V<=q0;if(!X){for(var Y=String.fromCharCode(V),G=$.length-Q,K=Z;K<=G;){var q=$.indexOf(Y,K);if(q===-1||q>G)return-1;for(var U=!0,F=1;F<Q;F++){var O=$.charCodeAt(q+F),z=J.charCodeAt(F);if(O>=p&&O<=c&&(O+=o0),z>=p&&z<=c&&(z+=o0),O!==z){U=!1;break}}if(U)return q;K=q+1}return-1}V>=p&&V<=c&&(V+=o0);for(let j=Z;j<=$.length-Q;j++){var H=$.charCodeAt(j);if(H>=p&&H<=c&&(H+=o0),H!==V)continue;let W=!0;for(let M=1;M<Q;M++){let D=$.charCodeAt(j+M),N=J.charCodeAt(M);if(D>=p&&D<=c&&(D+=o0),N>=p&&N<=c&&(N+=o0),D!==N){W=!1;break}}if(W)return j}return-1}function fZ($,J,Z){let Q=J.length;var V=J.charCodeAt(0);V>=p&&V<=c&&(V+=o0);for(let Y=Math.min(Z,$.length-Q);Y>=0;Y--){var X=$.charCodeAt(Y);if(X>=p&&X<=c&&(X+=o0),X!==V)continue;let G=!0;for(let K=1;K<Q;K++){let q=$.charCodeAt(Y+K),U=J.charCodeAt(K);if(q>=p&&q<=c&&(q+=o0),U>=p&&U<=c&&(U+=o0),q!==U){G=!1;break}}if(G)return Y}return-1}var _$=-1;function u$($,J,Z){let Q=Z.toLowerCase(),V="<"+Q,X="</"+Q,Y=1,G=J,K=$.length;for(_$=-1;G<K&&Y>0;){let F=E9($,V,G),O=E9($,X,G);if(O===-1)return-1;if(F!==-1&&F<O){let z=N9($,F);z?(z.tag.toLowerCase()===Q&&!z.isClosing&&!z.selfClosing&&!p9(z.tag)&&Y++,G=z.end):G=F+1}else{var q=O+X.length,U=q<K?$.charCodeAt(q):62;if((U===d||U===b||U===w||U===g)&&(Y--,Y===0)){_$=O;let z=O+X.length;for(;z<K&&$.charCodeAt(z)!==d;)z++;return z+1}G=O+1}}return-1}function m6($,J,Z,Q){if(Q.ignoreHTMLBlocks||Q.disableParsingRawHTML)return null;var V=J0($,J);if(A0($,J,V),$0>3&&!Z.inHTML)return null;var X=J+t;if($.charCodeAt(X)!==e)return null;var Y=$.indexOf(">",X+1);if(Y!==-1&&Y<V){var G=$.slice(X+1,Y);if(/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(G)||/^[^\s@]+@[^\s@]+$/.test(G))return null}var K=hZ($,X);if(K>=1&&K<=5){var q=$.length;if(K===1){for(var U=$.length,F=0;F<m$.length;F++){var O=E9($,"</"+m$[F]+">",X);O>=0&&O<U&&(U=O)}if(U<$.length){var z=$.indexOf(">",U);q=z>=0?i($,z+1):$.length}}else{var H=K===2?"-->":K===3?"?>":K===4?">":"]]>",j=$.indexOf(H,X);j>=0&&(q=i($,j+H.length))}var W=$.slice(X,q);if(K>=2)return{node:{type:_.htmlComment,text:W,i:!1,raw:!0,endPos:q},end:q};var M="div",D=W.match(/^<\/?([a-zA-Z][a-zA-Z0-9-]*)/);D&&(M=D[1]);var N=N9($,X),I={},v;N&&!N.isClosing&&(I=_9(N.attrs,M,Q),v=N.whitespaceBeforeAttrs+N.rawAttrs);var B=[],S=M.toLowerCase(),L="</"+S,R=E9(W,L,0),P=W,y="";if(N&&N.isClosing)for(P=W.slice(N.end-X);P.length>0&&P.charCodeAt(P.length-1)===g;)P=P.slice(0,-1);else if(N&&!N.isClosing){var k=N.end-X;if(R!==-1)for(P=W.slice(k),P.charCodeAt(0)===g&&(P=P.slice(1));P.length>0&&P.charCodeAt(P.length-1)===g;)P=P.slice(0,-1);else for(P=W;P.length>0&&P.charCodeAt(P.length-1)===g;)P=P.slice(0,-1);if(R!==-1){var E=W.slice(k,R);y=E.trim()}}var h=N?N.isClosing:!1;return{node:{type:_.htmlBlock,tag:M,attrs:I,f:v,children:B,a:P,text:y,d:!0,b:h,endPos:q,e:!0},end:q}}if(K===6||K===7){var f=_6($,J),x=f<$.length?f:$.length,D0=$.slice(X,x),Q0=f<$.length?i($,f):$.length,m=N9($,X);if(m){var n=m.tag,y0=n.toLowerCase(),c0=m.isClosing;if(c0){var m0=$.slice(m.end,x);return{node:{type:_.htmlBlock,tag:n,attrs:{},children:[],a:m0,text:m0,d:!0,b:!0,endPos:x,e:K===6},end:Q0}}if(m.selfClosing||p9(n))return{node:{type:_.htmlBlock,tag:n,attrs:_9(m.attrs,n,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:[],a:"",text:"",d:!1,b:!1,endPos:m.end,e:K===6},end:m.end<$.length&&$.charCodeAt(m.end)===g?m.end+1:m.end};var z0=Z.c||0,C=$.slice(X,x),j0=-1,Z0=-1;if(z0<10){for(var G0="</"+y0,G9=m.end-X,V0=1,B0=G9;B0<C.length&&V0>0;){var N0=E9(C,"<"+y0,B0),s=E9(C,G0,B0);if(s===-1)break;if(N0!==-1&&N0<s){var U0=N0+y0.length+1;if(U0<C.length){var A=C.charCodeAt(U0);(A===b||A===w||A===g||A===d||A===H0)&&V0++}B0=N0+1}else{var l=s+G0.length;if(l<C.length){var I0=C.charCodeAt(l);if((I0===d||I0===b||I0===w||I0===g)&&(V0--,V0===0)){j0=s;for(var b0=l;b0<C.length&&C.charCodeAt(b0)!==d;)b0++;Z0=b0+1;break}}else if(V0--,V0===0){j0=s,Z0=C.length;break}B0=s+1}}var $9=!1;if(j0===-1&&K===6&&!m.isClosing){var k0=u$($,m.end,y0);if(k0!==-1){for(var X0=_$,T=m.end,R0=!1,F0=!1,K9=!1,c9=0,b9=!1,W9=!1,q9=T;q9<X0;){var z9=$.charCodeAt(q9);if(z9===g)W9&&(R0=!0),b9||c9++,W9=!0,q9++;else if(z9===b||z9===w)q9++;else{if(!b9&&(b9=!0,c9>=2&&z9===e)){K9=!0;break}if(W9=!1,z9===e){var g9=$.charCodeAt(q9+1)|32;if((g9===O$||g9===x$||g9===h9)&&(D6.lastIndex=q9,D6.test($))){F0=!0;break}}q9++}}if(R0&&!K9&&!F0){var J$=J0($,k0);x=J$,Q0=i($,J$),C=$.slice(X,x),D0=$.slice(X,x),j0=X0-X,Z0=k0-X,$9=!0}}}}var O9=m.rawAttrs.indexOf(`
`)!==-1||m.whitespaceBeforeAttrs.indexOf(`
`)!==-1,Z9=!1;if(j0!==-1){var J9=C.slice(Z0).trim();Z9=J9.length===0}var Q9=!1,r0=x,P0=Q0;if(j0!==-1){var P9=X+Z0,U9=J0($,P9-1);if(P9<U9){for(var V9=P9;V9<U9&&($.charCodeAt(V9)===b||$.charCodeAt(V9)===w);)V9++;if(V9<U9&&$.charCodeAt(V9)===e){var w9=N9($,V9);w9&&!w9.isClosing&&(Q9=!0,r0=P9,P0=P9,Z9=!0)}}if(!Q9){var l9=i($,U9);if(l9<x){for(var X9=l9;X9<x&&($.charCodeAt(X9)===b||$.charCodeAt(X9)===w);)X9++;if(X9<x&&$.charCodeAt(X9)===e){var i6=N9($,X9);i6&&(Q9=!0,r0=U9,P0=l9,Z9=!0)}}}if(!Q9&&Z.inHTML){Q9=!0,r0=U9,P0=i($,U9);var a6=$.slice(P9,U9).trim();Z9=a6.length===0}}var o9=[],i0="";if(j0!==-1){i0=C.slice(m.end-X,j0);var R9=i0.trim();if(R9){var{inline:n6,inHTML:s6,c:t6}=Z;Z.inHTML=!0,Z.c=z0+1;var e6=y0==="p";if(e6)Z.inline=!0,o9=h0(R9,0,R9.length,Z,Q);else{var c$=i0.indexOf(`

`)!==-1,l$=j6.test(R9),b$=B6.test(R9),$Z=c$||l$||Z.inHTML&&b$,ZZ=i0.length>=2&&i0.charCodeAt(0)===g&&i0.charCodeAt(i0.length-1)===g&&!c$;ZZ&&!l$&&!b$?o9=[{type:_.text,text:R9}]:$Z||b$?(Z.inline=!1,o9=v9(i0,Z,Q)):(Z.inline=!0,o9=h0(R9,0,R9.length,Z,Q))}Z.inline=n6,Z.inHTML=s6,Z.c=t6}}var o$=!1;if(K===6&&j0!==-1&&!Z.inHTML&&!O9){var P$=i0,JZ=/<[a-zA-Z][^>]*>/.test(P$),QZ=/\n\n/.test(P$)||/^(\s{0,3}#[#\s]|\s{0,3}[-*+]\s|\s{0,3}\d+\.\s|\s{0,3}>\s|\s{0,3}```)/m.test(P$);JZ&&!QZ&&(o$=!0)}var VZ=!$9&&(Z.inHTML||K===7||O9||!Z9||o$);if(VZ){var l0,r$=!1;if(j0!==-1&&Q9){var i$=!1;if(Z.inHTML&&Z0<C.length){for(var U$=Z0;U$<C.length&&C.charCodeAt(U$)!==g;)U$++;var w$=C.slice(Z0,U$).trim();i$=w$.length>1&&w$.charCodeAt(0)===e&&w$.charCodeAt(1)!==H0}l0=i$?C.slice(m.end-X):i0,r$=!0}else(K===7||Z.inHTML)&&j0!==-1?(l0=C.slice(m.end-X),l0.charCodeAt(0)===g&&(l0=l0.slice(1))):Q9?l0=$.slice(X,r0):O9?l0=D0:(l0=C.slice(m.end-X),l0.charCodeAt(0)===g&&(l0=l0.slice(1)));var a$={type:_.htmlBlock,tag:n,attrs:_9(m.attrs,n,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:o9,a:l0,text:l0,d:!0,b:!1,endPos:r0,e:K===6};return r$&&(a$.l=!0),{node:a$,end:P0}}return{node:{type:_.htmlBlock,tag:n,attrs:_9(m.attrs,n,Q),f:m.whitespaceBeforeAttrs+m.rawAttrs,children:o9,a:$9?"":i0,text:i0,d:!1,b:!1,endPos:r0,e:K===6},end:P0}}var F$=D0.match(/^<(\/?)([a-zA-Z][a-zA-Z0-9-]*)/),XZ=F$?F$[2]:"div",n$=F$?F$[1]==="/":!1,R$=D0;if(n$){var s$=D0.indexOf(">");s$!==-1&&(R$=D0.slice(s$+1))}return{node:{type:_.htmlBlock,tag:XZ,attrs:{},children:[],a:R$,text:R$,d:!0,b:n$,endPos:x,e:K===6},end:Q0}}var L0=N9($,X);if(!L0)return null;var y9=L0.tag,y$=y9.toLowerCase(),t$=y9.charCodeAt(0),W$=t$>=p&&t$<=c;if(!W$&&!A$.has(y$)&&!q$.has(y$)&&!y$.includes("-"))return null;if(L0.isClosing)return{node:{type:_.htmlSelfClosing,tag:y9,attrs:{},a:$.slice(X,L0.end),b:!0,endPos:L0.end},end:L0.end};var FJ=!0,T9=u$($,L0.end,y9),Q$=[];if(T9!==-1){var YZ=_$,z$=$.slice(L0.end,YZ),V$=z$.trim();if(V$){var GZ=z$.indexOf(`

`)!==-1,KZ=j6.test(V$),qZ=B6.test(V$),UZ=Z.inline,FZ=Z.inHTML,WZ=Z.c;Z.inHTML=!0,Z.c=(Z.c||0)+1,GZ||KZ||qZ?(Z.inline=!1,Q$=v9(z$,Z,Q)):(Z.inline=!0,Q$=h0(V$,0,V$.length,Z,Q)),Z.inline=UZ,Z.inHTML=FZ,Z.c=WZ}var zZ=J0($,T9),OZ=$.slice(T9,zZ).trim(),k$=OZ?T9:i($,T9),e$=W$?$.slice(X,T9):$.slice(X,k$),HZ=W$?T9:k$;return{node:{type:_.htmlBlock,tag:y9,attrs:_9(L0.attrs,y9,Q),f:L0.whitespaceBeforeAttrs+L0.rawAttrs,children:Q$,a:e$,text:W$?z$:e$,d:!0,b:!1,endPos:HZ,e:!1},end:k$}}var r9=_6($,L0.end),DZ=r9<$.length?i($,r9):r9,L$=$.slice(L0.end,r9);if(L$.trim()){var{inline:jZ,inHTML:BZ,c:MZ}=Z;Z.inline=!1,Z.inHTML=!0,Z.c=(Z.c||0)+1,Q$=v9(L$,Z,Q),Z.inline=jZ,Z.inHTML=BZ,Z.c=MZ}var AZ=$.slice(L0.end,r9);return{node:{type:_.htmlBlock,tag:y9,attrs:_9(L0.attrs,y9,Q),f:L0.whitespaceBeforeAttrs+L0.rawAttrs,children:Q$,a:AZ,text:L$,d:!0,b:!1,endPos:r9,e:!1},end:DZ}}function hZ($,J){if($.charCodeAt(J)!==e)return 0;var Z=J+1,Q=$.length;if($.charCodeAt(Z)===S0&&$.charCodeAt(Z+1)===u&&$.charCodeAt(Z+2)===u)return 2;if($.charCodeAt(Z)===i9)return 3;if($.charCodeAt(Z)===S0){var V=$.charCodeAt(Z+1);if(V>=p&&V<=c)return 4;if($.slice(Z+1,Z+8)==="[CDATA[")return 5}for(var X=$.charCodeAt(Z)===H0,Y=X?Z+1:Z,G=Y;G<Q;){var K=$.charCodeAt(G);if(K>=p&&K<=c||K>=Y0&&K<=q0||K>=o&&K<=r||K===u)G++;else break}if(G===Y)return 0;var q=$.slice(Y,G);if(q$.has(q.toLowerCase())){if(X)return 0;var U=$.charCodeAt(G);return U===b||U===w||U===d||U===g||G>=Q?1:0}if(A$.has(q.toLowerCase())){if(X){for(var F=G;F<Q&&($.charCodeAt(F)===b||$.charCodeAt(F)===w);)F++;return F<Q&&$.charCodeAt(F)===d?6:0}var O=G<Q?$.charCodeAt(G):-1;return O===b||O===w||O===d||O===g||O===H0||O===-1?6:0}if(X){for(var W=G;W<Q&&($.charCodeAt(W)===b||$.charCodeAt(W)===w);)W++;if(W<Q&&$.charCodeAt(W)===d){var M=J0($,J),D=$.slice(W+1,M).trim();if(D==="")return 7}}else{var z=J0($,J),H=N9($,J);if(H&&H.end<=z){var j=$.slice(H.end,z).trim();if(j==="")return 7}}return 0}function v6($,J,Z){for(var Q=0,V=$.length;Q<V&&($.charCodeAt(Q)===b||$.charCodeAt(Q)===w);)Q++;for(;V>Q&&($.charCodeAt(V-1)===b||$.charCodeAt(V-1)===w);)V--;Q<V&&$.charCodeAt(Q)===v0&&Q++,V>Q&&$.charCodeAt(V-1)===v0&&(V-2<Q||$.charCodeAt(V-2)!==_0)&&V--;for(var X=[],Y=Q,G=!1,K=[],q=Q;q<V;){var U=$.charCodeAt(q);if(U===_0&&q+1<V){$.charCodeAt(q+1)===v0?(G||(G=!0,K=[]),K.push($.slice(Y,q)),K.push("|"),q+=2,Y=q):q+=2;continue}if(U===a){for(var F=0;q<V&&$.charCodeAt(q)===a;)F++,q++;for(var O=!1;q<V&&!O;){for(var z=0;q<V&&$.charCodeAt(q)===a;)z++,q++;z===F?O=!0:z===0&&q++}continue}if(U===v0){var H=G?(K.push($.slice(Y,q)),K.join("")):$.slice(Y,q);X.push(H.trim()),q++,Y=q,G=!1,K=[];continue}q++}var j=G?(K.push($.slice(Y,V)),K.join("")):$.slice(Y,V);return X.push(j.trim()),X.map(function(W){var M=W.indexOf("\\|")!==-1?W.replace(/\\\|/g,"|"):W;return h0(M,0,M.length,J,Z)})}function I6($,J,Z,Q){let V=J0($,J);var X=$.indexOf("|",J);if(X<0||X>=V)return null;let Y=i($,V);if(Y>=$.length)return null;let G=J0($,Y);if(!S6($,Y,G))return null;let K=$.slice(J,V),q=$.slice(Y,G);for(var U=[],F=0,O=q.length;F<O&&(q.charCodeAt(F)===b||q.charCodeAt(F)===w);)F++;for(F<O&&q.charCodeAt(F)===v0&&F++;F<O;){for(;F<O&&(q.charCodeAt(F)===b||q.charCodeAt(F)===w);)F++;if(F>=O||q.charCodeAt(F)===v0)break;var z=q.charCodeAt(F)===E0;for(z&&F++;F<O&&q.charCodeAt(F)===u;)F++;var H=F<O&&q.charCodeAt(F)===E0;for(H&&F++,U.push(z&&H?"center":H?"right":z?"left":null);F<O&&(q.charCodeAt(F)===b||q.charCodeAt(F)===w);)F++;F<O&&q.charCodeAt(F)===v0&&F++}let j=v6(K,Z,Q);if(U.length!==j.length)return null;let W=[],M=i($,G);for(;M<$.length;){let S=J0($,M),L=$.slice(M,S);if(d0($,M,S))break;if(A0($,M,S),$0<4){var D=$.charCodeAt(M+t);if(D===d||D===Y9||(D===u||D===O0||D===K0)&&x9($,M))break;if(D===a||D===M0){for(var N=M+t,I=0;N<S&&$.charCodeAt(N)===D;)I++,N++;if(I>=3)break}}W.push(v6(L,Z,Q)),M=i($,S)}if((Q.streaming||Q.optimizeForStreaming)&&W.length===0)return null;for(var v=j.length,B=0;B<W.length;B++)if(W[B].length<v)for(;W[B].length<v;)W[B].push([]);else W[B].length>v&&(W[B].length=v);return{node:{type:_.table,header:j,cells:W,align:U},end:M}}function CZ($,J,Z){var Q=J0($,J);if(A0($,J,Q),$0>3)return null;var V=J+t;if($.charCodeAt(V)!==W0)return null;if(V+1<$.length&&$.charCodeAt(V+1)===a0){var X=mZ($,V,Z);return X||null}Z.refs||(Z.refs={});var Y=x6($,V,Z.refs);return Y===null?null:{node:{type:_.refCollection},end:Y}}function mZ($,J,Z){var Q=$.length;if($.charCodeAt(J)!==W0||J+1>=Q||$.charCodeAt(J+1)!==a0)return null;for(var V=J+2,X=V;V<Q&&$.charCodeAt(V)!==u0;){if($.charCodeAt(V)===g)return null;V++}if(V>=Q)return null;var Y=("^"+$.slice(X,V)).toLowerCase();if(V++,V>=Q||$.charCodeAt(V)!==E0)return null;for(V++;V<Q&&($.charCodeAt(V)===b||$.charCodeAt(V)===w);)V++;if(V<Q&&$.charCodeAt(V)===g)for(V++;V<Q&&($.charCodeAt(V)===b||$.charCodeAt(V)===w);)V++;var G=$.indexOf(`
`,V);G<0&&(G=Q);for(var K=$.slice(V,G).trim(),q=G<Q?G+1:Q;q<Q;){var U=J0($,q);if(A0($,q,U),$0>=2&&!d0($,q,U))K+=`
`+$.slice(q,U),q=i($,U);else if(d0($,q,U)){var F=i($,U);if(F<Q){var O=J0($,F);if(A0($,F,O),$0>=2){K+=`
`,q=i($,U);continue}}break}else break}return Z.refs[Y]||(Z.refs[Y]={target:K,title:void 0}),{node:{type:_.footnote},end:q}}function uZ($,J,Z,Q){let V=J,X=0,Y=0,G=-1;for(;V<$.length;){let y=G>=0?G:J0($,V);if(G=-1,d0($,V,y))break;if(A0($,V,y),$0<4&&Y>0&&!Z.g){let E=$.charCodeAt(V+t);if(E===g0||E===u){let h=V+t;for(;h<y&&$.charCodeAt(h)===E;)h++;for(;h<y&&($.charCodeAt(h)===b||$.charCodeAt(h)===w);)h++;if(h>=y){X=E===g0?1:2,V=i($,y);break}}}Y=y;let k=i($,y);if(k<$.length){if($.charCodeAt(k)===a9){var K=J0($,k);V=i($,K),Y=K;continue}let E=J0($,k);if(G=E,A0($,k,E),$0<4){let h=$.charCodeAt(k+t);if(h===d){V=k;break}if(h===Y9&&h6($,k,Z,Q)){V=k;break}if(h===a||h===M0){for(var q=k+t,U=0;q<E&&$.charCodeAt(q)===h;)U++,q++;if(U>=3){V=k;break}}if(h===e){var F=k+t+1,O=F<E?$.charCodeAt(F):0,z=O===S0||O===i9;if(!z&&O===H0){for(var H=F+1,j=H;j<E&&($.charCodeAt(j)>=p&&$.charCodeAt(j)<=c||$.charCodeAt(j)>=Y0&&$.charCodeAt(j)<=q0||$.charCodeAt(j)>=o&&$.charCodeAt(j)<=r||$.charCodeAt(j)===u);)j++;j>H&&(z=A$.has($.slice(H,j).toLowerCase()))}else if(!z){for(var W=F;W<E&&($.charCodeAt(W)>=p&&$.charCodeAt(W)<=c||$.charCodeAt(W)>=Y0&&$.charCodeAt(W)<=q0||$.charCodeAt(W)>=o&&$.charCodeAt(W)<=r||$.charCodeAt(W)===u);)W++;if(W>F){var M=$.slice(F,W).toLowerCase();z=A$.has(M)||q$.has(M)}}if(z&&m6($,k,Z,Q)){V=k;break}}if(h===u||h===O0||h===B9){let f=k+t+1;if(f<E&&($.charCodeAt(f)===b||$.charCodeAt(f)===w)){var D=K$($,f,E);if(D<E&&!x9($,k)){V=k;break}}}if(h>=o&&h<=r){let f=k+t;for(;f<E&&$.charCodeAt(f)>=o&&$.charCodeAt(f)<=r;)f++;if(f<E&&($.charCodeAt(f)===p0||$.charCodeAt(f)===s0)&&f-(k+t)===1&&$.charCodeAt(k+t)===49){var N=f+1;if(N<E&&($.charCodeAt(N)===b||$.charCodeAt(N)===w)){var I=K$($,N,E);if(I<E){V=k;break}}}}if(h===v0){let f=i($,E);if(f<$.length){let x=J0($,f);if(S6($,f,x)){V=k;break}}}if((h===u||h===O0||h===K0)&&x9($,k)){if(h!==u){V=k;break}let f=0,x=k+t;for(;x<E&&$.charCodeAt(x)===u;)f++,x++;for(;x<E&&($.charCodeAt(x)===b||$.charCodeAt(x)===w);)x++;if(x<E){V=k;break}}}}V=i($,y)}for(var v=X?Y:V;v>J&&($.charCodeAt(v-1)===g||$.charCodeAt(v-1)===H9||$.charCodeAt(v-1)===b||$.charCodeAt(v-1)===w);)v--;for(var B=J;B<v&&($.charCodeAt(B)===b||$.charCodeAt(B)===w);)B++;if(B>=v)return null;for(var S=!1,L=B;L<v;L++)if($.charCodeAt(L)===a9){S=!0;break}var R=S?$.slice(B,v).replace(/\u001E/g,""):$.slice(B,v);if(!R)return null;let P=pZ(R,0,R.length,Z,Q);if(X){let k=(Q?.slugify||f0)(R);return{node:{type:_.heading,level:X,children:P,id:k},end:V}}return{node:{type:_.paragraph,children:P},end:V}}function pZ($,J,Z,Q,V){var X=$.indexOf(`
`,J);if(X<0||X>=Z)return h0($,J,Z,Q,V);for(var Y="",G=J,K=J;K<Z;){var q=$.charCodeAt(K);if(q===a){var U=v$($,K,Z);if(U>K){for(var F=!1,O=K;O<U;O++)if($.charCodeAt(O)===g){F=!0;break}F&&(Y+=$.slice(G,K),Y+=$.slice(K,U).replace(/\n/g," "),G=U),K=U;continue}}if(q===e){var z=u6($,K,Z);if(z>K){K=z;continue}}if(q===g){var H=!1,j=0;if(K>J&&$.charCodeAt(K-1)===_0)H=!0,j=1;else{for(var W=0,M=K-1;M>=J&&$.charCodeAt(M)===b;)W++,M--;W>=2&&(H=!0,j=W)}if(H)Y+=$.slice(G,K-j),Y+="";else{for(var D=K;D>G&&$.charCodeAt(D-1)===b;)D--;Y+=$.slice(G,D)+`
`}for(K++;K<Z&&$.charCodeAt(K)===b;)K++;G=K;continue}K++}return G<Z&&(Y+=$.slice(G,Z)),h0(Y,0,Y.length,Q,V)}function dZ($,J,Z){if($.charCodeAt(J)!==a)return null;let Q=I9($,J,Z,96),V=J+Q;for(;V<Z;){let X=$.indexOf("`",V);if(X<0||X>=Z)return null;let Y=I9($,X,Z,96);if(Y===Q){let G=$.slice(J+Q,X);return G=G.replace(/\n/g," "),G.length>0&&G[0]===" "&&G[G.length-1]===" "&&G.trim().length>0&&(G=G.slice(1,-1)),{node:{type:_.codeInline,text:G},end:X+Y}}V=X+Y}return null}function v$($,J,Z){if($.charCodeAt(J)!==a)return J;let Q=I9($,J,Z,96),V=J+Q;for(;V<Z;){let X=$.indexOf("`",V);if(X<0||X>=Z)return J;let Y=I9($,X,Z,96);if(Y===Q)return X+Y;V=X+Y}return J}function u6($,J,Z){if($.charCodeAt(J)!==e)return J;if(J+1<Z&&$.charCodeAt(J+1)===H0){let q=J+2;for(;q<Z&&$.charCodeAt(q)!==d;)q++;return q<Z?q+1:J}if(J+3<Z&&$.charCodeAt(J+1)===S0&&$.charCodeAt(J+2)===u&&$.charCodeAt(J+3)===u){let q=$.indexOf("-->",J+4);return q>=0?q+3:J}let Q=J+1,V=Q;for(;Q<Z;){let q=$.charCodeAt(Q);if(q>=p&&q<=c||q>=Y0&&q<=q0||q>=o&&q<=r||q===u)Q++;else break}if(Q===V)return J;let X=$.slice(V,Q).toLowerCase(),Y=!1;for(;Q<Z;){let q=$.charCodeAt(Q);if(q===d){Q++;break}if(q===H0&&Q+1<Z&&$.charCodeAt(Q+1)===d){Q+=2,Y=!0;break}if(q===j9||q===k9){var G=q;for(Q++;Q<Z&&$.charCodeAt(Q)!==G;)Q++;Q<Z&&Q++;continue}if(q===g)return J;Q++}if(Y||p9(X))return Q;let K=1;for(;Q<Z&&K>0;)if($.charCodeAt(Q)===e)if(Q+1<Z&&$.charCodeAt(Q+1)===H0){let q=Q+2,U=q;for(;U<Z&&($.charCodeAt(U)>=p&&$.charCodeAt(U)<=c||$.charCodeAt(U)>=Y0&&$.charCodeAt(U)<=q0);)U++;if($.slice(q,U).toLowerCase()===X){for(;U<Z&&$.charCodeAt(U)!==d;)U++;if(U<Z&&U++,K--,K===0)return U}Q=U}else{let q=Q+1,U=q;for(;U<Z&&($.charCodeAt(U)>=p&&$.charCodeAt(U)<=c||$.charCodeAt(U)>=Y0&&$.charCodeAt(U)<=q0);)U++;$.slice(q,U).toLowerCase()===X&&K++,Q++}else Q++;return Q}function cZ($,J,Z,Q,V){if($.charCodeAt(J)!==M0||J+1>=Z||$.charCodeAt(J+1)!==M0)return null;let X=J+2;for(;X+1<Z;){let Y=$.charCodeAt(X);if(Y===a){let G=v$($,X,Z);if(G>X){X=G;continue}}if(Y===M0&&$.charCodeAt(X+1)===M0){let G=$.slice(J+2,X),K=h0(G,0,G.length,Q,V);return{node:{type:_.textFormatted,tag:"del",children:K},end:X+2}}Y===_0&&X+1<Z&&X++,X++}return null}function lZ($,J,Z,Q,V){if($.charCodeAt(J)!==g0||J+1>=Z||$.charCodeAt(J+1)!==g0)return null;let X=J+2;for(;X+1<Z;){let Y=$.charCodeAt(X);if(Y===a){let G=v$($,X,Z);if(G>X){X=G;continue}}if(Y===g0&&$.charCodeAt(X+1)===g0&&X>J+2){let G=$.slice(J+2,X),K=h0(G,0,G.length,Q,V);return{node:{type:_.textFormatted,tag:"mark",children:K},end:X+2}}Y===_0&&X+1<Z&&X++,X++}return null}function b6($,J,Z){return $<n9?!!(d$($)&m9):W6.test(J[Z])}function P6($,J,Z){return $<n9?!!(d$($)&M9):z6.test(J[Z])}function oZ($,J,Z){var Q=$.charCodeAt(J);if(Q!==O0&&Q!==K0)return null;var V=I9($,J,Z,Q);if(V===0)return null;var X=J>0?$.charCodeAt(J-1):32,Y=J+V<Z?$.charCodeAt(J+V):32,G=P6(X,$,J-1),K=P6(Y,$,J+V),q=J>0?b6(X,$,J-1):!1,U=J+V<Z?b6(Y,$,J+V):!1,F=!K&&(!U||G||q),O=!G&&(!q||K||U),z,H;return Q===O0?(z=F,H=O):(z=F&&(!O||q),H=O&&(!F||U)),{len:V,canOpen:z,canClose:H}}function rZ($,J,Z,Q){if(J.length!==0){for(var V=[],X=0;X<12;X++)V[X]=-1;for(var Y=0;Y<J.length;){var G=J[Y];if(!G.active||!G.canClose){Y++;continue}for(var K=G.ch===O0?0:1,q=K*6+G.len%3*2+(G.canOpen?1:0),U=V[q]!==void 0?V[q]:-1,F=-1,O=Y-1;O>U;O--){var z=J[O];if(!(!z.active||z.ch!==G.ch||!z.canOpen)&&!((G.canOpen||z.canClose)&&(z.len+G.len)%3===0&&z.len%3!==0)){F=O;break}}if(F<0){V[q]=Y-1,!G.canOpen&&(G.active=!1),Y++;continue}var H=J[F],j=H.len>=2&&G.len>=2,W=j?2:1;H.len-=W,G.len-=W;var M=$[H.idx],D=$[G.idx];M.text=M.text.slice(0,M.text.length-W),D.text=D.text.slice(W);var N=H.idx+1,I=G.idx,v=$.slice(N,I),B={type:_.textFormatted,tag:j?"strong":"em",children:v};$.splice(N,I-N,B);for(var S=I-N-1,L=0;L<J.length;L++)J[L].idx>H.idx&&(J[L].idx-=S);for(var R=F+1;R<Y;R++)J[R].active=!1;if(H.len===0&&(H.active=!1,M.text==="")){$.splice(H.idx,1);for(var P=0;P<J.length;P++)J[P].idx>H.idx?J[P].idx--:J[P].idx===H.idx&&(J[P].idx=-1)}if(G.len===0){G.active=!1;var y=G.idx;if(D.text===""){$.splice(y,1);for(var k=0;k<J.length;k++)J[k].idx>y?J[k].idx--:J[k].idx===y&&(J[k].idx=-1)}}else continue;Y++}for(var E=0,h=0;h<$.length;h++){var f=$[h];if(f.type===_.text){var x=f;if(x.text==="")continue;if(E>0&&$[E-1].type===_.text){$[E-1].text+=x.text;continue}}$[E++]=f}$.length=E}}function w6($,J,Z,Q,V){let X=$.charCodeAt(J)===S0,Y=X?J+1:J;if($.charCodeAt(Y)!==W0)return null;var G=$.indexOf("]",Y+1);if(G<0||G>=Z)return null;for(var K=Y+1,q=-1,U=1;K<Z&&U>0;){var F=$.charCodeAt(K);if(F===_0&&K+1<Z){K+=2;continue}if(F===a){var O=v$($,K,Z);if(O>K){K=O;continue}}if(F===e){var z=p6($,K,Z);if(z){K=z.end;continue}var H=u6($,K,Z);if(H>K){K=H;continue}}F===W0?U++:F===u0&&U--,K++}if(U!==0)return null;var j=K-1,W=$.slice(Y+1,j),M=K<Z?$.charCodeAt(K):0,D=!1;if(M===n0){var N=!0;for(K++;K<Z&&($.charCodeAt(K)===b||$.charCodeAt(K)===g);)K++;var I="",v=K;if(K<Z&&$.charCodeAt(K)===e){for(K++,v=K;v<Z&&$.charCodeAt(v)!==d;){if($.charCodeAt(v)===_0&&v+1<Z){v+=2;continue}if($.charCodeAt(v)===g){N=!1;break}v++}N&&(v>=Z||$.charCodeAt(v)!==d)&&(N=!1),N&&(I=$.slice(K,v),v++)}else if(N){for(var B=0;v<Z;){var S=$.charCodeAt(v);if(S===_0&&v+1<Z){v+=2;continue}if(S===n0)B++;else if(S===s0){if(B===0)break;B--}else if(S===b||S===g)break;v++}I=$.slice(K,v)}if(N){for(K=v;K<Z&&($.charCodeAt(K)===b||$.charCodeAt(K)===g);)K++;var L;if(K<Z){var R=$.charCodeAt(K);if(R===j9||R===k9||R===n0){var P=R===n0?41:R;K++;for(var y=K;K<Z&&$.charCodeAt(K)!==P;)$.charCodeAt(K)===_0&&K+1<Z&&K++,K++;K>=Z?N=!1:(L=$.slice(y,K),K++)}}if(N){for(;K<Z&&($.charCodeAt(K)===b||$.charCodeAt(K)===g);)K++;(K>=Z||$.charCodeAt(K)!==s0)&&(N=!1)}}if(N){K++,I=$$(I),L!==void 0&&(L=s9($$(L)));var k=V?.sanitizer||u9,E=k(I,X?"img":"a",X?"src":"href"),h=E===null?null:I;if(X){var f=h0(W,0,W.length,Q,V),x=N$(f);return{node:{type:_.image,target:h,alt:x,title:L},end:K}}else{var D0=Q.inAnchor;Q.inAnchor=!0;var Q0=D0?[{type:_.text,text:W}]:h0(W,0,W.length,Q,V);return Q.inAnchor=D0,!Q.inAnchor&&p$(Q0)?null:{node:{type:_.link,target:h,title:L,children:Q0},end:K}}}else K=j+1,D=!0}var m="",n=K;if(!D&&M===W0){var y0=K+1;n=y0;for(var c0=!1;n<Z&&$.charCodeAt(n)!==u0;){if($.charCodeAt(n)===_0&&n+1<Z){n+=2;continue}if($.charCodeAt(n)===W0){c0=!0;break}n++}if(c0||n>=Z)return null;var m0=$.slice(y0,n);if(m0.trim())m=B$(m0);else{if(A6(W))return null;m=B$(W)}n=n+1}else{if(A6(W))return null;m=B$(W)}var z0=Q.refs[m];if(!z0)return null;if(X)return{node:{type:_.image,target:z0.target,alt:N$(h0(W,0,W.length,Q,V)),title:z0.title},end:n};var C=Q.inAnchor;Q.inAnchor=!0;var Q0=C?[{type:_.text,text:W}]:h0(W,0,W.length,Q,V);return Q.inAnchor=C,!Q.inAnchor&&p$(Q0)?null:{node:{type:_.link,target:z0.target,title:z0.title,children:Q0},end:n}}function p6($,J,Z){if($.charCodeAt(J)!==e)return null;for(var Q=J+1;Q<Z;){var V=$.charCodeAt(Q);if(V===d)break;if(V===b||V===g||V===H9||V===e)return null;Q++}if(Q>=Z||$.charCodeAt(Q)!==d)return null;var X=$.slice(J+1,Q),Y=X.match(/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^\x00-\x20]*)$/);return Y?{node:{type:_.link,target:X,title:void 0,children:[{type:_.text,text:X}]},end:Q+1}:X.indexOf("@")!==-1&&/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(X)?{node:{type:_.link,target:"mailto:"+X,title:void 0,children:[{type:_.text,text:X}]},end:Q+1}:null}function iZ($,J,Z,Q){if($.charCodeAt(J)!==W0||J+1>=Z||$.charCodeAt(J+1)!==a0)return null;let V=J+2;for(;V<Z&&$.charCodeAt(V)!==u0&&$.charCodeAt(V)!==g;)V++;if(V>=Z||$.charCodeAt(V)!==u0)return null;let X=$.slice(J+2,V);return X?{node:{type:_.footnoteReference,target:"#"+f0(X),text:X},end:V+1}:null}function aZ($,J,Z,Q){if(Q.disableBareUrls)return null;var V="",X=!1,Y=$.charCodeAt(J);if(Y===f9||Y===72?J+8<=Z&&$.charCodeAt(J+1)===h9&&$.charCodeAt(J+2)===h9&&$.charCodeAt(J+3)===O$&&($.charCodeAt(J+4)===x$&&$.charCodeAt(J+5)===E0&&$.charCodeAt(J+6)===H0&&$.charCodeAt(J+7)===H0?V="https://":$.charCodeAt(J+4)===E0&&$.charCodeAt(J+5)===H0&&$.charCodeAt(J+6)===H0&&(V="http://")):Y===D9||Y===70?J+6<=Z&&$.charCodeAt(J+1)===h9&&$.charCodeAt(J+2)===O$&&$.charCodeAt(J+3)===E0&&$.charCodeAt(J+4)===H0&&$.charCodeAt(J+5)===H0&&(V="ftp://"):(Y===F9||Y===87)&&J+4<=Z&&$.charCodeAt(J+1)===F9&&$.charCodeAt(J+2)===F9&&$.charCodeAt(J+3)===p0&&(V="www.",X=!0),!V)return null;let G=J+V.length;for(;G<Z;){let B=$.charCodeAt(G);if(B===b||B===g||B===w||B===H9||B===e||B===d)break;G++}for(var K=0,q=0,U=J;U<G;U++){var F=$.charCodeAt(U);F===n0?K++:F===s0&&q++}let O=G;for(;O>J+V.length;){let B=$.charCodeAt(O-1);if(B===p0||B===J6||B===E0||B===S0||B===i9||B===s0||B===O0||B===K0||B===M0){if(B===s0){if(K>=q)break;q--}O--}else if(B===g$){for(var z=O-2;z>J&&($.charCodeAt(z)>=p&&$.charCodeAt(z)<=c||$.charCodeAt(z)>=Y0&&$.charCodeAt(z)<=q0||$.charCodeAt(z)>=o&&$.charCodeAt(z)<=r);)z--;z>=J&&$.charCodeAt(z)===S$?O=z:O--}else break}if(O<=J+V.length)return null;var H=J+(X?4:V.length),j=$.indexOf("/",H);if((j<0||j>O)&&(j=O),X&&$.indexOf(".",H)===-1)return null;for(var W=-1,M=-1,D=j-1;D>=H;D--)if($.charCodeAt(D)===p0)if(W<0)W=D;else{M=D;break}for(var N=M>=0?M+1:H,D=N;D<j;D++)if($.charCodeAt(D)===K0)return null;var I=$.slice(J,O),v=X?"http://"+I:I;return{node:{type:_.link,target:v,title:void 0,children:[{type:_.text,text:I}]},end:O}}function nZ($,J,Z,Q){if(Q.disableBareUrls)return null;for(var V=J,X=V;V<Z;){var Y=$.charCodeAt(V);if(Y>=p&&Y<=c||Y>=Y0&&Y<=q0||Y>=o&&Y<=r||Y===p0||Y===S0||Y===Y9||Y===36||Y===X$||Y===S$||Y===k9||Y===O0||Y===B9||Y===H0||Y===g0||Y===i9||Y===a0||Y===K0||Y===a||Y===L9||Y===v0||Y===H$||Y===M0||Y===u)V++;else break}if(V===X||V>=Z||$.charCodeAt(V)!==Y$)return null;V++;for(var G=V,K=-1,q=V;V<Z;){var Y=$.charCodeAt(V);if(Y>=p&&Y<=c||Y>=Y0&&Y<=q0||Y>=o&&Y<=r)V++;else if((Y===u||Y===K0)&&V>G)V++;else if(Y===p0){if(V===G)break;var U=$.charCodeAt(V-1);if(U===u||U===K0||V-q>63)break;if(V+1<Z){var F=$.charCodeAt(V+1);if(F>=p&&F<=c||F>=Y0&&F<=q0||F>=o&&F<=r)K=V,q=V+1,V++;else break}else break}else break}if(V-q>63||K<0)return null;var O=$.charCodeAt(V-1);if(!(O>=p&&O<=c||O>=Y0&&O<=q0||O>=o&&O<=r)||V<=K+1)return null;for(var z=-1,H=K-1;H>=G;H--)if($.charCodeAt(H)===p0){z=H;break}for(var j=z>=0?z+1:G,H=j;H<V;H++)if($.charCodeAt(H)===K0)return null;var W=$.slice(J,V);return{node:{type:_.link,target:"mailto:"+W,title:void 0,children:[{type:_.text,text:W}]},end:V}}function p$($){for(var J=0;J<$.length;J++)if($[J].type===_.link||"children"in $[J]&&Array.isArray($[J].children)&&p$($[J].children))return!0;return!1}function N$($){for(var J="",Z=0;Z<$.length;Z++){var Q=$[Z];Q.type===_.text?J+=Q.text:Q.type===_.breakLine?J+=" ":Q.type===_.codeInline?J+=Q.text:"children"in Q&&Array.isArray(Q.children)?J+=N$(Q.children):Q.type===_.image?J+=Q.alt||"":Q.type===_.link&&(J+=N$(Q.children))}return J}function d9($){let J=$.includes("&")?s9($):$;return{type:_.text,text:J}}function sZ($,J,Z,Q,V){if($.charCodeAt(J)!==e)return null;var X=J+1;if(X>=Z)return null;var Y=$.charCodeAt(X);if(Y===S0&&X+1<Z&&$.charCodeAt(X+1)===u&&X+2<Z&&$.charCodeAt(X+2)===u){var G=X+3;if(G<Z&&$.charCodeAt(G)===d)return{node:{type:_.htmlComment,text:"",i:!0},end:G+1};if(G+1<Z&&$.charCodeAt(G)===u&&$.charCodeAt(G+1)===d)return{node:{type:_.htmlComment,text:"-",i:!0},end:G+2};var K=$.indexOf("-->",G);return K!==-1&&K<=Z-3?{node:{type:_.htmlComment,text:$.slice(J+4,K),i:!1},end:K+3}:null}if(Y===i9){var q=$.indexOf("?>",X+1);return q!==-1&&q<Z?{node:{type:_.htmlSelfClosing,tag:"?",attrs:{},a:$.slice(J,q+2),b:!1},end:q+2}:null}if(Y===S0&&X+1<Z){var U=$.charCodeAt(X+1);if(U===W0&&$.slice(X+1,X+8)==="[CDATA["){var F=$.indexOf("]]>",X+8);return F!==-1&&F<Z?{node:{type:_.htmlSelfClosing,tag:"![CDATA[",attrs:{},a:$.slice(J,F+3),b:!1},end:F+3}:null}if(U>=p&&U<=c){var O=$.indexOf(">",X+2);return O!==-1&&O<Z?{node:{type:_.htmlSelfClosing,tag:"!"+$.slice(X+1,O),attrs:{},a:$.slice(J,O+1),b:!1},end:O+1}:null}}if(Y===H0){var z=X+1;if(z>=Z)return null;var H=$.charCodeAt(z);if(!(H>=p&&H<=c||H>=Y0&&H<=q0))return null;for(z++;z<Z;){var j=$.charCodeAt(z);if(j>=p&&j<=c||j>=Y0&&j<=q0||j>=o&&j<=r||j===u)z++;else break}for(;z<Z&&($.charCodeAt(z)===b||$.charCodeAt(z)===w||$.charCodeAt(z)===g);)z++;if(z<Z&&$.charCodeAt(z)===d){var W=$.slice(X+1,z).trim();return{node:{type:_.htmlSelfClosing,tag:W,attrs:{},a:$.slice(J,z+1),b:!0},end:z+1}}return null}if(!(Y>=p&&Y<=c||Y>=Y0&&Y<=q0))return null;var M=N9($,J);if(!M)return null;var D=M.tag,N=D.toLowerCase(),I=M.selfClosing;if(I||p9(D))return{node:{type:_.htmlSelfClosing,tag:D,attrs:_9(M.attrs,D,V),a:$.slice(J,M.end),b:!1},end:M.end};var v=q$.has(N),B=u$($.slice(0,Z),M.end,D);if(B===-1)return{node:{type:_.htmlSelfClosing,tag:D,attrs:_9(M.attrs,D,V),a:$.slice(J,M.end),b:!1},end:M.end};var S=fZ($,"</"+N,B),L=$.slice(M.end,S),R=[];if(v)L.trim()&&(R=[{type:_.text,text:L}]);else{var P=L.trim();if(P){var{inAnchor:y,inline:k}=Q;N==="a"&&(Q.inAnchor=!0);var E=P.indexOf(`

`)!==-1||/^#{1,6}\s/.test(P);E?(Q.inline=!1,R=v9(P,Q,V)):R=h0(P,0,P.length,Q,V),Q.inAnchor=y,Q.inline=k}}return{node:{type:_.htmlBlock,tag:D,attrs:_9(M.attrs,D,V),f:M.rawAttrs,children:R,a:void 0,text:L,d:!1,b:!1,endPos:B,e:!1},end:B}}var tZ=200,e9=0;function h0($,J,Z,Q,V){if(e9++,e9>tZ)return e9--,[{type:_.text,text:$.slice(J,Z)}];let X=Q;if(V.streaming||V.optimizeForStreaming){let $9=function(X0,T){for(var R0=1,F0=T+1;F0<X0.length;F0++){var K9=X0.charCodeAt(F0);if(K9===W0)R0++;else if(K9===u0&&(R0--,R0===0))return F0}return-1},A=$.slice(J,Z),l=A;for(var Y=0,G=0,K=0,q=0,U=0,F=-1,O=-1,z=-1,H=-1,j=-1,W=0;W<A.length;W++){var M=A.charCodeAt(W);M===O0?W+1<A.length&&A.charCodeAt(W+1)===O0?(Y++,F=W,W++):(G++,O=W):M===K0?W+1<A.length&&A.charCodeAt(W+1)===K0?(K++,z=W,W++):(q++,H=W):M===M0&&W+1<A.length&&A.charCodeAt(W+1)===M0&&(U++,j=W,W++)}var D=[];U%2===1&&j>=0&&D.push([j,2]),K%2===1&&z>=0&&D.push([z,2]),q%2===1&&H>=0&&D.push([H,1]),Y%2===1&&F>=0&&D.push([F,2]),G%2===1&&O>=0&&D.push([O,1]),D.sort(function(X0,T){return T[0]-X0[0]});for(var N=0;N<D.length;N++){var I=D[N][0],v=D[N][1];A=A.slice(0,I)+A.slice(I+v)}let I0=0,b0=-1;for(let X0=0;X0<A.length;X0++)A.charCodeAt(X0)===a&&(I0++,b0=X0);if(I0%2===1&&b0!==-1){let X0=!1,T=-1,R0=0;for(;R0<A.length;)A.charCodeAt(R0)===a&&(X0?(X0=!1,T=-1):(T=R0,X0=!0)),R0++;X0&&T!==-1&&(A=A.slice(0,T))}for(var B=!0;B;){B=!1;for(var S=-1,L=-1,R=-1,P=!1,y=0;y<A.length;y++){var k=A.charCodeAt(y);if(k===W0&&(y===0||A.charCodeAt(y-1)!==_0)){var E=y>0&&A.charCodeAt(y-1)===S0,h=E?y-1:y,f=$9(A,y);if(f===-1)S=h,P=E,L=y+1,R=A.length;else{var x=f+1;if(x>=A.length)S=h,P=E,L=y+1,R=f;else if(A.charCodeAt(x)===n0){var D0=A.indexOf(")",x+1);D0===-1?(S=h,P=E,L=y+1,R=f,y=A.length):y=D0}else if(A.charCodeAt(x)===W0){var Q0=A.indexOf("]",x+1);Q0===-1?(S=h,P=E,L=y+1,R=f,y=A.length):y=Q0}else y=f}}}if(S>=0){var m=P?"":A.slice(L,R);A=A.slice(0,S)+m,B=!0}}let k0=A.match(/<([A-Z][A-Za-z0-9]*)(?:\s[^>]*)?>([^<]*)$/);if(k0&&k0.index!==void 0){var n=k0[0].length-k0[2].length,y0=n>=2&&k0[0].charCodeAt(n-2)===H0;if(!y0){for(var c0=!1,m0=0,z0=0;z0<k0.index;z0++)A.charCodeAt(z0)===a&&m0++;if(c0=m0%2===1,!c0){let X0=k0[1];E9(A,"</"+X0,0)===-1&&(A=A.replace(/<[A-Z][A-Za-z0-9]*(?:\s[^>]*)?>([^<]*)$/,"$1"))}}}A!==l&&($=$.slice(0,J)+A,Z=J+A.length)}let C=[];var j0=[];let Z0=J;var G0=V.disableAutoLink||V.disableBareUrls||X.inAnchor?-1:$.indexOf("@",J);for(G0>=Z&&(G0=-1);J<Z;){let A=$.charCodeAt(J),l=null;if(A===a){if(l=dZ($,J,Z),!l){var G9=I9($,J,Z,a);J+=G9-1}}else if(A===O0||A===K0){var V0=oZ($,J,Z);if(V0){if(V0.canOpen||V0.canClose){J>Z0&&C.push(d9($.slice(Z0,J)));var B0=$.slice(J,J+V0.len),N0=d9(B0);j0.push({idx:C.length,ch:A,len:V0.len,canOpen:V0.canOpen,canClose:V0.canClose,active:!0}),C.push(N0),J+=V0.len,Z0=J;continue}J+=V0.len-1}}else if(A===M0)l=cZ($,J,Z,X,V);else if(A===g0)l=lZ($,J,Z,X,V);else if(A===W0)J+1<Z&&$.charCodeAt(J+1)===a0&&(l=iZ($,J,Z,X)),l||(l=w6($,J,Z,X,V));else if(A===S0&&J+1<Z&&$.charCodeAt(J+1)===W0)l=w6($,J,Z,X,V);else if(A===e)l=p6($,J,Z),!l&&!V.disableParsingRawHTML&&!V.ignoreHTMLBlocks&&(l=sZ($,J,Z,X,V));else if((A===f9||A===F9||A===D9)&&!X.inAnchor&&!V.disableAutoLink&&(J===0||$.charCodeAt(J-1)!==e)){var s=J+1<Z?$.charCodeAt(J+1):0;(A===f9&&s===h9||A===D9&&s===h9||A===F9&&s===F9)&&(l=aZ($,J,Z,V))}if(!l&&G0>=0&&G0-J<=64&&!X.inAnchor&&!V.disableAutoLink&&!V.disableBareUrls&&(A>=p&&A<=c||A>=Y0&&A<=q0||A>=o&&A<=r)&&(l=nZ($,J,Z,V),!l&&J>=G0&&(G0=$.indexOf("@",J+1),G0>=Z&&(G0=-1))),A===D$){J>Z0&&C.push(d9($.slice(Z0,J))),C.push({type:_.breakLine}),J++,Z0=J;continue}if(l)J>Z0&&C.push(d9($.slice(Z0,J))),C.push(l.node),J=l.end,Z0=J;else{if(A===_0&&J+1<Z){let I0=$.charCodeAt(J+1);if(d$(I0)&m9){J>Z0&&C.push(d9($.slice(Z0,J))),C.push(d9($[J+1])),J+=2,Z0=J;continue}}if(J++,G0<0||G0-J>64)for(;J<Z;){var U0=$.charCodeAt(J);if(U0<n9&&!k6[U0])J++;else break}}}if(Z>Z0){let A=$.slice(Z0,Z);A&&C.push(d9(A))}return j0.length>0&&rZ(C,j0,Q,V),e9--,C}var eZ=500;function v9($,J,Z){var Q=J.j||0;if(Q>eZ)return[{type:_.text,text:$}];J.j=Q+1;let V=J;if((Z.streaming||Z.optimizeForStreaming)&&!J.k){var X=$.length;X>0&&$.charCodeAt(X-1)===g&&X--;for(var Y=X;Y>0&&$.charCodeAt(Y-1)!==g;)Y--;if(Y>0&&$.charCodeAt(Y)===v0){for(var G=!0,K=Y;K<X;K++){var q=$.charCodeAt(K);if(q!==b&&q!==w&&q!==u&&q!==E0&&q!==v0){G=!1;break}}if(G){for(var U=Y-1;U>0&&$.charCodeAt(U-1)!==g;)U--;$.charCodeAt(U)===v0&&($=$.slice(0,U).trimEnd())}}var F=$.trim(),O=F.lastIndexOf(`
`),z=O===-1?F:F.slice(O+1);if(z.length>0&&z.charCodeAt(0)===v0){for(var H=!1,j=!1,W=1;W<z.length;W++){var M=z.charCodeAt(W);M===v0&&(H=!0),M===u&&(j=!0)}H&&j&&($=O===-1?"":$.slice(0,$.lastIndexOf(z)).trimEnd())}for(var D=-1,N=-1,I=-1,v=$.length-1;v>=0;v--)if($.charCodeAt(v)===e){var B=v+1<$.length?$.charCodeAt(v+1):0;if(B>=p&&B<=c||B>=Y0&&B<=q0){for(var S=v+2;S<$.length;){var L=$.charCodeAt(S);if(L>=p&&L<=c||L>=Y0&&L<=q0||L>=o&&L<=r)S++;else break}for(var R=S;R<$.length&&$.charCodeAt(R)!==d;)R++;if(R<$.length&&$.charCodeAt(R-1)!==H0){for(var P=!1,y=R+1;y<$.length;y++)if($.charCodeAt(y)===e){P=!0;break}P||(D=v,N=S,I=R+1)}}break}if(D>=0){for(var k=0,E=0;E<D;E++)$.charCodeAt(E)===a&&k++;if(k%2===0){var h=$.slice(D+1,N);E9($,"</"+h,0)===-1&&($=$.slice(0,D)+$.slice(I))}}for(var f=$.length;f>0&&$.charCodeAt(f-1)===g;)f--;if(f>0){for(var x=f;x>0&&$.charCodeAt(x-1)!==g;)x--;for(var D0=x,Q0=0;D0<f&&$.charCodeAt(D0)===b&&Q0<3;)D0++,Q0++;if(x>0&&D0<f&&SZ($,D0,f)){for(var m=x-1,n=m;n>0&&$.charCodeAt(n-1)!==g;)n--;d0($,n,m)||($=$.slice(0,x).trimEnd())}}var y0=$.length;if(y0>0){for(var c0=$.lastIndexOf(`
`),m0=c0===-1?0:c0+1,z0=y0,C=m0,j0=0;C<z0&&$.charCodeAt(C)===b&&j0<3;)C++,j0++;if(C<z0){var Z0=$.charCodeAt(C),G0=!1;if(Z0===O0||Z0===u||Z0===B9){var G9=C+1;if(G9>=z0||$.charCodeAt(G9)===b||$.charCodeAt(G9)===w){for(var V0=G9;V0<z0&&($.charCodeAt(V0)===b||$.charCodeAt(V0)===w);)V0++;V0>=z0&&(G0=!0)}}else if(Z0>=o&&Z0<=r){for(var B0=C;B0<z0&&$.charCodeAt(B0)>=o&&$.charCodeAt(B0)<=r;)B0++;if(B0<z0&&($.charCodeAt(B0)===p0||$.charCodeAt(B0)===s0)){var N0=B0+1;if(N0>=z0||$.charCodeAt(N0)===b||$.charCodeAt(N0)===w){for(var s=N0;s<z0&&($.charCodeAt(s)===b||$.charCodeAt(s)===w);)s++;s>=z0&&(G0=!0)}}}G0&&($=$.slice(0,m0).trimEnd())}}}if(J.inline)return h0($,0,$.length,J,Z);let U0=[],A=0,l=$.length;if(A===0&&!Z.disableFrontmatter&&$.startsWith("---")){let T=q6($);if(T&&T.hasValidYaml){if(Z.preserveFrontmatter!==!1){let R0=$.slice(0,T.endPos).trimEnd();U0.push({type:_.frontmatter,text:R0})}A=T.endPos}}for(;A<l;){for(var I0=$.indexOf(`
`,A),b0=I0<0?l:I0;A<l&&d0($,A,b0);)A=b0<l?b0+1:b0,A<l&&(I0=$.indexOf(`
`,A),b0=I0<0?l:I0);if(A>=l)break;$.charCodeAt(A),A0($,A,b0);let T=null;if(g6=$,T6=A,f6=b0,$.charCodeAt(A)!==a9&&$0>=4&&!J.inHTML)T=xZ($,A);else if($.charCodeAt(A)!==a9){let R0=A+t,F0=$.charCodeAt(R0);F0===Y9?T=h6($,A,J,Z):F0===d?T=gZ($,A,J,Z):F0===a||F0===M0?T=EZ($,A,J):F0===u||F0===O0||F0===K0?(T=x9($,A),!T&&(T=N6($,A,J,Z))):F0===B9||F0>=o&&F0<=r?T=N6($,A,J,Z):F0===e?T=m6($,A,J,Z):F0===v0?T=I6($,A,J,Z):F0===W0&&(T=CZ($,A,J))}if(!T){for(var $9=!1,k0=A;k0<b0;k0++)if($.charCodeAt(k0)===v0){$9=!0;break}$9&&(T=I6($,A,J,Z))}if(T||(T=uZ($,A,J,Z)),T)T.node.type!==_.refCollection&&U0.push(T.node),A=T.end;else{var X0=$.indexOf(`
`,A);A=X0<0?l:X0+1}}return J.j=Q,U0}function $J($,J){e9=0,$.charCodeAt(0)===65279&&($=$.slice(1)),$=f$($);let Z={inline:!1,inAnchor:!1,inHTML:!1,inList:!1,inBlockQuote:!1,refs:{}},Q={...J,slugify:J?.slugify?X=>J.slugify(X,f0):f0,sanitizer:J?.sanitizer||u9,tagfilter:J?.tagfilter!==!1};Z.k=E6($,Z.refs,Q);let V=v9($,Z,Q);return Z.refs&&Object.keys(Z.refs).length>0?[{type:_.refCollection,refs:Z.refs},...V]:V}function d6($,J,Z,Q){var V=N9($,J);return V?{tagName:V.tag,tagLower:V.tag.toLowerCase(),attrs:V.rawAttrs,whitespaceBeforeAttrs:V.whitespaceBeforeAttrs,isSelfClosing:V.selfClosing,hasSpaceBeforeSlash:V.hasSpaceBeforeSlash,isClosing:V.isClosing,hasNewline:V.whitespaceBeforeAttrs.includes(`
`)||V.rawAttrs.includes(`
`),endPos:V.end}:null}function I$($,J,Z){e9=0,$=f$($),!J.refs&&(J.refs={}),J.k=E6($,J.refs,Z);let Q=v9($,J,Z);return J.refs&&Object.keys(J.refs).length>0?[{type:_.refCollection,refs:J.refs},...Q]:Q}var VJ=/^\n+/,o6=Symbol("markdown-options");function l6($){if(!$)return"";let J=[];for(let Z in $){let Q=$[Z];Q===!0?J.push(` ${Z}`):Q!=null&&Q!==!1&&J.push(` ${Z}="${String(Q)}"`)}return J.length?J.join(""):""}var e0=$=>Array.isArray($)?$:$!==null?[$]:[],XJ={[_.blockQuote]:($,{h:J,output:Z,state:Q,slug:V})=>{let X={},Y=$.children;return $.alert&&(X.class="markdown-alert-"+V($.alert.toLowerCase(),f0),Y=[{attrs:{},children:[{type:_.text,text:$.alert}],d:!0,type:_.htmlBlock,tag:"header"},...Y]),J("blockquote",{key:Q.key,...X},...e0(Z(Y,Q)))},[_.breakLine]:($,{h:J,state:Z})=>J("br",{key:Z.key}),[_.breakThematic]:($,{h:J,state:Z})=>J("hr",{key:Z.key}),[_.frontmatter]:($,{h:J,state:Z,options:Q})=>Q.preserveFrontmatter?J("pre",{key:Z.key},$.text):null,[_.codeBlock]:($,{h:J,state:Z})=>{let Q=$.lang?s9($.lang):"",V={...$.attrs||{},class:Q?`language-${Q} lang-${Q}`:""};return J("pre",{key:Z.key},J("code",V,$.text))},[_.codeInline]:($,{h:J,state:Z})=>J("code",{key:Z.key},$.text),[_.footnoteReference]:($,{h:J,state:Z,sanitize:Q})=>J("a",{key:Z.key,href:Q($.target,"a","href")},J("sup",{},$.text)),[_.gfmTask]:($,{h:J,state:Z})=>J("input",{key:Z.key,checked:$.completed,readOnly:!0,type:"checkbox"}),[_.heading]:($,{h:J,output:Z,state:Q})=>J(`h${$.level}`,{id:$.id,key:Q.key},...e0(Z($.children,Q))),[_.htmlBlock]:($,J)=>{let{h:Z,state:Q,options:V,output:X,sanitize:Y,slug:G,refs:K}=J;if(V.tagfilter&&h$($.tag)){let F=typeof $.a=="string"?$.a:`<${$.tag}${l6($.attrs)}>`;return Z("span",{key:Q.key},F)}if($.a&&$.d){let F=$.tag.toLowerCase(),O=L6(F),z=/<[a-z][^>]{0,100}>/i.test($.a);if(O){let I=$.a.replace(new RegExp("\\s*</"+F+">\\s*$","i"),"");return V.tagfilter&&(I=C$(I)),z?Z($.tag,{key:Q.key,...$.attrs,innerHTML:I}):Z($.tag,{key:Q.key,...$.attrs},I)}let H=I=>{if((I.type===_.htmlSelfClosing||I.type===_.htmlBlock)&&I.b)return[];if(I.type===_.paragraph){let v=I.children;return v?v.flatMap(H):[]}return I.type===_.text?I.text?.trim()?[I]:[]:I.type===_.htmlBlock&&I.children?[{...I,children:I.children?.flatMap(H)}]:[I]};if(/<\/?pre\b/i.test($.a)){var q=$.a,U=new RegExp("\\s*</"+F+">\\s*$","i");q=q.replace(U,"");let I=V.tagfilter?C$(q):q;return Z($.tag,{key:Q.key,...$.attrs,innerHTML:I})}let W={slugify:I=>G(I,f0),sanitizer:Y,tagfilter:!0},M=$.a.replace(/>\s+</g,"><").replace(/\n+/g," ").trim();if(new RegExp(`^<${$.tag}(\\s[^>]*)?>(\\s*</${$.tag}>)?$`,"i").test(M))return Z($.tag,{key:Q.key,...$.attrs});let N=I$(M,{inline:!1,refs:K,inHTML:!1},W);return Z($.tag,{key:Q.key,...$.attrs},...e0(X(N.flatMap(H),Q)))}return p9($.tag)?Z($.tag,{key:Q.key,...$.attrs}):Z($.tag,{key:Q.key,...$.attrs},...e0($.children?X($.children,Q):null))},[_.htmlSelfClosing]:($,{h:J,state:Z,options:Q})=>{if(Q.tagfilter&&h$($.tag)){let V=typeof $.a=="string"?$.a:`<${$.tag}${l6($.attrs)} />`;return J("span",{key:Z.key},V)}return J($.tag,{key:Z.key,...$.attrs})},[_.image]:($,{h:J,state:Z,sanitize:Q})=>J("img",{key:Z.key,alt:$.alt?.length>0?$.alt:void 0,title:$.title||void 0,src:Q($.target,"img","src")}),[_.link]:($,{h:J,output:Z,state:Q})=>{let V={key:Q.key};return $.target!=null&&(V.href=O6($.target)),$.title&&(V.title=$.title),J("a",V,...e0(Z($.children,Q)))},[_.table]:($,{h:J,output:Z,state:Q})=>{let V=$.header.map((G,K)=>J("th",{key:K,style:$.align[K]==null?{}:{textAlign:$.align[K]}},...e0(Z(G,Q)))),X=$.cells.map((G,K)=>J("tr",{key:K},...G.map((q,U)=>J("td",{key:U,style:$.align[U]==null?{}:{textAlign:$.align[U]}},...e0(Z(q,Q))))));var Y=[J("thead",{},J("tr",{},...V))];return $.cells.length>0&&Y.push(J("tbody",{},...X)),J("table",{key:Q.key},...Y)},[_.text]:$=>$.text,[_.textFormatted]:($,{h:J,output:Z,state:Q})=>J($.tag,{key:Q.key},...e0(Z($.children,Q))),[_.orderedList]:($,{h:J,output:Z,state:Q})=>{let V=$.items.map((Y,G)=>J("li",{key:G},...e0(Z(Y,Q)))),X={key:Q.key,start:$.start};return J("ol",X,...V)},[_.unorderedList]:($,{h:J,output:Z,state:Q})=>{let V=$.items.map((X,Y)=>J("li",{key:Y},...e0(Z(X,Q))));return J("ul",{key:Q.key},...V)},[_.paragraph]:($,{h:J,output:Z,state:Q})=>J("p",{key:Q.key},...e0(Z($.children,Q))),[_.ref]:()=>null};function YJ($,J,Z,Q,V,X,Y,G){let K=XJ[$.type];return K?K($,{h:Q,output:J,state:Z,sanitize:V,slug:X,refs:Y,options:G}):null}var GJ=($,J,Z,Q,V,X)=>{let Y=(q,U,F)=>{let O=()=>YJ(q,z=>U(Array.isArray(z)?z:[z]),F,J,Z,Q,V,X);return $?$(O,q,U,F):O()},G=q=>q.map(U=>"text"in U?U.text:""),K=(q,U={})=>{let F=(U.renderDepth||0)+1;if(F>2500)return G(q);U.renderDepth=F;let O=U.key,z=[],H=!1;for(let j=0;j<q.length;j++){U.key=j;let W=Y(q[j],K,U),M=typeof W=="string";if(M&&H)z[z.length-1]+=W;else if(W!==null)if(Array.isArray(W))for(let D=0;D<W.length;D++)z.push(W[D]);else z.push(W);H=M}return U.key=O,U.renderDepth=F-1,z};return K},KJ=($,J)=>{if(typeof $=="function"||!J)return $;let Z=$,Q=t9(J,Z,void 0);if(!Q)return $;if(typeof Q=="function"||typeof Q=="object"&&Q!==null&&("render"in Q||"setup"in Q))return Q;let V=t9(J,`${Z}.component`,Z);return typeof V=="function"||typeof V=="object"&&V!==null&&("render"in V||"setup"in V),V};function qJ($,J){let Z={...J||{}};Z.overrides=Z.overrides||{};let Q=Z.slugify||f0,V=Z.sanitizer||u9,X=H=>r6(H,{...Z,wrapper:null});function Y(H,j,...W){let M=typeof H=="string"?H:"",D=Z.overrides&&Object.keys(Z.overrides).length>0,N=D?t9(Z.overrides,`${M}.props`,{}):null,I=j||null;if(I)for(let y in I){let k=I[y];if(typeof k=="string"&&k.length>0&&k[0]==="<"&&(R6.test(k)||y6.test(k)||d6(k,0))){let E=X(k.trim());I[y]=y==="innerHTML"&&Array.isArray(E)?E[0]:E}}let v=D?KJ(H,Z.overrides):H,B=I?.class,S=N?.class,L=B&&S?`${B} ${S}`:B||S||void 0,R=typeof v!="string";if(!D&&!L&&!I?.innerHTML)return R&&W.length>0?Z$(v,I||{},{default:()=>W}):Z$(v,I||{},...W);let P=I?{...I}:{};if(N)for(let y in N)P[y]=N[y];return L&&(P.class=L),I?.innerHTML&&N?.innerHTML===void 0&&(P.innerHTML=I.innerHTML),R&&W.length>0?Z$(v,P,{default:()=>W}):Z$(v,P,...W)}let G=Z.createElement||((H,j,...W)=>typeof H!="string"&&W.length>0?Z$(H,j||{},{default:()=>W}):Z$(H,j||{},...W)),K={slugify:H=>Q(H,f0),sanitizer:V,tagfilter:Z.tagfilter!==!1,disableAutoLink:Z.disableAutoLink,disableParsingRawHTML:Z.disableParsingRawHTML,enforceAtxHeadings:Z.enforceAtxHeadings,forceBlock:Z.forceBlock,forceInline:Z.forceInline,preserveFrontmatter:Z.preserveFrontmatter},q=$[0]&&$[0].type===_.refCollection?$[0].refs:{},U=GJ(Z.renderRule,Y,V,Q,q,Z),F=U($,{inline:Z.forceInline,refs:q}),O=[];for(let H in q)H.charCodeAt(0)===a0&&O.push({identifier:H,footnote:q[H].target});if(O.length){let H=O.map(j=>{let W=j.identifier.slice(1),M=I$(j.footnote,{inline:!0,refs:q},K),D=U(M,{inline:!0,refs:q}),N=e0(D);return Y("div",{id:Q(W,f0)},W+": ",...N)});F.push(Y("footer",{key:"footer"},...H))}if(Z.wrapper===null)return F.length===0?null:F.length===1?F[0]:F;let z=Z.wrapper||(Z.forceInline?"span":"div");return F.length>1||Z.forceWrapper?G(z,{...Z.wrapperProps},...F):F.length===1?F[0]:null}function r6($="",J={}){let Z={...J||{}};Z.overrides=Z.overrides||{};let Q=Z.slugify||f0,V=Z.sanitizer||u9,X=Z.forceInline||!Z.forceBlock&&!U6.test($),Y={slugify:U=>Q(U,f0),sanitizer:V,tagfilter:Z.tagfilter!==!1,disableAutoLink:Z.disableAutoLink,disableParsingRawHTML:Z.disableParsingRawHTML,enforceAtxHeadings:Z.enforceAtxHeadings,forceBlock:Z.forceBlock,forceInline:X,preserveFrontmatter:Z.preserveFrontmatter},G={},K=$;if(!X){let U=K.length;for(;U>0&&(K[U-1]===`
`||K[U-1]==="\r");)U--;K=K.slice(0,U),K=`${K.replace(VJ,"")}

`}let q=I$(X?$:K,{inline:X,refs:G},Y);return qJ(q,{...Z,forceInline:X})}var SJ=$=>(JJ(o6,$.options),$.children),UJ=$=>{let J=QJ(o6,void 0),Z=c6(()=>{var K=Object.assign({},J,$.options);return K.overrides=Object.assign({},J?.overrides,$.options?.overrides),K}),Q=$.children===null||$.children===void 0?"":$.children,{options:V,children:X,...Y}=$;return c6(()=>r6(Q,{...Z.value,wrapperProps:{...Z.value?.wrapperProps,...Y}})).value},fJ=UJ;export{f0 as slugify,u9 as sanitizer,$J as parser,fJ as default,r6 as compiler,qJ as astToJSX,_ as RuleType,SJ as MarkdownProvider,o6 as MarkdownOptionsKey,UJ as Markdown};
