import{r as K}from"./chunk-QA3QBVWF.mjs";import{A as P,D as Q,F as ye,G as Se,t as q}from"./chunk-67TQ5CYL.mjs";import{b as I,h as M}from"./chunk-7W6UQGC5.mjs";import{a as c}from"./chunk-AQ6EADP3.mjs";var ot=Object.freeze({left:0,top:0,width:16,height:16}),L=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),X=Object.freeze({...ot,...L}),Te=Object.freeze({...X,body:"",hidden:!1});var lt=Object.freeze({width:null,height:null}),Ie=Object.freeze({...lt,...L});var J=c((n,e,r,s="")=>{let t=n.split(":");if(n.slice(0,1)==="@"){if(t.length<2||t.length>3)return null;s=t.shift().slice(1)}if(t.length>3||!t.length)return null;if(t.length>1){let o=t.pop(),a=t.pop(),p={provider:t.length>0?t[0]:s,prefix:a,name:o};return e&&!O(p)?null:p}let l=t[0],i=l.split("-");if(i.length>1){let o={provider:s,prefix:i.shift(),name:i.join("-")};return e&&!O(o)?null:o}if(r&&s===""){let o={provider:s,prefix:"",name:l};return e&&!O(o,r)?null:o}return null},"stringToIcon"),O=c((n,e)=>n?!!((e&&n.prefix===""||n.prefix)&&n.name):!1,"validateIconName");function $e(n,e){let r={};!n.hFlip!=!e.hFlip&&(r.hFlip=!0),!n.vFlip!=!e.vFlip&&(r.vFlip=!0);let s=((n.rotate||0)+(e.rotate||0))%4;return s&&(r.rotate=s),r}c($e,"mergeIconTransformations");function Y(n,e){let r=$e(n,e);for(let s in Te)s in L?s in n&&!(s in r)&&(r[s]=L[s]):s in e?r[s]=e[s]:s in n&&(r[s]=n[s]);return r}c(Y,"mergeIconData");function Re(n,e){let r=n.icons,s=n.aliases||Object.create(null),t=Object.create(null);function l(i){if(r[i])return t[i]=[];if(!(i in t)){t[i]=null;let o=s[i]&&s[i].parent,a=o&&l(o);a&&(t[i]=[o].concat(a))}return t[i]}return c(l,"resolve"),(e||Object.keys(r).concat(Object.keys(s))).forEach(l),t}c(Re,"getIconsTree");function Ee(n,e,r){let s=n.icons,t=n.aliases||Object.create(null),l={};function i(o){l=Y(s[o]||t[o],l)}return c(i,"parse"),i(e),r.forEach(i),Y(n,l)}c(Ee,"internalGetIconData");function ee(n,e){if(n.icons[e])return Ee(n,e,[]);let r=Re(n,[e])[e];return r?Ee(n,e,r):null}c(ee,"getIconData");var at=/(-?[0-9.]*[0-9]+[0-9.]*)/g,ct=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function te(n,e,r){if(e===1)return n;if(r=r||100,typeof n=="number")return Math.ceil(n*e*r)/r;if(typeof n!="string")return n;let s=n.split(at);if(s===null||!s.length)return n;let t=[],l=s.shift(),i=ct.test(l);for(;;){if(i){let o=parseFloat(l);isNaN(o)?t.push(l):t.push(Math.ceil(o*e*r)/r)}else t.push(l);if(l=s.shift(),l===void 0)return t.join("");i=!i}}c(te,"calculateSize");function pt(n,e="defs"){let r="",s=n.indexOf("<"+e);for(;s>=0;){let t=n.indexOf(">",s),l=n.indexOf("",l);if(i===-1)break;r+=n.slice(t+1,l).trim(),n=n.slice(0,s).trim()+n.slice(i+1)}return{defs:r,content:n}}c(pt,"splitSVGDefs");function ht(n,e){return n?""+n+""+e:e}c(ht,"mergeDefsAndContent");function ze(n,e,r){let s=pt(n);return ht(s.defs,e+s.content+r)}c(ze,"wrapSVGContent");var ut=c(n=>n==="unset"||n==="undefined"||n==="none","isUnsetKeyword");function ne(n,e){let r={...X,...n},s={...Ie,...e},t={left:r.left,top:r.top,width:r.width,height:r.height},l=r.body;[r,s].forEach(x=>{let b=[],A=x.hFlip,v=x.vFlip,S=x.rotate;A?v?S+=2:(b.push("translate("+(t.width+t.left).toString()+" "+(0-t.top).toString()+")"),b.push("scale(-1 1)"),t.top=t.left=0):v&&(b.push("translate("+(0-t.left).toString()+" "+(t.height+t.top).toString()+")"),b.push("scale(1 -1)"),t.top=t.left=0);let y;switch(S<0&&(S-=Math.floor(S/4)*4),S=S%4,S){case 1:y=t.height/2+t.top,b.unshift("rotate(90 "+y.toString()+" "+y.toString()+")");break;case 2:b.unshift("rotate(180 "+(t.width/2+t.left).toString()+" "+(t.height/2+t.top).toString()+")");break;case 3:y=t.width/2+t.left,b.unshift("rotate(-90 "+y.toString()+" "+y.toString()+")");break}S%2===1&&(t.left!==t.top&&(y=t.left,t.left=t.top,t.top=y),t.width!==t.height&&(y=t.width,t.width=t.height,t.height=y)),b.length&&(l=ze(l,'',""))});let i=s.width,o=s.height,a=t.width,p=t.height,h,u;i===null?(u=o===null?"1em":o==="auto"?p:o,h=te(u,a/p)):(h=i==="auto"?a:i,u=o===null?te(h,p/a):o==="auto"?p:o);let f={},g=c((x,b)=>{ut(b)||(f[x]=b.toString())},"setAttr");g("width",h),g("height",u);let d=[t.left,t.top,a,p];return f.viewBox=d.join(" "),{attributes:f,viewBox:d,body:l}}c(ne,"iconToSVG");var ft=/\sid="(\S+)"/g,gt="IconifyId"+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),dt=0;function re(n,e=gt){let r=[],s;for(;s=ft.exec(n);)r.push(s[1]);if(!r.length)return n;let t="suffix"+(Math.random()*16777216|Date.now()).toString(16);return r.forEach(l=>{let i=typeof e=="function"?e(l):e+(dt++).toString(),o=l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");n=n.replace(new RegExp('([#;"])('+o+')([")]|\\.[a-z])',"g"),"$1"+i+t+"$3")}),n=n.replace(new RegExp(t,"g"),""),n}c(re,"replaceIDs");function se(n,e){let r=n.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let s in e)r+=" "+s+'="'+e[s]+'"';return'"+n+""}c(se,"iconToHTML");var mt={body:'?',height:80,width:80},ie=new Map,Me=new Map,Qn=c(n=>{for(let e of n){if(!e.name)throw new Error('Invalid icon loader. Must have a "name" property with non-empty string value.');if(I.debug("Registering icon pack:",e.name),"loader"in e)Me.set(e.name,e.loader);else if("icons"in e)ie.set(e.name,e.icons);else throw I.error("Invalid icon loader:",e),new Error('Invalid icon loader. Must have either "icons" or "loader" property.')}},"registerIconPacks"),Le=c(async(n,e)=>{let r=J(n,!0,e!==void 0);if(!r)throw new Error(`Invalid icon name: ${n}`);let s=r.prefix||e;if(!s)throw new Error(`Icon name must contain a prefix: ${n}`);let t=ie.get(s);if(!t){let i=Me.get(s);if(!i)throw new Error(`Icon set not found: ${r.prefix}`);try{t={...await i(),prefix:s},ie.set(s,t)}catch(o){throw I.error(o),new Error(`Failed to load icon set: ${r.prefix}`)}}let l=ee(t,r.name);if(!l)throw new Error(`Icon not found: ${n}`);return l},"getRegisteredIconData"),Ae=c(async n=>{try{return await Le(n),!0}catch{return!1}},"isIconAvailable"),ve=c(async(n,e,r)=>{let s;try{s=await Le(n,e?.fallbackPrefix)}catch(i){I.error(i),s=mt}let t=ne(s,e),l=se(re(t.body),{...t.attributes,...r});return P(l,q())},"getIconSVG");function Ce(n){for(var e=[],r=1;rnull,"exec")};function k(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:c((t,l)=>{let i=typeof l=="string"?l:l.source;return i=i.replace(w.caret,"$1"),r=r.replace(t,i),s},"replace"),getRegex:c(()=>new RegExp(r,e),"getRegex")};return s}c(k,"h");var w={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:c(n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:c(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:c(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:c(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:c(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),"headingBeginRegex"),htmlBeginRegex:c(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex")},kt=/^(?:[ \t]*(?:\n|$))+/,xt=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,bt=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,F=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,wt=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,pe=/(?:[*+-]|\d{1,9}[.)])/,qe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Oe=k(qe).replace(/bull/g,pe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),yt=k(qe).replace(/bull/g,pe).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),he=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,St=/^[^\n]+/,ue=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Tt=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ue).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),It=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,pe).getRegex(),N="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fe=/|$))/,$t=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",fe).replace("tag",N).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ge=k(he).replace("hr",F).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",")|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),Rt=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ge).getRegex(),ge={blockquote:Rt,code:xt,def:Tt,fences:bt,heading:wt,hr:F,html:$t,lheading:Oe,list:It,newline:kt,paragraph:Ge,table:B,text:St},Pe=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex(),Et={...ge,lheading:yt,table:Pe,paragraph:k(he).replace("hr",F).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Pe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",N).getRegex()},zt={...ge,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fe).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:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:B,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(he).replace("hr",F).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",Oe).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Mt=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Lt=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,We=/^( {2,}|\\)\n(?!\s*$)/,At=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,Ne=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Dt=k(Ne,"u").replace(/punct/g,Z).getRegex(),_t=k(Ne,"u").replace(/punct/g,He).getRegex(),Ze="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Bt=k(Ze,"gu").replace(/notPunctSpace/g,Ve).replace(/punctSpace/g,de).replace(/punct/g,Z).getRegex(),Ft=k(Ze,"gu").replace(/notPunctSpace/g,Pt).replace(/punctSpace/g,Ct).replace(/punct/g,He).getRegex(),qt=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ve).replace(/punctSpace/g,de).replace(/punct/g,Z).getRegex(),Ot=k(/\\(punct)/,"gu").replace(/punct/g,Z).getRegex(),Gt=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Wt=k(fe).replace("(?:-->|$)","-->").getRegex(),Vt=k("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",Wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),W=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,Ht=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",W).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ue=k(/^!?\[(label)\]\[(ref)\]/).replace("label",W).replace("ref",ue).getRegex(),Qe=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",ue).getRegex(),Nt=k("reflink|nolink(?!\\()","g").replace("reflink",Ue).replace("nolink",Qe).getRegex(),me={_backpedal:B,anyPunctuation:Ot,autolink:Gt,blockSkip:jt,br:We,code:Lt,del:B,emStrongLDelim:Dt,emStrongRDelimAst:Bt,emStrongRDelimUnd:qt,escape:Mt,link:Ht,nolink:Qe,punctuation:vt,reflink:Ue,reflinkSearch:Nt,tag:Vt,text:At,url:B},Zt={...me,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",W).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",W).getRegex()},oe={...me,emStrongRDelimAst:Ft,emStrongLDelim:_t,url:k(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\":">",'"':""","'":"'"},je=c(n=>Qt[n],"ke");function T(n,e){if(e){if(w.escapeTest.test(n))return n.replace(w.escapeReplace,je)}else if(w.escapeTestNoEncode.test(n))return n.replace(w.escapeReplaceNoEncode,je);return n}c(T,"w");function De(n){try{n=encodeURI(n).replace(w.percentDecode,"%")}catch{return null}return n}c(De,"J");function _e(n,e){let r=n.replace(w.findPipe,(l,i,o)=>{let a=!1,p=i;for(;--p>=0&&o[p]==="\\";)a=!a;return a?"|":" |"}),s=r.split(w.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length0?-2:-1}c(Kt,"ge");function Be(n,e,r,s,t){let l=e.href,i=e.title||null,o=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let a={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:l,title:i,text:o,tokens:s.inlineTokens(o)};return s.state.inLink=!1,a}c(Be,"fe");function Xt(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(` `).map(l=>{let i=l.match(r.other.beginningSpace);if(i===null)return l;let[o]=i;return o.length>=t.length?l.slice(t.length):l}).join(` `)}c(Xt,"Je");var V=class{static{c(this,"y")}options;rules;lexer;constructor(n){this.options=n||z}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:D(r,` `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let r=e[0],s=Xt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=D(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:D(e[0],` `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let r=D(e[0],` `).split(` `),s="",t="",l=[];for(;r.length>0;){let i=!1,o=[],a;for(a=0;a1,t={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let l=this.rules.other.listItemRegex(r),i=!1;for(;n;){let a=!1,p="",h="";if(!(e=l.exec(n))||this.rules.block.hr.test(n))break;p=e[0],n=n.substring(p.length);let u=e[2].split(` `,1)[0].replace(this.rules.other.listReplaceTabs,A=>" ".repeat(3*A.length)),f=n.split(` `,1)[0],g=!u.trim(),d=0;if(this.options.pedantic?(d=2,h=u.trimStart()):g?d=e[1].length+1:(d=e[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,h=u.slice(d),d+=e[1].length),g&&this.rules.other.blankLine.test(f)&&(p+=f+` `,n=n.substring(f.length+1),a=!0),!a){let A=this.rules.other.nextBulletRegex(d),v=this.rules.other.hrRegex(d),S=this.rules.other.fencesBeginRegex(d),y=this.rules.other.headingBeginRegex(d),it=this.rules.other.htmlBeginRegex(d);for(;n;){let U=n.split(` `,1)[0],C;if(f=U,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),C=f):C=f.replace(this.rules.other.tabCharGlobal," "),S.test(f)||y.test(f)||it.test(f)||A.test(f)||v.test(f))break;if(C.search(this.rules.other.nonSpaceChar)>=d||!f.trim())h+=` `+C.slice(d);else{if(g||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(u)||y.test(u)||v.test(u))break;h+=` `+f}!g&&!f.trim()&&(g=!0),p+=U+` `,n=n.substring(U.length+1),u=C.slice(d)}}t.loose||(i?t.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(i=!0));let x=null,b;this.options.gfm&&(x=this.rules.other.listIsTask.exec(h),x&&(b=x[0]!=="[ ] ",h=h.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:p,task:!!x,checked:b,loose:!1,text:h,tokens:[]}),t.raw+=p}let o=t.items.at(-1);if(o)o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let a=0;au.type==="space"),h=p.length>0&&p.some(u=>this.rules.other.anyLine.test(u.raw));t.loose=h}if(t.loose)for(let a=0;a({text:o,tokens:this.lexer.inline(o),header:!1,align:l.align[a]})));return l}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===` `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let l=D(r.slice(0,-1),"\\");if((r.length-l.length)%2===0)return}else{let l=Kt(e[2],"()");if(l===-2)return;if(l>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+l;e[2]=e[2].substring(0,l),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let l=this.rules.other.pedanticHrefTitle.exec(s);l&&(s=l[1],t=l[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),Be(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let l=r[0].charAt(0);return{type:"text",raw:l,text:l}}return Be(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,l,i,o=t,a=0,p=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(p.lastIndex=0,e=e.slice(-1*n.length+t);(s=p.exec(e))!=null;){if(l=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!l)continue;if(i=[...l].length,s[3]||s[4]){o+=i;continue}else if((s[5]||s[6])&&t%3&&!((t+i)%3)){a+=i;continue}if(o-=i,o>0)continue;i=Math.min(i,i+o+a);let h=[...s[0]][0].length,u=n.slice(0,t+s.index+h+i);if(Math.min(t,i)%2){let g=u.slice(1,-1);return{type:"em",raw:u,text:g,tokens:this.lexer.inlineTokens(g)}}let f=u.slice(2,-2);return{type:"strong",raw:u,text:f,tokens:this.lexer.inlineTokens(f)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},$=class le{static{c(this,"l")}tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||z,this.options.tokenizer=this.options.tokenizer||new V,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:w,block:G.normal,inline:j.normal};this.options.pedantic?(r.block=G.pedantic,r.inline=j.pedantic):this.options.gfm&&(r.block=G.gfm,this.options.breaks?r.inline=j.breaks:r.inline=j.gfm),this.tokenizer.rules=r}static get rules(){return{block:G,inline:j}}static lex(e,r){return new le(r).lex(e)}static lexInline(e,r){return new le(r).inlineTokens(e)}lex(e){e=e.replace(w.carriageReturn,` `),this.blockTokens(e,this.tokens);for(let r=0;r(t=i.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let i=r.at(-1);t.raw.length===1&&i!==void 0?i.raw+=` `:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(` `)?"":` `)+t.raw,i.text+=` `+t.text,this.inlineQueue.at(-1).src=i.text):r.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(` `)?"":` `)+t.raw,i.text+=` `+t.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},r.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),r.push(t);continue}let l=e;if(this.options.extensions?.startBlock){let i=1/0,o=e.slice(1),a;this.options.extensions.startBlock.forEach(p=>{a=p.call({lexer:this},o),typeof a=="number"&&a>=0&&(i=Math.min(i,a))}),i<1/0&&i>=0&&(l=e.substring(0,i+1))}if(this.state.top&&(t=this.tokenizer.paragraph(l))){let i=r.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(` `)?"":` `)+t.raw,i.text+=` `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):r.push(t),s=l.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(` `)?"":` `)+t.raw,i.text+=` `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):r.push(t);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let s=e,t=null;if(this.tokens.links){let o=Object.keys(this.tokens.links);if(o.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)o.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let l=!1,i="";for(;e;){l||(i=""),l=!1;let o;if(this.options.extensions?.inline?.some(p=>(o=p.call({lexer:this},e,r))?(e=e.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);let p=r.at(-1);o.type==="text"&&p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):r.push(o);continue}if(o=this.tokenizer.emStrong(e,s,i)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),r.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),r.push(o);continue}let a=e;if(this.options.extensions?.startInline){let p=1/0,h=e.slice(1),u;this.options.extensions.startInline.forEach(f=>{u=f.call({lexer:this},h),typeof u=="number"&&u>=0&&(p=Math.min(p,u))}),p<1/0&&p>=0&&(a=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(a)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(i=o.raw.slice(-1)),l=!0;let p=r.at(-1);p?.type==="text"?(p.raw+=o.raw,p.text+=o.text):r.push(o);continue}if(e){let p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return r}},H=class{static{c(this,"P")}options;parser;constructor(n){this.options=n||z}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(w.notSpaceStart)?.[0],t=n.replace(w.endingNewline,"")+` `;return s?'
'+(r?t:T(t,!0))+`
`:"
"+(r?t:T(t,!0))+`
`}blockquote({tokens:n}){return`
${this.parser.parse(n)}
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`${this.parser.parseInline(n)} `}hr(n){return`
`}list(n){let e=n.ordered,r=n.start,s="";for(let i=0;i `+s+" `}listitem(n){let e="";if(n.task){let r=this.checkbox({checked:!!n.checked});n.loose?n.tokens[0]?.type==="paragraph"?(n.tokens[0].text=r+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=r+" "+T(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`
  • ${e}
  • `}checkbox({checked:n}){return"'}paragraph({tokens:n}){return`

    ${this.parser.parseInline(n)}

    `}table(n){let e="",r="";for(let t=0;t${s}`),` `+e+` `+s+`
    `}tablerow({text:n}){return` ${n} `}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+` `}strong({tokens:n}){return`${this.parser.parseInline(n)}`}em({tokens:n}){return`${this.parser.parseInline(n)}`}codespan({text:n}){return`${T(n,!0)}`}br(n){return"
    "}del({tokens:n}){return`${this.parser.parseInline(n)}`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=De(n);if(t===null)return s;n=t;let l='
    ",l}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=De(n);if(t===null)return T(r);n=t;let l=`${r}{let i=t[l].flat(1/0);r=r.concat(this.walkTokens(i,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let l=e.renderers[t.name];l?e.renderers[t.name]=function(...i){let o=t.renderer.apply(this,i);return o===!1&&(o=l.apply(this,i)),o}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=e[t.level];l?l.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new H(this.defaults);for(let l in r.renderer){if(!(l in t))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let i=l,o=r.renderer[i],a=t[i];t[i]=(...p)=>{let h=o.apply(t,p);return h===!1&&(h=a.apply(t,p)),h||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new V(this.defaults);for(let l in r.tokenizer){if(!(l in t))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let i=l,o=r.tokenizer[i],a=t[i];t[i]=(...p)=>{let h=o.apply(t,p);return h===!1&&(h=a.apply(t,p)),h}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new _;for(let l in r.hooks){if(!(l in t))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let i=l,o=r.hooks[i],a=t[i];_.passThroughHooks.has(l)?t[i]=p=>{if(this.defaults.async&&_.passThroughHooksRespectAsync.has(l))return Promise.resolve(o.call(t,p)).then(u=>a.call(t,u));let h=o.call(t,p);return a.call(t,h)}:t[i]=(...p)=>{let h=o.apply(t,p);return h===!1&&(h=a.apply(t,p)),h}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,l=r.walkTokens;s.walkTokens=function(i){let o=[];return o.push(l.call(this,i)),t&&(o=o.concat(t.call(this,i))),o}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return $.lex(n,e??this.defaults)}parser(n,e){return R.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},l=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));t.hooks&&(t.hooks.options=t,t.hooks.block=n);let i=t.hooks?t.hooks.provideLexer():n?$.lex:$.lexInline,o=t.hooks?t.hooks.provideParser():n?R.parse:R.parseInline;if(t.async)return Promise.resolve(t.hooks?t.hooks.preprocess(e):e).then(a=>i(a,t)).then(a=>t.hooks?t.hooks.processAllTokens(a):a).then(a=>t.walkTokens?Promise.all(this.walkTokens(a,t.walkTokens)).then(()=>a):a).then(a=>o(a,t)).then(a=>t.hooks?t.hooks.postprocess(a):a).catch(l);try{t.hooks&&(e=t.hooks.preprocess(e));let a=i(e,t);t.hooks&&(a=t.hooks.processAllTokens(a)),t.walkTokens&&this.walkTokens(a,t.walkTokens);let p=o(a,t);return t.hooks&&(p=t.hooks.postprocess(p)),p}catch(a){return l(a)}}}onError(n,e){return r=>{if(r.message+=` Please report this to https://github.com/markedjs/marked.`,n){let s="

    An error occurred:

    "+T(r.message+"",!0)+"
    ";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},E=new Jt;function m(n,e){return E.parse(n,e)}c(m,"d");m.options=m.setOptions=function(n){return E.setOptions(n),m.defaults=E.defaults,Fe(m.defaults),m};m.getDefaults=ce;m.defaults=z;m.use=function(...n){return E.use(...n),m.defaults=E.defaults,Fe(m.defaults),m};m.walkTokens=function(n,e){return E.walkTokens(n,e)};m.parseInline=E.parseInline;m.Parser=R;m.parser=R.parse;m.Renderer=H;m.TextRenderer=ke;m.Lexer=$;m.lexer=$.lex;m.Tokenizer=V;m.Hooks=_;m.parse=m;var er=m.options,tr=m.setOptions,nr=m.use,rr=m.walkTokens,sr=m.parseInline;var ir=R.parse,or=$.lex;function Yt(n,{markdownAutoWrap:e}){let s=n.replace(//g,` `).replace(/\n{2,}/g,` `);return Ce(s)}c(Yt,"preprocessMarkdown");function Ke(n){return n.split(/\\n|\n|/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}c(Ke,"nonMarkdownToLines");function Xe(n,e={}){let r=Yt(n,e),s=m.lexer(r),t=[[]],l=0;function i(o,a="normal"){o.type==="text"?o.text.split(` `).forEach((h,u)=>{u!==0&&(l++,t.push([])),h.split(" ").forEach(f=>{f=f.replace(/'/g,"'"),f&&t[l].push({content:f,type:a})})}):o.type==="strong"||o.type==="em"?o.tokens.forEach(p=>{i(p,o.type)}):o.type==="html"&&t[l].push({content:o.text,type:"normal"})}return c(i,"processNode"),s.forEach(o=>{o.type==="paragraph"?o.tokens?.forEach(a=>{i(a)}):o.type==="html"?t[l].push({content:o.text,type:"normal"}):t[l].push({content:o.raw,type:"normal"})}),t}c(Xe,"markdownToLines");function Je(n){return n?`

    ${n.replace(/\\n|\n/g,"
    ")}

    `:""}c(Je,"nonMarkdownToHTML");function Ye(n,{markdownAutoWrap:e}={}){let r=m.lexer(n);function s(t){return t.type==="text"?e===!1?t.text.replace(/\n */g,"
    ").replace(/ /g," "):t.text.replace(/\n */g,"
    "):t.type==="strong"?`${t.tokens?.map(s).join("")}`:t.type==="em"?`${t.tokens?.map(s).join("")}`:t.type==="paragraph"?`

    ${t.tokens?.map(s).join("")}

    `:t.type==="space"?"":t.type==="html"?`${t.text}`:t.type==="escape"?t.text:(I.warn(`Unsupported markdown: ${t.type}`),t.raw)}return c(s,"output"),r.map(s).join("")}c(Ye,"markdownToHTML");function en(n){return Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(e=>e.segment):[...n]}c(en,"splitTextToChars");function tn(n,e){let r=en(e.content);return et(n,[],r,e.type)}c(tn,"splitWordToFitWidth");function et(n,e,r,s){if(r.length===0)return[{content:e.join(""),type:s},{content:"",type:s}];let[t,...l]=r,i=[...e,t];return n([{content:i.join(""),type:s}])?et(n,i,l,s):(e.length===0&&t&&(e.push(t),r.shift()),[{content:e.join(""),type:s},{content:r.join(""),type:s}])}c(et,"splitWordToFitWidthRecursion");function tt(n,e){if(n.some(({content:r})=>r.includes(` `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return xe(n,e)}c(tt,"splitLineToFitWidth");function xe(n,e,r=[],s=[]){if(n.length===0)return s.length>0&&r.push(s),r.length>0?r:[];let t="";n[0].content===" "&&(t=" ",n.shift());let l=n.shift()??{content:" ",type:"normal"},i=[...s];if(t!==""&&i.push({content:t,type:"normal"}),i.push(l),e(i))return xe(n,e,r,i);if(s.length>0)r.push(s),n.unshift(l);else if(l.content){let[o,a]=tn(e,l);r.push([o]),a.content&&n.unshift(a)}return xe(n,e,r)}c(xe,"splitLineToFitWidthRecursion");function nt(n,e){e&&n.attr("style",e)}c(nt,"applyStyle");var rt=16384;async function nn(n,e,r,s,t=!1,l=q()){let i=n.append("foreignObject");i.attr("width",`${Math.min(10*r,rt)}px`),i.attr("height",`${Math.min(10*r,rt)}px`);let o=i.append("xhtml:div"),a=Q(e.label)?await ye(e.label.replace(Se.lineBreakRegex,` `),l):P(e.label,l),p=e.isNode?"nodeLabel":"edgeLabel",h=o.append("span");h.html(a),nt(h,e.labelStyle),h.attr("class",`${p} ${s}`),nt(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),t&&o.attr("class","labelBkg");let u=o.node().getBoundingClientRect();return u.width===r&&(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px"),u=o.node().getBoundingClientRect()),i.node()}c(nn,"addHtmlSpan");function be(n,e,r,s=!1){let t=n.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return s&&t.attr("text-anchor","middle"),t}c(be,"createTspan");function rn(n,e,r){let s=n.append("text"),t=be(s,1,e);we(t,r);let l=t.node().getComputedTextLength();return s.remove(),l}c(rn,"computeWidthOfText");function Mr(n,e,r){let s=n.append("text"),t=be(s,1,e);we(t,[{content:r,type:"normal"}]);let l=t.node()?.getBoundingClientRect();return l&&s.remove(),l}c(Mr,"computeDimensionOfText");function sn(n,e,r,s=!1,t=!1){let i=e.append("g"),o=i.insert("rect").attr("class","background").attr("style","stroke: none"),a=i.append("text").attr("y","-10.1");t&&a.attr("text-anchor","middle");let p=0;for(let h of r){let u=c(g=>rn(i,1.1,g)<=n,"checkWidth"),f=u(h)?[h]:tt(h,u);for(let g of f){let d=be(a,p,1.1,t);we(d,g),p++}}if(s){let h=a.node().getBBox(),u=2;return o.attr("x",h.x-u).attr("y",h.y-u).attr("width",h.width+2*u).attr("height",h.height+2*u),i.node()}else return a.node()}c(sn,"createFormattedText");function st(n){let e=/&(amp|lt|gt);/g;return n.replace(e,(r,s)=>{switch(s){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}c(st,"decodeHTMLEntities");function we(n,e){n.text(""),e.forEach((r,s)=>{let t=n.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");s===0?t.text(st(r.content)):t.text(" "+st(r.content))})}c(we,"updateTextContentAndStyles");async function on(n,e={}){let r=[];n.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(t,l,i)=>(r.push((async()=>{let o=`${l}:${i}`;return await Ae(o)?await ve(o,void 0,{class:"label-icon"}):``})()),t));let s=await Promise.all(r);return n.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>s.shift()??"")}c(on,"replaceIconSubstring");var Lr=c(async(n,e="",{style:r="",isTitle:s=!1,classes:t="",useHtmlLabels:l=!0,markdown:i=!0,isNode:o=!0,width:a=200,addSvgBackground:p=!1}={},h)=>{if(I.debug("XYZ createText",e,r,s,t,l,o,"addSvgBackground: ",p),l){let u=i?Ye(e,h):Je(e),f=await on(K(u),h),g=e.replace(/\\\\/g,"\\"),d={isNode:o,label:Q(e)?g:f,labelStyle:r.replace("fill:","color:")};return await nn(n,d,a,t,p,h)}else{let u=K(e.replace(//g,"
    ")),f=i?Xe(u.replace("
    ","
    "),h):Ke(u),g=sn(a,n,f,e?p:!1,!o);if(o){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");M(g).attr("style",d)}else{let d=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");M(g).select("rect").attr("style",d.replace(/background:/g,"fill:"));let x=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");M(g).select("text").attr("style",x)}return s?M(g).selectAll("tspan.text-outer-tspan").classed("title-row",!0):M(g).selectAll("tspan.text-outer-tspan").classed("row",!0),g}},"createText");export{mt as a,Qn as b,ve as c,Ce as d,Mr as e,Lr as f};