@vtj/pro 0.12.25 → 0.12.27

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.
Files changed (26) hide show
  1. package/dist/@vtj/materials/assets/antdv/index.umd.js +2 -2
  2. package/dist/@vtj/materials/assets/charts/index.umd.js +2 -2
  3. package/dist/@vtj/materials/assets/element/index.umd.js +2 -2
  4. package/dist/@vtj/materials/assets/icons/index.umd.js +2 -2
  5. package/dist/@vtj/materials/assets/ui/index.umd.js +2 -2
  6. package/dist/@vtj/materials/assets/uni-h5/index.umd.js +2 -2
  7. package/dist/@vtj/materials/assets/uni-ui/index.umd.js +2 -2
  8. package/dist/@vtj/materials/assets/vant/index.umd.js +2 -2
  9. package/dist/@vtj/materials/deps/@vtj/charts/index.umd.js +2 -2
  10. package/dist/@vtj/materials/deps/@vtj/icons/index.umd.js +2 -2
  11. package/dist/@vtj/materials/deps/@vtj/ui/index.umd.js +2 -2
  12. package/dist/@vtj/materials/deps/@vtj/utils/index.umd.js +2 -2
  13. package/dist/assets/{Editor-BLSuL67n-CjuW5946.js → Editor-CmLghefF-C7OTQRTa.js} +60 -60
  14. package/dist/assets/{auth-B04JXOPd.js → auth-dmyonXWY.js} +1 -1
  15. package/dist/assets/{index-4bryrK_V.js → index-BHrj7z2S.js} +1 -1
  16. package/dist/assets/{index-Cy_7DGHI.js → index-DfrBZv_R.js} +2 -2
  17. package/dist/assets/marked-BQZxLJfc.js +56 -0
  18. package/dist/assets/{page-CpZzlwz2.js → page-Dd61Dg7k.js} +1 -1
  19. package/dist/assets/{preview-jQBQU8UH.js → preview-CHnkNlg7.js} +1 -1
  20. package/dist/assets/{utils--KlF9XCI.js → utils-dg2JknUB.js} +1 -1
  21. package/dist/index.html +3 -3
  22. package/dist/uni/assets/{index-CcwBVtYf.js → index-De3VVH3V.js} +8 -8
  23. package/dist/uni/index.html +1 -1
  24. package/package.json +12 -12
  25. package/dist/assets/marked-DGBZG3x-.js +0 -56
  26. /package/dist/assets/{Editor-BLSuL67n-Bbg7yBKP.css → Editor-CmLghefF-Bbg7yBKP.css} +0 -0
