var _o=Object.defineProperty;var go=(e,t,n)=>t in e?_o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>go(e,typeof t!="symbol"?t+"":t,n);import{U as bo,Z as Kr,x as cr,r as Ee,d as ko,n as nn,c as rn,e as Ct,b as Qe,t as We,aV as Ro,p as Ao,f as fr,C as on,X as vo}from"./index-07rBQy2o.js";import{s as Do}from"./safeText-O-oWGdGq.js";function qa(e){const t=Ee(""),n=Ee(!1),r=Ee(0),i=Ee(""),o=cr(()=>e.suggest(t.value)),s=cr(()=>n.value&&o.value.length?u(r.value):void 0);bo(o,()=>{r.value>=o.value.length&&(r.value=0)});function u(R){return`${e.listId}-opt-${R}`}function l(R){i.value="",Kr(()=>{i.value=R})}function c(){n.value=t.value.trim()!=="",r.value=0}function d(R){const C=o.value.length;if(!n.value){n.value=!0,r.value=R===1||!C?0:C-1;return}C&&(r.value=(r.value+R+C)%C)}function p(R){if(R.key==="Enter"){R.preventDefault();const C=o.value[r.value];!R.isComposing&&n.value&&C!==void 0&&e.onPick(C);return}switch(R.key){case"ArrowDown":R.preventDefault(),d(1);break;case"ArrowUp":R.preventDefault(),d(-1);break;case"Escape":n.value?(R.preventDefault(),n.value=!1):t.value&&(R.preventDefault(),t.value="");break;case"Backspace":t.value===""&&e.onBackspace();break;case"Tab":n.value=!1;break}}function k(){n.value=!0,r.value=0}function m(){n.value=!1}function h(R){R!==r.value&&(r.value=R)}function T(){t.value="",n.value=!1,r.value=0}return{query:t,open:n,active:r,announcement:i,suggestions:o,activeId:s,optionId:u,announce:l,onInput:c,onKeydown:p,move:d,show:k,close:m,hover:h,reset:T}}const Co=["aria-labelledby","aria-describedby"],xo=["id"],Eo=["id"],wo={key:0,class:"error-text",role:"alert"},yo={class:"btn-row chat-confirm-buttons"},To=["aria-busy","disabled"],Fo=["disabled"],So=["disabled"],Ha=ko({__name:"ConfirmDialog",props:{title:{},body:{default:""},confirmLabel:{},cancelLabel:{},extraLabel:{default:""},tone:{default:"neutral"},cancelClass:{default:"btn ghost"},extraClass:{default:"btn ghost"}},setup(e,{expose:t}){const n=e,r=vo(),i=Ee(null),o=Ee(null),s=Ee(!1),u=Ee("");let l=null,c,d="cancel",p=null;function k(D={}){return p?.("cancel"),c=D.action,d="cancel",u.value="",s.value=!1,l=D.from??(document.activeElement instanceof HTMLElement?document.activeElement:null),i.value?.open||i.value?.showModal(),Kr(()=>o.value?.focus()),new Promise(v=>{p=v})}function m(D){d=D,i.value?.close()}function h(D){s.value&&D.preventDefault()}function T(){l?.isConnected&&l.focus(),l=null,c=void 0,s.value=!1;const D=p;p=null,D?.(d)}function R(D){D.target===i.value&&!s.value&&m("cancel")}async function C(){if(!s.value){if(!c){m("confirm");return}s.value=!0,u.value="";try{await c()}catch(D){s.value=!1,u.value=D instanceof Error?D.message:String(D);return}s.value=!1,m("confirm")}}return t({open:k}),(D,v)=>(nn(),rn("dialog",{ref_key:"dialog",ref:i,class:"chat-dialog chat-confirm confirm-dialog","aria-labelledby":`confirm-h-${Ct(r)}`,"aria-describedby":`confirm-b-${Ct(r)}`,onCancel:h,onClose:T,onClick:R},[Qe("h2",{id:`confirm-h-${Ct(r)}`,class:"chat-dialog-title"},We(n.title),9,xo),Qe("p",{id:`confirm-b-${Ct(r)}`,class:"chat-confirm-body"},[Ro(D.$slots,"default",{},()=>[Ao(We(n.body),1)])],8,Eo),u.value?(nn(),rn("p",wo,We(u.value),1)):fr("",!0),Qe("div",yo,[Qe("button",{class:on(["btn",{danger:n.tone==="danger"}]),type:"button","aria-busy":s.value?"true":void 0,disabled:s.value,onClick:C},We(n.confirmLabel),11,To),n.extraLabel?(nn(),rn("button",{key:0,class:on(n.extraClass),type:"button",disabled:s.value,onClick:v[0]||(v[0]=A=>m("extra"))},We(n.extraLabel),11,Fo)):fr("",!0),Qe("button",{ref_key:"cancelBtn",ref:o,class:on(n.cancelClass),type:"button",disabled:s.value,onClick:v[1]||(v[1]=A=>m("cancel"))},We(n.cancelLabel),11,So)])],40,Co))}}),hr={};function Io(e){let t=hr[e];if(t)return t;t=hr[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);t.push(r)}for(let n=0;n=55296&&d<=57343?i+="���":i+=String.fromCharCode(d),o+=6;continue}}if((u&248)===240&&o+91114111?i+="����":(p-=65536,i+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),o+=9;continue}}i+="�"}return i})}Ze.defaultChars=";/?:@&=+$,#";Ze.componentChars="";const pr={};function Bo(e){let t=pr[e];if(t)return t;t=pr[e]=[];for(let n=0;n<128;n++){const r=String.fromCharCode(n);/^[0-9a-z]$/i.test(r)?t.push(r):t.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2))}for(let n=0;n"u"&&(n=!0);const r=Bo(t);let i="";for(let o=0,s=e.length;o=55296&&u<=57343){if(u>=55296&&u<=56319&&o+1=56320&&l<=57343){i+=encodeURIComponent(e[o]+e[o+1]),o++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(e[o])}return i}Re.defaultChars=";/?:@&=+$,-_.!~*'()#";Re.componentChars="-_.!~*'()";function Cn(e){let t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&e.hostname.indexOf(":")!==-1?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",t+=e.search||"",t+=e.hash||"",t}function Tt(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const Lo=/^([a-z0-9.+-]+:)/i,Oo=/:[0-9]*$/,zo=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,Mo=["<",">",'"',"`"," ","\r",` `," "],No=["{","}","|","\\","^","`"].concat(Mo),Po=["'"].concat(No),dr=["%","/","?",";","#"].concat(Po),mr=["/","?","#"],jo=255,_r=/^[+a-z0-9A-Z_-]{0,63}$/,Uo=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,gr={javascript:!0,"javascript:":!0},br={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function xn(e,t){if(e&&e instanceof Tt)return e;const n=new Tt;return n.parse(e,t),n}Tt.prototype.parse=function(e,t){let n,r,i,o=e;if(o=o.trim(),!t&&e.split("#").length===1){const c=zo.exec(o);if(c)return this.pathname=c[1],c[2]&&(this.search=c[2]),this}let s=Lo.exec(o);if(s&&(s=s[0],n=s.toLowerCase(),this.protocol=s,o=o.substr(s.length)),(t||s||o.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=o.substr(0,2)==="//",i&&!(s&&gr[s])&&(o=o.substr(2),this.slashes=!0)),!gr[s]&&(i||s&&!br[s])){let c=-1;for(let h=0;h127?D+="x":D+=C[v];if(!D.match(_r)){const v=h.slice(0,T),A=h.slice(T+1),x=C.match(Uo);x&&(v.push(x[1]),A.unshift(x[2])),A.length&&(o=A.join(".")+o),this.hostname=v.join(".");break}}}}this.hostname.length>jo&&(this.hostname=""),m&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const u=o.indexOf("#");u!==-1&&(this.hash=o.substr(u),o=o.slice(0,u));const l=o.indexOf("?");return l!==-1&&(this.search=o.substr(l),o=o.slice(0,l)),o&&(this.pathname=o),br[n]&&this.hostname&&!this.pathname&&(this.pathname=""),this};Tt.prototype.parseHost=function(e){let t=Oo.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};const Jo=Object.freeze(Object.defineProperty({__proto__:null,decode:Ze,encode:Re,format:Cn,parse:xn},Symbol.toStringTag,{value:"Module"})),Qr=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,ei=/[\0-\x1F\x7F-\x9F]/,Wo=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,Fn=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B4E\u1B4F\u1B5A-\u1B60\u1B7D-\u1B7F\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\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[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C1\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2429\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E5\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828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uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0-\uDCBB\uDCC0\uDCC1\uDCD0-\uDCD8\uDD00-\uDE57\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF-\uDEF8\uDF00-\uDF92\uDF94-\uDFEF\uDFFA]/,ni=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,$o=Object.freeze(Object.defineProperty({__proto__:null,Any:Qr,Cc:ei,Cf:Wo,P:Fn,S:ti,Z:ni},Symbol.toStringTag,{value:"Module"})),qo=[8364,0,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,0,381,0,0,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,0,382,376];function Ho(e){return e===0||e>=55296&&e<=57343||e>1114111}function Zo(e){return Ho(e)?65533:e>=128&&e<=159&&qo[e-128]||e}function Yo(e){return e-1>>>0<127||e-160>>>0<55136?String.fromCharCode(e):String.fromCodePoint(Zo(e))}const le=(()=>{const e=new Uint8Array(127);let t=0;for(let n=33;n<=126;n++)n!==34&&n!==36&&n!==92&&(e[n]=t++);return e})();function Xo(e,t,n,r,i,o){const u=e.length,l=o*90;let c=0;const d=()=>{const L=le[e.charCodeAt(c++)];return L=o&&(L=L*91-l+le[e.charCodeAt(c++)]);const j=m[L];if(j<0){let I=h[L];const N=I+T[L];for(;I%#%&}*%}(%}9%}/%})%}*%}*%}?&}&%}3%}&*#%})%#%#)}#&#-#+*%E%%'%'#%}#*V##&##I}#&&##%&%#&&Qf%%))w/0+&%#(#.%-''''++++7}>%4'',##1,#%#&%##&#'##&#*#9)%&%}#*}%,#+P(%A&%#'&##wSD',9E00#y#@}(+}&%&>~!#~!X}#*}(&&}(&}(,%}%&#+&}#&}I%#%}%)#(},'%#*}4%%#%}(''}#/##(##),%-##%%)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{s,UXa*Ta'[y'g:v>ReS;x0PZ&RnlRnn~HrKJw1}f!=x!eB|2w]aP(#Xa&a*Ta.Ua2a7=]iOd'#Y&Ro&WnWg;u.RiDg6vjRiBNvdRlzhNvj]nYJuW_2Wm3x)kFze{9d])!a.!,Y01!#&aC!a3RndC=ox~BrC@2b^{pg,rlse7x'ksuq!%Rm.E{xidw(wBRmGx9o+)X#wwo-So-}69:Rl4@xSf@a#XZ'X)X,Ta(/ARl8b[xc>RfY:RlI:RfQwlg.ARl:9;Rlwdn'#^XafaQa1X1TaHTa)@b[{zcZ#X'7RkwWg@Ou4ARn&x)kG#{,g7u/RkGdH'U#Y*Vz'Wm&CARm|bx#(A]gUbUzJj9Q~=d,#Y(56H}l978H{U7d,0#U*2>ABb_xZ978BbU{e~AJQ{g!978BbU{hxMh?ad{oUYZ.x1h?{l!#:2>@=be}F?JvS!&BG{d7BG}(Bde#`a1X,Ya@!a'P~=wxf@2bZ}I56B2@@=aybb}08@55B9;5bb}Rfg=ayb^}&OuNBKuLA!)a!P~=x#fD{f2@>==23ExY5@Dah89b^~689Jv)!~2b[~1Lv'w(%*!a#bX|aPrmawRe]keu7uhv-q6rxu,q`xTo]/a5aU!bNaDXbi!b-!ao!bRhG<7@C5vIbs)#?C2F|9jPv0w.vISh-MKvUaz(.!9ABbb|[5;5unwfh;9:4E|YjQsBt|vjx'hYq3!(?C2F|J:2kJv~vYrquJu3x4ib#T)2@SmZM?C2F|Bj:rmu9@xPhI(a*a#U#`a3-5Abb|L~@:RhK9:4E|0@52B5G|#C::aY?C2F|-:2!a)-g>>ri;return t===En?ii:t}function Qo(e){return e-oe.ZERO>>>0<=9}function es(e){return(e|Ft)-oe.LOWER_A>>>0<=5}function ts(e){return(e|Ft)-oe.LOWER_A>>>0<=25}var kr;(function(e){e[e.EntityStart=0]="EntityStart",e[e.NumericStart=1]="NumericStart",e[e.NumericDecimal=2]="NumericDecimal",e[e.NumericHex=3]="NumericHex",e[e.NamedEntity=4]="NamedEntity"})(kr||(kr={}));var Rr;(function(e){e[e.Legacy=0]="Legacy",e[e.Strict=1]="Strict",e[e.Attribute=2]="Attribute"})(Rr||(Rr={}));function ns(e,t,n,r){const i=(t&X.BRANCH_LENGTH)>>7,o=t&X.JUMP_TABLE;if(o){if(i===0)return r===o?n:-1;const l=r-o;if(l>>>0>=i)return-1;const c=e[n+l];return c===0?-1:n+i+c-1&65535}if(i===0)return-1;const s=i+1>>1,u=n+s+i;for(let l=0;l>1)]>>((l&1)<<3)&255;if(d===r){const p=n+s+l;return u+e[p]&65535}if(d>r)return-1}return-1}function Ar(e,t,n){return n===1?String.fromCharCode(e[t]&X.VALUE_MASK):n===2?String.fromCharCode(e[t+1]):String.fromCharCode(e[t+1],e[t+2])}function rs(e,t,n){let r=t+1,i=0,o=r;if(r>>0>9)break;i=i*10+u,r+=1}if(r===o)return 0;r1114111&&(i=1114112);let s=r-t;return s>=En&&(ii=s,s=En),s<>7;do{const p=i+1,k=e.charCodeAt(p);let m,h;if(k===oe.NUM){const T=rs(e,p,o);m=Ko(T),m>0&&e.charCodeAt(p+m-1)!==oe.SEMI&&(m=0),h=m===0?"":Yo(T&Vo)}else if(ts(k)){m=0,h="";const T=k-c;let R;if(T>>>0>7;if(L===0){if(e.charCodeAt(A)!==z)break e;R+=1}else{const j=e.charCodeAt(A)-z;if(j>>>0>=L)break e;const I=r[R+1+j];if(I===0)break e;R=R+L+I&65535}if(v=r[R],A+=1,A>=o)break e}if((v&(X.VALUE_LENGTH|X.FLAG13))===X.FLAG13){const z=(v&X.BRANCH_LENGTH)>>7;if(e.charCodeAt(A)!==(v&X.JUMP_TABLE))break;A+=1;const L=z-1;let j=R+1,I=0;for(;I+1>8&255)))break e;A+=1,j+=1}if(I>1),v=r[R];continue}const x=v>>>14,w=e.charCodeAt(A);if(x!==0){if(w===oe.SEMI){m=A-p+1,h=x===1?String.fromCharCode(v&X.VALUE_MASK):Ar(r,R,x);break}if(x===1)break}const S=ns(r,v,R+(x||1),w);if(S<0)break;R=S,v=r[R],A+=1}h===""&&m>0&&(h=Ar(r,C,D))}else m=0,h="";m===0||n?i=p:(s=0);return u+e.slice(s)}function oi(e){return is(e,!0,!1)}var os=class{constructor(e={}){Y(this,"src_Any",Qr.source);Y(this,"src_Cc",ei.source);Y(this,"src_Z",ni.source);Y(this,"src_P",Fn.source);Y(this,"src_ZPCc",[this.src_Z,this.src_P,this.src_Cc].join("|"));Y(this,"src_ZCc",[this.src_Z,this.src_Cc].join("|"));Y(this,"cache",{});Y(this,"opts",{maxLength:1e4,urlAuth:!1,schema_names:[]});this.opts={...this.opts,...e}}set(e={}){return this.opts={...this.opts,...e},this.cache={},this}escapeRE(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}nestedPairRE(e,t,n=4){const r=this.escapeRE(e),i=this.escapeRE(t),o=`(?:(?!${this.src_ZCc}|${r}|${i}).)`;let s=`${r}${o}{0,1000}${i}`;for(let u=2;u<=n;u++)s=`${r}(?:${o}|${s}){0,1000}${i}`;return s}get_text_separators(){var e;return(e=this.cache).text_separators??(e.text_separators=/[><\uff5c]/)}get_pseudo_letter(){var e;return(e=this.cache).src_pseudo_letter??(e.src_pseudo_letter=new RegExp(`(?:(?!${this.get_text_separators().source}|${this.src_ZPCc})${this.src_Any})`))}get_ipv4_addr(){var e;return(e=this.cache).src_ip4??(e.src_ip4=new RegExp("(?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])[.]){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]|[0-9])"))}get_ipv6_addr(){var n;const e="[0-9A-Fa-f]{1,4}",t=`(?:(?:${e}:${e})|${this.get_ipv4_addr().source})`;return(n=this.cache).src_ip6_addr??(n.src_ip6_addr=new RegExp(`(?:(?:${e}:){6}${t}|::(?:${e}:){5}${t}|(?:${e})?::(?:${e}:){4}${t}|(?:(?:${e}:){0,1}${e})?::(?:${e}:){3}${t}|(?:(?:${e}:){0,2}${e})?::(?:${e}:){2}${t}|(?:(?:${e}:){0,3}${e})?::${e}:${t}|(?:(?:${e}:){0,4}${e})?::${t}|(?:(?:${e}:){0,5}${e})?::${e}|(?:(?:${e}:){0,6}${e})?::)`))}get_ipv6_url_host(){var e;return(e=this.cache).src_ip6_host??(e.src_ip6_host=new RegExp(`\\[${this.get_ipv6_addr().source}\\]`))}get_ipv6_mail_host(){var e;return(e=this.cache).src_ipv6_mail_host??(e.src_ipv6_mail_host=new RegExp(`\\[IPv6:${this.get_ipv6_addr().source}\\]`))}get_auth(){var e;return(e=this.cache).src_auth??(e.src_auth=new RegExp(`(?:(?:(?!${this.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`))}get_port(){var e;return(e=this.cache).src_port??(e.src_port=new RegExp("(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?"))}get_host_terminator(){var e;return(e=this.cache).src_host_terminator??(e.src_host_terminator=new RegExp(`(?=$|${this.get_text_separators().source}|${this.src_ZPCc})(?!${this.opts["---"]?"-(?!--)|":"-|"}_|:\\d|\\.-|\\.(?!$|${this.src_ZPCc}))`))}get_path_terminator(){var e;return(e=this.cache).src_path_terminator??(e.src_path_terminator=new RegExp(`${this.src_ZPCc}|${this.get_text_separators().source}`))}get_path(){var e;return(e=this.cache).src_path??(e.src_path=new RegExp(`(?:[/?#](?:${this.nestedPairRE("[","]")}|${this.nestedPairRE("(",")")}|${this.nestedPairRE("{","}")}|\\"(?:(?!${this.src_ZCc}|["]).){1,100}\\"|\\'(?:(?!${this.src_ZCc}|[']).){1,100}\\'|\\'(?=${this.get_pseudo_letter().source}|[-])|\\.{2,20}[:]?[a-zA-Z0-9%/&]|\\.(?!${this.src_ZCc}|[.]|$)|`+(this.opts["---"]?"\\-(?!--(?:[^-]|$))(?:-{0,19})|":"\\-{1,20}|")+`,(?!${this.src_ZCc}|$)|;(?!${this.src_ZCc}|$)|\\!{1,20}(?!${this.src_ZCc}|[!]|$)|\\?(?!${this.src_ZCc}|[?]|$)|`+this.get_path_extra().source+`[\\\\/:%@#&=_~*]|(?!${this.get_path_terminator().source}).){1,${this.opts.maxLength}}|\\/)?`))}get_mail_name(){var e;return(e=this.cache).src_mail_name??(e.src_mail_name=new RegExp("[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9](?:[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9]|[.](?=[-!#$%&'*+/=?^_`{|}~a-zA-Z0-9])){0,63}"))}get_xn(){var e;return(e=this.cache).src_xn??(e.src_xn=new RegExp("xn--[a-z0-9\\-]{1,59}"))}get_tld(){if(this.cache.tld)return this.cache.tld;const e=[...new Set(this.opts.tlds||[])].sort().reverse().join("|");return this.cache.tld=new RegExp(`${e||"$#none#$"}|${this.get_xn().source}`),this.cache.tld}get_domain_root(){var e;return(e=this.cache).src_domain_root??(e.src_domain_root=new RegExp("(?:"+this.get_xn().source+`|${this.get_pseudo_letter().source}{1,63})`))}get_domain(){var e;return(e=this.cache).src_domain??(e.src_domain=new RegExp("(?:"+this.get_xn().source+`|(?:${this.get_pseudo_letter().source})|(?:${this.get_pseudo_letter().source}(?:-|${this.get_pseudo_letter().source}){0,61}${this.get_pseudo_letter().source}))`))}get_url_host_port(){var e;return(e=this.cache).url_host_port??(e.url_host_port=new RegExp("(?:"+this.get_ipv6_url_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,10}${this.get_domain().source}))`+this.get_port().source+this.get_host_terminator().source))}get_fuzzy_url_host_port(){var e;return(e=this.cache).fuzzy_url_host_port??(e.fuzzy_url_host_port=new RegExp("(?:"+(this.opts.fuzzyIP?this.get_ipv4_addr().source+"|":"")+`(?:(?:(?:${this.get_domain().source})\\.){1,10}(?:${this.get_tld().source})))`+this.get_host_terminator().source))}get_mail_host(){var e;return(e=this.cache).src_mail_host??(e.src_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})\\.){0,4}${this.get_domain().source}))`+this.get_host_terminator().source))}get_fuzzy_mail_host(){var e;return(e=this.cache).src_fuzzy_mail_host??(e.src_fuzzy_mail_host=new RegExp("(?:"+this.get_ipv6_mail_host().source+`|(?:(?:(?:${this.get_domain().source})[.]){1,4}${this.get_domain_root().source}))`+this.get_host_terminator().source))}get_path_extra(){var e;return(e=this.cache).src_path_extra??(e.src_path_extra=new RegExp(""))}get_fuzzy_mail_host_search(){var e;return(e=this.cache).mail_fuzzy_host_search??(e.mail_fuzzy_host_search=new RegExp(`@${this.get_fuzzy_mail_host().source}`,"ig"))}get_fuzzy_link_search(){var e;return(e=this.cache).link_fuzzy_search??(e.link_fuzzy_search=new RegExp(`(^|(?![.:/\\-_@])(?:[$+<=>^\`||]|${this.src_ZPCc}))(?:(?![$+<=>^\`||])${this.get_fuzzy_url_host_port().source}${this.get_path().source})`,"ig"))}get_http_validator(){var e;return(e=this.cache).http_validator??(e.http_validator=new RegExp("\\/\\/"+(this.opts.urlAuth?this.get_auth().source:"")+this.get_url_host_port().source+this.get_path().source,"iy"))}get_relative_proto_validator(){var e;return(e=this.cache).relative_proto_validator??(e.relative_proto_validator=new RegExp((this.opts.urlAuth?this.get_auth().source:"")+`(?:localhost|${this.get_ipv6_url_host().source}|(?:(?:${this.get_domain().source})[.]){1,10}${this.get_domain_root().source})`+this.get_port().source+this.get_host_terminator().source+this.get_path().source,"iy"))}get_mail_name_validator(){var e;return(e=this.cache).mail_name_validator??(e.mail_name_validator=new RegExp(`(?:^|${this.get_text_separators().source}|"|\\(|${this.src_ZCc})(${this.get_mail_name().source})$`))}get_mailto_validator(){var e;return(e=this.cache).mailto_validator??(e.mailto_validator=new RegExp(`${this.get_mail_name().source}@${this.get_mail_host().source}`,"iy"))}get_schema_names(){var e;return(e=this.cache).schema_names??(e.schema_names=new RegExp((this.opts.schema_names||[]).map(t=>this.escapeRE(t)).join("|")))}get_schema_search(){var e;return(e=this.cache).schema_search??(e.schema_search=new RegExp(`(^|(?!_)(?:[><|]|${this.src_ZPCc}))(${this.get_schema_names().source})`,"ig"))}get_schema_at_start(){var e;return(e=this.cache).schema_at_start??(e.schema_at_start=new RegExp(`^${this.get_schema_search().source}`,"i"))}},sn={validate:(e,t,n)=>{const r=n.re.get_http_validator();r.lastIndex=t;const i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)},ss={"http:":sn,"https:":sn,"ftp:":sn,"//":{validate:function(e,t,n){const r=n.re.get_relative_proto_validator();r.lastIndex=t;const i=r.exec(e);return i?t>=3&&e[t-3]===":"||t>=3&&e[t-3]==="/"?0:i[0].length:0},normalize:(e,t)=>t.normalize(e)},"mailto:":{validate:function(e,t,n){const r=n.re.get_mailto_validator();r.lastIndex=t;const i=r.exec(e);return i?i[0].length:0},normalize:(e,t)=>t.normalize(e)}},us="a:cdefgilmnoqrstuwxz|b:abdefghijmnorstvwyz|c:acdfghiklmnoruvwxyz|d:ejkmoz|e:cegrstu|f:ijkmor|g:abdefghilmnpqrstuwy|h:kmnrtu|i:delmnoqrst|j:emop|k:eghimnprwyz|l:abcikrstuvy|m:acdeghklmnopqrstuvwxyz|n:acefgilopruz|o:m|p:aefghklmnrstwy|q:a|r:eosuw|s:abcdeghijklmnortuvxyz|t:cdfghjklmnortvwz|u:agksyz|v:aceginu|w:fs|y:et|z:amw",as="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф";function ls(){const e=as.split("|");return us.split("|").forEach(t=>{const n=t.indexOf(":"),r=t.slice(0,n);for(const i of t.slice(n+1))e.push(r+i)}),e}var cs={fuzzyLink:!1,fuzzyEmail:!0,fuzzyIP:!1,"---":!1,tlds:ls(),urlAuth:!1,maxLength:1e4},vr=class{constructor(e,t,n,r){Y(this,"schema");Y(this,"index");Y(this,"lastIndex");Y(this,"raw");Y(this,"text");Y(this,"url");const i=e.slice(n,r);this.schema=t.toLowerCase(),this.index=n,this.lastIndex=r,this.raw=i,this.text=i,this.url=i}},fs=class{constructor(e={}){Y(this,"__opts__");Y(this,"__schemas__");Y(this,"re");const{rebuilder:t,...n}=e;this.__opts__={...cs,...n},this.__schemas__={...ss},this.re=t||new os,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)})}add(e,t=null){if(!t)delete this.__schemas__[e];else{const n={normalize:(r,i)=>i.normalize(r),...t};this.__schemas__[e]=n}return this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}set(e={}){return this.__opts__={...this.__opts__,...e},this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}test(e){if(!e.length)return!1;let t,n;for(n=this.re.get_schema_search(),n.lastIndex=0;(t=n.exec(e))!==null;)if(this.testSchemaAt(e,t[2],n.lastIndex))return!0;if(this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(n=this.re.get_fuzzy_link_search(),n.lastIndex=0,n.exec(e)!==null))return!0;if(this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&e.indexOf("@")>=0){const r=this.re.get_fuzzy_mail_host_search(),i=this.re.get_mail_name_validator();for(r.lastIndex=0;(t=r.exec(e))!==null;){const o=e.slice(Math.max(0,t.index-65),t.index);if(i.test(o))return!0}}return!1}testSchemaAt(e,t,n){return this.__schemas__[t.toLowerCase()]?this.__schemas__[t.toLowerCase()].validate(e.slice(0,n+this.__opts__.maxLength),n,this):0}match(e){const t=[],n=this.re.get_schema_search();let r,i,o,s,u,l,c=!1,d=!1,p=!1,k=0;if(!e.length)return null;for(n.lastIndex=0,this.__opts__.fuzzyLink&&this.__schemas__["http:"]&&(r=this.re.get_fuzzy_link_search(),r.lastIndex=0),this.__opts__.fuzzyEmail&&this.__schemas__["mailto:"]&&(i=this.re.get_fuzzy_mail_host_search(),i.lastIndex=0,o=this.re.get_mail_name_validator());;){const m=Math.max(k-1,0);if(i&&o&&!p&&(!u||u.index=k)break;i.lastIndex=k)break;r.lastIndexh.lastIndex))&&(h=s);let T;if(!c)for(;;){if(!l){n.lastIndexh.index)break;const D=l;l=void 0;const v=this.testSchemaAt(e,D.schema,D.lastIndex);if(v){T={schema:D.schema,index:D.index,lastIndex:D.lastIndex+v};break}}let R=T;if((!R||u&&(u.indexR.lastIndex))&&(R=u),(!R||s&&(s.indexR.lastIndex))&&(R=s),!R)break;R===u?u=void 0:R===s&&(s=void 0);const C=new vr(e,R.schema,R.index,R.lastIndex);C.schema?this.__schemas__[C.schema].normalize(C,this):this.normalize(C),t.push(C),k=R.lastIndex}return t.length?t:null}matchAtStart(e){if(!e.length)return null;const t=this.re.get_schema_at_start().exec(e);if(!t)return null;const n=this.testSchemaAt(e,t[2],t[0].length);if(!n)return null;const r=new vr(e,t[2],t.index+t[1].length,t.index+t[0].length+n);return this.__schemas__[r.schema].normalize(r,this),r}tlds(e,t=!1){return e=Array.isArray(e)?e:[e],t?this.__opts__.tlds=this.__opts__.tlds.concat(e):this.__opts__.tlds=e,this.re.set({...this.__opts__,schema_names:Object.keys(this.__schemas__)}),this}normalize(e){e.schema||(e.url=`http://${e.url}`),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url=`mailto:${e.url}`)}};const qe=2147483647,pe=36,Sn=1,ot=26,hs=38,ps=700,si=72,ui=128,ai="-",ds=/^xn--/,ms=/[^\0-\x7F]/,_s=/[\x2E\u3002\uFF0E\uFF61]/g,gs={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},un=pe-Sn,de=Math.floor,an=String.fromCharCode;function xe(e){throw new RangeError(gs[e])}function bs(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}function li(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]),e=e.replace(_s,".");const i=e.split("."),o=bs(i,t).join(".");return r+o}function ci(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),Rs=function(e){return e>=48&&e<58?26+(e-48):e>=65&&e<91?e-65:e>=97&&e<123?e-97:pe},Dr=function(e,t){return e+22+75*(e<26)-((t!=0)<<5)},fi=function(e,t,n){let r=0;for(e=n?de(e/ps):e>>1,e+=de(e/t);e>un*ot>>1;r+=pe)e=de(e/un);return de(r+(un+1)*e/(e+hs))},hi=function(e){const t=[],n=e.length;let r=0,i=ui,o=si,s=e.lastIndexOf(ai);s<0&&(s=0);for(let u=0;u=128&&xe("not-basic"),t.push(e.charCodeAt(u));for(let u=s>0?s+1:0;u=n&&xe("invalid-input");const k=Rs(e.charCodeAt(u++));k>=pe&&xe("invalid-input"),k>de((qe-r)/d)&&xe("overflow"),r+=k*d;const m=p<=o?Sn:p>=o+ot?ot:p-o;if(kde(qe/h)&&xe("overflow"),d*=h}const c=t.length+1;o=fi(r-l,c,l==0),de(r/c)>qe-i&&xe("overflow"),i+=de(r/c),r%=c,t.splice(r++,0,i)}return String.fromCodePoint(...t)},pi=function(e){const t=[];e=ci(e);const n=e.length;let r=ui,i=0,o=si;for(const l of e)l<128&&t.push(an(l));const s=t.length;let u=s;for(s&&t.push(ai);u=r&&dde((qe-i)/c)&&xe("overflow"),i+=(l-r)*c,r=l;for(const d of e)if(dqe&&xe("overflow"),d===r){let p=i;for(let k=pe;;k+=pe){const m=k<=o?Sn:k>=o+ot?ot:k-o;if(p{let n={};for(var r in e)xr(n,r,{get:e[r],enumerable:!0});return xr(n,Symbol.toStringTag,{value:"Module"}),n},Ds=di({arrayReplaceAt:()=>Cs,asciiTrim:()=>It,callable:()=>mi,escapeHtml:()=>we,escapeRE:()=>Ls,fromCodePoint:()=>st,isMdAsciiPunct:()=>lt,isPunctChar:()=>gi,isPunctCharCode:()=>at,isSpace:()=>M,isValidEntityCode:()=>In,isWhiteSpace:()=>ut,lib:()=>Os,normalizeReference:()=>St,unescapeAll:()=>Ye,unescapeMd:()=>ys});function mi(e){const t=function(...n){return Reflect.construct(e,n,new.target&&new.target!==t?new.target:e)};return Object.defineProperty(t,"name",{value:e.name}),Object.setPrototypeOf(t,e),t.prototype=e.prototype,t}function Cs(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))}function In(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534||e>=0&&e<=8||e===11||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function st(e){if(e>65535){e-=65536;const t=55296+(e>>10),n=56320+(e&1023);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var _i=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,xs=new RegExp(`${_i.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`,"gi"),Es=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function ws(e,t){if(t.charCodeAt(0)===35&&Es.test(t)){const r=t[1].toLowerCase()==="x"?parseInt(t.slice(2),16):parseInt(t.slice(1),10);return In(r)?st(r):e}const n=oi(e);return n!==e?n:e}function ys(e){return e.indexOf("\\")<0?e:e.replace(_i,"$1")}function Ye(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(xs,function(t,n,r){return n||ws(t,r)})}var Ts=/[&<>"]/,Fs=/[&<>"]/g,Ss={"&":"&","<":"<",">":">",'"':"""};function Is(e){return Ss[e]}function we(e){return Ts.test(e)?e.replace(Fs,Is):e}var Bs=/[.?*+^$[\]\\(){}|-]/g;function Ls(e){return e.replace(Bs,"\\$&")}function M(e){switch(e){case 9:case 32:return!0}return!1}function ut(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function gi(e){return Fn.test(e)||ti.test(e)}function at(e){return gi(st(e))}function lt(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function St(e){return e=e.trim().replace(/\s+/g," "),e.toLowerCase().toUpperCase()}function Er(e){return e===32||e===9||e===10||e===13}function It(e){let t=0;for(;t=t&&Er(e.charCodeAt(n));n--);return e.slice(t,n+1)}var Os={mdurl:Jo,ucmicro:$o};function zs(e,t,n){let r,i,o,s;const u=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos32))return o;if(r===41){if(s===0)break;s--}i++}return t===i||s!==0||(o.str=Ye(e.slice(t,i)),o.pos=i,o.ok=!0),o}function Ns(e,t,n,r){let i,o=t;const s={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)s.str=r.str,s.marker=r.marker;else{if(o>=n)return s;let u=e.charCodeAt(o);if(u!==34&&u!==39&&u!==40)return s;t++,o++,u===40&&(u=41),s.marker=u}for(;oMs,parseLinkLabel:()=>zs,parseLinkTitle:()=>Ns});function ct(e){"@babel/helpers - typeof";return ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ct(e)}function js(e,t){if(ct(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(ct(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Us(e){var t=js(e,"string");return ct(t)=="symbol"?t:t+""}function E(e,t,n){return(t=Us(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Le=class{constructor(e,t,n){E(this,"map",null),E(this,"level",0),E(this,"children",null),E(this,"content",""),E(this,"markup",""),E(this,"info",""),E(this,"block",!1),E(this,"hidden",!1),this.type=e,this.tag=t,this.attrs=null,this.nesting=n,this.meta=null}attrIndex(e){if(!this.attrs)return-1;const t=this.attrs;for(let n=0,r=t.length;n=0&&(n=this.attrs[t][1]),n}attrJoin(e,t){const n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=`${this.attrs[n][1]} ${t}`}},ft=class{constructor(){E(this,"__rules__",[]),E(this,"__cache__",null)}__find__(e){for(let t=0;t{t.enabled&&t.alt.forEach(n=>{n&&e.add(n)})}),this.__cache__=Object.create(null),this.__cache__[""]=[],this.__rules__.forEach(t=>{t.enabled&&this.__cache__[""].push(t.fn)}),e.forEach(t=>{this.__cache__[t]=[],this.__rules__.forEach(n=>{n.enabled&&n.alt.indexOf(t)>=0&&this.__cache__[t].push(n.fn)})})}at(e,t,n={}){const r=this.__find__(e);if(r===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__[r].fn=t,this.__rules__[r].alt=n.alt||[],this.__cache__=null}before(e,t,n,r={}){const i=this.__find__(e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(i,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}after(e,t,n,r={}){const i=this.__find__(e);if(i===-1)throw new Error(`Parser rule not found: ${e}`);this.__rules__.splice(i+1,0,{name:t,enabled:!0,fn:n,alt:r.alt||[]}),this.__cache__=null}push(e,t,n={}){this.__rules__.push({name:e,enabled:!0,fn:t,alt:n.alt||[]}),this.__cache__=null}enable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const i=this.__find__(r);if(i<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[i].enabled=!0,n.push(r)}),this.__cache__=null,n}enableOnly(e,t=!1){Array.isArray(e)||(e=[e]),this.__rules__.forEach(n=>{n.enabled=!1}),this.enable(e,t)}disable(e,t=!1){Array.isArray(e)||(e=[e]);const n=[];return e.forEach(r=>{const i=this.__find__(r);if(i<0){if(t)return;throw new Error(`Rules manager: invalid rule name ${r}`)}this.__rules__[i].enabled=!1,n.push(r)}),this.__cache__=null,n}getRules(e){return this.__cache__||this.__compile__(),this.__cache__[e]||[]}},me={};me.code_inline=function(e,t,n,r,i){const o=e[t];return`${we(o.content)}`};me.code_block=function(e,t,n,r,i){const o=e[t];return`${we(e[t].content)} `};me.fence=function(e,t,n,r,i){const o=e[t],s=o.info?Ye(o.info).trim():"";let u="",l="";if(s){const d=s.split(/(\s+)/g);u=d[0],l=d.slice(2).join("")}let c;if(n.highlight?c=n.highlight(o.content,u,l)||we(o.content):c=we(o.content),c.indexOf("${c} `}return`
${c}
`};me.image=function(e,t,n,r,i){const o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)};me.hardbreak=function(e,t,n){return n.xhtmlOut?`
`:`
`};me.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?`
`:`
`:` `};me.text=function(e,t){return we(e[t].content)};me.html_block=function(e,t){return e[t].content};me.html_inline=function(e,t){return e[t].content};var bi=class{constructor(){E(this,"rules",Object.assign({},me))}renderAttrs(e){let t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t=0&&e[o].hidden&&e[o].nesting===0;)o--;r.block&&r.nesting!==-1&&o>=0&&e[o].hidden&&e[o].nesting===-1&&(i+=` `),i+=(r.nesting===-1?" `:">",i}renderInline(e,t,n){let r="";const i=this.rules;for(let o=0,s=e.length;o\s]/i.test(e)}function Xs(e){return/^<\/a\s*>/i.test(e)}function Gs(e){const t=e.tokens;if(e.md.options.linkify)for(let n=0,r=t.length;n=0;u--){const l=i[u];if(l.type==="link_close"){for(u--;i[u].level!==l.level&&i[u].type!=="link_open";)u--;continue}if(l.type==="html_inline"&&(Ys(l.content)&&s>0&&s--,Xs(l.content)&&s++),!(s>0)&&l.type==="text"&&e.md.linkify.test(l.content)){const c=l.content;let d=e.md.linkify.match(c);const p=[];let k=l.level,m=0;d.length>0&&d[0].index===0&&u>0&&i[u-1].type==="text_special"&&(d=d.slice(1));for(let h=0;hm){const w=new e.Token("text","",0);w.content=c.slice(m,D),w.level=k,p.push(w)}const v=new e.Token("link_open","a",1);v.attrs=[["href",R]],v.level=k++,v.markup="linkify",v.info="auto",p.push(v);const A=new e.Token("text","",0);A.content=C,A.level=k,p.push(A);const x=new e.Token("link_close","a",-1);x.level=--k,x.markup="linkify",x.info="auto",p.push(x),m=d[h].lastIndex}if(m0){let u=i.length;for(const p of o)u+=p.nodes.length-1;const l=new Array(u);let c=0,d=0;o.reverse();for(let p=0;p=0;n--){const r=e[n];r.type==="text"&&!t&&(r.content=r.content.replace(Ks,eu)),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function nu(e){let t=0;for(let n=e.length-1;n>=0;n--){const r=e[n];r.type==="text"&&!t&&Ri.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),r.type==="link_open"&&r.info==="auto"&&t--,r.type==="link_close"&&r.info==="auto"&&t++}}function ru(e){let t;if(e.md.options.typographer)for(t=e.tokens.length-1;t>=0;t--)e.tokens[t].type==="inline"&&(Vs.test(e.tokens[t].content)&&tu(e.tokens[t].children),Ri.test(e.tokens[t].content)&&nu(e.tokens[t].children))}var iu=/['"]/,wr=/['"]/g,yr="’",ou=1e3;function Tr(e,t,n){for(;e.length>n;){const r=e.pop();r.isSingleQuote?t.single=r.prevSameQuoteIdx:t.double=r.prevSameQuoteIdx}}function xt(e,t,n,r){e[t]||(e[t]=[]),e[t].push({pos:n,ch:r})}function su(e,t){let n="",r=0;t.sort((i,o)=>i.pos-o.pos);for(let i=0;i=0&&!(r[n].level<=l);n--);if(Tr(r,i,n+1),u.type!=="text")continue;const c=u.content;let d=0;const p=c.length;e:for(;d=0)R=c.charCodeAt(k.index-1);else for(n=s-1;n>=0&&!(e[n].type==="softbreak"||e[n].type==="hardbreak");n--)if(e[n].content){R=e[n].content.charCodeAt(e[n].content.length-1);break}let C=32;if(d=48&&R<=57&&(h=m=!1),m&&h&&(m=D,h=v),!m&&!h){T&&xt(o,s,k.index,yr);continue}if(h&&(n=T?i.single:i.double,n>=0&&r[n].level===l)){const w=r[n];let S,z;T?(S=t.md.options.quotes[2],z=t.md.options.quotes[3]):(S=t.md.options.quotes[0],z=t.md.options.quotes[1]),xt(o,s,k.index,z),xt(o,w.tokenIdx,w.contentPos,S),Tr(r,i,n);continue e}if(m){if(r.length>=ou)return;r.push({tokenIdx:s,contentPos:k.index,isSingleQuote:T,level:l,prevSameQuoteIdx:T?i.single:i.double}),T?i.single=r.length-1:i.double=r.length-1}else h&&T&&xt(o,s,k.index,yr)}}Object.keys(o).forEach(function(s){const u=Number(s);e[u].content=su(e[u].content,o[s])})}function au(e){if(e.md.options.typographer)for(let t=e.tokens.length-1;t>=0;t--)e.tokens[t].type!=="inline"||!iu.test(e.tokens[t].content)||uu(e.tokens[t].children,e)}function lu(e){let t,n;const r=e.length;for(t=0;t0&&this.level++,this.tokens.push(r),r}isEmpty(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]}skipEmptyLines(e){for(let t=this.lineMax;et;)if(!M(this.src.charCodeAt(--e)))return e+1;return e}skipChars(e,t){for(let n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e}getLines(e,t,n,r){if(e>=t)return"";const i=new Array(t-e);for(let o=0,s=e;sn?i[o]=new Array(u-n+1).join(" ")+this.src.slice(c,d):i[o]=this.src.slice(c,d)}return i.join("")}},fu=65536;function cn(e,t){const n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.slice(n,r)}function Fr(e){const t=[],n=e.length;let r=0,i=e.charCodeAt(r),o=!1,s=0,u="";for(;rn)return!1;let i=t+1;if(e.sCount[i]=4)return!1;let o=e.bMarks[i]+e.tShift[i];if(o>=e.eMarks[i])return!1;const s=e.src.charCodeAt(o++);if(s!==124&&s!==45&&s!==58||o>=e.eMarks[i])return!1;const u=e.src.charCodeAt(o++);if(u!==124&&u!==45&&u!==58&&!M(u)||s===45&&M(u))return!1;for(;o=4)return!1;c=Fr(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop();const p=c.length;if(p===0||p!==d.length)return!1;if(r)return!0;const k=e.parentType;e.parentType="table";const m=e.md.block.ruler.getRules("blockquote"),h=e.push("table_open","table",1),T=[t,0];h.map=T;const R=e.push("thead_open","thead",1);R.map=[t,t+1];const C=e.push("tr_open","tr",1);C.map=[t,t+1];for(let A=0;A=4||(c=Fr(l),c.length&&c[0]===""&&c.shift(),c.length&&c[c.length-1]===""&&c.pop(),v+=p-c.length,v>fu))break;if(i===t+2){const w=e.push("tbody_open","tbody",1);w.map=D=[t+2,0]}const x=e.push("tr_open","tr",1);x.map=[i,i+1];for(let w=0;w=4){r++,i=r;continue}break}e.line=i;const o=e.push("code_block","code",0);return o.content=e.getLines(t,i,4+e.blkIndent,!1)+` `,o.map=[t,e.line],!0}function du(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||i+3>o)return!1;const s=e.src.charCodeAt(i);if(s!==126&&s!==96)return!1;let u=i;i=e.skipChars(i,s);let l=i-u;if(l<3)return!1;const c=e.src.slice(u,i),d=e.src.slice(i,o);if(s===96&&d.indexOf(String.fromCharCode(s))>=0)return!1;if(r)return!0;let p=t,k=!1;for(;p++,!(p>=n||(i=u=e.bMarks[p]+e.tShift[p],o=e.eMarks[p],i=4)&&(i=e.skipChars(i,s),!(i-u=4||e.src.charCodeAt(i)!==62)return!1;if(r)return!0;const u=[],l=[],c=[],d=[],p=e.md.block.ruler.getRules("blockquote"),k=e.parentType;e.parentType="blockquote";let m=!1,h;for(h=t;h=o)break;if(e.src.charCodeAt(i++)===62&&!v){let x=e.sCount[h]+1,w,S;e.src.charCodeAt(i)===32?(i++,x++,S=!1,w=!0):e.src.charCodeAt(i)===9?(w=!0,(e.bsCount[h]+x)%4===3?(i++,x++,S=!1):S=!0):w=!1;let z=x;for(u.push(e.bMarks[h]),e.bMarks[h]=i;i=o,l.push(e.bsCount[h]),e.bsCount[h]=e.sCount[h]+1+(w?1:0),c.push(e.sCount[h]),e.sCount[h]=z-x,d.push(e.tShift[h]),e.tShift[h]=i-e.bMarks[h];continue}if(m)break;let A=!1;for(let x=0,w=p.length;x";const C=[t,0];R.map=C,e.md.block.tokenize(e,t,h);const D=e.push("blockquote_close","blockquote",-1);D.markup=">",e.lineMax=s,e.parentType=k,C[1]=e.line;for(let v=0;v=4)return!1;let o=e.bMarks[t]+e.tShift[t];const s=e.src.charCodeAt(o++);if(s!==42&&s!==45&&s!==95)return!1;let u=1;for(;o=r)return-1;let o=e.src.charCodeAt(i++);if(o<48||o>57)return-1;for(;;){if(i>=r)return-1;if(o=e.src.charCodeAt(i++),o>=48&&o<=57){if(i-n>=10)return-1;continue}if(o===41||o===46)break;return-1}return i=4||e.listIndent>=0&&e.sCount[l]-e.listIndent>=4&&e.sCount[l]=e.blkIndent&&(d=!0);let p,k,m;if((m=Ir(e,l))>=0){if(p=!0,s=e.bMarks[l]+e.tShift[l],k=Number(e.src.slice(s,m-1)),d&&k!==1)return!1}else if((m=Sr(e,l))>=0)p=!1;else return!1;if(d&&e.skipSpaces(m)>=e.eMarks[l])return!1;if(r)return!0;const h=e.src.charCodeAt(m-1),T=e.tokens.length;p?(u=e.push("ordered_list_open","ol",1),k!==1&&(u.attrs=[["start",k]])):u=e.push("bullet_list_open","ul",1);const R=[l,0];u.map=R,u.markup=String.fromCharCode(h);let C=!1;const D=e.md.block.ruler.getRules("list"),v=e.parentType;for(e.parentType="list";l=i?S=1:S=x-A,S>4&&(S=1);const z=A+S;u=e.push("list_item_open","li",1),u.markup=String.fromCharCode(h);const L=[l,0];u.map=L,p&&(u.info=e.src.slice(s,m-1));const j=e.tight,I=e.tShift[l],N=e.sCount[l],Q=e.listIndent;if(e.listIndent=e.blkIndent,e.blkIndent=z,e.tight=!0,e.tShift[l]=w-e.bMarks[l],e.sCount[l]=x,w>=i&&e.isEmpty(l+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,l,n),(!e.tight||C)&&(c=!1),C=e.line-l>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=Q,e.tShift[l]=I,e.sCount[l]=N,e.tight=j,u=e.push("list_item_close","li",-1),u.markup=String.fromCharCode(h),l=e.line,L[1]=l,l>=n||e.sCount[l]=4)break;let ee=!1;for(let q=0,pt=D.length;q56319)continue;const i=e.charCodeAt(n+1);i>=56320&&i<=57343&&(t--,n++)}return t}function et(e,t){return Math.min(e.eMarks[t]+1,e.src.length)}function Et(e,t){const n=e.lineMax;if(t>=n||e.isEmpty(t))return-1;let r=!1;if(e.sCount[t]-e.blkIndent>3&&(r=!0),e.sCount[t]<0&&(r=!0),!r){const i=e.md.block.ruler.getRules("reference"),o=e.parentType;e.parentType="reference";let s=!1;for(let u=0,l=i.length;u=4||i.charCodeAt(o)!==91)return!1;let u=et(e,t),l="",c=-1,d=++o;for(;ofn*2)return!1;let w=i.charCodeAt(o);if(w===91)return!1;if(w===93){c=o;break}if(w===92&&(w=i.charCodeAt(++o)),w===10&&ofn&&ku(l)>fn))return!1;for(o=c+2;o"u"&&(e.env.references={}),typeof e.env.references[v]>"u"&&(e.env.references[v]={title:D,href:k});const A=e.push("reference_definition","",0);A.map=[t,s],A.hidden=!0;const x=Object.create(null);return x.label=v,A.meta=x,e.line=s,!0}var Au=["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","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],vu=`<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`,Du="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",Di=new RegExp(`^(?:${vu}|${Du})`),Ie=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp(`^|$))`,"i"),/^$/,!0],[new RegExp(`${Di.source}\\s*$`),/^$/,!1]];function Cu(e,t,n,r){let i=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4||!e.md.options.html||e.src.charCodeAt(i)!==60)return!1;let s=e.src.slice(i,o),u=0;for(;u=4)return!1;let s=e.src.charCodeAt(i);if(s!==35||i>=o)return!1;let u=1;for(s=e.src.charCodeAt(++i);s===35&&i6||ii&&M(e.src.charCodeAt(l-1))&&(o=l),e.line=t+1;const c=e.push("heading_open",`h${u}`,1);c.markup="########".slice(0,u),c.map=[t,e.line];const d=e.push("inline","",0);d.content=It(e.src.slice(i,o)),d.map=[t,e.line],d.children=[];const p=e.push("heading_close",`h${u}`,-1);return p.markup="########".slice(0,u),!0}function Eu(e,t,n){const r=e.md.block.ruler.getRules("paragraph");if(e.sCount[t]-e.blkIndent>=4)return!1;const i=e.parentType;e.parentType="paragraph";let o=0,s,u=t+1;for(;u3)continue;if(e.sCount[u]>=e.blkIndent){let m=e.bMarks[u]+e.tShift[u];const h=e.eMarks[u];if(m=h))){o=s===61?1:2;break}}if(e.sCount[u]<0)continue;let k=!1;for(let m=0,h=r.length;m3||e.sCount[o]<0)continue;let c=!1;for(let d=0,p=r.length;d=n||e.sCount[s]=o){e.line=n;break}const l=e.line;let c=!1;for(let d=0;d=e.line)throw new Error("block rule didn't increment state.line");break}if(!c)throw new Error("none of the block rules matched");e.tight=!u,e.isEmpty(e.line-1)&&(u=!0),s=e.line,s0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r}scanDelims(e,t){const n=this.posMax,r=this.src.charCodeAt(e);let i;if(e===0)i=32;else if(e===1)i=this.src.charCodeAt(0),(i&63488)===55296&&(i=65533);else if(i=this.src.charCodeAt(e-1),(i&64512)===56320){const h=this.src.charCodeAt(e-2);i=(h&64512)===55296?65536+(h-55296<<10)+(i-56320):65533}else(i&64512)===55296&&(i=65533);let o=e;for(;o=65&&e<=90||e>=97&&e<=122}function Su(e){return e>=65&&e<=90||e>=97&&e<=122||e>=48&&e<=57||e===43||e===45||e===46}function Iu(e,t){if(!e.md.options.linkify||e.linkLevel>0)return!1;const n=e.pos,r=e.posMax;if(n+3>r||e.src.charCodeAt(n)!==58||e.src.charCodeAt(n+1)!==47||e.src.charCodeAt(n+2)!==47)return!1;const i=n-Math.min(10,e.pending.length,n);let o=n;for(;o>i&&Su(e.src.charCodeAt(o-1));)o--;if(o===n||!Fu(e.src.charCodeAt(o)))return!1;const s=n-o,u=e.md.linkify.matchAtStart(e.src.slice(o));if(!u)return!1;let l=u.url;if(l.length<=s)return!1;let c=l.length;for(;c>0&&l.charCodeAt(c-1)===42;)c--;c!==l.length&&(l=l.slice(0,c));const d=e.md.normalizeLink(l);if(!e.md.validateLink(d))return!1;if(!t){e.pending=e.pending.slice(0,-s);const p=e.push("link_open","a",1);p.attrs=[["href",d]],p.markup="linkify",p.info="auto";const k=e.push("text","",0);k.content=e.md.normalizeLinkText(l);const m=e.push("link_close","a",-1);m.markup="linkify",m.info="auto"}return e.pos+=l.length-s,!0}function Bu(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==10)return!1;const r=e.pending.length-1,i=e.posMax;if(!t)if(r>=0&&e.pending.charCodeAt(r)===32)if(r>=1&&e.pending.charCodeAt(r-1)===32){let o=r-1;for(;o>=1&&e.pending.charCodeAt(o-1)===32;)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(n++;n?@[]^_`{|}~-".split("").forEach(function(e){Bn[e.charCodeAt(0)]=1});function Lu(e,t){let n=e.pos;const r=e.posMax;if(e.src.charCodeAt(n)!==92||(n++,n>=r))return!1;let i=e.src.charCodeAt(n);if(i===10){for(t||e.push("hardbreak","br",0),n++;n=55296&&i<=56319&&n+1=56320&&u<=57343&&(o+=e.src[n+1],n++)}const s="\\"+o;if(!t){const u=e.push("text_special","",0);i<256&&Bn[i]!==0?u.content=o:u.content=s,u.markup=s,u.info="escape"}return e.pos=n+1,!0}function Ou(e){const t={};let n=0;for(;(n=e.indexOf("`",n))!==-1;){const r=n;for(;e.charCodeAt(++n)===96;);t[n-r]=r}return t}function zu(e,t){var n;const r=e.pos;if(e.src.charCodeAt(r)!==96)return!1;const i=e.posMax;let o=r+1;for(;o=o){let l=o,c;for(;(c=e.src.indexOf("`",l))!==-1&&ci)break;if(l-c===u){if(!t){const d=e.push("code_inline","code",0);d.markup=s;let p=e.src.slice(o,c).replace(/\n/g," ");p.startsWith(" ")&&p.endsWith(" ")&&/[^ ]/.test(p)&&(p=p.slice(1,-1)),d.content=p}return e.pos=l,!0}}}return t||(e.pending+=s),e.pos=o,!0}function Mu(e,t){const n=e.pos,r=e.src.charCodeAt(n);if(t||r!==126)return!1;const i=e.scanDelims(e.pos,!0);let o=i.length;const s=String.fromCharCode(r);if(o<2)return!1;let u;o%2&&(u=e.push("text","",0),u.content=s,o--);for(let l=0;l=0;r--){const i=t[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const o=t[i.end],s=r>0&&t[r-1].end===i.end+1&&t[r-1].marker===i.marker&&t[r-1].token===i.token-1&&t[i.end+1].token===o.token+1,u=String.fromCharCode(i.marker),l=e.tokens[i.token];l.type=s?"strong_open":"em_open",l.tag=s?"strong":"em",l.nesting=1,l.markup=s?u+u:u,l.content="";const c=e.tokens[o.token];c.type=s?"strong_close":"em_close",c.tag=s?"strong":"em",c.nesting=-1,c.markup=s?u+u:u,c.content="",s&&(e.tokens[t[r-1].token].content="",e.tokens[t[i.end+1].token].content="",r--)}}function ju(e){const t=e.tokens_meta,n=e.tokens_meta.length;Lr(e,e.delimiters);for(let i=0;i=p)return!1;if(l=h,i=e.md.helpers.parseLinkDestination(e.src,h,e.posMax),i.ok){for(s=e.md.normalizeLink(i.str),e.md.validateLink(s)?h=i.pos:s="",l=h;h=p||e.src.charCodeAt(h)!==41)&&(c=!0),h++}if(c){if(typeof e.env.references>"u")return!1;if(h=0?r=e.src.slice(l,h++):h=m+1):h=m+1,r||(r=e.src.slice(k,m)),r=St(r),o=e.env.references[r],!o)return e.pos=d,!1;s=o.href,u=o.title}if(!t){e.pos=k,e.posMax=m;const T=e.push("link_open","a",1),R=[["href",s]];if(T.attrs=R,u&&R.push(["title",u]),r){const C=Object.create(null);C.label=r,T.meta=C}e.linkLevel++,e.md.inline.tokenize(e),e.linkLevel--,e.push("link_close","a",-1)}return e.pos=h,e.posMax=p,!0}function Ju(e,t){let n,r,i,o,s,u,l,c,d="";const p=e.pos,k=e.posMax;if(e.src.charCodeAt(e.pos)!==33||e.src.charCodeAt(e.pos+1)!==91)return!1;const m=e.pos+2,h=e.md.helpers.parseLinkLabel(e,e.pos+1,!1);if(h<0)return!1;if(o=h+1,o=k)return!1;for(c=o,u=e.md.helpers.parseLinkDestination(e.src,o,e.posMax),u.ok&&(d=e.md.normalizeLink(u.str),e.md.validateLink(d)?o=u.pos:d=""),c=o;o=k||e.src.charCodeAt(o)!==41)return e.pos=p,!1;o++}else{if(typeof e.env.references>"u")return!1;if(o=0?i=e.src.slice(c,o++):o=h+1):o=h+1,i||(i=e.src.slice(m,h)),i=St(i),s=e.env.references[i],!s)return e.pos=p,!1;d=s.href,l=s.title}if(!t){r=e.src.slice(m,h);const T=[];e.md.inline.parse(r,e.md,e.env,T);const R=e.push("image","img",0),C=[["src",d],["alt",""]];if(R.attrs=C,R.children=T,R.content=r,l&&C.push(["title",l]),i){const D=Object.create(null);D.label=i,R.meta=D}}return e.pos=o,e.posMax=k,!0}var Wu=/^([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])?)*)$/,$u=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function qu(e,t){let n=e.pos;if(e.src.charCodeAt(n)!==60)return!1;const r=e.pos,i=e.posMax;for(;;){if(++n>=i)return!1;const s=e.src.charCodeAt(n);if(s===60)return!1;if(s===62)break}const o=e.src.slice(r+1,n);if($u.test(o)){const s=e.md.normalizeLink(o);if(!e.md.validateLink(s))return!1;if(!t){const u=e.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=o.length+2,!0}if(Wu.test(o)){const s=e.md.normalizeLink(`mailto:${o}`);if(!e.md.validateLink(s))return!1;if(!t){const u=e.push("link_open","a",1);u.attrs=[["href",s]],u.markup="autolink",u.info="auto";const l=e.push("text","",0);l.content=e.md.normalizeLinkText(o);const c=e.push("link_close","a",-1);c.markup="autolink",c.info="auto"}return e.pos+=o.length+2,!0}return!1}function Hu(e){return/^\s]/i.test(e)}function Zu(e){return/^<\/a\s*>/i.test(e)}function yi(e){const t=e|32;return t>=97&&t<=122}function Yu(e,t){const n=e.src;let r,i;if(n.startsWith(""}else if(n.startsWith("";else if(n.charCodeAt(t+1)===63)r=t+2,i="?>";else if(yi(n.charCodeAt(t+2)))r=t+3,i=">";else return-1;if(e.skipHtmlSpecial)return-1;const o=n.indexOf(i,r);return o<0?(e.skipHtmlSpecial=!0,-1):o+i.length}function Xu(e,t){if(!e.md.options.html)return!1;const n=e.posMax,r=e.pos;if(e.src.charCodeAt(r)!==60||r+2>=n)return!1;let i;const o=e.src.charCodeAt(r+1);if(o===33||o===63)i=Yu(e,r);else if(o===47||yi(o)){const s=e.src.slice(r).match(Di);i=s?r+s[0].length:-1}else return!1;if(i<0)return!1;if(!t){const s=e.push("html_inline","",0);s.content=e.src.slice(r,i),Hu(s.content)&&e.linkLevel++,Zu(s.content)&&e.linkLevel--}return e.pos=i,!0}var Gu=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,Vu=/^&([a-z][a-z0-9]{1,31});/i;function Ku(e,t){const n=e.pos,r=e.posMax;if(e.src.charCodeAt(n)!==38||n+1>=r)return!1;if(e.src.charCodeAt(n+1)===35){const i=e.src.slice(n).match(Gu);if(i){if(!t){const o=i[1][0].toLowerCase()==="x"?parseInt(i[1].slice(1),16):parseInt(i[1],10),s=e.push("text_special","",0);s.content=In(o)?st(o):st(65533),s.markup=i[0],s.info="entity"}return e.pos+=i[0].length,!0}}else{const i=e.src.slice(n).match(Vu);if(i){const o=oi(i[0]);if(o!==i[0]){if(!t){const s=e.push("text_special","",0);s.content=o,s.markup=i[0],s.info="entity"}return e.pos+=i[0].length,!0}}}return!1}function Or(e){const t={},n=e.length;if(!n)return;let r=0,i=-2;const o=[];for(let s=0;sl;c-=o[c]+1){const p=e[c];if(p.marker===u.marker&&p.open&&p.end<0){let k=!1;if((p.close||u.open)&&(p.length+u.length)%3===0&&(p.length%3!==0||u.length%3!==0)&&(k=!0),!k){const m=c>0&&!e[c-1].open?o[c-1]+1:0;o[s]=s-c+m,o[c]=m,u.open=!1,p.end=s,p.close=!1,d=-1,i=-2;break}}}d!==-1&&(t[u.marker][(u.open?3:0)+(u.length||0)%3]=d)}}function Qu(e){const t=e.tokens_meta,n=e.tokens_meta.length;Or(e.delimiters);for(let i=0;i0&&r++,i[t].type==="text"&&t+1=e.pos)throw new Error("inline rule didn't increment state.pos");break}}else e.pos=e.posMax;s||e.pos++,o[t]=e.pos}tokenize(e){const t=this.ruler.getRules(""),n=t.length,r=e.posMax,i=e.md.options.maxNesting;for(;e.pos=e.pos)throw new Error("inline rule didn't increment state.pos");break}}if(s){if(e.pos>=r)break;continue}e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()}parse(e,t,n,r){const i=new this.State(e,t,n,r);this.tokenize(i);const o=this.ruler2.getRules(""),s=o.length;for(let u=0;u=0))try{t.hostname=Cr.toASCII(t.hostname)}catch{}return t.auth&&(t.auth=Re(t.auth)),t.hostname&&(t.hostname=Re(t.hostname)),t.pathname&&(t.pathname=Re(t.pathname)),t.search&&(t.search=Re(t.search)),t.hash&&(t.hash=Re(t.hash)),Cn(t)}normalizeLinkText(e){const t=xn(e,!0);if(t.hostname&&(!t.protocol||zr.indexOf(t.protocol)>=0))try{t.hostname=Cr.toUnicode(t.hostname)}catch{}return Ze(Cn(t),Ze.defaultChars+"%")}constructor(...e){E(this,"inline",new Ti),E(this,"block",new Ci),E(this,"core",new Ai),E(this,"renderer",new bi),E(this,"linkify",new fs),E(this,"utils",Ds),E(this,"helpers",Object.assign({},Ps));const[t,n]=e;typeof t=="string"?(this.configure(t),n&&this.set(n)):(this.configure("default"),this.set(t||{}))}set(e){return Object.assign(this.options,e),this}configure(e){let t;if(typeof e=="string"){const i=e;if(t=ta[i],!t)throw new Error(`Wrong 'markdown-it' preset "${i}", check name`)}else t=e;if(!t)throw new Error("Wrong `markdown-it` preset, can't be empty");t.options&&(this.options={...t.options});const n=t.components;if(n){var r;["core","block","inline"].forEach(o=>{var s;const u=(s=n[o])===null||s===void 0?void 0:s.rules;u&&this[o].ruler.enableOnly(u)});const i=(r=n.inline)===null||r===void 0?void 0:r.rules2;i&&this.inline.ruler2.enableOnly(i)}return this}enable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(i=>{n=n.concat(this[i].ruler.enable(e,!0))}),n=n.concat(this.inline.ruler2.enable(e,!0));const r=e.filter(i=>n.indexOf(i)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${r}`);return this}disable(e,t=!1){let n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach(i=>{n=n.concat(this[i].ruler.disable(e,!0))}),n=n.concat(this.inline.ruler2.disable(e,!0));const r=e.filter(i=>n.indexOf(i)<0);if(r.length&&!t)throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${r}`);return this}use(e,...t){return e.apply(e,[this,...t]),this}parse(e,t){if(typeof e!="string")throw new Error("Input data should be a String");const n=new this.core.State(e,this,t);return this.core.process(n),n.tokens}render(e,t={}){return this.renderer.render(this.parse(e,t),this.options,t)}parseInline(e,t){const n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens}renderInline(e,t={}){return this.renderer.render(this.parseInline(e,t),this.options,t)}};E(_e,"Token",Le);E(_e,"Ruler",ft);E(_e,"Renderer",bi);E(_e,"ParserCore",Ai);E(_e,"StateCore",ki);E(_e,"ParserBlock",Ci);E(_e,"StateBlock",vi);E(_e,"ParserInline",Ti);E(_e,"StateInline",xi);var ia=mi(_e);function Mr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n2?r-2:0),o=2;o1?n-1:0),i=1;i"u"?null:W(BigInt.prototype.toString),Wr=typeof Symbol>"u"?null:W(Symbol.prototype.toString),ie=W(Object.prototype.hasOwnProperty),it=W(Object.prototype.toString),V=W(RegExp.prototype.test),ke=Li(TypeError);function W(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i2&&arguments[2]!==void 0?arguments[2]:Be;if(Nr&&Nr(e,null),!He(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=n(i);o!==i&&(ca(t)||(t[r]=o),i=o)}e[i]=!0}return e}function ga(e){for(let t=0;t/g),xa=K(/\${[\w\W]*/g),Ea=K(/^data-[\-\w.\u00B7-\uFFFF]+$/),wa=K(/^aria-[\-\w]+$/),Yr=K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ya=K(/^(?:\w+script|data):/i),Ta=K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fa=K(/^html$/i),Sa=K(/^[a-z][.\w]*(-[.\w]+)+$/i),An=K(/<[/\w!]/g),Xr=K(/<[/\w]/g),Ia=K(/<\/no(script|embed|frames)/i),Gr=K(/\/>/i),H={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ba=G(O({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),La=function(){return typeof window>"u"?null:window},Oa=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Vr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ce=function(t,n,r,i){return ie(t,n)&&He(t[n])?O(i.base?se(i.base):{},t[n],i.transform):r},vn=function(t,n,r){const i=ie(t,n)?t[n]:void 0;return i&&typeof i=="object"?se(i):r()};function Oi(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:La();const t=b=>Oi(b);if(t.version="3.4.17",t.removed=[],!e||!e.document||e.document.nodeType!==H.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,i=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,s=e.Node,u=e.Element,l=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,d=e.trustedTypes,p=u.prototype,k=ue(p,"cloneNode"),m=ue(p,"remove"),h=ue(p,"removeAttributeNode"),T=ue(p,"nextSibling"),R=ue(p,"childNodes"),C=ue(p,"parentNode"),D=ue(p,"shadowRoot"),v=ue(p,"attributes"),A=s&&s.prototype?ue(s.prototype,"nodeType"):null,x=s&&s.prototype?ue(s.prototype,"nodeName"):null,w=s&&s.prototype?ue(s.prototype,"ownerDocument"):null,S=function(a){return A?A(a):a.nodeType},z=function(a){return x?x(a):a.nodeName},L=ka(p,"namespaceURI"),j=function(a){return L?L(a):a.namespaceURI};if(typeof o=="function"){const b=n.createElement("template");b.content&&b.content.ownerDocument&&(n=b.content.ownerDocument)}let I,N="",Q,ee=!1,q=0;const pt=function(){if(q>0)throw ke('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Oe=function(a){pt(),q++;try{return I.createHTML(a)}finally{q--}},Mi=function(a){pt(),q++;try{return I.createScriptURL(a)}finally{q--}},Ni=function(){return ee||(Q=Oa(d,i),ee=!0),Q},dt=n,Bt=dt.implementation,Ln=dt.createNodeIterator,Pi=dt.createDocumentFragment,ji=dt.getElementsByTagName,Ui=r.importNode;let P=Vr();t.isSupported=typeof Fi=="function"&&typeof C=="function"&&Bt&&Bt.createHTMLDocument!==void 0;const Ji=Da,Wi=Ca,$i=xa,qi=Ea,Hi=wa,Zi=ya,On=Ta,Yi=Sa;let zn=Yr,U=null;const Lt=O({},[...$r,...gn,...bn,...kn,...qr]);let J=null;const Ot=O({},[...Hr,...Rn,...Zr,...yt]);let ce=Object.seal($e(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Xe=null,Mn=null;const Ae=Object.seal($e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Nn=!0,zt=!0,Pn=!1,Mt=!0,ge=!1,ye=!0,Te=!1,Nt=!1,mt=null,_t=null,Pt=!1,ze=!1,gt=!1,bt=!1,jn=!0,Un=!1;const Jn="user-content-";let jt=!0,Ut=!1,Fe=null,Me={},Se=null;const Wn=O({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let $n=null;const qn=O({},["audio","video","img","source","image","track"]);let Hn=null;const Zn=O({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),kt="http://www.w3.org/1998/Math/MathML",Rt="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let Ne=fe,Jt=!1,Wt=null;const Xi=O({},[kt,Rt,fe],_n),Yn=G(["mi","mo","mn","ms","mtext"]);let $t=O({},Yn);const Xn=G(["annotation-xml"]);let qt=O({},Xn);const Gi=O({},["title","style","font","a","script"]);let Ge=null;const Vi=["application/xhtml+xml","text/html"],Ki="text/html";let $=null,Pe=null;const Qi=n.createElement("form"),Gn=function(a){return a instanceof RegExp||a instanceof Function},Ht=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Pe&&Pe===a)return;(!a||typeof a!="object")&&(a={}),a=se(a),Ge=Vi.indexOf(a.PARSER_MEDIA_TYPE)===-1?Ki:a.PARSER_MEDIA_TYPE,$=Ge==="application/xhtml+xml"?_n:Be,U=Ce(a,"ALLOWED_TAGS",Lt,{transform:$}),J=Ce(a,"ALLOWED_ATTR",Ot,{transform:$}),Wt=Ce(a,"ALLOWED_NAMESPACES",Xi,{transform:_n}),Hn=Ce(a,"ADD_URI_SAFE_ATTR",Zn,{transform:$,base:Zn}),$n=Ce(a,"ADD_DATA_URI_TAGS",qn,{transform:$,base:qn}),Se=Ce(a,"FORBID_CONTENTS",Wn,{transform:$}),Xe=Ce(a,"FORBID_TAGS",se({}),{transform:$}),Mn=Ce(a,"FORBID_ATTR",se({}),{transform:$}),Me=ie(a,"USE_PROFILES")?a.USE_PROFILES&&typeof a.USE_PROFILES=="object"?se(a.USE_PROFILES):a.USE_PROFILES:!1,Nn=a.ALLOW_ARIA_ATTR!==!1,zt=a.ALLOW_DATA_ATTR!==!1,Pn=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Mt=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ge=a.SAFE_FOR_TEMPLATES||!1,ye=a.SAFE_FOR_XML!==!1,Te=a.WHOLE_DOCUMENT||!1,ze=a.RETURN_DOM||!1,gt=a.RETURN_DOM_FRAGMENT||!1,bt=a.RETURN_TRUSTED_TYPE||!1,Pt=a.FORCE_BODY||!1,jn=a.SANITIZE_DOM!==!1,Un=a.SANITIZE_NAMED_PROPS||!1,jt=a.KEEP_CONTENT!==!1,Ut=a.IN_PLACE||!1,zn=Ra(a.ALLOWED_URI_REGEXP)?a.ALLOWED_URI_REGEXP:Yr,Ne=typeof a.NAMESPACE=="string"?a.NAMESPACE:fe,$t=vn(a,"MATHML_TEXT_INTEGRATION_POINTS",()=>O({},Yn)),qt=vn(a,"HTML_INTEGRATION_POINTS",()=>O({},Xn));const f=vn(a,"CUSTOM_ELEMENT_HANDLING",()=>$e(null));if(ce=$e(null),ie(f,"tagNameCheck")&&Gn(f.tagNameCheck)&&(ce.tagNameCheck=f.tagNameCheck),ie(f,"attributeNameCheck")&&Gn(f.attributeNameCheck)&&(ce.attributeNameCheck=f.attributeNameCheck),ie(f,"allowCustomizedBuiltInElements")&&typeof f.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=f.allowCustomizedBuiltInElements),K(ce),ge&&(zt=!1),gt&&(ze=!0),Me&&(U=O({},qr),J=$e(null),Me.html===!0&&(O(U,$r),O(J,Hr)),Me.svg===!0&&(O(U,gn),O(J,Rn),O(J,yt)),Me.svgFilters===!0&&(O(U,bn),O(J,Rn),O(J,yt)),Me.mathMl===!0&&(O(U,kn),O(J,Zr),O(J,yt))),Ae.tagCheck=null,Ae.attributeCheck=null,ie(a,"ADD_TAGS")&&(typeof a.ADD_TAGS=="function"?Ae.tagCheck=a.ADD_TAGS:He(a.ADD_TAGS)&&(U===Lt&&(U=se(U)),O(U,a.ADD_TAGS,$))),ie(a,"ADD_ATTR")&&(typeof a.ADD_ATTR=="function"?Ae.attributeCheck=a.ADD_ATTR:He(a.ADD_ATTR)&&(J===Ot&&(J=se(J)),O(J,a.ADD_ATTR,$))),ie(a,"ADD_FORBID_CONTENTS")&&He(a.ADD_FORBID_CONTENTS)&&(Se===Wn&&(Se=se(Se)),O(Se,a.ADD_FORBID_CONTENTS,$)),jt&&(U["#text"]=!0),Te&&O(U,["html","head","body"]),U.table&&(O(U,["tbody"]),delete Xe.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ke('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const _=I;I=a.TRUSTED_TYPES_POLICY;try{N=Oe("")}catch(g){throw I=_,g}}else a.TRUSTED_TYPES_POLICY===null?(I=void 0,N=""):(I===void 0&&(I=Ni()),I&&typeof N=="string"&&(N=Oe("")));G&&G(a),Pe=a},Vn=O({},[...gn,...bn,...Aa]),Kn=O({},[...kn,...va]),eo=function(a,f,_){return f.namespaceURI===fe?a==="svg":f.namespaceURI===kt?a==="svg"&&(_==="annotation-xml"||$t[_]):!!Vn[a]},to=function(a,f,_){return f.namespaceURI===fe?a==="math":f.namespaceURI===Rt?a==="math"&&qt[_]:!!Kn[a]},no=function(a,f,_){return f.namespaceURI===Rt&&!qt[_]||f.namespaceURI===kt&&!$t[_]?!1:!Kn[a]&&(Gi[a]||!Vn[a])},ro=function(a){const f=j(a),_=Be(z(a)),g=C(a);let y,F;return g&&S(g)===H.element?(y={namespaceURI:j(g)},F=Be(z(g))):(y={namespaceURI:Ne},F="template"),Wt[f]?f===Rt?eo(_,y,F):f===kt?to(_,y,F):f===fe?no(_,y,F):!!(Ge==="application/xhtml+xml"&&Wt[f]):!1},ve=function(a){tt(t.removed,{element:a});try{C(a).removeChild(a)}catch{if(m(a),!C(a))throw ke("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qn=function(a,f,_){try{h(a,f)}catch{try{a.removeAttribute(_)}catch{}}},Zt=function(a){Xt(a);const f=R(a);f&&be(ha(f),g=>{try{m(g)}catch{}});const _=S(a)===H.element?v(a):null;if(_)for(let g=_.length-1;g>=0;--g){const y=_[g],F=y&&y.name;typeof F=="string"&&Qn(a,y,F)}},je=function(a,f,_){if(!_)try{_=f.getAttributeNode(a)}catch{_=null}tt(t.removed,{attribute:_||null,from:f});try{_?h(f,_):f.removeAttribute(a)}catch{try{f.removeAttribute(a)}catch{}}if(a==="is")if(ze||gt)try{ve(f)}catch{}else try{f.setAttribute(a,"")}catch{}},er=function(a){const f=v(a);if(f)for(let _=f.length-1;_>=0;--_){const g=f[_],y=g&&g.name;typeof y!="string"||J[$(y)]||Qn(a,g,y)}},Yt=function(a,f){let _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const g=[a];for(;g.length>0;){const y=g.pop();if(f(y)===!1)continue;if(_&&S(y)===H.element){const B=D(y);De(B)&&g.push(B)}const F=R(y);if(F)for(let B=F.length-1;B>=0;--B)g.push(F[B])}},Xt=function(a){Yt(a,f=>{S(f)===H.element&&er(f)})},Gt=function(a){const f=[];return Yt(a,_=>{f.push(_)},!0),f},io=function(a,f){const _=dn();be(Gt(a),g=>{S(g)===H.element&&mn(_,g)}),be(f,g=>{S(g)===H.element&&!nt(_,g)&&er(g)})},tr=function(a,f){let _=!1;return be(t.removed,g=>{g.element&&(_=_||g.element===a,Xt(g.element))}),io(a,f),_},oo=8,so=function(a,f){const _=Fe;let g=null;const y=()=>(g||(g=dn(),be(f,F=>{mn(g,F)})),g);for(let F=0;;F++){const B=Gt(a),Z=[a];let he=!1;if(be(B,te=>{S(te)===H.documentFragment?tt(Z,te):!he&&!nt(_,te)&&(he=nt(y(),te))}),!he)return;if(F>=oo)throw ke("the tree kept changing during in-place sanitization; refusing to return it");be(Z,(te,ne)=>{uo(te,ne>0,a,y())})}},uo=function(a,f,_,g){const y=Vt(a);let F;for(;F=y.nextNode();)!nt(g,F)||nt(Fe,F)||(f&&ae(P.uponSanitizeShadowNode,F,null),Qt(F,_),en(F,_),De(F.content)&&Ke(F.content))},ao=function(a){Fe&&mn(Fe,a)},nr=function(a,f){return ye?a==="patchsrc"?!0:a==="for"&&f!=="label"&&f!=="output":!1},lo=function(a){ye&&Yt(a,f=>{const _=S(f);if(_===H.processingInstruction||_===H.comment&&V(Xr,f.data)){try{m(f)}catch{}return!1}if(_===H.element){const g=f,y=$(z(f));try{g.hasAttribute&&g.hasAttribute("patchsrc")&&g.removeAttribute("patchsrc"),g.hasAttribute&&g.hasAttribute("for")&&nr("for",y)&&g.removeAttribute("for")}catch{}}return!0})},rr=function(a){let f=null,_=null;if(Pt)a=""+a;else{const F=jr(a,/^[\r\n\t ]+/);_=F&&F[0]}Ge==="application/xhtml+xml"&&Ne===fe&&(a=''+a+"");const g=I?Oe(a):a;if(Ne===fe)try{f=new c().parseFromString(g,Ge)}catch{}if(!f||!f.documentElement){f=Bt.createDocument(Ne,"template",null);try{f.documentElement.innerHTML=Jt?N:g}catch{}}const y=f.body||f.documentElement;return a&&_&&y.insertBefore(n.createTextNode(_),y.childNodes[0]||null),Ne===fe?ji.call(f,Te?"html":"body")[0]:Te?f.documentElement:y},Vt=function(a){const f=w?w(a):a.ownerDocument;return Ln.call(f||a,a,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},At=function(a){return a=rt(a,Ji," "),a=rt(a,Wi," "),a=rt(a,$i," "),a},Kt=function(a){var f;ir(a);const _=(f=a.querySelectorAll)===null||f===void 0?void 0:f.call(a,"template");_&&be(_,g=>{De(g.content)&&Kt(g.content)})},ir=function(a){a.normalize();const f=w?w(a):a.ownerDocument,_=Ln.call(f||a,a,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let g=_.nextNode();for(;g;)g.data=At(g.data),g=_.nextNode()},vt=function(a){const f=x?x(a):null;return typeof f!="string"||$(f)!=="form"?!1:typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||a.attributes!==v(a)||typeof a.removeAttribute!="function"||typeof a.removeAttributeNode!="function"||typeof a.getAttributeNode!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function"||a.nodeType!==A(a)||a.childNodes!==R(a)},De=function(a){if(!A||typeof a!="object"||a===null)return!1;try{return A(a)===H.documentFragment}catch{return!1}},Ve=function(a){if(!A||typeof a!="object"||a===null)return!1;try{return typeof A(a)=="number"}catch{return!1}};function ae(b,a,f){b.length!==0&&be(b,_=>{_.call(t,a,f,Pe)})}const co=function(a,f){return!!(ye&&a.hasChildNodes()&&!Ve(a.firstElementChild)&&V(An,a.textContent)&&V(An,a.innerHTML)||ye&&Ba[f]&&S(a)===H.element&&j(a)===fe&&(Ve(a.firstElementChild)||typeof a.textContent=="string"&&V(An,a.textContent))||a.nodeType===H.processingInstruction||ye&&a.nodeType===H.comment&&V(Xr,a.data))},Dt=function(a,f){if(a instanceof RegExp)return V(a,f);if(a instanceof Function){for(var _=arguments.length,g=new Array(_>2?_-2:0),y=2;y<_;y++)g[y-2]=arguments[y];return!!a(f,...g)}return!1},fo=function(a,f,_){if(!Xe[f]&&ur(f)&&Dt(ce.tagNameCheck,f))return!1;if(jt&&!Se[f]&&!Se[Be(f)]){const g=C(a),y=R(a);if(y&&g){const F=y.length;for(let B=F-1;B>=0;--B){const Z=a===_?k(y[B],!0):y[B];g.insertBefore(Z,T(a))}}}return ve(a),!0},or=function(a,f,_,g){return a.length===0?f:f===_||f===g?se(f):f},Ue=function(a,f){return a===f||C(a)!==null?!1:(Ut&&Xt(a),!0)},Qt=function(a,f){if(ao(a),ae(P.beforeSanitizeElements,a,null),Ue(a,f))return!0;if(vt(a))return ve(a),!0;const _=$(z(a));if(U=or(P.uponSanitizeElement,U,Lt,mt),ae(P.uponSanitizeElement,a,{tagName:_,allowedTags:U}),Ue(a,f))return!0;if(co(a,_))return ve(a),!0;if(Xe[_]||!(Ae.tagCheck instanceof Function&&Ae.tagCheck(_))&&!U[_]){const g=fo(a,_,f);return g===!1&&(ae(P.afterSanitizeElements,a,null),Ue(a,f))?!0:g}if(S(a)===H.element&&!ro(a)||(_==="noscript"||_==="noembed"||_==="noframes")&&V(Ia,a.innerHTML))return ve(a),!0;if(ge&&a.nodeType===H.text){const g=At(a.textContent);a.textContent!==g&&(tt(t.removed,{element:a.cloneNode()}),a.textContent=g)}return ae(P.afterSanitizeElements,a,null),Ue(a,f)},sr=function(a,f,_){if(Mn[f]||nr(f,a)||jn&&(f==="id"||f==="name")&&(_ in n||_ in Qi))return!1;const g=J[f]||Ae.attributeCheck instanceof Function&&Ae.attributeCheck(f,a);return zt&&V(qi,f)||Nn&&V(Hi,f)?!0:g?Hn[f]||V(zn,rt(_,On,""))||(f==="src"||f==="xlink:href"||f==="href")&&a!=="script"&&Ur(_,"data:")===0&&$n[a]||Pn&&!V(Zi,rt(_,On,""))?!0:!_:ur(a)&&Dt(ce.tagNameCheck,a)&&Dt(ce.attributeNameCheck,f,a)||f==="is"&&ce.allowCustomizedBuiltInElements&&Dt(ce.tagNameCheck,_)},ho=O({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ur=function(a){return!ho[Be(a)]&&V(Yi,a)},po=function(a,f,_,g){if(I&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!_)switch(d.getAttributeType(a,f)){case"TrustedHTML":return Oe(g);case"TrustedScriptURL":return Mi(g)}return g},mo=function(a,f,_,g){try{return _?a.setAttributeNS(_,f,g):a.setAttribute(f,g),vt(a)?(ve(a),!1):!0}catch{return je(f,a),!1}},ar=function(a,f){return ye&&V(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)?!0:Be(a)==="attributename"&&jr(f,"href")!==null},en=function(a,f){if(ae(P.beforeSanitizeAttributes,a,null),Ue(a,f))return;const _=a.attributes;if(!_||vt(a))return;J=or(P.uponSanitizeAttribute,J,Ot,_t);const g={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let y=_.length;const F=$(a.nodeName);for(;y--;){const B=_[y],Z=B.name,he=B.namespaceURI,te=B.value,ne=$(Z),Je=te;let re=Z==="value"?Je:da(Je),lr=!1;if(g.attrName=ne,g.attrValue=re,g.keepAttr=!0,g.forceKeepAttr=void 0,ae(P.uponSanitizeAttribute,a,g),re=g.attrValue,Un&&(ne==="id"||ne==="name")&&Ur(re,Jn)!==0&&(je(Z,a,B),re=Jn+re,lr=!0),ar(Z,re)){je(Z,a,B);continue}if(!g.forceKeepAttr){if(!g.keepAttr){je(Z,a,B);continue}if(!Mt&&V(Gr,re)){je(Z,a,B);continue}if(ge&&(re=At(re)),!sr(F,ne,re)){je(Z,a,B);continue}re=po(F,ne,he,re),re!==Je&&mo(a,Z,he,re)&&lr&&Pr(t.removed)}}ae(P.afterSanitizeAttributes,a,null),Ue(a,f)},Ke=function(a){let f=null;const _=Vt(a);for(ae(P.beforeSanitizeShadowDOM,a,null);f=_.nextNode();)if(ae(P.uponSanitizeShadowNode,f,null),Qt(f,a),en(f,a),De(f.content)&&Ke(f.content),S(f)===H.element){const g=D(f);De(g)&&(tn(g),Ke(g))}ge&&ir(a),ae(P.afterSanitizeShadowDOM,a,null)},tn=function(a){const f=[{node:a,shadow:null}];for(;f.length>0;){const _=f.pop();if(_.shadow){Ke(_.shadow);continue}const g=_.node,y=S(g)===H.element,F=R(g);if(F)for(let B=F.length-1;B>=0;--B)f.push({node:F[B],shadow:null});if(y){const B=x?x(g):null;if(typeof B=="string"&&$(B)==="template"){const Z=g.content;De(Z)&&f.push({node:Z,shadow:null})}}if(y){const B=D(g);De(B)&&f.push({node:null,shadow:B},{node:B,shadow:null})}}};return t.sanitize=function(b){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,_=null,g=null,y=null;if(Jt=!b,Jt&&(b=""),typeof b!="string"&&!Ve(b)&&(b=ba(b),typeof b!="string"))throw ke("dirty is not a string, aborting");if(!t.isSupported)return b;Nt?(U=mt,J=_t):Ht(a),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(U=se(U)),P.uponSanitizeAttribute.length>0&&(J=se(J)),t.removed=[];const F=Ut&&typeof b!="string"&&Ve(b);let B=[];const Z=Fe;if(F){lo(b);const ne=z(b);if(typeof ne=="string"){const Je=$(ne);if(!U[Je]||Xe[Je])throw Zt(b),ke("root node is forbidden and cannot be sanitized in-place")}if(vt(b))throw Zt(b),ke("root node is clobbered and cannot be sanitized in-place");B=Gt(b),Fe=dn()}else if(Ve(b))f=rr(""),_=f.ownerDocument.importNode(b,!0),_.nodeType===H.element&&_.nodeName==="BODY"||_.nodeName==="HTML"?f=_:f.appendChild(_),tn(f);else{if(!ze&&!ge&&!Te&&b.indexOf("<")===-1)return I&&bt?Oe(b):b;if(f=rr(b),!f)return ze?null:bt?N:""}f&&Pt&&ve(f.firstChild);const he=F?b:f;try{F&&tn(b);const ne=Vt(he);for(;g=ne.nextNode();)Qt(g,he),en(g,he),De(g.content)&&Ke(g.content);F&&so(b,B)}catch(ne){throw F&&(Zt(b),tr(b,B)),ne}finally{Fe=Z}if(F){if(tr(b,B))throw ke("a node selected for removal could not be safely returned; refusing to sanitize in place");return ge&&Kt(b),b}if(ze){if(ge&&Kt(f),gt)for(y=Pi.call(f.ownerDocument);f.firstChild;)y.appendChild(f.firstChild);else y=f;return(J.shadowroot||J.shadowrootmode)&&(y=Ui.call(r,y,!0)),y}let te=Te?f.outerHTML:f.innerHTML;return Te&&U["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&V(Fa,f.ownerDocument.doctype.name)&&(te=" `+te),ge&&(te=At(te)),I&&bt?Oe(te):te},t.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ht(b),Nt=!0,mt=U,_t=J},t.clearConfig=function(){Pe=null,Nt=!1,mt=null,_t=null,I=Q,N=""},t.isValidAttribute=function(b,a,f){Pe||Ht({});const _=$(b),g=$(a);return typeof f=="string"&&(ar(a,f)||!Mt&&V(Gr,f))?!1:sr(_,g,f)},t.addHook=function(b,a){typeof a=="function"&&ie(P,b)&&tt(P[b],a)},t.removeHook=function(b,a){if(ie(P,b)){if(a!==void 0){const f=fa(P[b],a);return f===-1?void 0:pa(P[b],f,1)[0]}return Pr(P[b])}},t.removeHooks=function(b){ie(P,b)&&(P[b]=[])},t.removeAllHooks=function(){P=Vr()},t}var za=Oi();const Tn="noopener noreferrer nofollow",Ma=/^\[([ xX])\] /;function zi(e){const t=e.trim().replace(/[\u0000-\u001f\u007f\s]+/g,"");return/^https:\/\/[^/\\]/i.test(t)||/^\/(?![/\\])/.test(t)?t:null}const ht=new ia({html:!1,linkify:!1,typographer:!1});ht.validateLink=()=>!0;function Na(e,t,n){const r=e[t+2];if(e[t+1]?.type!=="paragraph_open"||r?.type!=="inline"||!r.children)return;const i=Ma.exec(r.content),o=r.children[0];if(!i||o?.type!=="text"||!o.content.startsWith(i[0]))return;o.content=o.content.slice(i[0].length),r.content=r.content.slice(i[0].length),e[t].attrJoin("class","task-list-item");const s=new n.Token("html_inline","",0);s.content=i[1]===" "?'':'',r.children.unshift(s)}function Pa(e,t){const n=[],r=[];for(const i of e){if(i.type==="link_open"){const o=Do(String(i.attrGet("href")??""));if(r.push(!o),!o)continue;(/^https?:/i.test(o)||t.env?.newTabLinks&&o.startsWith("/"))&&(i.attrSet("target","_blank"),i.attrSet("rel",Tn))}else if(i.type==="link_close"){if(r.pop())continue}else if(i.type==="image"){const o=zi(String(i.attrGet("src")??""));if(!o){const s=new t.Token("text","",0);s.content=t.md.renderer.renderInlineAsText(i.children??[],t.md.options,t.env),n.push(s);continue}i.attrSet("loading","lazy"),i.attrSet("decoding","async"),/^https:/i.test(o)&&i.attrSet("referrerpolicy","no-referrer")}n.push(i)}return n}ht.core.ruler.push("bm_safe",e=>{const t=e.tokens;for(let n=0;n`
${i.renderToken(e,t,n)}`;ht.renderer.rules.table_close=(e,t,n,r,i)=>`${i.renderToken(e,t,n)}
`;const ja={ALLOWED_TAGS:["p","h2","h3","h4","h5","h6","ul","ol","li","blockquote","pre","code","hr","strong","em","s","a","img","table","thead","tbody","tr","th","td","div","input","br"],ALLOWED_ATTR:["href","target","rel","src","alt","title","loading","decoding","referrerpolicy","class","style","type","checked","disabled","role","aria-label","tabindex"],ADD_URI_SAFE_ATTR:["target","rel","loading","decoding","referrerpolicy","type","checked","disabled","aria-label","tabindex"],ALLOWED_URI_REGEXP:/^(?:https?:|mailto:|#|\/(?![/\\]))/i,ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1};let Dn=null;function Ua(){if(Dn)return Dn;const e=za(window);return e.setConfig(ja),e.addHook("uponSanitizeAttribute",(t,n)=>{const r=t.nodeName.toLowerCase(),i=n.attrValue.trim();let o=!0;n.attrName==="style"?o=(r==="th"||r==="td")&&/^text-align:\s*(left|center|right);?$/i.test(i):n.attrName==="class"?o=r==="li"&&i==="task-list-item"||r==="div"&&i==="table-scroll":n.attrName==="type"&&(o=r==="input"&&i==="checkbox"),o||(n.keepAttr=!1)}),e.addHook("afterSanitizeAttributes",t=>{t.nodeName==="IMG"?zi(t.getAttribute("src")??"")||t.replaceWith(t.ownerDocument.createTextNode(t.getAttribute("alt")??"")):t.nodeName==="A"?t.hasAttribute("target")&&(t.getAttribute("target")!=="_blank"&&t.setAttribute("target","_blank"),t.getAttribute("rel")!==Tn&&t.setAttribute("rel",Tn)):t.nodeName==="INPUT"&&(t.getAttribute("type")!=="checkbox"?t.remove():t.hasAttribute("disabled")||t.setAttribute("disabled",""))}),Dn=e,e}function Za(e,t={}){if(!e)return"";const n=e.replace(/\r\n?/g,` `).replace(/\u0000/g,""),r=ht.render(n,{newTabLinks:!!t.newTabLinks});return String(Ua().sanitize(r)).trim()}export{Ha as _,Za as r,qa as u};