Port the Fuc 0.12.0 frontend and default-off VIP plugin. Include the previously approved password-reset token revocation. Deploy only to an independent FUC-XB test instance; no production cutover.
65 lines
68 KiB
JavaScript
65 lines
68 KiB
JavaScript
function $t(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var be=$t();function Gn(t){be=t}var Ue={exec:()=>null};function w(t,e=""){let n=typeof t=="string"?t:t.source,s={replace:(i,a)=>{let l=typeof a=="string"?a:a.source;return l=l.replace($.caret,"$1"),n=n.replace(i,l),s},getRegex:()=>new RegExp(n,e)};return s}var $={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+));?/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")},Jr=/^(?:[ \t]*(?:\n|$))+/,ei=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ti=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Be=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ni=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ut=/(?:[*+-]|\d{1,9}[.)])/,Wn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jn=w(Wn).replace(/bull/g,Ut).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(),ri=w(Wn).replace(/bull/g,Ut).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(),Bt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ii=/^[^\n]+/,Ft=/(?!\s*\])(?:\\.|[^\[\]\\])+/,si=w(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Ft).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),oi=w(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ut).getRegex(),ot="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",Ht=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ai=w("^ {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[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ht).replace("tag",ot).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),qn=w(Bt).replace("hr",Be).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",ot).getRegex(),li=w(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",qn).getRegex(),Gt={blockquote:li,code:ei,def:si,fences:ti,heading:ni,hr:Be,html:ai,lheading:jn,list:oi,newline:Jr,paragraph:qn,table:Ue,text:ii},$n=w("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Be).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","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",ot).getRegex(),ci={...Gt,lheading:ri,table:$n,paragraph:w(Bt).replace("hr",Be).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",$n).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",ot).getRegex()},ui={...Gt,html:w(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ht).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:Ue,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:w(Bt).replace("hr",Be).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",jn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},pi=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fi=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Yn=/^( {2,}|\\)\n(?!\s*$)/,hi=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,at=/[\p{P}\p{S}]/u,Wt=/[\s\p{P}\p{S}]/u,Zn=/[^\s\p{P}\p{S}]/u,di=w(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Wt).getRegex(),Vn=/(?!~)[\p{P}\p{S}]/u,gi=/(?!~)[\s\p{P}\p{S}]/u,mi=/(?:[^\s\p{P}\p{S}]|~)/u,bi=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Xn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ki=w(Xn,"u").replace(/punct/g,at).getRegex(),Ti=w(Xn,"u").replace(/punct/g,Vn).getRegex(),Qn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_i=w(Qn,"gu").replace(/notPunctSpace/g,Zn).replace(/punctSpace/g,Wt).replace(/punct/g,at).getRegex(),xi=w(Qn,"gu").replace(/notPunctSpace/g,mi).replace(/punctSpace/g,gi).replace(/punct/g,Vn).getRegex(),wi=w("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Zn).replace(/punctSpace/g,Wt).replace(/punct/g,at).getRegex(),yi=w(/\\(punct)/,"gu").replace(/punct/g,at).getRegex(),Si=w(/^<(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(),Ai=w(Ht).replace("(?:-->|$)","-->").getRegex(),Ei=w("^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",Ai).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ri=w(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",rt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Kn=w(/^!?\[(label)\]\[(ref)\]/).replace("label",rt).replace("ref",Ft).getRegex(),Jn=w(/^!?\[(ref)\](?:\[\])?/).replace("ref",Ft).getRegex(),vi=w("reflink|nolink(?!\\()","g").replace("reflink",Kn).replace("nolink",Jn).getRegex(),jt={_backpedal:Ue,anyPunctuation:yi,autolink:Si,blockSkip:bi,br:Yn,code:fi,del:Ue,emStrongLDelim:ki,emStrongRDelimAst:_i,emStrongRDelimUnd:wi,escape:pi,link:Ri,nolink:Jn,punctuation:di,reflink:Kn,reflinkSearch:vi,tag:Ei,text:hi,url:Ue},Li={...jt,link:w(/^!?\[(label)\]\((.*?)\)/).replace("label",rt).getRegex(),reflink:w(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rt).getRegex()},Nt={...jt,emStrongRDelimAst:xi,emStrongLDelim:Ti,url:w(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ii={...Nt,br:w(Yn).replace("{2,}","*").getRegex(),text:w(Nt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},tt={normal:Gt,gfm:ci,pedantic:ui},Me={normal:jt,gfm:Nt,breaks:Ii,pedantic:Li},Oi={"&":"&","<":"<",">":">",'"':""","'":"'"},Un=t=>Oi[t];function K(t,e){if(e){if($.escapeTest.test(t))return t.replace($.escapeReplace,Un)}else if($.escapeTestNoEncode.test(t))return t.replace($.escapeReplaceNoEncode,Un);return t}function Bn(t){try{t=encodeURI(t).replace($.percentDecode,"%")}catch{return null}return t}function Fn(t,e){let n=t.replace($.findPipe,(a,l,c)=>{let h=!1,d=l;for(;--d>=0&&c[d]==="\\";)h=!h;return h?"|":" |"}),s=n.split($.splitPipe),i=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(;i<s.length;i++)s[i]=s[i].trim().replace($.slashPipe,"|");return s}function $e(t,e,n){let s=t.length;if(s===0)return"";let i=0;for(;i<s;){let a=t.charAt(s-i-1);if(a===e&&!n)i++;else if(a!==e&&n)i++;else break}return t.slice(0,s-i)}function Di(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let s=0;s<t.length;s++)if(t[s]==="\\")s++;else if(t[s]===e[0])n++;else if(t[s]===e[1]&&(n--,n<0))return s;return n>0?-2:-1}function Hn(t,e,n,s,i){let a=e.href,l=e.title||null,c=t[1].replace(i.other.outputLinkReplace,"$1");s.state.inLink=!0;let h={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:l,text:c,tokens:s.inlineTokens(c)};return s.state.inLink=!1,h}function Ci(t,e,n){let s=t.match(n.other.indentCodeCompensation);if(s===null)return e;let i=s[1];return e.split(`
|
|
`).map(a=>{let l=a.match(n.other.beginningSpace);if(l===null)return a;let[c]=l;return c.length>=i.length?a.slice(i.length):a}).join(`
|
|
`)}var it=class{options;rules;lexer;constructor(t){this.options=t||be}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 n=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?n:$e(n,`
|
|
`)}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],s=Ci(n,e[3]||"",this.rules);return{type:"code",raw:n,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 n=e[2].trim();if(this.rules.other.endingHash.test(n)){let s=$e(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:$e(e[0],`
|
|
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=$e(e[0],`
|
|
`).split(`
|
|
`),s="",i="",a=[];for(;n.length>0;){let l=!1,c=[],h;for(h=0;h<n.length;h++)if(this.rules.other.blockquoteStart.test(n[h]))c.push(n[h]),l=!0;else if(!l)c.push(n[h]);else break;n=n.slice(h);let d=c.join(`
|
|
`),m=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
${d}`:d,i=i?`${i}
|
|
${m}`:m;let T=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(m,a,!0),this.lexer.state.top=T,n.length===0)break;let x=a.at(-1);if(x?.type==="code")break;if(x?.type==="blockquote"){let O=x,S=O.raw+`
|
|
`+n.join(`
|
|
`),U=this.blockquote(S);a[a.length-1]=U,s=s.substring(0,s.length-O.raw.length)+U.raw,i=i.substring(0,i.length-O.text.length)+U.text;break}else if(x?.type==="list"){let O=x,S=O.raw+`
|
|
`+n.join(`
|
|
`),U=this.list(S);a[a.length-1]=U,s=s.substring(0,s.length-x.raw.length)+U.raw,i=i.substring(0,i.length-O.raw.length)+U.raw,n=S.substring(a.at(-1).raw.length).split(`
|
|
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),s=n.length>1,i={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");let a=this.rules.other.listItemRegex(n),l=!1;for(;t;){let h=!1,d="",m="";if(!(e=a.exec(t))||this.rules.block.hr.test(t))break;d=e[0],t=t.substring(d.length);let T=e[2].split(`
|
|
`,1)[0].replace(this.rules.other.listReplaceTabs,Y=>" ".repeat(3*Y.length)),x=t.split(`
|
|
`,1)[0],O=!T.trim(),S=0;if(this.options.pedantic?(S=2,m=T.trimStart()):O?S=e[1].length+1:(S=e[2].search(this.rules.other.nonSpaceChar),S=S>4?1:S,m=T.slice(S),S+=e[1].length),O&&this.rules.other.blankLine.test(x)&&(d+=x+`
|
|
`,t=t.substring(x.length+1),h=!0),!h){let Y=this.rules.other.nextBulletRegex(S),Te=this.rules.other.hrRegex(S),_e=this.rules.other.fencesBeginRegex(S),Z=this.rules.other.headingBeginRegex(S),se=this.rules.other.htmlBeginRegex(S);for(;t;){let oe=t.split(`
|
|
`,1)[0],C;if(x=oe,this.options.pedantic?(x=x.replace(this.rules.other.listReplaceNesting," "),C=x):C=x.replace(this.rules.other.tabCharGlobal," "),_e.test(x)||Z.test(x)||se.test(x)||Y.test(x)||Te.test(x))break;if(C.search(this.rules.other.nonSpaceChar)>=S||!x.trim())m+=`
|
|
`+C.slice(S);else{if(O||T.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||_e.test(T)||Z.test(T)||Te.test(T))break;m+=`
|
|
`+x}!O&&!x.trim()&&(O=!0),d+=oe+`
|
|
`,t=t.substring(oe.length+1),T=C.slice(S)}}i.loose||(l?i.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(l=!0));let U=null,ie;this.options.gfm&&(U=this.rules.other.listIsTask.exec(m),U&&(ie=U[0]!=="[ ] ",m=m.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:d,task:!!U,checked:ie,loose:!1,text:m,tokens:[]}),i.raw+=d}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let h=0;h<i.items.length;h++)if(this.lexer.state.top=!1,i.items[h].tokens=this.lexer.blockTokens(i.items[h].text,[]),!i.loose){let d=i.items[h].tokens.filter(T=>T.type==="space"),m=d.length>0&&d.some(T=>this.rules.other.anyLine.test(T.raw));i.loose=m}if(i.loose)for(let h=0;h<i.items.length;h++)i.items[h].loose=!0;return i}}html(t){let e=this.rules.block.html.exec(t);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=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"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:e[0],href:s,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=Fn(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?a.align.push("right"):this.rules.other.tableAlignCenter.test(l)?a.align.push("center"):this.rules.other.tableAlignLeft.test(l)?a.align.push("left"):a.align.push(null);for(let l=0;l<n.length;l++)a.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:a.align[l]});for(let l of i)a.rows.push(Fn(l,a.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:a.align[h]})));return a}}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 n=e[1].charAt(e[1].length-1)===`
|
|
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}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 n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let a=$e(n.slice(0,-1),"\\");if((n.length-a.length)%2===0)return}else{let a=Di(e[2],"()");if(a===-2)return;if(a>-1){let c=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,c).trim(),e[3]=""}}let s=e[2],i="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],i=a[3])}else i=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(n)?s=s.slice(1):s=s.slice(1,-1)),Hn(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[s.toLowerCase()];if(!i){let a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return Hn(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let s=this.rules.inline.emStrongLDelim.exec(t);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){let a=[...s[0]].length-1,l,c,h=a,d=0,m=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(m.lastIndex=0,e=e.slice(-1*t.length+a);(s=m.exec(e))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(c=[...l].length,s[3]||s[4]){h+=c;continue}else if((s[5]||s[6])&&a%3&&!((a+c)%3)){d+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h+d);let T=[...s[0]][0].length,x=t.slice(0,a+s.index+T+c);if(Math.min(a,c)%2){let S=x.slice(1,-1);return{type:"em",raw:x,text:S,tokens:this.lexer.inlineTokens(S)}}let O=x.slice(2,-2);return{type:"strong",raw:x,text:O,tokens:this.lexer.inlineTokens(O)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}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 n,s;return e[2]==="@"?(n=e[1],s="mailto:"+n):(n=e[1],s=n),{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,s;if(e[2]==="@")n=e[0],s="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},ee=class zt{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||be,this.options.tokenizer=this.options.tokenizer||new it,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 n={other:$,block:tt.normal,inline:Me.normal};this.options.pedantic?(n.block=tt.pedantic,n.inline=Me.pedantic):this.options.gfm&&(n.block=tt.gfm,this.options.breaks?n.inline=Me.breaks:n.inline=Me.gfm),this.tokenizer.rules=n}static get rules(){return{block:tt,inline:Me}}static lex(e,n){return new zt(n).lex(e)}static lexInline(e,n){return new zt(n).inlineTokens(e)}lex(e){e=e.replace($.carriageReturn,`
|
|
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],s=!1){for(this.options.pedantic&&(e=e.replace($.tabCharGlobal," ").replace($.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(l=>(i=l.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let l=n.at(-1);i.raw.length===1&&l!==void 0?l.raw+=`
|
|
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=`
|
|
`+i.raw,l.text+=`
|
|
`+i.text,this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let l=n.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=`
|
|
`+i.raw,l.text+=`
|
|
`+i.raw,this.inlineQueue.at(-1).src=l.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let a=e;if(this.options.extensions?.startBlock){let l=1/0,c=e.slice(1),h;this.options.extensions.startBlock.forEach(d=>{h=d.call({lexer:this},c),typeof h=="number"&&h>=0&&(l=Math.min(l,h))}),l<1/0&&l>=0&&(a=e.substring(0,l+1))}if(this.state.top&&(i=this.tokenizer.paragraph(a))){let l=n.at(-1);s&&l?.type==="paragraph"?(l.raw+=`
|
|
`+i.raw,l.text+=`
|
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i),s=a.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let l=n.at(-1);l?.type==="text"?(l.raw+=`
|
|
`+i.raw,l.text+=`
|
|
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):n.push(i);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let s=e,i=null;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,i.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let a=!1,l="";for(;e;){a||(l=""),a=!1;let c;if(this.options.extensions?.inline?.some(d=>(c=d.call({lexer:this},e,n))?(e=e.substring(c.raw.length),n.push(c),!0):!1))continue;if(c=this.tokenizer.escape(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.tag(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.link(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(c.raw.length);let d=n.at(-1);c.type==="text"&&d?.type==="text"?(d.raw+=c.raw,d.text+=c.text):n.push(c);continue}if(c=this.tokenizer.emStrong(e,s,l)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.codespan(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.br(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.del(e)){e=e.substring(c.raw.length),n.push(c);continue}if(c=this.tokenizer.autolink(e)){e=e.substring(c.raw.length),n.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(e))){e=e.substring(c.raw.length),n.push(c);continue}let h=e;if(this.options.extensions?.startInline){let d=1/0,m=e.slice(1),T;this.options.extensions.startInline.forEach(x=>{T=x.call({lexer:this},m),typeof T=="number"&&T>=0&&(d=Math.min(d,T))}),d<1/0&&d>=0&&(h=e.substring(0,d+1))}if(c=this.tokenizer.inlineText(h)){e=e.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(l=c.raw.slice(-1)),a=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=c.raw,d.text+=c.text):n.push(c);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},st=class{options;parser;constructor(t){this.options=t||be}space(t){return""}code({text:t,lang:e,escaped:n}){let s=(e||"").match($.notSpaceStart)?.[0],i=t.replace($.endingNewline,"")+`
|
|
`;return s?'<pre><code class="language-'+K(s)+'">'+(n?i:K(i,!0))+`</code></pre>
|
|
`:"<pre><code>"+(n?i:K(i,!0))+`</code></pre>
|
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
${this.parser.parse(t)}</blockquote>
|
|
`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
`}hr(t){return`<hr>
|
|
`}list(t){let e=t.ordered,n=t.start,s="";for(let l=0;l<t.items.length;l++){let c=t.items[l];s+=this.listitem(c)}let i=e?"ol":"ul",a=e&&n!==1?' start="'+n+'"':"";return"<"+i+a+`>
|
|
`+s+"</"+i+`>
|
|
`}listitem(t){let e="";if(t.task){let n=this.checkbox({checked:!!t.checked});t.loose?t.tokens[0]?.type==="paragraph"?(t.tokens[0].text=n+" "+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=n+" "+K(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>
|
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let s="";for(let i=0;i<t.rows.length;i++){let a=t.rows[i];n="";for(let l=0;l<a.length;l++)n+=this.tablecell(a[l]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
<thead>
|
|
`+e+`</thead>
|
|
`+s+`</table>
|
|
`}tablerow({text:t}){return`<tr>
|
|
${t}</tr>
|
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${K(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let s=this.parser.parseInline(n),i=Bn(t);if(i===null)return s;t=i;let a='<a href="'+t+'"';return e&&(a+=' title="'+K(e)+'"'),a+=">"+s+"</a>",a}image({href:t,title:e,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));let i=Bn(t);if(i===null)return K(n);t=i;let a=`<img src="${t}" alt="${n}"`;return e&&(a+=` title="${K(e)}"`),a+=">",a}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:K(t.text)}},qt=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},te=class Mt{options;renderer;textRenderer;constructor(e){this.options=e||be,this.options.renderer=this.options.renderer||new st,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new qt}static parse(e,n){return new Mt(n).parse(e)}static parseInline(e,n){return new Mt(n).parseInline(e)}parse(e,n=!0){let s="";for(let i=0;i<e.length;i++){let a=e[i];if(this.options.extensions?.renderers?.[a.type]){let c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){s+=h||"";continue}}let l=a;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 c=l,h=this.renderer.text(c);for(;i+1<e.length&&e[i+1].type==="text";)c=e[++i],h+=`
|
|
`+this.renderer.text(c);n?s+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):s+=h;continue}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}parseInline(e,n=this.renderer){let s="";for(let i=0;i<e.length;i++){let a=e[i];if(this.options.extensions?.renderers?.[a.type]){let c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=c||"";continue}}let l=a;switch(l.type){case"escape":{s+=n.text(l);break}case"html":{s+=n.html(l);break}case"link":{s+=n.link(l);break}case"image":{s+=n.image(l);break}case"strong":{s+=n.strong(l);break}case"em":{s+=n.em(l);break}case"codespan":{s+=n.codespan(l);break}case"br":{s+=n.br(l);break}case"del":{s+=n.del(l);break}case"text":{s+=n.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}},nt=class{options;block;constructor(t){this.options=t||be}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?ee.lex:ee.lexInline}provideParser(){return this.block?te.parse:te.parseInline}},Pi=class{defaults=$t();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=te;Renderer=st;TextRenderer=qt;Lexer=ee;Tokenizer=it;Hooks=nt;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(let s of t)switch(n=n.concat(e.call(this,s)),s.type){case"table":{let i=s;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,e));for(let a of i.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,e));break}case"list":{let i=s;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=s;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{let l=i[a].flat(1/0);n=n.concat(this.walkTokens(l,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let a=e.renderers[i.name];a?e.renderers[i.name]=function(...l){let c=i.renderer.apply(this,l);return c===!1&&(c=a.apply(this,l)),c}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[i.level];a?a.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),s.extensions=e),n.renderer){let i=this.defaults.renderer||new st(this.defaults);for(let a in n.renderer){if(!(a in i))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let l=a,c=n.renderer[l],h=i[l];i[l]=(...d)=>{let m=c.apply(i,d);return m===!1&&(m=h.apply(i,d)),m||""}}s.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new it(this.defaults);for(let a in n.tokenizer){if(!(a in i))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let l=a,c=n.tokenizer[l],h=i[l];i[l]=(...d)=>{let m=c.apply(i,d);return m===!1&&(m=h.apply(i,d)),m}}s.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new nt;for(let a in n.hooks){if(!(a in i))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let l=a,c=n.hooks[l],h=i[l];nt.passThroughHooks.has(a)?i[l]=d=>{if(this.defaults.async)return Promise.resolve(c.call(i,d)).then(T=>h.call(i,T));let m=c.call(i,d);return h.call(i,m)}:i[l]=(...d)=>{let m=c.apply(i,d);return m===!1&&(m=h.apply(i,d)),m}}s.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,a=n.walkTokens;s.walkTokens=function(l){let c=[];return c.push(a.call(this,l)),i&&(c=c.concat(i.call(this,l))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ee.lex(t,e??this.defaults)}parser(t,e){return te.parse(t,e??this.defaults)}parseMarkdown(t){return(n,s)=>{let i={...s},a={...this.defaults,...i},l=this.onError(!!a.silent,!!a.async);if(this.defaults.async===!0&&i.async===!1)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 n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));a.hooks&&(a.hooks.options=a,a.hooks.block=t);let c=a.hooks?a.hooks.provideLexer():t?ee.lex:ee.lexInline,h=a.hooks?a.hooks.provideParser():t?te.parse:te.parseInline;if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(d=>c(d,a)).then(d=>a.hooks?a.hooks.processAllTokens(d):d).then(d=>a.walkTokens?Promise.all(this.walkTokens(d,a.walkTokens)).then(()=>d):d).then(d=>h(d,a)).then(d=>a.hooks?a.hooks.postprocess(d):d).catch(l);try{a.hooks&&(n=a.hooks.preprocess(n));let d=c(n,a);a.hooks&&(d=a.hooks.processAllTokens(d)),a.walkTokens&&this.walkTokens(d,a.walkTokens);let m=h(d,a);return a.hooks&&(m=a.hooks.postprocess(m)),m}catch(d){return l(d)}}}onError(t,e){return n=>{if(n.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,t){let s="<p>An error occurred:</p><pre>"+K(n.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(n);throw n}}},me=new Pi;function y(t,e){return me.parse(t,e)}y.options=y.setOptions=function(t){return me.setOptions(t),y.defaults=me.defaults,Gn(y.defaults),y};y.getDefaults=$t;y.defaults=be;y.use=function(...t){return me.use(...t),y.defaults=me.defaults,Gn(y.defaults),y};y.walkTokens=function(t,e){return me.walkTokens(t,e)};y.parseInline=me.parseInline;y.Parser=te;y.parser=te.parse;y.Renderer=st;y.TextRenderer=qt;y.Lexer=ee;y.lexer=ee.lex;y.Tokenizer=it;y.Hooks=nt;y.parse=y;var ds=y.options,gs=y.setOptions,ms=y.use,bs=y.walkTokens,ks=y.parseInline;var Ts=te.parse,_s=ee.lex;function Ni(t,e){this.v=t,this.k=e}function er(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,s=Array(e);n<e;n++)s[n]=t[n];return s}function zi(t){if(Array.isArray(t))return t}function Mi(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var s,i,a,l,c=[],h=!0,d=!1;try{if(a=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;h=!1}else for(;!(h=(s=a.call(n)).done)&&(c.push(s.value),c.length!==e);h=!0);}catch(m){d=!0,i=m}finally{try{if(!h&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(d)throw i}}return c}}function $i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ui(t,e){return zi(t)||Mi(t,e)||Bi(t,e)||$i()}function Bi(t,e){if(t){if(typeof t=="string")return er(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?er(t,e):void 0}}function lt(t){var e,n;function s(a,l){try{var c=t[a](l),h=c.value,d=h instanceof Ni;Promise.resolve(d?h.v:h).then(function(m){if(d){var T=a==="return"&&h.k?a:"next";if(!h.k||m.done)return s(T,m);m=t[T](m).value}i(!!c.done,m)},function(m){s("throw",m)})}catch(m){i(2,m)}}function i(a,l){a===2?e.reject(l):e.resolve({value:l,done:a}),(e=e.next)?s(e.key,e.arg):n=null}this._invoke=function(a,l){return new Promise(function(c,h){var d={key:a,arg:l,resolve:c,reject:h,next:null};n?n=n.next=d:(e=n=d,s(a,l))})},typeof t.return!="function"&&(this.return=void 0)}lt.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},lt.prototype.next=function(t){return this._invoke("next",t)},lt.prototype.throw=function(t){return this._invoke("throw",t)},lt.prototype.return=function(t){return this._invoke("return",t)};var gr=Object.entries,tr=Object.setPrototypeOf,Fi=Object.isFrozen,mr=Object.getPrototypeOf,br=Object.getOwnPropertyDescriptor,P=Object.freeze,z=Object.seal,Le=Object.create,kr=typeof Reflect<"u"&&Reflect,nn=kr.apply,rn=kr.construct;P||(P=function(e){return e});z||(z=function(e){return e});nn||(nn=function(e,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),a=2;a<s;a++)i[a-2]=arguments[a];return e.apply(n,i)});rn||(rn=function(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return new e(...s)});var ne=v(Array.prototype.forEach);Array.prototype.indexOf;var Hi=v(Array.prototype.lastIndexOf),nr=v(Array.prototype.pop),Fe=v(Array.prototype.push),Gi=v(Array.prototype.slice),Wi=v(Array.prototype.splice),Ie=Array.isArray,Yt=Tr(Set),Zt=v(Set.prototype.add),He=v(Set.prototype.has),ke=v(String.prototype.toLowerCase),Vt=v(String.prototype.toString),rr=v(String.prototype.match),Ge=v(String.prototype.replace),ir=v(String.prototype.indexOf),ji=v(String.prototype.trim),qi=v(Number.prototype.toString),Yi=v(Boolean.prototype.toString),sr=typeof BigInt>"u"?null:v(BigInt.prototype.toString),or=typeof Symbol>"u"?null:v(Symbol.prototype.toString),G=v(Object.prototype.hasOwnProperty),We=v(Object.prototype.toString),N=v(RegExp.prototype.test),re=Tr(TypeError);function v(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,s=new Array(n>1?n-1:0),i=1;i<n;i++)s[i-1]=arguments[i];return nn(t,e,s)}}function Tr(t){return function(){for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return rn(t,n)}}function _(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ke;if(tr&&tr(t,null),!Ie(e))return t;let s=e.length;for(;s--;){let i=e[s];if(typeof i=="string"){let a=n(i);a!==i&&(Fi(e)||(e[s]=a),i=a)}t[i]=!0}return t}function Zi(t){for(let e=0;e<t.length;e++)G(t,e)||(t[e]=null);return t}function W(t){let e=Le(null);for(let s of gr(t)){var n=Ui(s,2);let i=n[0],a=n[1];G(t,i)&&(Ie(a)?e[i]=Zi(a):a&&typeof a=="object"&&a.constructor===Object?e[i]=W(a):e[i]=a)}return e}function Vi(t){switch(typeof t){case"string":return t;case"number":return qi(t);case"boolean":return Yi(t);case"bigint":return sr?sr(t):"0";case"symbol":return or?or(t):"Symbol()";case"undefined":return We(t);case"function":case"object":{if(t===null)return We(t);let e=t,n=j(e,"toString");if(typeof n=="function"){let s=n(e);return typeof s=="string"?s:We(s)}return We(t)}default:return We(t)}}function j(t,e){for(;t!==null;){let s=br(t,e);if(s){if(s.get)return v(s.get);if(typeof s.value=="function")return v(s.value)}t=mr(t)}function n(){return null}return n}function Xi(t,e){for(;t!==null;){let n=br(t,e);if(n)return n.get?v(n.get):null;t=mr(t)}return null}function Qi(t){try{return N(t,""),!0}catch{return!1}}var ar=P(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Xt=P(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qt=P(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ki=P(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kt=P(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ji=P(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),lr=P(["#text"]),cr=P(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Jt=P(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),ur=P(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ct=P(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),es=z(/{{[\w\W]*|^[\w\W]*}}/g),ts=z(/<%[\w\W]*|^[\w\W]*%>/g),ns=z(/\${[\w\W]*/g),rs=z(/^data-[\-\w.\u00B7-\uFFFF]+$/),is=z(/^aria-[\-\w]+$/),pr=z(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ss=z(/^(?:\w+script|data):/i),os=z(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),as=z(/^html$/i),ls=z(/^[a-z][.\w]*(-[.\w]+)+$/i),en=z(/<[/\w!]/g),fr=z(/<[/\w]/g),cs=z(/<\/no(script|embed|frames)/i),hr=z(/\/>/i),I={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},us=P(_({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),ps=function(){return typeof window>"u"?null:window},fs=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(s=n.getAttribute(i));let a="dompurify"+(s?"#"+s:"");try{return e.createPolicy(a,{createHTML(l){return l},createScriptURL(l){return l}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},dr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ue=function(e,n,s,i){return G(e,n)&&Ie(e[n])?_(i.base?W(i.base):{},e[n],i.transform):s},tn=function(e,n,s){let i=G(e,n)?e[n]:void 0;return i&&typeof i=="object"?W(i):s()};function _r(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ps(),e=f=>_r(f);if(e.version="3.4.17",e.removed=[],!t||!t.document||t.document.nodeType!==I.document||!t.Element)return e.isSupported=!1,e;let n=t.document,s=n,i=s.currentScript;t.DocumentFragment;let a=t.HTMLTemplateElement,l=t.Node,c=t.Element,h=t.NodeFilter;t.NamedNodeMap===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;let d=t.DOMParser,m=t.trustedTypes,T=c.prototype,x=j(T,"cloneNode"),O=j(T,"remove"),S=j(T,"removeAttributeNode"),U=j(T,"nextSibling"),ie=j(T,"childNodes"),Y=j(T,"parentNode"),Te=j(T,"shadowRoot"),_e=j(T,"attributes"),Z=l&&l.prototype?j(l.prototype,"nodeType"):null,se=l&&l.prototype?j(l.prototype,"nodeName"):null,oe=l&&l.prototype?j(l.prototype,"ownerDocument"):null,C=function(r){return Z?Z(r):r.nodeType},Oe=function(r){return se?se(r):r.nodeName},sn=Xi(T,"namespaceURI"),ut=function(r){return sn?sn(r):r.namespaceURI};if(typeof a=="function"){let f=n.createElement("template");f.content&&f.content.ownerDocument&&(n=f.content.ownerDocument)}let B,pe="",pt,on=!1,De=0,an=function(){if(De>0)throw re('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},xe=function(r){an(),De++;try{return B.createHTML(r)}finally{De--}},xr=function(r){an(),De++;try{return B.createScriptURL(r)}finally{De--}},wr=function(){return on||(pt=fs(m,i),on=!0),pt},je=n,ft=je.implementation,ln=je.createNodeIterator,yr=je.createDocumentFragment,Sr=je.getElementsByTagName,Ar=s.importNode,A=dr();e.isSupported=typeof gr=="function"&&typeof Y=="function"&&ft&&ft.createHTMLDocument!==void 0;let Er=es,Rr=ts,vr=ns,Lr=rs,Ir=is,Or=ss,cn=os,Dr=ls,un=pr,E=null,ht=_({},[...ar,...Xt,...Qt,...Kt,...lr]),R=null,dt=_({},[...cr,...Jt,...ur,...ct]),V=Object.seal(Le(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,pn=null,ae=Object.seal(Le(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),fn=!0,gt=!0,hn=!1,mt=!0,J=!1,fe=!0,he=!1,bt=!1,qe=null,Ye=null,kt=!1,we=!1,Ze=!1,Ve=!1,dn=!0,gn=!1,mn="user-content-",Tt=!0,_t=!1,de=null,ye={},ge=null,bn=_({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),kn=null,Tn=_({},["audio","video","img","source","image","track"]),_n=null,xn=_({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Xe="http://www.w3.org/1998/Math/MathML",Qe="http://www.w3.org/2000/svg",X="http://www.w3.org/1999/xhtml",Se=X,xt=!1,wt=null,Cr=_({},[Xe,Qe,X],Vt),wn=P(["mi","mo","mn","ms","mtext"]),yt=_({},wn),yn=P(["annotation-xml"]),St=_({},yn),Pr=_({},["title","style","font","a","script"]),Pe=null,Nr=["application/xhtml+xml","text/html"],zr="text/html",L=null,Ae=null,Mr=n.createElement("form"),Sn=function(r){return r instanceof RegExp||r instanceof Function},At=function(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ae&&Ae===r)return;(!r||typeof r!="object")&&(r={}),r=W(r),Pe=Nr.indexOf(r.PARSER_MEDIA_TYPE)===-1?zr:r.PARSER_MEDIA_TYPE,L=Pe==="application/xhtml+xml"?Vt:ke,E=ue(r,"ALLOWED_TAGS",ht,{transform:L}),R=ue(r,"ALLOWED_ATTR",dt,{transform:L}),wt=ue(r,"ALLOWED_NAMESPACES",Cr,{transform:Vt}),_n=ue(r,"ADD_URI_SAFE_ATTR",xn,{transform:L,base:xn}),kn=ue(r,"ADD_DATA_URI_TAGS",Tn,{transform:L,base:Tn}),ge=ue(r,"FORBID_CONTENTS",bn,{transform:L}),Ce=ue(r,"FORBID_TAGS",W({}),{transform:L}),pn=ue(r,"FORBID_ATTR",W({}),{transform:L}),ye=G(r,"USE_PROFILES")?r.USE_PROFILES&&typeof r.USE_PROFILES=="object"?W(r.USE_PROFILES):r.USE_PROFILES:!1,fn=r.ALLOW_ARIA_ATTR!==!1,gt=r.ALLOW_DATA_ATTR!==!1,hn=r.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=r.ALLOW_SELF_CLOSE_IN_ATTR!==!1,J=r.SAFE_FOR_TEMPLATES||!1,fe=r.SAFE_FOR_XML!==!1,he=r.WHOLE_DOCUMENT||!1,we=r.RETURN_DOM||!1,Ze=r.RETURN_DOM_FRAGMENT||!1,Ve=r.RETURN_TRUSTED_TYPE||!1,kt=r.FORCE_BODY||!1,dn=r.SANITIZE_DOM!==!1,gn=r.SANITIZE_NAMED_PROPS||!1,Tt=r.KEEP_CONTENT!==!1,_t=r.IN_PLACE||!1,un=Qi(r.ALLOWED_URI_REGEXP)?r.ALLOWED_URI_REGEXP:pr,Se=typeof r.NAMESPACE=="string"?r.NAMESPACE:X,yt=tn(r,"MATHML_TEXT_INTEGRATION_POINTS",()=>_({},wn)),St=tn(r,"HTML_INTEGRATION_POINTS",()=>_({},yn));let o=tn(r,"CUSTOM_ELEMENT_HANDLING",()=>Le(null));if(V=Le(null),G(o,"tagNameCheck")&&Sn(o.tagNameCheck)&&(V.tagNameCheck=o.tagNameCheck),G(o,"attributeNameCheck")&&Sn(o.attributeNameCheck)&&(V.attributeNameCheck=o.attributeNameCheck),G(o,"allowCustomizedBuiltInElements")&&typeof o.allowCustomizedBuiltInElements=="boolean"&&(V.allowCustomizedBuiltInElements=o.allowCustomizedBuiltInElements),z(V),J&&(gt=!1),Ze&&(we=!0),ye&&(E=_({},lr),R=Le(null),ye.html===!0&&(_(E,ar),_(R,cr)),ye.svg===!0&&(_(E,Xt),_(R,Jt),_(R,ct)),ye.svgFilters===!0&&(_(E,Qt),_(R,Jt),_(R,ct)),ye.mathMl===!0&&(_(E,Kt),_(R,ur),_(R,ct))),ae.tagCheck=null,ae.attributeCheck=null,G(r,"ADD_TAGS")&&(typeof r.ADD_TAGS=="function"?ae.tagCheck=r.ADD_TAGS:Ie(r.ADD_TAGS)&&(E===ht&&(E=W(E)),_(E,r.ADD_TAGS,L))),G(r,"ADD_ATTR")&&(typeof r.ADD_ATTR=="function"?ae.attributeCheck=r.ADD_ATTR:Ie(r.ADD_ATTR)&&(R===dt&&(R=W(R)),_(R,r.ADD_ATTR,L))),G(r,"ADD_FORBID_CONTENTS")&&Ie(r.ADD_FORBID_CONTENTS)&&(ge===bn&&(ge=W(ge)),_(ge,r.ADD_FORBID_CONTENTS,L)),Tt&&(E["#text"]=!0),he&&_(E,["html","head","body"]),E.table&&(_(E,["tbody"]),delete Ce.tbody),r.TRUSTED_TYPES_POLICY){if(typeof r.TRUSTED_TYPES_POLICY.createHTML!="function")throw re('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof r.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw re('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let u=B;B=r.TRUSTED_TYPES_POLICY;try{pe=xe("")}catch(p){throw B=u,p}}else r.TRUSTED_TYPES_POLICY===null?(B=void 0,pe=""):(B===void 0&&(B=wr()),B&&typeof pe=="string"&&(pe=xe("")));P&&P(r),Ae=r},An=_({},[...Xt,...Qt,...Ki]),En=_({},[...Kt,...Ji]),$r=function(r,o,u){return o.namespaceURI===X?r==="svg":o.namespaceURI===Xe?r==="svg"&&(u==="annotation-xml"||yt[u]):!!An[r]},Ur=function(r,o,u){return o.namespaceURI===X?r==="math":o.namespaceURI===Qe?r==="math"&&St[u]:!!En[r]},Br=function(r,o,u){return o.namespaceURI===Qe&&!St[u]||o.namespaceURI===Xe&&!yt[u]?!1:!En[r]&&(Pr[r]||!An[r])},Fr=function(r){let o=ut(r),u=ke(Oe(r)),p=Y(r),g,b;return p&&C(p)===I.element?(g={namespaceURI:ut(p)},b=ke(Oe(p))):(g={namespaceURI:Se},b="template"),wt[o]?o===Qe?$r(u,g,b):o===Xe?Ur(u,g,b):o===X?Br(u,g,b):!!(Pe==="application/xhtml+xml"&&wt[o]):!1},le=function(r){Fe(e.removed,{element:r});try{Y(r).removeChild(r)}catch{if(O(r),!Y(r))throw re("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rn=function(r,o,u){try{S(r,o)}catch{try{r.removeAttribute(u)}catch{}}},Et=function(r){vt(r);let o=ie(r);o&&ne(Gi(o),p=>{try{O(p)}catch{}});let u=C(r)===I.element?_e(r):null;if(u)for(let p=u.length-1;p>=0;--p){let g=u[p],b=g&&g.name;typeof b=="string"&&Rn(r,g,b)}},Ee=function(r,o,u){if(!u)try{u=o.getAttributeNode(r)}catch{u=null}Fe(e.removed,{attribute:u||null,from:o});try{u?S(o,u):o.removeAttribute(r)}catch{try{o.removeAttribute(r)}catch{}}if(r==="is")if(we||Ze)try{le(o)}catch{}else try{o.setAttribute(r,"")}catch{}},vn=function(r){let o=_e(r);if(o)for(let u=o.length-1;u>=0;--u){let p=o[u],g=p&&p.name;typeof g!="string"||R[L(g)]||Rn(r,p,g)}},Rt=function(r,o){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,p=[r];for(;p.length>0;){let g=p.pop();if(o(g)===!1)continue;if(u&&C(g)===I.element){let k=Te(g);ce(k)&&p.push(k)}let b=ie(g);if(b)for(let k=b.length-1;k>=0;--k)p.push(b[k])}},vt=function(r){Rt(r,o=>{C(o)===I.element&&vn(o)})},Lt=function(r){let o=[];return Rt(r,u=>{o.push(u)},!0),o},Hr=function(r,o){let u=Yt();ne(Lt(r),p=>{C(p)===I.element&&Zt(u,p)}),ne(o,p=>{C(p)===I.element&&!He(u,p)&&vn(p)})},Ln=function(r,o){let u=!1;return ne(e.removed,p=>{p.element&&(u=u||p.element===r,vt(p.element))}),Hr(r,o),u},Gr=8,Wr=function(r,o){let u=de,p=null,g=()=>(p||(p=Yt(),ne(o,b=>{Zt(p,b)})),p);for(let b=0;;b++){let k=Lt(r),D=[r],Q=!1;if(ne(k,M=>{C(M)===I.documentFragment?Fe(D,M):!Q&&!He(u,M)&&(Q=He(g(),M))}),!Q)return;if(b>=Gr)throw re("the tree kept changing during in-place sanitization; refusing to return it");ne(D,(M,F)=>{jr(M,F>0,r,g())})}},jr=function(r,o,u,p){let g=It(r),b;for(;b=g.nextNode();)!He(p,b)||He(de,b)||(o&&q(A.uponSanitizeShadowNode,b,null),Dt(b,u),Ct(b,u),ce(b.content)&&ze(b.content))},qr=function(r){de&&Zt(de,r)},In=function(r,o){return fe?r==="patchsrc"?!0:r==="for"&&o!=="label"&&o!=="output":!1},Yr=function(r){fe&&Rt(r,o=>{let u=C(o);if(u===I.processingInstruction||u===I.comment&&N(fr,o.data)){try{O(o)}catch{}return!1}if(u===I.element){let p=o,g=L(Oe(o));try{p.hasAttribute&&p.hasAttribute("patchsrc")&&p.removeAttribute("patchsrc"),p.hasAttribute&&p.hasAttribute("for")&&In("for",g)&&p.removeAttribute("for")}catch{}}return!0})},On=function(r){let o=null,u=null;if(kt)r="<remove></remove>"+r;else{let b=rr(r,/^[\r\n\t ]+/);u=b&&b[0]}Pe==="application/xhtml+xml"&&Se===X&&(r='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+r+"</body></html>");let p=B?xe(r):r;if(Se===X)try{o=new d().parseFromString(p,Pe)}catch{}if(!o||!o.documentElement){o=ft.createDocument(Se,"template",null);try{o.documentElement.innerHTML=xt?pe:p}catch{}}let g=o.body||o.documentElement;return r&&u&&g.insertBefore(n.createTextNode(u),g.childNodes[0]||null),Se===X?Sr.call(o,he?"html":"body")[0]:he?o.documentElement:g},It=function(r){let o=oe?oe(r):r.ownerDocument;return ln.call(o||r,r,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Ke=function(r){return r=Ge(r,Er," "),r=Ge(r,Rr," "),r=Ge(r,vr," "),r},Ot=function(r){var o;Dn(r);let u=(o=r.querySelectorAll)===null||o===void 0?void 0:o.call(r,"template");u&&ne(u,p=>{ce(p.content)&&Ot(p.content)})},Dn=function(r){r.normalize();let o=oe?oe(r):r.ownerDocument,u=ln.call(o||r,r,h.SHOW_TEXT|h.SHOW_COMMENT|h.SHOW_CDATA_SECTION|h.SHOW_PROCESSING_INSTRUCTION,null),p=u.nextNode();for(;p;)p.data=Ke(p.data),p=u.nextNode()},Je=function(r){let o=se?se(r):null;return typeof o!="string"||L(o)!=="form"?!1:typeof r.nodeName!="string"||typeof r.textContent!="string"||typeof r.removeChild!="function"||r.attributes!==_e(r)||typeof r.removeAttribute!="function"||typeof r.removeAttributeNode!="function"||typeof r.getAttributeNode!="function"||typeof r.setAttribute!="function"||typeof r.namespaceURI!="string"||typeof r.insertBefore!="function"||typeof r.hasChildNodes!="function"||r.nodeType!==Z(r)||r.childNodes!==ie(r)},ce=function(r){if(!Z||typeof r!="object"||r===null)return!1;try{return Z(r)===I.documentFragment}catch{return!1}},Ne=function(r){if(!Z||typeof r!="object"||r===null)return!1;try{return typeof Z(r)=="number"}catch{return!1}};function q(f,r,o){f.length!==0&&ne(f,u=>{u.call(e,r,o,Ae)})}let Zr=function(r,o){return!!(fe&&r.hasChildNodes()&&!Ne(r.firstElementChild)&&N(en,r.textContent)&&N(en,r.innerHTML)||fe&&us[o]&&C(r)===I.element&&ut(r)===X&&(Ne(r.firstElementChild)||typeof r.textContent=="string"&&N(en,r.textContent))||r.nodeType===I.processingInstruction||fe&&r.nodeType===I.comment&&N(fr,r.data))},et=function(r,o){if(r instanceof RegExp)return N(r,o);if(r instanceof Function){for(var u=arguments.length,p=new Array(u>2?u-2:0),g=2;g<u;g++)p[g-2]=arguments[g];return!!r(o,...p)}return!1},Vr=function(r,o,u){if(!Ce[o]&&Nn(o)&&et(V.tagNameCheck,o))return!1;if(Tt&&!ge[o]&&!ge[ke(o)]){let p=Y(r),g=ie(r);if(g&&p){let b=g.length;for(let k=b-1;k>=0;--k){let D=r===u?x(g[k],!0):g[k];p.insertBefore(D,U(r))}}}return le(r),!0},Cn=function(r,o,u,p){return r.length===0?o:o===u||o===p?W(o):o},Re=function(r,o){return r===o||Y(r)!==null?!1:(_t&&vt(r),!0)},Dt=function(r,o){if(qr(r),q(A.beforeSanitizeElements,r,null),Re(r,o))return!0;if(Je(r))return le(r),!0;let u=L(Oe(r));if(E=Cn(A.uponSanitizeElement,E,ht,qe),q(A.uponSanitizeElement,r,{tagName:u,allowedTags:E}),Re(r,o))return!0;if(Zr(r,u))return le(r),!0;if(Ce[u]||!(ae.tagCheck instanceof Function&&ae.tagCheck(u))&&!E[u]){let p=Vr(r,u,o);return p===!1&&(q(A.afterSanitizeElements,r,null),Re(r,o))?!0:p}if(C(r)===I.element&&!Fr(r)||(u==="noscript"||u==="noembed"||u==="noframes")&&N(cs,r.innerHTML))return le(r),!0;if(J&&r.nodeType===I.text){let p=Ke(r.textContent);r.textContent!==p&&(Fe(e.removed,{element:r.cloneNode()}),r.textContent=p)}return q(A.afterSanitizeElements,r,null),Re(r,o)},Pn=function(r,o,u){if(pn[o]||In(o,r)||dn&&(o==="id"||o==="name")&&(u in n||u in Mr))return!1;let p=R[o]||ae.attributeCheck instanceof Function&&ae.attributeCheck(o,r);return gt&&N(Lr,o)||fn&&N(Ir,o)?!0:p?_n[o]||N(un,Ge(u,cn,""))||(o==="src"||o==="xlink:href"||o==="href")&&r!=="script"&&ir(u,"data:")===0&&kn[r]||hn&&!N(Or,Ge(u,cn,""))?!0:!u:Nn(r)&&et(V.tagNameCheck,r)&&et(V.attributeNameCheck,o,r)||o==="is"&&V.allowCustomizedBuiltInElements&&et(V.tagNameCheck,u)},Xr=_({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Nn=function(r){return!Xr[ke(r)]&&N(Dr,r)},Qr=function(r,o,u,p){if(B&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!u)switch(m.getAttributeType(r,o)){case"TrustedHTML":return xe(p);case"TrustedScriptURL":return xr(p)}return p},Kr=function(r,o,u,p){try{return u?r.setAttributeNS(u,o,p):r.setAttribute(o,p),Je(r)?(le(r),!1):!0}catch{return Ee(o,r),!1}},zn=function(r,o){return fe&&N(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,o)?!0:ke(r)==="attributename"&&rr(o,"href")!==null},Ct=function(r,o){if(q(A.beforeSanitizeAttributes,r,null),Re(r,o))return;let u=r.attributes;if(!u||Je(r))return;R=Cn(A.uponSanitizeAttribute,R,dt,Ye);let p={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:R,forceKeepAttr:void 0},g=u.length,b=L(r.nodeName);for(;g--;){let k=u[g],D=k.name,Q=k.namespaceURI,M=k.value,F=L(D),ve=M,H=D==="value"?ve:ji(ve),Mn=!1;if(p.attrName=F,p.attrValue=H,p.keepAttr=!0,p.forceKeepAttr=void 0,q(A.uponSanitizeAttribute,r,p),H=p.attrValue,gn&&(F==="id"||F==="name")&&ir(H,mn)!==0&&(Ee(D,r,k),H=mn+H,Mn=!0),zn(D,H)){Ee(D,r,k);continue}if(!p.forceKeepAttr){if(!p.keepAttr){Ee(D,r,k);continue}if(!mt&&N(hr,H)){Ee(D,r,k);continue}if(J&&(H=Ke(H)),!Pn(b,F,H)){Ee(D,r,k);continue}H=Qr(b,F,Q,H),H!==ve&&Kr(r,D,Q,H)&&Mn&&nr(e.removed)}}q(A.afterSanitizeAttributes,r,null),Re(r,o)},ze=function(r){let o=null,u=It(r);for(q(A.beforeSanitizeShadowDOM,r,null);o=u.nextNode();)if(q(A.uponSanitizeShadowNode,o,null),Dt(o,r),Ct(o,r),ce(o.content)&&ze(o.content),C(o)===I.element){let p=Te(o);ce(p)&&(Pt(p),ze(p))}J&&Dn(r),q(A.afterSanitizeShadowDOM,r,null)},Pt=function(r){let o=[{node:r,shadow:null}];for(;o.length>0;){let u=o.pop();if(u.shadow){ze(u.shadow);continue}let p=u.node,g=C(p)===I.element,b=ie(p);if(b)for(let k=b.length-1;k>=0;--k)o.push({node:b[k],shadow:null});if(g){let k=se?se(p):null;if(typeof k=="string"&&L(k)==="template"){let D=p.content;ce(D)&&o.push({node:D,shadow:null})}}if(g){let k=Te(p);ce(k)&&o.push({node:null,shadow:k},{node:k,shadow:null})}}};return e.sanitize=function(f){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=null,u=null,p=null,g=null;if(xt=!f,xt&&(f="<!-->"),typeof f!="string"&&!Ne(f)&&(f=Vi(f),typeof f!="string"))throw re("dirty is not a string, aborting");if(!e.isSupported)return f;bt?(E=qe,R=Ye):At(r),(A.uponSanitizeElement.length>0||A.uponSanitizeAttribute.length>0)&&(E=W(E)),A.uponSanitizeAttribute.length>0&&(R=W(R)),e.removed=[];let b=_t&&typeof f!="string"&&Ne(f),k=[],D=de;if(b){Yr(f);let F=Oe(f);if(typeof F=="string"){let ve=L(F);if(!E[ve]||Ce[ve])throw Et(f),re("root node is forbidden and cannot be sanitized in-place")}if(Je(f))throw Et(f),re("root node is clobbered and cannot be sanitized in-place");k=Lt(f),de=Yt()}else if(Ne(f))o=On("<!---->"),u=o.ownerDocument.importNode(f,!0),u.nodeType===I.element&&u.nodeName==="BODY"||u.nodeName==="HTML"?o=u:o.appendChild(u),Pt(o);else{if(!we&&!J&&!he&&f.indexOf("<")===-1)return B&&Ve?xe(f):f;if(o=On(f),!o)return we?null:Ve?pe:""}o&&kt&&le(o.firstChild);let Q=b?f:o;try{b&&Pt(f);let F=It(Q);for(;p=F.nextNode();)Dt(p,Q),Ct(p,Q),ce(p.content)&&ze(p.content);b&&Wr(f,k)}catch(F){throw b&&(Et(f),Ln(f,k)),F}finally{de=D}if(b){if(Ln(f,k))throw re("a node selected for removal could not be safely returned; refusing to sanitize in place");return J&&Ot(f),f}if(we){if(J&&Ot(o),Ze)for(g=yr.call(o.ownerDocument);o.firstChild;)g.appendChild(o.firstChild);else g=o;return(R.shadowroot||R.shadowrootmode)&&(g=Ar.call(s,g,!0)),g}let M=he?o.outerHTML:o.innerHTML;return he&&E["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&N(as,o.ownerDocument.doctype.name)&&(M="<!DOCTYPE "+o.ownerDocument.doctype.name+`>
|
|
`+M),J&&(M=Ke(M)),B&&Ve?xe(M):M},e.setConfig=function(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};At(f),bt=!0,qe=E,Ye=R},e.clearConfig=function(){Ae=null,bt=!1,qe=null,Ye=null,B=pt,pe=""},e.isValidAttribute=function(f,r,o){Ae||At({});let u=L(f),p=L(r);return typeof o=="string"&&(zn(r,o)||!mt&&N(hr,o))?!1:Pn(u,p,o)},e.addHook=function(f,r){typeof r=="function"&&G(A,f)&&Fe(A[f],r)},e.removeHook=function(f,r){if(G(A,f)){if(r!==void 0){let o=Hi(A[f],r);return o===-1?void 0:Wi(A[f],o,1)[0]}return nr(A[f])}},e.removeHooks=function(f){G(A,f)&&(A[f]=[])},e.removeAllHooks=function(){A=dr()},e}var hs=_r();export{hs as DOMPurify,y as marked};
|
|
/*! Bundled license information:
|
|
|
|
dompurify/dist/purify.es.mjs:
|
|
(*! @license DOMPurify 3.4.17 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.17/LICENSE *)
|
|
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
*/
|