uEdition-Editor 2.0.0b3__py3-none-any.whl → 2.0.0b4__py3-none-any.whl

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.

Potentially problematic release.


This version of uEdition-Editor might be problematic. Click here for more details.

@@ -1,16 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-BFeD7k_m.js","assets/index-Vcq4gwWv.js","assets/CodeMirrorEditor-ddcHt3UE.css","assets/TeiEditor-BeHkuEAu.js"])))=>i.map(i=>d[i]);
2
- var df=Object.defineProperty;var Po=t=>{throw TypeError(t)};var mf=(t,e,n)=>e in t?df(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _s=(t,e,n)=>mf(t,typeof e!="symbol"?e+"":e,n),gs=(t,e,n)=>e.has(t)||Po("Cannot "+n);var T=(t,e,n)=>(gs(t,e,"read from private field"),n?n.call(t):e.get(t)),he=(t,e,n)=>e.has(t)?Po("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),re=(t,e,n,r)=>(gs(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),Te=(t,e,n)=>(gs(t,e,"access private method"),n);var Ei=(t,e,n,r)=>({set _(i){re(t,e,i,n)},get _(){return T(t,e,r)}});(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function _e(){}const xi=t=>t;function ne(t,e){for(const n in e)t[n]=e[n];return t}function Ju(t){return t()}function Do(){return Object.create(null)}function Ae(t){t.forEach(Ju)}function Zn(t){return typeof t=="function"}function fe(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let wi;function R2(t,e){return t===e?!0:(wi||(wi=document.createElement("a")),wi.href=e,t===wi.href)}function pf(t){return Object.keys(t).length===0}function io(t,...e){if(t==null){for(const r of e)r(void 0);return _e}const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function $r(t){let e;return io(t,n=>e=n)(),e}function x(t,e,n){t.$$.on_destroy.push(io(e,n))}function ce(t,e,n,r){if(t){const i=xu(t,e,n,r);return t[0](i)}}function xu(t,e,n,r){return t[1]&&r?ne(n.ctx.slice(),t[1](r(e))):n.ctx}function de(t,e,n,r){if(t[2]&&r){const i=t[2](r(n));if(e.dirty===void 0)return i;if(typeof i=="object"){const s=[],o=Math.max(e.dirty.length,i.length);for(let u=0;u<o;u+=1)s[u]=e.dirty[u]|i[u];return s}return e.dirty|i}return e.dirty}function me(t,e,n,r,i,s){if(i){const o=xu(e,n,r,s);t.p(o,i)}}function pe(t){if(t.ctx.length>32){const e=[],n=t.ctx.length/32;for(let r=0;r<n;r++)e[r]=-1;return e}return-1}function vt(t){const e={};for(const n in t)n[0]!=="$"&&(e[n]=t[n]);return e}function Ke(t,e){const n={};e=new Set(e);for(const r in t)!e.has(r)&&r[0]!=="$"&&(n[r]=t[r]);return n}function Ve(t){return t&&Zn(t.destroy)?t.destroy:_e}const ea=typeof window<"u";let so=ea?()=>window.performance.now():()=>Date.now(),oo=ea?t=>requestAnimationFrame(t):_e;const or=new Set;function ta(t){or.forEach(e=>{e.c(t)||(or.delete(e),e.f())}),or.size!==0&&oo(ta)}function lo(t){let e;return or.size===0&&oo(ta),{promise:new Promise(n=>{or.add(e={c:t,f:n})}),abort(){or.delete(e)}}}function D(t,e){t.appendChild(e)}function na(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function hf(t){const e=S("style");return e.textContent="/* empty */",_f(na(t),e),e.sheet}function _f(t,e){return D(t.head||t,e),e.sheet}function w(t,e,n){t.insertBefore(e,n||null)}function E(t){t.parentNode&&t.parentNode.removeChild(t)}function fi(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function S(t){return document.createElement(t)}function Fs(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function X(t){return document.createTextNode(t)}function U(){return X(" ")}function Ie(){return X("")}function G(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function M(t,e,n){n==null?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}const gf=["width","height"];function ie(t,e){const n=Object.getOwnPropertyDescriptors(t.__proto__);for(const r in e)e[r]==null?t.removeAttribute(r):r==="style"?t.style.cssText=e[r]:r==="__value"?t.value=t[r]=e[r]:n[r]&&n[r].set&&gf.indexOf(r)===-1?t[r]=e[r]:M(t,r,e[r])}function bf(t,e){Object.keys(e).forEach(n=>{yf(t,n,e[n])})}function yf(t,e,n){const r=e.toLowerCase();r in t?t[r]=typeof t[r]=="boolean"&&n===""?!0:n:e in t?t[e]=typeof t[e]=="boolean"&&n===""?!0:n:M(t,e,n)}function Mi(t){return/-/.test(t)?bf:ie}function vf(t){return Array.from(t.childNodes)}function Ge(t,e){e=""+e,t.data!==e&&(t.data=e)}function it(t,e){t.value=e??""}function Lo(t,e,n){for(let r=0;r<t.options.length;r+=1){const i=t.options[r];if(i.__value===e){i.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function kf(t){const e=t.querySelector(":checked");return e&&e.__value}function ra(t,e,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(t,{detail:e,bubbles:n,cancelable:r})}function Io(t,e){return new t(e)}const Hi=new Map;let Vi=0;function Cf(t){let e=5381,n=t.length;for(;n--;)e=(e<<5)-e^t.charCodeAt(n);return e>>>0}function Ef(t,e){const n={stylesheet:hf(e),rules:{}};return Hi.set(t,n),n}function Bi(t,e,n,r,i,s,o,u=0){const l=16.666/r;let a=`{
3
- `;for(let y=0;y<=1;y+=l){const g=e+(n-e)*s(y);a+=y*100+`%{${o(g,1-g)}}
4
- `}const f=a+`100% {${o(n,1-n)}}
5
- }`,c=`__svelte_${Cf(f)}_${u}`,d=na(t),{stylesheet:m,rules:p}=Hi.get(d)||Ef(d,t);p[c]||(p[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=t.style.animation||"";return t.style.animation=`${_?`${_}, `:""}${c} ${r}ms linear ${i}ms 1 both`,Vi+=1,c}function Ui(t,e){const n=(t.style.animation||"").split(", "),r=n.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),i=n.length-r.length;i&&(t.style.animation=r.join(", "),Vi-=i,Vi||wf())}function wf(){oo(()=>{Vi||(Hi.forEach(t=>{const{ownerNode:e}=t.stylesheet;e&&E(e)}),Hi.clear())})}let Zr;function zr(t){Zr=t}function ci(){if(!Zr)throw new Error("Function called outside component initialization");return Zr}function es(t){ci().$$.on_mount.push(t)}function ts(t){ci().$$.on_destroy.push(t)}function Of(){const t=ci();return(e,n,{cancelable:r=!1}={})=>{const i=t.$$.callbacks[e];if(i){const s=ra(e,n,{cancelable:r});return i.slice().forEach(o=>{o.call(t,s)}),!s.defaultPrevented}return!0}}function bt(t,e){return ci().$$.context.set(t,e),e}function at(t){return ci().$$.context.get(t)}function Oe(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(r=>r.call(this,e))}const sr=[],ve=[];let lr=[];const Ps=[],ia=Promise.resolve();let Ds=!1;function sa(){Ds||(Ds=!0,ia.then(oa))}function Kt(){return sa(),ia}function ft(t){lr.push(t)}function Wt(t){Ps.push(t)}const bs=new Set;let er=0;function oa(){if(er!==0)return;const t=Zr;do{try{for(;er<sr.length;){const e=sr[er];er++,zr(e),Af(e.$$)}}catch(e){throw sr.length=0,er=0,e}for(zr(null),sr.length=0,er=0;ve.length;)ve.pop()();for(let e=0;e<lr.length;e+=1){const n=lr[e];bs.has(n)||(bs.add(n),n())}lr.length=0}while(sr.length);for(;Ps.length;)Ps.pop()();Ds=!1,bs.clear(),zr(t)}function Af(t){if(t.fragment!==null){t.update(),Ae(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(ft)}}function Tf(t){const e=[],n=[];lr.forEach(r=>t.indexOf(r)===-1?e.push(r):n.push(r)),n.forEach(r=>r()),lr=e}let Br;function uo(){return Br||(Br=Promise.resolve(),Br.then(()=>{Br=null})),Br}function Wn(t,e,n){t.dispatchEvent(ra(`${e?"intro":"outro"}${n}`))}const Li=new Set;let Xt;function ke(){Xt={r:0,c:[],p:Xt}}function Ce(){Xt.r||Ae(Xt.c),Xt=Xt.p}function b(t,e){t&&t.i&&(Li.delete(t),t.i(e))}function k(t,e,n,r){if(t&&t.o){if(Li.has(t))return;Li.add(t),Xt.c.push(()=>{Li.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}else r&&r()}const ao={duration:0};function Pn(t,e,n){const r={direction:"in"};let i=e(t,n,r),s=!1,o,u,l=0;function a(){o&&Ui(t,o)}function f(){const{delay:d=0,duration:m=300,easing:p=xi,tick:_=_e,css:y}=i||ao;y&&(o=Bi(t,0,1,m,d,p,y,l++)),_(0,1);const g=so()+d,h=g+m;u&&u.abort(),s=!0,ft(()=>Wn(t,!0,"start")),u=lo(v=>{if(s){if(v>=h)return _(1,0),Wn(t,!0,"end"),a(),s=!1;if(v>=g){const O=p((v-g)/m);_(O,1-O)}}return s})}let c=!1;return{start(){c||(c=!0,Ui(t),Zn(i)?(i=i(r),uo().then(f)):f())},invalidate(){c=!1},end(){s&&(a(),s=!1)}}}function Dn(t,e,n){const r={direction:"out"};let i=e(t,n,r),s=!0,o;const u=Xt;u.r+=1;let l;function a(){const{delay:f=0,duration:c=300,easing:d=xi,tick:m=_e,css:p}=i||ao;p&&(o=Bi(t,1,0,c,f,d,p));const _=so()+f,y=_+c;ft(()=>Wn(t,!1,"start")),"inert"in t&&(l=t.inert,t.inert=!0),lo(g=>{if(s){if(g>=y)return m(0,1),Wn(t,!1,"end"),--u.r||Ae(u.c),!1;if(g>=_){const h=d((g-_)/c);m(1-h,h)}}return s})}return Zn(i)?uo().then(()=>{i=i(r),a()}):a(),{end(f){f&&"inert"in t&&(t.inert=l),f&&i.tick&&i.tick(1,0),s&&(o&&Ui(t,o),s=!1)}}}function $n(t,e,n,r){let s=e(t,n,{direction:"both"}),o=r?0:1,u=null,l=null,a=null,f;function c(){a&&Ui(t,a)}function d(p,_){const y=p.b-o;return _*=Math.abs(y),{a:o,b:p.b,d:y,duration:_,start:p.start,end:p.start+_,group:p.group}}function m(p){const{delay:_=0,duration:y=300,easing:g=xi,tick:h=_e,css:v}=s||ao,O={start:so()+_,b:p};p||(O.group=Xt,Xt.r+=1),"inert"in t&&(p?f!==void 0&&(t.inert=f):(f=t.inert,t.inert=!0)),u||l?l=O:(v&&(c(),a=Bi(t,o,p,y,_,g,v)),p&&h(0,1),u=d(O,y),ft(()=>Wn(t,p,"start")),lo($=>{if(l&&$>l.start&&(u=d(l,y),l=null,Wn(t,u.b,"start"),v&&(c(),a=Bi(t,o,u.b,u.duration,0,g,s.css))),u){if($>=u.end)h(o=u.b,1-o),Wn(t,u.b,"end"),l||(u.b?c():--u.group.r||Ae(u.group.c)),u=null;else if($>=u.start){const C=$-u.start;o=u.a+u.d*g(C/u.duration),h(o,1-o)}}return!!(u||l)}))}return{run(p){Zn(s)?uo().then(()=>{s=s({direction:p?"in":"out"}),m(p)}):m(p)},end(){c(),u=l=null}}}function en(t){return(t==null?void 0:t.length)!==void 0?t:Array.from(t)}function Ne(t,e){const n={},r={},i={$$scope:1};let s=t.length;for(;s--;){const o=t[s],u=e[s];if(u){for(const l in o)l in u||(r[l]=1);for(const l in u)i[l]||(n[l]=u[l],i[l]=1);t[s]=u}else for(const l in o)i[l]=1}for(const o in r)o in n||(n[o]=void 0);return n}function Qt(t,e,n){const r=t.$$.props[e];r!==void 0&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function B(t){t&&t.c()}function H(t,e,n){const{fragment:r,after_update:i}=t.$$;r&&r.m(e,n),ft(()=>{const s=t.$$.on_mount.map(Ju).filter(Zn);t.$$.on_destroy?t.$$.on_destroy.push(...s):Ae(s),t.$$.on_mount=[]}),i.forEach(ft)}function V(t,e){const n=t.$$;n.fragment!==null&&(Tf(n.after_update),Ae(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function $f(t,e){t.$$.dirty[0]===-1&&(sr.push(t),sa(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function ge(t,e,n,r,i,s,o=null,u=[-1]){const l=Zr;zr(t);const a=t.$$={fragment:null,ctx:[],props:s,update:_e,not_equal:i,bound:Do(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(l?l.$$.context:[])),callbacks:Do(),dirty:u,skip_bound:!1,root:e.target||l.$$.root};o&&o(a.root);let f=!1;if(a.ctx=n?n(t,e.props||{},(c,d,...m)=>{const p=m.length?m[0]:d;return a.ctx&&i(a.ctx[c],a.ctx[c]=p)&&(!a.skip_bound&&a.bound[c]&&a.bound[c](p),f&&$f(t,c)),d}):[],a.update(),f=!0,Ae(a.before_update),a.fragment=r?r(a.ctx):!1,e.target){if(e.hydrate){const c=vf(e.target);a.fragment&&a.fragment.l(c),c.forEach(E)}else a.fragment&&a.fragment.c();e.intro&&b(t.$$.fragment),H(t,e.target,e.anchor),oa()}zr(l)}class be{constructor(){_s(this,"$$");_s(this,"$$set")}$destroy(){V(this,1),this.$destroy=_e}$on(e,n){if(!Zn(n))return _e;const r=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(e){this.$$set&&!pf(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Sf="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Sf);var Sr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Or=typeof window>"u"||"Deno"in globalThis;function Nt(){}function Rf(t,e){return typeof t=="function"?t(e):t}function Ls(t){return typeof t=="number"&&t>=0&&t!==1/0}function la(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ur(t,e){return typeof t=="function"?t(e):t}function Bt(t,e){return typeof t=="function"?t(e):t}function No(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:u}=t;if(o){if(r){if(e.queryHash!==fo(o,e.options))return!1}else if(!Xr(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||i&&i!==e.state.fetchStatus||s&&!s(e))}function Mo(t,e){const{exact:n,status:r,predicate:i,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(Qn(e.options.mutationKey)!==Qn(s))return!1}else if(!Xr(e.options.mutationKey,s))return!1}return!(r&&e.state.status!==r||i&&!i(e))}function fo(t,e){return((e==null?void 0:e.queryKeyHashFn)||Qn)(t)}function Qn(t){return JSON.stringify(t,(e,n)=>Is(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Xr(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Xr(t[n],e[n])):!1}function ua(t,e){if(t===e)return t;const n=Ho(t)&&Ho(e);if(n||Is(t)&&Is(e)){const r=n?t:Object.keys(t),i=r.length,s=n?e:Object.keys(e),o=s.length,u=n?[]:{};let l=0;for(let a=0;a<o;a++){const f=n?a:s[a];(!n&&r.includes(f)||n)&&t[f]===void 0&&e[f]===void 0?(u[f]=void 0,l++):(u[f]=ua(t[f],e[f]),u[f]===t[f]&&t[f]!==void 0&&l++)}return i===o&&l===i?t:u}return e}function Ki(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Ho(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Is(t){if(!Vo(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!Vo(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Vo(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ff(t){return new Promise(e=>{setTimeout(e,t)})}function Ns(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?ua(t,e):e}function Pf(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function Df(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var co=Symbol();function aa(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===co?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}var Hn,bn,dr,Ku,Lf=(Ku=class extends Sr{constructor(){super();he(this,Hn);he(this,bn);he(this,dr);re(this,dr,e=>{if(!Or&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){T(this,bn)||this.setEventListener(T(this,dr))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,bn))==null||e.call(this),re(this,bn,void 0))}setEventListener(e){var n;re(this,dr,e),(n=T(this,bn))==null||n.call(this),re(this,bn,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){T(this,Hn)!==e&&(re(this,Hn,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof T(this,Hn)=="boolean"?T(this,Hn):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Hn=new WeakMap,bn=new WeakMap,dr=new WeakMap,Ku),mo=new Lf,mr,yn,pr,ju,If=(ju=class extends Sr{constructor(){super();he(this,mr,!0);he(this,yn);he(this,pr);re(this,pr,e=>{if(!Or&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){T(this,yn)||this.setEventListener(T(this,pr))}onUnsubscribe(){var e;this.hasListeners()||((e=T(this,yn))==null||e.call(this),re(this,yn,void 0))}setEventListener(e){var n;re(this,pr,e),(n=T(this,yn))==null||n.call(this),re(this,yn,e(this.setOnline.bind(this)))}setOnline(e){T(this,mr)!==e&&(re(this,mr,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return T(this,mr)}},mr=new WeakMap,yn=new WeakMap,pr=new WeakMap,ju),ji=new If;function Ms(){let t,e;const n=new Promise((i,s)=>{t=i,e=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),t(i)},n.reject=i=>{r({status:"rejected",reason:i}),e(i)},n}function Nf(t){return Math.min(1e3*2**t,3e4)}function fa(t){return(t??"online")==="online"?ji.isOnline():!0}var ca=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function ys(t){return t instanceof ca}function da(t){let e=!1,n=0,r=!1,i;const s=Ms(),o=_=>{var y;r||(d(new ca(_)),(y=t.abort)==null||y.call(t))},u=()=>{e=!0},l=()=>{e=!1},a=()=>mo.isFocused()&&(t.networkMode==="always"||ji.isOnline())&&t.canRun(),f=()=>fa(t.networkMode)&&t.canRun(),c=_=>{var y;r||(r=!0,(y=t.onSuccess)==null||y.call(t,_),i==null||i(),s.resolve(_))},d=_=>{var y;r||(r=!0,(y=t.onError)==null||y.call(t,_),i==null||i(),s.reject(_))},m=()=>new Promise(_=>{var y;i=g=>{(r||a())&&_(g)},(y=t.onPause)==null||y.call(t)}).then(()=>{var _;i=void 0,r||(_=t.onContinue)==null||_.call(t)}),p=()=>{if(r)return;let _;const y=n===0?t.initialPromise:void 0;try{_=y??t.fn()}catch(g){_=Promise.reject(g)}Promise.resolve(_).then(c).catch(g=>{var C;if(r)return;const h=t.retry??(Or?0:3),v=t.retryDelay??Nf,O=typeof v=="function"?v(n,g):v,$=h===!0||typeof h=="number"&&n<h||typeof h=="function"&&h(n,g);if(e||!$){d(g);return}n++,(C=t.onFail)==null||C.call(t,n,g),Ff(O).then(()=>a()?void 0:m()).then(()=>{e?d(g):p()})})};return{promise:s,cancel:o,continue:()=>(i==null||i(),s),cancelRetry:u,continueRetry:l,canStart:f,start:()=>(f()?p():m().then(p),s)}}function Mf(){let t=[],e=0,n=u=>{u()},r=u=>{u()},i=u=>setTimeout(u,0);const s=u=>{e?t.push(u):i(()=>{n(u)})},o=()=>{const u=t;t=[],u.length&&i(()=>{r(()=>{u.forEach(l=>{n(l)})})})};return{batch:u=>{let l;e++;try{l=u()}finally{e--,e||o()}return l},batchCalls:u=>(...l)=>{s(()=>{u(...l)})},schedule:s,setNotifyFunction:u=>{n=u},setBatchNotifyFunction:u=>{r=u},setScheduler:u=>{i=u}}}var ut=Mf(),Vn,qu,ma=(qu=class{constructor(){he(this,Vn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ls(this.gcTime)&&re(this,Vn,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Or?1/0:5*60*1e3))}clearGcTimeout(){T(this,Vn)&&(clearTimeout(T(this,Vn)),re(this,Vn,void 0))}},Vn=new WeakMap,qu),hr,_r,It,Ct,oi,Bn,Ht,on,Wu,Hf=(Wu=class extends ma{constructor(e){super();he(this,Ht);he(this,hr);he(this,_r);he(this,It);he(this,Ct);he(this,oi);he(this,Bn);re(this,Bn,!1),re(this,oi,e.defaultOptions),this.setOptions(e.options),this.observers=[],re(this,It,e.cache),this.queryKey=e.queryKey,this.queryHash=e.queryHash,re(this,hr,Vf(this.options)),this.state=e.state??T(this,hr),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=T(this,Ct))==null?void 0:e.promise}setOptions(e){this.options={...T(this,oi),...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&T(this,It).remove(this)}setData(e,n){const r=Ns(this.state.data,e,this.options);return Te(this,Ht,on).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){Te(this,Ht,on).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var r,i;const n=(r=T(this,Ct))==null?void 0:r.promise;return(i=T(this,Ct))==null||i.cancel(e),n?n.then(Nt).catch(Nt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(T(this,hr))}isActive(){return this.observers.some(e=>Bt(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===co||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(e=0){return this.state.isInvalidated||this.state.data===void 0||!la(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(r=>r.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=T(this,Ct))==null||n.continue()}onOnline(){var n;const e=this.observers.find(r=>r.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=T(this,Ct))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),T(this,It).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(T(this,Ct)&&(T(this,Bn)?T(this,Ct).cancel({revert:!0}):T(this,Ct).cancelRetry()),this.scheduleGc()),T(this,It).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,Ht,on).call(this,{type:"invalidate"})}fetch(e,n){var l,a,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(T(this,Ct))return T(this,Ct).continueRetry(),T(this,Ct).promise}if(e&&this.setOptions(e),!this.options.queryFn){const c=this.observers.find(d=>d.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,i=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(re(this,Bn,!0),r.signal)})},s=()=>{const c=aa(this.options,n),d={queryKey:this.queryKey,meta:this.meta};return i(d),re(this,Bn,!1),this.options.persister?this.options.persister(c,d,this):c(d)},o={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(o),(l=this.options.behavior)==null||l.onFetch(o,this),re(this,_r,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((a=o.fetchOptions)==null?void 0:a.meta))&&Te(this,Ht,on).call(this,{type:"fetch",meta:(f=o.fetchOptions)==null?void 0:f.meta});const u=c=>{var d,m,p,_;ys(c)&&c.silent||Te(this,Ht,on).call(this,{type:"error",error:c}),ys(c)||((m=(d=T(this,It).config).onError)==null||m.call(d,c,this),(_=(p=T(this,It).config).onSettled)==null||_.call(p,this.state.data,c,this)),this.scheduleGc()};return re(this,Ct,da({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var d,m,p,_;if(c===void 0){u(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(y){u(y);return}(m=(d=T(this,It).config).onSuccess)==null||m.call(d,c,this),(_=(p=T(this,It).config).onSettled)==null||_.call(p,c,this.state.error,this),this.scheduleGc()},onError:u,onFail:(c,d)=>{Te(this,Ht,on).call(this,{type:"failed",failureCount:c,error:d})},onPause:()=>{Te(this,Ht,on).call(this,{type:"pause"})},onContinue:()=>{Te(this,Ht,on).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0})),T(this,Ct).start()}},hr=new WeakMap,_r=new WeakMap,It=new WeakMap,Ct=new WeakMap,oi=new WeakMap,Bn=new WeakMap,Ht=new WeakSet,on=function(e){const n=r=>{switch(e.type){case"failed":return{...r,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...pa(r.data,this.options),fetchMeta:e.meta??null};case"success":return{...r,data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=e.error;return ys(i)&&i.revert&&T(this,_r)?{...T(this,_r),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...e.state}}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),T(this,It).notify({query:this,type:"updated",action:e})})},Wu);function pa(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:fa(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Vf(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var zt,Qu,Bf=(Qu=class extends Sr{constructor(e={}){super();he(this,zt);this.config=e,re(this,zt,new Map)}build(e,n,r){const i=n.queryKey,s=n.queryHash??fo(i,n);let o=this.get(s);return o||(o=new Hf({cache:this,queryKey:i,queryHash:s,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(i)}),this.add(o)),o}add(e){T(this,zt).has(e.queryHash)||(T(this,zt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=T(this,zt).get(e.queryHash);n&&(e.destroy(),n===e&&T(this,zt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return T(this,zt).get(e)}getAll(){return[...T(this,zt).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>No(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>No(e,r)):n}notify(e){ut.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){ut.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},zt=new WeakMap,Qu),Gt,Et,Un,Yt,_n,zu,Uf=(zu=class extends ma{constructor(e){super();he(this,Yt);he(this,Gt);he(this,Et);he(this,Un);this.mutationId=e.mutationId,re(this,Et,e.mutationCache),re(this,Gt,[]),this.state=e.state||ha(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){T(this,Gt).includes(e)||(T(this,Gt).push(e),this.clearGcTimeout(),T(this,Et).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){re(this,Gt,T(this,Gt).filter(n=>n!==e)),this.scheduleGc(),T(this,Et).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){T(this,Gt).length||(this.state.status==="pending"?this.scheduleGc():T(this,Et).remove(this))}continue(){var e;return((e=T(this,Un))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var i,s,o,u,l,a,f,c,d,m,p,_,y,g,h,v,O,$,C,F;re(this,Un,da({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(R,j)=>{Te(this,Yt,_n).call(this,{type:"failed",failureCount:R,error:j})},onPause:()=>{Te(this,Yt,_n).call(this,{type:"pause"})},onContinue:()=>{Te(this,Yt,_n).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>T(this,Et).canRun(this)}));const n=this.state.status==="pending",r=!T(this,Un).canStart();try{if(!n){Te(this,Yt,_n).call(this,{type:"pending",variables:e,isPaused:r}),await((s=(i=T(this,Et).config).onMutate)==null?void 0:s.call(i,e,this));const j=await((u=(o=this.options).onMutate)==null?void 0:u.call(o,e));j!==this.state.context&&Te(this,Yt,_n).call(this,{type:"pending",context:j,variables:e,isPaused:r})}const R=await T(this,Un).start();return await((a=(l=T(this,Et).config).onSuccess)==null?void 0:a.call(l,R,e,this.state.context,this)),await((c=(f=this.options).onSuccess)==null?void 0:c.call(f,R,e,this.state.context)),await((m=(d=T(this,Et).config).onSettled)==null?void 0:m.call(d,R,null,this.state.variables,this.state.context,this)),await((_=(p=this.options).onSettled)==null?void 0:_.call(p,R,null,e,this.state.context)),Te(this,Yt,_n).call(this,{type:"success",data:R}),R}catch(R){try{throw await((g=(y=T(this,Et).config).onError)==null?void 0:g.call(y,R,e,this.state.context,this)),await((v=(h=this.options).onError)==null?void 0:v.call(h,R,e,this.state.context)),await(($=(O=T(this,Et).config).onSettled)==null?void 0:$.call(O,void 0,R,this.state.variables,this.state.context,this)),await((F=(C=this.options).onSettled)==null?void 0:F.call(C,void 0,R,e,this.state.context)),R}finally{Te(this,Yt,_n).call(this,{type:"error",error:R})}}finally{T(this,Et).runNext(this)}}},Gt=new WeakMap,Et=new WeakMap,Un=new WeakMap,Yt=new WeakSet,_n=function(e){const n=r=>{switch(e.type){case"failed":return{...r,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...r,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ut.batch(()=>{T(this,Gt).forEach(r=>{r.onMutationUpdate(e)}),T(this,Et).notify({mutation:this,type:"updated",action:e})})},zu);function ha(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var an,Vt,li,Gu,Kf=(Gu=class extends Sr{constructor(e={}){super();he(this,an);he(this,Vt);he(this,li);this.config=e,re(this,an,new Set),re(this,Vt,new Map),re(this,li,0)}build(e,n,r){const i=new Uf({mutationCache:this,mutationId:++Ei(this,li)._,options:e.defaultMutationOptions(n),state:r});return this.add(i),i}add(e){T(this,an).add(e);const n=Oi(e);if(typeof n=="string"){const r=T(this,Vt).get(n);r?r.push(e):T(this,Vt).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(T(this,an).delete(e)){const n=Oi(e);if(typeof n=="string"){const r=T(this,Vt).get(n);if(r)if(r.length>1){const i=r.indexOf(e);i!==-1&&r.splice(i,1)}else r[0]===e&&T(this,Vt).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=Oi(e);if(typeof n=="string"){const r=T(this,Vt).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===e}else return!0}runNext(e){var r;const n=Oi(e);if(typeof n=="string"){const i=(r=T(this,Vt).get(n))==null?void 0:r.find(s=>s!==e&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ut.batch(()=>{T(this,an).forEach(e=>{this.notify({type:"removed",mutation:e})}),T(this,an).clear(),T(this,Vt).clear()})}getAll(){return Array.from(T(this,an))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>Mo(n,r))}findAll(e={}){return this.getAll().filter(n=>Mo(e,n))}notify(e){ut.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return ut.batch(()=>Promise.all(e.map(n=>n.continue().catch(Nt))))}},an=new WeakMap,Vt=new WeakMap,li=new WeakMap,Gu);function Oi(t){var e;return(e=t.options.scope)==null?void 0:e.id}function Bo(t){return{onFetch:(e,n)=>{var f,c,d,m,p;const r=e.options,i=(d=(c=(f=e.fetchOptions)==null?void 0:f.meta)==null?void 0:c.fetchMore)==null?void 0:d.direction,s=((m=e.state.data)==null?void 0:m.pages)||[],o=((p=e.state.data)==null?void 0:p.pageParams)||[];let u={pages:[],pageParams:[]},l=0;const a=async()=>{let _=!1;const y=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(e.signal.aborted?_=!0:e.signal.addEventListener("abort",()=>{_=!0}),e.signal)})},g=aa(e.options,e.fetchOptions),h=async(v,O,$)=>{if(_)return Promise.reject();if(O==null&&v.pages.length)return Promise.resolve(v);const C={queryKey:e.queryKey,pageParam:O,direction:$?"backward":"forward",meta:e.options.meta};y(C);const F=await g(C),{maxPages:R}=e.options,j=$?Df:Pf;return{pages:j(v.pages,F,R),pageParams:j(v.pageParams,O,R)}};if(i&&s.length){const v=i==="backward",O=v?jf:Uo,$={pages:s,pageParams:o},C=O(r,$);u=await h($,C,v)}else{const v=t??s.length;do{const O=l===0?o[0]??r.initialPageParam:Uo(r,u);if(l>0&&O==null)break;u=await h(u,O),l++}while(l<v)}return u};e.options.persister?e.fetchFn=()=>{var _,y;return(y=(_=e.options).persister)==null?void 0:y.call(_,a,{queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=a}}}function Uo(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function jf(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var nt,vn,kn,gr,br,Cn,yr,vr,Yu,_a=(Yu=class{constructor(t={}){he(this,nt);he(this,vn);he(this,kn);he(this,gr);he(this,br);he(this,Cn);he(this,yr);he(this,vr);re(this,nt,t.queryCache||new Bf),re(this,vn,t.mutationCache||new Kf),re(this,kn,t.defaultOptions||{}),re(this,gr,new Map),re(this,br,new Map),re(this,Cn,0)}mount(){Ei(this,Cn)._++,T(this,Cn)===1&&(re(this,yr,mo.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,nt).onFocus())})),re(this,vr,ji.subscribe(async t=>{t&&(await this.resumePausedMutations(),T(this,nt).onOnline())})))}unmount(){var t,e;Ei(this,Cn)._--,T(this,Cn)===0&&((t=T(this,yr))==null||t.call(this),re(this,yr,void 0),(e=T(this,vr))==null||e.call(this),re(this,vr,void 0))}isFetching(t){return T(this,nt).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return T(this,vn).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=T(this,nt).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=T(this,nt).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ur(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return T(this,nt).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),i=T(this,nt).get(r.queryHash),s=i==null?void 0:i.state.data,o=Rf(e,s);if(o!==void 0)return T(this,nt).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return ut.batch(()=>T(this,nt).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=T(this,nt).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=T(this,nt);ut.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=T(this,nt),r={type:"active",...t};return ut.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries(r,e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=ut.batch(()=>T(this,nt).findAll(t).map(i=>i.cancel(n)));return Promise.all(r).then(Nt).catch(Nt)}invalidateQueries(t,e={}){return ut.batch(()=>{if(T(this,nt).findAll(t).forEach(r=>{r.invalidate()}),(t==null?void 0:t.refetchType)==="none")return Promise.resolve();const n={...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"};return this.refetchQueries(n,e)})}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=ut.batch(()=>T(this,nt).findAll(t).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Nt)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Nt)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=T(this,nt).build(this,e);return n.isStaleByTime(ur(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Nt).catch(Nt)}fetchInfiniteQuery(t){return t.behavior=Bo(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Nt).catch(Nt)}ensureInfiniteQueryData(t){return t.behavior=Bo(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return ji.isOnline()?T(this,vn).resumePausedMutations():Promise.resolve()}getQueryCache(){return T(this,nt)}getMutationCache(){return T(this,vn)}getDefaultOptions(){return T(this,kn)}setDefaultOptions(t){re(this,kn,t)}setQueryDefaults(t,e){T(this,gr).set(Qn(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...T(this,gr).values()],n={};return e.forEach(r=>{Xr(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){T(this,br).set(Qn(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...T(this,br).values()];let n={};return e.forEach(r=>{Xr(t,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...T(this,kn).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=fo(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===co&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...T(this,kn).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){T(this,nt).clear(),T(this,vn).clear()}},nt=new WeakMap,vn=new WeakMap,kn=new WeakMap,gr=new WeakMap,br=new WeakMap,Cn=new WeakMap,yr=new WeakMap,vr=new WeakMap,Yu),Tt,He,ui,wt,Kn,kr,En,Zt,ai,Cr,Er,jn,qn,wn,wr,ze,Wr,Hs,Vs,Bs,Us,Ks,js,qs,ga,Zu,qf=(Zu=class extends Sr{constructor(e,n){super();he(this,ze);he(this,Tt);he(this,He);he(this,ui);he(this,wt);he(this,Kn);he(this,kr);he(this,En);he(this,Zt);he(this,ai);he(this,Cr);he(this,Er);he(this,jn);he(this,qn);he(this,wn);he(this,wr,new Set);this.options=n,re(this,Tt,e),re(this,Zt,null),re(this,En,Ms()),this.options.experimental_prefetchInRender||T(this,En).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(T(this,He).addObserver(this),Ko(T(this,He),this.options)?Te(this,ze,Wr).call(this):this.updateResult(),Te(this,ze,Us).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ws(T(this,He),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ws(T(this,He),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,ze,Ks).call(this),Te(this,ze,js).call(this),T(this,He).removeObserver(this)}setOptions(e,n){const r=this.options,i=T(this,He);if(this.options=T(this,Tt).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Bt(this.options.enabled,T(this,He))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,ze,qs).call(this),T(this,He).setOptions(this.options),r._defaulted&&!Ki(this.options,r)&&T(this,Tt).getQueryCache().notify({type:"observerOptionsUpdated",query:T(this,He),observer:this});const s=this.hasListeners();s&&jo(T(this,He),i,this.options,r)&&Te(this,ze,Wr).call(this),this.updateResult(n),s&&(T(this,He)!==i||Bt(this.options.enabled,T(this,He))!==Bt(r.enabled,T(this,He))||ur(this.options.staleTime,T(this,He))!==ur(r.staleTime,T(this,He)))&&Te(this,ze,Hs).call(this);const o=Te(this,ze,Vs).call(this);s&&(T(this,He)!==i||Bt(this.options.enabled,T(this,He))!==Bt(r.enabled,T(this,He))||o!==T(this,wn))&&Te(this,ze,Bs).call(this,o)}getOptimisticResult(e){const n=T(this,Tt).getQueryCache().build(T(this,Tt),e),r=this.createResult(n,e);return Qf(this,r)&&(re(this,wt,r),re(this,kr,this.options),re(this,Kn,T(this,He).state)),r}getCurrentResult(){return T(this,wt)}trackResult(e,n){const r={};return Object.keys(e).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),e[i])})}),r}trackProp(e){T(this,wr).add(e)}getCurrentQuery(){return T(this,He)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=T(this,Tt).defaultQueryOptions(e),r=T(this,Tt).getQueryCache().build(T(this,Tt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(e){return Te(this,ze,Wr).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),T(this,wt)))}createResult(e,n){var R;const r=T(this,He),i=this.options,s=T(this,wt),o=T(this,Kn),u=T(this,kr),a=e!==r?e.state:T(this,ui),{state:f}=e;let c={...f},d=!1,m;if(n._optimisticResults){const j=this.hasListeners(),I=!j&&Ko(e,n),L=j&&jo(e,r,n,i);(I||L)&&(c={...c,...pa(f.data,e.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:p,errorUpdatedAt:_,status:y}=c;if(n.select&&c.data!==void 0)if(s&&c.data===(o==null?void 0:o.data)&&n.select===T(this,ai))m=T(this,Cr);else try{re(this,ai,n.select),m=n.select(c.data),m=Ns(s==null?void 0:s.data,m,n),re(this,Cr,m),re(this,Zt,null)}catch(j){re(this,Zt,j)}else m=c.data;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let j;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(u==null?void 0:u.placeholderData))j=s.data;else if(j=typeof n.placeholderData=="function"?n.placeholderData((R=T(this,Er))==null?void 0:R.state.data,T(this,Er)):n.placeholderData,n.select&&j!==void 0)try{j=n.select(j),re(this,Zt,null)}catch(I){re(this,Zt,I)}j!==void 0&&(y="success",m=Ns(s==null?void 0:s.data,j,n),d=!0)}T(this,Zt)&&(p=T(this,Zt),m=T(this,Cr),_=Date.now(),y="error");const g=c.fetchStatus==="fetching",h=y==="pending",v=y==="error",O=h&&g,$=m!==void 0,F={status:y,fetchStatus:c.fetchStatus,isPending:h,isSuccess:y==="success",isError:v,isInitialLoading:O,isLoading:O,data:m,dataUpdatedAt:c.dataUpdatedAt,error:p,errorUpdatedAt:_,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>a.dataUpdateCount||c.errorUpdateCount>a.errorUpdateCount,isFetching:g,isRefetching:g&&!h,isLoadingError:v&&!$,isPaused:c.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:v&&$,isStale:po(e,n),refetch:this.refetch,promise:T(this,En)};if(this.options.experimental_prefetchInRender){const j=N=>{F.status==="error"?N.reject(F.error):F.data!==void 0&&N.resolve(F.data)},I=()=>{const N=re(this,En,F.promise=Ms());j(N)},L=T(this,En);switch(L.status){case"pending":e.queryHash===r.queryHash&&j(L);break;case"fulfilled":(F.status==="error"||F.data!==L.value)&&I();break;case"rejected":(F.status!=="error"||F.error!==L.reason)&&I();break}}return F}updateResult(e){const n=T(this,wt),r=this.createResult(T(this,He),this.options);if(re(this,Kn,T(this,He).state),re(this,kr,this.options),T(this,Kn).data!==void 0&&re(this,Er,T(this,He)),Ki(r,n))return;re(this,wt,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,u=typeof o=="function"?o():o;if(u==="all"||!u&&!T(this,wr).size)return!0;const l=new Set(u??T(this,wr));return this.options.throwOnError&&l.add("error"),Object.keys(T(this,wt)).some(a=>{const f=a;return T(this,wt)[f]!==n[f]&&l.has(f)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),Te(this,ze,ga).call(this,{...i,...e})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,ze,Us).call(this)}},Tt=new WeakMap,He=new WeakMap,ui=new WeakMap,wt=new WeakMap,Kn=new WeakMap,kr=new WeakMap,En=new WeakMap,Zt=new WeakMap,ai=new WeakMap,Cr=new WeakMap,Er=new WeakMap,jn=new WeakMap,qn=new WeakMap,wn=new WeakMap,wr=new WeakMap,ze=new WeakSet,Wr=function(e){Te(this,ze,qs).call(this);let n=T(this,He).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Nt)),n},Hs=function(){Te(this,ze,Ks).call(this);const e=ur(this.options.staleTime,T(this,He));if(Or||T(this,wt).isStale||!Ls(e))return;const r=la(T(this,wt).dataUpdatedAt,e)+1;re(this,jn,setTimeout(()=>{T(this,wt).isStale||this.updateResult()},r))},Vs=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(T(this,He)):this.options.refetchInterval)??!1},Bs=function(e){Te(this,ze,js).call(this),re(this,wn,e),!(Or||Bt(this.options.enabled,T(this,He))===!1||!Ls(T(this,wn))||T(this,wn)===0)&&re(this,qn,setInterval(()=>{(this.options.refetchIntervalInBackground||mo.isFocused())&&Te(this,ze,Wr).call(this)},T(this,wn)))},Us=function(){Te(this,ze,Hs).call(this),Te(this,ze,Bs).call(this,Te(this,ze,Vs).call(this))},Ks=function(){T(this,jn)&&(clearTimeout(T(this,jn)),re(this,jn,void 0))},js=function(){T(this,qn)&&(clearInterval(T(this,qn)),re(this,qn,void 0))},qs=function(){const e=T(this,Tt).getQueryCache().build(T(this,Tt),this.options);if(e===T(this,He))return;const n=T(this,He);re(this,He,e),re(this,ui,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},ga=function(e){ut.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(T(this,wt))}),T(this,Tt).getQueryCache().notify({query:T(this,He),type:"observerResultsUpdated"})})},Zu);function Wf(t,e){return Bt(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function Ko(t,e){return Wf(t,e)||t.state.data!==void 0&&Ws(t,e,e.refetchOnMount)}function Ws(t,e,n){if(Bt(e.enabled,t)!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&po(t,e)}return!1}function jo(t,e,n,r){return(t!==e||Bt(r.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&po(t,n)}function po(t,e){return Bt(e.enabled,t)!==!1&&t.isStaleByTime(ur(e.staleTime,t))}function Qf(t,e){return!Ki(t.getCurrentResult(),e)}var On,An,$t,fn,dn,Ii,Qs,Xu,zf=(Xu=class extends Sr{constructor(n,r){super();he(this,dn);he(this,On);he(this,An);he(this,$t);he(this,fn);re(this,On,n),this.setOptions(r),this.bindMethods(),Te(this,dn,Ii).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=T(this,On).defaultMutationOptions(n),Ki(this.options,r)||T(this,On).getMutationCache().notify({type:"observerOptionsUpdated",mutation:T(this,$t),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Qn(r.mutationKey)!==Qn(this.options.mutationKey)?this.reset():((i=T(this,$t))==null?void 0:i.state.status)==="pending"&&T(this,$t).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=T(this,$t))==null||n.removeObserver(this)}onMutationUpdate(n){Te(this,dn,Ii).call(this),Te(this,dn,Qs).call(this,n)}getCurrentResult(){return T(this,An)}reset(){var n;(n=T(this,$t))==null||n.removeObserver(this),re(this,$t,void 0),Te(this,dn,Ii).call(this),Te(this,dn,Qs).call(this)}mutate(n,r){var i;return re(this,fn,r),(i=T(this,$t))==null||i.removeObserver(this),re(this,$t,T(this,On).getMutationCache().build(T(this,On),this.options)),T(this,$t).addObserver(this),T(this,$t).execute(n)}},On=new WeakMap,An=new WeakMap,$t=new WeakMap,fn=new WeakMap,dn=new WeakSet,Ii=function(){var r;const n=((r=T(this,$t))==null?void 0:r.state)??ha();re(this,An,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Qs=function(n){ut.batch(()=>{var r,i,s,o,u,l,a,f;if(T(this,fn)&&this.hasListeners()){const c=T(this,An).variables,d=T(this,An).context;(n==null?void 0:n.type)==="success"?((i=(r=T(this,fn)).onSuccess)==null||i.call(r,n.data,c,d),(o=(s=T(this,fn)).onSettled)==null||o.call(s,n.data,null,c,d)):(n==null?void 0:n.type)==="error"&&((l=(u=T(this,fn)).onError)==null||l.call(u,n.error,c,d),(f=(a=T(this,fn)).onSettled)==null||f.call(a,void 0,n.error,c,d))}this.listeners.forEach(c=>{c(T(this,An))})})},Xu);const tr=[];function yt(t,e){return{subscribe:Re(t,e).subscribe}}function Re(t,e=_e){let n;const r=new Set;function i(u){if(fe(t,u)&&(t=u,n)){const l=!tr.length;for(const a of r)a[1](),tr.push(a,t);if(l){for(let a=0;a<tr.length;a+=2)tr[a][0](tr[a+1]);tr.length=0}}}function s(u){i(u(t))}function o(u,l=_e){const a=[u,l];return r.add(a),r.size===1&&(n=e(i,s)||_e),u(t),()=>{r.delete(a),r.size===0&&n&&(n(),n=null)}}return{set:i,update:s,subscribe:o}}function Ue(t,e,n){const r=!Array.isArray(t),i=r?[t]:t;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return yt(n,(o,u)=>{let l=!1;const a=[];let f=0,c=_e;const d=()=>{if(f)return;c();const p=e(r?a[0]:a,o,u);s?o(p):c=Zn(p)?p:_e},m=i.map((p,_)=>io(p,y=>{a[_]=y,f&=~(1<<_),l&&d()},()=>{f|=1<<_}));return l=!0,d(),function(){Ae(m),c(),l=!1}})}function qo(t){return{subscribe:t.subscribe.bind(t)}}const ba="$$_queryClient",Gf=()=>{const t=at(ba);if(!t)throw new Error("No QueryClient was found in Svelte context. Did you forget to wrap your component with QueryClientProvider?");return t},Yf=t=>{bt(ba,t)},Zf="$$_isRestoring",Xf=()=>{try{const t=at(Zf);return t||yt(!1)}catch{return yt(!1)}};function Jf(){return Xf()}function Ot(t){return Gf()}function ya(t){return"subscribe"in t&&typeof t.subscribe=="function"}function va(){}function xf(t,e,n){const r=Ot(),i=Jf(),s=ya(t)?t:yt(t),o=Ue([s,i],([f,c])=>{const d=r.defaultQueryOptions(f);return d._optimisticResults=c?"isRestoring":"optimistic",d}),u=new e(r,$r(o));o.subscribe(f=>{u.setOptions(f,{listeners:!1})});const l=Ue(i,(f,c)=>{const d=f?va:u.subscribe(ut.batchCalls(c));return u.updateResult(),d}),{subscribe:a}=Ue([l,o],([f,c])=>(f=u.getOptimisticResult(c),c.notifyOnChangeProps?f:u.trackResult(f)));return{subscribe:a}}function Tn(t,e){return xf(t,qf)}function ns(t,e){const n=Ot(),r=ya(t)?t:yt(t),i=new zf(n,$r(r));let s;r.subscribe(l=>{s=(a,f)=>{i.mutate(a,f).catch(va)},i.setOptions(l)});const o=yt(i.getCurrentResult(),l=>i.subscribe(ut.batchCalls(a=>l(a)))),{subscribe:u}=Ue(o,l=>({...l,mutate:s,mutateAsync:l.mutate}));return{subscribe:u}}function ec(t){let e;const n=t[2].default,r=ce(n,t,t[1],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&2)&&me(r,n,i,i[1],e?de(n,i[1],s,null):pe(i[1]),null)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function tc(t,e,n){let{$$slots:r={},$$scope:i}=e,{client:s=new _a}=e;return es(()=>{s.mount()}),Yf(s),ts(()=>{s.unmount()}),t.$$set=o=>{"client"in o&&n(0,s=o.client),"$$scope"in o&&n(1,i=o.$$scope)},[s,i,r]}class nc extends be{constructor(e){super(),ge(this,e,tc,ec,fe,{client:0})}}var Wo=Object.prototype.hasOwnProperty;function Qo(t,e,n){for(n of t.keys())if(ar(n,e))return n}function ar(t,e){var n,r,i;if(t===e)return!0;if(t&&e&&(n=t.constructor)===e.constructor){if(n===Date)return t.getTime()===e.getTime();if(n===RegExp)return t.toString()===e.toString();if(n===Array){if((r=t.length)===e.length)for(;r--&&ar(t[r],e[r]););return r===-1}if(n===Set){if(t.size!==e.size)return!1;for(r of t)if(i=r,i&&typeof i=="object"&&(i=Qo(e,i),!i)||!e.has(i))return!1;return!0}if(n===Map){if(t.size!==e.size)return!1;for(r of t)if(i=r[0],i&&typeof i=="object"&&(i=Qo(e,i),!i)||!ar(r[1],e.get(i)))return!1;return!0}if(n===ArrayBuffer)t=new Uint8Array(t),e=new Uint8Array(e);else if(n===DataView){if((r=t.byteLength)===e.byteLength)for(;r--&&t.getInt8(r)===e.getInt8(r););return r===-1}if(ArrayBuffer.isView(t)){if((r=t.byteLength)===e.byteLength)for(;r--&&t[r]===e[r];);return r===-1}if(!n||typeof t=="object"){r=0;for(n in t)if(Wo.call(t,n)&&++r&&!Wo.call(e,n)||!(n in e)||!ar(t[n],e[n]))return!1;return Object.keys(e).length===r}}return t!==t&&e!==e}function P2(t,e,n,r=!0){const i=e-n;return i<=0?r?t[t.length-1]:t[0]:t[i]}function D2(t,e,n,r=!0){const i=e+n;return i>t.length-1?r?t[0]:t[t.length-1]:t[i]}function L2(t,e,n=!0){return e===t.length-1?n?t[0]:t[e]:t[e+1]}function I2(t,e,n=!0){return e<=0?n?t[t.length-1]:t[0]:t[e-1]}function rc(t){return t[t.length-1]}function ic(t,e){return t.map((n,r)=>t[(e+r)%t.length])}function N2(t,e,n=ar){const r=e.findIndex(i=>n(i,t));return r!==-1?e.splice(r,1):e.push(t),e}function Pt(t){return Object.keys(t).reduce((e,n)=>t[n]===void 0?e:e+`${n}:${t[n]};`,"")}function Gr(t){return t?!0:void 0}Pt({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function rs(t){if(t!==null)return""}function zo(t){function e(n){return n(t),()=>{}}return{subscribe:e}}function M2(t){if(!pt)return null;const e=document.querySelector(`[data-melt-id="${t}"]`);return J(e)?e:null}const Ai=t=>new Proxy(t,{get(e,n,r){return Reflect.get(e,n,r)},ownKeys(e){return Reflect.ownKeys(e).filter(n=>n!=="action")}}),Go=t=>typeof t=="function";Pe("empty");function Pe(t,e){const{stores:n,action:r,returned:i}=e??{},s=(()=>{if(n&&i)return Ue(n,u=>{const l=i(u);if(Go(l)){const a=(...f)=>Ai({...l(...f),[`data-melt-${t}`]:"",action:r??We});return a.action=r??We,a}return Ai({...l,[`data-melt-${t}`]:"",action:r??We})});{const u=i,l=u==null?void 0:u();if(Go(l)){const a=(...f)=>Ai({...l(...f),[`data-melt-${t}`]:"",action:r??We});return a.action=r??We,zo(a)}return zo(Ai({...l,[`data-melt-${t}`]:"",action:r??We}))}})(),o=r??(()=>{});return o.subscribe=s.subscribe,o}function Xn(t){const e=s=>s?`${t}-${s}`:t,n=s=>`data-melt-${t}${s?`-${s}`:""}`,r=s=>`[data-melt-${t}${s?`-${s}`:""}]`;return{name:e,attribute:n,selector:r,getEl:s=>document.querySelector(r(s))}}const pt=typeof document<"u",ka=t=>typeof t=="function";function di(t){return t instanceof Element}function J(t){return t instanceof HTMLElement}function H2(t){return t instanceof HTMLInputElement}function V2(t){return t instanceof HTMLLabelElement}function B2(t){return t instanceof HTMLButtonElement}function ln(t){const e=t.getAttribute("aria-disabled"),n=t.getAttribute("disabled"),r=t.hasAttribute("data-disabled");return!!(e==="true"||n!==null||r)}function U2(t){return J(t)?t.isContentEditable:!1}function sc(t){return t!==null&&typeof t=="object"}function Ca(t){return sc(t)&&"subscribe"in t}function rt(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function We(){}function gt(t,e,n,r){const i=Array.isArray(e)?e:[e];return i.forEach(s=>t.addEventListener(s,n,r)),()=>{i.forEach(s=>t.removeEventListener(s,n,r))}}function ye(t,e,n,r){const i=Array.isArray(e)?e:[e];if(typeof n=="function"){const s=lc(o=>n(o));return i.forEach(o=>t.addEventListener(o,s,r)),()=>{i.forEach(o=>t.removeEventListener(o,s,r))}}return()=>void 0}function oc(t){const e=t.currentTarget;if(!J(e))return null;const n=new CustomEvent(`m-${t.type}`,{detail:{originalEvent:t},cancelable:!0});return e.dispatchEvent(n),n}function lc(t){return e=>{const n=oc(e);if(!(n!=null&&n.defaultPrevented))return t(e)}}function zs(t){t.setAttribute("data-highlighted","")}function gn(t){t.removeAttribute("data-highlighted")}const Jr=t=>{try{es(t)}catch{return t}},Ea=t=>{try{ts(t)}catch{return t}};function Rr(t,...e){const n={};for(const r of Object.keys(t))e.includes(r)||(n[r]=t[r]);return n}function K2(t,e,n){return Object.fromEntries(Object.entries(t).filter(([r,i])=>!ar(i,e)))}function uc(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function Ze(t){return{...t,get:()=>$r(t)}}Ze.writable=function(t){const e=Re(t);let n=t;return{subscribe:e.subscribe,set(r){e.set(r),n=r},update(r){const i=r(n);e.set(i),n=i},get(){return n}}};Ze.derived=function(t,e){const n=new Map,r=()=>{const s=Array.isArray(t)?t.map(o=>o.get()):t.get();return e(s)};return{get:r,subscribe:s=>{const o=[];return(Array.isArray(t)?t:[t]).forEach(l=>{o.push(l.subscribe(()=>{s(r())}))}),s(r()),n.set(s,o),()=>{const l=n.get(s);if(l)for(const a of l)a();n.delete(s)}}}};const fr=(t,e)=>{const n=Ze(t),r=(s,o)=>{n.update(u=>{const l=s(u);let a=l;return e&&(a=e({curr:u,next:l})),o==null||o(a),a})};return{...n,update:r,set:s=>{r(()=>s)}}};function cn(t){return new Promise(e=>setTimeout(e,t))}let ac="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",wa=(t=21)=>{let e="",n=t|0;for(;n--;)e+=ac[Math.random()*64|0];return e};function fc(){return wa(10)}function xr(t){return t.reduce((e,n)=>(e[n]=fc(),e),{})}const ae={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"},cc=[ae.ARROW_DOWN,ae.PAGE_UP,ae.HOME],dc=[ae.ARROW_UP,ae.PAGE_DOWN,ae.END],Gs=[...cc,...dc],ei=[ae.ENTER,ae.SPACE],mc=(t="ltr",e="horizontal")=>({horizontal:t==="rtl"?ae.ARROW_LEFT:ae.ARROW_RIGHT,vertical:ae.ARROW_DOWN})[e],pc=(t="ltr",e="horizontal")=>({horizontal:t==="rtl"?ae.ARROW_RIGHT:ae.ARROW_LEFT,vertical:ae.ARROW_UP})[e],j2=(t="ltr",e="horizontal")=>({nextKey:mc(t,e),prevKey:pc(t,e)});function hc(t,e=500){let n=null;return function(...r){const i=()=>{n=null,t(...r)};n&&clearTimeout(n),n=setTimeout(i,e)}}const Oa=()=>typeof window<"u";function _c(){const t=navigator.userAgentData;return(t==null?void 0:t.platform)??navigator.platform}const Aa=t=>Oa()&&t.test(_c().toLowerCase()),gc=()=>Oa()&&!!navigator.maxTouchPoints,bc=()=>Aa(/^mac/)&&!gc(),yc=()=>Aa(/mac|iphone|ipad|ipod/i),vc=()=>yc()&&!bc(),vs="data-melt-scroll-lock";function Yo(t,e){if(!t)return;const n=t.style.cssText;return Object.assign(t.style,e),()=>{t.style.cssText=n}}function kc(t,e,n){if(!t)return;const r=t.style.getPropertyValue(e);return t.style.setProperty(e,n),()=>{r?t.style.setProperty(e,r):t.style.removeProperty(e)}}function Cc(t){const e=t.getBoundingClientRect().left;return Math.round(e)+t.scrollLeft?"paddingLeft":"paddingRight"}function ho(t){const e=document,n=e.defaultView??window,{documentElement:r,body:i}=e;if(i.hasAttribute(vs))return We;i.setAttribute(vs,"");const o=n.innerWidth-r.clientWidth,u=()=>kc(r,"--scrollbar-width",`${o}px`),l=Cc(r),a=n.getComputedStyle(i)[l],f=()=>Yo(i,{overflow:"hidden",[l]:`calc(${a} + ${o}px)`}),c=()=>{const{scrollX:m,scrollY:p,visualViewport:_}=n,y=(_==null?void 0:_.offsetLeft)??0,g=(_==null?void 0:_.offsetTop)??0,h=Yo(i,{position:"fixed",overflow:"hidden",top:`${-(p-Math.floor(g))}px`,left:`${-(m-Math.floor(y))}px`,right:"0",[l]:`calc(${a} + ${o}px)`});return()=>{h==null||h(),n.scrollTo(m,p)}},d=[u(),vc()?c():f()];return()=>{d.forEach(m=>m==null?void 0:m()),i.removeAttribute(vs)}}function qi(t){const{open:e,forceVisible:n,activeTrigger:r}=t;return Ue([e,n,r],([i,s,o])=>(i||s)&&o!==null)}function xe(t,e){let n;const r=Ue(t,s=>{n==null||n(),n=e(s)}).subscribe(We),i=()=>{r(),n==null||n()};return Ea(i),i}function Dt(t){const e={};return Object.keys(t).forEach(n=>{const r=n,i=t[r];e[r]=Ze(Re(i))}),e}function et(t){pt&&cn(1).then(()=>{const e=document.activeElement;!J(e)||e===t||(e.tabIndex=-1,t&&(t.tabIndex=0,t.focus()))})}function Ta(){return Array.from(document.querySelectorAll('a[href]:not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), textarea:not([disabled]):not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])'))}function $a(t){const e=Ta(),r=e.indexOf(t)+1,i=e[r];return r<e.length&&J(i)?i:null}function Sa(t){const e=Ta(),r=e.indexOf(t)-1,i=e[r];return r>=0&&J(i)?i:null}const Ec=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock"]),wc={onMatch:et,getCurrentItem:()=>document.activeElement};function Oc(t={}){const e={...wc,...t},n=Ze(Re([])),r=hc(()=>{n.update(()=>[])});return{typed:n,resetTyped:r,handleTypeaheadSearch:(s,o)=>{if(Ec.has(s))return;const u=e.getCurrentItem(),l=$r(n);if(!Array.isArray(l))return;l.push(s.toLowerCase()),n.set(l);const a=o.filter(y=>!(y.getAttribute("disabled")==="true"||y.getAttribute("aria-disabled")==="true"||y.hasAttribute("data-disabled"))),c=l.length>1&&l.every(y=>y===l[0])?l[0]:l.join(""),d=J(u)?a.indexOf(u):-1;let m=ic(a,Math.max(d,0));c.length===1&&(m=m.filter(y=>y!==u));const _=m.find(y=>(y==null?void 0:y.innerText)&&y.innerText.toLowerCase().startsWith(c.toLowerCase()));J(_)&&_!==u&&e.onMatch(_),r()}}}function Ac(t){let e=t.parentElement;for(;J(e)&&!e.hasAttribute("data-portal");)e=e.parentElement;return e||"body"}function Ar(t,e){return e!==void 0?e:Ac(t)==="body"?document.body:null}async function ti(t){const{prop:e,defaultEl:n}=t;if(await Promise.all([cn(1),Kt]),e===void 0){n==null||n.focus();return}const r=ka(e)?e(n):e;if(typeof r=="string"){const i=document.querySelector(r);if(!J(i))return;i.focus()}else J(r)&&r.focus()}yt(void 0,t=>{function e(r){t(r),t(void 0)}return gt(document,"pointerup",e,{passive:!1,capture:!0})});const Tc=yt(void 0,t=>{function e(r){r&&r.key===ae.ESCAPE&&t(r),t(void 0)}return gt(document,"keydown",e,{passive:!1})}),ni=(t,e={})=>{let n=We;function r(i={}){n();const s={enabled:!0,...i},o=Ca(s.enabled)?s.enabled:yt(s.enabled);n=rt(Tc.subscribe(u=>{var a;if(!u||!$r(o))return;const l=u.target;if(!(!J(l)||l.closest("[data-escapee]")!==t)){if(u.preventDefault(),s.ignore){if(ka(s.ignore)){if(s.ignore(u))return}else if(Array.isArray(s.ignore)&&s.ignore.length>0&&s.ignore.some(f=>f&&l===f))return}(a=s.handler)==null||a.call(s,u)}}),xe(o,u=>{u?t.dataset.escapee="":delete t.dataset.escapee}))}return r(e),{update:r,destroy(){t.removeAttribute("data-escapee"),n()}}},Sn=Math.min,Ft=Math.max,Wi=Math.round,Ti=Math.floor,xt=t=>({x:t,y:t}),$c={left:"right",right:"left",bottom:"top",top:"bottom"},Sc={start:"end",end:"start"};function Ys(t,e,n){return Ft(t,Sn(e,n))}function Fr(t,e){return typeof t=="function"?t(e):t}function Rn(t){return t.split("-")[0]}function Pr(t){return t.split("-")[1]}function Ra(t){return t==="x"?"y":"x"}function _o(t){return t==="y"?"height":"width"}function zn(t){return["top","bottom"].includes(Rn(t))?"y":"x"}function go(t){return Ra(zn(t))}function Rc(t,e,n){n===void 0&&(n=!1);const r=Pr(t),i=go(t),s=_o(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(o=Qi(o)),[o,Qi(o)]}function Fc(t){const e=Qi(t);return[Zs(t),e,Zs(e)]}function Zs(t){return t.replace(/start|end/g,e=>Sc[e])}function Pc(t,e,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:r:e?r:i;case"left":case"right":return e?s:o;default:return[]}}function Dc(t,e,n,r){const i=Pr(t);let s=Pc(Rn(t),n==="start",r);return i&&(s=s.map(o=>o+"-"+i),e&&(s=s.concat(s.map(Zs)))),s}function Qi(t){return t.replace(/left|right|bottom|top/g,e=>$c[e])}function Lc(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fa(t){return typeof t!="number"?Lc(t):{top:t,right:t,bottom:t,left:t}}function zi(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Zo(t,e,n){let{reference:r,floating:i}=t;const s=zn(e),o=go(e),u=_o(o),l=Rn(e),a=s==="y",f=r.x+r.width/2-i.width/2,c=r.y+r.height/2-i.height/2,d=r[u]/2-i[u]/2;let m;switch(l){case"top":m={x:f,y:r.y-i.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:c};break;case"left":m={x:r.x-i.width,y:c};break;default:m={x:r.x,y:r.y}}switch(Pr(e)){case"start":m[o]-=d*(n&&a?-1:1);break;case"end":m[o]+=d*(n&&a?-1:1);break}return m}const Ic=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:o}=n,u=s.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let a=await o.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:c}=Zo(a,r,l),d=r,m={},p=0;for(let _=0;_<u.length;_++){const{name:y,fn:g}=u[_],{x:h,y:v,data:O,reset:$}=await g({x:f,y:c,initialPlacement:r,placement:d,strategy:i,middlewareData:m,rects:a,platform:o,elements:{reference:t,floating:e}});f=h??f,c=v??c,m={...m,[y]:{...m[y],...O}},$&&p<=50&&(p++,typeof $=="object"&&($.placement&&(d=$.placement),$.rects&&(a=$.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:i}):$.rects),{x:f,y:c}=Zo(a,d,l)),_=-1)}return{x:f,y:c,placement:d,strategy:i,middlewareData:m}};async function bo(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:s,rects:o,elements:u,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:f="viewport",elementContext:c="floating",altBoundary:d=!1,padding:m=0}=Fr(e,t),p=Fa(m),y=u[d?c==="floating"?"reference":"floating":c],g=zi(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:a,rootBoundary:f,strategy:l})),h=c==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),O=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},$=zi(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:v,strategy:l}):h);return{top:(g.top-$.top+p.top)/O.y,bottom:($.bottom-g.bottom+p.bottom)/O.y,left:(g.left-$.left+p.left)/O.x,right:($.right-g.right+p.right)/O.x}}const Nc=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:s,platform:o,elements:u,middlewareData:l}=e,{element:a,padding:f=0}=Fr(t,e)||{};if(a==null)return{};const c=Fa(f),d={x:n,y:r},m=go(i),p=_o(m),_=await o.getDimensions(a),y=m==="y",g=y?"top":"left",h=y?"bottom":"right",v=y?"clientHeight":"clientWidth",O=s.reference[p]+s.reference[m]-d[m]-s.floating[p],$=d[m]-s.reference[m],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a));let F=C?C[v]:0;(!F||!await(o.isElement==null?void 0:o.isElement(C)))&&(F=u.floating[v]||s.floating[p]);const R=O/2-$/2,j=F/2-_[p]/2-1,I=Sn(c[g],j),L=Sn(c[h],j),N=I,A=F-_[p]-L,P=F/2-_[p]/2+R,q=Ys(N,P,A),W=!l.arrow&&Pr(i)!=null&&P!==q&&s.reference[p]/2-(P<N?I:L)-_[p]/2<0,oe=W?P<N?P-N:P-A:0;return{[m]:d[m]+oe,data:{[m]:q,centerOffset:P-q-oe,...W&&{alignmentOffset:oe}},reset:W}}}),Mc=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:s,rects:o,initialPlacement:u,platform:l,elements:a}=e,{mainAxis:f=!0,crossAxis:c=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:_=!0,...y}=Fr(t,e);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const g=Rn(i),h=zn(u),v=Rn(u)===u,O=await(l.isRTL==null?void 0:l.isRTL(a.floating)),$=d||(v||!_?[Qi(u)]:Fc(u)),C=p!=="none";!d&&C&&$.push(...Dc(u,_,p,O));const F=[u,...$],R=await bo(e,y),j=[];let I=((r=s.flip)==null?void 0:r.overflows)||[];if(f&&j.push(R[g]),c){const P=Rc(i,o,O);j.push(R[P[0]],R[P[1]])}if(I=[...I,{placement:i,overflows:j}],!j.every(P=>P<=0)){var L,N;const P=(((L=s.flip)==null?void 0:L.index)||0)+1,q=F[P];if(q)return{data:{index:P,overflows:I},reset:{placement:q}};let W=(N=I.filter(oe=>oe.overflows[0]<=0).sort((oe,se)=>oe.overflows[1]-se.overflows[1])[0])==null?void 0:N.placement;if(!W)switch(m){case"bestFit":{var A;const oe=(A=I.filter(se=>{if(C){const z=zn(se.placement);return z===h||z==="y"}return!0}).map(se=>[se.placement,se.overflows.filter(z=>z>0).reduce((z,le)=>z+le,0)]).sort((se,z)=>se[1]-z[1])[0])==null?void 0:A[0];oe&&(W=oe);break}case"initialPlacement":W=u;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function Hc(t,e){const{placement:n,platform:r,elements:i}=t,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Rn(n),u=Pr(n),l=zn(n)==="y",a=["left","top"].includes(o)?-1:1,f=s&&l?-1:1,c=Fr(e,t);let{mainAxis:d,crossAxis:m,alignmentAxis:p}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return u&&typeof p=="number"&&(m=u==="end"?p*-1:p),l?{x:m*f,y:d*a}:{x:d*a,y:m*f}}const Vc=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:s,placement:o,middlewareData:u}=e,l=await Hc(e,t);return o===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:s+l.y,data:{...l,placement:o}}}}},Bc=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:s=!0,crossAxis:o=!1,limiter:u={fn:y=>{let{x:g,y:h}=y;return{x:g,y:h}}},...l}=Fr(t,e),a={x:n,y:r},f=await bo(e,l),c=zn(Rn(i)),d=Ra(c);let m=a[d],p=a[c];if(s){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",h=m+f[y],v=m-f[g];m=Ys(h,m,v)}if(o){const y=c==="y"?"top":"left",g=c==="y"?"bottom":"right",h=p+f[y],v=p-f[g];p=Ys(h,p,v)}const _=u.fn({...e,[d]:m,[c]:p});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[d]:s,[c]:o}}}}}},Uc=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:s,platform:o,elements:u}=e,{apply:l=()=>{},...a}=Fr(t,e),f=await bo(e,a),c=Rn(i),d=Pr(i),m=zn(i)==="y",{width:p,height:_}=s.floating;let y,g;c==="top"||c==="bottom"?(y=c,g=d===(await(o.isRTL==null?void 0:o.isRTL(u.floating))?"start":"end")?"left":"right"):(g=c,y=d==="end"?"top":"bottom");const h=_-f.top-f.bottom,v=p-f.left-f.right,O=Sn(_-f[y],h),$=Sn(p-f[g],v),C=!e.middlewareData.shift;let F=O,R=$;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(R=v),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(F=h),C&&!d){const I=Ft(f.left,0),L=Ft(f.right,0),N=Ft(f.top,0),A=Ft(f.bottom,0);m?R=p-2*(I!==0||L!==0?I+L:Ft(f.left,f.right)):F=_-2*(N!==0||A!==0?N+A:Ft(f.top,f.bottom))}await l({...e,availableWidth:R,availableHeight:F});const j=await o.getDimensions(u.floating);return p!==j.width||_!==j.height?{reset:{rects:!0}}:{}}}};function is(){return typeof window<"u"}function Dr(t){return Pa(t)?(t.nodeName||"").toLowerCase():"#document"}function Lt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function nn(t){var e;return(e=(Pa(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Pa(t){return is()?t instanceof Node||t instanceof Lt(t).Node:!1}function jt(t){return is()?t instanceof Element||t instanceof Lt(t).Element:!1}function tn(t){return is()?t instanceof HTMLElement||t instanceof Lt(t).HTMLElement:!1}function Xo(t){return!is()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Lt(t).ShadowRoot}function mi(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=qt(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(i)}function Kc(t){return["table","td","th"].includes(Dr(t))}function ss(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function yo(t){const e=vo(),n=jt(t)?qt(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function jc(t){let e=Fn(t);for(;tn(e)&&!Tr(e);){if(yo(e))return e;if(ss(e))return null;e=Fn(e)}return null}function vo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Tr(t){return["html","body","#document"].includes(Dr(t))}function qt(t){return Lt(t).getComputedStyle(t)}function os(t){return jt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fn(t){if(Dr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Xo(t)&&t.host||nn(t);return Xo(e)?e.host:e}function Da(t){const e=Fn(t);return Tr(e)?t.ownerDocument?t.ownerDocument.body:t.body:tn(e)&&mi(e)?e:Da(e)}function ri(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Da(t),s=i===((r=t.ownerDocument)==null?void 0:r.body),o=Lt(i);if(s){const u=Xs(o);return e.concat(o,o.visualViewport||[],mi(i)?i:[],u&&n?ri(u):[])}return e.concat(i,ri(i,[],n))}function Xs(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function La(t){const e=qt(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=tn(t),s=i?t.offsetWidth:n,o=i?t.offsetHeight:r,u=Wi(n)!==s||Wi(r)!==o;return u&&(n=s,r=o),{width:n,height:r,$:u}}function ko(t){return jt(t)?t:t.contextElement}function cr(t){const e=ko(t);if(!tn(e))return xt(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:s}=La(e);let o=(s?Wi(n.width):n.width)/r,u=(s?Wi(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!u||!Number.isFinite(u))&&(u=1),{x:o,y:u}}const qc=xt(0);function Ia(t){const e=Lt(t);return!vo()||!e.visualViewport?qc:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Wc(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Lt(t)?!1:e}function Gn(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),s=ko(t);let o=xt(1);e&&(r?jt(r)&&(o=cr(r)):o=cr(t));const u=Wc(s,n,r)?Ia(s):xt(0);let l=(i.left+u.x)/o.x,a=(i.top+u.y)/o.y,f=i.width/o.x,c=i.height/o.y;if(s){const d=Lt(s),m=r&&jt(r)?Lt(r):r;let p=d,_=Xs(p);for(;_&&r&&m!==p;){const y=cr(_),g=_.getBoundingClientRect(),h=qt(_),v=g.left+(_.clientLeft+parseFloat(h.paddingLeft))*y.x,O=g.top+(_.clientTop+parseFloat(h.paddingTop))*y.y;l*=y.x,a*=y.y,f*=y.x,c*=y.y,l+=v,a+=O,p=Lt(_),_=Xs(p)}}return zi({width:f,height:c,x:l,y:a})}function Co(t,e){const n=os(t).scrollLeft;return e?e.left+n:Gn(nn(t)).left+n}function Na(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:Co(t,r)),s=r.top+e.scrollTop;return{x:i,y:s}}function Qc(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const s=i==="fixed",o=nn(r),u=e?ss(e.floating):!1;if(r===o||u&&s)return n;let l={scrollLeft:0,scrollTop:0},a=xt(1);const f=xt(0),c=tn(r);if((c||!c&&!s)&&((Dr(r)!=="body"||mi(o))&&(l=os(r)),tn(r))){const m=Gn(r);a=cr(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const d=o&&!c&&!s?Na(o,l,!0):xt(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+f.x+d.x,y:n.y*a.y-l.scrollTop*a.y+f.y+d.y}}function zc(t){return Array.from(t.getClientRects())}function Gc(t){const e=nn(t),n=os(t),r=t.ownerDocument.body,i=Ft(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),s=Ft(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Co(t);const u=-n.scrollTop;return qt(r).direction==="rtl"&&(o+=Ft(e.clientWidth,r.clientWidth)-i),{width:i,height:s,x:o,y:u}}function Yc(t,e){const n=Lt(t),r=nn(t),i=n.visualViewport;let s=r.clientWidth,o=r.clientHeight,u=0,l=0;if(i){s=i.width,o=i.height;const a=vo();(!a||a&&e==="fixed")&&(u=i.offsetLeft,l=i.offsetTop)}return{width:s,height:o,x:u,y:l}}function Zc(t,e){const n=Gn(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,s=tn(t)?cr(t):xt(1),o=t.clientWidth*s.x,u=t.clientHeight*s.y,l=i*s.x,a=r*s.y;return{width:o,height:u,x:l,y:a}}function Jo(t,e,n){let r;if(e==="viewport")r=Yc(t,n);else if(e==="document")r=Gc(nn(t));else if(jt(e))r=Zc(e,n);else{const i=Ia(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return zi(r)}function Ma(t,e){const n=Fn(t);return n===e||!jt(n)||Tr(n)?!1:qt(n).position==="fixed"||Ma(n,e)}function Xc(t,e){const n=e.get(t);if(n)return n;let r=ri(t,[],!1).filter(u=>jt(u)&&Dr(u)!=="body"),i=null;const s=qt(t).position==="fixed";let o=s?Fn(t):t;for(;jt(o)&&!Tr(o);){const u=qt(o),l=yo(o);!l&&u.position==="fixed"&&(i=null),(s?!l&&!i:!l&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mi(o)&&!l&&Ma(t,o))?r=r.filter(f=>f!==o):i=u,o=Fn(o)}return e.set(t,r),r}function Jc(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const o=[...n==="clippingAncestors"?ss(e)?[]:Xc(e,this._c):[].concat(n),r],u=o[0],l=o.reduce((a,f)=>{const c=Jo(e,f,i);return a.top=Ft(c.top,a.top),a.right=Sn(c.right,a.right),a.bottom=Sn(c.bottom,a.bottom),a.left=Ft(c.left,a.left),a},Jo(e,u,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function xc(t){const{width:e,height:n}=La(t);return{width:e,height:n}}function ed(t,e,n){const r=tn(e),i=nn(e),s=n==="fixed",o=Gn(t,!0,s,e);let u={scrollLeft:0,scrollTop:0};const l=xt(0);if(r||!r&&!s)if((Dr(e)!=="body"||mi(i))&&(u=os(e)),r){const d=Gn(e,!0,s,e);l.x=d.x+e.clientLeft,l.y=d.y+e.clientTop}else i&&(l.x=Co(i));const a=i&&!r&&!s?Na(i,u):xt(0),f=o.left+u.scrollLeft-l.x-a.x,c=o.top+u.scrollTop-l.y-a.y;return{x:f,y:c,width:o.width,height:o.height}}function ks(t){return qt(t).position==="static"}function xo(t,e){if(!tn(t)||qt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return nn(t)===n&&(n=n.ownerDocument.body),n}function Ha(t,e){const n=Lt(t);if(ss(t))return n;if(!tn(t)){let i=Fn(t);for(;i&&!Tr(i);){if(jt(i)&&!ks(i))return i;i=Fn(i)}return n}let r=xo(t,e);for(;r&&Kc(r)&&ks(r);)r=xo(r,e);return r&&Tr(r)&&ks(r)&&!yo(r)?n:r||jc(t)||n}const td=async function(t){const e=this.getOffsetParent||Ha,n=this.getDimensions,r=await n(t.floating);return{reference:ed(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function nd(t){return qt(t).direction==="rtl"}const rd={convertOffsetParentRelativeRectToViewportRelativeRect:Qc,getDocumentElement:nn,getClippingRect:Jc,getOffsetParent:Ha,getElementRects:td,getClientRects:zc,getDimensions:xc,getScale:cr,isElement:jt,isRTL:nd};function id(t,e){let n=null,r;const i=nn(t);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function o(u,l){u===void 0&&(u=!1),l===void 0&&(l=1),s();const{left:a,top:f,width:c,height:d}=t.getBoundingClientRect();if(u||e(),!c||!d)return;const m=Ti(f),p=Ti(i.clientWidth-(a+c)),_=Ti(i.clientHeight-(f+d)),y=Ti(a),h={rootMargin:-m+"px "+-p+"px "+-_+"px "+-y+"px",threshold:Ft(0,Sn(1,l))||1};let v=!0;function O($){const C=$[0].intersectionRatio;if(C!==l){if(!v)return o();C?o(!1,C):r=setTimeout(()=>{o(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(O,{...h,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,h)}n.observe(t)}return o(!0),s}function sd(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,a=ko(t),f=i||s?[...a?ri(a):[],...ri(e)]:[];f.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const c=a&&u?id(a,n):null;let d=-1,m=null;o&&(m=new ResizeObserver(g=>{let[h]=g;h&&h.target===a&&m&&(m.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var v;(v=m)==null||v.observe(e)})),n()}),a&&!l&&m.observe(a),m.observe(e));let p,_=l?Gn(t):null;l&&y();function y(){const g=Gn(t);_&&(g.x!==_.x||g.y!==_.y||g.width!==_.width||g.height!==_.height)&&n(),_=g,p=requestAnimationFrame(y)}return n(),()=>{var g;f.forEach(h=>{i&&h.removeEventListener("scroll",n),s&&h.removeEventListener("resize",n)}),c==null||c(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const od=Vc,ld=Bc,ud=Mc,ad=Uc,fd=Nc,cd=(t,e,n)=>{const r=new Map,i={platform:rd,...n},s={...i.platform,_c:r};return Ic(t,e,{...i,platform:s})},dd={strategy:"absolute",placement:"top",gutter:5,flip:!0,sameWidth:!1,overflowPadding:8},md={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function pd(t,e,n={}){if(!e||!t||n===null)return{destroy:We};const r={...dd,...n},i=e.querySelector("[data-arrow=true]"),s=[];r.flip&&s.push(ud({boundary:r.boundary,padding:r.overflowPadding}));const o=J(i)?i.offsetHeight/2:0;if(r.gutter||r.offset){const l=r.gutter?{mainAxis:r.gutter}:r.offset;(l==null?void 0:l.mainAxis)!=null&&(l.mainAxis+=o),s.push(od(l))}s.push(ld({boundary:r.boundary,crossAxis:r.overlap,padding:r.overflowPadding})),i&&s.push(fd({element:i,padding:8})),s.push(ad({padding:r.overflowPadding,apply({rects:l,availableHeight:a,availableWidth:f}){r.sameWidth&&Object.assign(e.style,{width:`${Math.round(l.reference.width)}px`,minWidth:"unset"}),r.fitViewport&&Object.assign(e.style,{maxWidth:`${f}px`,maxHeight:`${a}px`})}}));function u(){if(!t||!e||J(t)&&!t.ownerDocument.documentElement.contains(t))return;const{placement:l,strategy:a}=r;cd(t,e,{placement:l,middleware:s,strategy:a}).then(f=>{const c=Math.round(f.x),d=Math.round(f.y),[m,p]=hd(f.placement);if(e.setAttribute("data-side",m),e.setAttribute("data-align",p),Object.assign(e.style,{position:r.strategy,top:`${d}px`,left:`${c}px`}),J(i)&&f.middlewareData.arrow){const{x:_,y}=f.middlewareData.arrow,g=f.placement.split("-")[0];i.setAttribute("data-side",g),Object.assign(i.style,{position:"absolute",left:_!=null?`${_}px`:"",top:y!=null?`${y}px`:"",[g]:`calc(100% - ${o}px)`,transform:md[g],backgroundColor:"inherit",zIndex:"inherit"})}return f})}return Object.assign(e.style,{position:r.strategy}),{destroy:sd(t,e,u)}}function hd(t){const[e,n="center"]=t.split("-");return[e,n]}/*!
6
- * tabbable 6.2.0
7
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
8
- */var Va=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],Gi=Va.join(","),Ba=typeof Element>"u",Yn=Ba?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Yi=!Ba&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},Zi=function t(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),s=i===""||i==="true",o=s||n&&e&&t(e.parentNode);return o},_d=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},Ua=function(e,n,r){if(Zi(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll(Gi));return n&&Yn.call(e,Gi)&&i.unshift(e),i=i.filter(r),i},Ka=function t(e,n,r){for(var i=[],s=Array.from(e);s.length;){var o=s.shift();if(!Zi(o,!1))if(o.tagName==="SLOT"){var u=o.assignedElements(),l=u.length?u:o.children,a=t(l,!0,r);r.flatten?i.push.apply(i,a):i.push({scopeParent:o,candidates:a})}else{var f=Yn.call(o,Gi);f&&r.filter(o)&&(n||!e.includes(o))&&i.push(o);var c=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),d=!Zi(c,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(c&&d){var m=t(c===!0?o.children:c.children,!0,r);r.flatten?i.push.apply(i,m):i.push({scopeParent:o,candidates:m})}else s.unshift.apply(s,o.children)}}return i},ja=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Mn=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||_d(e))&&!ja(e)?0:e.tabIndex},gd=function(e,n){var r=Mn(e);return r<0&&n&&!ja(e)?0:r},bd=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},qa=function(e){return e.tagName==="INPUT"},yd=function(e){return qa(e)&&e.type==="hidden"},vd=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},kd=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},Cd=function(e){if(!e.name)return!0;var n=e.form||Yi(e),r=function(u){return n.querySelectorAll('input[type="radio"][name="'+u+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var s=kd(i,e.form);return!s||s===e},Ed=function(e){return qa(e)&&e.type==="radio"},wd=function(e){return Ed(e)&&!Cd(e)},Od=function(e){var n,r=e&&Yi(e),i=(n=r)===null||n===void 0?void 0:n.host,s=!1;if(r&&r!==e){var o,u,l;for(s=!!((o=i)!==null&&o!==void 0&&(u=o.ownerDocument)!==null&&u!==void 0&&u.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!s&&i;){var a,f,c;r=Yi(i),i=(a=r)===null||a===void 0?void 0:a.host,s=!!((f=i)!==null&&f!==void 0&&(c=f.ownerDocument)!==null&&c!==void 0&&c.contains(i))}}return s},el=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},Ad=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var s=Yn.call(e,"details>summary:first-of-type"),o=s?e.parentElement:e;if(Yn.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var u=e;e;){var l=e.parentElement,a=Yi(e);if(l&&!l.shadowRoot&&i(l)===!0)return el(e);e.assignedSlot?e=e.assignedSlot:!l&&a!==e.ownerDocument?e=a.host:e=l}e=u}if(Od(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return el(e);return!1},Td=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return Yn.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},Xi=function(e,n){return!(n.disabled||Zi(n)||yd(n)||Ad(n,e)||vd(n)||Td(n))},Js=function(e,n){return!(wd(n)||Mn(n)<0||!Xi(e,n))},$d=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Sd=function t(e){var n=[],r=[];return e.forEach(function(i,s){var o=!!i.scopeParent,u=o?i.scopeParent:i,l=gd(u,o),a=o?t(i.candidates):u;l===0?o?n.push.apply(n,a):n.push(u):r.push({documentOrder:s,tabIndex:l,item:i,isScope:o,content:a})}),r.sort(bd).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(n)},Rd=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Ka([e],n.includeContainer,{filter:Js.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:$d}):r=Ua(e,n.includeContainer,Js.bind(null,n)),Sd(r)},Fd=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Ka([e],n.includeContainer,{filter:Xi.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Ua(e,n.includeContainer,Xi.bind(null,n)),r},nr=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Yn.call(e,Gi)===!1?!1:Js(n,e)},Pd=Va.concat("iframe").join(","),Cs=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Yn.call(e,Pd)===!1?!1:Xi(n,e)};/*!
9
- * focus-trap 7.6.2
10
- * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
11
- */function xs(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Dd(t){if(Array.isArray(t))return xs(t)}function Ld(t,e,n){return(e=Vd(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Id(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Nd(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function nl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tl(Object(n),!0).forEach(function(r){Ld(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Md(t){return Dd(t)||Id(t)||Bd(t)||Nd()}function Hd(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vd(t){var e=Hd(t,"string");return typeof e=="symbol"?e:e+""}function Bd(t,e){if(t){if(typeof t=="string")return xs(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xs(t,e):void 0}}var rl={activateTrap:function(e,n){if(e.length>0){var r=e[e.length-1];r!==n&&r.pause()}var i=e.indexOf(n);i===-1||e.splice(i,1),e.push(n)},deactivateTrap:function(e,n){var r=e.indexOf(n);r!==-1&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()}},Ud=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Kd=function(e){return(e==null?void 0:e.key)==="Escape"||(e==null?void 0:e.key)==="Esc"||(e==null?void 0:e.keyCode)===27},Yr=function(e){return(e==null?void 0:e.key)==="Tab"||(e==null?void 0:e.keyCode)===9},jd=function(e){return Yr(e)&&!e.shiftKey},qd=function(e){return Yr(e)&&e.shiftKey},il=function(e){return setTimeout(e,0)},Ur=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return typeof e=="function"?e.apply(void 0,r):e},$i=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Wd=[],Qd=function(e,n){var r=(n==null?void 0:n.document)||document,i=(n==null?void 0:n.trapStack)||Wd,s=nl({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:jd,isKeyBackward:qd},n),o={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},u,l=function(A,P,q){return A&&A[P]!==void 0?A[P]:s[q||P]},a=function(A,P){var q=typeof(P==null?void 0:P.composedPath)=="function"?P.composedPath():void 0;return o.containerGroups.findIndex(function(W){var oe=W.container,se=W.tabbableNodes;return oe.contains(A)||(q==null?void 0:q.includes(oe))||se.find(function(z){return z===A})})},f=function(A){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},q=P.hasFallback,W=q===void 0?!1:q,oe=P.params,se=oe===void 0?[]:oe,z=s[A];if(typeof z=="function"&&(z=z.apply(void 0,Md(se))),z===!0&&(z=void 0),!z){if(z===void 0||z===!1)return z;throw new Error("`".concat(A,"` was specified but was not a node, or did not return a node"))}var le=z;if(typeof z=="string"){try{le=r.querySelector(z)}catch($e){throw new Error("`".concat(A,'` appears to be an invalid selector; error="').concat($e.message,'"'))}if(!le&&!W)throw new Error("`".concat(A,"` as selector refers to no known node"))}return le},c=function(){var A=f("initialFocus",{hasFallback:!0});if(A===!1)return!1;if(A===void 0||A&&!Cs(A,s.tabbableOptions))if(a(r.activeElement)>=0)A=r.activeElement;else{var P=o.tabbableGroups[0],q=P&&P.firstTabbableNode;A=q||f("fallbackFocus")}else A===null&&(A=f("fallbackFocus"));if(!A)throw new Error("Your focus-trap needs to have at least one focusable element");return A},d=function(){if(o.containerGroups=o.containers.map(function(A){var P=Rd(A,s.tabbableOptions),q=Fd(A,s.tabbableOptions),W=P.length>0?P[0]:void 0,oe=P.length>0?P[P.length-1]:void 0,se=q.find(function($e){return nr($e)}),z=q.slice().reverse().find(function($e){return nr($e)}),le=!!P.find(function($e){return Mn($e)>0});return{container:A,tabbableNodes:P,focusableNodes:q,posTabIndexesFound:le,firstTabbableNode:W,lastTabbableNode:oe,firstDomTabbableNode:se,lastDomTabbableNode:z,nextTabbableNode:function(st){var Me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,Y=P.indexOf(st);return Y<0?Me?q.slice(q.indexOf(st)+1).find(function(Z){return nr(Z)}):q.slice(0,q.indexOf(st)).reverse().find(function(Z){return nr(Z)}):P[Y+(Me?1:-1)]}}}),o.tabbableGroups=o.containerGroups.filter(function(A){return A.tabbableNodes.length>0}),o.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(o.containerGroups.find(function(A){return A.posTabIndexesFound})&&o.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function(A){var P=A.activeElement;if(P)return P.shadowRoot&&P.shadowRoot.activeElement!==null?m(P.shadowRoot):P},p=function(A){if(A!==!1&&A!==m(document)){if(!A||!A.focus){p(c());return}A.focus({preventScroll:!!s.preventScroll}),o.mostRecentlyFocusedNode=A,Ud(A)&&A.select()}},_=function(A){var P=f("setReturnFocus",{params:[A]});return P||(P===!1?!1:A)},y=function(A){var P=A.target,q=A.event,W=A.isBackward,oe=W===void 0?!1:W;P=P||$i(q),d();var se=null;if(o.tabbableGroups.length>0){var z=a(P,q),le=z>=0?o.containerGroups[z]:void 0;if(z<0)oe?se=o.tabbableGroups[o.tabbableGroups.length-1].lastTabbableNode:se=o.tabbableGroups[0].firstTabbableNode;else if(oe){var $e=o.tabbableGroups.findIndex(function(_t){var dt=_t.firstTabbableNode;return P===dt});if($e<0&&(le.container===P||Cs(P,s.tabbableOptions)&&!nr(P,s.tabbableOptions)&&!le.nextTabbableNode(P,!1))&&($e=z),$e>=0){var st=$e===0?o.tabbableGroups.length-1:$e-1,Me=o.tabbableGroups[st];se=Mn(P)>=0?Me.lastTabbableNode:Me.lastDomTabbableNode}else Yr(q)||(se=le.nextTabbableNode(P,!1))}else{var Y=o.tabbableGroups.findIndex(function(_t){var dt=_t.lastTabbableNode;return P===dt});if(Y<0&&(le.container===P||Cs(P,s.tabbableOptions)&&!nr(P,s.tabbableOptions)&&!le.nextTabbableNode(P))&&(Y=z),Y>=0){var Z=Y===o.tabbableGroups.length-1?0:Y+1,ht=o.tabbableGroups[Z];se=Mn(P)>=0?ht.firstTabbableNode:ht.firstDomTabbableNode}else Yr(q)||(se=le.nextTabbableNode(P))}}else se=f("fallbackFocus");return se},g=function(A){var P=$i(A);if(!(a(P,A)>=0)){if(Ur(s.clickOutsideDeactivates,A)){u.deactivate({returnFocus:s.returnFocusOnDeactivate});return}Ur(s.allowOutsideClick,A)||A.preventDefault()}},h=function(A){var P=$i(A),q=a(P,A)>=0;if(q||P instanceof Document)q&&(o.mostRecentlyFocusedNode=P);else{A.stopImmediatePropagation();var W,oe=!0;if(o.mostRecentlyFocusedNode)if(Mn(o.mostRecentlyFocusedNode)>0){var se=a(o.mostRecentlyFocusedNode),z=o.containerGroups[se].tabbableNodes;if(z.length>0){var le=z.findIndex(function($e){return $e===o.mostRecentlyFocusedNode});le>=0&&(s.isKeyForward(o.recentNavEvent)?le+1<z.length&&(W=z[le+1],oe=!1):le-1>=0&&(W=z[le-1],oe=!1))}}else o.containerGroups.some(function($e){return $e.tabbableNodes.some(function(st){return Mn(st)>0})})||(oe=!1);else oe=!1;oe&&(W=y({target:o.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(o.recentNavEvent)})),p(W||o.mostRecentlyFocusedNode||c())}o.recentNavEvent=void 0},v=function(A){var P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;o.recentNavEvent=A;var q=y({event:A,isBackward:P});q&&(Yr(A)&&A.preventDefault(),p(q))},O=function(A){(s.isKeyForward(A)||s.isKeyBackward(A))&&v(A,s.isKeyBackward(A))},$=function(A){Kd(A)&&Ur(s.escapeDeactivates,A)!==!1&&(A.preventDefault(),u.deactivate())},C=function(A){var P=$i(A);a(P,A)>=0||Ur(s.clickOutsideDeactivates,A)||Ur(s.allowOutsideClick,A)||(A.preventDefault(),A.stopImmediatePropagation())},F=function(){if(o.active)return rl.activateTrap(i,u),o.delayInitialFocusTimer=s.delayInitialFocus?il(function(){p(c())}):p(c()),r.addEventListener("focusin",h,!0),r.addEventListener("mousedown",g,{capture:!0,passive:!1}),r.addEventListener("touchstart",g,{capture:!0,passive:!1}),r.addEventListener("click",C,{capture:!0,passive:!1}),r.addEventListener("keydown",O,{capture:!0,passive:!1}),r.addEventListener("keydown",$),u},R=function(){if(o.active)return r.removeEventListener("focusin",h,!0),r.removeEventListener("mousedown",g,!0),r.removeEventListener("touchstart",g,!0),r.removeEventListener("click",C,!0),r.removeEventListener("keydown",O,!0),r.removeEventListener("keydown",$),u},j=function(A){var P=A.some(function(q){var W=Array.from(q.removedNodes);return W.some(function(oe){return oe===o.mostRecentlyFocusedNode})});P&&p(c())},I=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(j):void 0,L=function(){I&&(I.disconnect(),o.active&&!o.paused&&o.containers.map(function(A){I.observe(A,{subtree:!0,childList:!0})}))};return u={get active(){return o.active},get paused(){return o.paused},activate:function(A){if(o.active)return this;var P=l(A,"onActivate"),q=l(A,"onPostActivate"),W=l(A,"checkCanFocusTrap");W||d(),o.active=!0,o.paused=!1,o.nodeFocusedBeforeActivation=r.activeElement,P==null||P();var oe=function(){W&&d(),F(),L(),q==null||q()};return W?(W(o.containers.concat()).then(oe,oe),this):(oe(),this)},deactivate:function(A){if(!o.active)return this;var P=nl({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},A);clearTimeout(o.delayInitialFocusTimer),o.delayInitialFocusTimer=void 0,R(),o.active=!1,o.paused=!1,L(),rl.deactivateTrap(i,u);var q=l(P,"onDeactivate"),W=l(P,"onPostDeactivate"),oe=l(P,"checkCanReturnFocus"),se=l(P,"returnFocus","returnFocusOnDeactivate");q==null||q();var z=function(){il(function(){se&&p(_(o.nodeFocusedBeforeActivation)),W==null||W()})};return se&&oe?(oe(_(o.nodeFocusedBeforeActivation)).then(z,z),this):(z(),this)},pause:function(A){if(o.paused||!o.active)return this;var P=l(A,"onPause"),q=l(A,"onPostPause");return o.paused=!0,P==null||P(),R(),L(),q==null||q(),this},unpause:function(A){if(!o.paused||!o.active)return this;var P=l(A,"onUnpause"),q=l(A,"onPostUnpause");return o.paused=!1,P==null||P(),d(),F(),L(),q==null||q(),this},updateContainerElements:function(A){var P=[].concat(A).filter(Boolean);return o.containers=P.map(function(q){return typeof q=="string"?r.querySelector(q):q}),o.active&&d(),L(),this}},u.updateContainerElements(e),u};function Wa(t={}){let e;const{immediate:n,...r}=t,i=Re(!1),s=Re(!1),o=c=>e==null?void 0:e.activate(c),u=c=>{e==null||e.deactivate(c)},l=()=>{e&&(e.pause(),s.set(!0))},a=()=>{e&&(e.unpause(),s.set(!1))};return{useFocusTrap:c=>(e=Qd(c,{...r,onActivate(){var d;i.set(!0),(d=t.onActivate)==null||d.call(t)},onDeactivate(){var d;i.set(!1),(d=t.onDeactivate)==null||d.call(t)}}),n&&o(),{destroy(){u(),e=void 0}}),hasFocus:qo(i),isPaused:qo(s),activate:o,deactivate:u,pause:l,unpause:a}}const Si=[],Qa=(t,e)=>{let n=We;function r(){const s=Si.indexOf(t);s>=0&&Si.splice(s,1)}function i(s){n();const{open:o,onClose:u,shouldCloseOnInteractOutside:l,closeOnInteractOutside:a}=s;cn(100).then(()=>{o?Si.push(t):r()});function f(){return rc(Si)===t}function c(){f()&&u&&(u(),r())}function d(p){const _=p.target;di(_)&&_&&f()&&(p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation())}function m(p){l!=null&&l(p)&&f()&&(p.preventDefault(),p.stopPropagation(),p.stopImmediatePropagation(),c())}n=Gd(t,{onInteractOutsideStart:d,onInteractOutside:a?m:void 0,enabled:o}).destroy}return i(e),{update:i,destroy(){r(),n()}}},zd={floating:{},focusTrap:{},modal:{},escapeKeydown:{},portal:"body"},Ji=(t,e)=>{t.dataset.escapee="";const{anchorElement:n,open:r,options:i}=e;if(!n||!r||!i)return{destroy:We};const s={...zd,...i},o=[];if(s.portal!==null&&o.push(ls(t,s.portal).destroy),o.push(pd(n,t,s.floating).destroy),s.focusTrap!==null){const{useFocusTrap:l}=Wa({immediate:!0,escapeDeactivates:!1,allowOutsideClick:!0,returnFocusOnDeactivate:!1,fallbackFocus:t,...s.focusTrap});o.push(l(t).destroy)}s.modal!==null&&o.push(Qa(t,{onClose:()=>{J(n)&&(r.set(!1),n.focus())},shouldCloseOnInteractOutside:l=>!(l.defaultPrevented||J(n)&&n.contains(l.target)),...s.modal}).destroy),s.escapeKeydown!==null&&o.push(ni(t,{enabled:r,handler:()=>{r.set(!1)},...s.escapeKeydown}).destroy);const u=rt(...o);return{destroy(){u()}}},ls=(t,e="body")=>{let n;if(!J(e)&&typeof e!="string")return{destroy:We};async function r(s){if(e=s,typeof e=="string"){if(n=document.querySelector(e),n===null&&(await Kt(),n=document.querySelector(e)),n===null)throw new Error(`No element found matching css selector: "${e}"`)}else if(e instanceof HTMLElement)n=e;else throw new TypeError(`Unknown portal target type: ${e===null?"null":typeof e}. Allowed types: string (CSS selector) or HTMLElement.`);t.dataset.portal="",n.appendChild(t),t.hidden=!1}function i(){t.remove()}return r(e),{update:r,destroy:i}},Gd=(t,e)=>{let n=We,r=We,i=!1,s=!1,o=!1;function u(f){n(),r();const{onInteractOutside:c,onInteractOutsideStart:d,enabled:m}=f;if(!m)return;function p(g){c&&sl(g,t)&&(d==null||d(g));const h=g.target;di(h)&&za(t,h)&&(s=!0),i=!0}function _(g){c==null||c(g)}const y=Yd(t);if(typeof PointerEvent<"u"){const g=h=>{r();const v=O=>{l(O)&&_(O),a()};if(h.pointerType==="touch"){r=gt(y,"click",v,{capture:!0,once:!0});return}v(h)};n=rt(gt(y,"pointerdown",p,!0),gt(y,"pointerup",g,!0))}else{const g=v=>{o?o=!1:l(v)&&_(v),a()},h=v=>{o=!0,l(v)&&_(v),a()};n=rt(gt(y,"mousedown",p,!0),gt(y,"mouseup",g,!0),gt(y,"touchstart",p,!0),gt(y,"touchend",h,!0))}}function l(f){return!!(i&&!s&&sl(f,t))}function a(){i=!1,s=!1}return u(e),{update:u,destroy(){n(),r()}}};function sl(t,e){if("button"in t&&t.button>0)return!1;const n=t.target;if(!di(n))return!1;const r=n.ownerDocument;return!r||!r.documentElement.contains(n)?!1:e&&!za(e,n)}function za(t,e){return t===e||t.contains(e)}function Yd(t){return(t==null?void 0:t.ownerDocument)??document}function Zd(t){const e={};return Object.keys(t).forEach(n=>{const r=n,i=t[r];Ca(i)?e[r]=Ze(i):e[r]=Ze(yt(i))}),e}const Xd={prefix:"",disabled:yt(!1),required:yt(!1),name:yt(void 0)};function q2(t){const e={...Xd,...uc(t)},{name:n}=Xn(e.prefix),{value:r,name:i,disabled:s,required:o}=Zd(Rr(e,"prefix")),u=i;return Pe(n("hidden-input"),{stores:[r,u,s,o],returned:([a,f,c,d])=>({name:f,value:a==null?void 0:a.toString(),"aria-hidden":"true",hidden:!0,disabled:c,required:d,tabIndex:-1,style:Pt({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"})}),action:a=>({destroy:r.subscribe(c=>{a.value=c,a.dispatchEvent(new Event("change",{bubbles:!0}))})})})}const Jd={ltr:[...ei,ae.ARROW_RIGHT],rtl:[...ei,ae.ARROW_LEFT]},xd={ltr:[ae.ARROW_LEFT],rtl:[ae.ARROW_RIGHT]},ol=["menu","trigger"],em={arrowSize:8,positioning:{placement:"bottom"},preventScroll:!0,closeOnEscape:!0,closeOnOutsideClick:!0,portal:void 0,loop:!1,dir:"ltr",defaultOpen:!1,typeahead:!0,closeOnItemClick:!0,onOutsideClick:void 0};function tm(t){const{name:e,selector:n}=Xn(t.selector),{preventScroll:r,arrowSize:i,positioning:s,closeOnEscape:o,closeOnOutsideClick:u,portal:l,forceVisible:a,typeahead:f,loop:c,closeFocus:d,disableFocusFirstItem:m,closeOnItemClick:p,onOutsideClick:_}=t.rootOptions,y=t.rootOpen,g=t.rootActiveTrigger,h=t.nextFocusable,v=t.prevFocusable,O=Ze.writable(!1),$=Ze(Re(0)),C=Ze(Re(null)),F=Ze(Re("right")),R=Ze(Re(null)),j=Ze(Ue([F,C],([Q,ee])=>te=>Q===(ee==null?void 0:ee.side)&&nm(te,ee==null?void 0:ee.area))),{typed:I,handleTypeaheadSearch:L}=Oc(),N=Dt({...xr(ol),...t.ids}),A=qi({open:y,forceVisible:a,activeTrigger:g}),P=Pe(e(),{stores:[A,l,N.menu,N.trigger],returned:([Q,ee,te,ue])=>({role:"menu",hidden:Q?void 0:!0,style:Pt({display:Q?void 0:"none"}),id:te,"aria-labelledby":ue,"data-state":Q?"open":"closed","data-portal":rs(ee),tabindex:-1}),action:Q=>{let ee=We;const te=xe([A,g,s,u,l,o],([we,Je,kt,K,De,je])=>{ee(),!(!we||!Je)&&Kt().then(()=>{ee(),jr(Q,n),ee=Ji(Q,{anchorElement:Je,open:y,options:{floating:kt,modal:{closeOnInteractOutside:K,shouldCloseOnInteractOutside:Se=>{var Le;return(Le=_.get())==null||Le(Se),!(Se.defaultPrevented||J(Je)&&Je.contains(Se.target))},onClose:()=>{y.set(!1),Je.focus()},open:we},portal:Ar(Q,De),escapeKeydown:je?void 0:null}}).destroy})}),ue=rt(ye(Q,"keydown",we=>{const Je=we.target,kt=we.currentTarget;if(!J(Je)||!J(kt)||!(Je.closest('[role="menu"]')===kt))return;if(Gs.includes(we.key)&&to(we,c.get()??!1),we.key===ae.TAB){we.preventDefault(),y.set(!1),eo(we,h,v);return}const De=we.key.length===1;!(we.ctrlKey||we.altKey||we.metaKey)&&De&&f.get()===!0&&L(we.key,un(kt))}));return{destroy(){te(),ue(),ee()}}}}),q=Pe(e("trigger"),{stores:[y,N.menu,N.trigger],returned:([Q,ee,te])=>({"aria-controls":ee,"aria-expanded":Q,"data-state":Q?"open":"closed",id:te,tabindex:0}),action:Q=>(Qr(Q),g.update(te=>te||Q),{destroy:rt(ye(Q,"click",te=>{const ue=y.get(),we=te.currentTarget;J(we)&&(_t(we),ue||te.preventDefault())}),ye(Q,"keydown",te=>{const ue=te.currentTarget;if(!J(ue)||!(ei.includes(te.key)||te.key===ae.ARROW_DOWN))return;te.preventDefault(),_t(ue);const we=ue.getAttribute("aria-controls");if(!we)return;const Je=document.getElementById(we);if(!Je)return;const kt=un(Je);kt.length&&et(kt[0])}))})}),W=Pe(e("arrow"),{stores:i,returned:Q=>({"data-arrow":!0,style:Pt({position:"absolute",width:`var(--arrow-size, ${Q}px)`,height:`var(--arrow-size, ${Q}px)`})})}),oe=Pe(e("overlay"),{stores:[A],returned:([Q])=>({hidden:Q?void 0:!0,tabindex:-1,style:Pt({display:Q?void 0:"none"}),"aria-hidden":"true","data-state":sm(Q)}),action:Q=>{let ee=We;o.get()&&(ee=ni(Q,{handler:()=>{y.set(!1);const we=g.get();we&&we.focus()}}).destroy);const te=xe([l],([ue])=>{if(ue===null)return We;const we=Ar(Q,ue);return we===null?We:ls(Q,we).destroy});return{destroy(){ee(),te()}}}}),se=Pe(e("item"),{returned:()=>({role:"menuitem",tabindex:-1,"data-orientation":"vertical"}),action:Q=>(jr(Q,n),Qr(Q),{destroy:rt(ye(Q,"pointerdown",te=>{const ue=te.currentTarget;if(J(ue)&&ln(ue)){te.preventDefault();return}}),ye(Q,"click",te=>{const ue=te.currentTarget;if(J(ue)){if(ln(ue)){te.preventDefault();return}if(te.defaultPrevented){et(ue);return}p.get()&&cn(1).then(()=>{y.set(!1)})}}),ye(Q,"keydown",te=>{Mr(te)}),ye(Q,"pointermove",te=>{Ir(te)}),ye(Q,"pointerleave",te=>{Nr(te)}),ye(Q,"focusin",te=>{dt(te)}),ye(Q,"focusout",te=>{mn(te)}))})}),z=Pe(e("group"),{returned:()=>Q=>({role:"group","aria-labelledby":Q})}),le=Pe(e("group-label"),{returned:()=>Q=>({id:Q})}),$e={defaultChecked:!1,disabled:!1},st=Q=>{const ee={...$e,...Q},te=ee.checked??Re(ee.defaultChecked??null),ue=fr(te,ee.onCheckedChange),we=Re(ee.disabled),Je=Pe(e("checkbox-item"),{stores:[ue,we],returned:([De,je])=>({role:"menuitemcheckbox",tabindex:-1,"data-orientation":"vertical","aria-checked":Hr(De)?"mixed":De?"true":"false","data-disabled":Gr(je),"data-state":hs(De)}),action:De=>(jr(De,n),Qr(De),{destroy:rt(ye(De,"pointerdown",Se=>{const Le=Se.currentTarget;if(J(Le)&&ln(Le)){Se.preventDefault();return}}),ye(De,"click",Se=>{const Le=Se.currentTarget;if(J(Le)){if(ln(Le)){Se.preventDefault();return}if(Se.defaultPrevented){et(Le);return}ue.update(hn=>Hr(hn)?!0:!hn),p.get()&&Kt().then(()=>{y.set(!1)})}}),ye(De,"keydown",Se=>{Mr(Se)}),ye(De,"pointermove",Se=>{const Le=Se.currentTarget;if(J(Le)){if(ln(Le)){pn(Se);return}Ir(Se,Le)}}),ye(De,"pointerleave",Se=>{Nr(Se)}),ye(De,"focusin",Se=>{dt(Se)}),ye(De,"focusout",Se=>{mn(Se)}))})}),kt=Ue(ue,De=>De===!0),K=Ue(ue,De=>De==="indeterminate");return{elements:{checkboxItem:Je},states:{checked:ue},helpers:{isChecked:kt,isIndeterminate:K},options:{disabled:we}}},Me=(Q={})=>{const ee=Q.value??Re(Q.defaultValue??null),te=fr(ee,Q.onValueChange),ue=Pe(e("radio-group"),{returned:()=>({role:"group"})}),we={disabled:!1},Je=Pe(e("radio-item"),{stores:[te],returned:([K])=>De=>{const{value:je,disabled:Se}={...we,...De},Le=K===je;return{disabled:Se,role:"menuitemradio","data-state":Le?"checked":"unchecked","aria-checked":Le,"data-disabled":Gr(Se),"data-value":je,"data-orientation":"vertical",tabindex:-1}},action:K=>(jr(K,n),{destroy:rt(ye(K,"pointerdown",je=>{const Se=je.currentTarget;if(!J(Se))return;const Le=K.dataset.value;if(K.dataset.disabled||Le===void 0){je.preventDefault();return}}),ye(K,"click",je=>{const Se=je.currentTarget;if(!J(Se))return;const Le=K.dataset.value;if(K.dataset.disabled||Le===void 0){je.preventDefault();return}if(je.defaultPrevented){if(!J(Se))return;et(Se);return}te.set(Le),p.get()&&Kt().then(()=>{y.set(!1)})}),ye(K,"keydown",je=>{Mr(je)}),ye(K,"pointermove",je=>{const Se=je.currentTarget;if(!J(Se))return;const Le=K.dataset.value;if(K.dataset.disabled||Le===void 0){pn(je);return}Ir(je,Se)}),ye(K,"pointerleave",je=>{Nr(je)}),ye(K,"focusin",je=>{dt(je)}),ye(K,"focusout",je=>{mn(je)}))})}),kt=Ue(te,K=>De=>K===De);return{elements:{radioGroup:ue,radioItem:Je},states:{value:te},helpers:{isChecked:kt}}},{elements:{root:Y}}=gm({orientation:"horizontal"}),Z={...em,disabled:!1,positioning:{placement:"right-start",gutter:8}},ht=Q=>{const ee={...Z,...Q},te=ee.open??Re(!1),ue=fr(te,ee==null?void 0:ee.onOpenChange),we=Dt(Rr(ee,"ids")),{positioning:Je,arrowSize:kt,disabled:K}=we,De=Ze(Re(null)),je=Ze(Re(null)),Se=Ze(Re(0)),Le=Dt({...xr(ol),...ee.ids});Jr(()=>{const Be=document.getElementById(Le.trigger.get());Be&&De.set(Be)});const hn=qi({open:ue,forceVisible:a,activeTrigger:De}),af=Pe(e("submenu"),{stores:[hn,Le.menu,Le.trigger],returned:([Be,mt,At])=>({role:"menu",hidden:Be?void 0:!0,style:Pt({display:Be?void 0:"none"}),id:mt,"aria-labelledby":At,"data-state":Be?"open":"closed","data-id":mt,tabindex:-1}),action:Be=>{let mt=We;const At=xe([hn,Je],([Ee,Ye])=>{if(mt(),!Ee)return;const tt=De.get();tt&&Kt().then(()=>{mt();const ot=ki(tt);mt=Ji(Be,{anchorElement:tt,open:ue,options:{floating:Ye,portal:J(ot)?ot:void 0,modal:null,focusTrap:null,escapeKeydown:null}}).destroy})}),qe=rt(ye(Be,"keydown",Ee=>{if(Ee.key===ae.ESCAPE)return;const Ye=Ee.target,tt=Ee.currentTarget;if(!J(Ye)||!J(tt)||!(Ye.closest('[role="menu"]')===tt))return;if(Gs.includes(Ee.key)){Ee.stopImmediatePropagation(),to(Ee,c.get()??!1);return}const Jn=xd.ltr.includes(Ee.key),xn=Ee.ctrlKey||Ee.altKey||Ee.metaKey,Ci=Ee.key.length===1;if(Jn){const Fo=De.get();Ee.preventDefault(),ue.update(()=>(Fo&&et(Fo),!1));return}if(Ee.key===ae.TAB){Ee.preventDefault(),y.set(!1),eo(Ee,h,v);return}!xn&&Ci&&f.get()===!0&&L(Ee.key,un(tt))}),ye(Be,"pointermove",Ee=>{ps(Ee)}),ye(Be,"focusout",Ee=>{const Ye=De.get();if(O.get()){const tt=Ee.target,ot=document.getElementById(Le.menu.get());if(!J(ot)||!J(tt))return;!ot.contains(tt)&&tt!==Ye&&ue.set(!1)}else{const tt=Ee.currentTarget,ot=Ee.relatedTarget;if(!J(ot)||!J(tt))return;!tt.contains(ot)&&ot!==Ye&&ue.set(!1)}}));return{destroy(){At(),mt(),qe()}}}}),ff=Pe(e("subtrigger"),{stores:[ue,K,Le.menu,Le.trigger],returned:([Be,mt,At,qe])=>({role:"menuitem",id:qe,tabindex:-1,"aria-controls":At,"aria-expanded":Be,"data-state":Be?"open":"closed","data-disabled":Gr(mt),"aria-haspopop":"menu"}),action:Be=>{jr(Be,n),Qr(Be),De.update(qe=>qe||Be);const mt=()=>{Es(je),window.clearTimeout(Se.get()),C.set(null)},At=rt(ye(Be,"click",qe=>{if(qe.defaultPrevented)return;const Ee=qe.currentTarget;!J(Ee)||ln(Ee)||(et(Ee),ue.get()||ue.update(Ye=>Ye||(De.set(Ee),!Ye)))}),ye(Be,"keydown",qe=>{const Ee=I.get(),Ye=qe.currentTarget;if(!(!J(Ye)||ln(Ye)||Ee.length>0&&qe.key===ae.SPACE)&&Jd.ltr.includes(qe.key)){if(!ue.get()){Ye.click(),qe.preventDefault();return}const ot=Ye.getAttribute("aria-controls");if(!ot)return;const Jn=document.getElementById(ot);if(!J(Jn))return;const xn=un(Jn)[0];et(xn)}}),ye(Be,"pointermove",qe=>{if(!Kr(qe)||(In(qe),qe.defaultPrevented))return;const Ee=qe.currentTarget;if(!J(Ee))return;im(Le.menu.get())||et(Ee);const Ye=je.get();!ue.get()&&!Ye&&!ln(Ee)&&je.set(window.setTimeout(()=>{ue.update(()=>(De.set(Ee),!0)),Es(je)},100))}),ye(Be,"pointerleave",qe=>{if(!Kr(qe))return;Es(je);const Ee=document.getElementById(Le.menu.get()),Ye=Ee==null?void 0:Ee.getBoundingClientRect();if(Ye){const tt=Ee==null?void 0:Ee.dataset.side,ot=tt==="right",Jn=ot?-5:5,xn=Ye[ot?"left":"right"],Ci=Ye[ot?"right":"left"];C.set({area:[{x:qe.clientX+Jn,y:qe.clientY},{x:xn,y:Ye.top},{x:Ci,y:Ye.top},{x:Ci,y:Ye.bottom},{x:xn,y:Ye.bottom}],side:tt}),window.clearTimeout(Se.get()),Se.set(window.setTimeout(()=>{C.set(null)},300))}else{if(ms(qe),qe.defaultPrevented)return;C.set(null)}}),ye(Be,"focusout",qe=>{const Ee=qe.currentTarget;if(!J(Ee))return;gn(Ee);const Ye=qe.relatedTarget;if(!J(Ye))return;const tt=Ee.getAttribute("aria-controls");if(!tt)return;const ot=document.getElementById(tt);ot&&!ot.contains(Ye)&&ue.set(!1)}),ye(Be,"focusin",qe=>{dt(qe)}));return{destroy(){mt(),At()}}}}),cf=Pe(e("subarrow"),{stores:kt,returned:Be=>({"data-arrow":!0,style:Pt({position:"absolute",width:`var(--arrow-size, ${Be}px)`,height:`var(--arrow-size, ${Be}px)`})})});return xe([y],([Be])=>{Be||(De.set(null),ue.set(!1))}),xe([C],([Be])=>{!pt||Be||window.clearTimeout(Se.get())}),xe([ue],([Be])=>{if(pt&&(Be&&O.get()&&cn(1).then(()=>{const mt=document.getElementById(Le.menu.get());if(!mt)return;const At=un(mt);At.length&&et(At[0])}),!Be)){const mt=R.get(),At=document.getElementById(Le.trigger.get());if(mt&&cn(1).then(()=>{const qe=document.getElementById(Le.menu.get());qe&&qe.contains(mt)&&gn(mt)}),!At||document.activeElement===At)return;gn(At)}}),{ids:Le,elements:{subTrigger:ff,subMenu:af,subArrow:cf},states:{subOpen:ue},options:we}};Jr(()=>{const Q=document.getElementById(N.trigger.get());J(Q)&&y.get()&&g.set(Q);const ee=[],te=()=>O.set(!1),ue=()=>{O.set(!0),ee.push(rt(gt(document,"pointerdown",te,{capture:!0,once:!0}),gt(document,"pointermove",te,{capture:!0,once:!0})))},we=Je=>{if(Je.key===ae.ESCAPE&&o.get()){y.set(!1);return}};return ee.push(gt(document,"keydown",ue,{capture:!0})),ee.push(gt(document,"keydown",we)),()=>{ee.forEach(Je=>Je())}}),xe([y,R],([Q,ee])=>{!Q&&ee&&gn(ee)}),xe([y],([Q])=>{if(pt&&!Q){const ee=g.get();if(!ee)return;const te=d.get();!Q&&ee&&ti({prop:te,defaultEl:ee})}}),xe([y,r],([Q,ee])=>{if(!pt)return;const te=[];return cn(1).then(()=>{const ue=document.getElementById(N.menu.get());if(ue&&Q&&O.get()){if(m.get()){et(ue);return}const we=un(ue);if(!we.length)return;et(we[0])}}),()=>{te.forEach(ue=>ue())}}),xe(y,Q=>{if(!pt)return;const ee=()=>O.set(!1),te=ue=>{if(O.set(!0),ue.key===ae.ESCAPE&&Q&&o.get()){y.set(!1);return}};return rt(gt(document,"pointerdown",ee,{capture:!0,once:!0}),gt(document,"pointermove",ee,{capture:!0,once:!0}),gt(document,"keydown",te,{capture:!0}))});function _t(Q){y.update(ee=>{const te=!ee;return te&&(h.set($a(Q)),v.set(Sa(Q)),g.set(Q)),te})}function dt(Q){const ee=Q.currentTarget;if(!J(ee))return;const te=R.get();te&&gn(te),zs(ee),R.set(ee)}function mn(Q){const ee=Q.currentTarget;J(ee)&&gn(ee)}function In(Q){Vr(Q)&&Q.preventDefault()}function pn(Q){if(Vr(Q))return;const ee=Q.target;if(!J(ee))return;const te=ki(ee);te&&et(te)}function ms(Q){Vr(Q)&&Q.preventDefault()}function ps(Q){if(!Kr(Q))return;const ee=Q.target,te=Q.currentTarget;if(!J(te)||!J(ee))return;const ue=$.get(),we=ue!==Q.clientX;if(te.contains(ee)&&we){const Je=Q.clientX>ue?"right":"left";F.set(Je),$.set(Q.clientX)}}function Ir(Q,ee=null){if(!Kr(Q)||(In(Q),Q.defaultPrevented))return;if(ee){et(ee);return}const te=Q.currentTarget;J(te)&&et(te)}function Nr(Q){Kr(Q)&&pn(Q)}function Mr(Q){if(I.get().length>0&&Q.key===ae.SPACE){Q.preventDefault();return}if(ei.includes(Q.key)){Q.preventDefault();const ue=Q.currentTarget;if(!J(ue))return;ue.click()}}function Hr(Q){return Q==="indeterminate"}function hs(Q){return Hr(Q)?"indeterminate":Q?"checked":"unchecked"}function Vr(Q){return j.get()(Q)}function ki(Q){const ee=Q.closest('[role="menu"]');return J(ee)?ee:null}return{elements:{trigger:q,menu:P,overlay:oe,item:se,group:z,groupLabel:le,arrow:W,separator:Y},builders:{createCheckboxItem:st,createSubmenu:ht,createMenuRadioGroup:Me},states:{open:y},helpers:{handleTypeaheadSearch:L},ids:N,options:t.rootOptions}}function eo(t,e,n){if(t.shiftKey){const r=n.get();r&&(t.preventDefault(),cn(1).then(()=>r.focus()),n.set(null))}else{const r=e.get();r&&(t.preventDefault(),cn(1).then(()=>r.focus()),e.set(null))}}function un(t){return Array.from(t.querySelectorAll(`[data-melt-menu-id="${t.id}"]`)).filter(e=>J(e))}function Qr(t){!t||!ln(t)||(t.setAttribute("data-disabled",""),t.setAttribute("aria-disabled","true"))}function Es(t){if(!pt)return;const e=t.get();e&&(window.clearTimeout(e),t.set(null))}function Kr(t){return t.pointerType==="mouse"}function jr(t,e){if(!t)return;const n=t.closest(`${e()}, ${e("submenu")}`);J(n)&&t.setAttribute("data-melt-menu-id",n.id)}function to(t,e){t.preventDefault();const n=document.activeElement,r=t.currentTarget;if(!J(n)||!J(r))return;const i=un(r);if(!i.length)return;const s=i.filter(l=>!(l.hasAttribute("data-disabled")||l.getAttribute("disabled")==="true")),o=s.indexOf(n);let u;switch(t.key){case ae.ARROW_DOWN:e?u=o<s.length-1?o+1:0:u=o<s.length-1?o+1:o;break;case ae.ARROW_UP:e?u=o>0?o-1:s.length-1:u=o<0?s.length-1:o>0?o-1:0;break;case ae.HOME:u=0;break;case ae.END:u=s.length-1;break;default:return}et(s[u])}function nm(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return rm(n,e)}function rm(t,e){const{x:n,y:r}=t;let i=!1;for(let s=0,o=e.length-1;s<e.length;o=s++){const u=e[s].x,l=e[s].y,a=e[o].x,f=e[o].y;l>r!=f>r&&n<(a-u)*(r-l)/(f-l)+u&&(i=!i)}return i}function im(t){const e=document.activeElement;if(!J(e))return!1;const n=e.closest(`[data-id="${t}"]`);return J(n)}function sm(t){return t?"open":"closed"}const om={isDateDisabled:void 0,isDateUnavailable:void 0,value:void 0,preventDeselect:!1,numberOfMonths:1,pagedNavigation:!1,weekStartsOn:0,fixedWeeks:!1,calendarLabel:"Event Date",locale:"en",minValue:void 0,maxValue:void 0,disabled:!1,readonly:!1,weekdayFormat:"narrow"};({...Rr(om,"isDateDisabled","isDateUnavailable","value","locale","disabled","readonly","minValue","maxValue","weekdayFormat")});const{name:Nn}=Xn("dialog"),lm={preventScroll:!0,closeOnEscape:!0,closeOnOutsideClick:!0,role:"dialog",defaultOpen:!1,portal:void 0,forceVisible:!1,openFocus:void 0,closeFocus:void 0,onOutsideClick:void 0},um=["content","title","description"];function am(t){const e={...lm,...t},n=Dt(Rr(e,"ids")),{preventScroll:r,closeOnEscape:i,closeOnOutsideClick:s,role:o,portal:u,forceVisible:l,openFocus:a,closeFocus:f,onOutsideClick:c}=n,d=Ze.writable(null),m=Dt({...xr(um),...e.ids}),p=e.open??Re(e.defaultOpen),_=fr(p,e==null?void 0:e.onOpenChange),y=Ue([_,l],([L,N])=>L||N);let g=We;function h(L){const N=L.currentTarget,A=L.currentTarget;!J(N)||!J(A)||(_.set(!0),d.set(A))}function v(){_.set(!1),ti({prop:f.get(),defaultEl:d.get()})}const O=Pe(Nn("trigger"),{stores:[_],returned:([L])=>({"aria-haspopup":"dialog","aria-expanded":L,type:"button"}),action:L=>({destroy:rt(ye(L,"click",A=>{h(A)}),ye(L,"keydown",A=>{A.key!==ae.ENTER&&A.key!==ae.SPACE||(A.preventDefault(),h(A))}))})}),$=Pe(Nn("overlay"),{stores:[y,_],returned:([L,N])=>({hidden:L?void 0:!0,tabindex:-1,style:Pt({display:L?void 0:"none"}),"aria-hidden":!0,"data-state":N?"open":"closed"}),action:L=>{let N=We;return i.get()&&(N=ni(L,{handler:()=>{v()}}).destroy),{destroy(){N()}}}}),C=Pe(Nn("content"),{stores:[y,m.content,m.description,m.title,_],returned:([L,N,A,P,q])=>({id:N,role:o.get(),"aria-describedby":A,"aria-labelledby":P,"aria-modal":L?"true":void 0,"data-state":q?"open":"closed",tabindex:-1,hidden:L?void 0:!0,style:Pt({display:L?void 0:"none"})}),action:L=>{let N=We,A=We;const P=rt(xe([_,s,i],([q,W,oe])=>{if(!q)return;const se=Wa({immediate:!1,escapeDeactivates:oe,clickOutsideDeactivates:W,allowOutsideClick:!0,returnFocusOnDeactivate:!1,fallbackFocus:L});N=se.activate,A=se.deactivate;const z=se.useFocusTrap(L);return z&&z.destroy?z.destroy:se.deactivate}),xe([s,_],([q,W])=>Qa(L,{open:W,closeOnInteractOutside:q,onClose(){v()},shouldCloseOnInteractOutside(oe){var se;return(se=c.get())==null||se(oe),!oe.defaultPrevented}}).destroy),xe([i],([q])=>q?ni(L,{handler:v}).destroy:We),xe([y],([q])=>{Kt().then(()=>{q?N():A()})}));return{destroy:()=>{g(),P()}}}}),F=Pe(Nn("portalled"),{stores:u,returned:L=>({"data-portal":rs(L)}),action:L=>{const N=xe([u],([A])=>{if(A===null)return We;const P=Ar(L,A);return P===null?We:ls(L,P).destroy});return{destroy(){N()}}}}),R=Pe(Nn("title"),{stores:[m.title],returned:([L])=>({id:L})}),j=Pe(Nn("description"),{stores:[m.description],returned:([L])=>({id:L})}),I=Pe(Nn("close"),{returned:()=>({type:"button"}),action:L=>({destroy:rt(ye(L,"click",()=>{v()}),ye(L,"keydown",A=>{A.key!==ae.SPACE&&A.key!==ae.ENTER||(A.preventDefault(),v())}))})});return xe([_,r],([L,N])=>{if(pt){if(N&&L&&(g=ho()),L){const A=document.getElementById(m.content.get());ti({prop:a.get(),defaultEl:A})}return()=>{l.get()||g()}}}),{ids:m,elements:{content:C,trigger:O,title:R,description:j,overlay:$,close:I,portalled:F},states:{open:_},options:n}}const ll=[ae.ARROW_LEFT,ae.ARROW_RIGHT,ae.HOME,ae.END],{name:ws}=Xn("menubar"),fm={loop:!0,closeOnEscape:!0,preventScroll:!1},cm=["menubar"];function dm(t){const e={...fm,...t},n=Dt(Rr(e,"ids")),{loop:r,closeOnEscape:i,preventScroll:s}=n,o=Ze(Re("")),u=Ze(Re(null)),l=Ze(Re(null)),a=Ze(Re(null)),f=Ze(Re(0));let c=!1;const d=Dt({...xr(cm),...e.ids}),m=Pe(ws(),{stores:[d.menubar],returned([O]){return{role:"menubar","data-melt-menubar":"","data-orientation":"horizontal",id:O}},action:O=>{const $=Array.from(O.querySelectorAll("[data-melt-menubar-trigger]"));return J($[0])?($[0].tabIndex=0,{destroy:We}):{}}}),p={positioning:{placement:"bottom-start"},arrowSize:8,dir:"ltr",loop:!1,closeOnEscape:!0,closeOnOutsideClick:!0,portal:void 0,forceVisible:!1,defaultOpen:!1,typeahead:!0,closeFocus:void 0,disableFocusFirstItem:!1,closeOnItemClick:!0,onOutsideClick:void 0},_=O=>{const $={...p,...O},C=Ze(Re(!1)),F=Ze(Re(null)),R=Dt($),{positioning:j,portal:I,forceVisible:L,closeOnOutsideClick:N,onOutsideClick:A}=R,P=tm({rootOptions:{...R,preventScroll:s},rootOpen:Ze(C),rootActiveTrigger:Ze(F),nextFocusable:Ze(u),prevFocusable:Ze(l),selector:"menubar-menu",removeScroll:!1}),q=qi({open:C,forceVisible:L,activeTrigger:F}),W=Pe(ws("menu"),{stores:[q,I,P.ids.menu,P.ids.trigger,d.menubar],returned:([z,le,$e,st,Me])=>({role:"menu",hidden:z?void 0:!0,style:Pt({display:z?void 0:"none"}),id:$e,"aria-labelledby":st,"data-state":z?"open":"closed","data-melt-scope":Me,"data-portal":rs(le),tabindex:-1}),action:z=>{let le=We;const $e=xe([C,F,j,I,N],([Me,Y,Z,ht,_t])=>{le(),Me&&Y&&Kt().then(()=>{le(),le=Ji(z,{anchorElement:Y,open:C,options:{floating:Z,portal:Ar(z,ht),modal:{closeOnInteractOutside:_t,shouldCloseOnInteractOutside:dt=>{var pn;if((pn=A.get())==null||pn(dt),dt.defaultPrevented)return!1;const mn=dt.target,In=document.getElementById(d.menubar.get());return!In||!di(mn)?!0:!In.contains(mn)},onClose:()=>{o.set("")},open:Me}}}).destroy})}),st=rt(ye(z,"keydown",Me=>{const Y=Me.target,Z=Me.currentTarget;if(!J(Z)||!J(Y)||(ll.includes(Me.key)&&y(Me),!(Y.closest('[role="menu"]')===Z)))return;Gs.includes(Me.key)&&to(Me),Me.key===ae.TAB&&(Me.preventDefault(),F.set(null),C.set(!1),eo(Me,u,l));const _t=Me.key.length===1;!(Me.ctrlKey||Me.altKey||Me.metaKey)&&_t&&P.helpers.handleTypeaheadSearch(Me.key,un(Z))}));return{destroy(){$e(),st(),le()}}}}),oe=Pe(ws("trigger"),{stores:[C,P.ids.menu,P.ids.trigger],returned:([z,le,$e])=>({"aria-controls":le,"aria-expanded":z,"data-state":z?"open":"closed",id:$e,"aria-haspopup":"menu","data-orientation":"horizontal",role:"menuitem"}),action:z=>{Qr(z);const le=document.getElementById(d.menubar.get());if(!le)return{};const $e=Array.from(le.querySelectorAll("[data-melt-menubar-trigger]"));if(!$e.length)return{};const st=xe([a],([Y])=>{!Y&&$e[0]===z||Y===z?z.tabIndex=0:z.tabIndex=-1});$e[0]===z?z.tabIndex=0:z.tabIndex=-1;const Me=rt(ye(z,"click",Y=>{const Z=C.get(),ht=Y.currentTarget;J(ht)&&(se(ht),Z||Y.preventDefault())}),ye(z,"keydown",Y=>{const Z=Y.currentTarget;if(J(Z)&&(ei.includes(Y.key)||Y.key===ae.ARROW_DOWN)){Y.preventDefault(),se(Z);const ht=Z.getAttribute("aria-controls");if(!ht)return;const _t=document.getElementById(ht);if(!_t)return;const dt=un(_t);if(!dt.length)return;et(dt[0])}}),ye(z,"pointerenter",Y=>{const Z=Y.currentTarget;if(!J(Z))return;const ht=o.get(),_t=C.get();ht&&!_t&&(C.set(!0),o.set(P.ids.menu.get()),F.set(Z))}));return{destroy(){Me(),st()}}}});function se(z){C.update(le=>{const $e=!le;return $e?(u.set($a(z)),l.set(Sa(z)),F.set(z),o.set(P.ids.menu.get())):F.set(null),$e})}return xe([o],([z])=>{if(pt){if(z===P.ids.menu.get()){if(C.get())return;const le=document.getElementById(P.ids.trigger.get());if(!le)return;F.set(le),zs(le),C.set(!0);return}if(z!==P.ids.menu.get()){if(!pt)return;if(C.get()){const le=document.getElementById(P.ids.trigger.get());if(!le)return;F.set(null),C.set(!1),gn(le)}return}}}),xe([C],([z])=>{if(!pt)return;const le=document.getElementById(P.ids.trigger.get());if(le){if(!z&&o.get()===P.ids.menu.get()){F.set(null),o.set(""),gn(le);return}z&&(a.set(le),zs(le))}}),Jr(()=>{if(!pt)return;const z=document.getElementById(P.ids.trigger.get());J(z)&&C.get()&&F.set(z)}),{ids:P.ids,elements:{...P.elements,menu:W,trigger:oe},builders:P.builders,states:P.states,options:R}};function y(O){if(!pt)return;O.preventDefault();const $=O.currentTarget,C=O.target;if(!J(C)||!J($))return;const F=C.hasAttribute("data-melt-menubar-menu-subtrigger"),R=C.closest('[role="menu"]')!==$,j=ae.ARROW_LEFT,I=O.key===j;if(!I&&F||I&&R)return;const N=document.getElementById(d.menubar.get());if(!J(N))return;const A=g(N),P=$.getAttribute("aria-labelledby"),q=A.findIndex(z=>z.id===P);let W;switch(O.key){case ae.ARROW_RIGHT:W=q<A.length-1?q+1:0;break;case ae.ARROW_LEFT:W=q>0?q-1:A.length-1;break;case ae.HOME:W=0;break;case ae.END:W=A.length-1;break;default:return}const se=A[W].getAttribute("aria-controls");se&&o.set(se)}function g(O){const $=O.closest('[role="menubar"]');return J($)?Array.from($.querySelectorAll("[data-melt-menubar-trigger]")).filter(C=>J(C)):[]}function h(O){O.preventDefault();const $=document.activeElement,C=O.currentTarget;if(!J(C)||!J($))return;const F=g(C);if(!F.length)return;const R=F.filter(N=>!(N.hasAttribute("data-disabled")||N.getAttribute("disabled")==="true")),j=R.indexOf($);let I;const L=r.get();switch(O.key){case ae.ARROW_RIGHT:I=j<R.length-1?j+1:L?0:j;break;case ae.ARROW_LEFT:I=j>0?j-1:L?R.length-1:0;break;case ae.HOME:I=0;break;case ae.END:I=R.length-1;break;default:return}et(R[I])}Jr(()=>{if(!pt)return;const O=document.getElementById(d.menubar.get());if(!O)return;const $=rt(ye(O,"keydown",C=>{const F=C.target,R=C.currentTarget;!J(R)||!J(F)||!F.hasAttribute("data-melt-menubar-trigger")||ll.includes(C.key)&&h(C)}),gt(document,"keydown",C=>{i.get()&&C.key===ae.ESCAPE&&(window.clearTimeout(f.get()),o.set(""))}));return()=>{$()}});const v=[];return xe([o,s],([O,$])=>{!pt||!$||(O?c||(v.push(ho()),c=!0):(v.forEach(C=>C()),c=!1))}),Ea(()=>{v.forEach(O=>O())}),{ids:d,elements:{menubar:m},builders:{createMenu:_},options:n}}const mm={positioning:{placement:"bottom"},arrowSize:8,defaultOpen:!1,disableFocusTrap:!1,closeOnEscape:!0,preventScroll:!1,onOpenChange:void 0,closeOnOutsideClick:!0,portal:void 0,forceVisible:!1,openFocus:void 0,closeFocus:void 0,onOutsideClick:void 0},{name:qr}=Xn("popover"),pm=["trigger","content"];function hm(t){const e={...mm,...t},n=Dt(Rr(e,"open","ids")),{positioning:r,arrowSize:i,disableFocusTrap:s,preventScroll:o,closeOnEscape:u,closeOnOutsideClick:l,portal:a,forceVisible:f,openFocus:c,closeFocus:d,onOutsideClick:m}=n,p=e.open??Re(e.defaultOpen),_=fr(p,e==null?void 0:e.onOpenChange),y=Ze.writable(null),g=Dt({...xr(pm),...e.ids});Jr(()=>{y.set(document.getElementById(g.trigger.get()))});function h(){_.set(!1);const L=document.getElementById(g.trigger.get());ti({prop:d.get(),defaultEl:L})}const v=qi({open:_,activeTrigger:y,forceVisible:f}),O=Pe(qr("content"),{stores:[v,a,g.content],returned:([L,N,A])=>({hidden:L&&pt?void 0:!0,tabindex:-1,style:Pt({display:L?void 0:"none"}),id:A,"data-state":L?"open":"closed","data-portal":rs(N)}),action:L=>{let N=We;const A=xe([v,y,r,s,u,l,a],([P,q,W,oe,se,z,le])=>{N(),!(!P||!q)&&Kt().then(()=>{N(),N=Ji(L,{anchorElement:q,open:_,options:{floating:W,focusTrap:oe?null:{returnFocusOnDeactivate:!1,clickOutsideDeactivates:z,allowOutsideClick:!0,escapeDeactivates:se},modal:{shouldCloseOnInteractOutside:C,onClose:h,open:P,closeOnInteractOutside:z},escapeKeydown:se?{handler:()=>{h()}}:null,portal:Ar(L,le)}}).destroy})});return{destroy(){A(),N()}}}});function $(L){_.update(N=>!N),L&&L!==y.get()&&y.set(L)}function C(L){var P;if((P=m.get())==null||P(L),L.defaultPrevented)return!1;const N=L.target,A=document.getElementById(g.trigger.get());return!(A&&di(N)&&(N===A||A.contains(N)))}const F=Pe(qr("trigger"),{stores:[v,g.content,g.trigger],returned:([L,N,A])=>({role:"button","aria-haspopup":"dialog","aria-expanded":L?"true":"false","data-state":ul(L),"aria-controls":N,id:A}),action:L=>({destroy:rt(ye(L,"click",()=>{$(L)}),ye(L,"keydown",A=>{A.key!==ae.ENTER&&A.key!==ae.SPACE||(A.preventDefault(),$(L))}))})}),R=Pe(qr("overlay"),{stores:[v],returned:([L])=>({hidden:L?void 0:!0,tabindex:-1,style:Pt({display:L?void 0:"none"}),"aria-hidden":"true","data-state":ul(L)}),action:L=>{let N=We,A=We,P=We;return u.get()&&(N=ni(L,{handler:()=>{h()}}).destroy),A=xe([a],([q])=>{if(P(),q===null)return;const W=Ar(L,q);W!==null&&(P=ls(L,W).destroy)}),{destroy(){N(),A(),P()}}}}),j=Pe(qr("arrow"),{stores:i,returned:L=>({"data-arrow":!0,style:Pt({position:"absolute",width:`var(--arrow-size, ${L}px)`,height:`var(--arrow-size, ${L}px)`})})}),I=Pe(qr("close"),{returned:()=>({type:"button"}),action:L=>({destroy:rt(ye(L,"click",A=>{A.defaultPrevented||h()}),ye(L,"keydown",A=>{A.defaultPrevented||A.key!==ae.ENTER&&A.key!==ae.SPACE||(A.preventDefault(),$())}))})});return xe([_,y,o],([L,N,A])=>{if(!pt)return;const P=[];if(L){N||Kt().then(()=>{const W=document.getElementById(g.trigger.get());J(W)&&y.set(W)}),A&&P.push(ho());const q=N??document.getElementById(g.trigger.get());ti({prop:c.get(),defaultEl:q})}return()=>{P.forEach(q=>q())}}),{ids:g,elements:{trigger:F,content:O,arrow:j,close:I,overlay:R},states:{open:_},options:n}}function ul(t){return t?"open":"closed"}const _m={orientation:"horizontal",decorative:!1},gm=t=>{const e={..._m,...t},n=Dt(e),{orientation:r,decorative:i}=n;return{elements:{root:Pe("separator",{stores:[r,i],returned:([o,u])=>({role:u?"none":"separator","aria-orientation":o==="vertical"?o:void 0,"aria-hidden":u,"data-orientation":o})})},options:n}},bm={loop:!0,orientation:"horizontal"},{name:Ri,selector:Os}=Xn("toolbar"),ym=t=>{const e={...bm,...t},n=Dt(e),{loop:r,orientation:i}=n,s=Pe(Ri(),{stores:i,returned:d=>({role:"toolbar","data-orientation":d})}),o=Pe(Ri("button"),{returned:()=>({role:"button",type:"button"}),action:d=>(As(d),{destroy:ye(d,"keydown",c)})}),u=Pe(Ri("link"),{returned:()=>({role:"link"}),action:d=>(As(d),{destroy:ye(d,"keydown",c)})}),l=Pe(Ri("separator"),{stores:i,returned:d=>({role:"separator","data-orientation":d==="horizontal"?"vertical":"horizontal","aria-orientation":d==="horizontal"?"vertical":"horizontal"})}),a={type:"single",disabled:!1},f=d=>{const m={...a,...d},p=Dt(m),{type:_,disabled:y}=p,g=m.defaultValue?m.defaultValue:m.type==="single"?void 0:[],h=m.value??Re(g),v=fr(h,m==null?void 0:m.onValueChange),{name:O}=Xn("toolbar-group"),$=Pe(O(),{stores:i,returned:R=>({role:"group","data-orientation":R})}),C=Pe(O("item"),{stores:[y,_,v,i],returned:([R,j,I,L])=>N=>{const A=typeof N=="string"?N:N.value,P=typeof N=="string"?!1:!!N.disabled,q=R||P,W=Array.isArray(I)?I.includes(A):I===A,oe=j==="single",se=j==="multiple";return{disabled:Gr(q),pressed:W,"data-orientation":L,"data-disabled":Gr(q),"data-value":A,"data-state":W?"on":"off","aria-checked":oe?W:void 0,"aria-pressed":se?W:void 0,type:"button",role:oe?"radio":void 0,"data-melt-toolbar-item":""}},action:R=>{As(R);function j(){const N=R.dataset.value,A=R.dataset.disabled==="true";return{value:N,disabled:A}}function I(){const{value:N,disabled:A}=j();N===void 0||A||v.update(P=>Array.isArray(P)?P.includes(N)?P.filter(q=>q!==N):(P.push(N),P):P===N?void 0:N)}return{destroy:rt(ye(R,"click",()=>{I()}),ye(R,"keydown",N=>{if(N.key===ae.ENTER||N.key===ae.SPACE){N.preventDefault(),I();return}c(N)}))}}}),F=Ue(v,R=>j=>Array.isArray(R)?R.includes(j):R===j);return{elements:{group:$,item:C},states:{value:v},helpers:{isPressed:F},options:p}};function c(d){const m=i.get(),p=r.get(),_={horizontal:ae.ARROW_RIGHT,vertical:ae.ARROW_DOWN}[m??"horizontal"],y={horizontal:ae.ARROW_LEFT,vertical:ae.ARROW_UP}[m??"horizontal"],g=d.currentTarget;if(!J(g))return;const h=g.closest("[data-melt-toolbar]");if(!J(h))return;const v=Ga(h),O=v.indexOf(g);if(d.key===_){d.preventDefault();const $=O+1;$>=v.length&&p?et(v[0]):et(v[$])}else if(d.key===y){d.preventDefault();const $=O-1;$<0&&p?et(v[v.length-1]):et(v[$])}else d.key===ae.HOME?(d.preventDefault(),et(v[0])):d.key===ae.END&&(d.preventDefault(),et(v[v.length-1]))}return{elements:{root:s,button:o,separator:l,link:u},builders:{createToolbarGroup:f},options:n}};function As(t){const e=t.closest("[data-melt-toolbar]");if(!J(e))return;Ga(e)[0]===t?t.tabIndex=0:t.tabIndex=-1}function Ga(t){return Array.from(t.querySelectorAll(`${Os("item")}, ${Os("button")}, ${Os("link")}`)).filter(e=>J(e))}function ii(t,e){const n={};return e.forEach(r=>{n[r]={[`data-${t}-${r}`]:""}}),r=>n[r]}function vm(t){return t?{"aria-disabled":"true","data-disabled":""}:{"aria-disabled":void 0,"data-disabled":void 0}}function Ln(){const t=Of();return e=>{const{originalEvent:n}=e.detail,{cancelable:r}=e,i=n.type;t(i,{originalEvent:n,currentTarget:n.currentTarget},{cancelable:r})||e.preventDefault()}}function pi(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function hi(t){return function(e,n){if(n===void 0)return;const r=t[e];r&&r.set(n)}}function Ya(t){return(e={})=>km(t,e)}function km(t,e){const r={...{side:"bottom",align:"center",sideOffset:0,alignOffset:0,sameWidth:!1,avoidCollisions:!0,collisionPadding:8,fitViewport:!1,strategy:"absolute",overlap:!1},...e};t.update(i=>({...i,placement:Cm(r.side,r.align),offset:{...i.offset,mainAxis:r.sideOffset,crossAxis:r.alignOffset},gutter:0,sameWidth:r.sameWidth,flip:r.avoidCollisions,overflowPadding:r.collisionPadding,boundary:r.collisionBoundary,fitViewport:r.fitViewport,strategy:r.strategy,overlap:r.overlap}))}function Cm(t,e){return e==="center"?t:`${t}-${e}`}function Eo(){return{NAME:"menu",SUB_NAME:"menu-submenu",RADIO_GROUP_NAME:"menu-radiogroup",CHECKBOX_ITEM_NAME:"menu-checkboxitem",RADIO_ITEM_NAME:"menu-radioitem",GROUP_NAME:"menu-group",PARTS:["arrow","checkbox-indicator","checkbox-item","content","group","item","label","radio-group","radio-item","radio-indicator","separator","sub-content","sub-trigger","trigger"]}}function _i(){const{NAME:t}=Eo();return at(t)}function Em(t){const{RADIO_GROUP_NAME:e}=Eo(),{builders:{createMenuRadioGroup:n},getAttrs:r}=_i(),i=n(t);return bt(e,{...i,getAttrs:r}),{...i,getAttrs:r}}function wm(t){const{RADIO_ITEM_NAME:e,RADIO_GROUP_NAME:n}=Eo(),r=at(n);return bt(e,{...r,value:t}),{...r,value:t}}function Om(t){const n={...{side:"bottom",align:"center"},...t},{options:{positioning:r}}=_i();Ya(r)(n)}const Am=t=>({builder:t&8}),al=t=>({builder:t[3]}),Tm=t=>({builder:t&8}),fl=t=>({builder:t[3]});function $m(t){let e=t[1]?"a":"div",n,r,i=(t[1]?"a":"div")&&Ts(t);return{c(){i&&i.c(),n=Ie()},m(s,o){i&&i.m(s,o),w(s,n,o),r=!0},p(s,o){s[1],e?fe(e,s[1]?"a":"div")?(i.d(1),i=Ts(s),e=s[1]?"a":"div",i.c(),i.m(n.parentNode,n)):i.p(s,o):(i=Ts(s),e=s[1]?"a":"div",i.c(),i.m(n.parentNode,n))},i(s){r||(b(i,s),r=!0)},o(s){k(i,s),r=!1},d(s){s&&E(n),i&&i.d(s)}}}function Sm(t){let e;const n=t[11].default,r=ce(n,t,t[10],fl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&1032)&&me(r,n,i,i[10],e?de(n,i[10],s,Tm):pe(i[10]),fl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Ts(t){let e,n,r,i;const s=t[11].default,o=ce(s,t,t[10],al);let u=[{href:t[1]},t[3],t[6]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S(t[1]?"a":"div"),o&&o.c(),Mi(t[1]?"a":"div")(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[13](e),n=!0,r||(i=[Ve(t[3].action(e)),G(e,"m-click",t[5]),G(e,"m-focusin",t[5]),G(e,"m-focusout",t[5]),G(e,"m-keydown",t[5]),G(e,"m-pointerdown",t[5]),G(e,"m-pointerleave",t[5]),G(e,"m-pointermove",t[5]),G(e,"pointerenter",t[12])],r=!0)},p(a,f){o&&o.p&&(!n||f&1032)&&me(o,s,a,a[10],n?de(s,a[10],f,Am):pe(a[10]),al),Mi(a[1]?"a":"div")(e,l=Ne(u,[(!n||f&2)&&{href:a[1]},f&8&&a[3],f&64&&a[6]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[13](null),r=!1,Ae(i)}}}function Rm(t){let e,n,r,i;const s=[Sm,$m],o=[];function u(l,a){return l[2]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Fm(t,e,n){let r,i;const s=["href","asChild","disabled","el"];let o=Ke(e,s),u,{$$slots:l={},$$scope:a}=e,{href:f=void 0}=e,{asChild:c=!1}=e,{disabled:d=!1}=e,{el:m=void 0}=e;const{elements:{item:p},getAttrs:_}=_i();x(t,p,v=>n(9,u=v));const y=Ln();function g(v){Oe.call(this,t,v)}function h(v){ve[v?"unshift":"push"](()=>{m=v,n(0,m)})}return t.$$set=v=>{e=ne(ne({},e),vt(v)),n(6,o=Ke(e,s)),"href"in v&&n(1,f=v.href),"asChild"in v&&n(2,c=v.asChild),"disabled"in v&&n(7,d=v.disabled),"el"in v&&n(0,m=v.el),"$$scope"in v&&n(10,a=v.$$scope)},t.$$.update=()=>{t.$$.dirty&512&&n(3,r=u),t.$$.dirty&128&&n(8,i={..._("item"),...vm(d)}),t.$$.dirty&264&&Object.assign(r,i)},[m,f,c,r,p,y,o,d,i,u,a,l,g,h]}class Ut extends be{constructor(e){super(),ge(this,e,Fm,Rm,fe,{href:1,asChild:2,disabled:7,el:0})}}const Pm=t=>({builder:t&4}),cl=t=>({builder:t[2]}),Dm=t=>({builder:t&4}),dl=t=>({builder:t[2]});function Lm(t){let e,n,r,i;const s=t[10].default,o=ce(s,t,t[9],cl);let u=[t[2],t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[12](e),n=!0,r||(i=[Ve(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-focusin",t[4]),G(e,"m-focusout",t[4]),G(e,"m-keydown",t[4]),G(e,"m-pointerdown",t[4]),G(e,"m-pointerleave",t[4]),G(e,"m-pointermove",t[4]),G(e,"pointerenter",t[11])],r=!0)},p(a,f){o&&o.p&&(!n||f&516)&&me(o,s,a,a[9],n?de(s,a[9],f,Pm):pe(a[9]),cl),ie(e,l=Ne(u,[f&4&&a[2],f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[12](null),r=!1,Ae(i)}}}function Im(t){let e;const n=t[10].default,r=ce(n,t,t[9],dl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&516)&&me(r,n,i,i[9],e?de(n,i[9],s,Dm):pe(i[9]),dl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Nm(t){let e,n,r,i;const s=[Im,Lm],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Mm(t,e,n){let r;const i=["value","disabled","asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{value:a}=e,{disabled:f=!1}=e,{asChild:c=!1}=e,{el:d=void 0}=e;const{elements:{radioItem:m},getAttrs:p}=wm(a);x(t,m,v=>n(8,o=v));const _=p("radio-item"),y=Ln();function g(v){Oe.call(this,t,v)}function h(v){ve[v?"unshift":"push"](()=>{d=v,n(0,d)})}return t.$$set=v=>{e=ne(ne({},e),vt(v)),n(5,s=Ke(e,i)),"value"in v&&n(6,a=v.value),"disabled"in v&&n(7,f=v.disabled),"asChild"in v&&n(1,c=v.asChild),"el"in v&&n(0,d=v.el),"$$scope"in v&&n(9,l=v.$$scope)},t.$$.update=()=>{t.$$.dirty&448&&n(2,r=o({value:a,disabled:f})),t.$$.dirty&4&&Object.assign(r,_)},[d,c,r,m,y,s,a,f,o,l,u,g,h]}class Hm extends be{constructor(e){super(),ge(this,e,Mm,Nm,fe,{value:6,disabled:7,asChild:1,el:0})}}const Vm=t=>({builder:t&4}),ml=t=>({builder:t[2]});function Bm(t){let e,n,r,i=[t[3],t[5]],s={};for(let o=0;o<i.length;o+=1)s=ne(s,i[o]);return{c(){e=S("div"),ie(e,s)},m(o,u){w(o,e,u),t[8](e),n||(r=Ve(t[3].action(e)),n=!0)},p(o,u){ie(e,s=Ne(i,[u&8&&o[3],u&32&&o[5]]))},i:_e,o:_e,d(o){o&&E(e),t[8](null),n=!1,r()}}}function Um(t){let e;const n=t[7].default,r=ce(n,t,t[6],ml);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&68)&&me(r,n,i,i[6],e?de(n,i[6],s,Vm):pe(i[6]),ml)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Km(t){let e,n,r,i;const s=[Um,Bm],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function jm(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{separator:c},getAttrs:d}=_i();x(t,c,_=>n(3,o=_));const m=d("separator");function p(_){ve[_?"unshift":"push"](()=>{f=_,n(0,f)})}return t.$$set=_=>{e=ne(ne({},e),vt(_)),n(5,s=Ke(e,i)),"asChild"in _&&n(1,a=_.asChild),"el"in _&&n(0,f=_.el),"$$scope"in _&&n(6,l=_.$$scope)},t.$$.update=()=>{t.$$.dirty&8&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,m)},[f,a,r,o,c,s,l,u,p]}class wo extends be{constructor(e){super(),ge(this,e,jm,Km,fe,{asChild:1,el:0})}}const qm=t=>({builder:t&4}),pl=t=>({builder:t[2]}),Wm=t=>({builder:t&4}),hl=t=>({builder:t[2]});function Qm(t){let e,n,r,i;const s=t[9].default,o=ce(s,t,t[8],pl);let u=[t[2],t[4]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[10](e),n=!0,r||(i=Ve(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&260)&&me(o,s,a,a[8],n?de(s,a[8],f,qm):pe(a[8]),pl),ie(e,l=Ne(u,[f&4&&a[2],f&16&&a[4]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,i()}}}function zm(t){let e;const n=t[9].default,r=ce(n,t,t[8],hl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&260)&&me(r,n,i,i[8],e?de(n,i[8],s,Wm):pe(i[8]),hl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Gm(t){let e,n,r,i;const s=[zm,Qm],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Ym(t,e,n){let r;const i=["value","onValueChange","asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{value:a=void 0}=e,{onValueChange:f=void 0}=e,{asChild:c=!1}=e,{el:d=void 0}=e;const{elements:{radioGroup:m},states:{value:p},getAttrs:_}=Em({defaultValue:a,onValueChange:({next:h})=>(h!=null&&h!==a&&(f==null||f(h),n(5,a=h)),h)});x(t,m,h=>n(7,o=h));const y=_("radio-group");function g(h){ve[h?"unshift":"push"](()=>{d=h,n(0,d)})}return t.$$set=h=>{e=ne(ne({},e),vt(h)),n(4,s=Ke(e,i)),"value"in h&&n(5,a=h.value),"onValueChange"in h&&n(6,f=h.onValueChange),"asChild"in h&&n(1,c=h.asChild),"el"in h&&n(0,d=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&32&&a!==void 0&&p.set(a),t.$$.dirty&128&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,y)},[d,c,r,m,s,a,f,o,l,u,g]}class Zm extends be{constructor(e){super(),ge(this,e,Ym,Gm,fe,{value:5,onValueChange:6,asChild:1,el:0})}}function Za(){return{NAME:"popover",PARTS:["arrow","close","content","trigger"]}}function Xm(t){const{NAME:e,PARTS:n}=Za(),r=ii(e,n),i={...hm({positioning:{placement:"bottom",gutter:0},...pi(t),forceVisible:!0}),getAttrs:r};return bt(e,i),{...i,updateOption:hi(i.options)}}function Oo(){const{NAME:t}=Za();return at(t)}function Jm(t){const n={...{side:"bottom",align:"center"},...t},{options:{positioning:r}}=Oo();Ya(r)(n)}function Xa(){return{NAME:"dialog",PARTS:["close","content","description","overlay","portal","title","trigger"]}}function xm(t){const{NAME:e,PARTS:n}=Xa(),r=ii(e,n),i={...am({...pi(t),role:"dialog",forceVisible:!0}),getAttrs:r};return bt(e,i),{...i,updateOption:hi(i.options)}}function Lr(){const{NAME:t}=Xa();return at(t)}const ep=t=>({ids:t&1}),_l=t=>({ids:t[0]});function tp(t){let e;const n=t[12].default,r=ce(n,t,t[11],_l);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&2049)&&me(r,n,i,i[11],e?de(n,i[11],s,ep):pe(i[11]),_l)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function np(t,e,n){let r,{$$slots:i={},$$scope:s}=e,{preventScroll:o=void 0}=e,{closeOnEscape:u=void 0}=e,{closeOnOutsideClick:l=void 0}=e,{portal:a=void 0}=e,{open:f=void 0}=e,{onOpenChange:c=void 0}=e,{openFocus:d=void 0}=e,{closeFocus:m=void 0}=e,{onOutsideClick:p=void 0}=e;const{states:{open:_},updateOption:y,ids:g}=xm({closeOnEscape:u,preventScroll:o,closeOnOutsideClick:l,portal:a,forceVisible:!0,defaultOpen:f,openFocus:d,closeFocus:m,onOutsideClick:p,onOpenChange:({next:v})=>(f!==v&&(c==null||c(v),n(2,f=v)),v)}),h=Ue([g.content,g.description,g.title],([v,O,$])=>({content:v,description:O,title:$}));return x(t,h,v=>n(0,r=v)),t.$$set=v=>{"preventScroll"in v&&n(3,o=v.preventScroll),"closeOnEscape"in v&&n(4,u=v.closeOnEscape),"closeOnOutsideClick"in v&&n(5,l=v.closeOnOutsideClick),"portal"in v&&n(6,a=v.portal),"open"in v&&n(2,f=v.open),"onOpenChange"in v&&n(7,c=v.onOpenChange),"openFocus"in v&&n(8,d=v.openFocus),"closeFocus"in v&&n(9,m=v.closeFocus),"onOutsideClick"in v&&n(10,p=v.onOutsideClick),"$$scope"in v&&n(11,s=v.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&f!==void 0&&_.set(f),t.$$.dirty&8&&y("preventScroll",o),t.$$.dirty&16&&y("closeOnEscape",u),t.$$.dirty&32&&y("closeOnOutsideClick",l),t.$$.dirty&64&&y("portal",a),t.$$.dirty&256&&y("openFocus",d),t.$$.dirty&512&&y("closeFocus",m),t.$$.dirty&1024&&y("onOutsideClick",p)},[r,h,f,o,u,l,a,c,d,m,p,s,i]}class si extends be{constructor(e){super(),ge(this,e,np,tp,fe,{preventScroll:3,closeOnEscape:4,closeOnOutsideClick:5,portal:6,open:2,onOpenChange:7,openFocus:8,closeFocus:9,onOutsideClick:10})}}const rp=t=>({builder:t&8}),gl=t=>({builder:t[3]}),ip=t=>({builder:t&8}),bl=t=>({builder:t[3]});function sp(t){let e=t[1],n,r,i=t[1]&&$s(t);return{c(){i&&i.c(),n=Ie()},m(s,o){i&&i.m(s,o),w(s,n,o),r=!0},p(s,o){s[1]?e?fe(e,s[1])?(i.d(1),i=$s(s),e=s[1],i.c(),i.m(n.parentNode,n)):i.p(s,o):(i=$s(s),e=s[1],i.c(),i.m(n.parentNode,n)):e&&(i.d(1),i=null,e=s[1])},i(s){r||(b(i,s),r=!0)},o(s){k(i,s),r=!1},d(s){s&&E(n),i&&i.d(s)}}}function op(t){let e;const n=t[9].default,r=ce(n,t,t[8],bl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&264)&&me(r,n,i,i[8],e?de(n,i[8],s,ip):pe(i[8]),bl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function $s(t){let e,n,r,i;const s=t[9].default,o=ce(s,t,t[8],gl);let u=[t[3],t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S(t[1]),o&&o.c(),Mi(t[1])(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[10](e),n=!0,r||(i=Ve(t[3].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&264)&&me(o,s,a,a[8],n?de(s,a[8],f,rp):pe(a[8]),gl),Mi(a[1])(e,l=Ne(u,[f&8&&a[3],f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,i()}}}function lp(t){let e,n,r,i;const s=[op,sp],o=[];function u(l,a){return l[2]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function up(t,e,n){let r;const i=["level","asChild","id","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{level:a="h2"}=e,{asChild:f=!1}=e,{id:c=void 0}=e,{el:d=void 0}=e;const{elements:{title:m},ids:p,getAttrs:_}=Lr();x(t,m,h=>n(7,o=h));const y=_("title");function g(h){ve[h?"unshift":"push"](()=>{d=h,n(0,d)})}return t.$$set=h=>{e=ne(ne({},e),vt(h)),n(5,s=Ke(e,i)),"level"in h&&n(1,a=h.level),"asChild"in h&&n(2,f=h.asChild),"id"in h&&n(6,c=h.id),"el"in h&&n(0,d=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&c&&p.title.set(c),t.$$.dirty&128&&n(3,r=o),t.$$.dirty&8&&Object.assign(r,y)},[d,a,f,r,m,s,c,o,l,u,g]}class St extends be{constructor(e){super(),ge(this,e,up,lp,fe,{level:1,asChild:2,id:6,el:0})}}const ap=t=>({builder:t&4}),yl=t=>({builder:t[2]}),fp=t=>({builder:t&4}),vl=t=>({builder:t[2]});function cp(t){let e,n,r,i;const s=t[8].default,o=ce(s,t,t[7],yl);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[9](e),n=!0,r||(i=[Ve(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-keydown",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&132)&&me(o,s,a,a[7],n?de(s,a[7],f,ap):pe(a[7]),yl),ie(e,l=Ne(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[9](null),r=!1,Ae(i)}}}function dp(t){let e;const n=t[8].default,r=ce(n,t,t[7],vl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&132)&&me(r,n,i,i[7],e?de(n,i[7],s,fp):pe(i[7]),vl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function mp(t){let e,n,r,i;const s=[dp,cp],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function pp(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{close:c},getAttrs:d}=Lr();x(t,c,y=>n(6,o=y));const m=Ln(),p=d("close");function _(y){ve[y?"unshift":"push"](()=>{f=y,n(0,f)})}return t.$$set=y=>{e=ne(ne({},e),vt(y)),n(5,s=Ke(e,i)),"asChild"in y&&n(1,a=y.asChild),"el"in y&&n(0,f=y.el),"$$scope"in y&&n(7,l=y.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,p)},[f,a,r,c,m,s,o,l,u,_]}class Mt extends be{constructor(e){super(),ge(this,e,pp,mp,fe,{asChild:1,el:0})}}const hp=t=>({builder:t&4}),kl=t=>({builder:t[2]}),_p=t=>({builder:t&4}),Cl=t=>({builder:t[2]});function gp(t){let e,n,r,i;const s=t[7].default,o=ce(s,t,t[6],kl);let u=[t[2],t[4]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[8](e),n=!0,r||(i=Ve(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&68)&&me(o,s,a,a[6],n?de(s,a[6],f,hp):pe(a[6]),kl),ie(e,l=Ne(u,[f&4&&a[2],f&16&&a[4]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[8](null),r=!1,i()}}}function bp(t){let e;const n=t[7].default,r=ce(n,t,t[6],Cl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&68)&&me(r,n,i,i[6],e?de(n,i[6],s,_p):pe(i[6]),Cl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function yp(t){let e,n,r,i;const s=[bp,gp],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function vp(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{portalled:c},getAttrs:d}=Lr();x(t,c,_=>n(5,o=_));const m=d("portal");function p(_){ve[_?"unshift":"push"](()=>{f=_,n(0,f)})}return t.$$set=_=>{e=ne(ne({},e),vt(_)),n(4,s=Ke(e,i)),"asChild"in _&&n(1,a=_.asChild),"el"in _&&n(0,f=_.el),"$$scope"in _&&n(6,l=_.$$scope)},t.$$.update=()=>{t.$$.dirty&32&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,m)},[f,a,r,c,s,o,l,u,p]}class gi extends be{constructor(e){super(),ge(this,e,vp,yp,fe,{asChild:1,el:0})}}const kp=t=>({builder:t[0]&256}),El=t=>({builder:t[8]}),Cp=t=>({builder:t[0]&256}),wl=t=>({builder:t[8]}),Ep=t=>({builder:t[0]&256}),Ol=t=>({builder:t[8]}),wp=t=>({builder:t[0]&256}),Al=t=>({builder:t[8]}),Op=t=>({builder:t[0]&256}),Tl=t=>({builder:t[8]}),Ap=t=>({builder:t[0]&256}),$l=t=>({builder:t[8]});function Tp(t){let e,n,r,i;const s=t[16].default,o=ce(s,t,t[15],El);let u=[t[8],t[12]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[56](e),n=!0,r||(i=[Ve(t[8].action(e)),G(e,"pointerdown",t[45]),G(e,"pointermove",t[46]),G(e,"pointerup",t[47]),G(e,"touchcancel",t[48]),G(e,"touchend",t[49]),G(e,"touchmove",t[50],{passive:!1}),G(e,"touchstart",t[51],{passive:!1})],r=!0)},p(a,f){o&&o.p&&(!n||f[0]&33024)&&me(o,s,a,a[15],n?de(s,a[15],f,kp):pe(a[15]),El),ie(e,l=Ne(u,[f[0]&256&&a[8],f[0]&4096&&a[12]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[56](null),r=!1,Ae(i)}}}function $p(t){let e,n,r,i,s;const o=t[16].default,u=ce(o,t,t[15],wl);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[55](e),r=!0,i||(s=[Ve(t[8].action(e)),G(e,"pointerdown",t[38]),G(e,"pointermove",t[39]),G(e,"pointerup",t[40]),G(e,"touchcancel",t[41]),G(e,"touchend",t[42]),G(e,"touchmove",t[43],{passive:!1}),G(e,"touchstart",t[44],{passive:!1})],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&33024)&&me(u,o,t,t[15],r?de(o,t[15],c,Cp):pe(t[15]),wl),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),n&&n.end(1),r=!0)},o(f){k(u,f),f&&(n=Dn(e,t[5],t[6])),r=!1},d(f){f&&E(e),u&&u.d(f),t[55](null),f&&n&&n.end(),i=!1,Ae(s)}}}function Sp(t){let e,n,r,i,s;const o=t[16].default,u=ce(o,t,t[15],Ol);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[54](e),r=!0,i||(s=[Ve(t[8].action(e)),G(e,"pointerdown",t[31]),G(e,"pointermove",t[32]),G(e,"pointerup",t[33]),G(e,"touchcancel",t[34]),G(e,"touchend",t[35]),G(e,"touchmove",t[36],{passive:!1}),G(e,"touchstart",t[37],{passive:!1})],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&33024)&&me(u,o,t,t[15],r?de(o,t[15],c,Ep):pe(t[15]),Ol),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&(n||ft(()=>{n=Pn(e,t[3],t[4]),n.start()})),r=!0)},o(f){k(u,f),r=!1},d(f){f&&E(e),u&&u.d(f),t[54](null),i=!1,Ae(s)}}}function Rp(t){let e,n,r,i,s,o;const u=t[16].default,l=ce(u,t,t[15],Al);let a=[t[8],t[12]],f={};for(let c=0;c<a.length;c+=1)f=ne(f,a[c]);return{c(){e=S("div"),l&&l.c(),ie(e,f)},m(c,d){w(c,e,d),l&&l.m(e,null),t[53](e),i=!0,s||(o=[Ve(t[8].action(e)),G(e,"pointerdown",t[24]),G(e,"pointermove",t[25]),G(e,"pointerup",t[26]),G(e,"touchcancel",t[27]),G(e,"touchend",t[28]),G(e,"touchmove",t[29],{passive:!1}),G(e,"touchstart",t[30],{passive:!1})],s=!0)},p(c,d){t=c,l&&l.p&&(!i||d[0]&33024)&&me(l,u,t,t[15],i?de(u,t[15],d,wp):pe(t[15]),Al),ie(e,f=Ne(a,[d[0]&256&&t[8],d[0]&4096&&t[12]]))},i(c){i||(b(l,c),c&&ft(()=>{i&&(r&&r.end(1),n=Pn(e,t[3],t[4]),n.start())}),i=!0)},o(c){k(l,c),n&&n.invalidate(),c&&(r=Dn(e,t[5],t[6])),i=!1},d(c){c&&E(e),l&&l.d(c),t[53](null),c&&r&&r.end(),s=!1,Ae(o)}}}function Fp(t){let e,n,r,i,s;const o=t[16].default,u=ce(o,t,t[15],Tl);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[52](e),r=!0,i||(s=[Ve(t[8].action(e)),G(e,"pointerdown",t[17]),G(e,"pointermove",t[18]),G(e,"pointerup",t[19]),G(e,"touchcancel",t[20]),G(e,"touchend",t[21]),G(e,"touchmove",t[22],{passive:!1}),G(e,"touchstart",t[23],{passive:!1})],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&33024)&&me(u,o,t,t[15],r?de(o,t[15],c,Op):pe(t[15]),Tl),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&ft(()=>{r&&(n||(n=$n(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(f){k(u,f),f&&(n||(n=$n(e,t[1],t[2],!1)),n.run(0)),r=!1},d(f){f&&E(e),u&&u.d(f),t[52](null),f&&n&&n.end(),i=!1,Ae(s)}}}function Pp(t){let e;const n=t[16].default,r=ce(n,t,t[15],$l);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s[0]&33024)&&me(r,n,i,i[15],e?de(n,i[15],s,Ap):pe(i[15]),$l)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Dp(t){let e,n,r,i;const s=[Pp,Fp,Rp,Sp,$p,Tp],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Ie()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function Lp(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","id","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:d=void 0}=e,{inTransitionConfig:m=void 0}=e,{outTransition:p=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:y=!1}=e,{id:g=void 0}=e,{el:h=void 0}=e;const{elements:{content:v},states:{open:O},ids:$,getAttrs:C}=Lr();x(t,v,K=>n(14,o=K)),x(t,O,K=>n(9,u=K));const F=C("content");function R(K){Oe.call(this,t,K)}function j(K){Oe.call(this,t,K)}function I(K){Oe.call(this,t,K)}function L(K){Oe.call(this,t,K)}function N(K){Oe.call(this,t,K)}function A(K){Oe.call(this,t,K)}function P(K){Oe.call(this,t,K)}function q(K){Oe.call(this,t,K)}function W(K){Oe.call(this,t,K)}function oe(K){Oe.call(this,t,K)}function se(K){Oe.call(this,t,K)}function z(K){Oe.call(this,t,K)}function le(K){Oe.call(this,t,K)}function $e(K){Oe.call(this,t,K)}function st(K){Oe.call(this,t,K)}function Me(K){Oe.call(this,t,K)}function Y(K){Oe.call(this,t,K)}function Z(K){Oe.call(this,t,K)}function ht(K){Oe.call(this,t,K)}function _t(K){Oe.call(this,t,K)}function dt(K){Oe.call(this,t,K)}function mn(K){Oe.call(this,t,K)}function In(K){Oe.call(this,t,K)}function pn(K){Oe.call(this,t,K)}function ms(K){Oe.call(this,t,K)}function ps(K){Oe.call(this,t,K)}function Ir(K){Oe.call(this,t,K)}function Nr(K){Oe.call(this,t,K)}function Mr(K){Oe.call(this,t,K)}function Hr(K){Oe.call(this,t,K)}function hs(K){Oe.call(this,t,K)}function Vr(K){Oe.call(this,t,K)}function ki(K){Oe.call(this,t,K)}function Q(K){Oe.call(this,t,K)}function ee(K){Oe.call(this,t,K)}function te(K){ve[K?"unshift":"push"](()=>{h=K,n(0,h)})}function ue(K){ve[K?"unshift":"push"](()=>{h=K,n(0,h)})}function we(K){ve[K?"unshift":"push"](()=>{h=K,n(0,h)})}function Je(K){ve[K?"unshift":"push"](()=>{h=K,n(0,h)})}function kt(K){ve[K?"unshift":"push"](()=>{h=K,n(0,h)})}return t.$$set=K=>{e=ne(ne({},e),vt(K)),n(12,s=Ke(e,i)),"transition"in K&&n(1,f=K.transition),"transitionConfig"in K&&n(2,c=K.transitionConfig),"inTransition"in K&&n(3,d=K.inTransition),"inTransitionConfig"in K&&n(4,m=K.inTransitionConfig),"outTransition"in K&&n(5,p=K.outTransition),"outTransitionConfig"in K&&n(6,_=K.outTransitionConfig),"asChild"in K&&n(7,y=K.asChild),"id"in K&&n(13,g=K.id),"el"in K&&n(0,h=K.el),"$$scope"in K&&n(15,a=K.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&8192&&g&&$.content.set(g),t.$$.dirty[0]&16384&&n(8,r=o),t.$$.dirty[0]&256&&Object.assign(r,F)},[h,f,c,d,m,p,_,y,r,u,v,O,s,g,o,a,l,R,j,I,L,N,A,P,q,W,oe,se,z,le,$e,st,Me,Y,Z,ht,_t,dt,mn,In,pn,ms,ps,Ir,Nr,Mr,Hr,hs,Vr,ki,Q,ee,te,ue,we,Je,kt]}class bi extends be{constructor(e){super(),ge(this,e,Lp,Dp,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,id:13,el:0},null,[-1,-1])}}const Ip=t=>({builder:t&256}),Sl=t=>({builder:t[8]});function Np(t){let e,n,r,i=[t[8],t[12]],s={};for(let o=0;o<i.length;o+=1)s=ne(s,i[o]);return{c(){e=S("div"),ie(e,s)},m(o,u){w(o,e,u),t[25](e),n||(r=[Ve(t[8].action(e)),G(e,"mouseup",t[20])],n=!0)},p(o,u){ie(e,s=Ne(i,[u&256&&o[8],u&4096&&o[12]]))},i:_e,o:_e,d(o){o&&E(e),t[25](null),n=!1,Ae(r)}}}function Mp(t){let e,n,r,i,s,o=[t[8],t[12]],u={};for(let l=0;l<o.length;l+=1)u=ne(u,o[l]);return{c(){e=S("div"),ie(e,u)},m(l,a){w(l,e,a),t[24](e),r=!0,i||(s=[Ve(t[8].action(e)),G(e,"mouseup",t[19])],i=!0)},p(l,a){t=l,ie(e,u=Ne(o,[a&256&&t[8],a&4096&&t[12]]))},i(l){r||(n&&n.end(1),r=!0)},o(l){l&&(n=Dn(e,t[5],t[6])),r=!1},d(l){l&&E(e),t[24](null),l&&n&&n.end(),i=!1,Ae(s)}}}function Hp(t){let e,n,r,i,s=[t[8],t[12]],o={};for(let u=0;u<s.length;u+=1)o=ne(o,s[u]);return{c(){e=S("div"),ie(e,o)},m(u,l){w(u,e,l),t[23](e),r||(i=[Ve(t[8].action(e)),G(e,"mouseup",t[18])],r=!0)},p(u,l){t=u,ie(e,o=Ne(s,[l&256&&t[8],l&4096&&t[12]]))},i(u){u&&(n||ft(()=>{n=Pn(e,t[3],t[4]),n.start()}))},o:_e,d(u){u&&E(e),t[23](null),r=!1,Ae(i)}}}function Vp(t){let e,n,r,i,s,o,u=[t[8],t[12]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),ie(e,l)},m(a,f){w(a,e,f),t[22](e),i=!0,s||(o=[Ve(t[8].action(e)),G(e,"mouseup",t[17])],s=!0)},p(a,f){t=a,ie(e,l=Ne(u,[f&256&&t[8],f&4096&&t[12]]))},i(a){i||(a&&ft(()=>{i&&(r&&r.end(1),n=Pn(e,t[3],t[4]),n.start())}),i=!0)},o(a){n&&n.invalidate(),a&&(r=Dn(e,t[5],t[6])),i=!1},d(a){a&&E(e),t[22](null),a&&r&&r.end(),s=!1,Ae(o)}}}function Bp(t){let e,n,r,i,s,o=[t[8],t[12]],u={};for(let l=0;l<o.length;l+=1)u=ne(u,o[l]);return{c(){e=S("div"),ie(e,u)},m(l,a){w(l,e,a),t[21](e),r=!0,i||(s=[G(e,"mouseup",t[16]),Ve(t[8].action(e))],i=!0)},p(l,a){t=l,ie(e,u=Ne(o,[a&256&&t[8],a&4096&&t[12]]))},i(l){r||(l&&ft(()=>{r&&(n||(n=$n(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(l){l&&(n||(n=$n(e,t[1],t[2],!1)),n.run(0)),r=!1},d(l){l&&E(e),t[21](null),l&&n&&n.end(),i=!1,Ae(s)}}}function Up(t){let e;const n=t[15].default,r=ce(n,t,t[14],Sl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&16640)&&me(r,n,i,i[14],e?de(n,i[14],s,Ip):pe(i[14]),Sl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Kp(t){let e,n,r,i;const s=[Up,Bp,Vp,Hp,Mp,Np],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Ie()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function jp(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:d=void 0}=e,{inTransitionConfig:m=void 0}=e,{outTransition:p=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:y=!1}=e,{el:g=void 0}=e;const{elements:{overlay:h},states:{open:v},getAttrs:O}=Lr();x(t,h,W=>n(13,o=W)),x(t,v,W=>n(9,u=W));const $=O("overlay");function C(W){Oe.call(this,t,W)}function F(W){Oe.call(this,t,W)}function R(W){Oe.call(this,t,W)}function j(W){Oe.call(this,t,W)}function I(W){Oe.call(this,t,W)}function L(W){ve[W?"unshift":"push"](()=>{g=W,n(0,g)})}function N(W){ve[W?"unshift":"push"](()=>{g=W,n(0,g)})}function A(W){ve[W?"unshift":"push"](()=>{g=W,n(0,g)})}function P(W){ve[W?"unshift":"push"](()=>{g=W,n(0,g)})}function q(W){ve[W?"unshift":"push"](()=>{g=W,n(0,g)})}return t.$$set=W=>{e=ne(ne({},e),vt(W)),n(12,s=Ke(e,i)),"transition"in W&&n(1,f=W.transition),"transitionConfig"in W&&n(2,c=W.transitionConfig),"inTransition"in W&&n(3,d=W.inTransition),"inTransitionConfig"in W&&n(4,m=W.inTransitionConfig),"outTransition"in W&&n(5,p=W.outTransition),"outTransitionConfig"in W&&n(6,_=W.outTransitionConfig),"asChild"in W&&n(7,y=W.asChild),"el"in W&&n(0,g=W.el),"$$scope"in W&&n(14,a=W.$$scope)},t.$$.update=()=>{t.$$.dirty&8192&&n(8,r=o),t.$$.dirty&256&&Object.assign(r,$)},[g,f,c,d,m,p,_,y,r,u,h,v,s,o,a,l,C,F,R,j,I,L,N,A,P,q]}class yi extends be{constructor(e){super(),ge(this,e,jp,Kp,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,el:0})}}const qp=t=>({builder:t&4}),Rl=t=>({builder:t[2]}),Wp=t=>({builder:t&4}),Fl=t=>({builder:t[2]});function Qp(t){let e,n,r,i;const s=t[8].default,o=ce(s,t,t[7],Rl);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[9](e),n=!0,r||(i=[Ve(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-keydown",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&132)&&me(o,s,a,a[7],n?de(s,a[7],f,qp):pe(a[7]),Rl),ie(e,l=Ne(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[9](null),r=!1,Ae(i)}}}function zp(t){let e;const n=t[8].default,r=ce(n,t,t[7],Fl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&132)&&me(r,n,i,i[7],e?de(n,i[7],s,Wp):pe(i[7]),Fl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Gp(t){let e,n,r,i;const s=[zp,Qp],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Yp(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{trigger:c},getAttrs:d}=Lr();x(t,c,y=>n(6,o=y));const m=Ln(),p=d("trigger");function _(y){ve[y?"unshift":"push"](()=>{f=y,n(0,f)})}return t.$$set=y=>{e=ne(ne({},e),vt(y)),n(5,s=Ke(e,i)),"asChild"in y&&n(1,a=y.asChild),"el"in y&&n(0,f=y.el),"$$scope"in y&&n(7,l=y.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,p)},[f,a,r,c,m,s,o,l,u,_]}class vi extends be{constructor(e){super(),ge(this,e,Yp,Gp,fe,{asChild:1,el:0})}}const Zp=t=>({builder:t[0]&256}),Pl=t=>({builder:t[8]}),Xp=t=>({builder:t[0]&256}),Dl=t=>({builder:t[8]}),Jp=t=>({builder:t[0]&256}),Ll=t=>({builder:t[8]}),xp=t=>({builder:t[0]&256}),Il=t=>({builder:t[8]}),eh=t=>({builder:t[0]&256}),Nl=t=>({builder:t[8]}),th=t=>({builder:t[0]&256}),Ml=t=>({builder:t[8]});function nh(t){let e,n,r,i;const s=t[28].default,o=ce(s,t,t[27],Pl);let u=[t[8],t[13]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[33](e),n=!0,r||(i=[Ve(t[8].action(e)),G(e,"m-keydown",t[12])],r=!0)},p(a,f){o&&o.p&&(!n||f[0]&134217984)&&me(o,s,a,a[27],n?de(s,a[27],f,Zp):pe(a[27]),Pl),ie(e,l=Ne(u,[f[0]&256&&a[8],f[0]&8192&&a[13]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[33](null),r=!1,Ae(i)}}}function rh(t){let e,n,r,i,s;const o=t[28].default,u=ce(o,t,t[27],Dl);let l=[t[8],t[13]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[32](e),r=!0,i||(s=[Ve(t[8].action(e)),G(e,"m-keydown",t[12])],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&134217984)&&me(u,o,t,t[27],r?de(o,t[27],c,Xp):pe(t[27]),Dl),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&8192&&t[13]]))},i(f){r||(b(u,f),n&&n.end(1),r=!0)},o(f){k(u,f),f&&(n=Dn(e,t[5],t[6])),r=!1},d(f){f&&E(e),u&&u.d(f),t[32](null),f&&n&&n.end(),i=!1,Ae(s)}}}function ih(t){let e,n,r,i,s;const o=t[28].default,u=ce(o,t,t[27],Ll);let l=[t[8],t[13]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[31](e),r=!0,i||(s=[Ve(t[8].action(e)),G(e,"m-keydown",t[12])],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&134217984)&&me(u,o,t,t[27],r?de(o,t[27],c,Jp):pe(t[27]),Ll),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&8192&&t[13]]))},i(f){r||(b(u,f),f&&(n||ft(()=>{n=Pn(e,t[3],t[4]),n.start()})),r=!0)},o(f){k(u,f),r=!1},d(f){f&&E(e),u&&u.d(f),t[31](null),i=!1,Ae(s)}}}function sh(t){let e,n,r,i,s,o;const u=t[28].default,l=ce(u,t,t[27],Il);let a=[t[8],t[13]],f={};for(let c=0;c<a.length;c+=1)f=ne(f,a[c]);return{c(){e=S("div"),l&&l.c(),ie(e,f)},m(c,d){w(c,e,d),l&&l.m(e,null),t[30](e),i=!0,s||(o=[Ve(t[8].action(e)),G(e,"m-keydown",t[12])],s=!0)},p(c,d){t=c,l&&l.p&&(!i||d[0]&134217984)&&me(l,u,t,t[27],i?de(u,t[27],d,xp):pe(t[27]),Il),ie(e,f=Ne(a,[d[0]&256&&t[8],d[0]&8192&&t[13]]))},i(c){i||(b(l,c),c&&ft(()=>{i&&(r&&r.end(1),n=Pn(e,t[3],t[4]),n.start())}),i=!0)},o(c){k(l,c),n&&n.invalidate(),c&&(r=Dn(e,t[5],t[6])),i=!1},d(c){c&&E(e),l&&l.d(c),t[30](null),c&&r&&r.end(),s=!1,Ae(o)}}}function oh(t){let e,n,r,i,s;const o=t[28].default,u=ce(o,t,t[27],Nl);let l=[t[8],t[13]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[29](e),r=!0,i||(s=[Ve(t[8].action(e)),G(e,"m-keydown",t[12])],i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&134217984)&&me(u,o,t,t[27],r?de(o,t[27],c,eh):pe(t[27]),Nl),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&8192&&t[13]]))},i(f){r||(b(u,f),f&&ft(()=>{r&&(n||(n=$n(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(f){k(u,f),f&&(n||(n=$n(e,t[1],t[2],!1)),n.run(0)),r=!1},d(f){f&&E(e),u&&u.d(f),t[29](null),f&&n&&n.end(),i=!1,Ae(s)}}}function lh(t){let e;const n=t[28].default,r=ce(n,t,t[27],Ml);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s[0]&134217984)&&me(r,n,i,i[27],e?de(n,i[27],s,th):pe(i[27]),Ml)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function uh(t){let e,n,r,i;const s=[lh,oh,sh,ih,rh,nh],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Ie()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function ah(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","id","side","align","sideOffset","alignOffset","collisionPadding","avoidCollisions","collisionBoundary","sameWidth","fitViewport","strategy","overlap","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:d=void 0}=e,{inTransitionConfig:m=void 0}=e,{outTransition:p=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:y=!1}=e,{id:g=void 0}=e,{side:h="bottom"}=e,{align:v="center"}=e,{sideOffset:O=0}=e,{alignOffset:$=0}=e,{collisionPadding:C=8}=e,{avoidCollisions:F=!0}=e,{collisionBoundary:R=void 0}=e,{sameWidth:j=!1}=e,{fitViewport:I=!1}=e,{strategy:L="absolute"}=e,{overlap:N=!1}=e,{el:A=void 0}=e;const{elements:{menu:P},states:{open:q},ids:W,getAttrs:oe}=_i();x(t,P,Z=>n(26,u=Z)),x(t,q,Z=>n(9,o=Z));const se=Ln(),z=oe("content");function le(Z){ve[Z?"unshift":"push"](()=>{A=Z,n(0,A)})}function $e(Z){ve[Z?"unshift":"push"](()=>{A=Z,n(0,A)})}function st(Z){ve[Z?"unshift":"push"](()=>{A=Z,n(0,A)})}function Me(Z){ve[Z?"unshift":"push"](()=>{A=Z,n(0,A)})}function Y(Z){ve[Z?"unshift":"push"](()=>{A=Z,n(0,A)})}return t.$$set=Z=>{e=ne(ne({},e),vt(Z)),n(13,s=Ke(e,i)),"transition"in Z&&n(1,f=Z.transition),"transitionConfig"in Z&&n(2,c=Z.transitionConfig),"inTransition"in Z&&n(3,d=Z.inTransition),"inTransitionConfig"in Z&&n(4,m=Z.inTransitionConfig),"outTransition"in Z&&n(5,p=Z.outTransition),"outTransitionConfig"in Z&&n(6,_=Z.outTransitionConfig),"asChild"in Z&&n(7,y=Z.asChild),"id"in Z&&n(14,g=Z.id),"side"in Z&&n(15,h=Z.side),"align"in Z&&n(16,v=Z.align),"sideOffset"in Z&&n(17,O=Z.sideOffset),"alignOffset"in Z&&n(18,$=Z.alignOffset),"collisionPadding"in Z&&n(19,C=Z.collisionPadding),"avoidCollisions"in Z&&n(20,F=Z.avoidCollisions),"collisionBoundary"in Z&&n(21,R=Z.collisionBoundary),"sameWidth"in Z&&n(22,j=Z.sameWidth),"fitViewport"in Z&&n(23,I=Z.fitViewport),"strategy"in Z&&n(24,L=Z.strategy),"overlap"in Z&&n(25,N=Z.overlap),"el"in Z&&n(0,A=Z.el),"$$scope"in Z&&n(27,a=Z.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&16384&&g&&W.menu.set(g),t.$$.dirty[0]&67108864&&n(8,r=u),t.$$.dirty[0]&256&&Object.assign(r,z),t.$$.dirty[0]&67076608&&o&&Om({side:h,align:v,sideOffset:O,alignOffset:$,collisionPadding:C,avoidCollisions:F,collisionBoundary:R,sameWidth:j,fitViewport:I,strategy:L,overlap:N})},[A,f,c,d,m,p,_,y,r,o,P,q,se,s,g,h,v,O,$,C,F,R,j,I,L,N,u,a,l,le,$e,st,Me,Y]}class us extends be{constructor(e){super(),ge(this,e,ah,uh,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,id:14,side:15,align:16,sideOffset:17,alignOffset:18,collisionPadding:19,avoidCollisions:20,collisionBoundary:21,sameWidth:22,fitViewport:23,strategy:24,overlap:25,el:0},null,[-1,-1])}}function as(){return{NAME:"menubar",MENU_NAME:"menu",SUB_NAME:"menu-submenu",PARTS:["arrow","checkbox-indicator","checkbox-item","content","group","item","label","radio-group","radio-item","separator","sub-content","sub-trigger","trigger"]}}function fh(t){const{NAME:e,PARTS:n,MENU_NAME:r}=as(),i=ii(e,["root"]),s=ii(r,n),o={...dm(pi(t)),getAttrs:s,getMenubarAttrs:i};return bt(e,o),{...o,updateOption:hi(o.options)}}function ch(){const{NAME:t}=as();return at(t)}function dh(t){const{MENU_NAME:e}=as(),{builders:{createMenu:n},getAttrs:r}=ch(),i={...n({...pi(t),forceVisible:!1}),getAttrs:r};return bt(e,i),{...i,updateOption:hi(i.options)}}function mh(){const{MENU_NAME:t}=as();return at(t)}const ph=t=>({builder:t&4,ids:t&8}),Hl=t=>({builder:t[2],ids:t[3]}),hh=t=>({builder:t&4,ids:t&8}),Vl=t=>({builder:t[2],ids:t[3]});function _h(t){let e,n,r,i;const s=t[13].default,o=ce(s,t,t[12],Hl);let u=[t[2],t[6]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[14](e),n=!0,r||(i=Ve(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&4108)&&me(o,s,a,a[12],n?de(s,a[12],f,ph):pe(a[12]),Hl),ie(e,l=Ne(u,[f&4&&a[2],f&64&&a[6]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[14](null),r=!1,i()}}}function gh(t){let e;const n=t[13].default,r=ce(n,t,t[12],Vl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&4108)&&me(r,n,i,i[12],e?de(n,i[12],s,hh):pe(i[12]),Vl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function bh(t){let e,n,r,i;const s=[gh,_h],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function yh(t,e,n){let r;const i=["loop","closeOnEscape","asChild","id","preventScroll","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{loop:f=!0}=e,{closeOnEscape:c=!0}=e,{asChild:d=!1}=e,{id:m=void 0}=e,{preventScroll:p=void 0}=e,{el:_=void 0}=e;const{elements:{menubar:y},updateOption:g,ids:h,getMenubarAttrs:v}=fh({loop:f,closeOnEscape:c,preventScroll:p});x(t,y,F=>n(11,o=F));const O=Ue([h.menubar],([F])=>({menubar:F}));x(t,O,F=>n(3,u=F));const $=v("root");function C(F){ve[F?"unshift":"push"](()=>{_=F,n(0,_)})}return t.$$set=F=>{e=ne(ne({},e),vt(F)),n(6,s=Ke(e,i)),"loop"in F&&n(7,f=F.loop),"closeOnEscape"in F&&n(8,c=F.closeOnEscape),"asChild"in F&&n(1,d=F.asChild),"id"in F&&n(9,m=F.id),"preventScroll"in F&&n(10,p=F.preventScroll),"el"in F&&n(0,_=F.el),"$$scope"in F&&n(12,a=F.$$scope)},t.$$.update=()=>{t.$$.dirty&512&&m&&h.menubar.set(m),t.$$.dirty&128&&g("loop",f),t.$$.dirty&256&&g("closeOnEscape",c),t.$$.dirty&1024&&g("preventScroll",p),t.$$.dirty&2048&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,$)},[_,d,r,u,y,O,s,f,c,m,p,o,a,l,C]}class vh extends be{constructor(e){super(),ge(this,e,yh,bh,fe,{loop:7,closeOnEscape:8,asChild:1,id:9,preventScroll:10,el:0})}}const kh=t=>({menuIds:t&1}),Bl=t=>({menuIds:t[0]});function Ch(t){let e;const n=t[15].default,r=ce(n,t,t[14],Bl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&16385)&&me(r,n,i,i[14],e?de(n,i[14],s,kh):pe(i[14]),Bl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Eh(t,e,n){let r,{$$slots:i={},$$scope:s}=e,{closeOnOutsideClick:o=void 0}=e,{closeOnEscape:u=void 0}=e,{portal:l=void 0}=e,{open:a=void 0}=e,{onOpenChange:f=void 0}=e,{loop:c=void 0}=e,{dir:d=void 0}=e,{typeahead:m=void 0}=e,{closeFocus:p=void 0}=e,{disableFocusFirstItem:_=void 0}=e,{closeOnItemClick:y=void 0}=e,{onOutsideClick:g=void 0}=e;const{states:{open:h},updateOption:v,ids:O}=dh({closeOnOutsideClick:o,closeOnEscape:u,portal:l,loop:c,dir:d,typeahead:m,closeFocus:p,disableFocusFirstItem:_,closeOnItemClick:y,onOutsideClick:g,onOpenChange:({next:C})=>(a!==C&&(f==null||f(C),n(2,a=C)),C)}),$=Ue([O.menu,O.trigger],([C,F])=>({menu:C,trigger:F}));return x(t,$,C=>n(0,r=C)),t.$$set=C=>{"closeOnOutsideClick"in C&&n(3,o=C.closeOnOutsideClick),"closeOnEscape"in C&&n(4,u=C.closeOnEscape),"portal"in C&&n(5,l=C.portal),"open"in C&&n(2,a=C.open),"onOpenChange"in C&&n(6,f=C.onOpenChange),"loop"in C&&n(7,c=C.loop),"dir"in C&&n(8,d=C.dir),"typeahead"in C&&n(9,m=C.typeahead),"closeFocus"in C&&n(10,p=C.closeFocus),"disableFocusFirstItem"in C&&n(11,_=C.disableFocusFirstItem),"closeOnItemClick"in C&&n(12,y=C.closeOnItemClick),"onOutsideClick"in C&&n(13,g=C.onOutsideClick),"$$scope"in C&&n(14,s=C.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&a!==void 0&&h.set(a),t.$$.dirty&8&&v("closeOnOutsideClick",o),t.$$.dirty&16&&v("closeOnEscape",u),t.$$.dirty&32&&v("portal",l),t.$$.dirty&128&&v("loop",c),t.$$.dirty&256&&v("dir",d),t.$$.dirty&1024&&v("closeFocus",p),t.$$.dirty&2048&&v("disableFocusFirstItem",_),t.$$.dirty&512&&v("typeahead",m),t.$$.dirty&4096&&v("closeOnItemClick",y),t.$$.dirty&8192&&v("onOutsideClick",g)},[r,$,a,o,u,l,f,c,d,m,p,_,y,g,s,i]}class fs extends be{constructor(e){super(),ge(this,e,Eh,Ch,fe,{closeOnOutsideClick:3,closeOnEscape:4,portal:5,open:2,onOpenChange:6,loop:7,dir:8,typeahead:9,closeFocus:10,disableFocusFirstItem:11,closeOnItemClick:12,onOutsideClick:13})}}const wh=t=>({builder:t&4}),Ul=t=>({builder:t[2]}),Oh=t=>({builder:t&4}),Kl=t=>({builder:t[2]});function Ah(t){let e,n,r,i;const s=t[9].default,o=ce(s,t,t[8],Ul);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[10](e),n=!0,r||(i=[Ve(t[2].action(e)),G(e,"m-click",t[4]),G(e,"m-keydown",t[4]),G(e,"m-pointerenter",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&260)&&me(o,s,a,a[8],n?de(s,a[8],f,wh):pe(a[8]),Ul),ie(e,l=Ne(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,Ae(i)}}}function Th(t){let e;const n=t[9].default,r=ce(n,t,t[8],Kl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&260)&&me(r,n,i,i[8],e?de(n,i[8],s,Oh):pe(i[8]),Kl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function $h(t){let e,n,r,i;const s=[Th,Ah],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function Sh(t,e,n){let r;const i=["asChild","id","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{id:f=void 0}=e,{el:c=void 0}=e;const{elements:{trigger:d},ids:m,getAttrs:p}=mh();x(t,d,h=>n(7,o=h));const _=Ln(),y=p("trigger");function g(h){ve[h?"unshift":"push"](()=>{c=h,n(0,c)})}return t.$$set=h=>{e=ne(ne({},e),vt(h)),n(5,s=Ke(e,i)),"asChild"in h&&n(1,a=h.asChild),"id"in h&&n(6,f=h.id),"el"in h&&n(0,c=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&f&&m.trigger.set(f),t.$$.dirty&128&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,y)},[c,a,r,d,_,s,f,o,l,u,g]}class cs extends be{constructor(e){super(),ge(this,e,Sh,$h,fe,{asChild:1,id:6,el:0})}}const Rh=t=>({ids:t&1}),jl=t=>({ids:t[0]});function Fh(t){let e;const n=t[13].default,r=ce(n,t,t[12],jl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&4097)&&me(r,n,i,i[12],e?de(n,i[12],s,Rh):pe(i[12]),jl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Ph(t,e,n){let r,{$$slots:i={},$$scope:s}=e,{disableFocusTrap:o=void 0}=e,{closeOnEscape:u=void 0}=e,{closeOnOutsideClick:l=void 0}=e,{preventScroll:a=void 0}=e,{portal:f=void 0}=e,{open:c=void 0}=e,{onOpenChange:d=void 0}=e,{openFocus:m=void 0}=e,{closeFocus:p=void 0}=e,{onOutsideClick:_=void 0}=e;const{updateOption:y,states:{open:g},ids:h}=Xm({disableFocusTrap:o,closeOnEscape:u,closeOnOutsideClick:l,preventScroll:a,portal:f,defaultOpen:c,openFocus:m,closeFocus:p,onOutsideClick:_,onOpenChange:({next:O})=>(c!==O&&(d==null||d(O),n(2,c=O)),O),positioning:{gutter:0,offset:{mainAxis:1}}}),v=Ue([h.content,h.trigger],([O,$])=>({content:O,trigger:$}));return x(t,v,O=>n(0,r=O)),t.$$set=O=>{"disableFocusTrap"in O&&n(3,o=O.disableFocusTrap),"closeOnEscape"in O&&n(4,u=O.closeOnEscape),"closeOnOutsideClick"in O&&n(5,l=O.closeOnOutsideClick),"preventScroll"in O&&n(6,a=O.preventScroll),"portal"in O&&n(7,f=O.portal),"open"in O&&n(2,c=O.open),"onOpenChange"in O&&n(8,d=O.onOpenChange),"openFocus"in O&&n(9,m=O.openFocus),"closeFocus"in O&&n(10,p=O.closeFocus),"onOutsideClick"in O&&n(11,_=O.onOutsideClick),"$$scope"in O&&n(12,s=O.$$scope)},t.$$.update=()=>{t.$$.dirty&4&&c!==void 0&&g.set(c),t.$$.dirty&8&&y("disableFocusTrap",o),t.$$.dirty&16&&y("closeOnEscape",u),t.$$.dirty&32&&y("closeOnOutsideClick",l),t.$$.dirty&64&&y("preventScroll",a),t.$$.dirty&128&&y("portal",f),t.$$.dirty&512&&y("openFocus",m),t.$$.dirty&1024&&y("closeFocus",p),t.$$.dirty&2048&&y("onOutsideClick",_)},[r,v,c,o,u,l,a,f,d,m,p,_,s,i]}class Dh extends be{constructor(e){super(),ge(this,e,Ph,Fh,fe,{disableFocusTrap:3,closeOnEscape:4,closeOnOutsideClick:5,preventScroll:6,portal:7,open:2,onOpenChange:8,openFocus:9,closeFocus:10,onOutsideClick:11})}}const Lh=t=>({builder:t[0]&256}),ql=t=>({builder:t[8]}),Ih=t=>({builder:t[0]&256}),Wl=t=>({builder:t[8]}),Nh=t=>({builder:t[0]&256}),Ql=t=>({builder:t[8]}),Mh=t=>({builder:t[0]&256}),zl=t=>({builder:t[8]}),Hh=t=>({builder:t[0]&256}),Gl=t=>({builder:t[8]}),Vh=t=>({builder:t[0]&256}),Yl=t=>({builder:t[8]});function Bh(t){let e,n,r,i;const s=t[27].default,o=ce(s,t,t[26],ql);let u=[t[8],t[12]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[32](e),n=!0,r||(i=Ve(t[8].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f[0]&67109120)&&me(o,s,a,a[26],n?de(s,a[26],f,Lh):pe(a[26]),ql),ie(e,l=Ne(u,[f[0]&256&&a[8],f[0]&4096&&a[12]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[32](null),r=!1,i()}}}function Uh(t){let e,n,r,i,s;const o=t[27].default,u=ce(o,t,t[26],Wl);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[31](e),r=!0,i||(s=Ve(t[8].action(e)),i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&67109120)&&me(u,o,t,t[26],r?de(o,t[26],c,Ih):pe(t[26]),Wl),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),n&&n.end(1),r=!0)},o(f){k(u,f),f&&(n=Dn(e,t[5],t[6])),r=!1},d(f){f&&E(e),u&&u.d(f),t[31](null),f&&n&&n.end(),i=!1,s()}}}function Kh(t){let e,n,r,i,s;const o=t[27].default,u=ce(o,t,t[26],Ql);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[30](e),r=!0,i||(s=Ve(t[8].action(e)),i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&67109120)&&me(u,o,t,t[26],r?de(o,t[26],c,Nh):pe(t[26]),Ql),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&(n||ft(()=>{n=Pn(e,t[3],t[4]),n.start()})),r=!0)},o(f){k(u,f),r=!1},d(f){f&&E(e),u&&u.d(f),t[30](null),i=!1,s()}}}function jh(t){let e,n,r,i,s,o;const u=t[27].default,l=ce(u,t,t[26],zl);let a=[t[8],t[12]],f={};for(let c=0;c<a.length;c+=1)f=ne(f,a[c]);return{c(){e=S("div"),l&&l.c(),ie(e,f)},m(c,d){w(c,e,d),l&&l.m(e,null),t[29](e),i=!0,s||(o=Ve(t[8].action(e)),s=!0)},p(c,d){t=c,l&&l.p&&(!i||d[0]&67109120)&&me(l,u,t,t[26],i?de(u,t[26],d,Mh):pe(t[26]),zl),ie(e,f=Ne(a,[d[0]&256&&t[8],d[0]&4096&&t[12]]))},i(c){i||(b(l,c),c&&ft(()=>{i&&(r&&r.end(1),n=Pn(e,t[3],t[4]),n.start())}),i=!0)},o(c){k(l,c),n&&n.invalidate(),c&&(r=Dn(e,t[5],t[6])),i=!1},d(c){c&&E(e),l&&l.d(c),t[29](null),c&&r&&r.end(),s=!1,o()}}}function qh(t){let e,n,r,i,s;const o=t[27].default,u=ce(o,t,t[26],Gl);let l=[t[8],t[12]],a={};for(let f=0;f<l.length;f+=1)a=ne(a,l[f]);return{c(){e=S("div"),u&&u.c(),ie(e,a)},m(f,c){w(f,e,c),u&&u.m(e,null),t[28](e),r=!0,i||(s=Ve(t[8].action(e)),i=!0)},p(f,c){t=f,u&&u.p&&(!r||c[0]&67109120)&&me(u,o,t,t[26],r?de(o,t[26],c,Hh):pe(t[26]),Gl),ie(e,a=Ne(l,[c[0]&256&&t[8],c[0]&4096&&t[12]]))},i(f){r||(b(u,f),f&&ft(()=>{r&&(n||(n=$n(e,t[1],t[2],!0)),n.run(1))}),r=!0)},o(f){k(u,f),f&&(n||(n=$n(e,t[1],t[2],!1)),n.run(0)),r=!1},d(f){f&&E(e),u&&u.d(f),t[28](null),f&&n&&n.end(),i=!1,s()}}}function Wh(t){let e;const n=t[27].default,r=ce(n,t,t[26],Yl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s[0]&67109120)&&me(r,n,i,i[26],e?de(n,i[26],s,Vh):pe(i[26]),Yl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function Qh(t){let e,n,r,i;const s=[Wh,qh,jh,Kh,Uh,Bh],o=[];function u(l,a){return l[7]&&l[9]?0:l[1]&&l[9]?1:l[3]&&l[5]&&l[9]?2:l[3]&&l[9]?3:l[5]&&l[9]?4:l[9]?5:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Ie()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?~e&&o[e].p(l,a):(n&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~e?(n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function zh(t,e,n){let r;const i=["transition","transitionConfig","inTransition","inTransitionConfig","outTransition","outTransitionConfig","asChild","id","side","align","sideOffset","alignOffset","collisionPadding","avoidCollisions","collisionBoundary","sameWidth","fitViewport","strategy","overlap","el"];let s=Ke(e,i),o,u,{$$slots:l={},$$scope:a}=e,{transition:f=void 0}=e,{transitionConfig:c=void 0}=e,{inTransition:d=void 0}=e,{inTransitionConfig:m=void 0}=e,{outTransition:p=void 0}=e,{outTransitionConfig:_=void 0}=e,{asChild:y=!1}=e,{id:g=void 0}=e,{side:h="bottom"}=e,{align:v="center"}=e,{sideOffset:O=0}=e,{alignOffset:$=0}=e,{collisionPadding:C=8}=e,{avoidCollisions:F=!0}=e,{collisionBoundary:R=void 0}=e,{sameWidth:j=!1}=e,{fitViewport:I=!1}=e,{strategy:L="absolute"}=e,{overlap:N=!1}=e,{el:A=void 0}=e;const{elements:{content:P},states:{open:q},ids:W,getAttrs:oe}=Oo();x(t,P,Y=>n(25,u=Y)),x(t,q,Y=>n(9,o=Y));const se=oe("content");function z(Y){ve[Y?"unshift":"push"](()=>{A=Y,n(0,A)})}function le(Y){ve[Y?"unshift":"push"](()=>{A=Y,n(0,A)})}function $e(Y){ve[Y?"unshift":"push"](()=>{A=Y,n(0,A)})}function st(Y){ve[Y?"unshift":"push"](()=>{A=Y,n(0,A)})}function Me(Y){ve[Y?"unshift":"push"](()=>{A=Y,n(0,A)})}return t.$$set=Y=>{e=ne(ne({},e),vt(Y)),n(12,s=Ke(e,i)),"transition"in Y&&n(1,f=Y.transition),"transitionConfig"in Y&&n(2,c=Y.transitionConfig),"inTransition"in Y&&n(3,d=Y.inTransition),"inTransitionConfig"in Y&&n(4,m=Y.inTransitionConfig),"outTransition"in Y&&n(5,p=Y.outTransition),"outTransitionConfig"in Y&&n(6,_=Y.outTransitionConfig),"asChild"in Y&&n(7,y=Y.asChild),"id"in Y&&n(13,g=Y.id),"side"in Y&&n(14,h=Y.side),"align"in Y&&n(15,v=Y.align),"sideOffset"in Y&&n(16,O=Y.sideOffset),"alignOffset"in Y&&n(17,$=Y.alignOffset),"collisionPadding"in Y&&n(18,C=Y.collisionPadding),"avoidCollisions"in Y&&n(19,F=Y.avoidCollisions),"collisionBoundary"in Y&&n(20,R=Y.collisionBoundary),"sameWidth"in Y&&n(21,j=Y.sameWidth),"fitViewport"in Y&&n(22,I=Y.fitViewport),"strategy"in Y&&n(23,L=Y.strategy),"overlap"in Y&&n(24,N=Y.overlap),"el"in Y&&n(0,A=Y.el),"$$scope"in Y&&n(26,a=Y.$$scope)},t.$$.update=()=>{t.$$.dirty[0]&8192&&g&&W.content.set(g),t.$$.dirty[0]&33554432&&n(8,r=u),t.$$.dirty[0]&256&&Object.assign(r,se),t.$$.dirty[0]&33538560&&o&&Jm({side:h,align:v,sideOffset:O,alignOffset:$,collisionPadding:C,avoidCollisions:F,collisionBoundary:R,sameWidth:j,fitViewport:I,strategy:L,overlap:N})},[A,f,c,d,m,p,_,y,r,o,P,q,s,g,h,v,O,$,C,F,R,j,I,L,N,u,a,l,z,le,$e,st,Me]}class Gh extends be{constructor(e){super(),ge(this,e,zh,Qh,fe,{transition:1,transitionConfig:2,inTransition:3,inTransitionConfig:4,outTransition:5,outTransitionConfig:6,asChild:7,id:13,side:14,align:15,sideOffset:16,alignOffset:17,collisionPadding:18,avoidCollisions:19,collisionBoundary:20,sameWidth:21,fitViewport:22,strategy:23,overlap:24,el:0},null,[-1,-1])}}const Yh=t=>({builder:t&4}),Zl=t=>({builder:t[2]}),Zh=t=>({builder:t&4}),Xl=t=>({builder:t[2]});function Xh(t){let e,n,r,i;const s=t[12].default,o=ce(s,t,t[11],Zl);let u=[t[2],{type:"button"},t[6]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[13](e),n=!0,r||(i=[Ve(t[2].action(e)),G(e,"m-click",t[5]),G(e,"m-keydown",t[5])],r=!0)},p(a,f){o&&o.p&&(!n||f&2052)&&me(o,s,a,a[11],n?de(s,a[11],f,Yh):pe(a[11]),Zl),ie(e,l=Ne(u,[f&4&&a[2],{type:"button"},f&64&&a[6]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[13](null),r=!1,Ae(i)}}}function Jh(t){let e;const n=t[12].default,r=ce(n,t,t[11],Xl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&2052)&&me(r,n,i,i[11],e?de(n,i[11],s,Zh):pe(i[11]),Xl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function xh(t){let e,n,r,i;const s=[Jh,Xh],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function e_(t,e,n){let r,i;const s=["asChild","id","el"];let o=Ke(e,s),u,l,{$$slots:a={},$$scope:f}=e,{asChild:c=!1}=e,{id:d=void 0}=e,{el:m=void 0}=e;const{elements:{trigger:p},states:{open:_},ids:y,getAttrs:g}=Oo();x(t,p,$=>n(9,u=$)),x(t,_,$=>n(10,l=$));const h=Ln(),v=g("trigger");function O($){ve[$?"unshift":"push"](()=>{m=$,n(0,m)})}return t.$$set=$=>{e=ne(ne({},e),vt($)),n(6,o=Ke(e,s)),"asChild"in $&&n(1,c=$.asChild),"id"in $&&n(7,d=$.id),"el"in $&&n(0,m=$.el),"$$scope"in $&&n(11,f=$.$$scope)},t.$$.update=()=>{t.$$.dirty&128&&d&&y.trigger.set(d),t.$$.dirty&1024&&n(8,r={...v,"aria-controls":l?y.content:void 0}),t.$$.dirty&512&&n(2,i=u),t.$$.dirty&260&&Object.assign(i,r)},[m,c,i,p,_,h,o,d,r,u,l,f,a,O]}class t_ extends be{constructor(e){super(),ge(this,e,e_,xh,fe,{asChild:1,id:7,el:0})}}function Ja(){return{NAME:"toolbar",GROUP_NAME:"toolbar-group",PARTS:["root","button","link","group","group-item"]}}function n_(t){const{NAME:e,PARTS:n}=Ja(),r=ii(e,n),i={...ym(pi(t)),getAttrs:r};return bt(e,i),{...i,updateOption:hi(i.options)}}function r_(){const{NAME:t}=Ja();return at(t)}const i_=t=>({builder:t&4}),Jl=t=>({builder:t[2]}),s_=t=>({builder:t&4}),xl=t=>({builder:t[2]});function o_(t){let e,n,r,i;const s=t[9].default,o=ce(s,t,t[8],Jl);let u=[t[2],t[4]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("div"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),t[10](e),n=!0,r||(i=Ve(t[2].action(e)),r=!0)},p(a,f){o&&o.p&&(!n||f&260)&&me(o,s,a,a[8],n?de(s,a[8],f,i_):pe(a[8]),Jl),ie(e,l=Ne(u,[f&4&&a[2],f&16&&a[4]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,i()}}}function l_(t){let e;const n=t[9].default,r=ce(n,t,t[8],xl);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&260)&&me(r,n,i,i[8],e?de(n,i[8],s,s_):pe(i[8]),xl)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function u_(t){let e,n,r,i;const s=[l_,o_],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function a_(t,e,n){let r;const i=["loop","orientation","asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{loop:a=!0}=e,{orientation:f=void 0}=e,{asChild:c=!1}=e,{el:d=void 0}=e;const{elements:{root:m},updateOption:p,getAttrs:_}=n_({loop:a,orientation:f});x(t,m,h=>n(7,o=h));const y=_("root");function g(h){ve[h?"unshift":"push"](()=>{d=h,n(0,d)})}return t.$$set=h=>{e=ne(ne({},e),vt(h)),n(4,s=Ke(e,i)),"loop"in h&&n(5,a=h.loop),"orientation"in h&&n(6,f=h.orientation),"asChild"in h&&n(1,c=h.asChild),"el"in h&&n(0,d=h.el),"$$scope"in h&&n(8,l=h.$$scope)},t.$$.update=()=>{t.$$.dirty&32&&p("loop",a),t.$$.dirty&64&&p("orientation",f),t.$$.dirty&128&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,y)},[d,c,r,m,s,a,f,o,l,u,g]}class f_ extends be{constructor(e){super(),ge(this,e,a_,u_,fe,{loop:5,orientation:6,asChild:1,el:0})}}const c_=t=>({builder:t&4}),eu=t=>({builder:t[2]}),d_=t=>({builder:t&4}),tu=t=>({builder:t[2]});function m_(t){let e,n,r,i;const s=t[8].default,o=ce(s,t,t[7],eu);let u=[t[2],{type:"button"},t[5]],l={};for(let a=0;a<u.length;a+=1)l=ne(l,u[a]);return{c(){e=S("button"),o&&o.c(),ie(e,l)},m(a,f){w(a,e,f),o&&o.m(e,null),e.autofocus&&e.focus(),t[10](e),n=!0,r||(i=[Ve(t[2].action(e)),G(e,"click",t[9]),G(e,"m-keydown",t[4])],r=!0)},p(a,f){o&&o.p&&(!n||f&132)&&me(o,s,a,a[7],n?de(s,a[7],f,c_):pe(a[7]),eu),ie(e,l=Ne(u,[f&4&&a[2],{type:"button"},f&32&&a[5]]))},i(a){n||(b(o,a),n=!0)},o(a){k(o,a),n=!1},d(a){a&&E(e),o&&o.d(a),t[10](null),r=!1,Ae(i)}}}function p_(t){let e;const n=t[8].default,r=ce(n,t,t[7],tu);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&132)&&me(r,n,i,i[7],e?de(n,i[7],s,d_):pe(i[7]),tu)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function h_(t){let e,n,r,i;const s=[p_,m_],o=[];function u(l,a){return l[1]?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function __(t,e,n){let r;const i=["asChild","el"];let s=Ke(e,i),o,{$$slots:u={},$$scope:l}=e,{asChild:a=!1}=e,{el:f=void 0}=e;const{elements:{button:c},getAttrs:d}=r_();x(t,c,g=>n(6,o=g));const m=Ln(),p=d("button");function _(g){Oe.call(this,t,g)}function y(g){ve[g?"unshift":"push"](()=>{f=g,n(0,f)})}return t.$$set=g=>{e=ne(ne({},e),vt(g)),n(5,s=Ke(e,i)),"asChild"in g&&n(1,a=g.asChild),"el"in g&&n(0,f=g.el),"$$scope"in g&&n(7,l=g.$$scope)},t.$$.update=()=>{t.$$.dirty&64&&n(2,r=o),t.$$.dirty&4&&Object.assign(r,p)},[f,a,r,c,m,s,o,l,u,_,y]}class g_ extends be{constructor(e){super(),ge(this,e,__,h_,fe,{asChild:1,el:0})}}var W2="M12 2C17.5 2 22 6.5 22 12S17.5 22 12 22 2 17.5 2 12 6.5 2 12 2M12 4C10.1 4 8.4 4.6 7.1 5.7L18.3 16.9C19.3 15.5 20 13.8 20 12C20 7.6 16.4 4 12 4M16.9 18.3L5.7 7.1C4.6 8.4 4 10.1 4 12C4 16.4 7.6 20 12 20C13.9 20 15.6 19.4 16.9 18.3Z",b_="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",y_="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",Q2="M7.41,8.58L12,13.17L16.59,8.58L18,10L12,16L6,10L7.41,8.58Z",z2="M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z",G2="M7.41,15.41L12,10.83L16.59,15.41L18,14L12,8L6,14L7.41,15.41Z",v_="M20 6.91L17.09 4L12 9.09L6.91 4L4 6.91L9.09 12L4 17.09L6.91 20L12 14.91L17.09 20L20 17.09L14.91 12L20 6.91Z",k_="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z",C_="M19,3H5C3.89,3 3,3.89 3,5V9H5V5H19V19H5V15H3V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M10.08,15.58L11.5,17L16.5,12L11.5,7L10.08,8.41L12.67,11H3V13H12.67L10.08,15.58Z",E_="M6 2C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H12V20H6V4H13V9H18V12H20V8L14 2M18 14C17.87 14 17.76 14.09 17.74 14.21L17.55 15.53C17.25 15.66 16.96 15.82 16.7 16L15.46 15.5C15.35 15.5 15.22 15.5 15.15 15.63L14.15 17.36C14.09 17.47 14.11 17.6 14.21 17.68L15.27 18.5C15.25 18.67 15.24 18.83 15.24 19C15.24 19.17 15.25 19.33 15.27 19.5L14.21 20.32C14.12 20.4 14.09 20.53 14.15 20.64L15.15 22.37C15.21 22.5 15.34 22.5 15.46 22.5L16.7 22C16.96 22.18 17.24 22.35 17.55 22.47L17.74 23.79C17.76 23.91 17.86 24 18 24H20C20.11 24 20.22 23.91 20.24 23.79L20.43 22.47C20.73 22.34 21 22.18 21.27 22L22.5 22.5C22.63 22.5 22.76 22.5 22.83 22.37L23.83 20.64C23.89 20.53 23.86 20.4 23.77 20.32L22.7 19.5C22.72 19.33 22.74 19.17 22.74 19C22.74 18.83 22.73 18.67 22.7 18.5L23.76 17.68C23.85 17.6 23.88 17.47 23.82 17.36L22.82 15.63C22.76 15.5 22.63 15.5 22.5 15.5L21.27 16C21 15.82 20.73 15.65 20.42 15.53L20.23 14.21C20.22 14.09 20.11 14 20 14M19 17.5C19.83 17.5 20.5 18.17 20.5 19C20.5 19.83 19.83 20.5 19 20.5C18.16 20.5 17.5 19.83 17.5 19C17.5 18.17 18.17 17.5 19 17.5Z",w_="M6,2A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2H6M6,4H13V9H18V20H6V4M8,12V14H16V12H8M8,16V18H13V16H8Z",O_="M23 18H20V15H18V18H15V20H18V23H20V20H23M6 2C4.89 2 4 2.9 4 4V20C4 21.11 4.89 22 6 22H13.81C13.45 21.38 13.2 20.7 13.08 20H6V4H13V9H18V13.08C18.33 13.03 18.67 13 19 13C19.34 13 19.67 13.03 20 13.08V8L14 2M8 12V14H16V12M8 16V18H13V16Z",A_="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M17,13V19H7L12,14L14,16M10,10.5A1.5,1.5 0 0,1 8.5,12A1.5,1.5 0 0,1 7,10.5A1.5,1.5 0 0,1 8.5,9A1.5,1.5 0 0,1 10,10.5Z",T_="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M18,20H6V4H13V9H18V20Z",$_="M14,2L20,8V20A2,2 0 0,1 18,22H6A2,2 0 0,1 4,20V4A2,2 0 0,1 6,2H14M18,20V9H13V4H6V20H18M12,12L16,16H13.5V19H10.5V16H8L12,12Z",S_="M4 18H12.13L11 19.13V20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V10.15C21.74 10.06 21.46 10 21.17 10C20.75 10 20.36 10.11 20 10.3V8H4V18M22.85 13.47L21.53 12.15C21.33 11.95 21 11.95 20.81 12.15L19.83 13.13L21.87 15.17L22.85 14.19C23.05 14 23.05 13.67 22.85 13.47M13 19.96V22H15.04L21.17 15.88L19.13 13.83L13 19.96Z",R_="M6.1,10L4,18V8H21A2,2 0 0,0 19,6H12L10,4H4A2,2 0 0,0 2,6V18A2,2 0 0,0 4,20H19C19.9,20 20.7,19.4 20.9,18.5L23.2,10H6.1M19,18H6L7.6,12H20.6L19,18Z",F_="M20,18H4V8H20M20,6H12L10,4H4C2.89,4 2,4.89 2,6V18A2,2 0 0,0 4,20H20A2,2 0 0,0 22,18V8C22,6.89 21.1,6 20,6Z",P_="M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.39 13.46 20.72 13.22 20 13.09V8H4V18H13.09C13.04 18.33 13 18.66 13 19M20 18V15H18V18H15V20H18V23H20V20H23V18H20Z",D_="M13 19C13 19.34 13.04 19.67 13.09 20H4C2.9 20 2 19.11 2 18V6C2 4.89 2.89 4 4 4H10L12 6H20C21.1 6 22 6.89 22 8V13.81C21.39 13.46 20.72 13.22 20 13.09V8H4V18H13.09C13.04 18.33 13 18.66 13 19M22.54 16.88L21.12 15.47L19 17.59L16.88 15.47L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88Z",L_="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z",Y2="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",I_="M13 14C9.64 14 8.54 15.35 8.18 16.24C9.25 16.7 10 17.76 10 19C10 20.66 8.66 22 7 22S4 20.66 4 19C4 17.69 4.83 16.58 6 16.17V7.83C4.83 7.42 4 6.31 4 5C4 3.34 5.34 2 7 2S10 3.34 10 5C10 6.31 9.17 7.42 8 7.83V13.12C8.88 12.47 10.16 12 12 12C14.67 12 15.56 10.66 15.85 9.77C14.77 9.32 14 8.25 14 7C14 5.34 15.34 4 17 4S20 5.34 20 7C20 8.34 19.12 9.5 17.91 9.86C17.65 11.29 16.68 14 13 14M7 18C6.45 18 6 18.45 6 19S6.45 20 7 20 8 19.55 8 19 7.55 18 7 18M7 4C6.45 4 6 4.45 6 5S6.45 6 7 6 8 5.55 8 5 7.55 4 7 4M17 6C16.45 6 16 6.45 16 7S16.45 8 17 8 18 7.55 18 7 17.55 6 17 6M17 14V17H14V19H17V22H19V19H22V17H19V14H17Z",N_="M13 14C9.64 14 8.54 15.35 8.18 16.24C9.25 16.7 10 17.76 10 19C10 20.66 8.66 22 7 22S4 20.66 4 19C4 17.69 4.83 16.58 6 16.17V7.83C4.83 7.42 4 6.31 4 5C4 3.34 5.34 2 7 2S10 3.34 10 5C10 6.31 9.17 7.42 8 7.83V13.12C8.88 12.47 10.16 12 12 12C14.67 12 15.56 10.66 15.85 9.77C14.77 9.32 14 8.25 14 7C14 5.34 15.34 4 17 4S20 5.34 20 7C20 8.34 19.12 9.5 17.91 9.86C17.65 11.29 16.68 14 13 14M7 18C6.45 18 6 18.45 6 19S6.45 20 7 20 8 19.55 8 19 7.55 18 7 18M7 4C6.45 4 6 4.45 6 5S6.45 6 7 6 8 5.55 8 5 7.55 4 7 4M17 6C16.45 6 16 6.45 16 7S16.45 8 17 8 18 7.55 18 7 17.55 6 17 6M20.12 14.46L18 16.59L15.88 14.47L14.47 15.88L16.59 18L14.47 20.12L15.88 21.54L18 19.41L20.12 21.54L21.54 20.12L19.41 18L21.54 15.88L20.12 14.46Z",rn="M12,18A6,6 0 0,1 6,12C6,11 6.25,10.03 6.7,9.2L5.24,7.74C4.46,8.97 4,10.43 4,12A8,8 0 0,0 12,20V23L16,19L12,15M12,4V1L8,5L12,9V6A6,6 0 0,1 18,12C18,13 17.75,13.97 17.3,14.8L18.76,16.26C19.54,15.03 20,13.57 20,12A8,8 0 0,0 12,4Z",M_="M6,2V8H6V8L10,12L6,16V16H6V22H18V16H18V16L14,12L18,8V8H18V2H6M16,16.5V20H8V16.5L12,12.5L16,16.5M12,11.5L8,7.5V4H16V7.5L12,11.5Z",Z2="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z",H_="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z";function V_(t){let e,n,r,i,s=t[0]!==null&&nu(t);return{c(){e=Fs("svg"),s&&s.c(),n=Fs("path"),M(n,"d",t[1]),M(e,"class",r="fill-current "+t[2]),M(e,"viewBox","0 0 24 24"),M(e,"aria-hidden",i=t[0]===null?"true":"false")},m(o,u){w(o,e,u),s&&s.m(e,null),D(e,n)},p(o,u){o[0]!==null?s?s.p(o,u):(s=nu(o),s.c(),s.m(e,n)):s&&(s.d(1),s=null),u&2&&M(n,"d",o[1]),u&4&&r!==(r="fill-current "+o[2])&&M(e,"class",r),u&1&&i!==(i=o[0]===null?"true":"false")&&M(e,"aria-hidden",i)},d(o){o&&E(e),s&&s.d()}}}function B_(t){let e,n;return{c(){e=S("span"),M(e,"class",n="block "+t[2])},m(r,i){w(r,e,i)},p(r,i){i&4&&n!==(n="block "+r[2])&&M(e,"class",n)},d(r){r&&E(e)}}}function nu(t){let e,n;return{c(){e=Fs("title"),n=X(t[0])},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&1&&Ge(n,r[0])},d(r){r&&E(e)}}}function U_(t){let e;function n(s,o){return s[1]===null?B_:V_}let r=n(t),i=r(t);return{c(){i.c(),e=Ie()},m(s,o){i.m(s,o),w(s,e,o)},p(s,[o]){r===(r=n(s))&&i?i.p(s,o):(i.d(1),i=r(s),i&&(i.c(),i.m(e.parentNode,e)))},i:_e,o:_e,d(s){s&&E(e),i.d(s)}}}function K_(t,e,n){let{label:r=null}=e,{path:i=null}=e,{class:s="w-6 h-6"}=e;return t.$$set=o=>{"label"in o&&n(0,r=o.label),"path"in o&&n(1,i=o.path),"class"in o&&n(2,s=o.class)},[r,i,s]}class Qe extends be{constructor(e){super(),ge(this,e,K_,U_,fe,{label:0,path:1,class:2})}}async function Jt({queryKey:t}){if(t){const e=["/api"];for(const r of t)r!==""&&(r[0]==="?"||r[0]==="&"||e.push("/"),e.push(r));let n=await window.fetch(e.join(""));if(n.ok)return await n.json()}throw new Error("Could not fetch data")}function xa(t){if(t.type==="text")return t.text;{let e=[];for(let n of t.content)e.push(xa(n));return e.join("")}}function X2(t){return t.content.length>0?xa(t.content[0]):"<Empty Document>"}function ef(t,e){let n=window.location.hash;n.startsWith("#")&&(n=n.substring(1));let r=new URLSearchParams(n);r.set(t,e),window.location.hash=r.toString()}function tf(t){let e=window.location.hash;e.startsWith("#")&&(e=e.substring(1));let n=new URLSearchParams(e);return n.has(t)?n.get(t):null}function j_(t){let e=window.location.hash;e.startsWith("#")&&(e=e.substring(1));let n=new URLSearchParams(e);n.has(t)&&(n.delete(t),window.location.hash=n.toString())}const ct=Re(null),q_=Re(null),ru=Re(!1);ct.subscribe(t=>{t!==null&&ef("path",t.fullpath)});function ds(){return at("apiStatus")}function Ao(){return at("currentUser")}function Rt(){return at("currentBranch")}function To(){return at("branches")}function nf(){return at("remoteBranches")}function W_(){return at("syncBranches")}function iu(t,e,n){const r=t.slice();return r[11]=e[n],r}function Q_(t){let e=t[0].length+t[1]+"",n,r;return{c(){n=X(e),r=X(" actions running")},m(i,s){w(i,n,s),w(i,r,s)},p(i,s){s&3&&e!==(e=i[0].length+i[1]+"")&&Ge(n,e)},d(i){i&&(E(n),E(r))}}}function z_(t){let e;return{c(){e=X("1 action running")},m(n,r){w(n,e,r)},p:_e,d(n){n&&E(e)}}}function G_(t){let e;return{c(){e=X("Idle")},m(n,r){w(n,e,r)},p:_e,d(n){n&&E(e)}}}function Y_(t){let e,n,r,i;return e=new Qe({props:{path:rn,class:"w-4 h-4 animate-spin"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Saving file",M(r,"class","flex-1")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function Z_(t){let e,n,r,i;return e=new Qe({props:{path:rn,class:"w-4 h-4 animate-spin"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Loading file",M(r,"class","flex-1")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function su(t){let e,n,r,i;const s=[Z_,Y_],o=[];function u(l,a){return l[11].action==="LoadTextFile"?0:l[11].action==="SaveCurrentFile"?1:-1}return~(n=u(t))&&(r=o[n]=s[n](t)),{c(){e=S("li"),r&&r.c(),M(e,"class","flex flex-row items-center space-x-2 px-3 py-1 border-l border-r last:border-b first-border-t border-slate-300")},m(l,a){w(l,e,a),~n&&o[n].m(e,null),i=!0},p(l,a){let f=n;n=u(l),n!==f&&(r&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~n?(r=o[n],r||(r=o[n]=s[n](l),r.c()),b(r,1),r.m(e,null)):r=null)},i(l){i||(b(r),i=!0)},o(l){k(r),i=!1},d(l){l&&E(e),~n&&o[n].d()}}}function ou(t){let e,n,r,i,s;return n=new Qe({props:{path:rn,class:"w-4 h-4 animate-spin"}}),{c(){e=S("li"),B(n.$$.fragment),r=U(),i=S("span"),i.textContent="Fetching branches",M(i,"class","flex-1"),M(e,"class","flex flex-row items-center space-x-2 px-3 py-1 border-l border-r last:border-b first-border-t border-slate-300")},m(o,u){w(o,e,u),H(n,e,null),D(e,r),D(e,i),s=!0},i(o){s||(b(n.$$.fragment,o),s=!0)},o(o){k(n.$$.fragment,o),s=!1},d(o){o&&E(e),V(n)}}}function lu(t){let e,n,r,i,s;return n=new Qe({props:{path:rn,class:"w-4 h-4 animate-spin"}}),{c(){e=S("li"),B(n.$$.fragment),r=U(),i=S("span"),i.textContent="Fetching remote branches",M(i,"class","flex-1"),M(e,"class","flex flex-row items-center space-x-2 px-3 py-1 border-l border-r last:border-b first-border-t border-slate-300")},m(o,u){w(o,e,u),H(n,e,null),D(e,r),D(e,i),s=!0},i(o){s||(b(n.$$.fragment,o),s=!0)},o(o){k(n.$$.fragment,o),s=!1},d(o){o&&E(e),V(n)}}}function uu(t){let e,n,r,i,s;return n=new Qe({props:{path:rn,class:"w-4 h-4 animate-spin"}}),{c(){e=S("li"),B(n.$$.fragment),r=U(),i=S("span"),i.textContent="Synchronising with remote git",M(i,"class","flex-1"),M(e,"class","flex flex-row items-center space-x-2 px-3 py-1 border-l border-r last:border-b first-border-t border-slate-300")},m(o,u){w(o,e,u),H(n,e,null),D(e,r),D(e,i),s=!0},i(o){s||(b(n.$$.fragment,o),s=!0)},o(o){k(n.$$.fragment,o),s=!1},d(o){o&&E(e),V(n)}}}function X_(t){let e,n,r,i,s,o=en(t[0]),u=[];for(let d=0;d<o.length;d+=1)u[d]=su(iu(t,o,d));const l=d=>k(u[d],1,1,()=>{u[d]=null});let a=t[2].isFetching&&ou(),f=t[3].isFetching&&lu(),c=t[4].isFetching&&uu();return{c(){e=S("ul");for(let d=0;d<u.length;d+=1)u[d].c();n=U(),a&&a.c(),r=U(),f&&f.c(),i=U(),c&&c.c()},m(d,m){w(d,e,m);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(e,null);D(e,n),a&&a.m(e,null),D(e,r),f&&f.m(e,null),D(e,i),c&&c.m(e,null),s=!0},p(d,m){if(m&1){o=en(d[0]);let p;for(p=0;p<o.length;p+=1){const _=iu(d,o,p);u[p]?(u[p].p(_,m),b(u[p],1)):(u[p]=su(_),u[p].c(),b(u[p],1),u[p].m(e,n))}for(ke(),p=o.length;p<u.length;p+=1)l(p);Ce()}d[2].isFetching?a?m&4&&b(a,1):(a=ou(),a.c(),b(a,1),a.m(e,r)):a&&(ke(),k(a,1,1,()=>{a=null}),Ce()),d[3].isFetching?f?m&8&&b(f,1):(f=lu(),f.c(),b(f,1),f.m(e,i)):f&&(ke(),k(f,1,1,()=>{f=null}),Ce()),d[4].isFetching?c?m&16&&b(c,1):(c=uu(),c.c(),b(c,1),c.m(e,null)):c&&(ke(),k(c,1,1,()=>{c=null}),Ce())},i(d){if(!s){for(let m=0;m<o.length;m+=1)b(u[m]);b(a),b(f),b(c),s=!0}},o(d){u=u.filter(Boolean);for(let m=0;m<u.length;m+=1)k(u[m]);k(a),k(f),k(c),s=!1},d(d){d&&E(e),fi(u,d),a&&a.d(),f&&f.d(),c&&c.d()}}}function J_(t){let e,n,r;function i(u,l){return u[0].length+u[1]===0?G_:u[0].length+u[1]===1?z_:Q_}let s=i(t),o=s(t);return n=new Gh({props:{class:"z-50 bg-white shadow-lg",$$slots:{default:[X_]},$$scope:{ctx:t}}}),{c(){o.c(),e=U(),B(n.$$.fragment)},m(u,l){o.m(u,l),w(u,e,l),H(n,u,l),r=!0},p(u,l){s===(s=i(u))&&o?o.p(u,l):(o.d(1),o=s(u),o&&(o.c(),o.m(e.parentNode,e)));const a={};l&16413&&(a.$$scope={dirty:l,ctx:u}),n.$set(a)},i(u){r||(b(n.$$.fragment,u),r=!0)},o(u){k(n.$$.fragment,u),r=!1},d(u){u&&E(e),o.d(u),V(n,u)}}}function x_(t){let e,n;return e=new t_({props:{$$slots:{default:[J_]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&16415&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function au(t){let e,n;return e=new si({props:{open:!0,onOpenChange:t[10],$$slots:{default:[i1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&16384&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function e1(t){let e;return{c(){e=X("Saving failed")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function t1(t){let e;return{c(){e=X("Close")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function n1(t){let e,n,r,i,s,o,u,l;return e=new St({props:{$$slots:{default:[e1]},$$scope:{ctx:t}}}),u=new Mt({props:{"data-button":!0,$$slots:{default:[t1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("div"),i=S("p"),i.textContent="Unfortunately saving the file failed.",s=U(),o=S("div"),B(u.$$.fragment),M(o,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(a,f){H(e,a,f),w(a,n,f),w(a,r,f),D(r,i),D(r,s),D(r,o),H(u,o,null),l=!0},p(a,f){const c={};f&16384&&(c.$$scope={dirty:f,ctx:a}),e.$set(c);const d={};f&16384&&(d.$$scope={dirty:f,ctx:a}),u.$set(d)},i(a){l||(b(e.$$.fragment,a),b(u.$$.fragment,a),l=!0)},o(a){k(e.$$.fragment,a),k(u.$$.fragment,a),l=!1},d(a){a&&(E(n),E(r)),V(e,a),V(u)}}}function r1(t){let e,n,r,i;return e=new yi({}),r=new bi({props:{$$slots:{default:[n1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&16384&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function i1(t){let e,n,r,i;return e=new vi({props:{class:"hidden"}}),r=new gi({props:{$$slots:{default:[r1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&16384&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function s1(t){let e,n,r,i;e=new Dh({props:{$$slots:{default:[x_]},$$scope:{ctx:t}}});let s=t[5]&&au(t);return{c(){B(e.$$.fragment),n=U(),s&&s.c(),r=Ie()},m(o,u){H(e,o,u),w(o,n,u),s&&s.m(o,u),w(o,r,u),i=!0},p(o,[u]){const l={};u&16415&&(l.$$scope={dirty:u,ctx:o}),e.$set(l),o[5]?s?(s.p(o,u),u&32&&b(s,1)):(s=au(o),s.c(),b(s,1),s.m(r.parentNode,r)):s&&(ke(),k(s,1,1,()=>{s=null}),Ce())},i(o){i||(b(e.$$.fragment,o),b(s),i=!0)},o(o){k(e.$$.fragment,o),k(s),i=!1},d(o){o&&(E(n),E(r)),V(e,o),s&&s.d(o)}}}const no=Re([]);let ro=Re(!1);function o1(t){t.status="active",no.update(n=>n.concat([t]));let e=null;t.action==="LoadTextFile"?e=l1(t):t.action==="SaveCurrentFile"&&(e=u1(t)),e!==null&&e.then(()=>{no.update(n=>{const r=n.indexOf(t);return r>=0?n.slice(0,r).concat(n.slice(r+1)):n})})}async function l1(t){const e=await window.fetch("/api/branches/"+t.branch.id+"/files/"+t.filename);t.callback(await e.text())}async function u1(t){const e=new FormData;e.append("content",new Blob([t.data])),(await window.fetch("/api/branches/"+t.branch.id+"/files/"+t.filename,{method:"PUT",body:e})).ok?t.callback():ro.set(!0)}function a1(t,e,n){let r,i,s,o,u,l;x(t,no,p=>n(0,r=p)),x(t,ro,p=>n(5,l=p));const a=To();x(t,a,p=>n(2,s=p));const f=nf();x(t,f,p=>n(3,o=p));const c=W_();x(t,c,p=>n(4,u=p));const d=Ue([a,f,c],p=>{let _=0;for(const y of p)y!==null&&y.isFetching&&(_=_+1);return _});return x(t,d,p=>n(1,i=p)),[r,i,s,o,u,l,a,f,c,d,p=>{p||ro.set(!1)}]}let f1=class extends be{constructor(e){super(),ge(this,e,a1,s1,fe,{})}};function c1(t){let e;const n=t[3].default,r=ce(n,t,t[5],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&32)&&me(r,n,i,i[5],e?de(n,i[5],s,null):pe(i[5]),null)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function d1(t){let e,n,r,i;return e=new yi({}),r=new bi({props:{$$slots:{default:[c1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&32&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function m1(t){let e,n,r,i;return e=new vi({props:{class:"hidden"}}),r=new gi({props:{$$slots:{default:[d1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&32&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function p1(t){let e,n,r;function i(o){t[4](o)}let s={onOpenChange:t[1],$$slots:{default:[m1]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new si({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&32&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function h1(t,e,n){let{$$slots:r={},$$scope:i}=e;const s=null;let{open:o=!1}=e;function u(a){a||Xe.set(Fe.NONE)}es(()=>{n(0,o=!0)});function l(a){o=a,n(0,o)}return t.$$set=a=>{"open"in a&&n(0,o=a.open),"$$scope"in a&&n(5,i=a.$$scope)},[o,u,s,r,l,i]}class sn extends be{constructor(e){super(),ge(this,e,h1,p1,fe,{onOpenChange:2,open:0})}get onOpenChange(){return this.$$.ctx[2]}}function _1(t){let e;return{c(){e=X("Create a new branch")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function fu(t){let e,n;return{c(){e=S("span"),n=X(t[2]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&4&&Ge(n,r[2])},d(r){r&&E(e)}}}function g1(t){let e,n,r,i;return e=new Mt({props:{"data-button":!0,$$slots:{default:[y1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("button"),r.textContent="Create",M(r,"type","submit"),M(r,"data-button","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function b1(t){let e,n,r,i;return n=new Qe({props:{path:rn,class:"block w-6 h-6 animate-spin"}}),{c(){e=S("span"),B(n.$$.fragment),r=S("span"),r.textContent="Creating...",M(e,"data-button",""),M(e,"class","inline-flex")},m(s,o){w(s,e,o),H(n,e,null),D(e,r),i=!0},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&E(e),V(n)}}}function y1(t){let e;return{c(){e=X("Don't create")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function v1(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_;e=new St({props:{$$slots:{default:[_1]},$$scope:{ctx:t}}});let y=t[2]&&fu(t);const g=[b1,g1],h=[];function v(O,$){return O[3].isPending?0:1}return c=v(t),d=h[c]=g[c](t),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New branch title",o=U(),u=S("input"),l=U(),y&&y.c(),a=U(),f=S("div"),d.c(),M(s,"data-form-field-label",""),M(u,"type","text"),M(u,"data-form-field-text",""),M(f,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(O,$){H(e,O,$),w(O,n,$),w(O,r,$),D(r,i),D(i,s),D(i,o),D(i,u),it(u,t[1]),D(i,l),y&&y.m(i,null),D(r,a),D(r,f),h[c].m(f,null),m=!0,p||(_=[G(u,"input",t[7]),G(r,"submit",t[6])],p=!0)},p(O,$){const C={};$&2048&&(C.$$scope={dirty:$,ctx:O}),e.$set(C),$&2&&u.value!==O[1]&&it(u,O[1]),O[2]?y?y.p(O,$):(y=fu(O),y.c(),y.m(i,null)):y&&(y.d(1),y=null);let F=c;c=v(O),c!==F&&(ke(),k(h[F],1,1,()=>{h[F]=null}),Ce(),d=h[c],d||(d=h[c]=g[c](O),d.c()),b(d,1),d.m(f,null))},i(O){m||(b(e.$$.fragment,O),b(d),m=!0)},o(O){k(e.$$.fragment,O),k(d),m=!1},d(O){O&&(E(n),E(r)),V(e,O),y&&y.d(),h[c].d(),p=!1,Ae(_)}}}function k1(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[4],$$slots:{default:[v1]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function C1(t,e,n){let r;const i=Ot(),s=Rt();let o=!1,u="",l="";function a(p){p&&n(1,u="")}const f=ns({mutationFn:async p=>{const _=await window.fetch("/api/branches",{method:"POST",body:JSON.stringify({title:p.title}),headers:{Accept:"application/json","Content-Type":"application/json"}});if(_.ok){i.invalidateQueries({queryKey:["branches"]});const y=await _.json();s.set(y),Xe.set(Fe.NONE)}else n(2,l=(await _.json()).detail[0].msg),n(2,l=l[0].toUpperCase()+l.substring(1))}});x(t,f,p=>n(3,r=p));async function c(p){p.preventDefault(),r.mutate({title:u})}function d(){u=this.value,n(1,u)}function m(p){o=p,n(0,o)}return[o,u,l,r,a,f,c,d,m]}class E1 extends be{constructor(e){super(),ge(this,e,C1,k1,fe,{})}}function w1(t){let e;return{c(){e=X("Create a new branch")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function cu(t){let e,n;return{c(){e=S("span"),n=X(t[2]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&4&&Ge(n,r[2])},d(r){r&&E(e)}}}function O1(t){let e,n,r,i;return e=new Mt({props:{"data-button":!0,$$slots:{default:[T1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("button"),r.textContent="Delete",M(r,"type","submit"),M(r,"data-button","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function A1(t){let e,n,r,i;return n=new Qe({props:{path:rn,class:"block w-6 h-6 animate-spin"}}),{c(){e=S("span"),B(n.$$.fragment),r=S("span"),r.textContent="Deleting...",M(e,"data-button",""),M(e,"class","inline-flex")},m(s,o){w(s,e,o),H(n,e,null),D(e,r),i=!0},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&E(e),V(n)}}}function T1(t){let e;return{c(){e=X("Don't delete")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function $1(t){var L;let e,n,r,i,s,o,u=((L=t[4])==null?void 0:L.title)+"",l,a,f,c,d,m,p,_,y,g,h,v,O,$,C;e=new St({props:{$$slots:{default:[w1]},$$scope:{ctx:t}}});let F=t[2]&&cu(t);const R=[A1,O1],j=[];function I(N,A){return N[3].isPending?0:1}return h=I(t),v=j[h]=R[h](t),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("p"),s=X("Please confirm you wish to delete the branch "),o=S("span"),l=X(u),a=X(`. This cannot be undone. To confirm the action, please enter the name of
13
- the branch to delete.`),f=U(),c=S("label"),d=S("span"),d.textContent="Confirm branch name",m=U(),p=S("input"),_=U(),F&&F.c(),y=U(),g=S("div"),v.c(),M(o,"class","inline-block mx-1 px-2 border border-fuchsia-700 rounded font-bold"),M(i,"class","mb-4"),M(d,"data-form-field-label",""),M(p,"type","text"),M(p,"data-form-field-text",""),M(g,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(N,A){H(e,N,A),w(N,n,A),w(N,r,A),D(r,i),D(i,s),D(i,o),D(o,l),D(i,a),D(r,f),D(r,c),D(c,d),D(c,m),D(c,p),it(p,t[1]),D(c,_),F&&F.m(c,null),D(r,y),D(r,g),j[h].m(g,null),O=!0,$||(C=[G(p,"input",t[9]),G(r,"submit",t[8])],$=!0)},p(N,A){var W;const P={};A&4096&&(P.$$scope={dirty:A,ctx:N}),e.$set(P),(!O||A&16)&&u!==(u=((W=N[4])==null?void 0:W.title)+"")&&Ge(l,u),A&2&&p.value!==N[1]&&it(p,N[1]),N[2]?F?F.p(N,A):(F=cu(N),F.c(),F.m(c,null)):F&&(F.d(1),F=null);let q=h;h=I(N),h!==q&&(ke(),k(j[q],1,1,()=>{j[q]=null}),Ce(),v=j[h],v||(v=j[h]=R[h](N),v.c()),b(v,1),v.m(g,null))},i(N){O||(b(e.$$.fragment,N),b(v),O=!0)},o(N){k(e.$$.fragment,N),k(v),O=!1},d(N){N&&(E(n),E(r)),V(e,N),F&&F.d(),j[h].d(),$=!1,Ae(C)}}}function S1(t){let e,n,r;function i(o){t[10](o)}let s={onOpenChange:t[6],$$slots:{default:[$1]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&4126&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function R1(t,e,n){let r,i;const s=Ot(),o=Rt();x(t,o,_=>n(4,i=_));let u=!1,l="",a="";function f(_){_&&n(1,l="")}const c=ns({mutationFn:async()=>{const _=await window.fetch("/api/branches/"+(i==null?void 0:i.id),{method:"DELETE",headers:{Accept:"application/json"}});_.ok?(s.invalidateQueries({queryKey:["branches"]}),o.set(null),Xe.set(Fe.NONE)):(n(2,a=(await _.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}});x(t,c,_=>n(3,r=_));function d(_){_.preventDefault(),(i==null?void 0:i.title)===l?(n(2,a=""),r.mutate()):n(2,a="Please enter the exact name of the branch to delete.")}function m(){l=this.value,n(1,l)}function p(_){u=_,n(0,u)}return[u,l,a,r,i,o,f,c,d,m,p]}class F1 extends be{constructor(e){super(),ge(this,e,R1,S1,fe,{})}}function du(t,e,n){const r=t.slice();return r[15]=e[n],r}function P1(t){let e;return{c(){e=X("Import a remote branch")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function mu(t){let e,n=t[15].title+"",r,i;return{c(){e=S("option"),r=X(n),e.__value=i=t[15].id,it(e,e.__value)},m(s,o){w(s,e,o),D(e,r)},p(s,o){o&16&&n!==(n=s[15].title+"")&&Ge(r,n),o&16&&i!==(i=s[15].id)&&(e.__value=i,it(e,e.__value))},d(s){s&&E(e)}}}function pu(t){let e,n;return{c(){e=S("span"),n=X(t[2]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&4&&Ge(n,r[2])},d(r){r&&E(e)}}}function D1(t){let e,n,r,i;return e=new Mt({props:{"data-button":!0,$$slots:{default:[I1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("button"),r.textContent="Import",M(r,"type","submit"),M(r,"data-button","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function L1(t){let e,n,r,i;return n=new Qe({props:{path:rn,class:"block w-6 h-6 animate-spin"}}),{c(){e=S("span"),B(n.$$.fragment),r=S("span"),r.textContent="Importing...",M(e,"data-button",""),M(e,"class","inline-flex")},m(s,o){w(s,e,o),H(n,e,null),D(e,r),i=!0},i(s){i||(b(n.$$.fragment,s),i=!0)},o(s){k(n.$$.fragment,s),i=!1},d(s){s&&E(e),V(n)}}}function I1(t){let e;return{c(){e=X("Don't import")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function N1(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_;e=new St({props:{$$slots:{default:[P1]},$$scope:{ctx:t}}});let y=en(t[4]),g=[];for(let C=0;C<y.length;C+=1)g[C]=mu(du(t,y,C));let h=t[2]&&pu(t);const v=[L1,D1],O=[];function $(C,F){return C[3].isPending?0:1}return c=$(t),d=O[c]=v[c](t),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New branch title",o=U(),u=S("select");for(let C=0;C<g.length;C+=1)g[C].c();l=U(),h&&h.c(),a=U(),f=S("div"),d.c(),M(s,"data-form-field-label",""),M(u,"data-form-field-text",""),t[1]===void 0&&ft(()=>t[9].call(u)),M(f,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(C,F){H(e,C,F),w(C,n,F),w(C,r,F),D(r,i),D(i,s),D(i,o),D(i,u);for(let R=0;R<g.length;R+=1)g[R]&&g[R].m(u,null);Lo(u,t[1],!0),D(i,l),h&&h.m(i,null),D(r,a),D(r,f),O[c].m(f,null),m=!0,p||(_=[G(u,"change",t[9]),G(r,"submit",t[8])],p=!0)},p(C,F){const R={};if(F&262144&&(R.$$scope={dirty:F,ctx:C}),e.$set(R),F&16){y=en(C[4]);let I;for(I=0;I<y.length;I+=1){const L=du(C,y,I);g[I]?g[I].p(L,F):(g[I]=mu(L),g[I].c(),g[I].m(u,null))}for(;I<g.length;I+=1)g[I].d(1);g.length=y.length}F&18&&Lo(u,C[1]),C[2]?h?h.p(C,F):(h=pu(C),h.c(),h.m(i,null)):h&&(h.d(1),h=null);let j=c;c=$(C),c!==j&&(ke(),k(O[j],1,1,()=>{O[j]=null}),Ce(),d=O[c],d||(d=O[c]=v[c](C),d.c()),b(d,1),d.m(f,null))},i(C){m||(b(e.$$.fragment,C),b(d),m=!0)},o(C){k(e.$$.fragment,C),k(d),m=!1},d(C){C&&(E(n),E(r)),V(e,C),fi(g,C),h&&h.d(),O[c].d(),p=!1,Ae(_)}}}function M1(t){let e,n,r;function i(o){t[10](o)}let s={onOpenChange:t[5],$$slots:{default:[N1]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&262174&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function H1(t,e,n){let r,i;const s=Ot(),o=Rt(),u=To(),l=nf();let a=!1,f="",c="";function d(h){h&&n(1,f="")}const m=Ue([u,l],([h,v])=>h.isSuccess&&v.isSuccess?v.data.filter(O=>{let $=!1;for(const C of h.data)if(O.id.endsWith("/"+C.id)){$=!0;break}return!$}).map(O=>({id:O.id.substring(O.id.indexOf("/")+1),title:O.title,nogit:!1})):[]);x(t,m,h=>n(4,i=h));const p=ns({mutationFn:async h=>{const v=await window.fetch("/api/branches",{method:"POST",body:JSON.stringify({title:h.title}),headers:{Accept:"application/json","Content-Type":"application/json","X-UEditor-Import-Branch":"true"}});if(v.ok){s.invalidateQueries({queryKey:["branches"]});const O=await v.json();o.set(O),Xe.set(Fe.NONE)}else n(2,c=(await v.json()).detail[0].msg),n(2,c=c[0].toUpperCase()+c.substring(1))}});x(t,p,h=>n(3,r=h));async function _(h){h.preventDefault(),r.mutate({title:f})}function y(){f=kf(this),n(1,f)}function g(h){a=h,n(0,a)}return[a,f,c,r,i,d,m,p,_,y,g]}class V1 extends be{constructor(e){super(),ge(this,e,H1,M1,fe,{})}}function B1(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=X('Create a new Folder in "'),r=X(n),i=X('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&Ge(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function hu(t){let e,n;return{c(){e=S("span"),n=X(t[2]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&4&&Ge(n,r[2])},d(r){r&&E(e)}}}function U1(t){let e;return{c(){e=X("Don't create")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function K1(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_,y;e=new St({props:{$$slots:{default:[B1]},$$scope:{ctx:t}}});let g=t[2]&&hu(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[U1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Folder Name",o=U(),u=S("input"),l=U(),g&&g.c(),a=U(),f=S("div"),B(c.$$.fragment),d=U(),m=S("button"),m.textContent="Create",M(s,"data-form-field-label",""),M(u,"type","text"),M(u,"data-form-field-text",""),M(m,"type","submit"),M(m,"data-button",""),M(f,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(h,v){H(e,h,v),w(h,n,v),w(h,r,v),D(r,i),D(i,s),D(i,o),D(i,u),it(u,t[1]),D(i,l),g&&g.m(i,null),D(r,a),D(r,f),H(c,f,null),D(f,d),D(f,m),p=!0,_||(y=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,v){const O={};v&2056&&(O.$$scope={dirty:v,ctx:h}),e.$set(O),v&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,v):(g=hu(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};v&2048&&($.$$scope={dirty:v,ctx:h}),c.$set($)},i(h){p||(b(e.$$.fragment,h),b(c.$$.fragment,h),p=!0)},o(h){k(e.$$.fragment,h),k(c.$$.fragment,h),p=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Ae(y)}}}function j1(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[K1]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function q1(t,e,n){let r,i;x(t,ct,p=>n(3,i=p));const s=Ot(),o=Rt();x(t,o,p=>n(9,r=p));let u=!1,l="",a="";async function f(p){if(p.preventDefault(),l.trim()==="")n(2,a="Please enter a folder name");else{const _=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+l.trim(),{method:"POST",headers:{"X-uEditor-New-Type":"folder"}});_.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),Xe.set(Fe.NONE)):(n(2,a=(await _.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}}function c(p){p?(n(1,l=""),n(2,a="")):Xe.set(Fe.NONE)}function d(){l=this.value,n(1,l)}function m(p){u=p,n(0,u)}return[u,l,a,i,o,f,c,d,m]}let W1=class extends be{constructor(e){super(),ge(this,e,q1,j1,fe,{})}};function Q1(t){var s;let e,n,r=((s=t[3])==null?void 0:s.fullpath)+"",i;return{c(){e=X("Delete "),n=S("span"),i=X(r),M(n,"class","font-bold")},m(o,u){w(o,e,u),w(o,n,u),D(n,i)},p(o,u){var l;u&8&&r!==(r=((l=o[3])==null?void 0:l.fullpath)+"")&&Ge(i,r)},d(o){o&&(E(e),E(n))}}}function _u(t){let e,n;return{c(){e=S("span"),n=X(t[1]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&2&&Ge(n,r[1])},d(r){r&&E(e)}}}function z1(t){let e;return{c(){e=X("Don't delete")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function G1(t){var j;let e,n,r,i,s,o,u=((j=t[3])==null?void 0:j.fullpath)+"",l,a,f,c,d,m,p,_,y,g,h,v,O,$,C,F;e=new St({props:{class:"bg-rose-700",$$slots:{default:[Q1]},$$scope:{ctx:t}}});let R=t[1]&&_u(t);return h=new Mt({props:{"data-button":!0,$$slots:{default:[z1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("p"),s=X("Please confirm you wish to delete the folder "),o=S("span"),l=X(u),a=X(`
14
- and all the files and folders within that. To confirm the action, please enter
15
- the name of the folder to delete.`),f=U(),c=S("label"),d=S("span"),d.textContent="Confirmation Folder Name",m=U(),p=S("input"),_=U(),R&&R.c(),y=U(),g=S("div"),B(h.$$.fragment),v=U(),O=S("button"),O.textContent="Delete",M(o,"class","inline-block mx-1 px-2 border border-fuchsia-700 rounded font-bold"),M(i,"class","mb-4"),M(d,"data-form-field-label",""),M(p,"type","text"),M(p,"data-form-field-text",""),M(c,"class","block"),M(O,"type","submit"),M(O,"data-button",""),M(O,"class","border-rose-700 hover:bg-rose-700 focus:bg-rose-700"),M(g,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(I,L){H(e,I,L),w(I,n,L),w(I,r,L),D(r,i),D(i,s),D(i,o),D(o,l),D(i,a),D(r,f),D(r,c),D(c,d),D(c,m),D(c,p),it(p,t[2]),D(c,_),R&&R.m(c,null),D(r,y),D(r,g),H(h,g,null),D(g,v),D(g,O),$=!0,C||(F=[G(p,"input",t[7]),G(r,"submit",t[5])],C=!0)},p(I,L){var P;const N={};L&2056&&(N.$$scope={dirty:L,ctx:I}),e.$set(N),(!$||L&8)&&u!==(u=((P=I[3])==null?void 0:P.fullpath)+"")&&Ge(l,u),L&4&&p.value!==I[2]&&it(p,I[2]),I[1]?R?R.p(I,L):(R=_u(I),R.c(),R.m(c,null)):R&&(R.d(1),R=null);const A={};L&2048&&(A.$$scope={dirty:L,ctx:I}),h.$set(A)},i(I){$||(b(e.$$.fragment,I),b(h.$$.fragment,I),$=!0)},o(I){k(e.$$.fragment,I),k(h.$$.fragment,I),$=!1},d(I){I&&(E(n),E(r)),V(e,I),R&&R.d(),V(h),C=!1,Ae(F)}}}function Y1(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[G1]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function Z1(t,e,n){let r,i;x(t,ct,p=>n(3,i=p));const s=Ot(),o=Rt();x(t,o,p=>n(9,r=p));let u=!1,l="",a="";async function f(p){p.preventDefault(),n(1,l=""),a===(i==null?void 0:i.fullpath)||a==(i==null?void 0:i.name)?(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+i.fullpath,{method:"DELETE"})).ok&&(s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ct.set(null),n(0,u=!1),Xe.set(Fe.NONE)):n(1,l="Please check that you have typed in the correct name.")}function c(p){p?(n(2,a=""),n(1,l="")):Xe.set(Fe.NONE)}function d(){a=this.value,n(2,a)}function m(p){u=p,n(0,u)}return[u,l,a,i,o,f,c,d,m]}let rf=class extends be{constructor(e){super(),ge(this,e,Z1,Y1,fe,{})}};function X1(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=X('Rename "'),r=X(n),i=X('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&Ge(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function gu(t){let e,n;return{c(){e=S("span"),n=X(t[2]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&4&&Ge(n,r[2])},d(r){r&&E(e)}}}function J1(t){let e;return{c(){e=X("Don't rename")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function x1(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_,y;e=new St({props:{$$slots:{default:[X1]},$$scope:{ctx:t}}});let g=t[2]&&gu(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[J1]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Folder Name",o=U(),u=S("input"),l=U(),g&&g.c(),a=U(),f=S("div"),B(c.$$.fragment),d=U(),m=S("button"),m.textContent="Rename",M(s,"data-form-field-label",""),M(u,"type","text"),M(u,"data-form-field-text",""),M(m,"type","submit"),M(m,"data-button",""),M(f,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(h,v){H(e,h,v),w(h,n,v),w(h,r,v),D(r,i),D(i,s),D(i,o),D(i,u),it(u,t[1]),D(i,l),g&&g.m(i,null),D(r,a),D(r,f),H(c,f,null),D(f,d),D(f,m),p=!0,_||(y=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,v){const O={};v&2056&&(O.$$scope={dirty:v,ctx:h}),e.$set(O),v&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,v):(g=gu(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};v&2048&&($.$$scope={dirty:v,ctx:h}),c.$set($)},i(h){p||(b(e.$$.fragment,h),b(c.$$.fragment,h),p=!0)},o(h){k(e.$$.fragment,h),k(c.$$.fragment,h),p=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Ae(y)}}}function eg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[x1]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function tg(t,e,n){let r,i;x(t,ct,p=>n(3,i=p));const s=Ot(),o=Rt();x(t,o,p=>n(9,r=p));let u=!1,l="",a="";async function f(p){if(p.preventDefault(),l.trim()==="")n(2,a="Please enter a folder name");else if(i!=null&&i.fullpath){const _=i.fullpath.split("/").slice(0,i.fullpath.split("/").length-1).join("/"),y=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+_+"/"+l.trim(),{method:"POST",headers:{"X-uEditor-New-Type":"folder","X-uEditor-Rename-From":i==null?void 0:i.fullpath}});y.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ct.set(null),Xe.set(Fe.NONE)):(n(2,a=(await y.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}else n(2,a="Cannot rename the root folder")}function c(p){p?(n(1,l=""),n(2,a="")):Xe.set(Fe.NONE)}function d(){l=this.value,n(1,l)}function m(p){u=p,n(0,u)}return[u,l,a,i,o,f,c,d,m]}let ng=class extends be{constructor(e){super(),ge(this,e,tg,eg,fe,{})}};function rg(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=X('Create a new File in "'),r=X(n),i=X('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&Ge(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function bu(t){let e,n;return{c(){e=S("span"),n=X(t[2]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&4&&Ge(n,r[2])},d(r){r&&E(e)}}}function ig(t){let e;return{c(){e=X("Don't create")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function sg(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_,y;e=new St({props:{$$slots:{default:[rg]},$$scope:{ctx:t}}});let g=t[2]&&bu(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[ig]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Filename",o=U(),u=S("input"),l=U(),g&&g.c(),a=U(),f=S("div"),B(c.$$.fragment),d=U(),m=S("button"),m.textContent="Create",M(s,"data-form-field-label",""),M(u,"type","text"),M(u,"data-form-field-text",""),M(m,"type","submit"),M(m,"data-button",""),M(f,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(h,v){H(e,h,v),w(h,n,v),w(h,r,v),D(r,i),D(i,s),D(i,o),D(i,u),it(u,t[1]),D(i,l),g&&g.m(i,null),D(r,a),D(r,f),H(c,f,null),D(f,d),D(f,m),p=!0,_||(y=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,v){const O={};v&2056&&(O.$$scope={dirty:v,ctx:h}),e.$set(O),v&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,v):(g=bu(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};v&2048&&($.$$scope={dirty:v,ctx:h}),c.$set($)},i(h){p||(b(e.$$.fragment,h),b(c.$$.fragment,h),p=!0)},o(h){k(e.$$.fragment,h),k(c.$$.fragment,h),p=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Ae(y)}}}function og(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[sg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function lg(t,e,n){let r,i;x(t,ct,p=>n(3,i=p));const s=Ot(),o=Rt();x(t,o,p=>n(9,r=p));let u=!1,l="",a="";async function f(p){if(p.preventDefault(),l.trim()==="")n(2,a="Please enter a filename");else{const _=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+l,{method:"POST",headers:{"X-uEditor-New-Type":"file"}});_.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),Xe.set(Fe.NONE)):(n(2,a=(await _.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}}function c(p){p?(n(1,l=""),n(2,a="")):Xe.set(Fe.NONE)}function d(){l=this.value,n(1,l)}function m(p){u=p,n(0,u)}return[u,l,a,i,o,f,c,d,m]}class ug extends be{constructor(e){super(),ge(this,e,lg,og,fe,{})}}function ag(t){var s;let e,n,r=((s=t[3])==null?void 0:s.fullpath)+"",i;return{c(){e=X("Delete "),n=S("span"),i=X(r),M(n,"class","font-bold")},m(o,u){w(o,e,u),w(o,n,u),D(n,i)},p(o,u){var l;u&8&&r!==(r=((l=o[3])==null?void 0:l.fullpath)+"")&&Ge(i,r)},d(o){o&&(E(e),E(n))}}}function yu(t){let e,n;return{c(){e=S("span"),n=X(t[1]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&2&&Ge(n,r[1])},d(r){r&&E(e)}}}function fg(t){let e;return{c(){e=X("Don't delete")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function cg(t){var j;let e,n,r,i,s,o,u=((j=t[3])==null?void 0:j.fullpath)+"",l,a,f,c,d,m,p,_,y,g,h,v,O,$,C,F;e=new St({props:{class:"bg-rose-700",$$slots:{default:[ag]},$$scope:{ctx:t}}});let R=t[1]&&yu(t);return h=new Mt({props:{"data-button":!0,$$slots:{default:[fg]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("p"),s=X("Please confirm you wish to delete the file "),o=S("span"),l=X(u),a=X(". To confirm the action, please enter the name of the file to delete."),f=U(),c=S("label"),d=S("span"),d.textContent="Confirm filename",m=U(),p=S("input"),_=U(),R&&R.c(),y=U(),g=S("div"),B(h.$$.fragment),v=U(),O=S("button"),O.textContent="Delete",M(o,"class","inline-block mx-1 px-2 border border-fuchsia-700 rounded font-bold"),M(i,"class","mb-4"),M(d,"data-form-field-label",""),M(p,"type","text"),M(p,"data-form-field-text",""),M(c,"class","block"),M(O,"type","submit"),M(O,"data-button",""),M(O,"class","border-rose-700 hover:bg-rose-700 focus:bg-rose-700"),M(g,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(I,L){H(e,I,L),w(I,n,L),w(I,r,L),D(r,i),D(i,s),D(i,o),D(o,l),D(i,a),D(r,f),D(r,c),D(c,d),D(c,m),D(c,p),it(p,t[2]),D(c,_),R&&R.m(c,null),D(r,y),D(r,g),H(h,g,null),D(g,v),D(g,O),$=!0,C||(F=[G(p,"input",t[7]),G(r,"submit",t[5])],C=!0)},p(I,L){var P;const N={};L&2056&&(N.$$scope={dirty:L,ctx:I}),e.$set(N),(!$||L&8)&&u!==(u=((P=I[3])==null?void 0:P.fullpath)+"")&&Ge(l,u),L&4&&p.value!==I[2]&&it(p,I[2]),I[1]?R?R.p(I,L):(R=yu(I),R.c(),R.m(c,null)):R&&(R.d(1),R=null);const A={};L&2048&&(A.$$scope={dirty:L,ctx:I}),h.$set(A)},i(I){$||(b(e.$$.fragment,I),b(h.$$.fragment,I),$=!0)},o(I){k(e.$$.fragment,I),k(h.$$.fragment,I),$=!1},d(I){I&&(E(n),E(r)),V(e,I),R&&R.d(),V(h),C=!1,Ae(F)}}}function dg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[cg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function mg(t,e,n){let r,i;x(t,ct,p=>n(3,i=p));const s=Ot(),o=Rt();x(t,o,p=>n(9,r=p));let u=!1,l="",a="";async function f(p){p.preventDefault(),n(1,l=""),a===(i==null?void 0:i.fullpath)||a==(i==null?void 0:i.name)?(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+i.fullpath,{method:"DELETE"})).ok&&(s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ct.set(null),n(0,u=!1),Xe.set(Fe.NONE)):n(1,l="Please check that you have typed in the correct name.")}function c(p){p?(n(2,a=""),n(1,l="")):Xe.set(Fe.NONE)}function d(){a=this.value,n(2,a)}function m(p){u=p,n(0,u)}return[u,l,a,i,o,f,c,d,m]}class pg extends be{constructor(e){super(),ge(this,e,mg,dg,fe,{})}}function hg(t){var s,o;let e,n=((s=t[3])!=null&&s.fullpath?(o=t[3])==null?void 0:o.fullpath:"/")+"",r,i;return{c(){e=X('Rename "'),r=X(n),i=X('"')},m(u,l){w(u,e,l),w(u,r,l),w(u,i,l)},p(u,l){var a,f;l&8&&n!==(n=((a=u[3])!=null&&a.fullpath?(f=u[3])==null?void 0:f.fullpath:"/")+"")&&Ge(r,n)},d(u){u&&(E(e),E(r),E(i))}}}function vu(t){let e,n;return{c(){e=S("span"),n=X(t[2]),M(e,"data-form-field-error","")},m(r,i){w(r,e,i),D(e,n)},p(r,i){i&4&&Ge(n,r[2])},d(r){r&&E(e)}}}function _g(t){let e;return{c(){e=X("Don't rename")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function gg(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_,y;e=new St({props:{$$slots:{default:[hg]},$$scope:{ctx:t}}});let g=t[2]&&vu(t);return c=new Mt({props:{"data-button":!0,$$slots:{default:[_g]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("form"),i=S("label"),s=S("span"),s.textContent="New Filename",o=U(),u=S("input"),l=U(),g&&g.c(),a=U(),f=S("div"),B(c.$$.fragment),d=U(),m=S("button"),m.textContent="Rename",M(s,"data-form-field-label",""),M(u,"type","text"),M(u,"data-form-field-text",""),M(m,"type","submit"),M(m,"data-button",""),M(f,"data-dialog-buttons",""),M(r,"data-dialog-content-area","")},m(h,v){H(e,h,v),w(h,n,v),w(h,r,v),D(r,i),D(i,s),D(i,o),D(i,u),it(u,t[1]),D(i,l),g&&g.m(i,null),D(r,a),D(r,f),H(c,f,null),D(f,d),D(f,m),p=!0,_||(y=[G(u,"input",t[7]),G(r,"submit",t[5])],_=!0)},p(h,v){const O={};v&2056&&(O.$$scope={dirty:v,ctx:h}),e.$set(O),v&2&&u.value!==h[1]&&it(u,h[1]),h[2]?g?g.p(h,v):(g=vu(h),g.c(),g.m(i,null)):g&&(g.d(1),g=null);const $={};v&2048&&($.$$scope={dirty:v,ctx:h}),c.$set($)},i(h){p||(b(e.$$.fragment,h),b(c.$$.fragment,h),p=!0)},o(h){k(e.$$.fragment,h),k(c.$$.fragment,h),p=!1},d(h){h&&(E(n),E(r)),V(e,h),g&&g.d(),V(c),_=!1,Ae(y)}}}function bg(t){let e,n,r;function i(o){t[8](o)}let s={onOpenChange:t[6],$$slots:{default:[gg]},$$scope:{ctx:t}};return t[0]!==void 0&&(s.open=t[0]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&2062&&(l.$$scope={dirty:u,ctx:o}),!n&&u&1&&(n=!0,l.open=o[0],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function yg(t,e,n){let r,i;x(t,ct,p=>n(3,i=p));const s=Ot(),o=Rt();x(t,o,p=>n(9,r=p));let u=!1,l="",a="";async function f(p){if(p.preventDefault(),l.trim()==="")n(2,a="Please enter a folder name");else if(i!=null&&i.fullpath){const _=i.fullpath.split("/").slice(0,i.fullpath.split("/").length-1).join("/"),y=await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+_+"/"+l.trim(),{method:"POST",headers:{"X-uEditor-New-Type":"file","X-uEditor-Rename-From":i==null?void 0:i.fullpath}});y.ok?(n(0,u=!1),s.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),ct.set(null),Xe.set(Fe.NONE)):(n(2,a=(await y.json()).detail[0].msg),n(2,a=a[0].toUpperCase()+a.substring(1)))}else n(2,a="Cannot rename the root folder")}function c(p){p?(n(1,l=""),n(2,a="")):Xe.set(Fe.NONE)}function d(){l=this.value,n(1,l)}function m(p){u=p,n(0,u)}return[u,l,a,i,o,f,c,d,m]}class vg extends be{constructor(e){super(),ge(this,e,yg,bg,fe,{})}}function ku(t,e,n){const r=t.slice();return r[21]=e[n][0],r[22]=e[n][1],r}function kg(t){let e;return{c(){e=X("Upload")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Cg(t){let e;return{c(){e=X("Uploading")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Eg(t){var l,a;let e,n=((l=t[6])!=null&&l.fullpath?(a=t[6])==null?void 0:a.fullpath:"/")+"",r,i;function s(f,c){return f[4].length>0?Cg:kg}let o=s(t),u=o(t);return{c(){u.c(),e=X(' Files to "'),r=X(n),i=X('"')},m(f,c){u.m(f,c),w(f,e,c),w(f,r,c),w(f,i,c)},p(f,c){var d,m;o!==(o=s(f))&&(u.d(1),u=o(f),u&&(u.c(),u.m(e.parentNode,e))),c&64&&n!==(n=((d=f[6])!=null&&d.fullpath?(m=f[6])==null?void 0:m.fullpath:"/")+"")&&Ge(r,n)},d(f){f&&(E(e),E(r),E(i)),u.d(f)}}}function wg(t){let e,n,r,i,s,o,u=en(t[4]),l=[];for(let f=0;f<u.length;f+=1)l[f]=Cu(ku(t,u,f));const a=f=>k(l[f],1,1,()=>{l[f]=null});return s=new Mt({props:{"data-button":!0,$$slots:{default:[Pg]},$$scope:{ctx:t}}}),{c(){e=S("div"),n=S("ul");for(let f=0;f<l.length;f+=1)l[f].c();r=U(),i=S("div"),B(s.$$.fragment),M(i,"data-dialog-buttons",""),M(e,"data-dialog-content-area","")},m(f,c){w(f,e,c),D(e,n);for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(n,null);D(e,r),D(e,i),H(s,i,null),o=!0},p(f,c){if(c&144){u=en(f[4]);let m;for(m=0;m<u.length;m+=1){const p=ku(f,u,m);l[m]?(l[m].p(p,c),b(l[m],1)):(l[m]=Cu(p),l[m].c(),b(l[m],1),l[m].m(n,null))}for(ke(),m=u.length;m<l.length;m+=1)a(m);Ce()}const d={};c&33554464&&(d.$$scope={dirty:c,ctx:f}),s.$set(d)},i(f){if(!o){for(let c=0;c<u.length;c+=1)b(l[c]);b(s.$$.fragment,f),o=!0}},o(f){l=l.filter(Boolean);for(let c=0;c<l.length;c+=1)k(l[c]);k(s.$$.fragment,f),o=!1},d(f){f&&E(e),fi(l,f),V(s)}}}function Og(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p;return a=new Mt({props:{"data-button":!0,$$slots:{default:[Dg]},$$scope:{ctx:t}}}),{c(){e=S("form"),n=S("label"),r=S("span"),r.textContent="Drop a file to upload or click to select a file to upload.",i=U(),s=S("input"),u=U(),l=S("div"),B(a.$$.fragment),f=U(),c=S("button"),c.textContent="Upload",M(s,"type","file"),M(s,"class","sr-only"),M(n,"class",o="flex justify-center items-center h-20 border-fuchsia-700 border-2 "+(t[2]?"border-solid":"border-dashed")+" rounded"),M(c,"type","submit"),M(c,"data-button",""),M(c,"class","sr-only"),M(l,"data-dialog-buttons",""),M(e,"data-dialog-content-area","")},m(_,y){w(_,e,y),D(e,n),D(n,r),D(n,i),D(n,s),t[12](s),D(e,u),D(e,l),H(a,l,null),D(l,f),D(l,c),t[16](c),d=!0,m||(p=[G(s,"change",t[13]),G(n,"drop",t[11]),G(n,"dragover",t[14]),G(n,"dragleave",t[15]),G(e,"submit",t[10])],m=!0)},p(_,y){(!d||y&4&&o!==(o="flex justify-center items-center h-20 border-fuchsia-700 border-2 "+(_[2]?"border-solid":"border-dashed")+" rounded"))&&M(n,"class",o);const g={};y&33554432&&(g.$$scope={dirty:y,ctx:_}),a.$set(g)},i(_){d||(b(a.$$.fragment,_),d=!0)},o(_){k(a.$$.fragment,_),d=!1},d(_){_&&E(e),t[12](null),V(a),t[16](null),m=!1,Ae(p)}}}function Ag(t){let e,n,r,i;return r=new Qe({props:{path:v_,class:"w-6 h-6 text-rose-700"}}),{c(){e=S("span"),e.textContent="failed to upload",n=U(),B(r.$$.fragment),M(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){k(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function Tg(t){let e,n,r,i;return r=new Qe({props:{path:b_,class:"w-6 h-6 text-lime-500"}}),{c(){e=S("span"),e.textContent="successfully uploaded",n=U(),B(r.$$.fragment),M(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){k(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function $g(t){let e,n,r,i;return r=new Qe({props:{path:rn,class:"w-6 h-6 animate-spin text-fuchsia-700"}}),{c(){e=S("span"),e.textContent="uploading",n=U(),B(r.$$.fragment),M(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){k(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function Sg(t){let e,n,r,i;return r=new Qe({props:{path:M_}}),{c(){e=S("span"),e.textContent="waiting to upload",n=U(),B(r.$$.fragment),M(e,"class","sr-only")},m(s,o){w(s,e,o),w(s,n,o),H(r,s,o),i=!0},i(s){i||(b(r.$$.fragment,s),i=!0)},o(s){k(r.$$.fragment,s),i=!1},d(s){s&&(E(e),E(n)),V(r,s)}}}function Cu(t){let e,n,r=t[21].name+"",i,s,o,u,l,a;const f=[Sg,$g,Tg,Ag],c=[];function d(m,p){return m[22]===m[7].READY?0:m[22]==m[7].ACTIVE?1:m[22]===m[7].SUCCESS?2:m[22]===m[7].FAILED?3:-1}return~(o=d(t))&&(u=c[o]=f[o](t)),{c(){e=S("li"),n=S("span"),i=X(r),s=U(),u&&u.c(),l=U(),M(n,"class","flex-1"),M(e,"class","flex flex-row space-x-4")},m(m,p){w(m,e,p),D(e,n),D(n,i),D(e,s),~o&&c[o].m(e,null),D(e,l),a=!0},p(m,p){(!a||p&16)&&r!==(r=m[21].name+"")&&Ge(i,r);let _=o;o=d(m),o!==_&&(u&&(ke(),k(c[_],1,1,()=>{c[_]=null}),Ce()),~o?(u=c[o],u||(u=c[o]=f[o](m),u.c()),b(u,1),u.m(e,l)):u=null)},i(m){a||(b(u),a=!0)},o(m){k(u),a=!1},d(m){m&&E(e),~o&&c[o].d()}}}function Rg(t){let e;return{c(){e=X("Cancel upload")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Fg(t){let e;return{c(){e=X("Close")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Pg(t){let e;function n(s,o){return s[5]?Fg:Rg}let r=n(t),i=r(t);return{c(){i.c(),e=Ie()},m(s,o){i.m(s,o),w(s,e,o)},p(s,o){r!==(r=n(s))&&(i.d(1),i=r(s),i&&(i.c(),i.m(e.parentNode,e)))},d(s){s&&E(e),i.d(s)}}}function Dg(t){let e;return{c(){e=X("Don't upload")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Lg(t){let e,n,r,i,s,o;e=new St({props:{$$slots:{default:[Eg]},$$scope:{ctx:t}}});const u=[Og,wg],l=[];function a(f,c){return f[4].length===0?0:1}return r=a(t),i=l[r]=u[r](t),{c(){B(e.$$.fragment),n=U(),i.c(),s=Ie()},m(f,c){H(e,f,c),w(f,n,c),l[r].m(f,c),w(f,s,c),o=!0},p(f,c){const d={};c&33554512&&(d.$$scope={dirty:c,ctx:f}),e.$set(d);let m=r;r=a(f),r===m?l[r].p(f,c):(ke(),k(l[m],1,1,()=>{l[m]=null}),Ce(),i=l[r],i?i.p(f,c):(i=l[r]=u[r](f),i.c()),b(i,1),i.m(s.parentNode,s))},i(f){o||(b(e.$$.fragment,f),b(i),o=!0)},o(f){k(e.$$.fragment,f),k(i),o=!1},d(f){f&&(E(n),E(s)),V(e,f),l[r].d(f)}}}function Ig(t){let e,n,r;function i(o){t[17](o)}let s={onOpenChange:t[9],$$slots:{default:[Lg]},$$scope:{ctx:t}};return t[3]!==void 0&&(s.open=t[3]),e=new sn({props:s}),ve.push(()=>Qt(e,"open",i)),{c(){B(e.$$.fragment)},m(o,u){H(e,o,u),r=!0},p(o,[u]){const l={};u&33554551&&(l.$$scope={dirty:u,ctx:o}),!n&&u&8&&(n=!0,l.open=o[3],Wt(()=>n=!1)),e.$set(l)},i(o){r||(b(e.$$.fragment,o),r=!0)},o(o){k(e.$$.fragment,o),r=!1},d(o){V(e,o)}}}function Ng(t,e,n){let r,i;x(t,ct,R=>n(6,i=R));var s=(R=>(R[R.READY=0]="READY",R[R.ACTIVE=1]="ACTIVE",R[R.SUCCESS=2]="SUCCESS",R[R.FAILED=3]="FAILED",R))(s||{});const o=Ot(),u=Rt();x(t,u,R=>n(18,r=R));let l=null,a=null,f=!1,c=!1,d=[],m=!1;function p(R){R||Xe.set(Fe.NONE)}async function _(R){if(R.preventDefault(),l&&l.files){n(4,d=[]);for(let j of l.files)d.push([j,0]);d.length>0&&g()}}async function y(R){if(R.preventDefault(),n(4,d=[]),R.dataTransfer&&R.dataTransfer.items){for(let j of R.dataTransfer.items)if(j.kind==="file"){const I=j.getAsFile();I!==null&&d.push([I,0])}d.length>0&&g()}}async function g(){n(5,m=!1);for(let R of d){if(!c)break;if(R[1]=1,n(4,d),(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+R[0].name,{method:"POST",headers:{"X-uEditor-New-Type":"file"}})).ok){const I=new FormData;I.append("content",R[0]),(await fetch("/api/branches/"+(r==null?void 0:r.id)+"/files/"+(i==null?void 0:i.fullpath)+"/"+R[0].name,{method:"PUT",body:I})).ok?R[1]=2:R[1]=3,n(4,d)}else R[1]=3,n(4,d)}o.invalidateQueries({queryKey:["branches",r==null?void 0:r.id,"files/"]}),n(5,m=!0)}function h(R){ve[R?"unshift":"push"](()=>{l=R,n(0,l)})}const v=()=>{a&&a.click()},O=R=>{R.preventDefault(),n(2,f=!0)},$=()=>{n(2,f=!1)};function C(R){ve[R?"unshift":"push"](()=>{a=R,n(1,a)})}function F(R){c=R,n(3,c)}return[l,a,f,c,d,m,i,s,u,p,_,y,h,v,O,$,C,F]}class Mg extends be{constructor(e){super(),ge(this,e,Ng,Ig,fe,{})}}function Hg(t){let e,n;return e=new Mg({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Vg(t){let e,n;return e=new vg({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Bg(t){let e,n;return e=new pg({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Ug(t){let e,n;return e=new ug({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Kg(t){let e,n;return e=new ng({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function jg(t){let e,n;return e=new rf({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function qg(t){let e,n;return e=new W1({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Wg(t){let e,n;return e=new F1({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Qg(t){let e,n;return e=new V1({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function zg(t){let e,n;return e=new E1({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Gg(t){let e,n,r,i;const s=[zg,Qg,Wg,qg,jg,Kg,Ug,Bg,Vg,Hg],o=[];function u(l,a){return l[0]===Fe.UEDITOR_NEW_BRANCH?0:l[0]===Fe.UEDITOR_IMPORT_REMOTE_BRANCH?1:l[0]===Fe.UEDITOR_DELETE_BRANCH?2:l[0]===Fe.FOLDER_CREATE?3:l[0]===Fe.FOLDER_DELETE?4:l[0]===Fe.FOLDER_RENAME?5:l[0]===Fe.FILE_CREATE?6:l[0]===Fe.FILE_DELETE?7:l[0]===Fe.FILE_RENAME?8:l[0]===Fe.FILE_UPLOAD?9:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Ie()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e!==f&&(n&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~e?(n=o[e],n||(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}var Fe=(t=>(t[t.NONE=1]="NONE",t[t.UEDITOR_NEW_BRANCH=2]="UEDITOR_NEW_BRANCH",t[t.UEDITOR_IMPORT_REMOTE_BRANCH=3]="UEDITOR_IMPORT_REMOTE_BRANCH",t[t.UEDITOR_DELETE_BRANCH=4]="UEDITOR_DELETE_BRANCH",t[t.FOLDER_CREATE=5]="FOLDER_CREATE",t[t.FOLDER_DELETE=6]="FOLDER_DELETE",t[t.FOLDER_RENAME=7]="FOLDER_RENAME",t[t.FILE_CREATE=8]="FILE_CREATE",t[t.FILE_DELETE=9]="FILE_DELETE",t[t.FILE_RENAME=10]="FILE_RENAME",t[t.FILE_UPLOAD=11]="FILE_UPLOAD",t))(Fe||{});const Xe=Re(1);function Yg(t,e,n){let r,i=_e;return x(t,Xe,s=>n(0,r=s)),t.$$.on_destroy.push(()=>i()),[r]}let Zg=class extends be{constructor(e){super(),ge(this,e,Yg,Gg,fe,{})}};const Xg="modulepreload",Jg=function(t){return"/app/"+t},Eu={},Fi=function(e,n,r){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),u=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.allSettled(n.map(l=>{if(l=Jg(l),l in Eu)return;Eu[l]=!0;const a=l.endsWith(".css"),f=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":Xg,a||(c.as="script"),c.crossOrigin="",c.href=l,u&&c.setAttribute("nonce",u),document.head.appendChild(c),a)return new Promise((d,m)=>{c.addEventListener("load",d),c.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}function s(o){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=o,window.dispatchEvent(u),!u.defaultPrevented)throw o}return i.then(o=>{for(const u of o||[])u.status==="rejected"&&s(u.reason);return e().catch(s)})};function xg(t){let e;return{c(){e=S("div"),e.textContent="Please select a file or folder from the file-browser on the left",M(e,"class","flex-1 relative px-2 py-1 text-gray-700")},m(n,r){w(n,e,r)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function eb(t){let e,n,r,i;const s=[rb,nb,tb],o=[];function u(l,a){return l[2]!==null?0:l[0]?1:2}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function tb(t){let e,n,r=t[1].mimetype+"",i,s;return{c(){e=S("div"),n=X("Unfortunately the μEditor does not know how to edit this file ("),i=X(r),s=X(")."),M(e,"class","flex-1 px-2 py-1 text-rose-700")},m(o,u){w(o,e,u),D(e,n),D(e,i),D(e,s)},p(o,u){u&2&&r!==(r=o[1].mimetype+"")&&Ge(i,r)},i:_e,o:_e,d(o){o&&E(e)}}}function nb(t){let e;return{c(){e=S("div"),e.textContent="Loading the editor. Please wait...",M(e,"class","flex-1 px-2 py-1")},m(n,r){w(n,e,r)},p:_e,i:_e,o:_e,d(n){n&&E(e)}}}function rb(t){let e,n,r;var i=t[2];function s(o,u){return{}}return i&&(e=Io(i,s())),{c(){e&&B(e.$$.fragment),n=Ie()},m(o,u){e&&H(e,o,u),w(o,n,u),r=!0},p(o,u){if(u&4&&i!==(i=o[2])){if(e){ke();const l=e;k(l.$$.fragment,1,0,()=>{V(l,1)}),Ce()}i?(e=Io(i,s()),B(e.$$.fragment),b(e.$$.fragment,1),H(e,n.parentNode,n)):e=null}},i(o){r||(e&&b(e.$$.fragment,o),r=!0)},o(o){e&&k(e.$$.fragment,o),r=!1},d(o){o&&E(n),e&&V(e,o)}}}function ib(t){let e,n,r,i;const s=[eb,xg],o=[];function u(l,a){return l[1]!==null?0:1}return e=u(t),n=o[e]=s[e](t),{c(){n.c(),r=Ie()},m(l,a){o[e].m(l,a),w(l,r,a),i=!0},p(l,[a]){let f=e;e=u(l),e===f?o[e].p(l,a):(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce(),n=o[e],n?n.p(l,a):(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r))},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),o[e].d(l)}}}function sb(t,e,n){let r,i;x(t,ct,f=>n(1,r=f));let s=!1;const o=["application/gitignore","application/json","application/toml","application/yaml"],u=["application/tei+xml"],l=Ue(ct,f=>{if(f){if(f.type==="folder")return"Folder";if(o.indexOf(f.mimetype)>=0||f.mimetype.startsWith("text/"))return"CodeMirror";if(u.indexOf(f.mimetype)>=0)return"Tei";if(f.mimetype.startsWith("image/"))return"Image"}return null}),a=Ue(l,(f,c)=>{let d=null;f==="Folder"?d=Fi(()=>import("./FolderEditor-DIEGEh84.js"),[]):f==="CodeMirror"?d=Fi(()=>import("./CodeMirrorEditor-BFeD7k_m.js"),__vite__mapDeps([0,1,2])):f==="Tei"?d=Fi(()=>import("./TeiEditor-BeHkuEAu.js"),__vite__mapDeps([3,1])):f==="Image"&&(d=Fi(()=>import("./ImageEditor-BRTKiGoH.js"),[])),d?(n(0,s=!0),d.then(m=>{c(m.default),n(0,s=!1)},()=>{n(0,s=!1)})):c(null)},null);return x(t,a,f=>n(2,i=f)),[s,r,i,a]}let ob=class extends be{constructor(e){super(),ge(this,e,sb,ib,fe,{})}};function lb(t){return t[t.length-1]}function sf(t){return Object.keys(t).reduce((e,n)=>t[n]===void 0?e:e+`${n}:${t[n]};`,"")}sf({position:"absolute",opacity:0,"pointer-events":"none",margin:0,transform:"translateX(-100%)"});function ub(t,...e){const n={};for(const r of Object.keys(t))e.includes(r)||(n[r]=t[r]);return n}function Pi(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=r)}return e}function wu(t){function e(n){return n(t),()=>{}}return{subscribe:e}}function Ou(t,e){if(!fb)return null;const n=document.querySelector(`[data-melt-id="${t}"]`);return $o(n)?n:null}const Di=t=>new Proxy(t,{get(e,n,r){return Reflect.get(e,n,r)},ownKeys(e){return Reflect.ownKeys(e).filter(n=>n!=="action")}}),Au=t=>typeof t=="function";Ni("empty");function Ni(t,e){const{stores:n,action:r,returned:i}=e??{},s=(()=>{if(n&&i)return Ue(n,u=>{const l=i(u);if(Au(l)){const a=(...f)=>Di(Pi({...l(...f),[`data-melt-${t}`]:"",action:r??rr}));return a.action=r??rr,a}return Di(Pi({...l,[`data-melt-${t}`]:"",action:r??rr}))});{const u=i,l=u==null?void 0:u();if(Au(l)){const a=(...f)=>Di(Pi({...l(...f),[`data-melt-${t}`]:"",action:r??rr}));return a.action=r??rr,wu(a)}return wu(Di(Pi({...l,[`data-melt-${t}`]:"",action:r??rr})))}})(),o=r??(()=>{});return o.subscribe=s.subscribe,o}function ab(t){const e=s=>s?`${t}-${s}`:t,n=s=>`data-melt-${t}${s?`-${s}`:""}`,r=s=>`[data-melt-${t}${s?`-${s}`:""}]`;return{name:e,attribute:n,selector:r,getEl:s=>document.querySelector(r(s))}}const fb=typeof document<"u",cb=t=>/^[a-z]$/i.test(t);function $o(t){return t instanceof HTMLElement}function db(t){return t.offsetParent===null}function mb(...t){return(...e)=>{for(const n of t)typeof n=="function"&&n(...e)}}function rr(){}function Ss(t,e,n,r){const i=Array.isArray(e)?e:[e];if(typeof n=="function"){const s=hb(o=>n(o));return i.forEach(o=>t.addEventListener(o,s,r)),()=>{i.forEach(o=>t.removeEventListener(o,s,r))}}return()=>void 0}function pb(t){const e=t.currentTarget;if(!$o(e))return null;const n=new CustomEvent(`m-${t.type}`,{detail:{originalEvent:t},cancelable:!0});return e.dispatchEvent(n),n}function hb(t){return e=>{const n=pb(e);if(!(n!=null&&n.defaultPrevented))return t(e)}}function So(t){return{...t,get:()=>$r(t)}}So.writable=function(t){const e=Re(t);let n=t;return{subscribe:e.subscribe,set(r){e.set(r),n=r},update(r){const i=r(n);e.set(i),n=i},get(){return n}}};So.derived=function(t,e){const n=new Map,r=()=>{const s=Array.isArray(t)?t.map(o=>o.get()):t.get();return e(s)};return{get:r,subscribe:s=>{const o=[];return(Array.isArray(t)?t:[t]).forEach(l=>{o.push(l.subscribe(()=>{s(r())}))}),s(r()),n.set(s,o),()=>{const l=n.get(s);if(l)for(const a of l)a();n.delete(s)}}}};const _b=(t,e)=>{const n=So(t),r=(s,o)=>{n.update(u=>{const l=s(u);let a=l;return e&&(a=e({curr:u,next:l})),o==null||o(a),a})};return{...n,update:r,set:s=>{r(()=>s)}}};function gb(){return wa(10)}function bb(t){return t.reduce((e,n)=>(e[n]=gb(),e),{})}const lt={ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",A:"a",P:"p"};yt(!1),yt(!1),yt(void 0),yt(void 0);const yb={isDateDisabled:void 0,isDateUnavailable:void 0,value:void 0,preventDeselect:!1,numberOfMonths:1,pagedNavigation:!1,weekStartsOn:0,fixedWeeks:!1,calendarLabel:"Event Date",locale:"en",minValue:void 0,maxValue:void 0,disabled:!1,readonly:!1,weekdayFormat:"narrow"};({...ub(yb,"isDateDisabled","isDateUnavailable","value","locale","disabled","readonly","minValue","maxValue","weekdayFormat")});const vb={forceVisible:!1,defaultExpanded:[]},ir={TABINDEX:"tabindex",EXPANDED:"aria-expanded",LABELLEDBY:"aria-labelledby",DATAID:"data-id"},{name:Rs}=ab("tree-view");function kb(t){const e={...vb,...t},{forceVisible:n}=e,r=Re(null),i=Re(null),s=e.expanded??Re(e.defaultExpanded),o=_b(s,e==null?void 0:e.onExpandedChange),u=Ue([i],([C])=>C==null?void 0:C.getAttribute("data-id")),l=Ue([i],([C])=>F=>(C==null?void 0:C.getAttribute("data-id"))===F),a=Ue([o],([C])=>F=>C.includes(F)),f=bb(["tree"]),c=Ni(Rs(),{returned:()=>({role:"tree","data-melt-id":f.tree})});let d=!1;const m=Ni(Rs("item"),{stores:[o,u,r],returned:([C,F,R])=>j=>{const{id:I,hasChildren:L}=j;let N=0;return R!==null&&(N=R===I?0:-1),{role:"treeitem","aria-selected":F===I,"data-id":I,tabindex:N,"aria-expanded":L?C.includes(I):void 0}},action:C=>{const F=mb(Ss(C,"keydown",R=>{const{key:j}=R,I=cb(j);if(![lt.ARROW_DOWN,lt.ARROW_UP,lt.ARROW_LEFT,lt.ARROW_RIGHT,lt.ENTER,lt.SPACE,lt.END,lt.HOME,lt.ASTERISK].includes(j)&&!I||!Ou(f.tree)||!$o(C)||C.getAttribute("role")!=="treeitem")return;const A=g(),P=A.findIndex(q=>q===C);if(j!==lt.ENTER&&j!==lt.SPACE&&R.preventDefault(),j===lt.ENTER||j===lt.SPACE)y(C),d=!0;else if(j===lt.ARROW_DOWN&&P!==A.length-1){const q=A[P+1];if(!q)return;_(q)}else if(j===lt.ARROW_UP&&P!==0){const q=A[P-1];if(!q)return;_(q)}else if(j===lt.HOME&&P!==0){const q=A[0];if(!q)return;_(q)}else if(j===lt.END&&P!=A.length-1){const q=lb(A);if(!q)return;_(q)}else if(j===lt.ARROW_LEFT)if($(C))v(C);else{const q=C==null?void 0:C.closest('[role="group"]'),W=q==null?void 0:q.getAttribute("data-group-id"),oe=A.find(se=>se.getAttribute("data-id")===W);if(!oe)return;_(oe)}else if(j===lt.ARROW_RIGHT)if($(C)){const q=A[P+1];if(!q)return;_(q)}else O(C)&&v(C);else if(I){const q=A.map(se=>{var z;return{value:(z=se.textContent)==null?void 0:z.toLowerCase().trim(),id:se.getAttribute("data-id")}});let W=-1,oe=q.slice(P+1).some((se,z)=>{var le;return((le=se.value)==null?void 0:le.toLowerCase()[0])===j?(W=P+1+z,!0):!1});if(oe||(oe=q.slice(0,P).some((se,z)=>{var le;return((le=se.value)==null?void 0:le.toLowerCase().at(0))===j?(W=z,!0):!1})),oe&&q[W].id){const se=A[W];if(!se)return;_(se)}}}),Ss(C,"click",async()=>{y(C),_(C),d||v(C),d=!1}),Ss(C,"focus",()=>{r.update(R=>C.getAttribute("data-id")??R)}));return{destroy(){F()}}}}),p=Ni(Rs("group"),{stores:[o],returned:([C])=>F=>({role:"group","data-group-id":F.id,hidden:!n&&!C.includes(F.id)?!0:void 0,style:sf({display:!n&&!C.includes(F.id)?"none":void 0})})});function _(C){r.update(F=>C.getAttribute("data-id")??F),C.focus()}function y(C){C.getAttribute(ir.DATAID)&&i.set(C)}function g(){let C=[];const F=Ou(f.tree);return F&&(C=Array.from(F.querySelectorAll('[role="treeitem"]')).filter(R=>!db(R))),C}function h(C){const F=C.hasAttribute(ir.EXPANDED),R=C.getAttribute(ir.EXPANDED),j=C.getAttribute(ir.DATAID);return{hasChildren:F,expanded:R,dataId:j}}function v(C){const{hasChildren:F,expanded:R,dataId:j}=h(C);!F||R===null||j===null||(R==="false"?o.update(I=>[...I,j]):o.update(I=>I.filter(L=>L!==j)))}function O(C){return C.hasAttribute(ir.EXPANDED)}function $(C){return C.getAttribute(ir.EXPANDED)==="true"}return{ids:f,elements:{tree:c,item:m,group:p},states:{expanded:o,selectedItem:i},helpers:{isExpanded:a,isSelected:l}}}var Cb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Eb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var of={exports:{}};(function(t,e){(function(n,r,i){t.exports=i(),t.exports.default=i()})("slugify",Cb,function(){var n=JSON.parse(`{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","¢":"cent","£":"pound","¤":"currency","¥":"yen","©":"(c)","ª":"a","®":"(r)","º":"o","À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Æ":"AE","Ç":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","Þ":"TH","ß":"ss","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","æ":"ae","ç":"c","è":"e","é":"e","ê":"e","ë":"e","ì":"i","í":"i","î":"i","ï":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","þ":"th","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Č":"C","č":"c","Ď":"D","ď":"d","Đ":"DJ","đ":"dj","Ē":"E","ē":"e","Ė":"E","ė":"e","Ę":"e","ę":"e","Ě":"E","ě":"e","Ğ":"G","ğ":"g","Ģ":"G","ģ":"g","Ĩ":"I","ĩ":"i","Ī":"i","ī":"i","Į":"I","į":"i","İ":"I","ı":"i","Ķ":"k","ķ":"k","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ł":"L","ł":"l","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","Ō":"O","ō":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","Ŕ":"R","ŕ":"r","Ř":"R","ř":"r","Ś":"S","ś":"s","Ş":"S","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","Ť":"T","ť":"t","Ũ":"U","ũ":"u","Ū":"u","ū":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","Ə":"E","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Lj":"LJ","lj":"lj","Nj":"NJ","nj":"nj","Ș":"S","ș":"s","Ț":"T","ț":"t","ə":"e","˚":"o","Ά":"A","Έ":"E","Ή":"H","Ί":"I","Ό":"O","Ύ":"Y","Ώ":"W","ΐ":"i","Α":"A","Β":"B","Γ":"G","Δ":"D","Ε":"E","Ζ":"Z","Η":"H","Θ":"8","Ι":"I","Κ":"K","Λ":"L","Μ":"M","Ν":"N","Ξ":"3","Ο":"O","Π":"P","Ρ":"R","Σ":"S","Τ":"T","Υ":"Y","Φ":"F","Χ":"X","Ψ":"PS","Ω":"W","Ϊ":"I","Ϋ":"Y","ά":"a","έ":"e","ή":"h","ί":"i","ΰ":"y","α":"a","β":"b","γ":"g","δ":"d","ε":"e","ζ":"z","η":"h","θ":"8","ι":"i","κ":"k","λ":"l","μ":"m","ν":"n","ξ":"3","ο":"o","π":"p","ρ":"r","ς":"s","σ":"s","τ":"t","υ":"y","φ":"f","χ":"x","ψ":"ps","ω":"w","ϊ":"i","ϋ":"y","ό":"o","ύ":"y","ώ":"w","Ё":"Yo","Ђ":"DJ","Є":"Ye","І":"I","Ї":"Yi","Ј":"J","Љ":"LJ","Њ":"NJ","Ћ":"C","Џ":"DZ","А":"A","Б":"B","В":"V","Г":"G","Д":"D","Е":"E","Ж":"Zh","З":"Z","И":"I","Й":"J","К":"K","Л":"L","М":"M","Н":"N","О":"O","П":"P","Р":"R","С":"S","Т":"T","У":"U","Ф":"F","Х":"H","Ц":"C","Ч":"Ch","Ш":"Sh","Щ":"Sh","Ъ":"U","Ы":"Y","Ь":"","Э":"E","Ю":"Yu","Я":"Ya","а":"a","б":"b","в":"v","г":"g","д":"d","е":"e","ж":"zh","з":"z","и":"i","й":"j","к":"k","л":"l","м":"m","н":"n","о":"o","п":"p","р":"r","с":"s","т":"t","у":"u","ф":"f","х":"h","ц":"c","ч":"ch","ш":"sh","щ":"sh","ъ":"u","ы":"y","ь":"","э":"e","ю":"yu","я":"ya","ё":"yo","ђ":"dj","є":"ye","і":"i","ї":"yi","ј":"j","љ":"lj","њ":"nj","ћ":"c","ѝ":"u","џ":"dz","Ґ":"G","ґ":"g","Ғ":"GH","ғ":"gh","Қ":"KH","қ":"kh","Ң":"NG","ң":"ng","Ү":"UE","ү":"ue","Ұ":"U","ұ":"u","Һ":"H","һ":"h","Ә":"AE","ә":"ae","Ө":"OE","ө":"oe","Ա":"A","Բ":"B","Գ":"G","Դ":"D","Ե":"E","Զ":"Z","Է":"E'","Ը":"Y'","Թ":"T'","Ժ":"JH","Ի":"I","Լ":"L","Խ":"X","Ծ":"C'","Կ":"K","Հ":"H","Ձ":"D'","Ղ":"GH","Ճ":"TW","Մ":"M","Յ":"Y","Ն":"N","Շ":"SH","Չ":"CH","Պ":"P","Ջ":"J","Ռ":"R'","Ս":"S","Վ":"V","Տ":"T","Ր":"R","Ց":"C","Փ":"P'","Ք":"Q'","Օ":"O''","Ֆ":"F","և":"EV","ء":"a","آ":"aa","أ":"a","ؤ":"u","إ":"i","ئ":"e","ا":"a","ب":"b","ة":"h","ت":"t","ث":"th","ج":"j","ح":"h","خ":"kh","د":"d","ذ":"th","ر":"r","ز":"z","س":"s","ش":"sh","ص":"s","ض":"dh","ط":"t","ظ":"z","ع":"a","غ":"gh","ف":"f","ق":"q","ك":"k","ل":"l","م":"m","ن":"n","ه":"h","و":"w","ى":"a","ي":"y","ً":"an","ٌ":"on","ٍ":"en","َ":"a","ُ":"u","ِ":"e","ْ":"","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","پ":"p","چ":"ch","ژ":"zh","ک":"k","گ":"g","ی":"y","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","฿":"baht","ა":"a","ბ":"b","გ":"g","დ":"d","ე":"e","ვ":"v","ზ":"z","თ":"t","ი":"i","კ":"k","ლ":"l","მ":"m","ნ":"n","ო":"o","პ":"p","ჟ":"zh","რ":"r","ს":"s","ტ":"t","უ":"u","ფ":"f","ქ":"k","ღ":"gh","ყ":"q","შ":"sh","ჩ":"ch","ც":"ts","ძ":"dz","წ":"ts","ჭ":"ch","ხ":"kh","ჯ":"j","ჰ":"h","Ṣ":"S","ṣ":"s","Ẁ":"W","ẁ":"w","Ẃ":"W","ẃ":"w","Ẅ":"W","ẅ":"w","ẞ":"SS","Ạ":"A","ạ":"a","Ả":"A","ả":"a","Ấ":"A","ấ":"a","Ầ":"A","ầ":"a","Ẩ":"A","ẩ":"a","Ẫ":"A","ẫ":"a","Ậ":"A","ậ":"a","Ắ":"A","ắ":"a","Ằ":"A","ằ":"a","Ẳ":"A","ẳ":"a","Ẵ":"A","ẵ":"a","Ặ":"A","ặ":"a","Ẹ":"E","ẹ":"e","Ẻ":"E","ẻ":"e","Ẽ":"E","ẽ":"e","Ế":"E","ế":"e","Ề":"E","ề":"e","Ể":"E","ể":"e","Ễ":"E","ễ":"e","Ệ":"E","ệ":"e","Ỉ":"I","ỉ":"i","Ị":"I","ị":"i","Ọ":"O","ọ":"o","Ỏ":"O","ỏ":"o","Ố":"O","ố":"o","Ồ":"O","ồ":"o","Ổ":"O","ổ":"o","Ỗ":"O","ỗ":"o","Ộ":"O","ộ":"o","Ớ":"O","ớ":"o","Ờ":"O","ờ":"o","Ở":"O","ở":"o","Ỡ":"O","ỡ":"o","Ợ":"O","ợ":"o","Ụ":"U","ụ":"u","Ủ":"U","ủ":"u","Ứ":"U","ứ":"u","Ừ":"U","ừ":"u","Ử":"U","ử":"u","Ữ":"U","ữ":"u","Ự":"U","ự":"u","Ỳ":"Y","ỳ":"y","Ỵ":"Y","ỵ":"y","Ỷ":"Y","ỷ":"y","Ỹ":"Y","ỹ":"y","–":"-","‘":"'","’":"'","“":"\\"","”":"\\"","„":"\\"","†":"+","•":"*","…":"...","₠":"ecu","₢":"cruzeiro","₣":"french franc","₤":"lira","₥":"mill","₦":"naira","₧":"peseta","₨":"rupee","₩":"won","₪":"new shequel","₫":"dong","€":"euro","₭":"kip","₮":"tugrik","₯":"drachma","₰":"penny","₱":"peso","₲":"guarani","₳":"austral","₴":"hryvnia","₵":"cedi","₸":"kazakhstani tenge","₹":"indian rupee","₺":"turkish lira","₽":"russian ruble","₿":"bitcoin","℠":"sm","™":"tm","∂":"d","∆":"delta","∑":"sum","∞":"infinity","♥":"love","元":"yuan","円":"yen","﷼":"rial","ﻵ":"laa","ﻷ":"laa","ﻹ":"lai","ﻻ":"la"}`),r=JSON.parse('{"bg":{"Й":"Y","Ц":"Ts","Щ":"Sht","Ъ":"A","Ь":"Y","й":"y","ц":"ts","щ":"sht","ъ":"a","ь":"y"},"de":{"Ä":"AE","ä":"ae","Ö":"OE","ö":"oe","Ü":"UE","ü":"ue","ß":"ss","%":"prozent","&":"und","|":"oder","∑":"summe","∞":"unendlich","♥":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","¢":"centavos","£":"libras","¤":"moneda","₣":"francos","∑":"suma","∞":"infinito","♥":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","¢":"centime","£":"livre","¤":"devise","₣":"franc","∑":"somme","∞":"infini","♥":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","¢":"centavo","∑":"soma","£":"libra","∞":"infinito","♥":"amor"},"uk":{"И":"Y","и":"y","Й":"Y","й":"y","Ц":"Ts","ц":"ts","Х":"Kh","х":"kh","Щ":"Shch","щ":"shch","Г":"H","г":"h"},"vi":{"Đ":"D","đ":"d"},"da":{"Ø":"OE","ø":"oe","Å":"AA","å":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"større end"},"nb":{"&":"og","Å":"AA","Æ":"AE","Ø":"OE","å":"aa","æ":"ae","ø":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","Å":"AA","Ä":"AE","Ö":"OE","å":"aa","ä":"ae","ö":"oe"}}');function i(s,o){if(typeof s!="string")throw new Error("slugify: string argument expected");o=typeof o=="string"?{replacement:o}:o||{};var u=r[o.locale]||{},l=o.replacement===void 0?"-":o.replacement,a=o.trim===void 0?!0:o.trim,f=s.normalize().split("").reduce(function(c,d){var m=u[d];return m===void 0&&(m=n[d]),m===void 0&&(m=d),m===l&&(m=" "),c+m.replace(o.remove||/[^\w\s$*_+~.()'"!\-:@]+/g,"")},"");return o.strict&&(f=f.replace(/[^A-Za-z0-9\s]/g,"")),a&&(f=f.trim()),f=f.replace(/\s+/g,l),o.lower&&(f=f.toLowerCase()),f}return i.extend=function(s){Object.assign(n,s)},i})})(of);var wb=of.exports;const Ob=Eb(wb);function Tu(t,e,n){var l;const r=t.slice();r[9]=e[n].name,r[10]=e[n].type,r[11]=e[n].fullpath,r[12]=e[n].content,r[13]=e[n].mimetype,r[19]=n;const i=`file-tree-${Ob(r[9],{strict:!0})}-${r[1]}-${r[19]}`;r[14]=i;const s=!!((l=r[12])!=null&&l.length);r[15]=s;const o=r[2]({id:r[14]});r[16]=o;const u=r[3]({id:r[14],hasChildren:r[15]});return r[17]=u,r}function Ab(t){let e,n,r,i,s;const o=[Pb,Fb,Rb,Sb],u=[];function l(a,f){return f&1&&(e=null),a[13]==="text/markdown"?0:(e==null&&(e=!!a[13].startsWith("image/")),e?1:a[13]==="application/yaml"||a[13]==="application/toml"||a[13]==="application/gitignore"?2:3)}return n=l(t,-1),r=u[n]=o[n](t),{c(){r.c(),i=Ie()},m(a,f){u[n].m(a,f),w(a,i,f),s=!0},p(a,f){let c=n;n=l(a,f),n!==c&&(ke(),k(u[c],1,1,()=>{u[c]=null}),Ce(),r=u[n],r||(r=u[n]=o[n](a),r.c()),b(r,1),r.m(i.parentNode,i))},i(a){s||(b(r),s=!0)},o(a){k(r),s=!1},d(a){a&&E(i),u[n].d(a)}}}function Tb(t){let e,n;return e=new Qe({props:{path:F_}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:_e,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function $b(t){let e,n;return e=new Qe({props:{path:R_}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:_e,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Sb(t){let e,n;return e=new Qe({props:{path:T_}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Rb(t){let e,n;return e=new Qe({props:{path:E_}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Fb(t){let e,n;return e=new Qe({props:{path:A_}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Pb(t){let e,n;return e=new Qe({props:{path:w_}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function $u(t){let e,n,r,i,s;n=new lf({props:{treeItems:t[12],level:t[1]+1}});let o=[t[16]],u={};for(let l=0;l<o.length;l+=1)u=ne(u,o[l]);return{c(){e=S("ol"),B(n.$$.fragment),ie(e,u)},m(l,a){w(l,e,a),H(n,e,null),r=!0,i||(s=Ve(t[16].action(e)),i=!0)},p(l,a){const f={};a&1&&(f.treeItems=l[12]),a&2&&(f.level=l[1]+1),n.$set(f),ie(e,u=Ne(o,[a&7&&l[16]]))},i(l){r||(b(n.$$.fragment,l),r=!0)},o(l){k(n.$$.fragment,l),r=!1},d(l){l&&E(e),V(n),i=!1,s()}}}function Su(t){let e,n,r,i,s,o,u,l=t[9]+"",a,f,c,d,m,p,_;const y=[$b,Tb,Ab],g=[];function h(C,F){return F&19&&(r=null),r==null&&(r=!!(C[10]==="folder"&&C[15]&&C[4](C[14]))),r?0:C[10]==="folder"?1:C[10]==="file"?2:-1}~(i=h(t,-1))&&(s=g[i]=y[i](t));let v=[{class:"flex items-center gap-1 p-1"},t[17],{"data-file-path":f=t[11]}],O={};for(let C=0;C<v.length;C+=1)O=ne(O,v[C]);let $=t[12]&&$u(t);return{c(){e=S("li"),n=S("button"),s&&s.c(),o=U(),u=S("span"),a=X(l),c=U(),$&&$.c(),d=U(),M(u,"class","select-none"),ie(n,O),M(e,"role","none")},m(C,F){w(C,e,F),D(e,n),~i&&g[i].m(n,null),D(n,o),D(n,u),D(u,a),n.autofocus&&n.focus(),D(e,c),$&&$.m(e,null),D(e,d),m=!0,p||(_=Ve(t[17].action(n)),p=!0)},p(C,F){let R=i;i=h(C,F),i===R?~i&&g[i].p(C,F):(s&&(ke(),k(g[R],1,1,()=>{g[R]=null}),Ce()),~i?(s=g[i],s?s.p(C,F):(s=g[i]=y[i](C),s.c()),b(s,1),s.m(n,o)):s=null),(!m||F&1)&&l!==(l=C[9]+"")&&Ge(a,l),ie(n,O=Ne(v,[{class:"flex items-center gap-1 p-1"},F&11&&C[17],(!m||F&1&&f!==(f=C[11]))&&{"data-file-path":f}])),C[12]?$?($.p(C,F),F&1&&b($,1)):($=$u(C),$.c(),b($,1),$.m(e,d)):$&&(ke(),k($,1,1,()=>{$=null}),Ce())},i(C){m||(b(s),b($),m=!0)},o(C){k(s),k($),m=!1},d(C){C&&E(e),~i&&g[i].d(),$&&$.d(),p=!1,_()}}}function Db(t){let e,n,r=en(t[0]),i=[];for(let o=0;o<r.length;o+=1)i[o]=Su(Tu(t,r,o));const s=o=>k(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();e=Ie()},m(o,u){for(let l=0;l<i.length;l+=1)i[l]&&i[l].m(o,u);w(o,e,u),n=!0},p(o,[u]){if(u&31){r=en(o[0]);let l;for(l=0;l<r.length;l+=1){const a=Tu(o,r,l);i[l]?(i[l].p(a,u),b(i[l],1)):(i[l]=Su(a),i[l].c(),b(i[l],1),i[l].m(e.parentNode,e))}for(ke(),l=r.length;l<i.length;l+=1)s(l);Ce()}},i(o){if(!n){for(let u=0;u<r.length;u+=1)b(i[u]);n=!0}},o(o){i=i.filter(Boolean);for(let u=0;u<i.length;u+=1)k(i[u]);n=!1},d(o){o&&E(e),fi(i,o)}}}function Lb(t,e,n){let r,i,s,{treeItems:o}=e,{level:u=1}=e;const{elements:{item:l,group:a},helpers:{isExpanded:f,isSelected:c}}=at("tree");return x(t,l,d=>n(3,i=d)),x(t,a,d=>n(2,r=d)),x(t,f,d=>n(4,s=d)),t.$$set=d=>{"treeItems"in d&&n(0,o=d.treeItems),"level"in d&&n(1,u=d.level)},[o,u,r,i,s,l,a,f]}class lf extends be{constructor(e){super(),ge(this,e,Lb,Db,fe,{treeItems:0,level:1})}}function Ib(t){let e,n,r,i,s;const o=t[1].default,u=ce(o,t,t[0],null);return i=new Qe({props:{path:rn,class:"w-12 h-12 animate-spin"}}),{c(){e=S("div"),n=S("p"),u&&u.c(),r=U(),B(i.$$.fragment),M(n,"class","sr-only"),M(e,"class","absolute left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2")},m(l,a){w(l,e,a),D(e,n),u&&u.m(n,null),D(e,r),H(i,e,null),s=!0},p(l,[a]){u&&u.p&&(!s||a&1)&&me(u,o,l,l[0],s?de(o,l[0],a,null):pe(l[0]),null)},i(l){s||(b(u,l),b(i.$$.fragment,l),s=!0)},o(l){k(u,l),k(i.$$.fragment,l),s=!1},d(l){l&&E(e),u&&u.d(l),V(i)}}}function Nb(t,e,n){let{$$slots:r={},$$scope:i}=e;return t.$$set=s=>{"$$scope"in s&&n(0,i=s.$$scope)},[i,r]}class Mb extends be{constructor(e){super(),ge(this,e,Nb,Ib,fe,{})}}function Hb(t){let e,n;return e=new Mb({props:{$$slots:{default:[Bb]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2048&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Vb(t){let e,n,r;n=new lf({props:{treeItems:t[0].data}});let i=[t[1]],s={};for(let o=0;o<i.length;o+=1)s=ne(s,i[o]);return{c(){e=S("ol"),B(n.$$.fragment),ie(e,s)},m(o,u){w(o,e,u),H(n,e,null),r=!0},p(o,u){const l={};u&1&&(l.treeItems=o[0].data),n.$set(l),ie(e,s=Ne(i,[u&2&&o[1]]))},i(o){r||(b(n.$$.fragment,o),r=!0)},o(o){k(n.$$.fragment,o),r=!1},d(o){o&&E(e),V(n)}}}function Bb(t){let e;return{c(){e=X("Loading the file list. Please wait...")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Ub(t){let e,n,r,i;const s=[Vb,Hb],o=[];function u(l,a){return l[0].isSuccess?0:l[0].isLoading?1:-1}return~(n=u(t))&&(r=o[n]=s[n](t)),{c(){e=S("nav"),r&&r.c(),M(e,"aria-label","Files"),M(e,"class","relative px-2 py-1 w-3/12 overflow-auto border-r border-gray-300")},m(l,a){w(l,e,a),~n&&o[n].m(e,null),i=!0},p(l,[a]){let f=n;n=u(l),n===f?~n&&o[n].p(l,a):(r&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~n?(r=o[n],r?r.p(l,a):(r=o[n]=s[n](l),r.c()),b(r,1),r.m(e,null)):r=null)},i(l){i||(b(r),i=!0)},o(l){k(r),i=!1},d(l){l&&E(e),~n&&o[n].d()}}}function uf(t,e){for(let n of t){if(n.fullpath===e)return n;if(n.content){const r=uf(n.content,e);if(r!==null)return r}}return null}function Kb(t){var n,r,i;const e=[];for(;t&&t.getAttribute("role")==="treeitem";)e.splice(0,0,t.getAttribute("data-id")),t=(i=(r=(n=t.parentElement)==null?void 0:n.parentElement)==null?void 0:r.parentElement)==null?void 0:i.querySelector(":scope > [role=treeitem]");return e}function jb(t,e,n){let r,i;const s=Rt(),o=Ao(),u=Ue([s,o],([p,_])=>p?{queryKey:["branches",p.id,"files/"],queryFn:Jt,enabled:_.isSuccess}:{queryKey:["branches","-","files/"],queryFn:Jt,enabled:!1}),l=Tn(u);x(t,l,p=>n(0,r=p));const a=kb({defaultExpanded:["file-tree--1-0"]});bt("tree",a);const{elements:{tree:f},states:{selectedItem:c,expanded:d}}=a;x(t,f,p=>n(1,i=p));const m=c.subscribe(p=>{if(c!==null&&(p==null?void 0:p.getAttribute("data-file-path"))!==null&&r.isSuccess){const _=uf(r.data,p==null?void 0:p.getAttribute("data-file-path"));ct.set(_)}else ct.set(null)});return ts(m),es(()=>{let p;p=l.subscribe(_=>{if(_.isSuccess){const y=tf("path");y&&Kt().then(()=>{const g=document.querySelector('[data-file-path="'+y+'"]');g&&(d.set(Kb(g)),c.set(g))}),p&&p()}})}),[r,i,l,f]}class qb extends be{constructor(e){super(),ge(this,e,jb,Ub,fe,{})}}function Ru(t,e,n){const r=t.slice();return r[10]=e[n],r}function Fu(t){let e,n=t[0].title+"",r,i;return{c(){e=X(" ("),r=X(n),i=X(")")},m(s,o){w(s,e,o),w(s,r,o),w(s,i,o)},p(s,o){o&1&&n!==(n=s[0].title+"")&&Ge(r,n)},d(s){s&&(E(e),E(r),E(i))}}}function Wb(t){let e,n,r=t[0]!==null&&Fu(t);return{c(){e=X("μEditor"),r&&r.c(),n=Ie()},m(i,s){w(i,e,s),r&&r.m(i,s),w(i,n,s)},p(i,s){i[0]!==null?r?r.p(i,s):(r=Fu(i),r.c(),r.m(n.parentNode,n)):r&&(r.d(1),r=null)},d(i){i&&(E(e),E(n)),r&&r.d(i)}}}function Qb(t){let e,n,r,i;return e=new Qe({props:{path:I_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="New Branch"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function zb(t){let e,n,r,i;return e=new Qe({props:{class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Import Branch"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function Pu(t){let e,n,r,i;return e=new Ut({props:{$$slots:{default:[Gb]},$$scope:{ctx:t}}}),e.$on("click",t[8]),r=new wo({}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&8193&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function Gb(t){let e,n,r,i,s=t[0].title+"",o,u;return e=new Qe({props:{path:N_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),i=X("Delete Branch "),o=X(s)},m(l,a){H(e,l,a),w(l,n,a),w(l,r,a),D(r,i),D(r,o),u=!0},p(l,a){(!u||a&1)&&s!==(s=l[0].title+"")&&Ge(o,s)},i(l){u||(b(e.$$.fragment,l),u=!0)},o(l){k(e.$$.fragment,l),u=!1},d(l){l&&(E(n),E(r)),V(e,l)}}}function Du(t){let e,n;return e=new Zm({props:{onValueChange:t[9],$$slots:{default:[Jb]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&4&&(s.onValueChange=r[9]),i&8197&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Yb(t){let e,n;return e=new Qe({props:{class:"w-4 h-4"}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Zb(t){let e,n;return e=new Qe({props:{path:y_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Xb(t){let e,n,r,i,s=t[10].title+"",o,u,l;const a=[Zb,Yb],f=[];function c(d,m){return d[0]!==null&&d[0].id===d[10].id?0:1}return e=c(t),n=f[e]=a[e](t),{c(){n.c(),r=U(),i=S("span"),o=X(s),u=U()},m(d,m){f[e].m(d,m),w(d,r,m),w(d,i,m),D(i,o),w(d,u,m),l=!0},p(d,m){let p=e;e=c(d),e!==p&&(ke(),k(f[p],1,1,()=>{f[p]=null}),Ce(),n=f[e],n||(n=f[e]=a[e](d),n.c()),b(n,1),n.m(r.parentNode,r)),(!l||m&4)&&s!==(s=d[10].title+"")&&Ge(o,s)},i(d){l||(b(n),l=!0)},o(d){k(n),l=!1},d(d){d&&(E(r),E(i),E(u)),f[e].d(d)}}}function Lu(t){let e,n;return e=new Hm({props:{value:t[10].id,$$slots:{default:[Xb]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&4&&(s.value=r[10].id),i&8197&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function Jb(t){let e,n,r=en(t[2].data),i=[];for(let o=0;o<r.length;o+=1)i[o]=Lu(Ru(t,r,o));const s=o=>k(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();e=Ie()},m(o,u){for(let l=0;l<i.length;l+=1)i[l]&&i[l].m(o,u);w(o,e,u),n=!0},p(o,u){if(u&5){r=en(o[2].data);let l;for(l=0;l<r.length;l+=1){const a=Ru(o,r,l);i[l]?(i[l].p(a,u),b(i[l],1)):(i[l]=Lu(a),i[l].c(),b(i[l],1),i[l].m(e.parentNode,e))}for(ke(),l=r.length;l<i.length;l+=1)s(l);Ce()}},i(o){if(!n){for(let u=0;u<r.length;u+=1)b(i[u]);n=!0}},o(o){i=i.filter(Boolean);for(let u=0;u<i.length;u+=1)k(i[u]);n=!1},d(o){o&&E(e),fi(i,o)}}}function xb(t){let e,n,r,i,s,o,u,l,a;e=new Ut({props:{$$slots:{default:[Qb]},$$scope:{ctx:t}}}),e.$on("click",t[6]),r=new Ut({props:{$$slots:{default:[zb]},$$scope:{ctx:t}}}),r.$on("click",t[7]),s=new wo({});let f=t[0]!==null&&t[1].isSuccess&&t[1].data.git.enabled&&t[1].data.git.default_branch!==t[0].id&&Pu(t),c=t[2].isSuccess&&Du(t);return{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment),i=U(),B(s.$$.fragment),o=U(),f&&f.c(),u=U(),c&&c.c(),l=Ie()},m(d,m){H(e,d,m),w(d,n,m),H(r,d,m),w(d,i,m),H(s,d,m),w(d,o,m),f&&f.m(d,m),w(d,u,m),c&&c.m(d,m),w(d,l,m),a=!0},p(d,m){const p={};m&8192&&(p.$$scope={dirty:m,ctx:d}),e.$set(p);const _={};m&8192&&(_.$$scope={dirty:m,ctx:d}),r.$set(_),d[0]!==null&&d[1].isSuccess&&d[1].data.git.enabled&&d[1].data.git.default_branch!==d[0].id?f?(f.p(d,m),m&3&&b(f,1)):(f=Pu(d),f.c(),b(f,1),f.m(u.parentNode,u)):f&&(ke(),k(f,1,1,()=>{f=null}),Ce()),d[2].isSuccess?c?(c.p(d,m),m&4&&b(c,1)):(c=Du(d),c.c(),b(c,1),c.m(l.parentNode,l)):c&&(ke(),k(c,1,1,()=>{c=null}),Ce())},i(d){a||(b(e.$$.fragment,d),b(r.$$.fragment,d),b(s.$$.fragment,d),b(f),b(c),a=!0)},o(d){k(e.$$.fragment,d),k(r.$$.fragment,d),k(s.$$.fragment,d),k(f),k(c),a=!1},d(d){d&&(E(n),E(i),E(o),E(u),E(l)),V(e,d),V(r,d),V(s,d),f&&f.d(d),c&&c.d(d)}}}function e0(t){let e,n,r,i;return e=new cs({props:{$$slots:{default:[Wb]},$$scope:{ctx:t}}}),r=new us({props:{$$slots:{default:[xb]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&8193&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&8199&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function t0(t){let e,n;return e=new fs({props:{$$slots:{default:[e0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&8199&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function n0(t,e,n){let r,i,s;const o=ds();x(t,o,m=>n(1,i=m));const u=To();x(t,u,m=>n(2,s=m));const l=Rt();return x(t,l,m=>n(0,r=m)),[r,i,s,o,u,l,()=>{Xe.set(Fe.UEDITOR_NEW_BRANCH)},()=>{Xe.set(Fe.UEDITOR_IMPORT_REMOTE_BRANCH)},()=>{Xe.set(Fe.UEDITOR_DELETE_BRANCH)},m=>{if(s.isSuccess)for(let p of s.data)p.id===m&&l.set(p)}]}class r0 extends be{constructor(e){super(),ge(this,e,n0,t0,fe,{})}}function i0(t){let e;return{c(){e=X("File")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function s0(t){let e,n,r,i;return e=new Qe({props:{path:L_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Rename"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function o0(t){let e,n,r,i;return e=new Qe({props:{path:H_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Delete"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function l0(t){let e,n,r,i;return e=new Ut({props:{$$slots:{default:[s0]},$$scope:{ctx:t}}}),e.$on("click",t[0]),r=new Ut({props:{$$slots:{default:[o0]},$$scope:{ctx:t}}}),r.$on("click",t[1]),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&4&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function u0(t){let e,n,r,i;return e=new cs({props:{$$slots:{default:[i0]},$$scope:{ctx:t}}}),r=new us({props:{$$slots:{default:[l0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&4&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function a0(t){let e,n;return e=new fs({props:{$$slots:{default:[u0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&4&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function f0(t){return[()=>{Xe.set(Fe.FILE_RENAME)},()=>{Xe.set(Fe.FILE_DELETE)}]}class c0 extends be{constructor(e){super(),ge(this,e,f0,a0,fe,{})}}function d0(t){let e;return{c(){e=X("Folder")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function m0(t){let e,n,r,i;return e=new Qe({props:{path:P_,class:"w4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="New Folder"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function p0(t){let e,n,r,i;return e=new Qe({props:{path:O_,class:"w4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="New File"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function h0(t){let e,n,r,i;return e=new Qe({props:{path:$_,class:"w4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Upload Files"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function _0(t){let e,n,r,i;return e=new Qe({props:{path:S_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Rename"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function g0(t){let e,n,r,i;return e=new Qe({props:{path:D_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Delete"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function b0(t){let e,n,r,i,s,o,u,l,a,f,c,d;return e=new Ut({props:{$$slots:{default:[m0]},$$scope:{ctx:t}}}),e.$on("click",t[2]),r=new Ut({props:{$$slots:{default:[p0]},$$scope:{ctx:t}}}),r.$on("click",t[3]),s=new Ut({props:{$$slots:{default:[h0]},$$scope:{ctx:t}}}),s.$on("click",t[4]),u=new wo({}),a=new Ut({props:{$$slots:{default:[_0]},$$scope:{ctx:t}}}),a.$on("click",t[5]),c=new Ut({props:{$$slots:{default:[g0]},$$scope:{ctx:t}}}),c.$on("click",t[6]),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment),i=U(),B(s.$$.fragment),o=U(),B(u.$$.fragment),l=U(),B(a.$$.fragment),f=U(),B(c.$$.fragment)},m(m,p){H(e,m,p),w(m,n,p),H(r,m,p),w(m,i,p),H(s,m,p),w(m,o,p),H(u,m,p),w(m,l,p),H(a,m,p),w(m,f,p),H(c,m,p),d=!0},p(m,p){const _={};p&256&&(_.$$scope={dirty:p,ctx:m}),e.$set(_);const y={};p&256&&(y.$$scope={dirty:p,ctx:m}),r.$set(y);const g={};p&256&&(g.$$scope={dirty:p,ctx:m}),s.$set(g);const h={};p&256&&(h.$$scope={dirty:p,ctx:m}),a.$set(h);const v={};p&256&&(v.$$scope={dirty:p,ctx:m}),c.$set(v)},i(m){d||(b(e.$$.fragment,m),b(r.$$.fragment,m),b(s.$$.fragment,m),b(u.$$.fragment,m),b(a.$$.fragment,m),b(c.$$.fragment,m),d=!0)},o(m){k(e.$$.fragment,m),k(r.$$.fragment,m),k(s.$$.fragment,m),k(u.$$.fragment,m),k(a.$$.fragment,m),k(c.$$.fragment,m),d=!1},d(m){m&&(E(n),E(i),E(o),E(l),E(f)),V(e,m),V(r,m),V(s,m),V(u,m),V(a,m),V(c,m)}}}function y0(t){let e,n,r,i;return e=new cs({props:{$$slots:{default:[d0]},$$scope:{ctx:t}}}),r=new us({props:{$$slots:{default:[b0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&256&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&256&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function Iu(t){let e,n;return e=new rf({}),e.$on("close",t[7]),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:_e,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function v0(t){let e,n,r,i;e=new fs({props:{$$slots:{default:[y0]},$$scope:{ctx:t}}});let s=t[0]===t[1].Delete&&Iu(t);return{c(){B(e.$$.fragment),n=U(),s&&s.c(),r=Ie()},m(o,u){H(e,o,u),w(o,n,u),s&&s.m(o,u),w(o,r,u),i=!0},p(o,[u]){const l={};u&256&&(l.$$scope={dirty:u,ctx:o}),e.$set(l),o[0]===o[1].Delete?s?(s.p(o,u),u&1&&b(s,1)):(s=Iu(o),s.c(),b(s,1),s.m(r.parentNode,r)):s&&(ke(),k(s,1,1,()=>{s=null}),Ce())},i(o){i||(b(e.$$.fragment,o),b(s),i=!0)},o(o){k(e.$$.fragment,o),k(s),i=!1},d(o){o&&(E(n),E(r)),V(e,o),s&&s.d(o)}}}function k0(t,e,n){var r=(c=>(c[c.Nothing=1]="Nothing",c[c.Rename=2]="Rename",c[c.Move=3]="Move",c[c.Copy=4]="Copy",c[c.Delete=5]="Delete",c))(r||{});let i=1;return[i,r,()=>{Xe.set(Fe.FOLDER_CREATE)},()=>{Xe.set(Fe.FILE_CREATE)},()=>{Xe.set(Fe.FILE_UPLOAD)},()=>{Xe.set(Fe.FOLDER_RENAME)},()=>{Xe.set(Fe.FOLDER_DELETE)},()=>{console.log("Resetting action"),n(0,i=r.Nothing)}]}class C0 extends be{constructor(e){super(),ge(this,e,k0,v0,fe,{})}}function Nu(t){let e,n;return e=new fs({props:{$$slots:{default:[A0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&66&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function E0(t){var r;let e=((r=t[1].data)==null?void 0:r.name)+"",n;return{c(){n=X(e)},m(i,s){w(i,n,s)},p(i,s){var o;s&2&&e!==(e=((o=i[1].data)==null?void 0:o.name)+"")&&Ge(n,e)},d(i){i&&E(n)}}}function w0(t){let e,n,r,i;return e=new Qe({props:{path:C_,class:"w-4 h-4"}}),{c(){B(e.$$.fragment),n=U(),r=S("span"),r.textContent="Logout"},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p:_e,i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function O0(t){let e,n;return e=new Ut({props:{$$slots:{default:[w0]},$$scope:{ctx:t}}}),e.$on("click",t[4]),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&64&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function A0(t){let e,n,r,i;return e=new cs({props:{$$slots:{default:[E0]},$$scope:{ctx:t}}}),r=new us({props:{$$slots:{default:[O0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&66&&(u.$$scope={dirty:o,ctx:s}),e.$set(u);const l={};o&64&&(l.$$scope={dirty:o,ctx:s}),r.$set(l)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function T0(t){let e,n,r=t[0].isSuccess&&t[0].data.auth.provider!=="no-auth"&&Nu(t);return{c(){r&&r.c(),e=Ie()},m(i,s){r&&r.m(i,s),w(i,e,s),n=!0},p(i,[s]){i[0].isSuccess&&i[0].data.auth.provider!=="no-auth"?r?(r.p(i,s),s&1&&b(r,1)):(r=Nu(i),r.c(),b(r,1),r.m(e.parentNode,e)):r&&(ke(),k(r,1,1,()=>{r=null}),Ce())},i(i){n||(b(r),n=!0)},o(i){k(r),n=!1},d(i){i&&E(e),r&&r.d(i)}}}function $0(t,e,n){let r,i;const s=Ao();x(t,s,a=>n(1,i=a));const o=ds();x(t,o,a=>n(0,r=a));const u=Ot();async function l(){(await window.fetch("/api/auth/login",{method:"DELETE"})).ok&&(u.cancelQueries(),u.invalidateQueries({queryKey:["auth"]}))}return[r,i,s,o,l]}class S0 extends be{constructor(e){super(),ge(this,e,$0,T0,fe,{})}}function Mu(t){let e,n,r,i;const s=[F0,R0],o=[];function u(l,a){return l[0].type==="file"?0:l[0].type==="folder"?1:-1}return~(e=u(t))&&(n=o[e]=s[e](t)),{c(){n&&n.c(),r=Ie()},m(l,a){~e&&o[e].m(l,a),w(l,r,a),i=!0},p(l,a){let f=e;e=u(l),e!==f&&(n&&(ke(),k(o[f],1,1,()=>{o[f]=null}),Ce()),~e?(n=o[e],n||(n=o[e]=s[e](l),n.c()),b(n,1),n.m(r.parentNode,r)):n=null)},i(l){i||(b(n),i=!0)},o(l){k(n),i=!1},d(l){l&&E(r),~e&&o[e].d(l)}}}function R0(t){let e,n;return e=new C0({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function F0(t){let e,n;return e=new c0({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function P0(t){let e,n,r,i,s,o,u;e=new r0({});let l=t[0]&&Mu(t);return o=new S0({}),{c(){B(e.$$.fragment),n=U(),l&&l.c(),r=U(),i=S("span"),s=U(),B(o.$$.fragment),M(i,"class","flex-1")},m(a,f){H(e,a,f),w(a,n,f),l&&l.m(a,f),w(a,r,f),w(a,i,f),w(a,s,f),H(o,a,f),u=!0},p(a,f){a[0]?l?(l.p(a,f),f&1&&b(l,1)):(l=Mu(a),l.c(),b(l,1),l.m(r.parentNode,r)):l&&(ke(),k(l,1,1,()=>{l=null}),Ce())},i(a){u||(b(e.$$.fragment,a),b(l),b(o.$$.fragment,a),u=!0)},o(a){k(e.$$.fragment,a),k(l),k(o.$$.fragment,a),u=!1},d(a){a&&(E(n),E(r),E(i),E(s)),V(e,a),l&&l.d(a),V(o,a)}}}function D0(t){let e,n;return e=new vh({props:{class:"border-b border-gray-300 px-2 pt-px",$$slots:{default:[P0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&3&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function L0(t,e,n){let r;return x(t,ct,i=>n(0,r=i)),[r]}class I0 extends be{constructor(e){super(),ge(this,e,L0,D0,fe,{})}}function N0(t){let e,n;return e=new Qe({props:{path:k_}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p:_e,i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function M0(t){let e,n;return e=new g_({props:{"aria-label":"Save",title:"Save","aria-disabled":t[0]!==null&&t[1]?null:"true",$$slots:{default:[N0]},$$scope:{ctx:t}}}),e.$on("click",t[3]),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&3&&(s["aria-disabled"]=r[0]!==null&&r[1]?null:"true"),i&128&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function H0(t){let e,n;return e=new f_({props:{class:"border-b border-gray-300",$$slots:{default:[M0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&131&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function V0(t,e,n){let r,i,s,o;x(t,ct,f=>n(4,r=f)),x(t,q_,f=>n(0,i=f)),x(t,ru,f=>n(1,o=f));const u=Ot(),l=Rt();x(t,l,f=>n(5,s=f));function a(){r!==null&&i!==null&&o1({action:"SaveCurrentFile",branch:s,filename:r.fullpath,data:i,callback(){ru.set(!1),(r.name==="uEdition.yml"||r.name==="uEdition.yaml"||r.name==="uEditor.yml"||r.name==="uEditor.yaml")&&u.invalidateQueries({queryKey:["configs"]})}})}return[i,o,l,a]}class B0 extends be{constructor(e){super(),ge(this,e,V0,H0,fe,{})}}function U0(t){let e;return{c(){e=S("div"),M(e,"class","flex-1")},m(n,r){w(n,e,r)},i:_e,o:_e,d(n){n&&E(e)}}}function K0(t){let e;return{c(){e=S("div"),e.innerHTML='<p class="px-4 py-2">Please select the branch you wish to work on from the File menu.</p>',M(e,"class","flex-1")},m(n,r){w(n,e,r)},i:_e,o:_e,d(n){n&&E(e)}}}function j0(t){let e,n,r,i,s;return n=new qb({}),i=new ob({}),{c(){e=S("div"),B(n.$$.fragment),r=U(),B(i.$$.fragment),M(e,"class","flex flex-row flex-1 overflow-hidden")},m(o,u){w(o,e,u),H(n,e,null),D(e,r),H(i,e,null),s=!0},i(o){s||(b(n.$$.fragment,o),b(i.$$.fragment,o),s=!0)},o(o){k(n.$$.fragment,o),k(i.$$.fragment,o),s=!1},d(o){o&&E(e),V(n),V(i)}}}function Hu(t){let e=t[4].fullpath+"",n;return{c(){n=X(e)},m(r,i){w(r,n,i)},p(r,i){i&16&&e!==(e=r[4].fullpath+"")&&Ge(n,e)},d(r){r&&E(n)}}}function q0(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_,y,g,h,v,O,$;document.title=e=t[0],o=new I0({}),l=new B0({});const C=[j0,K0,U0],F=[];function R(I,L){return I[1]!==null&&I[3].isSuccess?0:I[1]===null?1:2}f=R(t),c=F[f]=C[f](t);let j=t[4]&&Hu(t);return h=new f1({}),O=new Zg({}),{c(){n=S("link"),i=U(),s=S("main"),B(o.$$.fragment),u=U(),B(l.$$.fragment),a=U(),c.c(),d=U(),m=S("footer"),p=S("div"),j&&j.c(),_=U(),y=S("div"),g=U(),B(h.$$.fragment),v=U(),B(O.$$.fragment),M(n,"rel","stylesheet"),M(n,"href",r="/api/branches/"+(t[1]!==null?t[1].id:"-")+"/configs/ui-stylesheet?timestamp="+t[2]),M(p,"class","font-mono font-bold"),M(y,"class","flex-1"),M(m,"class","flex flex-row px-2 py-1 border-t border-slate-300 text-sm"),M(s,"class","flex flex-col w-screen h-screen overflow-hidden")},m(I,L){D(document.head,n),w(I,i,L),w(I,s,L),H(o,s,null),D(s,u),H(l,s,null),D(s,a),F[f].m(s,null),D(s,d),D(s,m),D(m,p),j&&j.m(p,null),D(m,_),D(m,y),D(m,g),H(h,m,null),w(I,v,L),H(O,I,L),$=!0},p(I,[L]){(!$||L&1)&&e!==(e=I[0])&&(document.title=e),(!$||L&6&&r!==(r="/api/branches/"+(I[1]!==null?I[1].id:"-")+"/configs/ui-stylesheet?timestamp="+I[2]))&&M(n,"href",r);let N=f;f=R(I),f!==N&&(ke(),k(F[N],1,1,()=>{F[N]=null}),Ce(),c=F[f],c||(c=F[f]=C[f](I),c.c()),b(c,1),c.m(s,d)),I[4]?j?j.p(I,L):(j=Hu(I),j.c(),j.m(p,null)):j&&(j.d(1),j=null)},i(I){$||(b(o.$$.fragment,I),b(l.$$.fragment,I),b(c),b(h.$$.fragment,I),b(O.$$.fragment,I),$=!0)},o(I){k(o.$$.fragment,I),k(l.$$.fragment,I),k(c),k(h.$$.fragment,I),k(O.$$.fragment,I),$=!1},d(I){I&&(E(i),E(s),E(v)),E(n),V(o),V(l),F[f].d(),j&&j.d(),V(h),V(O,I)}}}function W0(t,e,n){let r,i,s,o,u;x(t,ct,m=>n(4,u=m));const l=at("uEditionConfig"),a=at("uEditorConfig");x(t,a,m=>n(3,o=m));const f=at("currentBranch");x(t,f,m=>n(1,i=m));const c=Ue(l,m=>m.isSuccess&&m.data.languages&&m.data.languages.length>0&&m.data.languages[0].code&&m.data.title&&m.data.title[m.data.languages[0].code]?"μEditor - "+m.data.title[m.data.languages[0].code]:"μEditor");x(t,c,m=>n(0,r=m));const d=Ue(l,m=>new Date().getTime());return x(t,d,m=>n(2,s=m)),[r,i,s,o,u,a,f,c,d]}class Q0 extends be{constructor(e){super(),ge(this,e,W0,q0,fe,{})}}function Ro(t,{delay:e=0,duration:n=400,easing:r=xi}={}){const i=+getComputedStyle(t).opacity;return{delay:e,duration:n,easing:r,css:s=>`opacity: ${s*i}`}}function Vu(t){let e;const n=t[2].default,r=ce(n,t,t[3],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,s){r&&r.p&&(!e||s&8)&&me(r,n,i,i[3],e?de(n,i[3],s,null):pe(i[3]),null)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function z0(t){let e;return{c(){e=X("μEditor not ready")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function G0(t){let e,n,r,i;return e=new St({props:{$$slots:{default:[z0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("div"),r.innerHTML=`<p>Unfortunately the μEditor server is not ready. Please check the server
16
- logs to determine what the issue is.</p>`,M(r,"data-dialog-content-area","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p(s,o){const u={};o&8&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function Y0(t){let e,n,r,i;return e=new yi({props:{transition:Ro}}),r=new bi({props:{"data-dialog-role":"error",class:"flex flex-col overflow-hidden",$$slots:{default:[G0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&8&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function Z0(t){let e,n,r,i;return e=new vi({props:{class:"hidden"}}),r=new gi({props:{$$slots:{default:[Y0]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&8&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function X0(t){let e,n,r,i=t[0].isSuccess&&Vu(t);return n=new si({props:{open:t[0].isSuccess&&!t[0].data.ready,closeOnEscape:!1,closeOnOutsideClick:!1,$$slots:{default:[Z0]},$$scope:{ctx:t}}}),{c(){i&&i.c(),e=U(),B(n.$$.fragment)},m(s,o){i&&i.m(s,o),w(s,e,o),H(n,s,o),r=!0},p(s,[o]){s[0].isSuccess?i?(i.p(s,o),o&1&&b(i,1)):(i=Vu(s),i.c(),b(i,1),i.m(e.parentNode,e)):i&&(ke(),k(i,1,1,()=>{i=null}),Ce());const u={};o&1&&(u.open=s[0].isSuccess&&!s[0].data.ready),o&8&&(u.$$scope={dirty:o,ctx:s}),n.$set(u)},i(s){r||(b(i),b(n.$$.fragment,s),r=!0)},o(s){k(i),k(n.$$.fragment,s),r=!1},d(s){s&&E(e),i&&i.d(s),V(n,s)}}}function J0(t,e,n){let r,{$$slots:i={},$$scope:s}=e;const o=Tn({queryKey:[""],queryFn:Jt,refetchInterval:6e4});return x(t,o,u=>n(0,r=u)),bt("apiStatus",o),t.$$set=u=>{"$$scope"in u&&n(3,s=u.$$scope)},[r,o,i,s]}class x0 extends be{constructor(e){super(),ge(this,e,J0,X0,fe,{})}}function e2(t){let e;return{c(){e=X("Authenticating")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function t2(t){let e,n,r,i;return e=new St({props:{$$slots:{default:[e2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),r=S("div"),r.innerHTML="<p>You are being authenticated. Please wait.</p>",M(r,"data-dialog-content-area","")},m(s,o){H(e,s,o),w(s,n,o),w(s,r,o),i=!0},p(s,o){const u={};o&4096&&(u.$$scope={dirty:o,ctx:s}),e.$set(u)},i(s){i||(b(e.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),i=!1},d(s){s&&(E(n),E(r)),V(e,s)}}}function n2(t){let e,n,r,i;return e=new yi({props:{transition:Ro,class:"z-40"}}),r=new bi({props:{class:"flex flex-col overflow-hidden z-50",$$slots:{default:[t2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4096&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function r2(t){let e,n,r,i;return e=new vi({props:{class:"hidden"}}),r=new gi({props:{$$slots:{default:[n2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4096&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function i2(t){let e;return{c(){e=X("Login")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function s2(t){let e;return{c(){e=S("div"),e.innerHTML='<p>Click on the link below to log in via GitHub.</p> <div class="my-8 text-center"><a href="/api/auth/oidc/login" data-button="">Log in via GitHub</a></div>',M(e,"data-dialog-content-area","")},m(n,r){w(n,e,r)},p:_e,d(n){n&&E(e)}}}function o2(t){let e,n,r,i,s,o,u,l,a,f,c,d,m,p,_,y,g=t[4].isError&&Bu(),h=t[4].isError&&Uu();function v(C,F){return C[4].isPending?u2:l2}let O=v(t),$=O(t);return{c(){e=S("form"),n=S("label"),r=S("span"),r.textContent="E-Mail",i=U(),s=S("input"),o=U(),g&&g.c(),u=U(),l=S("label"),a=S("span"),a.textContent="Password",f=U(),c=S("input"),d=U(),h&&h.c(),m=U(),p=S("div"),$.c(),M(r,"data-form-field-label",""),M(s,"type","text"),M(s,"data-form-field-text",""),M(a,"data-form-field-label",""),M(c,"type","password"),M(c,"data-form-field-text",""),M(p,"data-dialog-buttons",""),M(e,"data-dialog-content-area","")},m(C,F){w(C,e,F),D(e,n),D(n,r),D(n,i),D(n,s),it(s,t[0]),D(n,o),g&&g.m(n,null),D(e,u),D(e,l),D(l,a),D(l,f),D(l,c),it(c,t[1]),D(l,d),h&&h.m(l,null),D(e,m),D(e,p),$.m(p,null),_||(y=[G(s,"input",t[9]),G(c,"input",t[10]),G(e,"submit",t[11])],_=!0)},p(C,F){F&1&&s.value!==C[0]&&it(s,C[0]),C[4].isError?g||(g=Bu(),g.c(),g.m(n,null)):g&&(g.d(1),g=null),F&2&&c.value!==C[1]&&it(c,C[1]),C[4].isError?h||(h=Uu(),h.c(),h.m(l,null)):h&&(h.d(1),h=null),O!==(O=v(C))&&($.d(1),$=O(C),$&&($.c(),$.m(p,null)))},d(C){C&&E(e),g&&g.d(),h&&h.d(),$.d(),_=!1,Ae(y)}}}function Bu(t){let e;return{c(){e=S("span"),e.textContent="Incorred e-mail address or password",M(e,"data-form-field-error","")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function Uu(t){let e;return{c(){e=S("span"),e.textContent="Incorred e-mail address or password",M(e,"data-form-field-error","")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function l2(t){let e;return{c(){e=S("button"),e.textContent="Login",M(e,"type","submit"),M(e,"data-button","")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function u2(t){let e;return{c(){e=S("span"),e.textContent="Logging in...",M(e,"data-button",""),M(e,"class","inline-flex")},m(n,r){w(n,e,r)},d(n){n&&E(e)}}}function a2(t){let e,n,r,i;e=new St({props:{$$slots:{default:[i2]},$$scope:{ctx:t}}});function s(l,a){var f,c;if(((f=l[3].data)==null?void 0:f.auth.provider)==="email-password")return o2;if(((c=l[3].data)==null?void 0:c.auth.provider)==="github")return s2}let o=s(t),u=o&&o(t);return{c(){B(e.$$.fragment),n=U(),u&&u.c(),r=Ie()},m(l,a){H(e,l,a),w(l,n,a),u&&u.m(l,a),w(l,r,a),i=!0},p(l,a){const f={};a&4096&&(f.$$scope={dirty:a,ctx:l}),e.$set(f),o===(o=s(l))&&u?u.p(l,a):(u&&u.d(1),u=o&&o(l),u&&(u.c(),u.m(r.parentNode,r)))},i(l){i||(b(e.$$.fragment,l),i=!0)},o(l){k(e.$$.fragment,l),i=!1},d(l){l&&(E(n),E(r)),V(e,l),u&&u.d(l)}}}function f2(t){let e,n,r,i;return e=new yi({props:{transition:Ro,class:"z-40"}}),r=new bi({props:{class:"flex flex-col overflow-hidden z-50",$$slots:{default:[a2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4123&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function c2(t){let e,n,r,i;return e=new vi({props:{class:"hidden"}}),r=new gi({props:{$$slots:{default:[f2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment),n=U(),B(r.$$.fragment)},m(s,o){H(e,s,o),w(s,n,o),H(r,s,o),i=!0},p(s,o){const u={};o&4123&&(u.$$scope={dirty:o,ctx:s}),r.$set(u)},i(s){i||(b(e.$$.fragment,s),b(r.$$.fragment,s),i=!0)},o(s){k(e.$$.fragment,s),k(r.$$.fragment,s),i=!1},d(s){s&&E(n),V(e,s),V(r,s)}}}function d2(t){let e,n,r,i,s;const o=t[8].default,u=ce(o,t,t[12],null);return n=new si({props:{open:t[2]==="pending",closeOnEscape:!1,closeOnOutsideClick:!1,$$slots:{default:[r2]},$$scope:{ctx:t}}}),i=new si({props:{open:t[2]==="error",closeOnEscape:!1,closeOnOutsideClick:!1,$$slots:{default:[c2]},$$scope:{ctx:t}}}),{c(){u&&u.c(),e=U(),B(n.$$.fragment),r=U(),B(i.$$.fragment)},m(l,a){u&&u.m(l,a),w(l,e,a),H(n,l,a),w(l,r,a),H(i,l,a),s=!0},p(l,[a]){u&&u.p&&(!s||a&4096)&&me(u,o,l,l[12],s?de(o,l[12],a,null):pe(l[12]),null);const f={};a&4&&(f.open=l[2]==="pending"),a&4096&&(f.$$scope={dirty:a,ctx:l}),n.$set(f);const c={};a&4&&(c.open=l[2]==="error"),a&4123&&(c.$$scope={dirty:a,ctx:l}),i.$set(c)},i(l){s||(b(u,l),b(n.$$.fragment,l),b(i.$$.fragment,l),s=!0)},o(l){k(u,l),k(n.$$.fragment,l),k(i.$$.fragment,l),s=!1},d(l){l&&(E(e),E(r)),u&&u.d(l),V(n,l),V(i,l)}}}function m2(t,e,n){let r,i,s,{$$slots:o={},$$scope:u}=e;const l=Ot(),a=ds();x(t,a,h=>n(3,i=h));const f=Tn({queryKey:["auth","user"],queryFn:Jt,retry:!1,refetchInterval:2e4});bt("currentUser",f);const c=Ue([a,f],([h,v])=>h.isSuccess?v.isSuccess?"authenticated":v.isError?h.data.auth.provider==="no-auth"||h.data.auth.provider==="email"?(window.fetch("/api/auth/login",{method:"POST"}).then(O=>{O.ok&&l.invalidateQueries({queryKey:["auth"]})}),"authenticating"):"error":v.status:h.status);x(t,c,h=>n(2,r=h));let d="",m="";const p=ns({mutationFn:async([h,v])=>{if((await window.fetch("/api/auth/login",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({email:h,password:v})})).ok)l.invalidateQueries({queryKey:["auth"]}),l.invalidateQueries({queryKey:["branches"]}),n(0,d=""),n(1,m="");else throw"Authentication failed"}});x(t,p,h=>n(4,s=h));function _(){d=this.value,n(0,d)}function y(){m=this.value,n(1,m)}const g=h=>{h.preventDefault(),s.isPending||s.mutate([d,m])};return t.$$set=h=>{"$$scope"in h&&n(12,u=h.$$scope)},[d,m,r,i,s,a,c,p,o,_,y,g,u]}class p2 extends be{constructor(e){super(),ge(this,e,m2,d2,fe,{})}}function h2(t){let e;const n=t[1].default,r=ce(n,t,t[0],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&1)&&me(r,n,i,i[0],e?de(n,i[0],s,null):pe(i[0]),null)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function _2(t,e,n){let{$$slots:r={},$$scope:i}=e;const s=tf("branch"),o=ds(),u=Ao(),l=Ue([o,u],([h,v])=>({queryKey:["branches"],queryFn:Jt,refetchInterval:6e4,enabled:h.isSuccess&&h.data.ready&&v.isSuccess})),a=Tn(l);bt("branches",a);const f=Ue([o,u],([h,v])=>({queryKey:["branches","?category=remote"],queryFn:Jt,refetchInterval:6e4,enabled:h.isSuccess&&h.data.ready&&h.data.git.enabled&&v.isSuccess})),c=Tn(f);bt("remoteBranches",c);const d=Re(null);bt("currentBranch",d);const m=Ue([o,u],([h,v])=>({queryKey:[":internal:","branches"],queryFn:async()=>{if((await window.fetch("/api/branches",{method:"PATCH"})).ok)return!0;throw new Error("Could not fetch data")},refetchInterval:6e4,enabled:h.isSuccess&&h.data.ready&&h.data.git.enabled&&v.isSuccess})),p=Tn(m);bt("syncBranches",p);const _=o.subscribe(h=>{h.isSuccess&&h.data.ready&&!h.data.git.enabled&&d.set({id:"-",nogit:!0,title:"All files"})}),y=d.subscribe(h=>{h!==null?ef("branch",h.id):j_("branch")}),g=a.subscribe(h=>{if(h.isSuccess){for(let v of h.data)v.id===s&&d.set(v);g()}});return ts(()=>{y(),_()}),t.$$set=h=>{"$$scope"in h&&n(0,i=h.$$scope)},[i,r]}class g2 extends be{constructor(e){super(),ge(this,e,_2,h2,fe,{})}}function b2(t){let e;const n=t[1].default,r=ce(n,t,t[0],null);return{c(){r&&r.c()},m(i,s){r&&r.m(i,s),e=!0},p(i,[s]){r&&r.p&&(!e||s&1)&&me(r,n,i,i[0],e?de(n,i[0],s,null):pe(i[0]),null)},i(i){e||(b(r,i),e=!0)},o(i){k(r,i),e=!1},d(i){r&&r.d(i)}}}function y2(t,e,n){let{$$slots:r={},$$scope:i}=e;const s=Rt(),o=Ue(s,f=>f!==null?{queryKey:["branches",f.id,"configs","uedition"],queryFn:Jt}:{queryKey:["branches","-","configs","uedition"],queryFn:Jt,enabled:f!==null}),u=Tn(o);bt("uEditionConfig",u);const l=Ue(s,f=>f!==null?{queryKey:["branches",f.id,"configs","ueditor"],queryFn:Jt}:{queryKey:["branches","-","configs","ueditor"],queryFn:Jt,enabled:!1}),a=Tn(l);return bt("uEditorConfig",a),t.$$set=f=>{"$$scope"in f&&n(0,i=f.$$scope)},[i,r]}class v2 extends be{constructor(e){super(),ge(this,e,y2,b2,fe,{})}}function k2(t){let e,n;return e=new Q0({}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function C2(t){let e,n;return e=new v2({props:{$$slots:{default:[k2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function E2(t){let e,n;return e=new g2({props:{$$slots:{default:[C2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function w2(t){let e,n;return e=new p2({props:{$$slots:{default:[E2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function O2(t){let e,n;return e=new x0({props:{$$slots:{default:[w2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,i){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function A2(t){let e,n;return e=new nc({props:{client:t[0],$$slots:{default:[O2]},$$scope:{ctx:t}}}),{c(){B(e.$$.fragment)},m(r,i){H(e,r,i),n=!0},p(r,[i]){const s={};i&2&&(s.$$scope={dirty:i,ctx:r}),e.$set(s)},i(r){n||(b(e.$$.fragment,r),n=!0)},o(r){k(e.$$.fragment,r),n=!1},d(r){V(e,r)}}}function T2(t){return[new _a]}class $2 extends be{constructor(e){super(),ge(this,e,T2,A2,fe,{})}}new $2({target:document.getElementById("app")});export{Ue as $,S_ as A,D_ as B,Xe as C,Fe as D,ve as E,Ie as F,_e as G,Of as H,Qe as I,q_ as J,Ot as K,Rt as L,o1 as M,ru as N,Qt as O,Wt as P,Mb as Q,J as R,be as S,M2 as T,di as U,V2 as V,Pe as W,ye as X,Ze as Y,Re as Z,fr as _,O_ as a,gm as a$,Dt as a0,Rr as a1,Xn as a2,xr as a3,Oc as a4,qi as a5,ar as a6,sc as a7,K2 as a8,Gr as a9,We as aA,N2 as aB,gt as aC,U2 as aD,j2 as aE,ii as aF,pi as aG,bt as aH,hi as aI,at as aJ,Ya as aK,ce as aL,me as aM,pe as aN,de as aO,Ke as aP,Ln as aQ,ne as aR,vt as aS,Oe as aT,ie as aU,Ve as aV,Ne as aW,Dn as aX,ft as aY,Pn as aZ,$n as a_,rt as aa,ae as ab,B2 as ac,Kt as ad,rc as ae,Gs as af,ln as ag,P2 as ah,D2 as ai,I2 as aj,L2 as ak,ni as al,Pt as am,xe as an,Ji as ao,Ar as ap,$r as aq,fc as ar,q2 as as,qo as at,Jr as au,pt as av,zs as aw,gn as ax,ho as ay,H2 as az,$_ as b,en as b0,fi as b1,z2 as b2,Q2 as b3,kb as b4,f_ as b5,g_ as b6,Y2 as b7,G2 as b8,Z2 as b9,W2 as ba,X2 as bb,Lo as bc,it as bd,si as be,vi as bf,gi as bg,yi as bh,bi,St as bj,Mt as bk,R2 as bl,U as c,B as d,S as e,M as f,w as g,D as h,ge as i,H as j,Ge as k,G as l,P_ as m,b as n,ke as o,k as p,Ce as q,E as r,fe as s,X as t,V as u,Ae as v,x as w,ct as x,es as y,ts as z};