ai-cli-online 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/package.json +1 -1
- package/server/dist/index.js +22 -6
- package/server/dist/websocket.d.ts +2 -0
- package/server/dist/websocket.js +12 -5
- package/server/package.json +4 -2
- package/shared/package.json +1 -1
- package/web/dist/assets/{index-79TY7o1G.css → index-BySW4V2D.css} +1 -1
- package/web/dist/assets/index-E685CW_H.js +38 -0
- package/web/dist/assets/markdown-BERZKN_L.js +60 -0
- package/web/dist/assets/react-vendor-BCIvbQoU.js +32 -0
- package/web/dist/assets/terminal-CFozNkMS.js +108 -0
- package/web/dist/index.html +5 -2
- package/web/package.json +1 -1
- package/web/dist/assets/index-mcWZLwbP.js +0 -235
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
var Bn=Object.defineProperty;var Hn=(n,e,t)=>e in n?Bn(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var A=(n,e,t)=>Hn(n,typeof e!="symbol"?e+"":e,t);function kt(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ie=kt();function un(n){ie=n}var Se={exec:()=>null};function T(n,e=""){let t=typeof n=="string"?n:n.source,s={replace:(r,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(v.caret,"$1"),t=t.replace(r,o),s},getRegex:()=>new RegExp(t,e)};return s}var Gn=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),v={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]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\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")},Wn=/^(?:[ \t]*(?:\n|$))+/,qn=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zn=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ye=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Yn=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,bt=/(?:[*+-]|\d{1,9}[.)])/,hn=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,fn=T(hn).replace(/bull/g,bt).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(),jn=T(hn).replace(/bull/g,bt).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(),xt=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xn=/^[^\n]+/,Tt=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Qn=T(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Tt).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Vn=T(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,bt).getRegex(),He="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",wt=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Kn=T("^ {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",wt).replace("tag",He).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gn=T(xt).replace("hr",ye).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",He).getRegex(),Jn=T(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gn).getRegex(),At={blockquote:Jn,code:qn,def:Qn,fences:Zn,heading:Yn,hr:ye,html:Kn,lheading:fn,list:Vn,newline:Wn,paragraph:gn,table:Se,text:Xn},Qt=T("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ye).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",He).getRegex(),er={...At,lheading:jn,table:Qt,paragraph:T(xt).replace("hr",ye).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Qt).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",He).getRegex()},tr={...At,html:T(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",wt).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:Se,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:T(xt).replace("hr",ye).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",fn).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nr=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,rr=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,dn=/^( {2,}|\\)\n(?!\s*$)/,sr=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ge=/[\p{P}\p{S}]/u,_t=/[\s\p{P}\p{S}]/u,mn=/[^\s\p{P}\p{S}]/u,ir=T(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,_t).getRegex(),kn=/(?!~)[\p{P}\p{S}]/u,lr=/(?!~)[\s\p{P}\p{S}]/u,ar=/(?:[^\s\p{P}\p{S}]|~)/u,or=T(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Gn?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bn=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,cr=T(bn,"u").replace(/punct/g,Ge).getRegex(),pr=T(bn,"u").replace(/punct/g,kn).getRegex(),xn="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ur=T(xn,"gu").replace(/notPunctSpace/g,mn).replace(/punctSpace/g,_t).replace(/punct/g,Ge).getRegex(),hr=T(xn,"gu").replace(/notPunctSpace/g,ar).replace(/punctSpace/g,lr).replace(/punct/g,kn).getRegex(),fr=T("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,mn).replace(/punctSpace/g,_t).replace(/punct/g,Ge).getRegex(),gr=T(/\\(punct)/,"gu").replace(/punct/g,Ge).getRegex(),dr=T(/^<(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(),mr=T(wt).replace("(?:-->|$)","-->").getRegex(),kr=T("^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",mr).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ue=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,br=T(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ue).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Tn=T(/^!?\[(label)\]\[(ref)\]/).replace("label",Ue).replace("ref",Tt).getRegex(),wn=T(/^!?\[(ref)\](?:\[\])?/).replace("ref",Tt).getRegex(),xr=T("reflink|nolink(?!\\()","g").replace("reflink",Tn).replace("nolink",wn).getRegex(),Vt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Et={_backpedal:Se,anyPunctuation:gr,autolink:dr,blockSkip:or,br:dn,code:rr,del:Se,emStrongLDelim:cr,emStrongRDelimAst:ur,emStrongRDelimUnd:fr,escape:nr,link:br,nolink:wn,punctuation:ir,reflink:Tn,reflinkSearch:xr,tag:kr,text:sr,url:Se},Tr={...Et,link:T(/^!?\[(label)\]\((.*?)\)/).replace("label",Ue).getRegex(),reflink:T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ue).getRegex()},ut={...Et,emStrongRDelimAst:hr,emStrongLDelim:pr,url:T(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Vt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:T(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Vt).getRegex()},wr={...ut,br:T(dn).replace("{2,}","*").getRegex(),text:T(ut.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Me={normal:At,gfm:er,pedantic:tr},ke={normal:Et,gfm:ut,breaks:wr,pedantic:Tr},Ar={"&":"&","<":"<",">":">",'"':""","'":"'"},Kt=n=>Ar[n];function V(n,e){if(e){if(v.escapeTest.test(n))return n.replace(v.escapeReplace,Kt)}else if(v.escapeTestNoEncode.test(n))return n.replace(v.escapeReplaceNoEncode,Kt);return n}function Jt(n){try{n=encodeURI(n).replace(v.percentDecode,"%")}catch{return null}return n}function en(n,e){var a;let t=n.replace(v.findPipe,(o,l,h)=>{let c=!1,f=l;for(;--f>=0&&h[f]==="\\";)c=!c;return c?"|":" |"}),s=t.split(v.splitPipe),r=0;if(s[0].trim()||s.shift(),s.length>0&&!((a=s.at(-1))!=null&&a.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(v.slashPipe,"|");return s}function be(n,e,t){let s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function _r(n,e){if(n.indexOf(e[1])===-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}function tn(n,e,t,s,r){let a=e.href,o=e.title||null,l=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;let h={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:a,title:o,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,h}function Er(n,e,t){let s=n.match(t.other.indentCodeCompensation);if(s===null)return e;let r=s[1];return e.split(`
|
|
3
|
+
`).map(a=>{let o=a.match(t.other.beginningSpace);if(o===null)return a;let[l]=o;return l.length>=r.length?a.slice(r.length):a}).join(`
|
|
4
|
+
`)}var Fe=class{constructor(n){A(this,"options");A(this,"rules");A(this,"lexer");this.options=n||ie}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:be(t,`
|
|
5
|
+
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let t=e[0],s=Er(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){let e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){let s=be(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){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:be(e[0],`
|
|
6
|
+
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let t=be(e[0],`
|
|
7
|
+
`).split(`
|
|
8
|
+
`),s="",r="",a=[];for(;t.length>0;){let o=!1,l=[],h;for(h=0;h<t.length;h++)if(this.rules.other.blockquoteStart.test(t[h]))l.push(t[h]),o=!0;else if(!o)l.push(t[h]);else break;t=t.slice(h);let c=l.join(`
|
|
9
|
+
`),f=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
|
+
${c}`:c,r=r?`${r}
|
|
12
|
+
${f}`:f;let k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,a,!0),this.lexer.state.top=k,t.length===0)break;let m=a.at(-1);if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){let u=m,w=u.raw+`
|
|
13
|
+
`+t.join(`
|
|
14
|
+
`),x=this.blockquote(w);a[a.length-1]=x,s=s.substring(0,s.length-u.raw.length)+x.raw,r=r.substring(0,r.length-u.text.length)+x.text;break}else if((m==null?void 0:m.type)==="list"){let u=m,w=u.raw+`
|
|
15
|
+
`+t.join(`
|
|
16
|
+
`),x=this.list(w);a[a.length-1]=x,s=s.substring(0,s.length-m.raw.length)+x.raw,r=r.substring(0,r.length-u.raw.length)+x.raw,t=w.substring(a.at(-1).raw.length).split(`
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:a,text:r}}}list(n){var t,s;let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),a=r.length>1,o={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let l=this.rules.other.listItemRegex(r),h=!1;for(;n;){let f=!1,k="",m="";if(!(e=l.exec(n))||this.rules.block.hr.test(n))break;k=e[0],n=n.substring(k.length);let u=e[2].split(`
|
|
18
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,W=>" ".repeat(3*W.length)),w=n.split(`
|
|
19
|
+
`,1)[0],x=!u.trim(),y=0;if(this.options.pedantic?(y=2,m=u.trimStart()):x?y=e[1].length+1:(y=e[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,m=u.slice(y),y+=e[1].length),x&&this.rules.other.blankLine.test(w)&&(k+=w+`
|
|
20
|
+
`,n=n.substring(w.length+1),f=!0),!f){let W=this.rules.other.nextBulletRegex(y),le=this.rules.other.hrRegex(y),K=this.rules.other.fencesBeginRegex(y),I=this.rules.other.headingBeginRegex(y),J=this.rules.other.htmlBeginRegex(y);for(;n;){let ee=n.split(`
|
|
21
|
+
`,1)[0],te;if(w=ee,this.options.pedantic?(w=w.replace(this.rules.other.listReplaceNesting," "),te=w):te=w.replace(this.rules.other.tabCharGlobal," "),K.test(w)||I.test(w)||J.test(w)||W.test(w)||le.test(w))break;if(te.search(this.rules.other.nonSpaceChar)>=y||!w.trim())m+=`
|
|
22
|
+
`+te.slice(y);else{if(x||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||K.test(u)||I.test(u)||le.test(u))break;m+=`
|
|
23
|
+
`+w}!x&&!w.trim()&&(x=!0),k+=ee+`
|
|
24
|
+
`,n=n.substring(ee.length+1),u=te.slice(y)}}o.loose||(h?o.loose=!0:this.rules.other.doubleBlankLine.test(k)&&(h=!0)),o.items.push({type:"list_item",raw:k,task:!!this.options.gfm&&this.rules.other.listIsTask.test(m),loose:!1,text:m,tokens:[]}),o.raw+=k}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let f of o.items){if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),f.task){if(f.text=f.text.replace(this.rules.other.listReplaceTask,""),((t=f.tokens[0])==null?void 0:t.type)==="text"||((s=f.tokens[0])==null?void 0:s.type)==="paragraph"){f.tokens[0].raw=f.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),f.tokens[0].text=f.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let m=this.lexer.inlineQueue.length-1;m>=0;m--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)){this.lexer.inlineQueue[m].src=this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask,"");break}}let k=this.rules.other.listTaskCheckbox.exec(f.raw);if(k){let m={type:"checkbox",raw:k[0]+" ",checked:k[0]!=="[ ]"};f.checked=m.checked,o.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=m.raw+f.tokens[0].raw,f.tokens[0].text=m.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(m)):f.tokens.unshift({type:"paragraph",raw:m.raw,text:m.raw,tokens:[m]}):f.tokens.unshift(m)}}if(!o.loose){let k=f.tokens.filter(u=>u.type==="space"),m=k.length>0&&k.some(u=>this.rules.other.anyLine.test(u.raw));o.loose=m}}if(o.loose)for(let f of o.items){f.loose=!0;for(let k of f.tokens)k.type==="text"&&(k.type="paragraph")}return o}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let 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){var o;let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let t=en(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(o=e[3])!=null&&o.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
+
`):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.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<t.length;l++)a.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:a.align[l]});for(let l of r)a.rows.push(en(l,a.header.length).map((h,c)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:a.align[c]})));return a}}lheading(n){let 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){let e=this.rules.block.paragraph.exec(n);if(e){let t=e[1].charAt(e[1].length-1)===`
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){let 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){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let 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){let e=this.rules.inline.link.exec(n);if(e){let t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;let a=be(t.slice(0,-1),"\\");if((t.length-a.length)%2===0)return}else{let a=_r(e[2],"()");if(a===-2)return;if(a>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,o).trim(),e[3]=""}}let s=e[2],r="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],r=a[3])}else r=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(t)?s=s.slice(1):s=s.slice(1,-1)),tn(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))){let s=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=e[s.toLowerCase()];if(!r){let a=t[0].charAt(0);return{type:"text",raw:a,text:a}}return tn(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))){let r=[...s[0]].length-1,a,o,l=r,h=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+r);(s=c.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(o=[...a].length,s[3]||s[4]){l+=o;continue}else if((s[5]||s[6])&&r%3&&!((r+o)%3)){h+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+h);let f=[...s[0]][0].length,k=n.slice(0,r+s.index+f+o);if(Math.min(r,o)%2){let u=k.slice(1,-1);return{type:"em",raw:k,text:u,tokens:this.lexer.inlineTokens(u)}}let m=k.slice(2,-2);return{type:"strong",raw:k,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," "),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){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let 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){let 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){var t;let e;if(e=this.rules.inline.url.exec(n)){let s,r;if(e[2]==="@")s=e[0],r="mailto:"+s;else{let a;do a=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(a!==e[0]);s=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},H=class ht{constructor(e){A(this,"tokens");A(this,"options");A(this,"state");A(this,"inlineQueue");A(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ie,this.options.tokenizer=this.options.tokenizer||new Fe,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 t={other:v,block:Me.normal,inline:ke.normal};this.options.pedantic?(t.block=Me.pedantic,t.inline=ke.pedantic):this.options.gfm&&(t.block=Me.gfm,this.options.breaks?t.inline=ke.breaks:t.inline=ke.gfm),this.tokenizer.rules=t}static get rules(){return{block:Me,inline:ke}}static lex(e,t){return new ht(t).lex(e)}static lexInline(e,t){return new ht(t).inlineTokens(e)}lex(e){e=e.replace(v.carriageReturn,`
|
|
27
|
+
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){let s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){var r,a,o;for(this.options.pedantic&&(e=e.replace(v.tabCharGlobal," ").replace(v.spaceLine,""));e;){let l;if((a=(r=this.options.extensions)==null?void 0:r.block)!=null&&a.some(c=>(l=c.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);let c=t.at(-1);l.raw.length===1&&c!==void 0?c.raw+=`
|
|
28
|
+
`:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);let c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
29
|
+
`)?"":`
|
|
30
|
+
`)+l.raw,c.text+=`
|
|
31
|
+
`+l.text,this.inlineQueue.at(-1).src=c.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);let c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
32
|
+
`)?"":`
|
|
33
|
+
`)+l.raw,c.text+=`
|
|
34
|
+
`+l.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},t.push(l));continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let h=e;if((o=this.options.extensions)!=null&&o.startBlock){let c=1/0,f=e.slice(1),k;this.options.extensions.startBlock.forEach(m=>{k=m.call({lexer:this},f),typeof k=="number"&&k>=0&&(c=Math.min(c,k))}),c<1/0&&c>=0&&(h=e.substring(0,c+1))}if(this.state.top&&(l=this.tokenizer.paragraph(h))){let c=t.at(-1);s&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=(c.raw.endsWith(`
|
|
35
|
+
`)?"":`
|
|
36
|
+
`)+l.raw,c.text+=`
|
|
37
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(l),s=h.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);let c=t.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=(c.raw.endsWith(`
|
|
38
|
+
`)?"":`
|
|
39
|
+
`)+l.raw,c.text+=`
|
|
40
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var h,c,f,k,m;let s=e,r=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)u.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(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let a;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)a=r[2]?r[2].length:0,s=s.slice(0,r.index+a)+"["+"a".repeat(r[0].length-a-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=((c=(h=this.options.hooks)==null?void 0:h.emStrongMask)==null?void 0:c.call({lexer:this},s))??s;let o=!1,l="";for(;e;){o||(l=""),o=!1;let u;if((k=(f=this.options.extensions)==null?void 0:f.inline)!=null&&k.some(x=>(u=x.call({lexer:this},e,t))?(e=e.substring(u.raw.length),t.push(u),!0):!1))continue;if(u=this.tokenizer.escape(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.tag(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.link(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(u.raw.length);let x=t.at(-1);u.type==="text"&&(x==null?void 0:x.type)==="text"?(x.raw+=u.raw,x.text+=u.text):t.push(u);continue}if(u=this.tokenizer.emStrong(e,s,l)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.codespan(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.br(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.del(e)){e=e.substring(u.raw.length),t.push(u);continue}if(u=this.tokenizer.autolink(e)){e=e.substring(u.raw.length),t.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(e))){e=e.substring(u.raw.length),t.push(u);continue}let w=e;if((m=this.options.extensions)!=null&&m.startInline){let x=1/0,y=e.slice(1),W;this.options.extensions.startInline.forEach(le=>{W=le.call({lexer:this},y),typeof W=="number"&&W>=0&&(x=Math.min(x,W))}),x<1/0&&x>=0&&(w=e.substring(0,x+1))}if(u=this.tokenizer.inlineText(w)){e=e.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(l=u.raw.slice(-1)),o=!0;let x=t.at(-1);(x==null?void 0:x.type)==="text"?(x.raw+=u.raw,x.text+=u.text):t.push(u);continue}if(e){let x="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(x)}}return t}},Be=class{constructor(n){A(this,"options");A(this,"parser");this.options=n||ie}space(n){return""}code({text:n,lang:e,escaped:t}){var a;let s=(a=(e||"").match(v.notSpaceStart))==null?void 0:a[0],r=n.replace(v.endingNewline,"")+`
|
|
41
|
+
`;return s?'<pre><code class="language-'+V(s)+'">'+(t?r:V(r,!0))+`</code></pre>
|
|
42
|
+
`:"<pre><code>"+(t?r:V(r,!0))+`</code></pre>
|
|
43
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
44
|
+
${this.parser.parse(n)}</blockquote>
|
|
45
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
46
|
+
`}hr(n){return`<hr>
|
|
47
|
+
`}list(n){let e=n.ordered,t=n.start,s="";for(let o=0;o<n.items.length;o++){let l=n.items[o];s+=this.listitem(l)}let r=e?"ol":"ul",a=e&&t!==1?' start="'+t+'"':"";return"<"+r+a+`>
|
|
48
|
+
`+s+"</"+r+`>
|
|
49
|
+
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
50
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
51
|
+
`}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++){let a=n.rows[r];t="";for(let o=0;o<a.length;o++)t+=this.tablecell(a[o]);s+=this.tablerow({text:t})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
|
|
52
|
+
<thead>
|
|
53
|
+
`+e+`</thead>
|
|
54
|
+
`+s+`</table>
|
|
55
|
+
`}tablerow({text:n}){return`<tr>
|
|
56
|
+
${n}</tr>
|
|
57
|
+
`}tablecell(n){let e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
58
|
+
`}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>${V(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){let s=this.parser.parseInline(t),r=Jt(n);if(r===null)return s;n=r;let a='<a href="'+n+'"';return e&&(a+=' title="'+V(e)+'"'),a+=">"+s+"</a>",a}image({href:n,title:e,text:t,tokens:s}){s&&(t=this.parser.parseInline(s,this.parser.textRenderer));let r=Jt(n);if(r===null)return V(t);n=r;let a=`<img src="${n}" alt="${t}"`;return e&&(a+=` title="${V(e)}"`),a+=">",a}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:V(n.text)}},St=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""}checkbox({raw:n}){return n}},G=class ft{constructor(e){A(this,"options");A(this,"renderer");A(this,"textRenderer");this.options=e||ie,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new St}static parse(e,t){return new ft(t).parse(e)}static parseInline(e,t){return new ft(t).parseInline(e)}parse(e){var s,r;let t="";for(let a=0;a<e.length;a++){let o=e[a];if((r=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&r[o.type]){let h=o,c=this.options.extensions.renderers[h.type].call({parser:this},h);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(h.type)){t+=c||"";continue}}let l=o;switch(l.type){case"space":{t+=this.renderer.space(l);break}case"hr":{t+=this.renderer.hr(l);break}case"heading":{t+=this.renderer.heading(l);break}case"code":{t+=this.renderer.code(l);break}case"table":{t+=this.renderer.table(l);break}case"blockquote":{t+=this.renderer.blockquote(l);break}case"list":{t+=this.renderer.list(l);break}case"checkbox":{t+=this.renderer.checkbox(l);break}case"html":{t+=this.renderer.html(l);break}case"def":{t+=this.renderer.def(l);break}case"paragraph":{t+=this.renderer.paragraph(l);break}case"text":{t+=this.renderer.text(l);break}default:{let h='Token with "'+l.type+'" type was not found.';if(this.options.silent)return"";throw new Error(h)}}}return t}parseInline(e,t=this.renderer){var r,a;let s="";for(let o=0;o<e.length;o++){let l=e[o];if((a=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&a[l.type]){let c=this.options.extensions.renderers[l.type].call({parser:this},l);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=c||"";continue}}let h=l;switch(h.type){case"escape":{s+=t.text(h);break}case"html":{s+=t.html(h);break}case"link":{s+=t.link(h);break}case"image":{s+=t.image(h);break}case"checkbox":{s+=t.checkbox(h);break}case"strong":{s+=t.strong(h);break}case"em":{s+=t.em(h);break}case"codespan":{s+=t.codespan(h);break}case"br":{s+=t.br(h);break}case"del":{s+=t.del(h);break}case"text":{s+=t.text(h);break}default:{let c='Token with "'+h.type+'" type was not found.';if(this.options.silent)return"";throw new Error(c)}}}return s}},ze,Ee=(ze=class{constructor(n){A(this,"options");A(this,"block");this.options=n||ie}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?H.lex:H.lexInline}provideParser(){return this.block?G.parse:G.parseInline}},A(ze,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),A(ze,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ze),Sr=class{constructor(...n){A(this,"defaults",kt());A(this,"options",this.setOptions);A(this,"parse",this.parseMarkdown(!0));A(this,"parseInline",this.parseMarkdown(!1));A(this,"Parser",G);A(this,"Renderer",Be);A(this,"TextRenderer",St);A(this,"Lexer",H);A(this,"Tokenizer",Fe);A(this,"Hooks",Ee);this.use(...n)}walkTokens(n,e){var s,r;let t=[];for(let a of n)switch(t=t.concat(e.call(this,a)),a.type){case"table":{let o=a;for(let l of o.header)t=t.concat(this.walkTokens(l.tokens,e));for(let l of o.rows)for(let h of l)t=t.concat(this.walkTokens(h.tokens,e));break}case"list":{let o=a;t=t.concat(this.walkTokens(o.items,e));break}default:{let o=a;(r=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{let h=o[l].flat(1/0);t=t.concat(this.walkTokens(h,e))}):o.tokens&&(t=t.concat(this.walkTokens(o.tokens,e)))}}return t}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{let 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){let a=e.renderers[r.name];a?e.renderers[r.name]=function(...o){let l=r.renderer.apply(this,o);return l===!1&&(l=a.apply(this,o)),l}:e.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[r.level];a?a.unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(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){let r=this.defaults.renderer||new Be(this.defaults);for(let a in t.renderer){if(!(a in r))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let o=a,l=t.renderer[o],h=r[o];r[o]=(...c)=>{let f=l.apply(r,c);return f===!1&&(f=h.apply(r,c)),f||""}}s.renderer=r}if(t.tokenizer){let r=this.defaults.tokenizer||new Fe(this.defaults);for(let a in t.tokenizer){if(!(a in r))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let o=a,l=t.tokenizer[o],h=r[o];r[o]=(...c)=>{let f=l.apply(r,c);return f===!1&&(f=h.apply(r,c)),f}}s.tokenizer=r}if(t.hooks){let r=this.defaults.hooks||new Ee;for(let a in t.hooks){if(!(a in r))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let o=a,l=t.hooks[o],h=r[o];Ee.passThroughHooks.has(a)?r[o]=c=>{if(this.defaults.async&&Ee.passThroughHooksRespectAsync.has(a))return(async()=>{let k=await l.call(r,c);return h.call(r,k)})();let f=l.call(r,c);return h.call(r,f)}:r[o]=(...c)=>{if(this.defaults.async)return(async()=>{let k=await l.apply(r,c);return k===!1&&(k=await h.apply(r,c)),k})();let f=l.apply(r,c);return f===!1&&(f=h.apply(r,c)),f}}s.hooks=r}if(t.walkTokens){let r=this.defaults.walkTokens,a=t.walkTokens;s.walkTokens=function(o){let l=[];return l.push(a.call(this,o)),r&&(l=l.concat(r.call(this,o))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return H.lex(n,e??this.defaults)}parser(n,e){return G.parse(n,e??this.defaults)}parseMarkdown(n){return(e,t)=>{let s={...t},r={...this.defaults,...s},a=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r,r.hooks.block=n),r.async)return(async()=>{let o=r.hooks?await r.hooks.preprocess(e):e,l=await(r.hooks?await r.hooks.provideLexer():n?H.lex:H.lexInline)(o,r),h=r.hooks?await r.hooks.processAllTokens(l):l;r.walkTokens&&await Promise.all(this.walkTokens(h,r.walkTokens));let c=await(r.hooks?await r.hooks.provideParser():n?G.parse:G.parseInline)(h,r);return r.hooks?await r.hooks.postprocess(c):c})().catch(a);try{r.hooks&&(e=r.hooks.preprocess(e));let o=(r.hooks?r.hooks.provideLexer():n?H.lex:H.lexInline)(e,r);r.hooks&&(o=r.hooks.processAllTokens(o)),r.walkTokens&&this.walkTokens(o,r.walkTokens);let l=(r.hooks?r.hooks.provideParser():n?G.parse:G.parseInline)(o,r);return r.hooks&&(l=r.hooks.postprocess(l)),l}catch(o){return a(o)}}}onError(n,e){return t=>{if(t.message+=`
|
|
59
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+V(t.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(t);throw t}}},se=new Sr;function _(n,e){return se.parse(n,e)}_.options=_.setOptions=function(n){return se.setOptions(n),_.defaults=se.defaults,un(_.defaults),_};_.getDefaults=kt;_.defaults=ie;_.use=function(...n){return se.use(...n),_.defaults=se.defaults,un(_.defaults),_};_.walkTokens=function(n,e){return se.walkTokens(n,e)};_.parseInline=se.parseInline;_.Parser=G;_.parser=G.parse;_.Renderer=Be;_.TextRenderer=St;_.Lexer=H;_.lexer=H.lex;_.Tokenizer=Fe;_.Hooks=Ee;_.parse=_;_.options;_.setOptions;_.use;_.walkTokens;_.parseInline;G.parse;H.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:An,setPrototypeOf:nn,isFrozen:yr,getPrototypeOf:Rr,getOwnPropertyDescriptor:Lr}=Object;let{freeze:z,seal:F,create:gt}=Object,{apply:dt,construct:mt}=typeof Reflect<"u"&&Reflect;z||(z=function(e){return e});F||(F=function(e){return e});dt||(dt=function(e,t){for(var s=arguments.length,r=new Array(s>2?s-2:0),a=2;a<s;a++)r[a-2]=arguments[a];return e.apply(t,r)});mt||(mt=function(e){for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];return new e(...s)});const Pe=$(Array.prototype.forEach),Ir=$(Array.prototype.lastIndexOf),rn=$(Array.prototype.pop),xe=$(Array.prototype.push),Cr=$(Array.prototype.splice),$e=$(String.prototype.toLowerCase),it=$(String.prototype.toString),lt=$(String.prototype.match),Te=$(String.prototype.replace),Or=$(String.prototype.indexOf),Dr=$(String.prototype.trim),B=$(Object.prototype.hasOwnProperty),P=$(RegExp.prototype.test),we=Nr(TypeError);function $(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var t=arguments.length,s=new Array(t>1?t-1:0),r=1;r<t;r++)s[r-1]=arguments[r];return dt(n,e,s)}}function Nr(n){return function(){for(var e=arguments.length,t=new Array(e),s=0;s<e;s++)t[s]=arguments[s];return mt(n,t)}}function b(n,e){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$e;nn&&nn(n,null);let s=e.length;for(;s--;){let r=e[s];if(typeof r=="string"){const a=t(r);a!==r&&(yr(e)||(e[s]=a),r=a)}n[r]=!0}return n}function Mr(n){for(let e=0;e<n.length;e++)B(n,e)||(n[e]=null);return n}function Y(n){const e=gt(null);for(const[t,s]of An(n))B(n,t)&&(Array.isArray(s)?e[t]=Mr(s):s&&typeof s=="object"&&s.constructor===Object?e[t]=Y(s):e[t]=s);return e}function Ae(n,e){for(;n!==null;){const s=Lr(n,e);if(s){if(s.get)return $(s.get);if(typeof s.value=="function")return $(s.value)}n=Rr(n)}function t(){return null}return t}const sn=z(["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"]),at=z(["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"]),ot=z(["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"]),Pr=z(["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"]),ct=z(["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"]),vr=z(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ln=z(["#text"]),an=z(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),pt=z(["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","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","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-rendering","textlength","type","u1","u2","unicode","values","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"]),on=z(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","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"]),ve=z(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zr=F(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$r=F(/<%[\w\W]*|[\w\W]*%>/gm),Ur=F(/\$\{[\w\W]*/gm),Fr=F(/^data-[\-\w.\u00B7-\uFFFF]+$/),Br=F(/^aria-[\-\w]+$/),_n=F(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hr=F(/^(?:\w+script|data):/i),Gr=F(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),En=F(/^html$/i),Wr=F(/^[a-z][.\w]*(-[.\w]+)+$/i);var cn=Object.freeze({__proto__:null,ARIA_ATTR:Br,ATTR_WHITESPACE:Gr,CUSTOM_ELEMENT:Wr,DATA_ATTR:Fr,DOCTYPE_NAME:En,ERB_EXPR:$r,IS_ALLOWED_URI:_n,IS_SCRIPT_OR_DATA:Hr,MUSTACHE_EXPR:zr,TMPLIT_EXPR:Ur});const _e={element:1,text:3,progressingInstruction:7,comment:8,document:9},qr=function(){return typeof window>"u"?null:window},Zr=function(e,t){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let s=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(s=t.getAttribute(r));const a="dompurify"+(s?"#"+s:"");try{return e.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return null}},pn=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Sn(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qr();const e=d=>Sn(d);if(e.version="3.3.1",e.removed=[],!n||!n.document||n.document.nodeType!==_e.document||!n.Element)return e.isSupported=!1,e;let{document:t}=n;const s=t,r=s.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:l,Element:h,NodeFilter:c,NamedNodeMap:f=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:k,DOMParser:m,trustedTypes:u}=n,w=h.prototype,x=Ae(w,"cloneNode"),y=Ae(w,"remove"),W=Ae(w,"nextSibling"),le=Ae(w,"childNodes"),K=Ae(w,"parentNode");if(typeof o=="function"){const d=t.createElement("template");d.content&&d.content.ownerDocument&&(t=d.content.ownerDocument)}let I,J="";const{implementation:ee,createNodeIterator:te,createDocumentFragment:yn,getElementsByTagName:Rn}=t,{importNode:Ln}=s;let M=pn();e.isSupported=typeof An=="function"&&typeof K=="function"&&ee&&ee.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:We,ERB_EXPR:qe,TMPLIT_EXPR:Ze,DATA_ATTR:In,ARIA_ATTR:Cn,IS_SCRIPT_OR_DATA:On,ATTR_WHITESPACE:yt,CUSTOM_ELEMENT:Dn}=cn;let{IS_ALLOWED_URI:Rt}=cn,C=null;const Lt=b({},[...sn,...at,...ot,...ct,...ln]);let O=null;const It=b({},[...an,...pt,...on,...ve]);let S=Object.seal(gt(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}})),ge=null,Ye=null;const ae=Object.seal(gt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ct=!0,je=!0,Ot=!1,Dt=!0,oe=!1,Re=!0,ne=!1,Xe=!1,Qe=!1,ce=!1,Le=!1,Ie=!1,Nt=!0,Mt=!1;const Nn="user-content-";let Ve=!0,de=!1,pe={},q=null;const Ke=b({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Pt=null;const vt=b({},["audio","video","img","source","image","track"]);let Je=null;const zt=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ce="http://www.w3.org/1998/Math/MathML",Oe="http://www.w3.org/2000/svg",j="http://www.w3.org/1999/xhtml";let ue=j,et=!1,tt=null;const Mn=b({},[Ce,Oe,j],it);let De=b({},["mi","mo","mn","ms","mtext"]),Ne=b({},["annotation-xml"]);const Pn=b({},["title","style","font","a","script"]);let me=null;const vn=["application/xhtml+xml","text/html"],zn="text/html";let L=null,he=null;const $n=t.createElement("form"),$t=function(i){return i instanceof RegExp||i instanceof Function},nt=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(he&&he===i)){if((!i||typeof i!="object")&&(i={}),i=Y(i),me=vn.indexOf(i.PARSER_MEDIA_TYPE)===-1?zn:i.PARSER_MEDIA_TYPE,L=me==="application/xhtml+xml"?it:$e,C=B(i,"ALLOWED_TAGS")?b({},i.ALLOWED_TAGS,L):Lt,O=B(i,"ALLOWED_ATTR")?b({},i.ALLOWED_ATTR,L):It,tt=B(i,"ALLOWED_NAMESPACES")?b({},i.ALLOWED_NAMESPACES,it):Mn,Je=B(i,"ADD_URI_SAFE_ATTR")?b(Y(zt),i.ADD_URI_SAFE_ATTR,L):zt,Pt=B(i,"ADD_DATA_URI_TAGS")?b(Y(vt),i.ADD_DATA_URI_TAGS,L):vt,q=B(i,"FORBID_CONTENTS")?b({},i.FORBID_CONTENTS,L):Ke,ge=B(i,"FORBID_TAGS")?b({},i.FORBID_TAGS,L):Y({}),Ye=B(i,"FORBID_ATTR")?b({},i.FORBID_ATTR,L):Y({}),pe=B(i,"USE_PROFILES")?i.USE_PROFILES:!1,Ct=i.ALLOW_ARIA_ATTR!==!1,je=i.ALLOW_DATA_ATTR!==!1,Ot=i.ALLOW_UNKNOWN_PROTOCOLS||!1,Dt=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,oe=i.SAFE_FOR_TEMPLATES||!1,Re=i.SAFE_FOR_XML!==!1,ne=i.WHOLE_DOCUMENT||!1,ce=i.RETURN_DOM||!1,Le=i.RETURN_DOM_FRAGMENT||!1,Ie=i.RETURN_TRUSTED_TYPE||!1,Qe=i.FORCE_BODY||!1,Nt=i.SANITIZE_DOM!==!1,Mt=i.SANITIZE_NAMED_PROPS||!1,Ve=i.KEEP_CONTENT!==!1,de=i.IN_PLACE||!1,Rt=i.ALLOWED_URI_REGEXP||_n,ue=i.NAMESPACE||j,De=i.MATHML_TEXT_INTEGRATION_POINTS||De,Ne=i.HTML_INTEGRATION_POINTS||Ne,S=i.CUSTOM_ELEMENT_HANDLING||{},i.CUSTOM_ELEMENT_HANDLING&&$t(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(S.tagNameCheck=i.CUSTOM_ELEMENT_HANDLING.tagNameCheck),i.CUSTOM_ELEMENT_HANDLING&&$t(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(S.attributeNameCheck=i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(S.allowCustomizedBuiltInElements=i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),oe&&(je=!1),Le&&(ce=!0),pe&&(C=b({},ln),O=[],pe.html===!0&&(b(C,sn),b(O,an)),pe.svg===!0&&(b(C,at),b(O,pt),b(O,ve)),pe.svgFilters===!0&&(b(C,ot),b(O,pt),b(O,ve)),pe.mathMl===!0&&(b(C,ct),b(O,on),b(O,ve))),i.ADD_TAGS&&(typeof i.ADD_TAGS=="function"?ae.tagCheck=i.ADD_TAGS:(C===Lt&&(C=Y(C)),b(C,i.ADD_TAGS,L))),i.ADD_ATTR&&(typeof i.ADD_ATTR=="function"?ae.attributeCheck=i.ADD_ATTR:(O===It&&(O=Y(O)),b(O,i.ADD_ATTR,L))),i.ADD_URI_SAFE_ATTR&&b(Je,i.ADD_URI_SAFE_ATTR,L),i.FORBID_CONTENTS&&(q===Ke&&(q=Y(q)),b(q,i.FORBID_CONTENTS,L)),i.ADD_FORBID_CONTENTS&&(q===Ke&&(q=Y(q)),b(q,i.ADD_FORBID_CONTENTS,L)),Ve&&(C["#text"]=!0),ne&&b(C,["html","head","body"]),C.table&&(b(C,["tbody"]),delete ge.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw we('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw we('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');I=i.TRUSTED_TYPES_POLICY,J=I.createHTML("")}else I===void 0&&(I=Zr(u,r)),I!==null&&typeof J=="string"&&(J=I.createHTML(""));z&&z(i),he=i}},Ut=b({},[...at,...ot,...Pr]),Ft=b({},[...ct,...vr]),Un=function(i){let p=K(i);(!p||!p.tagName)&&(p={namespaceURI:ue,tagName:"template"});const g=$e(i.tagName),E=$e(p.tagName);return tt[i.namespaceURI]?i.namespaceURI===Oe?p.namespaceURI===j?g==="svg":p.namespaceURI===Ce?g==="svg"&&(E==="annotation-xml"||De[E]):!!Ut[g]:i.namespaceURI===Ce?p.namespaceURI===j?g==="math":p.namespaceURI===Oe?g==="math"&&Ne[E]:!!Ft[g]:i.namespaceURI===j?p.namespaceURI===Oe&&!Ne[E]||p.namespaceURI===Ce&&!De[E]?!1:!Ft[g]&&(Pn[g]||!Ut[g]):!!(me==="application/xhtml+xml"&&tt[i.namespaceURI]):!1},Z=function(i){xe(e.removed,{element:i});try{K(i).removeChild(i)}catch{y(i)}},re=function(i,p){try{xe(e.removed,{attribute:p.getAttributeNode(i),from:p})}catch{xe(e.removed,{attribute:null,from:p})}if(p.removeAttribute(i),i==="is")if(ce||Le)try{Z(p)}catch{}else try{p.setAttribute(i,"")}catch{}},Bt=function(i){let p=null,g=null;if(Qe)i="<remove></remove>"+i;else{const R=lt(i,/^[\r\n\t ]+/);g=R&&R[0]}me==="application/xhtml+xml"&&ue===j&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const E=I?I.createHTML(i):i;if(ue===j)try{p=new m().parseFromString(E,me)}catch{}if(!p||!p.documentElement){p=ee.createDocument(ue,"template",null);try{p.documentElement.innerHTML=et?J:E}catch{}}const N=p.body||p.documentElement;return i&&g&&N.insertBefore(t.createTextNode(g),N.childNodes[0]||null),ue===j?Rn.call(p,ne?"html":"body")[0]:ne?p.documentElement:N},Ht=function(i){return te.call(i.ownerDocument||i,i,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},rt=function(i){return i instanceof k&&(typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||!(i.attributes instanceof f)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function")},Gt=function(i){return typeof l=="function"&&i instanceof l};function X(d,i,p){Pe(d,g=>{g.call(e,i,p,he)})}const Wt=function(i){let p=null;if(X(M.beforeSanitizeElements,i,null),rt(i))return Z(i),!0;const g=L(i.nodeName);if(X(M.uponSanitizeElement,i,{tagName:g,allowedTags:C}),Re&&i.hasChildNodes()&&!Gt(i.firstElementChild)&&P(/<[/\w!]/g,i.innerHTML)&&P(/<[/\w!]/g,i.textContent)||i.nodeType===_e.progressingInstruction||Re&&i.nodeType===_e.comment&&P(/<[/\w]/g,i.data))return Z(i),!0;if(!(ae.tagCheck instanceof Function&&ae.tagCheck(g))&&(!C[g]||ge[g])){if(!ge[g]&&Zt(g)&&(S.tagNameCheck instanceof RegExp&&P(S.tagNameCheck,g)||S.tagNameCheck instanceof Function&&S.tagNameCheck(g)))return!1;if(Ve&&!q[g]){const E=K(i)||i.parentNode,N=le(i)||i.childNodes;if(N&&E){const R=N.length;for(let U=R-1;U>=0;--U){const Q=x(N[U],!0);Q.__removalCount=(i.__removalCount||0)+1,E.insertBefore(Q,W(i))}}}return Z(i),!0}return i instanceof h&&!Un(i)||(g==="noscript"||g==="noembed"||g==="noframes")&&P(/<\/no(script|embed|frames)/i,i.innerHTML)?(Z(i),!0):(oe&&i.nodeType===_e.text&&(p=i.textContent,Pe([We,qe,Ze],E=>{p=Te(p,E," ")}),i.textContent!==p&&(xe(e.removed,{element:i.cloneNode()}),i.textContent=p)),X(M.afterSanitizeElements,i,null),!1)},qt=function(i,p,g){if(Nt&&(p==="id"||p==="name")&&(g in t||g in $n))return!1;if(!(je&&!Ye[p]&&P(In,p))){if(!(Ct&&P(Cn,p))){if(!(ae.attributeCheck instanceof Function&&ae.attributeCheck(p,i))){if(!O[p]||Ye[p]){if(!(Zt(i)&&(S.tagNameCheck instanceof RegExp&&P(S.tagNameCheck,i)||S.tagNameCheck instanceof Function&&S.tagNameCheck(i))&&(S.attributeNameCheck instanceof RegExp&&P(S.attributeNameCheck,p)||S.attributeNameCheck instanceof Function&&S.attributeNameCheck(p,i))||p==="is"&&S.allowCustomizedBuiltInElements&&(S.tagNameCheck instanceof RegExp&&P(S.tagNameCheck,g)||S.tagNameCheck instanceof Function&&S.tagNameCheck(g))))return!1}else if(!Je[p]){if(!P(Rt,Te(g,yt,""))){if(!((p==="src"||p==="xlink:href"||p==="href")&&i!=="script"&&Or(g,"data:")===0&&Pt[i])){if(!(Ot&&!P(On,Te(g,yt,"")))){if(g)return!1}}}}}}}return!0},Zt=function(i){return i!=="annotation-xml"&<(i,Dn)},Yt=function(i){X(M.beforeSanitizeAttributes,i,null);const{attributes:p}=i;if(!p||rt(i))return;const g={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0};let E=p.length;for(;E--;){const N=p[E],{name:R,namespaceURI:U,value:Q}=N,fe=L(R),st=Q;let D=R==="value"?st:Dr(st);if(g.attrName=fe,g.attrValue=D,g.keepAttr=!0,g.forceKeepAttr=void 0,X(M.uponSanitizeAttribute,i,g),D=g.attrValue,Mt&&(fe==="id"||fe==="name")&&(re(R,i),D=Nn+D),Re&&P(/((--!?|])>)|<\/(style|title|textarea)/i,D)){re(R,i);continue}if(fe==="attributename"&<(D,"href")){re(R,i);continue}if(g.forceKeepAttr)continue;if(!g.keepAttr){re(R,i);continue}if(!Dt&&P(/\/>/i,D)){re(R,i);continue}oe&&Pe([We,qe,Ze],Xt=>{D=Te(D,Xt," ")});const jt=L(i.nodeName);if(!qt(jt,fe,D)){re(R,i);continue}if(I&&typeof u=="object"&&typeof u.getAttributeType=="function"&&!U)switch(u.getAttributeType(jt,fe)){case"TrustedHTML":{D=I.createHTML(D);break}case"TrustedScriptURL":{D=I.createScriptURL(D);break}}if(D!==st)try{U?i.setAttributeNS(U,R,D):i.setAttribute(R,D),rt(i)?Z(i):rn(e.removed)}catch{re(R,i)}}X(M.afterSanitizeAttributes,i,null)},Fn=function d(i){let p=null;const g=Ht(i);for(X(M.beforeSanitizeShadowDOM,i,null);p=g.nextNode();)X(M.uponSanitizeShadowNode,p,null),Wt(p),Yt(p),p.content instanceof a&&d(p.content);X(M.afterSanitizeShadowDOM,i,null)};return e.sanitize=function(d){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},p=null,g=null,E=null,N=null;if(et=!d,et&&(d="<!-->"),typeof d!="string"&&!Gt(d))if(typeof d.toString=="function"){if(d=d.toString(),typeof d!="string")throw we("dirty is not a string, aborting")}else throw we("toString is not a function");if(!e.isSupported)return d;if(Xe||nt(i),e.removed=[],typeof d=="string"&&(de=!1),de){if(d.nodeName){const Q=L(d.nodeName);if(!C[Q]||ge[Q])throw we("root node is forbidden and cannot be sanitized in-place")}}else if(d instanceof l)p=Bt("<!---->"),g=p.ownerDocument.importNode(d,!0),g.nodeType===_e.element&&g.nodeName==="BODY"||g.nodeName==="HTML"?p=g:p.appendChild(g);else{if(!ce&&!oe&&!ne&&d.indexOf("<")===-1)return I&&Ie?I.createHTML(d):d;if(p=Bt(d),!p)return ce?null:Ie?J:""}p&&Qe&&Z(p.firstChild);const R=Ht(de?d:p);for(;E=R.nextNode();)Wt(E),Yt(E),E.content instanceof a&&Fn(E.content);if(de)return d;if(ce){if(Le)for(N=yn.call(p.ownerDocument);p.firstChild;)N.appendChild(p.firstChild);else N=p;return(O.shadowroot||O.shadowrootmode)&&(N=Ln.call(s,N,!0)),N}let U=ne?p.outerHTML:p.innerHTML;return ne&&C["!doctype"]&&p.ownerDocument&&p.ownerDocument.doctype&&p.ownerDocument.doctype.name&&P(En,p.ownerDocument.doctype.name)&&(U="<!DOCTYPE "+p.ownerDocument.doctype.name+`>
|
|
60
|
+
`+U),oe&&Pe([We,qe,Ze],Q=>{U=Te(U,Q," ")}),I&&Ie?I.createHTML(U):U},e.setConfig=function(){let d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};nt(d),Xe=!0},e.clearConfig=function(){he=null,Xe=!1},e.isValidAttribute=function(d,i,p){he||nt({});const g=L(d),E=L(i);return qt(g,E,p)},e.addHook=function(d,i){typeof i=="function"&&xe(M[d],i)},e.removeHook=function(d,i){if(i!==void 0){const p=Ir(M[d],i);return p===-1?void 0:Cr(M[d],p,1)[0]}return rn(M[d])},e.removeHooks=function(d){M[d]=[]},e.removeAllHooks=function(){M=pn()},e}var jr=Sn();export{_ as d,jr as p};
|