var we=Object.defineProperty;var me=(t,e,r)=>e in t?we(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var f=(t,e,r)=>me(t,typeof e!="symbol"?e+"":e,r);function H(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var T=H();function ae(t){T=t}var L={exec:()=>null};function g(t,e=""){let r=typeof t=="string"?t:t.source,s={replace:(n,i)=>{let c=typeof i=="string"?i:i.source;return c=c.replace(b.caret,"$1"),r=r.replace(n,c),s},getRegex:()=>new RegExp(r,e)};return s}var b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},ye=/^(?:[ \t]*(?:\n|$))+/,$e=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Se=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,v=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Re=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,G=/(?:[*+-]|\d{1,9}[.)])/,oe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ce=g(oe).replace(/bull/g,G).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Te=g(oe).replace(/bull/g,G).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),W=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ze=/^[^\n]+/,X=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ae=g(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",X).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_e=g(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,G).getRegex(),D="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",F=/|$))/,Pe=g("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",F).replace("tag",D).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he=g(W).replace("hr",v).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),Ie=g(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",he).getRegex(),U={blockquote:Ie,code:$e,def:Ae,fences:Se,heading:Re,hr:v,html:Pe,lheading:ce,list:_e,newline:ye,paragraph:he,table:L,text:ze},re=g("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",v).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex(),Le={...U,lheading:Te,table:re,paragraph:g(W).replace("hr",v).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex()},ve={...U,html:g(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",F).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:L,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:g(W).replace("hr",v).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",ce).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Be=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Ce=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pe=/^( {2,}|\\)\n(?!\s*$)/,qe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,ke=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Qe=g(ke,"u").replace(/punct/g,M).getRegex(),Ne=g(ke,"u").replace(/punct/g,ge).getRegex(),fe="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Oe=g(fe,"gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,J).replace(/punct/g,M).getRegex(),je=g(fe,"gu").replace(/notPunctSpace/g,De).replace(/punctSpace/g,Ze).replace(/punct/g,ge).getRegex(),He=g("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,J).replace(/punct/g,M).getRegex(),Ge=g(/\\(punct)/,"gu").replace(/punct/g,M).getRegex(),We=g(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[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])?)+(?![-_])/).getRegex(),Xe=g(F).replace("(?:-->|$)","-->").getRegex(),Fe=g("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Xe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,Ue=g(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),de=g(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",X).getRegex(),xe=g(/^!?\[(ref)\](?:\[\])?/).replace("ref",X).getRegex(),Je=g("reflink|nolink(?!\\()","g").replace("reflink",de).replace("nolink",xe).getRegex(),K={_backpedal:L,anyPunctuation:Ge,autolink:We,blockSkip:Me,br:pe,code:Ce,del:L,emStrongLDelim:Qe,emStrongRDelimAst:Oe,emStrongRDelimUnd:He,escape:Be,link:Ue,nolink:xe,punctuation:Ee,reflink:de,reflinkSearch:Je,tag:Fe,text:qe,url:L},Ke={...K,link:g(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:g(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()},N={...K,emStrongRDelimAst:je,emStrongLDelim:Ne,url:g(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},ne=t=>Ye[t];function m(t,e){if(e){if(b.escapeTest.test(t))return t.replace(b.escapeReplace,ne)}else if(b.escapeTestNoEncode.test(t))return t.replace(b.escapeReplaceNoEncode,ne);return t}function se(t){try{t=encodeURI(t).replace(b.percentDecode,"%")}catch{return null}return t}function le(t,e){var i;let r=t.replace(b.findPipe,(c,l,o)=>{let a=!1,p=l;for(;--p>=0&&o[p]==="\\";)a=!a;return a?"|":" |"}),s=r.split(b.splitPipe),n=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length0?-2:-1}function ie(t,e,r,s,n){let i=e.href,c=e.title||null,l=t[1].replace(n.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:t[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:c,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}function tt(t,e,r){let s=t.match(r.other.indentCodeCompensation);if(s===null)return e;let n=s[1];return e.split(` `).map(i=>{let c=i.match(r.other.beginningSpace);if(c===null)return i;let[l]=c;return l.length>=n.length?i.slice(n.length):i}).join(` `)}var E=class{constructor(t){f(this,"options");f(this,"rules");f(this,"lexer");this.options=t||T}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:P(r,` `)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let r=e[0],s=tt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=P(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:P(e[0],` `)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let r=P(e[0],` `).split(` `),s="",n="",i=[];for(;r.length>0;){let c=!1,l=[],o;for(o=0;o1,n={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let i=this.rules.other.listItemRegex(r),c=!1;for(;t;){let o=!1,a="",p="";if(!(e=i.exec(t))||this.rules.block.hr.test(t))break;a=e[0],t=t.substring(a.length);let k=e[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,z=>" ".repeat(3*z.length)),h=t.split(` `,1)[0],x=!k.trim(),u=0;if(this.options.pedantic?(u=2,p=k.trimStart()):x?u=e[1].length+1:(u=e[2].search(this.rules.other.nonSpaceChar),u=u>4?1:u,p=k.slice(u),u+=e[1].length),x&&this.rules.other.blankLine.test(h)&&(a+=h+` `,t=t.substring(h.length+1),o=!0),!o){let z=this.rules.other.nextBulletRegex(u),Y=this.rules.other.hrRegex(u),ee=this.rules.other.fencesBeginRegex(u),te=this.rules.other.headingBeginRegex(u),be=this.rules.other.htmlBeginRegex(u);for(;t;){let Q=t.split(` `,1)[0],A;if(h=Q,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),A=h):A=h.replace(this.rules.other.tabCharGlobal," "),ee.test(h)||te.test(h)||be.test(h)||z.test(h)||Y.test(h))break;if(A.search(this.rules.other.nonSpaceChar)>=u||!h.trim())p+=` `+A.slice(u);else{if(x||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ee.test(k)||te.test(k)||Y.test(k))break;p+=` `+h}!x&&!h.trim()&&(x=!0),a+=Q+` `,t=t.substring(Q.length+1),k=A.slice(u)}}n.loose||(c?n.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(c=!0));let w=null,S;this.options.gfm&&(w=this.rules.other.listIsTask.exec(p),w&&(S=w[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),n.items.push({type:"list_item",raw:a,task:!!w,checked:S,loose:!1,text:p,tokens:[]}),n.raw+=a}let l=n.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;n.raw=n.raw.trimEnd();for(let o=0;ok.type==="space"),p=a.length>0&&a.some(k=>this.rules.other.anyLine.test(k.raw));n.loose=p}if(n.loose)for(let o=0;o({text:o,tokens:this.lexer.inline(o),header:!1,align:i.align[a]})));return i}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let r=e[1].charAt(e[1].length-1)===` `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=P(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=et(e[2],"()");if(i===-2)return;if(i>-1){let c=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,c).trim(),e[3]=""}}let s=e[2],n="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],n=i[3])}else n=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),ie(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:n&&n.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let r;if((r=this.rules.inline.reflink.exec(t))||(r=this.rules.inline.nolink.exec(t))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),n=e[s.toLowerCase()];if(!n){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return ie(r,n,r[0],this.lexer,this.rules)}}emStrong(t,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let n=[...s[0]].length-1,i,c,l=n,o=0,a=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,e=e.slice(-1*t.length+n);(s=a.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(c=[...i].length,s[3]||s[4]){l+=c;continue}else if((s[5]||s[6])&&n%3&&!((n+c)%3)){o+=c;continue}if(l-=c,l>0)continue;c=Math.min(c,c+l+o);let p=[...s[0]][0].length,k=t.slice(0,n+s.index+p+c);if(Math.min(n,c)%2){let x=k.slice(1,-1);return{type:"em",raw:k,text:x,tokens:this.lexer.inlineTokens(x)}}let h=k.slice(2,-2);return{type:"strong",raw:k,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),n=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&n&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){let e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(t){var r;let e;if(e=this.rules.inline.url.exec(t)){let s,n;if(e[2]==="@")s=e[0],n="mailto:"+s;else{let i;do i=e[0],e[0]=((r=this.rules.inline._backpedal.exec(e[0]))==null?void 0:r[0])??"";while(i!==e[0]);s=e[0],e[1]==="www."?n="http://"+e[0]:n=e[0]}return{type:"link",raw:e[0],text:s,href:n,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},y=class O{constructor(e){f(this,"tokens");f(this,"options");f(this,"state");f(this,"tokenizer");f(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||T,this.options.tokenizer=this.options.tokenizer||new E,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:b,block:B.normal,inline:_.normal};this.options.pedantic?(r.block=B.pedantic,r.inline=_.pedantic):this.options.gfm&&(r.block=B.gfm,this.options.breaks?r.inline=_.breaks:r.inline=_.gfm),this.tokenizer.rules=r}static get rules(){return{block:B,inline:_}}static lex(e,r){return new O(r).lex(e)}static lexInline(e,r){return new O(r).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(l=a.call({lexer:this},e,r))?(e=e.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let a=r.at(-1);l.raw.length===1&&a!==void 0?a.raw+=` `:r.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let a=r.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+l.raw,a.text+=` `+l.text,this.inlineQueue.at(-1).src=a.text):r.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let a=r.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+l.raw,a.text+=` `+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),r.push(l);continue}let o=e;if((c=this.options.extensions)!=null&&c.startBlock){let a=1/0,p=e.slice(1),k;this.options.extensions.startBlock.forEach(h=>{k=h.call({lexer:this},p),typeof k=="number"&&k>=0&&(a=Math.min(a,k))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(o))){let a=r.at(-1);s&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+l.raw,a.text+=` `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(l),s=o.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let a=r.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=(a.raw.endsWith(` `)?"":` `)+l.raw,a.text+=` `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):r.push(l);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){var l,o,a,p,k;let s=e,n=null;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(n=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)h.includes(n[0].slice(n[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(n=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,n.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(n=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,n.index)+"["+"a".repeat(n[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((o=(l=this.options.hooks)==null?void 0:l.emStrongMask)==null?void 0:o.call({lexer:this},s))??s;let i=!1,c="";for(;e;){i||(c=""),i=!1;let h;if((p=(a=this.options.extensions)==null?void 0:a.inline)!=null&&p.some(u=>(h=u.call({lexer:this},e,r))?(e=e.substring(h.raw.length),r.push(h),!0):!1))continue;if(h=this.tokenizer.escape(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.tag(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.link(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(h.raw.length);let u=r.at(-1);h.type==="text"&&(u==null?void 0:u.type)==="text"?(u.raw+=h.raw,u.text+=h.text):r.push(h);continue}if(h=this.tokenizer.emStrong(e,s,c)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.codespan(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.br(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.del(e)){e=e.substring(h.raw.length),r.push(h);continue}if(h=this.tokenizer.autolink(e)){e=e.substring(h.raw.length),r.push(h);continue}if(!this.state.inLink&&(h=this.tokenizer.url(e))){e=e.substring(h.raw.length),r.push(h);continue}let x=e;if((k=this.options.extensions)!=null&&k.startInline){let u=1/0,w=e.slice(1),S;this.options.extensions.startInline.forEach(z=>{S=z.call({lexer:this},w),typeof S=="number"&&S>=0&&(u=Math.min(u,S))}),u<1/0&&u>=0&&(x=e.substring(0,u+1))}if(h=this.tokenizer.inlineText(x)){e=e.substring(h.raw.length),h.raw.slice(-1)!=="_"&&(c=h.raw.slice(-1)),i=!0;let u=r.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=h.raw,u.text+=h.text):r.push(h);continue}if(e){let u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return r}},Z=class{constructor(t){f(this,"options");f(this,"parser");this.options=t||T}space(t){return""}code({text:t,lang:e,escaped:r}){var i;let s=(i=(e||"").match(b.notSpaceStart))==null?void 0:i[0],n=t.replace(b.endingNewline,"")+` `;return s?'
'+(r?n:m(n,!0))+`
`:"
"+(r?n:m(n,!0))+`
`}blockquote({tokens:t}){return`
${this.parser.parse(t)}
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`${this.parser.parseInline(t)} `}hr(t){return`
`}list(t){let e=t.ordered,r=t.start,s="";for(let c=0;c `+s+" `}listitem(t){var r;let e="";if(t.task){let s=this.checkbox({checked:!!t.checked});t.loose?((r=t.tokens[0])==null?void 0:r.type)==="paragraph"?(t.tokens[0].text=s+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&t.tokens[0].tokens[0].type==="text"&&(t.tokens[0].tokens[0].text=s+" "+m(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):e+=s+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`
  • ${e}
  • `}checkbox({checked:t}){return"'}paragraph({tokens:t}){return`

    ${this.parser.parseInline(t)}

    `}table(t){let e="",r="";for(let n=0;n${s}`),` `+e+` `+s+`
    `}tablerow({text:t}){return` ${t} `}tablecell(t){let e=this.parser.parseInline(t.tokens),r=t.header?"th":"td";return(t.align?`<${r} align="${t.align}">`:`<${r}>`)+e+` `}strong({tokens:t}){return`${this.parser.parseInline(t)}`}em({tokens:t}){return`${this.parser.parseInline(t)}`}codespan({text:t}){return`${m(t,!0)}`}br(t){return"
    "}del({tokens:t}){return`${this.parser.parseInline(t)}`}link({href:t,title:e,tokens:r}){let s=this.parser.parseInline(r),n=se(t);if(n===null)return s;t=n;let i='
    ",i}image({href:t,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let n=se(t);if(n===null)return m(r);t=n;let i=`${r}{let o=c[l].flat(1/0);r=r.concat(this.walkTokens(o,e))}):c.tokens&&(r=r.concat(this.walkTokens(c.tokens,e)))}}return r}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(n=>{if(!n.name)throw new Error("extension name required");if("renderer"in n){let i=e.renderers[n.name];i?e.renderers[n.name]=function(...c){let l=n.renderer.apply(this,c);return l===!1&&(l=i.apply(this,c)),l}:e.renderers[n.name]=n.renderer}if("tokenizer"in n){if(!n.level||n.level!=="block"&&n.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[n.level];i?i.unshift(n.tokenizer):e[n.level]=[n.tokenizer],n.start&&(n.level==="block"?e.startBlock?e.startBlock.push(n.start):e.startBlock=[n.start]:n.level==="inline"&&(e.startInline?e.startInline.push(n.start):e.startInline=[n.start]))}"childTokens"in n&&n.childTokens&&(e.childTokens[n.name]=n.childTokens)}),s.extensions=e),r.renderer){let n=this.defaults.renderer||new Z(this.defaults);for(let i in r.renderer){if(!(i in n))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let c=i,l=r.renderer[c],o=n[c];n[c]=(...a)=>{let p=l.apply(n,a);return p===!1&&(p=o.apply(n,a)),p||""}}s.renderer=n}if(r.tokenizer){let n=this.defaults.tokenizer||new E(this.defaults);for(let i in r.tokenizer){if(!(i in n))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let c=i,l=r.tokenizer[c],o=n[c];n[c]=(...a)=>{let p=l.apply(n,a);return p===!1&&(p=o.apply(n,a)),p}}s.tokenizer=n}if(r.hooks){let n=this.defaults.hooks||new I;for(let i in r.hooks){if(!(i in n))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let c=i,l=r.hooks[c],o=n[c];I.passThroughHooks.has(i)?n[c]=a=>{if(this.defaults.async&&I.passThroughHooksRespectAsync.has(i))return Promise.resolve(l.call(n,a)).then(k=>o.call(n,k));let p=l.call(n,a);return o.call(n,p)}:n[c]=(...a)=>{let p=l.apply(n,a);return p===!1&&(p=o.apply(n,a)),p}}s.hooks=n}if(r.walkTokens){let n=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(c){let l=[];return l.push(i.call(this,c)),n&&(l=l.concat(n.call(this,c))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return y.lex(t,e??this.defaults)}parser(t,e){return $.parse(t,e??this.defaults)}parseMarkdown(t){return(e,r)=>{let s={...r},n={...this.defaults,...s},i=this.onError(!!n.silent,!!n.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));n.hooks&&(n.hooks.options=n,n.hooks.block=t);let c=n.hooks?n.hooks.provideLexer():t?y.lex:y.lexInline,l=n.hooks?n.hooks.provideParser():t?$.parse:$.parseInline;if(n.async)return Promise.resolve(n.hooks?n.hooks.preprocess(e):e).then(o=>c(o,n)).then(o=>n.hooks?n.hooks.processAllTokens(o):o).then(o=>n.walkTokens?Promise.all(this.walkTokens(o,n.walkTokens)).then(()=>o):o).then(o=>l(o,n)).then(o=>n.hooks?n.hooks.postprocess(o):o).catch(i);try{n.hooks&&(e=n.hooks.preprocess(e));let o=c(e,n);n.hooks&&(o=n.hooks.processAllTokens(o)),n.walkTokens&&this.walkTokens(o,n.walkTokens);let a=l(o,n);return n.hooks&&(a=n.hooks.postprocess(a)),a}catch(o){return i(o)}}}onError(t,e){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,t){let s="

    An error occurred:

    "+m(r.message+"",!0)+"
    ";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},R=new rt;function d(t,e){return R.parse(t,e)}d.options=d.setOptions=function(t){return R.setOptions(t),d.defaults=R.defaults,ae(d.defaults),d};d.getDefaults=H;d.defaults=T;d.use=function(...t){return R.use(...t),d.defaults=R.defaults,ae(d.defaults),d};d.walkTokens=function(t,e){return R.walkTokens(t,e)};d.parseInline=R.parseInline;d.Parser=$;d.parser=$.parse;d.Renderer=Z;d.TextRenderer=V;d.Lexer=y;d.lexer=y.lex;d.Tokenizer=E;d.Hooks=I;d.parse=d;d.options;d.setOptions;d.use;d.walkTokens;d.parseInline;$.parse;y.lex;export{d};