Intended-AI/.vercel/output/static/_app/immutable/entry/_page.svelte.2f89fa28.js

51 lines
86 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

var fi=Object.defineProperty;var hi=(a,e,n)=>e in a?fi(a,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):a[e]=n;var $n=(a,e,n)=>(hi(a,typeof e!="symbol"?e+"":e,n),n);import{S as Ee,i as Te,s as de,J as _e,K as be,m as D,h as E,n as g,b as V,G as L,H as Y,L as wt,k as W,y as ce,q as nt,a as we,l as q,z as ke,r as rt,c as xe,A as fe,M as tt,g as P,v as De,d as $,f as Me,B as he,I as xt,o as or,e as ue,N as pi,O as ur,u as Nt,P as cr,Q as di,R as mi,x as Et,T as it,U as sn,V as Pe,W as fr,X as Tt,Y as hr,Z as gi,w as pr,_ as Hn,$ as Fn,a0 as Bn,a1 as _i,a2 as bi,a3 as ki}from"../chunks/index.3641fafa.js";import{w as an,d as vi}from"../chunks/index.fa397836.js";function yi(a){let e,n;return{c(){e=_e("svg"),n=_e("path"),this.h()},l(t){e=be(t,"svg",{stroke:!0,fill:!0,"stroke-width":!0,viewBox:!0,"stroke-linecap":!0,"stroke-linejoin":!0,class:!0,height:!0,width:!0,xmlns:!0});var r=D(e);n=be(r,"path",{d:!0}),D(n).forEach(E),r.forEach(E),this.h()},h(){g(n,"d","M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"),g(e,"stroke","currentColor"),g(e,"fill","none"),g(e,"stroke-width","2"),g(e,"viewBox","0 0 24 24"),g(e,"stroke-linecap","round"),g(e,"stroke-linejoin","round"),g(e,"class","h-4 w-4"),g(e,"height","1em"),g(e,"width","1em"),g(e,"xmlns","http://www.w3.org/2000/svg")},m(t,r){V(t,e,r),L(e,n)},p:Y,i:Y,o:Y,d(t){t&&E(e)}}}class wi extends Ee{constructor(e){super(),Te(this,e,null,yi,de,{})}}function xi(a){let e,n,t;return{c(){e=_e("svg"),n=_e("path"),t=_e("path"),this.h()},l(r){e=be(r,"svg",{stroke:!0,fill:!0,"stroke-width":!0,viewBox:!0,"stroke-linecap":!0,"stroke-linejoin":!0,class:!0,height:!0,width:!0,xmlns:!0});var i=D(e);n=be(i,"path",{d:!0}),D(n).forEach(E),t=be(i,"path",{d:!0}),D(t).forEach(E),i.forEach(E),this.h()},h(){g(n,"d","M12 20h9"),g(t,"d","M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z"),g(e,"stroke","currentColor"),g(e,"fill","none"),g(e,"stroke-width","2"),g(e,"viewBox","0 0 24 24"),g(e,"stroke-linecap","round"),g(e,"stroke-linejoin","round"),g(e,"class","h-4 w-4"),g(e,"height","1em"),g(e,"width","1em"),g(e,"xmlns","http://www.w3.org/2000/svg")},m(r,i){V(r,e,i),L(e,n),L(e,t)},p:Y,i:Y,o:Y,d(r){r&&E(e)}}}class Ei extends Ee{constructor(e){super(),Te(this,e,null,xi,de,{})}}function Ti(a){let e,n,t;return{c(){e=_e("svg"),n=_e("line"),t=_e("line"),this.h()},l(r){e=be(r,"svg",{stroke:!0,fill:!0,"stroke-width":!0,viewBox:!0,"stroke-linecap":!0,"stroke-linejoin":!0,class:!0,height:!0,width:!0,xmlns:!0});var i=D(e);n=be(i,"line",{x1:!0,y1:!0,x2:!0,y2:!0}),D(n).forEach(E),t=be(i,"line",{x1:!0,y1:!0,x2:!0,y2:!0}),D(t).forEach(E),i.forEach(E),this.h()},h(){g(n,"x1","12"),g(n,"y1","5"),g(n,"x2","12"),g(n,"y2","19"),g(t,"x1","5"),g(t,"y1","12"),g(t,"x2","19"),g(t,"y2","12"),g(e,"stroke","currentColor"),g(e,"fill","none"),g(e,"stroke-width","2"),g(e,"viewBox","0 0 24 24"),g(e,"stroke-linecap","round"),g(e,"stroke-linejoin","round"),g(e,"class","h-4 w-4"),g(e,"height","1em"),g(e,"width","1em"),g(e,"xmlns","http://www.w3.org/2000/svg")},m(r,i){V(r,e,i),L(e,n),L(e,t)},p:Y,i:Y,o:Y,d(r){r&&E(e)}}}class Ai extends Ee{constructor(e){super(),Te(this,e,null,Ti,de,{})}}function Si(a){let e,n,t,r,i;return{c(){e=_e("svg"),n=_e("polyline"),t=_e("path"),r=_e("line"),i=_e("line"),this.h()},l(l){e=be(l,"svg",{stroke:!0,fill:!0,"stroke-width":!0,viewBox:!0,"stroke-linecap":!0,"stroke-linejoin":!0,class:!0,height:!0,width:!0,xmlns:!0});var s=D(e);n=be(s,"polyline",{points:!0}),D(n).forEach(E),t=be(s,"path",{d:!0}),D(t).forEach(E),r=be(s,"line",{x1:!0,y1:!0,x2:!0,y2:!0}),D(r).forEach(E),i=be(s,"line",{x1:!0,y1:!0,x2:!0,y2:!0}),D(i).forEach(E),s.forEach(E),this.h()},h(){g(n,"points","3 6 5 6 21 6"),g(t,"d","M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"),g(r,"x1","10"),g(r,"y1","11"),g(r,"x2","10"),g(r,"y2","17"),g(i,"x1","14"),g(i,"y1","11"),g(i,"x2","14"),g(i,"y2","17"),g(e,"stroke","currentColor"),g(e,"fill","none"),g(e,"stroke-width","2"),g(e,"viewBox","0 0 24 24"),g(e,"stroke-linecap","round"),g(e,"stroke-linejoin","round"),g(e,"class","h-4 w-4"),g(e,"height","1em"),g(e,"width","1em"),g(e,"xmlns","http://www.w3.org/2000/svg")},m(l,s){V(l,e,s),L(e,n),L(e,t),L(e,r),L(e,i)},p:Y,i:Y,o:Y,d(l){l&&E(e)}}}class Ri extends Ee{constructor(e){super(),Te(this,e,null,Si,de,{})}}var Ii=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},dr={};(function(a){var e=function(n,t){if(!(this instanceof e))return new e(n,t);this.INITIALIZING=-1,this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,this.url=n,t=t||{},this.headers=t.headers||{},this.payload=t.payload!==void 0?t.payload:"",this.method=t.method||this.payload&&"POST"||"GET",this.withCredentials=!!t.withCredentials,this.FIELD_SEPARATOR=":",this.listeners={},this.xhr=null,this.readyState=this.INITIALIZING,this.progress=0,this.chunk="",this.addEventListener=function(r,i){this.listeners[r]===void 0&&(this.listeners[r]=[]),this.listeners[r].indexOf(i)===-1&&this.listeners[r].push(i)},this.removeEventListener=function(r,i){if(this.listeners[r]!==void 0){var l=[];this.listeners[r].forEach(function(s){s!==i&&l.push(s)}),l.length===0?delete this.listeners[r]:this.listeners[r]=l}},this.dispatchEvent=function(r){if(!r)return!0;r.source=this;var i="on"+r.type;return this.hasOwnProperty(i)&&(this[i].call(this,r),r.defaultPrevented)?!1:this.listeners[r.type]?this.listeners[r.type].every(function(l){return l(r),!r.defaultPrevented}):!0},this._setReadyState=function(r){var i=new CustomEvent("readystatechange");i.readyState=r,this.readyState=r,this.dispatchEvent(i)},this._onStreamFailure=function(r){var i=new CustomEvent("error");i.data=r.currentTarget.response,this.dispatchEvent(i),this.close()},this._onStreamAbort=function(r){this.dispatchEvent(new CustomEvent("abort")),this.close()},this._onStreamProgress=function(r){if(this.xhr){if(this.xhr.status!==200){this._onStreamFailure(r);return}this.readyState==this.CONNECTING&&(this.dispatchEvent(new CustomEvent("open")),this._setReadyState(this.OPEN));var i=this.xhr.responseText.substring(this.progress);this.progress+=i.length,i.split(/(\r\n|\r|\n){2}/g).forEach(function(l){l.trim().length===0?(this.dispatchEvent(this._parseEventChunk(this.chunk.trim())),this.chunk=""):this.chunk+=l}.bind(this))}},this._onStreamLoaded=function(r){this._onStreamProgress(r),this.dispatchEvent(this._parseEventChunk(this.chunk)),this.chunk=""},this._parseEventChunk=function(r){if(!r||r.length===0)return null;var i={id:null,retry:null,data:"",event:"message"};r.split(/\n|\r\n|\r/).forEach(function(s){s=s.trimRight();var o=s.indexOf(this.FIELD_SEPARATOR);if(!(o<=0)){var c=s.substring(0,o);if(c in i){var f=s.substring(o+1).trimLeft();c==="data"?i[c]+=f:i[c]=f}}}.bind(this));var l=new CustomEvent(i.event);return l.data=i.data,l.id=i.id,l},this._checkStreamClosed=function(){this.xhr&&this.xhr.readyState===XMLHttpRequest.DONE&&this._setReadyState(this.CLOSED)},this.stream=function(){this._setReadyState(this.CONNECTING),this.xhr=new XMLHttpRequest,this.xhr.addEventListener("progress",this._onStreamProgress.bind(this)),this.xhr.addEventListener("load",this._onStreamLoaded.bind(this)),this.xhr.addEventListener("readystatechange",this._checkStreamClosed.bind(this)),this.xhr.addEventListener("error",this._onStreamFailure.bind(this)),this.xhr.addEventListener("abort",this._onStreamAbort.bind(this)),this.xhr.open(this.method,this.url);for(var r in this.headers)this.xhr.setRequestHeader(r,this.headers[r]);this.xhr.withCredentials=this.withCredentials,this.xhr.send(this.payload)},this.close=function(){this.readyState!==this.CLOSED&&(this.xhr.abort(),this.xhr=null,this._setReadyState(this.CLOSED))}};a.SSE=e})(dr);const{subscribe:Ni,update:Li,...mr}=an({messages:[{role:"assistant",content:"Welcome! Please introduce yourself to your AI competitor."}],chatState:"idle"}),Oi=async a=>{ln(a,"user","loading"),Ci()},Ci=async a=>{const e=new dr.SSE("/api/chat",{headers:{"Content-Type":"application/json"},payload:JSON.stringify({messages:wt(Ue).messages})});e.addEventListener("error",gr),e.addEventListener("message",zi),e.stream()},Di=a=>{mr.set(a)},Mi=()=>mr.set({messages:[{role:"assistant",content:"Welcome! Please introduce yourself to your AI competitor."}],chatState:"idle"}),ln=(a,e,n)=>{Ue.update(t=>({messages:[...t.messages,{role:e,content:a}],chatState:n}))},gr=a=>{ln(a,"system","error"),console.error(a)},zi=a=>{try{if(a.data==="[DONE]")return ln(wt(We),"assistant","idle"),We.set("");wt(We)==="..."&&We.set("");const e=JSON.parse(a.data),[{delta:n}]=e.choices;n.content&&We.update(t=>t+n.content)}catch(e){gr(e)}},Ue={subscribe:Ni,set:Oi,update:Li,reset:Mi,replace:Di},We=an(""),At=an(),rn=a=>localStorage.setItem("chatHistory",JSON.stringify(a)),on=()=>JSON.parse(localStorage.getItem("chatHistory")||"{}"),Pi=vi(Ue,a=>{let e=localStorage.getItem("chatHistory");if(!e&&a.messages.length===1)return null;if(e&&a.messages.length===1)return JSON.parse(e);const n=a.messages[1].content,t=a.messages,r={[n]:t};e||rn(r);const i=on();return i?(i[n]=t,rn(i),At.set(i),i):null}),Ui=a=>{const e=on();delete e[a],rn(e),At.set(e)},$i=a=>on()[a],Gn=a=>{if(wt(Ue).chatState!=="idle"||!a)return;const e=$i(a);Ue.replace({messages:e,chatState:"idle"})};function jn(a,e,n){const t=a.slice();return t[5]=e[n],t}function Wn(a){let e=[],n=new Map,t,r,i=a[0];const l=s=>s[5];for(let s=0;s<i.length;s+=1){let o=jn(a,i,s),c=l(o);n.set(c,e[s]=qn(c,o))}return{c(){for(let s=0;s<e.length;s+=1)e[s].c();t=ue()},l(s){for(let o=0;o<e.length;o+=1)e[o].l(s);t=ue()},m(s,o){for(let c=0;c<e.length;c+=1)e[c]&&e[c].m(s,o);V(s,t,o),r=!0},p(s,o){o&1&&(i=s[0],De(),e=pi(e,o,l,1,s,i,n,t.parentNode,di,qn,t,jn),Me())},i(s){if(!r){for(let o=0;o<i.length;o+=1)P(e[o]);r=!0}},o(s){for(let o=0;o<e.length;o+=1)$(e[o]);r=!1},d(s){for(let o=0;o<e.length;o+=1)e[o].d(s);s&&E(t)}}}function qn(a,e){let n,t,r,i,l=e[5]+"",s,o,c,f,h,b,p,M,G,j,x,O;t=new wi({}),h=new Ei({});function X(){return e[1](e[5])}M=new Ri({});function R(){return e[2](e[5])}function K(){return e[3](e[5])}return{key:a,first:null,c(){n=W("div"),ce(t.$$.fragment),r=we(),i=W("div"),s=nt(l),o=we(),c=W("div"),f=W("button"),ce(h.$$.fragment),b=we(),p=W("button"),ce(M.$$.fragment),G=we(),this.h()},l(w){n=q(w,"DIV",{class:!0});var U=D(n);ke(t.$$.fragment,U),r=xe(U),i=q(U,"DIV",{class:!0});var Re=D(i);s=rt(Re,l),Re.forEach(E),o=xe(U),c=q(U,"DIV",{class:!0});var N=D(c);f=q(N,"BUTTON",{class:!0});var F=D(f);ke(h.$$.fragment,F),F.forEach(E),b=xe(N),p=q(N,"BUTTON",{class:!0});var ie=D(p);ke(M.$$.fragment,ie),ie.forEach(E),N.forEach(E),G=xe(U),U.forEach(E),this.h()},h(){g(i,"class","flex-1 text-ellipsis max-h-5 overflow-hidden break-all relative"),g(f,"class","p-1 hover:text-white"),g(p,"class","p-1 hover:text-white"),g(c,"class","absolute flex right-1 z-10 text-gray-300 visible"),g(n,"class","flex py-3 px-3 items-center gap-3 relative rounded-md cursor-pointer break-all pr-14 bg-opacity-40 hover:bg-white/5 bg-black group animate-flash text-sm"),this.first=n},m(w,U){V(w,n,U),fe(t,n,null),L(n,r),L(n,i),L(i,s),L(n,o),L(n,c),L(c,f),fe(h,f,null),L(c,b),L(c,p),fe(M,p,null),L(n,G),j=!0,x||(O=[tt(f,"click",X),tt(p,"click",ur(R)),tt(n,"click",K)],x=!0)},p(w,U){e=w,(!j||U&1)&&l!==(l=e[5]+"")&&Nt(s,l)},i(w){j||(P(t.$$.fragment,w),P(h.$$.fragment,w),P(M.$$.fragment,w),j=!0)},o(w){$(t.$$.fragment,w),$(h.$$.fragment,w),$(M.$$.fragment,w),j=!1},d(w){w&&E(n),he(t),he(h),he(M),x=!1,cr(O)}}}function Hi(a){let e,n,t,r,i,l,s,o;t=new Ai({});let c=a[0].length>0&&Wn(a);return{c(){e=W("div"),n=W("button"),ce(t.$$.fragment),r=nt(" New Game"),i=we(),c&&c.c(),this.h()},l(f){e=q(f,"DIV",{class:!0});var h=D(e);n=q(h,"BUTTON",{class:!0});var b=D(n);ke(t.$$.fragment,b),r=rt(b," New Game"),b.forEach(E),i=xe(h),c&&c.l(h),h.forEach(E),this.h()},h(){g(n,"class","flex py-3 px-3 items-center gap-3 rounded-md hover:bg-gray-500/10 transition-colors duration-200 text-white cursor-pointer text-sm mb-2 flex-shrink-0 border border-white/20"),g(e,"class","h-[700px] w-[350px] bg-black bg-opacity-20 rounded-md py-4 px-2 overflow-y-auto flex flex-col gap-2")},m(f,h){V(f,e,h),L(e,n),fe(t,n,null),L(n,r),L(e,i),c&&c.m(e,null),l=!0,s||(o=tt(n,"click",Ue.reset),s=!0)},p(f,[h]){f[0].length>0?c?(c.p(f,h),h&1&&P(c,1)):(c=Wn(f),c.c(),P(c,1),c.m(e,null)):c&&(De(),$(c,1,1,()=>{c=null}),Me())},i(f){l||(P(t.$$.fragment,f),P(c),l=!0)},o(f){$(t.$$.fragment,f),$(c),l=!1},d(f){f&&E(e),he(t),c&&c.d(),s=!1,o()}}}function Fi(a,e,n){let t;xt(a,Pi,o=>n(4,t=o));let r=[];return or(()=>{At.set(t),At.subscribe(o=>{n(0,r=Object.keys(o))})}),[r,o=>Gn(o),o=>Ui(o),o=>Gn(o)]}class Bi extends Ee{constructor(e){super(),Te(this,e,Fi,Hi,de,{})}}const Gi={},ji=()=>mi(Gi);function Wi(a){let e,n,t;const r=[a[0],{__index:a[1]}];var i=a[2][a[0].type];function l(s){let o={};for(let c=0;c<r.length;c+=1)o=Pe(o,r[c]);return{props:o}}return i&&(e=Et(i,l())),{c(){e&&ce(e.$$.fragment),n=ue()},l(s){e&&ke(e.$$.fragment,s),n=ue()},m(s,o){e&&fe(e,s,o),V(s,n,o),t=!0},p(s,o){const c=o&3?it(r,[o&1&&sn(s[0]),o&2&&{__index:s[1]}]):{};if(o&5&&i!==(i=s[2][s[0].type])){if(e){De();const f=e;$(f.$$.fragment,1,0,()=>{he(f,1)}),Me()}i?(e=Et(i,l()),ce(e.$$.fragment),P(e.$$.fragment,1),fe(e,n.parentNode,n)):e=null}else i&&e.$set(c)},i(s){t||(e&&P(e.$$.fragment,s),t=!0)},o(s){e&&$(e.$$.fragment,s),t=!1},d(s){s&&E(n),e&&he(e,s)}}}function qi(a){let e,n,t;const r=[a[0],{__index:a[1]}];var i=a[2][a[0].tagName];function l(s){let o={};for(let c=0;c<r.length;c+=1)o=Pe(o,r[c]);return{props:o}}return i&&(e=Et(i,l())),{c(){e&&ce(e.$$.fragment),n=ue()},l(s){e&&ke(e.$$.fragment,s),n=ue()},m(s,o){e&&fe(e,s,o),V(s,n,o),t=!0},p(s,o){const c=o&3?it(r,[o&1&&sn(s[0]),o&2&&{__index:s[1]}]):{};if(o&5&&i!==(i=s[2][s[0].tagName])){if(e){De();const f=e;$(f.$$.fragment,1,0,()=>{he(f,1)}),Me()}i?(e=Et(i,l()),ce(e.$$.fragment),P(e.$$.fragment,1),fe(e,n.parentNode,n)):e=null}else i&&e.$set(c)},i(s){t||(e&&P(e.$$.fragment,s),t=!0)},o(s){e&&$(e.$$.fragment,s),t=!1},d(s){s&&E(n),e&&he(e,s)}}}function Zi(a){let e,n;const t=[a[0]];let r={};for(let i=0;i<t.length;i+=1)r=Pe(r,t[i]);return e=new _r({props:r}),{c(){ce(e.$$.fragment)},l(i){ke(e.$$.fragment,i)},m(i,l){fe(e,i,l),n=!0},p(i,l){const s=l&1?it(t,[sn(i[0])]):{};e.$set(s)},i(i){n||(P(e.$$.fragment,i),n=!0)},o(i){$(e.$$.fragment,i),n=!1},d(i){he(e,i)}}}function Vi(a){let e,n,t,r;const i=[Zi,qi,Wi],l=[];function s(o,c){return o[0].type==="root"?0:o[0].type==="element"?1:o[2][o[0].type]!==void 0?2:-1}return~(e=s(a))&&(n=l[e]=i[e](a)),{c(){n&&n.c(),t=ue()},l(o){n&&n.l(o),t=ue()},m(o,c){~e&&l[e].m(o,c),V(o,t,c),r=!0},p(o,[c]){let f=e;e=s(o),e===f?~e&&l[e].p(o,c):(n&&(De(),$(l[f],1,1,()=>{l[f]=null}),Me()),~e?(n=l[e],n?n.p(o,c):(n=l[e]=i[e](o),n.c()),P(n,1),n.m(t.parentNode,t)):n=null)},i(o){r||(P(n),r=!0)},o(o){$(n),r=!1},d(o){~e&&l[e].d(o),o&&E(t)}}}function Xi(a,e,n){let t,{astNode:r}=e,{__index:i=0}=e,{type:l=void 0}=e,{position:s=void 0}=e;const o=ji();return xt(a,o,c=>n(2,t=c)),a.$$set=c=>{"astNode"in c&&n(0,r=c.astNode),"__index"in c&&n(1,i=c.__index),"type"in c&&n(4,l=c.type),"position"in c&&n(5,s=c.position)},[r,i,t,o,l,s]}let Qi=class extends Ee{constructor(e){super(),Te(this,e,Xi,Vi,de,{astNode:0,__index:1,type:4,position:5})}};function Zn(a,e,n){const t=a.slice();return t[4]=e[n],t[1]=n,t}function Vn(a){let e,n;return e=new Qi({props:{astNode:a[4],__index:a[1]}}),{c(){ce(e.$$.fragment)},l(t){ke(e.$$.fragment,t)},m(t,r){fe(e,t,r),n=!0},p(t,r){const i={};r&1&&(i.astNode=t[4]),e.$set(i)},i(t){n||(P(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){he(e,t)}}}function Yi(a){let e,n,t=a[0],r=[];for(let l=0;l<t.length;l+=1)r[l]=Vn(Zn(a,t,l));const i=l=>$(r[l],1,1,()=>{r[l]=null});return{c(){for(let l=0;l<r.length;l+=1)r[l].c();e=ue()},l(l){for(let s=0;s<r.length;s+=1)r[s].l(l);e=ue()},m(l,s){for(let o=0;o<r.length;o+=1)r[o]&&r[o].m(l,s);V(l,e,s),n=!0},p(l,[s]){if(s&1){t=l[0];let o;for(o=0;o<t.length;o+=1){const c=Zn(l,t,o);r[o]?(r[o].p(c,s),P(r[o],1)):(r[o]=Vn(c),r[o].c(),P(r[o],1),r[o].m(e.parentNode,e))}for(De(),o=t.length;o<r.length;o+=1)i(o);Me()}},i(l){if(!n){for(let s=0;s<t.length;s+=1)P(r[s]);n=!0}},o(l){r=r.filter(Boolean);for(let s=0;s<r.length;s+=1)$(r[s]);n=!1},d(l){fr(r,l),l&&E(e)}}}function Ki(a,e,n){let{children:t}=e,{type:r=void 0}=e,{position:i=void 0}=e,{__index:l=void 0}=e;return a.$$set=s=>{"children"in s&&n(0,t=s.children),"type"in s&&n(2,r=s.type),"position"in s&&n(3,i=s.position),"__index"in s&&n(1,l=s.__index)},[t,l,r,i]}class _r extends Ee{constructor(e){super(),Te(this,e,Ki,Yi,de,{children:0,type:2,position:3,__index:1})}}function Ji(a){let e=a[0],n,t=a[0]&&tn(a);return{c(){t&&t.c(),n=ue()},l(r){t&&t.l(r),n=ue()},m(r,i){t&&t.m(r,i),V(r,n,i)},p(r,i){r[0]?e?de(e,r[0])?(t.d(1),t=tn(r),e=r[0],t.c(),t.m(n.parentNode,n)):t.p(r,i):(t=tn(r),e=r[0],t.c(),t.m(n.parentNode,n)):e&&(t.d(1),t=null,e=r[0])},i:Y,o:Y,d(r){r&&E(n),t&&t.d(r)}}}function es(a){let e=a[0],n,t=a[0]&&nn(a);return{c(){t&&t.c(),n=ue()},l(r){t&&t.l(r),n=ue()},m(r,i){t&&t.m(r,i),V(r,n,i)},p(r,i){r[0]?e?de(e,r[0])?(t.d(1),t=nn(r),e=r[0],t.c(),t.m(n.parentNode,n)):t.p(r,i):(t=nn(r),e=r[0],t.c(),t.m(n.parentNode,n)):e&&(t.d(1),t=null,e=r[0])},i:Y,o(r){$(t)},d(r){r&&E(n),t&&t.d(r)}}}function tn(a){let e,n=[a[2]],t={};for(let r=0;r<n.length;r+=1)t=Pe(t,n[r]);return{c(){e=W(a[0]),this.h()},l(r){e=q(r,(a[0]||"null").toUpperCase(),{}),D(e).forEach(E),this.h()},h(){Tt(a[0])(e,t)},m(r,i){V(r,e,i)},p(r,i){Tt(r[0])(e,t=it(n,[i&4&&r[2]]))},d(r){r&&E(e)}}}function nn(a){let e,n,t;n=new _r({props:{children:a[1]}});let r=[a[2]],i={};for(let l=0;l<r.length;l+=1)i=Pe(i,r[l]);return{c(){e=W(a[0]),ce(n.$$.fragment),this.h()},l(l){e=q(l,(a[0]||"null").toUpperCase(),{});var s=D(e);ke(n.$$.fragment,s),s.forEach(E),this.h()},h(){Tt(a[0])(e,i)},m(l,s){V(l,e,s),fe(n,e,null),t=!0},p(l,s){const o={};s&2&&(o.children=l[1]),n.$set(o),Tt(l[0])(e,i=it(r,[s&4&&l[2]]))},i(l){t||(P(n.$$.fragment,l),t=!0)},o(l){$(n.$$.fragment,l),t=!1},d(l){l&&E(e),he(n)}}}function ts(a){let e,n,t,r,i;const l=[es,Ji],s=[];function o(c,f){return f&2&&(e=null),e==null&&(e=!!(Array.isArray(c[1])&&c[1].length!==0)),e?0:1}return n=o(a,-1),t=s[n]=l[n](a),{c(){t.c(),r=ue()},l(c){t.l(c),r=ue()},m(c,f){s[n].m(c,f),V(c,r,f),i=!0},p(c,[f]){let h=n;n=o(c,f),n===h?s[n].p(c,f):(De(),$(s[h],1,1,()=>{s[h]=null}),Me(),t=s[n],t?t.p(c,f):(t=s[n]=l[n](c),t.c()),P(t,1),t.m(r.parentNode,r))},i(c){i||(P(t),i=!0)},o(c){$(t),i=!1},d(c){s[n].d(c),c&&E(r)}}}function ns(a,e,n){let{tagName:t}=e,{children:r}=e,{properties:i}=e,{type:l=void 0}=e,{position:s=void 0}=e,{__index:o=void 0}=e;return a.$$set=c=>{"tagName"in c&&n(0,t=c.tagName),"children"in c&&n(1,r=c.children),"properties"in c&&n(2,i=c.properties),"type"in c&&n(3,l=c.type),"position"in c&&n(4,s=c.position),"__index"in c&&n(5,o=c.__index)},[t,r,i,l,s,o]}class rs extends Ee{constructor(e){super(),Te(this,e,ns,ts,de,{tagName:0,children:1,properties:2,type:3,position:4,__index:5})}}const is=["address","article","aside","footer","header","h1","h2","h3","h4","h5","h6","main","nav","section","blockquote","dd","div","dl","dt","figcaption","figure","hr","li","menu","ol","p","pre","ul","a","abbr","b","bdi","bdo","br","cite","code","data","dfn","em","i","kbd","mark","q","rp","rt","ruby","s","samp","small","span","strong","sub","sup","time","u","var","wbr","area","audio","img","map","track","video","embed","iframe","object","param","picture","portal","source","svg","math","del","ins","caption","col","colgroup","table","tbody","td","tfoot","th","thead","tr","button","datalist","fieldset","form","input","label","legend","meter","optgroup","option","output","progress","select","textarea","details","dialog","summary"],ss=is.reduce((a,e)=>({...a,[e]:rs}),{});function as(a){let e;return{c(){e=nt(a[0])},l(n){e=rt(n,a[0])},m(n,t){V(n,e,t)},p(n,[t]){t&1&&Nt(e,n[0])},i:Y,o:Y,d(n){n&&E(e)}}}function ls(a,e,n){let{value:t=""}=e,{type:r=void 0}=e,{position:i=void 0}=e,{__index:l=void 0}=e;return a.$$set=s=>{"value"in s&&n(0,t=s.value),"type"in s&&n(1,r=s.type),"position"in s&&n(2,i=s.position),"__index"in s&&n(3,l=s.__index)},[t,r,i,l]}class Xn extends Ee{constructor(e){super(),Te(this,e,ls,as,de,{value:0,type:1,position:2,__index:3})}}({...ss});function br(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}let qe=br();function os(a){qe=a}const kr=/[&<>"']/,us=new RegExp(kr.source,"g"),vr=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,cs=new RegExp(vr.source,"g"),fs={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Qn=a=>fs[a];function oe(a,e){if(e){if(kr.test(a))return a.replace(us,Qn)}else if(vr.test(a))return a.replace(cs,Qn);return a}const hs=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function yr(a){return a.replace(hs,(e,n)=>(n=n.toLowerCase(),n==="colon"?":":n.charAt(0)==="#"?n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1)):""))}const ps=/(^|[^\[])\^/g;function B(a,e){a=typeof a=="string"?a:a.source,e=e||"";const n={replace:(t,r)=>(r=r.source||r,r=r.replace(ps,"$1"),a=a.replace(t,r),n),getRegex:()=>new RegExp(a,e)};return n}const ds=/[^\w:]/g,ms=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Yn(a,e,n){if(a){let t;try{t=decodeURIComponent(yr(n)).replace(ds,"").toLowerCase()}catch{return null}if(t.indexOf("javascript:")===0||t.indexOf("vbscript:")===0||t.indexOf("data:")===0)return null}e&&!ms.test(n)&&(n=ks(e,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch{return null}return n}const vt={},gs=/^[^:]+:\/*[^/]*$/,_s=/^([^:]+:)[\s\S]*$/,bs=/^([^:]+:\/*[^/]*)[\s\S]*$/;function ks(a,e){vt[" "+a]||(gs.test(a)?vt[" "+a]=a+"/":vt[" "+a]=yt(a,"/",!0)),a=vt[" "+a];const n=a.indexOf(":")===-1;return e.substring(0,2)==="//"?n?e:a.replace(_s,"$1")+e:e.charAt(0)==="/"?n?e:a.replace(bs,"$1")+e:a+e}const St={exec:function(){}};function Kn(a,e){const n=a.replace(/\|/g,(i,l,s)=>{let o=!1,c=l;for(;--c>=0&&s[c]==="\\";)o=!o;return o?"|":" |"}),t=n.split(/ \|/);let r=0;if(t[0].trim()||t.shift(),t.length>0&&!t[t.length-1].trim()&&t.pop(),t.length>e)t.splice(e);else for(;t.length<e;)t.push("");for(;r<t.length;r++)t[r]=t[r].trim().replace(/\\\|/g,"|");return t}function yt(a,e,n){const t=a.length;if(t===0)return"";let r=0;for(;r<t;){const i=a.charAt(t-r-1);if(i===e&&!n)r++;else if(i!==e&&n)r++;else break}return a.slice(0,t-r)}function vs(a,e){if(a.indexOf(e[1])===-1)return-1;const n=a.length;let t=0,r=0;for(;r<n;r++)if(a[r]==="\\")r++;else if(a[r]===e[0])t++;else if(a[r]===e[1]&&(t--,t<0))return r;return-1}function ys(a){a&&a.sanitize&&!a.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Jn(a,e){if(e<1)return"";let n="";for(;e>1;)e&1&&(n+=a),e>>=1,a+=a;return n+a}function er(a,e,n,t){const r=e.href,i=e.title?oe(e.title):null,l=a[1].replace(/\\([\[\]])/g,"$1");if(a[0].charAt(0)!=="!"){t.state.inLink=!0;const s={type:"link",raw:n,href:r,title:i,text:l,tokens:t.inlineTokens(l)};return t.state.inLink=!1,s}return{type:"image",raw:n,href:r,title:i,text:oe(l)}}function ws(a,e){const n=a.match(/^(\s+)(?:```)/);if(n===null)return e;const t=n[1];return e.split(`
`).map(r=>{const i=r.match(/^\s+/);if(i===null)return r;const[l]=i;return l.length>=t.length?r.slice(t.length):r}).join(`
`)}class un{constructor(e){this.options=e||qe}space(e){const n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){const n=this.rules.block.code.exec(e);if(n){const t=n[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?t:yt(t,`
`)}}}fences(e){const n=this.rules.block.fences.exec(e);if(n){const t=n[0],r=ws(t,n[3]||"");return{type:"code",raw:t,lang:n[2]?n[2].trim().replace(this.rules.inline._escapes,"$1"):n[2],text:r}}}heading(e){const n=this.rules.block.heading.exec(e);if(n){let t=n[2].trim();if(/#$/.test(t)){const r=yt(t,"#");(this.options.pedantic||!r||/ $/.test(r))&&(t=r.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(e){const n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:n[0]}}blockquote(e){const n=this.rules.block.blockquote.exec(e);if(n){const t=n[0].replace(/^ *>[ \t]?/gm,""),r=this.lexer.state.top;this.lexer.state.top=!0;const i=this.lexer.blockTokens(t);return this.lexer.state.top=r,{type:"blockquote",raw:n[0],tokens:i,text:t}}}list(e){let n=this.rules.block.list.exec(e);if(n){let t,r,i,l,s,o,c,f,h,b,p,M,G=n[1].trim();const j=G.length>1,x={type:"list",raw:"",ordered:j,start:j?+G.slice(0,-1):"",loose:!1,items:[]};G=j?`\\d{1,9}\\${G.slice(-1)}`:`\\${G}`,this.options.pedantic&&(G=j?G:"[*+-]");const O=new RegExp(`^( {0,3}${G})((?:[ ][^\\n]*)?(?:\\n|$))`);for(;e&&(M=!1,!(!(n=O.exec(e))||this.rules.block.hr.test(e)));){if(t=n[0],e=e.substring(t.length),f=n[2].split(`
`,1)[0].replace(/^\t+/,R=>" ".repeat(3*R.length)),h=e.split(`
`,1)[0],this.options.pedantic?(l=2,p=f.trimLeft()):(l=n[2].search(/[^ ]/),l=l>4?1:l,p=f.slice(l),l+=n[1].length),o=!1,!f&&/^ *$/.test(h)&&(t+=h+`
`,e=e.substring(h.length+1),M=!0),!M){const R=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),K=new RegExp(`^ {0,${Math.min(3,l-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),w=new RegExp(`^ {0,${Math.min(3,l-1)}}(?:\`\`\`|~~~)`),U=new RegExp(`^ {0,${Math.min(3,l-1)}}#`);for(;e&&(b=e.split(`
`,1)[0],h=b,this.options.pedantic&&(h=h.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(w.test(h)||U.test(h)||R.test(h)||K.test(e)));){if(h.search(/[^ ]/)>=l||!h.trim())p+=`
`+h.slice(l);else{if(o||f.search(/[^ ]/)>=4||w.test(f)||U.test(f)||K.test(f))break;p+=`
`+h}!o&&!h.trim()&&(o=!0),t+=b+`
`,e=e.substring(b.length+1),f=h.slice(l)}}x.loose||(c?x.loose=!0:/\n *\n *$/.test(t)&&(c=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(p),r&&(i=r[0]!=="[ ] ",p=p.replace(/^\[[ xX]\] +/,""))),x.items.push({type:"list_item",raw:t,task:!!r,checked:i,loose:!1,text:p}),x.raw+=t}x.items[x.items.length-1].raw=t.trimRight(),x.items[x.items.length-1].text=p.trimRight(),x.raw=x.raw.trimRight();const X=x.items.length;for(s=0;s<X;s++)if(this.lexer.state.top=!1,x.items[s].tokens=this.lexer.blockTokens(x.items[s].text,[]),!x.loose){const R=x.items[s].tokens.filter(w=>w.type==="space"),K=R.length>0&&R.some(w=>/\n.*\n/.test(w.raw));x.loose=K}if(x.loose)for(s=0;s<X;s++)x.items[s].loose=!0;return x}}html(e){const n=this.rules.block.html.exec(e);if(n){const t={type:"html",raw:n[0],pre:!this.options.sanitizer&&(n[1]==="pre"||n[1]==="script"||n[1]==="style"),text:n[0]};if(this.options.sanitize){const r=this.options.sanitizer?this.options.sanitizer(n[0]):oe(n[0]);t.type="paragraph",t.text=r,t.tokens=this.lexer.inline(r)}return t}}def(e){const n=this.rules.block.def.exec(e);if(n){const t=n[1].toLowerCase().replace(/\s+/g," "),r=n[2]?n[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",i=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline._escapes,"$1"):n[3];return{type:"def",tag:t,raw:n[0],href:r,title:i}}}table(e){const n=this.rules.block.table.exec(e);if(n){const t={type:"table",header:Kn(n[1]).map(r=>({text:r})),align:n[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:n[3]&&n[3].trim()?n[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(t.header.length===t.align.length){t.raw=n[0];let r=t.align.length,i,l,s,o;for(i=0;i<r;i++)/^ *-+: *$/.test(t.align[i])?t.align[i]="right":/^ *:-+: *$/.test(t.align[i])?t.align[i]="center":/^ *:-+ *$/.test(t.align[i])?t.align[i]="left":t.align[i]=null;for(r=t.rows.length,i=0;i<r;i++)t.rows[i]=Kn(t.rows[i],t.header.length).map(c=>({text:c}));for(r=t.header.length,l=0;l<r;l++)t.header[l].tokens=this.lexer.inline(t.header[l].text);for(r=t.rows.length,l=0;l<r;l++)for(o=t.rows[l],s=0;s<o.length;s++)o[s].tokens=this.lexer.inline(o[s].text);return t}}}lheading(e){const n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){const n=this.rules.block.paragraph.exec(e);if(n){const t=n[1].charAt(n[1].length-1)===`
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:t,tokens:this.lexer.inline(t)}}}text(e){const n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){const n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:oe(n[1])}}tag(e){const n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&/^<a /i.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):oe(n[0]):n[0]}}link(e){const n=this.rules.inline.link.exec(e);if(n){const t=n[2].trim();if(!this.options.pedantic&&/^</.test(t)){if(!/>$/.test(t))return;const l=yt(t.slice(0,-1),"\\");if((t.length-l.length)%2===0)return}else{const l=vs(n[2],"()");if(l>-1){const o=(n[0].indexOf("!")===0?5:4)+n[1].length+l;n[2]=n[2].substring(0,l),n[0]=n[0].substring(0,o).trim(),n[3]=""}}let r=n[2],i="";if(this.options.pedantic){const l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],i=l[3])}else i=n[3]?n[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(t)?r=r.slice(1):r=r.slice(1,-1)),er(n,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:i&&i.replace(this.rules.inline._escapes,"$1")},n[0],this.lexer)}}reflink(e,n){let t;if((t=this.rules.inline.reflink.exec(e))||(t=this.rules.inline.nolink.exec(e))){let r=(t[2]||t[1]).replace(/\s+/g," ");if(r=n[r.toLowerCase()],!r){const i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return er(t,r,t[0],this.lexer)}}emStrong(e,n,t=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r||r[3]&&t.match(/[\p{L}\p{N}]/u))return;const i=r[1]||r[2]||"";if(!i||i&&(t===""||this.rules.inline.punctuation.exec(t))){const l=r[0].length-1;let s,o,c=l,f=0;const h=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+l);(r=h.exec(n))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=s.length,r[3]||r[4]){c+=o;continue}else if((r[5]||r[6])&&l%3&&!((l+o)%3)){f+=o;continue}if(c-=o,c>0)continue;o=Math.min(o,o+c+f);const b=e.slice(0,l+r.index+(r[0].length-s.length)+o);if(Math.min(l,o)%2){const M=b.slice(1,-1);return{type:"em",raw:b,text:M,tokens:this.lexer.inlineTokens(M)}}const p=b.slice(2,-2);return{type:"strong",raw:b,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(e){const n=this.rules.inline.code.exec(e);if(n){let t=n[2].replace(/\n/g," ");const r=/[^ ]/.test(t),i=/^ /.test(t)&&/ $/.test(t);return r&&i&&(t=t.substring(1,t.length-1)),t=oe(t,!0),{type:"codespan",raw:n[0],text:t}}}br(e){const n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){const n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e,n){const t=this.rules.inline.autolink.exec(e);if(t){let r,i;return t[2]==="@"?(r=oe(this.options.mangle?n(t[1]):t[1]),i="mailto:"+r):(r=oe(t[1]),i=r),{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(e,n){let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=oe(this.options.mangle?n(t[0]):t[0]),i="mailto:"+r;else{let l;do l=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])[0];while(l!==t[0]);r=oe(t[0]),t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e,n){const t=this.rules.inline.text.exec(e);if(t){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):oe(t[0]):t[0]:r=oe(this.options.smartypants?n(t[0]):t[0]),{type:"text",raw:t[0],text:r}}}}const A={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:St,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};A._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;A._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;A.def=B(A.def).replace("label",A._label).replace("title",A._title).getRegex();A.bullet=/(?:[*+-]|\d{1,9}[.)])/;A.listItemStart=B(/^( *)(bull) */).replace("bull",A.bullet).getRegex();A.list=B(A.list).replace(/bull/g,A.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+A.def.source+")").getRegex();A._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";A._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;A.html=B(A.html,"i").replace("comment",A._comment).replace("tag",A._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();A.paragraph=B(A._paragraph).replace("hr",A.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",A._tag).getRegex();A.blockquote=B(A.blockquote).replace("paragraph",A.paragraph).getRegex();A.normal={...A};A.gfm={...A.normal,table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"};A.gfm.table=B(A.gfm.table).replace("hr",A.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",A._tag).getRegex();A.gfm.paragraph=B(A._paragraph).replace("hr",A.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",A.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",A._tag).getRegex();A.pedantic={...A.normal,html:B(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",A._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:St,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:B(A.normal._paragraph).replace("hr",A.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",A.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()};const v={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:St,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^(?:[^_*\\]|\\.)*?\_\_(?:[^_*\\]|\\.)*?\*(?:[^_*\\]|\\.)*?(?=\_\_)|(?:[^*\\]|\\.)+(?=[^*])|[punct_](\*+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|(?:[^punct*_\s\\]|\\.)(\*+)(?=[^punct*_\s])/,rDelimUnd:/^(?:[^_*\\]|\\.)*?\*\*(?:[^_*\\]|\\.)*?\_(?:[^_*\\]|\\.)*?(?=\*\*)|(?:[^_\\]|\\.)+(?=[^_])|[punct*](\_+)(?=[\s]|$)|(?:[^punct*_\s\\]|\\.)(\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:St,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};v._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";v.punctuation=B(v.punctuation).replace(/punctuation/g,v._punctuation).getRegex();v.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;v.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;v._comment=B(A._comment).replace("(?:-->|$)","-->").getRegex();v.emStrong.lDelim=B(v.emStrong.lDelim).replace(/punct/g,v._punctuation).getRegex();v.emStrong.rDelimAst=B(v.emStrong.rDelimAst,"g").replace(/punct/g,v._punctuation).getRegex();v.emStrong.rDelimUnd=B(v.emStrong.rDelimUnd,"g").replace(/punct/g,v._punctuation).getRegex();v._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;v._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;v._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])?)+(?![-_])/;v.autolink=B(v.autolink).replace("scheme",v._scheme).replace("email",v._email).getRegex();v._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;v.tag=B(v.tag).replace("comment",v._comment).replace("attribute",v._attribute).getRegex();v._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;v._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;v._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;v.link=B(v.link).replace("label",v._label).replace("href",v._href).replace("title",v._title).getRegex();v.reflink=B(v.reflink).replace("label",v._label).replace("ref",A._label).getRegex();v.nolink=B(v.nolink).replace("ref",A._label).getRegex();v.reflinkSearch=B(v.reflinkSearch,"g").replace("reflink",v.reflink).replace("nolink",v.nolink).getRegex();v.normal={...v};v.pedantic={...v.normal,strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:B(/^!?\[(label)\]\((.*?)\)/).replace("label",v._label).getRegex(),reflink:B(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",v._label).getRegex()};v.gfm={...v.normal,escape:B(v.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/};v.gfm.url=B(v.gfm.url,"i").replace("email",v.gfm._extended_email).getRegex();v.breaks={...v.gfm,br:B(v.br).replace("{2,}","*").getRegex(),text:B(v.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()};function xs(a){return a.replace(/---/g,"—").replace(/--/g,"").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1").replace(/'/g,"").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function tr(a){let e="",n,t;const r=a.length;for(n=0;n<r;n++)t=a.charCodeAt(n),Math.random()>.5&&(t="x"+t.toString(16)),e+="&#"+t+";";return e}class $e{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||qe,this.options.tokenizer=this.options.tokenizer||new un,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={block:A.normal,inline:v.normal};this.options.pedantic?(n.block=A.pedantic,n.inline=v.pedantic):this.options.gfm&&(n.block=A.gfm,this.options.breaks?n.inline=v.breaks:n.inline=v.gfm),this.tokenizer.rules=n}static get rules(){return{block:A,inline:v}}static lex(e,n){return new $e(n).lex(e)}static lexInline(e,n){return new $e(n).inlineTokens(e)}lex(e){e=e.replace(/\r\n|\r/g,`
`),this.blockTokens(e,this.tokens);let n;for(;n=this.inlineQueue.shift();)this.inlineTokens(n.src,n.tokens);return this.tokens}blockTokens(e,n=[]){this.options.pedantic?e=e.replace(/\t/g," ").replace(/^ +$/gm,""):e=e.replace(/^( *)(\t+)/gm,(s,o,c)=>o+" ".repeat(c.length));let t,r,i,l;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(s=>(t=s.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))){if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length),t.raw.length===1&&n.length>0?n[n.length-1].raw+=`
`:n.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
`+t.raw,r.text+=`
`+t.text,this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
`+t.raw,r.text+=`
`+t.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title});continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),n.push(t);continue}if(i=e,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const o=e.slice(1);let c;this.options.extensions.startBlock.forEach(function(f){c=f.call({lexer:this},o),typeof c=="number"&&c>=0&&(s=Math.min(s,c))}),s<1/0&&s>=0&&(i=e.substring(0,s+1))}if(this.state.top&&(t=this.tokenizer.paragraph(i))){r=n[n.length-1],l&&r.type==="paragraph"?(r.raw+=`
`+t.raw,r.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(t),l=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&r.type==="text"?(r.raw+=`
`+t.raw,r.text+=`
`+t.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):n.push(t);continue}if(e){const s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){let t,r,i,l=e,s,o,c;if(this.tokens.links){const f=Object.keys(this.tokens.links);if(f.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(l))!=null;)f.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(l=l.slice(0,s.index)+"["+Jn("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(l))!=null;)l=l.slice(0,s.index)+"["+Jn("a",s[0].length-2)+"]"+l.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.escapedEmSt.exec(l))!=null;)l=l.slice(0,s.index+s[0].length-2)+"++"+l.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;e;)if(o||(c=""),o=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(f=>(t=f.call({lexer:this},e,n))?(e=e.substring(t.raw.length),n.push(t),!0):!1))){if(t=this.tokenizer.escape(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.tag(e)){e=e.substring(t.raw.length),r=n[n.length-1],r&&t.type==="text"&&r.type==="text"?(r.raw+=t.raw,r.text+=t.text):n.push(t);continue}if(t=this.tokenizer.link(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(t.raw.length),r=n[n.length-1],r&&t.type==="text"&&r.type==="text"?(r.raw+=t.raw,r.text+=t.text):n.push(t);continue}if(t=this.tokenizer.emStrong(e,l,c)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.codespan(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.br(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.del(e)){e=e.substring(t.raw.length),n.push(t);continue}if(t=this.tokenizer.autolink(e,tr)){e=e.substring(t.raw.length),n.push(t);continue}if(!this.state.inLink&&(t=this.tokenizer.url(e,tr))){e=e.substring(t.raw.length),n.push(t);continue}if(i=e,this.options.extensions&&this.options.extensions.startInline){let f=1/0;const h=e.slice(1);let b;this.options.extensions.startInline.forEach(function(p){b=p.call({lexer:this},h),typeof b=="number"&&b>=0&&(f=Math.min(f,b))}),f<1/0&&f>=0&&(i=e.substring(0,f+1))}if(t=this.tokenizer.inlineText(i,xs)){e=e.substring(t.raw.length),t.raw.slice(-1)!=="_"&&(c=t.raw.slice(-1)),o=!0,r=n[n.length-1],r&&r.type==="text"?(r.raw+=t.raw,r.text+=t.text):n.push(t);continue}if(e){const f="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return n}}class cn{constructor(e){this.options=e||qe}code(e,n,t){const r=(n||"").match(/\S*/)[0];if(this.options.highlight){const i=this.options.highlight(e,r);i!=null&&i!==e&&(t=!0,e=i)}return e=e.replace(/\n$/,"")+`
`,r?'<pre><code class="'+this.options.langPrefix+oe(r)+'">'+(t?e:oe(e,!0))+`</code></pre>
`:"<pre><code>"+(t?e:oe(e,!0))+`</code></pre>
`}blockquote(e){return`<blockquote>
${e}</blockquote>
`}html(e){return e}heading(e,n,t,r){if(this.options.headerIds){const i=this.options.headerPrefix+r.slug(t);return`<h${n} id="${i}">${e}</h${n}>
`}return`<h${n}>${e}</h${n}>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(e,n,t){const r=n?"ol":"ul",i=n&&t!==1?' start="'+t+'"':"";return"<"+r+i+`>
`+e+"</"+r+`>
`}listitem(e){return`<li>${e}</li>
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>
`}table(e,n){return n&&(n=`<tbody>${n}</tbody>`),`<table>
<thead>
`+e+`</thead>
`+n+`</table>
`}tablerow(e){return`<tr>
${e}</tr>
`}tablecell(e,n){const t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,n,t){if(e=Yn(this.options.sanitize,this.options.baseUrl,e),e===null)return t;let r='<a href="'+e+'"';return n&&(r+=' title="'+n+'"'),r+=">"+t+"</a>",r}image(e,n,t){if(e=Yn(this.options.sanitize,this.options.baseUrl,e),e===null)return t;let r=`<img src="${e}" alt="${t}"`;return n&&(r+=` title="${n}"`),r+=this.options.xhtml?"/>":">",r}text(e){return e}}class wr{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,n,t){return""+t}image(e,n,t){return""+t}br(){return""}}class xr{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,n){let t=e,r=0;if(this.seen.hasOwnProperty(t)){r=this.seen[e];do r++,t=e+"-"+r;while(this.seen.hasOwnProperty(t))}return n||(this.seen[e]=r,this.seen[t]=0),t}slug(e,n={}){const t=this.serialize(e);return this.getNextSafeSlug(t,n.dryrun)}}class He{constructor(e){this.options=e||qe,this.options.renderer=this.options.renderer||new cn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new wr,this.slugger=new xr}static parse(e,n){return new He(n).parse(e)}static parseInline(e,n){return new He(n).parseInline(e)}parse(e,n=!0){let t="",r,i,l,s,o,c,f,h,b,p,M,G,j,x,O,X,R,K,w;const U=e.length;for(r=0;r<U;r++){if(p=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(w=this.options.extensions.renderers[p.type].call({parser:this},p),w!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type))){t+=w||"";continue}switch(p.type){case"space":continue;case"hr":{t+=this.renderer.hr();continue}case"heading":{t+=this.renderer.heading(this.parseInline(p.tokens),p.depth,yr(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue}case"code":{t+=this.renderer.code(p.text,p.lang,p.escaped);continue}case"table":{for(h="",f="",s=p.header.length,i=0;i<s;i++)f+=this.renderer.tablecell(this.parseInline(p.header[i].tokens),{header:!0,align:p.align[i]});for(h+=this.renderer.tablerow(f),b="",s=p.rows.length,i=0;i<s;i++){for(c=p.rows[i],f="",o=c.length,l=0;l<o;l++)f+=this.renderer.tablecell(this.parseInline(c[l].tokens),{header:!1,align:p.align[l]});b+=this.renderer.tablerow(f)}t+=this.renderer.table(h,b);continue}case"blockquote":{b=this.parse(p.tokens),t+=this.renderer.blockquote(b);continue}case"list":{for(M=p.ordered,G=p.start,j=p.loose,s=p.items.length,b="",i=0;i<s;i++)O=p.items[i],X=O.checked,R=O.task,x="",O.task&&(K=this.renderer.checkbox(X),j?O.tokens.length>0&&O.tokens[0].type==="paragraph"?(O.tokens[0].text=K+" "+O.tokens[0].text,O.tokens[0].tokens&&O.tokens[0].tokens.length>0&&O.tokens[0].tokens[0].type==="text"&&(O.tokens[0].tokens[0].text=K+" "+O.tokens[0].tokens[0].text)):O.tokens.unshift({type:"text",text:K}):x+=K),x+=this.parse(O.tokens,j),b+=this.renderer.listitem(x,R,X);t+=this.renderer.list(b,M,G);continue}case"html":{t+=this.renderer.html(p.text);continue}case"paragraph":{t+=this.renderer.paragraph(this.parseInline(p.tokens));continue}case"text":{for(b=p.tokens?this.parseInline(p.tokens):p.text;r+1<U&&e[r+1].type==="text";)p=e[++r],b+=`
`+(p.tokens?this.parseInline(p.tokens):p.text);t+=n?this.renderer.paragraph(b):b;continue}default:{const Re='Token with "'+p.type+'" type was not found.';if(this.options.silent){console.error(Re);return}else throw new Error(Re)}}}return t}parseInline(e,n){n=n||this.renderer;let t="",r,i,l;const s=e.length;for(r=0;r<s;r++){if(i=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]&&(l=this.options.extensions.renderers[i.type].call({parser:this},i),l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type))){t+=l||"";continue}switch(i.type){case"escape":{t+=n.text(i.text);break}case"html":{t+=n.html(i.text);break}case"link":{t+=n.link(i.href,i.title,this.parseInline(i.tokens,n));break}case"image":{t+=n.image(i.href,i.title,i.text);break}case"strong":{t+=n.strong(this.parseInline(i.tokens,n));break}case"em":{t+=n.em(this.parseInline(i.tokens,n));break}case"codespan":{t+=n.codespan(i.text);break}case"br":{t+=n.br();break}case"del":{t+=n.del(this.parseInline(i.tokens,n));break}case"text":{t+=n.text(i.text);break}default:{const o='Token with "'+i.type+'" type was not found.';if(this.options.silent){console.error(o);return}else throw new Error(o)}}}return t}}class Rt{constructor(e){this.options=e||qe}preprocess(e){return e}postprocess(e){return e}}$n(Rt,"passThroughHooks",new Set(["preprocess","postprocess"]));function Es(a,e,n){return t=>{if(t.message+=`
Please report this to https://github.com/markedjs/marked.`,a){const r="<p>An error occurred:</p><pre>"+oe(t.message+"",!0)+"</pre>";if(e)return Promise.resolve(r);if(n){n(null,r);return}return r}if(e)return Promise.reject(t);if(n){n(t);return}throw t}}function Er(a,e){return(n,t,r)=>{typeof t=="function"&&(r=t,t=null);const i={...t};t={...T.defaults,...i};const l=Es(t.silent,t.async,r);if(typeof n>"u"||n===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(ys(t),t.hooks&&(t.hooks.options=t),r){const s=t.highlight;let o;try{t.hooks&&(n=t.hooks.preprocess(n)),o=a(n,t)}catch(h){return l(h)}const c=function(h){let b;if(!h)try{t.walkTokens&&T.walkTokens(o,t.walkTokens),b=e(o,t),t.hooks&&(b=t.hooks.postprocess(b))}catch(p){h=p}return t.highlight=s,h?l(h):r(null,b)};if(!s||s.length<3||(delete t.highlight,!o.length))return c();let f=0;T.walkTokens(o,function(h){h.type==="code"&&(f++,setTimeout(()=>{s(h.text,h.lang,function(b,p){if(b)return c(b);p!=null&&p!==h.text&&(h.text=p,h.escaped=!0),f--,f===0&&c()})},0))}),f===0&&c();return}if(t.async)return Promise.resolve(t.hooks?t.hooks.preprocess(n):n).then(s=>a(s,t)).then(s=>t.walkTokens?Promise.all(T.walkTokens(s,t.walkTokens)).then(()=>s):s).then(s=>e(s,t)).then(s=>t.hooks?t.hooks.postprocess(s):s).catch(l);try{t.hooks&&(n=t.hooks.preprocess(n));const s=a(n,t);t.walkTokens&&T.walkTokens(s,t.walkTokens);let o=e(s,t);return t.hooks&&(o=t.hooks.postprocess(o)),o}catch(s){return l(s)}}}function T(a,e,n){return Er($e.lex,He.parse)(a,e,n)}T.options=T.setOptions=function(a){return T.defaults={...T.defaults,...a},os(T.defaults),T};T.getDefaults=br;T.defaults=qe;T.use=function(...a){const e=T.defaults.extensions||{renderers:{},childTokens:{}};a.forEach(n=>{const t={...n};if(t.async=T.defaults.async||t.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if(r.renderer){const i=e.renderers[r.name];i?e.renderers[r.name]=function(...l){let s=r.renderer.apply(this,l);return s===!1&&(s=i.apply(this,l)),s}:e.renderers[r.name]=r.renderer}if(r.tokenizer){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");e[r.level]?e[r.level].unshift(r.tokenizer):e[r.level]=[r.tokenizer],r.start&&(r.level==="block"?e.startBlock?e.startBlock.push(r.start):e.startBlock=[r.start]:r.level==="inline"&&(e.startInline?e.startInline.push(r.start):e.startInline=[r.start]))}r.childTokens&&(e.childTokens[r.name]=r.childTokens)}),t.extensions=e),n.renderer){const r=T.defaults.renderer||new cn;for(const i in n.renderer){const l=r[i];r[i]=(...s)=>{let o=n.renderer[i].apply(r,s);return o===!1&&(o=l.apply(r,s)),o}}t.renderer=r}if(n.tokenizer){const r=T.defaults.tokenizer||new un;for(const i in n.tokenizer){const l=r[i];r[i]=(...s)=>{let o=n.tokenizer[i].apply(r,s);return o===!1&&(o=l.apply(r,s)),o}}t.tokenizer=r}if(n.hooks){const r=T.defaults.hooks||new Rt;for(const i in n.hooks){const l=r[i];Rt.passThroughHooks.has(i)?r[i]=s=>{if(T.defaults.async)return Promise.resolve(n.hooks[i].call(r,s)).then(c=>l.call(r,c));const o=n.hooks[i].call(r,s);return l.call(r,o)}:r[i]=(...s)=>{let o=n.hooks[i].apply(r,s);return o===!1&&(o=l.apply(r,s)),o}}t.hooks=r}if(n.walkTokens){const r=T.defaults.walkTokens;t.walkTokens=function(i){let l=[];return l.push(n.walkTokens.call(this,i)),r&&(l=l.concat(r.call(this,i))),l}}T.setOptions(t)})};T.walkTokens=function(a,e){let n=[];for(const t of a)switch(n=n.concat(e.call(T,t)),t.type){case"table":{for(const r of t.header)n=n.concat(T.walkTokens(r.tokens,e));for(const r of t.rows)for(const i of r)n=n.concat(T.walkTokens(i.tokens,e));break}case"list":{n=n.concat(T.walkTokens(t.items,e));break}default:T.defaults.extensions&&T.defaults.extensions.childTokens&&T.defaults.extensions.childTokens[t.type]?T.defaults.extensions.childTokens[t.type].forEach(function(r){n=n.concat(T.walkTokens(t[r],e))}):t.tokens&&(n=n.concat(T.walkTokens(t.tokens,e)))}return n};T.parseInline=Er($e.lexInline,He.parseInline);T.Parser=He;T.parser=He.parse;T.Renderer=cn;T.TextRenderer=wr;T.Lexer=$e;T.lexer=$e.lex;T.Tokenizer=un;T.Slugger=xr;T.Hooks=Rt;T.parse=T;T.options;T.setOptions;T.use;T.walkTokens;T.parseInline;He.parse;$e.lex;var It={},Ts={get exports(){return It},set exports(a){It=a}};/*! @license DOMPurify 3.0.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.1/LICENSE */var nr;function rr(){return nr||(nr=1,function(a,e){(function(n,t){a.exports=t()})(Ii,function(){function n(m){return n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},n(m)}function t(m,_){return t=Object.setPrototypeOf||function(I,z){return I.__proto__=z,I},t(m,_)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function i(m,_,y){return r()?i=Reflect.construct:i=function(z,J,se){var ee=[null];ee.push.apply(ee,J);var pe=Function.bind.apply(z,ee),at=new pe;return se&&t(at,se.prototype),at},i.apply(null,arguments)}function l(m,_){return c(m)||h(m,_)||b(m,_)||G()}function s(m){return o(m)||f(m)||b(m)||M()}function o(m){if(Array.isArray(m))return p(m)}function c(m){if(Array.isArray(m))return m}function f(m){if(typeof Symbol<"u"&&m[Symbol.iterator]!=null||m["@@iterator"]!=null)return Array.from(m)}function h(m,_){var y=m==null?null:typeof Symbol<"u"&&m[Symbol.iterator]||m["@@iterator"];if(y!=null){var I=[],z=!0,J=!1,se,ee;try{for(y=y.call(m);!(z=(se=y.next()).done)&&(I.push(se.value),!(_&&I.length===_));z=!0);}catch(pe){J=!0,ee=pe}finally{try{!z&&y.return!=null&&y.return()}finally{if(J)throw ee}}return I}}function b(m,_){if(m){if(typeof m=="string")return p(m,_);var y=Object.prototype.toString.call(m).slice(8,-1);if(y==="Object"&&m.constructor&&(y=m.constructor.name),y==="Map"||y==="Set")return Array.from(m);if(y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(y))return p(m,_)}}function p(m,_){(_==null||_>m.length)&&(_=m.length);for(var y=0,I=new Array(_);y<_;y++)I[y]=m[y];return I}function M(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function j(m,_){var y=typeof Symbol<"u"&&m[Symbol.iterator]||m["@@iterator"];if(!y){if(Array.isArray(m)||(y=b(m))||_&&m&&typeof m.length=="number"){y&&(m=y);var I=0,z=function(){};return{s:z,n:function(){return I>=m.length?{done:!0}:{done:!1,value:m[I++]}},e:function(pe){throw pe},f:z}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var J=!0,se=!1,ee;return{s:function(){y=y.call(m)},n:function(){var pe=y.next();return J=pe.done,pe},e:function(pe){se=!0,ee=pe},f:function(){try{!J&&y.return!=null&&y.return()}finally{if(se)throw ee}}}}var x=Object.entries,O=Object.setPrototypeOf,X=Object.isFrozen,R=Object.getPrototypeOf,K=Object.getOwnPropertyDescriptor,w=Object.freeze,U=Object.seal,Re=Object.create,N=typeof Reflect<"u"&&Reflect,F=N.apply,ie=N.construct;F||(F=function(_,y,I){return _.apply(y,I)}),w||(w=function(_){return _}),U||(U=function(_){return _}),ie||(ie=function(_,y){return i(_,s(y))});var Z=ve(Array.prototype.forEach),ze=ve(Array.prototype.pop),Ie=ve(Array.prototype.push),Le=ve(String.prototype.toLowerCase),Ze=ve(String.prototype.toString),st=ve(String.prototype.match),Ae=ve(String.prototype.replace),Ar=ve(String.prototype.indexOf),Sr=ve(String.prototype.trim),me=ve(RegExp.prototype.test),Lt=Rr(TypeError);function ve(m){return function(_){for(var y=arguments.length,I=new Array(y>1?y-1:0),z=1;z<y;z++)I[z-1]=arguments[z];return F(m,_,I)}}function Rr(m){return function(){for(var _=arguments.length,y=new Array(_),I=0;I<_;I++)y[I]=arguments[I];return ie(m,y)}}function C(m,_,y){y=y||Le,O&&O(m,null);for(var I=_.length;I--;){var z=_[I];if(typeof z=="string"){var J=y(z);J!==z&&(X(_)||(_[I]=J),z=J)}m[z]=!0}return m}function Ve(m){var _=Re(null),y=j(x(m)),I;try{for(y.s();!(I=y.n()).done;){var z=l(I.value,2),J=z[0],se=z[1];_[J]=se}}catch(ee){y.e(ee)}finally{y.f()}return _}function ut(m,_){for(;m!==null;){var y=K(m,_);if(y){if(y.get)return ve(y.get);if(typeof y.value=="function")return ve(y.value)}m=R(m)}function I(z){return console.warn("fallback value for",z),null}return I}var fn=w(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ot=w(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Ct=w(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ir=w(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Dt=w(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),Nr=w(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hn=w(["#text"]),pn=w(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),Mt=w(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),dn=w(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),ct=w(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lr=U(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Or=U(/<%[\w\W]*|[\w\W]*%>/gm),Cr=U(/\${[\w\W]*}/gm),Dr=U(/^data-[\-\w.\u00B7-\uFFFF]/),Mr=U(/^aria-[\-\w]+$/),zr=U(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pr=U(/^(?:\w+script|data):/i),Ur=U(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),$r=U(/^html$/i),Hr=function(){return typeof window>"u"?null:window},Fr=function(_,y){if(n(_)!=="object"||typeof _.createPolicy!="function")return null;var I=null,z="data-tt-policy-suffix";y.currentScript&&y.currentScript.hasAttribute(z)&&(I=y.currentScript.getAttribute(z));var J="dompurify"+(I?"#"+I:"");try{return _.createPolicy(J,{createHTML:function(ee){return ee},createScriptURL:function(ee){return ee}})}catch{return console.warn("TrustedTypes policy "+J+" could not be created."),null}};function mn(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Hr(),_=function(u){return mn(u)};if(_.version="3.0.1",_.removed=[],!m||!m.document||m.document.nodeType!==9)return _.isSupported=!1,_;var y=m.document,I=m.document,z=m.DocumentFragment,J=m.HTMLTemplateElement,se=m.Node,ee=m.Element,pe=m.NodeFilter,at=m.NamedNodeMap,Gr=at===void 0?m.NamedNodeMap||m.MozNamedAttrMap:at,jr=m.HTMLFormElement,Wr=m.DOMParser,ft=m.trustedTypes,ht=ee.prototype,qr=ut(ht,"cloneNode"),Zr=ut(ht,"nextSibling"),Vr=ut(ht,"childNodes"),zt=ut(ht,"parentNode");if(typeof J=="function"){var Pt=I.createElement("template");Pt.content&&Pt.content.ownerDocument&&(I=Pt.content.ownerDocument)}var Se=Fr(ft,y),gn=Se?Se.createHTML(""):"",pt=I,Ut=pt.implementation,Xr=pt.createNodeIterator,Qr=pt.createDocumentFragment,Yr=pt.getElementsByTagName,Kr=y.importNode,Ne={};_.isSupported=typeof x=="function"&&typeof zt=="function"&&Ut&&typeof Ut.createHTMLDocument<"u";var $t=Lr,Ht=Or,Ft=Cr,Jr=Dr,ei=Mr,ti=Pr,_n=Ur,Bt=zr,te=null,bn=C({},[].concat(s(fn),s(Ot),s(Ct),s(Dt),s(hn))),ne=null,kn=C({},[].concat(s(pn),s(Mt),s(dn),s(ct))),Q=Object.seal(Object.create(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}})),lt=null,Gt=null,vn=!0,jt=!0,yn=!1,wn=!0,Xe=!1,Fe=!1,Wt=!1,qt=!1,Qe=!1,dt=!1,mt=!1,xn=!0,En=!1,ni="user-content-",Zt=!0,ot=!1,Ye={},Ke=null,Tn=C({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),An=null,Sn=C({},["audio","video","img","source","image","track"]),Vt=null,Rn=C({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),gt="http://www.w3.org/1998/Math/MathML",_t="http://www.w3.org/2000/svg",Oe="http://www.w3.org/1999/xhtml",Je=Oe,Xt=!1,Qt=null,ri=C({},[gt,_t,Oe],Ze),Be,ii=["application/xhtml+xml","text/html"],si="text/html",re,et=null,ai=I.createElement("form"),In=function(u){return u instanceof RegExp||u instanceof Function},Yt=function(u){et&&et===u||((!u||n(u)!=="object")&&(u={}),u=Ve(u),Be=ii.indexOf(u.PARSER_MEDIA_TYPE)===-1?Be=si:Be=u.PARSER_MEDIA_TYPE,re=Be==="application/xhtml+xml"?Ze:Le,te="ALLOWED_TAGS"in u?C({},u.ALLOWED_TAGS,re):bn,ne="ALLOWED_ATTR"in u?C({},u.ALLOWED_ATTR,re):kn,Qt="ALLOWED_NAMESPACES"in u?C({},u.ALLOWED_NAMESPACES,Ze):ri,Vt="ADD_URI_SAFE_ATTR"in u?C(Ve(Rn),u.ADD_URI_SAFE_ATTR,re):Rn,An="ADD_DATA_URI_TAGS"in u?C(Ve(Sn),u.ADD_DATA_URI_TAGS,re):Sn,Ke="FORBID_CONTENTS"in u?C({},u.FORBID_CONTENTS,re):Tn,lt="FORBID_TAGS"in u?C({},u.FORBID_TAGS,re):{},Gt="FORBID_ATTR"in u?C({},u.FORBID_ATTR,re):{},Ye="USE_PROFILES"in u?u.USE_PROFILES:!1,vn=u.ALLOW_ARIA_ATTR!==!1,jt=u.ALLOW_DATA_ATTR!==!1,yn=u.ALLOW_UNKNOWN_PROTOCOLS||!1,wn=u.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Xe=u.SAFE_FOR_TEMPLATES||!1,Fe=u.WHOLE_DOCUMENT||!1,Qe=u.RETURN_DOM||!1,dt=u.RETURN_DOM_FRAGMENT||!1,mt=u.RETURN_TRUSTED_TYPE||!1,qt=u.FORCE_BODY||!1,xn=u.SANITIZE_DOM!==!1,En=u.SANITIZE_NAMED_PROPS||!1,Zt=u.KEEP_CONTENT!==!1,ot=u.IN_PLACE||!1,Bt=u.ALLOWED_URI_REGEXP||Bt,Je=u.NAMESPACE||Oe,Q=u.CUSTOM_ELEMENT_HANDLING||{},u.CUSTOM_ELEMENT_HANDLING&&In(u.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Q.tagNameCheck=u.CUSTOM_ELEMENT_HANDLING.tagNameCheck),u.CUSTOM_ELEMENT_HANDLING&&In(u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Q.attributeNameCheck=u.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),u.CUSTOM_ELEMENT_HANDLING&&typeof u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Q.allowCustomizedBuiltInElements=u.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Xe&&(jt=!1),dt&&(Qe=!0),Ye&&(te=C({},s(hn)),ne=[],Ye.html===!0&&(C(te,fn),C(ne,pn)),Ye.svg===!0&&(C(te,Ot),C(ne,Mt),C(ne,ct)),Ye.svgFilters===!0&&(C(te,Ct),C(ne,Mt),C(ne,ct)),Ye.mathMl===!0&&(C(te,Dt),C(ne,dn),C(ne,ct))),u.ADD_TAGS&&(te===bn&&(te=Ve(te)),C(te,u.ADD_TAGS,re)),u.ADD_ATTR&&(ne===kn&&(ne=Ve(ne)),C(ne,u.ADD_ATTR,re)),u.ADD_URI_SAFE_ATTR&&C(Vt,u.ADD_URI_SAFE_ATTR,re),u.FORBID_CONTENTS&&(Ke===Tn&&(Ke=Ve(Ke)),C(Ke,u.FORBID_CONTENTS,re)),Zt&&(te["#text"]=!0),Fe&&C(te,["html","head","body"]),te.table&&(C(te,["tbody"]),delete lt.tbody),w&&w(u),et=u)},Nn=C({},["mi","mo","mn","ms","mtext"]),Ln=C({},["foreignobject","desc","title","annotation-xml"]),li=C({},["title","style","font","a","script"]),bt=C({},Ot);C(bt,Ct),C(bt,Ir);var Kt=C({},Dt);C(Kt,Nr);var oi=function(u){var d=zt(u);(!d||!d.tagName)&&(d={namespaceURI:Je,tagName:"template"});var k=Le(u.tagName),H=Le(d.tagName);return Qt[u.namespaceURI]?u.namespaceURI===_t?d.namespaceURI===Oe?k==="svg":d.namespaceURI===gt?k==="svg"&&(H==="annotation-xml"||Nn[H]):!!bt[k]:u.namespaceURI===gt?d.namespaceURI===Oe?k==="math":d.namespaceURI===_t?k==="math"&&Ln[H]:!!Kt[k]:u.namespaceURI===Oe?d.namespaceURI===_t&&!Ln[H]||d.namespaceURI===gt&&!Nn[H]?!1:!Kt[k]&&(li[k]||!bt[k]):!!(Be==="application/xhtml+xml"&&Qt[u.namespaceURI]):!1},Ge=function(u){Ie(_.removed,{element:u});try{u.parentNode.removeChild(u)}catch{u.remove()}},Jt=function(u,d){try{Ie(_.removed,{attribute:d.getAttributeNode(u),from:d})}catch{Ie(_.removed,{attribute:null,from:d})}if(d.removeAttribute(u),u==="is"&&!ne[u])if(Qe||dt)try{Ge(d)}catch{}else try{d.setAttribute(u,"")}catch{}},On=function(u){var d,k;if(qt)u="<remove></remove>"+u;else{var H=st(u,/^[\r\n\t ]+/);k=H&&H[0]}Be==="application/xhtml+xml"&&Je===Oe&&(u='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+u+"</body></html>");var ae=Se?Se.createHTML(u):u;if(Je===Oe)try{d=new Wr().parseFromString(ae,Be)}catch{}if(!d||!d.documentElement){d=Ut.createDocument(Je,"template",null);try{d.documentElement.innerHTML=Xt?gn:ae}catch{}}var ye=d.body||d.documentElement;return u&&k&&ye.insertBefore(I.createTextNode(k),ye.childNodes[0]||null),Je===Oe?Yr.call(d,Fe?"html":"body")[0]:Fe?d.documentElement:ye},Cn=function(u){return Xr.call(u.ownerDocument||u,u,pe.SHOW_ELEMENT|pe.SHOW_COMMENT|pe.SHOW_TEXT,null,!1)},ui=function(u){return u instanceof jr&&(typeof u.nodeName!="string"||typeof u.textContent!="string"||typeof u.removeChild!="function"||!(u.attributes instanceof Gr)||typeof u.removeAttribute!="function"||typeof u.setAttribute!="function"||typeof u.namespaceURI!="string"||typeof u.insertBefore!="function"||typeof u.hasChildNodes!="function")},kt=function(u){return n(se)==="object"?u instanceof se:u&&n(u)==="object"&&typeof u.nodeType=="number"&&typeof u.nodeName=="string"},Ce=function(u,d,k){Ne[u]&&Z(Ne[u],function(H){H.call(_,d,k,et)})},Dn=function(u){var d;if(Ce("beforeSanitizeElements",u,null),ui(u))return Ge(u),!0;var k=re(u.nodeName);if(Ce("uponSanitizeElement",u,{tagName:k,allowedTags:te}),u.hasChildNodes()&&!kt(u.firstElementChild)&&(!kt(u.content)||!kt(u.content.firstElementChild))&&me(/<[/\w]/g,u.innerHTML)&&me(/<[/\w]/g,u.textContent))return Ge(u),!0;if(!te[k]||lt[k]){if(!lt[k]&&zn(k)&&(Q.tagNameCheck instanceof RegExp&&me(Q.tagNameCheck,k)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(k)))return!1;if(Zt&&!Ke[k]){var H=zt(u)||u.parentNode,ae=Vr(u)||u.childNodes;if(ae&&H)for(var ye=ae.length,le=ye-1;le>=0;--le)H.insertBefore(qr(ae[le],!0),Zr(u))}return Ge(u),!0}return u instanceof ee&&!oi(u)||(k==="noscript"||k==="noembed")&&me(/<\/no(script|embed)/i,u.innerHTML)?(Ge(u),!0):(Xe&&u.nodeType===3&&(d=u.textContent,d=Ae(d,$t," "),d=Ae(d,Ht," "),d=Ae(d,Ft," "),u.textContent!==d&&(Ie(_.removed,{element:u.cloneNode()}),u.textContent=d)),Ce("afterSanitizeElements",u,null),!1)},Mn=function(u,d,k){if(xn&&(d==="id"||d==="name")&&(k in I||k in ai))return!1;if(!(jt&&!Gt[d]&&me(Jr,d))){if(!(vn&&me(ei,d))){if(!ne[d]||Gt[d]){if(!(zn(u)&&(Q.tagNameCheck instanceof RegExp&&me(Q.tagNameCheck,u)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(u))&&(Q.attributeNameCheck instanceof RegExp&&me(Q.attributeNameCheck,d)||Q.attributeNameCheck instanceof Function&&Q.attributeNameCheck(d))||d==="is"&&Q.allowCustomizedBuiltInElements&&(Q.tagNameCheck instanceof RegExp&&me(Q.tagNameCheck,k)||Q.tagNameCheck instanceof Function&&Q.tagNameCheck(k))))return!1}else if(!Vt[d]){if(!me(Bt,Ae(k,_n,""))){if(!((d==="src"||d==="xlink:href"||d==="href")&&u!=="script"&&Ar(k,"data:")===0&&An[u])){if(!(yn&&!me(ti,Ae(k,_n,"")))){if(k)return!1}}}}}}return!0},zn=function(u){return u.indexOf("-")>0},Pn=function(u){var d,k,H,ae;Ce("beforeSanitizeAttributes",u,null);var ye=u.attributes;if(ye){var le={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ne};for(ae=ye.length;ae--;){d=ye[ae];var ge=d,je=ge.name,en=ge.namespaceURI;if(k=je==="value"?d.value:Sr(d.value),H=re(je),le.attrName=H,le.attrValue=k,le.keepAttr=!0,le.forceKeepAttr=void 0,Ce("uponSanitizeAttribute",u,le),k=le.attrValue,!le.forceKeepAttr&&(Jt(je,u),!!le.keepAttr)){if(!wn&&me(/\/>/i,k)){Jt(je,u);continue}Xe&&(k=Ae(k,$t," "),k=Ae(k,Ht," "),k=Ae(k,Ft," "));var Un=re(u.nodeName);if(Mn(Un,H,k)){if(En&&(H==="id"||H==="name")&&(Jt(je,u),k=ni+k),Se&&n(ft)==="object"&&typeof ft.getAttributeType=="function"&&!en)switch(ft.getAttributeType(Un,H)){case"TrustedHTML":k=Se.createHTML(k);break;case"TrustedScriptURL":k=Se.createScriptURL(k);break}try{en?u.setAttributeNS(en,je,k):u.setAttribute(je,k),ze(_.removed)}catch{}}}}Ce("afterSanitizeAttributes",u,null)}},ci=function S(u){var d,k=Cn(u);for(Ce("beforeSanitizeShadowDOM",u,null);d=k.nextNode();)Ce("uponSanitizeShadowNode",d,null),!Dn(d)&&(d.content instanceof z&&S(d.content),Pn(d));Ce("afterSanitizeShadowDOM",u,null)};return _.sanitize=function(S){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d,k,H,ae;if(Xt=!S,Xt&&(S="<!-->"),typeof S!="string"&&!kt(S)){if(typeof S.toString!="function")throw Lt("toString is not a function");if(S=S.toString(),typeof S!="string")throw Lt("dirty is not a string, aborting")}if(!_.isSupported)return S;if(Wt||Yt(u),_.removed=[],typeof S=="string"&&(ot=!1),ot){if(S.nodeName){var ye=re(S.nodeName);if(!te[ye]||lt[ye])throw Lt("root node is forbidden and cannot be sanitized in-place")}}else if(S instanceof se)d=On("<!---->"),k=d.ownerDocument.importNode(S,!0),k.nodeType===1&&k.nodeName==="BODY"||k.nodeName==="HTML"?d=k:d.appendChild(k);else{if(!Qe&&!Xe&&!Fe&&S.indexOf("<")===-1)return Se&&mt?Se.createHTML(S):S;if(d=On(S),!d)return Qe?null:mt?gn:""}d&&qt&&Ge(d.firstChild);for(var le=Cn(ot?S:d);H=le.nextNode();)Dn(H)||(H.content instanceof z&&ci(H.content),Pn(H));if(ot)return S;if(Qe){if(dt)for(ae=Qr.call(d.ownerDocument);d.firstChild;)ae.appendChild(d.firstChild);else ae=d;return(ne.shadowroot||ne.shadowrootmod)&&(ae=Kr.call(y,ae,!0)),ae}var ge=Fe?d.outerHTML:d.innerHTML;return Fe&&te["!doctype"]&&d.ownerDocument&&d.ownerDocument.doctype&&d.ownerDocument.doctype.name&&me($r,d.ownerDocument.doctype.name)&&(ge="<!DOCTYPE "+d.ownerDocument.doctype.name+`>
`+ge),Xe&&(ge=Ae(ge,$t," "),ge=Ae(ge,Ht," "),ge=Ae(ge,Ft," ")),Se&&mt?Se.createHTML(ge):ge},_.setConfig=function(S){Yt(S),Wt=!0},_.clearConfig=function(){et=null,Wt=!1},_.isValidAttribute=function(S,u,d){et||Yt({});var k=re(S),H=re(u);return Mn(k,H,d)},_.addHook=function(S,u){typeof u=="function"&&(Ne[S]=Ne[S]||[],Ie(Ne[S],u))},_.removeHook=function(S){if(Ne[S])return ze(Ne[S])},_.removeHooks=function(S){Ne[S]&&(Ne[S]=[])},_.removeAllHooks=function(){Ne={}},_}var Br=mn();return Br})}(Ts)),It}var ir=window.DOMPurify||(window.DOMPurify=rr().default||rr());function As(a){let e,n,t=a[0]==="user"?"Me":"Bot",r,i,l,s,o,c=ir.sanitize(T.parse(a[1]))+"",f,h,b,p,M,G,j;return{c(){e=W("div"),n=W("p"),r=nt(t),l=we(),s=W("div"),o=W("div"),b=we(),p=W("div"),this.h()},l(x){e=q(x,"DIV",{class:!0});var O=D(e);n=q(O,"P",{class:!0});var X=D(n);r=rt(X,t),X.forEach(E),O.forEach(E),l=xe(x),s=q(x,"DIV",{class:!0});var R=D(s);o=q(R,"DIV",{class:!0});var K=D(o);K.forEach(E),b=xe(R),p=q(R,"DIV",{}),D(p).forEach(E),R.forEach(E),this.h()},h(){g(n,"class","text-xs px-2"),g(e,"class",i="flex items-center "+a[4][a[0]]),g(o,"class",f="bg-black py-0.5 px-4 max-w-2xl rounded leading-loose "+a[2]+" "+a[4][a[0]]),g(s,"class",M="flex "+a[4][a[0]])},m(x,O){V(x,e,O),L(e,n),L(n,r),V(x,l,O),V(x,s,O),L(s,o),o.innerHTML=c,L(s,b),L(s,p),a[6](p),G||(j=hr(h=a[5].call(null,o,a[1])),G=!0)},p(x,[O]){O&1&&t!==(t=x[0]==="user"?"Me":"Bot")&&Nt(r,t),O&1&&i!==(i="flex items-center "+x[4][x[0]])&&g(e,"class",i),O&2&&c!==(c=ir.sanitize(T.parse(x[1]))+"")&&(o.innerHTML=c),O&5&&f!==(f="bg-black py-0.5 px-4 max-w-2xl rounded leading-loose "+x[2]+" "+x[4][x[0]])&&g(o,"class",f),h&&gi(h.update)&&O&2&&h.update.call(null,x[1]),O&1&&M!==(M="flex "+x[4][x[0]])&&g(s,"class",M)},i:Y,o:Y,d(x){x&&E(e),x&&E(l),x&&E(s),a[6](null),G=!1,j()}}}function Ss(a,e,n){let{type:t}=e,{message:r=""}=e,{class:i=""}=e,l;const s={user:"justify-end text-rose-700",assistant:"justify-start text-teal-400",system:"justify-center text-gray-400"},o=(f,h)=>({update(b){l.scrollIntoView({behavior:"auto",block:"end",inline:"end"})}});or(()=>{l.scrollIntoView({behavior:"auto",block:"end",inline:"end"})});function c(f){pr[f?"unshift":"push"](()=>{l=f,n(3,l)})}return a.$$set=f=>{"type"in f&&n(0,t=f.type),"message"in f&&n(1,r=f.message),"class"in f&&n(2,i=f.class)},[t,r,i,l,s,o,c]}class Tr extends Ee{constructor(e){super(),Te(this,e,Ss,As,de,{type:0,message:1,class:2})}}function Rs(a){let e,n,t,r,i,l,s,o,c=[{name:a[2]},{placeholder:a[1]},{class:"shadow bg-white/10 rounded-md px-4 py-1.5 min-w-xl text-teal-300 border border-transparent focus:outline-none focus:ring-1 focus:ring-teal-300 focus:border-transparent"},a[6]],f={};for(let h=0;h<c.length;h+=1)f=Pe(f,c[h]);return{c(){e=W("div"),n=W("label"),t=nt(a[3]),r=we(),i=W("input"),this.h()},l(h){e=q(h,"DIV",{class:!0});var b=D(e);n=q(b,"LABEL",{class:!0,for:!0});var p=D(n);t=rt(p,a[3]),p.forEach(E),r=xe(b),i=q(b,"INPUT",{name:!0,placeholder:!0,class:!0}),b.forEach(E),this.h()},h(){g(n,"class","text-xs"),g(n,"for",a[2]),Hn(i,f),g(e,"class",l="flex flex-col min-w-xl "+a[4])},m(h,b){V(h,e,b),L(e,n),L(n,t),L(e,r),L(e,i),i.autofocus&&i.focus(),Fn(i,a[0]),s||(o=[hr(a[5].call(null,i)),tt(i,"input",a[8])],s=!0)},p(h,[b]){b&8&&Nt(t,h[3]),b&4&&g(n,"for",h[2]),Hn(i,f=it(c,[b&4&&{name:h[2]},b&2&&{placeholder:h[1]},{class:"shadow bg-white/10 rounded-md px-4 py-1.5 min-w-xl text-teal-300 border border-transparent focus:outline-none focus:ring-1 focus:ring-teal-300 focus:border-transparent"},b&64&&h[6]])),b&1&&i.value!==h[0]&&Fn(i,h[0]),b&16&&l!==(l="flex flex-col min-w-xl "+h[4])&&g(e,"class",l)},i:Y,o:Y,d(h){h&&E(e),s=!1,cr(o)}}}function Is(a,e,n){const t=["value","placeholder","name","type","label","class"];let r=Bn(e,t),{value:i}=e,{placeholder:l=""}=e,{name:s=""}=e,{type:o="text"}=e,{label:c=""}=e,{class:f=""}=e;const h=p=>{p.type=o};function b(){i=this.value,n(0,i)}return a.$$set=p=>{e=Pe(Pe({},e),_i(p)),n(6,r=Bn(e,t)),"value"in p&&n(0,i=p.value),"placeholder"in p&&n(1,l=p.placeholder),"name"in p&&n(2,s=p.name),"type"in p&&n(7,o=p.type),"label"in p&&n(3,c=p.label),"class"in p&&n(4,f=p.class)},[i,l,s,c,f,h,r,o,b]}class Ns extends Ee{constructor(e){super(),Te(this,e,Is,Rs,de,{value:0,placeholder:1,name:2,type:7,label:3,class:4})}}function sr(a,e,n){const t=a.slice();return t[6]=e[n],t}function ar(a){let e,n;return e=new Tr({props:{type:a[6].role,message:a[6].content}}),{c(){ce(e.$$.fragment)},l(t){ke(e.$$.fragment,t)},m(t,r){fe(e,t,r),n=!0},p(t,r){const i={};r&2&&(i.type=t[6].role),r&2&&(i.message=t[6].content),e.$set(i)},i(t){n||(P(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){he(e,t)}}}function lr(a){let e,n;return e=new Tr({props:{type:"assistant",message:a[2]}}),{c(){ce(e.$$.fragment)},l(t){ke(e.$$.fragment,t)},m(t,r){fe(e,t,r),n=!0},p(t,r){const i={};r&4&&(i.message=t[2]),e.$set(i)},i(t){n||(P(e.$$.fragment,t),n=!0)},o(t){$(e.$$.fragment,t),n=!1},d(t){he(e,t)}}}function Ls(a){let e,n,t,r,i,l,s,o,c,f,h,b,p,M,G,j,x,O;t=new Bi({});let X=a[1].messages,R=[];for(let N=0;N<X.length;N+=1)R[N]=ar(sr(a,X,N));const K=N=>$(R[N],1,1,()=>{R[N]=null});let w=a[2]&&lr(a);function U(N){a[4](N)}let Re={type:"text",class:"w-full"};return a[0]!==void 0&&(Re.value=a[0]),h=new Ns({props:Re}),pr.push(()=>bi(h,"value",U)),{c(){e=W("section"),n=W("div"),ce(t.$$.fragment),r=we(),i=W("div"),l=W("div"),s=W("div");for(let N=0;N<R.length;N+=1)R[N].c();o=we(),w&&w.c(),c=we(),f=W("form"),ce(h.$$.fragment),p=we(),M=W("button"),G=nt("Send"),this.h()},l(N){e=q(N,"SECTION",{class:!0});var F=D(e);n=q(F,"DIV",{class:!0});var ie=D(n);ke(t.$$.fragment,ie),ie.forEach(E),r=xe(F),i=q(F,"DIV",{class:!0});var Z=D(i);l=q(Z,"DIV",{class:!0});var ze=D(l);s=q(ze,"DIV",{class:!0});var Ie=D(s);for(let st=0;st<R.length;st+=1)R[st].l(Ie);o=xe(Ie),w&&w.l(Ie),Ie.forEach(E),ze.forEach(E),c=xe(Z),f=q(Z,"FORM",{class:!0});var Le=D(f);ke(h.$$.fragment,Le),p=xe(Le),M=q(Le,"BUTTON",{type:!0,class:!0});var Ze=D(M);G=rt(Ze,"Send"),Ze.forEach(E),Le.forEach(E),Z.forEach(E),F.forEach(E),this.h()},h(){g(n,"class","flex flex-col gap-2"),g(s,"class","flex flex-col gap-2"),g(l,"class","h-[700px] w-full bg-black bg-opacity-20 rounded-md p-4 overflow-y-auto flex flex-col gap-4"),g(M,"type","submit"),g(M,"class","bg-black bg-opacity-40 hover:bg-white/5 px-8 py-1.5 border border-black/40 ml-[-0.5rem] rounded-md text-teal-300"),g(f,"class","flex w-full rounded-md gap-4 bg-black bg-opacity-20 p-2"),g(i,"class","flex flex-col w-full px-8 items-center gap-2"),g(e,"class","flex max-w-6xl w-full pt-4 justify-center")},m(N,F){V(N,e,F),L(e,n),fe(t,n,null),L(e,r),L(e,i),L(i,l),L(l,s);for(let ie=0;ie<R.length;ie+=1)R[ie]&&R[ie].m(s,null);L(s,o),w&&w.m(s,null),L(i,c),L(i,f),fe(h,f,null),L(f,p),L(f,M),L(M,G),j=!0,x||(O=tt(f,"submit",ur(a[3])),x=!0)},p(N,[F]){if(F&2){X=N[1].messages;let Z;for(Z=0;Z<X.length;Z+=1){const ze=sr(N,X,Z);R[Z]?(R[Z].p(ze,F),P(R[Z],1)):(R[Z]=ar(ze),R[Z].c(),P(R[Z],1),R[Z].m(s,o))}for(De(),Z=X.length;Z<R.length;Z+=1)K(Z);Me()}N[2]?w?(w.p(N,F),F&4&&P(w,1)):(w=lr(N),w.c(),P(w,1),w.m(s,null)):w&&(De(),$(w,1,1,()=>{w=null}),Me());const ie={};!b&&F&1&&(b=!0,ie.value=N[0],ki(()=>b=!1)),h.$set(ie)},i(N){if(!j){P(t.$$.fragment,N);for(let F=0;F<X.length;F+=1)P(R[F]);P(w),P(h.$$.fragment,N),j=!0}},o(N){$(t.$$.fragment,N),R=R.filter(Boolean);for(let F=0;F<R.length;F+=1)$(R[F]);$(w),$(h.$$.fragment,N),j=!1},d(N){N&&E(e),he(t),fr(R,N),w&&w.d(),he(h),x=!1,O()}}}function Os(a,e,n){let t,r;xt(a,Ue,o=>n(1,t=o)),xt(a,We,o=>n(2,r=o));let i="";const l=async()=>{We.set("..."),await Ue.set(i),n(0,i="")};function s(o){i=o,n(0,i)}return[i,t,r,l,s]}class Us extends Ee{constructor(e){super(),Te(this,e,Os,Ls,de,{})}}export{Us as default};