UNPKG

koishi-plugin-davinci-003

Version:
46 lines 64.2 kB
var ht=Object.defineProperty;var Le=l=>{throw TypeError(l)};var gt=(l,r,t)=>r in l?ht(l,r,{enumerable:true,configurable:true,writable:true,value:t}):l[r]=t;var R=(l,r,t)=>gt(l,typeof r!="symbol"?r+"":r,t),dt=(l,r,t)=>r.has(l)||Le("Cannot "+t);var Pe=(l,r,t)=>r.has(l)?Le("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(l):r.set(l,t);var fe=(l,r,t)=>(dt(l,r,"access private method"),t);import{message as H,send as we,defineExtension as mt}from"@koishijs/client";import{defineComponent as ue,h as kt,useModel as je,resolveComponent as Z,createElementBlock as j,openBlock as F,createVNode as V,withCtx as G,Fragment as Ke,renderList as Je,createElementVNode as E,mergeModels as bt,unref as Ye,createTextVNode as $e,ref as K,inject as xt,createCommentVNode as ie,withDirectives as wt,createBlock as Ve,vModelText as vt,toDisplayString as yt,Transition as _t}from"vue";function ze(){return{async:false,breaks:false,extensions:null,gfm:true,hooks:null,pedantic:false,renderer:null,silent:false,tokenizer:null,walkTokens:null}}let re=ze();function et(l){re=l}const tt=/[&<>"']/,Tt=new RegExp(tt.source,"g"),nt=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,At=new RegExp(nt.source,"g"),St={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},qe=l=>St[l];function D(l,r){if(r){if(tt.test(l))return l.replace(Tt,qe)}else if(nt.test(l))return l.replace(At,qe);return l}const $t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Rt(l){return l.replace($t,(r,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const It=/(^|[^\[])\^/g;function T(l,r){l=typeof l=="string"?l:l.source,r=r||"";const t={replace:(n,s)=>(s=typeof s=="object"&&"source"in s?s.source:s,s=s.replace(It,"$1"),l=l.replace(n,s),t),getRegex:()=>new RegExp(l,r)};return t}function Oe(l){try{l=encodeURI(l).replace(/%25/g,"%")}catch{return null}return l}const me={exec:()=>null};function De(l,r){const t=l.replace(/\|/g,(e,i,o)=>{let c=false,h=i;for(;--h>=0&&o[h]==="\\";)c=!c;return c?"|":" |"}),n=t.split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),r)if(n.length>r)n.splice(r);else for(;n.length<r;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function pe(l,r,t){const n=l.length;if(n===0)return"";let s=0;for(;s<n&&l.charAt(n-s-1)===r;)s++;return l.slice(0,n-s)}function zt(l,r){if(l.indexOf(r[1])===-1)return-1;let t=0;for(let n=0;n<l.length;n++)if(l[n]==="\\")n++;else if(l[n]===r[0])t++;else if(l[n]===r[1]&&(t--,t<0))return n;return-1}function Ue(l,r,t,n){const s=r.href,e=r.title?D(r.title):null,i=l[1].replace(/\\([\[\]])/g,"$1");if(l[0].charAt(0)!=="!"){n.state.inLink=true;const o={type:"link",raw:t,href:s,title:e,text:i,tokens:n.inlineTokens(i)};return n.state.inLink=false,o}return{type:"image",raw:t,href:s,title:e,text:D(i)}}function Et(l,r){const t=l.match(/^(\s+)(?:```)/);if(t===null)return r;const n=t[1];return r.split(` `).map(s=>{const e=s.match(/^\s+/);if(e===null)return s;const[i]=e;return i.length>=n.length?s.slice(n.length):s}).join(` `)}class ke{constructor(r){R(this,"options");R(this,"rules");R(this,"lexer");this.options=r||re}space(r){const t=this.rules.block.newline.exec(r);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(r){const t=this.rules.block.code.exec(r);if(t){const n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:pe(n,` `)}}}fences(r){const t=this.rules.block.fences.exec(r);if(t){const n=t[0],s=Et(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline._escapes,"$1"):t[2],text:s}}}heading(r){const t=this.rules.block.heading.exec(r);if(t){let n=t[2].trim();if(/#$/.test(n)){const s=pe(n,"#");(this.options.pedantic||!s||/ $/.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(r){const t=this.rules.block.hr.exec(r);if(t)return{type:"hr",raw:t[0]}}blockquote(r){const t=this.rules.block.blockquote.exec(r);if(t){const n=pe(t[0].replace(/^ *>[ \t]?/gm,""),` `),s=this.lexer.state.top;this.lexer.state.top=true;const e=this.lexer.blockTokens(n);return this.lexer.state.top=s,{type:"blockquote",raw:t[0],tokens:e,text:n}}}list(r){let t=this.rules.block.list.exec(r);if(t){let n=t[1].trim();const s=n.length>1,e={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:false,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let o="",c="",h=false;for(;r;){let p=false;if(!(t=i.exec(r))||this.rules.block.hr.test(r))break;o=t[0],r=r.substring(o.length);let a=t[2].split(` `,1)[0].replace(/^\t+/,P=>" ".repeat(3*P.length)),f=r.split(` `,1)[0],u=0;this.options.pedantic?(u=2,c=a.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,c=a.slice(u),u+=t[1].length);let x=false;if(!a&&/^ *$/.test(f)&&(o+=f+` `,r=r.substring(f.length+1),p=true),!p){const P=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),v=new RegExp(`^ {0,${Math.min(3,u-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,u-1)}}(?:\`\`\`|~~~)`),C=new RegExp(`^ {0,${Math.min(3,u-1)}}#`);for(;r;){const A=r.split(` `,1)[0];if(f=A,this.options.pedantic&&(f=f.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),w.test(f)||C.test(f)||P.test(f)||v.test(r))break;if(f.search(/[^ ]/)>=u||!f.trim())c+=` `+f.slice(u);else{if(x||a.search(/[^ ]/)>=4||w.test(a)||C.test(a)||v.test(a))break;c+=` `+f}!x&&!f.trim()&&(x=true),o+=A+` `,r=r.substring(A.length+1),a=f.slice(u)}}e.loose||(h?e.loose=true:/\n *\n *$/.test(o)&&(h=true));let y=null,m;this.options.gfm&&(y=/^\[[ xX]\] /.exec(c),y&&(m=y[0]!=="[ ] ",c=c.replace(/^\[[ xX]\] +/,""))),e.items.push({type:"list_item",raw:o,task:!!y,checked:m,loose:false,text:c,tokens:[]}),e.raw+=o}e.items[e.items.length-1].raw=o.trimEnd(),e.items[e.items.length-1].text=c.trimEnd(),e.raw=e.raw.trimEnd();for(let p=0;p<e.items.length;p++)if(this.lexer.state.top=false,e.items[p].tokens=this.lexer.blockTokens(e.items[p].text,[]),!e.loose){const a=e.items[p].tokens.filter(u=>u.type==="space"),f=a.length>0&&a.some(u=>/\n.*\n/.test(u.raw));e.loose=f}if(e.loose)for(let p=0;p<e.items.length;p++)e.items[p].loose=true;return e}}html(r){const t=this.rules.block.html.exec(r);if(t)return{type:"html",block:true,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(r){const t=this.rules.block.def.exec(r);if(t){const n=t[1].toLowerCase().replace(/\s+/g," "),s=t[2]?t[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",e=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline._escapes,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:e}}}table(r){const t=this.rules.block.table.exec(r);if(t){if(!/[:|]/.test(t[2]))return;const n={type:"table",raw:t[0],header:De(t[1]).map(s=>({text:s,tokens:[]})),align:t[2].replace(/^\||\| *$/g,"").split("|"),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[]};if(n.header.length===n.align.length){let s=n.align.length,e,i,o,c;for(e=0;e<s;e++){const h=n.align[e];h&&(/^ *-+: *$/.test(h)?n.align[e]="right":/^ *:-+: *$/.test(h)?n.align[e]="center":/^ *:-+ *$/.test(h)?n.align[e]="left":n.align[e]=null)}for(s=n.rows.length,e=0;e<s;e++)n.rows[e]=De(n.rows[e],n.header.length).map(h=>({text:h,tokens:[]}));for(s=n.header.length,i=0;i<s;i++)n.header[i].tokens=this.lexer.inline(n.header[i].text);for(s=n.rows.length,i=0;i<s;i++)for(c=n.rows[i],o=0;o<c.length;o++)c[o].tokens=this.lexer.inline(c[o].text);return n}}}lheading(r){const t=this.rules.block.lheading.exec(r);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(r){const t=this.rules.block.paragraph.exec(r);if(t){const n=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(r){const t=this.rules.block.text.exec(r);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(r){const t=this.rules.inline.escape.exec(r);if(t)return{type:"escape",raw:t[0],text:D(t[1])}}tag(r){const t=this.rules.inline.tag.exec(r);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=true:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=false),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=true:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=false),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:false,text:t[0]}}link(r){const t=this.rules.inline.link.exec(r);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^</.test(n)){if(!/>$/.test(n))return;const i=pe(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=zt(t[2],"()");if(i>-1){const c=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,c).trim(),t[3]=""}}let s=t[2],e="";if(this.options.pedantic){const i=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);i&&(s=i[1],e=i[3])}else e=t[3]?t[3].slice(1,-1):"";return s=s.trim(),/^</.test(s)&&(this.options.pedantic&&!/>$/.test(n)?s=s.slice(1):s=s.slice(1,-1)),Ue(t,{href:s&&s.replace(this.rules.inline._escapes,"$1"),title:e&&e.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(r,t){let n;if((n=this.rules.inline.reflink.exec(r))||(n=this.rules.inline.nolink.exec(r))){let s=(n[2]||n[1]).replace(/\s+/g," ");if(s=t[s.toLowerCase()],!s){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Ue(n,s,n[0],this.lexer)}}emStrong(r,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(r);if(!s||s[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...s[0]].length-1;let o,c,h=i,p=0;const a=s[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*r.length+i);(s=a.exec(t))!=null;){if(o=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!o)continue;if(c=[...o].length,s[3]||s[4]){h+=c;continue}else if((s[5]||s[6])&&i%3&&!((i+c)%3)){p+=c;continue}if(h-=c,h>0)continue;c=Math.min(c,c+h+p);const f=[...s[0]][0].length,u=r.slice(0,i+s.index+f+c);if(Math.min(i,c)%2){const y=u.slice(1,-1);return{type:"em",raw:u,text:y,tokens:this.lexer.inlineTokens(y)}}const x=u.slice(2,-2);return{type:"strong",raw:u,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(r){const t=this.rules.inline.code.exec(r);if(t){let n=t[2].replace(/\n/g," ");const s=/[^ ]/.test(n),e=/^ /.test(n)&&/ $/.test(n);return s&&e&&(n=n.substring(1,n.length-1)),n=D(n,true),{type:"codespan",raw:t[0],text:n}}}br(r){const t=this.rules.inline.br.exec(r);if(t)return{type:"br",raw:t[0]}}del(r){const t=this.rules.inline.del.exec(r);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(r){const t=this.rules.inline.autolink.exec(r);if(t){let n,s;return t[2]==="@"?(n=D(t[1]),s="mailto:"+n):(n=D(t[1]),s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(r){let t;if(t=this.rules.inline.url.exec(r)){let n,s;if(t[2]==="@")n=D(t[0]),s="mailto:"+n;else{let e;do e=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0];while(e!==t[0]);n=D(t[0]),t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(r){const t=this.rules.inline.text.exec(r);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=D(t[0]),{type:"text",raw:t[0],text:n}}}}const 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:me,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=T(d.def).replace("label",d._label).replace("title",d._title).getRegex();d.bullet=/(?:[*+-]|\d{1,9}[.)])/;d.listItemStart=T(/^( *)(bull) */).replace("bull",d.bullet).getRegex();d.list=T(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=T(d.html,"i").replace("comment",d._comment).replace("tag",d._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();d.lheading=T(d.lheading).replace(/bull/g,d.bullet).getRegex();d.paragraph=T(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=T(d.blockquote).replace("paragraph",d.paragraph).getRegex();d.normal={...d};d.gfm={...d.normal,table:"^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};d.gfm.table=T(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=T(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={...d.normal,html:T(`^ *(?: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:me,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:T(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()};const g={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:me,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:me,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^((?![*_])[\spunctuation])/};g._punctuation="\\p{P}$+<=>`^|~";g.punctuation=T(g.punctuation,"u").replace(/punctuation/g,g._punctuation).getRegex();g.blockSkip=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g;g.anyPunctuation=/\\[punct]/g;g._escapes=/\\([punct])/g;g._comment=T(d._comment).replace("(?:-->|$)","-->").getRegex();g.emStrong.lDelim=T(g.emStrong.lDelim,"u").replace(/punct/g,g._punctuation).getRegex();g.emStrong.rDelimAst=T(g.emStrong.rDelimAst,"gu").replace(/punct/g,g._punctuation).getRegex();g.emStrong.rDelimUnd=T(g.emStrong.rDelimUnd,"gu").replace(/punct/g,g._punctuation).getRegex();g.anyPunctuation=T(g.anyPunctuation,"gu").replace(/punct/g,g._punctuation).getRegex();g._escapes=T(g._escapes,"gu").replace(/punct/g,g._punctuation).getRegex();g._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;g._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])?)+(?![-_])/;g.autolink=T(g.autolink).replace("scheme",g._scheme).replace("email",g._email).getRegex();g._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;g.tag=T(g.tag).replace("comment",g._comment).replace("attribute",g._attribute).getRegex();g._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;g._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;g._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;g.link=T(g.link).replace("label",g._label).replace("href",g._href).replace("title",g._title).getRegex();g.reflink=T(g.reflink).replace("label",g._label).replace("ref",d._label).getRegex();g.nolink=T(g.nolink).replace("ref",d._label).getRegex();g.reflinkSearch=T(g.reflinkSearch,"g").replace("reflink",g.reflink).replace("nolink",g.nolink).getRegex();g.normal={...g};g.pedantic={...g.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:T(/^!?\[(label)\]\((.*?)\)/).replace("label",g._label).getRegex(),reflink:T(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",g._label).getRegex()};g.gfm={...g.normal,escape:T(g.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.!#$%&'*+\/=?_`{\|}~-]+@)))/};g.gfm.url=T(g.gfm.url,"i").replace("email",g.gfm._extended_email).getRegex();g.breaks={...g.gfm,br:T(g.br).replace("{2,}","*").getRegex(),text:T(g.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};class M{constructor(r){R(this,"tokens");R(this,"options");R(this,"state");R(this,"tokenizer");R(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=r||re,this.options.tokenizer=this.options.tokenizer||new ke,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:false,inRawBlock:false,top:true};const t={block:d.normal,inline:g.normal};this.options.pedantic?(t.block=d.pedantic,t.inline=g.pedantic):this.options.gfm&&(t.block=d.gfm,this.options.breaks?t.inline=g.breaks:t.inline=g.gfm),this.tokenizer.rules=t}static get rules(){return{block:d,inline:g}}static lex(r,t){return new M(t).lex(r)}static lexInline(r,t){return new M(t).inlineTokens(r)}lex(r){r=r.replace(/\r\n|\r/g,` `),this.blockTokens(r,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(r,t=[]){this.options.pedantic?r=r.replace(/\t/g," ").replace(/^ +$/gm,""):r=r.replace(/^( *)(\t+)/gm,(o,c,h)=>c+" ".repeat(h.length));let n,s,e,i;for(;r;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(o=>(n=o.call({lexer:this},r,t))?(r=r.substring(n.raw.length),t.push(n),true):false))){if(n=this.tokenizer.space(r)){r=r.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=` `:t.push(n);continue}if(n=this.tokenizer.code(r)){r=r.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` `+n.raw,s.text+=` `+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(n=this.tokenizer.fences(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.list(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.html(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.def(r)){r=r.substring(n.raw.length),s=t[t.length-1],s&&(s.type==="paragraph"||s.type==="text")?(s.raw+=` `+n.raw,s.text+=` `+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text):this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(r)){r=r.substring(n.raw.length),t.push(n);continue}if(e=r,this.options.extensions&&this.options.extensions.startBlock){let o=1/0;const c=r.slice(1);let h;this.options.extensions.startBlock.forEach(p=>{h=p.call({lexer:this},c),typeof h=="number"&&h>=0&&(o=Math.min(o,h))}),o<1/0&&o>=0&&(e=r.substring(0,o+1))}if(this.state.top&&(n=this.tokenizer.paragraph(e))){s=t[t.length-1],i&&s.type==="paragraph"?(s.raw+=` `+n.raw,s.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=e.length!==r.length,r=r.substring(n.raw.length);continue}if(n=this.tokenizer.text(r)){r=r.substring(n.raw.length),s=t[t.length-1],s&&s.type==="text"?(s.raw+=` `+n.raw,s.text+=` `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);continue}if(r){const o="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=true,t}inline(r,t=[]){return this.inlineQueue.push({src:r,tokens:t}),t}inlineTokens(r,t=[]){let n,s,e,i=r,o,c,h;if(this.tokens.links){const p=Object.keys(this.tokens.links);if(p.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)p.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;r;)if(c||(h=""),c=false,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(p=>(n=p.call({lexer:this},r,t))?(r=r.substring(n.raw.length),t.push(n),true):false))){if(n=this.tokenizer.escape(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(r)){r=r.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(r,this.tokens.links)){r=r.substring(n.raw.length),s=t[t.length-1],s&&n.type==="text"&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(r,i,h)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(r)){r=r.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(r)){r=r.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(r))){r=r.substring(n.raw.length),t.push(n);continue}if(e=r,this.options.extensions&&this.options.extensions.startInline){let p=1/0;const a=r.slice(1);let f;this.options.extensions.startInline.forEach(u=>{f=u.call({lexer:this},a),typeof f=="number"&&f>=0&&(p=Math.min(p,f))}),p<1/0&&p>=0&&(e=r.substring(0,p+1))}if(n=this.tokenizer.inlineText(e)){r=r.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(h=n.raw.slice(-1)),c=true,s=t[t.length-1],s&&s.type==="text"?(s.raw+=n.raw,s.text+=n.text):t.push(n);continue}if(r){const p="Infinite loop on byte: "+r.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}}class be{constructor(r){R(this,"options");this.options=r||re}code(r,t,n){var e;const s=(e=(t||"").match(/^\S*/))==null?void 0:e[0];return r=r.replace(/\n$/,"")+` `,s?'<pre><code class="language-'+D(s)+'">'+(n?r:D(r,true))+`</code></pre> `:"<pre><code>"+(n?r:D(r,true))+`</code></pre> `}blockquote(r){return`<blockquote> ${r}</blockquote> `}html(r,t){return r}heading(r,t,n){return`<h${t}>${r}</h${t}> `}hr(){return`<hr> `}list(r,t,n){const s=t?"ol":"ul",e=t&&n!==1?' start="'+n+'"':"";return"<"+s+e+`> `+r+"</"+s+`> `}listitem(r,t,n){return`<li>${r}</li> `}checkbox(r){return"<input "+(r?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph(r){return`<p>${r}</p> `}table(r,t){return t&&(t=`<tbody>${t}</tbody>`),`<table> <thead> `+r+`</thead> `+t+`</table> `}tablerow(r){return`<tr> ${r}</tr> `}tablecell(r,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+r+`</${n}> `}strong(r){return`<strong>${r}</strong>`}em(r){return`<em>${r}</em>`}codespan(r){return`<code>${r}</code>`}br(){return"<br>"}del(r){return`<del>${r}</del>`}link(r,t,n){const s=Oe(r);if(s===null)return n;r=s;let e='<a href="'+r+'"';return t&&(e+=' title="'+t+'"'),e+=">"+n+"</a>",e}image(r,t,n){const s=Oe(r);if(s===null)return n;r=s;let e=`<img src="${r}" alt="${n}"`;return t&&(e+=` title="${t}"`),e+=">",e}text(r){return r}}class Ee{strong(r){return r}em(r){return r}codespan(r){return r}del(r){return r}html(r){return r}text(r){return r}link(r,t,n){return""+n}image(r,t,n){return""+n}br(){return""}}class W{constructor(r){R(this,"options");R(this,"renderer");R(this,"textRenderer");this.options=r||re,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ee}static parse(r,t){return new W(t).parse(r)}static parseInline(r,t){return new W(t).parseInline(r)}parse(r,t=true){let n="";for(let s=0;s<r.length;s++){const e=r[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[e.type]){const i=e,o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==false||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(i.type)){n+=o||"";continue}}switch(e.type){case"space":continue;case"hr":{n+=this.renderer.hr();continue}case"heading":{const i=e;n+=this.renderer.heading(this.parseInline(i.tokens),i.depth,Rt(this.parseInline(i.tokens,this.textRenderer)));continue}case"code":{const i=e;n+=this.renderer.code(i.text,i.lang,!!i.escaped);continue}case"table":{const i=e;let o="",c="";for(let p=0;p<i.header.length;p++)c+=this.renderer.tablecell(this.parseInline(i.header[p].tokens),{header:true,align:i.align[p]});o+=this.renderer.tablerow(c);let h="";for(let p=0;p<i.rows.length;p++){const a=i.rows[p];c="";for(let f=0;f<a.length;f++)c+=this.renderer.tablecell(this.parseInline(a[f].tokens),{header:false,align:i.align[f]});h+=this.renderer.tablerow(c)}n+=this.renderer.table(o,h);continue}case"blockquote":{const i=e,o=this.parse(i.tokens);n+=this.renderer.blockquote(o);continue}case"list":{const i=e,o=i.ordered,c=i.start,h=i.loose;let p="";for(let a=0;a<i.items.length;a++){const f=i.items[a],u=f.checked,x=f.task;let y="";if(f.task){const m=this.renderer.checkbox(!!u);h?f.tokens.length>0&&f.tokens[0].type==="paragraph"?(f.tokens[0].text=m+" "+f.tokens[0].text,f.tokens[0].tokens&&f.tokens[0].tokens.length>0&&f.tokens[0].tokens[0].type==="text"&&(f.tokens[0].tokens[0].text=m+" "+f.tokens[0].tokens[0].text)):f.tokens.unshift({type:"text",text:m+" "}):y+=m+" "}y+=this.parse(f.tokens,h),p+=this.renderer.listitem(y,x,!!u)}n+=this.renderer.list(p,o,c);continue}case"html":{const i=e;n+=this.renderer.html(i.text,i.block);continue}case"paragraph":{const i=e;n+=this.renderer.paragraph(this.parseInline(i.tokens));continue}case"text":{let i=e,o=i.tokens?this.parseInline(i.tokens):i.text;for(;s+1<r.length&&r[s+1].type==="text";)i=r[++s],o+=` `+(i.tokens?this.parseInline(i.tokens):i.text);n+=t?this.renderer.paragraph(o):o;continue}default:{const i='Token with "'+e.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}parseInline(r,t){t=t||this.renderer;let n="";for(let s=0;s<r.length;s++){const e=r[s];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[e.type]){const i=this.options.extensions.renderers[e.type].call({parser:this},e);if(i!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(e.type)){n+=i||"";continue}}switch(e.type){case"escape":{const i=e;n+=t.text(i.text);break}case"html":{const i=e;n+=t.html(i.text);break}case"link":{const i=e;n+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break}case"image":{const i=e;n+=t.image(i.href,i.title,i.text);break}case"strong":{const i=e;n+=t.strong(this.parseInline(i.tokens,t));break}case"em":{const i=e;n+=t.em(this.parseInline(i.tokens,t));break}case"codespan":{const i=e;n+=t.codespan(i.text);break}case"br":{n+=t.br();break}case"del":{const i=e;n+=t.del(this.parseInline(i.tokens,t));break}case"text":{const i=e;n+=t.text(i.text);break}default:{const i='Token with "'+e.type+'" type was not found.';if(this.options.silent)return console.error(i),"";throw new Error(i)}}}return n}}class oe{constructor(r){R(this,"options");this.options=r||re}preprocess(r){return r}postprocess(r){return r}}R(oe,"passThroughHooks",new Set(["preprocess","postprocess"]));var ne,Re,rt;class Ct{constructor(...r){Pe(this,ne);R(this,"defaults",ze());R(this,"options",this.setOptions);R(this,"parse",fe(this,ne,Re).call(this,M.lex,W.parse));R(this,"parseInline",fe(this,ne,Re).call(this,M.lexInline,W.parseInline));R(this,"Parser",W);R(this,"Renderer",be);R(this,"TextRenderer",Ee);R(this,"Lexer",M);R(this,"Tokenizer",ke);R(this,"Hooks",oe);this.use(...r)}walkTokens(r,t){var s,e;let n=[];for(const i of r)switch(n=n.concat(t.call(this,i)),i.type){case"table":{const o=i;for(const c of o.header)n=n.concat(this.walkTokens(c.tokens,t));for(const c of o.rows)for(const h of c)n=n.concat(this.walkTokens(h.tokens,t));break}case"list":{const o=i;n=n.concat(this.walkTokens(o.items,t));break}default:{const o=i;(e=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&e[o.type]?this.defaults.extensions.childTokens[o.type].forEach(c=>{n=n.concat(this.walkTokens(o[c],t))}):o.tokens&&(n=n.concat(this.walkTokens(o.tokens,t)))}}return n}use(...r){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return r.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||false,n.extensions&&(n.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const i=t.renderers[e.name];i?t.renderers[e.name]=function(...o){let c=e.renderer.apply(this,o);return c===false&&(c=i.apply(this,o)),c}:t.renderers[e.name]=e.renderer}if("tokenizer"in e){if(!e.level||e.level!=="block"&&e.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[e.level];i?i.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level==="block"?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level==="inline"&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),s.extensions=t),n.renderer){const e=this.defaults.renderer||new be(this.defaults);for(const i in n.renderer){const o=n.renderer[i],c=i,h=e[c];e[c]=(...p)=>{let a=o.apply(e,p);return a===false&&(a=h.apply(e,p)),a||""}}s.renderer=e}if(n.tokenizer){const e=this.defaults.tokenizer||new ke(this.defaults);for(const i in n.tokenizer){const o=n.tokenizer[i],c=i,h=e[c];e[c]=(...p)=>{let a=o.apply(e,p);return a===false&&(a=h.apply(e,p)),a}}s.tokenizer=e}if(n.hooks){const e=this.defaults.hooks||new oe;for(const i in n.hooks){const o=n.hooks[i],c=i,h=e[c];oe.passThroughHooks.has(i)?e[c]=p=>{if(this.defaults.async)return Promise.resolve(o.call(e,p)).then(f=>h.call(e,f));const a=o.call(e,p);return h.call(e,a)}:e[c]=(...p)=>{let a=o.apply(e,p);return a===false&&(a=h.apply(e,p)),a}}s.hooks=e}if(n.walkTokens){const e=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(o){let c=[];return c.push(i.call(this,o)),e&&(c=c.concat(e.call(this,o))),c}}this.defaults={...this.defaults,...s}}),this}setOptions(r){return this.defaults={...this.defaults,...r},this}lexer(r,t){return M.lex(r,t??this.defaults)}parser(r,t){return W.parse(r,t??this.defaults)}}ne=new WeakSet,Re=function(r,t){return(n,s)=>{const e={...s},i={...this.defaults,...e};this.defaults.async===true&&e.async===false&&(i.silent||console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."),i.async=true);const o=fe(this,ne,rt).call(this,!!i.silent,!!i.async);if(typeof n>"u"||n===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(i.hooks&&(i.hooks.options=i),i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(c=>r(c,i)).then(c=>i.walkTokens?Promise.all(this.walkTokens(c,i.walkTokens)).then(()=>c):c).then(c=>t(c,i)).then(c=>i.hooks?i.hooks.postprocess(c):c).catch(o);try{i.hooks&&(n=i.hooks.preprocess(n));const c=r(n,i);i.walkTokens&&this.walkTokens(c,i.walkTokens);let h=t(c,i);return i.hooks&&(h=i.hooks.postprocess(h)),h}catch(c){return o(c)}}},rt=function(r,t){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,r){const s="<p>An error occurred:</p><pre>"+D(n.message+"",true)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}};const te=new Ct;function _(l,r){return te.parse(l,r)}_.options=_.setOptions=function(l){return te.setOptions(l),_.defaults=te.defaults,et(_.defaults),_};_.getDefaults=ze;_.defaults=re;_.use=function(...l){return te.use(...l),_.defaults=te.defaults,et(_.defaults),_};_.walkTokens=function(l,r){return te.walkTokens(l,r)};_.parseInline=te.parseInline;_.Parser=W;_.parser=W.parse;_.Renderer=be;_.TextRenderer=Ee;_.Lexer=M;_.lexer=M.lex;_.Tokenizer=ke;_.Hooks=oe;_.parse=_;_.options;_.setOptions;_.use;_.walkTokens;_.parseInline;W.parse;M.lex;var he={exports:{}},I={},ge={exports:{}},ee={},Be;function st(){if(Be)return ee;Be=1;function l(){var e={};return e["align-content"]=false,e["align-items"]=false,e["align-self"]=false,e["alignment-adjust"]=false,e["alignment-baseline"]=false,e.all=false,e["anchor-point"]=false,e.animation=false,e["animation-delay"]=false,e["animation-direction"]=false,e["animation-duration"]=false,e["animation-fill-mode"]=false,e["animation-iteration-count"]=false,e["animation-name"]=false,e["animation-play-state"]=false,e["animation-timing-function"]=false,e.azimuth=false,e["backface-visibility"]=false,e.background=true,e["background-attachment"]=true,e["background-clip"]=true,e["background-color"]=true,e["background-image"]=true,e["background-origin"]=true,e["background-position"]=true,e["background-repeat"]=true,e["background-size"]=true,e["baseline-shift"]=false,e.binding=false,e.bleed=false,e["bookmark-label"]=false,e["bookmark-level"]=false,e["bookmark-state"]=false,e.border=true,e["border-bottom"]=true,e["border-bottom-color"]=true,e["border-bottom-left-radius"]=true,e["border-bottom-right-radius"]=true,e["border-bottom-style"]=true,e["border-bottom-width"]=true,e["border-collapse"]=true,e["border-color"]=true,e["border-image"]=true,e["border-image-outset"]=true,e["border-image-repeat"]=true,e["border-image-slice"]=true,e["border-image-source"]=true,e["border-image-width"]=true,e["border-left"]=true,e["border-left-color"]=true,e["border-left-style"]=true,e["border-left-width"]=true,e["border-radius"]=true,e["border-right"]=true,e["border-right-color"]=true,e["border-right-style"]=true,e["border-right-width"]=true,e["border-spacing"]=true,e["border-style"]=true,e["border-top"]=true,e["border-top-color"]=true,e["border-top-left-radius"]=true,e["border-top-right-radius"]=true,e["border-top-style"]=true,e["border-top-width"]=true,e["border-width"]=true,e.bottom=false,e["box-decoration-break"]=true,e["box-shadow"]=true,e["box-sizing"]=true,e["box-snap"]=true,e["box-suppress"]=true,e["break-after"]=true,e["break-before"]=true,e["break-inside"]=true,e["caption-side"]=false,e.chains=false,e.clear=true,e.clip=false,e["clip-path"]=false,e["clip-rule"]=false,e.color=true,e["color-interpolation-filters"]=true,e["column-count"]=false,e["column-fill"]=false,e["column-gap"]=false,e["column-rule"]=false,e["column-rule-color"]=false,e["column-rule-style"]=false,e["column-rule-width"]=false,e["column-span"]=false,e["column-width"]=false,e.columns=false,e.contain=false,e.content=false,e["counter-increment"]=false,e["counter-reset"]=false,e["counter-set"]=false,e.crop=false,e.cue=false,e["cue-after"]=false,e["cue-before"]=false,e.cursor=false,e.direction=false,e.display=true,e["display-inside"]=true,e["display-list"]=true,e["display-outside"]=true,e["dominant-baseline"]=false,e.elevation=false,e["empty-cells"]=false,e.filter=false,e.flex=false,e["flex-basis"]=false,e["flex-direction"]=false,e["flex-flow"]=false,e["flex-grow"]=false,e["flex-shrink"]=false,e["flex-wrap"]=false,e.float=false,e["float-offset"]=false,e["flood-color"]=false,e["flood-opacity"]=false,e["flow-from"]=false,e["flow-into"]=false,e.font=true,e["font-family"]=true,e["font-feature-settings"]=true,e["font-kerning"]=true,e["font-language-override"]=true,e["font-size"]=true,e["font-size-adjust"]=true,e["font-stretch"]=true,e["font-style"]=true,e["font-synthesis"]=true,e["font-variant"]=true,e["font-variant-alternates"]=true,e["font-variant-caps"]=true,e["font-variant-east-asian"]=true,e["font-variant-ligatures"]=true,e["font-variant-numeric"]=true,e["font-variant-position"]=true,e["font-weight"]=true,e.grid=false,e["grid-area"]=false,e["grid-auto-columns"]=false,e["grid-auto-flow"]=false,e["grid-auto-rows"]=false,e["grid-column"]=false,e["grid-column-end"]=false,e["grid-column-start"]=false,e["grid-row"]=false,e["grid-row-end"]=false,e["grid-row-start"]=false,e["grid-template"]=false,e["grid-template-areas"]=false,e["grid-template-columns"]=false,e["grid-template-rows"]=false,e["hanging-punctuation"]=false,e.height=true,e.hyphens=false,e.icon=false,e["image-orientation"]=false,e["image-resolution"]=false,e["ime-mode"]=false,e["initial-letters"]=false,e["inline-box-align"]=false,e["justify-content"]=false,e["justify-items"]=false,e["justify-self"]=false,e.left=false,e["letter-spacing"]=true,e["lighting-color"]=true,e["line-box-contain"]=false,e["line-break"]=false,e["line-grid"]=false,e["line-height"]=false,e["line-snap"]=false,e["line-stacking"]=false,e["line-stacking-ruby"]=false,e["line-stacking-shift"]=false,e["line-stacking-strategy"]=false,e["list-style"]=true,e["list-style-image"]=true,e["list-style-position"]=true,e["list-style-type"]=true,e.margin=true,e["margin-bottom"]=true,e["margin-left"]=true,e["margin-right"]=true,e["margin-top"]=true,e["marker-offset"]=false,e["marker-side"]=false,e.marks=false,e.mask=false,e["mask-box"]=false,e["mask-box-outset"]=false,e["mask-box-repeat"]=false,e["mask-box-slice"]=false,e["mask-box-source"]=false,e["mask-box-width"]=false,e["mask-clip"]=false,e["mask-image"]=false,e["mask-origin"]=false,e["mask-position"]=false,e["mask-repeat"]=false,e["mask-size"]=false,e["mask-source-type"]=false,e["mask-type"]=false,e["max-height"]=true,e["max-lines"]=false,e["max-width"]=true,e["min-height"]=true,e["min-width"]=true,e["move-to"]=false,e["nav-down"]=false,e["nav-index"]=false,e["nav-left"]=false,e["nav-right"]=false,e["nav-up"]=false,e["object-fit"]=false,e["object-position"]=false,e.opacity=false,e.order=false,e.orphans=false,e.outline=false,e["outline-color"]=false,e["outline-offset"]=false,e["outline-style"]=false,e["outline-width"]=false,e.overflow=false,e["overflow-wrap"]=false,e["overflow-x"]=false,e["overflow-y"]=false,e.padding=true,e["padding-bottom"]=true,e["padding-left"]=true,e["padding-right"]=true,e["padding-top"]=true,e.page=false,e["page-break-after"]=false,e["page-break-before"]=false,e["page-break-inside"]=false,e["page-policy"]=false,e.pause=false,e["pause-after"]=false,e["pause-before"]=false,e.perspective=false,e["perspective-origin"]=false,e.pitch=false,e["pitch-range"]=false,e["play-during"]=false,e.position=false,e["presentation-level"]=false,e.quotes=false,e["region-fragment"]=false,e.resize=false,e.rest=false,e["rest-after"]=false,e["rest-before"]=false,e.richness=false,e.right=false,e.rotation=false,e["rotation-point"]=false,e["ruby-align"]=false,e["ruby-merge"]=false,e["ruby-position"]=false,e["shape-image-threshold"]=false,e["shape-outside"]=false,e["shape-margin"]=false,e.size=false,e.speak=false,e["speak-as"]=false,e["speak-header"]=false,e["speak-numeral"]=false,e["speak-punctuation"]=false,e["speech-rate"]=false,e.stress=false,e["string-set"]=false,e["tab-size"]=false,e["table-layout"]=false,e["text-align"]=true,e["text-align-last"]=true,e["text-combine-upright"]=true,e["text-decoration"]=true,e["text-decoration-color"]=true,e["text-decoration-line"]=true,e["text-decoration-skip"]=true,e["text-decoration-style"]=true,e["text-emphasis"]=true,e["text-emphasis-color"]=true,e["text-emphasis-position"]=true,e["text-emphasis-style"]=true,e["text-height"]=true,e["text-indent"]=true,e["text-justify"]=true,e["text-orientation"]=true,e["text-overflow"]=true,e["text-shadow"]=true,e["text-space-collapse"]=true,e["text-transform"]=true,e["text-underline-position"]=true,e["text-wrap"]=true,e.top=false,e.transform=false,e["transform-origin"]=false,e["transform-style"]=false,e.transition=false,e["transition-delay"]=false,e["transition-duration"]=false,e["transition-property"]=false,e["transition-timing-function"]=false,e["unicode-bidi"]=false,e["vertical-align"]=false,e.visibility=false,e["voice-balance"]=false,e["voice-duration"]=false,e["voice-family"]=false,e["voice-pitch"]=false,e["voice-range"]=false,e["voice-rate"]=false,e["voice-stress"]=false,e["voice-volume"]=false,e.volume=false,e["white-space"]=false,e.widows=false,e.width=true,e["will-change"]=false,e["word-break"]=true,e["word-spacing"]=true,e["word-wrap"]=true,e["wrap-flow"]=false,e["wrap-through"]=false,e["writing-mode"]=false,e["z-index"]=false,e}function r(e,i,o){}function t(e,i,o){}var n=/javascript\s*\:/img;function s(e,i){return n.test(i)?"":i}return ee.whiteList=l(),ee.getDefaultWhiteList=l,ee.onAttr=r,ee.onIgnoreAttr=t,ee.safeAttrValue=s,ee}var ve,Ne;function it(){return Ne||(Ne=1,ve={indexOf:function(l,r){var t,n;if(Array.prototype.indexOf)return l.indexOf(r);for(t=0,n=l.length;t<n;t++)if(l[t]===r)return t;return-1},forEach:function(l,r,t){var n,s;if(Array.prototype.forEach)return l.forEach(r,t);for(n=0,s=l.length;n<s;n++)r.call(t,l[n],n,l)},trim:function(l){return String.prototype.trim?l.trim():l.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(l){return String.prototype.trimRight?l.trimRight():l.replace(/(\s*$)/g,"")}}),ve}var ye,Ze;function Lt(){if(Ze)return ye;Ze=1;var l=it();function r(t,n){t=l.trimRight(t),t[t.length-1]!==";"&&(t+=";");var s=t.length,e=false,i=0,o=0,c="";function h(){if(!e){var f=l.trim(t.slice(i,o)),u=f.indexOf(":");if(u!==-1){var x=l.trim(f.slice(0,u)),y=l.trim(f.slice(u+1));if(x){var m=n(i,c.length,x,y,f);m&&(c+=m+"; ")}}}i=o+1}for(;o<s;o++){var p=t[o];if(p==="/"&&t[o+1]==="*"){var a=t.indexOf("*/",o+2);if(a===-1)break;o=a+1,i=o+1,e=false}else p==="("?e=true:p===")"?e=false:p===";"?e||h():p===` `&&h()}return l.trim(c)}return ye=r,ye}var _e,Fe;function Pt(){if(Fe)return _e;Fe=1;var l=st(),r=Lt();it();function t(e){return e==null}function n(e){var i={};for(var o in e)i[o]=e[o];return i}function s(e){e=n(e||{}),e.whiteList=e.whiteList||l.whiteList,e.onAttr=e.onAttr||l.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||l.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||l.safeAttrValue,this.options=e}return s.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var i=this,o=i.options,c=o.whiteList,h=o.onAttr,p=o.onIgnoreAttr,a=o.safeAttrValue,f=r(e,function(u,x,y,m,P){var v=c[y],w=false;if(v===true?w=v:typeof v=="function"?w=v(m):v instanceof RegExp&&(w=v.test(m)),w!==true&&(w=false),m=a(y,m),!!m){var C={position:x,sourcePosition:u,source:P,isWhite:w};if(w){var A=h(y,m,C);return t(A)?y+":"+m:A}else{var A=p(y,m,C);if(!t(A))return A}}});return f},_e=s,_e}var Me;function Ie(){return Me||(Me=1,function(l,r){var t=st(),n=Pt();function s(i,o){var c=new n(o);return c.process(i)}r=l.exports=s,r.FilterCSS=n;for(var e in t)r[e]=t[e];typeof window<"u"&&(window.filterCSS=l.exports)}(ge,ge.exports)),ge.exports}var Te,We;function Ce(){return We||(We=1,Te={indexOf:function(l,r){var t,n;if(Array.prototype.indexOf)return l.indexOf(r);for(t=0,n=l.length;t<n;t++)if(l[t]===r)return t;return-1},forEach:function(l,r,t){var n,s;if(Array.prototype.forEach)return l.forEach(r,t);for(n=0,s=l.length;n<s;n++)r.call(t,l[n],n,l)},trim:function(l){return String.prototype.trim?l.trim():l.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(l){var r=/\s|\n|\t/,t=r.exec(l);return t?t.index:-1}}),Te}var Xe;function at(){if(Xe)return I;Xe=1;var l=Ie().FilterCSS,r=Ie().getDefaultWhiteList,t=Ce();function n(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var s=new l;function e(k,$,b){}function i(k,$,b){}function o(k,$,b){}function c(k,$,b){}function h(k){return k.replace(a,"&lt;").replace(f,"&gt;")}function p(k,$,b,S){if(b=ce(b),$==="href"||$==="src"){if(b=t.trim(b),b==="#")return"#";if(!(b.substr(0,7)==="http://"||b.substr(0,8)==="https://"||b.substr(0,7)==="mailto:"||b.substr(0,4)==="tel:"||b.substr(0,11)==="data:image/"||b.substr(0,6)==="ftp://"||b.substr(0,2)==="./"||b.substr(0,3)==="../"||b[0]==="#"||b[0]==="/"))return""}else if($==="background"){if(v.lastIndex=0,v.test(b))return""}else if($==="style"){if(w.lastIndex=0,w.test(b)||(C.lastIndex=0,C.test(b)&&(v.lastIndex=0,v.test(b))))return"";S!==false&&(S=S||s,b=S.process(b))}return b=U(b),b}var a=/</g,f=/>/g,u=/"/g,x=/&quot;/g,y=/&#([a-zA-Z0-9]*);?/gim,m=/&colon;?/gim,P=/&newline;?/gim,v=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,w=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,C=/u\s*r\s*l\s*\(.*/gi;function A(k){return k.replace(u,"&quot;")}function z(k){return k.replace(x,'"')}function L(k){return k.replace(y,function(b,S){return S[0]==="x"||S[0]==="X"?String.fromCharCode(parseInt(S.substr(1),16)):String.fromCharCode(parseInt(S,10))})}function q(k){return k.replace(m,":").repl