var Il=Object.defineProperty;var kl=Object.getPrototypeOf;var Rl=Reflect.get;var Ea=n=>{throw TypeError(n)};var Fl=(n,t,e)=>t in n?Il(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var E=(n,t,e)=>Fl(n,typeof t!="symbol"?t+"":t,e),ei=(n,t,e)=>t.has(n)||Ea("Cannot "+e);var c=(n,t,e)=>(ei(n,t,"read from private field"),e?e.call(n):t.get(n)),y=(n,t,e)=>t.has(n)?Ea("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),z=(n,t,e,r)=>(ei(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),rt=(n,t,e)=>(ei(n,t,"access private method"),e);var Ia=(n,t,e)=>Rl(kl(n),e,t);import"./Bzak7iHL.js";import{h as Kn,i as hc,j as Nl,k as fc,g as u,R as Dl,H as Ml,o as ka,m as Ra,p as ni,N as Js,aw as Ll,aT as Bl,v as Fa,G as Ul,M as ci,bi as Wl,P as jl,ad as ql,b2 as Kl,aS as zi,bj as zl,z as li,bk as Vl,bl as Hl,A as Gl,L as Na,bm as an,I as gc,K as pc,bn as ri,bo as Yl,aQ as Xl,J as Jl,ax as Zl,D as G,c as W,F as st,r as j,a as v,E as Y,f as K,b0 as X,a5 as Ar,a6 as C,bp as Da,aA as yr,aZ as Ql,aY as Ma,a_ as $l,aj as tu,ak as Wt,a0 as eu,u as O,aW as nu,bh as fn,b as L,d as T,aX as ru,bq as vc,s as F,br as su,bs as ou,n as V,t as Q,ao as St,_ as iu,ay as au}from"./MIlO0V30.js";import{c as mc,m as cu,u as lu,o as uu,s as Tt}from"./BMmwim-G.js";import{B as du,i as bt}from"./D6Mj8HfB.js";import{c as U,_ as hu}from"./DPCugUAM.js";import{e as fu,h as gu,B as wr}from"./D1I5yNUo.js";import{i as pu,B as vu,c as bc,d as k,f as mu,t as bu,g as yu,h as wu,j as Go,k as ge,l as ar,m as Vi,n as yc,o as gn,p as jt,q as zn,r as wc,s as Ue,u as xu,v as Su,w as _u,L as we,I as qn,a as xc,e as Sc,b as Pu,C as Cu}from"./BOCLbrhU.js";import{a as Rt,c as oe,s as H,r as no,d as Tr,e as La,f as _c,g as Zs}from"./De4R2cbq.js";import{p as w,b as pn,r as ot,s as _t}from"./znVx7SEM.js";import{B as ro}from"./CINS0kDe.js";import{o as Dt}from"./Dt2zEVER.js";const Ou=Symbol("NaN");function Au(n,t,e){Kn&&hc();var r=new du(n),s=!Nl();fc(()=>{var o=t();o!==o&&(o=Ou),s&&o!==null&&typeof o=="object"&&(o={}),r.ensure(o,e)})}function Pn(n,t){return t}function Tu(n,t,e){for(var r=[],s=t.length,o,i=t.length,a=0;a{if(o){if(o.pending.delete(h),o.done.add(h),o.pending.size===0){var g=n.outrogroups;ui(zi(o.done)),g.delete(o),g.size===0&&(n.outrogroups=null)}}else i-=1},!1)}if(i===0){var l=r.length===0&&e!==null;if(l){var d=e,f=d.parentNode;Xl(f),f.append(d),n.items.clear()}ui(t,!l)}else o={pending:new Set(t),done:new Set},(n.outrogroups??(n.outrogroups=new Set)).add(o)}function ui(n,t=!0){for(var e=0;e{var b=e();return Kl(b)?b:b==null?[]:zi(b)}),f,h=!0;function g(){p.fallback=l,Eu(p,f,i,t,r),l!==null&&(f.length===0?(l.f&an)===0?gc(l):(l.f^=an,Cr(l,null,i)):pc(l,()=>{l=null}))}var m=fc(()=>{f=u(d);var b=f.length;let _=!1;if(Kn){var S=Dl(i)===Ml;S!==(b===0)&&(i=ka(),Ra(i),ni(!1),_=!0)}for(var A=new Set,R=Ul,x=jl(),q=0;qo(i)):(l=ci(()=>o(Ba??(Ba=Na()))),l.f|=an)),b>A.size&&Wl(),Kn&&b>0&&Ra(ka()),!h)if(x){for(const[tt,Z]of a)A.has(tt)||R.skip_effect(Z.e);R.oncommit(g),R.ondiscard(()=>{})}else g();_&&ni(!0),u(d)}),p={effect:m,items:a,outrogroups:null,fallback:l};h=!1,Kn&&(i=Js)}function xr(n){for(;n!==null&&(n.f&Yl)===0;)n=n.next;return n}function Eu(n,t,e,r,s){var I;var o=t.length,i=n.items,a=xr(n.effect.first),l,d=null,f=[],h=[],g,m,p,b;for(b=0;b0){var N=null;Tu(n,q,N)}}}function Iu(n,t,e,r,s,o,i,a){var l=(i&Vl)!==0?(i&Hl)===0?Gl(e,!1,!1):li(e):null,d=(i&zl)!==0?li(s):null;return{v:l,i:d,e:ci(()=>(o(t,l??e,d??s,a),()=>{n.delete(r)}))}}function Cr(n,t,e){if(n.nodes)for(var r=n.nodes.start,s=n.nodes.end,o=t&&(t.f&an)===0?t.nodes.start:e;r!==null;){var i=Zl(r);if(o.before(r),r===s)return;r=i}}function Ze(n,t,e){t===null?n.effect.first=e:t.next=e,e===null?n.effect.last=t:e.prev=t}var ku=K('
');function Ru(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class","children"]);var s=ku(),o=W(s);Rt(o,a=>({"data-slot":"table",class:a,...r}),[()=>oe("w-full caption-bottom text-sm",t.class)]);var i=W(o);H(i,()=>t.children??st),j(o),pn(o,a=>e(a),()=>e()),j(s),v(n,s),Y()}var Fu=K("");function Nu(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class","children"]);var s=Fu();Rt(s,i=>({"data-slot":"table-body",class:i,...r}),[()=>oe("[&_tr:last-child]:border-0",t.class)]);var o=W(s);H(o,()=>t.children??st),j(s),pn(s,i=>e(i),()=>e()),v(n,s),Y()}var Du=K("");function zt(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class","children"]);var s=Du();Rt(s,i=>({"data-slot":"table-cell",class:i,...r}),[()=>oe("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",t.class)]);var o=W(s);H(o,()=>t.children??st),j(s),pn(s,i=>e(i),()=>e()),v(n,s),Y()}var Mu=K("");function Xt(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class","children"]);var s=Mu();Rt(s,i=>({"data-slot":"table-head",class:i,...r}),[()=>oe("text-foreground h-10 bg-clip-padding px-2 text-start align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pe-0",t.class)]);var o=W(s);H(o,()=>t.children??st),j(s),pn(s,i=>e(i),()=>e()),v(n,s),Y()}var Lu=K("");function Bu(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class","children"]);var s=Lu();Rt(s,i=>({"data-slot":"table-header",class:i,...r}),[()=>oe("[&_tr]:border-b",t.class)]);var o=W(s);H(o,()=>t.children??st),j(s),pn(s,i=>e(i),()=>e()),v(n,s),Y()}var Uu=K("");function si(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class","children"]);var s=Uu();Rt(s,i=>({"data-slot":"table-row",class:i,...r}),[()=>oe("hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t.class)]);var o=W(s);H(o,()=>t.children??st),j(s),pn(s,i=>e(i),()=>e()),v(n,s),Y()}function Ln(n){let t=X(Ar(n));return{[vu]:!0,[pu]:!0,get current(){return u(t)},set current(e){C(t,e,!0)}}}Ln.from=bc;Ln.with=k;Ln.flatten=mu;Ln.readonly=bu;Ln.isBox=yu;Ln.isWritableBox=wu;const Pc=typeof window<"u"?window:void 0;function Wu(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var xe,Se,Re,So,fe,Or,so;const ha=class ha extends Map{constructor(e){super();y(this,fe);y(this,xe,new Map);y(this,Se,X(0));y(this,Re,X(0));y(this,So,Da||-1);if(e){for(var[r,s]of e)super.set(r,s);c(this,Re).v=super.size}}has(e){var r=c(this,xe),s=r.get(e);if(s===void 0){var o=super.get(e);if(o!==void 0)s=rt(this,fe,Or).call(this,0),r.set(e,s);else return u(c(this,Se)),!1}return u(s),!0}forEach(e,r){rt(this,fe,so).call(this),super.forEach(e,r)}get(e){var r=c(this,xe),s=r.get(e);if(s===void 0){var o=super.get(e);if(o!==void 0)s=rt(this,fe,Or).call(this,0),r.set(e,s);else{u(c(this,Se));return}}return u(s),super.get(e)}set(e,r){var h;var s=c(this,xe),o=s.get(e),i=super.get(e),a=super.set(e,r),l=c(this,Se);if(o===void 0)o=rt(this,fe,Or).call(this,0),s.set(e,o),C(c(this,Re),super.size),yr(l);else if(i!==r){yr(o);var d=l.reactions===null?null:new Set(l.reactions),f=d===null||!((h=o.reactions)!=null&&h.every(g=>d.has(g)));f&&yr(l)}return a}delete(e){var r=c(this,xe),s=r.get(e),o=super.delete(e);return s!==void 0&&(r.delete(e),C(c(this,Re),super.size),C(s,-1),yr(c(this,Se))),o}clear(){if(super.size!==0){super.clear();var e=c(this,xe);C(c(this,Re),0);for(var r of e.values())C(r,-1);yr(c(this,Se)),e.clear()}}keys(){return u(c(this,Se)),super.keys()}values(){return rt(this,fe,so).call(this),super.values()}entries(){return rt(this,fe,so).call(this),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return u(c(this,Re)),super.size}};xe=new WeakMap,Se=new WeakMap,Re=new WeakMap,So=new WeakMap,fe=new WeakSet,Or=function(e){return Da===c(this,So)?X(e):li(e)},so=function(){u(c(this,Se));var e=c(this,xe);if(c(this,Re).v!==e.size){for(var r of Ia(ha.prototype,this,"keys").call(this))if(!e.has(r)){var s=rt(this,fe,Or).call(this,0);e.set(r,s)}}for([,s]of c(this,xe))u(s)};let di=ha;var Gn,Rr;class ju{constructor(t={}){y(this,Gn);y(this,Rr);const{window:e=Pc,document:r=e==null?void 0:e.document}=t;e!==void 0&&(z(this,Gn,r),z(this,Rr,mc(s=>{const o=Dt(e,"focusin",s),i=Dt(e,"focusout",s);return()=>{o(),i()}})))}get current(){var t;return(t=c(this,Rr))==null||t.call(this),c(this,Gn)?Wu(c(this,Gn)):null}}Gn=new WeakMap,Rr=new WeakMap;new ju;function qu(n){return typeof n=="function"}var Fr,Fe;class vn{constructor(t){y(this,Fr);y(this,Fe);z(this,Fr,t),z(this,Fe,Symbol(t))}get key(){return c(this,Fe)}exists(){return Ql(c(this,Fe))}get(){const t=Ma(c(this,Fe));if(t===void 0)throw new Error(`Context "${c(this,Fr)}" not found`);return t}getOr(t){const e=Ma(c(this,Fe));return e===void 0?t:e}set(t){return $l(c(this,Fe),t)}}Fr=new WeakMap,Fe=new WeakMap;function Ku(n,t){switch(n){case"post":Wt(t);break;case"pre":tu(t);break}}function Cc(n,t,e,r={}){const{lazy:s=!1}=r;let o=!s,i=Array.isArray(n)?[]:void 0;Ku(t,()=>{const a=Array.isArray(n)?n.map(d=>d()):n();if(!o){o=!0,i=a;return}const l=eu(()=>e(a,i));return i=a,l})}function qt(n,t,e){Cc(n,"post",t,e)}function zu(n,t,e){Cc(n,"pre",t,e)}qt.pre=zu;function Ua(n){return qu(n)?n():n}var $e,Yn,Xn,Jn,tn,_o,Po,Zn;class Vu{constructor(t,e={box:"border-box"}){y(this,$e,{width:0,height:0});y(this,Yn,!1);y(this,Xn);y(this,Jn);y(this,tn);y(this,_o,O(()=>{var t;return(t=u(c(this,Zn)))==null||t(),this.getSize().width}));y(this,Po,O(()=>{var t;return(t=u(c(this,Zn)))==null||t(),this.getSize().height}));y(this,Zn,O(()=>{const t=Ua(c(this,Jn));if(t)return mc(e=>{if(!c(this,tn))return;const r=new(c(this,tn)).ResizeObserver(s=>{z(this,Yn,!0);for(const o of s){const i=c(this,Xn).box==="content-box"?o.contentBoxSize:o.borderBoxSize,a=Array.isArray(i)?i:[i];c(this,$e).width=a.reduce((l,d)=>Math.max(l,d.inlineSize),0),c(this,$e).height=a.reduce((l,d)=>Math.max(l,d.blockSize),0)}e()});return r.observe(t),()=>{z(this,Yn,!1),r.disconnect()}})}));z(this,tn,e.window??Pc),z(this,Xn,e),z(this,Jn,t),z(this,$e,{width:0,height:0})}calculateSize(){const t=Ua(c(this,Jn));if(!t||!c(this,tn))return;const e=t.offsetWidth,r=t.offsetHeight;if(c(this,Xn).box==="border-box")return{width:e,height:r};const s=c(this,tn).getComputedStyle(t),o=parseFloat(s.paddingLeft)+parseFloat(s.paddingRight),i=parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),a=parseFloat(s.borderLeftWidth)+parseFloat(s.borderRightWidth),l=parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),d=e-o-a,f=r-i-l;return{width:d,height:f}}getSize(){return c(this,Yn)?c(this,$e):this.calculateSize()??c(this,$e)}get current(){var t;return(t=u(c(this,Zn)))==null||t(),this.getSize()}get width(){return u(c(this,_o))}get height(){return u(c(this,Po))}}$e=new WeakMap,Yn=new WeakMap,Xn=new WeakMap,Jn=new WeakMap,tn=new WeakMap,_o=new WeakMap,Po=new WeakMap,Zn=new WeakMap;function ur(n){Wt(()=>()=>{n()})}function Hu(n,t){return setTimeout(t,n)}function We(n){nu().then(n)}const Gu=1,Yu=9,Xu=11;function hi(n){return Go(n)&&n.nodeType===Gu&&typeof n.nodeName=="string"}function Oc(n){return Go(n)&&n.nodeType===Yu}function Ju(n){var t;return Go(n)&&((t=n.constructor)==null?void 0:t.name)==="VisualViewport"}function Zu(n){return Go(n)&&n.nodeType!==void 0}function Ac(n){return Zu(n)&&n.nodeType===Xu&&"host"in n}function Qu(n,t){var r;if(!n||!t||!hi(n)||!hi(t))return!1;const e=(r=t.getRootNode)==null?void 0:r.call(t);if(n===t||n.contains(t))return!0;if(e&&Ac(e)){let s=t;for(;s;){if(n===s)return!0;s=s.parentNode||s.host}}return!1}function Vs(n){return Oc(n)?n:Ju(n)?n.document:(n==null?void 0:n.ownerDocument)??document}function Hi(n){var t;return Ac(n)?Hi(n.host):Oc(n)?n.defaultView??window:hi(n)?((t=n.ownerDocument)==null?void 0:t.defaultView)??window:window}function $u(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Nr;class Gi{constructor(t){E(this,"element");y(this,Nr,O(()=>this.element.current?this.element.current.getRootNode()??document:document));E(this,"getDocument",()=>Vs(this.root));E(this,"getWindow",()=>this.getDocument().defaultView??window);E(this,"getActiveElement",()=>$u(this.root));E(this,"isActiveElement",t=>t===this.getActiveElement());E(this,"querySelector",t=>this.root?this.root.querySelector(t):null);E(this,"querySelectorAll",t=>this.root?this.root.querySelectorAll(t):[]);E(this,"setTimeout",(t,e)=>this.getWindow().setTimeout(t,e));E(this,"clearTimeout",t=>this.getWindow().clearTimeout(t));typeof t=="function"?this.element=k(t):this.element=t}get root(){return u(c(this,Nr))}set root(t){C(c(this,Nr),t)}getElementById(t){return this.root.getElementById(t)}}Nr=new WeakMap;const Ir="ArrowDown",Yi="ArrowLeft",Xi="ArrowRight",lo="ArrowUp",Tc="End",Ji="Enter",td="Escape",Ec="Home",ed="PageDown",nd="PageUp",Yo=" ",rd="Tab";function sd(n){return window.getComputedStyle(n).getPropertyValue("direction")}function od(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Yi:Xi,vertical:Ir}[t]}function id(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Xi:Yi,vertical:lo}[t]}function ad(n="ltr",t="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:od(n,t),prevKey:id(n,t)}}const Ic=typeof document<"u",Wa=cd();function cd(){var n,t;return Ic&&((n=window==null?void 0:window.navigator)==null?void 0:n.userAgent)&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||((t=window==null?void 0:window.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window==null?void 0:window.navigator.userAgent))}function qe(n){return n instanceof HTMLElement}function fi(n){return n instanceof Element}function kc(n){return n instanceof Element||n instanceof SVGElement}function ld(n){return n!==null}function ud(n){return n instanceof HTMLInputElement&&"select"in n}var Vt,Ne;class dd{constructor(t){y(this,Vt);y(this,Ne,Ln(null));z(this,Vt,t)}getCandidateNodes(){return c(this,Vt).rootNode.current?c(this,Vt).candidateSelector?Array.from(c(this,Vt).rootNode.current.querySelectorAll(c(this,Vt).candidateSelector)):c(this,Vt).candidateAttr?Array.from(c(this,Vt).rootNode.current.querySelectorAll(`[${c(this,Vt).candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){var e;const t=this.getCandidateNodes();t.length&&((e=t[0])==null||e.focus())}handleKeydown(t,e,r=!1){var p,b;const s=c(this,Vt).rootNode.current;if(!s||!t)return;const o=this.getCandidateNodes();if(!o.length)return;const i=o.indexOf(t),a=sd(s),{nextKey:l,prevKey:d}=ad(a,c(this,Vt).orientation.current),f=c(this,Vt).loop.current,h={[l]:i+1,[d]:i-1,[Ec]:0,[Tc]:o.length-1};if(r){const _=l===Ir?Xi:Ir,S=d===lo?Yi:lo;h[_]=i+1,h[S]=i-1}let g=h[e.key];if(g===void 0)return;e.preventDefault(),g<0&&f?g=o.length-1:g===o.length&&f&&(g=0);const m=o[g];if(m)return m.focus(),c(this,Ne).current=m.id,(b=(p=c(this,Vt)).onCandidateFocus)==null||b.call(p,m),m}getTabIndex(t){const e=this.getCandidateNodes(),r=c(this,Ne).current!==null;return t&&!r&&e[0]===t?(c(this,Ne).current=t.id,0):(t==null?void 0:t.id)===c(this,Ne).current?0:-1}setCurrentTabStopId(t){c(this,Ne).current=t}focusCurrentTabStop(){var r;const t=c(this,Ne).current;if(!t)return;const e=(r=c(this,Vt).rootNode.current)==null?void 0:r.querySelector(`#${t}`);!e||!qe(e)||e.focus()}}Vt=new WeakMap,Ne=new WeakMap;var Qn,Cn,je,gi,oo;class hd{constructor(t){y(this,je);y(this,Qn);y(this,Cn,null);z(this,Qn,t),ur(()=>rt(this,je,gi).call(this))}run(t){rt(this,je,gi).call(this);const e=c(this,Qn).ref.current;if(e){if(typeof e.getAnimations!="function"){rt(this,je,oo).call(this,t);return}z(this,Cn,window.requestAnimationFrame(()=>{const r=e.getAnimations();if(r.length===0){rt(this,je,oo).call(this,t);return}Promise.allSettled(r.map(s=>s.finished)).then(()=>{rt(this,je,oo).call(this,t)})}))}}}Qn=new WeakMap,Cn=new WeakMap,je=new WeakSet,gi=function(){c(this,Cn)&&(window.cancelAnimationFrame(c(this,Cn)),z(this,Cn,null))},oo=function(t){const e=()=>{t()};c(this,Qn).afterTick?We(e):e()};var _e,Dr,Mr,On;class pi{constructor(t){y(this,_e);y(this,Dr);y(this,Mr);y(this,On,X(!1));z(this,_e,t),C(c(this,On),t.open.current,!0),z(this,Dr,t.enabled??!0),z(this,Mr,new hd({ref:c(this,_e).ref,afterTick:c(this,_e).open})),qt(()=>c(this,_e).open.current,e=>{e&&C(c(this,On),!0),c(this,Dr)&&c(this,Mr).run(()=>{var r,s;e===c(this,_e).open.current&&(c(this,_e).open.current||C(c(this,On),!1),(s=(r=c(this,_e)).onComplete)==null||s.call(r))})})}get shouldRender(){return u(c(this,On))}}_e=new WeakMap,Dr=new WeakMap,Mr=new WeakMap,On=new WeakMap;function Pt(){}const fd=yc({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),Nn=new vn("Dialog.Root | AlertDialog.Root");var Lr,Br,Ur,Wr,jr,qr,Kr,zr,Vr,Hr,Gr;const fa=class fa{constructor(t,e){E(this,"opts");y(this,Lr,X(null));y(this,Br,X(null));y(this,Ur,X(null));y(this,Wr,X(null));y(this,jr,X(void 0));y(this,qr,X(void 0));y(this,Kr,X(void 0));y(this,zr,X(void 0));y(this,Vr,X(null));y(this,Hr,X(0));E(this,"depth");E(this,"parent");E(this,"contentPresence");E(this,"overlayPresence");E(this,"getBitsAttr",t=>fd.getAttr(t,this.opts.variant.current));y(this,Gr,O(()=>({"data-state":Vi(this.opts.open.current)})));this.opts=t,this.parent=e,this.depth=e?e.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new pi({ref:k(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new pi({ref:k(()=>this.overlayNode),open:this.opts.open,enabled:!0}),qt(()=>this.opts.open.current,r=>{this.parent&&(r?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),ur(()=>{var r;this.opts.open.current&&((r=this.parent)==null||r.decrementNested())})}static create(t){const e=Nn.getOr(null);return Nn.set(new fa(t,e))}get triggerNode(){return u(c(this,Lr))}set triggerNode(t){C(c(this,Lr),t,!0)}get contentNode(){return u(c(this,Br))}set contentNode(t){C(c(this,Br),t,!0)}get overlayNode(){return u(c(this,Ur))}set overlayNode(t){C(c(this,Ur),t,!0)}get descriptionNode(){return u(c(this,Wr))}set descriptionNode(t){C(c(this,Wr),t,!0)}get contentId(){return u(c(this,jr))}set contentId(t){C(c(this,jr),t,!0)}get titleId(){return u(c(this,qr))}set titleId(t){C(c(this,qr),t,!0)}get triggerId(){return u(c(this,Kr))}set triggerId(t){C(c(this,Kr),t,!0)}get descriptionId(){return u(c(this,zr))}set descriptionId(t){C(c(this,zr),t,!0)}get cancelNode(){return u(c(this,Vr))}set cancelNode(t){C(c(this,Vr),t,!0)}get nestedOpenCount(){return u(c(this,Hr))}set nestedOpenCount(t){C(c(this,Hr),t,!0)}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}incrementNested(){var t;this.nestedOpenCount++,(t=this.parent)==null||t.incrementNested()}decrementNested(){var t;this.nestedOpenCount!==0&&(this.nestedOpenCount--,(t=this.parent)==null||t.decrementNested())}get sharedProps(){return u(c(this,Gr))}set sharedProps(t){C(c(this,Gr),t)}};Lr=new WeakMap,Br=new WeakMap,Ur=new WeakMap,Wr=new WeakMap,jr=new WeakMap,qr=new WeakMap,Kr=new WeakMap,zr=new WeakMap,Vr=new WeakMap,Hr=new WeakMap,Gr=new WeakMap;let vi=fa;var Yr;const ga=class ga{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Yr,O(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:"",onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ge(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}static create(t){return new ga(t,Nn.get())}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===Yo||t.key===Ji)&&(t.preventDefault(),this.root.handleClose())}get props(){return u(c(this,Yr))}set props(t){C(c(this,Yr),t)}};Yr=new WeakMap;let mi=ga;var Xr;const pa=class pa{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Xr,O(()=>({id:this.opts.id.current,role:"heading","aria-level":this.opts.level.current,[this.root.getBitsAttr("title")]:"",...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.root.titleId=this.opts.id.current,this.attachment=ge(this.opts.ref),qt.pre(()=>this.opts.id.current,r=>{this.root.titleId=r})}static create(t){return new pa(t,Nn.get())}get props(){return u(c(this,Xr))}set props(t){C(c(this,Xr),t)}};Xr=new WeakMap;let bi=pa;var Jr;const va=class va{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Jr,O(()=>({id:this.opts.id.current,[this.root.getBitsAttr("description")]:"",...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.root.descriptionId=this.opts.id.current,this.attachment=ge(this.opts.ref,r=>{this.root.descriptionNode=r}),qt.pre(()=>this.opts.id.current,r=>{this.root.descriptionId=r})}static create(t){return new va(t,Nn.get())}get props(){return u(c(this,Jr))}set props(t){C(c(this,Jr),t)}};Jr=new WeakMap;let yi=va;var Zr,Qr;const ma=class ma{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Zr,O(()=>({open:this.root.opts.open.current})));y(this,Qr,O(()=>({id:this.opts.id.current,role:this.root.opts.variant.current==="alert-dialog"?"alertdialog":"dialog","aria-modal":"true","aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr("content")]:"",style:{pointerEvents:"auto",outline:this.root.opts.variant.current==="alert-dialog"?"none":void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:"layout style"},tabindex:this.root.opts.variant.current==="alert-dialog"?-1:void 0,"data-nested-open":ar(this.root.nestedOpenCount>0),"data-nested":ar(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ge(this.opts.ref,r=>{this.root.contentNode=r,this.root.contentId=r==null?void 0:r.id})}static create(t){return new ma(t,Nn.get())}get snippetProps(){return u(c(this,Zr))}set snippetProps(t){C(c(this,Zr),t)}get props(){return u(c(this,Qr))}set props(t){C(c(this,Qr),t)}get shouldRender(){return this.root.contentPresence.shouldRender}};Zr=new WeakMap,Qr=new WeakMap;let wi=ma;var $r,ts;const ba=class ba{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,$r,O(()=>({open:this.root.opts.open.current})));y(this,ts,O(()=>({id:this.opts.id.current,[this.root.getBitsAttr("overlay")]:"",style:{pointerEvents:"auto","--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":ar(this.root.nestedOpenCount>0),"data-nested":ar(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ge(this.opts.ref,r=>this.root.overlayNode=r)}static create(t){return new ba(t,Nn.get())}get snippetProps(){return u(c(this,$r))}set snippetProps(t){C(c(this,$r),t)}get props(){return u(c(this,ts))}set props(t){C(c(this,ts),t)}get shouldRender(){return this.root.overlayPresence.shouldRender}};$r=new WeakMap,ts=new WeakMap;let xi=ba;var gd=K("
");function pd(n,t){const e=fn();G(t,!0);let r=w(t,"id",19,()=>gn(e)),s=w(t,"ref",15,null),o=w(t,"level",3,2),i=ot(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const a=bi.create({id:k(()=>r()),level:k(()=>o()),ref:k(()=>s(),m=>s(m))}),l=O(()=>jt(i,a.props));var d=L(),f=T(d);{var h=m=>{var p=L(),b=T(p);H(b,()=>t.child,()=>({props:u(l)})),v(m,p)},g=m=>{var p=gd();Rt(p,()=>({...u(l)}));var b=W(p);H(b,()=>t.children??st),j(p),v(m,p)};bt(f,m=>{t.child?m(h):m(g,!1)})}v(n,d),Y()}function vd(n,t){var e=L(),r=T(e);Au(r,()=>t.children,s=>{var o=L(),i=T(o);H(i,()=>t.children??st),v(s,o)}),v(n,e)}const md=new vn("BitsConfig");function bd(){const n=new yd(null,{});return md.getOr(n).opts}class yd{constructor(t,e){E(this,"opts");const r=wd(t,e);this.opts={defaultPortalTo:r(s=>s.defaultPortalTo),defaultLocale:r(s=>s.defaultLocale)}}}function wd(n,t){return e=>k(()=>{var o,i;const s=(o=e(t))==null?void 0:o.current;if(s!==void 0)return s;if(n!==null)return(i=e(n.opts))==null?void 0:i.current})}function xd(n,t){return e=>{const r=bd();return k(()=>{const s=e();if(s!==void 0)return s;const o=n(r).current;return o!==void 0?o:t})}}const Sd=xd(n=>n.defaultPortalTo,"body");function Rc(n,t){G(t,!0);const e=Sd(()=>t.to),r=ru();let s=O(o);function o(){if(!Ic||t.disabled)return null;let h=null;return typeof e.current=="string"?h=document.querySelector(e.current):h=e.current,h}let i;function a(){i&&(lu(i),i=null)}qt([()=>u(s),()=>t.disabled],([h,g])=>{if(!h||g){a();return}return i=cu(vd,{target:h,props:{children:t.children},context:r}),()=>{a()}});var l=L(),d=T(l);{var f=h=>{var g=L(),m=T(g);H(m,()=>t.children??st),v(h,g)};bt(d,h=>{t.disabled&&h(f)})}v(n,l),Y()}class _d{constructor(t,e={bubbles:!0,cancelable:!0}){E(this,"eventName");E(this,"options");this.eventName=t,this.options=e}createEvent(t){return new CustomEvent(this.eventName,{...this.options,detail:t})}dispatch(t,e){const r=this.createEvent(e);return t.dispatchEvent(r),r}listen(t,e,r){const s=o=>{e(o)};return Dt(t,this.eventName,s,r)}}function ja(n,t=500){let e=null;const r=(...s)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{n(...s)},t)};return r.destroy=()=>{e!==null&&(clearTimeout(e),e=null)},r}function Fc(n,t){return n===t||n.contains(t)}function Nc(n){return(n==null?void 0:n.ownerDocument)??document}function Pd(n,t){const{clientX:e,clientY:r}=n,s=t.getBoundingClientRect();return es.right||rs.bottom}const Cd=[Ji,Yo],Od=[Ir,nd,Ec],Dc=[lo,ed,Tc],Ad=[...Od,...Dc];function qa(n){return n.pointerType==="mouse"}function Td(n,{select:t=!1}={}){if(!n||!n.focus)return;const e=Vs(n);if(e.activeElement===n)return;const r=e.activeElement;n.focus({preventScroll:!0}),n!==r&&ud(n)&&t&&n.select()}function Ed(n,{select:t=!1}={},e){const r=e();for(const s of n)if(Td(s,{select:t}),e()!==r)return!0}let Sr=X(!1);const ce=class ce{constructor(){Wt(()=>(ce._refs===0&&(ce._cleanup=vc(()=>{const t=[],e=s=>{C(Sr,!1)},r=s=>{C(Sr,!0)};return t.push(Dt(document,"pointerdown",e,{capture:!0}),Dt(document,"pointermove",e,{capture:!0}),Dt(document,"keydown",r,{capture:!0})),zn(...t)})),ce._refs++,()=>{var t;ce._refs--,ce._refs===0&&(C(Sr,!1),(t=ce._cleanup)==null||t.call(ce))}))}get current(){return u(Sr)}set current(t){C(Sr,t,!0)}};E(ce,"_refs",0),E(ce,"_cleanup");let Si=ce;/*! * tabbable 6.4.0 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var Mc=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],uo=Mc.join(","),Lc=typeof Element>"u",Dn=Lc?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ho=!Lc&&Element.prototype.getRootNode?function(n){var t;return n==null||(t=n.getRootNode)===null||t===void 0?void 0:t.call(n)}:function(n){return n==null?void 0:n.ownerDocument},fo=function(t,e){var r;e===void 0&&(e=!0);var s=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=s===""||s==="true",i=o||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):fo(t.parentNode));return i},Id=function(t){var e,r=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return r===""||r==="true"},Bc=function(t,e,r){if(fo(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(uo));return e&&Dn.call(t,uo)&&s.unshift(t),s=s.filter(r),s},go=function(t,e,r){for(var s=[],o=Array.from(t);o.length;){var i=o.shift();if(!fo(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),l=a.length?a:i.children,d=go(l,!0,r);r.flatten?s.push.apply(s,d):s.push({scopeParent:i,candidates:d})}else{var f=Dn.call(i,uo);f&&r.filter(i)&&(e||!t.includes(i))&&s.push(i);var h=i.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(i),g=!fo(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(h&&g){var m=go(h===!0?i.children:h.children,!0,r);r.flatten?s.push.apply(s,m):s.push({scopeParent:i,candidates:m})}else o.unshift.apply(o,i.children)}}return s},Uc=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Wc=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Id(t))&&!Uc(t)?0:t.tabIndex},kd=function(t,e){var r=Wc(t);return r<0&&e&&!Uc(t)?0:r},Rd=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},jc=function(t){return t.tagName==="INPUT"},Fd=function(t){return jc(t)&&t.type==="hidden"},Nd=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return e},Dd=function(t,e){for(var r=0;rsummary:first-of-type"),a=i?t.parentElement:t;if(Dn.call(a,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof s=="function"){for(var l=t;t;){var d=t.parentElement,f=ho(t);if(d&&!d.shadowRoot&&s(d)===!0)return Ka(t);t.assignedSlot?t=t.assignedSlot:!d&&f!==t.ownerDocument?t=f.host:t=d}t=l}if(Ud(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Ka(t);return!1},jd=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var e=t.parentElement;e;){if(e.tagName==="FIELDSET"&&e.disabled){for(var r=0;r=0)},qc=function(t){var e=[],r=[];return t.forEach(function(s,o){var i=!!s.scopeParent,a=i?s.scopeParent:s,l=kd(a,i),d=i?qc(s.candidates):a;l===0?i?e.push.apply(e,d):e.push(a):r.push({documentOrder:o,tabIndex:l,item:s,isScope:i,content:d})}),r.sort(Rd).reduce(function(s,o){return o.isScope?s.push.apply(s,o.content):s.push(o.content),s},[]).concat(e)},Kc=function(t,e){e=e||{};var r;return e.getShadowRoot?r=go([t],e.includeContainer,{filter:_i.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:qd}):r=Bc(t,e.includeContainer,_i.bind(null,e)),qc(r)},zc=function(t,e){e=e||{};var r;return e.getShadowRoot?r=go([t],e.includeContainer,{filter:po.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):r=Bc(t,e.includeContainer,po.bind(null,e)),r},Zi=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return Dn.call(t,uo)===!1?!1:_i(e,t)},Kd=Mc.concat("iframe:not([inert]):not([inert] *)").join(","),Vc=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return Dn.call(t,Kd)===!1?!1:po(e,t)};function Er(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function zd(n,t){if(!Zi(n,Er()))return Vd(n,t);const e=Vs(n),r=Kc(e.body,Er());t==="prev"&&r.reverse();const s=r.indexOf(n);return s===-1?e.body:r.slice(s+1)[0]}function Vd(n,t){const e=Vs(n);if(!Vc(n,Er()))return e.body;const r=zc(e.body,Er());t==="prev"&&r.reverse();const s=r.indexOf(n);return s===-1?e.body:r.slice(s+1).find(i=>Zi(i,Er()))??e.body}function Hc(n,t,e){const r=t.toLowerCase();if(r.endsWith(" ")){const h=r.slice(0,-1);if(n.filter(b=>b.toLowerCase().startsWith(h)).length<=1)return Hc(n,h,e);const m=e==null?void 0:e.toLowerCase();if(m&&m.startsWith(h)&&m.charAt(h.length)===" "&&t.trim()===h)return e;const p=n.filter(b=>b.toLowerCase().startsWith(r));if(p.length>0){const b=e?n.indexOf(e):-1;return za(p,Math.max(b,0)).find(A=>A!==e)||e}}const o=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,i=o.toLowerCase(),a=e?n.indexOf(e):-1;let l=za(n,Math.max(a,0));o.length===1&&(l=l.filter(h=>h!==e));const f=l.find(h=>h==null?void 0:h.toLowerCase().startsWith(i));return f!==e?f:void 0}function za(n,t){return n.map((e,r)=>n[(t+r)%n.length])}const Hd={afterMs:1e4,onChange:Pt};function Gc(n,t){const{afterMs:e,onChange:r,getWindow:s}={...Hd,...t};let o=null,i=X(Ar(n));function a(){return s().setTimeout(()=>{C(i,n,!0),r==null||r(n)},e)}return Wt(()=>()=>{o&&s().clearTimeout(o)}),k(()=>u(i),l=>{C(i,l,!0),r==null||r(l),o&&s().clearTimeout(o),o=a()})}var De,Me,Co,Oo;class Gd{constructor(t){y(this,De);y(this,Me);y(this,Co,O(()=>c(this,De).onMatch?c(this,De).onMatch:t=>t.focus()));y(this,Oo,O(()=>c(this,De).getCurrentItem?c(this,De).getCurrentItem:c(this,De).getActiveElement));z(this,De,t),z(this,Me,Gc("",{afterMs:1e3,getWindow:t.getWindow})),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,e){var l,d;if(!e.length)return;c(this,Me).current=c(this,Me).current+t;const r=u(c(this,Oo))(),s=((d=(l=e.find(f=>f===r))==null?void 0:l.textContent)==null?void 0:d.trim())??"",o=e.map(f=>{var h;return((h=f.textContent)==null?void 0:h.trim())??""}),i=Hc(o,c(this,Me).current,s),a=e.find(f=>{var h;return((h=f.textContent)==null?void 0:h.trim())===i});return a&&u(c(this,Co))(a),a}resetTypeahead(){c(this,Me).current=""}get search(){return c(this,Me).current}}De=new WeakMap,Me=new WeakMap,Co=new WeakMap,Oo=new WeakMap;var An,es,$n,en,hn,Pi,Ci;class Yd{constructor(t){y(this,hn);y(this,An);y(this,es);y(this,$n);y(this,en,X(null));z(this,An,t),z(this,es,O(()=>c(this,An).enabled())),z(this,$n,Gc(!1,{afterMs:t.transitTimeout??300,onChange:e=>{var r,s;u(c(this,es))&&((s=(r=c(this,An)).setIsPointerInTransit)==null||s.call(r,e))},getWindow:()=>Hi(c(this,An).triggerNode())})),qt([t.triggerNode,t.contentNode,t.enabled],([e,r,s])=>{if(!e||!r||!s)return;const o=a=>{rt(this,hn,Ci).call(this,a,r)},i=a=>{rt(this,hn,Ci).call(this,a,e)};return zn(Dt(e,"pointerleave",o),Dt(r,"pointerleave",i))}),qt(()=>u(c(this,en)),()=>{const e=s=>{var d,f;if(!u(c(this,en)))return;const o=s.target;if(!fi(o))return;const i={x:s.clientX,y:s.clientY},a=((d=t.triggerNode())==null?void 0:d.contains(o))||((f=t.contentNode())==null?void 0:f.contains(o)),l=!Qd(i,u(c(this,en)));a?rt(this,hn,Pi).call(this):l&&(rt(this,hn,Pi).call(this),t.onPointerExit())},r=Vs(t.triggerNode()??t.contentNode());if(r)return Dt(r,"pointermove",e)})}}An=new WeakMap,es=new WeakMap,$n=new WeakMap,en=new WeakMap,hn=new WeakSet,Pi=function(){C(c(this,en),null),c(this,$n).current=!1},Ci=function(t,e){const r=t.currentTarget;if(!qe(r))return;const s={x:t.clientX,y:t.clientY},o=Xd(s,r.getBoundingClientRect()),i=Jd(s,o),a=Zd(e.getBoundingClientRect()),l=$d([...i,...a]);C(c(this,en),l,!0),c(this,$n).current=!0};function Xd(n,t){const e=Math.abs(t.top-n.y),r=Math.abs(t.bottom-n.y),s=Math.abs(t.right-n.x),o=Math.abs(t.left-n.x);switch(Math.min(e,r,s,o)){case o:return"left";case s:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Jd(n,t,e=5){const r=e*1.5;switch(t){case"top":return[{x:n.x-e,y:n.y+e},{x:n.x,y:n.y-r},{x:n.x+e,y:n.y+e}];case"bottom":return[{x:n.x-e,y:n.y-e},{x:n.x,y:n.y+r},{x:n.x+e,y:n.y-e}];case"left":return[{x:n.x+e,y:n.y-e},{x:n.x-r,y:n.y},{x:n.x+e,y:n.y+e}];case"right":return[{x:n.x-e,y:n.y-e},{x:n.x+r,y:n.y},{x:n.x-e,y:n.y+e}]}}function Zd(n){const{top:t,right:e,bottom:r,left:s}=n;return[{x:s,y:t},{x:e,y:t},{x:e,y:r},{x:s,y:r}]}function Qd(n,t){const{x:e,y:r}=n;let s=!1;for(let o=0,i=t.length-1;or!=f>r&&e<(d-a)*(r-l)/(f-l)+a&&(s=!s)}return s}function $d(n){const t=n.slice();return t.sort((e,r)=>e.xr.x?1:e.yr.y?1:0),th(t)}function th(n){if(n.length<=1)return n.slice();const t=[];for(let r=0;r=2;){const o=t[t.length-1],i=t[t.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))t.pop();else break}t.push(s)}t.pop();const e=[];for(let r=n.length-1;r>=0;r--){const s=n[r];for(;e.length>=2;){const o=e[e.length-1],i=e[e.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))e.pop();else break}e.push(s)}return e.pop(),t.length===1&&e.length===1&&t[0].x===e[0].x&&t[0].y===e[0].y?t:t.concat(e)}const eh="data-context-menu-trigger",nh="data-context-menu-content",rh=new vn("Menu.Root"),Qi=new vn("Menu.Root | Menu.Sub"),Yc=new vn("Menu.Content"),sh=new _d("bitsmenuopen",{bubbles:!1,cancelable:!0}),oh=yc({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});var ns,rs;const ya=class ya{constructor(t){E(this,"opts");E(this,"isUsingKeyboard",new Si);y(this,ns,X(!1));y(this,rs,X(!1));E(this,"getBitsAttr",t=>oh.getAttr(t,this.opts.variant.current));this.opts=t}static create(t){const e=new ya(t);return rh.set(e)}get ignoreCloseAutoFocus(){return u(c(this,ns))}set ignoreCloseAutoFocus(t){C(c(this,ns),t,!0)}get isPointerInTransit(){return u(c(this,rs))}set isPointerInTransit(t){C(c(this,rs),t,!0)}};ns=new WeakMap,rs=new WeakMap;let Oi=ya;var ss,os;const wa=class wa{constructor(t,e,r){E(this,"opts");E(this,"root");E(this,"parentMenu");E(this,"contentId",k(()=>""));y(this,ss,X(null));E(this,"contentPresence");y(this,os,X(null));this.opts=t,this.root=e,this.parentMenu=r,this.contentPresence=new pi({ref:k(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&qt(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}static create(t,e){return Qi.set(new wa(t,e,null))}get contentNode(){return u(c(this,ss))}set contentNode(t){C(c(this,ss),t,!0)}get triggerNode(){return u(c(this,os))}set triggerNode(t){C(c(this,os),t,!0)}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}};ss=new WeakMap,os=new WeakMap;let Ai=wa;var is,as,cs,ls,us,ln,Xc,io,ds,hs;const xa=class xa{constructor(t,e){y(this,ln);E(this,"opts");E(this,"parentMenu");E(this,"rovingFocusGroup");E(this,"domContext");E(this,"attachment");y(this,is,X(""));y(this,as,0);y(this,cs);y(this,ls,X(!1));y(this,us);E(this,"onCloseAutoFocus",t=>{var e,r;(r=(e=this.opts.onCloseAutoFocus).current)==null||r.call(e,t),!(t.defaultPrevented||c(this,us))&&this.parentMenu.triggerNode&&Zi(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())});y(this,ds,O(()=>({open:this.parentMenu.opts.open.current})));y(this,hs,O(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Vi(this.parentMenu.opts.open.current),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:"auto",contain:"layout style"},...this.attachment})));E(this,"popperProps",{onCloseAutoFocus:t=>this.onCloseAutoFocus(t)});this.opts=t,this.parentMenu=e,this.domContext=new Gi(t.ref),this.attachment=ge(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),e.contentId=t.id,z(this,us,t.isSub??!1),this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new Yd({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,enabled:()=>{var r;return this.parentMenu.opts.open.current&&!!((r=this.parentMenu.triggerNode)!=null&&r.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger")))},onPointerExit:()=>{this.parentMenu.opts.open.current=!1},setIsPointerInTransit:r=>{this.parentMenu.root.isPointerInTransit=r}}),z(this,cs,new Gd({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch),this.rovingFocusGroup=new dd({rootNode:k(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:k(()=>"vertical")}),qt(()=>this.parentMenu.contentNode,r=>{if(!r)return;const s=()=>{We(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return sh.listen(r,s)}),Wt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(c(this,as))})}static create(t){return Yc.set(new xa(t,Qi.get()))}get search(){return u(c(this,is))}set search(t){C(c(this,is),t,!0)}get mounted(){return u(c(this,ls))}set mounted(t){C(c(this,ls),t,!0)}handleTabKeyDown(t){let e=this.parentMenu;for(;e.parentMenu!==null;)e=e.parentMenu;if(!e.triggerNode)return;t.preventDefault();const r=zd(e.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,e.onClose(),We(()=>{r.focus(),We(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){var d,f;if(t.defaultPrevented)return;if(t.key===rd){this.handleTabKeyDown(t);return}const e=t.target,r=t.currentTarget;if(!qe(e)||!qe(r))return;const s=((d=e.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`))==null?void 0:d.id)===this.parentMenu.contentId.current,o=t.ctrlKey||t.altKey||t.metaKey,i=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(e,t)||t.code==="Space")return;const l=rt(this,ln,Xc).call(this);s&&!o&&i&&c(this,cs).call(this,t.key,l),((f=t.target)==null?void 0:f.id)===this.parentMenu.contentId.current&&Ad.includes(t.key)&&(t.preventDefault(),Dc.includes(t.key)&&l.reverse(),Ed(l,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){var e,r;fi(t.currentTarget)&&fi(t.target)&&((r=(e=t.currentTarget).contains)!=null&&r.call(e,t.target)||(this.domContext.getWindow().clearTimeout(c(this,as)),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&We(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return rt(this,ln,io).call(this)}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||rt(this,ln,io).call(this)||this.parentMenu.root.isUsingKeyboard.current)return;const e=this.parentMenu.contentNode;e==null||e.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!rt(this,ln,io).call(this)}handleInteractOutside(t){var r;if(!kc(t.target))return;const e=(r=this.parentMenu.triggerNode)==null?void 0:r.id;if(t.target.id===e){t.preventDefault();return}t.target.closest(`#${e}`)&&t.preventDefault()}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}get snippetProps(){return u(c(this,ds))}set snippetProps(t){C(c(this,ds),t)}get props(){return u(c(this,hs))}set props(t){C(c(this,hs),t)}};is=new WeakMap,as=new WeakMap,cs=new WeakMap,ls=new WeakMap,us=new WeakMap,ln=new WeakSet,Xc=function(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]},io=function(){return this.parentMenu.root.isPointerInTransit},ds=new WeakMap,hs=new WeakMap;let Ti=xa;var tr,fs;class ih{constructor(t,e){E(this,"opts");E(this,"content");E(this,"attachment");y(this,tr,X(!1));y(this,fs,O(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":wc(this.opts.disabled.current),"data-disabled":ar(this.opts.disabled.current),"data-highlighted":u(c(this,tr))?"":void 0,[this.content.parentMenu.root.getBitsAttr("item")]:"",onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment})));this.opts=t,this.content=e,this.attachment=ge(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(t){if(!t.defaultPrevented&&qa(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!qe(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||qa(t)&&this.content.onItemLeave(t)}onfocus(t){We(()=>{t.defaultPrevented||this.opts.disabled.current||C(c(this,tr),!0)})}onblur(t){We(()=>{t.defaultPrevented||C(c(this,tr),!1)})}get props(){return u(c(this,fs))}set props(t){C(c(this,fs),t)}}tr=new WeakMap,fs=new WeakMap;var gs,Ao,Jc,ps;const Sa=class Sa{constructor(t,e){y(this,Ao);E(this,"opts");E(this,"item");E(this,"root");y(this,gs,!1);y(this,ps,O(()=>jt(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown})));this.opts=t,this.item=e,this.root=e.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}static create(t){const e=new ih(t,Yc.get());return new Sa(t,e)}onkeydown(t){const e=this.item.content.search!=="";if(!(this.item.opts.disabled.current||e&&t.key===Yo)&&Cd.includes(t.key)){if(!qe(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||rt(this,Ao,Jc).call(this)}onpointerup(t){var e;if(!t.defaultPrevented&&!c(this,gs)){if(!qe(t.currentTarget))return;(e=t.currentTarget)==null||e.click()}}onpointerdown(t){z(this,gs,!0)}get props(){return u(c(this,ps))}set props(t){C(c(this,ps),t)}};gs=new WeakMap,Ao=new WeakSet,Jc=function(){if(this.item.opts.disabled.current)return;const t=new CustomEvent("menuitemselect",{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(t),t.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()},ps=new WeakMap;let Ei=Sa;var To,vs;const _a=class _a{constructor(t,e){E(this,"opts");E(this,"parentMenu");E(this,"attachment");E(this,"onclick",t=>{this.opts.disabled.current||t.detail!==0||(this.parentMenu.toggleOpen(),t.preventDefault())});E(this,"onpointerdown",t=>{if(!this.opts.disabled.current){if(t.pointerType==="touch")return t.preventDefault();t.button===0&&t.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||t.preventDefault())}});E(this,"onpointerup",t=>{this.opts.disabled.current||t.pointerType==="touch"&&(t.preventDefault(),this.parentMenu.toggleOpen())});E(this,"onkeydown",t=>{if(!this.opts.disabled.current){if(t.key===Yo||t.key===Ji){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===Ir&&(this.parentMenu.onOpen(),t.preventDefault())}});y(this,To,O(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current}));y(this,vs,O(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":wc(this.parentMenu.opts.open.current),"aria-controls":u(c(this,To)),"data-disabled":ar(this.opts.disabled.current),"data-state":Vi(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr("trigger")]:"",onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment})));this.opts=t,this.parentMenu=e,this.attachment=ge(this.opts.ref,r=>this.parentMenu.triggerNode=r)}static create(t){return new _a(t,Qi.get())}get props(){return u(c(this,vs))}set props(t){C(c(this,vs),t)}};To=new WeakMap,vs=new WeakMap;let Ii=_a;globalThis.bitsDismissableLayers??(globalThis.bitsDismissableLayers=new Map);var er,Tn,nn,nr,rr,rn,ms,Le,Eo,lr,Zc,Io,sr,ko,Ro,Fo,No,bs,Qc,Do,Mo;const Pa=class Pa{constructor(t){y(this,lr);E(this,"opts");y(this,er);y(this,Tn);y(this,nn,{pointerdown:!1});y(this,nr,!1);y(this,rr,!1);y(this,rn);y(this,ms);y(this,Le,Pt);y(this,Eo,t=>{t.defaultPrevented||this.opts.ref.current&&We(()=>{var e,r;!this.opts.ref.current||c(this,No).call(this,t.target)||t.target&&!c(this,rr)&&((r=(e=c(this,ms)).current)==null||r.call(e,t))})});y(this,Io,t=>{let e=t;e.defaultPrevented&&(e=Va(t)),c(this,er).current(t)});y(this,sr,ja(t=>{if(!this.opts.ref.current){c(this,Le).call(this);return}const e=this.opts.isValidEvent.current(t,this.opts.ref.current)||lh(t,this.opts.ref.current);if(!c(this,nr)||rt(this,lr,Qc).call(this)||!e){c(this,Le).call(this);return}let r=t;if(r.defaultPrevented&&(r=Va(r)),c(this,Tn).current!=="close"&&c(this,Tn).current!=="defer-otherwise-close"){c(this,Le).call(this);return}t.pointerType==="touch"?(c(this,Le).call(this),z(this,Le,Dt(c(this,rn),"click",c(this,Io),{once:!0}))):c(this,er).current(r)},10));y(this,ko,t=>{c(this,nn)[t.type]=!0});y(this,Ro,t=>{c(this,nn)[t.type]=!1});y(this,Fo,()=>{this.opts.ref.current&&z(this,nr,ch(this.opts.ref.current))});y(this,No,t=>this.opts.ref.current?Fc(this.opts.ref.current,t):!1);y(this,bs,ja(()=>{for(const t in c(this,nn))c(this,nn)[t]=!1;z(this,nr,!1)},20));y(this,Do,()=>{z(this,rr,!0)});y(this,Mo,()=>{z(this,rr,!1)});E(this,"props",{onfocuscapture:c(this,Do),onblurcapture:c(this,Mo)});this.opts=t,z(this,Tn,t.interactOutsideBehavior),z(this,er,t.onInteractOutside),z(this,ms,t.onFocusOutside),Wt(()=>{z(this,rn,Nc(this.opts.ref.current))});let e=Pt;const r=()=>{c(this,bs).call(this),globalThis.bitsDismissableLayers.delete(this),c(this,sr).destroy(),e()};qt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return Hu(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,c(this,Tn)),e(),e=rt(this,lr,Zc).call(this))}),r}),ur(()=>{c(this,bs).destroy(),globalThis.bitsDismissableLayers.delete(this),c(this,sr).destroy(),c(this,Le).call(this),e()})}static create(t){return new Pa(t)}};er=new WeakMap,Tn=new WeakMap,nn=new WeakMap,nr=new WeakMap,rr=new WeakMap,rn=new WeakMap,ms=new WeakMap,Le=new WeakMap,Eo=new WeakMap,lr=new WeakSet,Zc=function(){return zn(Dt(c(this,rn),"pointerdown",zn(c(this,ko),c(this,Fo)),{capture:!0}),Dt(c(this,rn),"pointerdown",zn(c(this,Ro),c(this,sr))),Dt(c(this,rn),"focusin",c(this,Eo)))},Io=new WeakMap,sr=new WeakMap,ko=new WeakMap,Ro=new WeakMap,Fo=new WeakMap,No=new WeakMap,bs=new WeakMap,Qc=function(){return Object.values(c(this,nn)).some(Boolean)},Do=new WeakMap,Mo=new WeakMap;let ki=Pa;function ah(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([t,{current:e}])=>e==="close"||e==="ignore")}function ch(n){const t=[...globalThis.bitsDismissableLayers],e=ah(t);if(e)return e[0].opts.ref.current===n;const[r]=t[0];return r.opts.ref.current===n}function lh(n,t){const e=n.target;if(!kc(e))return!1;const r=!!e.closest(`[${eh}]`);if("button"in n&&n.button>0&&!r)return!1;if("button"in n&&n.button===0&&r)return!0;const s=!!t.closest(`[${nh}]`);return r&&s?!1:Nc(e).documentElement.contains(e)&&!Fc(t,e)&&Pd(n,t)}function Va(n){const t=n.currentTarget,e=n.target;let r;n instanceof PointerEvent?r=new PointerEvent(n.type,n):r=new PointerEvent("pointerdown",n);let s=!1;return new Proxy(r,{get:(i,a)=>a==="currentTarget"?t:a==="target"?e:a==="preventDefault"?()=>{s=!0,typeof i.preventDefault=="function"&&i.preventDefault()}:a==="defaultPrevented"?s:a in i?i[a]:n[a]})}function $c(n,t){G(t,!0);let e=w(t,"interactOutsideBehavior",3,"close"),r=w(t,"onInteractOutside",3,Pt),s=w(t,"onFocusOutside",3,Pt),o=w(t,"isValidEvent",3,()=>!1);const i=ki.create({id:k(()=>t.id),interactOutsideBehavior:k(()=>e()),onInteractOutside:k(()=>r()),enabled:k(()=>t.enabled),onFocusOutside:k(()=>s()),isValidEvent:k(()=>o()),ref:t.ref});var a=L(),l=T(a);H(l,()=>t.children??st,()=>({props:i.props})),v(n,a),Y()}globalThis.bitsEscapeLayers??(globalThis.bitsEscapeLayers=new Map);var Lo,Bo;const Ca=class Ca{constructor(t){E(this,"opts");E(this,"domContext");y(this,Lo,()=>Dt(this.domContext.getDocument(),"keydown",c(this,Bo),{passive:!1}));y(this,Bo,t=>{if(t.key!==td||!uh(this))return;const e=new KeyboardEvent(t.type,t);t.preventDefault();const r=this.opts.escapeKeydownBehavior.current;r!=="close"&&r!=="defer-otherwise-close"||this.opts.onEscapeKeydown.current(e)});this.opts=t,this.domContext=new Gi(this.opts.ref);let e=Pt;qt(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),e=c(this,Lo).call(this)),()=>{e(),globalThis.bitsEscapeLayers.delete(this)}))}static create(t){return new Ca(t)}};Lo=new WeakMap,Bo=new WeakMap;let Ri=Ca;function uh(n){const t=[...globalThis.bitsEscapeLayers],e=t.findLast(([s,{current:o}])=>o==="close"||o==="ignore");if(e)return e[0]===n;const[r]=t[0];return r===n}function tl(n,t){G(t,!0);let e=w(t,"escapeKeydownBehavior",3,"close"),r=w(t,"onEscapeKeydown",3,Pt);Ri.create({escapeKeydownBehavior:k(()=>e()),onEscapeKeydown:k(()=>r()),enabled:k(()=>t.enabled),ref:t.ref});var s=L(),o=T(s);H(o,()=>t.children??st),v(n,s),Y()}var Be,ys,En;const Uo=class Uo{constructor(){y(this,Be,Ue([]));y(this,ys,new WeakMap);y(this,En,new WeakMap)}static getInstance(){return this.instance||(this.instance=new Uo),this.instance}register(t){const e=this.getActive();e&&e!==t&&e.pause();const r=document.activeElement;r&&r!==document.body&&c(this,En).set(t,r),c(this,Be).current=c(this,Be).current.filter(s=>s!==t),c(this,Be).current.unshift(t)}unregister(t){c(this,Be).current=c(this,Be).current.filter(r=>r!==t);const e=this.getActive();e&&e.resume()}getActive(){return c(this,Be).current[0]}setFocusMemory(t,e){c(this,ys).set(t,e)}getFocusMemory(t){return c(this,ys).get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,e){c(this,En).set(t,e)}getPreFocusMemory(t){return c(this,En).get(t)}clearPreFocusMemory(t){c(this,En).delete(t)}};Be=new WeakMap,ys=new WeakMap,En=new WeakMap,E(Uo,"instance");let Fi=Uo;var sn,Ht,te,In,on,Ft,el,nl,rl,sl,Di,ao,Mi;const Oa=class Oa{constructor(t){y(this,Ft);y(this,sn,!1);y(this,Ht,null);y(this,te,Fi.getInstance());y(this,In,[]);y(this,on);z(this,on,t)}get paused(){return c(this,sn)}pause(){z(this,sn,!0)}resume(){z(this,sn,!1)}mount(t){c(this,Ht)&&this.unmount(),z(this,Ht,t),c(this,te).register(this),rt(this,Ft,sl).call(this),rt(this,Ft,nl).call(this)}unmount(){c(this,Ht)&&(rt(this,Ft,el).call(this),rt(this,Ft,rl).call(this),c(this,te).unregister(this),c(this,te).clearPreFocusMemory(this),z(this,Ht,null))}static use(t){let e=null;return qt([()=>t.ref.current,()=>t.enabled.current],([r,s])=>{r&&s?(e||(e=new Oa(t)),e.mount(r)):e&&(e.unmount(),e=null)}),ur(()=>{e==null||e.unmount()}),{get props(){return{tabindex:-1}}}}};sn=new WeakMap,Ht=new WeakMap,te=new WeakMap,In=new WeakMap,on=new WeakMap,Ft=new WeakSet,el=function(){for(const t of c(this,In))t();z(this,In,[])},nl=function(){if(!c(this,Ht))return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});c(this,on).onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!c(this,Ht))return;const e=rt(this,Ft,ao).call(this);e?(e.focus(),c(this,te).setFocusMemory(this,e)):c(this,Ht).focus()})},rl=function(){var e,r;const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if((r=(e=c(this,on).onCloseAutoFocus).current)==null||r.call(e,t),!t.defaultPrevented){const s=c(this,te).getPreFocusMemory(this);if(s&&document.contains(s))try{s.focus()}catch{document.body.focus()}}},sl=function(){if(!c(this,Ht)||!c(this,on).trap.current)return;const t=c(this,Ht),e=t.ownerDocument,r=i=>{if(c(this,sn)||!c(this,te).isActiveScope(this))return;const a=i.target;if(!a)return;if(t.contains(a))c(this,te).setFocusMemory(this,a);else{const d=c(this,te).getFocusMemory(this);if(d&&t.contains(d)&&Vc(d))i.preventDefault(),d.focus();else{const f=rt(this,Ft,ao).call(this),h=rt(this,Ft,Mi).call(this)[0];(f||h||t).focus()}}},s=i=>{if(!c(this,on).loop||c(this,sn)||i.key!=="Tab"||!c(this,te).isActiveScope(this))return;const a=rt(this,Ft,Di).call(this);if(a.length===0)return;const l=a[0],d=a[a.length-1];!i.shiftKey&&e.activeElement===d?(i.preventDefault(),l.focus()):i.shiftKey&&e.activeElement===l&&(i.preventDefault(),d.focus())};c(this,In).push(Dt(e,"focusin",r,{capture:!0}),Dt(t,"keydown",s));const o=new MutationObserver(()=>{const i=c(this,te).getFocusMemory(this);if(i&&!t.contains(i)){const a=rt(this,Ft,ao).call(this),l=rt(this,Ft,Mi).call(this)[0],d=a||l;d?(d.focus(),c(this,te).setFocusMemory(this,d)):t.focus()}});o.observe(t,{childList:!0,subtree:!0}),c(this,In).push(()=>o.disconnect())},Di=function(){return c(this,Ht)?Kc(c(this,Ht),{includeContainer:!1,getShadowRoot:!0}):[]},ao=function(){return rt(this,Ft,Di).call(this)[0]||null},Mi=function(){return c(this,Ht)?zc(c(this,Ht),{includeContainer:!1,getShadowRoot:!0}):[]};let Ni=Oa;function ol(n,t){G(t,!0);let e=w(t,"enabled",3,!1),r=w(t,"trapFocus",3,!1),s=w(t,"loop",3,!1),o=w(t,"onCloseAutoFocus",3,Pt),i=w(t,"onOpenAutoFocus",3,Pt);const a=Ni.use({enabled:k(()=>e()),trap:k(()=>r()),loop:s(),onCloseAutoFocus:k(()=>o()),onOpenAutoFocus:k(()=>i()),ref:t.ref});var l=L(),d=T(l);H(d,()=>t.focusScope??st,()=>({props:a.props})),v(n,l),Y()}globalThis.bitsTextSelectionLayers??(globalThis.bitsTextSelectionLayers=new Map);var or,Wo,il,jo,ws;const Aa=class Aa{constructor(t){y(this,Wo);E(this,"opts");E(this,"domContext");y(this,or,Pt);y(this,jo,t=>{const e=this.opts.ref.current,r=t.target;!qe(e)||!qe(r)||!this.opts.enabled.current||!hh(this)||!Qu(e,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&z(this,or,dh(e,this.domContext.getDocument().body)))});y(this,ws,()=>{c(this,or).call(this),z(this,or,Pt)});this.opts=t,this.domContext=new Gi(t.ref);let e=Pt;qt(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),e(),e=rt(this,Wo,il).call(this)),()=>{e(),c(this,ws).call(this),globalThis.bitsTextSelectionLayers.delete(this)}))}static create(t){return new Aa(t)}};or=new WeakMap,Wo=new WeakSet,il=function(){return zn(Dt(this.domContext.getDocument(),"pointerdown",c(this,jo)),Dt(this.domContext.getDocument(),"pointerup",xu(c(this,ws),this.opts.onPointerUp.current)))},jo=new WeakMap,ws=new WeakMap;let Li=Aa;const Ha=n=>n.style.userSelect||n.style.webkitUserSelect;function dh(n,t){const e=Ha(t),r=Ha(n);return Qs(t,"none"),Qs(n,"text"),()=>{Qs(t,e),Qs(n,r)}}function Qs(n,t){n.style.userSelect=t,n.style.webkitUserSelect=t}function hh(n){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const e=t.at(-1);return e?e[0]===n:!1}function al(n,t){G(t,!0);let e=w(t,"preventOverflowTextSelection",3,!0),r=w(t,"onPointerDown",3,Pt),s=w(t,"onPointerUp",3,Pt);Li.create({id:k(()=>t.id),onPointerDown:k(()=>r()),onPointerUp:k(()=>s()),enabled:k(()=>t.enabled&&e()),ref:t.ref});var o=L(),i=T(o);H(i,()=>t.children??st),v(n,o),Y()}globalThis.bitsIdCounter??(globalThis.bitsIdCounter={current:0});function $i(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}var xs,ir,kn,Rn,qo,cl;class fh{constructor(t){y(this,qo);y(this,xs);y(this,ir,0);y(this,kn,X());y(this,Rn);z(this,xs,t)}get(...t){return z(this,ir,c(this,ir)+1),u(c(this,kn))===void 0&&z(this,Rn,vc(()=>{C(c(this,kn),c(this,xs).call(this,...t),!0)})),Wt(()=>()=>{rt(this,qo,cl).call(this)}),u(c(this,kn))}}xs=new WeakMap,ir=new WeakMap,kn=new WeakMap,Rn=new WeakMap,qo=new WeakSet,cl=function(){z(this,ir,c(this,ir)-1),c(this,Rn)&&c(this,ir)<=0&&(c(this,Rn).call(this),C(c(this,kn),void 0),z(this,Rn,void 0))};const co=new di;let $s=X(null),Sn=null,_r=null,Pr=!1;const Ga=k(()=>{for(const n of co.values())if(n)return!0;return!1});let oi=null;const gh=new fh(()=>{function n(){document.body.setAttribute("style",u($s)??""),document.body.style.removeProperty("--scrollbar-width"),Wa&&(Sn==null||Sn()),C($s,null)}function t(){_r!==null&&(window.clearTimeout(_r),_r=null)}function e(s,o){t(),Pr=!0,oi=Date.now();const i=oi,a=()=>{_r=null,oi===i&&(ll(co)?Pr=!1:(Pr=!1,o()))},l=s===null?24:s;_r=window.setTimeout(a,l)}function r(){u($s)===null&&co.size===0&&!Pr&&C($s,document.body.getAttribute("style"),!0)}return qt(()=>Ga.current,()=>{var f,h;if(!Ga.current)return;r(),Pr=!1;const s=getComputedStyle(document.documentElement),o=getComputedStyle(document.body),i=((f=s.scrollbarGutter)==null?void 0:f.includes("stable"))||((h=o.scrollbarGutter)==null?void 0:h.includes("stable")),a=window.innerWidth-document.documentElement.clientWidth,d={padding:Number.parseInt(o.paddingRight??"0",10)+a,margin:Number.parseInt(o.marginRight??"0",10)};a>0&&!i&&(document.body.style.paddingRight=`${d.padding}px`,document.body.style.marginRight=`${d.margin}px`,document.body.style.setProperty("--scrollbar-width",`${a}px`)),document.body.style.overflow="hidden",Wa&&(Sn=Dt(document,"touchmove",g=>{g.target===document.documentElement&&(g.touches.length>1||g.preventDefault())},{passive:!1})),We(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),ur(()=>()=>{Sn==null||Sn()}),{get lockMap(){return co},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:e,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});var Fn,Ss,_s,ee;class ph{constructor(t,e=()=>null){y(this,Fn,$i());y(this,Ss);y(this,_s,()=>null);y(this,ee);E(this,"locked");z(this,Ss,t),z(this,_s,e),z(this,ee,gh.get()),c(this,ee)&&(c(this,ee).cancelPendingCleanup(),c(this,ee).ensureInitialStyleCaptured(),c(this,ee).lockMap.set(c(this,Fn),c(this,Ss)??!1),this.locked=k(()=>c(this,ee).lockMap.get(c(this,Fn))??!1,r=>c(this,ee).lockMap.set(c(this,Fn),r)),ur(()=>{if(c(this,ee).lockMap.delete(c(this,Fn)),ll(c(this,ee).lockMap))return;const r=c(this,_s).call(this);c(this,ee).scheduleCleanupIfNoNewLocks(r,()=>{c(this,ee).resetBodyStyle()})}))}}Fn=new WeakMap,Ss=new WeakMap,_s=new WeakMap,ee=new WeakMap;function ll(n){for(const[t,e]of n)if(e)return!0;return!1}function vo(n,t){G(t,!0);let e=w(t,"preventScroll",3,!0),r=w(t,"restoreScrollDelay",3,null);e()&&new ph(e(),()=>r()),Y()}var vh=K("
");function mh(n,t){const e=fn();G(t,!0);let r=w(t,"id",19,()=>gn(e)),s=w(t,"forceMount",3,!1),o=w(t,"ref",15,null),i=ot(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const a=xi.create({id:k(()=>r()),ref:k(()=>o(),g=>o(g))}),l=O(()=>jt(i,a.props));var d=L(),f=T(d);{var h=g=>{var m=L(),p=T(m);{var b=S=>{var A=L(),R=T(A);{let x=O(()=>({props:jt(u(l)),...a.snippetProps}));H(R,()=>t.child,()=>u(x))}v(S,A)},_=S=>{var A=vh();Rt(A,x=>({...x}),[()=>jt(u(l))]);var R=W(A);H(R,()=>t.children??st,()=>a.snippetProps),j(A),v(S,A)};bt(p,S=>{t.child?S(b):S(_,!1)})}v(g,m)};bt(f,g=>{(a.shouldRender||s())&&g(h)})}v(n,d),Y()}var bh=K("
");function yh(n,t){const e=fn();G(t,!0);let r=w(t,"id",19,()=>gn(e)),s=w(t,"ref",15,null),o=ot(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const i=yi.create({id:k(()=>r()),ref:k(()=>s(),g=>s(g))}),a=O(()=>jt(o,i.props));var l=L(),d=T(l);{var f=g=>{var m=L(),p=T(m);H(p,()=>t.child,()=>({props:u(a)})),v(g,m)},h=g=>{var m=bh();Rt(m,()=>({...u(a)}));var p=W(m);H(p,()=>t.children??st),j(m),v(g,m)};bt(d,g=>{t.child?g(f):g(h,!1)})}v(n,l),Y()}const wh=["top","right","bottom","left"],un=Math.min,re=Math.max,mo=Math.round,to=Math.floor,Ce=n=>({x:n,y:n}),xh={left:"right",right:"left",bottom:"top",top:"bottom"},Sh={start:"end",end:"start"};function Bi(n,t,e){return re(n,un(t,e))}function Ke(n,t){return typeof n=="function"?n(t):n}function ze(n){return n.split("-")[0]}function dr(n){return n.split("-")[1]}function ta(n){return n==="x"?"y":"x"}function ea(n){return n==="y"?"height":"width"}const _h=new Set(["top","bottom"]);function Pe(n){return _h.has(ze(n))?"y":"x"}function na(n){return ta(Pe(n))}function Ph(n,t,e){e===void 0&&(e=!1);const r=dr(n),s=na(n),o=ea(s);let i=s==="x"?r===(e?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=bo(i)),[i,bo(i)]}function Ch(n){const t=bo(n);return[Ui(n),t,Ui(t)]}function Ui(n){return n.replace(/start|end/g,t=>Sh[t])}const Ya=["left","right"],Xa=["right","left"],Oh=["top","bottom"],Ah=["bottom","top"];function Th(n,t,e){switch(n){case"top":case"bottom":return e?t?Xa:Ya:t?Ya:Xa;case"left":case"right":return t?Oh:Ah;default:return[]}}function Eh(n,t,e,r){const s=dr(n);let o=Th(ze(n),e==="start",r);return s&&(o=o.map(i=>i+"-"+s),t&&(o=o.concat(o.map(Ui)))),o}function bo(n){return n.replace(/left|right|bottom|top/g,t=>xh[t])}function Ih(n){return{top:0,right:0,bottom:0,left:0,...n}}function ul(n){return typeof n!="number"?Ih(n):{top:n,right:n,bottom:n,left:n}}function yo(n){const{x:t,y:e,width:r,height:s}=n;return{width:r,height:s,top:e,left:t,right:t+r,bottom:e+s,x:t,y:e}}function Ja(n,t,e){let{reference:r,floating:s}=n;const o=Pe(t),i=na(t),a=ea(i),l=ze(t),d=o==="y",f=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,g=r[a]/2-s[a]/2;let m;switch(l){case"top":m={x:f,y:r.y-s.height};break;case"bottom":m={x:f,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-s.width,y:h};break;default:m={x:r.x,y:r.y}}switch(dr(t)){case"start":m[i]-=g*(e&&d?-1:1);break;case"end":m[i]+=g*(e&&d?-1:1);break}return m}async function kh(n,t){var e;t===void 0&&(t={});const{x:r,y:s,platform:o,rects:i,elements:a,strategy:l}=n,{boundary:d="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:g=!1,padding:m=0}=Ke(t,n),p=ul(m),_=a[g?h==="floating"?"reference":"floating":h],S=yo(await o.getClippingRect({element:(e=await(o.isElement==null?void 0:o.isElement(_)))==null||e?_:_.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:d,rootBoundary:f,strategy:l})),A=h==="floating"?{x:r,y:s,width:i.floating.width,height:i.floating.height}:i.reference,R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),x=await(o.isElement==null?void 0:o.isElement(R))?await(o.getScale==null?void 0:o.getScale(R))||{x:1,y:1}:{x:1,y:1},q=yo(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:A,offsetParent:R,strategy:l}):A);return{top:(S.top-q.top+p.top)/x.y,bottom:(q.bottom-S.bottom+p.bottom)/x.y,left:(S.left-q.left+p.left)/x.x,right:(q.right-S.right+p.right)/x.x}}const Rh=async(n,t,e)=>{const{placement:r="bottom",strategy:s="absolute",middleware:o=[],platform:i}=e,a=o.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:n,floating:t,strategy:s}),{x:f,y:h}=Ja(d,r,l),g=r,m={},p=0;for(let _=0;_({name:"arrow",options:n,async fn(t){const{x:e,y:r,placement:s,rects:o,platform:i,elements:a,middlewareData:l}=t,{element:d,padding:f=0}=Ke(n,t)||{};if(d==null)return{};const h=ul(f),g={x:e,y:r},m=na(s),p=ea(m),b=await i.getDimensions(d),_=m==="y",S=_?"top":"left",A=_?"bottom":"right",R=_?"clientHeight":"clientWidth",x=o.reference[p]+o.reference[m]-g[m]-o.floating[p],q=g[m]-o.reference[m],B=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let N=B?B[R]:0;(!N||!await(i.isElement==null?void 0:i.isElement(B)))&&(N=a.floating[R]||o.floating[p]);const I=x/2-q/2,tt=N/2-b[p]/2-1,Z=un(h[S],tt),Ct=un(h[A],tt),yt=Z,At=N-b[p]-Ct,ut=N/2-b[p]/2+I,vt=Bi(yt,ut,At),it=!l.arrow&&dr(s)!=null&&ut!==vt&&o.reference[p]/2-(utut<=0)){var Ct,yt;const ut=(((Ct=o.flip)==null?void 0:Ct.index)||0)+1,vt=N[ut];if(vt&&(!(h==="alignment"?A!==Pe(vt):!1)||Z.every(et=>Pe(et.placement)===A?et.overflows[0]>0:!0)))return{data:{index:ut,overflows:Z},reset:{placement:vt}};let it=(yt=Z.filter(ft=>ft.overflows[0]<=0).sort((ft,et)=>ft.overflows[1]-et.overflows[1])[0])==null?void 0:yt.placement;if(!it)switch(m){case"bestFit":{var At;const ft=(At=Z.filter(et=>{if(B){const Ot=Pe(et.placement);return Ot===A||Ot==="y"}return!0}).map(et=>[et.placement,et.overflows.filter(Ot=>Ot>0).reduce((Ot,ne)=>Ot+ne,0)]).sort((et,Ot)=>et[1]-Ot[1])[0])==null?void 0:At[0];ft&&(it=ft);break}case"initialPlacement":it=a;break}if(s!==it)return{reset:{placement:it}}}return{}}}};function Za(n,t){return{top:n.top-t.height,right:n.right-t.width,bottom:n.bottom-t.height,left:n.left-t.width}}function Qa(n){return wh.some(t=>n[t]>=0)}const Dh=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(t){const{rects:e,platform:r}=t,{strategy:s="referenceHidden",...o}=Ke(n,t);switch(s){case"referenceHidden":{const i=await r.detectOverflow(t,{...o,elementContext:"reference"}),a=Za(i,e.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Qa(a)}}}case"escaped":{const i=await r.detectOverflow(t,{...o,altBoundary:!0}),a=Za(i,e.floating);return{data:{escapedOffsets:a,escaped:Qa(a)}}}default:return{}}}}},dl=new Set(["left","top"]);async function Mh(n,t){const{placement:e,platform:r,elements:s}=n,o=await(r.isRTL==null?void 0:r.isRTL(s.floating)),i=ze(e),a=dr(e),l=Pe(e)==="y",d=dl.has(i)?-1:1,f=o&&l?-1:1,h=Ke(t,n);let{mainAxis:g,crossAxis:m,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(m=a==="end"?p*-1:p),l?{x:m*f,y:g*d}:{x:g*d,y:m*f}}const Lh=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,r;const{x:s,y:o,placement:i,middlewareData:a}=t,l=await Mh(t,n);return i===((e=a.offset)==null?void 0:e.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:i}}}}},Bh=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:r,placement:s,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:A,y:R}=S;return{x:A,y:R}}},...d}=Ke(n,t),f={x:e,y:r},h=await o.detectOverflow(t,d),g=Pe(ze(s)),m=ta(g);let p=f[m],b=f[g];if(i){const S=m==="y"?"top":"left",A=m==="y"?"bottom":"right",R=p+h[S],x=p-h[A];p=Bi(R,p,x)}if(a){const S=g==="y"?"top":"left",A=g==="y"?"bottom":"right",R=b+h[S],x=b-h[A];b=Bi(R,b,x)}const _=l.fn({...t,[m]:p,[g]:b});return{..._,data:{x:_.x-e,y:_.y-r,enabled:{[m]:i,[g]:a}}}}}},Uh=function(n){return n===void 0&&(n={}),{options:n,fn(t){const{x:e,y:r,placement:s,rects:o,middlewareData:i}=t,{offset:a=0,mainAxis:l=!0,crossAxis:d=!0}=Ke(n,t),f={x:e,y:r},h=Pe(s),g=ta(h);let m=f[g],p=f[h];const b=Ke(a,t),_=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(l){const R=g==="y"?"height":"width",x=o.reference[g]-o.floating[R]+_.mainAxis,q=o.reference[g]+o.reference[R]-_.mainAxis;mq&&(m=q)}if(d){var S,A;const R=g==="y"?"width":"height",x=dl.has(ze(s)),q=o.reference[h]-o.floating[R]+(x&&((S=i.offset)==null?void 0:S[h])||0)+(x?0:_.crossAxis),B=o.reference[h]+o.reference[R]+(x?0:((A=i.offset)==null?void 0:A[h])||0)-(x?_.crossAxis:0);pB&&(p=B)}return{[g]:m,[h]:p}}}},Wh=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,r;const{placement:s,rects:o,platform:i,elements:a}=t,{apply:l=()=>{},...d}=Ke(n,t),f=await i.detectOverflow(t,d),h=ze(s),g=dr(s),m=Pe(s)==="y",{width:p,height:b}=o.floating;let _,S;h==="top"||h==="bottom"?(_=h,S=g===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(S=h,_=g==="end"?"top":"bottom");const A=b-f.top-f.bottom,R=p-f.left-f.right,x=un(b-f[_],A),q=un(p-f[S],R),B=!t.middlewareData.shift;let N=x,I=q;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(I=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=A),B&&!g){const Z=re(f.left,0),Ct=re(f.right,0),yt=re(f.top,0),At=re(f.bottom,0);m?I=p-2*(Z!==0||Ct!==0?Z+Ct:re(f.left,f.right)):N=b-2*(yt!==0||At!==0?yt+At:re(f.top,f.bottom))}await l({...t,availableWidth:I,availableHeight:N});const tt=await i.getDimensions(a.floating);return p!==tt.width||b!==tt.height?{reset:{rects:!0}}:{}}}};function Xo(){return typeof window<"u"}function hr(n){return hl(n)?(n.nodeName||"").toLowerCase():"#document"}function se(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(n){var t;return(t=(hl(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function hl(n){return Xo()?n instanceof Node||n instanceof se(n).Node:!1}function pe(n){return Xo()?n instanceof Element||n instanceof se(n).Element:!1}function Oe(n){return Xo()?n instanceof HTMLElement||n instanceof se(n).HTMLElement:!1}function $a(n){return!Xo()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof se(n).ShadowRoot}const jh=new Set(["inline","contents"]);function Hs(n){const{overflow:t,overflowX:e,overflowY:r,display:s}=ve(n);return/auto|scroll|overlay|hidden|clip/.test(t+r+e)&&!jh.has(s)}const qh=new Set(["table","td","th"]);function Kh(n){return qh.has(hr(n))}const zh=[":popover-open",":modal"];function Jo(n){return zh.some(t=>{try{return n.matches(t)}catch{return!1}})}const Vh=["transform","translate","scale","rotate","perspective"],Hh=["transform","translate","scale","rotate","perspective","filter"],Gh=["paint","layout","strict","content"];function ra(n){const t=sa(),e=pe(n)?ve(n):n;return Vh.some(r=>e[r]?e[r]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||Hh.some(r=>(e.willChange||"").includes(r))||Gh.some(r=>(e.contain||"").includes(r))}function Yh(n){let t=dn(n);for(;Oe(t)&&!cr(t);){if(ra(t))return t;if(Jo(t))return null;t=dn(t)}return null}function sa(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Xh=new Set(["html","body","#document"]);function cr(n){return Xh.has(hr(n))}function ve(n){return se(n).getComputedStyle(n)}function Zo(n){return pe(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function dn(n){if(hr(n)==="html")return n;const t=n.assignedSlot||n.parentNode||$a(n)&&n.host||Ae(n);return $a(t)?t.host:t}function fl(n){const t=dn(n);return cr(t)?n.ownerDocument?n.ownerDocument.body:n.body:Oe(t)&&Hs(t)?t:fl(t)}function kr(n,t,e){var r;t===void 0&&(t=[]),e===void 0&&(e=!0);const s=fl(n),o=s===((r=n.ownerDocument)==null?void 0:r.body),i=se(s);if(o){const a=Wi(i);return t.concat(i,i.visualViewport||[],Hs(s)?s:[],a&&e?kr(a):[])}return t.concat(s,kr(s,[],e))}function Wi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function gl(n){const t=ve(n);let e=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=Oe(n),o=s?n.offsetWidth:e,i=s?n.offsetHeight:r,a=mo(e)!==o||mo(r)!==i;return a&&(e=o,r=i),{width:e,height:r,$:a}}function oa(n){return pe(n)?n:n.contextElement}function Vn(n){const t=oa(n);if(!Oe(t))return Ce(1);const e=t.getBoundingClientRect(),{width:r,height:s,$:o}=gl(t);let i=(o?mo(e.width):e.width)/r,a=(o?mo(e.height):e.height)/s;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Jh=Ce(0);function pl(n){const t=se(n);return!sa()||!t.visualViewport?Jh:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Zh(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==se(n)?!1:t}function Mn(n,t,e,r){t===void 0&&(t=!1),e===void 0&&(e=!1);const s=n.getBoundingClientRect(),o=oa(n);let i=Ce(1);t&&(r?pe(r)&&(i=Vn(r)):i=Vn(n));const a=Zh(o,e,r)?pl(o):Ce(0);let l=(s.left+a.x)/i.x,d=(s.top+a.y)/i.y,f=s.width/i.x,h=s.height/i.y;if(o){const g=se(o),m=r&&pe(r)?se(r):r;let p=g,b=Wi(p);for(;b&&r&&m!==p;){const _=Vn(b),S=b.getBoundingClientRect(),A=ve(b),R=S.left+(b.clientLeft+parseFloat(A.paddingLeft))*_.x,x=S.top+(b.clientTop+parseFloat(A.paddingTop))*_.y;l*=_.x,d*=_.y,f*=_.x,h*=_.y,l+=R,d+=x,p=se(b),b=Wi(p)}}return yo({width:f,height:h,x:l,y:d})}function Qo(n,t){const e=Zo(n).scrollLeft;return t?t.left+e:Mn(Ae(n)).left+e}function vl(n,t){const e=n.getBoundingClientRect(),r=e.left+t.scrollLeft-Qo(n,e),s=e.top+t.scrollTop;return{x:r,y:s}}function Qh(n){let{elements:t,rect:e,offsetParent:r,strategy:s}=n;const o=s==="fixed",i=Ae(r),a=t?Jo(t.floating):!1;if(r===i||a&&o)return e;let l={scrollLeft:0,scrollTop:0},d=Ce(1);const f=Ce(0),h=Oe(r);if((h||!h&&!o)&&((hr(r)!=="body"||Hs(i))&&(l=Zo(r)),Oe(r))){const m=Mn(r);d=Vn(r),f.x=m.x+r.clientLeft,f.y=m.y+r.clientTop}const g=i&&!h&&!o?vl(i,l):Ce(0);return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-l.scrollLeft*d.x+f.x+g.x,y:e.y*d.y-l.scrollTop*d.y+f.y+g.y}}function $h(n){return Array.from(n.getClientRects())}function tf(n){const t=Ae(n),e=Zo(n),r=n.ownerDocument.body,s=re(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=re(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-e.scrollLeft+Qo(n);const a=-e.scrollTop;return ve(r).direction==="rtl"&&(i+=re(t.clientWidth,r.clientWidth)-s),{width:s,height:o,x:i,y:a}}const tc=25;function ef(n,t){const e=se(n),r=Ae(n),s=e.visualViewport;let o=r.clientWidth,i=r.clientHeight,a=0,l=0;if(s){o=s.width,i=s.height;const f=sa();(!f||f&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}const d=Qo(r);if(d<=0){const f=r.ownerDocument,h=f.body,g=getComputedStyle(h),m=f.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,p=Math.abs(r.clientWidth-h.clientWidth-m);p<=tc&&(o-=p)}else d<=tc&&(o+=d);return{width:o,height:i,x:a,y:l}}const nf=new Set(["absolute","fixed"]);function rf(n,t){const e=Mn(n,!0,t==="fixed"),r=e.top+n.clientTop,s=e.left+n.clientLeft,o=Oe(n)?Vn(n):Ce(1),i=n.clientWidth*o.x,a=n.clientHeight*o.y,l=s*o.x,d=r*o.y;return{width:i,height:a,x:l,y:d}}function ec(n,t,e){let r;if(t==="viewport")r=ef(n,e);else if(t==="document")r=tf(Ae(n));else if(pe(t))r=rf(t,e);else{const s=pl(n);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return yo(r)}function ml(n,t){const e=dn(n);return e===t||!pe(e)||cr(e)?!1:ve(e).position==="fixed"||ml(e,t)}function sf(n,t){const e=t.get(n);if(e)return e;let r=kr(n,[],!1).filter(a=>pe(a)&&hr(a)!=="body"),s=null;const o=ve(n).position==="fixed";let i=o?dn(n):n;for(;pe(i)&&!cr(i);){const a=ve(i),l=ra(i);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&!!s&&nf.has(s.position)||Hs(i)&&!l&&ml(n,i))?r=r.filter(f=>f!==i):s=a,i=dn(i)}return t.set(n,r),r}function of(n){let{element:t,boundary:e,rootBoundary:r,strategy:s}=n;const i=[...e==="clippingAncestors"?Jo(t)?[]:sf(t,this._c):[].concat(e),r],a=i[0],l=i.reduce((d,f)=>{const h=ec(t,f,s);return d.top=re(h.top,d.top),d.right=un(h.right,d.right),d.bottom=un(h.bottom,d.bottom),d.left=re(h.left,d.left),d},ec(t,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function af(n){const{width:t,height:e}=gl(n);return{width:t,height:e}}function cf(n,t,e){const r=Oe(t),s=Ae(t),o=e==="fixed",i=Mn(n,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=Ce(0);function d(){l.x=Qo(s)}if(r||!r&&!o)if((hr(t)!=="body"||Hs(s))&&(a=Zo(t)),r){const m=Mn(t,!0,o,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else s&&d();o&&!r&&s&&d();const f=s&&!r&&!o?vl(s,a):Ce(0),h=i.left+a.scrollLeft-l.x-f.x,g=i.top+a.scrollTop-l.y-f.y;return{x:h,y:g,width:i.width,height:i.height}}function ii(n){return ve(n).position==="static"}function nc(n,t){if(!Oe(n)||ve(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return Ae(n)===e&&(e=e.ownerDocument.body),e}function bl(n,t){const e=se(n);if(Jo(n))return e;if(!Oe(n)){let s=dn(n);for(;s&&!cr(s);){if(pe(s)&&!ii(s))return s;s=dn(s)}return e}let r=nc(n,t);for(;r&&Kh(r)&&ii(r);)r=nc(r,t);return r&&cr(r)&&ii(r)&&!ra(r)?e:r||Yh(n)||e}const lf=async function(n){const t=this.getOffsetParent||bl,e=this.getDimensions,r=await e(n.floating);return{reference:cf(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uf(n){return ve(n).direction==="rtl"}const df={convertOffsetParentRelativeRectToViewportRelativeRect:Qh,getDocumentElement:Ae,getClippingRect:of,getOffsetParent:bl,getElementRects:lf,getClientRects:$h,getDimensions:af,getScale:Vn,isElement:pe,isRTL:uf};function yl(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function hf(n,t){let e=null,r;const s=Ae(n);function o(){var a;clearTimeout(r),(a=e)==null||a.disconnect(),e=null}function i(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const d=n.getBoundingClientRect(),{left:f,top:h,width:g,height:m}=d;if(a||t(),!g||!m)return;const p=to(h),b=to(s.clientWidth-(f+g)),_=to(s.clientHeight-(h+m)),S=to(f),R={rootMargin:-p+"px "+-b+"px "+-_+"px "+-S+"px",threshold:re(0,un(1,l))||1};let x=!0;function q(B){const N=B[0].intersectionRatio;if(N!==l){if(!x)return i();N?i(!1,N):r=setTimeout(()=>{i(!1,1e-7)},1e3)}N===1&&!yl(d,n.getBoundingClientRect())&&i(),x=!1}try{e=new IntersectionObserver(q,{...R,root:s.ownerDocument})}catch{e=new IntersectionObserver(q,R)}e.observe(n)}return i(!0),o}function ff(n,t,e,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,d=oa(n),f=s||o?[...d?kr(d):[],...kr(t)]:[];f.forEach(S=>{s&&S.addEventListener("scroll",e,{passive:!0}),o&&S.addEventListener("resize",e)});const h=d&&a?hf(d,e):null;let g=-1,m=null;i&&(m=new ResizeObserver(S=>{let[A]=S;A&&A.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=m)==null||R.observe(t)})),e()}),d&&!l&&m.observe(d),m.observe(t));let p,b=l?Mn(n):null;l&&_();function _(){const S=Mn(n);b&&!yl(b,S)&&e(),b=S,p=requestAnimationFrame(_)}return e(),()=>{var S;f.forEach(A=>{s&&A.removeEventListener("scroll",e),o&&A.removeEventListener("resize",e)}),h==null||h(),(S=m)==null||S.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const gf=Lh,pf=Bh,vf=Nh,mf=Wh,bf=Dh,yf=Fh,wf=Uh,xf=(n,t,e)=>{const r=new Map,s={platform:df,...e},o={...s.platform,_c:r};return Rh(n,t,{...s,platform:o})};function _n(n){return typeof n=="function"?n():n}function wl(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function rc(n,t){const e=wl(n);return Math.round(t*e)/e}function sc(n){return{[`--bits-${n}-content-transform-origin`]:"var(--bits-floating-transform-origin)",[`--bits-${n}-content-available-width`]:"var(--bits-floating-available-width)",[`--bits-${n}-content-available-height`]:"var(--bits-floating-available-height)",[`--bits-${n}-anchor-width`]:"var(--bits-floating-anchor-width)",[`--bits-${n}-anchor-height`]:"var(--bits-floating-anchor-height)"}}function Sf(n){const t=n.whileElementsMounted,e=O(()=>_n(n.open)??!0),r=O(()=>_n(n.middleware)),s=O(()=>_n(n.transform)??!0),o=O(()=>_n(n.placement)??"bottom"),i=O(()=>_n(n.strategy)??"absolute"),a=O(()=>_n(n.sideOffset)??0),l=O(()=>_n(n.alignOffset)??0),d=n.reference;let f=X(0),h=X(0);const g=Ue(null);let m=X(Ar(u(i))),p=X(Ar(u(o))),b=X(Ar({})),_=X(!1);const S=O(()=>{const N=g.current?rc(g.current,u(f)):u(f),I=g.current?rc(g.current,u(h)):u(h);return u(s)?{position:u(m),left:"0",top:"0",transform:`translate(${N}px, ${I}px)`,...g.current&&wl(g.current)>=1.5&&{willChange:"transform"}}:{position:u(m),left:`${N}px`,top:`${I}px`}});let A;function R(){d.current===null||g.current===null||xf(d.current,g.current,{middleware:u(r),placement:u(o),strategy:u(i)}).then(N=>{if(!u(e)&&u(f)!==0&&u(h)!==0){const I=Math.max(Math.abs(u(a)),Math.abs(u(l)),15);if(N.x<=I&&N.y<=I)return}C(f,N.x,!0),C(h,N.y,!0),C(m,N.strategy,!0),C(p,N.placement,!0),C(b,N.middlewareData,!0),C(_,!0)})}function x(){typeof A=="function"&&(A(),A=void 0)}function q(){if(x(),t===void 0){R();return}d.current===null||g.current===null||(A=t(d.current,g.current,R))}function B(){u(e)||C(_,!1)}return Wt(R),Wt(q),Wt(B),Wt(()=>x),{floating:g,reference:d,get strategy(){return u(m)},get placement(){return u(p)},get middlewareData(){return u(b)},get isPositioned(){return u(_)},get floatingStyles(){return u(S)},get update(){return R}}}const _f={top:"bottom",right:"left",bottom:"top",left:"right"},ia=new vn("Floating.Root"),oc=new vn("Floating.Content"),aa=new vn("Floating.Root");class wo{constructor(){E(this,"anchorNode",Ue(null));E(this,"customAnchorNode",Ue(null));E(this,"triggerNode",Ue(null));Wt(()=>{this.customAnchorNode.current?typeof this.customAnchorNode.current=="string"?this.anchorNode.current=document.querySelector(this.customAnchorNode.current):this.anchorNode.current=this.customAnchorNode.current:this.anchorNode.current=this.triggerNode.current})}static create(t=!1){return t?aa.set(new wo):ia.set(new wo)}}var Ps,Ko,Cs,zo,Os,Vo,As,Ts,Es,Is,ks,Rs,Fs,Ns,Ds,Ms,Ls,Bs,Us,Ws,js,qs,Ks,zs;const Ho=class Ho{constructor(t,e){E(this,"opts");E(this,"root");E(this,"contentRef",Ue(null));E(this,"wrapperRef",Ue(null));E(this,"arrowRef",Ue(null));E(this,"contentAttachment",ge(this.contentRef));E(this,"wrapperAttachment",ge(this.wrapperRef));E(this,"arrowAttachment",ge(this.arrowRef));E(this,"arrowId",Ue($i()));y(this,Ps,O(()=>{if(typeof this.opts.style=="string")return Su(this.opts.style);if(!this.opts.style)return{}}));y(this,Ko);y(this,Cs,new Vu(()=>this.arrowRef.current??void 0));y(this,zo,O(()=>{var t;return((t=c(this,Cs))==null?void 0:t.width)??0}));y(this,Os,O(()=>{var t;return((t=c(this,Cs))==null?void 0:t.height)??0}));y(this,Vo,O(()=>{var t;return((t=this.opts.side)==null?void 0:t.current)+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:"")}));y(this,As,O(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]));y(this,Ts,O(()=>u(c(this,As)).length>0));y(this,Es,O(()=>({padding:this.opts.collisionPadding.current,boundary:u(c(this,As)).filter(ld),altBoundary:this.hasExplicitBoundaries})));y(this,Is,X(void 0));y(this,ks,X(void 0));y(this,Rs,X(void 0));y(this,Fs,X(void 0));y(this,Ns,O(()=>[gf({mainAxis:this.opts.sideOffset.current+u(c(this,Os)),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&pf({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?wf():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&vf({...this.detectOverflowOptions}),mf({...this.detectOverflowOptions,apply:({rects:t,availableWidth:e,availableHeight:r})=>{const{width:s,height:o}=t.reference;C(c(this,Is),e,!0),C(c(this,ks),r,!0),C(c(this,Rs),s,!0),C(c(this,Fs),o,!0)}}),this.arrowRef.current&&yf({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),Pf({arrowWidth:u(c(this,zo)),arrowHeight:u(c(this,Os))}),this.opts.hideWhenDetached.current&&bf({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean)));E(this,"floating");y(this,Ds,O(()=>Cf(this.floating.placement)));y(this,Ms,O(()=>Of(this.floating.placement)));y(this,Ls,O(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.x)??0}));y(this,Bs,O(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.y)??0}));y(this,Us,O(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.centerOffset)!==0}));y(this,Ws,X());y(this,js,O(()=>_f[this.placedSide]));y(this,qs,O(()=>{var t,e,r;return{id:this.opts.wrapperId.current,"data-bits-floating-content-wrapper":"",style:{...this.floating.floatingStyles,transform:this.floating.isPositioned?this.floating.floatingStyles.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:this.contentZIndex,"--bits-floating-transform-origin":`${(t=this.floating.middlewareData.transformOrigin)==null?void 0:t.x} ${(e=this.floating.middlewareData.transformOrigin)==null?void 0:e.y}`,"--bits-floating-available-width":`${u(c(this,Is))}px`,"--bits-floating-available-height":`${u(c(this,ks))}px`,"--bits-floating-anchor-width":`${u(c(this,Rs))}px`,"--bits-floating-anchor-height":`${u(c(this,Fs))}px`,...((r=this.floating.middlewareData.hide)==null?void 0:r.referenceHidden)&&{visibility:"hidden","pointer-events":"none"},...u(c(this,Ps))},dir:this.opts.dir.current,...this.wrapperAttachment}}));y(this,Ks,O(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:_u({...u(c(this,Ps))}),...this.contentAttachment})));y(this,zs,O(()=>({position:"absolute",left:this.arrowX?`${this.arrowX}px`:void 0,top:this.arrowY?`${this.arrowY}px`:void 0,[this.arrowBaseSide]:0,"transform-origin":{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[this.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[this.placedSide],visibility:this.cannotCenterArrow?"hidden":void 0})));this.opts=t,this.root=e,t.customAnchor&&(this.root.customAnchorNode.current=t.customAnchor.current),qt(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=Sf({strategy:()=>this.opts.strategy.current,placement:()=>u(c(this,Vo)),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>{var o;return ff(...r,{animationFrame:((o=c(this,Ko))==null?void 0:o.current)==="always"})},open:()=>this.opts.enabled.current,sideOffset:()=>this.opts.sideOffset.current,alignOffset:()=>this.opts.alignOffset.current}),Wt(()=>{var r;this.floating.isPositioned&&((r=this.opts.onPlaced)==null||r.current())}),qt(()=>this.contentRef.current,r=>{if(!r)return;const s=Hi(r);this.contentZIndex=s.getComputedStyle(r).zIndex}),Wt(()=>{this.floating.floating.current=this.wrapperRef.current})}static create(t,e=!1){return e?oc.set(new Ho(t,aa.get())):oc.set(new Ho(t,ia.get()))}get hasExplicitBoundaries(){return u(c(this,Ts))}set hasExplicitBoundaries(t){C(c(this,Ts),t)}get detectOverflowOptions(){return u(c(this,Es))}set detectOverflowOptions(t){C(c(this,Es),t)}get middleware(){return u(c(this,Ns))}set middleware(t){C(c(this,Ns),t)}get placedSide(){return u(c(this,Ds))}set placedSide(t){C(c(this,Ds),t)}get placedAlign(){return u(c(this,Ms))}set placedAlign(t){C(c(this,Ms),t)}get arrowX(){return u(c(this,Ls))}set arrowX(t){C(c(this,Ls),t)}get arrowY(){return u(c(this,Bs))}set arrowY(t){C(c(this,Bs),t)}get cannotCenterArrow(){return u(c(this,Us))}set cannotCenterArrow(t){C(c(this,Us),t)}get contentZIndex(){return u(c(this,Ws))}set contentZIndex(t){C(c(this,Ws),t,!0)}get arrowBaseSide(){return u(c(this,js))}set arrowBaseSide(t){C(c(this,js),t)}get wrapperProps(){return u(c(this,qs))}set wrapperProps(t){C(c(this,qs),t)}get props(){return u(c(this,Ks))}set props(t){C(c(this,Ks),t)}get arrowStyle(){return u(c(this,zs))}set arrowStyle(t){C(c(this,zs),t)}};Ps=new WeakMap,Ko=new WeakMap,Cs=new WeakMap,zo=new WeakMap,Os=new WeakMap,Vo=new WeakMap,As=new WeakMap,Ts=new WeakMap,Es=new WeakMap,Is=new WeakMap,ks=new WeakMap,Rs=new WeakMap,Fs=new WeakMap,Ns=new WeakMap,Ds=new WeakMap,Ms=new WeakMap,Ls=new WeakMap,Bs=new WeakMap,Us=new WeakMap,Ws=new WeakMap,js=new WeakMap,qs=new WeakMap,Ks=new WeakMap,zs=new WeakMap;let ji=Ho;class xo{constructor(t,e){E(this,"opts");E(this,"root");this.opts=t,this.root=e,t.virtualEl&&t.virtualEl.current?e.triggerNode=bc(t.virtualEl.current):e.triggerNode=t.ref}static create(t,e=!1){return e?new xo(t,aa.get()):new xo(t,ia.get())}}function Pf(n){return{name:"transformOrigin",options:n,fn(t){var _,S,A;const{placement:e,rects:r,middlewareData:s}=t,i=((_=s.arrow)==null?void 0:_.centerOffset)!==0,a=i?0:n.arrowWidth,l=i?0:n.arrowHeight,[d,f]=ca(e),h={start:"0%",center:"50%",end:"100%"}[f],g=(((S=s.arrow)==null?void 0:S.x)??0)+a/2,m=(((A=s.arrow)==null?void 0:A.y)??0)+l/2;let p="",b="";return d==="bottom"?(p=i?h:`${g}px`,b=`${-l}px`):d==="top"?(p=i?h:`${g}px`,b=`${r.floating.height+l}px`):d==="right"?(p=`${-l}px`,b=i?h:`${m}px`):d==="left"&&(p=`${r.floating.width+l}px`,b=i?h:`${m}px`),{data:{x:p,y:b}}}}}function ca(n){const[t,e="center"]=n.split("-");return[t,e]}function Cf(n){return ca(n)[0]}function Of(n){return ca(n)[1]}function Af(n,t){G(t,!0);let e=w(t,"tooltip",3,!1);wo.create(e());var r=L(),s=T(r);H(s,()=>t.children??st),v(n,r),Y()}function Tf(n,t){G(t,!0);let e=w(t,"tooltip",3,!1);xo.create({id:k(()=>t.id),virtualEl:k(()=>t.virtualEl),ref:t.ref},e());var r=L(),s=T(r);H(s,()=>t.children??st),v(n,r),Y()}function Ef(n,t){G(t,!0);let e=w(t,"side",3,"bottom"),r=w(t,"sideOffset",3,0),s=w(t,"align",3,"center"),o=w(t,"alignOffset",3,0),i=w(t,"arrowPadding",3,0),a=w(t,"avoidCollisions",3,!0),l=w(t,"collisionBoundary",19,()=>[]),d=w(t,"collisionPadding",3,0),f=w(t,"hideWhenDetached",3,!1),h=w(t,"onPlaced",3,()=>{}),g=w(t,"sticky",3,"partial"),m=w(t,"updatePositionStrategy",3,"optimized"),p=w(t,"strategy",3,"fixed"),b=w(t,"dir",3,"ltr"),_=w(t,"style",19,()=>({})),S=w(t,"wrapperId",19,$i),A=w(t,"customAnchor",3,null),R=w(t,"tooltip",3,!1);const x=ji.create({side:k(()=>e()),sideOffset:k(()=>r()),align:k(()=>s()),alignOffset:k(()=>o()),id:k(()=>t.id),arrowPadding:k(()=>i()),avoidCollisions:k(()=>a()),collisionBoundary:k(()=>l()),collisionPadding:k(()=>d()),hideWhenDetached:k(()=>f()),onPlaced:k(()=>h()),sticky:k(()=>g()),updatePositionStrategy:k(()=>m()),strategy:k(()=>p()),dir:k(()=>b()),style:k(()=>_()),enabled:k(()=>t.enabled),wrapperId:k(()=>S()),customAnchor:k(()=>A())},R()),q=O(()=>jt(x.wrapperProps,{style:{pointerEvents:"auto"}}));var B=L(),N=T(B);H(N,()=>t.content??st,()=>({props:x.props,wrapperProps:u(q)})),v(n,B),Y()}function If(n,t){G(t,!0),uu(()=>{var s;(s=t.onPlaced)==null||s.call(t)});var e=L(),r=T(e);H(r,()=>t.content??st,()=>({props:{},wrapperProps:{}})),v(n,e),Y()}function kf(n,t){let e=w(t,"isStatic",3,!1),r=ot(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var s=L(),o=T(s);{var i=l=>{If(l,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},a=l=>{Ef(l,_t({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};bt(o,l=>{e()?l(i):l(a,!1)})}v(n,s)}var Rf=K(" ",1);function xl(n,t){G(t,!0);let e=w(t,"interactOutsideBehavior",3,"close"),r=w(t,"trapFocus",3,!0),s=w(t,"isValidEvent",3,()=>!1),o=w(t,"customAnchor",3,null),i=w(t,"isStatic",3,!1),a=w(t,"tooltip",3,!1),l=w(t,"contentPointerEvents",3,"auto"),d=ot(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled","ref","tooltip","contentPointerEvents"]);kf(n,{get isStatic(){return i()},get id(){return t.id},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return o()},get enabled(){return t.enabled},get tooltip(){return a()},content:(h,g)=>{let m=()=>g==null?void 0:g().props,p=()=>g==null?void 0:g().wrapperProps;var b=Rf(),_=T(b);{var S=x=>{vo(x,{get preventScroll(){return t.preventScroll}})},A=x=>{vo(x,{get preventScroll(){return t.preventScroll}})};bt(_,x=>{t.forceMount&&t.enabled?x(S):t.forceMount||x(A,1)})}var R=F(_,2);ol(R,{get onOpenAutoFocus(){return t.onOpenAutoFocus},get onCloseAutoFocus(){return t.onCloseAutoFocus},get loop(){return t.loop},get enabled(){return t.enabled},get trapFocus(){return r()},get forceMount(){return t.forceMount},get ref(){return t.ref},focusScope:(q,B)=>{let N=()=>B==null?void 0:B().props;tl(q,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(I,tt)=>{$c(I,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return e()},get isValidEvent(){return s()},get enabled(){return t.enabled},get ref(){return t.ref},children:(Ct,yt)=>{let At=()=>yt==null?void 0:yt().props;al(Ct,{get id(){return t.id},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get enabled(){return t.enabled},get ref(){return t.ref},children:(ut,vt)=>{var it=L(),ft=T(it);{let et=O(()=>({props:jt(d,m(),At(),N(),{style:{pointerEvents:l()}}),wrapperProps:p()}));H(ft,()=>t.popper??st,()=>u(et))}v(ut,it)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),v(h,b)},$$slots:{content:!0}}),Y()}function Ff(n,t){let e=w(t,"interactOutsideBehavior",3,"close"),r=w(t,"trapFocus",3,!0),s=w(t,"isValidEvent",3,()=>!1),o=w(t,"customAnchor",3,null),i=w(t,"isStatic",3,!1),a=ot(t,["$$slots","$$events","$$legacy","popper","open","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","ref","shouldRender"]);var l=L(),d=T(l);{var f=h=>{xl(h,_t({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return o()},get isStatic(){return i()},get enabled(){return t.open},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return e()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return s()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>a))};bt(d,h=>{t.shouldRender&&h(f)})}v(n,l)}function Nf(n,t){let e=w(t,"interactOutsideBehavior",3,"close"),r=w(t,"trapFocus",3,!0),s=w(t,"isValidEvent",3,()=>!1),o=w(t,"customAnchor",3,null),i=w(t,"isStatic",3,!1),a=ot(t,["$$slots","$$events","$$legacy","popper","onEscapeKeydown","escapeKeydownBehavior","preventOverflowTextSelection","id","onPointerDown","onPointerUp","side","sideOffset","align","alignOffset","arrowPadding","avoidCollisions","collisionBoundary","collisionPadding","sticky","hideWhenDetached","updatePositionStrategy","strategy","dir","preventScroll","wrapperId","style","onPlaced","onInteractOutside","onCloseAutoFocus","onOpenAutoFocus","onFocusOutside","interactOutsideBehavior","loop","trapFocus","isValidEvent","customAnchor","isStatic","enabled"]);xl(n,_t({get popper(){return t.popper},get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get preventOverflowTextSelection(){return t.preventOverflowTextSelection},get id(){return t.id},get onPointerDown(){return t.onPointerDown},get onPointerUp(){return t.onPointerUp},get side(){return t.side},get sideOffset(){return t.sideOffset},get align(){return t.align},get alignOffset(){return t.alignOffset},get arrowPadding(){return t.arrowPadding},get avoidCollisions(){return t.avoidCollisions},get collisionBoundary(){return t.collisionBoundary},get collisionPadding(){return t.collisionPadding},get sticky(){return t.sticky},get hideWhenDetached(){return t.hideWhenDetached},get updatePositionStrategy(){return t.updatePositionStrategy},get strategy(){return t.strategy},get dir(){return t.dir},get preventScroll(){return t.preventScroll},get wrapperId(){return t.wrapperId},get style(){return t.style},get onPlaced(){return t.onPlaced},get customAnchor(){return o()},get isStatic(){return i()},get enabled(){return t.enabled},get onInteractOutside(){return t.onInteractOutside},get onCloseAutoFocus(){return t.onCloseAutoFocus},get onOpenAutoFocus(){return t.onOpenAutoFocus},get interactOutsideBehavior(){return e()},get loop(){return t.loop},get trapFocus(){return r()},get isValidEvent(){return s()},get onFocusOutside(){return t.onFocusOutside}},()=>a,{forceMount:!0}))}var Df=K("
");function Mf(n,t){const e=fn();G(t,!0);let r=w(t,"ref",15,null),s=w(t,"id",19,()=>gn(e)),o=w(t,"disabled",3,!1),i=w(t,"onSelect",3,Pt),a=w(t,"closeOnSelect",3,!0),l=ot(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const d=Ei.create({id:k(()=>s()),disabled:k(()=>o()),onSelect:k(()=>i()),ref:k(()=>r(),b=>r(b)),closeOnSelect:k(()=>a())}),f=O(()=>jt(l,d.props));var h=L(),g=T(h);{var m=b=>{var _=L(),S=T(_);H(S,()=>t.child,()=>({props:u(f)})),v(b,_)},p=b=>{var _=Df();Rt(_,()=>({...u(f)}));var S=W(_);H(S,()=>t.children??st),j(_),v(b,_)};bt(g,b=>{t.child?b(m):b(p,!1)})}v(n,h),Y()}function Lf(n,t){G(t,!0);let e=w(t,"open",15,!1),r=w(t,"onOpenChange",3,Pt),s=w(t,"onOpenChangeComplete",3,Pt);vi.create({variant:k(()=>"dialog"),open:k(()=>e(),a=>{e(a),r()(a)}),onOpenChangeComplete:k(()=>s())});var o=L(),i=T(o);H(i,()=>t.children??st),v(n,o),Y()}var Bf=K("");function Uf(n,t){const e=fn();G(t,!0);let r=w(t,"id",19,()=>gn(e)),s=w(t,"ref",15,null),o=w(t,"disabled",3,!1),i=ot(t,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const a=mi.create({variant:k(()=>"close"),id:k(()=>r()),ref:k(()=>s(),m=>s(m)),disabled:k(()=>!!o())}),l=O(()=>jt(i,a.props));var d=L(),f=T(d);{var h=m=>{var p=L(),b=T(p);H(b,()=>t.child,()=>({props:u(l)})),v(m,p)},g=m=>{var p=Bf();Rt(p,()=>({...u(l)}));var b=W(p);H(b,()=>t.children??st),j(p),v(m,p)};bt(f,m=>{t.child?m(h):m(g,!1)})}v(n,d),Y()}var Wf=K(" ",1),jf=K("
",1);function qf(n,t){const e=fn();G(t,!0);let r=w(t,"id",19,()=>gn(e)),s=w(t,"ref",15,null),o=w(t,"forceMount",3,!1),i=w(t,"onCloseAutoFocus",3,Pt),a=w(t,"onOpenAutoFocus",3,Pt),l=w(t,"onEscapeKeydown",3,Pt),d=w(t,"onInteractOutside",3,Pt),f=w(t,"trapFocus",3,!0),h=w(t,"preventScroll",3,!0),g=w(t,"restoreScrollDelay",3,null),m=ot(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const p=wi.create({id:k(()=>r()),ref:k(()=>s(),R=>s(R))}),b=O(()=>jt(m,p.props));var _=L(),S=T(_);{var A=R=>{ol(R,{get ref(){return p.opts.ref},loop:!0,get trapFocus(){return f()},get enabled(){return p.root.opts.open.current},get onOpenAutoFocus(){return a()},get onCloseAutoFocus(){return i()},focusScope:(q,B)=>{let N=()=>B==null?void 0:B().props;tl(q,_t(()=>u(b),{get enabled(){return p.root.opts.open.current},get ref(){return p.opts.ref},onEscapeKeydown:I=>{l()(I),!I.defaultPrevented&&p.root.handleClose()},children:(I,tt)=>{$c(I,_t(()=>u(b),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},onInteractOutside:Z=>{d()(Z),!Z.defaultPrevented&&p.root.handleClose()},children:(Z,Ct)=>{al(Z,_t(()=>u(b),{get ref(){return p.opts.ref},get enabled(){return p.root.opts.open.current},children:(yt,At)=>{var ut=L(),vt=T(ut);{var it=et=>{var Ot=Wf(),ne=T(Ot);{var Kt=Mt=>{vo(Mt,{get preventScroll(){return h()},get restoreScrollDelay(){return g()}})};bt(ne,Mt=>{p.root.opts.open.current&&Mt(Kt)})}var Zt=F(ne,2);{let Mt=O(()=>({props:jt(u(b),N()),...p.snippetProps}));H(Zt,()=>t.child,()=>u(Mt))}v(et,Ot)},ft=et=>{var Ot=jf(),ne=T(Ot);vo(ne,{get preventScroll(){return h()}});var Kt=F(ne,2);Rt(Kt,Mt=>({...Mt}),[()=>jt(u(b),N())]);var Zt=W(Kt);H(Zt,()=>t.children??st),j(Kt),v(et,Ot)};bt(vt,et=>{t.child?et(it):et(ft,!1)})}v(yt,ut)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};bt(S,R=>{(p.shouldRender||o())&&R(A)})}v(n,_),Y()}function Kf(n,t){G(t,!0);let e=w(t,"open",15,!1),r=w(t,"dir",3,"ltr"),s=w(t,"onOpenChange",3,Pt),o=w(t,"onOpenChangeComplete",3,Pt),i=w(t,"_internal_variant",3,"dropdown-menu");const a=Oi.create({variant:k(()=>i()),dir:k(()=>r()),onClose:()=>{e(!1),s()(!1)}});Ai.create({open:k(()=>e(),l=>{e(l),s()(l)}),onOpenChangeComplete:k(()=>o())},a),Af(n,{children:(l,d)=>{var f=L(),h=T(f);H(h,()=>t.children??st),v(l,f)},$$slots:{default:!0}}),Y()}var zf=K("
"),Vf=K("
");function Hf(n,t){const e=fn();G(t,!0);let r=w(t,"id",19,()=>gn(e)),s=w(t,"ref",15,null),o=w(t,"loop",3,!0),i=w(t,"onInteractOutside",3,Pt),a=w(t,"onEscapeKeydown",3,Pt),l=w(t,"onCloseAutoFocus",3,Pt),d=w(t,"forceMount",3,!1),f=w(t,"trapFocus",3,!1),h=ot(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const g=Ti.create({id:k(()=>r()),loop:k(()=>o()),ref:k(()=>s(),x=>s(x)),onCloseAutoFocus:k(()=>l())}),m=O(()=>jt(h,g.props));function p(x){if(g.handleInteractOutside(x),!x.defaultPrevented&&(i()(x),!x.defaultPrevented)){if(x.target&&x.target instanceof Element){const q=`[${g.parentMenu.root.getBitsAttr("sub-content")}]`;if(x.target.closest(q))return}g.parentMenu.onClose()}}function b(x){a()(x),!x.defaultPrevented&&g.parentMenu.onClose()}var _=L(),S=T(_);{var A=x=>{Nf(x,_t(()=>u(m),()=>g.popperProps,{get ref(){return g.opts.ref},get enabled(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:b,get trapFocus(){return f()},get loop(){return o()},forceMount:!0,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(B,N)=>{let I=()=>N==null?void 0:N().props,tt=()=>N==null?void 0:N().wrapperProps;const Z=O(()=>jt(I(),{style:sc("dropdown-menu")},{style:t.style}));var Ct=L(),yt=T(Ct);{var At=vt=>{var it=L(),ft=T(it);{let et=O(()=>({props:u(Z),wrapperProps:tt(),...g.snippetProps}));H(ft,()=>t.child,()=>u(et))}v(vt,it)},ut=vt=>{var it=zf();Rt(it,()=>({...tt()}));var ft=W(it);Rt(ft,()=>({...u(Z)}));var et=W(ft);H(et,()=>t.children??st),j(ft),j(it),v(vt,it)};bt(yt,vt=>{t.child?vt(At):vt(ut,!1)})}v(B,Ct)},$$slots:{popper:!0}}))},R=x=>{Ff(x,_t(()=>u(m),()=>g.popperProps,{get ref(){return g.opts.ref},get open(){return g.parentMenu.opts.open.current},onInteractOutside:p,onEscapeKeydown:b,get trapFocus(){return f()},get loop(){return o()},forceMount:!1,get id(){return r()},get shouldRender(){return g.shouldRender},popper:(B,N)=>{let I=()=>N==null?void 0:N().props,tt=()=>N==null?void 0:N().wrapperProps;const Z=O(()=>jt(I(),{style:sc("dropdown-menu")},{style:t.style}));var Ct=L(),yt=T(Ct);{var At=vt=>{var it=L(),ft=T(it);{let et=O(()=>({props:u(Z),wrapperProps:tt(),...g.snippetProps}));H(ft,()=>t.child,()=>u(et))}v(vt,it)},ut=vt=>{var it=Vf();Rt(it,()=>({...tt()}));var ft=W(it);Rt(ft,()=>({...u(Z)}));var et=W(ft);H(et,()=>t.children??st),j(ft),j(it),v(vt,it)};bt(yt,vt=>{t.child?vt(At):vt(ut,!1)})}v(B,Ct)},$$slots:{popper:!0}}))};bt(S,x=>{d()?x(A):d()||x(R,1)})}v(n,_),Y()}var Gf=K("");function Yf(n,t){const e=fn();G(t,!0);let r=w(t,"id",19,()=>gn(e)),s=w(t,"ref",15,null),o=w(t,"disabled",3,!1),i=w(t,"type",3,"button"),a=ot(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const l=Ii.create({id:k(()=>r()),disabled:k(()=>o()??!1),ref:k(()=>s(),f=>s(f))}),d=O(()=>jt(a,l.props,{type:i()}));Tf(n,{get id(){return r()},get ref(){return l.opts.ref},children:(f,h)=>{var g=L(),m=T(g);{var p=_=>{var S=L(),A=T(S);H(A,()=>t.child,()=>({props:u(d)})),v(_,S)},b=_=>{var S=Gf();Rt(S,()=>({...u(d)}));var A=W(S);H(A,()=>t.children??st),j(S),v(_,S)};bt(m,_=>{t.child?_(p):_(b,!1)})}v(f,g)},$$slots:{default:!0}}),Y()}function Xf(n,t){G(t,!0);let e=w(t,"open",15,!1),r=ot(t,["$$slots","$$events","$$legacy","open"]);var s=L(),o=T(s);U(o,()=>Lf,(i,a)=>{a(i,_t(()=>r,{get open(){return e()},set open(l){e(l)}}))}),v(n,s),Y()}function Jf(n,t){let e=ot(t,["$$slots","$$events","$$legacy"]);var r=L(),s=T(r);U(s,()=>Rc,(o,i)=>{i(o,_t(()=>e))}),v(n,r)}function Zf(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class"]);var s=L(),o=T(s);{let i=O(()=>oe("text-lg leading-none font-semibold",t.class));U(o,()=>pd,(a,l)=>{l(a,_t({"data-slot":"dialog-title",get class(){return u(i)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}v(n,s),Y()}var Qf=K("
");function $f(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class","children"]);var s=Qf();Rt(s,i=>({"data-slot":"dialog-header",class:i,...r}),[()=>oe("flex flex-col gap-2 text-center sm:text-start",t.class)]);var o=W(s);H(o,()=>t.children??st),j(s),pn(s,i=>e(i),()=>e()),v(n,s),Y()}function tg(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class"]);var s=L(),o=T(s);{let i=O(()=>oe("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t.class));U(o,()=>mh,(a,l)=>{l(a,_t({"data-slot":"dialog-overlay",get class(){return u(i)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}v(n,s),Y()}/** * @license @lucide/svelte v0.561.0 - ISC * * ISC License * * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * --- * * The MIT License (MIT) (for portions derived from Feather) * * Copyright (c) 2013-2023 Cole Bemis * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */const eg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};var ng=su("");function fr(n,t){G(t,!0);const e=w(t,"color",3,"currentColor"),r=w(t,"size",3,24),s=w(t,"strokeWidth",3,2),o=w(t,"absoluteStrokeWidth",3,!1),i=w(t,"iconNode",19,()=>[]),a=ot(t,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var l=ng();Rt(l,h=>({...eg,...a,width:r(),height:r(),stroke:e(),"stroke-width":h,class:["lucide-icon lucide",t.name&&`lucide-${t.name}`,t.class]}),[()=>o()?Number(s())*24/Number(r()):s()]);var d=W(l);cn(d,17,i,Pn,(h,g)=>{var m=O(()=>ou(u(g),2));let p=()=>u(m)[0],b=()=>u(m)[1];var _=L(),S=T(_);fu(S,p,!0,(A,R)=>{Rt(A,()=>({...b()}))}),v(h,_)});var f=F(d);H(f,()=>t.children??st),j(l),v(n,l),Y()}function Sl(n,t){G(t,!0);/** * @license @lucide/svelte v0.561.0 - ISC * * ISC License * * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * --- * * The MIT License (MIT) (for portions derived from Feather) * * Copyright (c) 2013-2023 Cole Bemis * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */let e=ot(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];fr(n,_t({name:"x"},()=>e,{get iconNode(){return r},children:(s,o)=>{var i=L(),a=T(i);H(a,()=>t.children??st),v(s,i)},$$slots:{default:!0}})),Y()}var rg=K(' Close',1),sg=K(" ",1),og=K(" ",1);function ig(n,t){G(t,!0);let e=w(t,"ref",15,null),r=w(t,"showCloseButton",3,!0),s=ot(t,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);Jf(n,_t(()=>t.portalProps,{children:(o,i)=>{var a=og(),l=T(a);U(l,()=>tg,(f,h)=>{h(f,{})});var d=F(l,2);{let f=O(()=>oe("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t.class));U(d,()=>qf,(h,g)=>{g(h,_t({"data-slot":"dialog-content",get class(){return u(f)}},()=>s,{get ref(){return e()},set ref(m){e(m)},children:(m,p)=>{var b=sg(),_=T(b);H(_,()=>t.children??st);var S=F(_,2);{var A=R=>{var x=L(),q=T(x);U(q,()=>Uf,(B,N)=>{N(B,{class:"ring-offset-background focus:ring-ring absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:(I,tt)=>{var Z=rg(),Ct=T(Z);Sl(Ct,{}),V(2),v(I,Z)},$$slots:{default:!0}})}),v(R,x)};bt(S,R=>{r()&&R(A)})}v(m,b)},$$slots:{default:!0}}))})}v(o,a)},$$slots:{default:!0}})),Y()}function ag(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref","class"]);var s=L(),o=T(s);{let i=O(()=>oe("text-muted-foreground text-sm",t.class));U(o,()=>yh,(a,l)=>{l(a,_t({"data-slot":"dialog-description",get class(){return u(i)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}v(n,s),Y()}function cg(n,t){G(t,!0);let e=w(t,"open",15,!1),r=ot(t,["$$slots","$$events","$$legacy","open"]);var s=L(),o=T(s);U(o,()=>Kf,(i,a)=>{a(i,_t(()=>r,{get open(){return e()},set open(l){e(l)}}))}),v(n,s),Y()}function _l(n,t){let e=ot(t,["$$slots","$$events","$$legacy"]);var r=L(),s=T(r);U(s,()=>Rc,(o,i)=>{i(o,_t(()=>e))}),v(n,r)}function lg(n,t){G(t,!0);let e=w(t,"ref",15,null),r=w(t,"sideOffset",3,4),s=ot(t,["$$slots","$$events","$$legacy","ref","sideOffset","portalProps","class"]);_l(n,_t(()=>t.portalProps,{children:(o,i)=>{var a=L(),l=T(a);{let d=O(()=>oe("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-end-2 data-[side=right]:slide-in-from-start-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--bits-dropdown-menu-content-available-height) min-w-[8rem] origin-(--bits-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md outline-none",t.class));U(l,()=>Hf,(f,h)=>{h(f,_t({"data-slot":"dropdown-menu-content",get sideOffset(){return r()},get class(){return u(d)}},()=>s,{get ref(){return e()},set ref(g){e(g)}}))})}v(o,a)},$$slots:{default:!0}})),Y()}function ic(n,t){G(t,!0);let e=w(t,"ref",15,null),r=w(t,"variant",3,"default"),s=ot(t,["$$slots","$$events","$$legacy","ref","class","inset","variant"]);var o=L(),i=T(o);{let a=O(()=>oe("data-highlighted:bg-accent data-highlighted:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:data-highlighted:bg-destructive/10 dark:data-[variant=destructive]:data-highlighted:bg-destructive/20 data-[variant=destructive]:data-highlighted:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:ps-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t.class));U(i,()=>Mf,(l,d)=>{d(l,_t({"data-slot":"dropdown-menu-item",get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return u(a)}},()=>s,{get ref(){return e()},set ref(f){e(f)}}))})}v(n,o),Y()}function ug(n,t){G(t,!0);let e=w(t,"ref",15,null),r=ot(t,["$$slots","$$events","$$legacy","ref"]);var s=L(),o=T(s);U(o,()=>Yf,(i,a)=>{a(i,_t({"data-slot":"dropdown-menu-trigger"},()=>r,{get ref(){return e()},set ref(l){e(l)}}))}),v(n,s),Y()}function dg(n,t){G(t,!0);/** * @license @lucide/svelte v0.561.0 - ISC * * ISC License * * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * --- * * The MIT License (MIT) (for portions derived from Feather) * * Copyright (c) 2013-2023 Cole Bemis * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */let e=ot(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z"}],["circle",{cx:"12",cy:"13",r:"3"}]];fr(n,_t({name:"camera"},()=>e,{get iconNode(){return r},children:(s,o)=>{var i=L(),a=T(i);H(a,()=>t.children??st),v(s,i)},$$slots:{default:!0}})),Y()}function hg(n,t){G(t,!0);/** * @license @lucide/svelte v0.561.0 - ISC * * ISC License * * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * --- * * The MIT License (MIT) (for portions derived from Feather) * * Copyright (c) 2013-2023 Cole Bemis * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */let e=ot(t,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"1"}],["circle",{cx:"19",cy:"12",r:"1"}],["circle",{cx:"5",cy:"12",r:"1"}]];fr(n,_t({name:"ellipsis"},()=>e,{get iconNode(){return r},children:(s,o)=>{var i=L(),a=T(i);H(a,()=>t.children??st),v(s,i)},$$slots:{default:!0}})),Y()}function fg(n,t){G(t,!0);/** * @license @lucide/svelte v0.561.0 - ISC * * ISC License * * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * --- * * The MIT License (MIT) (for portions derived from Feather) * * Copyright (c) 2013-2023 Cole Bemis * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */let e=ot(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"}],["path",{d:"m15 5 4 4"}]];fr(n,_t({name:"pencil"},()=>e,{get iconNode(){return r},children:(s,o)=>{var i=L(),a=T(i);H(a,()=>t.children??st),v(s,i)},$$slots:{default:!0}})),Y()}function gg(n,t){G(t,!0);/** * @license @lucide/svelte v0.561.0 - ISC * * ISC License * * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * --- * * The MIT License (MIT) (for portions derived from Feather) * * Copyright (c) 2013-2023 Cole Bemis * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */let e=ot(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];fr(n,_t({name:"plus"},()=>e,{get iconNode(){return r},children:(s,o)=>{var i=L(),a=T(i);H(a,()=>t.children??st),v(s,i)},$$slots:{default:!0}})),Y()}function pg(n,t){G(t,!0);/** * @license @lucide/svelte v0.561.0 - ISC * * ISC License * * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2023 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2025. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * * --- * * The MIT License (MIT) (for portions derived from Feather) * * Copyright (c) 2013-2023 Cole Bemis * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. * */let e=ot(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 11v6"}],["path",{d:"M14 11v6"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}],["path",{d:"M3 6h18"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}]];fr(n,_t({name:"trash-2"},()=>e,{get iconNode(){return r},children:(s,o)=>{var i=L(),a=T(i);H(a,()=>t.children??st),v(s,i)},$$slots:{default:!0}})),Y()}class Jt extends Error{constructor(t){var e,r,s,o;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,Jt.prototype),t!==null&&typeof t=="object"&&(this.originalError=t.originalError,this.url=typeof t.url=="string"?t.url:"",this.status=typeof t.status=="number"?t.status:0,this.isAbort=!!t.isAbort||t.name==="AbortError"||t.message==="Aborted",t.response!==null&&typeof t.response=="object"?this.response=t.response:t.data!==null&&typeof t.data=="object"?this.response=t.data:this.response={}),this.originalError||t instanceof Jt||(this.originalError=t),this.name="ClientResponseError "+this.status,this.message=(e=this.response)==null?void 0:e.message,this.message||(this.isAbort?this.message="The request was aborted (most likely autocancelled; you can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation).":(o=(s=(r=this.originalError)==null?void 0:r.cause)==null?void 0:s.message)!=null&&o.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong."),this.cause=this.originalError}get data(){return this.response}toJSON(){return{...this}}}const eo=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function vg(n,t){const e={};if(typeof n!="string")return e;const r=Object.assign({},{}).decode||mg;let s=0;for(;s0&&(!e.exp||e.exp-t>Date.now()/1e3))}Pl=typeof atob!="function"||yg?n=>{let t=String(n).replace(/=+$/,"");if(t.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var e,r,s=0,o=0,i="";r=t.charAt(o++);~r&&(e=s%4?64*e+r:r,s++%4)?i+=String.fromCharCode(255&e>>(-2*s&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return i}:atob;const cc="pb_auth";class la{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get record(){return this.baseModel}get model(){return this.baseModel}get isValid(){return!Cl(this.token)}get isSuperuser(){var e,r;let t=Hn(this.token);return t.type=="auth"&&(((e=this.record)==null?void 0:e.collectionName)=="_superusers"||!((r=this.record)!=null&&r.collectionName)&&t.collectionId=="pbc_3142635823")}get isAdmin(){return console.warn("Please replace pb.authStore.isAdmin with pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),this.isSuperuser}get isAuthRecord(){return console.warn("Please replace pb.authStore.isAuthRecord with !pb.authStore.isSuperuser OR simply check the value of pb.authStore.record?.collectionName"),Hn(this.token).type=="auth"&&!this.isSuperuser}save(t,e){this.baseToken=t||"",this.baseModel=e||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(t,e=cc){const r=vg(t||"")[e]||"";let s={};try{s=JSON.parse(r),(typeof s===null||typeof s!="object"||Array.isArray(s))&&(s={})}catch{}this.save(s.token||"",s.record||s.model||null)}exportToCookie(t,e=cc){var l,d;const r={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},s=Hn(this.token);r.expires=s!=null&&s.exp?new Date(1e3*s.exp):new Date("1970-01-01"),t=Object.assign({},r,t);const o={token:this.token,record:this.record?JSON.parse(JSON.stringify(this.record)):null};let i=ac(e,JSON.stringify(o),t);const a=typeof Blob<"u"?new Blob([i]).size:i.length;if(o.record&&a>4096){o.record={id:(l=o.record)==null?void 0:l.id,email:(d=o.record)==null?void 0:d.email};const f=["collectionId","collectionName","verified"];for(const h in this.record)f.includes(h)&&(o.record[h]=this.record[h]);i=ac(e,JSON.stringify(o),t)}return i}onChange(t,e=!1){return this._onChangeCallbacks.push(t),e&&t(this.token,this.record),()=>{for(let r=this._onChangeCallbacks.length-1;r>=0;r--)if(this._onChangeCallbacks[r]==t)return delete this._onChangeCallbacks[r],void this._onChangeCallbacks.splice(r,1)}}triggerChange(){for(const t of this._onChangeCallbacks)t&&t(this.token,this.record)}}class wg extends la{constructor(t="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=t,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get record(){const t=this._storageGet(this.storageKey)||{};return t.record||t.model||null}get model(){return this.record}save(t,e){this._storageSet(this.storageKey,{token:t,record:e}),super.save(t,e)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(t){if(typeof window<"u"&&(window!=null&&window.localStorage)){const e=window.localStorage.getItem(t)||"";try{return JSON.parse(e)}catch{return e}}return this.storageFallback[t]}_storageSet(t,e){if(typeof window<"u"&&(window!=null&&window.localStorage)){let r=e;typeof e!="string"&&(r=JSON.stringify(e)),window.localStorage.setItem(t,r)}else this.storageFallback[t]=e}_storageRemove(t){var e;typeof window<"u"&&(window!=null&&window.localStorage)&&((e=window.localStorage)==null||e.removeItem(t)),delete this.storageFallback[t]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",(t=>{if(t.key!=this.storageKey)return;const e=this._storageGet(this.storageKey)||{};super.save(e.token||"",e.record||e.model||null)}))}}class Ve{constructor(t){this.client=t}}class xg extends Ve{async getAll(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/settings",t)}async update(t,e){return e=Object.assign({method:"PATCH",body:t},e),this.client.send("/api/settings",e)}async testS3(t="storage",e){return e=Object.assign({method:"POST",body:{filesystem:t}},e),this.client.send("/api/settings/test/s3",e).then((()=>!0))}async testEmail(t,e,r,s){return s=Object.assign({method:"POST",body:{email:e,template:r,collection:t}},s),this.client.send("/api/settings/test/email",s).then((()=>!0))}async generateAppleClientSecret(t,e,r,s,o,i){return i=Object.assign({method:"POST",body:{clientId:t,teamId:e,keyId:r,privateKey:s,duration:o}},i),this.client.send("/api/settings/apple/generate-client-secret",i)}}const Sg=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function ua(n){if(n){n.query=n.query||{};for(let t in n)Sg.includes(t)||(n.query[t]=n[t],delete n[t])}}function da(n){const t=[];for(const e in n){const r=encodeURIComponent(e),s=Array.isArray(n[e])?n[e]:[n[e]];for(let o of s)o=_g(o),o!==null&&t.push(r+"="+o)}return t.join("&")}function _g(n){return n==null?null:n instanceof Date?encodeURIComponent(n.toISOString().replace("T"," ")):encodeURIComponent(typeof n=="object"?JSON.stringify(n):n)}class Ol extends Ve{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(t,e,r){var i;if(!t)throw new Error("topic must be set.");let s=t;if(r){ua(r=Object.assign({},r));const a="options="+encodeURIComponent(JSON.stringify({query:r.query,headers:r.headers}));s+=(s.includes("?")?"&":"?")+a}const o=function(a){const l=a;let d;try{d=JSON.parse(l==null?void 0:l.data)}catch{}e(d||{})};return this.subscriptions[s]||(this.subscriptions[s]=[]),this.subscriptions[s].push(o),this.isConnected?this.subscriptions[s].length===1?await this.submitSubscriptions():(i=this.eventSource)==null||i.addEventListener(s,o):await this.connect(),async()=>this.unsubscribeByTopicAndListener(t,o)}async unsubscribe(t){var r;let e=!1;if(t){const s=this.getSubscriptionsByTopic(t);for(let o in s)if(this.hasSubscriptionListeners(o)){for(let i of this.subscriptions[o])(r=this.eventSource)==null||r.removeEventListener(o,i);delete this.subscriptions[o],e||(e=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?e&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(t){var r;let e=!1;for(let s in this.subscriptions)if((s+"?").startsWith(t)){e=!0;for(let o of this.subscriptions[s])(r=this.eventSource)==null||r.removeEventListener(s,o);delete this.subscriptions[s]}e&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(t,e){var o;let r=!1;const s=this.getSubscriptionsByTopic(t);for(let i in s){if(!Array.isArray(this.subscriptions[i])||!this.subscriptions[i].length)continue;let a=!1;for(let l=this.subscriptions[i].length-1;l>=0;l--)this.subscriptions[i][l]===e&&(a=!0,delete this.subscriptions[i][l],this.subscriptions[i].splice(l,1),(o=this.eventSource)==null||o.removeEventListener(i,e));a&&(this.subscriptions[i].length||delete this.subscriptions[i],r||this.hasSubscriptionListeners(i)||(r=!0))}this.hasSubscriptionListeners()?r&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(t){var e,r;if(this.subscriptions=this.subscriptions||{},t)return!!((e=this.subscriptions[t])!=null&&e.length);for(let s in this.subscriptions)if((r=this.subscriptions[s])!=null&&r.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch((t=>{if(!(t!=null&&t.isAbort))throw t}))}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(t){const e={};t=t.includes("?")?t:t+"?";for(let r in this.subscriptions)(r+"?").startsWith(t)&&(e[r]=this.subscriptions[r]);return e}getNonEmptySubscriptionKeys(){const t=[];for(let e in this.subscriptions)this.subscriptions[e].length&&t.push(e);return t}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let t in this.subscriptions)for(let e of this.subscriptions[t])this.eventSource.addEventListener(t,e)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let t in this.subscriptions)for(let e of this.subscriptions[t])this.eventSource.removeEventListener(t,e)}async connect(){if(!(this.reconnectAttempts>0))return new Promise(((t,e)=>{this.pendingConnects.push({resolve:t,reject:e}),this.pendingConnects.length>1||this.initConnect()}))}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout((()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))}),this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildURL("/api/realtime")),this.eventSource.onerror=t=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",(t=>{const e=t;this.clientId=e==null?void 0:e.lastEventId,this.submitSubscriptions().then((async()=>{let r=3;for(;this.hasUnsentSubscriptions()&&r>0;)r--,await this.submitSubscriptions()})).then((()=>{for(let s of this.pendingConnects)s.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const r=this.getSubscriptionsByTopic("PB_CONNECT");for(let s in r)for(let o of r[s])o(t)})).catch((r=>{this.clientId="",this.connectErrorHandler(r)}))}))}hasUnsentSubscriptions(){const t=this.getNonEmptySubscriptionKeys();if(t.length!=this.lastSentSubscriptions.length)return!0;for(const e of t)if(!this.lastSentSubscriptions.includes(e))return!0;return!1}connectErrorHandler(t){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let r of this.pendingConnects)r.reject(new Jt(t));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const e=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout((()=>{this.initConnect()}),e)}disconnect(t=!1){var e;if(this.clientId&&this.onDisconnect&&this.onDisconnect(Object.keys(this.subscriptions)),clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(e=this.eventSource)==null||e.close(),this.eventSource=null,this.clientId="",!t){this.reconnectAttempts=0;for(let r of this.pendingConnects)r.resolve();this.pendingConnects=[]}}}class Al extends Ve{decode(t){return t}async getFullList(t,e){if(typeof t=="number")return this._getFullList(t,e);let r=1e3;return(e=Object.assign({},t,e)).batch&&(r=e.batch,delete e.batch),this._getFullList(r,e)}async getList(t=1,e=30,r){return(r=Object.assign({method:"GET"},r)).query=Object.assign({page:t,perPage:e},r.query),this.client.send(this.baseCrudPath,r).then((s=>{var o;return s.items=((o=s.items)==null?void 0:o.map((i=>this.decode(i))))||[],s}))}async getFirstListItem(t,e){return(e=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+t},e)).query=Object.assign({filter:t,skipTotal:1},e.query),this.getList(1,1,e).then((r=>{var s;if(!((s=r==null?void 0:r.items)!=null&&s.length))throw new Jt({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return r.items[0]}))}async getOne(t,e){if(!t)throw new Jt({url:this.client.buildURL(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return e=Object.assign({method:"GET"},e),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),e).then((r=>this.decode(r)))}async create(t,e){return e=Object.assign({method:"POST",body:t},e),this.client.send(this.baseCrudPath,e).then((r=>this.decode(r)))}async update(t,e,r){return r=Object.assign({method:"PATCH",body:e},r),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),r).then((s=>this.decode(s)))}async delete(t,e){return e=Object.assign({method:"DELETE"},e),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t),e).then((()=>!0))}_getFullList(t=1e3,e){(e=e||{}).query=Object.assign({skipTotal:1},e.query);let r=[],s=async o=>this.getList(o,t||1e3,e).then((i=>{const a=i.items;return r=r.concat(a),a.length==i.perPage?s(o+1):r}));return s(1)}}function Qe(n,t,e,r){const s=r!==void 0;return s||e!==void 0?s?(console.warn(n),t.body=Object.assign({},t.body,e),t.query=Object.assign({},t.query,r),t):Object.assign(t,e):t}function ai(n){var t;(t=n._resetAutoRefresh)==null||t.call(n)}class Pg extends Al{constructor(t,e){super(t),this.collectionIdOrName=e}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}get isSuperusers(){return this.collectionIdOrName=="_superusers"||this.collectionIdOrName=="_pbc_2773867675"}async subscribe(t,e,r){if(!t)throw new Error("Missing topic.");if(!e)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+t,e,r)}async unsubscribe(t){return t?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+t):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(t,e){if(typeof t=="number")return super.getFullList(t,e);const r=Object.assign({},t,e);return super.getFullList(r)}async getList(t=1,e=30,r){return super.getList(t,e,r)}async getFirstListItem(t,e){return super.getFirstListItem(t,e)}async getOne(t,e){return super.getOne(t,e)}async create(t,e){return super.create(t,e)}async update(t,e,r){return super.update(t,e,r).then((s=>{var o,i,a;if(((o=this.client.authStore.record)==null?void 0:o.id)===(s==null?void 0:s.id)&&(((i=this.client.authStore.record)==null?void 0:i.collectionId)===this.collectionIdOrName||((a=this.client.authStore.record)==null?void 0:a.collectionName)===this.collectionIdOrName)){let l=Object.assign({},this.client.authStore.record.expand),d=Object.assign({},this.client.authStore.record,s);l&&(d.expand=Object.assign(l,s.expand)),this.client.authStore.save(this.client.authStore.token,d)}return s}))}async delete(t,e){return super.delete(t,e).then((r=>{var s,o,i;return!r||((s=this.client.authStore.record)==null?void 0:s.id)!==t||((o=this.client.authStore.record)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((i=this.client.authStore.record)==null?void 0:i.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),r}))}authResponse(t){const e=this.decode((t==null?void 0:t.record)||{});return this.client.authStore.save(t==null?void 0:t.token,e),Object.assign({},t,{token:(t==null?void 0:t.token)||"",record:e})}async listAuthMethods(t){return t=Object.assign({method:"GET",fields:"mfa,otp,password,oauth2"},t),this.client.send(this.baseCollectionPath+"/auth-methods",t)}async authWithPassword(t,e,r){let s;r=Object.assign({method:"POST",body:{identity:t,password:e}},r),this.isSuperusers&&(s=r.autoRefreshThreshold,delete r.autoRefreshThreshold,r.autoRefresh||ai(this.client));let o=await this.client.send(this.baseCollectionPath+"/auth-with-password",r);return o=this.authResponse(o),s&&this.isSuperusers&&(function(a,l,d,f){ai(a);const h=a.beforeSend,g=a.authStore.record,m=a.authStore.onChange(((p,b)=>{(!p||(b==null?void 0:b.id)!=(g==null?void 0:g.id)||(b!=null&&b.collectionId||g!=null&&g.collectionId)&&(b==null?void 0:b.collectionId)!=(g==null?void 0:g.collectionId))&&ai(a)}));a._resetAutoRefresh=function(){m(),a.beforeSend=h,delete a._resetAutoRefresh},a.beforeSend=async(p,b)=>{var R;const _=a.authStore.token;if((R=b.query)!=null&&R.autoRefresh)return h?h(p,b):{url:p,sendOptions:b};let S=a.authStore.isValid;if(S&&Cl(a.authStore.token,l))try{await d()}catch{S=!1}S||await f();const A=b.headers||{};for(let x in A)if(x.toLowerCase()=="authorization"&&_==A[x]&&a.authStore.token){A[x]=a.authStore.token;break}return b.headers=A,h?h(p,b):{url:p,sendOptions:b}}})(this.client,s,(()=>this.authRefresh({autoRefresh:!0})),(()=>this.authWithPassword(t,e,Object.assign({autoRefresh:!0},r)))),o}async authWithOAuth2Code(t,e,r,s,o,i,a){let l={method:"POST",body:{provider:t,code:e,codeVerifier:r,redirectURL:s,createData:o}};return l=Qe("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectURL, createData?, options?).",l,i,a),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",l).then((d=>this.authResponse(d)))}authWithOAuth2(...t){if(t.length>1||typeof(t==null?void 0:t[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((t==null?void 0:t[0])||"",(t==null?void 0:t[1])||"",(t==null?void 0:t[2])||"",(t==null?void 0:t[3])||"",(t==null?void 0:t[4])||{},(t==null?void 0:t[5])||{},(t==null?void 0:t[6])||{});const e=(t==null?void 0:t[0])||{};let r=null;e.urlCallback||(r=lc(void 0));const s=new Ol(this.client);function o(){r==null||r.close(),s.unsubscribe()}const i={},a=e.requestKey;return a&&(i.requestKey=a),this.listAuthMethods(i).then((l=>{const d=l.oauth2.providers.find((h=>h.name===e.provider));if(!d)throw new Jt(new Error(`Missing or invalid provider "${e.provider}".`));const f=this.client.buildURL("/api/oauth2-redirect");return new Promise((async(h,g)=>{var p,b,_;const m=a?(p=this.client.cancelControllers)==null?void 0:p[a]:void 0;m&&(m.signal.onabort=()=>{o(),g(new Jt({isAbort:!0,message:"manually cancelled"}))}),s.onDisconnect=S=>{S.length&&g&&(o(),g(new Jt(new Error("realtime connection interrupted"))))};try{await s.subscribe("@oauth2",(async x=>{var B;const q=s.clientId;try{if(!x.state||q!==x.state)throw new Error("State parameters don't match.");if(x.error||!x.code)throw new Error("OAuth2 redirect error or missing code: "+x.error);const N=Object.assign({},e);delete N.provider,delete N.scopes,delete N.createData,delete N.urlCallback,(B=m==null?void 0:m.signal)!=null&&B.onabort&&(m.signal.onabort=null);const I=await this.authWithOAuth2Code(d.name,x.code,d.codeVerifier,f,e.createData,N);h(I)}catch(N){g(new Jt(N))}o()}));const S={state:s.clientId};(b=e.scopes)!=null&&b.length&&(S.scope=e.scopes.join(" "));const A=this._replaceQueryParams(d.authURL+f,S);await(e.urlCallback||function(x){r?r.location.href=x:r=lc(x)})(A)}catch(S){(_=m==null?void 0:m.signal)!=null&&_.onabort&&(m.signal.onabort=null),o(),g(new Jt(S))}}))})).catch((l=>{throw o(),l}))}async authRefresh(t,e){let r={method:"POST"};return r=Qe("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",r,t,e),this.client.send(this.baseCollectionPath+"/auth-refresh",r).then((s=>this.authResponse(s)))}async requestPasswordReset(t,e,r){let s={method:"POST",body:{email:t}};return s=Qe("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",s,e,r),this.client.send(this.baseCollectionPath+"/request-password-reset",s).then((()=>!0))}async confirmPasswordReset(t,e,r,s,o){let i={method:"POST",body:{token:t,password:e,passwordConfirm:r}};return i=Qe("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",i,s,o),this.client.send(this.baseCollectionPath+"/confirm-password-reset",i).then((()=>!0))}async requestVerification(t,e,r){let s={method:"POST",body:{email:t}};return s=Qe("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",s,e,r),this.client.send(this.baseCollectionPath+"/request-verification",s).then((()=>!0))}async confirmVerification(t,e,r){let s={method:"POST",body:{token:t}};return s=Qe("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",s,e,r),this.client.send(this.baseCollectionPath+"/confirm-verification",s).then((()=>{const o=Hn(t),i=this.client.authStore.record;return i&&!i.verified&&i.id===o.id&&i.collectionId===o.collectionId&&(i.verified=!0,this.client.authStore.save(this.client.authStore.token,i)),!0}))}async requestEmailChange(t,e,r){let s={method:"POST",body:{newEmail:t}};return s=Qe("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",s,e,r),this.client.send(this.baseCollectionPath+"/request-email-change",s).then((()=>!0))}async confirmEmailChange(t,e,r,s){let o={method:"POST",body:{token:t,password:e}};return o=Qe("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",o,r,s),this.client.send(this.baseCollectionPath+"/confirm-email-change",o).then((()=>{const i=Hn(t),a=this.client.authStore.record;return a&&a.id===i.id&&a.collectionId===i.collectionId&&this.client.authStore.clear(),!0}))}async listExternalAuths(t,e){return this.client.collection("_externalAuths").getFullList(Object.assign({},e,{filter:this.client.filter("recordRef = {:id}",{id:t})}))}async unlinkExternalAuth(t,e,r){const s=await this.client.collection("_externalAuths").getFirstListItem(this.client.filter("recordRef = {:recordId} && provider = {:provider}",{recordId:t,provider:e}));return this.client.collection("_externalAuths").delete(s.id,r).then((()=>!0))}async requestOTP(t,e){return e=Object.assign({method:"POST",body:{email:t}},e),this.client.send(this.baseCollectionPath+"/request-otp",e)}async authWithOTP(t,e,r){return r=Object.assign({method:"POST",body:{otpId:t,password:e}},r),this.client.send(this.baseCollectionPath+"/auth-with-otp",r).then((s=>this.authResponse(s)))}async impersonate(t,e,r){(r=Object.assign({method:"POST",body:{duration:e}},r)).headers=r.headers||{},r.headers.Authorization||(r.headers.Authorization=this.client.authStore.token);const s=new Tl(this.client.baseURL,new la,this.client.lang),o=await s.send(this.baseCollectionPath+"/impersonate/"+encodeURIComponent(t),r);return s.authStore.save(o==null?void 0:o.token,this.decode((o==null?void 0:o.record)||{})),s}_replaceQueryParams(t,e={}){let r=t,s="";t.indexOf("?")>=0&&(r=t.substring(0,t.indexOf("?")),s=t.substring(t.indexOf("?")+1));const o={},i=s.split("&");for(const a of i){if(a=="")continue;const l=a.split("=");o[decodeURIComponent(l[0].replace(/\+/g," "))]=decodeURIComponent((l[1]||"").replace(/\+/g," "))}for(let a in e)e.hasOwnProperty(a)&&(e[a]==null?delete o[a]:o[a]=e[a]);s="";for(let a in o)o.hasOwnProperty(a)&&(s!=""&&(s+="&"),s+=encodeURIComponent(a.replace(/%20/g,"+"))+"="+encodeURIComponent(o[a].replace(/%20/g,"+")));return s!=""?r+"?"+s:r}}function lc(n){if(typeof window>"u"||!(window!=null&&window.open))throw new Jt(new Error("Not in a browser context - please pass a custom urlCallback function."));let t=1024,e=768,r=window.innerWidth,s=window.innerHeight;t=t>r?r:t,e=e>s?s:e;let o=r/2-t/2,i=s/2-e/2;return window.open(n,"popup_window","width="+t+",height="+e+",top="+i+",left="+o+",resizable,menubar=no")}class Cg extends Al{get baseCrudPath(){return"/api/collections"}async import(t,e=!1,r){return r=Object.assign({method:"PUT",body:{collections:t,deleteMissing:e}},r),this.client.send(this.baseCrudPath+"/import",r).then((()=>!0))}async getScaffolds(t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/meta/scaffolds",t)}async truncate(t,e){return e=Object.assign({method:"DELETE"},e),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(t)+"/truncate",e).then((()=>!0))}}class Og extends Ve{async getList(t=1,e=30,r){return(r=Object.assign({method:"GET"},r)).query=Object.assign({page:t,perPage:e},r.query),this.client.send("/api/logs",r)}async getOne(t,e){if(!t)throw new Jt({url:this.client.buildURL("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/"+encodeURIComponent(t),e)}async getStats(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/stats",t)}}class Ag extends Ve{async check(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/health",t)}}class Tg extends Ve{getUrl(t,e,r={}){return console.warn("Please replace pb.files.getUrl() with pb.files.getURL()"),this.getURL(t,e,r)}getURL(t,e,r={}){if(!e||!(t!=null&&t.id)||!(t!=null&&t.collectionId)&&!(t!=null&&t.collectionName))return"";const s=[];s.push("api"),s.push("files"),s.push(encodeURIComponent(t.collectionId||t.collectionName)),s.push(encodeURIComponent(t.id)),s.push(encodeURIComponent(e));let o=this.client.buildURL(s.join("/"));r.download===!1&&delete r.download;const i=da(r);return i&&(o+=(o.includes("?")?"&":"?")+i),o}async getToken(t){return t=Object.assign({method:"POST"},t),this.client.send("/api/files/token",t).then((e=>(e==null?void 0:e.token)||""))}}class Eg extends Ve{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/backups",t)}async create(t,e){return e=Object.assign({method:"POST",body:{name:t}},e),this.client.send("/api/backups",e).then((()=>!0))}async upload(t,e){return e=Object.assign({method:"POST",body:t},e),this.client.send("/api/backups/upload",e).then((()=>!0))}async delete(t,e){return e=Object.assign({method:"DELETE"},e),this.client.send(`/api/backups/${encodeURIComponent(t)}`,e).then((()=>!0))}async restore(t,e){return e=Object.assign({method:"POST"},e),this.client.send(`/api/backups/${encodeURIComponent(t)}/restore`,e).then((()=>!0))}getDownloadUrl(t,e){return console.warn("Please replace pb.backups.getDownloadUrl() with pb.backups.getDownloadURL()"),this.getDownloadURL(t,e)}getDownloadURL(t,e){return this.client.buildURL(`/api/backups/${encodeURIComponent(e)}?token=${encodeURIComponent(t)}`)}}class Ig extends Ve{async getFullList(t){return t=Object.assign({method:"GET"},t),this.client.send("/api/crons",t)}async run(t,e){return e=Object.assign({method:"POST"},e),this.client.send(`/api/crons/${encodeURIComponent(t)}`,e).then((()=>!0))}}function qi(n){return typeof Blob<"u"&&n instanceof Blob||typeof File<"u"&&n instanceof File||n!==null&&typeof n=="object"&&n.uri&&(typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal)}function Ki(n){var t;return n&&(((t=n.constructor)==null?void 0:t.name)==="FormData"||typeof FormData<"u"&&n instanceof FormData)}function uc(n){for(const t in n){const e=Array.isArray(n[t])?n[t]:[n[t]];for(const r of e)if(qi(r))return!0}return!1}const kg=/^[\-\.\d]+$/;function dc(n){if(typeof n!="string")return n;if(n=="true")return!0;if(n=="false")return!1;if((n[0]==="-"||n[0]>="0"&&n[0]<="9")&&kg.test(n)){let t=+n;if(""+t===n)return t}return n}class Rg extends Ve{constructor(){super(...arguments),this.requests=[],this.subs={}}collection(t){return this.subs[t]||(this.subs[t]=new Fg(this.requests,t)),this.subs[t]}async send(t){const e=new FormData,r=[];for(let s=0;s{if(l==="@jsonPayload"&&typeof a=="string")try{let d=JSON.parse(a);Object.assign(i,d)}catch(d){console.warn("@jsonPayload error:",d)}else i[l]!==void 0?(Array.isArray(i[l])||(i[l]=[i[l]]),i[l].push(dc(a))):i[l]=dc(a)})),i})(r));for(const s in r){const o=r[s];if(qi(o))t.files[s]=t.files[s]||[],t.files[s].push(o);else if(Array.isArray(o)){const i=[],a=[];for(const l of o)qi(l)?i.push(l):a.push(l);if(i.length>0&&i.length==o.length){t.files[s]=t.files[s]||[];for(let l of i)t.files[s].push(l)}else if(t.json[s]=a,i.length>0){let l=s;s.startsWith("+")||s.endsWith("+")||(l+="+"),t.files[l]=t.files[l]||[];for(let d of i)t.files[l].push(d)}}else t.json[s]=o}}}class Tl{get baseUrl(){return this.baseURL}set baseUrl(t){this.baseURL=t}constructor(t="/",e,r="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseURL=t,this.lang=r,e?this.authStore=e:typeof window<"u"&&window.Deno?this.authStore=new la:this.authStore=new wg,this.collections=new Cg(this),this.files=new Tg(this),this.logs=new Og(this),this.settings=new xg(this),this.realtime=new Ol(this),this.health=new Ag(this),this.backups=new Eg(this),this.crons=new Ig(this)}get admins(){return this.collection("_superusers")}createBatch(){return new Rg(this)}collection(t){return this.recordServices[t]||(this.recordServices[t]=new Pg(this,t)),this.recordServices[t]}autoCancellation(t){return this.enableAutoCancellation=!!t,this}cancelRequest(t){return this.cancelControllers[t]&&(this.cancelControllers[t].abort(),delete this.cancelControllers[t]),this}cancelAllRequests(){for(let t in this.cancelControllers)this.cancelControllers[t].abort();return this.cancelControllers={},this}filter(t,e){if(!e)return t;for(let r in e){let s=e[r];switch(typeof s){case"boolean":case"number":s=""+s;break;case"string":s="'"+s.replace(/'/g,"\\'")+"'";break;default:s=s===null?"null":s instanceof Date?"'"+s.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(s).replace(/'/g,"\\'")+"'"}t=t.replaceAll("{:"+r+"}",s)}return t}getFileUrl(t,e,r={}){return console.warn("Please replace pb.getFileUrl() with pb.files.getURL()"),this.files.getURL(t,e,r)}buildUrl(t){return console.warn("Please replace pb.buildUrl() with pb.buildURL()"),this.buildURL(t)}buildURL(t){var r;let e=this.baseURL;return typeof window>"u"||!window.location||e.startsWith("https://")||e.startsWith("http://")||(e=(r=window.location.origin)!=null&&r.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseURL.startsWith("/")||(e+=window.location.pathname||"/",e+=e.endsWith("/")?"":"/"),e+=this.baseURL),t&&(e+=e.endsWith("/")?"":"/",e+=t.startsWith("/")?t.substring(1):t),e}async send(t,e){e=this.initSendOptions(t,e);let r=this.buildURL(t);if(this.beforeSend){const s=Object.assign({},await this.beforeSend(r,e));s.url!==void 0||s.options!==void 0?(r=s.url||r,e=s.options||e):Object.keys(s).length&&(e=s,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(e.query!==void 0){const s=da(e.query);s&&(r+=(r.includes("?")?"&":"?")+s),delete e.query}return this.getHeader(e.headers,"Content-Type")=="application/json"&&e.body&&typeof e.body!="string"&&(e.body=JSON.stringify(e.body)),(e.fetch||fetch)(r,e).then((async s=>{var i;let o={};try{o=await s.json()}catch(a){if((i=e.signal)!=null&&i.aborted||(a==null?void 0:a.name)=="AbortError"||(a==null?void 0:a.message)=="Aborted")throw a}if(this.afterSend&&(o=await this.afterSend(s,o,e)),s.status>=400)throw new Jt({url:s.url,status:s.status,data:o});return o})).catch((s=>{throw new Jt(s)}))}initSendOptions(t,e){if((e=Object.assign({method:"GET"},e)).body=(function(s){if(typeof FormData>"u"||s===void 0||typeof s!="object"||s===null||Ki(s)||!uc(s))return s;const o=new FormData;for(const i in s){const a=s[i];if(a!==void 0)if(typeof a!="object"||uc({data:a})){const l=Array.isArray(a)?a:[a];for(let d of l)o.append(i,d)}else{let l={};l[i]=a,o.append("@jsonPayload",JSON.stringify(l))}}return o})(e.body),ua(e),e.query=Object.assign({},e.params,e.query),e.requestKey===void 0&&(e.$autoCancel===!1||e.query.$autoCancel===!1?e.requestKey=null:(e.$cancelKey||e.query.$cancelKey)&&(e.requestKey=e.$cancelKey||e.query.$cancelKey)),delete e.$autoCancel,delete e.query.$autoCancel,delete e.$cancelKey,delete e.query.$cancelKey,this.getHeader(e.headers,"Content-Type")!==null||Ki(e.body)||(e.headers=Object.assign({},e.headers,{"Content-Type":"application/json"})),this.getHeader(e.headers,"Accept-Language")===null&&(e.headers=Object.assign({},e.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(e.headers,"Authorization")===null&&(e.headers=Object.assign({},e.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&e.requestKey!==null){const r=e.requestKey||(e.method||"GET")+t;delete e.requestKey,this.cancelRequest(r);const s=new AbortController;this.cancelControllers[r]=s,e.signal=s.signal}return e}getHeader(t,e){t=t||{},e=e.toLowerCase();for(let r in t)if(r.toLowerCase()==e)return t[r];return null}}const Ng="https://pocketbase.ccllc.pro",Dg=new Tl(Ng),Mg=["EA","BX","CA","PK","PLT","LF"],Lg=["Framing","Insulation","Drywall","T-Bar","Painting","Masking","Misc"],Bg=["ACT","Channel","Fasteners","Finishing Materials","Adhesives","Mud","Corner Bead","Sanding","Tape","Metal Studs","Metal Tracks","FRP","Gyp","Insulation","Paint","Weatherproofing","Misc"];var Ug=K(''),Wg=K('

'),jg=K('',2),qg=K(" Cancel",1),Kg=K(''),zg=K('
Replace:
'),Vg=K(""),Hg=K(""),Gg=K(""),Yg=K(""),Xg=K('

'),Jg=K('
');function Zg(n,t){G(t,!0);const e="Stackq_Items";function r(P,D){return`${Dg.baseUrl}/api/files/${e}/${P}/${D}`}let s=w(t,"item",3,null),o=w(t,"itemsForParent",19,()=>[]);const i=O(()=>!!s()),a=O(()=>s()?o().filter(P=>P.id!==s().id):o()),l=O(()=>{var P;return((P=s())==null?void 0:P.Item)??""}),d=O(()=>{var P;return((P=s())==null?void 0:P.SKU)??""}),f=O(()=>{var P;return((P=s())==null?void 0:P.Description)??""}),h=O(()=>{var P;return((P=s())==null?void 0:P.UOM)??""}),g=O(()=>{var P;return((P=s())==null?void 0:P.Cost)!=null?String(s().Cost):""}),m=O(()=>{var P;return((P=s())==null?void 0:P.Vendor)??""}),p=O(()=>{var P,D;return Array.isArray((P=s())==null?void 0:P.Catagory)?s().Catagory[0]:((D=s())==null?void 0:D.Catagory)??""}),b=O(()=>{var P,D;return Array.isArray((P=s())==null?void 0:P.Sub_Catagory)?s().Sub_Catagory[0]:((D=s())==null?void 0:D.Sub_Catagory)??""}),_=O(()=>{var P;return((P=s())==null?void 0:P.Parent)??""}),S=O(()=>{var P;return!!((P=s())!=null&&P.Has_Parent)}),A=O(()=>{var P;return!!((P=s())!=null&&P.Stock)});let R=X(""),x=X(!1),q=X(null),B=X(void 0),N=null,I=0;Wt(()=>{C(R,u(d),!0)});async function tt(){if(typeof globalThis>"u"||"BarcodeDetector"in globalThis)return!0;try{const P=await hu(()=>import("./Bd99md_0.js"),[],import.meta.url);return globalThis.BarcodeDetector=P.BarcodeDetector,!0}catch{return!1}}async function Z(){if(C(q,null),!await tt()){C(q,"Failed to load barcode scanner. Try again or use Chrome/Edge."),C(x,!0);return}try{N=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),C(x,!0)}catch(D){C(q,D instanceof Error?D.message:"Could not access camera.",!0),C(x,!0)}}Wt(()=>{if(!(!u(x)||!N||!u(B)))return u(B).srcObject=N,u(B).play().then(()=>yt()).catch(()=>{}),()=>{u(B).srcObject&&(u(B).srcObject=null)}});const Ct=300;function yt(){if(!u(x)||!u(B)||!("BarcodeDetector"in globalThis))return;const P=new globalThis.BarcodeDetector;let D=0;async function M(){if(!u(x)||!u(B))return;if(u(B).readyState<2){I=requestAnimationFrame(M);return}const kt=Date.now();if(kt-D>=Ct){D=kt;try{const Lt=await P.detect(u(B));if(Lt.length>0){C(R,Lt[0].rawValue,!0),At();return}}catch{}}I=requestAnimationFrame(M)}M()}function At(){C(x,!1),C(q,null),I&&(cancelAnimationFrame(I),I=0),N&&(N.getTracks().forEach(P=>P.stop()),N=null),u(B)&&u(B).srcObject&&(u(B).srcObject=null)}var ut=Jg(),vt=W(ut);{var it=P=>{var D=Ug();no(D),St(()=>_c(D,s().id)),v(P,D)};bt(vt,P=>{u(i)&&P(it)})}var ft=F(vt,2),et=W(ft),Ot=W(et);we(Ot,{for:"Item",children:(P,D)=>{V();var M=Q("Item");v(P,M)},$$slots:{default:!0}});var ne=F(Ot,2);qn(ne,{id:"Item",name:"Item",get value(){return u(l)},required:!0}),j(et);var Kt=F(et,2),Zt=W(Kt);we(Zt,{for:"SKU",children:(P,D)=>{V();var M=Q("SKU");v(P,M)},$$slots:{default:!0}});var Mt=F(Zt,2),gr=W(Mt);qn(gr,{id:"SKU",name:"SKU",class:"flex-1",get value(){return u(R)},set value(P){C(R,P,!0)}});var me=F(gr,2);ro(me,{type:"button",variant:"outline",size:"icon",onclick:Z,title:"Scan barcode",children:(P,D)=>{dg(P,{class:"size-4"})},$$slots:{default:!0}}),j(Mt),j(Kt),j(ft);var Te=F(ft,2);{var mn=P=>{var D=Kg(),M=W(D),kt=W(M);{var Lt=$t=>{var he=Wg(),Je=W(he,!0);j(he),St(()=>Tt(Je,u(q))),v($t,he)},Ta=$t=>{var he=jg();he.muted=!0,pn(he,Je=>C(B,Je),()=>u(B)),v($t,he)};bt(kt,$t=>{u(q)?$t(Lt):$t(Ta,!1)})}var mr=F(kt,2),Xs=W(mr);ro(Xs,{type:"button",variant:"outline",class:"flex-1",onclick:At,children:($t,he)=>{var Je=qg(),xn=T(Je);Sl(xn,{class:"mr-2 size-4"}),V(),v($t,Je)},$$slots:{default:!0}}),j(mr),j(M),j(D),v(P,D)};bt(Te,P=>{u(x)&&P(mn)})}var le=F(Te,2),Gt=W(le);we(Gt,{for:"Description",children:(P,D)=>{V();var M=Q("Description");v(P,M)},$$slots:{default:!0}});var ie=F(Gt,2);qn(ie,{id:"Description",name:"Description",get value(){return u(f)}}),j(le);var ae=F(le,2),Bt=W(ae);we(Bt,{for:"Image",children:(P,D)=>{V();var M=Q("Image");v(P,M)},$$slots:{default:!0}});var nt=F(Bt,2);{var Ee=P=>{var D=zg(),M=W(D);V(2),j(D),St(kt=>Tr(M,"src",kt),[()=>r(s().id,s().Image)]),v(P,D)};bt(nt,P=>{var D;u(i)&&((D=s())!=null&&D.Image)&&P(Ee)})}var bn=F(nt,2);qn(bn,{id:"Image",name:"Image",type:"file",accept:"image/*"}),j(ae);var ue=F(ae,2),be=W(ue),Ie=W(be);we(Ie,{for:"UOM",children:(P,D)=>{V();var M=Q("UOM");v(P,M)},$$slots:{default:!0}});var He=F(Ie,2),de=W(He);de.value=de.__value="";var Ge=F(de);cn(Ge,17,()=>Mg,Pn,(P,D)=>{var M=Vg(),kt=W(M,!0);j(M);var Lt={};St(()=>{Zs(M,u(h)===u(D)),Tt(kt,u(D)),Lt!==(Lt=u(D))&&(M.value=(M.__value=u(D))??"")}),v(P,M)}),j(He),j(be);var ye=F(be,2),Ye=W(ye);we(Ye,{for:"Cost",children:(P,D)=>{V();var M=Q("Cost");v(P,M)},$$slots:{default:!0}});var yn=F(Ye,2);qn(yn,{id:"Cost",name:"Cost",type:"number",step:"any",get value(){return u(g)}}),j(ye),j(ue);var ke=F(ue,2),wn=W(ke);we(wn,{for:"Vendor",children:(P,D)=>{V();var M=Q("Vendor");v(P,M)},$$slots:{default:!0}});var dt=F(wn,2);qn(dt,{id:"Vendor",name:"Vendor",get value(){return u(m)}}),j(ke);var at=F(ke,2),ct=W(at),Et=W(ct);we(Et,{for:"Catagory",children:(P,D)=>{V();var M=Q("Catagory");v(P,M)},$$slots:{default:!0}});var lt=F(Et,2),Bn=W(lt);Bn.value=Bn.__value="";var Gs=F(Bn);cn(Gs,17,()=>Lg,Pn,(P,D)=>{var M=Hg(),kt=W(M,!0);j(M);var Lt={};St(()=>{Zs(M,u(p)===u(D)),Tt(kt,u(D)),Lt!==(Lt=u(D))&&(M.value=(M.__value=u(D))??"")}),v(P,M)}),j(lt),j(ct);var pr=F(ct,2),Ys=W(pr);we(Ys,{for:"Sub_Catagory",children:(P,D)=>{V();var M=Q("Sub_Catagory");v(P,M)},$$slots:{default:!0}});var pt=F(Ys,2),gt=W(pt);gt.value=gt.__value="";var mt=F(gt);cn(mt,17,()=>Bg,Pn,(P,D)=>{var M=Gg(),kt=W(M,!0);j(M);var Lt={};St(()=>{Zs(M,u(b)===u(D)),Tt(kt,u(D)),Lt!==(Lt=u(D))&&(M.value=(M.__value=u(D))??"")}),v(P,M)}),j(pt),j(pr),j(at);var Nt=F(at,2),J=W(Nt);we(J,{for:"Parent",children:(P,D)=>{V();var M=Q("Parent");v(P,M)},$$slots:{default:!0}});var wt=F(J,2),It=W(wt);It.value=It.__value="";var Yt=F(It);cn(Yt,17,()=>u(a),Pn,(P,D)=>{var M=Yg(),kt=W(M,!0);j(M);var Lt={};St(()=>{Zs(M,u(_)===u(D).id),Tt(kt,u(D).Item||u(D).SKU||u(D).id),Lt!==(Lt=u(D).id)&&(M.value=(M.__value=u(D).id)??"")}),v(P,M)}),j(wt),j(Nt);var xt=F(Nt,2),$=W(xt),ht=W($);no(ht),V(),j($);var Ut=F($,2),Xe=W(Ut);no(Xe),V(),j(Ut),j(xt);var Qt=F(xt,2);{var vr=P=>{var D=Xg(),M=W(D,!0);j(D),St(()=>Tt(M,t.error)),v(P,D)};bt(Qt,P=>{t.error&&P(vr)})}var Un=F(Qt,2),$o=W(Un);ro($o,{type:"submit",children:(P,D)=>{V();var M=Q();St(()=>Tt(M,t.submitLabel)),v(P,M)},$$slots:{default:!0}}),j(Un),j(ut),xc(ut,(P,D)=>{var M;return(M=Sc)==null?void 0:M(P,D)},()=>()=>async({update:P,result:D})=>{var M,kt;await P(),D.type==="success"&&((M=D.data)!=null&&M.success)&&((kt=t.onSuccess)==null||kt.call(t))}),St(()=>{Tr(ut,"action",t.action),La(ht,u(S)),La(Xe,u(A))}),v(n,ut),Y()}var Qg=K(" New item",1),$g=K(" ",1),tp=K(''),ep=K(''),np=K(''),rp=K(" ",1),sp=K(''),op=K(" ",1),ip=K('No'),ap=K(' '),cp=K(''),lp=K(" Edit",1),up=K(" Delete",1),dp=K(' ',1),hp=K(" ",1),fp=K(" ",1),gp=K(" ",1),pp=K(" ",1),vp=K(" ",1),mp=K('

Stackq Items

');function Ip(n,t){G(t,!0);let e=X(!1),r=X(null),s=X("create");const o=O(()=>{var I;return((I=t.data)==null?void 0:I.items)??[]}),i=O(()=>{var I;return((I=t.data)==null?void 0:I.itemsForParent)??[]}),a="https://pocketbase.ccllc.pro",l="Stackq_Items";function d(I){return I.Image?`${a}/api/files/${l}/${I.id}/${I.Image}`:null}function f(I){return I==null?[]:Array.isArray(I)?I:[I]}function h(I){if(!I)return"—";try{return new Date(I).toLocaleDateString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return I}}function g(){C(r,null),C(s,"create"),C(e,!0)}function m(I){C(r,I,!0),C(s,"update"),C(e,!0)}function p(){C(e,!1),C(r,null)}const b=O(()=>{var I,tt,Z;return((I=t.data)==null?void 0:I.form)==="create"||((tt=t.data)==null?void 0:tt.form)==="update"?((Z=t.data)==null?void 0:Z.error)??null:null});Wt(()=>{var I,tt;u(b)&&(((I=t.data)==null?void 0:I.form)==="create"||((tt=t.data)==null?void 0:tt.form)==="update")&&C(e,!0)});var _=mp();gu("1kn3tit",I=>{iu(()=>{au.title="Items – Stackq"})});var S=W(_),A=F(W(S),2),R=W(A),x=W(R);j(R);var q=F(R,2);ro(q,{onclick:g,children:(I,tt)=>{var Z=Qg(),Ct=T(Z);gg(Ct,{class:"mr-2 size-4"}),V(),v(I,Z)},$$slots:{default:!0}}),j(A),j(S);var B=F(S,2);Pu(B,{children:(I,tt)=>{Cu(I,{class:"p-0",children:(Z,Ct)=>{var yt=L(),At=T(yt);U(At,()=>Ru,(ut,vt)=>{vt(ut,{children:(it,ft)=>{var et=gp(),Ot=T(et);U(Ot,()=>Bu,(Kt,Zt)=>{Zt(Kt,{children:(Mt,gr)=>{var me=L(),Te=T(me);U(Te,()=>si,(mn,le)=>{le(mn,{children:(Gt,ie)=>{var ae=$g(),Bt=T(ae);U(Bt,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Image");v(ct,lt)},$$slots:{default:!0}})});var nt=F(Bt,2);U(nt,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Item");v(ct,lt)},$$slots:{default:!0}})});var Ee=F(nt,2);U(Ee,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("SKU");v(ct,lt)},$$slots:{default:!0}})});var bn=F(Ee,2);U(bn,()=>Xt,(dt,at)=>{at(dt,{class:"max-w-[200px]",children:(ct,Et)=>{V();var lt=Q("Description");v(ct,lt)},$$slots:{default:!0}})});var ue=F(bn,2);U(ue,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("UOM");v(ct,lt)},$$slots:{default:!0}})});var be=F(ue,2);U(be,()=>Xt,(dt,at)=>{at(dt,{class:"text-right",children:(ct,Et)=>{V();var lt=Q("Cost");v(ct,lt)},$$slots:{default:!0}})});var Ie=F(be,2);U(Ie,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Vendor");v(ct,lt)},$$slots:{default:!0}})});var He=F(Ie,2);U(He,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Catagory");v(ct,lt)},$$slots:{default:!0}})});var de=F(He,2);U(de,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Sub_Catagory");v(ct,lt)},$$slots:{default:!0}})});var Ge=F(de,2);U(Ge,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Has Parent");v(ct,lt)},$$slots:{default:!0}})});var ye=F(Ge,2);U(ye,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Parent");v(ct,lt)},$$slots:{default:!0}})});var Ye=F(ye,2);U(Ye,()=>Xt,(dt,at)=>{at(dt,{children:(ct,Et)=>{V();var lt=Q("Stock");v(ct,lt)},$$slots:{default:!0}})});var yn=F(Ye,2);U(yn,()=>Xt,(dt,at)=>{at(dt,{class:"text-muted-foreground",children:(ct,Et)=>{V();var lt=Q("created");v(ct,lt)},$$slots:{default:!0}})});var ke=F(yn,2);U(ke,()=>Xt,(dt,at)=>{at(dt,{class:"text-muted-foreground",children:(ct,Et)=>{V();var lt=Q("updated");v(ct,lt)},$$slots:{default:!0}})});var wn=F(ke,2);U(wn,()=>Xt,(dt,at)=>{at(dt,{class:"w-[70px]",children:(ct,Et)=>{V();var lt=Q("Actions");v(ct,lt)},$$slots:{default:!0}})}),v(Gt,ae)},$$slots:{default:!0}})}),v(Mt,me)},$$slots:{default:!0}})});var ne=F(Ot,2);U(ne,()=>Nu,(Kt,Zt)=>{Zt(Kt,{children:(Mt,gr)=>{var me=L(),Te=T(me);{var mn=Gt=>{var ie=L(),ae=T(ie);U(ae,()=>si,(Bt,nt)=>{nt(Bt,{children:(Ee,bn)=>{var ue=L(),be=T(ue);U(be,()=>zt,(Ie,He)=>{He(Ie,{colspan:"15",class:"h-24 text-center text-muted-foreground",children:(de,Ge)=>{V();var ye=Q("No items. Create one or check PocketBase collection name and auth.");v(de,ye)},$$slots:{default:!0}})}),v(Ee,ue)},$$slots:{default:!0}})}),v(Gt,ie)},le=Gt=>{var ie=L(),ae=T(ie);cn(ae,17,()=>u(o),Bt=>Bt.id,(Bt,nt)=>{var Ee=L(),bn=T(Ee);U(bn,()=>si,(ue,be)=>{be(ue,{children:(Ie,He)=>{var de=fp(),Ge=T(de);U(Ge,()=>zt,(pt,gt)=>{gt(pt,{class:"w-16",children:(mt,Nt)=>{var J=L(),wt=T(J);{var It=$=>{var ht=tp(),Ut=W(ht);j(ht),St((Xe,Qt)=>{Tr(ht,"href",Xe),Tr(Ut,"src",Qt)},[()=>d(u(nt)),()=>d(u(nt))]),v($,ht)},Yt=O(()=>d(u(nt))),xt=$=>{var ht=ep();v($,ht)};bt(wt,$=>{u(Yt)?$(It):$(xt,!1)})}v(mt,J)},$$slots:{default:!0}})});var ye=F(Ge,2);U(ye,()=>zt,(pt,gt)=>{gt(pt,{class:"font-medium",children:(mt,Nt)=>{V();var J=Q();St(()=>Tt(J,u(nt).Item??"—")),v(mt,J)},$$slots:{default:!0}})});var Ye=F(ye,2);U(Ye,()=>zt,(pt,gt)=>{gt(pt,{class:"font-mono text-xs",children:(mt,Nt)=>{V();var J=Q();St(()=>Tt(J,u(nt).SKU??"—")),v(mt,J)},$$slots:{default:!0}})});var yn=F(Ye,2);{let pt=O(()=>u(nt).Description??"");U(yn,()=>zt,(gt,mt)=>{mt(gt,{class:"max-w-[200px] truncate",get title(){return u(pt)},children:(Nt,J)=>{V();var wt=Q();St(()=>Tt(wt,u(nt).Description??"—")),v(Nt,wt)},$$slots:{default:!0}})})}var ke=F(yn,2);U(ke,()=>zt,(pt,gt)=>{gt(pt,{children:(mt,Nt)=>{wr(mt,{variant:"outline",children:(J,wt)=>{V();var It=Q();St(()=>Tt(It,u(nt).UOM??"—")),v(J,It)},$$slots:{default:!0}})},$$slots:{default:!0}})});var wn=F(ke,2);U(wn,()=>zt,(pt,gt)=>{gt(pt,{class:"text-right tabular-nums",children:(mt,Nt)=>{V();var J=Q();St(wt=>Tt(J,wt),[()=>u(nt).Cost!=null?Number(u(nt).Cost).toLocaleString():"—"]),v(mt,J)},$$slots:{default:!0}})});var dt=F(wn,2);U(dt,()=>zt,(pt,gt)=>{gt(pt,{class:"text-muted-foreground",children:(mt,Nt)=>{V();var J=Q();St(()=>Tt(J,u(nt).Vendor??"—")),v(mt,J)},$$slots:{default:!0}})});var at=F(dt,2);U(at,()=>zt,(pt,gt)=>{gt(pt,{children:(mt,Nt)=>{var J=rp(),wt=T(J);cn(wt,17,()=>f(u(nt).Catagory),Pn,($,ht)=>{wr($,{variant:"secondary",class:"mr-1 text-xs",children:(Ut,Xe)=>{V();var Qt=Q();St(()=>Tt(Qt,u(ht))),v(Ut,Qt)},$$slots:{default:!0}})});var It=F(wt,2);{var Yt=$=>{var ht=np();v($,ht)},xt=O(()=>f(u(nt).Catagory).length===0);bt(It,$=>{u(xt)&&$(Yt)})}v(mt,J)},$$slots:{default:!0}})});var ct=F(at,2);U(ct,()=>zt,(pt,gt)=>{gt(pt,{children:(mt,Nt)=>{var J=op(),wt=T(J);cn(wt,17,()=>f(u(nt).Sub_Catagory),Pn,($,ht)=>{wr($,{variant:"outline",class:"mr-1 text-xs",children:(Ut,Xe)=>{V();var Qt=Q();St(()=>Tt(Qt,u(ht))),v(Ut,Qt)},$$slots:{default:!0}})});var It=F(wt,2);{var Yt=$=>{var ht=sp();v($,ht)},xt=O(()=>f(u(nt).Sub_Catagory).length===0);bt(It,$=>{u(xt)&&$(Yt)})}v(mt,J)},$$slots:{default:!0}})});var Et=F(ct,2);U(Et,()=>zt,(pt,gt)=>{gt(pt,{children:(mt,Nt)=>{var J=L(),wt=T(J);{var It=xt=>{wr(xt,{children:($,ht)=>{V();var Ut=Q("Yes");v($,Ut)},$$slots:{default:!0}})},Yt=xt=>{var $=ip();v(xt,$)};bt(wt,xt=>{u(nt).Has_Parent?xt(It):xt(Yt,!1)})}v(mt,J)},$$slots:{default:!0}})});var lt=F(Et,2);U(lt,()=>zt,(pt,gt)=>{gt(pt,{class:"text-muted-foreground",children:(mt,Nt)=>{var J=L(),wt=T(J);{var It=$=>{var ht=Q();St(()=>Tt(ht,u(nt).expand.Parent.Item??u(nt).expand.Parent.SKU??u(nt).Parent)),v($,ht)},Yt=$=>{var ht=ap(),Ut=W(ht,!0);j(ht),St(()=>Tt(Ut,u(nt).Parent)),v($,ht)},xt=$=>{var ht=Q("—");v($,ht)};bt(wt,$=>{var ht;(ht=u(nt).expand)!=null&&ht.Parent?$(It):u(nt).Parent?$(Yt,1):$(xt,!1)})}v(mt,J)},$$slots:{default:!0}})});var Bn=F(lt,2);U(Bn,()=>zt,(pt,gt)=>{gt(pt,{children:(mt,Nt)=>{var J=L(),wt=T(J);{var It=xt=>{wr(xt,{variant:"default",children:($,ht)=>{V();var Ut=Q("Stock");v($,Ut)},$$slots:{default:!0}})},Yt=xt=>{var $=cp();v(xt,$)};bt(wt,xt=>{u(nt).Stock?xt(It):xt(Yt,!1)})}v(mt,J)},$$slots:{default:!0}})});var Gs=F(Bn,2);U(Gs,()=>zt,(pt,gt)=>{gt(pt,{class:"text-muted-foreground text-xs",children:(mt,Nt)=>{V();var J=Q();St(wt=>Tt(J,wt),[()=>h(u(nt).created)]),v(mt,J)},$$slots:{default:!0}})});var pr=F(Gs,2);U(pr,()=>zt,(pt,gt)=>{gt(pt,{class:"text-muted-foreground text-xs",children:(mt,Nt)=>{V();var J=Q();St(wt=>Tt(J,wt),[()=>h(u(nt).updated)]),v(mt,J)},$$slots:{default:!0}})});var Ys=F(pr,2);U(Ys,()=>zt,(pt,gt)=>{gt(pt,{children:(mt,Nt)=>{var J=L(),wt=T(J);U(wt,()=>cg,(It,Yt)=>{Yt(It,{children:(xt,$)=>{var ht=hp(),Ut=T(ht);U(Ut,()=>ug,(Qt,vr)=>{vr(Qt,{class:"border-0 bg-transparent hover:bg-muted inline-flex size-8 items-center justify-center rounded-md",children:(Un,$o)=>{hg(Un,{class:"size-4"})},$$slots:{default:!0}})});var Xe=F(Ut,2);U(Xe,()=>_l,(Qt,vr)=>{vr(Qt,{children:(Un,$o)=>{var P=L(),D=T(P);U(D,()=>lg,(M,kt)=>{kt(M,{align:"end",children:(Lt,Ta)=>{var mr=dp(),Xs=T(mr);U(Xs,()=>ic,(xn,Wn)=>{Wn(xn,{onclick:()=>m(u(nt)),children:(jn,El)=>{var br=lp(),ti=T(br);fg(ti,{class:"mr-2 size-4"}),V(),v(jn,br)},$$slots:{default:!0}})});var $t=F(Xs,2),he=W($t);no(he),j($t),xc($t,xn=>{var Wn;return(Wn=Sc)==null?void 0:Wn(xn)});var Je=F($t,2);U(Je,()=>ic,(xn,Wn)=>{Wn(xn,{class:"text-destructive focus:text-destructive cursor-pointer",onclick:()=>{var jn;confirm("Delete this item? This cannot be undone.")&&((jn=document.getElementById("delete-form-"+u(nt).id))==null||jn.requestSubmit())},children:(jn,El)=>{var br=up(),ti=T(br);pg(ti,{class:"mr-2 size-4"}),V(),v(jn,br)},$$slots:{default:!0}})}),St(()=>{Tr($t,"id",`delete-form-${u(nt).id??""}`),_c(he,u(nt).id)}),v(Lt,mr)},$$slots:{default:!0}})}),v(Un,P)},$$slots:{default:!0}})}),v(xt,ht)},$$slots:{default:!0}})}),v(mt,J)},$$slots:{default:!0}})}),v(Ie,de)},$$slots:{default:!0}})}),v(Bt,Ee)}),v(Gt,ie)};bt(Te,Gt=>{u(o).length===0?Gt(mn):Gt(le,!1)})}v(Mt,me)},$$slots:{default:!0}})}),v(it,et)},$$slots:{default:!0}})}),v(Z,yt)},$$slots:{default:!0}})},$$slots:{default:!0}});var N=F(B,2);U(N,()=>Xf,(I,tt)=>{tt(I,{get open(){return u(e)},set open(Z){C(e,Z,!0)},children:(Z,Ct)=>{var yt=L(),At=T(yt);U(At,()=>ig,(ut,vt)=>{vt(ut,{class:"max-h-[90vh] overflow-y-auto sm:max-w-[500px]",children:(it,ft)=>{var et=vp(),Ot=T(et);U(Ot,()=>$f,(Kt,Zt)=>{Zt(Kt,{children:(Mt,gr)=>{var me=pp(),Te=T(me);U(Te,()=>Zf,(le,Gt)=>{Gt(le,{children:(ie,ae)=>{V();var Bt=Q();St(()=>Tt(Bt,u(r)?"Edit item":"New item")),v(ie,Bt)},$$slots:{default:!0}})});var mn=F(Te,2);U(mn,()=>ag,(le,Gt)=>{Gt(le,{children:(ie,ae)=>{V();var Bt=Q();St(()=>Tt(Bt,u(r)?"Update the item below.":"Add a new Stackq item.")),v(ie,Bt)},$$slots:{default:!0}})}),v(Mt,me)},$$slots:{default:!0}})});var ne=F(Ot,2);{let Kt=O(()=>u(r)?"?/update":"?/create"),Zt=O(()=>u(r)?"Update":"Create"),Mt=O(()=>u(b)??null);Zg(ne,{get item(){return u(r)},get itemsForParent(){return u(i)},get action(){return u(Kt)},get submitLabel(){return u(Zt)},get error(){return u(Mt)},onSuccess:p})}v(it,et)},$$slots:{default:!0}})}),v(Z,yt)},$$slots:{default:!0}})}),j(_),St(()=>Tt(x,`${u(o).length??""} items`)),v(n,_),Y()}export{Ip as default};