md-editor-v3 4.19.0-6 → 4.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/chunks/index.cjs +1 -1
- package/lib/es/chunks/index.mjs +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +1 -1
package/lib/cjs/chunks/index.cjs
CHANGED
package/lib/es/chunks/index.mjs
CHANGED
package/lib/umd/index.js
CHANGED
|
@@ -110,7 +110,7 @@ See: https://github.com/francoischalifour/medium-zoom`)}},h3=function(t){var n=d
|
|
|
110
110
|
`:">",o},rO.prototype.renderInline=function(e,t,n){let i="";const r=this.rules;for(let o=0,a=e.length;o<a;o++){const O=e[o].type;typeof r[O]<"u"?i+=r[O](e,o,t,n,this):i+=this.renderToken(e,o,t)}return i},rO.prototype.renderInlineAsText=function(e,t,n){let i="";for(let r=0,o=e.length;r<o;r++)switch(e[r].type){case"text":i+=e[r].content;break;case"image":i+=this.renderInlineAsText(e[r].children,t,n);break;case"html_inline":case"html_block":i+=e[r].content;break;case"softbreak":case"hardbreak":i+=`
|
|
111
111
|
`;break}return i},rO.prototype.render=function(e,t,n){let i="";const r=this.rules;for(let o=0,a=e.length;o<a;o++){const O=e[o].type;O==="inline"?i+=this.renderInline(e[o].children,t,n):typeof r[O]<"u"?i+=r[O](e,o,t,n,this):i+=this.renderToken(e,o,t,n)}return i};function pn(){this.__rules__=[],this.__cache__=null}pn.prototype.__find__=function(e){for(let t=0;t<this.__rules__.length;t++)if(this.__rules__[t].name===e)return t;return-1},pn.prototype.__compile__=function(){const e=this,t=[""];e.__rules__.forEach(function(n){n.enabled&&n.alt.forEach(function(i){t.indexOf(i)<0&&t.push(i)})}),e.__cache__={},t.forEach(function(n){e.__cache__[n]=[],e.__rules__.forEach(function(i){i.enabled&&(n&&i.alt.indexOf(n)<0||e.__cache__[n].push(i.fn))})})},pn.prototype.at=function(e,t,n){const i=this.__find__(e),r=n||{};if(i===-1)throw new Error("Parser rule not found: "+e);this.__rules__[i].fn=t,this.__rules__[i].alt=r.alt||[],this.__cache__=null},pn.prototype.before=function(e,t,n,i){const r=this.__find__(e),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},pn.prototype.after=function(e,t,n,i){const r=this.__find__(e),o=i||{};if(r===-1)throw new Error("Parser rule not found: "+e);this.__rules__.splice(r+1,0,{name:t,enabled:!0,fn:n,alt:o.alt||[]}),this.__cache__=null},pn.prototype.push=function(e,t,n){const i=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:i.alt||[]}),this.__cache__=null},pn.prototype.enable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!0,n.push(i)},this),this.__cache__=null,n},pn.prototype.enableOnly=function(e,t){Array.isArray(e)||(e=[e]),this.__rules__.forEach(function(n){n.enabled=!1}),this.enable(e,t)},pn.prototype.disable=function(e,t){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(function(i){const r=this.__find__(i);if(r<0){if(t)return;throw new Error("Rules manager: invalid rule name "+i)}this.__rules__[r].enabled=!1,n.push(i)},this),this.__cache__=null,n},pn.prototype.getRules=function(e){return this.__cache__===null&&this.__compile__(),this.__cache__[e]||[]};function bi(e,t,n){this.type=e,this.tag=t,this.attrs=null,this.map=null,this.nesting=n,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}bi.prototype.attrIndex=function(t){if(!this.attrs)return-1;const n=this.attrs;for(let i=0,r=n.length;i<r;i++)if(n[i][0]===t)return i;return-1},bi.prototype.attrPush=function(t){this.attrs?this.attrs.push(t):this.attrs=[t]},bi.prototype.attrSet=function(t,n){const i=this.attrIndex(t),r=[t,n];i<0?this.attrPush(r):this.attrs[i]=r},bi.prototype.attrGet=function(t){const n=this.attrIndex(t);let i=null;return n>=0&&(i=this.attrs[n][1]),i},bi.prototype.attrJoin=function(t,n){const i=this.attrIndex(t);i<0?this.attrPush([t,n]):this.attrs[i][1]=this.attrs[i][1]+" "+n};function $x(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}$x.prototype.Token=bi;const $6=/\r\n?|\n/g,Q6=/\0/g;function b6(e){let t;t=e.src.replace($6,`
|
|
112
112
|
`),t=t.replace(Q6,"�"),e.src=t}function y6(e){let t;e.inlineMode?(t=new e.Token("inline","",0),t.content=e.src,t.map=[0,1],t.children=[],e.tokens.push(t)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function S6(e){const t=e.tokens;for(let n=0,i=t.length;n<i;n++){const r=t[n];r.type==="inline"&&e.md.inline.parse(r.content,e.md,e.env,r.children)}}function P6(e){return/^<a[>\s]/i.test(e)}function k6(e){return/^<\/a\s*>/i.test(e)}function x6(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,i=t.length;n<i;n++){if(t[n].type!=="inline"||!e.md.linkify.pretest(t[n].content))continue;let r=t[n].children,o=0;for(let a=r.length-1;a>=0;a--){const O=r[a];if(O.type==="link_close"){for(a--;r[a].level!==O.level&&r[a].type!=="link_open";)a--;continue}if(O.type==="html_inline"&&(P6(O.content)&&o>0&&o--,k6(O.content)&&o++),!(o>0)&&O.type==="text"&&e.md.linkify.test(O.content)){const l=O.content;let s=e.md.linkify.match(l);const u=[];let c=O.level,f=0;s.length>0&&s[0].index===0&&a>0&&r[a-1].type==="text_special"&&(s=s.slice(1));for(let h=0;h<s.length;h++){const p=s[h].url,Q=e.md.normalizeLink(p);if(!e.md.validateLink(Q))continue;let $=s[h].text;s[h].schema?s[h].schema==="mailto:"&&!/^mailto:/i.test($)?$=e.md.normalizeLinkText("mailto:"+$).replace(/^mailto:/,""):$=e.md.normalizeLinkText($):$=e.md.normalizeLinkText("http://"+$).replace(/^http:\/\//,"");const g=s[h].index;if(g>f){const y=new e.Token("text","",0);y.content=l.slice(f,g),y.level=c,u.push(y)}const b=new e.Token("link_open","a",1);b.attrs=[["href",Q]],b.level=c++,b.markup="linkify",b.info="auto",u.push(b);const P=new e.Token("text","",0);P.content=$,P.level=c,u.push(P);const k=new e.Token("link_close","a",-1);k.level=--c,k.markup="linkify",k.info="auto",u.push(k),f=s[h].lastIndex}if(f<l.length){const h=new e.Token("text","",0);h.content=l.slice(f),h.level=c,u.push(h)}t[n].children=r=mx(r,a,u)}}}}const Qx=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,v6=/\((c|tm|r)\)/i,w6=/\((c|tm|r)\)/ig,X6={c:"©",r:"®",tm:"™"};function T6(e,t){return X6[t.toLowerCase()]}function _6(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&(i.content=i.content.replace(w6,T6)),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function R6(e){let t=0;for(let n=e.length-1;n>=0;n--){const i=e[n];i.type==="text"&&!t&&Qx.test(i.content)&&(i.content=i.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),i.type==="link_open"&&i.info==="auto"&&t--,i.type==="link_close"&&i.info==="auto"&&t++}}function z6(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(v6.test(e.tokens[t].content)&&_6(e.tokens[t].children),Qx.test(e.tokens[t].content)&&R6(e.tokens[t].children))}const W6=/['"]/,bx=/['"]/g,yx="’";function Ec(e,t,n){return e.slice(0,t)+n+e.slice(t+1)}function q6(e,t){let n;const i=[];for(let r=0;r<e.length;r++){const o=e[r],a=e[r].level;for(n=i.length-1;n>=0&&!(i[n].level<=a);n--);if(i.length=n+1,o.type!=="text")continue;let O=o.content,l=0,s=O.length;e:for(;l<s;){bx.lastIndex=l;const u=bx.exec(O);if(!u)break;let c=!0,f=!0;l=u.index+1;const h=u[0]==="'";let p=32;if(u.index-1>=0)p=O.charCodeAt(u.index-1);else for(n=r-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){p=e[n].content.charCodeAt(e[n].content.length-1);break}let Q=32;if(l<s)Q=O.charCodeAt(l);else for(n=r+1;n<e.length&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n++)if(e[n].content){Q=e[n].content.charCodeAt(0);break}const $=Dl(p)||Il(String.fromCharCode(p)),g=Dl(Q)||Il(String.fromCharCode(Q)),b=Gl(p),P=Gl(Q);if(P?c=!1:g&&(b||$||(c=!1)),b?f=!1:$&&(P||g||(f=!1)),Q===34&&u[0]==='"'&&p>=48&&p<=57&&(f=c=!1),c&&f&&(c=$,f=g),!c&&!f){h&&(o.content=Ec(o.content,u.index,yx));continue}if(f)for(n=i.length-1;n>=0;n--){let k=i[n];if(i[n].level<a)break;if(k.single===h&&i[n].level===a){k=i[n];let y,X;h?(y=t.md.options.quotes[2],X=t.md.options.quotes[3]):(y=t.md.options.quotes[0],X=t.md.options.quotes[1]),o.content=Ec(o.content,u.index,X),e[k.token].content=Ec(e[k.token].content,k.pos,y),l+=X.length-1,k.token===r&&(l+=y.length-1),O=o.content,s=O.length,i.length=n;continue e}}c?i.push({token:r,pos:u.index,single:h,level:a}):f&&h&&(o.content=Ec(o.content,u.index,yx))}}}function Z6(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!W6.test(e.tokens[t].content)||q6(e.tokens[t].children,e)}function U6(e){let t,n;const i=e.tokens,r=i.length;for(let o=0;o<r;o++){if(i[o].type!=="inline")continue;const a=i[o].children,O=a.length;for(t=0;t<O;t++)a[t].type==="text_special"&&(a[t].type="text");for(t=n=0;t<O;t++)a[t].type==="text"&&t+1<O&&a[t+1].type==="text"?a[t+1].content=a[t].content+a[t+1].content:(t!==n&&(a[n]=a[t]),n++);t!==n&&(a.length=n)}}const Im=[["normalize",b6],["block",y6],["inline",S6],["linkify",x6],["replacements",z6],["smartquotes",Z6],["text_join",U6]];function Dm(){this.ruler=new pn;for(let e=0;e<Im.length;e++)this.ruler.push(Im[e][0],Im[e][1])}Dm.prototype.process=function(e){const t=this.ruler.getRules("");for(let n=0,i=t.length;n<i;n++)t[n](e)},Dm.prototype.State=$x;function er(e,t,n,i){this.src=e,this.md=t,this.env=n,this.tokens=i,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const r=this.src;for(let o=0,a=0,O=0,l=0,s=r.length,u=!1;a<s;a++){const c=r.charCodeAt(a);if(!u)if(Fe(c)){O++,c===9?l+=4-l%4:l++;continue}else u=!0;(c===10||a===s-1)&&(c!==10&&a++,this.bMarks.push(o),this.eMarks.push(a),this.tShift.push(O),this.sCount.push(l),this.bsCount.push(0),u=!1,O=0,l=0,o=a+1)}this.bMarks.push(r.length),this.eMarks.push(r.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}er.prototype.push=function(e,t,n){const i=new bi(e,t,n);return i.block=!0,n<0&&this.level--,i.level=this.level,n>0&&this.level++,this.tokens.push(i),i},er.prototype.isEmpty=function(t){return this.bMarks[t]+this.tShift[t]>=this.eMarks[t]},er.prototype.skipEmptyLines=function(t){for(let n=this.lineMax;t<n&&!(this.bMarks[t]+this.tShift[t]<this.eMarks[t]);t++);return t},er.prototype.skipSpaces=function(t){for(let n=this.src.length;t<n;t++){const i=this.src.charCodeAt(t);if(!Fe(i))break}return t},er.prototype.skipSpacesBack=function(t,n){if(t<=n)return t;for(;t>n;)if(!Fe(this.src.charCodeAt(--t)))return t+1;return t},er.prototype.skipChars=function(t,n){for(let i=this.src.length;t<i&&this.src.charCodeAt(t)===n;t++);return t},er.prototype.skipCharsBack=function(t,n,i){if(t<=i)return t;for(;t>i;)if(n!==this.src.charCodeAt(--t))return t+1;return t},er.prototype.getLines=function(t,n,i,r){if(t>=n)return"";const o=new Array(n-t);for(let a=0,O=t;O<n;O++,a++){let l=0;const s=this.bMarks[O];let u=s,c;for(O+1<n||r?c=this.eMarks[O]+1:c=this.eMarks[O];u<c&&l<i;){const f=this.src.charCodeAt(u);if(Fe(f))f===9?l+=4-(l+this.bsCount[O])%4:l++;else if(u-s<this.tShift[O])l++;else break;u++}l>i?o[a]=new Array(l-i+1).join(" ")+this.src.slice(u,c):o[a]=this.src.slice(u,c)}return o.join("")},er.prototype.Token=bi;const E6=65536;function Nm(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];return e.src.slice(n,i)}function Sx(e){const t=[],n=e.length;let i=0,r=e.charCodeAt(i),o=!1,a=0,O="";for(;i<n;)r===124&&(o?(O+=e.substring(a,i-1),a=i):(t.push(O+e.substring(a,i)),O="",a=i+1)),o=r===92,i++,r=e.charCodeAt(i);return t.push(O+e.substring(a)),t}function Y6(e,t,n,i){if(t+2>n)return!1;let r=t+1;if(e.sCount[r]<e.blkIndent||e.sCount[r]-e.blkIndent>=4)return!1;let o=e.bMarks[r]+e.tShift[r];if(o>=e.eMarks[r])return!1;const a=e.src.charCodeAt(o++);if(a!==124&&a!==45&&a!==58||o>=e.eMarks[r])return!1;const O=e.src.charCodeAt(o++);if(O!==124&&O!==45&&O!==58&&!Fe(O)||a===45&&Fe(O))return!1;for(;o<e.eMarks[r];){const k=e.src.charCodeAt(o);if(k!==124&&k!==45&&k!==58&&!Fe(k))return!1;o++}let l=Nm(e,t+1),s=l.split("|");const u=[];for(let k=0;k<s.length;k++){const y=s[k].trim();if(!y){if(k===0||k===s.length-1)continue;return!1}if(!/^:?-+:?$/.test(y))return!1;y.charCodeAt(y.length-1)===58?u.push(y.charCodeAt(0)===58?"center":"right"):y.charCodeAt(0)===58?u.push("left"):u.push("")}if(l=Nm(e,t).trim(),l.indexOf("|")===-1||e.sCount[t]-e.blkIndent>=4)return!1;s=Sx(l),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop();const c=s.length;if(c===0||c!==u.length)return!1;if(i)return!0;const f=e.parentType;e.parentType="table";const h=e.md.block.ruler.getRules("blockquote"),p=e.push("table_open","table",1),Q=[t,0];p.map=Q;const $=e.push("thead_open","thead",1);$.map=[t,t+1];const g=e.push("tr_open","tr",1);g.map=[t,t+1];for(let k=0;k<s.length;k++){const y=e.push("th_open","th",1);u[k]&&(y.attrs=[["style","text-align:"+u[k]]]);const X=e.push("inline","",0);X.content=s[k].trim(),X.children=[],e.push("th_close","th",-1)}e.push("tr_close","tr",-1),e.push("thead_close","thead",-1);let b,P=0;for(r=t+2;r<n&&!(e.sCount[r]<e.blkIndent);r++){let k=!1;for(let X=0,x=h.length;X<x;X++)if(h[X](e,r,n,!0)){k=!0;break}if(k||(l=Nm(e,r).trim(),!l)||e.sCount[r]-e.blkIndent>=4||(s=Sx(l),s.length&&s[0]===""&&s.shift(),s.length&&s[s.length-1]===""&&s.pop(),P+=c-s.length,P>E6))break;if(r===t+2){const X=e.push("tbody_open","tbody",1);X.map=b=[t+2,0]}const y=e.push("tr_open","tr",1);y.map=[r,r+1];for(let X=0;X<c;X++){const x=e.push("td_open","td",1);u[X]&&(x.attrs=[["style","text-align:"+u[X]]]);const v=e.push("inline","",0);v.content=s[X]?s[X].trim():"",v.children=[],e.push("td_close","td",-1)}e.push("tr_close","tr",-1)}return b&&(e.push("tbody_close","tbody",-1),b[1]=r),e.push("table_close","table",-1),Q[1]=r,e.parentType=f,e.line=r,!0}function V6(e,t,n){if(e.sCount[t]-e.blkIndent<4)return!1;let i=t+1,r=i;for(;i<n;){if(e.isEmpty(i)){i++;continue}if(e.sCount[i]-e.blkIndent>=4){i++,r=i;continue}break}e.line=r;const o=e.push("code_block","code",0);return o.content=e.getLines(t,r,4+e.blkIndent,!1)+`
|
|
113
|
-
`,o.map=[t,e.line],!0}function C6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const a=e.src.charCodeAt(r);if(a!==126&&a!==96)return!1;let O=r;r=e.skipChars(r,a);let l=r-O;if(l<3)return!1;const s=e.src.slice(O,r),u=e.src.slice(r,o);if(a===96&&u.indexOf(String.fromCharCode(a))>=0)return!1;if(i)return!0;let c=t,f=!1;for(;c++,!(c>=n||(r=O=e.bMarks[c]+e.tShift[c],o=e.eMarks[c],r<o&&e.sCount[c]<e.blkIndent));)if(e.src.charCodeAt(r)===a&&!(e.sCount[c]-e.blkIndent>=4)&&(r=e.skipChars(r,a),!(r-O<l)&&(r=e.skipSpaces(r),!(r<o)))){f=!0;break}l=e.sCount[t],e.line=c+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,c,l,!0),h.markup=s,h.map=[t,e.line],!0}function j6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const O=[],l=[],s=[],u=[],c=e.md.block.ruler.getRules("blockquote"),f=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=t;p<n;p++){const P=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],r>=o)break;if(e.src.charCodeAt(r++)===62&&!P){let y=e.sCount[p]+1,X,x;e.src.charCodeAt(r)===32?(r++,y++,x=!1,X=!0):e.src.charCodeAt(r)===9?(X=!0,(e.bsCount[p]+y)%4===3?(r++,y++,x=!1):x=!0):X=!1;let v=y;for(O.push(e.bMarks[p]),e.bMarks[p]=r;r<o;){const w=e.src.charCodeAt(r);if(Fe(w))w===9?v+=4-(v+e.bsCount[p]+(x?1:0))%4:v++;else break;r++}h=r>=o,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(X?1:0),s.push(e.sCount[p]),e.sCount[p]=v-y,u.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(h)break;let k=!1;for(let y=0,X=c.length;y<X;y++)if(c[y](e,p,n,!0)){k=!0;break}if(k){e.lineMax=p,e.blkIndent!==0&&(O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]=-1}const Q=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const g=[t,0];$.map=g,e.md.block.tokenize(e,t,p);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=a,e.parentType=f,g[1]=e.line;for(let P=0;P<u.length;P++)e.bMarks[P+t]=O[P],e.tShift[P+t]=u[P],e.sCount[P+t]=s[P],e.bsCount[P+t]=l[P];return e.blkIndent=Q,!0}function A6(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let O=1;for(;o<r;){const s=e.src.charCodeAt(o++);if(s!==a&&!Fe(s))return!1;s===a&&O++}if(O<3)return!1;if(i)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(O+1).join(String.fromCharCode(a)),!0}function Px(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const o=e.src.charCodeAt(i);if(!Fe(o))return-1}return i}function kx(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=i)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<i&&(o=e.src.charCodeAt(r),!Fe(o))?-1:r}function G6(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function I6(e,t,n,i){let r,o,a,O,l=t,s=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u=!1;i&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(u=!0);let c,f,h;if((h=kx(e,l))>=0){if(c=!0,a=e.bMarks[l]+e.tShift[l],f=Number(e.src.slice(a,h-1)),u&&f!==1)return!1}else if((h=Px(e,l))>=0)c=!1;else return!1;if(u&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(i)return!0;const p=e.src.charCodeAt(h-1),Q=e.tokens.length;c?(O=e.push("ordered_list_open","ol",1),f!==1&&(O.attrs=[["start",f]])):O=e.push("bullet_list_open","ul",1);const $=[l,0];O.map=$,O.markup=String.fromCharCode(p);let g=!1;const b=e.md.block.ruler.getRules("list"),P=e.parentType;for(e.parentType="list";l<n;){o=h,r=e.eMarks[l];const k=e.sCount[l]+h-(e.bMarks[l]+e.tShift[l]);let y=k;for(;o<r;){const q=e.src.charCodeAt(o);if(q===9)y+=4-(y+e.bsCount[l])%4;else if(q===32)y++;else break;o++}const X=o;let x;X>=r?x=1:x=y-k,x>4&&(x=1);const v=k+x;O=e.push("list_item_open","li",1),O.markup=String.fromCharCode(p);const w=[l,0];O.map=w,c&&(O.info=e.src.slice(a,h-1));const Y=e.tight,U=e.tShift[l],V=e.sCount[l],Z=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=v,e.tight=!0,e.tShift[l]=X-e.bMarks[l],e.sCount[l]=y,X>=r&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||g)&&(s=!1),g=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Z,e.tShift[l]=U,e.sCount[l]=V,e.tight=Y,O=e.push("list_item_close","li",-1),O.markup=String.fromCharCode(p),l=e.line,w[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let T=!1;for(let q=0,W=b.length;q<W;q++)if(b[q](e,l,n,!0)){T=!0;break}if(T)break;if(c){if(h=kx(e,l),h<0)break;a=e.bMarks[l]+e.tShift[l]}else if(h=Px(e,l),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return c?O=e.push("ordered_list_close","ol",-1):O=e.push("bullet_list_close","ul",-1),O.markup=String.fromCharCode(p),$[1]=l,e.line=l,e.parentType=P,s&&G6(e,Q),!0}function D6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function O(b){const P=e.lineMax;if(b>=P||e.isEmpty(b))return null;let k=!1;if(e.sCount[b]-e.blkIndent>3&&(k=!0),e.sCount[b]<0&&(k=!0),!k){const x=e.md.block.ruler.getRules("reference"),v=e.parentType;e.parentType="reference";let w=!1;for(let Y=0,U=x.length;Y<U;Y++)if(x[Y](e,b,P,!0)){w=!0;break}if(e.parentType=v,w)return null}const y=e.bMarks[b]+e.tShift[b],X=e.eMarks[b];return e.src.slice(y,X+1)}let l=e.src.slice(r,o+1);o=l.length;let s=-1;for(r=1;r<o;r++){const b=l.charCodeAt(r);if(b===91)return!1;if(b===93){s=r;break}else if(b===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(b===92&&(r++,r<o&&l.charCodeAt(r)===10)){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}}if(s<0||l.charCodeAt(s+1)!==58)return!1;for(r=s+2;r<o;r++){const b=l.charCodeAt(r);if(b===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(b))break}const u=e.md.helpers.parseLinkDestination(l,r,o);if(!u.ok)return!1;const c=e.md.normalizeLink(u.str);if(!e.md.validateLink(c))return!1;r=u.pos;const f=r,h=a,p=r;for(;r<o;r++){const b=l.charCodeAt(r);if(b===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(b))break}let Q=e.md.helpers.parseLinkTitle(l,r,o);for(;Q.can_continue;){const b=O(a);if(b===null)break;l+=b,r=o,o=l.length,a++,Q=e.md.helpers.parseLinkTitle(l,r,o,Q)}let $;for(r<o&&p!==r&&Q.ok?($=Q.str,r=Q.pos):($="",r=f,a=h);r<o;){const b=l.charCodeAt(r);if(!Fe(b))break;r++}if(r<o&&l.charCodeAt(r)!==10&&$)for($="",r=f,a=h;r<o;){const b=l.charCodeAt(r);if(!Fe(b))break;r++}if(r<o&&l.charCodeAt(r)!==10)return!1;const g=Uc(l.slice(1,s));return g?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:$,href:c}),e.line=a),!0):!1}const N6=["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"],L6="[a-zA-Z_:][a-zA-Z0-9:._-]*",F6="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",xx="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+L6+"(?:\\s*=\\s*"+F6+")?)")+"*\\s*\\/?>",vx="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",M6="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",B6="<[?][\\s\\S]*?[?]>",H6="<![A-Za-z][^>]*>",K6="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",J6=new RegExp("^(?:"+xx+"|"+vx+"|"+M6+"|"+B6+"|"+H6+"|"+K6+")"),eC=new RegExp("^(?:"+xx+"|"+vx+")"),oO=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+N6.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(eC.source+"\\s*$"),/^$/,!1]];function tC(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let a=e.src.slice(r,o),O=0;for(;O<oO.length&&!oO[O][0].test(a);O++);if(O===oO.length)return!1;if(i)return oO[O][2];let l=t+1;if(!oO[O][1].test(a)){for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(r=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],a=e.src.slice(r,o),oO[O][1].test(a)){a.length!==0&&l++;break}}e.line=l;const s=e.push("html_block","",0);return s.map=[t,l],s.content=e.getLines(t,l,e.blkIndent,!0),!0}function nC(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.src.charCodeAt(r);if(a!==35||r>=o)return!1;let O=1;for(a=e.src.charCodeAt(++r);a===35&&r<o&&O<=6;)O++,a=e.src.charCodeAt(++r);if(O>6||r<o&&!Fe(a))return!1;if(i)return!0;o=e.skipSpacesBack(o,r);const l=e.skipCharsBack(o,35,r);l>r&&Fe(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const s=e.push("heading_open","h"+String(O),1);s.markup="########".slice(0,O),s.map=[t,e.line];const u=e.push("inline","",0);u.content=e.src.slice(r,o).trim(),u.map=[t,e.line],u.children=[];const c=e.push("heading_close","h"+String(O),-1);return c.markup="########".slice(0,O),!0}function iC(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,a,O=t+1;for(;O<n&&!e.isEmpty(O);O++){if(e.sCount[O]-e.blkIndent>3)continue;if(e.sCount[O]>=e.blkIndent){let h=e.bMarks[O]+e.tShift[O];const p=e.eMarks[O];if(h<p&&(a=e.src.charCodeAt(h),(a===45||a===61)&&(h=e.skipChars(h,a),h=e.skipSpaces(h),h>=p))){o=a===61?1:2;break}}if(e.sCount[O]<0)continue;let f=!1;for(let h=0,p=i.length;h<p;h++)if(i[h](e,O,n,!0)){f=!0;break}if(f)break}if(!o)return!1;const l=e.getLines(t,O,e.blkIndent,!1).trim();e.line=O+1;const s=e.push("heading_open","h"+String(o),1);s.markup=String.fromCharCode(a),s.map=[t,e.line];const u=e.push("inline","",0);u.content=l,u.map=[t,e.line-1],u.children=[];const c=e.push("heading_close","h"+String(o),-1);return c.markup=String.fromCharCode(a),e.parentType=r,!0}function rC(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let s=!1;for(let u=0,c=i.length;u<c;u++)if(i[u](e,o,n,!0)){s=!0;break}if(s)break}const a=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const O=e.push("paragraph_open","p",1);O.map=[t,e.line];const l=e.push("inline","",0);return l.content=a,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const Yc=[["table",Y6,["paragraph","reference"]],["code",V6],["fence",C6,["paragraph","reference","blockquote","list"]],["blockquote",j6,["paragraph","reference","blockquote","list"]],["hr",A6,["paragraph","reference","blockquote","list"]],["list",I6,["paragraph","reference","blockquote"]],["reference",D6],["html_block",tC,["paragraph","reference","blockquote"]],["heading",nC,["paragraph","reference","blockquote"]],["lheading",iC],["paragraph",rC]];function Vc(){this.ruler=new pn;for(let e=0;e<Yc.length;e++)this.ruler.push(Yc[e][0],Yc[e][1],{alt:(Yc[e][2]||[]).slice()})}Vc.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,o=e.md.options.maxNesting;let a=t,O=!1;for(;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n||e.sCount[a]<e.blkIndent));){if(e.level>=o){e.line=n;break}const l=e.line;let s=!1;for(let u=0;u<r;u++)if(s=i[u](e,a,n,!1),s){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");e.tight=!O,e.isEmpty(e.line-1)&&(O=!0),a=e.line,a<n&&e.isEmpty(a)&&(O=!0,a++,e.line=a)}},Vc.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)},Vc.prototype.State=er;function Nl(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Nl.prototype.pushPending=function(){const e=new bi("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Nl.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new bi(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i},Nl.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<n&&this.src.charCodeAt(o)===i;)o++;const a=o-e,O=o<n?this.src.charCodeAt(o):32,l=Dl(r)||Il(String.fromCharCode(r)),s=Dl(O)||Il(String.fromCharCode(O)),u=Gl(r),c=Gl(O),f=!c&&(!s||u||l),h=!u&&(!l||c||s);return{can_open:f&&(t||!h||l),can_close:h&&(t||!f||s),length:a}},Nl.prototype.Token=bi;function oC(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function aC(e,t){let n=e.pos;for(;n<e.posMax&&!oC(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const OC=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function lC(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(OC);if(!r)return!1;const o=r[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let O=a.url;if(O.length<=o.length)return!1;O=O.replace(/\*+$/,"");const l=e.md.normalizeLink(O);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const s=e.push("link_open","a",1);s.attrs=[["href",l]],s.markup="linkify",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(O);const c=e.push("link_close","a",-1);c.markup="linkify",c.info="auto"}return e.pos+=O.length-o.length,!0}function sC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let o=i-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),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(n++;n<r&&Fe(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const Lm=[];for(let e=0;e<256;e++)Lm.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Lm[e.charCodeAt(0)]=1});function uC(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Fe(r));)n++;return e.pos=n,!0}let o=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const O=e.src.charCodeAt(n+1);O>=56320&&O<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const O=e.push("text_special","",0);r<256&&Lm[r]!==0?O.content=o:O.content=a,O.markup=a,O.info="escape"}return e.pos=n+1,!0}function cC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const a=e.src.slice(r,n),O=a.length;if(e.backticksScanned&&(e.backticks[O]||0)<=r)return t||(e.pending+=a),e.pos+=O,!0;let l=n,s;for(;(s=e.src.indexOf("`",l))!==-1;){for(l=s+1;l<o&&e.src.charCodeAt(l)===96;)l++;const u=l-s;if(u===O){if(!t){const c=e.push("code_inline","code",0);c.markup=a,c.content=e.src.slice(n,s).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[u]=s}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=O,!0}function fC(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const a=String.fromCharCode(i);if(o<2)return!1;let O;o%2&&(O=e.push("text","",0),O.content=a,o--);for(let l=0;l<o;l+=2)O=e.push("text","",0),O.content=a+a,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function wx(e,t){let n;const i=[],r=t.length;for(let o=0;o<r;o++){const a=t[o];if(a.marker!==126||a.end===-1)continue;const O=t[a.end];n=e.tokens[a.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[O.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[O.token-1].type==="text"&&e.tokens[O.token-1].content==="~"&&i.push(O.token-1)}for(;i.length;){const o=i.pop();let a=o+1;for(;a<e.tokens.length&&e.tokens[a].type==="s_close";)a++;a--,o!==a&&(n=e.tokens[a],e.tokens[a]=e.tokens[o],e.tokens[o]=n)}}function dC(e){const t=e.tokens_meta,n=e.tokens_meta.length;wx(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&wx(e,t[i].delimiters)}const Xx={tokenize:fC,postProcess:dC};function hC(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let o=0;o<r.length;o++){const a=e.push("text","",0);a.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function Tx(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],a=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===o.token+1,O=String.fromCharCode(r.marker),l=e.tokens[r.token];l.type=a?"strong_open":"em_open",l.tag=a?"strong":"em",l.nesting=1,l.markup=a?O+O:O,l.content="";const s=e.tokens[o.token];s.type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?O+O:O,s.content="",a&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function pC(e){const t=e.tokens_meta,n=e.tokens_meta.length;Tx(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Tx(e,t[i].delimiters)}const _x={tokenize:hC,postProcess:pC};function mC(e,t){let n,i,r,o,a="",O="",l=e.pos,s=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,c=e.posMax,f=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<c&&e.src.charCodeAt(p)===40){for(s=!1,p++;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(p>=c)return!1;if(l=p,r=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),r.ok){for(a=e.md.normalizeLink(r.str),e.md.validateLink(a)?p=r.pos:a="",l=p;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(r=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<c&&l!==p&&r.ok)for(O=r.str,p=r.pos;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);}(p>=c||e.src.charCodeAt(p)!==41)&&(s=!0),p++}if(s){if(typeof e.env.references>"u")return!1;if(p<c&&e.src.charCodeAt(p)===91?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?i=e.src.slice(l,p++):p=h+1):p=h+1,i||(i=e.src.slice(f,h)),o=e.env.references[Uc(i)],!o)return e.pos=u,!1;a=o.href,O=o.title}if(!t){e.pos=f,e.posMax=h;const Q=e.push("link_open","a",1),$=[["href",a]];Q.attrs=$,O&&$.push(["title",O]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=c,!0}function gC(e,t){let n,i,r,o,a,O,l,s,u="";const c=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<f&&e.src.charCodeAt(o)===40){for(o++;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(o>=f)return!1;for(s=o,O=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),O.ok&&(u=e.md.normalizeLink(O.str),e.md.validateLink(u)?o=O.pos:u=""),s=o;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(O=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<f&&s!==o&&O.ok)for(l=O.str,o=O.pos;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);else l="";if(o>=f||e.src.charCodeAt(o)!==41)return e.pos=c,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<f&&e.src.charCodeAt(o)===91?(s=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(s,o++):o=p+1):o=p+1,r||(r=e.src.slice(h,p)),a=e.env.references[Uc(r)],!a)return e.pos=c,!1;u=a.href,l=a.title}if(!t){i=e.src.slice(h,p);const Q=[];e.md.inline.parse(i,e.md,e.env,Q);const $=e.push("image","img",0),g=[["src",u],["alt",""]];$.attrs=g,$.children=Q,$.content=i,l&&g.push(["title",l])}return e.pos=o,e.posMax=f,!0}const $C=/^([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])?)*)$/,QC=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function bC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(i+1,n);if(QC.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}if($C.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}return!1}function yC(e){return/^<a[>\s]/i.test(e)}function SC(e){return/^<\/a\s*>/i.test(e)}function PC(e){const t=e|32;return t>=97&&t<=122}function kC(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!PC(r))return!1;const o=e.src.slice(i).match(J6);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],yC(a.content)&&e.linkLevel++,SC(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const xC=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,vC=/^&([a-z][a-z0-9]{1,31});/i;function wC(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(xC);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),O=e.push("text_special","",0);O.content=Gm(a)?Zc(a):Zc(65533),O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(vC);if(o){const a=px(o[0]);if(a!==o[0]){if(!t){const O=e.push("text_special","",0);O.content=a,O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function Rx(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const o=[];for(let a=0;a<n;a++){const O=e[a];if(o.push(0),(e[i].marker!==O.marker||r!==O.token-1)&&(i=a),r=O.token,O.length=O.length||0,!O.close)continue;t.hasOwnProperty(O.marker)||(t[O.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[O.marker][(O.open?3:0)+O.length%3];let s=i-o[i]-1,u=s;for(;s>l;s-=o[s]+1){const c=e[s];if(c.marker===O.marker&&c.open&&c.end<0){let f=!1;if((c.close||O.open)&&(c.length+O.length)%3===0&&(c.length%3!==0||O.length%3!==0)&&(f=!0),!f){const h=s>0&&!e[s-1].open?o[s-1]+1:0;o[a]=a-s+h,o[s]=h,O.open=!1,c.end=a,c.close=!1,u=-1,r=-2;break}}}u!==-1&&(t[O.marker][(O.open?3:0)+(O.length||0)%3]=u)}}function XC(e){const t=e.tokens_meta,n=e.tokens_meta.length;Rx(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Rx(t[i].delimiters)}function TC(e){let t,n,i=0;const r=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<o&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const Fm=[["text",aC],["linkify",lC],["newline",sC],["escape",uC],["backticks",cC],["strikethrough",Xx.tokenize],["emphasis",_x.tokenize],["link",mC],["image",gC],["autolink",bC],["html_inline",kC],["entity",wC]],Mm=[["balance_pairs",XC],["strikethrough",Xx.postProcess],["emphasis",_x.postProcess],["fragments_join",TC]];function Ll(){this.ruler=new pn;for(let e=0;e<Fm.length;e++)this.ruler.push(Fm[e][0],Fm[e][1]);this.ruler2=new pn;for(let e=0;e<Mm.length;e++)this.ruler2.push(Mm[e][0],Mm[e][1])}Ll.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let a=!1;if(e.level<r){for(let O=0;O<i;O++)if(e.level++,a=n[O](e,!0),e.level--,a){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos},Ll.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const o=e.pos;let a=!1;if(e.level<r){for(let O=0;O<n;O++)if(a=t[O](e,!1),a){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ll.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const o=this.ruler2.getRules(""),a=o.length;for(let O=0;O<a;O++)o[O](r)},Ll.prototype.State=Nl;function _C(e){const t={};e=e||{},t.src_Any=ux.source,t.src_Cc=cx.source,t.src_Z=dx.source,t.src_P=Vm.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.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]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Bm(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Cc(e){return Object.prototype.toString.call(e)}function RC(e){return Cc(e)==="[object String]"}function zC(e){return Cc(e)==="[object Object]"}function WC(e){return Cc(e)==="[object RegExp]"}function zx(e){return Cc(e)==="[object Function]"}function qC(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Wx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ZC(e){return Object.keys(e||{}).reduce(function(t,n){return t||Wx.hasOwnProperty(n)},!1)}const UC={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},EC="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]",YC="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function VC(e){e.__index__=-1,e.__text_cache__=""}function CC(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function qx(){return function(e,t){t.normalize(e)}}function jc(e){const t=e.re=_C(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(EC),n.push(t.src_xn),t.src_tlds=n.join("|");function i(O){return O.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function o(O,l){throw new Error('(LinkifyIt) Invalid schema "'+O+'": '+l)}Object.keys(e.__schemas__).forEach(function(O){const l=e.__schemas__[O];if(l===null)return;const s={validate:null,link:null};if(e.__compiled__[O]=s,zC(l)){WC(l.validate)?s.validate=CC(l.validate):zx(l.validate)?s.validate=l.validate:o(O,l),zx(l.normalize)?s.normalize=l.normalize:l.normalize?o(O,l):s.normalize=qx();return}if(RC(l)){r.push(O);return}o(O,l)}),r.forEach(function(O){e.__compiled__[e.__schemas__[O]]&&(e.__compiled__[O].validate=e.__compiled__[e.__schemas__[O]].validate,e.__compiled__[O].normalize=e.__compiled__[e.__schemas__[O]].normalize)}),e.__compiled__[""]={validate:null,normalize:qx()};const a=Object.keys(e.__compiled__).filter(function(O){return O.length>0&&e.__compiled__[O]}).map(qC).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","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"),VC(e)}function jC(e,t){const n=e.__index__,i=e.__last_index__,r=e.__text_cache__.slice(n,i);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=i+t,this.raw=r,this.text=r,this.url=r}function Hm(e,t){const n=new jC(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Rn(e,t){if(!(this instanceof Rn))return new Rn(e,t);t||ZC(e)&&(t=e,e={}),this.__opts__=Bm({},Wx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Bm({},UC,e),this.__compiled__={},this.__tlds__=YC,this.__tlds_replaced__=!1,this.re={},jc(this)}Rn.prototype.add=function(t,n){return this.__schemas__[t]=n,jc(this),this},Rn.prototype.set=function(t){return this.__opts__=Bm(this.__opts__,t),this},Rn.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,i,r,o,a,O,l,s,u;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=t.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s<this.__index__)&&(i=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=i.index+i[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__="",this.__index__=a,this.__last_index__=i.index+i[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,O=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&O>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=O))),this.__index__>=0},Rn.prototype.pretest=function(t){return this.re.pretest.test(t)},Rn.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0},Rn.prototype.match=function(t){const n=[];let i=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Hm(this,i)),i=this.__last_index__);let r=i?t.slice(i):t;for(;this.test(r);)n.push(Hm(this,i)),r=r.slice(this.__last_index__),i+=this.__last_index__;return n.length?n:null},Rn.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);return i?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i,Hm(this,0)):null},Rn.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,o){return i!==o[r-1]}).reverse(),jc(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,jc(this),this)},Rn.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},Rn.prototype.onCompile=function(){};const aO=2147483647,tr=36,Km=1,Fl=26,AC=38,GC=700,Zx=72,Ux=128,Ex="-",IC=/^xn--/,DC=/[^\0-\x7F]/,NC=/[\x2E\u3002\uFF0E\uFF61]/g,LC={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Jm=tr-Km,nr=Math.floor,eg=String.fromCharCode;function io(e){throw new RangeError(LC[e])}function FC(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function Yx(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(NC,".");const r=e.split("."),o=FC(r,t).join(".");return i+o}function Vx(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const o=e.charCodeAt(n++);(o&64512)==56320?t.push(((r&1023)<<10)+(o&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const MC=e=>String.fromCodePoint(...e),BC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:tr},Cx=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},jx=function(e,t,n){let i=0;for(e=n?nr(e/GC):e>>1,e+=nr(e/t);e>Jm*Fl>>1;i+=tr)e=nr(e/Jm);return nr(i+(Jm+1)*e/(e+AC))},Ax=function(e){const t=[],n=e.length;let i=0,r=Ux,o=Zx,a=e.lastIndexOf(Ex);a<0&&(a=0);for(let O=0;O<a;++O)e.charCodeAt(O)>=128&&io("not-basic"),t.push(e.charCodeAt(O));for(let O=a>0?a+1:0;O<n;){const l=i;for(let u=1,c=tr;;c+=tr){O>=n&&io("invalid-input");const f=BC(e.charCodeAt(O++));f>=tr&&io("invalid-input"),f>nr((aO-i)/u)&&io("overflow"),i+=f*u;const h=c<=o?Km:c>=o+Fl?Fl:c-o;if(f<h)break;const p=tr-h;u>nr(aO/p)&&io("overflow"),u*=p}const s=t.length+1;o=jx(i-l,s,l==0),nr(i/s)>aO-r&&io("overflow"),r+=nr(i/s),i%=s,t.splice(i++,0,r)}return String.fromCodePoint(...t)},Gx=function(e){const t=[];e=Vx(e);const n=e.length;let i=Ux,r=0,o=Zx;for(const l of e)l<128&&t.push(eg(l));const a=t.length;let O=a;for(a&&t.push(Ex);O<n;){let l=aO;for(const u of e)u>=i&&u<l&&(l=u);const s=O+1;l-i>nr((aO-r)/s)&&io("overflow"),r+=(l-i)*s,i=l;for(const u of e)if(u<i&&++r>aO&&io("overflow"),u===i){let c=r;for(let f=tr;;f+=tr){const h=f<=o?Km:f>=o+Fl?Fl:f-o;if(c<h)break;const p=c-h,Q=tr-h;t.push(eg(Cx(h+p%Q,0))),c=nr(p/Q)}t.push(eg(Cx(c,0))),o=jx(r,s,O===a),r=0,++O}++r,++i}return t.join("")},Ix={version:"2.3.1",ucs2:{decode:Vx,encode:MC},decode:Ax,encode:Gx,toASCII:function(e){return Yx(e,function(t){return DC.test(t)?"xn--"+Gx(t):t})},toUnicode:function(e){return Yx(e,function(t){return IC.test(t)?Ax(t.slice(4).toLowerCase()):t})}},HC={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},KC=/^(vbscript|javascript|file|data):/,JC=/^data:image\/(gif|png|jpeg|webp);/;function e9(e){const t=e.trim().toLowerCase();return KC.test(t)?JC.test(t):!0}const Dx=["http:","https:","mailto:"];function t9(e){const t=Ym(e,!0);if(t.hostname&&(!t.protocol||Dx.indexOf(t.protocol)>=0))try{t.hostname=Ix.toASCII(t.hostname)}catch{}return Al(Em(t))}function n9(e){const t=Ym(e,!0);if(t.hostname&&(!t.protocol||Dx.indexOf(t.protocol)>=0))try{t.hostname=Ix.toUnicode(t.hostname)}catch{}return nO(Em(t),nO.defaultChars+"%")}function ei(e,t){if(!(this instanceof ei))return new ei(e,t);t||Am(e)||(t=e||{},e="default"),this.inline=new Ll,this.block=new Vc,this.core=new Dm,this.renderer=new rO,this.linkify=new Rn,this.validateLink=e9,this.normalizeLink=t9,this.normalizeLinkText=n9,this.utils=d6,this.helpers=qc({},g6),this.options={},this.configure(e),t&&this.set(t)}ei.prototype.set=function(e){return qc(this.options,e),this},ei.prototype.configure=function(e){const t=this;if(Am(e)){const n=e;if(e=HC[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},ei.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this},ei.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this},ei.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},ei.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},ei.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},ei.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},ei.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Nx=new Set([!0,!1,"alt","title"]);function Lx(e,t){return(Array.isArray(e)?e:[]).filter(([n])=>n!==t)}function Fx(e,t){e&&e.attrs&&(e.attrs=Lx(e.attrs,t))}function i9(e,t){if(!Nx.has(e))throw new TypeError(`figcaption must be one of: ${[...Nx]}.`);if(e==="alt")return t.content;const n=t.attrs.find(([i])=>i==="title");return Array.isArray(n)&&n[1]?(Fx(t,"title"),n[1]):void 0}function r9(e,t){t=t||{},e.core.ruler.before("linkify","image_figures",function(n){let i=1;for(let r=1,o=n.tokens.length;r<o-1;++r){const a=n.tokens[r];if(a.type!=="inline"||!a.children||a.children.length!==1&&a.children.length!==3||a.children.length===1&&a.children[0].type!=="image")continue;if(a.children.length===3){const[s,u,c]=a.children;if(s.type!=="link_open"||u.type!=="image"||c.type!=="link_close")continue}if(r!==0&&n.tokens[r-1].type!=="paragraph_open"||r!==o-1&&n.tokens[r+1].type!=="paragraph_close")continue;const O=n.tokens[r-1];let l;if(O.type="figure_open",O.tag="figure",n.tokens[r+1].type="figure_close",n.tokens[r+1].tag="figure",t.dataType&&n.tokens[r-1].attrPush(["data-type","image"]),t.link&&a.children.length===1){[l]=a.children;const s=new n.Token("link_open","a",1);s.attrPush(["href",l.attrGet("src")]),a.children.unshift(s),a.children.push(new n.Token("link_close","a",-1))}if(l=a.children.length===1?a.children[0]:a.children[1],t.figcaption){const s=i9(t.figcaption,l);if(s){const[u]=e.parseInline(s,n.env);a.children.push(new n.Token("figcaption_open","figcaption",1)),a.children.push(...u.children),a.children.push(new n.Token("figcaption_close","figcaption",-1)),l.attrs&&(l.attrs=Lx(l.attrs,"title"))}}if(t.copyAttrs&&l.attrs){const s=t.copyAttrs===!0?"":t.copyAttrs;O.attrs=l.attrs.filter(([u])=>u.match(s)).map(u=>Array.from(u))}if(t.tabindex&&(n.tokens[r-1].attrPush(["tabindex",i]),i++),t.lazy&&(l.attrs.some(([s])=>s==="loading")||l.attrs.push(["loading","lazy"])),t.async&&(l.attrs.some(([s])=>s==="decoding")||l.attrs.push(["decoding","async"])),t.classes&&typeof t.classes=="string"){let s=!1;for(let u=0,c=l.attrs.length;u<c&&!s;u++){const f=l.attrs[u];f[0]==="class"&&(f[1]=`${f[1]} ${t.classes}`,s=!0)}s||l.attrs.push(["class",t.classes])}if(t.removeSrc){const s=l.attrs.find(([u])=>u==="src");l.attrs.push(["data-src",s[1]]),Fx(l,"src")}}})}const o9=e=>{const t=m.inject("highlight"),n=m.shallowRef(ot.editorExtensions.highlight.instance);return m.onMounted(()=>{e.noHighlight||n.value||(un("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`}),un("script",{...t.value.js,id:`${z}-hljs`,onload(){n.value=window.hljs}},"hljs"))}),m.watch(()=>t.value.css,()=>{e.noHighlight||xW("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`})}),n},OO=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Mx=new Set,tg=typeof process=="object"&&process?process:{},Bx=(e,t,n,i)=>{typeof tg.emitWarning=="function"?tg.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let Ac=globalThis.AbortController,Hx=globalThis.AbortSignal;if(typeof Ac>"u"){Hx=class{constructor(){Xe(this,"onabort");Xe(this,"_onabort",[]);Xe(this,"reason");Xe(this,"aborted",!1)}addEventListener(i,r){this._onabort.push(r)}},Ac=class{constructor(){Xe(this,"signal",new Hx);t()}abort(i){var r,o;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const a of this.signal._onabort)a(i);(o=(r=this.signal).onabort)==null||o.call(r,i)}}};let e=((Jz=tg.env)==null?void 0:Jz.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const t=()=>{e&&(e=!1,Bx("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const a9=e=>!Mx.has(e),ro=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Kx=e=>ro(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Gc:null:null;class Gc extends Array{constructor(t){super(t),this.fill(0)}}const ha=class ha{constructor(t,n){Xe(this,"heap");Xe(this,"length");if(!_(ha,_O))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(t),this.length=0}static create(t){const n=Kx(t);if(!n)return[];de(ha,_O,!0);const i=new ha(t,n);return de(ha,_O,!1),i}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};_O=new WeakMap,Qe(ha,_O,!1);let ng=ha;const MQ=class MQ{constructor(t){Qe(this,Ns);Qe(this,Ud);Qe(this,sr);Qe(this,ur);Qe(this,Ms);Qe(this,WO);Qe(this,qO);Qe(this,Le);Qe(this,Bs);Qe(this,ga);Qe(this,_i,void 0);Qe(this,Vn,void 0);Qe(this,Ri,void 0);Qe(this,zi,void 0);Qe(this,RO,void 0);Xe(this,"ttl");Xe(this,"ttlResolution");Xe(this,"ttlAutopurge");Xe(this,"updateAgeOnGet");Xe(this,"updateAgeOnHas");Xe(this,"allowStale");Xe(this,"noDisposeOnSet");Xe(this,"noUpdateTTL");Xe(this,"maxEntrySize");Xe(this,"sizeCalculation");Xe(this,"noDeleteOnFetchRejection");Xe(this,"noDeleteOnStaleGet");Xe(this,"allowStaleOnFetchAbort");Xe(this,"allowStaleOnFetchRejection");Xe(this,"ignoreFetchAbort");Qe(this,_t,void 0);Qe(this,Wi,void 0);Qe(this,Pt,void 0);Qe(this,Ke,void 0);Qe(this,ge,void 0);Qe(this,ln,void 0);Qe(this,Cn,void 0);Qe(this,Jt,void 0);Qe(this,Ut,void 0);Qe(this,qi,void 0);Qe(this,Et,void 0);Qe(this,Zi,void 0);Qe(this,Ui,void 0);Qe(this,jn,void 0);Qe(this,Ei,void 0);Qe(this,yo,void 0);Qe(this,sn,void 0);Qe(this,pa,()=>{});Qe(this,qr,()=>{});Qe(this,Ls,()=>{});Qe(this,An,()=>!1);Qe(this,ma,t=>{});Qe(this,zO,(t,n,i)=>{});Qe(this,Fs,(t,n,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Xe(this,MOe,"LRUCache");const{max:n=0,ttl:i,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:O,allowStale:l,dispose:s,disposeAfter:u,noDisposeOnSet:c,noUpdateTTL:f,maxSize:h=0,maxEntrySize:p=0,sizeCalculation:Q,fetchMethod:$,noDeleteOnFetchRejection:g,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:k,ignoreFetchAbort:y}=t;if(n!==0&&!ro(n))throw new TypeError("max option must be a nonnegative integer");const X=n?Kx(n):Array;if(!X)throw new Error("invalid max value: "+n);if(de(this,_i,n),de(this,Vn,h),this.maxEntrySize=p||_(this,Vn),this.sizeCalculation=Q,this.sizeCalculation){if(!_(this,Vn)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if($!==void 0&&typeof $!="function")throw new TypeError("fetchMethod must be a function if specified");if(de(this,RO,$),de(this,yo,!!$),de(this,Pt,new Map),de(this,Ke,new Array(n).fill(void 0)),de(this,ge,new Array(n).fill(void 0)),de(this,ln,new X(n)),de(this,Cn,new X(n)),de(this,Jt,0),de(this,Ut,0),de(this,qi,ng.create(n)),de(this,_t,0),de(this,Wi,0),typeof s=="function"&&de(this,Ri,s),typeof u=="function"?(de(this,zi,u),de(this,Et,[])):(de(this,zi,void 0),de(this,Et,void 0)),de(this,Ei,!!_(this,Ri)),de(this,sn,!!_(this,zi)),this.noDisposeOnSet=!!c,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!g,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!y,this.maxEntrySize!==0){if(_(this,Vn)!==0&&!ro(_(this,Vn)))throw new TypeError("maxSize must be a positive integer if specified");if(!ro(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");se(this,Ud,lW).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!O,this.ttlResolution=ro(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!ro(this.ttl))throw new TypeError("ttl must be a positive integer if specified");se(this,Ns,JQ).call(this)}if(_(this,_i)===0&&this.ttl===0&&_(this,Vn)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!_(this,_i)&&!_(this,Vn)){const x="LRU_CACHE_UNBOUNDED";a9(x)&&(Mx.add(x),Bx("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,MQ))}}static unsafeExposeInternals(t){return{starts:_(t,Ui),ttls:_(t,jn),sizes:_(t,Zi),keyMap:_(t,Pt),keyList:_(t,Ke),valList:_(t,ge),next:_(t,ln),prev:_(t,Cn),get head(){return _(t,Jt)},get tail(){return _(t,Ut)},free:_(t,qi),isBackgroundFetch:n=>{var i;return se(i=t,Le,et).call(i,n)},backgroundFetch:(n,i,r,o)=>{var a;return se(a=t,qO,eh).call(a,n,i,r,o)},moveToTail:n=>{var i;return se(i=t,ga,nu).call(i,n)},indexes:n=>{var i;return se(i=t,sr,ko).call(i,n)},rindexes:n=>{var i;return se(i=t,ur,xo).call(i,n)},isStale:n=>{var i;return _(i=t,An).call(i,n)}}}get max(){return _(this,_i)}get maxSize(){return _(this,Vn)}get calculatedSize(){return _(this,Wi)}get size(){return _(this,_t)}get fetchMethod(){return _(this,RO)}get dispose(){return _(this,Ri)}get disposeAfter(){return _(this,zi)}getRemainingTTL(t){return _(this,Pt).has(t)?1/0:0}*entries(){for(const t of se(this,sr,ko).call(this))_(this,ge)[t]!==void 0&&_(this,Ke)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield[_(this,Ke)[t],_(this,ge)[t]])}*rentries(){for(const t of se(this,ur,xo).call(this))_(this,ge)[t]!==void 0&&_(this,Ke)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield[_(this,Ke)[t],_(this,ge)[t]])}*keys(){for(const t of se(this,sr,ko).call(this)){const n=_(this,Ke)[t];n!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield n)}}*rkeys(){for(const t of se(this,ur,xo).call(this)){const n=_(this,Ke)[t];n!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield n)}}*values(){for(const t of se(this,sr,ko).call(this))_(this,ge)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield _(this,ge)[t])}*rvalues(){for(const t of se(this,ur,xo).call(this))_(this,ge)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield _(this,ge)[t])}[Symbol.iterator](){return this.entries()}find(t,n={}){for(const i of se(this,sr,ko).call(this)){const r=_(this,ge)[i],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&t(o,_(this,Ke)[i],this))return this.get(_(this,Ke)[i],n)}}forEach(t,n=this){for(const i of se(this,sr,ko).call(this)){const r=_(this,ge)[i],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,_(this,Ke)[i],this)}}rforEach(t,n=this){for(const i of se(this,ur,xo).call(this)){const r=_(this,ge)[i],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,_(this,Ke)[i],this)}}purgeStale(){let t=!1;for(const n of se(this,ur,xo).call(this,{allowStale:!0}))_(this,An).call(this,n)&&(this.delete(_(this,Ke)[n]),t=!0);return t}info(t){const n=_(this,Pt).get(t);if(n===void 0)return;const i=_(this,ge)[n],r=se(this,Le,et).call(this,i)?i.__staleWhileFetching:i;if(r===void 0)return;const o={value:r};if(_(this,jn)&&_(this,Ui)){const a=_(this,jn)[n],O=_(this,Ui)[n];if(a&&O){const l=a-(OO.now()-O);o.ttl=l,o.start=Date.now()}}return _(this,Zi)&&(o.size=_(this,Zi)[n]),o}dump(){const t=[];for(const n of se(this,sr,ko).call(this,{allowStale:!0})){const i=_(this,Ke)[n],r=_(this,ge)[n],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||i===void 0)continue;const a={value:o};if(_(this,jn)&&_(this,Ui)){a.ttl=_(this,jn)[n];const O=OO.now()-_(this,Ui)[n];a.start=Math.floor(Date.now()-O)}_(this,Zi)&&(a.size=_(this,Zi)[n]),t.unshift([i,a])}return t}load(t){this.clear();for(const[n,i]of t){if(i.start){const r=Date.now()-i.start;i.start=OO.now()-r}this.set(n,i.value,i)}}set(t,n,i={}){var f,h,p,Q,$;if(n===void 0)return this.delete(t),this;const{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:O=this.sizeCalculation,status:l}=i;let{noUpdateTTL:s=this.noUpdateTTL}=i;const u=_(this,Fs).call(this,t,n,i.size||0,O);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(t),this;let c=_(this,_t)===0?void 0:_(this,Pt).get(t);if(c===void 0)c=_(this,_t)===0?_(this,Ut):_(this,qi).length!==0?_(this,qi).pop():_(this,_t)===_(this,_i)?se(this,WO,Jd).call(this,!1):_(this,_t),_(this,Ke)[c]=t,_(this,ge)[c]=n,_(this,Pt).set(t,c),_(this,ln)[_(this,Ut)]=c,_(this,Cn)[c]=_(this,Ut),de(this,Ut,c),Kd(this,_t)._++,_(this,zO).call(this,c,u,l),l&&(l.set="add"),s=!1;else{se(this,ga,nu).call(this,c);const g=_(this,ge)[c];if(n!==g){if(_(this,yo)&&se(this,Le,et).call(this,g)){g.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:b}=g;b!==void 0&&!a&&(_(this,Ei)&&((f=_(this,Ri))==null||f.call(this,b,t,"set")),_(this,sn)&&((h=_(this,Et))==null||h.push([b,t,"set"])))}else a||(_(this,Ei)&&((p=_(this,Ri))==null||p.call(this,g,t,"set")),_(this,sn)&&((Q=_(this,Et))==null||Q.push([g,t,"set"])));if(_(this,ma).call(this,c),_(this,zO).call(this,c,u,l),_(this,ge)[c]=n,l){l.set="replace";const b=g&&se(this,Le,et).call(this,g)?g.__staleWhileFetching:g;b!==void 0&&(l.oldValue=b)}}else l&&(l.set="update")}if(r!==0&&!_(this,jn)&&se(this,Ns,JQ).call(this),_(this,jn)&&(s||_(this,Ls).call(this,c,r,o),l&&_(this,qr).call(this,l,c)),!a&&_(this,sn)&&_(this,Et)){const g=_(this,Et);let b;for(;b=g==null?void 0:g.shift();)($=_(this,zi))==null||$.call(this,...b)}return this}pop(){var t;try{for(;_(this,_t);){const n=_(this,ge)[_(this,Jt)];if(se(this,WO,Jd).call(this,!0),se(this,Le,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(_(this,sn)&&_(this,Et)){const n=_(this,Et);let i;for(;i=n==null?void 0:n.shift();)(t=_(this,zi))==null||t.call(this,...i)}}}has(t,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=n,o=_(this,Pt).get(t);if(o!==void 0){const a=_(this,ge)[o];if(se(this,Le,et).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(_(this,An).call(this,o))r&&(r.has="stale",_(this,qr).call(this,r,o));else return i&&_(this,pa).call(this,o),r&&(r.has="hit",_(this,qr).call(this,r,o)),!0}else r&&(r.has="miss");return!1}peek(t,n={}){const{allowStale:i=this.allowStale}=n,r=_(this,Pt).get(t);if(r===void 0||!i&&_(this,An).call(this,r))return;const o=_(this,ge)[r];return se(this,Le,et).call(this,o)?o.__staleWhileFetching:o}async fetch(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:O=this.noDisposeOnSet,size:l=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:Q,forceRefresh:$=!1,status:g,signal:b}=n;if(!_(this,yo))return g&&(g.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:g});const P={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:O,size:l,sizeCalculation:s,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:g,signal:b};let k=_(this,Pt).get(t);if(k===void 0){g&&(g.fetch="miss");const y=se(this,qO,eh).call(this,t,k,P,Q);return y.__returned=y}else{const y=_(this,ge)[k];if(se(this,Le,et).call(this,y)){const Y=i&&y.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",Y&&(g.returnedStale=!0)),Y?y.__staleWhileFetching:y.__returned=y}const X=_(this,An).call(this,k);if(!$&&!X)return g&&(g.fetch="hit"),se(this,ga,nu).call(this,k),r&&_(this,pa).call(this,k),g&&_(this,qr).call(this,g,k),y;const x=se(this,qO,eh).call(this,t,k,P,Q),w=x.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=X?"stale":"refresh",w&&X&&(g.returnedStale=!0)),w?x.__staleWhileFetching:x.__returned=x}}get(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=n,O=_(this,Pt).get(t);if(O!==void 0){const l=_(this,ge)[O],s=se(this,Le,et).call(this,l);return a&&_(this,qr).call(this,a,O),_(this,An).call(this,O)?(a&&(a.get="stale"),s?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(o||this.delete(t),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),s?l.__staleWhileFetching:(se(this,ga,nu).call(this,O),r&&_(this,pa).call(this,O),l))}else a&&(a.get="miss")}delete(t){var i,r,o,a;let n=!1;if(_(this,_t)!==0){const O=_(this,Pt).get(t);if(O!==void 0)if(n=!0,_(this,_t)===1)this.clear();else{_(this,ma).call(this,O);const l=_(this,ge)[O];if(se(this,Le,et).call(this,l)?l.__abortController.abort(new Error("deleted")):(_(this,Ei)||_(this,sn))&&(_(this,Ei)&&((i=_(this,Ri))==null||i.call(this,l,t,"delete")),_(this,sn)&&((r=_(this,Et))==null||r.push([l,t,"delete"]))),_(this,Pt).delete(t),_(this,Ke)[O]=void 0,_(this,ge)[O]=void 0,O===_(this,Ut))de(this,Ut,_(this,Cn)[O]);else if(O===_(this,Jt))de(this,Jt,_(this,ln)[O]);else{const s=_(this,Cn)[O];_(this,ln)[s]=_(this,ln)[O];const u=_(this,ln)[O];_(this,Cn)[u]=_(this,Cn)[O]}Kd(this,_t)._--,_(this,qi).push(O)}}if(_(this,sn)&&((o=_(this,Et))!=null&&o.length)){const O=_(this,Et);let l;for(;l=O==null?void 0:O.shift();)(a=_(this,zi))==null||a.call(this,...l)}return n}clear(){var t,n,i;for(const r of se(this,ur,xo).call(this,{allowStale:!0})){const o=_(this,ge)[r];if(se(this,Le,et).call(this,o))o.__abortController.abort(new Error("deleted"));else{const a=_(this,Ke)[r];_(this,Ei)&&((t=_(this,Ri))==null||t.call(this,o,a,"delete")),_(this,sn)&&((n=_(this,Et))==null||n.push([o,a,"delete"]))}}if(_(this,Pt).clear(),_(this,ge).fill(void 0),_(this,Ke).fill(void 0),_(this,jn)&&_(this,Ui)&&(_(this,jn).fill(0),_(this,Ui).fill(0)),_(this,Zi)&&_(this,Zi).fill(0),de(this,Jt,0),de(this,Ut,0),_(this,qi).length=0,de(this,Wi,0),de(this,_t,0),_(this,sn)&&_(this,Et)){const r=_(this,Et);let o;for(;o=r==null?void 0:r.shift();)(i=_(this,zi))==null||i.call(this,...o)}}};MOe=Symbol.toStringTag,_i=new WeakMap,Vn=new WeakMap,Ri=new WeakMap,zi=new WeakMap,RO=new WeakMap,_t=new WeakMap,Wi=new WeakMap,Pt=new WeakMap,Ke=new WeakMap,ge=new WeakMap,ln=new WeakMap,Cn=new WeakMap,Jt=new WeakMap,Ut=new WeakMap,qi=new WeakMap,Et=new WeakMap,Zi=new WeakMap,Ui=new WeakMap,jn=new WeakMap,Ei=new WeakMap,yo=new WeakMap,sn=new WeakMap,Ns=new WeakSet,JQ=function(){const t=new Gc(_(this,_i)),n=new Gc(_(this,_i));de(this,jn,t),de(this,Ui,n),de(this,Ls,(o,a,O=OO.now())=>{if(n[o]=a!==0?O:0,t[o]=a,a!==0&&this.ttlAutopurge){const l=setTimeout(()=>{_(this,An).call(this,o)&&this.delete(_(this,Ke)[o])},a+1);l.unref&&l.unref()}}),de(this,pa,o=>{n[o]=t[o]!==0?OO.now():0}),de(this,qr,(o,a)=>{if(t[a]){const O=t[a],l=n[a];if(!O||!l)return;o.ttl=O,o.start=l,o.now=i||r();const s=o.now-l;o.remainingTTL=O-s}});let i=0;const r=()=>{const o=OO.now();if(this.ttlResolution>0){i=o;const a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{const a=_(this,Pt).get(o);if(a===void 0)return 0;const O=t[a],l=n[a];if(!O||!l)return 1/0;const s=(i||r())-l;return O-s},de(this,An,o=>{const a=n[o],O=t[o];return!!O&&!!a&&(i||r())-a>O})},pa=new WeakMap,qr=new WeakMap,Ls=new WeakMap,An=new WeakMap,Ud=new WeakSet,lW=function(){const t=new Gc(_(this,_i));de(this,Wi,0),de(this,Zi,t),de(this,ma,n=>{de(this,Wi,_(this,Wi)-t[n]),t[n]=0}),de(this,Fs,(n,i,r,o)=>{if(se(this,Le,et).call(this,i))return 0;if(!ro(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(i,n),!ro(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),de(this,zO,(n,i,r)=>{if(t[n]=i,_(this,Vn)){const o=_(this,Vn)-t[n];for(;_(this,Wi)>o;)se(this,WO,Jd).call(this,!0)}de(this,Wi,_(this,Wi)+t[n]),r&&(r.entrySize=i,r.totalCalculatedSize=_(this,Wi))})},ma=new WeakMap,zO=new WeakMap,Fs=new WeakMap,sr=new WeakSet,ko=function*({allowStale:t=this.allowStale}={}){if(_(this,_t))for(let n=_(this,Ut);!(!se(this,Ms,eb).call(this,n)||((t||!_(this,An).call(this,n))&&(yield n),n===_(this,Jt)));)n=_(this,Cn)[n]},ur=new WeakSet,xo=function*({allowStale:t=this.allowStale}={}){if(_(this,_t))for(let n=_(this,Jt);!(!se(this,Ms,eb).call(this,n)||((t||!_(this,An).call(this,n))&&(yield n),n===_(this,Ut)));)n=_(this,ln)[n]},Ms=new WeakSet,eb=function(t){return t!==void 0&&_(this,Pt).get(_(this,Ke)[t])===t},WO=new WeakSet,Jd=function(t){var o,a;const n=_(this,Jt),i=_(this,Ke)[n],r=_(this,ge)[n];return _(this,yo)&&se(this,Le,et).call(this,r)?r.__abortController.abort(new Error("evicted")):(_(this,Ei)||_(this,sn))&&(_(this,Ei)&&((o=_(this,Ri))==null||o.call(this,r,i,"evict")),_(this,sn)&&((a=_(this,Et))==null||a.push([r,i,"evict"]))),_(this,ma).call(this,n),t&&(_(this,Ke)[n]=void 0,_(this,ge)[n]=void 0,_(this,qi).push(n)),_(this,_t)===1?(de(this,Jt,de(this,Ut,0)),_(this,qi).length=0):de(this,Jt,_(this,ln)[n]),_(this,Pt).delete(i),Kd(this,_t)._--,n},qO=new WeakSet,eh=function(t,n,i,r){const o=n===void 0?void 0:_(this,ge)[n];if(se(this,Le,et).call(this,o))return o;const a=new Ac,{signal:O}=i;O==null||O.addEventListener("abort",()=>a.abort(O.reason),{signal:a.signal});const l={signal:a.signal,options:i,context:r},s=(Q,$=!1)=>{const{aborted:g}=a.signal,b=i.ignoreFetchAbort&&Q!==void 0;if(i.status&&(g&&!$?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,b&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),g&&!b&&!$)return c(a.signal.reason);const P=h;return _(this,ge)[n]===h&&(Q===void 0?P.__staleWhileFetching?_(this,ge)[n]=P.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,Q,l.options))),Q},u=Q=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=Q),c(Q)),c=Q=>{const{aborted:$}=a.signal,g=$&&i.allowStaleOnFetchAbort,b=g||i.allowStaleOnFetchRejection,P=b||i.noDeleteOnFetchRejection,k=h;if(_(this,ge)[n]===h&&(!P||k.__staleWhileFetching===void 0?this.delete(t):g||(_(this,ge)[n]=k.__staleWhileFetching)),b)return i.status&&k.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw Q},f=(Q,$)=>{var b;const g=(b=_(this,RO))==null?void 0:b.call(this,t,o,l);g&&g instanceof Promise&&g.then(P=>Q(P===void 0?void 0:P),$),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(Q(void 0),i.allowStaleOnFetchAbort&&(Q=P=>s(P,!0)))})};i.status&&(i.status.fetchDispatched=!0);const h=new Promise(f).then(s,u),p=Object.assign(h,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return n===void 0?(this.set(t,p,{...l.options,status:void 0}),n=_(this,Pt).get(t)):_(this,ge)[n]=p,p},Le=new WeakSet,et=function(t){if(!_(this,yo))return!1;const n=t;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ac},Bs=new WeakSet,tb=function(t,n){_(this,Cn)[n]=t,_(this,ln)[t]=n},ga=new WeakSet,nu=function(t){t!==_(this,Ut)&&(t===_(this,Jt)?de(this,Jt,_(this,ln)[t]):se(this,Bs,tb).call(this,_(this,Cn)[t],_(this,ln)[t]),se(this,Bs,tb).call(this,_(this,Ut),t),de(this,Ut,t))};let ig=MQ;const Ic=new ig({max:1e3,ttl:6e5}),O9=e=>{const t=m.inject("theme"),n=m.inject("rootRef"),{editorExtensions:i,editorExtensionsAttrs:r,mermaidConfig:o}=ot,a=m.shallowRef(i.mermaid.instance),O=m.shallowRef(-1),l=()=>{const u=a.value;!e.noMermaid&&u&&(u.initialize(o({startOnLoad:!1,theme:t.value==="dark"?"dark":"default"})),O.value=O.value+1)};return m.watch(()=>t.value,()=>{Ic.clear(),l()}),m.onMounted(()=>{var c,f;if(e.noMermaid||a.value)return;const u=i.mermaid.js;/\.mjs/.test(u)?(un("link",{...(c=r.mermaid)==null?void 0:c.js,rel:"modulepreload",href:u,id:`${z}-mermaid-m`}),import(u).then(h=>{a.value=h.default,l()})):un("script",{...(f=r.mermaid)==null?void 0:f.js,src:u,id:`${z}-mermaid`,onload(){a.value=window.mermaid,l()}},"mermaid")}),{mermaidRef:a,reRenderRef:O,replaceMermaid:()=>{m.nextTick(()=>{if(!e.noMermaid&&a.value){const u=n.value.querySelectorAll(`div.${z}-mermaid`),c=document.createElement("div");c.style.width=document.body.offsetWidth+"px",c.style.height=document.body.offsetHeight+"px",c.style.position="fixed",c.style.zIndex="-10000",c.style.top="-10000";let f=u.length;f>0&&document.body.appendChild(c),u.forEach(async h=>{let p=Ic.get(h.innerText);if(!p){const $=ih(),g=a.value.renderAsync||a.value.render;let b="";try{b=await g($,h.innerText,c)}catch{}p=await e.sanitizeMermaid(typeof b=="string"?b:b.svg)}const Q=document.createElement("p");Q.className=`${z}-mermaid`,Q.setAttribute("data-processed",""),Q.innerHTML=p,Q.children[0].removeAttribute("height"),Ic.set(h.innerText,Q.innerHTML),h.dataset.line!==void 0&&(Q.dataset.line=h.dataset.line),h.replaceWith(Q),--f===0&&c.remove()})}})}}},l9=e=>{const t=m.shallowRef(ot.editorExtensions.katex.instance);return m.onMounted(()=>{if(e.noKatex||t.value)return;const{editorExtensions:n}=ot;un("script",{src:n.katex.js,id:`${z}-katex`,onload(){t.value=window.katex}},"katex"),un("link",{rel:"stylesheet",href:n.katex.css,id:`${z}-katexCss`})}),t},s9=(e,t)=>{const n=e.renderer.rules.fence.bind(e.renderer.rules);e.renderer.rules.fence=(i,r,o,a,O)=>{const l=i[r],s=l.content.trim();if(l.info==="mermaid"){let u;i[r].map&&i[r].level===0&&(u=i[r].map[0],i[r].attrSet("data-line",String(u)));const c=Ic.get(s);return c?`<p class="${z}-mermaid" ${u!==void 0?"data-line="+u:""} data-processed>${c}</p>`:`<div class="${z}-mermaid" ${u!==void 0?"data-line="+u:""} data-mermaid-theme=${t.themeRef.value}>${s}</div>`}return n(i,r,o,a,O)}},Dc=(e,t)=>{const n=e.attrs?e.attrs.slice():[];return t.forEach(i=>{const r=e.attrIndex(i[0]);r<0?n.push(i):(n[r]=n[r].slice(),n[r][1]+=` ${i[1]}`)}),n},u9=(e,t)=>{const n=[{open:"$",close:"$"},{open:"\\(",close:"\\)"}];let i,r,o;for(const a of n)if(e.src.startsWith(a.open,e.pos)){const O=e.pos+a.open.length;for(i=O;(i=e.src.indexOf(a.close,i))!==-1;){for(o=i-1;e.src[o]==="\\";)o-=1;if((i-o)%2==1)break;i+=a.close.length}return i===-1?(t||(e.pending+=a.open),e.pos=O,!0):i-O===0?(t||(e.pending+=a.open+a.close),e.pos=O+a.close.length,!0):(t||(r=e.push("math_inline","math",0),r.markup=a.open,r.content=e.src.slice(O,i)),e.pos=i+a.close.length,!0)}return!1},c9=(e,t,n,i)=>{const r=[{open:"$$",close:"$$"},{open:"\\[",close:"\\]"}];let o,a,O,l,s=!1,u=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];for(const f of r){if(u+f.open.length>c||e.src.slice(u,u+f.open.length)!==f.open)continue;if(u+=f.open.length,o=e.src.slice(u,c),i)return!0;for(o.trim().slice(-f.close.length)===f.close&&(o=o.trim().slice(0,-f.close.length),s=!0),O=t;!s&&(O++,!(O>=n||(u=e.bMarks[O]+e.tShift[O],c=e.eMarks[O],u<c&&e.tShift[O]<e.blkIndent)));)e.src.slice(u,c).trim().slice(-f.close.length)===f.close&&(l=e.src.slice(0,c).lastIndexOf(f.close),a=e.src.slice(u,l),s=!0);e.line=O+1;const h=e.push("math_block","math",0);return h.block=!0,h.content=(o&&o.trim()?o+`
|
|
113
|
+
`,o.map=[t,e.line],!0}function C6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||r+3>o)return!1;const a=e.src.charCodeAt(r);if(a!==126&&a!==96)return!1;let O=r;r=e.skipChars(r,a);let l=r-O;if(l<3)return!1;const s=e.src.slice(O,r),u=e.src.slice(r,o);if(a===96&&u.indexOf(String.fromCharCode(a))>=0)return!1;if(i)return!0;let c=t,f=!1;for(;c++,!(c>=n||(r=O=e.bMarks[c]+e.tShift[c],o=e.eMarks[c],r<o&&e.sCount[c]<e.blkIndent));)if(e.src.charCodeAt(r)===a&&!(e.sCount[c]-e.blkIndent>=4)&&(r=e.skipChars(r,a),!(r-O<l)&&(r=e.skipSpaces(r),!(r<o)))){f=!0;break}l=e.sCount[t],e.line=c+(f?1:0);const h=e.push("fence","code",0);return h.info=u,h.content=e.getLines(t+1,c,l,!0),h.markup=s,h.map=[t,e.line],!0}function j6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];const a=e.lineMax;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==62)return!1;if(i)return!0;const O=[],l=[],s=[],u=[],c=e.md.block.ruler.getRules("blockquote"),f=e.parentType;e.parentType="blockquote";let h=!1,p;for(p=t;p<n;p++){const P=e.sCount[p]<e.blkIndent;if(r=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],r>=o)break;if(e.src.charCodeAt(r++)===62&&!P){let y=e.sCount[p]+1,X,x;e.src.charCodeAt(r)===32?(r++,y++,x=!1,X=!0):e.src.charCodeAt(r)===9?(X=!0,(e.bsCount[p]+y)%4===3?(r++,y++,x=!1):x=!0):X=!1;let v=y;for(O.push(e.bMarks[p]),e.bMarks[p]=r;r<o;){const w=e.src.charCodeAt(r);if(Fe(w))w===9?v+=4-(v+e.bsCount[p]+(x?1:0))%4:v++;else break;r++}h=r>=o,l.push(e.bsCount[p]),e.bsCount[p]=e.sCount[p]+1+(X?1:0),s.push(e.sCount[p]),e.sCount[p]=v-y,u.push(e.tShift[p]),e.tShift[p]=r-e.bMarks[p];continue}if(h)break;let k=!1;for(let y=0,X=c.length;y<X;y++)if(c[y](e,p,n,!0)){k=!0;break}if(k){e.lineMax=p,e.blkIndent!==0&&(O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]-=e.blkIndent);break}O.push(e.bMarks[p]),l.push(e.bsCount[p]),u.push(e.tShift[p]),s.push(e.sCount[p]),e.sCount[p]=-1}const Q=e.blkIndent;e.blkIndent=0;const $=e.push("blockquote_open","blockquote",1);$.markup=">";const g=[t,0];$.map=g,e.md.block.tokenize(e,t,p);const b=e.push("blockquote_close","blockquote",-1);b.markup=">",e.lineMax=a,e.parentType=f,g[1]=e.line;for(let P=0;P<u.length;P++)e.bMarks[P+t]=O[P],e.tShift[P+t]=u[P],e.sCount[P+t]=s[P],e.bsCount[P+t]=l[P];return e.blkIndent=Q,!0}function A6(e,t,n,i){const r=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let o=e.bMarks[t]+e.tShift[t];const a=e.src.charCodeAt(o++);if(a!==42&&a!==45&&a!==95)return!1;let O=1;for(;o<r;){const s=e.src.charCodeAt(o++);if(s!==a&&!Fe(s))return!1;s===a&&O++}if(O<3)return!1;if(i)return!0;e.line=t+1;const l=e.push("hr","hr",0);return l.map=[t,e.line],l.markup=Array(O+1).join(String.fromCharCode(a)),!0}function Px(e,t){const n=e.eMarks[t];let i=e.bMarks[t]+e.tShift[t];const r=e.src.charCodeAt(i++);if(r!==42&&r!==45&&r!==43)return-1;if(i<n){const o=e.src.charCodeAt(i);if(!Fe(o))return-1}return i}function kx(e,t){const n=e.bMarks[t]+e.tShift[t],i=e.eMarks[t];let r=n;if(r+1>=i)return-1;let o=e.src.charCodeAt(r++);if(o<48||o>57)return-1;for(;;){if(r>=i)return-1;if(o=e.src.charCodeAt(r++),o>=48&&o<=57){if(r-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return r<i&&(o=e.src.charCodeAt(r),!Fe(o))?-1:r}function G6(e,t){const n=e.level+2;for(let i=t+2,r=e.tokens.length-2;i<r;i++)e.tokens[i].level===n&&e.tokens[i].type==="paragraph_open"&&(e.tokens[i+2].hidden=!0,e.tokens[i].hidden=!0,i+=2)}function I6(e,t,n,i){let r,o,a,O,l=t,s=!0;if(e.sCount[l]-e.blkIndent>=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]<e.blkIndent)return!1;let u=!1;i&&e.parentType==="paragraph"&&e.sCount[l]>=e.blkIndent&&(u=!0);let c,f,h;if((h=kx(e,l))>=0){if(c=!0,a=e.bMarks[l]+e.tShift[l],f=Number(e.src.slice(a,h-1)),u&&f!==1)return!1}else if((h=Px(e,l))>=0)c=!1;else return!1;if(u&&e.skipSpaces(h)>=e.eMarks[l])return!1;if(i)return!0;const p=e.src.charCodeAt(h-1),Q=e.tokens.length;c?(O=e.push("ordered_list_open","ol",1),f!==1&&(O.attrs=[["start",f]])):O=e.push("bullet_list_open","ul",1);const $=[l,0];O.map=$,O.markup=String.fromCharCode(p);let g=!1;const b=e.md.block.ruler.getRules("list"),P=e.parentType;for(e.parentType="list";l<n;){o=h,r=e.eMarks[l];const k=e.sCount[l]+h-(e.bMarks[l]+e.tShift[l]);let y=k;for(;o<r;){const q=e.src.charCodeAt(o);if(q===9)y+=4-(y+e.bsCount[l])%4;else if(q===32)y++;else break;o++}const X=o;let x;X>=r?x=1:x=y-k,x>4&&(x=1);const v=k+x;O=e.push("list_item_open","li",1),O.markup=String.fromCharCode(p);const w=[l,0];O.map=w,c&&(O.info=e.src.slice(a,h-1));const Y=e.tight,U=e.tShift[l],V=e.sCount[l],Z=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=v,e.tight=!0,e.tShift[l]=X-e.bMarks[l],e.sCount[l]=y,X>=r&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n,!0),(!e.tight||g)&&(s=!1),g=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Z,e.tShift[l]=U,e.sCount[l]=V,e.tight=Y,O=e.push("list_item_close","li",-1),O.markup=String.fromCharCode(p),l=e.line,w[1]=l,l>=n||e.sCount[l]<e.blkIndent||e.sCount[l]-e.blkIndent>=4)break;let T=!1;for(let q=0,W=b.length;q<W;q++)if(b[q](e,l,n,!0)){T=!0;break}if(T)break;if(c){if(h=kx(e,l),h<0)break;a=e.bMarks[l]+e.tShift[l]}else if(h=Px(e,l),h<0)break;if(p!==e.src.charCodeAt(h-1))break}return c?O=e.push("ordered_list_close","ol",-1):O=e.push("bullet_list_close","ul",-1),O.markup=String.fromCharCode(p),$[1]=l,e.line=l,e.parentType=P,s&&G6(e,Q),!0}function D6(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t],a=t+1;if(e.sCount[t]-e.blkIndent>=4||e.src.charCodeAt(r)!==91)return!1;function O(b){const P=e.lineMax;if(b>=P||e.isEmpty(b))return null;let k=!1;if(e.sCount[b]-e.blkIndent>3&&(k=!0),e.sCount[b]<0&&(k=!0),!k){const x=e.md.block.ruler.getRules("reference"),v=e.parentType;e.parentType="reference";let w=!1;for(let Y=0,U=x.length;Y<U;Y++)if(x[Y](e,b,P,!0)){w=!0;break}if(e.parentType=v,w)return null}const y=e.bMarks[b]+e.tShift[b],X=e.eMarks[b];return e.src.slice(y,X+1)}let l=e.src.slice(r,o+1);o=l.length;let s=-1;for(r=1;r<o;r++){const b=l.charCodeAt(r);if(b===91)return!1;if(b===93){s=r;break}else if(b===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(b===92&&(r++,r<o&&l.charCodeAt(r)===10)){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}}if(s<0||l.charCodeAt(s+1)!==58)return!1;for(r=s+2;r<o;r++){const b=l.charCodeAt(r);if(b===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(b))break}const u=e.md.helpers.parseLinkDestination(l,r,o);if(!u.ok)return!1;const c=e.md.normalizeLink(u.str);if(!e.md.validateLink(c))return!1;r=u.pos;const f=r,h=a,p=r;for(;r<o;r++){const b=l.charCodeAt(r);if(b===10){const P=O(a);P!==null&&(l+=P,o=l.length,a++)}else if(!Fe(b))break}let Q=e.md.helpers.parseLinkTitle(l,r,o);for(;Q.can_continue;){const b=O(a);if(b===null)break;l+=b,r=o,o=l.length,a++,Q=e.md.helpers.parseLinkTitle(l,r,o,Q)}let $;for(r<o&&p!==r&&Q.ok?($=Q.str,r=Q.pos):($="",r=f,a=h);r<o;){const b=l.charCodeAt(r);if(!Fe(b))break;r++}if(r<o&&l.charCodeAt(r)!==10&&$)for($="",r=f,a=h;r<o;){const b=l.charCodeAt(r);if(!Fe(b))break;r++}if(r<o&&l.charCodeAt(r)!==10)return!1;const g=Uc(l.slice(1,s));return g?(i||(typeof e.env.references>"u"&&(e.env.references={}),typeof e.env.references[g]>"u"&&(e.env.references[g]={title:$,href:c}),e.line=a),!0):!1}const N6=["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"],L6="[a-zA-Z_:][a-zA-Z0-9:._-]*",F6="(?:"+"[^\"'=<>`\\x00-\\x20]+"+"|"+"'[^']*'"+"|"+'"[^"]*"'+")",xx="<[A-Za-z][A-Za-z0-9\\-]*"+("(?:\\s+"+L6+"(?:\\s*=\\s*"+F6+")?)")+"*\\s*\\/?>",vx="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",M6="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",B6="<[?][\\s\\S]*?[?]>",H6="<![A-Za-z][^>]*>",K6="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",J6=new RegExp("^(?:"+xx+"|"+vx+"|"+M6+"|"+B6+"|"+H6+"|"+K6+")"),eC=new RegExp("^(?:"+xx+"|"+vx+")"),oO=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+N6.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(eC.source+"\\s*$"),/^$/,!1]];function tC(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(r)!==60)return!1;let a=e.src.slice(r,o),O=0;for(;O<oO.length&&!oO[O][0].test(a);O++);if(O===oO.length)return!1;if(i)return oO[O][2];let l=t+1;if(!oO[O][1].test(a)){for(;l<n&&!(e.sCount[l]<e.blkIndent);l++)if(r=e.bMarks[l]+e.tShift[l],o=e.eMarks[l],a=e.src.slice(r,o),oO[O][1].test(a)){a.length!==0&&l++;break}}e.line=l;const s=e.push("html_block","",0);return s.map=[t,l],s.content=e.getLines(t,l,e.blkIndent,!0),!0}function nC(e,t,n,i){let r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;let a=e.src.charCodeAt(r);if(a!==35||r>=o)return!1;let O=1;for(a=e.src.charCodeAt(++r);a===35&&r<o&&O<=6;)O++,a=e.src.charCodeAt(++r);if(O>6||r<o&&!Fe(a))return!1;if(i)return!0;o=e.skipSpacesBack(o,r);const l=e.skipCharsBack(o,35,r);l>r&&Fe(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const s=e.push("heading_open","h"+String(O),1);s.markup="########".slice(0,O),s.map=[t,e.line];const u=e.push("inline","",0);u.content=e.src.slice(r,o).trim(),u.map=[t,e.line],u.children=[];const c=e.push("heading_close","h"+String(O),-1);return c.markup="########".slice(0,O),!0}function iC(e,t,n){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const r=e.parentType;e.parentType="paragraph";let o=0,a,O=t+1;for(;O<n&&!e.isEmpty(O);O++){if(e.sCount[O]-e.blkIndent>3)continue;if(e.sCount[O]>=e.blkIndent){let h=e.bMarks[O]+e.tShift[O];const p=e.eMarks[O];if(h<p&&(a=e.src.charCodeAt(h),(a===45||a===61)&&(h=e.skipChars(h,a),h=e.skipSpaces(h),h>=p))){o=a===61?1:2;break}}if(e.sCount[O]<0)continue;let f=!1;for(let h=0,p=i.length;h<p;h++)if(i[h](e,O,n,!0)){f=!0;break}if(f)break}if(!o)return!1;const l=e.getLines(t,O,e.blkIndent,!1).trim();e.line=O+1;const s=e.push("heading_open","h"+String(o),1);s.markup=String.fromCharCode(a),s.map=[t,e.line];const u=e.push("inline","",0);u.content=l,u.map=[t,e.line-1],u.children=[];const c=e.push("heading_close","h"+String(o),-1);return c.markup=String.fromCharCode(a),e.parentType=r,!0}function rC(e,t,n){const i=e.md.block.ruler.getRules("paragraph"),r=e.parentType;let o=t+1;for(e.parentType="paragraph";o<n&&!e.isEmpty(o);o++){if(e.sCount[o]-e.blkIndent>3||e.sCount[o]<0)continue;let s=!1;for(let u=0,c=i.length;u<c;u++)if(i[u](e,o,n,!0)){s=!0;break}if(s)break}const a=e.getLines(t,o,e.blkIndent,!1).trim();e.line=o;const O=e.push("paragraph_open","p",1);O.map=[t,e.line];const l=e.push("inline","",0);return l.content=a,l.map=[t,e.line],l.children=[],e.push("paragraph_close","p",-1),e.parentType=r,!0}const Yc=[["table",Y6,["paragraph","reference"]],["code",V6],["fence",C6,["paragraph","reference","blockquote","list"]],["blockquote",j6,["paragraph","reference","blockquote","list"]],["hr",A6,["paragraph","reference","blockquote","list"]],["list",I6,["paragraph","reference","blockquote"]],["reference",D6],["html_block",tC,["paragraph","reference","blockquote"]],["heading",nC,["paragraph","reference","blockquote"]],["lheading",iC],["paragraph",rC]];function Vc(){this.ruler=new pn;for(let e=0;e<Yc.length;e++)this.ruler.push(Yc[e][0],Yc[e][1],{alt:(Yc[e][2]||[]).slice()})}Vc.prototype.tokenize=function(e,t,n){const i=this.ruler.getRules(""),r=i.length,o=e.md.options.maxNesting;let a=t,O=!1;for(;a<n&&(e.line=a=e.skipEmptyLines(a),!(a>=n||e.sCount[a]<e.blkIndent));){if(e.level>=o){e.line=n;break}const l=e.line;let s=!1;for(let u=0;u<r;u++)if(s=i[u](e,a,n,!1),s){if(l>=e.line)throw new Error("block rule didn't increment state.line");break}if(!s)throw new Error("none of the block rules matched");e.tight=!O,e.isEmpty(e.line-1)&&(O=!0),a=e.line,a<n&&e.isEmpty(a)&&(O=!0,a++,e.line=a)}},Vc.prototype.parse=function(e,t,n,i){if(!e)return;const r=new this.State(e,t,n,i);this.tokenize(r,r.line,r.lineMax)},Vc.prototype.State=er;function Nl(e,t,n,i){this.src=e,this.env=n,this.md=t,this.tokens=i,this.tokens_meta=Array(i.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}Nl.prototype.pushPending=function(){const e=new bi("text","",0);return e.content=this.pending,e.level=this.pendingLevel,this.tokens.push(e),this.pending="",e},Nl.prototype.push=function(e,t,n){this.pending&&this.pushPending();const i=new bi(e,t,n);let r=null;return n<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),i.level=this.level,n>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],r={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(r),i},Nl.prototype.scanDelims=function(e,t){const n=this.posMax,i=this.src.charCodeAt(e),r=e>0?this.src.charCodeAt(e-1):32;let o=e;for(;o<n&&this.src.charCodeAt(o)===i;)o++;const a=o-e,O=o<n?this.src.charCodeAt(o):32,l=Dl(r)||Il(String.fromCharCode(r)),s=Dl(O)||Il(String.fromCharCode(O)),u=Gl(r),c=Gl(O),f=!c&&(!s||u||l),h=!u&&(!l||c||s);return{can_open:f&&(t||!h||l),can_close:h&&(t||!f||s),length:a}},Nl.prototype.Token=bi;function oC(e){switch(e){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function aC(e,t){let n=e.pos;for(;n<e.posMax&&!oC(e.src.charCodeAt(n));)n++;return n===e.pos?!1:(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}const OC=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function lC(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,i=e.posMax;if(n+3>i||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const r=e.pending.match(OC);if(!r)return!1;const o=r[1],a=e.md.linkify.matchAtStart(e.src.slice(n-o.length));if(!a)return!1;let O=a.url;if(O.length<=o.length)return!1;O=O.replace(/\*+$/,"");const l=e.md.normalizeLink(O);if(!e.md.validateLink(l))return!1;if(!t){e.pending=e.pending.slice(0,-o.length);const s=e.push("link_open","a",1);s.attrs=[["href",l]],s.markup="linkify",s.info="auto";const u=e.push("text","",0);u.content=e.md.normalizeLinkText(O);const c=e.push("link_close","a",-1);c.markup="linkify",c.info="auto"}return e.pos+=O.length-o.length,!0}function sC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const i=e.pending.length-1,r=e.posMax;if(!t)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let o=i-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),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(n++;n<r&&Fe(e.src.charCodeAt(n));)n++;return e.pos=n,!0}const Lm=[];for(let e=0;e<256;e++)Lm.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(e){Lm[e.charCodeAt(0)]=1});function uC(e,t){let n=e.pos;const i=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=i))return!1;let r=e.src.charCodeAt(n);if(r===10){for(t||e.push("hardbreak","br",0),n++;n<i&&(r=e.src.charCodeAt(n),!!Fe(r));)n++;return e.pos=n,!0}let o=e.src[n];if(r>=55296&&r<=56319&&n+1<i){const O=e.src.charCodeAt(n+1);O>=56320&&O<=57343&&(o+=e.src[n+1],n++)}const a="\\"+o;if(!t){const O=e.push("text_special","",0);r<256&&Lm[r]!==0?O.content=o:O.content=a,O.markup=a,O.info="escape"}return e.pos=n+1,!0}function cC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==96)return!1;const r=n;n++;const o=e.posMax;for(;n<o&&e.src.charCodeAt(n)===96;)n++;const a=e.src.slice(r,n),O=a.length;if(e.backticksScanned&&(e.backticks[O]||0)<=r)return t||(e.pending+=a),e.pos+=O,!0;let l=n,s;for(;(s=e.src.indexOf("`",l))!==-1;){for(l=s+1;l<o&&e.src.charCodeAt(l)===96;)l++;const u=l-s;if(u===O){if(!t){const c=e.push("code_inline","code",0);c.markup=a,c.content=e.src.slice(n,s).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return e.pos=l,!0}e.backticks[u]=s}return e.backticksScanned=!0,t||(e.pending+=a),e.pos+=O,!0}function fC(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==126)return!1;const r=e.scanDelims(e.pos,!0);let o=r.length;const a=String.fromCharCode(i);if(o<2)return!1;let O;o%2&&(O=e.push("text","",0),O.content=a,o--);for(let l=0;l<o;l+=2)O=e.push("text","",0),O.content=a+a,e.delimiters.push({marker:i,length:0,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close});return e.pos+=r.length,!0}function wx(e,t){let n;const i=[],r=t.length;for(let o=0;o<r;o++){const a=t[o];if(a.marker!==126||a.end===-1)continue;const O=t[a.end];n=e.tokens[a.token],n.type="s_open",n.tag="s",n.nesting=1,n.markup="~~",n.content="",n=e.tokens[O.token],n.type="s_close",n.tag="s",n.nesting=-1,n.markup="~~",n.content="",e.tokens[O.token-1].type==="text"&&e.tokens[O.token-1].content==="~"&&i.push(O.token-1)}for(;i.length;){const o=i.pop();let a=o+1;for(;a<e.tokens.length&&e.tokens[a].type==="s_close";)a++;a--,o!==a&&(n=e.tokens[a],e.tokens[a]=e.tokens[o],e.tokens[o]=n)}}function dC(e){const t=e.tokens_meta,n=e.tokens_meta.length;wx(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&wx(e,t[i].delimiters)}const Xx={tokenize:fC,postProcess:dC};function hC(e,t){const n=e.pos,i=e.src.charCodeAt(n);if(t||i!==95&&i!==42)return!1;const r=e.scanDelims(e.pos,i===42);for(let o=0;o<r.length;o++){const a=e.push("text","",0);a.content=String.fromCharCode(i),e.delimiters.push({marker:i,length:r.length,token:e.tokens.length-1,end:-1,open:r.can_open,close:r.can_close})}return e.pos+=r.length,!0}function Tx(e,t){const n=t.length;for(let i=n-1;i>=0;i--){const r=t[i];if(r.marker!==95&&r.marker!==42||r.end===-1)continue;const o=t[r.end],a=i>0&&t[i-1].end===r.end+1&&t[i-1].marker===r.marker&&t[i-1].token===r.token-1&&t[r.end+1].token===o.token+1,O=String.fromCharCode(r.marker),l=e.tokens[r.token];l.type=a?"strong_open":"em_open",l.tag=a?"strong":"em",l.nesting=1,l.markup=a?O+O:O,l.content="";const s=e.tokens[o.token];s.type=a?"strong_close":"em_close",s.tag=a?"strong":"em",s.nesting=-1,s.markup=a?O+O:O,s.content="",a&&(e.tokens[t[i-1].token].content="",e.tokens[t[r.end+1].token].content="",i--)}}function pC(e){const t=e.tokens_meta,n=e.tokens_meta.length;Tx(e,e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Tx(e,t[i].delimiters)}const _x={tokenize:hC,postProcess:pC};function mC(e,t){let n,i,r,o,a="",O="",l=e.pos,s=!0;if(e.src.charCodeAt(e.pos)!==91)return!1;const u=e.pos,c=e.posMax,f=e.pos+1,h=e.md.helpers.parseLinkLabel(e,e.pos,!0);if(h<0)return!1;let p=h+1;if(p<c&&e.src.charCodeAt(p)===40){for(s=!1,p++;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(p>=c)return!1;if(l=p,r=e.md.helpers.parseLinkDestination(e.src,p,e.posMax),r.ok){for(a=e.md.normalizeLink(r.str),e.md.validateLink(a)?p=r.pos:a="",l=p;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);if(r=e.md.helpers.parseLinkTitle(e.src,p,e.posMax),p<c&&l!==p&&r.ok)for(O=r.str,p=r.pos;p<c&&(n=e.src.charCodeAt(p),!(!Fe(n)&&n!==10));p++);}(p>=c||e.src.charCodeAt(p)!==41)&&(s=!0),p++}if(s){if(typeof e.env.references>"u")return!1;if(p<c&&e.src.charCodeAt(p)===91?(l=p+1,p=e.md.helpers.parseLinkLabel(e,p),p>=0?i=e.src.slice(l,p++):p=h+1):p=h+1,i||(i=e.src.slice(f,h)),o=e.env.references[Uc(i)],!o)return e.pos=u,!1;a=o.href,O=o.title}if(!t){e.pos=f,e.posMax=h;const Q=e.push("link_open","a",1),$=[["href",a]];Q.attrs=$,O&&$.push(["title",O]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=p,e.posMax=c,!0}function gC(e,t){let n,i,r,o,a,O,l,s,u="";const c=e.pos,f=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const h=e.pos+2,p=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(p<0)return!1;if(o=p+1,o<f&&e.src.charCodeAt(o)===40){for(o++;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(o>=f)return!1;for(s=o,O=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),O.ok&&(u=e.md.normalizeLink(O.str),e.md.validateLink(u)?o=O.pos:u=""),s=o;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);if(O=e.md.helpers.parseLinkTitle(e.src,o,e.posMax),o<f&&s!==o&&O.ok)for(l=O.str,o=O.pos;o<f&&(n=e.src.charCodeAt(o),!(!Fe(n)&&n!==10));o++);else l="";if(o>=f||e.src.charCodeAt(o)!==41)return e.pos=c,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o<f&&e.src.charCodeAt(o)===91?(s=o+1,o=e.md.helpers.parseLinkLabel(e,o),o>=0?r=e.src.slice(s,o++):o=p+1):o=p+1,r||(r=e.src.slice(h,p)),a=e.env.references[Uc(r)],!a)return e.pos=c,!1;u=a.href,l=a.title}if(!t){i=e.src.slice(h,p);const Q=[];e.md.inline.parse(i,e.md,e.env,Q);const $=e.push("image","img",0),g=[["src",u],["alt",""]];$.attrs=g,$.children=Q,$.content=i,l&&g.push(["title",l])}return e.pos=o,e.posMax=f,!0}const $C=/^([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])?)*)$/,QC=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function bC(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const i=e.pos,r=e.posMax;for(;;){if(++n>=r)return!1;const a=e.src.charCodeAt(n);if(a===60)return!1;if(a===62)break}const o=e.src.slice(i+1,n);if(QC.test(o)){const a=e.md.normalizeLink(o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}if($C.test(o)){const a=e.md.normalizeLink("mailto:"+o);if(!e.md.validateLink(a))return!1;if(!t){const O=e.push("link_open","a",1);O.attrs=[["href",a]],O.markup="autolink",O.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const s=e.push("link_close","a",-1);s.markup="autolink",s.info="auto"}return e.pos+=o.length+2,!0}return!1}function yC(e){return/^<a[>\s]/i.test(e)}function SC(e){return/^<\/a\s*>/i.test(e)}function PC(e){const t=e|32;return t>=97&&t<=122}function kC(e,t){if(!e.md.options.html)return!1;const n=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=n)return!1;const r=e.src.charCodeAt(i+1);if(r!==33&&r!==63&&r!==47&&!PC(r))return!1;const o=e.src.slice(i).match(J6);if(!o)return!1;if(!t){const a=e.push("html_inline","",0);a.content=o[0],yC(a.content)&&e.linkLevel++,SC(a.content)&&e.linkLevel--}return e.pos+=o[0].length,!0}const xC=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,vC=/^&([a-z][a-z0-9]{1,31});/i;function wC(e,t){const n=e.pos,i=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=i)return!1;if(e.src.charCodeAt(n+1)===35){const o=e.src.slice(n).match(xC);if(o){if(!t){const a=o[1][0].toLowerCase()==="x"?parseInt(o[1].slice(1),16):parseInt(o[1],10),O=e.push("text_special","",0);O.content=Gm(a)?Zc(a):Zc(65533),O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}else{const o=e.src.slice(n).match(vC);if(o){const a=px(o[0]);if(a!==o[0]){if(!t){const O=e.push("text_special","",0);O.content=a,O.markup=o[0],O.info="entity"}return e.pos+=o[0].length,!0}}}return!1}function Rx(e){const t={},n=e.length;if(!n)return;let i=0,r=-2;const o=[];for(let a=0;a<n;a++){const O=e[a];if(o.push(0),(e[i].marker!==O.marker||r!==O.token-1)&&(i=a),r=O.token,O.length=O.length||0,!O.close)continue;t.hasOwnProperty(O.marker)||(t[O.marker]=[-1,-1,-1,-1,-1,-1]);const l=t[O.marker][(O.open?3:0)+O.length%3];let s=i-o[i]-1,u=s;for(;s>l;s-=o[s]+1){const c=e[s];if(c.marker===O.marker&&c.open&&c.end<0){let f=!1;if((c.close||O.open)&&(c.length+O.length)%3===0&&(c.length%3!==0||O.length%3!==0)&&(f=!0),!f){const h=s>0&&!e[s-1].open?o[s-1]+1:0;o[a]=a-s+h,o[s]=h,O.open=!1,c.end=a,c.close=!1,u=-1,r=-2;break}}}u!==-1&&(t[O.marker][(O.open?3:0)+(O.length||0)%3]=u)}}function XC(e){const t=e.tokens_meta,n=e.tokens_meta.length;Rx(e.delimiters);for(let i=0;i<n;i++)t[i]&&t[i].delimiters&&Rx(t[i].delimiters)}function TC(e){let t,n,i=0;const r=e.tokens,o=e.tokens.length;for(t=n=0;t<o;t++)r[t].nesting<0&&i--,r[t].level=i,r[t].nesting>0&&i++,r[t].type==="text"&&t+1<o&&r[t+1].type==="text"?r[t+1].content=r[t].content+r[t+1].content:(t!==n&&(r[n]=r[t]),n++);t!==n&&(r.length=n)}const Fm=[["text",aC],["linkify",lC],["newline",sC],["escape",uC],["backticks",cC],["strikethrough",Xx.tokenize],["emphasis",_x.tokenize],["link",mC],["image",gC],["autolink",bC],["html_inline",kC],["entity",wC]],Mm=[["balance_pairs",XC],["strikethrough",Xx.postProcess],["emphasis",_x.postProcess],["fragments_join",TC]];function Ll(){this.ruler=new pn;for(let e=0;e<Fm.length;e++)this.ruler.push(Fm[e][0],Fm[e][1]);this.ruler2=new pn;for(let e=0;e<Mm.length;e++)this.ruler2.push(Mm[e][0],Mm[e][1])}Ll.prototype.skipToken=function(e){const t=e.pos,n=this.ruler.getRules(""),i=n.length,r=e.md.options.maxNesting,o=e.cache;if(typeof o[t]<"u"){e.pos=o[t];return}let a=!1;if(e.level<r){for(let O=0;O<i;O++)if(e.level++,a=n[O](e,!0),e.level--,a){if(t>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;a||e.pos++,o[t]=e.pos},Ll.prototype.tokenize=function(e){const t=this.ruler.getRules(""),n=t.length,i=e.posMax,r=e.md.options.maxNesting;for(;e.pos<i;){const o=e.pos;let a=!1;if(e.level<r){for(let O=0;O<n;O++)if(a=t[O](e,!1),a){if(o>=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(a){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ll.prototype.parse=function(e,t,n,i){const r=new this.State(e,t,n,i);this.tokenize(r);const o=this.ruler2.getRules(""),a=o.length;for(let O=0;O<a;O++)o[O](r)},Ll.prototype.State=Nl;function _C(e){const t={};e=e||{},t.src_Any=ux.source,t.src_Cc=cx.source,t.src_Z=dx.source,t.src_P=Vm.source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");const n="[><|]";return t.src_pseudo_letter="(?:(?!"+n+"|"+t.src_ZPCc+")"+t.src_Any+")",t.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]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|"+n+"|"+t.src_ZPCc+")(?!"+(e["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|"+n+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]|$)|"+(e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+"|$)|;(?!"+t.src_ZCc+"|$)|\\!+(?!"+t.src_ZCc+"|[!]|$)|\\?(?!"+t.src_ZCc+"|[?]|$))+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|"+n+'|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}function Bm(e){return Array.prototype.slice.call(arguments,1).forEach(function(n){n&&Object.keys(n).forEach(function(i){e[i]=n[i]})}),e}function Cc(e){return Object.prototype.toString.call(e)}function RC(e){return Cc(e)==="[object String]"}function zC(e){return Cc(e)==="[object Object]"}function WC(e){return Cc(e)==="[object RegExp]"}function zx(e){return Cc(e)==="[object Function]"}function qC(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const Wx={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function ZC(e){return Object.keys(e||{}).reduce(function(t,n){return t||Wx.hasOwnProperty(n)},!1)}const UC={"http:":{validate:function(e,t,n){const i=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(i)?i.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){const i=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(i)?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){const i=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(i)?i.match(n.re.mailto)[0].length:0}}},EC="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]",YC="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function VC(e){e.__index__=-1,e.__text_cache__=""}function CC(e){return function(t,n){const i=t.slice(n);return e.test(i)?i.match(e)[0].length:0}}function qx(){return function(e,t){t.normalize(e)}}function jc(e){const t=e.re=_C(e.__opts__),n=e.__tlds__.slice();e.onCompile(),e.__tlds_replaced__||n.push(EC),n.push(t.src_xn),t.src_tlds=n.join("|");function i(O){return O.replace("%TLDS%",t.src_tlds)}t.email_fuzzy=RegExp(i(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(i(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(i(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(i(t.tpl_host_fuzzy_test),"i");const r=[];e.__compiled__={};function o(O,l){throw new Error('(LinkifyIt) Invalid schema "'+O+'": '+l)}Object.keys(e.__schemas__).forEach(function(O){const l=e.__schemas__[O];if(l===null)return;const s={validate:null,link:null};if(e.__compiled__[O]=s,zC(l)){WC(l.validate)?s.validate=CC(l.validate):zx(l.validate)?s.validate=l.validate:o(O,l),zx(l.normalize)?s.normalize=l.normalize:l.normalize?o(O,l):s.normalize=qx();return}if(RC(l)){r.push(O);return}o(O,l)}),r.forEach(function(O){e.__compiled__[e.__schemas__[O]]&&(e.__compiled__[O].validate=e.__compiled__[e.__schemas__[O]].validate,e.__compiled__[O].normalize=e.__compiled__[e.__schemas__[O]].normalize)}),e.__compiled__[""]={validate:null,normalize:qx()};const a=Object.keys(e.__compiled__).filter(function(O){return O.length>0&&e.__compiled__[O]}).map(qC).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+a+")","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"),VC(e)}function jC(e,t){const n=e.__index__,i=e.__last_index__,r=e.__text_cache__.slice(n,i);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=i+t,this.raw=r,this.text=r,this.url=r}function Hm(e,t){const n=new jC(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Rn(e,t){if(!(this instanceof Rn))return new Rn(e,t);t||ZC(e)&&(t=e,e={}),this.__opts__=Bm({},Wx,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=Bm({},UC,e),this.__compiled__={},this.__tlds__=YC,this.__tlds_replaced__=!1,this.re={},jc(this)}Rn.prototype.add=function(t,n){return this.__schemas__[t]=n,jc(this),this},Rn.prototype.set=function(t){return this.__opts__=Bm(this.__opts__,t),this},Rn.prototype.test=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return!1;let n,i,r,o,a,O,l,s,u;if(this.re.schema_test.test(t)){for(l=this.re.schema_search,l.lastIndex=0;(n=l.exec(t))!==null;)if(o=this.testSchemaAt(t,n[2],l.lastIndex),o){this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+o;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(s=t.search(this.re.host_fuzzy_test),s>=0&&(this.__index__<0||s<this.__index__)&&(i=t.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(a=i.index+i[1].length,(this.__index__<0||a<this.__index__)&&(this.__schema__="",this.__index__=a,this.__last_index__=i.index+i[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(u=t.indexOf("@"),u>=0&&(r=t.match(this.re.email_fuzzy))!==null&&(a=r.index+r[1].length,O=r.index+r[0].length,(this.__index__<0||a<this.__index__||a===this.__index__&&O>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=a,this.__last_index__=O))),this.__index__>=0},Rn.prototype.pretest=function(t){return this.re.pretest.test(t)},Rn.prototype.testSchemaAt=function(t,n,i){return this.__compiled__[n.toLowerCase()]?this.__compiled__[n.toLowerCase()].validate(t,i,this):0},Rn.prototype.match=function(t){const n=[];let i=0;this.__index__>=0&&this.__text_cache__===t&&(n.push(Hm(this,i)),i=this.__last_index__);let r=i?t.slice(i):t;for(;this.test(r);)n.push(Hm(this,i)),r=r.slice(this.__last_index__),i+=this.__last_index__;return n.length?n:null},Rn.prototype.matchAtStart=function(t){if(this.__text_cache__=t,this.__index__=-1,!t.length)return null;const n=this.re.schema_at_start.exec(t);if(!n)return null;const i=this.testSchemaAt(t,n[2],n[0].length);return i?(this.__schema__=n[2],this.__index__=n.index+n[1].length,this.__last_index__=n.index+n[0].length+i,Hm(this,0)):null},Rn.prototype.tlds=function(t,n){return t=Array.isArray(t)?t:[t],n?(this.__tlds__=this.__tlds__.concat(t).sort().filter(function(i,r,o){return i!==o[r-1]}).reverse(),jc(this),this):(this.__tlds__=t.slice(),this.__tlds_replaced__=!0,jc(this),this)},Rn.prototype.normalize=function(t){t.schema||(t.url="http://"+t.url),t.schema==="mailto:"&&!/^mailto:/i.test(t.url)&&(t.url="mailto:"+t.url)},Rn.prototype.onCompile=function(){};const aO=2147483647,tr=36,Km=1,Fl=26,AC=38,GC=700,Zx=72,Ux=128,Ex="-",IC=/^xn--/,DC=/[^\0-\x7F]/,NC=/[\x2E\u3002\uFF0E\uFF61]/g,LC={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Jm=tr-Km,nr=Math.floor,eg=String.fromCharCode;function io(e){throw new RangeError(LC[e])}function FC(e,t){const n=[];let i=e.length;for(;i--;)n[i]=t(e[i]);return n}function Yx(e,t){const n=e.split("@");let i="";n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(NC,".");const r=e.split("."),o=FC(r,t).join(".");return i+o}function Vx(e){const t=[];let n=0;const i=e.length;for(;n<i;){const r=e.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){const o=e.charCodeAt(n++);(o&64512)==56320?t.push(((r&1023)<<10)+(o&1023)+65536):(t.push(r),n--)}else t.push(r)}return t}const MC=e=>String.fromCodePoint(...e),BC=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:tr},Cx=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},jx=function(e,t,n){let i=0;for(e=n?nr(e/GC):e>>1,e+=nr(e/t);e>Jm*Fl>>1;i+=tr)e=nr(e/Jm);return nr(i+(Jm+1)*e/(e+AC))},Ax=function(e){const t=[],n=e.length;let i=0,r=Ux,o=Zx,a=e.lastIndexOf(Ex);a<0&&(a=0);for(let O=0;O<a;++O)e.charCodeAt(O)>=128&&io("not-basic"),t.push(e.charCodeAt(O));for(let O=a>0?a+1:0;O<n;){const l=i;for(let u=1,c=tr;;c+=tr){O>=n&&io("invalid-input");const f=BC(e.charCodeAt(O++));f>=tr&&io("invalid-input"),f>nr((aO-i)/u)&&io("overflow"),i+=f*u;const h=c<=o?Km:c>=o+Fl?Fl:c-o;if(f<h)break;const p=tr-h;u>nr(aO/p)&&io("overflow"),u*=p}const s=t.length+1;o=jx(i-l,s,l==0),nr(i/s)>aO-r&&io("overflow"),r+=nr(i/s),i%=s,t.splice(i++,0,r)}return String.fromCodePoint(...t)},Gx=function(e){const t=[];e=Vx(e);const n=e.length;let i=Ux,r=0,o=Zx;for(const l of e)l<128&&t.push(eg(l));const a=t.length;let O=a;for(a&&t.push(Ex);O<n;){let l=aO;for(const u of e)u>=i&&u<l&&(l=u);const s=O+1;l-i>nr((aO-r)/s)&&io("overflow"),r+=(l-i)*s,i=l;for(const u of e)if(u<i&&++r>aO&&io("overflow"),u===i){let c=r;for(let f=tr;;f+=tr){const h=f<=o?Km:f>=o+Fl?Fl:f-o;if(c<h)break;const p=c-h,Q=tr-h;t.push(eg(Cx(h+p%Q,0))),c=nr(p/Q)}t.push(eg(Cx(c,0))),o=jx(r,s,O===a),r=0,++O}++r,++i}return t.join("")},Ix={version:"2.3.1",ucs2:{decode:Vx,encode:MC},decode:Ax,encode:Gx,toASCII:function(e){return Yx(e,function(t){return DC.test(t)?"xn--"+Gx(t):t})},toUnicode:function(e){return Yx(e,function(t){return IC.test(t)?Ax(t.slice(4).toLowerCase()):t})}},HC={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},zero:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}}},KC=/^(vbscript|javascript|file|data):/,JC=/^data:image\/(gif|png|jpeg|webp);/;function e9(e){const t=e.trim().toLowerCase();return KC.test(t)?JC.test(t):!0}const Dx=["http:","https:","mailto:"];function t9(e){const t=Ym(e,!0);if(t.hostname&&(!t.protocol||Dx.indexOf(t.protocol)>=0))try{t.hostname=Ix.toASCII(t.hostname)}catch{}return Al(Em(t))}function n9(e){const t=Ym(e,!0);if(t.hostname&&(!t.protocol||Dx.indexOf(t.protocol)>=0))try{t.hostname=Ix.toUnicode(t.hostname)}catch{}return nO(Em(t),nO.defaultChars+"%")}function ei(e,t){if(!(this instanceof ei))return new ei(e,t);t||Am(e)||(t=e||{},e="default"),this.inline=new Ll,this.block=new Vc,this.core=new Dm,this.renderer=new rO,this.linkify=new Rn,this.validateLink=e9,this.normalizeLink=t9,this.normalizeLinkText=n9,this.utils=d6,this.helpers=qc({},g6),this.options={},this.configure(e),t&&this.set(t)}ei.prototype.set=function(e){return qc(this.options,e),this},ei.prototype.configure=function(e){const t=this;if(Am(e)){const n=e;if(e=HC[n],!e)throw new Error('Wrong `markdown-it` preset "'+n+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach(function(n){e.components[n].rules&&t[n].ruler.enableOnly(e.components[n].rules),e.components[n].rules2&&t[n].ruler2.enableOnly(e.components[n].rules2)}),this},ei.prototype.enable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.enable(e,!0))},this),n=n.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this},ei.prototype.disable=function(e,t){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(r){n=n.concat(this[r].ruler.disable(e,!0))},this),n=n.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(r){return n.indexOf(r)<0});if(i.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this},ei.prototype.use=function(e){const t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},ei.prototype.parse=function(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},ei.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},ei.prototype.parseInline=function(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},ei.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)};const Nx=new Set([!0,!1,"alt","title"]);function Lx(e,t){return(Array.isArray(e)?e:[]).filter(([n])=>n!==t)}function Fx(e,t){e&&e.attrs&&(e.attrs=Lx(e.attrs,t))}function i9(e,t){if(!Nx.has(e))throw new TypeError(`figcaption must be one of: ${[...Nx]}.`);if(e==="alt")return t.content;const n=t.attrs.find(([i])=>i==="title");return Array.isArray(n)&&n[1]?(Fx(t,"title"),n[1]):void 0}function r9(e,t){t=t||{},e.core.ruler.before("linkify","image_figures",function(n){let i=1;for(let r=1,o=n.tokens.length;r<o-1;++r){const a=n.tokens[r];if(a.type!=="inline"||!a.children||a.children.length!==1&&a.children.length!==3||a.children.length===1&&a.children[0].type!=="image")continue;if(a.children.length===3){const[s,u,c]=a.children;if(s.type!=="link_open"||u.type!=="image"||c.type!=="link_close")continue}if(r!==0&&n.tokens[r-1].type!=="paragraph_open"||r!==o-1&&n.tokens[r+1].type!=="paragraph_close")continue;const O=n.tokens[r-1];let l;if(O.type="figure_open",O.tag="figure",n.tokens[r+1].type="figure_close",n.tokens[r+1].tag="figure",t.dataType&&n.tokens[r-1].attrPush(["data-type","image"]),t.link&&a.children.length===1){[l]=a.children;const s=new n.Token("link_open","a",1);s.attrPush(["href",l.attrGet("src")]),a.children.unshift(s),a.children.push(new n.Token("link_close","a",-1))}if(l=a.children.length===1?a.children[0]:a.children[1],t.figcaption){const s=i9(t.figcaption,l);if(s){const[u]=e.parseInline(s,n.env);a.children.push(new n.Token("figcaption_open","figcaption",1)),a.children.push(...u.children),a.children.push(new n.Token("figcaption_close","figcaption",-1)),l.attrs&&(l.attrs=Lx(l.attrs,"title"))}}if(t.copyAttrs&&l.attrs){const s=t.copyAttrs===!0?"":t.copyAttrs;O.attrs=l.attrs.filter(([u])=>u.match(s)).map(u=>Array.from(u))}if(t.tabindex&&(n.tokens[r-1].attrPush(["tabindex",i]),i++),t.lazy&&(l.attrs.some(([s])=>s==="loading")||l.attrs.push(["loading","lazy"])),t.async&&(l.attrs.some(([s])=>s==="decoding")||l.attrs.push(["decoding","async"])),t.classes&&typeof t.classes=="string"){let s=!1;for(let u=0,c=l.attrs.length;u<c&&!s;u++){const f=l.attrs[u];f[0]==="class"&&(f[1]=`${f[1]} ${t.classes}`,s=!0)}s||l.attrs.push(["class",t.classes])}if(t.removeSrc){const s=l.attrs.find(([u])=>u==="src");l.attrs.push(["data-src",s[1]]),Fx(l,"src")}}})}const o9=e=>{const t=m.inject("highlight"),n=m.shallowRef(ot.editorExtensions.highlight.instance);return m.onMounted(()=>{e.noHighlight||n.value||(un("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`}),un("script",{...t.value.js,id:`${z}-hljs`,onload(){n.value=window.hljs}},"hljs"))}),m.watch(()=>t.value.css,()=>{e.noHighlight||n.value||xW("link",{...t.value.css,rel:"stylesheet",id:`${z}-hlCss`})}),n},OO=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Mx=new Set,tg=typeof process=="object"&&process?process:{},Bx=(e,t,n,i)=>{typeof tg.emitWarning=="function"?tg.emitWarning(e,t,n,i):console.error(`[${n}] ${t}: ${e}`)};let Ac=globalThis.AbortController,Hx=globalThis.AbortSignal;if(typeof Ac>"u"){Hx=class{constructor(){Xe(this,"onabort");Xe(this,"_onabort",[]);Xe(this,"reason");Xe(this,"aborted",!1)}addEventListener(i,r){this._onabort.push(r)}},Ac=class{constructor(){Xe(this,"signal",new Hx);t()}abort(i){var r,o;if(!this.signal.aborted){this.signal.reason=i,this.signal.aborted=!0;for(const a of this.signal._onabort)a(i);(o=(r=this.signal).onabort)==null||o.call(r,i)}}};let e=((Jz=tg.env)==null?void 0:Jz.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const t=()=>{e&&(e=!1,Bx("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}const a9=e=>!Mx.has(e),ro=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),Kx=e=>ro(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?Gc:null:null;class Gc extends Array{constructor(t){super(t),this.fill(0)}}const ha=class ha{constructor(t,n){Xe(this,"heap");Xe(this,"length");if(!_(ha,_O))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new n(t),this.length=0}static create(t){const n=Kx(t);if(!n)return[];de(ha,_O,!0);const i=new ha(t,n);return de(ha,_O,!1),i}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}};_O=new WeakMap,Qe(ha,_O,!1);let ng=ha;const MQ=class MQ{constructor(t){Qe(this,Ns);Qe(this,Ud);Qe(this,sr);Qe(this,ur);Qe(this,Ms);Qe(this,WO);Qe(this,qO);Qe(this,Le);Qe(this,Bs);Qe(this,ga);Qe(this,_i,void 0);Qe(this,Vn,void 0);Qe(this,Ri,void 0);Qe(this,zi,void 0);Qe(this,RO,void 0);Xe(this,"ttl");Xe(this,"ttlResolution");Xe(this,"ttlAutopurge");Xe(this,"updateAgeOnGet");Xe(this,"updateAgeOnHas");Xe(this,"allowStale");Xe(this,"noDisposeOnSet");Xe(this,"noUpdateTTL");Xe(this,"maxEntrySize");Xe(this,"sizeCalculation");Xe(this,"noDeleteOnFetchRejection");Xe(this,"noDeleteOnStaleGet");Xe(this,"allowStaleOnFetchAbort");Xe(this,"allowStaleOnFetchRejection");Xe(this,"ignoreFetchAbort");Qe(this,_t,void 0);Qe(this,Wi,void 0);Qe(this,Pt,void 0);Qe(this,Ke,void 0);Qe(this,ge,void 0);Qe(this,ln,void 0);Qe(this,Cn,void 0);Qe(this,Jt,void 0);Qe(this,Ut,void 0);Qe(this,qi,void 0);Qe(this,Et,void 0);Qe(this,Zi,void 0);Qe(this,Ui,void 0);Qe(this,jn,void 0);Qe(this,Ei,void 0);Qe(this,yo,void 0);Qe(this,sn,void 0);Qe(this,pa,()=>{});Qe(this,qr,()=>{});Qe(this,Ls,()=>{});Qe(this,An,()=>!1);Qe(this,ma,t=>{});Qe(this,zO,(t,n,i)=>{});Qe(this,Fs,(t,n,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Xe(this,MOe,"LRUCache");const{max:n=0,ttl:i,ttlResolution:r=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:O,allowStale:l,dispose:s,disposeAfter:u,noDisposeOnSet:c,noUpdateTTL:f,maxSize:h=0,maxEntrySize:p=0,sizeCalculation:Q,fetchMethod:$,noDeleteOnFetchRejection:g,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:k,ignoreFetchAbort:y}=t;if(n!==0&&!ro(n))throw new TypeError("max option must be a nonnegative integer");const X=n?Kx(n):Array;if(!X)throw new Error("invalid max value: "+n);if(de(this,_i,n),de(this,Vn,h),this.maxEntrySize=p||_(this,Vn),this.sizeCalculation=Q,this.sizeCalculation){if(!_(this,Vn)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if($!==void 0&&typeof $!="function")throw new TypeError("fetchMethod must be a function if specified");if(de(this,RO,$),de(this,yo,!!$),de(this,Pt,new Map),de(this,Ke,new Array(n).fill(void 0)),de(this,ge,new Array(n).fill(void 0)),de(this,ln,new X(n)),de(this,Cn,new X(n)),de(this,Jt,0),de(this,Ut,0),de(this,qi,ng.create(n)),de(this,_t,0),de(this,Wi,0),typeof s=="function"&&de(this,Ri,s),typeof u=="function"?(de(this,zi,u),de(this,Et,[])):(de(this,zi,void 0),de(this,Et,void 0)),de(this,Ei,!!_(this,Ri)),de(this,sn,!!_(this,zi)),this.noDisposeOnSet=!!c,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!g,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!y,this.maxEntrySize!==0){if(_(this,Vn)!==0&&!ro(_(this,Vn)))throw new TypeError("maxSize must be a positive integer if specified");if(!ro(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");se(this,Ud,lW).call(this)}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!O,this.ttlResolution=ro(r)||r===0?r:1,this.ttlAutopurge=!!o,this.ttl=i||0,this.ttl){if(!ro(this.ttl))throw new TypeError("ttl must be a positive integer if specified");se(this,Ns,JQ).call(this)}if(_(this,_i)===0&&this.ttl===0&&_(this,Vn)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!_(this,_i)&&!_(this,Vn)){const x="LRU_CACHE_UNBOUNDED";a9(x)&&(Mx.add(x),Bx("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",x,MQ))}}static unsafeExposeInternals(t){return{starts:_(t,Ui),ttls:_(t,jn),sizes:_(t,Zi),keyMap:_(t,Pt),keyList:_(t,Ke),valList:_(t,ge),next:_(t,ln),prev:_(t,Cn),get head(){return _(t,Jt)},get tail(){return _(t,Ut)},free:_(t,qi),isBackgroundFetch:n=>{var i;return se(i=t,Le,et).call(i,n)},backgroundFetch:(n,i,r,o)=>{var a;return se(a=t,qO,eh).call(a,n,i,r,o)},moveToTail:n=>{var i;return se(i=t,ga,nu).call(i,n)},indexes:n=>{var i;return se(i=t,sr,ko).call(i,n)},rindexes:n=>{var i;return se(i=t,ur,xo).call(i,n)},isStale:n=>{var i;return _(i=t,An).call(i,n)}}}get max(){return _(this,_i)}get maxSize(){return _(this,Vn)}get calculatedSize(){return _(this,Wi)}get size(){return _(this,_t)}get fetchMethod(){return _(this,RO)}get dispose(){return _(this,Ri)}get disposeAfter(){return _(this,zi)}getRemainingTTL(t){return _(this,Pt).has(t)?1/0:0}*entries(){for(const t of se(this,sr,ko).call(this))_(this,ge)[t]!==void 0&&_(this,Ke)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield[_(this,Ke)[t],_(this,ge)[t]])}*rentries(){for(const t of se(this,ur,xo).call(this))_(this,ge)[t]!==void 0&&_(this,Ke)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield[_(this,Ke)[t],_(this,ge)[t]])}*keys(){for(const t of se(this,sr,ko).call(this)){const n=_(this,Ke)[t];n!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield n)}}*rkeys(){for(const t of se(this,ur,xo).call(this)){const n=_(this,Ke)[t];n!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield n)}}*values(){for(const t of se(this,sr,ko).call(this))_(this,ge)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield _(this,ge)[t])}*rvalues(){for(const t of se(this,ur,xo).call(this))_(this,ge)[t]!==void 0&&!se(this,Le,et).call(this,_(this,ge)[t])&&(yield _(this,ge)[t])}[Symbol.iterator](){return this.entries()}find(t,n={}){for(const i of se(this,sr,ko).call(this)){const r=_(this,ge)[i],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o!==void 0&&t(o,_(this,Ke)[i],this))return this.get(_(this,Ke)[i],n)}}forEach(t,n=this){for(const i of se(this,sr,ko).call(this)){const r=_(this,ge)[i],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,_(this,Ke)[i],this)}}rforEach(t,n=this){for(const i of se(this,ur,xo).call(this)){const r=_(this,ge)[i],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;o!==void 0&&t.call(n,o,_(this,Ke)[i],this)}}purgeStale(){let t=!1;for(const n of se(this,ur,xo).call(this,{allowStale:!0}))_(this,An).call(this,n)&&(this.delete(_(this,Ke)[n]),t=!0);return t}info(t){const n=_(this,Pt).get(t);if(n===void 0)return;const i=_(this,ge)[n],r=se(this,Le,et).call(this,i)?i.__staleWhileFetching:i;if(r===void 0)return;const o={value:r};if(_(this,jn)&&_(this,Ui)){const a=_(this,jn)[n],O=_(this,Ui)[n];if(a&&O){const l=a-(OO.now()-O);o.ttl=l,o.start=Date.now()}}return _(this,Zi)&&(o.size=_(this,Zi)[n]),o}dump(){const t=[];for(const n of se(this,sr,ko).call(this,{allowStale:!0})){const i=_(this,Ke)[n],r=_(this,ge)[n],o=se(this,Le,et).call(this,r)?r.__staleWhileFetching:r;if(o===void 0||i===void 0)continue;const a={value:o};if(_(this,jn)&&_(this,Ui)){a.ttl=_(this,jn)[n];const O=OO.now()-_(this,Ui)[n];a.start=Math.floor(Date.now()-O)}_(this,Zi)&&(a.size=_(this,Zi)[n]),t.unshift([i,a])}return t}load(t){this.clear();for(const[n,i]of t){if(i.start){const r=Date.now()-i.start;i.start=OO.now()-r}this.set(n,i.value,i)}}set(t,n,i={}){var f,h,p,Q,$;if(n===void 0)return this.delete(t),this;const{ttl:r=this.ttl,start:o,noDisposeOnSet:a=this.noDisposeOnSet,sizeCalculation:O=this.sizeCalculation,status:l}=i;let{noUpdateTTL:s=this.noUpdateTTL}=i;const u=_(this,Fs).call(this,t,n,i.size||0,O);if(this.maxEntrySize&&u>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(t),this;let c=_(this,_t)===0?void 0:_(this,Pt).get(t);if(c===void 0)c=_(this,_t)===0?_(this,Ut):_(this,qi).length!==0?_(this,qi).pop():_(this,_t)===_(this,_i)?se(this,WO,Jd).call(this,!1):_(this,_t),_(this,Ke)[c]=t,_(this,ge)[c]=n,_(this,Pt).set(t,c),_(this,ln)[_(this,Ut)]=c,_(this,Cn)[c]=_(this,Ut),de(this,Ut,c),Kd(this,_t)._++,_(this,zO).call(this,c,u,l),l&&(l.set="add"),s=!1;else{se(this,ga,nu).call(this,c);const g=_(this,ge)[c];if(n!==g){if(_(this,yo)&&se(this,Le,et).call(this,g)){g.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:b}=g;b!==void 0&&!a&&(_(this,Ei)&&((f=_(this,Ri))==null||f.call(this,b,t,"set")),_(this,sn)&&((h=_(this,Et))==null||h.push([b,t,"set"])))}else a||(_(this,Ei)&&((p=_(this,Ri))==null||p.call(this,g,t,"set")),_(this,sn)&&((Q=_(this,Et))==null||Q.push([g,t,"set"])));if(_(this,ma).call(this,c),_(this,zO).call(this,c,u,l),_(this,ge)[c]=n,l){l.set="replace";const b=g&&se(this,Le,et).call(this,g)?g.__staleWhileFetching:g;b!==void 0&&(l.oldValue=b)}}else l&&(l.set="update")}if(r!==0&&!_(this,jn)&&se(this,Ns,JQ).call(this),_(this,jn)&&(s||_(this,Ls).call(this,c,r,o),l&&_(this,qr).call(this,l,c)),!a&&_(this,sn)&&_(this,Et)){const g=_(this,Et);let b;for(;b=g==null?void 0:g.shift();)($=_(this,zi))==null||$.call(this,...b)}return this}pop(){var t;try{for(;_(this,_t);){const n=_(this,ge)[_(this,Jt)];if(se(this,WO,Jd).call(this,!0),se(this,Le,et).call(this,n)){if(n.__staleWhileFetching)return n.__staleWhileFetching}else if(n!==void 0)return n}}finally{if(_(this,sn)&&_(this,Et)){const n=_(this,Et);let i;for(;i=n==null?void 0:n.shift();)(t=_(this,zi))==null||t.call(this,...i)}}}has(t,n={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=n,o=_(this,Pt).get(t);if(o!==void 0){const a=_(this,ge)[o];if(se(this,Le,et).call(this,a)&&a.__staleWhileFetching===void 0)return!1;if(_(this,An).call(this,o))r&&(r.has="stale",_(this,qr).call(this,r,o));else return i&&_(this,pa).call(this,o),r&&(r.has="hit",_(this,qr).call(this,r,o)),!0}else r&&(r.has="miss");return!1}peek(t,n={}){const{allowStale:i=this.allowStale}=n,r=_(this,Pt).get(t);if(r===void 0||!i&&_(this,An).call(this,r))return;const o=_(this,ge)[r];return se(this,Le,et).call(this,o)?o.__staleWhileFetching:o}async fetch(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:O=this.noDisposeOnSet,size:l=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:Q,forceRefresh:$=!1,status:g,signal:b}=n;if(!_(this,yo))return g&&(g.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,status:g});const P={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:o,ttl:a,noDisposeOnSet:O,size:l,sizeCalculation:s,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:g,signal:b};let k=_(this,Pt).get(t);if(k===void 0){g&&(g.fetch="miss");const y=se(this,qO,eh).call(this,t,k,P,Q);return y.__returned=y}else{const y=_(this,ge)[k];if(se(this,Le,et).call(this,y)){const Y=i&&y.__staleWhileFetching!==void 0;return g&&(g.fetch="inflight",Y&&(g.returnedStale=!0)),Y?y.__staleWhileFetching:y.__returned=y}const X=_(this,An).call(this,k);if(!$&&!X)return g&&(g.fetch="hit"),se(this,ga,nu).call(this,k),r&&_(this,pa).call(this,k),g&&_(this,qr).call(this,g,k),y;const x=se(this,qO,eh).call(this,t,k,P,Q),w=x.__staleWhileFetching!==void 0&&i;return g&&(g.fetch=X?"stale":"refresh",w&&X&&(g.returnedStale=!0)),w?x.__staleWhileFetching:x.__returned=x}}get(t,n={}){const{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:a}=n,O=_(this,Pt).get(t);if(O!==void 0){const l=_(this,ge)[O],s=se(this,Le,et).call(this,l);return a&&_(this,qr).call(this,a,O),_(this,An).call(this,O)?(a&&(a.get="stale"),s?(a&&i&&l.__staleWhileFetching!==void 0&&(a.returnedStale=!0),i?l.__staleWhileFetching:void 0):(o||this.delete(t),a&&i&&(a.returnedStale=!0),i?l:void 0)):(a&&(a.get="hit"),s?l.__staleWhileFetching:(se(this,ga,nu).call(this,O),r&&_(this,pa).call(this,O),l))}else a&&(a.get="miss")}delete(t){var i,r,o,a;let n=!1;if(_(this,_t)!==0){const O=_(this,Pt).get(t);if(O!==void 0)if(n=!0,_(this,_t)===1)this.clear();else{_(this,ma).call(this,O);const l=_(this,ge)[O];if(se(this,Le,et).call(this,l)?l.__abortController.abort(new Error("deleted")):(_(this,Ei)||_(this,sn))&&(_(this,Ei)&&((i=_(this,Ri))==null||i.call(this,l,t,"delete")),_(this,sn)&&((r=_(this,Et))==null||r.push([l,t,"delete"]))),_(this,Pt).delete(t),_(this,Ke)[O]=void 0,_(this,ge)[O]=void 0,O===_(this,Ut))de(this,Ut,_(this,Cn)[O]);else if(O===_(this,Jt))de(this,Jt,_(this,ln)[O]);else{const s=_(this,Cn)[O];_(this,ln)[s]=_(this,ln)[O];const u=_(this,ln)[O];_(this,Cn)[u]=_(this,Cn)[O]}Kd(this,_t)._--,_(this,qi).push(O)}}if(_(this,sn)&&((o=_(this,Et))!=null&&o.length)){const O=_(this,Et);let l;for(;l=O==null?void 0:O.shift();)(a=_(this,zi))==null||a.call(this,...l)}return n}clear(){var t,n,i;for(const r of se(this,ur,xo).call(this,{allowStale:!0})){const o=_(this,ge)[r];if(se(this,Le,et).call(this,o))o.__abortController.abort(new Error("deleted"));else{const a=_(this,Ke)[r];_(this,Ei)&&((t=_(this,Ri))==null||t.call(this,o,a,"delete")),_(this,sn)&&((n=_(this,Et))==null||n.push([o,a,"delete"]))}}if(_(this,Pt).clear(),_(this,ge).fill(void 0),_(this,Ke).fill(void 0),_(this,jn)&&_(this,Ui)&&(_(this,jn).fill(0),_(this,Ui).fill(0)),_(this,Zi)&&_(this,Zi).fill(0),de(this,Jt,0),de(this,Ut,0),_(this,qi).length=0,de(this,Wi,0),de(this,_t,0),_(this,sn)&&_(this,Et)){const r=_(this,Et);let o;for(;o=r==null?void 0:r.shift();)(i=_(this,zi))==null||i.call(this,...o)}}};MOe=Symbol.toStringTag,_i=new WeakMap,Vn=new WeakMap,Ri=new WeakMap,zi=new WeakMap,RO=new WeakMap,_t=new WeakMap,Wi=new WeakMap,Pt=new WeakMap,Ke=new WeakMap,ge=new WeakMap,ln=new WeakMap,Cn=new WeakMap,Jt=new WeakMap,Ut=new WeakMap,qi=new WeakMap,Et=new WeakMap,Zi=new WeakMap,Ui=new WeakMap,jn=new WeakMap,Ei=new WeakMap,yo=new WeakMap,sn=new WeakMap,Ns=new WeakSet,JQ=function(){const t=new Gc(_(this,_i)),n=new Gc(_(this,_i));de(this,jn,t),de(this,Ui,n),de(this,Ls,(o,a,O=OO.now())=>{if(n[o]=a!==0?O:0,t[o]=a,a!==0&&this.ttlAutopurge){const l=setTimeout(()=>{_(this,An).call(this,o)&&this.delete(_(this,Ke)[o])},a+1);l.unref&&l.unref()}}),de(this,pa,o=>{n[o]=t[o]!==0?OO.now():0}),de(this,qr,(o,a)=>{if(t[a]){const O=t[a],l=n[a];if(!O||!l)return;o.ttl=O,o.start=l,o.now=i||r();const s=o.now-l;o.remainingTTL=O-s}});let i=0;const r=()=>{const o=OO.now();if(this.ttlResolution>0){i=o;const a=setTimeout(()=>i=0,this.ttlResolution);a.unref&&a.unref()}return o};this.getRemainingTTL=o=>{const a=_(this,Pt).get(o);if(a===void 0)return 0;const O=t[a],l=n[a];if(!O||!l)return 1/0;const s=(i||r())-l;return O-s},de(this,An,o=>{const a=n[o],O=t[o];return!!O&&!!a&&(i||r())-a>O})},pa=new WeakMap,qr=new WeakMap,Ls=new WeakMap,An=new WeakMap,Ud=new WeakSet,lW=function(){const t=new Gc(_(this,_i));de(this,Wi,0),de(this,Zi,t),de(this,ma,n=>{de(this,Wi,_(this,Wi)-t[n]),t[n]=0}),de(this,Fs,(n,i,r,o)=>{if(se(this,Le,et).call(this,i))return 0;if(!ro(r))if(o){if(typeof o!="function")throw new TypeError("sizeCalculation must be a function");if(r=o(i,n),!ro(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return r}),de(this,zO,(n,i,r)=>{if(t[n]=i,_(this,Vn)){const o=_(this,Vn)-t[n];for(;_(this,Wi)>o;)se(this,WO,Jd).call(this,!0)}de(this,Wi,_(this,Wi)+t[n]),r&&(r.entrySize=i,r.totalCalculatedSize=_(this,Wi))})},ma=new WeakMap,zO=new WeakMap,Fs=new WeakMap,sr=new WeakSet,ko=function*({allowStale:t=this.allowStale}={}){if(_(this,_t))for(let n=_(this,Ut);!(!se(this,Ms,eb).call(this,n)||((t||!_(this,An).call(this,n))&&(yield n),n===_(this,Jt)));)n=_(this,Cn)[n]},ur=new WeakSet,xo=function*({allowStale:t=this.allowStale}={}){if(_(this,_t))for(let n=_(this,Jt);!(!se(this,Ms,eb).call(this,n)||((t||!_(this,An).call(this,n))&&(yield n),n===_(this,Ut)));)n=_(this,ln)[n]},Ms=new WeakSet,eb=function(t){return t!==void 0&&_(this,Pt).get(_(this,Ke)[t])===t},WO=new WeakSet,Jd=function(t){var o,a;const n=_(this,Jt),i=_(this,Ke)[n],r=_(this,ge)[n];return _(this,yo)&&se(this,Le,et).call(this,r)?r.__abortController.abort(new Error("evicted")):(_(this,Ei)||_(this,sn))&&(_(this,Ei)&&((o=_(this,Ri))==null||o.call(this,r,i,"evict")),_(this,sn)&&((a=_(this,Et))==null||a.push([r,i,"evict"]))),_(this,ma).call(this,n),t&&(_(this,Ke)[n]=void 0,_(this,ge)[n]=void 0,_(this,qi).push(n)),_(this,_t)===1?(de(this,Jt,de(this,Ut,0)),_(this,qi).length=0):de(this,Jt,_(this,ln)[n]),_(this,Pt).delete(i),Kd(this,_t)._--,n},qO=new WeakSet,eh=function(t,n,i,r){const o=n===void 0?void 0:_(this,ge)[n];if(se(this,Le,et).call(this,o))return o;const a=new Ac,{signal:O}=i;O==null||O.addEventListener("abort",()=>a.abort(O.reason),{signal:a.signal});const l={signal:a.signal,options:i,context:r},s=(Q,$=!1)=>{const{aborted:g}=a.signal,b=i.ignoreFetchAbort&&Q!==void 0;if(i.status&&(g&&!$?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,b&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),g&&!b&&!$)return c(a.signal.reason);const P=h;return _(this,ge)[n]===h&&(Q===void 0?P.__staleWhileFetching?_(this,ge)[n]=P.__staleWhileFetching:this.delete(t):(i.status&&(i.status.fetchUpdated=!0),this.set(t,Q,l.options))),Q},u=Q=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=Q),c(Q)),c=Q=>{const{aborted:$}=a.signal,g=$&&i.allowStaleOnFetchAbort,b=g||i.allowStaleOnFetchRejection,P=b||i.noDeleteOnFetchRejection,k=h;if(_(this,ge)[n]===h&&(!P||k.__staleWhileFetching===void 0?this.delete(t):g||(_(this,ge)[n]=k.__staleWhileFetching)),b)return i.status&&k.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),k.__staleWhileFetching;if(k.__returned===k)throw Q},f=(Q,$)=>{var b;const g=(b=_(this,RO))==null?void 0:b.call(this,t,o,l);g&&g instanceof Promise&&g.then(P=>Q(P===void 0?void 0:P),$),a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(Q(void 0),i.allowStaleOnFetchAbort&&(Q=P=>s(P,!0)))})};i.status&&(i.status.fetchDispatched=!0);const h=new Promise(f).then(s,u),p=Object.assign(h,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return n===void 0?(this.set(t,p,{...l.options,status:void 0}),n=_(this,Pt).get(t)):_(this,ge)[n]=p,p},Le=new WeakSet,et=function(t){if(!_(this,yo))return!1;const n=t;return!!n&&n instanceof Promise&&n.hasOwnProperty("__staleWhileFetching")&&n.__abortController instanceof Ac},Bs=new WeakSet,tb=function(t,n){_(this,Cn)[n]=t,_(this,ln)[t]=n},ga=new WeakSet,nu=function(t){t!==_(this,Ut)&&(t===_(this,Jt)?de(this,Jt,_(this,ln)[t]):se(this,Bs,tb).call(this,_(this,Cn)[t],_(this,ln)[t]),se(this,Bs,tb).call(this,_(this,Ut),t),de(this,Ut,t))};let ig=MQ;const Ic=new ig({max:1e3,ttl:6e5}),O9=e=>{const t=m.inject("theme"),n=m.inject("rootRef"),{editorExtensions:i,editorExtensionsAttrs:r,mermaidConfig:o}=ot,a=m.shallowRef(i.mermaid.instance),O=m.shallowRef(-1),l=()=>{const u=a.value;!e.noMermaid&&u&&(u.initialize(o({startOnLoad:!1,theme:t.value==="dark"?"dark":"default"})),O.value=O.value+1)};return m.watch(()=>t.value,()=>{Ic.clear(),l()}),m.onMounted(()=>{var c,f;if(e.noMermaid||a.value)return;const u=i.mermaid.js;/\.mjs/.test(u)?(un("link",{...(c=r.mermaid)==null?void 0:c.js,rel:"modulepreload",href:u,id:`${z}-mermaid-m`}),import(u).then(h=>{a.value=h.default,l()})):un("script",{...(f=r.mermaid)==null?void 0:f.js,src:u,id:`${z}-mermaid`,onload(){a.value=window.mermaid,l()}},"mermaid")}),{mermaidRef:a,reRenderRef:O,replaceMermaid:()=>{m.nextTick(()=>{if(!e.noMermaid&&a.value){const u=n.value.querySelectorAll(`div.${z}-mermaid`),c=document.createElement("div");c.style.width=document.body.offsetWidth+"px",c.style.height=document.body.offsetHeight+"px",c.style.position="fixed",c.style.zIndex="-10000",c.style.top="-10000";let f=u.length;f>0&&document.body.appendChild(c),u.forEach(async h=>{let p=Ic.get(h.innerText);if(!p){const $=ih(),g=a.value.renderAsync||a.value.render;let b="";try{b=await g($,h.innerText,c)}catch{}p=await e.sanitizeMermaid(typeof b=="string"?b:b.svg)}const Q=document.createElement("p");Q.className=`${z}-mermaid`,Q.setAttribute("data-processed",""),Q.innerHTML=p,Q.children[0].removeAttribute("height"),Ic.set(h.innerText,Q.innerHTML),h.dataset.line!==void 0&&(Q.dataset.line=h.dataset.line),h.replaceWith(Q),--f===0&&c.remove()})}})}}},l9=e=>{const t=m.shallowRef(ot.editorExtensions.katex.instance);return m.onMounted(()=>{if(e.noKatex||t.value)return;const{editorExtensions:n}=ot;un("script",{src:n.katex.js,id:`${z}-katex`,onload(){t.value=window.katex}},"katex"),un("link",{rel:"stylesheet",href:n.katex.css,id:`${z}-katexCss`})}),t},s9=(e,t)=>{const n=e.renderer.rules.fence.bind(e.renderer.rules);e.renderer.rules.fence=(i,r,o,a,O)=>{const l=i[r],s=l.content.trim();if(l.info==="mermaid"){let u;i[r].map&&i[r].level===0&&(u=i[r].map[0],i[r].attrSet("data-line",String(u)));const c=Ic.get(s);return c?`<p class="${z}-mermaid" ${u!==void 0?"data-line="+u:""} data-processed>${c}</p>`:`<div class="${z}-mermaid" ${u!==void 0?"data-line="+u:""} data-mermaid-theme=${t.themeRef.value}>${s}</div>`}return n(i,r,o,a,O)}},Dc=(e,t)=>{const n=e.attrs?e.attrs.slice():[];return t.forEach(i=>{const r=e.attrIndex(i[0]);r<0?n.push(i):(n[r]=n[r].slice(),n[r][1]+=` ${i[1]}`)}),n},u9=(e,t)=>{const n=[{open:"$",close:"$"},{open:"\\(",close:"\\)"}];let i,r,o;for(const a of n)if(e.src.startsWith(a.open,e.pos)){const O=e.pos+a.open.length;for(i=O;(i=e.src.indexOf(a.close,i))!==-1;){for(o=i-1;e.src[o]==="\\";)o-=1;if((i-o)%2==1)break;i+=a.close.length}return i===-1?(t||(e.pending+=a.open),e.pos=O,!0):i-O===0?(t||(e.pending+=a.open+a.close),e.pos=O+a.close.length,!0):(t||(r=e.push("math_inline","math",0),r.markup=a.open,r.content=e.src.slice(O,i)),e.pos=i+a.close.length,!0)}return!1},c9=(e,t,n,i)=>{const r=[{open:"$$",close:"$$"},{open:"\\[",close:"\\]"}];let o,a,O,l,s=!1,u=e.bMarks[t]+e.tShift[t],c=e.eMarks[t];for(const f of r){if(u+f.open.length>c||e.src.slice(u,u+f.open.length)!==f.open)continue;if(u+=f.open.length,o=e.src.slice(u,c),i)return!0;for(o.trim().slice(-f.close.length)===f.close&&(o=o.trim().slice(0,-f.close.length),s=!0),O=t;!s&&(O++,!(O>=n||(u=e.bMarks[O]+e.tShift[O],c=e.eMarks[O],u<c&&e.tShift[O]<e.blkIndent)));)e.src.slice(u,c).trim().slice(-f.close.length)===f.close&&(l=e.src.slice(0,c).lastIndexOf(f.close),a=e.src.slice(u,l),s=!0);e.line=O+1;const h=e.push("math_block","math",0);return h.block=!0,h.content=(o&&o.trim()?o+`
|
|
114
114
|
`:"")+e.getLines(t+1,O,e.tShift[t],!0)+(a&&a.trim()?a:""),h.map=[t,e.line],h.markup=f.open,!0}return!1},f9=(e,{katexRef:t})=>{const n=(r,o,a,O,l)=>{const s=r[o],u={attrs:Dc(s,[["class",`${z}-katex-inline`]])};if(t.value){const c=t.value.renderToString(s.content,ot.katexConfig({throwOnError:!1}));return`<span ${l.renderAttrs(u)} data-processed>${c}</span>`}else return`<span ${l.renderAttrs(u)}>${s.content}</span>`},i=(r,o,a,O,l)=>{const s=r[o],u={attrs:Dc(s,[["class",`${z}-katex-block`]])};if(t.value){const c=t.value.renderToString(s.content,ot.katexConfig({throwOnError:!1,displayMode:!0}));return`<p ${l.renderAttrs(u)} data-processed>${c}</p>`}else return`<p ${l.renderAttrs(u)}>${s.content}</p>`};e.inline.ruler.before("escape","math_inline",u9),e.block.ruler.after("blockquote","math_block",c9,{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.math_inline=n,e.renderer.rules.math_block=i},d9=(e,t)=>{t=t||{};const n=3,i=t.marker||"!",r=i.charCodeAt(0),o=i.length;let a="",O="";const l=(u,c,f,h,p)=>{const Q=u[c];return Q.type==="admonition_open"?u[c].attrPush(["class",`${z}-admonition ${z}-admonition-${Q.info}`]):Q.type==="admonition_title_open"&&u[c].attrPush(["class",`${z}-admonition-title`]),p.renderToken(u,c,f)},s=u=>{const c=u.trim().split(" ",2);O="",a=c[0],c.length>1&&(O=u.substring(a.length+2))};e.block.ruler.before("code","admonition",(u,c,f,h)=>{let p,Q,$,g=!1,b=u.bMarks[c]+u.tShift[c],P=u.eMarks[c];if(r!==u.src.charCodeAt(b))return!1;for(p=b+1;p<=P&&i[(p-b)%o]===u.src[p];p++);const k=Math.floor((p-b)/o);if(k!==n)return!1;p-=(p-b)%o;const y=u.src.slice(b,p),X=u.src.slice(p,P);if(s(X),h)return!0;for(Q=c;Q++,!(Q>=f||(b=u.bMarks[Q]+u.tShift[Q],P=u.eMarks[Q],b<P&&u.sCount[Q]<u.blkIndent));)if(r===u.src.charCodeAt(b)&&!(u.sCount[Q]-u.blkIndent>=4)){for(p=b+1;p<=P&&i[(p-b)%o]===u.src[p];p++);if(!(Math.floor((p-b)/o)<k)&&(p-=(p-b)%o,p=u.skipSpaces(p),!(p<P))){g=!0;break}}const x=u.parentType,v=u.lineMax;return u.parentType="root",u.lineMax=Q,$=u.push("admonition_open","div",1),$.markup=y,$.block=!0,$.info=a,$.map=[c,Q],O&&($=u.push("admonition_title_open","p",1),$.markup=y+" "+a,$.map=[c,Q],$=u.push("inline","",0),$.content=O,$.map=[c,u.line-1],$.children=[],$=u.push("admonition_title_close","p",-1),$.markup=y+" "+a),u.md.block.tokenize(u,c+1,Q),$=u.push("admonition_close","div",-1),$.markup=u.src.slice(b,p),$.block=!0,u.parentType=x,u.lineMax=v,u.line=Q+(g?1:0),!0},{alt:["paragraph","reference","blockquote","list"]}),e.renderer.rules.admonition_open=l,e.renderer.rules.admonition_title_open=l,e.renderer.rules.admonition_title_close=l,e.renderer.rules.admonition_close=l},h9=(e,t)=>{e.renderer.rules.heading_open=(n,i)=>{var O;const r=n[i],o=((O=n[i+1].children)==null?void 0:O.reduce((l,s)=>l+(["text","code_inline"].includes(s.type)&&s.content||""),""))||"",a=r.markup.length;return t.headsRef.value.push({text:o,level:a}),r.map&&r.level===0&&r.attrSet("id",t.mdHeadingId(o,a,t.headsRef.value.length)),e.renderer.renderToken(n,i,t)},e.renderer.rules.heading_close=(n,i,r,o,a)=>a.renderToken(n,i,r)},Jx=(e,t)=>{if(typeof t[e]=="string")return t[e];const n=`<i class="${z}-iconfont ${z}-icon-${e}"></i>`;switch(ot.iconfontType){case"svg":return`<svg class="${z}-icon" aria-hidden="true"><use xlink:href="#${z}-icon-${e}"></use></svg>`;default:return n}},p9=(e,t)=>{const n=e.renderer.rules.fence,i=e.utils.unescapeAll,r=/\[(\w*)(?::([\w ]*))?\]/,o=/::(open|close)/,a=c=>c.info?i(c.info).trim():"",O=c=>{const f=a(c),[h=null,p=""]=(r.exec(f)||[]).slice(1);return[h,p]},l=c=>{const f=a(c);return f?f.split(/(\s+)/g)[0]:""},s=c=>{const f=c.info.match(o)||[],h=f[1]==="open"||f[1]!=="close"&&t.codeFoldable&&c.content.trim().split(`
|
|
115
115
|
`).length<t.autoFoldThreshold,p=f[1]||t.codeFoldable?"details":"div",Q=f[1]||t.codeFoldable?"summary":"div";return{open:h,tagContainer:p,tagHeader:Q}},u=(c,f,h,p,Q)=>{var E;if(c[f].hidden)return"";const $=(E=t.usedLanguageTextRef.value)==null?void 0:E.copyCode.text,g=t.customIconRef.value.copy||$,b=!!t.customIconRef.value.copy,P=`<span class="${z}-collapse-tips">${Jx("collapse-tips",t.customIconRef.value)}</span>`,[k]=O(c[f]);if(k===null){const{open:I,tagContainer:N,tagHeader:A}=s(c[f]),L=[["class",`${z}-code`]];I&&L.push(["open",""]);const J={attrs:Dc(c[f],L)};c[f].info=c[f].info.replace(o,"");const Oe=n(c,f,h,p,Q);return`<${N} ${Q.renderAttrs(J)}>
|
|
116
116
|
<${A} class="${z}-code-head">
|