@@ -1,56 +0,0 @@
1
- var ye=Object.defineProperty,$e=Object.defineProperties;var Re=Object.getOwnPropertyDescriptors;var se=Object.getOwnPropertySymbols;var Se=Object.prototype.hasOwnProperty,Te=Object.prototype.propertyIsEnumerable;var N=(h,e,t)=>e in h?ye(h,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[e]=t,w=(h,e)=>{for(var t in e||(e={}))Se.call(e,t)&&N(h,t,e[t]);if(se)for(var t of se(e))Te.call(e,t)&&N(h,t,e[t]);return h},A=(h,e)=>$e(h,Re(e));var k=(h,e,t)=>N(h,typeof e!="symbol"?e+"":e,t);function Q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let z=Q();function ce(h){z=h}const L={exec:()=>null};function f(h,e=""){let t=typeof h=="string"?h:h.source;const n={replace:(i,s)=>{let r=typeof s=="string"?s:s.source;return r=r.replace(m.caret,"$1"),t=t.replace(i,r),n},getRegex:()=>new RegExp(t,e)};return n}const m={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:h=>new RegExp(`^( {0,3}${h})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:h=>new RegExp(`^ {0,${Math.min(3,h-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:h=>new RegExp(`^ {0,${Math.min(3,h-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:h=>new RegExp(`^ {0,${Math.min(3,h-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:h=>new RegExp(`^ {0,${Math.min(3,h-1)}}#`),htmlBeginRegex:h=>new RegExp(`^ {0,${Math.min(3,h-1)}}<(?:[a-z].*>|!--)`,"i")},ze=/^(?:[ \t]*(?:\n|$))+/,Ae=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,B=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ce=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,H=/(?:[*+-]|\d{1,9}[.)])/,he=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pe=f(he).replace(/bull/g,H).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(),Ie=f(he).replace(/bull/g,H).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(),F=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Le=/^[^\n]+/,U=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Pe=f(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",U).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Be=f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,H).getRegex(),D="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",X=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ee=f("^ {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",X).replace("tag",D).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ue=f(F).replace("hr",B).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",D).getRegex(),qe=f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ue).getRegex(),W={blockquote:qe,code:Ae,def:Pe,fences:_e,heading:Ce,hr:B,html:Ee,lheading:pe,list:Be,newline:ze,paragraph:ue,table:L,text:Le},re=f("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",B).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",D).getRegex(),ve=A(w({},W),{lheading:Ie,table:re,paragraph:f(F).replace("hr",B).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",D).getRegex()}),Ze=A(w({},W),{html:f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",X).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:L,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(F).replace("hr",B).replace("heading",` *#{1,6} *[^
2
- ]`).replace("lheading",pe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()}),De=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Me=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ge=/^( {2,}|\\)\n(?!\s*$)/,Ge=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,M=/[\p{P}\p{S}]/u,J=/[\s\p{P}\p{S}]/u,fe=/[^\s\p{P}\p{S}]/u,Oe=f(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,J).getRegex(),de=/(?!~)[\p{P}\p{S}]/u,Ne=/(?!~)[\s\p{P}\p{S}]/u,je=/(?:[^\s\p{P}\p{S}]|~)/u,Qe=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ke=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,He=f(ke,"u").replace(/punct/g,M).getRegex(),Fe=f(ke,"u").replace(/punct/g,de).getRegex(),be="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ue=f(be,"gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,J).replace(/punct/g,M).getRegex(),Xe=f(be,"gu").replace(/notPunctSpace/g,je).replace(/punctSpace/g,Ne).replace(/punct/g,de).getRegex(),We=f("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fe).replace(/punctSpace/g,J).replace(/punct/g,M).getRegex(),Je=f(/\\(punct)/,"gu").replace(/punct/g,M).getRegex(),Ke=f(/^<(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(),Ve=f(X).replace("(?:-->|$)","-->").getRegex(),Ye=f("^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",Ve).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),q=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,et=f(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",q).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xe=f(/^!?\[(label)\]\[(ref)\]/).replace("label",q).replace("ref",U).getRegex(),me=f(/^!?\[(ref)\](?:\[\])?/).replace("ref",U).getRegex(),tt=f("reflink|nolink(?!\\()","g").replace("reflink",xe).replace("nolink",me).getRegex(),K={_backpedal:L,anyPunctuation:Je,autolink:Ke,blockSkip:Qe,br:ge,code:Me,del:L,emStrongLDelim:He,emStrongRDelimAst:Ue,emStrongRDelimUnd:We,escape:De,link:et,nolink:me,punctuation:Oe,reflink:xe,reflinkSearch:tt,tag:Ye,text:Ge,url:L},nt=A(w({},K),{link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",q).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q).getRegex()}),j=A(w({},K),{emStrongRDelimAst:Xe,emStrongLDelim:Fe,url:f(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/}),st=A(w({},j),{br:f(ge).replace("{2,}","*").getRegex(),text:f(j.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()}),E={normal:W,gfm:ve,pedantic:Ze},C={normal:K,gfm:j,breaks:st,pedantic:nt},rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ie=h=>rt[h];function S(h,e){if(e){if(m.escapeTest.test(h))return h.replace(m.escapeReplace,ie)}else if(m.escapeTestNoEncode.test(h))return h.replace(m.escapeReplaceNoEncode,ie);return h}function le(h){try{h=encodeURI(h).replace(m.percentDecode,"%")}catch(e){return null}return h}function oe(h,e){var s;const t=h.replace(m.findPipe,(r,l,c)=>{let o=!1,a=l;for(;--a>=0&&c[a]==="\\";)o=!o;return o?"|":" |"}),n=t.split(m.splitPipe);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(m.slashPipe,"|");return n}function I(h,e,t){const n=h.length;if(n===0)return"";let i=0;for(;i<n&&h.charAt(n-i-1)===e;)i++;return h.slice(0,n-i)}function it(h,e){if(h.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<h.length;n++)if(h[n]==="\\")n++;else if(h[n]===e[0])t++;else if(h[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function ae(h,e,t,n,i){const s=e.href,r=e.title||null,l=h[1].replace(i.other.outputLinkReplace,"$1");n.state.inLink=!0;const c={type:h[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:r,text:l,tokens:n.inlineTokens(l)};return n.state.inLink=!1,c}function lt(h,e,t){const n=h.match(t.other.indentCodeCompensation);if(n===null)return e;const i=n[1];return e.split(`
3
- `).map(s=>{const r=s.match(t.other.beginningSpace);if(r===null)return s;const[l]=r;return l.length>=i.length?s.slice(i.length):s}).join(`
4
- `)}class v{constructor(e){k(this,"options");k(this,"rules");k(this,"lexer");this.options=e||z}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:I(n,`
5
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=lt(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const i=I(n,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:I(t[0],`
6
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=I(t[0],`
7
- `).split(`
8
- `),i="",s="";const r=[];for(;n.length>0;){let l=!1;const c=[];let o;for(o=0;o<n.length;o++)if(this.rules.other.blockquoteStart.test(n[o]))c.push(n[o]),l=!0;else if(!l)c.push(n[o]);else break;n=n.slice(o);const a=c.join(`
9
- `),p=a.replace(this.rules.other.blockquoteSetextReplace,`
10
- $1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
11
- ${a}`:a,s=s?`${s}
12
- ${p}`:p;const u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,r,!0),this.lexer.state.top=u,n.length===0)break;const g=r.at(-1);if((g==null?void 0:g.type)==="code")break;if((g==null?void 0:g.type)==="blockquote"){const x=g,b=x.raw+`
13
- `+n.join(`
14
- `),y=this.blockquote(b);r[r.length-1]=y,i=i.substring(0,i.length-x.raw.length)+y.raw,s=s.substring(0,s.length-x.text.length)+y.text;break}else if((g==null?void 0:g.type)==="list"){const x=g,b=x.raw+`
15
- `+n.join(`
16
- `),y=this.list(b);r[r.length-1]=y,i=i.substring(0,i.length-g.raw.length)+y.raw,s=s.substring(0,s.length-x.raw.length)+y.raw,n=b.substring(r.at(-1).raw.length).split(`
17
- `);continue}}return{type:"blockquote",raw:i,tokens:r,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const r=this.rules.other.listItemRegex(n);let l=!1;for(;e;){let o=!1,a="",p="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;a=t[0],e=e.substring(a.length);let u=t[2].split(`
18
- `,1)[0].replace(this.rules.other.listReplaceTabs,G=>" ".repeat(3*G.length)),g=e.split(`
19
- `,1)[0],x=!u.trim(),b=0;if(this.options.pedantic?(b=2,p=u.trimStart()):x?b=t[1].length+1:(b=t[2].search(this.rules.other.nonSpaceChar),b=b>4?1:b,p=u.slice(b),b+=t[1].length),x&&this.rules.other.blankLine.test(g)&&(a+=g+`
20
- `,e=e.substring(g.length+1),o=!0),!o){const G=this.rules.other.nextBulletRegex(b),ee=this.rules.other.hrRegex(b),te=this.rules.other.fencesBeginRegex(b),ne=this.rules.other.headingBeginRegex(b),we=this.rules.other.htmlBeginRegex(b);for(;e;){const O=e.split(`
21
- `,1)[0];let _;if(g=O,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),_=g):_=g.replace(this.rules.other.tabCharGlobal," "),te.test(g)||ne.test(g)||we.test(g)||G.test(g)||ee.test(g))break;if(_.search(this.rules.other.nonSpaceChar)>=b||!g.trim())p+=`
22
- `+_.slice(b);else{if(x||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||te.test(u)||ne.test(u)||ee.test(u))break;p+=`
23
- `+g}!x&&!g.trim()&&(x=!0),a+=O+`
24
- `,e=e.substring(O.length+1),u=_.slice(b)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(l=!0));let y=null,Y;this.options.gfm&&(y=this.rules.other.listIsTask.exec(p),y&&(Y=y[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:a,task:!!y,checked:Y,loose:!1,text:p,tokens:[]}),s.raw+=a}const c=s.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let o=0;o<s.items.length;o++)if(this.lexer.state.top=!1,s.items[o].tokens=this.lexer.blockTokens(s.items[o].text,[]),!s.loose){const a=s.items[o].tokens.filter(u=>u.type==="space"),p=a.length>0&&a.some(u=>this.rules.other.anyLine.test(u.raw));s.loose=p}if(s.loose)for(let o=0;o<s.items.length;o++)s.items[o].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:s}}}table(e){var l;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=oe(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(l=t[3])!=null&&l.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
25
- `):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const c of i)this.rules.other.tableAlignRight.test(c)?r.align.push("right"):this.rules.other.tableAlignCenter.test(c)?r.align.push("center"):this.rules.other.tableAlignLeft.test(c)?r.align.push("left"):r.align.push(null);for(let c=0;c<n.length;c++)r.header.push({text:n[c],tokens:this.lexer.inline(n[c]),header:!0,align:r.align[c]});for(const c of s)r.rows.push(oe(c,r.header.length).map((o,a)=>({text:o,tokens:this.lexer.inline(o),header:!1,align:r.align[a]})));return r}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
26
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const r=I(n.slice(0,-1),"\\");if((n.length-r.length)%2===0)return}else{const r=it(t[2],"()");if(r===-2)return;if(r>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+r;t[2]=t[2].substring(0,r),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){const r=this.rules.other.pedanticHrefTitle.exec(i);r&&(i=r[1],s=r[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?i=i.slice(1):i=i.slice(1,-1)),ae(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){const r=n[0].charAt(0);return{type:"text",raw:r,text:r}}return ae(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const r=[...i[0]].length-1;let l,c,o=r,a=0;const p=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,t=t.slice(-1*e.length+r);(i=p.exec(t))!=null;){if(l=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!l)continue;if(c=[...l].length,i[3]||i[4]){o+=c;continue}else if((i[5]||i[6])&&r%3&&!((r+c)%3)){a+=c;continue}if(o-=c,o>0)continue;c=Math.min(c,c+o+a);const u=[...i[0]][0].length,g=e.slice(0,r+i.index+u+c);if(Math.min(r,c)%2){const b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}const x=g.slice(2,-2);return{type:"strong",raw:g,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return i&&s&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=t[1],i="mailto:"+n):(n=t[1],i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n,i;let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]==="@")s=t[0],r="mailto:"+s;else{let l;do l=t[0],t[0]=(i=(n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])!=null?i:"";while(l!==t[0]);s=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}}class ${constructor(e){k(this,"tokens");k(this,"options");k(this,"state");k(this,"tokenizer");k(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||z,this.options.tokenizer=this.options.tokenizer||new v,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:m,block:E.normal,inline:C.normal};this.options.pedantic?(t.block=E.pedantic,t.inline=C.pedantic):this.options.gfm&&(t.block=E.gfm,this.options.breaks?t.inline=C.breaks:t.inline=C.gfm),this.tokenizer.rules=t}static get rules(){return{block:E,inline:C}}static lex(e,t){return new $(t).lex(e)}static lexInline(e,t){return new $(t).inlineTokens(e)}lex(e){e=e.replace(m.carriageReturn,`
27
- `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const n=this.inlineQueue[t];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){var i,s,r;for(this.options.pedantic&&(e=e.replace(m.tabCharGlobal," ").replace(m.spaceLine,""));e;){let l;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(o=>(l=o.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);const o=t.at(-1);l.raw.length===1&&o!==void 0?o.raw+=`
28
- `:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);const o=t.at(-1);(o==null?void 0:o.type)==="paragraph"||(o==null?void 0:o.type)==="text"?(o.raw+=`
29
- `+l.raw,o.text+=`
30
- `+l.text,this.inlineQueue.at(-1).src=o.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);const o=t.at(-1);(o==null?void 0:o.type)==="paragraph"||(o==null?void 0:o.type)==="text"?(o.raw+=`
31
- `+l.raw,o.text+=`
32
- `+l.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});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 c=e;if((r=this.options.extensions)!=null&&r.startBlock){let o=1/0;const a=e.slice(1);let p;this.options.extensions.startBlock.forEach(u=>{p=u.call({lexer:this},a),typeof p=="number"&&p>=0&&(o=Math.min(o,p))}),o<1/0&&o>=0&&(c=e.substring(0,o+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const o=t.at(-1);n&&(o==null?void 0:o.type)==="paragraph"?(o.raw+=`
33
- `+l.raw,o.text+=`
34
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(l),n=c.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);const o=t.at(-1);(o==null?void 0:o.type)==="text"?(o.raw+=`
35
- `+l.raw,o.text+=`
36
- `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(l);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var l,c,o;let n=e,i=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)a.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,i.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,r="";for(;e;){s||(r=""),s=!1;let a;if((c=(l=this.options.extensions)==null?void 0:l.inline)!=null&&c.some(u=>(a=u.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const u=t.at(-1);a.type==="text"&&(u==null?void 0:u.type)==="text"?(u.raw+=a.raw,u.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,n,r)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let p=e;if((o=this.options.extensions)!=null&&o.startInline){let u=1/0;const g=e.slice(1);let x;this.options.extensions.startInline.forEach(b=>{x=b.call({lexer:this},g),typeof x=="number"&&x>=0&&(u=Math.min(u,x))}),u<1/0&&u>=0&&(p=e.substring(0,u+1))}if(a=this.tokenizer.inlineText(p)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(r=a.raw.slice(-1)),s=!0;const u=t.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=a.raw,u.text+=a.text):t.push(a);continue}if(e){const u="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return t}}class Z{constructor(e){k(this,"options");k(this,"parser");this.options=e||z}space(e){return""}code({text:e,lang:t,escaped:n}){var r;const i=(r=(t||"").match(m.notSpaceStart))==null?void 0:r[0],s=e.replace(m.endingNewline,"")+`
37
- `;return i?'<pre><code class="language-'+S(i)+'">'+(n?s:S(s,!0))+`</code></pre>
38
- `:"<pre><code>"+(n?s:S(s,!0))+`</code></pre>
39
- `}blockquote({tokens:e}){return`<blockquote>
40
- ${this.parser.parse(e)}</blockquote>
41
- `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
42
- `}hr(e){return`<hr>
43
- `}list(e){const t=e.ordered,n=e.start;let i="";for(let l=0;l<e.items.length;l++){const c=e.items[l];i+=this.listitem(c)}const s=t?"ol":"ul",r=t&&n!==1?' start="'+n+'"':"";return"<"+s+r+`>
44
- `+i+"</"+s+`>
45
- `}listitem(e){var n;let t="";if(e.task){const i=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=i+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=i+" "+S(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:i+" ",text:i+" ",escaped:!0}):t+=i+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
46
- `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
47
- `}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let i="";for(let s=0;s<e.rows.length;s++){const r=e.rows[s];n="";for(let l=0;l<r.length;l++)n+=this.tablecell(r[l]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
48
- <thead>
49
- `+t+`</thead>
50
- `+i+`</table>
51
- `}tablerow({text:e}){return`<tr>
52
- ${e}</tr>
53
- `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
54
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${S(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),s=le(e);if(s===null)return i;e=s;let r='<a href="'+e+'"';return t&&(r+=' title="'+S(t)+'"'),r+=">"+i+"</a>",r}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));const s=le(e);if(s===null)return S(n);e=s;let r=`<img src="${e}" alt="${n}"`;return t&&(r+=` title="${S(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:S(e.text)}}class V{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class R{constructor(e){k(this,"options");k(this,"renderer");k(this,"textRenderer");this.options=e||z,this.options.renderer=this.options.renderer||new Z,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new V}static parse(e,t){return new R(t).parse(e)}static parseInline(e,t){return new R(t).parseInline(e)}parse(e,t=!0){var i,s;let n="";for(let r=0;r<e.length;r++){const l=e[r];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){const o=l,a=this.options.extensions.renderers[o.type].call({parser:this},o);if(a!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(o.type)){n+=a||"";continue}}const c=l;switch(c.type){case"space":{n+=this.renderer.space(c);continue}case"hr":{n+=this.renderer.hr(c);continue}case"heading":{n+=this.renderer.heading(c);continue}case"code":{n+=this.renderer.code(c);continue}case"table":{n+=this.renderer.table(c);continue}case"blockquote":{n+=this.renderer.blockquote(c);continue}case"list":{n+=this.renderer.list(c);continue}case"html":{n+=this.renderer.html(c);continue}case"paragraph":{n+=this.renderer.paragraph(c);continue}case"text":{let o=c,a=this.renderer.text(o);for(;r+1<e.length&&e[r+1].type==="text";)o=e[++r],a+=`
55
- `+this.renderer.text(o);t?n+=this.renderer.paragraph({type:"paragraph",raw:a,text:a,tokens:[{type:"text",raw:a,text:a,escaped:!0}]}):n+=a;continue}default:{const o='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(e,t=this.renderer){var i,s;let n="";for(let r=0;r<e.length;r++){const l=e[r];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){const o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){n+=o||"";continue}}const c=l;switch(c.type){case"escape":{n+=t.text(c);break}case"html":{n+=t.html(c);break}case"link":{n+=t.link(c);break}case"image":{n+=t.image(c);break}case"strong":{n+=t.strong(c);break}case"em":{n+=t.em(c);break}case"codespan":{n+=t.codespan(c);break}case"br":{n+=t.br(c);break}case"del":{n+=t.del(c);break}case"text":{n+=t.text(c);break}default:{const o='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}}class P{constructor(e){k(this,"options");k(this,"block");this.options=e||z}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?$.lex:$.lexInline}provideParser(){return this.block?R.parse:R.parseInline}}k(P,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class ot{constructor(...e){k(this,"defaults",Q());k(this,"options",this.setOptions);k(this,"parse",this.parseMarkdown(!0));k(this,"parseInline",this.parseMarkdown(!1));k(this,"Parser",R);k(this,"Renderer",Z);k(this,"TextRenderer",V);k(this,"Lexer",$);k(this,"Tokenizer",v);k(this,"Hooks",P);this.use(...e)}walkTokens(e,t){var i,s;let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const l=r;for(const c of l.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of l.rows)for(const o of c)n=n.concat(this.walkTokens(o.tokens,t));break}case"list":{const l=r;n=n.concat(this.walkTokens(l.items,t));break}default:{const l=r;(s=(i=this.defaults.extensions)==null?void 0:i.childTokens)!=null&&s[l.type]?this.defaults.extensions.childTokens[l.type].forEach(c=>{const o=l[c].flat(1/0);n=n.concat(this.walkTokens(o,t))}):l.tokens&&(n=n.concat(this.walkTokens(l.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i=w({},n);if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const r=t.renderers[s.name];r?t.renderers[s.name]=function(...l){let c=s.renderer.apply(this,l);return c===!1&&(c=r.apply(this,l)),c}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const r=t[s.level];r?r.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),n.renderer){const s=this.defaults.renderer||new Z(this.defaults);for(const r in n.renderer){if(!(r in s))throw new Error(`renderer '${r}' does not exist`);if(["options","parser"].includes(r))continue;const l=r,c=n.renderer[l],o=s[l];s[l]=(...a)=>{let p=c.apply(s,a);return p===!1&&(p=o.apply(s,a)),p||""}}i.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new v(this.defaults);for(const r in n.tokenizer){if(!(r in s))throw new Error(`tokenizer '${r}' does not exist`);if(["options","rules","lexer"].includes(r))continue;const l=r,c=n.tokenizer[l],o=s[l];s[l]=(...a)=>{let p=c.apply(s,a);return p===!1&&(p=o.apply(s,a)),p}}i.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new P;for(const r in n.hooks){if(!(r in s))throw new Error(`hook '${r}' does not exist`);if(["options","block"].includes(r))continue;const l=r,c=n.hooks[l],o=s[l];P.passThroughHooks.has(r)?s[l]=a=>{if(this.defaults.async)return Promise.resolve(c.call(s,a)).then(u=>o.call(s,u));const p=c.call(s,a);return o.call(s,p)}:s[l]=(...a)=>{let p=c.apply(s,a);return p===!1&&(p=o.apply(s,a)),p}}i.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,r=n.walkTokens;i.walkTokens=function(l){let c=[];return c.push(r.call(this,l)),s&&(c=c.concat(s.call(this,l))),c}}this.defaults=w(w({},this.defaults),i)}),this}setOptions(e){return this.defaults=w(w({},this.defaults),e),this}lexer(e,t){return $.lex(e,t!=null?t:this.defaults)}parser(e,t){return R.parse(e,t!=null?t:this.defaults)}parseMarkdown(e){return(n,i)=>{const s=w({},i),r=w(w({},this.defaults),s),l=this.onError(!!r.silent,!!r.async);if(this.defaults.async===!0&&s.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=="undefined"||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"));r.hooks&&(r.hooks.options=r,r.hooks.block=e);const c=r.hooks?r.hooks.provideLexer():e?$.lex:$.lexInline,o=r.hooks?r.hooks.provideParser():e?R.parse:R.parseInline;if(r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(n):n).then(a=>c(a,r)).then(a=>r.hooks?r.hooks.processAllTokens(a):a).then(a=>r.walkTokens?Promise.all(this.walkTokens(a,r.walkTokens)).then(()=>a):a).then(a=>o(a,r)).then(a=>r.hooks?r.hooks.postprocess(a):a).catch(l);try{r.hooks&&(n=r.hooks.preprocess(n));let a=c(n,r);r.hooks&&(a=r.hooks.processAllTokens(a)),r.walkTokens&&this.walkTokens(a,r.walkTokens);let p=o(a,r);return r.hooks&&(p=r.hooks.postprocess(p)),p}catch(a){return l(a)}}}onError(e,t){return n=>{if(n.message+=`
56
- Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+S(n.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const T=new ot;function d(h,e){return T.parse(h,e)}d.options=d.setOptions=function(h){return T.setOptions(h),d.defaults=T.defaults,ce(d.defaults),d};d.getDefaults=Q;d.defaults=z;d.use=function(...h){return T.use(...h),d.defaults=T.defaults,ce(d.defaults),d};d.walkTokens=function(h,e){return T.walkTokens(h,e)};d.parseInline=T.parseInline;d.Parser=R;d.parser=R.parse;d.Renderer=Z;d.TextRenderer=V;d.Lexer=$;d.lexer=$.lex;d.Tokenizer=v;d.Hooks=P;d.parse=d;d.options;d.setOptions;d.use;d.walkTokens;d.parseInline;R.parse;$.lex;export{d as m};