You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
39 KiB
1 line
39 KiB
"use strict";var ut=Object.defineProperty,gt=(z,w,S)=>w in z?ut(z,w,{enumerable:!0,configurable:!0,writable:!0,value:S}):z[w]=S,f=(z,w,S)=>(gt(z,"symbol"!=typeof w?w+"":w,S),S);(self.webpackChunkjupyter_web=self.webpackChunkjupyter_web||[]).push([[2580],{92580:(z,w,S)=>{var J;function q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}S.r(w),S.d(w,{Hooks:()=>B,Lexer:()=>R,Marked:()=>be,Parser:()=>T,Renderer:()=>P,TextRenderer:()=>G,Tokenizer:()=>C,defaults:()=>$,getDefaults:()=>q,lexer:()=>ht,marked:()=>u,options:()=>rt,parse:()=>ot,parseInline:()=>at,parser:()=>ct,setOptions:()=>st,use:()=>it,walkTokens:()=>lt});var $={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function te(n){$=n}var _={exec:()=>null};function p(n,e=""){let t="string"==typeof n?n:n.source;const s={replace:(r,i)=>{let l="string"==typeof i?i:i.source;return l=l.replace(b.caret,"$1"),t=t.replace(r,l),s},getRegex:()=>new RegExp(t,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:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,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+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},A=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,j=/(?:[*+-]|\d{1,9}[.)])/,ne=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,re=p(ne).replace(/bull/g,j).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(),ve=p(ne).replace(/bull/g,j).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(),N=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,H=/(?!\s*\])(?:\\.|[^\[\]\\])+/,_e=p(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",H).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ae=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,j).getRegex(),Z="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",Q=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Le=p("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Q).replace("tag",Z).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),se=p(N).replace("hr",A).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Z).getRegex(),F={blockquote:p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",se).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:_e,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:A,html:Le,lheading:re,list:Ae,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:se,table:_,text:/^[^\n]+/},ie=p("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Z).getRegex(),Ce={...F,lheading:ve,table:ie,paragraph:p(N).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ie).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Z).getRegex()},Pe={...F,html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Q).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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(N).replace("hr",A).replace("heading"," *#{1,6} *[^\n]").replace("lheading",re).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},le=/^( {2,}|\\)\n(?!\s*$)/,D=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,ae=/[^\s\p{P}\p{S}]/u,Ze=p(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),oe=/(?!~)[\p{P}\p{S}]/u,ce=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Ge=p(ce,"u").replace(/punct/g,D).getRegex(),je=p(ce,"u").replace(/punct/g,oe).getRegex(),he="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ne=p(he,"gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,U).replace(/punct/g,D).getRegex(),He=p(he,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,oe).getRegex(),Qe=p("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ae).replace(/punctSpace/g,U).replace(/punct/g,D).getRegex(),Fe=p(/\\(punct)/,"gu").replace(/punct/g,D).getRegex(),Ue=p(/^<(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=p(Q).replace("(?:--\x3e|$)","--\x3e").getRegex(),We=p("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),M=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Je=p(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",M).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),pe=p(/^!?\[(label)\]\[(ref)\]/).replace("label",M).replace("ref",H).getRegex(),ue=p(/^!?\[(ref)\](?:\[\])?/).replace("ref",H).getRegex(),X={_backpedal:_,anyPunctuation:Fe,autolink:Ue,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:le,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:_,emStrongLDelim:Ge,emStrongRDelimAst:Ne,emStrongRDelimUnd:Qe,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Je,nolink:ue,punctuation:Ze,reflink:pe,reflinkSearch:p("reflink|nolink(?!\\()","g").replace("reflink",pe).replace("nolink",ue).getRegex(),tag:We,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:_},Ve={...X,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",M).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M).getRegex()},W={...X,emStrongRDelimAst:He,emStrongLDelim:je,url:p(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ye={...W,br:p(le).replace("{2,}","*").getRegex(),text:p(W.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},O={normal:F,gfm:Ce,pedantic:Pe},L={normal:X,gfm:W,breaks:Ye,pedantic:Ve},et={"&":"&","<":"<",">":">",'"':""","'":"'"},ge=n=>et[n];function y(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,ge)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,ge);return n}function fe(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}function ke(n,e){const s=n.replace(b.findPipe,(i,l,a)=>{let c=!1,o=l;for(;--o>=0&&"\\"===a[o];)c=!c;return c?"|":" |"}).split(b.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(b.slashPipe,"|");return s}function I(n,e,t){const s=n.length;if(0===s)return"";let r=0;for(;r<s;){const i=n.charAt(s-r-1);if(i!==e||t){if(i===e||!t)break;r++}else r++}return n.slice(0,s-r)}function de(n,e,t,s,r){const i=e.href,l=e.title||null,a=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;const c={type:"!"===n[0].charAt(0)?"image":"link",raw:t,href:i,title:l,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,c}var C=class{constructor(n){f(this,"options"),f(this,"rules"),f(this,"lexer"),this.options=n||$}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:I(t,"\n")}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],s=function nt(n,e,t){const s=n.match(t.other.indentCodeCompensation);if(null===s)return e;const r=s[1];return e.split("\n").map(i=>{const l=i.match(t.other.beginningSpace);if(null===l)return i;const[a]=l;return a.length>=r.length?i.slice(r.length):i}).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const s=I(t,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(t=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:I(e[0],"\n")}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=I(e[0],"\n").split("\n"),s="",r="";const i=[];for(;t.length>0;){let l=!1;const a=[];let c;for(c=0;c<t.length;c++)if(this.rules.other.blockquoteStart.test(t[c]))a.push(t[c]),l=!0;else{if(l)break;a.push(t[c])}t=t.slice(c);const o=a.join("\n"),h=o.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}\n${o}`:o,r=r?`${r}\n${h}`:h;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(h,i,!0),this.lexer.state.top=d,0===t.length)break;const g=i.at(-1);if("code"===g?.type)break;if("blockquote"===g?.type){const x=g,k=x.raw+"\n"+t.join("\n"),m=this.blockquote(k);i[i.length-1]=m,s=s.substring(0,s.length-x.raw.length)+m.raw,r=r.substring(0,r.length-x.text.length)+m.text;break}if("list"!==g?.type);else{const x=g,k=x.raw+"\n"+t.join("\n"),m=this.list(k);i[i.length-1]=m,s=s.substring(0,s.length-g.raw.length)+m.raw,r=r.substring(0,r.length-x.raw.length)+m.raw,t=k.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const s=t.length>1,r={type:"list",raw:"",ordered:s,start:s?+t.slice(0,-1):"",loose:!1,items:[]};t=s?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=s?t:"[*+-]");const i=this.rules.other.listItemRegex(t);let l=!1;for(;n;){let c=!1,o="",h="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;o=e[0],n=n.substring(o.length);let d=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,K=>" ".repeat(3*K.length)),g=n.split("\n",1)[0],x=!d.trim(),k=0;if(this.options.pedantic?(k=2,h=d.trimStart()):x?k=e[1].length+1:(k=e[2].search(this.rules.other.nonSpaceChar),k=k>4?1:k,h=d.slice(k),k+=e[1].length),x&&this.rules.other.blankLine.test(g)&&(o+=g+"\n",n=n.substring(g.length+1),c=!0),!c){const K=this.rules.other.nextBulletRegex(k),me=this.rules.other.hrRegex(k),we=this.rules.other.fencesBeginRegex(k),ye=this.rules.other.headingBeginRegex(k),pt=this.rules.other.htmlBeginRegex(k);for(;n;){const V=n.split("\n",1)[0];let E;if(g=V,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),E=g):E=g.replace(this.rules.other.tabCharGlobal," "),we.test(g)||ye.test(g)||pt.test(g)||K.test(g)||me.test(g))break;if(E.search(this.rules.other.nonSpaceChar)>=k||!g.trim())h+="\n"+E.slice(k);else{if(x||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||we.test(d)||ye.test(d)||me.test(d))break;h+="\n"+g}!x&&!g.trim()&&(x=!0),o+=V+"\n",n=n.substring(V.length+1),d=E.slice(k)}}r.loose||(l?r.loose=!0:this.rules.other.doubleBlankLine.test(o)&&(l=!0));let xe,m=null;this.options.gfm&&(m=this.rules.other.listIsTask.exec(h),m&&(xe="[ ] "!==m[0],h=h.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:o,task:!!m,checked:xe,loose:!1,text:h,tokens:[]}),r.raw+=o}const a=r.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){const o=r.items[c].tokens.filter(d=>"space"===d.type),h=o.length>0&&o.some(d=>this.rules.other.anyLine.test(d.raw));r.loose=h}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:s,title:r}}}table(n){const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=ke(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===s.length){for(const l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<t.length;l++)i.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:i.align[l]});for(const l of r)i.rows.push(ke(l,i.header.length).map((a,c)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[c]})));return i}}lheading(n){const e=this.rules.block.lheading.exec(n);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(n){const e=this.rules.block.paragraph.exec(n);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);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(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const i=I(t.slice(0,-1),"\\");if((t.length-i.length)%2==0)return}else{const i=function tt(n,e){if(-1===n.indexOf(e[1]))return-1;let t=0;for(let s=0;s<n.length;s++)if("\\"===n[s])s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}(e[2],"()");if(-2===i)return;if(i>-1){const a=(0===e[0].indexOf("!")?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(s=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?s.slice(1):s.slice(1,-1)),de(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const r=e[(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!r){const i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return de(t,r,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&t.match(this.rules.other.unicodeAlphaNumeric))&&(!s[1]&&!s[2]||!t||this.rules.inline.punctuation.exec(t))){const i=[...s[0]].length-1;let l,a,c=i,o=0;const h="*"===s[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,e=e.slice(-1*n.length+i);null!=(s=h.exec(e));){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(a=[...l].length,s[3]||s[4]){c+=a;continue}if((s[5]||s[6])&&i%3&&!((i+a)%3)){o+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+o);const d=[...s[0]][0].length,g=n.slice(0,i+s.index+d+a);if(Math.min(i,a)%2){const k=g.slice(1,-1);return{type:"em",raw:g,text:k,tokens:this.lexer.inlineTokens(k)}}const x=g.slice(2,-2);return{type:"strong",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return s&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,s;return"@"===e[2]?(t=e[1],s="mailto:"+t):(t=e[1],s=t),{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let t,s;if("@"===e[2])t=e[0],s="mailto:"+t;else{let r;do{r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(r!==e[0]);t=e[0],s="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:s,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},R=class Y{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||$,this.options.tokenizer=this.options.tokenizer||new C,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:b,block:O.normal,inline:L.normal};this.options.pedantic?(t.block=O.pedantic,t.inline=L.pedantic):this.options.gfm&&(t.block=O.gfm,this.options.breaks?t.inline=L.breaks:t.inline=L.gfm),this.tokenizer.rules=t}static get rules(){return{block:O,inline:L}}static lex(e,t){return new Y(t).lex(e)}static lexInline(e,t){return new Y(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(l=>!!(r=l.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const l=t.at(-1);1===r.raw.length&&void 0!==l?l.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const l=t.at(-1);"paragraph"===l?.type||"text"===l?.type?(l.raw+="\n"+r.raw,l.text+="\n"+r.text,this.inlineQueue.at(-1).src=l.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const l=t.at(-1);"paragraph"===l?.type||"text"===l?.type?(l.raw+="\n"+r.raw,l.text+="\n"+r.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let l=1/0;const a=e.slice(1);let c;this.options.extensions.startBlock.forEach(o=>{c=o.call({lexer:this},a),"number"==typeof c&&c>=0&&(l=Math.min(l,c))}),l<1/0&&l>=0&&(i=e.substring(0,l+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){const l=t.at(-1);s&&"paragraph"===l?.type?(l.raw+="\n"+r.raw,l.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(r),s=i.length!==e.length,e=e.substring(r.raw.length)}else if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const l=t.at(-1);"text"===l?.type?(l.raw+="\n"+r.raw,l.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):t.push(r)}else if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}throw new Error(l)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let s=e,r=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(s));)a.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(s));)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(s));)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,l="";for(;e;){let a;if(i||(l=""),i=!1,this.options.extensions?.inline?.some(o=>!!(a=o.call({lexer:this},e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const o=t.at(-1);"text"===a.type&&"text"===o?.type?(o.raw+=a.raw,o.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let c=e;if(this.options.extensions?.startInline){let o=1/0;const h=e.slice(1);let d;this.options.extensions.startInline.forEach(g=>{d=g.call({lexer:this},h),"number"==typeof d&&d>=0&&(o=Math.min(o,d))}),o<1/0&&o>=0&&(c=e.substring(0,o+1))}if(a=this.tokenizer.inlineText(c)){e=e.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(l=a.raw.slice(-1)),i=!0;const o=t.at(-1);"text"===o?.type?(o.raw+=a.raw,o.text+=a.text):t.push(a)}else if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}throw new Error(o)}}return t}},P=class{constructor(n){f(this,"options"),f(this,"parser"),this.options=n||$}space(n){return""}code({text:n,lang:e,escaped:t}){const s=(e||"").match(b.notSpaceStart)?.[0],r=n.replace(b.endingNewline,"")+"\n";return s?'<pre><code class="language-'+y(s)+'">'+(t?r:y(r,!0))+"</code></pre>\n":"<pre><code>"+(t?r:y(r,!0))+"</code></pre>\n"}blockquote({tokens:n}){return`<blockquote>\n${this.parser.parse(n)}</blockquote>\n`}html({text:n}){return n}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>\n`}hr(n){return"<hr>\n"}list(n){const e=n.ordered,t=n.start;let s="";for(let l=0;l<n.items.length;l++){const a=n.items[l];s+=this.listitem(a)}const r=e?"ol":"ul";return"<"+r+(e&&1!==t?' start="'+t+'"':"")+">\n"+s+"</"+r+">\n"}listitem(n){let e="";if(n.task){const t=this.checkbox({checked:!!n.checked});n.loose?"paragraph"===n.tokens[0]?.type?(n.tokens[0].text=t+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&"text"===n.tokens[0].tokens[0].type&&(n.tokens[0].tokens[0].text=t+" "+y(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:t+" ",text:t+" ",escaped:!0}):e+=t+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>\n`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>\n`}table(n){let e="",t="";for(let r=0;r<n.header.length;r++)t+=this.tablecell(n.header[r]);e+=this.tablerow({text:t});let s="";for(let r=0;r<n.rows.length;r++){const i=n.rows[r];t="";for(let l=0;l<i.length;l++)t+=this.tablecell(i[l]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+s+"</table>\n"}tablerow({text:n}){return`<tr>\n${n}</tr>\n`}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>\n`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${y(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const s=this.parser.parseInline(t),r=fe(n);if(null===r)return s;let i='<a href="'+(n=r)+'"';return e&&(i+=' title="'+y(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));const r=fe(n);if(null===r)return y(t);let i=`<img src="${n=r}" alt="${t}"`;return e&&(i+=` title="${y(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:y(n.text)}},G=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},T=class ee{constructor(e){f(this,"options"),f(this,"renderer"),f(this,"textRenderer"),this.options=e||$,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new G}static parse(e,t){return new ee(t).parse(e)}static parseInline(e,t){return new ee(t).parseInline(e)}parse(e,t=!0){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions?.renderers?.[i.type]){const a=i,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(!1!==c||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){s+=c||"";continue}}const l=i;switch(l.type){case"space":s+=this.renderer.space(l);continue;case"hr":s+=this.renderer.hr(l);continue;case"heading":s+=this.renderer.heading(l);continue;case"code":s+=this.renderer.code(l);continue;case"table":s+=this.renderer.table(l);continue;case"blockquote":s+=this.renderer.blockquote(l);continue;case"list":s+=this.renderer.list(l);continue;case"html":s+=this.renderer.html(l);continue;case"paragraph":s+=this.renderer.paragraph(l);continue;case"text":{let a=l,c=this.renderer.text(a);for(;r+1<e.length&&"text"===e[r+1].type;)a=e[++r],c+="\n"+this.renderer.text(a);s+=t?this.renderer.paragraph({type:"paragraph",raw:c,text:c,tokens:[{type:"text",raw:c,text:c,escaped:!0}]}):c;continue}default:{const a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,t=this.renderer){let s="";for(let r=0;r<e.length;r++){const i=e[r];if(this.options.extensions?.renderers?.[i.type]){const a=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==a||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}const l=i;switch(l.type){case"escape":case"text":s+=t.text(l);break;case"html":s+=t.html(l);break;case"link":s+=t.link(l);break;case"image":s+=t.image(l);break;case"strong":s+=t.strong(l);break;case"em":s+=t.em(l);break;case"codespan":s+=t.codespan(l);break;case"br":s+=t.br(l);break;case"del":s+=t.del(l);break;default:{const a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},B=(J=class{constructor(n){f(this,"options"),f(this,"block"),this.options=n||$}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?R.lex:R.lexInline}provideParser(){return this.block?T.parse:T.parseInline}},f(J,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),J),be=class{constructor(...n){f(this,"defaults",{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}),f(this,"options",this.setOptions),f(this,"parse",this.parseMarkdown(!0)),f(this,"parseInline",this.parseMarkdown(!1)),f(this,"Parser",T),f(this,"Renderer",P),f(this,"TextRenderer",G),f(this,"Lexer",R),f(this,"Tokenizer",C),f(this,"Hooks",B),this.use(...n)}walkTokens(n,e){let t=[];for(const s of n)switch(t=t.concat(e.call(this,s)),s.type){case"table":{const r=s;for(const i of r.header)t=t.concat(this.walkTokens(i.tokens,e));for(const i of r.rows)for(const l of i)t=t.concat(this.walkTokens(l.tokens,e));break}case"list":{const r=s;t=t.concat(this.walkTokens(r.items,e));break}default:{const r=s;this.defaults.extensions?.childTokens?.[r.type]?this.defaults.extensions.childTokens[r.type].forEach(i=>{const l=r[i].flat(1/0);t=t.concat(this.walkTokens(l,e))}):r.tokens&&(t=t.concat(this.walkTokens(r.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const s={...t};if(s.async=this.defaults.async||s.async||!1,t.extensions&&(t.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const i=e.renderers[r.name];e.renderers[r.name]=i?function(...l){let a=r.renderer.apply(this,l);return!1===a&&(a=i.apply(this,l)),a}:r.renderer}if("tokenizer"in r){if(!r.level||"block"!==r.level&&"inline"!==r.level)throw new Error("extension level must be 'block' or 'inline'");const i=e[r.level];i?i.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&("block"===r.level?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:"inline"===r.level&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),s.extensions=e),t.renderer){const r=this.defaults.renderer||new P(this.defaults);for(const i in t.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const l=i,a=t.renderer[l],c=r[l];r[l]=(...o)=>{let h=a.apply(r,o);return!1===h&&(h=c.apply(r,o)),h||""}}s.renderer=r}if(t.tokenizer){const r=this.defaults.tokenizer||new C(this.defaults);for(const i in t.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const l=i,a=t.tokenizer[l],c=r[l];r[l]=(...o)=>{let h=a.apply(r,o);return!1===h&&(h=c.apply(r,o)),h}}s.tokenizer=r}if(t.hooks){const r=this.defaults.hooks||new B;for(const i in t.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const l=i,a=t.hooks[l],c=r[l];B.passThroughHooks.has(i)?r[l]=o=>{if(this.defaults.async)return Promise.resolve(a.call(r,o)).then(d=>c.call(r,d));const h=a.call(r,o);return c.call(r,h)}:r[l]=(...o)=>{let h=a.apply(r,o);return!1===h&&(h=c.apply(r,o)),h}}s.hooks=r}if(t.walkTokens){const r=this.defaults.walkTokens,i=t.walkTokens;s.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),r&&(a=a.concat(r.call(this,l))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return R.lex(n,e??this.defaults)}parser(n,e){return T.parse(n,e??this.defaults)}parseMarkdown(n){return(t,s)=>{const r={...s},i={...this.defaults,...r},l=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return l(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 t>"u"||null===t)return l(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=n);const a=i.hooks?i.hooks.provideLexer():n?R.lex:R.lexInline,c=i.hooks?i.hooks.provideParser():n?T.parse:T.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(o=>a(o,i)).then(o=>i.hooks?i.hooks.processAllTokens(o):o).then(o=>i.walkTokens?Promise.all(this.walkTokens(o,i.walkTokens)).then(()=>o):o).then(o=>c(o,i)).then(o=>i.hooks?i.hooks.postprocess(o):o).catch(l);try{i.hooks&&(t=i.hooks.preprocess(t));let o=a(t,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let h=c(o,i);return i.hooks&&(h=i.hooks.postprocess(h)),h}catch(o){return l(o)}}}onError(n,e){return t=>{if(t.message+="\nPlease report this to https://github.com/markedjs/marked.",n){const s="<p>An error occurred:</p><pre>"+y(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},v=new be;function u(n,e){return v.parse(n,e)}u.options=u.setOptions=function(n){return v.setOptions(n),u.defaults=v.defaults,te(u.defaults),u},u.getDefaults=q,u.defaults=$,u.use=function(...n){return v.use(...n),u.defaults=v.defaults,te(u.defaults),u},u.walkTokens=function(n,e){return v.walkTokens(n,e)},u.parseInline=v.parseInline,u.Parser=T,u.parser=T.parse,u.Renderer=P,u.TextRenderer=G,u.Lexer=R,u.lexer=R.lex,u.Tokenizer=C,u.Hooks=B,u.parse=u;var rt=u.options,st=u.setOptions,it=u.use,lt=u.walkTokens,at=u.parseInline,ot=u,ct=T.parse,ht=R.lex}}]); |