import{d as Ee}from"./entities.48a44fec.js";import{L as qe}from"./linkify-it.c76d7176.js";import{p as ye}from"./punycode.js.4b3f125a.js";const fe={};function Ne(e){let n=fe[e];if(n)return n;n=fe[e]=[];for(let r=0;r<128;r++){const i=String.fromCharCode(r);n.push(i)}for(let r=0;r=55296&&h<=57343?o+="\uFFFD\uFFFD\uFFFD":o+=String.fromCharCode(h),t+=6;continue}}if((l&248)===240&&t+91114111?o+="\uFFFD\uFFFD\uFFFD\uFFFD":(p-=65536,o+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),t+=9;continue}}o+="\uFFFD"}return o})}R.defaultChars=";/?:@&=+$,#";R.componentChars="";const he={};function Ue(e){let n=he[e];if(n)return n;n=he[e]=[];for(let r=0;r<128;r++){const i=String.fromCharCode(r);/^[0-9a-z]$/i.test(i)?n.push(i):n.push("%"+("0"+r.toString(16).toUpperCase()).slice(-2))}for(let r=0;r=55296&&l<=57343){if(l>=55296&&l<=56319&&t+1=56320&&s<=57343){o+=encodeURIComponent(e[t]+e[t+1]),t++;continue}}o+="%EF%BF%BD";continue}o+=encodeURIComponent(e[t])}return o}N.defaultChars=";/?:@&=+$,-_.!~*'()#";N.componentChars="-_.!~*'()";function te(e){let n="";return n+=e.protocol||"",n+=e.slashes?"//":"",n+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?n+="["+e.hostname+"]":n+=e.hostname||"",n+=e.port?":"+e.port:"",n+=e.pathname||"",n+=e.search||"",n+=e.hash||"",n}function W(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Ze=/^([a-z0-9.+-]+:)/i,He=/:[0-9]*$/,Ge=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,We=["<",">",'"',"`"," ","\r",` `," "],Qe=["{","}","|","\\","^","`"].concat(We),Je=["'"].concat(Qe),pe=["%","/","?",";","#"].concat(Je),ae=["/","?","#"],Ve=255,de=/^[+a-z0-9A-Z_-]{0,63}$/,Xe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ke={javascript:!0,"javascript:":!0},De={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function oe(e,n){if(e&&e instanceof W)return e;const r=new W;return r.parse(e,n),r}W.prototype.parse=function(e,n){let r,i,o,t=e;if(t=t.trim(),!n&&e.split("#").length===1){const c=Ge.exec(t);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let u=Ze.exec(t);if(u&&(u=u[0],r=u.toLowerCase(),this.protocol=u,t=t.substr(u.length)),(n||u||t.match(/^\/\/[^@\/]+@[^@\/]+/))&&(o=t.substr(0,2)==="//",o&&!(u&&ke[u])&&(t=t.substr(2),this.slashes=!0)),!ke[u]&&(o||u&&!De[u])){let c=-1;for(let f=0;f127?k+="x":k+=_[x];if(!k.match(de)){const x=f.slice(0,m),D=f.slice(m+1),C=_.match(Xe);C&&(x.push(C[1]),D.unshift(C[2])),D.length&&(t=D.join(".")+t),this.hostname=x.join(".");break}}}}this.hostname.length>Ve&&(this.hostname=""),a&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const l=t.indexOf("#");l!==-1&&(this.hash=t.substr(l),t=t.slice(0,l));const s=t.indexOf("?");return s!==-1&&(this.search=t.substr(s),t=t.slice(0,s)),t&&(this.pathname=t),De[r]&&this.hostname&&!this.pathname&&(this.pathname=""),this};W.prototype.parseHost=function(e){let n=He.exec(e);n&&(n=n[0],n!==":"&&(this.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(this.hostname=e)};var Ye=Object.freeze(Object.defineProperty({__proto__:null,decode:R,encode:N,format:te,parse:oe},Symbol.toStringTag,{value:"Module"})),Ke=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,en=/[\0-\x1F\x7F-\x9F]/,nn=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Se=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA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xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uA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E80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,rn=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,tn=Object.freeze(Object.defineProperty({__proto__:null,Any:Ke,Cc:en,Cf:nn,P:Se,S:Be,Z:rn},Symbol.toStringTag,{value:"Module"}));function on(e){return Object.prototype.toString.call(e)}function ie(e){return on(e)==="[object String]"}const un=Object.prototype.hasOwnProperty;function ln(e,n){return un.call(e,n)}function J(e){return Array.prototype.slice.call(arguments,1).forEach(function(r){if(!!r){if(typeof r!="object")throw new TypeError(r+"must be object");Object.keys(r).forEach(function(i){e[i]=r[i]})}}),e}function Me(e,n,r){return[].concat(e.slice(0,n),r,e.slice(n+1))}function ue(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function Q(e){if(e>65535){e-=65536;const n=55296+(e>>10),r=56320+(e&1023);return String.fromCharCode(n,r)}return String.fromCharCode(e)}const we=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,sn=/&([a-z#][a-z0-9]{1,31});/gi,cn=new RegExp(we.source+"|"+sn.source,"gi"),fn=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function hn(e,n){if(n.charCodeAt(0)===35&&fn.test(n)){const i=n[1].toLowerCase()==="x"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return ue(i)?Q(i):e}const r=Ee(e);return r!==e?r:e}function pn(e){return e.indexOf("\\")<0?e:e.replace(we,"$1")}function O(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(cn,function(n,r,i){return r||hn(n,i)})}const an=/[&<>"]/,dn=/[&<>"]/g,kn={"&":"&","<":"<",">":">",'"':"""};function Dn(e){return kn[e]}function I(e){return an.test(e)?e.replace(dn,Dn):e}const xn=/[.?*+^$[\]\\(){}|-]/g;function Cn(e){return e.replace(xn,"\\$&")}function A(e){switch(e){case 9:case 32:return!0}return!1}function $(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function j(e){return Se.test(e)||Be.test(e)}function q(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function V(e){return e=e.trim().replace(/\s+/g," "),"\u1E9E".toLowerCase()==="\u1E7E"&&(e=e.replace(/ẞ/g,"\xDF")),e.toLowerCase().toUpperCase()}const mn={mdurl:Ye,ucmicro:tn};var Fn=Object.freeze(Object.defineProperty({__proto__:null,lib:mn,assign:J,isString:ie,has:ln,unescapeMd:pn,unescapeAll:O,isValidEntityCode:ue,fromCodePoint:Q,escapeHtml:I,arrayReplaceAt:Me,isSpace:A,isWhiteSpace:$,isMdAsciiPunct:q,isPunctChar:j,escapeRE:Cn,normalizeReference:V},Symbol.toStringTag,{value:"Module"}));function gn(e,n,r){let i,o,t,u;const l=e.posMax,s=e.pos;for(e.pos=n+1,i=1;e.pos32))return t;if(i===41){if(u===0)break;u--}o++}return n===o||u!==0||(t.str=O(e.slice(n,o)),t.pos=o,t.ok=!0),t}function An(e,n,r,i){let o,t=n;const u={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(i)u.str=i.str,u.marker=i.marker;else{if(t>=r)return u;let l=e.charCodeAt(t);if(l!==34&&l!==39&&l!==40)return u;n++,t++,l===40&&(l=41),u.marker=l}for(;t"+I(t.content)+""};M.code_block=function(e,n,r,i,o){const t=e[n];return""+I(e[n].content)+` `};M.fence=function(e,n,r,i,o){const t=e[n],u=t.info?O(t.info).trim():"";let l="",s="";if(u){const h=u.split(/(\s+)/g);l=h[0],s=h.slice(2).join("")}let c;if(r.highlight?c=r.highlight(t.content,l,s)||I(t.content):c=I(t.content),c.indexOf("${c} `}return`
${c}
`};M.image=function(e,n,r,i,o){const t=e[n];return t.attrs[t.attrIndex("alt")][1]=o.renderInlineAsText(t.children,r,i),o.renderToken(e,n,r)};M.hardbreak=function(e,n,r){return r.xhtmlOut?`
`:`
`};M.softbreak=function(e,n,r){return r.breaks?r.xhtmlOut?`
`:`
`:` `};M.text=function(e,n){return I(e[n].content)};M.html_block=function(e,n){return e[n].content};M.html_inline=function(e,n){return e[n].content};function z(){this.rules=J({},M)}z.prototype.renderAttrs=function(n){let r,i,o;if(!n.attrs)return"";for(o="",r=0,i=n.attrs.length;r `:">",t};z.prototype.renderInline=function(e,n,r){let i="";const o=this.rules;for(let t=0,u=e.length;t=0&&(i=this.attrs[r][1]),i};B.prototype.attrJoin=function(n,r){const i=this.attrIndex(n);i<0?this.attrPush([n,r]):this.attrs[i][1]=this.attrs[i][1]+" "+r};function Te(e,n,r){this.src=e,this.env=r,this.tokens=[],this.inlineMode=!1,this.md=n}Te.prototype.Token=B;const En=/\r\n?|\n/g,yn=/\0/g;function Sn(e){let n;n=e.src.replace(En,` `),n=n.replace(yn,"\uFFFD"),e.src=n}function Bn(e){let n;e.inlineMode?(n=new e.Token("inline","",0),n.content=e.src,n.map=[0,1],n.children=[],e.tokens.push(n)):e.md.block.parse(e.src,e.md,e.env,e.tokens)}function Mn(e){const n=e.tokens;for(let r=0,i=n.length;r\s]/i.test(e)}function Tn(e){return/^<\/a\s*>/i.test(e)}function In(e){const n=e.tokens;if(!!e.md.options.linkify)for(let r=0,i=n.length;r=0;u--){const l=o[u];if(l.type==="link_close"){for(u--;o[u].level!==l.level&&o[u].type!=="link_open";)u--;continue}if(l.type==="html_inline"&&(wn(l.content)&&t>0&&t--,Tn(l.content)&&t++),!(t>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const s=l.content;let c=e.md.linkify.match(s);const h=[];let p=l.level,d=0;c.length>0&&c[0].index===0&&u>0&&o[u-1].type==="text_special"&&(c=c.slice(1));for(let a=0;ad){const C=new e.Token("text","",0);C.content=s.slice(d,_),C.level=p,h.push(C)}const k=new e.Token("link_open","a",1);k.attrs=[["href",m]],k.level=p++,k.markup="linkify",k.info="auto",h.push(k);const x=new e.Token("text","",0);x.content=F,x.level=p,h.push(x);const D=new e.Token("link_close","a",-1);D.level=--p,D.markup="linkify",D.info="auto",h.push(D),d=c[a].lastIndex}if(d=0;r--){const i=e[r];i.type==="text"&&!n&&(i.content=i.content.replace(Pn,On)),i.type==="link_open"&&i.info==="auto"&&n--,i.type==="link_close"&&i.info==="auto"&&n++}}function Ln(e){let n=0;for(let r=e.length-1;r>=0;r--){const i=e[r];i.type==="text"&&!n&&Ie.test(i.content)&&(i.content=i.content.replace(/\+-/g,"\xB1").replace(/\.{2,}/g,"\u2026").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1\u2014").replace(/(^|\s)--(?=\s|$)/mg,"$1\u2013").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1\u2013")),i.type==="link_open"&&i.info==="auto"&&n--,i.type==="link_close"&&i.info==="auto"&&n++}}function $n(e){let n;if(!!e.md.options.typographer)for(n=e.tokens.length-1;n>=0;n--)e.tokens[n].type==="inline"&&(vn.test(e.tokens[n].content)&&zn(e.tokens[n].children),Ie.test(e.tokens[n].content)&&Ln(e.tokens[n].children))}const jn=/['"]/,xe=/['"]/g,Ce="\u2019";function H(e,n,r){return e.slice(0,n)+r+e.slice(n+1)}function qn(e,n){let r;const i=[];for(let o=0;o=0&&!(i[r].level<=u);r--);if(i.length=r+1,t.type!=="text")continue;let l=t.content,s=0,c=l.length;e:for(;s=0)f=l.charCodeAt(h.index-1);else for(r=o-1;r>=0&&!(e[r].type==="softbreak"||e[r].type==="hardbreak");r--)if(!!e[r].content){f=e[r].content.charCodeAt(e[r].content.length-1);break}let m=32;if(s=48&&f<=57&&(d=p=!1),p&&d&&(p=F,d=_),!p&&!d){a&&(t.content=H(t.content,h.index,Ce));continue}if(d)for(r=i.length-1;r>=0;r--){let D=i[r];if(i[r].level=0;n--)e.tokens[n].type!=="inline"||!jn.test(e.tokens[n].content)||qn(e.tokens[n].children,e)}function Un(e){let n,r;const i=e.tokens,o=i.length;for(let t=0;t0&&this.level++,this.tokens.push(i),i};w.prototype.isEmpty=function(n){return this.bMarks[n]+this.tShift[n]>=this.eMarks[n]};w.prototype.skipEmptyLines=function(n){for(let r=this.lineMax;nr;)if(!A(this.src.charCodeAt(--n)))return n+1;return n};w.prototype.skipChars=function(n,r){for(let i=this.src.length;ni;)if(r!==this.src.charCodeAt(--n))return n+1;return n};w.prototype.getLines=function(n,r,i,o){if(n>=r)return"";const t=new Array(r-n);for(let u=0,l=n;li?t[u]=new Array(s-i+1).join(" ")+this.src.slice(h,p):t[u]=this.src.slice(h,p)}return t.join("")};w.prototype.Token=B;const Zn=65536;function ee(e,n){const r=e.bMarks[n]+e.tShift[n],i=e.eMarks[n];return e.src.slice(r,i)}function me(e){const n=[],r=e.length;let i=0,o=e.charCodeAt(i),t=!1,u=0,l="";for(;ir)return!1;let o=n+1;if(e.sCount[o]=4)return!1;let t=e.bMarks[o]+e.tShift[o];if(t>=e.eMarks[o])return!1;const u=e.src.charCodeAt(t++);if(u!==124&&u!==45&&u!==58||t>=e.eMarks[o])return!1;const l=e.src.charCodeAt(t++);if(l!==124&&l!==45&&l!==58&&!A(l)||u===45&&A(l))return!1;for(;t=4)return!1;c=me(s),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const p=c.length;if(p===0||p!==h.length)return!1;if(i)return!0;const d=e.parentType;e.parentType="table";const a=e.md.block.ruler.getRules("blockquote"),f=e.push("table_open","table",1),m=[n,0];f.map=m;const F=e.push("thead_open","thead",1);F.map=[n,n+1];const _=e.push("tr_open","tr",1);_.map=[n,n+1];for(let D=0;D=4||(c=me(s),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),x+=p-c.length,x>Zn))break;if(o===n+2){const g=e.push("tbody_open","tbody",1);g.map=k=[n+2,0]}const C=e.push("tr_open","tr",1);C.map=[o,o+1];for(let g=0;g=4){i++,o=i;continue}break}e.line=o;const t=e.push("code_block","code",0);return t.content=e.getLines(n,o,4+e.blkIndent,!1)+` `,t.map=[n,e.line],!0}function Wn(e,n,r,i){let o=e.bMarks[n]+e.tShift[n],t=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||o+3>t)return!1;const u=e.src.charCodeAt(o);if(u!==126&&u!==96)return!1;let l=o;o=e.skipChars(o,u);let s=o-l;if(s<3)return!1;const c=e.src.slice(l,o),h=e.src.slice(o,t);if(u===96&&h.indexOf(String.fromCharCode(u))>=0)return!1;if(i)return!0;let p=n,d=!1;for(;p++,!(p>=r||(o=l=e.bMarks[p]+e.tShift[p],t=e.eMarks[p],o=4)&&(o=e.skipChars(o,u),!(o-l=4||e.src.charCodeAt(o)!==62)return!1;if(i)return!0;const l=[],s=[],c=[],h=[],p=e.md.block.ruler.getRules("blockquote"),d=e.parentType;e.parentType="blockquote";let a=!1,f;for(f=n;f=t)break;if(e.src.charCodeAt(o++)===62&&!x){let C=e.sCount[f]+1,g,b;e.src.charCodeAt(o)===32?(o++,C++,b=!1,g=!0):e.src.charCodeAt(o)===9?(g=!0,(e.bsCount[f]+C)%4===3?(o++,C++,b=!1):b=!0):g=!1;let y=C;for(l.push(e.bMarks[f]),e.bMarks[f]=o;o=t,s.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(g?1:0),c.push(e.sCount[f]),e.sCount[f]=y-C,h.push(e.tShift[f]),e.tShift[f]=o-e.bMarks[f];continue}if(a)break;let D=!1;for(let C=0,g=p.length;C";const _=[n,0];F.map=_,e.md.block.tokenize(e,n,f);const k=e.push("blockquote_close","blockquote",-1);k.markup=">",e.lineMax=u,e.parentType=d,_[1]=e.line;for(let x=0;x=4)return!1;let t=e.bMarks[n]+e.tShift[n];const u=e.src.charCodeAt(t++);if(u!==42&&u!==45&&u!==95)return!1;let l=1;for(;t=i)return-1;let t=e.src.charCodeAt(o++);if(t<48||t>57)return-1;for(;;){if(o>=i)return-1;if(t=e.src.charCodeAt(o++),t>=48&&t<=57){if(o-r>=10)return-1;continue}if(t===41||t===46)break;return-1}return o=4||e.listIndent>=0&&e.sCount[s]-e.listIndent>=4&&e.sCount[s]=e.blkIndent&&(h=!0);let p,d,a;if((a=ge(e,s))>=0){if(p=!0,u=e.bMarks[s]+e.tShift[s],d=Number(e.src.slice(u,a-1)),h&&d!==1)return!1}else if((a=Fe(e,s))>=0)p=!1;else return!1;if(h&&e.skipSpaces(a)>=e.eMarks[s])return!1;if(i)return!0;const f=e.src.charCodeAt(a-1),m=e.tokens.length;p?(l=e.push("ordered_list_open","ol",1),d!==1&&(l.attrs=[["start",d]])):l=e.push("bullet_list_open","ul",1);const F=[s,0];l.map=F,l.markup=String.fromCharCode(f);let _=!1;const k=e.md.block.ruler.getRules("list"),x=e.parentType;for(e.parentType="list";s=o?b=1:b=C-D,b>4&&(b=1);const y=D+b;l=e.push("list_item_open","li",1),l.markup=String.fromCharCode(f);const T=[s,0];l.map=T,p&&(l.info=e.src.slice(u,a-1));const L=e.tight,Y=e.tShift[s],Le=e.sCount[s],$e=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=y,e.tight=!0,e.tShift[s]=g-e.bMarks[s],e.sCount[s]=C,g>=o&&e.isEmpty(s+1)?e.line=Math.min(e.line+2,r):e.md.block.tokenize(e,s,r,!0),(!e.tight||_)&&(c=!1),_=e.line-s>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=$e,e.tShift[s]=Y,e.sCount[s]=Le,e.tight=L,l=e.push("list_item_close","li",-1),l.markup=String.fromCharCode(f),s=e.line,T[1]=s,s>=r||e.sCount[s]=4)break;let ce=!1;for(let v=0,je=k.length;v=4||e.src.charCodeAt(o)!==91)return!1;function l(k){const x=e.lineMax;if(k>=x||e.isEmpty(k))return null;let D=!1;if(e.sCount[k]-e.blkIndent>3&&(D=!0),e.sCount[k]<0&&(D=!0),!D){const b=e.md.block.ruler.getRules("reference"),y=e.parentType;e.parentType="reference";let T=!1;for(let L=0,Y=b.length;L`\\x00-\\x20]+",rr="'[^']*'",tr='"[^"]*"',or="(?:"+nr+"|"+rr+"|"+tr+")",ir="(?:\\s+"+er+"(?:\\s*=\\s*"+or+")?)",ve="<[A-Za-z][A-Za-z0-9\\-]*"+ir+"*\\s*\\/?>",Pe="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",ur="",lr="<[?][\\s\\S]*?[?]>",sr="]*>",cr="",fr=new RegExp("^(?:"+ve+"|"+Pe+"|"+ur+"|"+lr+"|"+sr+"|"+cr+")"),hr=new RegExp("^(?:"+ve+"|"+Pe+")"),P=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(hr.source+"\\s*$"),/^$/,!1]];function pr(e,n,r,i){let o=e.bMarks[n]+e.tShift[n],t=e.eMarks[n];if(e.sCount[n]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(o)!==60)return!1;let u=e.src.slice(o,t),l=0;for(;l=4)return!1;let u=e.src.charCodeAt(o);if(u!==35||o>=t)return!1;let l=1;for(u=e.src.charCodeAt(++o);u===35&&o6||oo&&A(e.src.charCodeAt(s-1))&&(t=s),e.line=n+1;const c=e.push("heading_open","h"+String(l),1);c.markup="########".slice(0,l),c.map=[n,e.line];const h=e.push("inline","",0);h.content=e.src.slice(o,t).trim(),h.map=[n,e.line],h.children=[];const p=e.push("heading_close","h"+String(l),-1);return p.markup="########".slice(0,l),!0}function dr(e,n,r){const i=e.md.block.ruler.getRules("paragraph");if(e.sCount[n]-e.blkIndent>=4)return!1;const o=e.parentType;e.parentType="paragraph";let t=0,u,l=n+1;for(;l3)continue;if(e.sCount[l]>=e.blkIndent){let a=e.bMarks[l]+e.tShift[l];const f=e.eMarks[l];if(a=f))){t=u===61?1:2;break}}if(e.sCount[l]<0)continue;let d=!1;for(let a=0,f=i.length;a3||e.sCount[t]<0)continue;let c=!1;for(let h=0,p=i.length;h=r||e.sCount[u]=t){e.line=r;break}const s=e.line;let c=!1;for(let h=0;h=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),u=e.line,u0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i};U.prototype.scanDelims=function(e,n){const r=this.posMax,i=this.src.charCodeAt(e),o=e>0?this.src.charCodeAt(e-1):32;let t=e;for(;t0)return!1;const r=e.pos,i=e.posMax;if(r+3>i||e.src.charCodeAt(r)!==58||e.src.charCodeAt(r+1)!==47||e.src.charCodeAt(r+2)!==47)return!1;const o=e.pending.match(Cr);if(!o)return!1;const t=o[1],u=e.md.linkify.matchAtStart(e.src.slice(r-t.length));if(!u)return!1;let l=u.url;if(l.length<=t.length)return!1;l=l.replace(/\*+$/,"");const s=e.md.normalizeLink(l);if(!e.md.validateLink(s))return!1;if(!n){e.pending=e.pending.slice(0,-t.length);const c=e.push("link_open","a",1);c.attrs=[["href",s]],c.markup="linkify",c.info="auto";const h=e.push("text","",0);h.content=e.md.normalizeLinkText(l);const p=e.push("link_close","a",-1);p.markup="linkify",p.info="auto"}return e.pos+=l.length-t.length,!0}function Fr(e,n){let r=e.pos;if(e.src.charCodeAt(r)!==10)return!1;const i=e.pending.length-1,o=e.posMax;if(!n)if(i>=0&&e.pending.charCodeAt(i)===32)if(i>=1&&e.pending.charCodeAt(i-1)===32){let t=i-1;for(;t>=1&&e.pending.charCodeAt(t-1)===32;)t--;e.pending=e.pending.slice(0,t),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(r++;r?@[]^_`{|}~-".split("").forEach(function(e){se[e.charCodeAt(0)]=1});function gr(e,n){let r=e.pos;const i=e.posMax;if(e.src.charCodeAt(r)!==92||(r++,r>=i))return!1;let o=e.src.charCodeAt(r);if(o===10){for(n||e.push("hardbreak","br",0),r++;r=55296&&o<=56319&&r+1=56320&&l<=57343&&(t+=e.src[r+1],r++)}const u="\\"+t;if(!n){const l=e.push("text_special","",0);o<256&&se[o]!==0?l.content=t:l.content=u,l.markup=u,l.info="escape"}return e.pos=r+1,!0}function _r(e,n){let r=e.pos;if(e.src.charCodeAt(r)!==96)return!1;const o=r;r++;const t=e.posMax;for(;r=0;i--){const o=n[i];if(o.marker!==95&&o.marker!==42||o.end===-1)continue;const t=n[o.end],u=i>0&&n[i-1].end===o.end+1&&n[i-1].marker===o.marker&&n[i-1].token===o.token-1&&n[o.end+1].token===t.token+1,l=String.fromCharCode(o.marker),s=e.tokens[o.token];s.type=u?"strong_open":"em_open",s.tag=u?"strong":"em",s.nesting=1,s.markup=u?l+l:l,s.content="";const c=e.tokens[t.token];c.type=u?"strong_close":"em_close",c.tag=u?"strong":"em",c.nesting=-1,c.markup=u?l+l:l,c.content="",u&&(e.tokens[n[i-1].token].content="",e.tokens[n[o.end+1].token].content="",i--)}}function yr(e){const n=e.tokens_meta,r=e.tokens_meta.length;Ae(e,e.delimiters);for(let i=0;i=p)return!1;if(s=f,o=e.md.helpers.parseLinkDestination(e.src,f,e.posMax),o.ok){for(u=e.md.normalizeLink(o.str),e.md.validateLink(u)?f=o.pos:u="",s=f;f=p||e.src.charCodeAt(f)!==41)&&(c=!0),f++}if(c){if(typeof e.env.references=="undefined")return!1;if(f=0?i=e.src.slice(s,f++):f=a+1):f=a+1,i||(i=e.src.slice(d,a)),t=e.env.references[V(i)],!t)return e.pos=h,!1;u=t.href,l=t.title}if(!n){e.pos=d,e.posMax=a;const m=e.push("link_open","a",1),F=[["href",u]];m.attrs=F,l&&F.push(["title",l]),e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=f,e.posMax=p,!0}function Br(e,n){let r,i,o,t,u,l,s,c,h="";const p=e.pos,d=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const a=e.pos+2,f=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(f<0)return!1;if(t=f+1,t=d)return!1;for(c=t,l=e.md.helpers.parseLinkDestination(e.src,t,e.posMax),l.ok&&(h=e.md.normalizeLink(l.str),e.md.validateLink(h)?t=l.pos:h=""),c=t;t=d||e.src.charCodeAt(t)!==41)return e.pos=p,!1;t++}else{if(typeof e.env.references=="undefined")return!1;if(t=0?o=e.src.slice(c,t++):t=f+1):t=f+1,o||(o=e.src.slice(a,f)),u=e.env.references[V(o)],!u)return e.pos=p,!1;h=u.href,s=u.title}if(!n){i=e.src.slice(a,f);const m=[];e.md.inline.parse(i,e.md,e.env,m);const F=e.push("image","img",0),_=[["src",h],["alt",""]];F.attrs=_,F.children=m,F.content=i,s&&_.push(["title",s])}return e.pos=t,e.posMax=d,!0}const Mr=/^([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])?)*)$/,wr=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function Tr(e,n){let r=e.pos;if(e.src.charCodeAt(r)!==60)return!1;const i=e.pos,o=e.posMax;for(;;){if(++r>=o)return!1;const u=e.src.charCodeAt(r);if(u===60)return!1;if(u===62)break}const t=e.src.slice(i+1,r);if(wr.test(t)){const u=e.md.normalizeLink(t);if(!e.md.validateLink(u))return!1;if(!n){const l=e.push("link_open","a",1);l.attrs=[["href",u]],l.markup="autolink",l.info="auto";const s=e.push("text","",0);s.content=e.md.normalizeLinkText(t);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=t.length+2,!0}if(Mr.test(t)){const u=e.md.normalizeLink("mailto:"+t);if(!e.md.validateLink(u))return!1;if(!n){const l=e.push("link_open","a",1);l.attrs=[["href",u]],l.markup="autolink",l.info="auto";const s=e.push("text","",0);s.content=e.md.normalizeLinkText(t);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=t.length+2,!0}return!1}function Ir(e){return/^\s]/i.test(e)}function vr(e){return/^<\/a\s*>/i.test(e)}function Pr(e){const n=e|32;return n>=97&&n<=122}function Rr(e,n){if(!e.md.options.html)return!1;const r=e.posMax,i=e.pos;if(e.src.charCodeAt(i)!==60||i+2>=r)return!1;const o=e.src.charCodeAt(i+1);if(o!==33&&o!==63&&o!==47&&!Pr(o))return!1;const t=e.src.slice(i).match(fr);if(!t)return!1;if(!n){const u=e.push("html_inline","",0);u.content=t[0],Ir(u.content)&&e.linkLevel++,vr(u.content)&&e.linkLevel--}return e.pos+=t[0].length,!0}const Or=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,zr=/^&([a-z][a-z0-9]{1,31});/i;function Lr(e,n){const r=e.pos,i=e.posMax;if(e.src.charCodeAt(r)!==38||r+1>=i)return!1;if(e.src.charCodeAt(r+1)===35){const t=e.src.slice(r).match(Or);if(t){if(!n){const u=t[1][0].toLowerCase()==="x"?parseInt(t[1].slice(1),16):parseInt(t[1],10),l=e.push("text_special","",0);l.content=ue(u)?Q(u):Q(65533),l.markup=t[0],l.info="entity"}return e.pos+=t[0].length,!0}}else{const t=e.src.slice(r).match(zr);if(t){const u=Ee(t[0]);if(u!==t[0]){if(!n){const l=e.push("text_special","",0);l.content=u,l.markup=t[0],l.info="entity"}return e.pos+=t[0].length,!0}}}return!1}function be(e){const n={},r=e.length;if(!r)return;let i=0,o=-2;const t=[];for(let u=0;us;c-=t[c]+1){const p=e[c];if(p.marker===l.marker&&p.open&&p.end<0){let d=!1;if((p.close||l.open)&&(p.length+l.length)%3===0&&(p.length%3!==0||l.length%3!==0)&&(d=!0),!d){const a=c>0&&!e[c-1].open?t[c-1]+1:0;t[u]=u-c+a,t[c]=a,l.open=!1,p.end=u,p.close=!1,h=-1,o=-2;break}}}h!==-1&&(n[l.marker][(l.open?3:0)+(l.length||0)%3]=h)}}function $r(e){const n=e.tokens_meta,r=e.tokens_meta.length;be(e.delimiters);for(let i=0;i0&&i++,o[n].type==="text"&&n+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;u||e.pos++,t[n]=e.pos};Z.prototype.tokenize=function(e){const n=this.ruler.getRules(""),r=n.length,i=e.posMax,o=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(u){if(e.pos>=i)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()};Z.prototype.parse=function(e,n,r,i){const o=new this.State(e,n,r,i);this.tokenize(o);const t=this.ruler2.getRules(""),u=t.length;for(let l=0;l=0))try{n.hostname=ye.toASCII(n.hostname)}catch{}return N(te(n))}function Jr(e){const n=oe(e,!0);if(n.hostname&&(!n.protocol||ze.indexOf(n.protocol)>=0))try{n.hostname=ye.toUnicode(n.hostname)}catch{}return R(te(n),R.defaultChars+"%")}function S(e,n){if(!(this instanceof S))return new S(e,n);n||ie(e)||(n=e||{},e="default"),this.inline=new Z,this.block=new X,this.core=new le,this.renderer=new z,this.linkify=new qe,this.validateLink=Wr,this.normalizeLink=Qr,this.normalizeLinkText=Jr,this.utils=Fn,this.helpers=J({},bn),this.options={},this.configure(e),n&&this.set(n)}S.prototype.set=function(e){return J(this.options,e),this};S.prototype.configure=function(e){const n=this;if(ie(e)){const r=e;if(e=Zr[r],!e)throw new Error('Wrong `markdown-it` preset "'+r+'", check name')}if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach(function(r){e.components[r].rules&&n[r].ruler.enableOnly(e.components[r].rules),e.components[r].rules2&&n[r].ruler2.enableOnly(e.components[r].rules2)}),this};S.prototype.enable=function(e,n){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.enable(e,!0))},this),r=r.concat(this.inline.ruler2.enable(e,!0));const i=e.filter(function(o){return r.indexOf(o)<0});if(i.length&&!n)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+i);return this};S.prototype.disable=function(e,n){let r=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(function(o){r=r.concat(this[o].ruler.disable(e,!0))},this),r=r.concat(this.inline.ruler2.disable(e,!0));const i=e.filter(function(o){return r.indexOf(o)<0});if(i.length&&!n)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+i);return this};S.prototype.use=function(e){const n=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,n),this};S.prototype.parse=function(e,n){if(typeof e!="string")throw new Error("Input data should be a String");const r=new this.core.State(e,this,n);return this.core.process(r),r.tokens};S.prototype.render=function(e,n){return n=n||{},this.renderer.render(this.parse(e,n),this.options,n)};S.prototype.parseInline=function(e,n){const r=new this.core.State(e,this,n);return r.inlineMode=!0,this.core.process(r),r.tokens};S.prototype.renderInline=function(e,n){return n=n||{},this.renderer.render(this.parseInline(e,n),this.options,n)};export{S as M};