import{d as $e}from"./chunk-D3YCQTGW.js";import{c as Ee}from"./chunk-OBT56KUD.js";import{m as Se,t as R}from"./chunk-NMCXU7N6.js";import{Ba as q,Bc as _e,C as te,Cb as ge,Cc as Te,E as ne,Jc as H,La as he,R as ie,Tb as me,U as se,Uc as Z,Vc as W,Xa as pe,Ya as L,bb as ue,bc as ke,cc as xe,ea as re,f as P,ga as oe,ha as le,ia as ae,mc as be,nb as de,p as ee,pa as ce,pc as we,qc as ye,sa as D,sb as fe,tb as N,u as U,ua as $}from"./chunk-IYD54RT7.js";import{a as x,b as O,h as G}from"./chunk-RVFOIZLJ.js";function Q(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var z=Q();function Ce(a){z=a}var Ae=/[&<>"']/,Me=new RegExp(Ae.source,"g"),De=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,je=new RegExp(De.source,"g"),Be={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Re=a=>Be[a];function y(a,t){if(t){if(Ae.test(a))return a.replace(Me,Re)}else if(De.test(a))return a.replace(je,Re);return a}var Fe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Ue(a){return a.replace(Fe,(t,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}var qe=/(^|[^\[])\^/g;function k(a,t){a=typeof a=="string"?a:a.source,t=t||"";let n={replace:(e,i)=>(i=typeof i=="object"&&"source"in i?i.source:i,i=i.replace(qe,"$1"),a=a.replace(e,i),n),getRegex:()=>new RegExp(a,t)};return n}function Ie(a){try{a=encodeURI(a).replace(/%25/g,"%")}catch{return null}return a}var j={exec:()=>null};function ze(a,t){let n=a.replace(/\|/g,(s,r,o)=>{let l=!1,p=r;for(;--p>=0&&o[p]==="\\";)l=!l;return l?"|":" |"}),e=n.split(/ \|/),i=0;if(e[0].trim()||e.shift(),e.length>0&&!e[e.length-1].trim()&&e.pop(),t)if(e.length>t)e.splice(t);else for(;e.length<t;)e.push("");for(;i<e.length;i++)e[i]=e[i].trim().replace(/\\\|/g,"|");return e}function M(a,t,n){let e=a.length;if(e===0)return"";let i=0;for(;i<e;){let s=a.charAt(e-i-1);if(s===t&&!n)i++;else if(s!==t&&n)i++;else break}return a.slice(0,e-i)}function He(a,t){if(a.indexOf(t[1])===-1)return-1;let n=0;for(let e=0;e<a.length;e++)if(a[e]==="\\")e++;else if(a[e]===t[0])n++;else if(a[e]===t[1]&&(n--,n<0))return e;return-1}function Oe(a,t,n,e){let i=t.href,s=t.title?y(t.title):null,r=a[1].replace(/\\([\[\]])/g,"$1");if(a[0].charAt(0)!=="!"){e.state.inLink=!0;let o={type:"link",raw:n,href:i,title:s,text:r,tokens:e.inlineTokens(r)};return e.state.inLink=!1,o}return{type:"image",raw:n,href:i,title:s,text:y(r)}}function Ze(a,t){let n=a.match(/^(\s+)(?:```)/);if(n===null)return t;let e=n[1];return t.split(`
`).map(i=>{let s=i.match(/^\s+/);if(s===null)return i;let[r]=s;return r.length>=e.length?i.slice(e.length):i}).join(`
`)}var A=class{options;rules;lexer;constructor(t){this.options=t||z}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let e=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?e:M(e,`
`)}}}fences(t){let n=this.rules.block.fences.exec(t);if(n){let e=n[0],i=Ze(e,n[3]||"");return{type:"code",raw:e,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:i}}}heading(t){let n=this.rules.block.heading.exec(t);if(n){let e=n[2].trim();if(/#$/.test(e)){let i=M(e,"#");(this.options.pedantic||!i||/ $/.test(i))&&(e=i.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(t){let n=this.rules.block.hr.exec(t);if(n)return{type:"hr",raw:n[0]}}blockquote(t){let n=this.rules.block.blockquote.exec(t);if(n){let e=M(n[0].replace(/^ *>[ \t]?/gm,""),`
`),i=this.lexer.state.top;this.lexer.state.top=!0;let s=this.lexer.blockTokens(e);return this.lexer.state.top=i,{type:"blockquote",raw:n[0],tokens:s,text:e}}}list(t){let n=this.rules.block.list.exec(t);if(n){let e=n[1].trim(),i=e.length>1,s={type:"list",raw:"",ordered:i,start:i?+e.slice(0,-1):"",loose:!1,items:[]};e=i?`\\d{1,9}\\${e.slice(-1)}`:`\\${e}`,this.options.pedantic&&(e=i?e:"[*+-]");let r=new RegExp(`^( {0,3}${e})((?:[	 ][^\\n]*)?(?:\\n|$))`),o="",l="",p=!1;for(;t;){let h=!1;if(!(n=r.exec(t))||this.rules.block.hr.test(t))break;o=n[0],t=t.substring(o.length);let f=n[2].split(`
`,1)[0].replace(/^\t+/,B=>" ".repeat(3*B.length)),u=t.split(`
`,1)[0],g=0;this.options.pedantic?(g=2,l=f.trimStart()):(g=n[2].search(/[^ ]/),g=g>4?1:g,l=f.slice(g),g+=n[1].length);let w=!1;if(!f&&/^ *$/.test(u)&&(o+=u+`
`,t=t.substring(u.length+1),h=!0),!h){let B=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`),V=new RegExp(`^ {0,${Math.min(3,g-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),J=new RegExp(`^ {0,${Math.min(3,g-1)}}(?:\`\`\`|~~~)`),Y=new RegExp(`^ {0,${Math.min(3,g-1)}}#`);for(;t;){let F=t.split(`
`,1)[0];if(u=F,this.options.pedantic&&(u=u.replace(/^ {1,4}(?=( {4})*[^ ])/g,"  ")),J.test(u)||Y.test(u)||B.test(u)||V.test(t))break;if(u.search(/[^ ]/)>=g||!u.trim())l+=`
`+u.slice(g);else{if(w||f.search(/[^ ]/)>=4||J.test(f)||Y.test(f)||V.test(f))break;l+=`
`+u}!w&&!u.trim()&&(w=!0),o+=F+`
`,t=t.substring(F.length+1),f=u.slice(g)}}s.loose||(p?s.loose=!0:/\n *\n *$/.test(o)&&(p=!0));let b=null,E;this.options.gfm&&(b=/^\[[ xX]\] /.exec(l),b&&(E=b[0]!=="[ ] ",l=l.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:o,task:!!b,checked:E,loose:!1,text:l,tokens:[]}),s.raw+=o}s.items[s.items.length-1].raw=o.trimEnd(),s.items[s.items.length-1].text=l.trimEnd(),s.raw=s.raw.trimEnd();for(let h=0;h<s.items.length;h++)if(this.lexer.state.top=!1,s.items[h].tokens=this.lexer.blockTokens(s.items[h].text,[]),!s.loose){let f=s.items[h].tokens.filter(g=>g.type==="space"),u=f.length>0&&f.some(g=>/\n.*\n/.test(g.raw));s.loose=u}if(s.loose)for(let h=0;h<s.items.length;h++)s.items[h].loose=!0;return s}}html(t){let n=this.rules.block.html.exec(t);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(t){let n=this.rules.block.def.exec(t);if(n){let e=n[1].toLowerCase().replace(/\s+/g," "),i=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",s=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:e,raw:n[0],href:i,title:s}}}table(t){let n=this.rules.block.table.exec(t);if(n){if(!/[:|]/.test(n[2]))return;let e={type:"table",raw:n[0],header:ze(n[1]).map(i=>({text:i,tokens:[]})),align:n[2].replace(/^\||\| *$/g,"").split("|"),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(e.header.length===e.align.length){let i=e.align.length,s,r,o,l;for(s=0;s<i;s++){let p=e.align[s];p&&(/^ *-+: *$/.test(p)?e.align[s]="right":/^ *:-+: *$/.test(p)?e.align[s]="center":/^ *:-+ *$/.test(p)?e.align[s]="left":e.align[s]=null)}for(i=e.rows.length,s=0;s<i;s++)e.rows[s]=ze(e.rows[s],e.header.length).map(p=>({text:p,tokens:[]}));for(i=e.header.length,r=0;r<i;r++)e.header[r].tokens=this.lexer.inline(e.header[r].text);for(i=e.rows.length,r=0;r<i;r++)for(l=e.rows[r],o=0;o<l.length;o++)l[o].tokens=this.lexer.inline(l[o].text);return e}}}lheading(t){let n=this.rules.block.lheading.exec(t);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(t){let n=this.rules.block.paragraph.exec(t);if(n){let e=n[1].charAt(n[1].length-1)===`
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:e,tokens:this.lexer.inline(e)}}}text(t){let n=this.rules.block.text.exec(t);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(t){let n=this.rules.inline.escape.exec(t);if(n)return{type:"escape",raw:n[0],text:y(n[1])}}tag(t){let n=this.rules.inline.tag.exec(t);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(t){let n=this.rules.inline.link.exec(t);if(n){let e=n[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let r=M(e.slice(0,-1),"\\");if((e.length-r.length)%2===0)return}else{let r=He(n[2],"()");if(r>-1){let l=(n[0].indexOf("!")===0?5:4)+n[1].length+r;n[2]=n[2].substring(0,r),n[0]=n[0].substring(0,l).trim(),n[3]=""}}let i=n[2],s="";if(this.options.pedantic){let r=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);r&&(i=r[1],s=r[3])}else s=n[3]?n[3].slice(1,-1):"";return i=i.trim(),/^</.test(i)&&(this.options.pedantic&&!/>$/.test(e)?i=i.slice(1):i=i.slice(1,-1)),Oe(n,{href:i&&i.replace(this.rules.inline._escapes,"$1"),title:s&&s.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(t,n){let e;if((e=this.rules.inline.reflink.exec(t))||(e=this.rules.inline.nolink.exec(t))){let i=(e[2]||e[1]).replace(/\s+/g," ");if(i=n[i.toLowerCase()],!i){let s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return Oe(e,i,e[0],this.lexer)}}emStrong(t,n,e=""){let i=this.rules.inline.emStrong.lDelim.exec(t);if(!i||i[3]&&e.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!e||this.rules.inline.punctuation.exec(e)){let r=[...i[0]].length-1,o,l,p=r,h=0,f=i[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(f.lastIndex=0,n=n.slice(-1*t.length+r);(i=f.exec(n))!=null;){if(o=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!o)continue;if(l=[...o].length,i[3]||i[4]){p+=l;continue}else if((i[5]||i[6])&&r%3&&!((r+l)%3)){h+=l;continue}if(p-=l,p>0)continue;l=Math.min(l,l+p+h);let u=[...i[0]][0].length,g=t.slice(0,r+i.index+u+l);if(Math.min(r,l)%2){let b=g.slice(1,-1);return{type:"em",raw:g,text:b,tokens:this.lexer.inlineTokens(b)}}let w=g.slice(2,-2);return{type:"strong",raw:g,text:w,tokens:this.lexer.inlineTokens(w)}}}}codespan(t){let n=this.rules.inline.code.exec(t);if(n){let e=n[2].replace(/\n/g," "),i=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return i&&s&&(e=e.substring(1,e.length-1)),e=y(e,!0),{type:"codespan",raw:n[0],text:e}}}br(t){let n=this.rules.inline.br.exec(t);if(n)return{type:"br",raw:n[0]}}del(t){let n=this.rules.inline.del.exec(t);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(t){let n=this.rules.inline.autolink.exec(t);if(n){let e,i;return n[2]==="@"?(e=y(n[1]),i="mailto:"+e):(e=y(n[1]),i=e),{type:"link",raw:n[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}url(t){let n;if(n=this.rules.inline.url.exec(t)){let e,i;if(n[2]==="@")e=y(n[0]),i="mailto:"+e;else{let s;do s=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0];while(s!==n[0]);e=y(n[0]),n[1]==="www."?i="http://"+n[0]:i=n[0]}return{type:"link",raw:n[0],text:e,href:i,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(t){let n=this.rules.inline.text.exec(t);if(n){let e;return this.lexer.state.inRawBlock?e=n[0]:e=y(n[0]),{type:"text",raw:n[0],text:e}}}},d={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {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|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:j,lheading:/^(?!bull )((?:.|\n(?!\s*?\n|bull ))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};d._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;d._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;d.def=k(d.def).replace("label",d._label).replace("title",d._title).getRegex();d.bullet=/(?:[*+-]|\d{1,9}[.)])/;d.listItemStart=k(/^( *)(bull) */).replace("bull",d.bullet).getRegex();d.list=k(d.list).replace(/bull/g,d.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+d.def.source+")").getRegex();d._tag="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|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";d._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;d.html=k(d.html,"i").replace("comment",d._comment).replace("tag",d._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();d.lheading=k(d.lheading).replace(/bull/g,d.bullet).getRegex();d.paragraph=k(d._paragraph).replace("hr",d.hr).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._tag).getRegex();d.blockquote=k(d.blockquote).replace("paragraph",d.paragraph).getRegex();d.normal=x({},d);d.gfm=O(x({},d.normal),{table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});d.gfm.table=k(d.gfm.table).replace("hr",d.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\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._tag).getRegex();d.gfm.paragraph=k(d._paragraph).replace("hr",d.hr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",d.gfm.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._tag).getRegex();d.pedantic=O(x({},d.normal),{html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",d._comment).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:j,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(d.normal._paragraph).replace("hr",d.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",d.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var c={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:j,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,rDelimAst:/^[^_*]*?__[^_*]*?\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\*)[punct](\*+)(?=[\s]|$)|[^punct\s](\*+)(?!\*)(?=[punct\s]|$)|(?!\*)[punct\s](\*+)(?=[^punct\s])|[\s](\*+)(?!\*)(?=[punct])|(?!\*)[punct](\*+)(?!\*)(?=[punct])|[^punct\s](\*+)(?=[^punct\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\s]|$)|[^punct\s](_+)(?!_)(?=[punct\s]|$)|(?!_)[punct\s](_+)(?=[^punct\s])|[\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:j,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};c._punctuation="\\p{P}$+<=>`^|~";c.punctuation=k(c.punctuation,"u").replace(/punctuation/g,c._punctuation).getRegex();c.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;c.anyPunctuation=/\\[punct]/g;c._escapes=/\\([punct])/g;c._comment=k(d._comment).replace("(?:-->|$)","-->").getRegex();c.emStrong.lDelim=k(c.emStrong.lDelim,"u").replace(/punct/g,c._punctuation).getRegex();c.emStrong.rDelimAst=k(c.emStrong.rDelimAst,"gu").replace(/punct/g,c._punctuation).getRegex();c.emStrong.rDelimUnd=k(c.emStrong.rDelimUnd,"gu").replace(/punct/g,c._punctuation).getRegex();c.anyPunctuation=k(c.anyPunctuation,"gu").replace(/punct/g,c._punctuation).getRegex();c._escapes=k(c._escapes,"gu").replace(/punct/g,c._punctuation).getRegex();c._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;c._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])?)+(?![-_])/;c.autolink=k(c.autolink).replace("scheme",c._scheme).replace("email",c._email).getRegex();c._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;c.tag=k(c.tag).replace("comment",c._comment).replace("attribute",c._attribute).getRegex();c._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;c._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;c._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;c.link=k(c.link).replace("label",c._label).replace("href",c._href).replace("title",c._title).getRegex();c.reflink=k(c.reflink).replace("label",c._label).replace("ref",d._label).getRegex();c.nolink=k(c.nolink).replace("ref",d._label).getRegex();c.reflinkSearch=k(c.reflinkSearch,"g").replace("reflink",c.reflink).replace("nolink",c.nolink).getRegex();c.normal=x({},c);c.pedantic=O(x({},c.normal),{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",c._label).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",c._label).getRegex()});c.gfm=O(x({},c.normal),{escape:k(c.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\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.!#$%&'*+\/=?_`{\|}~-]+@)))/});c.gfm.url=k(c.gfm.url,"i").replace("email",c.gfm._extended_email).getRegex();c.breaks=O(x({},c.gfm),{br:k(c.br).replace("{2,}","*").getRegex(),text:k(c.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var T=class a{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||z,this.options.tokenizer=this.options.tokenizer||new A,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={block:d.normal,inline:c.normal};this.options.pedantic?(n.block=d.pedantic,n.inline=c.pedantic):this.options.gfm&&(n.block=d.gfm,this.options.breaks?n.inline=c.breaks:n.inline=c.gfm),this.tokenizer.rules=n}static get rules(){return{block:d,inline:c}}static lex(t,n){return new a(n).lex(t)}static lexInline(t,n){return new a(n).inlineTokens(t)}lex(t){t=t.replace(/\r\n|\r/g,`
`),this.blockTokens(t,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(t,n=[]){this.options.pedantic?t=t.replace(/\t/g,"    ").replace(/^ +$/gm,""):t=t.replace(/^( *)(\t+)/gm,(o,l,p)=>l+"    ".repeat(p.length));let e,i,s,r;for(;t;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(e=o.call({lexer:this},t,n))?(t=t.substring(e.raw.length),n.push(e),!0):!1))){if(e=this.tokenizer.space(t)){t=t.substring(e.raw.length),e.raw.length===1&&n.length>0?n[n.length-1].raw+=`
`:n.push(e);continue}if(e=this.tokenizer.code(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+e.raw,i.text+=`
`+e.text,this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(e);continue}if(e=this.tokenizer.fences(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.heading(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.hr(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.blockquote(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.list(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.html(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.def(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&(i.type==="paragraph"||i.type==="text")?(i.raw+=`
`+e.raw,i.text+=`
`+e.raw,this.inlineQueue[this.inlineQueue.length-1].src=i.text):this.tokens.links[e.tag]||(this.tokens.links[e.tag]={href:e.href,title:e.title});continue}if(e=this.tokenizer.table(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.lheading(t)){t=t.substring(e.raw.length),n.push(e);continue}if(s=t,this.options.extensions&&this.options.extensions.startBlock){let o=1/0,l=t.slice(1),p;this.options.extensions.startBlock.forEach(h=>{p=h.call({lexer:this},l),typeof p=="number"&&p>=0&&(o=Math.min(o,p))}),o<1/0&&o>=0&&(s=t.substring(0,o+1))}if(this.state.top&&(e=this.tokenizer.paragraph(s))){i=n[n.length-1],r&&i.type==="paragraph"?(i.raw+=`
`+e.raw,i.text+=`
`+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(e),r=s.length!==t.length,t=t.substring(e.raw.length);continue}if(e=this.tokenizer.text(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&i.type==="text"?(i.raw+=`
`+e.raw,i.text+=`
`+e.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=i.text):n.push(e);continue}if(t){let o="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){let e,i,s,r=t,o,l,p;if(this.tokens.links){let h=Object.keys(this.tokens.links);if(h.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)h.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,o.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;t;)if(l||(p=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(h=>(e=h.call({lexer:this},t,n))?(t=t.substring(e.raw.length),n.push(e),!0):!1))){if(e=this.tokenizer.escape(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.tag(t)){t=t.substring(e.raw.length),i=n[n.length-1],i&&e.type==="text"&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):n.push(e);continue}if(e=this.tokenizer.link(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(e.raw.length),i=n[n.length-1],i&&e.type==="text"&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):n.push(e);continue}if(e=this.tokenizer.emStrong(t,r,p)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.codespan(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.br(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.del(t)){t=t.substring(e.raw.length),n.push(e);continue}if(e=this.tokenizer.autolink(t)){t=t.substring(e.raw.length),n.push(e);continue}if(!this.state.inLink&&(e=this.tokenizer.url(t))){t=t.substring(e.raw.length),n.push(e);continue}if(s=t,this.options.extensions&&this.options.extensions.startInline){let h=1/0,f=t.slice(1),u;this.options.extensions.startInline.forEach(g=>{u=g.call({lexer:this},f),typeof u=="number"&&u>=0&&(h=Math.min(h,u))}),h<1/0&&h>=0&&(s=t.substring(0,h+1))}if(e=this.tokenizer.inlineText(s)){t=t.substring(e.raw.length),e.raw.slice(-1)!=="_"&&(p=e.raw.slice(-1)),l=!0,i=n[n.length-1],i&&i.type==="text"?(i.raw+=e.raw,i.text+=e.text):n.push(e);continue}if(t){let h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},_=class{options;constructor(t){this.options=t||z}code(t,n,e){let i=(n||"").match(/^\S*/)?.[0];return t=t.replace(/\n$/,"")+`
`,i?'<pre><code class="language-'+y(i)+'">'+(e?t:y(t,!0))+`</code></pre>
`:"<pre><code>"+(e?t:y(t,!0))+`</code></pre>
`}blockquote(t){return`<blockquote>
${t}</blockquote>
`}html(t,n){return t}heading(t,n,e){return`<h${n}>${t}</h${n}>
`}hr(){return`<hr>
`}list(t,n,e){let i=n?"ol":"ul",s=n&&e!==1?' start="'+e+'"':"";return"<"+i+s+`>
`+t+"</"+i+`>
`}listitem(t,n,e){return`<li>${t}</li>
`}checkbox(t){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(t){return`<p>${t}</p>
`}table(t,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
<thead>
`+t+`</thead>
`+n+`</table>
`}tablerow(t){return`<tr>
${t}</tr>
`}tablecell(t,n){let e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+t+`</${e}>
`}strong(t){return`<strong>${t}</strong>`}em(t){return`<em>${t}</em>`}codespan(t){return`<code>${t}</code>`}br(){return"<br>"}del(t){return`<del>${t}</del>`}link(t,n,e){let i=Ie(t);if(i===null)return e;t=i;let s='<a href="'+t+'"';return n&&(s+=' title="'+n+'"'),s+=">"+e+"</a>",s}image(t,n,e){let i=Ie(t);if(i===null)return e;t=i;let s=`<img src="${t}" alt="${e}"`;return n&&(s+=` title="${n}"`),s+=">",s}text(t){return t}},v=class{strong(t){return t}em(t){return t}codespan(t){return t}del(t){return t}html(t){return t}text(t){return t}link(t,n,e){return""+e}image(t,n,e){return""+e}br(){return""}},S=class a{options;renderer;textRenderer;constructor(t){this.options=t||z,this.options.renderer=this.options.renderer||new _,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new v}static parse(t,n){return new a(n).parse(t)}static parseInline(t,n){return new a(n).parseInline(t)}parse(t,n=!0){let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let r=s,o=this.options.extensions.renderers[r.type].call({parser:this},r);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(r.type)){e+=o||"";continue}}switch(s.type){case"space":continue;case"hr":{e+=this.renderer.hr();continue}case"heading":{let r=s;e+=this.renderer.heading(this.parseInline(r.tokens),r.depth,Ue(this.parseInline(r.tokens,this.textRenderer)));continue}case"code":{let r=s;e+=this.renderer.code(r.text,r.lang,!!r.escaped);continue}case"table":{let r=s,o="",l="";for(let h=0;h<r.header.length;h++)l+=this.renderer.tablecell(this.parseInline(r.header[h].tokens),{header:!0,align:r.align[h]});o+=this.renderer.tablerow(l);let p="";for(let h=0;h<r.rows.length;h++){let f=r.rows[h];l="";for(let u=0;u<f.length;u++)l+=this.renderer.tablecell(this.parseInline(f[u].tokens),{header:!1,align:r.align[u]});p+=this.renderer.tablerow(l)}e+=this.renderer.table(o,p);continue}case"blockquote":{let r=s,o=this.parse(r.tokens);e+=this.renderer.blockquote(o);continue}case"list":{let r=s,o=r.ordered,l=r.start,p=r.loose,h="";for(let f=0;f<r.items.length;f++){let u=r.items[f],g=u.checked,w=u.task,b="";if(u.task){let E=this.renderer.checkbox(!!g);p?u.tokens.length>0&&u.tokens[0].type==="paragraph"?(u.tokens[0].text=E+" "+u.tokens[0].text,u.tokens[0].tokens&&u.tokens[0].tokens.length>0&&u.tokens[0].tokens[0].type==="text"&&(u.tokens[0].tokens[0].text=E+" "+u.tokens[0].tokens[0].text)):u.tokens.unshift({type:"text",text:E+" "}):b+=E+" "}b+=this.parse(u.tokens,p),h+=this.renderer.listitem(b,w,!!g)}e+=this.renderer.list(h,o,l);continue}case"html":{let r=s;e+=this.renderer.html(r.text,r.block);continue}case"paragraph":{let r=s;e+=this.renderer.paragraph(this.parseInline(r.tokens));continue}case"text":{let r=s,o=r.tokens?this.parseInline(r.tokens):r.text;for(;i+1<t.length&&t[i+1].type==="text";)r=t[++i],o+=`
`+(r.tokens?this.parseInline(r.tokens):r.text);e+=n?this.renderer.paragraph(o):o;continue}default:{let r='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return e}parseInline(t,n){n=n||this.renderer;let e="";for(let i=0;i<t.length;i++){let s=t[i];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]){let r=this.options.extensions.renderers[s.type].call({parser:this},s);if(r!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){e+=r||"";continue}}switch(s.type){case"escape":{let r=s;e+=n.text(r.text);break}case"html":{let r=s;e+=n.html(r.text);break}case"link":{let r=s;e+=n.link(r.href,r.title,this.parseInline(r.tokens,n));break}case"image":{let r=s;e+=n.image(r.href,r.title,r.text);break}case"strong":{let r=s;e+=n.strong(this.parseInline(r.tokens,n));break}case"em":{let r=s;e+=n.em(this.parseInline(r.tokens,n));break}case"codespan":{let r=s;e+=n.codespan(r.text);break}case"br":{e+=n.br();break}case"del":{let r=s;e+=n.del(this.parseInline(r.tokens,n));break}case"text":{let r=s;e+=n.text(r.text);break}default:{let r='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(r),"";throw new Error(r)}}}return e}},C=class{options;constructor(t){this.options=t||z}static passThroughHooks=new Set(["preprocess","postprocess"]);preprocess(t){return t}postprocess(t){return t}},K=class{defaults=Q();options=this.setOptions;parse=this.#e(T.lex,S.parse);parseInline=this.#e(T.lexInline,S.parseInline);Parser=S;Renderer=_;TextRenderer=v;Lexer=T;Tokenizer=A;Hooks=C;constructor(...t){this.use(...t)}walkTokens(t,n){let e=[];for(let i of t)switch(e=e.concat(n.call(this,i)),i.type){case"table":{let s=i;for(let r of s.header)e=e.concat(this.walkTokens(r.tokens,n));for(let r of s.rows)for(let o of r)e=e.concat(this.walkTokens(o.tokens,n));break}case"list":{let s=i;e=e.concat(this.walkTokens(s.items,n));break}default:{let s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(r=>{e=e.concat(this.walkTokens(s[r],n))}):s.tokens&&(e=e.concat(this.walkTokens(s.tokens,n)))}}return e}use(...t){let n=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(e=>{let i=x({},e);if(i.async=this.defaults.async||i.async||!1,e.extensions&&(e.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let r=n.renderers[s.name];r?n.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=r.apply(this,o)),l}:n.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'");let r=n[s.level];r?r.unshift(s.tokenizer):n[s.level]=[s.tokenizer],s.start&&(s.level==="block"?n.startBlock?n.startBlock.push(s.start):n.startBlock=[s.start]:s.level==="inline"&&(n.startInline?n.startInline.push(s.start):n.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(n.childTokens[s.name]=s.childTokens)}),i.extensions=n),e.renderer){let s=this.defaults.renderer||new _(this.defaults);for(let r in e.renderer){let o=e.renderer[r],l=r,p=s[l];s[l]=(...h)=>{let f=o.apply(s,h);return f===!1&&(f=p.apply(s,h)),f||""}}i.renderer=s}if(e.tokenizer){let s=this.defaults.tokenizer||new A(this.defaults);for(let r in e.tokenizer){let o=e.tokenizer[r],l=r,p=s[l];s[l]=(...h)=>{let f=o.apply(s,h);return f===!1&&(f=p.apply(s,h)),f}}i.tokenizer=s}if(e.hooks){let s=this.defaults.hooks||new C;for(let r in e.hooks){let o=e.hooks[r],l=r,p=s[l];C.passThroughHooks.has(r)?s[l]=h=>{if(this.defaults.async)return Promise.resolve(o.call(s,h)).then(u=>p.call(s,u));let f=o.call(s,h);return p.call(s,f)}:s[l]=(...h)=>{let f=o.apply(s,h);return f===!1&&(f=p.apply(s,h)),f}}i.hooks=s}if(e.walkTokens){let s=this.defaults.walkTokens,r=e.walkTokens;i.walkTokens=function(o){let l=[];return l.push(r.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults=x(x({},this.defaults),i)}),this}setOptions(t){return this.defaults=x(x({},this.defaults),t),this}lexer(t,n){return T.lex(t,n??this.defaults)}parser(t,n){return S.parse(t,n??this.defaults)}#e(t,n){return(e,i)=>{let s=x({},i),r=x(x({},this.defaults),s);this.defaults.async===!0&&s.async===!1&&(r.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),r.async=!0);let o=this.#t(!!r.silent,!!r.async);if(typeof e>"u"||e===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(r.hooks&&(r.hooks.options=r),r.async)return Promise.resolve(r.hooks?r.hooks.preprocess(e):e).then(l=>t(l,r)).then(l=>r.walkTokens?Promise.all(this.walkTokens(l,r.walkTokens)).then(()=>l):l).then(l=>n(l,r)).then(l=>r.hooks?r.hooks.postprocess(l):l).catch(o);try{r.hooks&&(e=r.hooks.preprocess(e));let l=t(e,r);r.walkTokens&&this.walkTokens(l,r.walkTokens);let p=n(l,r);return r.hooks&&(p=r.hooks.postprocess(p)),p}catch(l){return o(l)}}}#t(t,n){return e=>{if(e.message+=`
Please report this to https://github.com/markedjs/marked.`,t){let i="<p>An error occurred:</p><pre>"+y(e.message+"",!0)+"</pre>";return n?Promise.resolve(i):i}if(n)return Promise.reject(e);throw e}}},I=new K;function m(a,t){return I.parse(a,t)}m.options=m.setOptions=function(a){return I.setOptions(a),m.defaults=I.defaults,Ce(m.defaults),m};m.getDefaults=Q;m.defaults=z;m.use=function(...a){return I.use(...a),m.defaults=I.defaults,Ce(m.defaults),m};m.walkTokens=function(a,t){return I.walkTokens(a,t)};m.parseInline=I.parseInline;m.Parser=S;m.parser=S.parse;m.Renderer=_;m.TextRenderer=v;m.Lexer=T;m.lexer=T.lex;m.Tokenizer=A;m.Hooks=C;m.parse=m;var st=m.options,rt=m.setOptions,ot=m.use,lt=m.walkTokens,at=m.parseInline;var ct=S.parse,ht=T.lex;var We=["*"],Ke="Copy",Qe="Copied",Xe=(()=>{let t=class t{constructor(){this._buttonClick$=new P,this.copied$=this._buttonClick$.pipe(le(()=>ne(ee(!0),te(3e3).pipe(ie(!1)))),se(),re(1)),this.copiedText$=this.copied$.pipe(oe(!1),U(e=>e?Qe:Ke))}onCopyToClipboardClick(){this._buttonClick$.next()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=q({type:t,selectors:[["markdown-clipboard"]],standalone:!0,features:[H],decls:4,vars:7,consts:[[1,"markdown-clipboard-button",3,"click"]],template:function(i,s){i&1&&(ke(0,"button",0),Z(1,"async"),be("click",function(){return s.onCopyToClipboardClick()}),_e(2),Z(3,"async"),xe()),i&2&&(me("copied",W(1,3,s.copied$)),fe(2),Te(W(3,5,s.copiedText$)))},dependencies:[Se],encapsulation:2,changeDetection:0});let a=t;return a})(),Ve=new D("CLIPBOARD_OPTIONS");var X=function(a){return a.CommandLine="command-line",a.LineHighlight="line-highlight",a.LineNumbers="line-numbers",a}(X||{}),Pe=new D("MARKED_EXTENSIONS"),Je=new D("MARKED_OPTIONS"),Ye="[ngx-markdown] When using the `emoji` attribute you *have to* include Emoji-Toolkit files to `angular.json` or use imports. See README for more information",Ge="[ngx-markdown] When using the `katex` attribute you *have to* include KaTeX files to `angular.json` or use imports. See README for more information",et="[ngx-markdown] When using the `mermaid` attribute you *have to* include Mermaid files to `angular.json` or use imports. See README for more information",tt="[ngx-markdown] When using the `clipboard` attribute you *have to* include Clipboard files to `angular.json` or use imports. See README for more information",nt="[ngx-markdown] When using the `clipboard` attribute you *have to* provide the `viewContainerRef` parameter to `MarkdownService.render()` function",it="[ngx-markdown] When using the `src` attribute you *have to* pass the `HttpClient` as a parameter of the `forRoot` method. See README for more information",Le=new D("SECURITY_CONTEXT");var Ne=(()=>{let t=class t{get options(){return this._options}set options(e){this._options=x(x({},this.DEFAULT_MARKED_OPTIONS),e)}get renderer(){return this.options.renderer}set renderer(e){this.options.renderer=e}constructor(e,i,s,r,o,l,p){this.clipboardOptions=e,this.extensions=i,this.platform=r,this.securityContext=o,this.http=l,this.sanitizer=p,this.DEFAULT_MARKED_OPTIONS={renderer:new _},this.DEFAULT_KATEX_OPTIONS={delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}]},this.DEFAULT_MERMAID_OPTIONS={startOnLoad:!1},this.DEFAULT_CLIPBOARD_OPTIONS={buttonComponent:void 0},this.DEFAULT_PARSE_OPTIONS={decodeHtml:!1,inline:!1,emoji:!1,mermaid:!1,markedOptions:void 0,disableSanitizer:!1},this.DEFAULT_RENDER_OPTIONS={clipboard:!1,clipboardOptions:void 0,katex:!1,katexOptions:void 0,mermaid:!1,mermaidOptions:void 0},this._reload$=new P,this.reload$=this._reload$.asObservable(),this.options=s}parse(e,i=this.DEFAULT_PARSE_OPTIONS){let{decodeHtml:s,inline:r,emoji:o,mermaid:l,disableSanitizer:p}=i,h=x(x({},this.options),i.markedOptions),f=h.renderer||this.renderer||new _;this.extensions&&(this.renderer=this.extendsRendererForExtensions(f)),l&&(this.renderer=this.extendsRendererForMermaid(f));let u=this.trimIndentation(e),g=s?this.decodeHtml(u):u,w=o?this.parseEmoji(g):g,b=this.parseMarked(w,h,r);return(p?b:this.sanitizer.sanitize(this.securityContext,b))||""}render(e,i=this.DEFAULT_RENDER_OPTIONS,s){let{clipboard:r,clipboardOptions:o,katex:l,katexOptions:p,mermaid:h,mermaidOptions:f}=i;r&&this.renderClipboard(e,s,x(x(x({},this.DEFAULT_CLIPBOARD_OPTIONS),this.clipboardOptions),o)),l&&this.renderKatex(e,x(x({},this.DEFAULT_KATEX_OPTIONS),p)),h&&this.renderMermaid(e,x(x({},this.DEFAULT_MERMAID_OPTIONS),f)),this.highlight(e)}reload(){this._reload$.next()}getSource(e){if(!this.http)throw new Error(it);return this.http.get(e,{responseType:"text"}).pipe(U(i=>this.handleExtension(e,i)))}highlight(e){if(!R(this.platform)||typeof Prism>"u"||typeof Prism.highlightAllUnder>"u")return;e||(e=document);let i=e.querySelectorAll('pre code:not([class*="language-"])');Array.prototype.forEach.call(i,s=>s.classList.add("language-none")),Prism.highlightAllUnder(e)}decodeHtml(e){if(!R(this.platform))return e;let i=document.createElement("textarea");return i.innerHTML=e,i.value}extendsRendererForExtensions(e){let i=e;return i.\u0275NgxMarkdownRendererExtendedForExtensions===!0||(this.extensions?.length>0&&m.use(...this.extensions),i.\u0275NgxMarkdownRendererExtendedForExtensions=!0),e}extendsRendererForMermaid(e){let i=e;if(i.\u0275NgxMarkdownRendererExtendedForMermaid===!0)return e;let s=e.code;return e.code=function(r,o,l){return o==="mermaid"?`<div class="mermaid">${r}</div>`:s.call(this,r,o,l)},i.\u0275NgxMarkdownRendererExtendedForMermaid=!0,e}handleExtension(e,i){let s=e.lastIndexOf("://"),r=s>-1?e.substring(s+4):e,o=r.lastIndexOf("/"),l=o>-1?r.substring(o+1).split("?")[0]:"",p=l.lastIndexOf("."),h=p>-1?l.substring(p+1):"";return h&&h!=="md"?"```"+h+`
`+i+"\n```":i}parseMarked(e,i,s=!1){return i.renderer&&(m.use({renderer:i.renderer}),delete i.renderer),s?m.parseInline(e,i):m.parse(e,i)}parseEmoji(e){if(!R(this.platform))return e;if(typeof joypixels>"u"||typeof joypixels.shortnameToUnicode>"u")throw new Error(Ye);return joypixels.shortnameToUnicode(e)}renderKatex(e,i){if(R(this.platform)){if(typeof katex>"u"||typeof renderMathInElement>"u")throw new Error(Ge);renderMathInElement(e,i)}}renderClipboard(e,i,s){if(!R(this.platform))return;if(typeof ClipboardJS>"u")throw new Error(tt);if(!i)throw new Error(nt);let{buttonComponent:r,buttonTemplate:o}=s,l=e.querySelectorAll("pre");for(let p=0;p<l.length;p++){let h=l.item(p),f=document.createElement("div");f.style.position="relative",h.parentNode.insertBefore(f,h),f.appendChild(h);let u=document.createElement("div");u.style.position="absolute",u.style.top=".5em",u.style.right=".5em",u.style.opacity="0",u.style.transition="opacity 250ms ease-out",f.insertAdjacentElement("beforeend",u),h.onmouseover=()=>u.style.opacity="1",h.onmouseout=()=>u.style.opacity="0";let g;r?g=i.createComponent(r).hostView:o?g=i.createEmbeddedView(o):g=i.createComponent(Xe).hostView;let w;g.rootNodes.forEach(b=>{b.onmouseover=()=>u.style.opacity="1",u.appendChild(b),w=new ClipboardJS(b,{text:()=>h.innerText})}),g.onDestroy(()=>w.destroy())}}renderMermaid(e,i=this.DEFAULT_MERMAID_OPTIONS){if(!R(this.platform))return;if(typeof mermaid>"u"||typeof mermaid.initialize>"u")throw new Error(et);let s=e.querySelectorAll(".mermaid");s.length!==0&&(mermaid.initialize(i),mermaid.run({nodes:s}))}trimIndentation(e){if(!e)return"";let i;return e.split(`
`).map(s=>{let r=i;return s.length>0&&(r=isNaN(r)?s.search(/\S|$/):Math.min(s.search(/\S|$/),r)),isNaN(i)&&(i=r),r?s.substring(r):s}).join(`
`)}};t.\u0275fac=function(i){return new(i||t)($(Ve,8),$(Pe,8),$(Je,8),$(ue),$(Le),$(Ee,8),$($e))},t.\u0275prov=ce({token:t,factory:t.\u0275fac});let a=t;return a})(),Lt=(()=>{let t=class t{get disableSanitizer(){return this._disableSanitizer}set disableSanitizer(e){this._disableSanitizer=this.coerceBooleanProperty(e)}get inline(){return this._inline}set inline(e){this._inline=this.coerceBooleanProperty(e)}get clipboard(){return this._clipboard}set clipboard(e){this._clipboard=this.coerceBooleanProperty(e)}get emoji(){return this._emoji}set emoji(e){this._emoji=this.coerceBooleanProperty(e)}get katex(){return this._katex}set katex(e){this._katex=this.coerceBooleanProperty(e)}get mermaid(){return this._mermaid}set mermaid(e){this._mermaid=this.coerceBooleanProperty(e)}get lineHighlight(){return this._lineHighlight}set lineHighlight(e){this._lineHighlight=this.coerceBooleanProperty(e)}get lineNumbers(){return this._lineNumbers}set lineNumbers(e){this._lineNumbers=this.coerceBooleanProperty(e)}get commandLine(){return this._commandLine}set commandLine(e){this._commandLine=this.coerceBooleanProperty(e)}constructor(e,i,s){this.element=e,this.markdownService=i,this.viewContainerRef=s,this.error=new L,this.load=new L,this.ready=new L,this._clipboard=!1,this._commandLine=!1,this._disableSanitizer=!1,this._emoji=!1,this._inline=!1,this._katex=!1,this._lineHighlight=!1,this._lineNumbers=!1,this._mermaid=!1,this.destroyed$=new P}ngOnChanges(){this.loadContent()}loadContent(){if(this.data!=null){this.handleData();return}if(this.src!=null){this.handleSrc();return}}ngAfterViewInit(){!this.data&&!this.src&&this.handleTransclusion(),this.markdownService.reload$.pipe(ae(this.destroyed$)).subscribe(()=>this.loadContent())}ngOnDestroy(){this.destroyed$.next(),this.destroyed$.complete()}render(e,i=!1){return G(this,null,function*(){let s={decodeHtml:i,inline:this.inline,emoji:this.emoji,mermaid:this.mermaid,disableSanitizer:this.disableSanitizer},r={clipboard:this.clipboard,clipboardOptions:{buttonComponent:this.clipboardButtonComponent,buttonTemplate:this.clipboardButtonTemplate},katex:this.katex,katexOptions:this.katexOptions,mermaid:this.mermaid,mermaidOptions:this.mermaidOptions},o=yield this.markdownService.parse(e,s);this.element.nativeElement.innerHTML=o,this.handlePlugins(),this.markdownService.render(this.element.nativeElement,r,this.viewContainerRef),this.ready.emit()})}coerceBooleanProperty(e){return e!=null&&`${String(e)}`!="false"}handleData(){this.render(this.data)}handleSrc(){this.markdownService.getSource(this.src).subscribe({next:e=>{this.render(e).then(()=>{this.load.emit(e)})},error:e=>this.error.emit(e)})}handleTransclusion(){this.render(this.element.nativeElement.innerHTML,!0)}handlePlugins(){this.commandLine&&(this.setPluginClass(this.element.nativeElement,X.CommandLine),this.setPluginOptions(this.element.nativeElement,{dataFilterOutput:this.filterOutput,dataHost:this.host,dataPrompt:this.prompt,dataOutput:this.output,dataUser:this.user})),this.lineHighlight&&this.setPluginOptions(this.element.nativeElement,{dataLine:this.line,dataLineOffset:this.lineOffset}),this.lineNumbers&&(this.setPluginClass(this.element.nativeElement,X.LineNumbers),this.setPluginOptions(this.element.nativeElement,{dataStart:this.start}))}setPluginClass(e,i){let s=e.querySelectorAll("pre");for(let r=0;r<s.length;r++){let o=i instanceof Array?i:[i];s.item(r).classList.add(...o)}}setPluginOptions(e,i){let s=e.querySelectorAll("pre");for(let r=0;r<s.length;r++)Object.keys(i).forEach(o=>{let l=i[o];if(l){let p=this.toLispCase(o);s.item(r).setAttribute(p,l.toString())}})}toLispCase(e){let i=e.match(/([A-Z])/g);if(!i)return e;let s=e.toString();for(let r=0,o=i.length;r<o;r++)s=s.replace(new RegExp(i[r]),"-"+i[r].toLowerCase());return s.slice(0,1)==="-"&&(s=s.slice(1)),s}};t.\u0275fac=function(i){return new(i||t)(N(pe),N(Ne),N(ge))},t.\u0275cmp=q({type:t,selectors:[["markdown"],["","markdown",""]],inputs:{data:"data",src:"src",disableSanitizer:"disableSanitizer",inline:"inline",clipboard:"clipboard",clipboardButtonComponent:"clipboardButtonComponent",clipboardButtonTemplate:"clipboardButtonTemplate",emoji:"emoji",katex:"katex",katexOptions:"katexOptions",mermaid:"mermaid",mermaidOptions:"mermaidOptions",lineHighlight:"lineHighlight",line:"line",lineOffset:"lineOffset",lineNumbers:"lineNumbers",start:"start",commandLine:"commandLine",filterOutput:"filterOutput",host:"host",prompt:"prompt",output:"output",user:"user"},outputs:{error:"error",load:"load",ready:"ready"},standalone:!0,features:[he,H],ngContentSelectors:We,decls:1,vars:0,template:function(i,s){i&1&&(we(),ye(0))},encapsulation:2});let a=t;return a})();function Nt(a){return[Ne,a?.loader??[],a?.clipboardOptions??[],a?.markedOptions??[],{provide:Pe,useValue:a?.markedExtensions??[]},{provide:Le,useValue:a?.sanitize??de.HTML}]}var ve;(function(a){let t;(function(i){i.Strict="strict",i.Loose="loose",i.Antiscript="antiscript",i.Sandbox="sandbox"})(t=a.SecurityLevel||(a.SecurityLevel={}));let n;(function(i){i.Base="base",i.Forest="forest",i.Dark="dark",i.Default="default",i.Neutral="neutral"})(n=a.Theme||(a.Theme={}));let e;(function(i){i[i.Debug=1]="Debug",i[i.Info=2]="Info",i[i.Warn=3]="Warn",i[i.Error=4]="Error",i[i.Fatal=5]="Fatal"})(e=a.LogLevel||(a.LogLevel={}))})(ve||(ve={}));export{Je as a,Lt as b,Nt as c};
