@zooid/web 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,66 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/json-editor-De2WPcl1.js","assets/json-editor-DfH04Znl.css"])))=>i.map(i=>d[i]);
2
+ var zl=Object.defineProperty;var Ns=e=>{throw TypeError(e)};var Rl=(e,t,r)=>t in e?zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var le=(e,t,r)=>Rl(e,typeof t!="symbol"?t+"":t,r),po=(e,t,r)=>t.has(e)||Ns("Cannot "+r);var S=(e,t,r)=>(po(e,t,"read from private field"),r?r.call(e):t.get(e)),ve=(e,t,r)=>t.has(e)?Ns("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ue=(e,t,r,n)=>(po(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),et=(e,t,r)=>(po(e,t,"access private method"),r);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function n(o){if(o.ep)return;o.ep=!0;const s=r(o);fetch(o.href,s)}})();const Pl="5";var Ai;typeof window<"u"&&((Ai=window.__svelte??(window.__svelte={})).v??(Ai.v=new Set)).add(Pl);const Ml=1,Il=2,Ri=4,Ol=8,Ll=16,$l=1,jl=2,Pi=4,Nl=8,Bl=16,Mi=1,Gl=2,Le=Symbol(),Ii="http://www.w3.org/1999/xhtml",Dl="@attach",So=!1;var ts=Array.isArray,ql=Array.prototype.indexOf,Zr=Array.prototype.includes,so=Array.from,Vl=Object.defineProperty,rr=Object.getOwnPropertyDescriptor,Oi=Object.getOwnPropertyDescriptors,Fl=Object.prototype,Hl=Array.prototype,rs=Object.getPrototypeOf,Bs=Object.isExtensible;function cn(e){return typeof e=="function"}const Yn=()=>{};function iv(e){return e()}function Ul(e){for(var t=0;t<e.length;t++)e[t]()}function Li(){var e,t,r=new Promise((n,o)=>{e=n,t=o});return{promise:r,resolve:e,reject:t}}const Ge=2,kn=4,Rn=8,ns=1<<24,Zt=16,kt=32,Ir=64,Co=128,ct=512,Pe=1024,De=2048,dt=4096,it=8192,Ut=16384,Pn=32768,ar=65536,Gs=1<<17,$i=1<<18,en=1<<19,ji=1<<20,Dt=1<<25,zr=65536,To=1<<21,os=1<<22,nr=1<<23,Rt=Symbol("$state"),Ni=Symbol("legacy props"),Wl=Symbol(""),br=new class extends Error{constructor(){super(...arguments);le(this,"name","StaleReactionError");le(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Ei;const ss=!!((Ei=globalThis.document)!=null&&Ei.contentType)&&globalThis.document.contentType.includes("xml");function Zl(e){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Kl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Yl(e,t,r){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Jl(e){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Xl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Ql(e){throw new Error("https://svelte.dev/e/effect_orphan")}function ec(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function lv(e){throw new Error("https://svelte.dev/e/lifecycle_legacy_only")}function tc(e){throw new Error("https://svelte.dev/e/props_invalid_value")}function rc(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function nc(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function oc(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function sc(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}function ic(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function ac(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Bi(e){return e===this.v}function lc(e,t){return e!=e?t==t:e!==t||e!==null&&typeof e=="object"||typeof e=="function"}function Gi(e){return!lc(e,this.v)}let Mn=!1,cc=!1;function cv(){Mn=!0}let Te=null;function Kr(e){Te=e}function uv(e){return Di().get(e)}function dv(e,t){return Di().set(e,t),t}function Fe(e,t=!1,r){Te={p:Te,i:!1,c:null,e:null,s:e,x:null,l:Mn&&!t?{s:null,u:null,$:[]}:null}}function He(e){var t=Te,r=t.e;if(r!==null){t.e=null;for(var n of r)la(n)}return e!==void 0&&(t.x=e),t.i=!0,Te=t.p,e??{}}function In(){return!Mn||Te!==null&&Te.l===null}function Di(e){return Te===null&&Zl(),Te.c??(Te.c=new Map(uc(Te)||void 0))}function uc(e){let t=e.p;for(;t!==null;){const r=t.c;if(r!==null)return r;t=t.p}return null}let xr=[];function qi(){var e=xr;xr=[],Ul(e)}function Pt(e){if(xr.length===0&&!yn){var t=xr;queueMicrotask(()=>{t===xr&&qi()})}xr.push(e)}function dc(){for(;xr.length>0;)qi()}function Vi(e){var t=be;if(t===null)return he.f|=nr,e;if((t.f&Pn)===0&&(t.f&kn)===0)throw e;Yr(e,t)}function Yr(e,t){for(;t!==null;){if((t.f&Co)!==0){if((t.f&Pn)===0)throw e;try{t.b.error(e);return}catch(r){e=r}}t=t.parent}throw e}const fc=-7169;function ze(e,t){e.f=e.f&fc|t}function is(e){(e.f&ct)!==0||e.deps===null?ze(e,Pe):ze(e,dt)}function Fi(e){if(e!==null)for(const t of e)(t.f&Ge)===0||(t.f&zr)===0||(t.f^=zr,Fi(t.deps))}function Hi(e,t,r){(e.f&De)!==0?t.add(e):(e.f&dt)!==0&&r.add(e),Fi(e.deps),ze(e,Pe)}const Nn=new Set;let de=null,Ao=null,Ne=null,Ke=[],io=null,Eo=!1,yn=!1;var Dr,qr,_r,Vr,Tn,An,kr,jt,Fr,Mt,zo,Ro,Ui;const Is=class Is{constructor(){ve(this,Mt);le(this,"committed",!1);le(this,"current",new Map);le(this,"previous",new Map);ve(this,Dr,new Set);ve(this,qr,new Set);ve(this,_r,0);ve(this,Vr,0);ve(this,Tn,null);ve(this,An,new Set);ve(this,kr,new Set);ve(this,jt,new Map);le(this,"is_fork",!1);ve(this,Fr,!1)}is_deferred(){return this.is_fork||S(this,Vr)>0}skip_effect(t){S(this,jt).has(t)||S(this,jt).set(t,{d:[],m:[]})}unskip_effect(t){var r=S(this,jt).get(t);if(r){S(this,jt).delete(t);for(var n of r.d)ze(n,De),yt(n);for(n of r.m)ze(n,dt),yt(n)}}process(t){var o;Ke=[],this.apply();var r=[],n=[];for(const s of t)et(this,Mt,zo).call(this,s,r,n);if(this.is_deferred()){et(this,Mt,Ro).call(this,n),et(this,Mt,Ro).call(this,r);for(const[s,i]of S(this,jt))Yi(s,i)}else{for(const s of S(this,Dr))s();S(this,Dr).clear(),S(this,_r)===0&&et(this,Mt,Ui).call(this),Ao=this,de=null,Ds(n),Ds(r),Ao=null,(o=S(this,Tn))==null||o.resolve()}Ne=null}capture(t,r){r!==Le&&!this.previous.has(t)&&this.previous.set(t,r),(t.f&nr)===0&&(this.current.set(t,t.v),Ne==null||Ne.set(t,t.v))}activate(){de=this,this.apply()}deactivate(){de===this&&(de=null,Ne=null)}flush(){if(this.activate(),Ke.length>0){if(Wi(),de!==null&&de!==this)return}else S(this,_r)===0&&this.process([]);this.deactivate()}discard(){for(const t of S(this,qr))t(this);S(this,qr).clear()}increment(t){ue(this,_r,S(this,_r)+1),t&&ue(this,Vr,S(this,Vr)+1)}decrement(t){ue(this,_r,S(this,_r)-1),t&&ue(this,Vr,S(this,Vr)-1),!S(this,Fr)&&(ue(this,Fr,!0),Pt(()=>{ue(this,Fr,!1),this.is_deferred()?Ke.length>0&&this.flush():this.revive()}))}revive(){for(const t of S(this,An))S(this,kr).delete(t),ze(t,De),yt(t);for(const t of S(this,kr))ze(t,dt),yt(t);this.flush()}oncommit(t){S(this,Dr).add(t)}ondiscard(t){S(this,qr).add(t)}settled(){return(S(this,Tn)??ue(this,Tn,Li())).promise}static ensure(){if(de===null){const t=de=new Is;Nn.add(de),yn||Pt(()=>{de===t&&t.flush()})}return de}apply(){}};Dr=new WeakMap,qr=new WeakMap,_r=new WeakMap,Vr=new WeakMap,Tn=new WeakMap,An=new WeakMap,kr=new WeakMap,jt=new WeakMap,Fr=new WeakMap,Mt=new WeakSet,zo=function(t,r,n){t.f^=Pe;for(var o=t.first,s=null;o!==null;){var i=o.f,a=(i&(kt|Ir))!==0,l=a&&(i&Pe)!==0,c=l||(i&it)!==0||S(this,jt).has(o);if(!c&&o.fn!==null){a?o.f^=Pe:s!==null&&(i&(kn|Rn|ns))!==0?s.b.defer_effect(o):(i&kn)!==0?r.push(o):rn(o)&&((i&Zt)!==0&&S(this,kr).add(o),Rr(o));var u=o.first;if(u!==null){o=u;continue}}for(;o!==null;){o===s&&(s=null);var p=o.next;if(p!==null){o=p;break}o=o.parent}}},Ro=function(t){for(var r=0;r<t.length;r+=1)Hi(t[r],S(this,An),S(this,kr))},Ui=function(){var o;if(Nn.size>1){this.previous.clear();var t=Ne,r=!0;for(const s of Nn){if(s===this){r=!1;continue}const i=[];for(const[l,c]of this.current){if(s.current.has(l))if(r&&c!==s.current.get(l))s.current.set(l,c);else continue;i.push(l)}if(i.length===0)continue;const a=[...s.current.keys()].filter(l=>!this.current.has(l));if(a.length>0){var n=Ke;Ke=[];const l=new Set,c=new Map;for(const u of i)Zi(u,a,l,c);if(Ke.length>0){de=s,s.apply();for(const u of Ke)et(o=s,Mt,zo).call(o,u,[],[]);s.deactivate()}Ke=n}}de=null,Ne=t}this.committed=!0,Nn.delete(this)};let or=Is;function pc(e){var t=yn;yn=!0;try{for(var r;;){if(dc(),Ke.length===0&&(de==null||de.flush(),Ke.length===0))return io=null,r;Wi()}}finally{yn=t}}function Wi(){Eo=!0;var e=null;try{for(var t=0;Ke.length>0;){var r=or.ensure();if(t++>1e3){var n,o;hc()}r.process(Ke),sr.clear()}}finally{Ke=[],Eo=!1,io=null}}function hc(){try{ec()}catch(e){Yr(e,io)}}let mt=null;function Ds(e){var t=e.length;if(t!==0){for(var r=0;r<t;){var n=e[r++];if((n.f&(Ut|it))===0&&rn(n)&&(mt=new Set,Rr(n),n.deps===null&&n.first===null&&n.nodes===null&&n.teardown===null&&n.ac===null&&fa(n),(mt==null?void 0:mt.size)>0)){sr.clear();for(const o of mt){if((o.f&(Ut|it))!==0)continue;const s=[o];let i=o.parent;for(;i!==null;)mt.has(i)&&(mt.delete(i),s.push(i)),i=i.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Ut|it))===0&&Rr(l)}}mt.clear()}}mt=null}}function Zi(e,t,r,n){if(!r.has(e)&&(r.add(e),e.reactions!==null))for(const o of e.reactions){const s=o.f;(s&Ge)!==0?Zi(o,t,r,n):(s&(os|Zt))!==0&&(s&De)===0&&Ki(o,t,n)&&(ze(o,De),yt(o))}}function Ki(e,t,r){const n=r.get(e);if(n!==void 0)return n;if(e.deps!==null)for(const o of e.deps){if(Zr.call(t,o))return!0;if((o.f&Ge)!==0&&Ki(o,t,r))return r.set(o,!0),!0}return r.set(e,!1),!1}function yt(e){for(var t=io=e;t.parent!==null;){t=t.parent;var r=t.f;if(Eo&&t===be&&(r&Zt)!==0&&(r&$i)===0)return;if((r&(Ir|kt))!==0){if((r&Pe)===0)return;t.f^=Pe}}Ke.push(t)}function Yi(e,t){if(!((e.f&kt)!==0&&(e.f&Pe)!==0)){(e.f&De)!==0?t.d.push(e):(e.f&dt)!==0&&t.m.push(e),ze(e,Pe);for(var r=e.first;r!==null;)Yi(r,t),r=r.next}}function vc(e){let t=0,r=lr(0),n;return()=>{cs()&&(d(r),tn(()=>(t===0&&(n=Or(()=>e(()=>wn(r)))),t+=1,()=>{Pt(()=>{t-=1,t===0&&(n==null||n(),n=void 0,wn(r))})})))}}var gc=ar|en;function mc(e,t,r){new bc(e,t,r)}var bt,es,Nt,Sr,Tt,At,rt,Et,Bt,Cr,tr,Hr,Ur,Wr,Gt,no,Xe,xc,yc,Po,Wn,Mo;class bc{constructor(t,r,n){ve(this,Xe);le(this,"parent");le(this,"is_pending",!1);ve(this,bt);ve(this,es,null);ve(this,Nt);ve(this,Sr);ve(this,Tt);ve(this,At,null);ve(this,rt,null);ve(this,Et,null);ve(this,Bt,null);ve(this,Cr,0);ve(this,tr,0);ve(this,Hr,!1);ve(this,Ur,new Set);ve(this,Wr,new Set);ve(this,Gt,null);ve(this,no,vc(()=>(ue(this,Gt,lr(S(this,Cr))),()=>{ue(this,Gt,null)})));ue(this,bt,t),ue(this,Nt,r),ue(this,Sr,o=>{var s=be;s.b=this,s.f|=Co,n(o)}),this.parent=be.b,ue(this,Tt,Ln(()=>{et(this,Xe,Po).call(this)},gc))}defer_effect(t){Hi(t,S(this,Ur),S(this,Wr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!S(this,Nt).pending}update_pending_count(t){et(this,Xe,Mo).call(this,t),ue(this,Cr,S(this,Cr)+t),!(!S(this,Gt)||S(this,Hr))&&(ue(this,Hr,!0),Pt(()=>{ue(this,Hr,!1),S(this,Gt)&&Jr(S(this,Gt),S(this,Cr))}))}get_effect_pending(){return S(this,no).call(this),d(S(this,Gt))}error(t){var r=S(this,Nt).onerror;let n=S(this,Nt).failed;if(!r&&!n)throw t;S(this,At)&&(Be(S(this,At)),ue(this,At,null)),S(this,rt)&&(Be(S(this,rt)),ue(this,rt,null)),S(this,Et)&&(Be(S(this,Et)),ue(this,Et,null));var o=!1,s=!1;const i=()=>{if(o){ac();return}o=!0,s&&sc(),S(this,Et)!==null&&Ar(S(this,Et),()=>{ue(this,Et,null)}),et(this,Xe,Wn).call(this,()=>{or.ensure(),et(this,Xe,Po).call(this)})};Pt(()=>{try{s=!0,r==null||r(t,i),s=!1}catch(a){Yr(a,S(this,Tt)&&S(this,Tt).parent)}n&&ue(this,Et,et(this,Xe,Wn).call(this,()=>{or.ensure();try{return ot(()=>{var a=be;a.b=this,a.f|=Co,n(S(this,bt),()=>t,()=>i)})}catch(a){return Yr(a,S(this,Tt).parent),null}}))})}}bt=new WeakMap,es=new WeakMap,Nt=new WeakMap,Sr=new WeakMap,Tt=new WeakMap,At=new WeakMap,rt=new WeakMap,Et=new WeakMap,Bt=new WeakMap,Cr=new WeakMap,tr=new WeakMap,Hr=new WeakMap,Ur=new WeakMap,Wr=new WeakMap,Gt=new WeakMap,no=new WeakMap,Xe=new WeakSet,xc=function(){try{ue(this,At,ot(()=>S(this,Sr).call(this,S(this,bt))))}catch(t){this.error(t)}},yc=function(){const t=S(this,Nt).pending;t&&(this.is_pending=!0,ue(this,rt,ot(()=>t(S(this,bt)))),Pt(()=>{var r=ue(this,Bt,document.createDocumentFragment()),n=Wt();r.append(n),ue(this,At,et(this,Xe,Wn).call(this,()=>(or.ensure(),ot(()=>S(this,Sr).call(this,n))))),S(this,tr)===0&&(S(this,bt).before(r),ue(this,Bt,null),Ar(S(this,rt),()=>{ue(this,rt,null)}),this.is_pending=!1)}))},Po=function(){try{if(this.is_pending=this.has_pending_snippet(),ue(this,tr,0),ue(this,Cr,0),ue(this,At,ot(()=>{S(this,Sr).call(this,S(this,bt))})),S(this,tr)>0){var t=ue(this,Bt,document.createDocumentFragment());va(S(this,At),t);const r=S(this,Nt).pending;ue(this,rt,ot(()=>r(S(this,bt))))}else this.is_pending=!1}catch(r){this.error(r)}},Wn=function(t){var r=be,n=he,o=Te;pt(S(this,Tt)),ft(S(this,Tt)),Kr(S(this,Tt).ctx);try{return t()}catch(s){return Vi(s),null}finally{pt(r),ft(n),Kr(o)}},Mo=function(t){var r;if(!this.has_pending_snippet()){this.parent&&et(r=this.parent,Xe,Mo).call(r,t);return}if(ue(this,tr,S(this,tr)+t),S(this,tr)===0){this.is_pending=!1;for(const n of S(this,Ur))ze(n,De),yt(n);for(const n of S(this,Wr))ze(n,dt),yt(n);S(this,Ur).clear(),S(this,Wr).clear(),S(this,rt)&&Ar(S(this,rt),()=>{ue(this,rt,null)}),S(this,Bt)&&(S(this,bt).before(S(this,Bt)),ue(this,Bt,null))}};function Ji(e,t,r,n){const o=In()?ao:as;var s=e.filter(f=>!f.settled);if(r.length===0&&s.length===0){n(t.map(o));return}var i=de,a=be,l=wc(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(f=>f.promise)):null;function u(f){l();try{n(f)}catch(m){(a.f&Ut)===0&&Yr(m,a)}i==null||i.deactivate(),Io()}if(r.length===0){c.then(()=>u(t.map(o)));return}function p(){l(),Promise.all(r.map(f=>_c(f))).then(f=>u([...t.map(o),...f])).catch(f=>Yr(f,a))}c?c.then(p):p()}function wc(){var e=be,t=he,r=Te,n=de;return function(s=!0){pt(e),ft(t),Kr(r),s&&(n==null||n.activate())}}function Io(){pt(null),ft(null),Kr(null)}function ao(e){var t=Ge|De,r=he!==null&&(he.f&Ge)!==0?he:null;return be!==null&&(be.f|=en),{ctx:Te,deps:null,effects:null,equals:Bi,f:t,fn:e,reactions:null,rv:0,v:Le,wv:0,parent:r??be,ac:null}}function _c(e,t,r){let n=be;n===null&&Kl();var o=n.b,s=void 0,i=lr(Le),a=!he,l=new Map;return $c(()=>{var m;var c=Li();s=c.promise;try{Promise.resolve(e()).then(c.resolve,c.reject).then(()=>{u===de&&u.committed&&u.deactivate(),Io()})}catch(g){c.reject(g),Io()}var u=de;if(a){var p=o.is_rendered();o.update_pending_count(1),u.increment(p),(m=l.get(u))==null||m.reject(br),l.delete(u),l.set(u,c)}const f=(g,y=void 0)=>{if(u.activate(),y)y!==br&&(i.f|=nr,Jr(i,y));else{(i.f&nr)!==0&&(i.f^=nr),Jr(i,g);for(const[v,b]of l){if(l.delete(v),v===u)break;b.reject(br)}}a&&(o.update_pending_count(-1),u.decrement(p))};c.promise.then(f,g=>f(null,g||"unknown"))}),us(()=>{for(const c of l.values())c.reject(br)}),new Promise(c=>{function u(p){function f(){p===s?c(i):u(s)}p.then(f,f)}u(s)})}function _e(e){const t=ao(e);return ga(t),t}function as(e){const t=ao(e);return t.equals=Gi,t}function kc(e){var t=e.effects;if(t!==null){e.effects=null;for(var r=0;r<t.length;r+=1)Be(t[r])}}function Sc(e){for(var t=e.parent;t!==null;){if((t.f&Ge)===0)return(t.f&Ut)===0?t:null;t=t.parent}return null}function ls(e){var t,r=be;pt(Sc(e));try{e.f&=~zr,kc(e),t=ya(e)}finally{pt(r)}return t}function Xi(e){var t=ls(e);if(!e.equals(t)&&(e.wv=ba(),(!(de!=null&&de.is_fork)||e.deps===null)&&(e.v=t,e.deps===null))){ze(e,Pe);return}cr||(Ne!==null?(cs()||de!=null&&de.is_fork)&&Ne.set(e,t):is(e))}function Cc(e){var t,r;if(e.effects!==null)for(const n of e.effects)(n.teardown||n.ac)&&((t=n.teardown)==null||t.call(n),(r=n.ac)==null||r.abort(br),n.teardown=Yn,n.ac=null,Sn(n,0),fs(n))}function Qi(e){if(e.effects!==null)for(const t of e.effects)t.teardown&&Rr(t)}let Oo=new Set;const sr=new Map;let ea=!1;function lr(e,t){var r={f:0,v:e,reactions:null,equals:Bi,rv:0,wv:0};return r}function D(e,t){const r=lr(e);return ga(r),r}function Tc(e,t=!1,r=!0){var o;const n=lr(e);return t||(n.equals=Gi),Mn&&r&&Te!==null&&Te.l!==null&&((o=Te.l).s??(o.s=[])).push(n),n}function fv(e,t){return h(e,Or(()=>d(e))),t}function h(e,t,r=!1){he!==null&&(!_t||(he.f&Gs)!==0)&&In()&&(he.f&(Ge|Zt|os|Gs))!==0&&(ut===null||!Zr.call(ut,e))&&oc();let n=r?wt(t):t;return Jr(e,n)}function Jr(e,t){if(!e.equals(t)){var r=e.v;cr?sr.set(e,t):sr.set(e,r),e.v=t;var n=or.ensure();if(n.capture(e,r),(e.f&Ge)!==0){const o=e;(e.f&De)!==0&&ls(o),is(o)}e.wv=ba(),ta(e,De),In()&&be!==null&&(be.f&Pe)!==0&&(be.f&(kt|Ir))===0&&(lt===null?Nc([e]):lt.push(e)),!n.is_fork&&Oo.size>0&&!ea&&Ac()}return t}function Ac(){ea=!1;for(const e of Oo)(e.f&Pe)!==0&&ze(e,dt),rn(e)&&Rr(e);Oo.clear()}function qs(e,t=1){var r=d(e),n=t===1?r++:r--;return h(e,r),n}function wn(e){h(e,e.v+1)}function ta(e,t){var r=e.reactions;if(r!==null)for(var n=In(),o=r.length,s=0;s<o;s++){var i=r[s],a=i.f;if(!(!n&&i===be)){var l=(a&De)===0;if(l&&ze(i,t),(a&Ge)!==0){var c=i;Ne==null||Ne.delete(c),(a&zr)===0&&(a&ct&&(i.f|=zr),ta(c,dt))}else l&&((a&Zt)!==0&&mt!==null&&mt.add(i),yt(i))}}}function wt(e){if(typeof e!="object"||e===null||Rt in e)return e;const t=rs(e);if(t!==Fl&&t!==Hl)return e;var r=new Map,n=ts(e),o=D(0),s=Er,i=a=>{if(Er===s)return a();var l=he,c=Er;ft(null),Ws(s);var u=a();return ft(l),Ws(c),u};return n&&r.set("length",D(e.length)),new Proxy(e,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&rc();var u=r.get(l);return u===void 0?i(()=>{var p=D(c.value);return r.set(l,p),p}):h(u,c.value,!0),!0},deleteProperty(a,l){var c=r.get(l);if(c===void 0){if(l in a){const u=i(()=>D(Le));r.set(l,u),wn(o)}}else h(c,Le),wn(o);return!0},get(a,l,c){var m;if(l===Rt)return e;var u=r.get(l),p=l in a;if(u===void 0&&(!p||(m=rr(a,l))!=null&&m.writable)&&(u=i(()=>{var g=wt(p?a[l]:Le),y=D(g);return y}),r.set(l,u)),u!==void 0){var f=d(u);return f===Le?void 0:f}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var u=r.get(l);u&&(c.value=d(u))}else if(c===void 0){var p=r.get(l),f=p==null?void 0:p.v;if(p!==void 0&&f!==Le)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return c},has(a,l){var f;if(l===Rt)return!0;var c=r.get(l),u=c!==void 0&&c.v!==Le||Reflect.has(a,l);if(c!==void 0||be!==null&&(!u||(f=rr(a,l))!=null&&f.writable)){c===void 0&&(c=i(()=>{var m=u?wt(a[l]):Le,g=D(m);return g}),r.set(l,c));var p=d(c);if(p===Le)return!1}return u},set(a,l,c,u){var M;var p=r.get(l),f=l in a;if(n&&l==="length")for(var m=c;m<p.v;m+=1){var g=r.get(m+"");g!==void 0?h(g,Le):m in a&&(g=i(()=>D(Le)),r.set(m+"",g))}if(p===void 0)(!f||(M=rr(a,l))!=null&&M.writable)&&(p=i(()=>D(void 0)),h(p,wt(c)),r.set(l,p));else{f=p.v!==Le;var y=i(()=>wt(c));h(p,y)}var v=Reflect.getOwnPropertyDescriptor(a,l);if(v!=null&&v.set&&v.set.call(u,c),!f){if(n&&typeof l=="string"){var b=r.get("length"),C=Number(l);Number.isInteger(C)&&C>=b.v&&h(b,C+1)}wn(o)}return!0},ownKeys(a){d(o);var l=Reflect.ownKeys(a).filter(p=>{var f=r.get(p);return f===void 0||f.v!==Le});for(var[c,u]of r)u.v!==Le&&!(c in a)&&l.push(c);return l},setPrototypeOf(){nc()}})}function Vs(e){try{if(e!==null&&typeof e=="object"&&Rt in e)return e[Rt]}catch{}return e}function Ec(e,t){return Object.is(Vs(e),Vs(t))}var Fs,ra,na,oa;function zc(){if(Fs===void 0){Fs=window,ra=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,r=Text.prototype;na=rr(t,"firstChild").get,oa=rr(t,"nextSibling").get,Bs(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),Bs(r)&&(r.__t=void 0)}}function Wt(e=""){return document.createTextNode(e)}function st(e){return na.call(e)}function On(e){return oa.call(e)}function x(e,t){return st(e)}function Ce(e,t=!1){{var r=st(e);return r instanceof Comment&&r.data===""?On(r):r}}function k(e,t=1,r=!1){let n=e;for(;t--;)n=On(n);return n}function Rc(e){e.textContent=""}function sa(){return!1}function Pc(e,t,r){return document.createElementNS(Ii,e,void 0)}function Mc(e,t){if(t){const r=document.body;e.autofocus=!0,Pt(()=>{document.activeElement===r&&e.focus()})}}let Hs=!1;function Ic(){Hs||(Hs=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var t;if(!e.defaultPrevented)for(const r of e.target.elements)(t=r.__on_r)==null||t.call(r)})},{capture:!0}))}function lo(e){var t=he,r=be;ft(null),pt(null);try{return e()}finally{ft(t),pt(r)}}function ia(e,t,r,n=r){e.addEventListener(t,()=>lo(r));const o=e.__on_r;o?e.__on_r=()=>{o(),n(!0)}:e.__on_r=()=>n(!0),Ic()}function aa(e){be===null&&(he===null&&Ql(),Xl()),cr&&Jl()}function Oc(e,t){var r=t.last;r===null?t.last=t.first=e:(r.next=e,e.prev=r,t.last=e)}function St(e,t,r){var n=be;n!==null&&(n.f&it)!==0&&(e|=it);var o={ctx:Te,deps:null,nodes:null,f:e|De|ct,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{Rr(o)}catch(a){throw Be(o),a}else t!==null&&yt(o);var s=o;if(r&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&en)===0&&(s=s.first,(e&Zt)!==0&&(e&ar)!==0&&s!==null&&(s.f|=ar)),s!==null&&(s.parent=n,n!==null&&Oc(s,n),he!==null&&(he.f&Ge)!==0&&(e&Ir)===0)){var i=he;(i.effects??(i.effects=[])).push(s)}return o}function cs(){return he!==null&&!_t}function us(e){const t=St(Rn,null,!1);return ze(t,Pe),t.teardown=e,t}function Xr(e){aa();var t=be.f,r=!he&&(t&kt)!==0&&(t&Pn)===0;if(r){var n=Te;(n.e??(n.e=[])).push(e)}else return la(e)}function la(e){return St(kn|ji,e,!1)}function pv(e){return aa(),St(Rn|ji,e,!0)}function Lc(e){or.ensure();const t=St(Ir|en,e,!0);return(r={})=>new Promise(n=>{r.outro?Ar(t,()=>{Be(t),n(void 0)}):(Be(t),n(void 0))})}function ds(e){return St(kn,e,!1)}function hv(e,t){var r=Te,n={effect:null,ran:!1,deps:e};r.l.$.push(n),n.effect=tn(()=>{e(),!n.ran&&(n.ran=!0,Or(t))})}function vv(){var e=Te;tn(()=>{for(var t of e.l.$){t.deps();var r=t.effect;(r.f&Pe)!==0&&r.deps!==null&&ze(r,dt),rn(r)&&Rr(r),t.ran=!1}})}function $c(e){return St(os|en,e,!0)}function tn(e,t=0){return St(Rn|t,e,!0)}function se(e,t=[],r=[],n=[]){Ji(n,t,r,o=>{St(Rn,()=>e(...o.map(d)),!0)})}function Ln(e,t=0){var r=St(Zt|t,e,!0);return r}function ca(e,t=0){var r=St(ns|t,e,!0);return r}function ot(e){return St(kt|en,e,!0)}function ua(e){var t=e.teardown;if(t!==null){const r=cr,n=he;Us(!0),ft(null);try{t.call(null)}finally{Us(r),ft(n)}}}function fs(e,t=!1){var r=e.first;for(e.first=e.last=null;r!==null;){const o=r.ac;o!==null&&lo(()=>{o.abort(br)});var n=r.next;(r.f&Ir)!==0?r.parent=null:Be(r,t),r=n}}function jc(e){for(var t=e.first;t!==null;){var r=t.next;(t.f&kt)===0&&Be(t),t=r}}function Be(e,t=!0){var r=!1;(t||(e.f&$i)!==0)&&e.nodes!==null&&e.nodes.end!==null&&(da(e.nodes.start,e.nodes.end),r=!0),fs(e,t&&!r),Sn(e,0),ze(e,Ut);var n=e.nodes&&e.nodes.t;if(n!==null)for(const s of n)s.stop();ua(e);var o=e.parent;o!==null&&o.first!==null&&fa(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function da(e,t){for(;e!==null;){var r=e===t?null:On(e);e.remove(),e=r}}function fa(e){var t=e.parent,r=e.prev,n=e.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),t!==null&&(t.first===e&&(t.first=n),t.last===e&&(t.last=r))}function Ar(e,t,r=!0){var n=[];pa(e,n,!0);var o=()=>{r&&Be(e),t&&t()},s=n.length;if(s>0){var i=()=>--s||o();for(var a of n)a.out(i)}else o()}function pa(e,t,r){if((e.f&it)===0){e.f^=it;var n=e.nodes&&e.nodes.t;if(n!==null)for(const a of n)(a.is_global||r)&&t.push(a);for(var o=e.first;o!==null;){var s=o.next,i=(o.f&ar)!==0||(o.f&kt)!==0&&(e.f&Zt)!==0;pa(o,t,i?r:!1),o=s}}}function ps(e){ha(e,!0)}function ha(e,t){if((e.f&it)!==0){e.f^=it,(e.f&Pe)===0&&(ze(e,De),yt(e));for(var r=e.first;r!==null;){var n=r.next,o=(r.f&ar)!==0||(r.f&kt)!==0;ha(r,o?t:!1),r=n}var s=e.nodes&&e.nodes.t;if(s!==null)for(const i of s)(i.is_global||t)&&i.in()}}function va(e,t){if(e.nodes)for(var r=e.nodes.start,n=e.nodes.end;r!==null;){var o=r===n?null:On(r);t.append(r),r=o}}let Zn=!1,cr=!1;function Us(e){cr=e}let he=null,_t=!1;function ft(e){he=e}let be=null;function pt(e){be=e}let ut=null;function ga(e){he!==null&&(ut===null?ut=[e]:ut.push(e))}let Ye=null,tt=0,lt=null;function Nc(e){lt=e}let ma=1,yr=0,Er=yr;function Ws(e){Er=e}function ba(){return++ma}function rn(e){var t=e.f;if((t&De)!==0)return!0;if(t&Ge&&(e.f&=~zr),(t&dt)!==0){for(var r=e.deps,n=r.length,o=0;o<n;o++){var s=r[o];if(rn(s)&&Xi(s),s.wv>e.wv)return!0}(t&ct)!==0&&Ne===null&&ze(e,Pe)}return!1}function xa(e,t,r=!0){var n=e.reactions;if(n!==null&&!(ut!==null&&Zr.call(ut,e)))for(var o=0;o<n.length;o++){var s=n[o];(s.f&Ge)!==0?xa(s,t,!1):t===s&&(r?ze(s,De):(s.f&Pe)!==0&&ze(s,dt),yt(s))}}function ya(e){var y;var t=Ye,r=tt,n=lt,o=he,s=ut,i=Te,a=_t,l=Er,c=e.f;Ye=null,tt=0,lt=null,he=(c&(kt|Ir))===0?e:null,ut=null,Kr(e.ctx),_t=!1,Er=++yr,e.ac!==null&&(lo(()=>{e.ac.abort(br)}),e.ac=null);try{e.f|=To;var u=e.fn,p=u();e.f|=Pn;var f=e.deps,m=de==null?void 0:de.is_fork;if(Ye!==null){var g;if(m||Sn(e,tt),f!==null&&tt>0)for(f.length=tt+Ye.length,g=0;g<Ye.length;g++)f[tt+g]=Ye[g];else e.deps=f=Ye;if(cs()&&(e.f&ct)!==0)for(g=tt;g<f.length;g++)((y=f[g]).reactions??(y.reactions=[])).push(e)}else!m&&f!==null&&tt<f.length&&(Sn(e,tt),f.length=tt);if(In()&&lt!==null&&!_t&&f!==null&&(e.f&(Ge|dt|De))===0)for(g=0;g<lt.length;g++)xa(lt[g],e);if(o!==null&&o!==e){if(yr++,o.deps!==null)for(let v=0;v<r;v+=1)o.deps[v].rv=yr;if(t!==null)for(const v of t)v.rv=yr;lt!==null&&(n===null?n=lt:n.push(...lt))}return(e.f&nr)!==0&&(e.f^=nr),p}catch(v){return Vi(v)}finally{e.f^=To,Ye=t,tt=r,lt=n,he=o,ut=s,Kr(i),_t=a,Er=l}}function Bc(e,t){let r=t.reactions;if(r!==null){var n=ql.call(r,e);if(n!==-1){var o=r.length-1;o===0?r=t.reactions=null:(r[n]=r[o],r.pop())}}if(r===null&&(t.f&Ge)!==0&&(Ye===null||!Zr.call(Ye,t))){var s=t;(s.f&ct)!==0&&(s.f^=ct,s.f&=~zr),is(s),Cc(s),Sn(s,0)}}function Sn(e,t){var r=e.deps;if(r!==null)for(var n=t;n<r.length;n++)Bc(e,r[n])}function Rr(e){var t=e.f;if((t&Ut)===0){ze(e,Pe);var r=be,n=Zn;be=e,Zn=!0;try{(t&(Zt|ns))!==0?jc(e):fs(e),ua(e);var o=ya(e);e.teardown=typeof o=="function"?o:null,e.wv=ma;var s;So&&cc&&(e.f&De)!==0&&e.deps}finally{Zn=n,be=r}}}async function wa(){await Promise.resolve(),pc()}function d(e){var t=e.f,r=(t&Ge)!==0;if(he!==null&&!_t){var n=be!==null&&(be.f&Ut)!==0;if(!n&&(ut===null||!Zr.call(ut,e))){var o=he.deps;if((he.f&To)!==0)e.rv<yr&&(e.rv=yr,Ye===null&&o!==null&&o[tt]===e?tt++:Ye===null?Ye=[e]:Ye.push(e));else{(he.deps??(he.deps=[])).push(e);var s=e.reactions;s===null?e.reactions=[he]:Zr.call(s,he)||s.push(he)}}}if(cr&&sr.has(e))return sr.get(e);if(r){var i=e;if(cr){var a=i.v;return((i.f&Pe)===0&&i.reactions!==null||ka(i))&&(a=ls(i)),sr.set(i,a),a}var l=(i.f&ct)===0&&!_t&&he!==null&&(Zn||(he.f&ct)!==0),c=(i.f&Pn)===0;rn(i)&&(l&&(i.f|=ct),Xi(i)),l&&!c&&(Qi(i),_a(i))}if(Ne!=null&&Ne.has(e))return Ne.get(e);if((e.f&nr)!==0)throw e.v;return e.v}function _a(e){if(e.f|=ct,e.deps!==null)for(const t of e.deps)(t.reactions??(t.reactions=[])).push(e),(t.f&Ge)!==0&&(t.f&ct)===0&&(Qi(t),_a(t))}function ka(e){if(e.v===Le)return!0;if(e.deps===null)return!1;for(const t of e.deps)if(sr.has(t)||(t.f&Ge)!==0&&ka(t))return!0;return!1}function Or(e){var t=_t;try{return _t=!0,e()}finally{_t=t}}function gv(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(Rt in e)Lo(e);else if(!Array.isArray(e))for(let t in e){const r=e[t];typeof r=="object"&&r&&Rt in r&&Lo(r)}}}function Lo(e,t=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!t.has(e)){t.add(e),e instanceof Date&&e.getTime();for(let n in e)try{Lo(e[n],t)}catch{}const r=rs(e);if(r!==Object.prototype&&r!==Array.prototype&&r!==Map.prototype&&r!==Set.prototype&&r!==Date.prototype){const n=Oi(r);for(let o in n){const s=n[o].get;if(s)try{s.call(e)}catch{}}}}}const wr=Symbol("events"),Sa=new Set,$o=new Set;function Ca(e,t,r,n={}){function o(s){if(n.capture||jo.call(t,s),!s.cancelBubble)return lo(()=>r==null?void 0:r.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Pt(()=>{t.addEventListener(e,o,n)}):t.addEventListener(e,o,n),o}function $n(e,t,r,n,o){var s={capture:n,passive:o},i=Ca(e,t,r,s);(t===document.body||t===window||t===document||t instanceof HTMLMediaElement)&&us(()=>{t.removeEventListener(e,i,s)})}function fe(e,t,r){(t[wr]??(t[wr]={}))[e]=r}function ht(e){for(var t=0;t<e.length;t++)Sa.add(e[t]);for(var r of $o)r(e)}let Zs=null;function jo(e){var v,b;var t=this,r=t.ownerDocument,n=e.type,o=((v=e.composedPath)==null?void 0:v.call(e))||[],s=o[0]||e.target;Zs=e;var i=0,a=Zs===e&&e[wr];if(a){var l=o.indexOf(a);if(l!==-1&&(t===document||t===window)){e[wr]=t;return}var c=o.indexOf(t);if(c===-1)return;l<=c&&(i=l)}if(s=o[i]||e.target,s!==t){Vl(e,"currentTarget",{configurable:!0,get(){return s||r}});var u=he,p=be;ft(null),pt(null);try{for(var f,m=[];s!==null;){var g=s.assignedSlot||s.parentNode||s.host||null;try{var y=(b=s[wr])==null?void 0:b[n];y!=null&&(!s.disabled||e.target===s)&&y.call(s,e)}catch(C){f?m.push(C):f=C}if(e.cancelBubble||g===t||g===null)break;s=g}if(f){for(let C of m)queueMicrotask(()=>{throw C});throw f}}finally{e[wr]=t,delete e.currentTarget,ft(u),pt(p)}}}var zi;const ho=((zi=globalThis==null?void 0:globalThis.window)==null?void 0:zi.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:e=>e});function Gc(e){return(ho==null?void 0:ho.createHTML(e))??e}function hs(e,t=!1){var r=Pc("template");return e=e.replaceAll("<!>","<!---->"),r.innerHTML=t?Gc(e):e,r.content}function Pr(e,t){var r=be;r.nodes===null&&(r.nodes={start:e,end:t,a:null,t:null})}function B(e,t){var r=(t&Mi)!==0,n=(t&Gl)!==0,o,s=!e.startsWith("<!>");return()=>{o===void 0&&(o=hs(s?e:"<!>"+e,!0),r||(o=st(o)));var i=n||ra?document.importNode(o,!0):o.cloneNode(!0);if(r){var a=st(i),l=i.lastChild;Pr(a,l)}else Pr(i,i);return i}}function Dc(e,t,r="svg"){var n=!e.startsWith("<!>"),o=(t&Mi)!==0,s=`<${r}>${n?e:"<!>"+e}</${r}>`,i;return()=>{if(!i){var a=hs(s,!0),l=st(a);if(o)for(i=document.createDocumentFragment();st(l);)i.appendChild(st(l));else i=st(l)}var c=i.cloneNode(!0);if(o){var u=st(c),p=c.lastChild;Pr(u,p)}else Pr(c,c);return c}}function Ta(e,t){return Dc(e,t,"svg")}function je(e=""){{var t=Wt(e+"");return Pr(t,t),t}}function ir(){var e=document.createDocumentFragment(),t=document.createComment(""),r=Wt();return e.append(t,r),Pr(t,r),e}function E(e,t){e!==null&&e.before(t)}function qc(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const Vc=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Fc(e){return Vc.includes(e)}const Hc={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Uc(e){return e=e.toLowerCase(),Hc[e]??e}const Wc=["touchstart","touchmove"];function Zc(e){return Wc.includes(e)}function oe(e,t){var r=t==null?"":typeof t=="object"?t+"":t;r!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=r,e.nodeValue=r+"")}function Kc(e,t){return Yc(e,t)}const Bn=new Map;function Yc(e,{target:t,anchor:r,props:n={},events:o,context:s,intro:i=!0}){zc();var a=void 0,l=Lc(()=>{var c=r??t.appendChild(Wt());mc(c,{pending:()=>{}},f=>{Fe({});var m=Te;s&&(m.c=s),o&&(n.$$events=o),a=e(f,n)||{},He()});var u=new Set,p=f=>{for(var m=0;m<f.length;m++){var g=f[m];if(!u.has(g)){u.add(g);var y=Zc(g);for(const C of[t,document]){var v=Bn.get(C);v===void 0&&(v=new Map,Bn.set(C,v));var b=v.get(g);b===void 0?(C.addEventListener(g,jo,{passive:y}),v.set(g,1)):v.set(g,b+1)}}}};return p(so(Sa)),$o.add(p),()=>{var y;for(var f of u)for(const v of[t,document]){var m=Bn.get(v),g=m.get(f);--g==0?(v.removeEventListener(f,jo),m.delete(f),m.size===0&&Bn.delete(v)):m.set(f,g)}$o.delete(p),c!==r&&((y=c.parentNode)==null||y.removeChild(c))}});return Jc.set(a,l),a}let Jc=new WeakMap;var xt,zt,nt,Tr,En,zn,oo;class vs{constructor(t,r=!0){le(this,"anchor");ve(this,xt,new Map);ve(this,zt,new Map);ve(this,nt,new Map);ve(this,Tr,new Set);ve(this,En,!0);ve(this,zn,()=>{var t=de;if(S(this,xt).has(t)){var r=S(this,xt).get(t),n=S(this,zt).get(r);if(n)ps(n),S(this,Tr).delete(r);else{var o=S(this,nt).get(r);o&&(S(this,zt).set(r,o.effect),S(this,nt).delete(r),o.fragment.lastChild.remove(),this.anchor.before(o.fragment),n=o.effect)}for(const[s,i]of S(this,xt)){if(S(this,xt).delete(s),s===t)break;const a=S(this,nt).get(i);a&&(Be(a.effect),S(this,nt).delete(i))}for(const[s,i]of S(this,zt)){if(s===r||S(this,Tr).has(s))continue;const a=()=>{if(Array.from(S(this,xt).values()).includes(s)){var c=document.createDocumentFragment();va(i,c),c.append(Wt()),S(this,nt).set(s,{effect:i,fragment:c})}else Be(i);S(this,Tr).delete(s),S(this,zt).delete(s)};S(this,En)||!n?(S(this,Tr).add(s),Ar(i,a,!1)):a()}}});ve(this,oo,t=>{S(this,xt).delete(t);const r=Array.from(S(this,xt).values());for(const[n,o]of S(this,nt))r.includes(n)||(Be(o.effect),S(this,nt).delete(n))});this.anchor=t,ue(this,En,r)}ensure(t,r){var n=de,o=sa();if(r&&!S(this,zt).has(t)&&!S(this,nt).has(t))if(o){var s=document.createDocumentFragment(),i=Wt();s.append(i),S(this,nt).set(t,{effect:ot(()=>r(i)),fragment:s})}else S(this,zt).set(t,ot(()=>r(this.anchor)));if(S(this,xt).set(n,t),o){for(const[a,l]of S(this,zt))a===t?n.unskip_effect(l):n.skip_effect(l);for(const[a,l]of S(this,nt))a===t?n.unskip_effect(l.effect):n.skip_effect(l.effect);n.oncommit(S(this,zn)),n.ondiscard(S(this,oo))}else S(this,zn).call(this)}}xt=new WeakMap,zt=new WeakMap,nt=new WeakMap,Tr=new WeakMap,En=new WeakMap,zn=new WeakMap,oo=new WeakMap;function Xc(e,t,...r){var n=new vs(e);Ln(()=>{const o=t()??null;n.ensure(o,o&&(s=>o(s,...r)))},ar)}function re(e,t,r=!1){var n=new vs(e),o=r?ar:0;function s(i,a){n.ensure(i,a)}Ln(()=>{var i=!1;t((a,l=0)=>{i=!0,s(l,a)}),i||s(!1,null)},o)}function mn(e,t){return t}function Qc(e,t,r){for(var n=[],o=t.length,s,i=t.length,a=0;a<o;a++){let p=t[a];Ar(p,()=>{if(s){if(s.pending.delete(p),s.done.add(p),s.pending.size===0){var f=e.outrogroups;No(so(s.done)),f.delete(s),f.size===0&&(e.outrogroups=null)}}else i-=1},!1)}if(i===0){var l=n.length===0&&r!==null;if(l){var c=r,u=c.parentNode;Rc(u),u.append(c),e.items.clear()}No(t,!l)}else s={pending:new Set(t),done:new Set},(e.outrogroups??(e.outrogroups=new Set)).add(s)}function No(e,t=!0){for(var r=0;r<e.length;r++)Be(e[r],t)}var Ks;function qt(e,t,r,n,o,s=null){var i=e,a=new Map,l=(t&Ri)!==0;if(l){var c=e;i=c.appendChild(Wt())}var u=null,p=as(()=>{var b=r();return ts(b)?b:b==null?[]:so(b)}),f,m=!0;function g(){v.fallback=u,eu(v,f,i,t,n),u!==null&&(f.length===0?(u.f&Dt)===0?ps(u):(u.f^=Dt,bn(u,null,i)):Ar(u,()=>{u=null}))}var y=Ln(()=>{f=d(p);for(var b=f.length,C=new Set,M=de,_=sa(),z=0;z<b;z+=1){var w=f[z],A=n(w,z),R=m?null:a.get(A);R?(R.v&&Jr(R.v,w),R.i&&Jr(R.i,z),_&&M.unskip_effect(R.e)):(R=tu(a,m?i:Ks??(Ks=Wt()),w,A,z,o,t,r),m||(R.e.f|=Dt),a.set(A,R)),C.add(A)}if(b===0&&s&&!u&&(m?u=ot(()=>s(i)):(u=ot(()=>s(Ks??(Ks=Wt()))),u.f|=Dt)),b>C.size&&Yl(),!m)if(_){for(const[K,te]of a)C.has(K)||M.skip_effect(te.e);M.oncommit(g),M.ondiscard(()=>{})}else g();d(p)}),v={effect:y,items:a,outrogroups:null,fallback:u};m=!1}function un(e){for(;e!==null&&(e.f&kt)===0;)e=e.next;return e}function eu(e,t,r,n,o){var te,ie,F,P,O,U,$,W,T;var s=(n&Ol)!==0,i=t.length,a=e.items,l=un(e.effect.first),c,u=null,p,f=[],m=[],g,y,v,b;if(s)for(b=0;b<i;b+=1)g=t[b],y=o(g,b),v=a.get(y).e,(v.f&Dt)===0&&((ie=(te=v.nodes)==null?void 0:te.a)==null||ie.measure(),(p??(p=new Set)).add(v));for(b=0;b<i;b+=1){if(g=t[b],y=o(g,b),v=a.get(y).e,e.outrogroups!==null)for(const L of e.outrogroups)L.pending.delete(v),L.done.delete(v);if((v.f&Dt)!==0)if(v.f^=Dt,v===l)bn(v,null,r);else{var C=u?u.next:l;v===e.effect.last&&(e.effect.last=v.prev),v.prev&&(v.prev.next=v.next),v.next&&(v.next.prev=v.prev),Jt(e,u,v),Jt(e,v,C),bn(v,C,r),u=v,f=[],m=[],l=un(u.next);continue}if((v.f&it)!==0&&(ps(v),s&&((P=(F=v.nodes)==null?void 0:F.a)==null||P.unfix(),(p??(p=new Set)).delete(v))),v!==l){if(c!==void 0&&c.has(v)){if(f.length<m.length){var M=m[0],_;u=M.prev;var z=f[0],w=f[f.length-1];for(_=0;_<f.length;_+=1)bn(f[_],M,r);for(_=0;_<m.length;_+=1)c.delete(m[_]);Jt(e,z.prev,w.next),Jt(e,u,z),Jt(e,w,M),l=M,u=w,b-=1,f=[],m=[]}else c.delete(v),bn(v,l,r),Jt(e,v.prev,v.next),Jt(e,v,u===null?e.effect.first:u.next),Jt(e,u,v),u=v;continue}for(f=[],m=[];l!==null&&l!==v;)(c??(c=new Set)).add(l),m.push(l),l=un(l.next);if(l===null)continue}(v.f&Dt)===0&&f.push(v),u=v,l=un(v.next)}if(e.outrogroups!==null){for(const L of e.outrogroups)L.pending.size===0&&(No(so(L.done)),(O=e.outrogroups)==null||O.delete(L));e.outrogroups.size===0&&(e.outrogroups=null)}if(l!==null||c!==void 0){var A=[];if(c!==void 0)for(v of c)(v.f&it)===0&&A.push(v);for(;l!==null;)(l.f&it)===0&&l!==e.fallback&&A.push(l),l=un(l.next);var R=A.length;if(R>0){var K=(n&Ri)!==0&&i===0?r:null;if(s){for(b=0;b<R;b+=1)($=(U=A[b].nodes)==null?void 0:U.a)==null||$.measure();for(b=0;b<R;b+=1)(T=(W=A[b].nodes)==null?void 0:W.a)==null||T.fix()}Qc(e,A,K)}}s&&Pt(()=>{var L,q;if(p!==void 0)for(v of p)(q=(L=v.nodes)==null?void 0:L.a)==null||q.apply()})}function tu(e,t,r,n,o,s,i,a){var l=(i&Ml)!==0?(i&Ll)===0?Tc(r,!1,!1):lr(r):null,c=(i&Il)!==0?lr(o):null;return{v:l,i:c,e:ot(()=>(s(t,l??r,c??o,a),()=>{e.delete(n)}))}}function bn(e,t,r){if(e.nodes)for(var n=e.nodes.start,o=e.nodes.end,s=t&&(t.f&Dt)===0?t.nodes.start:r;n!==null;){var i=On(n);if(s.before(n),n===o)return;n=i}}function Jt(e,t,r){t===null?e.effect.first=r:t.next=r,r===null?e.effect.last=t:r.prev=t}function Bo(e,t,r=!1,n=!1,o=!1){var s=e,i="";se(()=>{var a=be;if(i!==(i=t()??"")&&(a.nodes!==null&&(da(a.nodes.start,a.nodes.end),a.nodes=null),i!=="")){var l=i+"";r?l=`<svg>${l}</svg>`:n&&(l=`<math>${l}</math>`);var c=hs(l);if((r||n)&&(c=st(c)),Pr(st(c),c.lastChild),r||n)for(;st(c);)s.before(st(c));else s.before(c)}})}function ru(e,t,r){var n=new vs(e);Ln(()=>{var o=t()??null;n.ensure(o,o&&(s=>r(s,o)))},ar)}function nu(e,t){var r=void 0,n;ca(()=>{r!==(r=t())&&(n&&(Be(n),n=null),r&&(n=ot(()=>{ds(()=>r(e))})))})}function Aa(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Aa(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Ea(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Aa(e))&&(n&&(n+=" "),n+=t);return n}function za(e){return typeof e=="object"?Ea(e):e??""}const Ys=[...`
3
+ \r\f \v\uFEFF`];function ou(e,t,r){var n=e==null?"":""+e;if(t&&(n=n?n+" "+t:t),r){for(var o in r)if(r[o])n=n?n+" "+o:o;else if(n.length)for(var s=o.length,i=0;(i=n.indexOf(o,i))>=0;){var a=i+s;(i===0||Ys.includes(n[i-1]))&&(a===n.length||Ys.includes(n[a]))?n=(i===0?"":n.substring(0,i))+n.substring(a+1):i=a}}return n===""?null:n}function Js(e,t=!1){var r=t?" !important;":";",n="";for(var o in e){var s=e[o];s!=null&&s!==""&&(n+=" "+o+": "+s+r)}return n}function vo(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function su(e,t){if(t){var r="",n,o;if(Array.isArray(t)?(n=t[0],o=t[1]):n=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,i=0,a=!1,l=[];n&&l.push(...Object.keys(n).map(vo)),o&&l.push(...Object.keys(o).map(vo));var c=0,u=-1;const y=e.length;for(var p=0;p<y;p++){var f=e[p];if(a?f==="/"&&e[p-1]==="*"&&(a=!1):s?s===f&&(s=!1):f==="/"&&e[p+1]==="*"?a=!0:f==='"'||f==="'"?s=f:f==="("?i++:f===")"&&i--,!a&&s===!1&&i===0){if(f===":"&&u===-1)u=p;else if(f===";"||p===y-1){if(u!==-1){var m=vo(e.substring(c,u).trim());if(!l.includes(m)){f!==";"&&p++;var g=e.substring(c,p).trim();r+=" "+g+";"}}c=p+1,u=-1}}}}return n&&(r+=Js(n)),o&&(r+=Js(o,!0)),r=r.trim(),r===""?null:r}return e==null?null:String(e)}function Vt(e,t,r,n,o,s){var i=e.__className;if(i!==r||i===void 0){var a=ou(r,n,s);a==null?e.removeAttribute("class"):t?e.className=a:e.setAttribute("class",a),e.__className=r}else if(s&&o!==s)for(var l in s){var c=!!s[l];(o==null||c!==!!o[l])&&e.classList.toggle(l,c)}return s}function go(e,t={},r,n){for(var o in r){var s=r[o];t[o]!==s&&(r[o]==null?e.style.removeProperty(o):e.style.setProperty(o,s,n))}}function er(e,t,r,n){var o=e.__style;if(o!==t){var s=su(t,n);s==null?e.removeAttribute("style"):e.style.cssText=s,e.__style=t}else n&&(Array.isArray(n)?(go(e,r==null?void 0:r[0],n[0]),go(e,r==null?void 0:r[1],n[1],"important")):go(e,r,n));return n}function Go(e,t,r=!1){if(e.multiple){if(t==null)return;if(!ts(t))return ic();for(var n of e.options)n.selected=t.includes(Xs(n));return}for(n of e.options){var o=Xs(n);if(Ec(o,t)){n.selected=!0;return}}(!r||t!==void 0)&&(e.selectedIndex=-1)}function iu(e){var t=new MutationObserver(()=>{Go(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),us(()=>{t.disconnect()})}function Xs(e){return"__value"in e?e.__value:e.value}const dn=Symbol("class"),fn=Symbol("style"),Ra=Symbol("is custom element"),Pa=Symbol("is html"),au=ss?"option":"OPTION",lu=ss?"select":"SELECT",cu=ss?"progress":"PROGRESS";function mv(e,t){var r=ms(e);r.value===(r.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==cu)||(e.value=t??"")}function uu(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Qr(e,t,r,n){var o=ms(e);o[t]!==(o[t]=r)&&(t==="loading"&&(e[Wl]=r),r==null?e.removeAttribute(t):typeof r!="string"&&Ma(e).includes(t)?e[t]=r:e.setAttribute(t,r))}function du(e,t,r,n,o=!1,s=!1){var i=ms(e),a=i[Ra],l=!i[Pa],c=t||{},u=e.nodeName===au;for(var p in t)p in r||(r[p]=null);r.class?r.class=za(r.class):(n||r[dn])&&(r.class=null),r[fn]&&(r.style??(r.style=null));var f=Ma(e);for(const M in r){let _=r[M];if(u&&M==="value"&&_==null){e.value=e.__value="",c[M]=_;continue}if(M==="class"){var m=e.namespaceURI==="http://www.w3.org/1999/xhtml";Vt(e,m,_,n,t==null?void 0:t[dn],r[dn]),c[M]=_,c[dn]=r[dn];continue}if(M==="style"){er(e,_,t==null?void 0:t[fn],r[fn]),c[M]=_,c[fn]=r[fn];continue}var g=c[M];if(!(_===g&&!(_===void 0&&e.hasAttribute(M)))){c[M]=_;var y=M[0]+M[1];if(y!=="$$")if(y==="on"){const z={},w="$$"+M;let A=M.slice(2);var v=Fc(A);if(qc(A)&&(A=A.slice(0,-7),z.capture=!0),!v&&g){if(_!=null)continue;e.removeEventListener(A,c[w],z),c[w]=null}if(v)fe(A,e,_),ht([A]);else if(_!=null){let R=function(K){c[M].call(this,K)};c[w]=Ca(A,e,R,z)}}else if(M==="style")Qr(e,M,_);else if(M==="autofocus")Mc(e,!!_);else if(!a&&(M==="__value"||M==="value"&&_!=null))e.value=e.__value=_;else if(M==="selected"&&u)uu(e,_);else{var b=M;l||(b=Uc(b));var C=b==="defaultValue"||b==="defaultChecked";if(_==null&&!a&&!C)if(i[M]=null,b==="value"||b==="checked"){let z=e;const w=t===void 0;if(b==="value"){let A=z.defaultValue;z.removeAttribute(b),z.defaultValue=A,z.value=z.__value=w?A:null}else{let A=z.defaultChecked;z.removeAttribute(b),z.defaultChecked=A,z.checked=w?A:!1}}else e.removeAttribute(M);else C||f.includes(b)&&(a||typeof _!="string")?(e[b]=_,b in i&&(i[b]=Le)):typeof _!="function"&&Qr(e,b,_)}}}return c}function gs(e,t,r=[],n=[],o=[],s,i=!1,a=!1){Ji(o,r,n,l=>{var c=void 0,u={},p=e.nodeName===lu,f=!1;if(ca(()=>{var g=t(...l.map(d)),y=du(e,c,g,s,i,a);f&&p&&"value"in g&&Go(e,g.value);for(let b of Object.getOwnPropertySymbols(u))g[b]||Be(u[b]);for(let b of Object.getOwnPropertySymbols(g)){var v=g[b];b.description===Dl&&(!c||v!==c[b])&&(u[b]&&Be(u[b]),u[b]=ot(()=>nu(e,()=>v))),y[b]=v}c=y}),p){var m=e;ds(()=>{Go(m,c.value,!0),iu(m)})}f=!0})}function ms(e){return e.__attributes??(e.__attributes={[Ra]:e.nodeName.includes("-"),[Pa]:e.namespaceURI===Ii})}var Qs=new Map;function Ma(e){var t=e.getAttribute("is")||e.nodeName,r=Qs.get(t);if(r)return r;Qs.set(t,r=[]);for(var n,o=e,s=Element.prototype;s!==o;){n=Oi(o);for(var i in n)n[i].set&&r.push(i);o=rs(o)}return r}function Jn(e,t,r=t){var n=new WeakSet;ia(e,"input",async o=>{var s=o?e.defaultValue:e.value;if(s=mo(e)?bo(s):s,r(s),de!==null&&n.add(de),await wa(),s!==(s=t())){var i=e.selectionStart,a=e.selectionEnd,l=e.value.length;if(e.value=s??"",a!==null){var c=e.value.length;i===a&&a===l&&c>l?(e.selectionStart=c,e.selectionEnd=c):(e.selectionStart=i,e.selectionEnd=Math.min(a,c))}}}),Or(t)==null&&e.value&&(r(mo(e)?bo(e.value):e.value),de!==null&&n.add(de)),tn(()=>{var o=t();if(e===document.activeElement){var s=Ao??de;if(n.has(s))return}mo(e)&&o===bo(e.value)||e.type==="date"&&!o&&!e.value||o!==e.value&&(e.value=o??"")})}function Do(e,t,r=t){ia(e,"change",n=>{var o=n?e.defaultChecked:e.checked;r(o)}),Or(t)==null&&r(e.checked),tn(()=>{var n=t();e.checked=!!n})}function mo(e){var t=e.type;return t==="number"||t==="range"}function bo(e){return e===""?null:+e}function ei(e,t){return e===t||(e==null?void 0:e[Rt])===t}function fu(e={},t,r,n){return ds(()=>{var o,s;return tn(()=>{o=s,s=[],Or(()=>{e!==r(...s)&&(t(e,...s),o&&ei(r(...o),e)&&t(null,...o))})}),()=>{Pt(()=>{s&&ei(r(...s),e)&&t(null,...s)})}}),e}let Gn=!1;function pu(e){var t=Gn;try{return Gn=!1,[e(),Gn]}finally{Gn=t}}const hu={get(e,t){if(!e.exclude.includes(t))return e.props[t]},set(e,t){return!1},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function bs(e,t,r){return new Proxy({props:e,exclude:t},hu)}const vu={get(e,t){if(!e.exclude.includes(t))return d(e.version),t in e.special?e.special[t]():e.props[t]},set(e,t,r){if(!(t in e.special)){var n=be;try{pt(e.parent_effect),e.special[t]=at({get[t](){return e.props[t]}},t,Pi)}finally{pt(n)}}return e.special[t](r),qs(e.version),!0},getOwnPropertyDescriptor(e,t){if(!e.exclude.includes(t)&&t in e.props)return{enumerable:!0,configurable:!0,value:e.props[t]}},deleteProperty(e,t){return e.exclude.includes(t)||(e.exclude.push(t),qs(e.version)),!0},has(e,t){return e.exclude.includes(t)?!1:t in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(t=>!e.exclude.includes(t))}};function bv(e,t){return new Proxy({props:e,exclude:t,special:{},version:lr(0),parent_effect:be},vu)}const gu={get(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(cn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n)return n[t]}},set(e,t,r){let n=e.props.length;for(;n--;){let o=e.props[n];cn(o)&&(o=o());const s=rr(o,t);if(s&&s.set)return s.set(r),!0}return!1},getOwnPropertyDescriptor(e,t){let r=e.props.length;for(;r--;){let n=e.props[r];if(cn(n)&&(n=n()),typeof n=="object"&&n!==null&&t in n){const o=rr(n,t);return o&&!o.configurable&&(o.configurable=!0),o}}},has(e,t){if(t===Rt||t===Ni)return!1;for(let r of e.props)if(cn(r)&&(r=r()),r!=null&&t in r)return!0;return!1},ownKeys(e){const t=[];for(let r of e.props)if(cn(r)&&(r=r()),!!r){for(const n in r)t.includes(n)||t.push(n);for(const n of Object.getOwnPropertySymbols(r))t.includes(n)||t.push(n)}return t}};function xv(...e){return new Proxy({props:e},gu)}function at(e,t,r,n){var M;var o=!Mn||(r&jl)!==0,s=(r&Nl)!==0,i=(r&Bl)!==0,a=n,l=!0,c=()=>(l&&(l=!1,a=i?Or(n):n),a),u;if(s){var p=Rt in e||Ni in e;u=((M=rr(e,t))==null?void 0:M.set)??(p&&t in e?_=>e[t]=_:void 0)}var f,m=!1;s?[f,m]=pu(()=>e[t]):f=e[t],f===void 0&&n!==void 0&&(f=c(),u&&(o&&tc(),u(f)));var g;if(o?g=()=>{var _=e[t];return _===void 0?c():(l=!0,_)}:g=()=>{var _=e[t];return _!==void 0&&(a=void 0),_===void 0?a:_},o&&(r&Pi)===0)return g;if(u){var y=e.$$legacy;return(function(_,z){return arguments.length>0?((!o||!z||y||m)&&u(z?g():_),_):g()})}var v=!1,b=((r&$l)!==0?ao:as)(()=>(v=!1,g()));s&&d(b);var C=be;return(function(_,z){if(arguments.length>0){const w=z?d(b):o&&s?wt(_):_;return h(b,w),v=!0,a!==void 0&&(a=w),_}return cr&&v||(C.f&Ut)!==0?b.v:d(b)})}var mu=B('<button type="button" class="fixed inset-0 z-40" aria-label="Close menu" tabindex="-1"></button> <div class="absolute top-full left-0 mt-1 w-48 bg-card border border-border rounded-md shadow-lg z-50 py-1"><button class="w-full text-left px-3 py-1.5 text-xs hover:bg-secondary transition-colors flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg> Server config</button> <button class="w-full text-left px-3 py-1.5 text-xs hover:bg-secondary transition-colors flex items-center gap-2"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z"></path><circle cx="16.5" cy="7.5" r=".5" fill="currentColor"></circle></svg> Keys & tokens</button></div>',1),bu=B('<div class="relative"><button class="flex items-center gap-1.5 font-semibold text-sm truncate hover:text-primary transition-colors" title="Server settings"><span class="truncate"> </span> <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="shrink-0 text-muted-foreground"><path d="m6 9 6 6 6-6"></path></svg></button> <!></div>');function xu(e,t){let r=D(!1);function n(){h(r,!d(r))}function o(f){h(r,!1),f()}function s(){h(r,!1)}var i=bu(),a=x(i),l=x(a),c=x(l),u=k(a,2);{var p=f=>{var m=mu(),g=Ce(m),y=k(g,2),v=x(y),b=k(v,2);fe("click",g,s),fe("click",v,()=>o(t.onServerConfig)),fe("click",b,()=>o(t.onKeysAndTokens)),E(f,m)};re(u,f=>{d(r)&&f(p)})}se(()=>oe(c,t.serverName)),fe("click",a,n),E(e,i)}ht(["click"]);var yu=B('<span class="font-semibold text-sm truncate"> </span>'),wu=B('<button class="p-1.5 rounded hover:bg-secondary transition-colors md:hidden" aria-label="Close sidebar"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg></button>'),_u=Ta('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground/40 shrink-0"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>'),ku=B('<button><span class="text-muted-foreground/60 shrink-0">#</span> <span class="truncate flex-1"> </span> <!></button>'),Su=B('<div class="px-3 py-4 text-xs text-muted-foreground/60 text-center">No channels yet</div>'),Cu=B('<button class="w-full text-left px-3 py-1.5 flex items-center gap-2 text-sm text-muted-foreground/50 hover:text-muted-foreground hover:bg-secondary/50 transition-colors"><span class="shrink-0">+</span> <span>Create channel</span></button>'),Tu=B('<span class="text-muted-foreground/30">WS</span>'),Au=B('<span class="text-muted-foreground/30"> </span>'),Eu=B('<div class="flex flex-col h-full w-full bg-[oklch(0.13_0_0)] border-r border-border"><div class="flex items-center justify-between px-3 h-12 border-b border-border shrink-0"><!> <!></div> <div class="flex-1 overflow-y-auto py-2"><div class="px-3 mb-1 text-[10px] font-semibold text-muted-foreground uppercase tracking-wider">Channels</div> <!> <!> <!></div> <button class="border-t border-border px-3 h-12 flex items-center gap-2 w-full hover:bg-secondary/50 transition-colors shrink-0"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="8" r="5"></circle><path d="M20 21a8 8 0 0 0-16 0"></path></svg> <span> </span></button> <div class="border-t border-border px-3 py-2 flex items-center justify-between text-[10px] text-muted-foreground/50"><div class="flex items-center gap-1.5"><span></span> <span> </span> <!></div> <a href="https://zooid.dev" class="underline hover:text-muted-foreground/70">Zooid</a></div></div>');function ti(e,t){Fe(t,!0);const r={connected:"bg-primary",polling:"bg-primary",reconnecting:"bg-yellow-500",error:"bg-destructive",idle:"bg-muted-foreground",loading:"bg-muted-foreground"},n={connected:"Connected",polling:"Connected",reconnecting:"Reconnecting...",error:"Error",idle:"Idle",loading:"Loading..."};var o=Eu(),s=x(o),i=x(s);{var a=P=>{xu(P,{get serverName(){return t.serverName},get onServerConfig(){return t.onServerConfig},get onKeysAndTokens(){return t.onKeysAndTokens}})},l=P=>{var O=yu(),U=x(O);se(()=>oe(U,t.serverName)),E(P,O)};re(i,P=>{t.isAdmin?P(a):P(l,!1)})}var c=k(i,2);{var u=P=>{var O=wu();fe("click",O,function(...U){var $;($=t.onClose)==null||$.apply(this,U)}),E(P,O)};re(c,P=>{t.onClose&&P(u)})}var p=k(s,2),f=k(x(p),2);qt(f,17,()=>t.channels,P=>P.id,(P,O)=>{var U=ku(),$=k(x(U),2),W=x($),T=k($,2);{var L=q=>{var H=_u();E(q,H)};re(T,q=>{d(O).is_public||q(L)})}se(()=>{Vt(U,1,`w-full text-left px-3 py-1.5 flex items-center gap-2 text-sm transition-colors
4
+ ${t.selectedId===d(O).id?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground hover:bg-secondary/50"}`),oe(W,d(O).name)}),fe("click",U,()=>t.onSelect(d(O).id)),E(P,U)});var m=k(f,2);{var g=P=>{var O=Su();E(P,O)};re(m,P=>{t.channels.length===0&&!t.isAdmin&&P(g)})}var y=k(m,2);{var v=P=>{var O=Cu();fe("click",O,function(...U){var $;($=t.onCreateChannel)==null||$.apply(this,U)}),E(P,O)};re(y,P=>{t.isAdmin&&P(v)})}var b=k(p,2),C=x(b),M=k(C,2),_=x(M),z=k(b,2),w=x(z),A=x(w),R=k(A,2),K=x(R),te=k(R,2);{var ie=P=>{var O=Tu();E(P,O)},F=P=>{var O=Au(),U=x(O);se(()=>oe(U,`${t.pollInterval??""}s`)),E(P,O)};re(te,P=>{t.status==="connected"?P(ie):t.status==="polling"&&P(F,1)})}se(()=>{Qr(b,"title",t.hasAuth?"Authenticated":"Sign in"),Vt(C,0,za(t.hasAuth?"text-primary":"text-muted-foreground")),Vt(M,1,`text-xs ${t.hasAuth?"text-foreground":"text-muted-foreground"}`),oe(_,t.hasAuth?"Signed in":"Sign in"),Vt(A,1,`inline-block w-1.5 h-1.5 rounded-full ${r[t.status]}`),oe(K,n[t.status])}),fe("click",b,function(...P){var O;(O=t.onAuthClick)==null||O.apply(this,P)}),E(e,o),He()}ht(["click"]);var ri=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Ze=e=>!e||typeof e!="object"||Object.keys(e).length===0,zu=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Ia(e,t){e.forEach(function(r){Array.isArray(r)?Ia(r,t):t.push(r)})}function Oa(e){let t=[];return Ia(e,t),t}var La=(...e)=>Oa(e).filter(Boolean),$a=(e,t)=>{let r={},n=Object.keys(e),o=Object.keys(t);for(let s of n)if(o.includes(s)){let i=e[s],a=t[s];Array.isArray(i)||Array.isArray(a)?r[s]=La(a,i):typeof i=="object"&&typeof a=="object"?r[s]=$a(i,a):r[s]=a+" "+i}else r[s]=e[s];for(let s of o)n.includes(s)||(r[s]=t[s]);return r},ni=e=>!e||typeof e!="string"?e:e.replace(/\s+/g," ").trim();const xs="-",Ru=e=>{const t=Mu(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{const a=i.split(xs);return a[0]===""&&a.length!==1&&a.shift(),ja(a,t)||Pu(i)},getConflictingClassGroupIds:(i,a)=>{const l=r[i]||[];return a&&n[i]?[...l,...n[i]]:l}}},ja=(e,t)=>{var i;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?ja(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const s=e.join(xs);return(i=t.validators.find(({validator:a})=>a(s)))==null?void 0:i.classGroupId},oi=/^\[(.+)\]$/,Pu=e=>{if(oi.test(e)){const t=oi.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Mu=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const o in r)qo(r[o],n,o,t);return n},qo=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const s=o===""?t:si(t,o);s.classGroupId=r;return}if(typeof o=="function"){if(Iu(o)){qo(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([s,i])=>{qo(i,si(t,s),r,n)})})},si=(e,t)=>{let r=e;return t.split(xs).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Iu=e=>e.isThemeGetter,Ou=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(s,i)=>{r.set(s,i),t++,t>e&&(t=0,n=r,r=new Map)};return{get(s){let i=r.get(s);if(i!==void 0)return i;if((i=n.get(s))!==void 0)return o(s,i),i},set(s,i){r.has(s)?r.set(s,i):o(s,i)}}},Vo="!",Fo=":",Lu=Fo.length,$u=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,a=0,l=0,c;for(let g=0;g<o.length;g++){let y=o[g];if(i===0&&a===0){if(y===Fo){s.push(o.slice(l,g)),l=g+Lu;continue}if(y==="/"){c=g;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const u=s.length===0?o:o.substring(l),p=ju(u),f=p!==u,m=c&&c>l?c-l:void 0;return{modifiers:s,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const o=t+Fo,s=n;n=i=>i.startsWith(o)?s(i.substring(o.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},ju=e=>e.endsWith(Vo)?e.substring(0,e.length-1):e.startsWith(Vo)?e.substring(1):e,Nu=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const o=[];let s=[];return n.forEach(i=>{i[0]==="["||t[i]?(o.push(...s.sort(),i),s=[]):s.push(i)}),o.push(...s.sort()),o}},Bu=e=>({cache:Ou(e.cacheSize),parseClassName:$u(e),sortModifiers:Nu(e),...Ru(e)}),Gu=/\s+/,Du=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Gu);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:p,modifiers:f,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}=r(u);if(p){l=u+(l.length>0?" "+l:l);continue}let v=!!y,b=n(v?g.substring(0,y):g);if(!b){if(!v){l=u+(l.length>0?" "+l:l);continue}if(b=n(g),!b){l=u+(l.length>0?" "+l:l);continue}v=!1}const C=s(f).join(":"),M=m?C+Vo:C,_=M+b;if(i.includes(_))continue;i.push(_);const z=o(b,v);for(let w=0;w<z.length;++w){const A=z[w];i.push(M+A)}l=u+(l.length>0?" "+l:l)}return l};function qu(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=Na(t))&&(n&&(n+=" "),n+=r);return n}const Na=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Na(e[n]))&&(r&&(r+=" "),r+=t);return r};function Ho(e,...t){let r,n,o,s=i;function i(l){const c=t.reduce((u,p)=>p(u),e());return r=Bu(c),n=r.cache.get,o=r.cache.set,s=a,a(l)}function a(l){const c=n(l);if(c)return c;const u=Du(l,r);return o(l,u),u}return function(){return s(qu.apply(null,arguments))}}const Oe=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},Ba=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Ga=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Vu=/^\d+\/\d+$/,Fu=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Hu=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Uu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,Wu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Br=e=>Vu.test(e),pe=e=>!!e&&!Number.isNaN(Number(e)),hr=e=>!!e&&Number.isInteger(Number(e)),ii=e=>e.endsWith("%")&&pe(e.slice(0,-1)),Xt=e=>Fu.test(e),Ku=()=>!0,Yu=e=>Hu.test(e)&&!Uu.test(e),ys=()=>!1,Ju=e=>Wu.test(e),Xu=e=>Zu.test(e),Qu=e=>!Y(e)&&!J(e),ed=e=>nn(e,Va,ys),Y=e=>Ba.test(e),vr=e=>nn(e,Fa,Yu),xo=e=>nn(e,dd,pe),td=e=>nn(e,Da,ys),rd=e=>nn(e,qa,Xu),nd=e=>nn(e,ys,Ju),J=e=>Ga.test(e),Dn=e=>on(e,Fa),od=e=>on(e,fd),sd=e=>on(e,Da),id=e=>on(e,Va),ad=e=>on(e,qa),ld=e=>on(e,pd,!0),nn=(e,t,r)=>{const n=Ba.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},on=(e,t,r=!1)=>{const n=Ga.exec(e);return n?n[1]?t(n[1]):r:!1},Da=e=>e==="position",cd=new Set(["image","url"]),qa=e=>cd.has(e),ud=new Set(["length","size","percentage"]),Va=e=>ud.has(e),Fa=e=>e==="length",dd=e=>e==="number",fd=e=>e==="family-name",pd=e=>e==="shadow",Uo=()=>{const e=Oe("color"),t=Oe("font"),r=Oe("text"),n=Oe("font-weight"),o=Oe("tracking"),s=Oe("leading"),i=Oe("breakpoint"),a=Oe("container"),l=Oe("spacing"),c=Oe("radius"),u=Oe("shadow"),p=Oe("inset-shadow"),f=Oe("drop-shadow"),m=Oe("blur"),g=Oe("perspective"),y=Oe("aspect"),v=Oe("ease"),b=Oe("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],_=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],w=()=>[J,Y,l],A=()=>[Br,"full","auto",...w()],R=()=>[hr,"none","subgrid",J,Y],K=()=>["auto",{span:["full",hr,J,Y]},J,Y],te=()=>[hr,"auto",J,Y],ie=()=>["auto","min","max","fr",J,Y],F=()=>["start","end","center","between","around","evenly","stretch","baseline"],P=()=>["start","end","center","stretch"],O=()=>["auto",...w()],U=()=>[Br,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...w()],$=()=>[e,J,Y],W=()=>[ii,vr],T=()=>["","none","full",c,J,Y],L=()=>["",pe,Dn,vr],q=()=>["solid","dashed","dotted","double"],H=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["","none",m,J,Y],ee=()=>["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",J,Y],Z=()=>["none",pe,J,Y],I=()=>["none",pe,J,Y],N=()=>[pe,J,Y],j=()=>[Br,"full",...w()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Xt],breakpoint:[Xt],color:[Ku],container:[Xt],"drop-shadow":[Xt],ease:["in","out","in-out"],font:[Qu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Xt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Xt],shadow:[Xt],spacing:["px",pe],text:[Xt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Br,Y,J,y]}],container:["container"],columns:[{columns:[pe,Y,J,a]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...M(),Y,J]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[hr,"auto",J,Y]}],basis:[{basis:[Br,"full","auto",a,...w()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pe,Br,"auto","initial","none",Y]}],grow:[{grow:["",pe,J,Y]}],shrink:[{shrink:["",pe,J,Y]}],order:[{order:[hr,"first","last","none",J,Y]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":te()}],"col-end":[{"col-end":te()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":te()}],"row-end":[{"row-end":te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ie()}],"auto-rows":[{"auto-rows":ie()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...P(),"normal"]}],"justify-self":[{"justify-self":["auto",...P()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...P(),"baseline"]}],"align-self":[{self:["auto",...P(),"baseline"]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...P(),"baseline"]}],"place-self":[{"place-self":["auto",...P()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:O()}],mx:[{mx:O()}],my:[{my:O()}],ms:[{ms:O()}],me:[{me:O()}],mt:[{mt:O()}],mr:[{mr:O()}],mb:[{mb:O()}],ml:[{ml:O()}],"space-x":[{"space-x":w()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":w()}],"space-y-reverse":["space-y-reverse"],size:[{size:U()}],w:[{w:[a,"screen",...U()]}],"min-w":[{"min-w":[a,"screen","none",...U()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...U()]}],h:[{h:["screen",...U()]}],"min-h":[{"min-h":["screen","none",...U()]}],"max-h":[{"max-h":["screen",...U()]}],"font-size":[{text:["base",r,Dn,vr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,J,xo]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ii,Y]}],"font-family":[{font:[od,Y,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,J,Y]}],"line-clamp":[{"line-clamp":[pe,"none",J,xo]}],leading:[{leading:[s,...w()]}],"list-image":[{"list-image":["none",J,Y]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",J,Y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:$()}],"text-color":[{text:$()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...q(),"wavy"]}],"text-decoration-thickness":[{decoration:[pe,"from-font","auto",J,vr]}],"text-decoration-color":[{decoration:$()}],"underline-offset":[{"underline-offset":[pe,"auto",J,Y]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:w()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",J,Y]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",J,Y]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),sd,td]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:["auto","cover","contain",id,ed]}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},hr,J,Y],radial:["",J,Y],conic:[hr,J,Y]},ad,rd]}],"bg-color":[{bg:$()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:$()}],"gradient-via":[{via:$()}],"gradient-to":[{to:$()}],rounded:[{rounded:T()}],"rounded-s":[{"rounded-s":T()}],"rounded-e":[{"rounded-e":T()}],"rounded-t":[{"rounded-t":T()}],"rounded-r":[{"rounded-r":T()}],"rounded-b":[{"rounded-b":T()}],"rounded-l":[{"rounded-l":T()}],"rounded-ss":[{"rounded-ss":T()}],"rounded-se":[{"rounded-se":T()}],"rounded-ee":[{"rounded-ee":T()}],"rounded-es":[{"rounded-es":T()}],"rounded-tl":[{"rounded-tl":T()}],"rounded-tr":[{"rounded-tr":T()}],"rounded-br":[{"rounded-br":T()}],"rounded-bl":[{"rounded-bl":T()}],"border-w":[{border:L()}],"border-w-x":[{"border-x":L()}],"border-w-y":[{"border-y":L()}],"border-w-s":[{"border-s":L()}],"border-w-e":[{"border-e":L()}],"border-w-t":[{"border-t":L()}],"border-w-r":[{"border-r":L()}],"border-w-b":[{"border-b":L()}],"border-w-l":[{"border-l":L()}],"divide-x":[{"divide-x":L()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":L()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...q(),"hidden","none"]}],"divide-style":[{divide:[...q(),"hidden","none"]}],"border-color":[{border:$()}],"border-color-x":[{"border-x":$()}],"border-color-y":[{"border-y":$()}],"border-color-s":[{"border-s":$()}],"border-color-e":[{"border-e":$()}],"border-color-t":[{"border-t":$()}],"border-color-r":[{"border-r":$()}],"border-color-b":[{"border-b":$()}],"border-color-l":[{"border-l":$()}],"divide-color":[{divide:$()}],"outline-style":[{outline:[...q(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pe,J,Y]}],"outline-w":[{outline:["",pe,Dn,vr]}],"outline-color":[{outline:[e]}],shadow:[{shadow:["","none",u,ld,nd]}],"shadow-color":[{shadow:$()}],"inset-shadow":[{"inset-shadow":["none",J,Y,p]}],"inset-shadow-color":[{"inset-shadow":$()}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:$()}],"ring-offset-w":[{"ring-offset":[pe,vr]}],"ring-offset-color":[{"ring-offset":$()}],"inset-ring-w":[{"inset-ring":L()}],"inset-ring-color":[{"inset-ring":$()}],opacity:[{opacity:[pe,J,Y]}],"mix-blend":[{"mix-blend":[...H(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":H()}],filter:[{filter:["","none",J,Y]}],blur:[{blur:G()}],brightness:[{brightness:[pe,J,Y]}],contrast:[{contrast:[pe,J,Y]}],"drop-shadow":[{"drop-shadow":["","none",f,J,Y]}],grayscale:[{grayscale:["",pe,J,Y]}],"hue-rotate":[{"hue-rotate":[pe,J,Y]}],invert:[{invert:["",pe,J,Y]}],saturate:[{saturate:[pe,J,Y]}],sepia:[{sepia:["",pe,J,Y]}],"backdrop-filter":[{"backdrop-filter":["","none",J,Y]}],"backdrop-blur":[{"backdrop-blur":G()}],"backdrop-brightness":[{"backdrop-brightness":[pe,J,Y]}],"backdrop-contrast":[{"backdrop-contrast":[pe,J,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pe,J,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pe,J,Y]}],"backdrop-invert":[{"backdrop-invert":["",pe,J,Y]}],"backdrop-opacity":[{"backdrop-opacity":[pe,J,Y]}],"backdrop-saturate":[{"backdrop-saturate":[pe,J,Y]}],"backdrop-sepia":[{"backdrop-sepia":["",pe,J,Y]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",J,Y]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pe,"initial",J,Y]}],ease:[{ease:["linear","initial",v,J,Y]}],delay:[{delay:[pe,J,Y]}],animate:[{animate:["none",b,J,Y]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,J,Y]}],"perspective-origin":[{"perspective-origin":ee()}],rotate:[{rotate:Z()}],"rotate-x":[{"rotate-x":Z()}],"rotate-y":[{"rotate-y":Z()}],"rotate-z":[{"rotate-z":Z()}],scale:[{scale:I()}],"scale-x":[{"scale-x":I()}],"scale-y":[{"scale-y":I()}],"scale-z":[{"scale-z":I()}],"scale-3d":["scale-3d"],skew:[{skew:N()}],"skew-x":[{"skew-x":N()}],"skew-y":[{"skew-y":N()}],transform:[{transform:[J,Y,"","none","gpu","cpu"]}],"transform-origin":[{origin:ee()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:j()}],"translate-x":[{"translate-x":j()}],"translate-y":[{"translate-y":j()}],"translate-z":[{"translate-z":j()}],"translate-none":["translate-none"],accent:[{accent:$()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:$()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",J,Y]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",J,Y]}],fill:[{fill:["none",...$()]}],"stroke-w":[{stroke:[pe,Dn,vr,xo]}],stroke:[{stroke:["none",...$()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["before","after","placeholder","file","marker","selection","first-line","first-letter","backdrop","*","**"]}},hd=(e,{cacheSize:t,prefix:r,experimentalParseClassName:n,extend:o={},override:s={}})=>(xn(e,"cacheSize",t),xn(e,"prefix",r),xn(e,"experimentalParseClassName",n),qn(e.theme,s.theme),qn(e.classGroups,s.classGroups),qn(e.conflictingClassGroups,s.conflictingClassGroups),qn(e.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),xn(e,"orderSensitiveModifiers",s.orderSensitiveModifiers),Vn(e.theme,o.theme),Vn(e.classGroups,o.classGroups),Vn(e.conflictingClassGroups,o.conflictingClassGroups),Vn(e.conflictingClassGroupModifiers,o.conflictingClassGroupModifiers),Ha(e,o,"orderSensitiveModifiers"),e),xn=(e,t,r)=>{r!==void 0&&(e[t]=r)},qn=(e,t)=>{if(t)for(const r in t)xn(e,r,t[r])},Vn=(e,t)=>{if(t)for(const r in t)Ha(e,t,r)},Ha=(e,t,r)=>{const n=t[r];n!==void 0&&(e[r]=e[r]?e[r].concat(n):n)},vd=(e,...t)=>typeof e=="function"?Ho(Uo,e,...t):Ho(()=>hd(Uo(),e),...t),gd=Ho(Uo);var md={twMerge:!0,twMergeConfig:{},responsiveVariants:!1},Ua=e=>e||void 0,Cn=(...e)=>Ua(Oa(e).filter(Boolean).join(" ")),yo=null,$t={},Wo=!1,pn=(...e)=>t=>t.twMerge?((!yo||Wo)&&(Wo=!1,yo=Ze($t)?gd:vd({...$t,extend:{theme:$t.theme,classGroups:$t.classGroups,conflictingClassGroupModifiers:$t.conflictingClassGroupModifiers,conflictingClassGroups:$t.conflictingClassGroups,...$t.extend}})),Ua(yo(Cn(e)))):Cn(e),ai=(e,t)=>{for(let r in t)e.hasOwnProperty(r)?e[r]=Cn(e[r],t[r]):e[r]=t[r];return e},Wa=(e,t)=>{let{extend:r=null,slots:n={},variants:o={},compoundVariants:s=[],compoundSlots:i=[],defaultVariants:a={}}=e,l={...md,...t},c=r!=null&&r.base?Cn(r.base,e==null?void 0:e.base):e==null?void 0:e.base,u=r!=null&&r.variants&&!Ze(r.variants)?$a(o,r.variants):o,p=r!=null&&r.defaultVariants&&!Ze(r.defaultVariants)?{...r.defaultVariants,...a}:a;!Ze(l.twMergeConfig)&&!zu(l.twMergeConfig,$t)&&(Wo=!0,$t=l.twMergeConfig);let f=Ze(r==null?void 0:r.slots),m=Ze(n)?{}:{base:Cn(e==null?void 0:e.base,f&&(r==null?void 0:r.base)),...n},g=f?m:ai({...r==null?void 0:r.slots},Ze(m)?{base:e==null?void 0:e.base}:m),y=Ze(r==null?void 0:r.compoundVariants)?s:La(r==null?void 0:r.compoundVariants,s),v=C=>{if(Ze(u)&&Ze(n)&&f)return pn(c,C==null?void 0:C.class,C==null?void 0:C.className)(l);if(y&&!Array.isArray(y))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof y}`);if(i&&!Array.isArray(i))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof i}`);let M=(F,P,O=[],U)=>{let $=O;if(typeof P=="string")$=$.concat(ni(P).split(" ").map(W=>`${F}:${W}`));else if(Array.isArray(P))$=$.concat(P.reduce((W,T)=>W.concat(`${F}:${T}`),[]));else if(typeof P=="object"&&typeof U=="string"){for(let W in P)if(P.hasOwnProperty(W)&&W===U){let T=P[W];if(T&&typeof T=="string"){let L=ni(T);$[U]?$[U]=$[U].concat(L.split(" ").map(q=>`${F}:${q}`)):$[U]=L.split(" ").map(q=>`${F}:${q}`)}else Array.isArray(T)&&T.length>0&&($[U]=T.reduce((L,q)=>L.concat(`${F}:${q}`),[]))}}return $},_=(F,P=u,O=null,U=null)=>{var $;let W=P[F];if(!W||Ze(W))return null;let T=($=U==null?void 0:U[F])!=null?$:C==null?void 0:C[F];if(T===null)return null;let L=ri(T),q=Array.isArray(l.responsiveVariants)&&l.responsiveVariants.length>0||l.responsiveVariants===!0,H=p==null?void 0:p[F],G=[];if(typeof L=="object"&&q)for(let[I,N]of Object.entries(L)){let j=W[N];if(I==="initial"){H=N;continue}Array.isArray(l.responsiveVariants)&&!l.responsiveVariants.includes(I)||(G=M(I,j,G,O))}let ee=L!=null&&typeof L!="object"?L:ri(H),Z=W[ee||"false"];return typeof G=="object"&&typeof O=="string"&&G[O]?ai(G,Z):G.length>0?(G.push(Z),O==="base"?G.join(" "):G):Z},z=()=>u?Object.keys(u).map(F=>_(F,u)):null,w=(F,P)=>{if(!u||typeof u!="object")return null;let O=new Array;for(let U in u){let $=_(U,u,F,P),W=F==="base"&&typeof $=="string"?$:$&&$[F];W&&(O[O.length]=W)}return O},A={};for(let F in C)C[F]!==void 0&&(A[F]=C[F]);let R=(F,P)=>{var O;let U=typeof(C==null?void 0:C[F])=="object"?{[F]:(O=C[F])==null?void 0:O.initial}:{};return{...p,...A,...U,...P}},K=(F=[],P)=>{let O=[];for(let{class:U,className:$,...W}of F){let T=!0;for(let[L,q]of Object.entries(W)){let H=R(L,P)[L];if(Array.isArray(q)){if(!q.includes(H)){T=!1;break}}else{let G=ee=>ee==null||ee===!1;if(G(q)&&G(H))continue;if(H!==q){T=!1;break}}}T&&(U&&O.push(U),$&&O.push($))}return O},te=F=>{let P=K(y,F);if(!Array.isArray(P))return P;let O={};for(let U of P)if(typeof U=="string"&&(O.base=pn(O.base,U)(l)),typeof U=="object")for(let[$,W]of Object.entries(U))O[$]=pn(O[$],W)(l);return O},ie=F=>{if(i.length<1)return null;let P={};for(let{slots:O=[],class:U,className:$,...W}of i){if(!Ze(W)){let T=!0;for(let L of Object.keys(W)){let q=R(L,F)[L];if(q===void 0||(Array.isArray(W[L])?!W[L].includes(q):W[L]!==q)){T=!1;break}}if(!T)continue}for(let T of O)P[T]=P[T]||[],P[T].push([U,$])}return P};if(!Ze(n)||!f){let F={};if(typeof g=="object"&&!Ze(g))for(let P of Object.keys(g))F[P]=O=>{var U,$;return pn(g[P],w(P,O),((U=te(O))!=null?U:[])[P],(($=ie(O))!=null?$:[])[P],O==null?void 0:O.class,O==null?void 0:O.className)(l)};return F}return pn(c,z(),K(y),C==null?void 0:C.class,C==null?void 0:C.className)(l)},b=()=>{if(!(!u||typeof u!="object"))return Object.keys(u)};return v.variantKeys=b(),v.extend=r,v.base=c,v.slots=g,v.variants=u,v.defaultVariants=p,v.compoundSlots=i,v.compoundVariants=y,v};const bd=(e,t)=>{const r=new Array(e.length+t.length);for(let n=0;n<e.length;n++)r[n]=e[n];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r},xd=(e,t)=>({classGroupId:e,validator:t}),Za=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Xn="-",li=[],yd="arbitrary..",wd=e=>{const t=kd(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return _d(i);const a=i.split(Xn),l=a[0]===""&&a.length>1?1:0;return Ka(a,l,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const l=n[i],c=r[i];return l?c?bd(c,l):l:c||li}return r[i]||li}}},Ka=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const o=e[t],s=r.nextPart.get(o);if(s){const c=Ka(e,t+1,s);if(c)return c}const i=r.validators;if(i===null)return;const a=t===0?e.join(Xn):e.slice(t).join(Xn),l=i.length;for(let c=0;c<l;c++){const u=i[c];if(u.validator(a))return u.classGroupId}},_d=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?yd+n:void 0})(),kd=e=>{const{theme:t,classGroups:r}=e;return Sd(r,t)},Sd=(e,t)=>{const r=Za();for(const n in e){const o=e[n];ws(o,r,n,t)}return r},ws=(e,t,r,n)=>{const o=e.length;for(let s=0;s<o;s++){const i=e[s];Cd(i,t,r,n)}},Cd=(e,t,r,n)=>{if(typeof e=="string"){Td(e,t,r);return}if(typeof e=="function"){Ad(e,t,r,n);return}Ed(e,t,r,n)},Td=(e,t,r)=>{const n=e===""?t:Ya(t,e);n.classGroupId=r},Ad=(e,t,r,n)=>{if(zd(e)){ws(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(xd(r,e))},Ed=(e,t,r,n)=>{const o=Object.entries(e),s=o.length;for(let i=0;i<s;i++){const[a,l]=o[i];ws(l,Ya(t,a),r,n)}},Ya=(e,t)=>{let r=e;const n=t.split(Xn),o=n.length;for(let s=0;s<o;s++){const i=n[s];let a=r.nextPart.get(i);a||(a=Za(),r.nextPart.set(i,a)),r=a}return r},zd=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Rd=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(s,i)=>{r[s]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(s){let i=r[s];if(i!==void 0)return i;if((i=n[s])!==void 0)return o(s,i),i},set(s,i){s in r?r[s]=i:o(s,i)}}},Zo="!",ci=":",Pd=[],ui=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),Md=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=o=>{const s=[];let i=0,a=0,l=0,c;const u=o.length;for(let y=0;y<u;y++){const v=o[y];if(i===0&&a===0){if(v===ci){s.push(o.slice(l,y)),l=y+1;continue}if(v==="/"){c=y;continue}}v==="["?i++:v==="]"?i--:v==="("?a++:v===")"&&a--}const p=s.length===0?o:o.slice(l);let f=p,m=!1;p.endsWith(Zo)?(f=p.slice(0,-1),m=!0):p.startsWith(Zo)&&(f=p.slice(1),m=!0);const g=c&&c>l?c-l:void 0;return ui(s,m,f,g)};if(t){const o=t+ci,s=n;n=i=>i.startsWith(o)?s(i.slice(o.length)):ui(Pd,!1,i,void 0,!0)}if(r){const o=n;n=s=>r({className:s,parseClassName:o})}return n},Id=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let o=[];for(let s=0;s<r.length;s++){const i=r[s],a=i[0]==="[",l=t.has(i);a||l?(o.length>0&&(o.sort(),n.push(...o),o=[]),n.push(i)):o.push(i)}return o.length>0&&(o.sort(),n.push(...o)),n}},Od=e=>({cache:Rd(e.cacheSize),parseClassName:Md(e),sortModifiers:Id(e),...wd(e)}),Ld=/\s+/,$d=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:s}=t,i=[],a=e.trim().split(Ld);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:p,modifiers:f,hasImportantModifier:m,baseClassName:g,maybePostfixModifierPosition:y}=r(u);if(p){l=u+(l.length>0?" "+l:l);continue}let v=!!y,b=n(v?g.substring(0,y):g);if(!b){if(!v){l=u+(l.length>0?" "+l:l);continue}if(b=n(g),!b){l=u+(l.length>0?" "+l:l);continue}v=!1}const C=f.length===0?"":f.length===1?f[0]:s(f).join(":"),M=m?C+Zo:C,_=M+b;if(i.indexOf(_)>-1)continue;i.push(_);const z=o(b,v);for(let w=0;w<z.length;++w){const A=z[w];i.push(M+A)}l=u+(l.length>0?" "+l:l)}return l},jd=(...e)=>{let t=0,r,n,o="";for(;t<e.length;)(r=e[t++])&&(n=Ja(r))&&(o&&(o+=" "),o+=n);return o},Ja=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=Ja(e[n]))&&(r&&(r+=" "),r+=t);return r},Nd=(e,...t)=>{let r,n,o,s;const i=l=>{const c=t.reduce((u,p)=>p(u),e());return r=Od(c),n=r.cache.get,o=r.cache.set,s=a,a(l)},a=l=>{const c=n(l);if(c)return c;const u=$d(l,r);return o(l,u),u};return s=i,(...l)=>s(jd(...l))},Bd=[],Re=e=>{const t=r=>r[e]||Bd;return t.isThemeGetter=!0,t},Xa=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Qa=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Gd=/^\d+\/\d+$/,Dd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,qd=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Vd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Fd=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Hd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gr=e=>Gd.test(e),ce=e=>!!e&&!Number.isNaN(Number(e)),Qt=e=>!!e&&Number.isInteger(Number(e)),wo=e=>e.endsWith("%")&&ce(e.slice(0,-1)),Lt=e=>Dd.test(e),el=()=>!0,Ud=e=>qd.test(e)&&!Vd.test(e),_s=()=>!1,Wd=e=>Fd.test(e),Zd=e=>Hd.test(e),Kd=e=>!X(e)&&!Q(e),Yd=e=>ur(e,nl,_s),X=e=>Xa.test(e),gr=e=>ur(e,ol,Ud),di=e=>ur(e,of,ce),Jd=e=>ur(e,il,el),Xd=e=>ur(e,sl,_s),fi=e=>ur(e,tl,_s),Qd=e=>ur(e,rl,Zd),Fn=e=>ur(e,al,Wd),Q=e=>Qa.test(e),hn=e=>Lr(e,ol),ef=e=>Lr(e,sl),pi=e=>Lr(e,tl),tf=e=>Lr(e,nl),rf=e=>Lr(e,rl),Hn=e=>Lr(e,al,!0),nf=e=>Lr(e,il,!0),ur=(e,t,r)=>{const n=Xa.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Lr=(e,t,r=!1)=>{const n=Qa.exec(e);return n?n[1]?t(n[1]):r:!1},tl=e=>e==="position"||e==="percentage",rl=e=>e==="image"||e==="url",nl=e=>e==="length"||e==="size"||e==="bg-size",ol=e=>e==="length",of=e=>e==="number",sl=e=>e==="family-name",il=e=>e==="number"||e==="weight",al=e=>e==="shadow",sf=()=>{const e=Re("color"),t=Re("font"),r=Re("text"),n=Re("font-weight"),o=Re("tracking"),s=Re("leading"),i=Re("breakpoint"),a=Re("container"),l=Re("spacing"),c=Re("radius"),u=Re("shadow"),p=Re("inset-shadow"),f=Re("text-shadow"),m=Re("drop-shadow"),g=Re("blur"),y=Re("perspective"),v=Re("aspect"),b=Re("ease"),C=Re("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],z=()=>[..._(),Q,X],w=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],R=()=>[Q,X,l],K=()=>[Gr,"full","auto",...R()],te=()=>[Qt,"none","subgrid",Q,X],ie=()=>["auto",{span:["full",Qt,Q,X]},Qt,Q,X],F=()=>[Qt,"auto",Q,X],P=()=>["auto","min","max","fr",Q,X],O=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...R()],W=()=>[Gr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],T=()=>[e,Q,X],L=()=>[..._(),pi,fi,{position:[Q,X]}],q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],H=()=>["auto","cover","contain",tf,Yd,{size:[Q,X]}],G=()=>[wo,hn,gr],ee=()=>["","none","full",c,Q,X],Z=()=>["",ce,hn,gr],I=()=>["solid","dashed","dotted","double"],N=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],j=()=>[ce,wo,pi,fi],ge=()=>["","none",g,Q,X],me=()=>["none",ce,Q,X],Ee=()=>["none",ce,Q,X],Me=()=>[ce,Q,X],ke=()=>[Gr,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Lt],breakpoint:[Lt],color:[el],container:[Lt],"drop-shadow":[Lt],ease:["in","out","in-out"],font:[Kd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Lt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Lt],shadow:[Lt],spacing:["px",ce],text:[Lt],"text-shadow":[Lt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gr,X,Q,v]}],container:["container"],columns:[{columns:[ce,X,Q,a]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:z()}],overflow:[{overflow:w()}],"overflow-x":[{"overflow-x":w()}],"overflow-y":[{"overflow-y":w()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:K()}],"inset-x":[{"inset-x":K()}],"inset-y":[{"inset-y":K()}],start:[{start:K()}],end:[{end:K()}],top:[{top:K()}],right:[{right:K()}],bottom:[{bottom:K()}],left:[{left:K()}],visibility:["visible","invisible","collapse"],z:[{z:[Qt,"auto",Q,X]}],basis:[{basis:[Gr,"full","auto",a,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[ce,Gr,"auto","initial","none",X]}],grow:[{grow:["",ce,Q,X]}],shrink:[{shrink:["",ce,Q,X]}],order:[{order:[Qt,"first","last","none",Q,X]}],"grid-cols":[{"grid-cols":te()}],"col-start-end":[{col:ie()}],"col-start":[{"col-start":F()}],"col-end":[{"col-end":F()}],"grid-rows":[{"grid-rows":te()}],"row-start-end":[{row:ie()}],"row-start":[{"row-start":F()}],"row-end":[{"row-end":F()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":P()}],"auto-rows":[{"auto-rows":P()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...O(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...O()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":O()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],w:[{w:[a,"screen",...W()]}],"min-w":[{"min-w":[a,"screen","none",...W()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",r,hn,gr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,nf,Jd]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wo,X]}],"font-family":[{font:[ef,Xd,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Q,X]}],"line-clamp":[{"line-clamp":[ce,"none",Q,di]}],leading:[{leading:[s,...R()]}],"list-image":[{"list-image":["none",Q,X]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Q,X]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:T()}],"text-color":[{text:T()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:[ce,"from-font","auto",Q,gr]}],"text-decoration-color":[{decoration:T()}],"underline-offset":[{"underline-offset":[ce,"auto",Q,X]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q,X]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q,X]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:q()}],"bg-size":[{bg:H()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Qt,Q,X],radial:["",Q,X],conic:[Qt,Q,X]},rf,Qd]}],"bg-color":[{bg:T()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:T()}],"gradient-via":[{via:T()}],"gradient-to":[{to:T()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...I(),"hidden","none"]}],"divide-style":[{divide:[...I(),"hidden","none"]}],"border-color":[{border:T()}],"border-color-x":[{"border-x":T()}],"border-color-y":[{"border-y":T()}],"border-color-s":[{"border-s":T()}],"border-color-e":[{"border-e":T()}],"border-color-t":[{"border-t":T()}],"border-color-r":[{"border-r":T()}],"border-color-b":[{"border-b":T()}],"border-color-l":[{"border-l":T()}],"divide-color":[{divide:T()}],"outline-style":[{outline:[...I(),"none","hidden"]}],"outline-offset":[{"outline-offset":[ce,Q,X]}],"outline-w":[{outline:["",ce,hn,gr]}],"outline-color":[{outline:T()}],shadow:[{shadow:["","none",u,Hn,Fn]}],"shadow-color":[{shadow:T()}],"inset-shadow":[{"inset-shadow":["none",p,Hn,Fn]}],"inset-shadow-color":[{"inset-shadow":T()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:T()}],"ring-offset-w":[{"ring-offset":[ce,gr]}],"ring-offset-color":[{"ring-offset":T()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":T()}],"text-shadow":[{"text-shadow":["none",f,Hn,Fn]}],"text-shadow-color":[{"text-shadow":T()}],opacity:[{opacity:[ce,Q,X]}],"mix-blend":[{"mix-blend":[...N(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":N()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[ce]}],"mask-image-linear-from-pos":[{"mask-linear-from":j()}],"mask-image-linear-to-pos":[{"mask-linear-to":j()}],"mask-image-linear-from-color":[{"mask-linear-from":T()}],"mask-image-linear-to-color":[{"mask-linear-to":T()}],"mask-image-t-from-pos":[{"mask-t-from":j()}],"mask-image-t-to-pos":[{"mask-t-to":j()}],"mask-image-t-from-color":[{"mask-t-from":T()}],"mask-image-t-to-color":[{"mask-t-to":T()}],"mask-image-r-from-pos":[{"mask-r-from":j()}],"mask-image-r-to-pos":[{"mask-r-to":j()}],"mask-image-r-from-color":[{"mask-r-from":T()}],"mask-image-r-to-color":[{"mask-r-to":T()}],"mask-image-b-from-pos":[{"mask-b-from":j()}],"mask-image-b-to-pos":[{"mask-b-to":j()}],"mask-image-b-from-color":[{"mask-b-from":T()}],"mask-image-b-to-color":[{"mask-b-to":T()}],"mask-image-l-from-pos":[{"mask-l-from":j()}],"mask-image-l-to-pos":[{"mask-l-to":j()}],"mask-image-l-from-color":[{"mask-l-from":T()}],"mask-image-l-to-color":[{"mask-l-to":T()}],"mask-image-x-from-pos":[{"mask-x-from":j()}],"mask-image-x-to-pos":[{"mask-x-to":j()}],"mask-image-x-from-color":[{"mask-x-from":T()}],"mask-image-x-to-color":[{"mask-x-to":T()}],"mask-image-y-from-pos":[{"mask-y-from":j()}],"mask-image-y-to-pos":[{"mask-y-to":j()}],"mask-image-y-from-color":[{"mask-y-from":T()}],"mask-image-y-to-color":[{"mask-y-to":T()}],"mask-image-radial":[{"mask-radial":[Q,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":j()}],"mask-image-radial-to-pos":[{"mask-radial-to":j()}],"mask-image-radial-from-color":[{"mask-radial-from":T()}],"mask-image-radial-to-color":[{"mask-radial-to":T()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":_()}],"mask-image-conic-pos":[{"mask-conic":[ce]}],"mask-image-conic-from-pos":[{"mask-conic-from":j()}],"mask-image-conic-to-pos":[{"mask-conic-to":j()}],"mask-image-conic-from-color":[{"mask-conic-from":T()}],"mask-image-conic-to-color":[{"mask-conic-to":T()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:q()}],"mask-size":[{mask:H()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Q,X]}],filter:[{filter:["","none",Q,X]}],blur:[{blur:ge()}],brightness:[{brightness:[ce,Q,X]}],contrast:[{contrast:[ce,Q,X]}],"drop-shadow":[{"drop-shadow":["","none",m,Hn,Fn]}],"drop-shadow-color":[{"drop-shadow":T()}],grayscale:[{grayscale:["",ce,Q,X]}],"hue-rotate":[{"hue-rotate":[ce,Q,X]}],invert:[{invert:["",ce,Q,X]}],saturate:[{saturate:[ce,Q,X]}],sepia:[{sepia:["",ce,Q,X]}],"backdrop-filter":[{"backdrop-filter":["","none",Q,X]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[ce,Q,X]}],"backdrop-contrast":[{"backdrop-contrast":[ce,Q,X]}],"backdrop-grayscale":[{"backdrop-grayscale":["",ce,Q,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[ce,Q,X]}],"backdrop-invert":[{"backdrop-invert":["",ce,Q,X]}],"backdrop-opacity":[{"backdrop-opacity":[ce,Q,X]}],"backdrop-saturate":[{"backdrop-saturate":[ce,Q,X]}],"backdrop-sepia":[{"backdrop-sepia":["",ce,Q,X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Q,X]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[ce,"initial",Q,X]}],ease:[{ease:["linear","initial",b,Q,X]}],delay:[{delay:[ce,Q,X]}],animate:[{animate:["none",C,Q,X]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Q,X]}],"perspective-origin":[{"perspective-origin":z()}],rotate:[{rotate:me()}],"rotate-x":[{"rotate-x":me()}],"rotate-y":[{"rotate-y":me()}],"rotate-z":[{"rotate-z":me()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:Me()}],"skew-x":[{"skew-x":Me()}],"skew-y":[{"skew-y":Me()}],transform:[{transform:[Q,X,"","none","gpu","cpu"]}],"transform-origin":[{origin:z()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ke()}],"translate-x":[{"translate-x":ke()}],"translate-y":[{"translate-y":ke()}],"translate-z":[{"translate-z":ke()}],"translate-none":["translate-none"],accent:[{accent:T()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:T()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q,X]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q,X]}],fill:[{fill:["none",...T()]}],"stroke-w":[{stroke:[ce,hn,gr,di]}],stroke:[{stroke:["none",...T()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},af=Nd(sf);function ks(...e){return af(Ea(e))}Wa({base:"inline-flex items-center rounded-md border px-2 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground shadow",outline:"text-foreground"}},defaultVariants:{variant:"default"}});var lf=B("<div></div>");function cf(e,t){Fe(t,!0);let r=at(t,"orientation",3,"horizontal"),n=bs(t,["$$slots","$$events","$$legacy","class","orientation"]);var o=lf();gs(o,s=>({role:"separator","aria-orientation":r(),class:s,...n}),[()=>ks("shrink-0 bg-border",r()==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t.class)]),E(e,o),He()}function uf(e){const r=/Z|[+-]\d{2}:?\d{2}$/.test(e)?e:e+"Z";return new Date(r).toLocaleString()}function ll(e){const r=/Z|[+-]\d{2}:?\d{2}$/.test(e)?e:e+"Z",n=Date.now()-new Date(r).getTime(),o=Math.floor(n/1e3);if(o<60)return`${o}s ago`;const s=Math.floor(o/60);if(s<60)return`${s}m ago`;const i=Math.floor(s/60);return i<24?`${i}h ago`:`${Math.floor(i/24)}d ago`}var df=B('<button class="p-1 rounded hover:bg-secondary transition-colors md:hidden shrink-0" aria-label="Open channels"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line></svg></button>'),ff=Ta('<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="text-muted-foreground/40"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"></rect><path d="M7 11V7a5 5 0 0 1 10 0v4"></path></svg>'),pf=B('<!> <span class="text-xs text-muted-foreground truncate hidden sm:block"> </span>',1),hf=B('<button class="p-1 rounded hover:bg-secondary transition-colors text-muted-foreground hover:text-foreground" title="Edit channel"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"></path><circle cx="12" cy="12" r="3"></circle></svg></button>'),vf=B('<div class="flex items-center gap-3 px-4 h-12 border-b border-border shrink-0"><!> <span class="text-muted-foreground/60">#</span> <span class="font-semibold text-sm"> </span> <!> <!> <div class="ml-auto flex items-center gap-2"><!> <span class="text-[10px] text-muted-foreground hidden sm:block"> </span> <div class="flex items-center bg-muted/50 rounded-md p-0.5 text-[11px]"><button>Pretty</button> <button></button></div></div></div>');function gf(e,t){Fe(t,!0);let r=at(t,"viewMode",15,"pretty"),n=at(t,"isAdmin",3,!1);var o=vf(),s=x(o);{var i=z=>{var w=df();fe("click",w,function(...A){var R;(R=t.onMenuClick)==null||R.apply(this,A)}),E(z,w)};re(s,z=>{t.onMenuClick&&z(i)})}var a=k(s,4),l=x(a),c=k(a,2);{var u=z=>{var w=ff();E(z,w)};re(c,z=>{t.channel.is_public||z(u)})}var p=k(c,2);{var f=z=>{var w=pf(),A=Ce(w);cf(A,{orientation:"vertical",class:"h-4"});var R=k(A,2),K=x(R);se(()=>oe(K,t.channel.description)),E(z,w)};re(p,z=>{t.channel.description&&z(f)})}var m=k(p,2),g=x(m);{var y=z=>{var w=hf();fe("click",w,function(...A){var R;(R=t.onEditChannel)==null||R.apply(this,A)}),E(z,w)};re(g,z=>{n()&&t.onEditChannel&&z(y)})}var v=k(g,2),b=x(v),C=k(v,2),M=x(C),_=k(M,2);_.textContent="{ }",se(()=>{oe(l,t.channel.name),oe(b,`${t.channel.event_count??""} events`),Vt(M,1,`px-2 py-0.5 rounded transition-colors ${r()==="pretty"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`),Vt(_,1,`px-2 py-0.5 rounded transition-colors font-mono ${r()==="raw"?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`)}),fe("click",M,()=>r("pretty")),fe("click",_,()=>r("raw")),E(e,o),He()}ht(["click"]);function Ss(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $r=Ss();function cl(e){$r=e}var _n={exec:()=>null};function ye(e,t=""){let r=typeof e=="string"?e:e.source;const n={replace:(o,s)=>{let i=typeof s=="string"?s:s.source;return i=i.replace(Ue.caret,"$1"),r=r.replace(o,i),n},getRegex:()=>new RegExp(r,t)};return n}var Ue={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},mf=/^(?:[ \t]*(?:\n|$))+/,bf=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,xf=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,jn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yf=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Cs=/(?:[*+-]|\d{1,9}[.)])/,ul=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,dl=ye(ul).replace(/bull/g,Cs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),wf=ye(ul).replace(/bull/g,Cs).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ts=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,_f=/^[^\n]+/,As=/(?!\s*\])(?:\\.|[^\[\]\\])+/,kf=ye(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",As).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Sf=ye(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Cs).getRegex(),co="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Es=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Cf=ye("^ {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|$))","i").replace("comment",Es).replace("tag",co).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fl=ye(Ts).replace("hr",jn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",co).getRegex(),Tf=ye(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fl).getRegex(),zs={blockquote:Tf,code:bf,def:kf,fences:xf,heading:yf,hr:jn,html:Cf,lheading:dl,list:Sf,newline:mf,paragraph:fl,table:_n,text:_f},hi=ye("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",jn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",co).getRegex(),Af={...zs,lheading:wf,table:hi,paragraph:ye(Ts).replace("hr",jn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",hi).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",co).getRegex()},Ef={...zs,html:ye(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Es).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:_n,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ye(Ts).replace("hr",jn).replace("heading",` *#{1,6} *[^
5
+ ]`).replace("lheading",dl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},zf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Rf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pl=/^( {2,}|\\)\n(?!\s*$)/,Pf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,uo=/[\p{P}\p{S}]/u,Rs=/[\s\p{P}\p{S}]/u,hl=/[^\s\p{P}\p{S}]/u,Mf=ye(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Rs).getRegex(),vl=/(?!~)[\p{P}\p{S}]/u,If=/(?!~)[\s\p{P}\p{S}]/u,Of=/(?:[^\s\p{P}\p{S}]|~)/u,Lf=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,gl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,$f=ye(gl,"u").replace(/punct/g,uo).getRegex(),jf=ye(gl,"u").replace(/punct/g,vl).getRegex(),ml="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Nf=ye(ml,"gu").replace(/notPunctSpace/g,hl).replace(/punctSpace/g,Rs).replace(/punct/g,uo).getRegex(),Bf=ye(ml,"gu").replace(/notPunctSpace/g,Of).replace(/punctSpace/g,If).replace(/punct/g,vl).getRegex(),Gf=ye("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,hl).replace(/punctSpace/g,Rs).replace(/punct/g,uo).getRegex(),Df=ye(/\\(punct)/,"gu").replace(/punct/g,uo).getRegex(),qf=ye(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Vf=ye(Es).replace("(?:-->|$)","-->").getRegex(),Ff=ye("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Vf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Qn=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Hf=ye(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Qn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),bl=ye(/^!?\[(label)\]\[(ref)\]/).replace("label",Qn).replace("ref",As).getRegex(),xl=ye(/^!?\[(ref)\](?:\[\])?/).replace("ref",As).getRegex(),Uf=ye("reflink|nolink(?!\\()","g").replace("reflink",bl).replace("nolink",xl).getRegex(),Ps={_backpedal:_n,anyPunctuation:Df,autolink:qf,blockSkip:Lf,br:pl,code:Rf,del:_n,emStrongLDelim:$f,emStrongRDelimAst:Nf,emStrongRDelimUnd:Gf,escape:zf,link:Hf,nolink:xl,punctuation:Mf,reflink:bl,reflinkSearch:Uf,tag:Ff,text:Pf,url:_n},Wf={...Ps,link:ye(/^!?\[(label)\]\((.*?)\)/).replace("label",Qn).getRegex(),reflink:ye(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Qn).getRegex()},Ko={...Ps,emStrongRDelimAst:Bf,emStrongLDelim:jf,url:ye(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Zf={...Ko,br:ye(pl).replace("{2,}","*").getRegex(),text:ye(Ko.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Un={normal:zs,gfm:Af,pedantic:Ef},vn={normal:Ps,gfm:Ko,breaks:Zf,pedantic:Wf},Kf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},vi=e=>Kf[e];function Ct(e,t){if(t){if(Ue.escapeTest.test(e))return e.replace(Ue.escapeReplace,vi)}else if(Ue.escapeTestNoEncode.test(e))return e.replace(Ue.escapeReplaceNoEncode,vi);return e}function gi(e){try{e=encodeURI(e).replace(Ue.percentDecode,"%")}catch{return null}return e}function mi(e,t){var s;const r=e.replace(Ue.findPipe,(i,a,l)=>{let c=!1,u=a;for(;--u>=0&&l[u]==="\\";)c=!c;return c?"|":" |"}),n=r.split(Ue.splitPipe);let o=0;if(n[0].trim()||n.shift(),n.length>0&&!((s=n.at(-1))!=null&&s.trim())&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;o<n.length;o++)n[o]=n[o].trim().replace(Ue.slashPipe,"|");return n}function gn(e,t,r){const n=e.length;if(n===0)return"";let o=0;for(;o<n&&e.charAt(n-o-1)===t;)o++;return e.slice(0,n-o)}function Yf(e,t){if(e.indexOf(t[1])===-1)return-1;let r=0;for(let n=0;n<e.length;n++)if(e[n]==="\\")n++;else if(e[n]===t[0])r++;else if(e[n]===t[1]&&(r--,r<0))return n;return r>0?-2:-1}function bi(e,t,r,n,o){const s=t.href,i=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:s,title:i,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function Jf(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const o=n[1];return t.split(`
6
+ `).map(s=>{const i=s.match(r.other.beginningSpace);if(i===null)return s;const[a]=i;return a.length>=o.length?s.slice(o.length):s}).join(`
7
+ `)}var eo=class{constructor(e){le(this,"options");le(this,"rules");le(this,"lexer");this.options=e||$r}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:gn(r,`
8
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=Jf(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const n=gn(r,"#");(this.options.pedantic||!n||this.rules.other.endingSpaceChar.test(n))&&(r=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:gn(t[0],`
9
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=gn(t[0],`
10
+ `).split(`
11
+ `),n="",o="";const s=[];for(;r.length>0;){let i=!1;const a=[];let l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))a.push(r[l]),i=!0;else if(!i)a.push(r[l]);else break;r=r.slice(l);const c=a.join(`
12
+ `),u=c.replace(this.rules.other.blockquoteSetextReplace,`
13
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}
14
+ ${c}`:c,o=o?`${o}
15
+ ${u}`:u;const p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(u,s,!0),this.lexer.state.top=p,r.length===0)break;const f=s.at(-1);if((f==null?void 0:f.type)==="code")break;if((f==null?void 0:f.type)==="blockquote"){const m=f,g=m.raw+`
16
+ `+r.join(`
17
+ `),y=this.blockquote(g);s[s.length-1]=y,n=n.substring(0,n.length-m.raw.length)+y.raw,o=o.substring(0,o.length-m.text.length)+y.text;break}else if((f==null?void 0:f.type)==="list"){const m=f,g=m.raw+`
18
+ `+r.join(`
19
+ `),y=this.list(g);s[s.length-1]=y,n=n.substring(0,n.length-f.raw.length)+y.raw,o=o.substring(0,o.length-m.raw.length)+y.raw,r=g.substring(s.at(-1).raw.length).split(`
20
+ `);continue}}return{type:"blockquote",raw:n,tokens:s,text:o}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const n=r.length>1,o={type:"list",raw:"",ordered:n,start:n?+r.slice(0,-1):"",loose:!1,items:[]};r=n?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=n?r:"[*+-]");const s=this.rules.other.listItemRegex(r);let i=!1;for(;e;){let l=!1,c="",u="";if(!(t=s.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let p=t[2].split(`
21
+ `,1)[0].replace(this.rules.other.listReplaceTabs,b=>" ".repeat(3*b.length)),f=e.split(`
22
+ `,1)[0],m=!p.trim(),g=0;if(this.options.pedantic?(g=2,u=p.trimStart()):m?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,u=p.slice(g),g+=t[1].length),m&&this.rules.other.blankLine.test(f)&&(c+=f+`
23
+ `,e=e.substring(f.length+1),l=!0),!l){const b=this.rules.other.nextBulletRegex(g),C=this.rules.other.hrRegex(g),M=this.rules.other.fencesBeginRegex(g),_=this.rules.other.headingBeginRegex(g),z=this.rules.other.htmlBeginRegex(g);for(;e;){const w=e.split(`
24
+ `,1)[0];let A;if(f=w,this.options.pedantic?(f=f.replace(this.rules.other.listReplaceNesting," "),A=f):A=f.replace(this.rules.other.tabCharGlobal," "),M.test(f)||_.test(f)||z.test(f)||b.test(f)||C.test(f))break;if(A.search(this.rules.other.nonSpaceChar)>=g||!f.trim())u+=`
25
+ `+A.slice(g);else{if(m||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||M.test(p)||_.test(p)||C.test(p))break;u+=`
26
+ `+f}!m&&!f.trim()&&(m=!0),c+=w+`
27
+ `,e=e.substring(w.length+1),p=A.slice(g)}}o.loose||(i?o.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let y=null,v;this.options.gfm&&(y=this.rules.other.listIsTask.exec(u),y&&(v=y[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:c,task:!!y,checked:v,loose:!1,text:u,tokens:[]}),o.raw+=c}const a=o.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let l=0;l<o.items.length;l++)if(this.lexer.state.top=!1,o.items[l].tokens=this.lexer.blockTokens(o.items[l].text,[]),!o.loose){const c=o.items[l].tokens.filter(p=>p.type==="space"),u=c.length>0&&c.some(p=>this.rules.other.anyLine.test(p.raw));o.loose=u}if(o.loose)for(let l=0;l<o.items.length;l++)o.items[l].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:n,title:o}}}table(e){var i;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=mi(t[1]),n=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=(i=t[3])!=null&&i.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
28
+ `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===n.length){for(const a of n)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<r.length;a++)s.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:s.align[a]});for(const a of o)s.rows.push(mi(a,s.header.length).map((l,c)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:s.align[c]})));return s}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
29
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const s=gn(r.slice(0,-1),"\\");if((r.length-s.length)%2===0)return}else{const s=Yf(t[2],"()");if(s===-2)return;if(s>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let n=t[2],o="";if(this.options.pedantic){const s=this.rules.other.pedanticHrefTitle.exec(n);s&&(n=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?n=n.slice(1):n=n.slice(1,-1)),bi(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const n=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=t[n.toLowerCase()];if(!o){const s=r[0].charAt(0);return{type:"text",raw:s,text:s}}return bi(r,o,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let n=this.rules.inline.emStrongLDelim.exec(e);if(!n||n[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(n[1]||n[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const s=[...n[0]].length-1;let i,a,l=s,c=0;const u=n[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+s);(n=u.exec(t))!=null;){if(i=n[1]||n[2]||n[3]||n[4]||n[5]||n[6],!i)continue;if(a=[...i].length,n[3]||n[4]){l+=a;continue}else if((n[5]||n[6])&&s%3&&!((s+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);const p=[...n[0]][0].length,f=e.slice(0,s+n.index+p+a);if(Math.min(s,a)%2){const g=f.slice(1,-1);return{type:"em",raw:f,text:g,tokens:this.lexer.inlineTokens(g)}}const m=f.slice(2,-2);return{type:"strong",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return n&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,n;return t[2]==="@"?(r=t[1],n="mailto:"+r):(r=t[1],n=r),{type:"link",raw:t[0],text:r,href:n,tokens:[{type:"text",raw:r,text:r}]}}}url(e){var r;let t;if(t=this.rules.inline.url.exec(e)){let n,o;if(t[2]==="@")n=t[0],o="mailto:"+n;else{let s;do s=t[0],t[0]=((r=this.rules.inline._backpedal.exec(t[0]))==null?void 0:r[0])??"";while(s!==t[0]);n=t[0],t[1]==="www."?o="http://"+t[0]:o=t[0]}return{type:"link",raw:t[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}},Ft=class Yo{constructor(t){le(this,"tokens");le(this,"options");le(this,"state");le(this,"tokenizer");le(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||$r,this.options.tokenizer=this.options.tokenizer||new eo,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 r={other:Ue,block:Un.normal,inline:vn.normal};this.options.pedantic?(r.block=Un.pedantic,r.inline=vn.pedantic):this.options.gfm&&(r.block=Un.gfm,this.options.breaks?r.inline=vn.breaks:r.inline=vn.gfm),this.tokenizer.rules=r}static get rules(){return{block:Un,inline:vn}}static lex(t,r){return new Yo(r).lex(t)}static lexInline(t,r){return new Yo(r).inlineTokens(t)}lex(t){t=t.replace(Ue.carriageReturn,`
30
+ `),this.blockTokens(t,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){const n=this.inlineQueue[r];this.inlineTokens(n.src,n.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,r=[],n=!1){var o,s,i;for(this.options.pedantic&&(t=t.replace(Ue.tabCharGlobal," ").replace(Ue.spaceLine,""));t;){let a;if((s=(o=this.options.extensions)==null?void 0:o.block)!=null&&s.some(c=>(a=c.call({lexer:this},t,r))?(t=t.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);const c=r.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
31
+ `:r.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);const c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
32
+ `+a.raw,c.text+=`
33
+ `+a.text,this.inlineQueue.at(-1).src=c.text):r.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);const c=r.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
34
+ `+a.raw,c.text+=`
35
+ `+a.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),r.push(a);continue}let l=t;if((i=this.options.extensions)!=null&&i.startBlock){let c=1/0;const u=t.slice(1);let p;this.options.extensions.startBlock.forEach(f=>{p=f.call({lexer:this},u),typeof p=="number"&&p>=0&&(c=Math.min(c,p))}),c<1/0&&c>=0&&(l=t.substring(0,c+1))}if(this.state.top&&(a=this.tokenizer.paragraph(l))){const c=r.at(-1);n&&(c==null?void 0:c.type)==="paragraph"?(c.raw+=`
36
+ `+a.raw,c.text+=`
37
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(a),n=l.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);const c=r.at(-1);(c==null?void 0:c.type)==="text"?(c.raw+=`
38
+ `+a.raw,c.text+=`
39
+ `+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):r.push(a);continue}if(t){const c="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return this.state.top=!0,r}inline(t,r=[]){return this.inlineQueue.push({src:t,tokens:r}),r}inlineTokens(t,r=[]){var a,l,c;let n=t,o=null;if(this.tokens.links){const u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(n))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(n))!=null;)n=n.slice(0,o.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(o=this.tokenizer.rules.inline.blockSkip.exec(n))!=null;)n=n.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,i="";for(;t;){s||(i=""),s=!1;let u;if((l=(a=this.options.extensions)==null?void 0:a.inline)!=null&&l.some(f=>(u=f.call({lexer:this},t,r))?(t=t.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(u.raw.length);const f=r.at(-1);u.type==="text"&&(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(t,n,i)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(t)){t=t.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(t)){t=t.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(t))){t=t.substring(u.raw.length),r.push(u);continue}let p=t;if((c=this.options.extensions)!=null&&c.startInline){let f=1/0;const m=t.slice(1);let g;this.options.extensions.startInline.forEach(y=>{g=y.call({lexer:this},m),typeof g=="number"&&g>=0&&(f=Math.min(f,g))}),f<1/0&&f>=0&&(p=t.substring(0,f+1))}if(u=this.tokenizer.inlineText(p)){t=t.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(i=u.raw.slice(-1)),s=!0;const f=r.at(-1);(f==null?void 0:f.type)==="text"?(f.raw+=u.raw,f.text+=u.text):r.push(u);continue}if(t){const f="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(f);break}else throw new Error(f)}}return r}},to=class{constructor(e){le(this,"options");le(this,"parser");this.options=e||$r}space(e){return""}code({text:e,lang:t,escaped:r}){var s;const n=(s=(t||"").match(Ue.notSpaceStart))==null?void 0:s[0],o=e.replace(Ue.endingNewline,"")+`
40
+ `;return n?'<pre><code class="language-'+Ct(n)+'">'+(r?o:Ct(o,!0))+`</code></pre>
41
+ `:"<pre><code>"+(r?o:Ct(o,!0))+`</code></pre>
42
+ `}blockquote({tokens:e}){return`<blockquote>
43
+ ${this.parser.parse(e)}</blockquote>
44
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
45
+ `}hr(e){return`<hr>
46
+ `}list(e){const t=e.ordered,r=e.start;let n="";for(let i=0;i<e.items.length;i++){const a=e.items[i];n+=this.listitem(a)}const o=t?"ol":"ul",s=t&&r!==1?' start="'+r+'"':"";return"<"+o+s+`>
47
+ `+n+"</"+o+`>
48
+ `}listitem(e){var r;let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?((r=e.tokens[0])==null?void 0:r.type)==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+Ct(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
49
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
50
+ `}table(e){let t="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);t+=this.tablerow({text:r});let n="";for(let o=0;o<e.rows.length;o++){const s=e.rows[o];r="";for(let i=0;i<s.length;i++)r+=this.tablecell(s[i]);n+=this.tablerow({text:r})}return n&&(n=`<tbody>${n}</tbody>`),`<table>
51
+ <thead>
52
+ `+t+`</thead>
53
+ `+n+`</table>
54
+ `}tablerow({text:e}){return`<tr>
55
+ ${e}</tr>
56
+ `}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
57
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ct(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const n=this.parser.parseInline(r),o=gi(e);if(o===null)return n;e=o;let s='<a href="'+e+'"';return t&&(s+=' title="'+Ct(t)+'"'),s+=">"+n+"</a>",s}image({href:e,title:t,text:r,tokens:n}){n&&(r=this.parser.parseInline(n,this.parser.textRenderer));const o=gi(e);if(o===null)return Ct(r);e=o;let s=`<img src="${e}" alt="${r}"`;return t&&(s+=` title="${Ct(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ct(e.text)}},Ms=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Ht=class Jo{constructor(t){le(this,"options");le(this,"renderer");le(this,"textRenderer");this.options=t||$r,this.options.renderer=this.options.renderer||new to,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ms}static parse(t,r){return new Jo(r).parse(t)}static parseInline(t,r){return new Jo(r).parseInline(t)}parse(t,r=!0){var o,s;let n="";for(let i=0;i<t.length;i++){const a=t[i];if((s=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&s[a.type]){const c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){n+=u||"";continue}}const l=a;switch(l.type){case"space":{n+=this.renderer.space(l);continue}case"hr":{n+=this.renderer.hr(l);continue}case"heading":{n+=this.renderer.heading(l);continue}case"code":{n+=this.renderer.code(l);continue}case"table":{n+=this.renderer.table(l);continue}case"blockquote":{n+=this.renderer.blockquote(l);continue}case"list":{n+=this.renderer.list(l);continue}case"html":{n+=this.renderer.html(l);continue}case"paragraph":{n+=this.renderer.paragraph(l);continue}case"text":{let c=l,u=this.renderer.text(c);for(;i+1<t.length&&t[i+1].type==="text";)c=t[++i],u+=`
58
+ `+this.renderer.text(c);r?n+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):n+=u;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}parseInline(t,r=this.renderer){var o,s;let n="";for(let i=0;i<t.length;i++){const a=t[i];if((s=(o=this.options.extensions)==null?void 0:o.renderers)!=null&&s[a.type]){const c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){n+=c||"";continue}}const l=a;switch(l.type){case"escape":{n+=r.text(l);break}case"html":{n+=r.html(l);break}case"link":{n+=r.link(l);break}case"image":{n+=r.image(l);break}case"strong":{n+=r.strong(l);break}case"em":{n+=r.em(l);break}case"codespan":{n+=r.codespan(l);break}case"br":{n+=r.br(l);break}case"del":{n+=r.del(l);break}case"text":{n+=r.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return n}},ko,Kn=(ko=class{constructor(e){le(this,"options");le(this,"block");this.options=e||$r}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ft.lex:Ft.lexInline}provideParser(){return this.block?Ht.parse:Ht.parseInline}},le(ko,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),ko),Xf=class{constructor(...e){le(this,"defaults",Ss());le(this,"options",this.setOptions);le(this,"parse",this.parseMarkdown(!0));le(this,"parseInline",this.parseMarkdown(!1));le(this,"Parser",Ht);le(this,"Renderer",to);le(this,"TextRenderer",Ms);le(this,"Lexer",Ft);le(this,"Tokenizer",eo);le(this,"Hooks",Kn);this.use(...e)}walkTokens(e,t){var n,o;let r=[];for(const s of e)switch(r=r.concat(t.call(this,s)),s.type){case"table":{const i=s;for(const a of i.header)r=r.concat(this.walkTokens(a.tokens,t));for(const a of i.rows)for(const l of a)r=r.concat(this.walkTokens(l.tokens,t));break}case"list":{const i=s;r=r.concat(this.walkTokens(i.items,t));break}default:{const i=s;(o=(n=this.defaults.extensions)==null?void 0:n.childTokens)!=null&&o[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{const l=i[a].flat(1/0);r=r.concat(this.walkTokens(l,t))}):i.tokens&&(r=r.concat(this.walkTokens(i.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const n={...r};if(n.async=this.defaults.async||n.async||!1,r.extensions&&(r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if("renderer"in o){const s=t.renderers[o.name];s?t.renderers[o.name]=function(...i){let a=o.renderer.apply(this,i);return a===!1&&(a=s.apply(this,i)),a}:t.renderers[o.name]=o.renderer}if("tokenizer"in o){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const s=t[o.level];s?s.unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}"childTokens"in o&&o.childTokens&&(t.childTokens[o.name]=o.childTokens)}),n.extensions=t),r.renderer){const o=this.defaults.renderer||new to(this.defaults);for(const s in r.renderer){if(!(s in o))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;const i=s,a=r.renderer[i],l=o[i];o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u||""}}n.renderer=o}if(r.tokenizer){const o=this.defaults.tokenizer||new eo(this.defaults);for(const s in r.tokenizer){if(!(s in o))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;const i=s,a=r.tokenizer[i],l=o[i];o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}n.tokenizer=o}if(r.hooks){const o=this.defaults.hooks||new Kn;for(const s in r.hooks){if(!(s in o))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;const i=s,a=r.hooks[i],l=o[i];Kn.passThroughHooks.has(s)?o[i]=c=>{if(this.defaults.async)return Promise.resolve(a.call(o,c)).then(p=>l.call(o,p));const u=a.call(o,c);return l.call(o,u)}:o[i]=(...c)=>{let u=a.apply(o,c);return u===!1&&(u=l.apply(o,c)),u}}n.hooks=o}if(r.walkTokens){const o=this.defaults.walkTokens,s=r.walkTokens;n.walkTokens=function(i){let a=[];return a.push(s.call(this,i)),o&&(a=a.concat(o.call(this,i))),a}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ft.lex(e,t??this.defaults)}parser(e,t){return Ht.parse(e,t??this.defaults)}parseMarkdown(e){return(r,n)=>{const o={...n},s={...this.defaults,...o},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&o.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);const a=s.hooks?s.hooks.provideLexer():e?Ft.lex:Ft.lexInline,l=s.hooks?s.hooks.provideParser():e?Ht.parse:Ht.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(r):r).then(c=>a(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(i);try{s.hooks&&(r=s.hooks.preprocess(r));let c=a(r,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let u=l(c,s);return s.hooks&&(u=s.hooks.postprocess(u)),u}catch(c){return i(c)}}}onError(e,t){return r=>{if(r.message+=`
59
+ Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+Ct(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},Mr=new Xf;function xe(e,t){return Mr.parse(e,t)}xe.options=xe.setOptions=function(e){return Mr.setOptions(e),xe.defaults=Mr.defaults,cl(xe.defaults),xe};xe.getDefaults=Ss;xe.defaults=$r;xe.use=function(...e){return Mr.use(...e),xe.defaults=Mr.defaults,cl(xe.defaults),xe};xe.walkTokens=function(e,t){return Mr.walkTokens(e,t)};xe.parseInline=Mr.parseInline;xe.Parser=Ht;xe.parser=Ht.parse;xe.Renderer=to;xe.TextRenderer=Ms;xe.Lexer=Ft;xe.lexer=Ft.lex;xe.Tokenizer=eo;xe.Hooks=Kn;xe.parse=xe;xe.options;xe.setOptions;xe.use;xe.walkTokens;xe.parseInline;Ht.parse;Ft.lex;xe.setOptions({breaks:!0,gfm:!0});const Qf=/[*_#\[`~>]|\n[-*] |\n\d+\. /;function ep(e){return Qf.test(e)}function xi(e){return xe.parse(e,{async:!1})}function tp(e){try{const t=JSON.parse(e);return typeof t!="object"||t===null||Array.isArray(t)?null:Xo(t)}catch{return null}}function Xo(e){return Object.entries(e).map(([t,r])=>{if(typeof r=="object"&&r!==null&&!Array.isArray(r))return{kind:"group",key:t,children:Xo(r)};if(Array.isArray(r)&&r.length>0)return{kind:"list",key:t,items:r.map(s=>typeof s=="object"&&s!==null&&!Array.isArray(s)?Xo(s):[{kind:"text",key:"",value:String(s),markdown:!1,multiline:!1}])};const n=typeof r=="string"?r:JSON.stringify(r),o=n.includes(`
60
+ `);return{kind:"text",key:t,value:n,markdown:ep(n),multiline:o}})}function mr(e){return e.replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function rp(e){var t,r,n,o,s,i,a;const l=(t=e.meta)===null||t===void 0?void 0:t.title,c=(r=e.meta)===null||r===void 0?void 0:r.creator,u=(n=e.meta)===null||n===void 0?void 0:n.source,p=(s=(o=e.meta)===null||o===void 0?void 0:o.license)===null||s===void 0?void 0:s.url,f=np(e);return!l&&!c&&!u&&!p&&!f?"":'<metadata xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"><rdf:RDF><rdf:Description>'+(l?`<dc:title>${mr(l)}</dc:title>`:"")+(c?`<dc:creator>${mr(c)}</dc:creator>`:"")+(u?`<dc:source xsi:type="dcterms:URI">${mr((a=(i=e.meta)===null||i===void 0?void 0:i.source)!==null&&a!==void 0?a:"")}</dc:source>`:"")+(p?`<dcterms:license xsi:type="dcterms:URI">${mr(p)}</dcterms:license>`:"")+(f?`<dc:rights>${mr(f)}</dc:rights>`:"")+"</rdf:Description></rdf:RDF></metadata>"}function np(e){var t,r,n,o,s,i,a,l,c,u,p,f,m,g,y;let v=!((t=e.meta)===null||t===void 0)&&t.title?`„${(r=e.meta)===null||r===void 0?void 0:r.title}”`:"Design",b=`„${(o=(n=e.meta)===null||n===void 0?void 0:n.creator)!==null&&o!==void 0?o:"Unknown"}”`;!((s=e.meta)===null||s===void 0)&&s.source&&(v+=` (${e.meta.source})`);let C="";return((a=(i=e.meta)===null||i===void 0?void 0:i.license)===null||a===void 0?void 0:a.name)!=="MIT"&&((l=e.meta)===null||l===void 0?void 0:l.creator)!=="DiceBear"&&(!((c=e.meta)===null||c===void 0)&&c.title)&&(C+="Remix of "),C+=`${v} by ${b}`,!((p=(u=e.meta)===null||u===void 0?void 0:u.license)===null||p===void 0)&&p.name&&(C+=`, licensed under „${(m=(f=e.meta)===null||f===void 0?void 0:f.license)===null||m===void 0?void 0:m.name}”`,!((y=(g=e.meta)===null||g===void 0?void 0:g.license)===null||y===void 0)&&y.url&&(C+=` (${e.meta.license.url})`)),C}const yi=-2147483648,op=2147483647;function yl(e){return e^=e<<13,e^=e>>17,e^=e<<5,e}function sp(e){let t=0;for(let r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r)|0,t=yl(t);return t}function ro(e=""){e=e.toString();let t=sp(e)||1;const r=()=>t=yl(t),n=(o,s)=>Math.floor((r()-yi)/(op-yi)*(s+1-o)+o);return{seed:e,next:r,bool(o=50){return n(1,100)<=o},integer(o,s){return n(o,s)},pick(o,s){var i;return o.length===0?(r(),s):(i=o[n(0,o.length-1)])!==null&&i!==void 0?i:s},shuffle(o){const s=ro(r().toString()),i=[...o];for(let a=i.length-1;a>0;a--){const l=s.integer(0,a);[i[a],i[l]]=[i[l],i[a]]}return i},string(o,s="abcdefghijklmnopqrstuvwxyz1234567890"){const i=ro(r().toString());let a="";for(let l=0;l<o;l++)a+=s[i.integer(0,s.length-1)];return a}}}function sn(e){let t=e.attributes.viewBox.split(" "),r=parseInt(t[0]),n=parseInt(t[1]),o=parseInt(t[2]),s=parseInt(t[3]);return{x:r,y:n,width:o,height:s}}function ip(e,t,r,n,o){let{width:s,height:i,x:a,y:l}=sn(e);const c=`<rect fill="${t}" width="${s}" height="${i}" x="${a}" y="${l}" />`;switch(n){case"solid":return c+e.body;case"gradientLinear":return`<rect fill="url(#backgroundLinear)" width="${s}" height="${i}" x="${a}" y="${l}" /><defs><linearGradient id="backgroundLinear" gradientTransform="rotate(${o} 0.5 0.5)"><stop stop-color="${t}"/><stop offset="1" stop-color="${r}"/></linearGradient></defs>`+e.body}}function ap(e,t){let{width:r,height:n,x:o,y:s}=sn(e),i=t?(t-100)/100:0,a=(r/2+o)*i*-1,l=(n/2+s)*i*-1;return`<g transform="translate(${a} ${l}) scale(${t/100})">${e.body}</g>`}function lp(e,t,r){let n=sn(e),o=(n.width+n.x*2)*((t??0)/100),s=(n.height+n.y*2)*((r??0)/100);return`<g transform="translate(${o} ${s})">${e.body}</g>`}function cp(e,t){let{width:r,height:n,x:o,y:s}=sn(e);return`<g transform="rotate(${t}, ${r/2+o}, ${n/2+s})">${e.body}</g>`}function up(e){let{width:t,x:r}=sn(e);return`<g transform="scale(-1 1) translate(${t*-1-r*2} 0)">${e.body}</g>`}function dp(e,t){let{width:r,height:n,x:o,y:s}=sn(e),i=t?r*t/100:0,a=t?n*t/100:0;return`<mask id="viewboxMask"><rect width="${r}" height="${n}" rx="${i}" ry="${a}" x="${o}" y="${s}" fill="#fff" /></mask><g mask="url(#viewboxMask)">${e.body}</g>`}function fp(e){const t={xmlns:"http://www.w3.org/2000/svg",...e.attributes};return Object.keys(t).map(r=>`${mr(r)}="${mr(t[r])}"`).join(" ")}function pp(e){const t=ro(Math.random().toString()),r={};return e.body.replace(/(id="|url\(#)([a-z0-9-_]+)([")])/gi,(n,o,s,i)=>(r[s]=r[s]||t.string(8),`${o}${r[s]}${i}`))}const hp={properties:{seed:{type:"string"},flip:{type:"boolean",default:!1},rotate:{type:"integer",minimum:0,maximum:360,default:0},scale:{type:"integer",minimum:0,maximum:200,default:100},radius:{type:"integer",minimum:0,maximum:50,default:0},size:{type:"integer",minimum:1},backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"}},backgroundType:{type:"array",items:{type:"string",enum:["solid","gradientLinear"]},default:["solid"]},backgroundRotation:{type:"array",items:{type:"integer",minimum:-360,maximum:360},default:[0,360]},translateX:{type:"integer",minimum:-100,maximum:100,default:0},translateY:{type:"integer",minimum:-100,maximum:100,default:0},clip:{type:"boolean",default:!0},randomizeIds:{type:"boolean",default:!1}}};function wi(e){var t;let r={},n=(t=e.properties)!==null&&t!==void 0?t:{};return Object.keys(n).forEach(o=>{let s=n[o];typeof s=="object"&&s.default!==void 0&&(Array.isArray(s.default)?r[o]=[...s.default]:typeof s.default=="object"?r[o]={...s.default}:r[o]=s.default)}),r}function vp(e,t){var r;let n={...wi(hp),...wi((r=e.schema)!==null&&r!==void 0?r:{}),...t};return JSON.parse(JSON.stringify(n))}function _i(e){return e==="transparent"?e:`#${e}`}function gp(e,t,r){var n;let o=e.shuffle(t);o.length<=1||t.length==2&&r=="gradientLinear"?(o=t,e.next()):o=e.shuffle(t),o.length===0&&(o=["transparent"]);const s=o[0],i=(n=o[1])!==null&&n!==void 0?n:o[0];return{primary:_i(s),secondary:_i(i)}}function mp(e,t={}){var r,n,o,s,i;t=vp(e,t);const a=ro(t.seed),l=e.create({prng:a,options:t}),c=a.pick((r=t.backgroundType)!==null&&r!==void 0?r:[],"solid"),{primary:u,secondary:p}=gp(a,(n=t.backgroundColor)!==null&&n!==void 0?n:[],c),f=a.integer(!((o=t.backgroundRotation)===null||o===void 0)&&o.length?Math.min(...t.backgroundRotation):0,!((s=t.backgroundRotation)===null||s===void 0)&&s.length?Math.max(...t.backgroundRotation):0);t.size&&(l.attributes.width=t.size.toString(),l.attributes.height=t.size.toString()),t.scale!==void 0&&t.scale!==100&&(l.body=ap(l,t.scale)),t.flip&&(l.body=up(l)),t.rotate&&(l.body=cp(l,t.rotate)),(t.translateX||t.translateY)&&(l.body=lp(l,t.translateX,t.translateY)),u!=="transparent"&&p!=="transparent"&&(l.body=ip(l,u,p,c,f)),(t.radius||t.clip)&&(l.body=dp(l,(i=t.radius)!==null&&i!==void 0?i:0)),t.randomizeIds&&(l.body=pp(l));const m=fp(l),g=rp(e),y=`<svg ${m}>${g}${l.body}</svg>`;return{toString:()=>y,toJson:()=>{var v;return{svg:y,extra:{primaryBackgroundColor:u,secondaryBackgroundColor:p,backgroundType:c,backgroundRotation:f,...(v=l.extra)===null||v===void 0?void 0:v.call(l)}}},toDataUri:()=>`data:image/svg+xml;utf8,${encodeURIComponent(y)}`}}const bp={g:(e,t)=>'<path d="M101.6 51.2a20 20 0 0 0-14.7-14.5q-3.9-1-8.5-1-10 0-17 4.7A30 30 0 0 0 50.9 54q-3.6 9-3.6 21.6 0 12.8 3.5 21.8 3.4 9 10.3 14a29 29 0 0 0 17.2 4.8q9 0 15-2.6 6-2.7 9-7.5t3-11.4l6.8.7H78.7v-28h64.5v20q0 20-8.4 34.1a56 56 0 0 1-23.2 21.6Q97 150.7 78 150.7q-21.3 0-37.3-9t-25-25.8q-9-16.5-9-39.7a87 87 0 0 1 5.4-32 67 67 0 0 1 38-38q12.9-5 27.6-5 12.9 0 24 3.7 11.1 3.6 19.7 10.4a50 50 0 0 1 20.2 36z" fill="white"/>',r:(e,t)=>'<path d="M17.6 148.7V3.2h62.8q16.2 0 28.3 6 12 5.8 18.9 16.9a50 50 0 0 1 6.7 26.6q0 15.6-7 26.3A43 43 0 0 1 108 95.2q-12.5 5.5-29 5.5H41.3V70H71q7 0 11.8-1.7a15 15 0 0 0 7.6-5.6 17 17 0 0 0 2.7-10q0-6.3-2.7-10.2a15 15 0 0 0-7.6-5.8q-4.9-2-11.8-2H57v114zm85.2-66.8 36.4 66.8h-43L60.9 81.9z" fill="white"/>',a:(e,t)=>'<path d="M42.6 148.7H0L48 3.2h54l48 145.5h-42.7L75.5 43.3h-1.1zm-8-57.4h80.1v29.5h-80z" fill="white"/>',d:(e,t)=>'<path d="M67 148.7H11V3.2h55.4q22.5 0 38.8 8.8a60 60 0 0 1 25.3 25q9 16.2 9 39 0 22.6-9 39a61 61 0 0 1-25 25 81 81 0 0 1-38.5 8.7m-16.5-33.5h15a44 44 0 0 0 18.5-3.5q7.6-3.5 11.6-12t4-23.8q0-15-4-23.7a24 24 0 0 0-12-12 47 47 0 0 0-19.2-3.5H50.5z" fill="white"/>',i:(e,t)=>'<path d="M94.8 3.2v145.5H55.3V3.2z" fill="white"/>',e:(e,t)=>'<path d="M22.2 148.7V3.2H127V35H61.7v25h59.9v32h-60v25h65.1v31.8z" fill="white"/>',n:(e,t)=>'<path d="M138 3.2v145.5h-33L52.5 72.3h-1v76.4H12.2V3.2h33.5l51.7 76.2h1.2V3.2z" fill="white"/>',t:(e,t)=>'<path d="M11.7 35V3.2h126.5V35H94.4v113.7h-39V35z" fill="white"/>'},xp={g:(e,t)=>'<path d="M101.6 51.1a20 20 0 0 0-14.7-14.5q-3.9-1-8.5-1.1-10 0-17 4.8A30 30 0 0 0 50.9 54q-3.6 9-3.6 21.6 0 12.8 3.5 21.8 3.4 9 10.3 14a29 29 0 0 0 17.2 4.8q9 0 15-2.6 6-2.7 9-7.5t3-11.4l6.8.7H78.7v-28h64.5v20q0 20-8.4 34.1a56 56 0 0 1-23.2 21.6Q97 150.6 78 150.6q-21.3 0-37.3-9t-25-25.8-9-39.7a87 87 0 0 1 5.4-32 67 67 0 0 1 38-38Q63 1 77.6 1q12.9 0 24 3.7 11.1 3.6 19.7 10.4a50 50 0 0 1 20.2 36z" fill="white"/>',r:(e,t)=>'<path d="M17.6 148.6V3h62.8q16.2 0 28.3 6 12 5.8 18.9 16.9a50 50 0 0 1 6.7 26.5q0 15.7-7 26.4A43 43 0 0 1 108 95q-12.5 5.5-29 5.5H41.3V69.9H71q7 0 11.8-1.7a15 15 0 0 0 7.6-5.6 17 17 0 0 0 2.7-10q0-6.3-2.7-10.2a15 15 0 0 0-7.6-5.8q-4.9-2-11.8-2H57v114zm85.2-66.8 36.4 66.8h-43L60.9 81.8z" fill="white"/>',a:(e,t)=>'<path d="M42.6 148.6H0L48 3h54l48 145.5h-42.7L75.5 43.2h-1.1zm-8-57.4h80.1v29.5h-80z" fill="white"/>',d:(e,t)=>'<path d="M67 148.6H11V3h55.4q22.5 0 38.8 8.7a60 60 0 0 1 25.3 25q9 16.4 9 39 0 22.8-9 39.1a61 61 0 0 1-25 25 81 81 0 0 1-38.5 8.7M50.5 115h15a44 44 0 0 0 18.5-3.4q7.6-3.6 11.6-12t4-23.8q0-15-4-23.7a24 24 0 0 0-12-12 47 47 0 0 0-19.2-3.5H50.5z" fill="white"/>',i:(e,t)=>'<path d="M94.8 3.1v145.5H55.3V3z" fill="white"/>',e:(e,t)=>'<path d="M22.2 148.6V3H127v32H61.7v25h59.9v31.8h-60v25h65.1v31.9z" fill="white"/>',n:(e,t)=>'<path d="M138 3.1v145.5h-33L52.5 72h-1v76.5H12.2V3h33.5l51.7 76.1h1.2v-76z" fill="white"/>',t:(e,t)=>'<path d="M11.7 35V3h126.5v32H94.4v113.7h-39V34.9z" fill="white"/>'},yp=Object.freeze(Object.defineProperty({__proto__:null,shape1:xp,shape2:bp},Symbol.toStringTag,{value:"Module"}));function ki({prng:e,group:t,width:r,height:n,values:o=[],rotation:s,offsetX:i,offsetY:a}){const l=yp,c=e.pick(o),u=e.integer(Math.min(...s),Math.max(...s)),p=e.integer(Math.min(...i),Math.max(...i)),f=e.integer(Math.min(...a),Math.max(...a));if(c&&l[t][c])return{name:c,value(m,g){var y,v,b;let C=l[t][c](m,g);return(this.rotation||this.offsetX||this.offsetY)&&(C=`<g transform="translate(${(y=this.offsetX)!==null&&y!==void 0?y:0}, ${(v=this.offsetY)!==null&&v!==void 0?v:0}) rotate(${(b=this.rotation)!==null&&b!==void 0?b:0} ${r/2} ${n/2})">${C}</g>`),C},rotation:u,offsetX:p,offsetY:f}}function wp({prng:e,options:t}){var r,n,o,s,i,a;const l=ki({prng:e,group:"shape2",values:t.shape2,width:150,height:150,rotation:!((r=t.shape2Rotation)===null||r===void 0)&&r.length?t.shape2Rotation:[0],offsetX:!((n=t.shape2OffsetX)===null||n===void 0)&&n.length?t.shape2OffsetX:[0],offsetY:!((o=t.shape2OffsetY)===null||o===void 0)&&o.length?t.shape2OffsetY:[0]}),c=ki({prng:e,group:"shape1",values:t.shape1,width:150,height:150,rotation:!((s=t.shape1Rotation)===null||s===void 0)&&s.length?t.shape1Rotation:[0],offsetX:!((i=t.shape1OffsetX)===null||i===void 0)&&i.length?t.shape1OffsetX:[0],offsetY:!((a=t.shape1OffsetY)===null||a===void 0)&&a.length?t.shape1OffsetY:[0]});return{shape2:l,shape1:c}}function _p({prng:e,options:t}){return{}}const kp={$schema:"http://json-schema.org/draft-07/schema#",properties:{backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["eb4747","eb6247","eb7e47","eb9947","ebb447","ebd047","ebeb47","d0eb47","b4eb47","99eb47","7eeb47","62eb47","47eb47","47eb62","47eb7e","47eb99","47ebb4","47ebd0","47ebeb","47d0eb","47b4eb","4799eb","477eeb","4762eb","4747eb","6247eb","7e47eb","9947eb","b447eb","d047eb","eb47eb","eb47d0","eb4799","eb477e","eb4762"]},shape1:{type:"array",items:{type:"string",enum:["g","r","a","d","i","e","n","t"]},default:["g","r","a","d","i","e","n","t"]},shape1OffsetX:{type:"array",items:{type:"integer",minimum:-80,maximum:80},maxItems:2,default:[-80,80]},shape1OffsetY:{type:"array",items:{type:"integer",minimum:-80,maximum:80},maxItems:2,default:[-80,80]},shape1Rotation:{type:"array",items:{type:"integer",minimum:-180,maximum:180},maxItems:2,default:[-180,180]},shape2:{type:"array",items:{type:"string",enum:["g","r","a","d","i","e","n","t"]},default:["g","r","a","d","i","e","n","t"]},shape2OffsetX:{type:"array",items:{type:"integer",minimum:-80,maximum:80},maxItems:2,default:[-80,80]},shape2OffsetY:{type:"array",items:{type:"integer",minimum:-80,maximum:80},maxItems:2,default:[-80,80]},shape2Rotation:{type:"array",items:{type:"integer",minimum:-160,maximum:160},maxItems:2,default:[-160,160]}}},Sp={title:"Glass",creator:"DiceBear",source:"https://www.dicebear.com",homepage:"https://www.dicebear.com",license:{name:"CC0 1.0",url:"https://creativecommons.org/publicdomain/zero/1.0/"}},Cp=({prng:e,options:t})=>{var r,n,o,s;const i=wp({prng:e,options:t}),a=_p({prng:e,options:t});return{attributes:{viewBox:"0 0 100 100",fill:"none","shape-rendering":"auto"},body:`<g style="mix-blend-mode:screen" opacity="0.6" filter="url(#dicebearGlass-a)"><g transform="translate(-25 -25)">${(n=(r=i.shape2)===null||r===void 0?void 0:r.value(i,a))!==null&&n!==void 0?n:""}</g></g><g style="mix-blend-mode:screen" opacity="0.6" filter="url(#dicebearGlass-b)"><g transform="translate(-25 -25)">${(s=(o=i.shape1)===null||o===void 0?void 0:o.value(i,a))!==null&&s!==void 0?s:""}</g></g><defs><filter id="dicebearGlass-a" x="-57" y="-57" width="214" height="214" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="16" result="effect1_foregroundBlur_25_7"/></filter><filter id="dicebearGlass-b" x="-57" y="-57" width="214" height="214" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur stdDeviation="16" result="effect1_foregroundBlur_25_7"/></filter></defs>`,extra:()=>({...Object.entries(i).reduce((l,[c,u])=>(l[c]=u==null?void 0:u.name,l),{}),...Object.entries(a).reduce((l,[c,u])=>(l[`${c}Color`]=u,l),{})})}},Tp=Object.freeze(Object.defineProperty({__proto__:null,create:Cp,meta:Sp,schema:kp},Symbol.toStringTag,{value:"Module"}));var Ap=B('<span class="inline-flex shrink-0 rounded-full overflow-hidden"><!></span>');function Ep(e,t){Fe(t,!0);let r=at(t,"size",3,24),n=_e(()=>s(t.event)),o=_e(()=>mp(Tp,{seed:d(n),size:r()}).toString());function s(l){const c=l.publisher_id,u=l.publisher_name;if(!c)return u??"anonymous";const p=c.indexOf(":"),f=p>0?c.slice(0,p):c,m=p>0?c.slice(p+1):null;return m?`${m}+${f}`:u?`${u}+${f}`:f}var i=Ap(),a=x(i);Bo(a,()=>d(o)),se(()=>er(i,`width: ${r()??""}px; height: ${r()??""}px`)),E(e,i),He()}const Qo=(e,t=Yn,r=Yn)=>{var n=ir(),o=Ce(n);{var s=c=>{var u=Mp(),p=Ce(u),f=x(p),m=x(f),g=k(p,2),y=x(g);{var v=C=>{var M=zp(),_=x(M);Bo(_,()=>xi(t().value)),E(C,M)},b=C=>{var M=ir(),_=Ce(M);qt(_,17,()=>t().value.split(`
61
+ `),mn,(z,w,A)=>{var R=Pp(),K=Ce(R);{var te=F=>{var P=Rp();E(F,P)};re(K,F=>{A>0&&F(te)})}var ie=k(K,1,!0);se(()=>oe(ie,d(w))),E(z,R)}),E(C,M)};re(y,C=>{t().markdown?C(v):C(b,!1)})}se(()=>{er(p,r()>0?`padding-left: ${r()*.75}rem`:""),oe(m,t().key),er(g,`padding-left: ${(r()+1)*.75}rem`)}),E(c,u)},i=c=>{var u=Lp(),p=x(u);{var f=v=>{var b=Ip(),C=Ce(b),M=x(C);se(()=>oe(M,t().key)),E(v,b)};re(p,v=>{t().key&&v(f)})}var m=k(p);{var g=v=>{var b=Op(),C=x(b);Bo(C,()=>xi(t().value)),E(v,b)},y=v=>{var b=je();se(()=>oe(b,t().value)),E(v,b)};re(m,v=>{t().markdown?v(g):v(y,!1)})}se(()=>er(u,r()>0?`padding-left: ${r()*.75}rem`:"")),E(c,u)},a=c=>{var u=$p(),p=Ce(u),f=x(p),m=x(f),g=k(p,2);qt(g,17,()=>t().children,mn,(y,v)=>{Qo(y,()=>d(v),()=>r()+1)}),se(()=>{er(p,r()>0?`padding-left: ${r()*.75}rem`:""),oe(m,t().key)}),E(c,u)},l=c=>{var u=Np(),p=Ce(u),f=x(p),m=x(f),g=k(p,2);qt(g,21,()=>t().items,mn,(y,v)=>{var b=jp(),C=x(b);{var M=z=>{var w=je();se(()=>oe(w,d(v)[0].value)),E(z,w)},_=z=>{var w=ir(),A=Ce(w);qt(A,17,()=>d(v),mn,(R,K)=>{Qo(R,()=>d(K),()=>r()+2)}),E(z,w)};re(C,z=>{d(v).length===1&&d(v)[0].kind==="text"&&!d(v)[0].key?z(M):z(_,!1)})}E(y,b)}),se(()=>{er(p,r()>0?`padding-left: ${r()*.75}rem`:""),oe(m,t().key),er(g,`padding-left: ${(r()+1)*.75}rem`)}),E(c,u)};re(o,c=>{t().kind==="text"&&t().multiline?c(s):t().kind==="text"?c(i,1):t().kind==="group"?c(a,2):c(l,!1)})}E(e,n)};var zp=B('<span class="prose-inline"><!></span>'),Rp=B("<br/>"),Pp=B("<!> ",1),Mp=B('<div><span class="font-semibold text-foreground/90"> </span><span class="text-foreground/50">:</span></div> <div class="break-words overflow-wrap-anywhere text-foreground/70"><!></div>',1),Ip=B('<span class="font-semibold text-foreground/90"> </span><span class="text-foreground/50">:</span>',1),Op=B('<span class="prose-inline"><!></span>'),Lp=B('<div class="break-words overflow-wrap-anywhere"><!><!></div>'),$p=B('<div><span class="font-semibold text-foreground/90"> </span><span class="text-foreground/50">:</span></div> <!>',1),jp=B('<li class="text-foreground/80"><!></li>'),Np=B('<div><span class="font-semibold text-foreground/90"> </span><span class="text-foreground/50">:</span></div> <ol class="list-decimal list-inside"></ol>',1),Bp=B('<span class="text-[10px] font-mono text-muted-foreground/60 bg-secondary/60 px-1.5 py-0 rounded"> </span>'),Gp=B('<button class="text-[10px] font-mono text-primary/60 hover:text-primary bg-primary/10 hover:bg-primary/20 px-1.5 py-0 rounded cursor-pointer transition-colors" title="Scroll to parent event">&#8593; reply</button>'),Dp=B('<button class="text-[10px] text-muted-foreground/0 group-hover:text-muted-foreground/40 hover:!text-foreground transition-colors px-1" title="Reply"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 17 4 12 9 7"></polyline><path d="M20 18v-2a4 4 0 0 0-4-4H4"></path></svg></button>'),qp=B('<div class="text-sm text-foreground/80 flex flex-col gap-0.5 pl-0"></div>'),Vp=B('<pre class="text-xs text-foreground/60 overflow-x-auto whitespace-pre-wrap break-all font-mono"> </pre>'),Fp=B('<div><div class="text-muted-foreground mb-0.5">Type</div> <div class="text-foreground font-mono"> </div></div>'),Hp=B('<div><div class="text-muted-foreground mb-0.5">Publisher</div> <div class="text-foreground"> </div></div>'),Up=B('<button type="button" class="fixed inset-0 bg-background/40 z-40" aria-label="Close detail panel"></button> <div class="fixed inset-y-0 right-0 w-72 max-w-[80vw] bg-card border-l border-border shadow-lg z-50 p-4 flex flex-col gap-3 animate-slide-in-right svelte-1i0f4p7"><div class="flex items-center justify-between"><h3 class="text-sm font-semibold">Event detail</h3> <button class="text-muted-foreground hover:text-foreground transition-colors" aria-label="Close"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg></button></div> <div class="flex flex-col gap-2 text-xs"><div><div class="text-muted-foreground mb-0.5">Created</div> <div class="text-foreground font-mono"> </div></div> <div><div class="text-muted-foreground mb-0.5">Event ID</div> <div class="text-foreground font-mono break-all select-all"> </div></div> <!> <!></div></div>',1),Wp=B('<div class="group py-2 px-2 hover:bg-secondary/30 rounded transition-colors"><div class="flex items-center gap-2 mb-0.5"><!> <span class="font-semibold text-sm text-foreground"> </span> <!> <!> <div class="ml-auto shrink-0 flex items-center gap-1"><!> <button class="text-[10px] text-muted-foreground/40 hover:text-foreground transition-colors relative"> </button></div></div> <!></div> <!>',1);function Zp(e,t){Fe(t,!0);let r=at(t,"viewMode",3,"pretty"),n=at(t,"canReply",3,!1),o=_e(()=>p(t.event.data)),s=_e(()=>tp(t.event.data)),i=_e(()=>ll(t.event.created_at)),a=_e(()=>uf(t.event.created_at)),l=_e(()=>g(t.event)),c=_e(()=>f(t.event.data)),u=D(!1);function p(H){try{return JSON.stringify(JSON.parse(H),null,2)}catch{return H}}function f(H){try{const G=JSON.parse(H);if(typeof G.in_reply_to=="string")return G.in_reply_to}catch{}return null}function m(H){const G=document.getElementById(`event-${H}`);G&&(G.scrollIntoView({behavior:"smooth",block:"center"}),G.classList.add("bg-primary/10"),setTimeout(()=>G.classList.remove("bg-primary/10"),1500))}function g(H){const G=H.publisher_id,ee=H.publisher_name;if(!ee&&!G)return null;const Z=(G==null?void 0:G.indexOf(":"))??-1,I=Z>0?G.slice(0,Z):null;return ee&&(I&&I!=="local")?`${ee} (@${I})`:ee||G}function y(){h(u,!d(u))}function v(){h(u,!1)}var b=Wp(),C=Ce(b),M=x(C),_=x(M);Ep(_,{get event(){return t.event},size:20});var z=k(_,2),w=x(z),A=k(z,2);{var R=H=>{var G=Bp(),ee=x(G);se(()=>oe(ee,t.event.type)),E(H,G)};re(A,H=>{t.event.type&&H(R)})}var K=k(A,2);{var te=H=>{var G=Gp();fe("click",G,()=>m(d(c))),E(H,G)};re(K,H=>{d(c)&&H(te)})}var ie=k(K,2),F=x(ie);{var P=H=>{var G=Dp();fe("click",G,()=>{var ee;return(ee=t.onReply)==null?void 0:ee.call(t,t.event.id)}),E(H,G)};re(F,H=>{n()&&H(P)})}var O=k(F,2),U=x(O),$=k(M,2);{var W=H=>{var G=qp();qt(G,21,()=>d(s),mn,(ee,Z)=>{Qo(ee,()=>d(Z),()=>0)}),E(H,G)},T=H=>{var G=Vp(),ee=x(G);se(()=>oe(ee,d(o))),E(H,G)};re($,H=>{r()==="pretty"&&d(s)?H(W):H(T,!1)})}var L=k(C,2);{var q=H=>{var G=Up(),ee=Ce(G),Z=k(ee,2),I=x(Z),N=k(x(I),2),j=k(I,2),ge=x(j),me=k(x(ge),2),Ee=x(me),Me=k(ge,2),ke=k(x(Me),2),ne=x(ke),Se=k(Me,2);{var Ae=vt=>{var It=Fp(),Ve=k(x(It),2),Qe=x(Ve);se(()=>oe(Qe,t.event.type)),E(vt,It)};re(Se,vt=>{t.event.type&&vt(Ae)})}var qe=k(Se,2);{var dr=vt=>{var It=Hp(),Ve=k(x(It),2),Qe=x(Ve);se(()=>oe(Qe,d(l))),E(vt,It)};re(qe,vt=>{d(l)&&vt(dr)})}se(()=>{oe(Ee,d(a)),oe(ne,t.event.id)}),fe("click",ee,v),fe("click",N,v),E(H,G)};re(L,H=>{d(u)&&H(q)})}se(()=>{Qr(C,"id",`event-${t.event.id??""}`),oe(w,d(l)??"anonymous"),oe(U,d(i))}),fe("click",O,y),E(e,b),He()}ht(["click"]);var Kp=B('<div class="flex items-center justify-center h-32 text-sm text-muted-foreground">No events yet. Waiting for signals...</div>'),Yp=B('<div class="border-t border-border/30 mx-2"></div>'),Jp=B("<!> <!>",1),Xp=B('<div class="mt-auto"></div> <div class="flex flex-col pt-2 pb-4"></div>',1),Qp=B('<div class="flex-1 overflow-auto px-4 flex flex-col"><!></div>');function eh(e,t){Fe(t,!0);let r=at(t,"viewMode",3,"pretty"),n=at(t,"canReply",3,!1),o=_e(()=>[...t.events].reverse()),s=D(void 0);Xr(()=>{t.events.length,d(s)&&wa().then(()=>{d(s).scrollTop=d(s).scrollHeight})});var i=Qp(),a=x(i);{var l=u=>{var p=Kp();E(u,p)},c=u=>{var p=Xp(),f=k(Ce(p),2);qt(f,23,()=>d(o),m=>m.id,(m,g,y)=>{var v=Jp(),b=Ce(v);{var C=_=>{var z=Yp();E(_,z)};re(b,_=>{d(y)>0&&_(C)})}var M=k(b,2);Zp(M,{get event(){return d(g)},get viewMode(){return r()},get canReply(){return n()},get onReply(){return t.onReply}}),E(m,v)}),E(u,p)};re(a,u=>{t.events.length===0?u(l):u(c,!1)})}fu(i,u=>h(s,u),()=>d(s)),E(e,i),He()}const th="modulepreload",rh=function(e){return"/"+e},Si={},nh=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){let i=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=i(r.map(c=>{if(c=rh(c),c in Si)return;Si[c]=!0;const u=c.endsWith(".css"),p=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const f=document.createElement("link");if(f.rel=u?"stylesheet":th,u||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),u)return new Promise((m,g)=>{f.addEventListener("load",m),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return o.then(i=>{for(const a of i||[])a.status==="rejected"&&s(a.reason);return t().catch(s)})};var oh=B("<button> </button>"),sh=B('<div class="absolute bottom-full left-0 mb-1 bg-popover border border-border rounded-md shadow-lg py-1 z-10 min-w-[120px]"></div>'),ih=B('<div class="relative"><button class="flex items-center gap-1 px-2 py-0.5 rounded text-[11px] bg-secondary text-muted-foreground hover:text-foreground transition-colors"><span class="font-mono"> </span> <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"></path></svg></button> <!></div>'),ah=B('<div class="flex items-center gap-1"><span class="text-[10px] text-muted-foreground/50">type:</span> <input type="text" class="bg-transparent border-none outline-none text-[11px] font-mono text-muted-foreground w-20 placeholder:text-muted-foreground/30" placeholder="message"/></div>'),lh=B('<div class="flex items-center gap-2 px-3 py-1 border-b border-border/50 text-[11px] text-muted-foreground"><svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 17 4 12 9 7"></polyline><path d="M20 18v-2a4 4 0 0 0-4-4H4"></path></svg> <span class="font-mono truncate"> </span> <button class="ml-auto text-muted-foreground/60 hover:text-foreground transition-colors" aria-label="Cancel reply"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></svg></button></div>'),ch=B('<input type="text" class="w-full bg-transparent outline-none text-sm text-foreground placeholder:text-muted-foreground/40" autocomplete="off"/>'),uh=B('<div class="text-sm text-muted-foreground/40 py-1">Loading editor...</div>'),dh=B('<button type="button" class="fixed inset-0 z-5" aria-label="Close dropdown"></button>'),fh=B('<div class="border-t border-border mx-4 mb-3 mt-1 mb-[calc(0.75rem+env(safe-area-inset-bottom))] rounded-lg border bg-secondary/30 max-h-[250px] flex flex-col"><div class="flex items-center gap-2 px-3 py-1.5 border-b border-border/50"><!></div> <!> <div class="px-3 py-2 flex-1 overflow-auto min-h-0"><!></div> <div class="flex items-center justify-between px-3 py-1.5 border-t border-border/50"><div class="flex items-center gap-1"></div> <button aria-label="Send"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"></path><path d="m21.854 2.147-10.94 10.939"></path></svg></button></div></div> <!>',1);function ph(e,t){Fe(t,!0);let r=at(t,"replyTo",15,null),n=D(""),o=D(wt({json:{}})),s=D("message"),i=D(""),a=D(!1),l=D(!1),c=D(null);async function u(){if(!d(c)){const I=await nh(()=>import("./json-editor-De2WPcl1.js"),__vite__mapDeps([0,1]));h(c,I.default,!0)}}let p=_e(()=>{const I=t.channel.config;if(!(I!=null&&I.types))return[];const N=Object.keys(I.types);return!I.strict&&N.length>0&&!N.includes("message")?[...N,"message"]:N}),f=_e(()=>d(p).length>0?d(s):d(i).trim()||"message"),m=_e(()=>{var N,j;if(!d(f))return null;const I=t.channel.config;return((j=(N=I==null?void 0:I.types)==null?void 0:N[d(f)])==null?void 0:j.schema)??null}),g=_e(()=>{var j;if(!d(m))return!1;const I=d(m).properties;if(!I)return!1;const N=Object.keys(I);return!(N.length===1&&((j=I[N[0]])==null?void 0:j.type)==="string")}),y=_e(()=>{if(d(g)||!d(m))return null;const I=d(m).properties;return I?Object.keys(I)[0]:null});function v(I){if(!I)return{};const N=I.properties;if(!N)return{};const j={};for(const[ge,me]of Object.entries(N))if(me.default!==void 0)j[ge]=me.default;else if(me.enum&&me.enum.length>0)j[ge]=me.enum[0];else{const Ee={string:"",number:0,boolean:!1,array:[],object:{}};j[ge]=Ee[me.type??"string"]??""}return j}function b(I){var j,ge;const N=t.channel.config;return((ge=(j=N==null?void 0:N.types)==null?void 0:j[I])==null?void 0:ge.schema)??null}let C=null;Xr(()=>{r()&&r()!==C&&h(s,"message"),C=r()});let M="",_="";Xr(()=>{const I=t.channel.id!==M,N=d(f)!==_;if(I){M=t.channel.id,h(n,""),h(i,"");const j=t.channel.config,ge=j!=null&&j.types?Object.keys(j.types):[];h(s,ge[0]??"message",!0)}if(I||N){_=d(f);const j=b(d(f));h(o,{json:v(j)},!0),d(g)&&u()}});async function z(I){if(!d(a)){h(a,!0);try{if(d(g)){let N;"json"in d(o)?N=d(o).json:"text"in d(o)&&(N=JSON.parse(d(o).text)),t.onPublish({type:d(f),data:N}),h(o,{json:v(d(m))},!0)}else{const N=d(n).trim();if(!N)return;let j;if(d(y))j={[d(y)]:N};else try{j=JSON.parse(N)}catch{j={body:N}}r()&&typeof j=="object"&&j!==null&&(j={...j,in_reply_to:r()}),t.onPublish({type:d(f),data:j}),h(n,""),r(null)}}catch{}finally{h(a,!1)}}}function w(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),z())}function A(I){h(s,I,!0),h(l,!1)}var R=fh(),K=Ce(R),te=x(K),ie=x(te);{var F=I=>{var N=ih(),j=x(N),ge=x(j),me=x(ge),Ee=k(j,2);{var Me=ke=>{var ne=sh();qt(ne,20,()=>d(p),Se=>Se,(Se,Ae)=>{var qe=oh(),dr=x(qe);se(()=>{Vt(qe,1,`w-full text-left px-3 py-1 text-[11px] font-mono transition-colors
62
+ ${d(f)===Ae?"bg-secondary text-foreground":"text-muted-foreground hover:text-foreground hover:bg-secondary/50"}`),oe(dr,Ae)}),fe("click",qe,()=>A(Ae)),E(Se,qe)}),E(ke,ne)};re(Ee,ke=>{d(l)&&ke(Me)})}se(()=>oe(me,d(f))),fe("click",j,()=>h(l,!d(l))),E(I,N)},P=I=>{var N=ah(),j=k(x(N),2);Jn(j,()=>d(i),ge=>h(i,ge)),E(I,N)};re(ie,I=>{d(p).length>0?I(F):I(P,!1)})}var O=k(te,2);{var U=I=>{var N=lh(),j=k(x(N),2),ge=x(j),me=k(j,2);se(Ee=>oe(ge,`Replying to ${Ee??""}...`),[()=>r().slice(0,12)]),fe("click",me,()=>r(null)),E(I,N)};re(O,I=>{r()&&I(U)})}var $=k(O,2),W=x($);{var T=I=>{var N=ch();se(()=>Qr(N,"placeholder",`Message #${t.channel.id??""}`)),fe("keydown",N,w),Jn(N,()=>d(n),j=>h(n,j)),E(I,N)},L=I=>{var N=ir(),j=Ce(N);ru(j,()=>d(c),(ge,me)=>{me(ge,{get schema(){return d(m)},get content(){return d(o)},set content(Ee){h(o,Ee,!0)}})}),E(I,N)},q=I=>{var N=uh();E(I,N)};re(W,I=>{d(g)?d(c)?I(L,1):I(q,!1):I(T)})}var H=k($,2),G=k(x(H),2),ee=k(K,2);{var Z=I=>{var N=dh();fe("click",N,()=>h(l,!1)),E(I,N)};re(ee,I=>{d(l)&&I(Z)})}se((I,N)=>{Vt(G,1,`flex items-center gap-1 px-2 py-1 rounded text-xs transition-colors
63
+ ${I??""}`),G.disabled=N},[()=>(d(g)||d(n).trim())&&!d(a)?"text-foreground hover:bg-secondary":"text-muted-foreground/30 cursor-default",()=>!d(g)&&!d(n).trim()||d(a)]),fe("click",G,()=>z()),E(e,R),He()}ht(["click","keydown"]);const hh=Wa({base:"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}});var vh=B("<button><!></button>");function Je(e,t){Fe(t,!0);let r=at(t,"variant",3,"default"),n=at(t,"size",3,"default"),o=bs(t,["$$slots","$$events","$$legacy","class","variant","size","children"]);var s=vh();gs(s,a=>({class:a,...o}),[()=>ks(hh({variant:r(),size:n()}),t.class)]);var i=x(s);Xc(i,()=>t.children??Yn),E(e,s),He()}var gh=B("<input/>");function $e(e,t){Fe(t,!0);let r=at(t,"value",15),n=bs(t,["$$slots","$$events","$$legacy","class","value"]);var o=gh();gs(o,s=>({class:s,...n}),[()=>ks("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",t.class)],void 0,void 0,void 0,!0),Jn(o,r),E(e,o),He()}var mh=B('<div class="bg-secondary rounded-md px-3 py-2 mb-4"><div class="text-sm font-medium text-foreground"> </div> <div class="text-xs text-muted-foreground mt-1 font-mono"> </div></div> <div class="flex gap-2"><!> <!></div>',1),bh=B('<p class="text-xs text-destructive"> </p>'),xh=B('<form class="flex flex-col gap-3"><!> <!> <div class="flex gap-2"><!> <!></div></form>'),yh=B('<div class="fixed inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center p-4" role="dialog" aria-modal="true" aria-label="Authentication" tabindex="-1"><div class="bg-card border border-border rounded-lg shadow-lg w-full max-w-sm p-6"><h2 class="font-semibold text-sm mb-1">Authentication</h2> <p class="text-xs text-muted-foreground mb-4">Paste an admin or publish token to unlock channels and publishing.</p> <!></div></div>');function wh(e,t){Fe(t,!0);let r=D(""),n=D(""),o=D(!1);async function s(p){p.preventDefault();const f=d(r).trim();if(!(!f||d(o))){h(n,""),h(o,!0);try{await t.onSave(f)?h(r,""):h(n,"Invalid token. Check that it is correct and not expired.")}catch{h(n,"Failed to validate token. Is the server reachable?")}finally{h(o,!1)}}}function i(p){p.target===p.currentTarget&&t.onClose()}function a(p){p.key==="Escape"&&t.onClose()}Xr(()=>{t.open&&h(n,"")});var l=ir(),c=Ce(l);{var u=p=>{var f=yh(),m=x(f),g=k(x(m),4);{var y=b=>{var C=mh(),M=Ce(C),_=x(M),z=x(_),w=k(_,2),A=x(w),R=k(M,2),K=x(R);Je(K,{variant:"destructive",size:"sm",class:"flex-1",get onclick(){return t.onLogout},children:(ie,F)=>{var P=je("Sign out");E(ie,P)},$$slots:{default:!0}});var te=k(K,2);Je(te,{variant:"outline",size:"sm",class:"flex-1",get onclick(){return t.onClose},children:(ie,F)=>{var P=je("Close");E(ie,P)},$$slots:{default:!0}}),se(ie=>{oe(z,`Signed in as ${(t.claims.name||t.claims.sub||"Unknown")??""}`),oe(A,ie)},[()=>t.claims.scopes.join(", ")]),E(b,C)},v=b=>{var C=xh(),M=x(C);$e(M,{type:"text",placeholder:"eyJhbGci...",oninput:()=>h(n,""),autocomplete:"off",spellcheck:"false",get value(){return d(r)},set value(K){h(r,K,!0)}});var _=k(M,2);{var z=K=>{var te=bh(),ie=x(te);se(()=>oe(ie,d(n))),E(K,te)};re(_,K=>{d(n)&&K(z)})}var w=k(_,2),A=x(w);{let K=_e(()=>!d(r).trim()||d(o));Je(A,{type:"submit",size:"sm",class:"flex-1",get disabled(){return d(K)},children:(te,ie)=>{var F=je();se(()=>oe(F,d(o)?"Verifying...":"Sign in")),E(te,F)},$$slots:{default:!0}})}var R=k(A,2);Je(R,{variant:"outline",size:"sm",class:"flex-1",get onclick(){return t.onClose},children:(K,te)=>{var ie=je("Cancel");E(K,ie)},$$slots:{default:!0}}),$n("submit",C,s),E(b,C)};re(g,b=>{t.currentToken&&t.claims?b(y):b(v,!1)})}fe("click",f,i),fe("keydown",f,a),E(p,f)};re(c,p=>{t.open&&p(u)})}E(e,l),He()}ht(["click","keydown"]);var _h=B('<p class="text-xs text-muted-foreground">Loading...</p>'),kh=B('<p class="text-xs text-destructive"> </p>'),Sh=B('<form class="flex flex-col gap-3"><label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Name</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Description</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Tags (comma-separated)</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Owner</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Company</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Email</span> <!></label> <!> <div class="flex gap-2 mt-1"><!></div></form>'),Ch=B('<div class="flex-1 flex flex-col min-w-0"><div class="flex items-center gap-3 px-4 h-12 border-b border-border shrink-0"><button class="p-1 rounded hover:bg-secondary transition-colors md:hidden" aria-label="Open channels"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line></svg></button> <h1 class="text-sm font-semibold">Server Configuration</h1></div> <div class="flex-1 overflow-y-auto p-4 md:p-6"><div class="max-w-lg mx-auto"><!></div></div></div>');function Th(e,t){Fe(t,!0);let r=D(!1),n=D(!1),o=D(""),s=D(!1),i=D(""),a=D(""),l=D(""),c=D(""),u=D(""),p=D("");async function f(){h(r,!0);try{const w=await t.client.getServerMeta();h(i,w.name??"",!0),h(a,w.description??"",!0),h(l,(w.tags??[]).join(", "),!0),h(c,w.owner??"",!0),h(u,w.company??"",!0),h(p,w.email??"",!0)}catch(w){h(o,w instanceof Error?w.message:"Failed to load",!0)}finally{h(r,!1)}}async function m(w){w.preventDefault(),h(n,!0),h(o,""),h(s,!1);try{await t.client.updateServerMeta({name:d(i)||void 0,description:d(a)||null,tags:d(l)?d(l).split(",").map(A=>A.trim()).filter(Boolean):[],owner:d(c)||null,company:d(u)||null,email:d(p)||null}),h(s,!0),t.onSaved(),setTimeout(()=>{h(s,!1)},2e3)}catch(A){h(o,A instanceof Error?A.message:"Failed to save",!0)}finally{h(n,!1)}}f();var g=Ch(),y=x(g),v=x(y),b=k(y,2),C=x(b),M=x(C);{var _=w=>{var A=_h();E(w,A)},z=w=>{var A=Sh(),R=x(A),K=k(x(R),2);$e(K,{placeholder:"My Zooid Server",get value(){return d(i)},set value(Z){h(i,Z,!0)}});var te=k(R,2),ie=k(x(te),2);$e(ie,{placeholder:"What this server is for",get value(){return d(a)},set value(Z){h(a,Z,!0)}});var F=k(te,2),P=k(x(F),2);$e(P,{placeholder:"ai, signals, trading",get value(){return d(l)},set value(Z){h(l,Z,!0)}});var O=k(F,2),U=k(x(O),2);$e(U,{placeholder:"Your name",get value(){return d(c)},set value(Z){h(c,Z,!0)}});var $=k(O,2),W=k(x($),2);$e(W,{placeholder:"Organization",get value(){return d(u)},set value(Z){h(u,Z,!0)}});var T=k($,2),L=k(x(T),2);$e(L,{type:"email",placeholder:"contact@example.com",get value(){return d(p)},set value(Z){h(p,Z,!0)}});var q=k(T,2);{var H=Z=>{var I=kh(),N=x(I);se(()=>oe(N,d(o))),E(Z,I)};re(q,Z=>{d(o)&&Z(H)})}var G=k(q,2),ee=x(G);Je(ee,{type:"submit",size:"sm",get disabled(){return d(n)},children:(Z,I)=>{var N=je();se(()=>oe(N,d(s)?"Saved!":d(n)?"Saving...":"Save")),E(Z,N)},$$slots:{default:!0}}),$n("submit",A,m),E(w,A)};re(M,w=>{d(r)?w(_):w(z,!1)})}fe("click",v,function(...w){var A;(A=t.onMenuClick)==null||A.apply(this,w)}),E(e,g),He()}ht(["click"]);var Ah=B('<div class="flex flex-col gap-3"><div class="bg-secondary rounded-md p-3"><div class="text-[10px] text-muted-foreground mb-1 uppercase tracking-wider">Token (shown once)</div> <div class="text-xs font-mono break-all select-all max-h-24 overflow-y-auto"> </div></div> <div class="flex gap-2"><!> <!></div></div>'),Eh=B('<p class="text-xs text-destructive"> </p>'),zh=B('<form class="flex flex-col gap-3"><label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Scopes (comma-separated)</span> <!> <span class="text-[10px] text-muted-foreground/60">admin, pub:channel, sub:channel, pub:*, sub:*</span></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Subject (optional)</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Display name (optional)</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Expires in (optional)</span> <!> <span class="text-[10px] text-muted-foreground/60">Leave empty for no expiry</span></label> <!> <div class="flex gap-2 mt-1"><!></div></form>'),Rh=B('<p class="text-xs text-muted-foreground">Loading...</p>'),Ph=B('<p class="text-xs text-muted-foreground/60 text-center py-4">No keys found</p>'),Mh=B('<div class="text-[10px] text-muted-foreground/60 mt-0.5 font-mono truncate"> </div>'),Ih=B('<div class="bg-secondary rounded-md px-3 py-2 flex items-start justify-between gap-2"><div class="min-w-0 flex-1"><div class="text-xs font-mono font-medium truncate"> </div> <div class="text-[10px] text-muted-foreground mt-0.5"> </div> <!></div> <!></div>'),Oh=B('<div class="flex flex-col gap-2"></div>'),Lh=B('<p class="text-xs text-destructive mt-3"> </p>'),$h=B('<div class="flex-1 flex flex-col min-w-0"><div class="flex items-center gap-3 px-4 h-12 border-b border-border shrink-0"><button class="p-1 rounded hover:bg-secondary transition-colors md:hidden" aria-label="Open channels"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line></svg></button> <h1 class="text-sm font-semibold">Keys & Tokens</h1></div> <div class="flex-1 overflow-y-auto p-4 md:p-6"><div class="max-w-lg mx-auto flex flex-col gap-8"><section><h2 class="font-semibold text-sm mb-1">Mint Token</h2> <p class="text-xs text-muted-foreground mb-4">Create a new JWT with custom scopes.</p> <!></section> <section><h2 class="font-semibold text-sm mb-1">Signing Keys</h2> <p class="text-xs text-muted-foreground mb-4">Trusted keys used to verify JWT tokens.</p> <!> <!></section></div></div></div>');function jh(e,t){Fe(t,!0);let r=D(wt([])),n=D(!1),o=D(""),s=D(null);async function i(){h(n,!0),h(o,"");try{h(r,await t.client.listKeys(),!0)}catch(L){h(o,L instanceof Error?L.message:"Failed to load keys",!0)}finally{h(n,!1)}}async function a(L){if(confirm(`Revoke key "${L}"? Tokens signed by this key will stop working.`)){h(s,L,!0),h(o,"");try{await t.client.revokeKey(L),h(r,d(r).filter(q=>q.kid!==L),!0)}catch(q){h(o,q instanceof Error?q.message:"Failed to revoke key",!0)}finally{h(s,null)}}}let l=D("pub:*, sub:*"),c=D(""),u=D(""),p=D(""),f=D(!1),m=D(""),g=D(""),y=D(!1);async function v(L){L.preventDefault(),h(f,!0),h(m,""),h(g,""),h(y,!1);const q=d(l).split(",").map(H=>H.trim()).filter(Boolean);if(q.length===0){h(m,"At least one scope is required"),h(f,!1);return}try{const H=await t.client.mintToken({scopes:q,sub:d(c)||void 0,name:d(u)||void 0,expires_in:d(p)||void 0});h(g,H.token,!0)}catch(H){h(m,H instanceof Error?H.message:"Failed to mint token",!0)}finally{h(f,!1)}}async function b(){await navigator.clipboard.writeText(d(g)),h(y,!0),setTimeout(()=>{h(y,!1)},2e3)}function C(){h(g,""),h(m,""),h(y,!1)}i();var M=$h(),_=x(M),z=x(_),w=k(_,2),A=x(w),R=x(A),K=k(x(R),4);{var te=L=>{var q=Ah(),H=x(q),G=k(x(H),2),ee=x(G),Z=k(H,2),I=x(Z);Je(I,{size:"sm",class:"flex-1",onclick:b,children:(j,ge)=>{var me=je();se(()=>oe(me,d(y)?"Copied!":"Copy")),E(j,me)},$$slots:{default:!0}});var N=k(I,2);Je(N,{variant:"outline",size:"sm",class:"flex-1",onclick:C,children:(j,ge)=>{var me=je("Mint another");E(j,me)},$$slots:{default:!0}}),se(()=>oe(ee,d(g))),E(L,q)},ie=L=>{var q=zh(),H=x(q),G=k(x(H),2);$e(G,{placeholder:"admin, pub:my-channel, sub:*",get value(){return d(l)},set value(ne){h(l,ne,!0)}});var ee=k(H,2),Z=k(x(ee),2);$e(Z,{placeholder:"my-bot",get value(){return d(c)},set value(ne){h(c,ne,!0)}});var I=k(ee,2),N=k(x(I),2);$e(N,{placeholder:"My Bot",get value(){return d(u)},set value(ne){h(u,ne,!0)}});var j=k(I,2),ge=k(x(j),2);$e(ge,{placeholder:"7d, 1h, 30m",get value(){return d(p)},set value(ne){h(p,ne,!0)}});var me=k(j,2);{var Ee=ne=>{var Se=Eh(),Ae=x(Se);se(()=>oe(Ae,d(m))),E(ne,Se)};re(me,ne=>{d(m)&&ne(Ee)})}var Me=k(me,2),ke=x(Me);{let ne=_e(()=>d(f)||!d(l).trim());Je(ke,{type:"submit",size:"sm",get disabled(){return d(ne)},children:(Se,Ae)=>{var qe=je();se(()=>oe(qe,d(f)?"Minting...":"Mint")),E(Se,qe)},$$slots:{default:!0}})}$n("submit",q,v),E(L,q)};re(K,L=>{d(g)?L(te):L(ie,!1)})}var F=k(R,2),P=k(x(F),4);{var O=L=>{var q=Rh();E(L,q)},U=L=>{var q=Ph();E(L,q)},$=L=>{var q=Oh();qt(q,21,()=>d(r),H=>H.kid,(H,G)=>{var ee=Ih(),Z=x(ee),I=x(Z),N=x(I),j=k(I,2),ge=x(j),me=k(j,2);{var Ee=ke=>{var ne=Mh(),Se=x(ne);se(Ae=>oe(Se,Ae),[()=>d(G).max_scopes.join(", ")]),E(ke,ne)};re(me,ke=>{d(G).max_scopes&&ke(Ee)})}var Me=k(Z,2);{let ke=_e(()=>d(s)===d(G).kid);Je(Me,{variant:"destructive",size:"sm",class:"shrink-0 text-[10px] h-6 px-2",get disabled(){return d(ke)},onclick:()=>a(d(G).kid),children:(ne,Se)=>{var Ae=je();se(()=>oe(Ae,d(s)===d(G).kid?"...":"Revoke")),E(ne,Ae)},$$slots:{default:!0}})}se(ke=>{oe(N,d(G).kid),oe(ge,`${d(G).crv??""} · ${d(G).issuer??"unknown issuer"??""} · ${ke??""}`)},[()=>ll(d(G).created_at)]),E(H,ee)}),E(L,q)};re(P,L=>{d(n)?L(O):d(r).length===0?L(U,1):L($,!1)})}var W=k(P,2);{var T=L=>{var q=Lh(),H=x(q);se(()=>oe(H,d(o))),E(L,q)};re(W,L=>{d(o)&&L(T)})}fe("click",z,function(...L){var q;(q=t.onMenuClick)==null||q.apply(this,L)}),E(e,M),He()}ht(["click"]);var Nh=B('<p class="text-xs text-destructive"> </p>'),Bh=B('<div class="fixed inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center p-4" role="dialog" aria-modal="true" aria-label="Create channel" tabindex="-1"><div class="bg-card border border-border rounded-lg shadow-lg w-full max-w-sm p-6"><h2 class="font-semibold text-sm mb-1">Create Channel</h2> <p class="text-xs text-muted-foreground mb-4">Create a new pub/sub channel.</p> <form class="flex flex-col gap-3"><label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Name</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">ID (slug)</span> <!> <span class="text-[10px] text-muted-foreground/60">Lowercase, hyphens, 3-64 chars</span></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Description (optional)</span> <!></label> <label class="flex items-center gap-2 cursor-pointer"><input type="checkbox" class="rounded border-border"/> <span class="text-xs text-muted-foreground">Public channel</span></label> <!> <div class="flex gap-2 mt-1"><!> <!></div></form></div></div>');function Gh(e,t){Fe(t,!0);let r=D(""),n=D(""),o=D(""),s=D(!0),i=D(!1),a=D("");Xr(()=>{t.open&&(h(r,""),h(n,""),h(o,""),h(s,!0),h(a,""))});function l(){(!d(r)||d(r)===c(d(n).slice(0,-1)))&&h(r,c(d(n)),!0)}function c(v){return v.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,64)}async function u(v){if(v.preventDefault(),!(!d(r).trim()||!d(n).trim())){h(i,!0),h(a,"");try{await t.client.createChannel({id:d(r).trim(),name:d(n).trim(),description:d(o).trim()||void 0,is_public:d(s)}),t.onCreated(d(r).trim()),t.onClose()}catch(b){h(a,b instanceof Error?b.message:"Failed to create channel",!0)}finally{h(i,!1)}}}function p(v){v.target===v.currentTarget&&t.onClose()}function f(v){v.key==="Escape"&&t.onClose()}var m=ir(),g=Ce(m);{var y=v=>{var b=Bh(),C=x(b),M=k(x(C),4),_=x(M),z=k(x(_),2);$e(z,{oninput:l,placeholder:"My Channel",get value(){return d(n)},set value(W){h(n,W,!0)}});var w=k(_,2),A=k(x(w),2);$e(A,{placeholder:"my-channel",get value(){return d(r)},set value(W){h(r,W,!0)}});var R=k(w,2),K=k(x(R),2);$e(K,{placeholder:"What this channel is for",get value(){return d(o)},set value(W){h(o,W,!0)}});var te=k(R,2),ie=x(te),F=k(te,2);{var P=W=>{var T=Nh(),L=x(T);se(()=>oe(L,d(a))),E(W,T)};re(F,W=>{d(a)&&W(P)})}var O=k(F,2),U=x(O);{let W=_e(()=>d(i)||!d(r).trim()||!d(n).trim());Je(U,{type:"submit",size:"sm",class:"flex-1",get disabled(){return d(W)},children:(T,L)=>{var q=je();se(()=>oe(q,d(i)?"Creating...":"Create")),E(T,q)},$$slots:{default:!0}})}var $=k(U,2);Je($,{variant:"outline",size:"sm",class:"flex-1",get onclick(){return t.onClose},children:(W,T)=>{var L=je("Cancel");E(W,L)},$$slots:{default:!0}}),fe("click",b,p),fe("keydown",b,f),$n("submit",M,u),Do(ie,()=>d(s),W=>h(s,W)),E(v,b)};re(g,v=>{t.open&&v(y)})}E(e,m),He()}ht(["click","keydown"]);var Dh=B('<p class="text-xs text-destructive"> </p>'),qh=B('<div class="fixed inset-0 bg-background/80 backdrop-blur-sm z-50 flex items-center justify-center p-4" role="dialog" aria-modal="true" aria-label="Edit channel" tabindex="-1"><div class="bg-card border border-border rounded-lg shadow-lg w-full max-w-sm p-6 max-h-[90vh] overflow-y-auto"><h2 class="font-semibold text-sm mb-1">Edit Channel</h2> <p class="text-xs text-muted-foreground mb-4 font-mono"> </p> <form class="flex flex-col gap-3"><label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Name</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Description</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Tags (comma-separated)</span> <!></label> <label class="flex items-center gap-2 cursor-pointer"><input type="checkbox" class="rounded border-border"/> <span class="text-xs text-muted-foreground">Public channel</span></label> <div class="border-t border-border pt-3 mt-1"><div class="text-[10px] font-semibold text-muted-foreground uppercase tracking-wider mb-2">Config</div> <div class="flex flex-col gap-3"><label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Storage (max events)</span> <!></label> <label class="flex flex-col gap-1"><span class="text-xs text-muted-foreground">Event types (JSON)</span> <textarea class="w-full bg-background border border-input rounded-md px-3 py-2 text-xs font-mono min-h-[80px] resize-y focus:outline-none focus:ring-1 focus:ring-ring" spellcheck="false"></textarea> <span class="text-[10px] text-muted-foreground/60">Define event type schemas as JSON</span></label> <label class="flex items-center gap-2 cursor-pointer"><input type="checkbox" class="rounded border-border"/> <span class="text-xs text-muted-foreground">Strict types (reject unknown types)</span></label></div></div> <!> <div class="flex gap-2 mt-1"><!> <!></div> <div class="border-t border-border pt-3 mt-1"><!></div></form></div></div>');function Vh(e,t){Fe(t,!0);let r=D(!1),n=D(""),o=D(!1),s=D(!1),i=D(""),a=D(""),l=D(""),c=D(!0),u=D(""),p=D(!1),f=D("");Xr(()=>{if(t.open&&t.channel){h(n,""),h(o,!1),h(i,t.channel.name,!0),h(a,t.channel.description??"",!0),h(l,(t.channel.tags??[]).join(", "),!0),h(c,t.channel.is_public,!0);const _=t.channel.config;h(u,(_==null?void 0:_.storage)!=null?String(_.storage):"",!0),h(p,!!(_!=null&&_.strict_types)),h(f,_!=null&&_.types?JSON.stringify(_.types,null,2):"",!0)}});async function m(_){if(_.preventDefault(),!t.channel)return;h(r,!0),h(n,"");let z=null;if(d(u)||d(f)||d(p)){if(z={},d(u)){const A=parseInt(d(u),10);!isNaN(A)&&A>0&&(z.storage=A)}if(d(f).trim())try{z.types=JSON.parse(d(f))}catch{h(n,"Invalid JSON in types definition"),h(r,!1);return}if(d(p)){if(!z.types){h(n,"strict_types requires types to be defined"),h(r,!1);return}z.strict_types=!0}}try{await t.client.updateChannel(t.channel.id,{name:d(i).trim()||void 0,description:d(a).trim()||null,tags:d(l)?d(l).split(",").map(A=>A.trim()).filter(Boolean):null,is_public:d(c),config:z}),t.onSaved(),t.onClose()}catch(A){h(n,A instanceof Error?A.message:"Failed to save",!0)}finally{h(r,!1)}}async function g(){if(t.channel){if(!d(o)){h(o,!0);return}h(s,!0),h(n,"");try{await t.client.deleteChannel(t.channel.id),t.onDeleted(),t.onClose()}catch(_){h(n,_ instanceof Error?_.message:"Failed to delete",!0)}finally{h(s,!1)}}}function y(_){_.target===_.currentTarget&&t.onClose()}function v(_){_.key==="Escape"&&t.onClose()}var b=ir(),C=Ce(b);{var M=_=>{var z=qh(),w=x(z),A=k(x(w),2),R=x(A),K=k(A,2),te=x(K),ie=k(x(te),2);$e(ie,{placeholder:"Channel name",get value(){return d(i)},set value(ne){h(i,ne,!0)}});var F=k(te,2),P=k(x(F),2);$e(P,{placeholder:"What this channel is for",get value(){return d(a)},set value(ne){h(a,ne,!0)}});var O=k(F,2),U=k(x(O),2);$e(U,{placeholder:"ai, signals",get value(){return d(l)},set value(ne){h(l,ne,!0)}});var $=k(O,2),W=x($),T=k($,2),L=k(x(T),2),q=x(L),H=k(x(q),2);$e(H,{type:"number",placeholder:"Default (unlimited)",get value(){return d(u)},set value(ne){h(u,ne,!0)}});var G=k(q,2),ee=k(x(G),2);Qr(ee,"placeholder",`{
64
+ "message": { ... },
65
+ "alert": { ... }
66
+ }`);var Z=k(G,2),I=x(Z),N=k(T,2);{var j=ne=>{var Se=Dh(),Ae=x(Se);se(()=>oe(Ae,d(n))),E(ne,Se)};re(N,ne=>{d(n)&&ne(j)})}var ge=k(N,2),me=x(ge);{let ne=_e(()=>d(r)||!d(i).trim());Je(me,{type:"submit",size:"sm",class:"flex-1",get disabled(){return d(ne)},children:(Se,Ae)=>{var qe=je();se(()=>oe(qe,d(r)?"Saving...":"Save")),E(Se,qe)},$$slots:{default:!0}})}var Ee=k(me,2);Je(Ee,{variant:"outline",size:"sm",class:"flex-1",get onclick(){return t.onClose},children:(ne,Se)=>{var Ae=je("Cancel");E(ne,Ae)},$$slots:{default:!0}});var Me=k(ge,2),ke=x(Me);Je(ke,{type:"button",variant:"destructive",size:"sm",class:"w-full text-[11px]",get disabled(){return d(s)},onclick:g,children:(ne,Se)=>{var Ae=ir(),qe=Ce(Ae);{var dr=Ve=>{var Qe=je("Deleting...");E(Ve,Qe)},vt=Ve=>{var Qe=je();se(()=>oe(Qe,`Confirm delete "${t.channel.id??""}"`)),E(Ve,Qe)},It=Ve=>{var Qe=je("Delete channel");E(Ve,Qe)};re(qe,Ve=>{d(s)?Ve(dr):d(o)?Ve(vt,1):Ve(It,!1)})}E(ne,Ae)},$$slots:{default:!0}}),se(()=>oe(R,t.channel.id)),fe("click",z,y),fe("keydown",z,v),$n("submit",K,m),Do(W,()=>d(c),ne=>h(c,ne)),Jn(ee,()=>d(f),ne=>h(f,ne)),Do(I,()=>d(p),ne=>h(p,ne)),E(_,z)};re(C,_=>{t.open&&t.channel&&_(M)})}E(e,b),He()}ht(["click","keydown"]);var Ci=class extends Error{constructor(t,r){super(r);le(this,"status");this.name="ZooidError",this.status=t}},Fh=class{constructor(e){le(this,"server");le(this,"token");le(this,"_fetch");this.server=e.server.replace(/\/+$/,""),this.token=e.token,this._fetch=e.fetch??globalThis.fetch.bind(globalThis)}async request(e,t,r){const n={};this.token&&(n.Authorization=`Bearer ${this.token}`),r!==void 0&&(n["Content-Type"]="application/json");let o;try{o=await this._fetch(this.server+t,{method:e,headers:n,body:r!==void 0?JSON.stringify(r):void 0})}catch(s){throw new Ci(0,`Cannot connect to ${this.server} — ${s instanceof Error?s.message:"network error"}`)}if(!o.ok){let s=`HTTP ${o.status}`;try{const i=await o.json();i.error&&(s=String(i.error))}catch{}throw new Ci(o.status,s)}if(o.status!==204)return o.json()}async getMetadata(){return this.request("GET","/.well-known/zooid.json")}async getServerMeta(){return this.request("GET","/api/v1/server")}async updateServerMeta(e){return this.request("PUT","/api/v1/server",e)}async listChannels(){return(await this.request("GET","/api/v1/channels")).channels}async createChannel(e){return this.request("POST","/api/v1/channels",e)}async updateChannel(e,t){return this.request("PATCH",`/api/v1/channels/${e}`,t)}async getClaim(e,t){const r={channels:e};return t&&(r.action=t),this.request("POST","/api/v1/directory/claim",r)}async getTokenClaims(){return this.request("GET","/api/v1/tokens/claims")}async mintToken(e){return this.request("POST","/api/v1/tokens",e)}async listKeys(){return(await this.request("GET","/api/v1/keys")).keys}async addKey(e){return this.request("POST","/api/v1/keys",e)}async revokeKey(e){await this.request("DELETE",`/api/v1/keys/${encodeURIComponent(e)}`)}async deleteChannel(e){await this.request("DELETE",`/api/v1/channels/${e}`)}async deleteEvent(e,t){await this.request("DELETE",`/api/v1/channels/${e}/events/${t}`)}async publish(e,t){const r={data:t.data};return t.type!==void 0&&(r.type=t.type),this.request("POST",`/api/v1/channels/${e}/events`,r)}async publishBatch(e,t){const r={events:t.map(o=>{const s={data:o.data};return o.type!==void 0&&(s.type=o.type),s})};return(await this.request("POST",`/api/v1/channels/${e}/events`,r)).events}tail(e,t){return t!=null&&t.follow?this.createTailStream(e,t):this.poll(e,t)}createTailStream(e,t){const r=[];let n=null,o=!1,s=null;this.subscribe(e,a=>{if(n){const l=n;n=null,l({value:a,done:!1})}else r.push(a)},{mode:t.mode,interval:t.interval,type:t.type}).then(a=>{s=a,o&&a()});const i={close(){o=!0,s==null||s(),n&&(n({value:void 0,done:!0}),n=null)},[Symbol.asyncIterator](){return{next(){return r.length>0?Promise.resolve({value:r.shift(),done:!1}):o?Promise.resolve({value:void 0,done:!0}):new Promise(a=>{n=a})},return(){return i.close(),Promise.resolve({value:void 0,done:!0})}}}};return i}async poll(e,t){const r=new URLSearchParams;t!=null&&t.cursor&&r.set("cursor",t.cursor),(t==null?void 0:t.limit)!==void 0&&r.set("limit",String(t.limit)),t!=null&&t.type&&r.set("type",t.type),t!=null&&t.since&&r.set("since",t.since);const n=r.toString(),o=`/api/v1/channels/${e}/events${n?`?${n}`:""}`;return this.request("GET",o)}async registerWebhook(e,t,r){return this.request("POST",`/api/v1/channels/${e}/webhooks`,{url:t,...r})}async removeWebhook(e,t){await this.request("DELETE",`/api/v1/channels/${e}/webhooks/${t}`)}async subscribe(e,t,r){const n=(r==null?void 0:r.mode)??"auto";if(n==="poll")return this.startPolling(e,t,r);const o=s=>new Promise((i,a)=>{const l=this.buildWsUrl(e,r),c=new globalThis.WebSocket(l);c.onopen=()=>{i(()=>{c.close()})},c.onmessage=u=>{try{const p=JSON.parse(String(u.data));t(p)}catch{}},c.onclose=()=>{},c.onerror=()=>{c.close(),s?setTimeout(()=>{o(!1).then(i,a)},1e3):n==="auto"?this.startPolling(e,t,r).then(i,a):a(new Error("WebSocket connection failed"))}});return o(!0)}buildWsUrl(e,t){const r=this.server.replace(/^http:\/\//,"ws://").replace(/^https:\/\//,"wss://"),n=new URLSearchParams;this.token&&n.set("token",this.token),t!=null&&t.type&&n.set("types",t.type);const o=n.toString();return`${r}/api/v1/channels/${e}/ws${o?`?${o}`:""}`}startPolling(e,t,r){const n=(r==null?void 0:r.interval)??5e3,o=r==null?void 0:r.type;let s=null,i=null,a=!1;const l=async()=>{try{const c={};s&&(c.cursor=s),o&&(c.type=o);const u=await this.poll(e,c);if(a)return;for(const p of u.events)t(p);u.cursor&&(s=u.cursor)}catch{}};return l(),i=setInterval(l,n),Promise.resolve(()=>{a=!0,i!==null&&(clearInterval(i),i=null)})}};const Ti={server_name:"Zooid",server_description:null,poll_interval:5,delivery:["poll"]};async function _o(e){try{const t=await fetch(`${e}/.well-known/zooid.json`);if(!t.ok)return Ti;const r=await t.json();return{server_name:r.server_name??"Zooid",server_description:r.server_description??null,poll_interval:r.poll_interval??5,delivery:Array.isArray(r.delivery)?r.delivery:["poll"],auth_url:r.auth_url??void 0}}catch{return Ti}}function Hh(e){return new Fh({server:window.location.origin,token:e})}async function Uh(e){try{const t=await fetch(`${e}/api/v1/auth/refresh`,{method:"POST",credentials:"include"});return t.ok?t.json():null}catch{return null}}async function Wh(e){try{await fetch(`${e}/api/v1/auth/logout`,{method:"POST",credentials:"include"})}catch{}}var Zh=B('<button type="button" class="fixed inset-0 bg-background/60 z-40 md:hidden" aria-label="Close sidebar"></button> <div class="fixed inset-y-0 left-0 w-60 z-50 md:hidden"><!></div>',1),Kh=B(`<div class="border-t border-border mx-4 mb-3 mt-1 mb-[calc(0.75rem+env(safe-area-inset-bottom))] px-3 py-2 rounded-lg border bg-secondary/20 text-xs text-muted-foreground/50 text-center">You don't have publish access to this channel</div>`),Yh=B('<div class="border-t border-border mx-4 mb-3 mt-1 mb-[calc(0.75rem+env(safe-area-inset-bottom))] px-3 py-2 rounded-lg border bg-secondary/20 text-xs text-muted-foreground/50 text-center"><button class="hover:text-muted-foreground transition-colors">Sign in to chat</button></div>'),Jh=B("<!> <!> <!>",1),Xh=B('<div class="flex-1 flex flex-col"><div class="flex items-center gap-3 px-4 h-12 border-b border-border"><button class="p-1 rounded hover:bg-secondary transition-colors md:hidden" aria-label="Open channels"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line></svg></button> <span class="text-sm text-muted-foreground"> </span></div></div>'),Qh=B('<button class="text-xs text-primary hover:text-primary/80 mt-1 transition-colors">Create a channel</button>'),ev=B('<p class="text-xs text-muted-foreground/60 mt-1">or create one with <code class="text-foreground/80">npx zooid channel create</code></p>'),tv=B('<div class="flex-1 flex flex-col items-center justify-center text-muted-foreground"><button class="p-2 rounded hover:bg-secondary transition-colors md:hidden mb-4" aria-label="Open channels"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="4" x2="20" y1="12" y2="12"></line><line x1="4" x2="20" y1="6" y2="6"></line><line x1="4" x2="20" y1="18" y2="18"></line></svg></button> <p class="text-sm">Select a channel</p> <!></div>'),rv=B('<div class="flex-1 flex flex-col min-w-0"><!></div>'),nv=B('<div class="flex h-dvh w-full overflow-hidden"><div class="hidden md:flex w-60 shrink-0"><!></div> <!> <!></div> <!> <!> <!>',1);function ov(e,t){Fe(t,!0);const r=60,n=[0,1e3,2e3,4e3,8e3],o=window.location.origin;let s=D(wt(localStorage.getItem("zooid_token")??"")),i=D(null),a=D(!1),l=_e(()=>Hh(d(s)||void 0)),c=_e(()=>{var V,ae;return((ae=(V=d(i))==null?void 0:V.scopes)==null?void 0:ae.includes("admin"))??!1}),u=D(wt([])),p=D(null),f=D(null),m=D(wt([])),g=D("pretty"),y=D("idle"),v=D(null),b=D(null),C=D(5),M=D(null),_=0,z=null,w=D("Zooid"),A=D(void 0),R=D(null),K=D(null),te=D(!1),ie=D(!1),F=D(!1),P=D("channel");const O=new Set;let U=_e(()=>{if(!d(i)||!d(p))return!1;const V=d(i).scopes;return V.includes("admin")?!0:V.some(ae=>ae===`pub:${d(p)}`||ae==="pub:*"||ae.endsWith("*")&&ae.startsWith("pub:")&&d(p).startsWith(ae.slice(4,-1)))}),$=_e(()=>{var ae;if(!d(U)||!d(f))return!1;const V=d(f).config;return V!=null&&V.strict?!!((ae=V==null?void 0:V.types)!=null&&ae.message):!0});function W(V){h(K,V,!0)}const T=window.location.pathname;if(T==="/_settings/keys-and-tokens")h(P,"keys-and-tokens"),document.title="Keys & Tokens — Zooid";else if(T==="/_settings/server")h(P,"server"),document.title="Server Config — Zooid";else{const V=T.match(/^\/([a-z0-9][a-z0-9-]{1,62}[a-z0-9])$/);V&&h(p,V[1],!0)}async function L(){var we;const V=localStorage.getItem("zooid_token");V&&V!==d(s)&&h(s,V,!0);const[ae]=await Promise.all([_o(o),q(),d(s)?H():Promise.resolve()]);h(w,ae.server_name,!0),h(C,ae.poll_interval,!0),h(A,ae.auth_url,!0),(we=d(i))!=null&&we.exp&&Se(),d(p)?G(d(p)):d(u).length>0&&G(d(u)[0].id)}async function q(){try{h(u,await d(l).listChannels(),!0)}catch{h(u,[],!0)}}async function H(){if(!d(s)){h(i,null);return}try{h(i,await d(l).getTokenClaims(),!0)}catch{h(i,null),h(s,""),localStorage.removeItem("zooid_token")}}function G(V){d(p)===V&&d(f)||(h(P,"channel"),h(p,V,!0),h(te,!1),window.history.pushState({},"",`/${V}`),document.title=`${V} — Zooid`,I())}function ee(V,ae){h(P,V,!0),h(p,null),h(f,null),Z(),h(y,"idle"),h(te,!1),window.history.pushState({},"",`/_settings/${V}`),document.title=`${ae} — Zooid`}function Z(){d(b)&&(clearInterval(d(b)),h(b,null)),z&&(clearTimeout(z),z=null),d(M)&&(d(M).close(),h(M,null)),O.clear(),h(m,[],!0),h(v,null),h(K,null)}async function I(){if(!d(p))return;Z(),h(y,"loading");try{const Ie=(await d(l).listChannels()).find(We=>We.id===d(p))??null;if(!Ie){h(f,null),h(y,"idle");return}h(f,Ie,!0)}catch{h(f,null),h(y,"idle");return}document.title=`${d(f).name} — Zooid`,Ee(d(p),d(s)||void 0),await N();const V=await _o(o);V.delivery.includes("websocket")&&V.poll_interval<=r?ge():(h(C,V.poll_interval,!0),j())}async function N(){var V;if(d(p))try{const ae=await d(l).poll(d(p),{cursor:d(v)??void 0,limit:50});if(ae.events.length>0){const Ie=ae.events.slice().reverse().filter(We=>!O.has(We.id));for(const We of Ie)O.add(We.id);d(v)&&Ie.length>0?h(m,[...Ie,...d(m)],!0):d(v)||h(m,Ie,!0),h(v,((V=ae.events[ae.events.length-1])==null?void 0:V.id)??d(v),!0)}}catch{h(y,"error")}}function j(){d(b)&&clearInterval(d(b)),h(y,"polling"),h(b,setInterval(async()=>{if(d(p))try{const ae=(await d(l).listChannels()).find(we=>we.id===d(p));ae&&h(f,ae,!0)}catch{}await N(),h(y,"polling")},d(C)*1e3),!0)}function ge(){if(!d(p))return;const V=window.location.protocol==="https:"?"wss:":"ws:",ae=new URL(`${V}//${window.location.host}/api/v1/channels/${d(p)}/ws`);d(s)&&ae.searchParams.set("token",d(s));const we=new WebSocket(ae.toString());we.addEventListener("open",()=>{h(y,"connected"),_=0,N()}),we.addEventListener("message",Ie=>{try{const We=JSON.parse(Ie.data);if(O.has(We.id))return;O.add(We.id),h(m,[We,...d(m)],!0),h(v,We.id,!0)}catch{}}),we.addEventListener("close",()=>{h(M,null),me()}),we.addEventListener("error",()=>{}),h(M,we,!0)}function me(){if(!d(p))return;if(_>=n.length){j();return}h(y,"reconnecting");const V=n[_];_++,z=setTimeout(()=>{z=null,ge()},V)}function Ee(V,ae){let we=document.querySelector('link[rel="alternate"][type="application/rss+xml"]');we||(we=document.createElement("link"),we.rel="alternate",we.type="application/rss+xml",document.head.appendChild(we)),we.href=ae?`${o}/api/v1/channels/${V}/rss?token=${ae}`:`${o}/api/v1/channels/${V}/rss`,we.title=`${V} RSS Feed`}function Me(){if(d(i)){h(a,!0);return}if(d(A)){window.location.href=d(A);return}h(a,!0)}async function ke(V){return h(s,V,!0),localStorage.setItem("zooid_token",V),await H(),d(i)?(h(a,!1),d(i).exp&&Se(),await q(),d(p)&&I(),!0):!1}async function ne(){d(R)&&(clearInterval(d(R)),h(R,null)),await Wh(o),h(s,""),h(i,null),localStorage.removeItem("zooid_token"),h(a,!1),q(),d(p)&&I()}function Se(){d(R)&&clearInterval(d(R)),h(R,setInterval(async()=>{var we;if(!((we=d(i))!=null&&we.exp))return;const V=Math.floor(Date.now()/1e3);if(d(i).exp-V<120){const Ie=await Uh(o);Ie!=null&&Ie.token?(h(s,Ie.token,!0),localStorage.setItem("zooid_token",d(s)),await H()):ne()}},3e4),!0)}async function Ae(V){if(!(!d(p)||!d(s)))try{await d(l).publish(d(p),V),await N()}catch{}}function qe(){_o(o).then(V=>{h(w,V.server_name,!0)})}function dr(V){q().then(()=>{G(V)})}function vt(){q(),d(p)&&I()}function It(){h(p,null),h(f,null),Z(),window.history.pushState({},"","/"),q()}window.addEventListener("popstate",()=>{const V=window.location.pathname;if(V==="/_settings/keys-and-tokens")h(P,"keys-and-tokens"),h(p,null),h(f,null),Z(),document.title="Keys & Tokens — Zooid";else if(V==="/_settings/server")h(P,"server"),h(p,null),h(f,null),Z(),document.title="Server Config — Zooid";else{h(P,"channel");const ae=V.match(/^\/([a-z0-9][a-z0-9-]{1,62}[a-z0-9])$/);ae?(h(p,ae[1],!0),I()):(h(p,null),h(f,null),Z())}}),L();var Ve=nv(),Qe=Ce(Ve),Os=x(Qe),wl=x(Os);{let V=_e(()=>!!d(i));ti(wl,{get channels(){return d(u)},get selectedId(){return d(p)},get serverName(){return d(w)},get hasAuth(){return d(V)},get isAdmin(){return d(c)},get status(){return d(y)},get pollInterval(){return d(C)},onSelect:G,onAuthClick:Me,onServerConfig:()=>ee("server","Server Config"),onKeysAndTokens:()=>ee("keys-and-tokens","Keys & Tokens"),onCreateChannel:()=>h(ie,!0)})}var Ls=k(Os,2);{var _l=V=>{var ae=Zh(),we=Ce(ae),Ie=k(we,2),We=x(Ie);{let fo=_e(()=>!!d(i));ti(We,{get channels(){return d(u)},get selectedId(){return d(p)},get serverName(){return d(w)},get hasAuth(){return d(fo)},get isAdmin(){return d(c)},get status(){return d(y)},get pollInterval(){return d(C)},onSelect:G,onAuthClick:()=>{h(te,!1),Me()},onClose:()=>h(te,!1),onServerConfig:()=>ee("server","Server Config"),onKeysAndTokens:()=>ee("keys-and-tokens","Keys & Tokens"),onCreateChannel:()=>{h(te,!1),h(ie,!0)}})}fe("click",we,()=>h(te,!1)),E(V,ae)};re(Ls,V=>{d(te)&&V(_l)})}var kl=k(Ls,2);{var Sl=V=>{jh(V,{get client(){return d(l)},onMenuClick:()=>h(te,!0)})},Cl=V=>{Th(V,{get client(){return d(l)},onMenuClick:()=>h(te,!0),onSaved:qe})},Tl=V=>{var ae=rv(),we=x(ae);{var Ie=Ot=>{var Kt=Jh(),fr=Ce(Kt);gf(fr,{get channel(){return d(f)},get isAdmin(){return d(c)},onMenuClick:()=>h(te,!0),onEditChannel:()=>h(F,!0),get viewMode(){return d(g)},set viewMode(gt){h(g,gt,!0)}});var pr=k(fr,2);eh(pr,{get events(){return d(m)},get viewMode(){return d(g)},get canReply(){return d($)},onReply:W});var an=k(pr,2);{var ln=gt=>{ph(gt,{get channel(){return d(f)},onPublish:Ae,get replyTo(){return d(K)},set replyTo(Nr){h(K,Nr,!0)}})},Yt=gt=>{var Nr=Kh();E(gt,Nr)},jr=gt=>{var Nr=Yh(),El=x(Nr);fe("click",El,Me),E(gt,Nr)};re(an,gt=>{d(U)?gt(ln):d(i)?gt(Yt,1):gt(jr,!1)})}E(Ot,Kt)},We=Ot=>{var Kt=Xh(),fr=x(Kt),pr=x(fr),an=k(pr,2),ln=x(an);se(()=>oe(ln,d(y)==="loading"?"Loading...":"Channel not found")),fe("click",pr,()=>h(te,!0)),E(Ot,Kt)},fo=Ot=>{var Kt=tv(),fr=x(Kt),pr=k(fr,4);{var an=Yt=>{var jr=Qh();fe("click",jr,()=>h(ie,!0)),E(Yt,jr)},ln=Yt=>{var jr=ev();E(Yt,jr)};re(pr,Yt=>{d(c)?Yt(an):Yt(ln,!1)})}fe("click",fr,()=>h(te,!0)),E(Ot,Kt)};re(we,Ot=>{d(f)?Ot(Ie):d(p)?Ot(We,1):Ot(fo,!1)})}E(V,ae)};re(kl,V=>{d(P)==="keys-and-tokens"?V(Sl):d(P)==="server"?V(Cl,1):V(Tl,!1)})}var $s=k(Qe,2);{let V=_e(()=>d(i)?d(s):null);wh($s,{get open(){return d(a)},get currentToken(){return d(V)},get claims(){return d(i)},onSave:ke,onLogout:ne,onClose:()=>h(a,!1)})}var js=k($s,2);Gh(js,{get open(){return d(ie)},get client(){return d(l)},onClose:()=>h(ie,!1),onCreated:dr});var Al=k(js,2);Vh(Al,{get open(){return d(F)},get channel(){return d(f)},get client(){return d(l)},onClose:()=>h(F,!1),onSaved:vt,onDeleted:It}),E(e,Ve),He()}ht(["click"]);Kc(ov,{target:document.getElementById("app")});export{Fs as $,re as A,vs as B,fu as C,E as D,He as E,Tc as F,x as G,k as H,ru as I,se as J,er as K,B as L,xv as M,dv as N,hv as O,vv as P,Ce as Q,qt as R,mn as S,Bo as T,Ta as U,bv as V,gs as W,dn as X,ir as Y,Qr as Z,Vt as _,Or as a,as as a0,nh as a1,uv as a2,za as a3,fv as a4,je as a5,oe as a6,Xc as a7,Yn as a8,fe as a9,_e as aa,ht as ab,D as ac,wa as ad,Jn as ae,mv as af,pc as ag,wt as ah,lv as b,Te as c,Mn as d,Ln as e,In as f,ds as g,gv as h,ts as i,rr as j,pv as k,Zl as l,iv as m,Ul as n,d as o,ao as p,h as q,tn as r,lc as s,us as t,Xr as u,lr as v,cv as w,Fe as x,at as y,$n as z};