306 lines
153 KiB
JavaScript
306 lines
153 KiB
JavaScript
var sc=Object.defineProperty;var ic=Object.getPrototypeOf;var ac=Reflect.get;var fa=n=>{throw TypeError(n)};var lc=(n,t,e)=>t in n?sc(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var E=(n,t,e)=>lc(n,typeof t!="symbol"?t+"":t,e),Us=(n,t,e)=>t.has(n)||fa("Cannot "+e);var a=(n,t,e)=>(Us(n,t,"read from private field"),e?e.call(n):t.get(n)),y=(n,t,e)=>t.has(n)?fa("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),V=(n,t,e,r)=>(Us(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),tt=(n,t,e)=>(Us(n,t,"access private method"),e);var ha=(n,t,e)=>ac(ic(n),e,t);import"./Bzak7iHL.js";import{h as Nn,i as Ua,j as cc,k as qa,g as c,R as uc,H as dc,o as ga,m as va,p as qs,N as Wo,aw as fc,aT as hc,v as pa,G as gc,M as Zs,bi as vc,P as pc,ad as mc,b2 as yc,aS as Fi,bj as bc,z as Js,bk as wc,bl as xc,A as _c,L as ma,bm as nn,I as Ya,K as Ga,bn as Ys,bo as Pc,aQ as Sc,J as Cc,ax as Oc,D as G,c as z,F as et,r as K,a as p,E as X,f as H,b0 as j,a5 as yr,a6 as x,bp as ya,aA as cr,aZ as Ac,aY as ba,a_ as Ec,aj as Tc,ak as Wt,a0 as Fc,u as O,aW as Mc,bh as cn,b as N,d as T,aX as Ic,bq as Xa,s as k,br as kc,bs as Dc,n as q,t as Z,ao as Ct,_ as Nc,ay as Rc}from"./MIlO0V30.js";import{c as ja,m as Bc,u as Lc,o as Wc,s as Et}from"./BMmwim-G.js";import{B as zc,i as yt}from"./D6Mj8HfB.js";import{c as W,_ as Kc}from"./DPCugUAM.js";import{e as Vc,h as Hc,B as ur}from"./hxRy_pid.js";import{i as Uc,B as qc,c as Za,d as M,f as Yc,t as Gc,g as Xc,h as jc,j as Ds,k as ce,l as Qn,m as Mi,n as Ja,o as un,p as zt,q as Rn,r as Qa,s as Be,u as Zc,v as Jc,w as Qc,L as Te,I as dr,a as $a,e as tl,b as $c,C as tu}from"./CEGTtJLH.js";import{a as Tt,c as ne,s as Y,r as Uo,d as el,e as wa,f as nl,g as zo}from"./De4R2cbq.js";import{p as b,b as dn,r as nt,s as xt}from"./znVx7SEM.js";import{B as qo}from"./CINS0kDe.js";import{o as It}from"./Dt2zEVER.js";const eu=Symbol("NaN");function nu(n,t,e){Nn&&Ua();var r=new zc(n),o=!cc();qa(()=>{var i=t();i!==i&&(i=eu),o&&i!==null&&typeof i=="object"&&(i={}),r.ensure(i,e)})}function mn(n,t){return t}function ru(n,t,e){for(var r=[],o=t.length,i,s=t.length,l=0;l<o;l++){let f=t[l];Ga(f,()=>{if(i){if(i.pending.delete(f),i.done.add(f),i.pending.size===0){var v=n.outrogroups;Qs(Fi(i.done)),v.delete(i),v.size===0&&(n.outrogroups=null)}}else s-=1},!1)}if(s===0){var u=r.length===0&&e!==null;if(u){var d=e,h=d.parentNode;Sc(h),h.append(d),n.items.clear()}Qs(t,!u)}else i={pending:new Set(t),done:new Set},(n.outrogroups??(n.outrogroups=new Set)).add(i)}function Qs(n,t=!0){for(var e=0;e<n.length;e++)Cc(n[e],t)}var xa;function rn(n,t,e,r,o,i=null){var s=n,l=new Map;Nn&&Ua();var u=null,d=mc(()=>{var w=e();return yc(w)?w:w==null?[]:Fi(w)}),h,f=!0;function v(){g.fallback=u,ou(g,h,s,t,r),u!==null&&(h.length===0?(u.f&nn)===0?Ya(u):(u.f^=nn,pr(u,null,s)):Ga(u,()=>{u=null}))}var m=qa(()=>{h=c(d);var w=h.length;let P=!1;if(Nn){var S=uc(s)===dc;S!==(w===0)&&(s=ga(),va(s),qs(!1),P=!0)}for(var A=new Set,I=gc,_=pc(),F=0;F<w;F+=1){Nn&&Wo.nodeType===fc&&Wo.data===hc&&(s=Wo,P=!0,qs(!1));var L=h[F],D=r(L,F),U=f?null:l.get(D);U?(U.v&&pa(U.v,L),U.i&&pa(U.i,F),_&&I.unskip_effect(U.e)):(U=su(l,f?s:xa??(xa=ma()),L,D,F,o,t,e),f||(U.e.f|=nn),l.set(D,U)),A.add(D)}if(w===0&&i&&!u&&(f?u=Zs(()=>i(s)):(u=Zs(()=>i(xa??(xa=ma()))),u.f|=nn)),w>A.size&&vc(),Nn&&w>0&&va(ga()),!f)if(_){for(const[rt,ot]of l)A.has(rt)||I.skip_effect(ot.e);I.oncommit(v),I.ondiscard(()=>{})}else v();P&&qs(!0),c(d)}),g={effect:m,items:l,outrogroups:null,fallback:u};f=!1,Nn&&(s=Wo)}function fr(n){for(;n!==null&&(n.f&Pc)===0;)n=n.next;return n}function ou(n,t,e,r,o){var U;var i=t.length,s=n.items,l=fr(n.effect.first),u,d=null,h=[],f=[],v,m,g,w;for(w=0;w<i;w+=1){if(v=t[w],m=o(v,w),g=s.get(m).e,n.outrogroups!==null)for(const rt of n.outrogroups)rt.pending.delete(g),rt.done.delete(g);if((g.f&nn)!==0)if(g.f^=nn,g===l)pr(g,null,e);else{var P=d?d.next:l;g===n.effect.last&&(n.effect.last=g.prev),g.prev&&(g.prev.next=g.next),g.next&&(g.next.prev=g.prev),Xe(n,d,g),Xe(n,g,P),pr(g,P,e),d=g,h=[],f=[],l=fr(d.next);continue}if((g.f&Ys)!==0&&Ya(g),g!==l){if(u!==void 0&&u.has(g)){if(h.length<f.length){var S=f[0],A;d=S.prev;var I=h[0],_=h[h.length-1];for(A=0;A<h.length;A+=1)pr(h[A],S,e);for(A=0;A<f.length;A+=1)u.delete(f[A]);Xe(n,I.prev,_.next),Xe(n,d,I),Xe(n,_,S),l=S,d=_,w-=1,h=[],f=[]}else u.delete(g),pr(g,l,e),Xe(n,g.prev,g.next),Xe(n,g,d===null?n.effect.first:d.next),Xe(n,d,g),d=g;continue}for(h=[],f=[];l!==null&&l!==g;)(u??(u=new Set)).add(l),f.push(l),l=fr(l.next);if(l===null)continue}(g.f&nn)===0&&h.push(g),d=g,l=fr(g.next)}if(n.outrogroups!==null){for(const rt of n.outrogroups)rt.pending.size===0&&(Qs(Fi(rt.done)),(U=n.outrogroups)==null||U.delete(rt));n.outrogroups.size===0&&(n.outrogroups=null)}if(l!==null||u!==void 0){var F=[];if(u!==void 0)for(g of u)(g.f&Ys)===0&&F.push(g);for(;l!==null;)(l.f&Ys)===0&&l!==n.fallback&&F.push(l),l=fr(l.next);var L=F.length;if(L>0){var D=null;ru(n,F,D)}}}function su(n,t,e,r,o,i,s,l){var u=(s&wc)!==0?(s&xc)===0?_c(e,!1,!1):Js(e):null,d=(s&bc)!==0?Js(o):null;return{v:u,i:d,e:Zs(()=>(i(t,u??e,d??o,l),()=>{n.delete(r)}))}}function pr(n,t,e){if(n.nodes)for(var r=n.nodes.start,o=n.nodes.end,i=t&&(t.f&nn)===0?t.nodes.start:e;r!==null;){var s=Oc(r);if(i.before(r),r===o)return;r=s}}function Xe(n,t,e){t===null?n.effect.first=e:t.next=e,e===null?n.effect.last=t:e.prev=t}var iu=H('<div data-slot="table-container" class="relative w-full overflow-x-auto"><table><!></table></div>');function au(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=iu(),i=z(o);Tt(i,l=>({"data-slot":"table",class:l,...r}),[()=>ne("w-full caption-bottom text-sm",t.class)]);var s=z(i);Y(s,()=>t.children??et),K(i),dn(i,l=>e(l),()=>e()),K(o),p(n,o),X()}var lu=H("<tbody><!></tbody>");function cu(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=lu();Tt(o,s=>({"data-slot":"table-body",class:s,...r}),[()=>ne("[&_tr:last-child]:border-0",t.class)]);var i=z(o);Y(i,()=>t.children??et),K(o),dn(o,s=>e(s),()=>e()),p(n,o),X()}var uu=H("<td><!></td>");function Gt(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=uu();Tt(o,s=>({"data-slot":"table-cell",class:s,...r}),[()=>ne("bg-clip-padding p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pe-0",t.class)]);var i=z(o);Y(i,()=>t.children??et),K(o),dn(o,s=>e(s),()=>e()),p(n,o),X()}var du=H("<th><!></th>");function Zt(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=du();Tt(o,s=>({"data-slot":"table-head",class:s,...r}),[()=>ne("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 i=z(o);Y(i,()=>t.children??et),K(o),dn(o,s=>e(s),()=>e()),p(n,o),X()}var fu=H("<thead><!></thead>");function hu(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=fu();Tt(o,s=>({"data-slot":"table-header",class:s,...r}),[()=>ne("[&_tr]:border-b",t.class)]);var i=z(o);Y(i,()=>t.children??et),K(o),dn(o,s=>e(s),()=>e()),p(n,o),X()}var gu=H("<tr><!></tr>");function Gs(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=gu();Tt(o,s=>({"data-slot":"table-row",class:s,...r}),[()=>ne("hover:[&,&>svelte-css-wrapper]:[&>th,td]:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t.class)]);var i=z(o);Y(i,()=>t.children??et),K(o),dn(o,s=>e(s),()=>e()),p(n,o),X()}function Fn(n){let t=j(yr(n));return{[qc]:!0,[Uc]:!0,get current(){return c(t)},set current(e){x(t,e,!0)}}}Fn.from=Za;Fn.with=M;Fn.flatten=Yc;Fn.readonly=Gc;Fn.isBox=Xc;Fn.isWritableBox=jc;const rl=typeof window<"u"?window:void 0;function vu(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var pe,me,Fe,cs,le,mr,Yo;const ji=class ji extends Map{constructor(e){super();y(this,le);y(this,pe,new Map);y(this,me,j(0));y(this,Fe,j(0));y(this,cs,ya||-1);if(e){for(var[r,o]of e)super.set(r,o);a(this,Fe).v=super.size}}has(e){var r=a(this,pe),o=r.get(e);if(o===void 0){var i=super.get(e);if(i!==void 0)o=tt(this,le,mr).call(this,0),r.set(e,o);else return c(a(this,me)),!1}return c(o),!0}forEach(e,r){tt(this,le,Yo).call(this),super.forEach(e,r)}get(e){var r=a(this,pe),o=r.get(e);if(o===void 0){var i=super.get(e);if(i!==void 0)o=tt(this,le,mr).call(this,0),r.set(e,o);else{c(a(this,me));return}}return c(o),super.get(e)}set(e,r){var f;var o=a(this,pe),i=o.get(e),s=super.get(e),l=super.set(e,r),u=a(this,me);if(i===void 0)i=tt(this,le,mr).call(this,0),o.set(e,i),x(a(this,Fe),super.size),cr(u);else if(s!==r){cr(i);var d=u.reactions===null?null:new Set(u.reactions),h=d===null||!((f=i.reactions)!=null&&f.every(v=>d.has(v)));h&&cr(u)}return l}delete(e){var r=a(this,pe),o=r.get(e),i=super.delete(e);return o!==void 0&&(r.delete(e),x(a(this,Fe),super.size),x(o,-1),cr(a(this,me))),i}clear(){if(super.size!==0){super.clear();var e=a(this,pe);x(a(this,Fe),0);for(var r of e.values())x(r,-1);cr(a(this,me)),e.clear()}}keys(){return c(a(this,me)),super.keys()}values(){return tt(this,le,Yo).call(this),super.values()}entries(){return tt(this,le,Yo).call(this),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return c(a(this,Fe)),super.size}};pe=new WeakMap,me=new WeakMap,Fe=new WeakMap,cs=new WeakMap,le=new WeakSet,mr=function(e){return ya===a(this,cs)?j(e):Js(e)},Yo=function(){c(a(this,me));var e=a(this,pe);if(a(this,Fe).v!==e.size){for(var r of ha(ji.prototype,this,"keys").call(this))if(!e.has(r)){var o=tt(this,le,mr).call(this,0);e.set(r,o)}}for([,o]of a(this,pe))c(o)};let $s=ji;var Ln,_r;class pu{constructor(t={}){y(this,Ln);y(this,_r);const{window:e=rl,document:r=e==null?void 0:e.document}=t;e!==void 0&&(V(this,Ln,r),V(this,_r,ja(o=>{const i=It(e,"focusin",o),s=It(e,"focusout",o);return()=>{i(),s()}})))}get current(){var t;return(t=a(this,_r))==null||t.call(this),a(this,Ln)?vu(a(this,Ln)):null}}Ln=new WeakMap,_r=new WeakMap;new pu;function mu(n){return typeof n=="function"}var Pr,Me;class fn{constructor(t){y(this,Pr);y(this,Me);V(this,Pr,t),V(this,Me,Symbol(t))}get key(){return a(this,Me)}exists(){return Ac(a(this,Me))}get(){const t=ba(a(this,Me));if(t===void 0)throw new Error(`Context "${a(this,Pr)}" not found`);return t}getOr(t){const e=ba(a(this,Me));return e===void 0?t:e}set(t){return Ec(a(this,Me),t)}}Pr=new WeakMap,Me=new WeakMap;function yu(n,t){switch(n){case"post":Wt(t);break;case"pre":Tc(t);break}}function ol(n,t,e,r={}){const{lazy:o=!1}=r;let i=!o,s=Array.isArray(n)?[]:void 0;yu(t,()=>{const l=Array.isArray(n)?n.map(d=>d()):n();if(!i){i=!0,s=l;return}const u=Fc(()=>e(l,s));return s=l,u})}function Kt(n,t,e){ol(n,"post",t,e)}function bu(n,t,e){ol(n,"pre",t,e)}Kt.pre=bu;function _a(n){return mu(n)?n():n}var je,Wn,zn,Kn,Ze,us,ds,Vn;class wu{constructor(t,e={box:"border-box"}){y(this,je,{width:0,height:0});y(this,Wn,!1);y(this,zn);y(this,Kn);y(this,Ze);y(this,us,O(()=>{var t;return(t=c(a(this,Vn)))==null||t(),this.getSize().width}));y(this,ds,O(()=>{var t;return(t=c(a(this,Vn)))==null||t(),this.getSize().height}));y(this,Vn,O(()=>{const t=_a(a(this,Kn));if(t)return ja(e=>{if(!a(this,Ze))return;const r=new(a(this,Ze)).ResizeObserver(o=>{V(this,Wn,!0);for(const i of o){const s=a(this,zn).box==="content-box"?i.contentBoxSize:i.borderBoxSize,l=Array.isArray(s)?s:[s];a(this,je).width=l.reduce((u,d)=>Math.max(u,d.inlineSize),0),a(this,je).height=l.reduce((u,d)=>Math.max(u,d.blockSize),0)}e()});return r.observe(t),()=>{V(this,Wn,!1),r.disconnect()}})}));V(this,Ze,e.window??rl),V(this,zn,e),V(this,Kn,t),V(this,je,{width:0,height:0})}calculateSize(){const t=_a(a(this,Kn));if(!t||!a(this,Ze))return;const e=t.offsetWidth,r=t.offsetHeight;if(a(this,zn).box==="border-box")return{width:e,height:r};const o=a(this,Ze).getComputedStyle(t),i=parseFloat(o.paddingLeft)+parseFloat(o.paddingRight),s=parseFloat(o.paddingTop)+parseFloat(o.paddingBottom),l=parseFloat(o.borderLeftWidth)+parseFloat(o.borderRightWidth),u=parseFloat(o.borderTopWidth)+parseFloat(o.borderBottomWidth),d=e-i-l,h=r-s-u;return{width:d,height:h}}getSize(){return a(this,Wn)?a(this,je):this.calculateSize()??a(this,je)}get current(){var t;return(t=c(a(this,Vn)))==null||t(),this.getSize()}get width(){return c(a(this,us))}get height(){return c(a(this,ds))}}je=new WeakMap,Wn=new WeakMap,zn=new WeakMap,Kn=new WeakMap,Ze=new WeakMap,us=new WeakMap,ds=new WeakMap,Vn=new WeakMap;function er(n){Wt(()=>()=>{n()})}function xu(n,t){return setTimeout(t,n)}function Le(n){Mc().then(n)}const _u=1,Pu=9,Su=11;function ti(n){return Ds(n)&&n.nodeType===_u&&typeof n.nodeName=="string"}function sl(n){return Ds(n)&&n.nodeType===Pu}function Cu(n){var t;return Ds(n)&&((t=n.constructor)==null?void 0:t.name)==="VisualViewport"}function Ou(n){return Ds(n)&&n.nodeType!==void 0}function il(n){return Ou(n)&&n.nodeType===Su&&"host"in n}function Au(n,t){var r;if(!n||!t||!ti(n)||!ti(t))return!1;const e=(r=t.getRootNode)==null?void 0:r.call(t);if(n===t||n.contains(t))return!0;if(e&&il(e)){let o=t;for(;o;){if(n===o)return!0;o=o.parentNode||o.host}}return!1}function Ro(n){return sl(n)?n:Cu(n)?n.document:(n==null?void 0:n.ownerDocument)??document}function Ii(n){var t;return il(n)?Ii(n.host):sl(n)?n.defaultView??window:ti(n)?((t=n.ownerDocument)==null?void 0:t.defaultView)??window:window}function Eu(n){let t=n.activeElement;for(;t!=null&&t.shadowRoot;){const e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Sr;class ki{constructor(t){E(this,"element");y(this,Sr,O(()=>this.element.current?this.element.current.getRootNode()??document:document));E(this,"getDocument",()=>Ro(this.root));E(this,"getWindow",()=>this.getDocument().defaultView??window);E(this,"getActiveElement",()=>Eu(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=M(t):this.element=t}get root(){return c(a(this,Sr))}set root(t){x(a(this,Sr),t)}getElementById(t){return this.root.getElementById(t)}}Sr=new WeakMap;const wr="ArrowDown",Di="ArrowLeft",Ni="ArrowRight",Jo="ArrowUp",al="End",Ri="Enter",Tu="Escape",ll="Home",Fu="PageDown",Mu="PageUp",Ns=" ",Iu="Tab";function ku(n){return window.getComputedStyle(n).getPropertyValue("direction")}function Du(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Di:Ni,vertical:wr}[t]}function Nu(n="ltr",t="horizontal"){return{horizontal:n==="rtl"?Ni:Di,vertical:Jo}[t]}function Ru(n="ltr",t="horizontal"){return["ltr","rtl"].includes(n)||(n="ltr"),["horizontal","vertical"].includes(t)||(t="horizontal"),{nextKey:Du(n,t),prevKey:Nu(n,t)}}const cl=typeof document<"u",Pa=Bu();function Bu(){var n,t;return cl&&((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 ze(n){return n instanceof HTMLElement}function ei(n){return n instanceof Element}function ul(n){return n instanceof Element||n instanceof SVGElement}function Lu(n){return n!==null}function Wu(n){return n instanceof HTMLInputElement&&"select"in n}var Ut,Ie;class zu{constructor(t){y(this,Ut);y(this,Ie,Fn(null));V(this,Ut,t)}getCandidateNodes(){return a(this,Ut).rootNode.current?a(this,Ut).candidateSelector?Array.from(a(this,Ut).rootNode.current.querySelectorAll(a(this,Ut).candidateSelector)):a(this,Ut).candidateAttr?Array.from(a(this,Ut).rootNode.current.querySelectorAll(`[${a(this,Ut).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 g,w;const o=a(this,Ut).rootNode.current;if(!o||!t)return;const i=this.getCandidateNodes();if(!i.length)return;const s=i.indexOf(t),l=ku(o),{nextKey:u,prevKey:d}=Ru(l,a(this,Ut).orientation.current),h=a(this,Ut).loop.current,f={[u]:s+1,[d]:s-1,[ll]:0,[al]:i.length-1};if(r){const P=u===wr?Ni:wr,S=d===Jo?Di:Jo;f[P]=s+1,f[S]=s-1}let v=f[e.key];if(v===void 0)return;e.preventDefault(),v<0&&h?v=i.length-1:v===i.length&&h&&(v=0);const m=i[v];if(m)return m.focus(),a(this,Ie).current=m.id,(w=(g=a(this,Ut)).onCandidateFocus)==null||w.call(g,m),m}getTabIndex(t){const e=this.getCandidateNodes(),r=a(this,Ie).current!==null;return t&&!r&&e[0]===t?(a(this,Ie).current=t.id,0):(t==null?void 0:t.id)===a(this,Ie).current?0:-1}setCurrentTabStopId(t){a(this,Ie).current=t}focusCurrentTabStop(){var r;const t=a(this,Ie).current;if(!t)return;const e=(r=a(this,Ut).rootNode.current)==null?void 0:r.querySelector(`#${t}`);!e||!ze(e)||e.focus()}}Ut=new WeakMap,Ie=new WeakMap;var Hn,yn,We,ni,Go;class Ku{constructor(t){y(this,We);y(this,Hn);y(this,yn,null);V(this,Hn,t),er(()=>tt(this,We,ni).call(this))}run(t){tt(this,We,ni).call(this);const e=a(this,Hn).ref.current;if(e){if(typeof e.getAnimations!="function"){tt(this,We,Go).call(this,t);return}V(this,yn,window.requestAnimationFrame(()=>{const r=e.getAnimations();if(r.length===0){tt(this,We,Go).call(this,t);return}Promise.allSettled(r.map(o=>o.finished)).then(()=>{tt(this,We,Go).call(this,t)})}))}}}Hn=new WeakMap,yn=new WeakMap,We=new WeakSet,ni=function(){a(this,yn)&&(window.cancelAnimationFrame(a(this,yn)),V(this,yn,null))},Go=function(t){const e=()=>{t()};a(this,Hn).afterTick?Le(e):e()};var ye,Cr,Or,bn;class ri{constructor(t){y(this,ye);y(this,Cr);y(this,Or);y(this,bn,j(!1));V(this,ye,t),x(a(this,bn),t.open.current,!0),V(this,Cr,t.enabled??!0),V(this,Or,new Ku({ref:a(this,ye).ref,afterTick:a(this,ye).open})),Kt(()=>a(this,ye).open.current,e=>{e&&x(a(this,bn),!0),a(this,Cr)&&a(this,Or).run(()=>{var r,o;e===a(this,ye).open.current&&(a(this,ye).open.current||x(a(this,bn),!1),(o=(r=a(this,ye)).onComplete)==null||o.call(r))})})}get shouldRender(){return c(a(this,bn))}}ye=new WeakMap,Cr=new WeakMap,Or=new WeakMap,bn=new WeakMap;function Pt(){}const Vu=Ja({component:"dialog",parts:["content","trigger","overlay","title","description","close","cancel","action"]}),An=new fn("Dialog.Root | AlertDialog.Root");var Ar,Er,Tr,Fr,Mr,Ir,kr,Dr,Nr,Rr,Br;const Zi=class Zi{constructor(t,e){E(this,"opts");y(this,Ar,j(null));y(this,Er,j(null));y(this,Tr,j(null));y(this,Fr,j(null));y(this,Mr,j(void 0));y(this,Ir,j(void 0));y(this,kr,j(void 0));y(this,Dr,j(void 0));y(this,Nr,j(null));y(this,Rr,j(0));E(this,"depth");E(this,"parent");E(this,"contentPresence");E(this,"overlayPresence");E(this,"getBitsAttr",t=>Vu.getAttr(t,this.opts.variant.current));y(this,Br,O(()=>({"data-state":Mi(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 ri({ref:M(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new ri({ref:M(()=>this.overlayNode),open:this.opts.open,enabled:!0}),Kt(()=>this.opts.open.current,r=>{this.parent&&(r?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),er(()=>{var r;this.opts.open.current&&((r=this.parent)==null||r.decrementNested())})}static create(t){const e=An.getOr(null);return An.set(new Zi(t,e))}get triggerNode(){return c(a(this,Ar))}set triggerNode(t){x(a(this,Ar),t,!0)}get contentNode(){return c(a(this,Er))}set contentNode(t){x(a(this,Er),t,!0)}get overlayNode(){return c(a(this,Tr))}set overlayNode(t){x(a(this,Tr),t,!0)}get descriptionNode(){return c(a(this,Fr))}set descriptionNode(t){x(a(this,Fr),t,!0)}get contentId(){return c(a(this,Mr))}set contentId(t){x(a(this,Mr),t,!0)}get titleId(){return c(a(this,Ir))}set titleId(t){x(a(this,Ir),t,!0)}get triggerId(){return c(a(this,kr))}set triggerId(t){x(a(this,kr),t,!0)}get descriptionId(){return c(a(this,Dr))}set descriptionId(t){x(a(this,Dr),t,!0)}get cancelNode(){return c(a(this,Nr))}set cancelNode(t){x(a(this,Nr),t,!0)}get nestedOpenCount(){return c(a(this,Rr))}set nestedOpenCount(t){x(a(this,Rr),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 c(a(this,Br))}set sharedProps(t){x(a(this,Br),t)}};Ar=new WeakMap,Er=new WeakMap,Tr=new WeakMap,Fr=new WeakMap,Mr=new WeakMap,Ir=new WeakMap,kr=new WeakMap,Dr=new WeakMap,Nr=new WeakMap,Rr=new WeakMap,Br=new WeakMap;let oi=Zi;var Lr;const Ji=class Ji{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Lr,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=ce(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}static create(t){return new Ji(t,An.get())}onclick(t){this.opts.disabled.current||t.button>0||this.root.handleClose()}onkeydown(t){this.opts.disabled.current||(t.key===Ns||t.key===Ri)&&(t.preventDefault(),this.root.handleClose())}get props(){return c(a(this,Lr))}set props(t){x(a(this,Lr),t)}};Lr=new WeakMap;let si=Ji;var Wr;const Qi=class Qi{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Wr,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=ce(this.opts.ref),Kt.pre(()=>this.opts.id.current,r=>{this.root.titleId=r})}static create(t){return new Qi(t,An.get())}get props(){return c(a(this,Wr))}set props(t){x(a(this,Wr),t)}};Wr=new WeakMap;let ii=Qi;var zr;const $i=class $i{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,zr,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=ce(this.opts.ref,r=>{this.root.descriptionNode=r}),Kt.pre(()=>this.opts.id.current,r=>{this.root.descriptionId=r})}static create(t){return new $i(t,An.get())}get props(){return c(a(this,zr))}set props(t){x(a(this,zr),t)}};zr=new WeakMap;let ai=$i;var Kr,Vr;const ta=class ta{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Kr,O(()=>({open:this.root.opts.open.current})));y(this,Vr,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":Qn(this.root.nestedOpenCount>0),"data-nested":Qn(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref,r=>{this.root.contentNode=r,this.root.contentId=r==null?void 0:r.id})}static create(t){return new ta(t,An.get())}get snippetProps(){return c(a(this,Kr))}set snippetProps(t){x(a(this,Kr),t)}get props(){return c(a(this,Vr))}set props(t){x(a(this,Vr),t)}get shouldRender(){return this.root.contentPresence.shouldRender}};Kr=new WeakMap,Vr=new WeakMap;let li=ta;var Hr,Ur;const ea=class ea{constructor(t,e){E(this,"opts");E(this,"root");E(this,"attachment");y(this,Hr,O(()=>({open:this.root.opts.open.current})));y(this,Ur,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":Qn(this.root.nestedOpenCount>0),"data-nested":Qn(this.root.parent!==null),...this.root.sharedProps,...this.attachment})));this.opts=t,this.root=e,this.attachment=ce(this.opts.ref,r=>this.root.overlayNode=r)}static create(t){return new ea(t,An.get())}get snippetProps(){return c(a(this,Hr))}set snippetProps(t){x(a(this,Hr),t)}get props(){return c(a(this,Ur))}set props(t){x(a(this,Ur),t)}get shouldRender(){return this.root.overlayPresence.shouldRender}};Hr=new WeakMap,Ur=new WeakMap;let ci=ea;var Hu=H("<div><!></div>");function Uu(n,t){const e=cn();G(t,!0);let r=b(t,"id",19,()=>un(e)),o=b(t,"ref",15,null),i=b(t,"level",3,2),s=nt(t,["$$slots","$$events","$$legacy","id","ref","child","children","level"]);const l=ii.create({id:M(()=>r()),level:M(()=>i()),ref:M(()=>o(),m=>o(m))}),u=O(()=>zt(s,l.props));var d=N(),h=T(d);{var f=m=>{var g=N(),w=T(g);Y(w,()=>t.child,()=>({props:c(u)})),p(m,g)},v=m=>{var g=Hu();Tt(g,()=>({...c(u)}));var w=z(g);Y(w,()=>t.children??et),K(g),p(m,g)};yt(h,m=>{t.child?m(f):m(v,!1)})}p(n,d),X()}function qu(n,t){var e=N(),r=T(e);nu(r,()=>t.children,o=>{var i=N(),s=T(i);Y(s,()=>t.children??et),p(o,i)}),p(n,e)}const Yu=new fn("BitsConfig");function Gu(){const n=new Xu(null,{});return Yu.getOr(n).opts}class Xu{constructor(t,e){E(this,"opts");const r=ju(t,e);this.opts={defaultPortalTo:r(o=>o.defaultPortalTo),defaultLocale:r(o=>o.defaultLocale)}}}function ju(n,t){return e=>M(()=>{var i,s;const o=(i=e(t))==null?void 0:i.current;if(o!==void 0)return o;if(n!==null)return(s=e(n.opts))==null?void 0:s.current})}function Zu(n,t){return e=>{const r=Gu();return M(()=>{const o=e();if(o!==void 0)return o;const i=n(r).current;return i!==void 0?i:t})}}const Ju=Zu(n=>n.defaultPortalTo,"body");function dl(n,t){G(t,!0);const e=Ju(()=>t.to),r=Ic();let o=O(i);function i(){if(!cl||t.disabled)return null;let f=null;return typeof e.current=="string"?f=document.querySelector(e.current):f=e.current,f}let s;function l(){s&&(Lc(s),s=null)}Kt([()=>c(o),()=>t.disabled],([f,v])=>{if(!f||v){l();return}return s=Bc(qu,{target:f,props:{children:t.children},context:r}),()=>{l()}});var u=N(),d=T(u);{var h=f=>{var v=N(),m=T(v);Y(m,()=>t.children??et),p(f,v)};yt(d,f=>{t.disabled&&f(h)})}p(n,u),X()}class Qu{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 o=i=>{e(i)};return It(t,this.eventName,o,r)}}function Sa(n,t=500){let e=null;const r=(...o)=>{e!==null&&clearTimeout(e),e=setTimeout(()=>{n(...o)},t)};return r.destroy=()=>{e!==null&&(clearTimeout(e),e=null)},r}function fl(n,t){return n===t||n.contains(t)}function hl(n){return(n==null?void 0:n.ownerDocument)??document}function $u(n,t){const{clientX:e,clientY:r}=n,o=t.getBoundingClientRect();return e<o.left||e>o.right||r<o.top||r>o.bottom}const td=[Ri,Ns],ed=[wr,Mu,ll],gl=[Jo,Fu,al],nd=[...ed,...gl];function Ca(n){return n.pointerType==="mouse"}function rd(n,{select:t=!1}={}){if(!n||!n.focus)return;const e=Ro(n);if(e.activeElement===n)return;const r=e.activeElement;n.focus({preventScroll:!0}),n!==r&&Wu(n)&&t&&n.select()}function od(n,{select:t=!1}={},e){const r=e();for(const o of n)if(rd(o,{select:t}),e()!==r)return!0}let hr=j(!1);const re=class re{constructor(){Wt(()=>(re._refs===0&&(re._cleanup=Xa(()=>{const t=[],e=o=>{x(hr,!1)},r=o=>{x(hr,!0)};return t.push(It(document,"pointerdown",e,{capture:!0}),It(document,"pointermove",e,{capture:!0}),It(document,"keydown",r,{capture:!0})),Rn(...t)})),re._refs++,()=>{var t;re._refs--,re._refs===0&&(x(hr,!1),(t=re._cleanup)==null||t.call(re))}))}get current(){return c(hr)}set current(t){x(hr,t,!0)}};E(re,"_refs",0),E(re,"_cleanup");let ui=re;/*!
|
||
* tabbable 6.4.0
|
||
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
||
*/var vl=["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] *)"],Qo=vl.join(","),pl=typeof Element>"u",En=pl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$o=!pl&&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},ts=function(t,e){var r;e===void 0&&(e=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",s=i||e&&t&&(typeof t.closest=="function"?t.closest("[inert]"):ts(t.parentNode));return s},sd=function(t){var e,r=t==null||(e=t.getAttribute)===null||e===void 0?void 0:e.call(t,"contenteditable");return r===""||r==="true"},ml=function(t,e,r){if(ts(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Qo));return e&&En.call(t,Qo)&&o.unshift(t),o=o.filter(r),o},es=function(t,e,r){for(var o=[],i=Array.from(t);i.length;){var s=i.shift();if(!ts(s,!1))if(s.tagName==="SLOT"){var l=s.assignedElements(),u=l.length?l:s.children,d=es(u,!0,r);r.flatten?o.push.apply(o,d):o.push({scopeParent:s,candidates:d})}else{var h=En.call(s,Qo);h&&r.filter(s)&&(e||!t.includes(s))&&o.push(s);var f=s.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(s),v=!ts(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(s));if(f&&v){var m=es(f===!0?s.children:f.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:s,candidates:m})}else i.unshift.apply(i,s.children)}}return o},yl=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},bl=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||sd(t))&&!yl(t)?0:t.tabIndex},id=function(t,e){var r=bl(t);return r<0&&e&&!yl(t)?0:r},ad=function(t,e){return t.tabIndex===e.tabIndex?t.documentOrder-e.documentOrder:t.tabIndex-e.tabIndex},wl=function(t){return t.tagName==="INPUT"},ld=function(t){return wl(t)&&t.type==="hidden"},cd=function(t){var e=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return e},ud=function(t,e){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===e)return t[r]},dd=function(t){if(!t.name)return!0;var e=t.form||$o(t),r=function(l){return e.querySelectorAll('input[type="radio"][name="'+l+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(s){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",s.message),!1}var i=ud(o,t.form);return!i||i===t},fd=function(t){return wl(t)&&t.type==="radio"},hd=function(t){return fd(t)&&!dd(t)},gd=function(t){var e,r=t&&$o(t),o=(e=r)===null||e===void 0?void 0:e.host,i=!1;if(r&&r!==t){var s,l,u;for(i=!!((s=o)!==null&&s!==void 0&&(l=s.ownerDocument)!==null&&l!==void 0&&l.contains(o)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!i&&o;){var d,h,f;r=$o(o),o=(d=r)===null||d===void 0?void 0:d.host,i=!!((h=o)!==null&&h!==void 0&&(f=h.ownerDocument)!==null&&f!==void 0&&f.contains(o))}}return i},Oa=function(t){var e=t.getBoundingClientRect(),r=e.width,o=e.height;return r===0&&o===0},vd=function(t,e){var r=e.displayCheck,o=e.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var s=En.call(t,"details>summary:first-of-type"),l=s?t.parentElement:t;if(En.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof o=="function"){for(var u=t;t;){var d=t.parentElement,h=$o(t);if(d&&!d.shadowRoot&&o(d)===!0)return Oa(t);t.assignedSlot?t=t.assignedSlot:!d&&h!==t.ownerDocument?t=h.host:t=d}t=u}if(gd(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return Oa(t);return!1},pd=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<e.children.length;r++){var o=e.children.item(r);if(o.tagName==="LEGEND")return En.call(e,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}e=e.parentElement}return!1},ns=function(t,e){return!(e.disabled||ld(e)||vd(e,t)||cd(e)||pd(e))},di=function(t,e){return!(hd(e)||bl(e)<0||!ns(t,e))},md=function(t){var e=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(e)||e>=0)},xl=function(t){var e=[],r=[];return t.forEach(function(o,i){var s=!!o.scopeParent,l=s?o.scopeParent:o,u=id(l,s),d=s?xl(o.candidates):l;u===0?s?e.push.apply(e,d):e.push(l):r.push({documentOrder:i,tabIndex:u,item:o,isScope:s,content:d})}),r.sort(ad).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(e)},_l=function(t,e){e=e||{};var r;return e.getShadowRoot?r=es([t],e.includeContainer,{filter:di.bind(null,e),flatten:!1,getShadowRoot:e.getShadowRoot,shadowRootFilter:md}):r=ml(t,e.includeContainer,di.bind(null,e)),xl(r)},Pl=function(t,e){e=e||{};var r;return e.getShadowRoot?r=es([t],e.includeContainer,{filter:ns.bind(null,e),flatten:!0,getShadowRoot:e.getShadowRoot}):r=ml(t,e.includeContainer,ns.bind(null,e)),r},Bi=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return En.call(t,Qo)===!1?!1:di(e,t)},yd=vl.concat("iframe:not([inert]):not([inert] *)").join(","),Sl=function(t,e){if(e=e||{},!t)throw new Error("No node provided");return En.call(t,yd)===!1?!1:ns(e,t)};function br(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"}}function bd(n,t){if(!Bi(n,br()))return wd(n,t);const e=Ro(n),r=_l(e.body,br());t==="prev"&&r.reverse();const o=r.indexOf(n);return o===-1?e.body:r.slice(o+1)[0]}function wd(n,t){const e=Ro(n);if(!Sl(n,br()))return e.body;const r=Pl(e.body,br());t==="prev"&&r.reverse();const o=r.indexOf(n);return o===-1?e.body:r.slice(o+1).find(s=>Bi(s,br()))??e.body}function Cl(n,t,e){const r=t.toLowerCase();if(r.endsWith(" ")){const f=r.slice(0,-1);if(n.filter(w=>w.toLowerCase().startsWith(f)).length<=1)return Cl(n,f,e);const m=e==null?void 0:e.toLowerCase();if(m&&m.startsWith(f)&&m.charAt(f.length)===" "&&t.trim()===f)return e;const g=n.filter(w=>w.toLowerCase().startsWith(r));if(g.length>0){const w=e?n.indexOf(e):-1;return Aa(g,Math.max(w,0)).find(A=>A!==e)||e}}const i=t.length>1&&Array.from(t).every(f=>f===t[0])?t[0]:t,s=i.toLowerCase(),l=e?n.indexOf(e):-1;let u=Aa(n,Math.max(l,0));i.length===1&&(u=u.filter(f=>f!==e));const h=u.find(f=>f==null?void 0:f.toLowerCase().startsWith(s));return h!==e?h:void 0}function Aa(n,t){return n.map((e,r)=>n[(t+r)%n.length])}const xd={afterMs:1e4,onChange:Pt};function Ol(n,t){const{afterMs:e,onChange:r,getWindow:o}={...xd,...t};let i=null,s=j(yr(n));function l(){return o().setTimeout(()=>{x(s,n,!0),r==null||r(n)},e)}return Wt(()=>()=>{i&&o().clearTimeout(i)}),M(()=>c(s),u=>{x(s,u,!0),r==null||r(u),i&&o().clearTimeout(i),i=l()})}var ke,De,fs,hs;class _d{constructor(t){y(this,ke);y(this,De);y(this,fs,O(()=>a(this,ke).onMatch?a(this,ke).onMatch:t=>t.focus()));y(this,hs,O(()=>a(this,ke).getCurrentItem?a(this,ke).getCurrentItem:a(this,ke).getActiveElement));V(this,ke,t),V(this,De,Ol("",{afterMs:1e3,getWindow:t.getWindow})),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(t,e){var u,d;if(!e.length)return;a(this,De).current=a(this,De).current+t;const r=c(a(this,hs))(),o=((d=(u=e.find(h=>h===r))==null?void 0:u.textContent)==null?void 0:d.trim())??"",i=e.map(h=>{var f;return((f=h.textContent)==null?void 0:f.trim())??""}),s=Cl(i,a(this,De).current,o),l=e.find(h=>{var f;return((f=h.textContent)==null?void 0:f.trim())===s});return l&&c(a(this,fs))(l),l}resetTypeahead(){a(this,De).current=""}get search(){return a(this,De).current}}ke=new WeakMap,De=new WeakMap,fs=new WeakMap,hs=new WeakMap;var wn,qr,Un,Je,ln,fi,hi;class Pd{constructor(t){y(this,ln);y(this,wn);y(this,qr);y(this,Un);y(this,Je,j(null));V(this,wn,t),V(this,qr,O(()=>a(this,wn).enabled())),V(this,Un,Ol(!1,{afterMs:t.transitTimeout??300,onChange:e=>{var r,o;c(a(this,qr))&&((o=(r=a(this,wn)).setIsPointerInTransit)==null||o.call(r,e))},getWindow:()=>Ii(a(this,wn).triggerNode())})),Kt([t.triggerNode,t.contentNode,t.enabled],([e,r,o])=>{if(!e||!r||!o)return;const i=l=>{tt(this,ln,hi).call(this,l,r)},s=l=>{tt(this,ln,hi).call(this,l,e)};return Rn(It(e,"pointerleave",i),It(r,"pointerleave",s))}),Kt(()=>c(a(this,Je)),()=>{const e=o=>{var d,h;if(!c(a(this,Je)))return;const i=o.target;if(!ei(i))return;const s={x:o.clientX,y:o.clientY},l=((d=t.triggerNode())==null?void 0:d.contains(i))||((h=t.contentNode())==null?void 0:h.contains(i)),u=!Ad(s,c(a(this,Je)));l?tt(this,ln,fi).call(this):u&&(tt(this,ln,fi).call(this),t.onPointerExit())},r=Ro(t.triggerNode()??t.contentNode());if(r)return It(r,"pointermove",e)})}}wn=new WeakMap,qr=new WeakMap,Un=new WeakMap,Je=new WeakMap,ln=new WeakSet,fi=function(){x(a(this,Je),null),a(this,Un).current=!1},hi=function(t,e){const r=t.currentTarget;if(!ze(r))return;const o={x:t.clientX,y:t.clientY},i=Sd(o,r.getBoundingClientRect()),s=Cd(o,i),l=Od(e.getBoundingClientRect()),u=Ed([...s,...l]);x(a(this,Je),u,!0),a(this,Un).current=!0};function Sd(n,t){const e=Math.abs(t.top-n.y),r=Math.abs(t.bottom-n.y),o=Math.abs(t.right-n.x),i=Math.abs(t.left-n.x);switch(Math.min(e,r,o,i)){case i:return"left";case o:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Cd(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 Od(n){const{top:t,right:e,bottom:r,left:o}=n;return[{x:o,y:t},{x:e,y:t},{x:e,y:r},{x:o,y:r}]}function Ad(n,t){const{x:e,y:r}=n;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const l=t[i].x,u=t[i].y,d=t[s].x,h=t[s].y;u>r!=h>r&&e<(d-l)*(r-u)/(h-u)+l&&(o=!o)}return o}function Ed(n){const t=n.slice();return t.sort((e,r)=>e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0),Td(t)}function Td(n){if(n.length<=1)return n.slice();const t=[];for(let r=0;r<n.length;r++){const o=n[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const e=[];for(let r=n.length-1;r>=0;r--){const o=n[r];for(;e.length>=2;){const i=e[e.length-1],s=e[e.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))e.pop();else break}e.push(o)}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 Fd="data-context-menu-trigger",Md="data-context-menu-content",Id=new fn("Menu.Root"),Li=new fn("Menu.Root | Menu.Sub"),Al=new fn("Menu.Content"),kd=new Qu("bitsmenuopen",{bubbles:!1,cancelable:!0}),Dd=Ja({component:"menu",parts:["trigger","content","sub-trigger","item","group","group-heading","checkbox-group","checkbox-item","radio-group","radio-item","separator","sub-content","arrow"]});var Yr,Gr;const na=class na{constructor(t){E(this,"opts");E(this,"isUsingKeyboard",new ui);y(this,Yr,j(!1));y(this,Gr,j(!1));E(this,"getBitsAttr",t=>Dd.getAttr(t,this.opts.variant.current));this.opts=t}static create(t){const e=new na(t);return Id.set(e)}get ignoreCloseAutoFocus(){return c(a(this,Yr))}set ignoreCloseAutoFocus(t){x(a(this,Yr),t,!0)}get isPointerInTransit(){return c(a(this,Gr))}set isPointerInTransit(t){x(a(this,Gr),t,!0)}};Yr=new WeakMap,Gr=new WeakMap;let gi=na;var Xr,jr;const ra=class ra{constructor(t,e,r){E(this,"opts");E(this,"root");E(this,"parentMenu");E(this,"contentId",M(()=>""));y(this,Xr,j(null));E(this,"contentPresence");y(this,jr,j(null));this.opts=t,this.root=e,this.parentMenu=r,this.contentPresence=new ri({ref:M(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),r&&Kt(()=>r.opts.open.current,()=>{r.opts.open.current||(this.opts.open.current=!1)})}static create(t,e){return Li.set(new ra(t,e,null))}get contentNode(){return c(a(this,Xr))}set contentNode(t){x(a(this,Xr),t,!0)}get triggerNode(){return c(a(this,jr))}set triggerNode(t){x(a(this,jr),t,!0)}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}};Xr=new WeakMap,jr=new WeakMap;let vi=ra;var Zr,Jr,Qr,$r,to,on,El,Xo,eo,no;const oa=class oa{constructor(t,e){y(this,on);E(this,"opts");E(this,"parentMenu");E(this,"rovingFocusGroup");E(this,"domContext");E(this,"attachment");y(this,Zr,j(""));y(this,Jr,0);y(this,Qr);y(this,$r,j(!1));y(this,to);E(this,"onCloseAutoFocus",t=>{var e,r;(r=(e=this.opts.onCloseAutoFocus).current)==null||r.call(e,t),!(t.defaultPrevented||a(this,to))&&this.parentMenu.triggerNode&&Bi(this.parentMenu.triggerNode)&&(t.preventDefault(),this.parentMenu.triggerNode.focus())});y(this,eo,O(()=>({open:this.parentMenu.opts.open.current})));y(this,no,O(()=>({id:this.opts.id.current,role:"menu","aria-orientation":"vertical",[this.parentMenu.root.getBitsAttr("content")]:"","data-state":Mi(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 ki(t.ref),this.attachment=ce(this.opts.ref,r=>{this.parentMenu.contentNode!==r&&(this.parentMenu.contentNode=r)}),e.contentId=t.id,V(this,to,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 Pd({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}}),V(this,Qr,new _d({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch),this.rovingFocusGroup=new zu({rootNode:M(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr("item"),loop:this.opts.loop,orientation:M(()=>"vertical")}),Kt(()=>this.parentMenu.contentNode,r=>{if(!r)return;const o=()=>{Le(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})};return kd.listen(r,o)}),Wt(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(a(this,Jr))})}static create(t){return Al.set(new oa(t,Li.get()))}get search(){return c(a(this,Zr))}set search(t){x(a(this,Zr),t,!0)}get mounted(){return c(a(this,$r))}set mounted(t){x(a(this,$r),t,!0)}handleTabKeyDown(t){let e=this.parentMenu;for(;e.parentMenu!==null;)e=e.parentMenu;if(!e.triggerNode)return;t.preventDefault();const r=bd(e.triggerNode,t.shiftKey?"prev":"next");r?(this.parentMenu.root.ignoreCloseAutoFocus=!0,e.onClose(),Le(()=>{r.focus(),Le(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(t){var d,h;if(t.defaultPrevented)return;if(t.key===Iu){this.handleTabKeyDown(t);return}const e=t.target,r=t.currentTarget;if(!ze(e)||!ze(r))return;const o=((d=e.closest(`[${this.parentMenu.root.getBitsAttr("content")}]`))==null?void 0:d.id)===this.parentMenu.contentId.current,i=t.ctrlKey||t.altKey||t.metaKey,s=t.key.length===1;if(this.rovingFocusGroup.handleKeydown(e,t)||t.code==="Space")return;const u=tt(this,on,El).call(this);o&&!i&&s&&a(this,Qr).call(this,t.key,u),((h=t.target)==null?void 0:h.id)===this.parentMenu.contentId.current&&nd.includes(t.key)&&(t.preventDefault(),gl.includes(t.key)&&u.reverse(),od(u,{select:!1},()=>this.domContext.getActiveElement()))}onblur(t){var e,r;ei(t.currentTarget)&&ei(t.target)&&((r=(e=t.currentTarget).contains)!=null&&r.call(e,t.target)||(this.domContext.getWindow().clearTimeout(a(this,Jr)),this.search=""))}onfocus(t){this.parentMenu.root.isUsingKeyboard.current&&Le(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return tt(this,on,Xo).call(this)}onItemLeave(t){if(t.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr("sub-trigger"))||tt(this,on,Xo).call(this)||this.parentMenu.root.isUsingKeyboard.current)return;const e=this.parentMenu.contentNode;e==null||e.focus(),this.rovingFocusGroup.setCurrentTabStopId("")}onTriggerLeave(){return!!tt(this,on,Xo).call(this)}handleInteractOutside(t){var r;if(!ul(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 c(a(this,eo))}set snippetProps(t){x(a(this,eo),t)}get props(){return c(a(this,no))}set props(t){x(a(this,no),t)}};Zr=new WeakMap,Jr=new WeakMap,Qr=new WeakMap,$r=new WeakMap,to=new WeakMap,on=new WeakSet,El=function(){const t=this.parentMenu.contentNode;return t?Array.from(t.querySelectorAll(`[${this.parentMenu.root.getBitsAttr("item")}]:not([data-disabled])`)):[]},Xo=function(){return this.parentMenu.root.isPointerInTransit},eo=new WeakMap,no=new WeakMap;let pi=oa;var qn,ro;class Nd{constructor(t,e){E(this,"opts");E(this,"content");E(this,"attachment");y(this,qn,j(!1));y(this,ro,O(()=>({id:this.opts.id.current,tabindex:-1,role:"menuitem","aria-disabled":Qa(this.opts.disabled.current),"data-disabled":Qn(this.opts.disabled.current),"data-highlighted":c(a(this,qn))?"":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=ce(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&&Ca(t))if(this.opts.disabled.current)this.content.onItemLeave(t);else{if(this.content.onItemEnter())return;const r=t.currentTarget;if(!ze(r))return;r.focus()}}onpointerleave(t){t.defaultPrevented||Ca(t)&&this.content.onItemLeave(t)}onfocus(t){Le(()=>{t.defaultPrevented||this.opts.disabled.current||x(a(this,qn),!0)})}onblur(t){Le(()=>{t.defaultPrevented||x(a(this,qn),!1)})}get props(){return c(a(this,ro))}set props(t){x(a(this,ro),t)}}qn=new WeakMap,ro=new WeakMap;var oo,gs,Tl,so;const sa=class sa{constructor(t,e){y(this,gs);E(this,"opts");E(this,"item");E(this,"root");y(this,oo,!1);y(this,so,O(()=>zt(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 Nd(t,Al.get());return new sa(t,e)}onkeydown(t){const e=this.item.content.search!=="";if(!(this.item.opts.disabled.current||e&&t.key===Ns)&&td.includes(t.key)){if(!ze(t.currentTarget))return;t.currentTarget.click(),t.preventDefault()}}onclick(t){this.item.opts.disabled.current||tt(this,gs,Tl).call(this)}onpointerup(t){var e;if(!t.defaultPrevented&&!a(this,oo)){if(!ze(t.currentTarget))return;(e=t.currentTarget)==null||e.click()}}onpointerdown(t){V(this,oo,!0)}get props(){return c(a(this,so))}set props(t){x(a(this,so),t)}};oo=new WeakMap,gs=new WeakSet,Tl=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()},so=new WeakMap;let mi=sa;var vs,io;const ia=class ia{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===Ns||t.key===Ri){this.parentMenu.toggleOpen(),t.preventDefault();return}t.key===wr&&(this.parentMenu.onOpen(),t.preventDefault())}});y(this,vs,O(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current}));y(this,io,O(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":"menu","aria-expanded":Qa(this.parentMenu.opts.open.current),"aria-controls":c(a(this,vs)),"data-disabled":Qn(this.opts.disabled.current),"data-state":Mi(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=ce(this.opts.ref,r=>this.parentMenu.triggerNode=r)}static create(t){return new ia(t,Li.get())}get props(){return c(a(this,io))}set props(t){x(a(this,io),t)}};vs=new WeakMap,io=new WeakMap;let yi=ia;globalThis.bitsDismissableLayers??(globalThis.bitsDismissableLayers=new Map);var Yn,xn,Qe,Gn,Xn,$e,ao,Ne,ps,tr,Fl,ms,jn,ys,bs,ws,xs,lo,Ml,_s,Ps;const aa=class aa{constructor(t){y(this,tr);E(this,"opts");y(this,Yn);y(this,xn);y(this,Qe,{pointerdown:!1});y(this,Gn,!1);y(this,Xn,!1);y(this,$e);y(this,ao);y(this,Ne,Pt);y(this,ps,t=>{t.defaultPrevented||this.opts.ref.current&&Le(()=>{var e,r;!this.opts.ref.current||a(this,xs).call(this,t.target)||t.target&&!a(this,Xn)&&((r=(e=a(this,ao)).current)==null||r.call(e,t))})});y(this,ms,t=>{let e=t;e.defaultPrevented&&(e=Ea(t)),a(this,Yn).current(t)});y(this,jn,Sa(t=>{if(!this.opts.ref.current){a(this,Ne).call(this);return}const e=this.opts.isValidEvent.current(t,this.opts.ref.current)||Ld(t,this.opts.ref.current);if(!a(this,Gn)||tt(this,tr,Ml).call(this)||!e){a(this,Ne).call(this);return}let r=t;if(r.defaultPrevented&&(r=Ea(r)),a(this,xn).current!=="close"&&a(this,xn).current!=="defer-otherwise-close"){a(this,Ne).call(this);return}t.pointerType==="touch"?(a(this,Ne).call(this),V(this,Ne,It(a(this,$e),"click",a(this,ms),{once:!0}))):a(this,Yn).current(r)},10));y(this,ys,t=>{a(this,Qe)[t.type]=!0});y(this,bs,t=>{a(this,Qe)[t.type]=!1});y(this,ws,()=>{this.opts.ref.current&&V(this,Gn,Bd(this.opts.ref.current))});y(this,xs,t=>this.opts.ref.current?fl(this.opts.ref.current,t):!1);y(this,lo,Sa(()=>{for(const t in a(this,Qe))a(this,Qe)[t]=!1;V(this,Gn,!1)},20));y(this,_s,()=>{V(this,Xn,!0)});y(this,Ps,()=>{V(this,Xn,!1)});E(this,"props",{onfocuscapture:a(this,_s),onblurcapture:a(this,Ps)});this.opts=t,V(this,xn,t.interactOutsideBehavior),V(this,Yn,t.onInteractOutside),V(this,ao,t.onFocusOutside),Wt(()=>{V(this,$e,hl(this.opts.ref.current))});let e=Pt;const r=()=>{a(this,lo).call(this),globalThis.bitsDismissableLayers.delete(this),a(this,jn).destroy(),e()};Kt([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(!(!this.opts.enabled.current||!this.opts.ref.current))return xu(1,()=>{this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,a(this,xn)),e(),e=tt(this,tr,Fl).call(this))}),r}),er(()=>{a(this,lo).destroy(),globalThis.bitsDismissableLayers.delete(this),a(this,jn).destroy(),a(this,Ne).call(this),e()})}static create(t){return new aa(t)}};Yn=new WeakMap,xn=new WeakMap,Qe=new WeakMap,Gn=new WeakMap,Xn=new WeakMap,$e=new WeakMap,ao=new WeakMap,Ne=new WeakMap,ps=new WeakMap,tr=new WeakSet,Fl=function(){return Rn(It(a(this,$e),"pointerdown",Rn(a(this,ys),a(this,ws)),{capture:!0}),It(a(this,$e),"pointerdown",Rn(a(this,bs),a(this,jn))),It(a(this,$e),"focusin",a(this,ps)))},ms=new WeakMap,jn=new WeakMap,ys=new WeakMap,bs=new WeakMap,ws=new WeakMap,xs=new WeakMap,lo=new WeakMap,Ml=function(){return Object.values(a(this,Qe)).some(Boolean)},_s=new WeakMap,Ps=new WeakMap;let bi=aa;function Rd(n=[...globalThis.bitsDismissableLayers]){return n.findLast(([t,{current:e}])=>e==="close"||e==="ignore")}function Bd(n){const t=[...globalThis.bitsDismissableLayers],e=Rd(t);if(e)return e[0].opts.ref.current===n;const[r]=t[0];return r.opts.ref.current===n}function Ld(n,t){const e=n.target;if(!ul(e))return!1;const r=!!e.closest(`[${Fd}]`);if("button"in n&&n.button>0&&!r)return!1;if("button"in n&&n.button===0&&r)return!0;const o=!!t.closest(`[${Md}]`);return r&&o?!1:hl(e).documentElement.contains(e)&&!fl(t,e)&&$u(n,t)}function Ea(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 o=!1;return new Proxy(r,{get:(s,l)=>l==="currentTarget"?t:l==="target"?e:l==="preventDefault"?()=>{o=!0,typeof s.preventDefault=="function"&&s.preventDefault()}:l==="defaultPrevented"?o:l in s?s[l]:n[l]})}function Il(n,t){G(t,!0);let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"onInteractOutside",3,Pt),o=b(t,"onFocusOutside",3,Pt),i=b(t,"isValidEvent",3,()=>!1);const s=bi.create({id:M(()=>t.id),interactOutsideBehavior:M(()=>e()),onInteractOutside:M(()=>r()),enabled:M(()=>t.enabled),onFocusOutside:M(()=>o()),isValidEvent:M(()=>i()),ref:t.ref});var l=N(),u=T(l);Y(u,()=>t.children??et,()=>({props:s.props})),p(n,l),X()}globalThis.bitsEscapeLayers??(globalThis.bitsEscapeLayers=new Map);var Ss,Cs;const la=class la{constructor(t){E(this,"opts");E(this,"domContext");y(this,Ss,()=>It(this.domContext.getDocument(),"keydown",a(this,Cs),{passive:!1}));y(this,Cs,t=>{if(t.key!==Tu||!Wd(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 ki(this.opts.ref);let e=Pt;Kt(()=>t.enabled.current,r=>(r&&(globalThis.bitsEscapeLayers.set(this,t.escapeKeydownBehavior),e=a(this,Ss).call(this)),()=>{e(),globalThis.bitsEscapeLayers.delete(this)}))}static create(t){return new la(t)}};Ss=new WeakMap,Cs=new WeakMap;let wi=la;function Wd(n){const t=[...globalThis.bitsEscapeLayers],e=t.findLast(([o,{current:i}])=>i==="close"||i==="ignore");if(e)return e[0]===n;const[r]=t[0];return r===n}function kl(n,t){G(t,!0);let e=b(t,"escapeKeydownBehavior",3,"close"),r=b(t,"onEscapeKeydown",3,Pt);wi.create({escapeKeydownBehavior:M(()=>e()),onEscapeKeydown:M(()=>r()),enabled:M(()=>t.enabled),ref:t.ref});var o=N(),i=T(o);Y(i,()=>t.children??et),p(n,o),X()}var Re,co,_n;const Os=class Os{constructor(){y(this,Re,Be([]));y(this,co,new WeakMap);y(this,_n,new WeakMap)}static getInstance(){return this.instance||(this.instance=new Os),this.instance}register(t){const e=this.getActive();e&&e!==t&&e.pause();const r=document.activeElement;r&&r!==document.body&&a(this,_n).set(t,r),a(this,Re).current=a(this,Re).current.filter(o=>o!==t),a(this,Re).current.unshift(t)}unregister(t){a(this,Re).current=a(this,Re).current.filter(r=>r!==t);const e=this.getActive();e&&e.resume()}getActive(){return a(this,Re).current[0]}setFocusMemory(t,e){a(this,co).set(t,e)}getFocusMemory(t){return a(this,co).get(t)}isActiveScope(t){return this.getActive()===t}setPreFocusMemory(t,e){a(this,_n).set(t,e)}getPreFocusMemory(t){return a(this,_n).get(t)}clearPreFocusMemory(t){a(this,_n).delete(t)}};Re=new WeakMap,co=new WeakMap,_n=new WeakMap,E(Os,"instance");let xi=Os;var tn,qt,Jt,Pn,en,Ft,Dl,Nl,Rl,Bl,Pi,jo,Si;const ca=class ca{constructor(t){y(this,Ft);y(this,tn,!1);y(this,qt,null);y(this,Jt,xi.getInstance());y(this,Pn,[]);y(this,en);V(this,en,t)}get paused(){return a(this,tn)}pause(){V(this,tn,!0)}resume(){V(this,tn,!1)}mount(t){a(this,qt)&&this.unmount(),V(this,qt,t),a(this,Jt).register(this),tt(this,Ft,Bl).call(this),tt(this,Ft,Nl).call(this)}unmount(){a(this,qt)&&(tt(this,Ft,Dl).call(this),tt(this,Ft,Rl).call(this),a(this,Jt).unregister(this),a(this,Jt).clearPreFocusMemory(this),V(this,qt,null))}static use(t){let e=null;return Kt([()=>t.ref.current,()=>t.enabled.current],([r,o])=>{r&&o?(e||(e=new ca(t)),e.mount(r)):e&&(e.unmount(),e=null)}),er(()=>{e==null||e.unmount()}),{get props(){return{tabindex:-1}}}}};tn=new WeakMap,qt=new WeakMap,Jt=new WeakMap,Pn=new WeakMap,en=new WeakMap,Ft=new WeakSet,Dl=function(){for(const t of a(this,Pn))t();V(this,Pn,[])},Nl=function(){if(!a(this,qt))return;const t=new CustomEvent("focusScope.onOpenAutoFocus",{bubbles:!1,cancelable:!0});a(this,en).onOpenAutoFocus.current(t),t.defaultPrevented||requestAnimationFrame(()=>{if(!a(this,qt))return;const e=tt(this,Ft,jo).call(this);e?(e.focus(),a(this,Jt).setFocusMemory(this,e)):a(this,qt).focus()})},Rl=function(){var e,r;const t=new CustomEvent("focusScope.onCloseAutoFocus",{bubbles:!1,cancelable:!0});if((r=(e=a(this,en).onCloseAutoFocus).current)==null||r.call(e,t),!t.defaultPrevented){const o=a(this,Jt).getPreFocusMemory(this);if(o&&document.contains(o))try{o.focus()}catch{document.body.focus()}}},Bl=function(){if(!a(this,qt)||!a(this,en).trap.current)return;const t=a(this,qt),e=t.ownerDocument,r=s=>{if(a(this,tn)||!a(this,Jt).isActiveScope(this))return;const l=s.target;if(!l)return;if(t.contains(l))a(this,Jt).setFocusMemory(this,l);else{const d=a(this,Jt).getFocusMemory(this);if(d&&t.contains(d)&&Sl(d))s.preventDefault(),d.focus();else{const h=tt(this,Ft,jo).call(this),f=tt(this,Ft,Si).call(this)[0];(h||f||t).focus()}}},o=s=>{if(!a(this,en).loop||a(this,tn)||s.key!=="Tab"||!a(this,Jt).isActiveScope(this))return;const l=tt(this,Ft,Pi).call(this);if(l.length===0)return;const u=l[0],d=l[l.length-1];!s.shiftKey&&e.activeElement===d?(s.preventDefault(),u.focus()):s.shiftKey&&e.activeElement===u&&(s.preventDefault(),d.focus())};a(this,Pn).push(It(e,"focusin",r,{capture:!0}),It(t,"keydown",o));const i=new MutationObserver(()=>{const s=a(this,Jt).getFocusMemory(this);if(s&&!t.contains(s)){const l=tt(this,Ft,jo).call(this),u=tt(this,Ft,Si).call(this)[0],d=l||u;d?(d.focus(),a(this,Jt).setFocusMemory(this,d)):t.focus()}});i.observe(t,{childList:!0,subtree:!0}),a(this,Pn).push(()=>i.disconnect())},Pi=function(){return a(this,qt)?_l(a(this,qt),{includeContainer:!1,getShadowRoot:!0}):[]},jo=function(){return tt(this,Ft,Pi).call(this)[0]||null},Si=function(){return a(this,qt)?Pl(a(this,qt),{includeContainer:!1,getShadowRoot:!0}):[]};let _i=ca;function Ll(n,t){G(t,!0);let e=b(t,"enabled",3,!1),r=b(t,"trapFocus",3,!1),o=b(t,"loop",3,!1),i=b(t,"onCloseAutoFocus",3,Pt),s=b(t,"onOpenAutoFocus",3,Pt);const l=_i.use({enabled:M(()=>e()),trap:M(()=>r()),loop:o(),onCloseAutoFocus:M(()=>i()),onOpenAutoFocus:M(()=>s()),ref:t.ref});var u=N(),d=T(u);Y(d,()=>t.focusScope??et,()=>({props:l.props})),p(n,u),X()}globalThis.bitsTextSelectionLayers??(globalThis.bitsTextSelectionLayers=new Map);var Zn,As,Wl,Es,uo;const ua=class ua{constructor(t){y(this,As);E(this,"opts");E(this,"domContext");y(this,Zn,Pt);y(this,Es,t=>{const e=this.opts.ref.current,r=t.target;!ze(e)||!ze(r)||!this.opts.enabled.current||!Kd(this)||!Au(e,r)||(this.opts.onPointerDown.current(t),!t.defaultPrevented&&V(this,Zn,zd(e,this.domContext.getDocument().body)))});y(this,uo,()=>{a(this,Zn).call(this),V(this,Zn,Pt)});this.opts=t,this.domContext=new ki(t.ref);let e=Pt;Kt(()=>this.opts.enabled.current,r=>(r&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),e(),e=tt(this,As,Wl).call(this)),()=>{e(),a(this,uo).call(this),globalThis.bitsTextSelectionLayers.delete(this)}))}static create(t){return new ua(t)}};Zn=new WeakMap,As=new WeakSet,Wl=function(){return Rn(It(this.domContext.getDocument(),"pointerdown",a(this,Es)),It(this.domContext.getDocument(),"pointerup",Zc(a(this,uo),this.opts.onPointerUp.current)))},Es=new WeakMap,uo=new WeakMap;let Ci=ua;const Ta=n=>n.style.userSelect||n.style.webkitUserSelect;function zd(n,t){const e=Ta(t),r=Ta(n);return Ko(t,"none"),Ko(n,"text"),()=>{Ko(t,e),Ko(n,r)}}function Ko(n,t){n.style.userSelect=t,n.style.webkitUserSelect=t}function Kd(n){const t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;const e=t.at(-1);return e?e[0]===n:!1}function zl(n,t){G(t,!0);let e=b(t,"preventOverflowTextSelection",3,!0),r=b(t,"onPointerDown",3,Pt),o=b(t,"onPointerUp",3,Pt);Ci.create({id:M(()=>t.id),onPointerDown:M(()=>r()),onPointerUp:M(()=>o()),enabled:M(()=>t.enabled&&e()),ref:t.ref});var i=N(),s=T(i);Y(s,()=>t.children??et),p(n,i),X()}globalThis.bitsIdCounter??(globalThis.bitsIdCounter={current:0});function Wi(n="bits"){return globalThis.bitsIdCounter.current++,`${n}-${globalThis.bitsIdCounter.current}`}var fo,Jn,Sn,Cn,Ts,Kl;class Vd{constructor(t){y(this,Ts);y(this,fo);y(this,Jn,0);y(this,Sn,j());y(this,Cn);V(this,fo,t)}get(...t){return V(this,Jn,a(this,Jn)+1),c(a(this,Sn))===void 0&&V(this,Cn,Xa(()=>{x(a(this,Sn),a(this,fo).call(this,...t),!0)})),Wt(()=>()=>{tt(this,Ts,Kl).call(this)}),c(a(this,Sn))}}fo=new WeakMap,Jn=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,Ts=new WeakSet,Kl=function(){V(this,Jn,a(this,Jn)-1),a(this,Cn)&&a(this,Jn)<=0&&(a(this,Cn).call(this),x(a(this,Sn),void 0),V(this,Cn,void 0))};const Zo=new $s;let Vo=j(null),vn=null,gr=null,vr=!1;const Fa=M(()=>{for(const n of Zo.values())if(n)return!0;return!1});let Xs=null;const Hd=new Vd(()=>{function n(){document.body.setAttribute("style",c(Vo)??""),document.body.style.removeProperty("--scrollbar-width"),Pa&&(vn==null||vn()),x(Vo,null)}function t(){gr!==null&&(window.clearTimeout(gr),gr=null)}function e(o,i){t(),vr=!0,Xs=Date.now();const s=Xs,l=()=>{gr=null,Xs===s&&(Vl(Zo)?vr=!1:(vr=!1,i()))},u=o===null?24:o;gr=window.setTimeout(l,u)}function r(){c(Vo)===null&&Zo.size===0&&!vr&&x(Vo,document.body.getAttribute("style"),!0)}return Kt(()=>Fa.current,()=>{var h,f;if(!Fa.current)return;r(),vr=!1;const o=getComputedStyle(document.documentElement),i=getComputedStyle(document.body),s=((h=o.scrollbarGutter)==null?void 0:h.includes("stable"))||((f=i.scrollbarGutter)==null?void 0:f.includes("stable")),l=window.innerWidth-document.documentElement.clientWidth,d={padding:Number.parseInt(i.paddingRight??"0",10)+l,margin:Number.parseInt(i.marginRight??"0",10)};l>0&&!s&&(document.body.style.paddingRight=`${d.padding}px`,document.body.style.marginRight=`${d.margin}px`,document.body.style.setProperty("--scrollbar-width",`${l}px`)),document.body.style.overflow="hidden",Pa&&(vn=It(document,"touchmove",v=>{v.target===document.documentElement&&(v.touches.length>1||v.preventDefault())},{passive:!1})),Le(()=>{document.body.style.pointerEvents="none",document.body.style.overflow="hidden"})}),er(()=>()=>{vn==null||vn()}),{get lockMap(){return Zo},resetBodyStyle:n,scheduleCleanupIfNoNewLocks:e,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}});var On,ho,go,Qt;class Ud{constructor(t,e=()=>null){y(this,On,Wi());y(this,ho);y(this,go,()=>null);y(this,Qt);E(this,"locked");V(this,ho,t),V(this,go,e),V(this,Qt,Hd.get()),a(this,Qt)&&(a(this,Qt).cancelPendingCleanup(),a(this,Qt).ensureInitialStyleCaptured(),a(this,Qt).lockMap.set(a(this,On),a(this,ho)??!1),this.locked=M(()=>a(this,Qt).lockMap.get(a(this,On))??!1,r=>a(this,Qt).lockMap.set(a(this,On),r)),er(()=>{if(a(this,Qt).lockMap.delete(a(this,On)),Vl(a(this,Qt).lockMap))return;const r=a(this,go).call(this);a(this,Qt).scheduleCleanupIfNoNewLocks(r,()=>{a(this,Qt).resetBodyStyle()})}))}}On=new WeakMap,ho=new WeakMap,go=new WeakMap,Qt=new WeakMap;function Vl(n){for(const[t,e]of n)if(e)return!0;return!1}function rs(n,t){G(t,!0);let e=b(t,"preventScroll",3,!0),r=b(t,"restoreScrollDelay",3,null);e()&&new Ud(e(),()=>r()),X()}var qd=H("<div><!></div>");function Yd(n,t){const e=cn();G(t,!0);let r=b(t,"id",19,()=>un(e)),o=b(t,"forceMount",3,!1),i=b(t,"ref",15,null),s=nt(t,["$$slots","$$events","$$legacy","id","forceMount","child","children","ref"]);const l=ci.create({id:M(()=>r()),ref:M(()=>i(),v=>i(v))}),u=O(()=>zt(s,l.props));var d=N(),h=T(d);{var f=v=>{var m=N(),g=T(m);{var w=S=>{var A=N(),I=T(A);{let _=O(()=>({props:zt(c(u)),...l.snippetProps}));Y(I,()=>t.child,()=>c(_))}p(S,A)},P=S=>{var A=qd();Tt(A,_=>({..._}),[()=>zt(c(u))]);var I=z(A);Y(I,()=>t.children??et,()=>l.snippetProps),K(A),p(S,A)};yt(g,S=>{t.child?S(w):S(P,!1)})}p(v,m)};yt(h,v=>{(l.shouldRender||o())&&v(f)})}p(n,d),X()}var Gd=H("<div><!></div>");function Xd(n,t){const e=cn();G(t,!0);let r=b(t,"id",19,()=>un(e)),o=b(t,"ref",15,null),i=nt(t,["$$slots","$$events","$$legacy","id","children","child","ref"]);const s=ai.create({id:M(()=>r()),ref:M(()=>o(),v=>o(v))}),l=O(()=>zt(i,s.props));var u=N(),d=T(u);{var h=v=>{var m=N(),g=T(m);Y(g,()=>t.child,()=>({props:c(l)})),p(v,m)},f=v=>{var m=Gd();Tt(m,()=>({...c(l)}));var g=z(m);Y(g,()=>t.children??et),K(m),p(v,m)};yt(d,v=>{t.child?v(h):v(f,!1)})}p(n,u),X()}const jd=["top","right","bottom","left"],sn=Math.min,te=Math.max,os=Math.round,Ho=Math.floor,we=n=>({x:n,y:n}),Zd={left:"right",right:"left",bottom:"top",top:"bottom"},Jd={start:"end",end:"start"};function Oi(n,t,e){return te(n,sn(t,e))}function Ke(n,t){return typeof n=="function"?n(t):n}function Ve(n){return n.split("-")[0]}function nr(n){return n.split("-")[1]}function zi(n){return n==="x"?"y":"x"}function Ki(n){return n==="y"?"height":"width"}const Qd=new Set(["top","bottom"]);function be(n){return Qd.has(Ve(n))?"y":"x"}function Vi(n){return zi(be(n))}function $d(n,t,e){e===void 0&&(e=!1);const r=nr(n),o=Vi(n),i=Ki(o);let s=o==="x"?r===(e?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=ss(s)),[s,ss(s)]}function tf(n){const t=ss(n);return[Ai(n),t,Ai(t)]}function Ai(n){return n.replace(/start|end/g,t=>Jd[t])}const Ma=["left","right"],Ia=["right","left"],ef=["top","bottom"],nf=["bottom","top"];function rf(n,t,e){switch(n){case"top":case"bottom":return e?t?Ia:Ma:t?Ma:Ia;case"left":case"right":return t?ef:nf;default:return[]}}function of(n,t,e,r){const o=nr(n);let i=rf(Ve(n),e==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Ai)))),i}function ss(n){return n.replace(/left|right|bottom|top/g,t=>Zd[t])}function sf(n){return{top:0,right:0,bottom:0,left:0,...n}}function Hl(n){return typeof n!="number"?sf(n):{top:n,right:n,bottom:n,left:n}}function is(n){const{x:t,y:e,width:r,height:o}=n;return{width:r,height:o,top:e,left:t,right:t+r,bottom:e+o,x:t,y:e}}function ka(n,t,e){let{reference:r,floating:o}=n;const i=be(t),s=Vi(t),l=Ki(s),u=Ve(t),d=i==="y",h=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,v=r[l]/2-o[l]/2;let m;switch(u){case"top":m={x:h,y:r.y-o.height};break;case"bottom":m={x:h,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(nr(t)){case"start":m[s]-=v*(e&&d?-1:1);break;case"end":m[s]+=v*(e&&d?-1:1);break}return m}async function af(n,t){var e;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:l,strategy:u}=n,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:f="floating",altBoundary:v=!1,padding:m=0}=Ke(t,n),g=Hl(m),P=l[v?f==="floating"?"reference":"floating":f],S=is(await i.getClippingRect({element:(e=await(i.isElement==null?void 0:i.isElement(P)))==null||e?P:P.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),A=f==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,I=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),_=await(i.isElement==null?void 0:i.isElement(I))?await(i.getScale==null?void 0:i.getScale(I))||{x:1,y:1}:{x:1,y:1},F=is(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:A,offsetParent:I,strategy:u}):A);return{top:(S.top-F.top+g.top)/_.y,bottom:(F.bottom-S.bottom+g.bottom)/_.y,left:(S.left-F.left+g.left)/_.x,right:(F.right-S.right+g.right)/_.x}}const lf=async(n,t,e)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=e,l=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let d=await s.getElementRects({reference:n,floating:t,strategy:o}),{x:h,y:f}=ka(d,r,u),v=r,m={},g=0;for(let P=0;P<l.length;P++){var w;const{name:S,fn:A}=l[P],{x:I,y:_,data:F,reset:L}=await A({x:h,y:f,initialPlacement:r,placement:v,strategy:o,middlewareData:m,rects:d,platform:{...s,detectOverflow:(w=s.detectOverflow)!=null?w:af},elements:{reference:n,floating:t}});h=I??h,f=_??f,m={...m,[S]:{...m[S],...F}},L&&g<=50&&(g++,typeof L=="object"&&(L.placement&&(v=L.placement),L.rects&&(d=L.rects===!0?await s.getElementRects({reference:n,floating:t,strategy:o}):L.rects),{x:h,y:f}=ka(d,v,u)),P=-1)}return{x:h,y:f,placement:v,strategy:o,middlewareData:m}},cf=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:r,placement:o,rects:i,platform:s,elements:l,middlewareData:u}=t,{element:d,padding:h=0}=Ke(n,t)||{};if(d==null)return{};const f=Hl(h),v={x:e,y:r},m=Vi(o),g=Ki(m),w=await s.getDimensions(d),P=m==="y",S=P?"top":"left",A=P?"bottom":"right",I=P?"clientHeight":"clientWidth",_=i.reference[g]+i.reference[m]-v[m]-i.floating[g],F=v[m]-i.reference[m],L=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d));let D=L?L[I]:0;(!D||!await(s.isElement==null?void 0:s.isElement(L)))&&(D=l.floating[I]||i.floating[g]);const U=_/2-F/2,rt=D/2-w[g]/2-1,ot=sn(f[S],rt),_t=sn(f[A],rt),gt=ot,At=D-w[g]-_t,mt=D/2-w[g]/2+U,it=Oi(gt,mt,At),J=!u.arrow&&nr(o)!=null&&mt!==it&&i.reference[g]/2-(mt<gt?ot:_t)-w[g]/2<0,at=J?mt<gt?mt-gt:mt-At:0;return{[m]:v[m]+at,data:{[m]:it,centerOffset:mt-it-at,...J&&{alignmentOffset:at}},reset:J}}}),uf=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:l,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:f=!0,fallbackPlacements:v,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:w=!0,...P}=Ke(n,t);if((e=i.arrow)!=null&&e.alignmentOffset)return{};const S=Ve(o),A=be(l),I=Ve(l)===l,_=await(u.isRTL==null?void 0:u.isRTL(d.floating)),F=v||(I||!w?[ss(l)]:tf(l)),L=g!=="none";!v&&L&&F.push(...of(l,w,g,_));const D=[l,...F],U=await u.detectOverflow(t,P),rt=[];let ot=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&rt.push(U[S]),f){const mt=$d(o,s,_);rt.push(U[mt[0]],U[mt[1]])}if(ot=[...ot,{placement:o,overflows:rt}],!rt.every(mt=>mt<=0)){var _t,gt;const mt=(((_t=i.flip)==null?void 0:_t.index)||0)+1,it=D[mt];if(it&&(!(f==="alignment"?A!==be(it):!1)||ot.every($=>be($.placement)===A?$.overflows[0]>0:!0)))return{data:{index:mt,overflows:ot},reset:{placement:it}};let J=(gt=ot.filter(at=>at.overflows[0]<=0).sort((at,$)=>at.overflows[1]-$.overflows[1])[0])==null?void 0:gt.placement;if(!J)switch(m){case"bestFit":{var At;const at=(At=ot.filter($=>{if(L){const St=be($.placement);return St===A||St==="y"}return!0}).map($=>[$.placement,$.overflows.filter(St=>St>0).reduce((St,kt)=>St+kt,0)]).sort(($,St)=>$[1]-St[1])[0])==null?void 0:At[0];at&&(J=at);break}case"initialPlacement":J=l;break}if(o!==J)return{reset:{placement:J}}}return{}}}};function Da(n,t){return{top:n.top-t.height,right:n.right-t.width,bottom:n.bottom-t.height,left:n.left-t.width}}function Na(n){return jd.some(t=>n[t]>=0)}const df=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(t){const{rects:e,platform:r}=t,{strategy:o="referenceHidden",...i}=Ke(n,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),l=Da(s,e.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Na(l)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),l=Da(s,e.floating);return{data:{escapedOffsets:l,escaped:Na(l)}}}default:return{}}}}},Ul=new Set(["left","top"]);async function ff(n,t){const{placement:e,platform:r,elements:o}=n,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=Ve(e),l=nr(e),u=be(e)==="y",d=Ul.has(s)?-1:1,h=i&&u?-1:1,f=Ke(t,n);let{mainAxis:v,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),u?{x:m*h,y:v*d}:{x:v*d,y:m*h}}const hf=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,r;const{x:o,y:i,placement:s,middlewareData:l}=t,u=await ff(t,n);return s===((e=l.offset)==null?void 0:e.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:s}}}}},gf=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:u={fn:S=>{let{x:A,y:I}=S;return{x:A,y:I}}},...d}=Ke(n,t),h={x:e,y:r},f=await i.detectOverflow(t,d),v=be(Ve(o)),m=zi(v);let g=h[m],w=h[v];if(s){const S=m==="y"?"top":"left",A=m==="y"?"bottom":"right",I=g+f[S],_=g-f[A];g=Oi(I,g,_)}if(l){const S=v==="y"?"top":"left",A=v==="y"?"bottom":"right",I=w+f[S],_=w-f[A];w=Oi(I,w,_)}const P=u.fn({...t,[m]:g,[v]:w});return{...P,data:{x:P.x-e,y:P.y-r,enabled:{[m]:s,[v]:l}}}}}},vf=function(n){return n===void 0&&(n={}),{options:n,fn(t){const{x:e,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:l=0,mainAxis:u=!0,crossAxis:d=!0}=Ke(n,t),h={x:e,y:r},f=be(o),v=zi(f);let m=h[v],g=h[f];const w=Ke(l,t),P=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(u){const I=v==="y"?"height":"width",_=i.reference[v]-i.floating[I]+P.mainAxis,F=i.reference[v]+i.reference[I]-P.mainAxis;m<_?m=_:m>F&&(m=F)}if(d){var S,A;const I=v==="y"?"width":"height",_=Ul.has(Ve(o)),F=i.reference[f]-i.floating[I]+(_&&((S=s.offset)==null?void 0:S[f])||0)+(_?0:P.crossAxis),L=i.reference[f]+i.reference[I]+(_?0:((A=s.offset)==null?void 0:A[f])||0)-(_?P.crossAxis:0);g<F?g=F:g>L&&(g=L)}return{[v]:m,[f]:g}}}},pf=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,r;const{placement:o,rects:i,platform:s,elements:l}=t,{apply:u=()=>{},...d}=Ke(n,t),h=await s.detectOverflow(t,d),f=Ve(o),v=nr(o),m=be(o)==="y",{width:g,height:w}=i.floating;let P,S;f==="top"||f==="bottom"?(P=f,S=v===(await(s.isRTL==null?void 0:s.isRTL(l.floating))?"start":"end")?"left":"right"):(S=f,P=v==="end"?"top":"bottom");const A=w-h.top-h.bottom,I=g-h.left-h.right,_=sn(w-h[P],A),F=sn(g-h[S],I),L=!t.middlewareData.shift;let D=_,U=F;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(U=I),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(D=A),L&&!v){const ot=te(h.left,0),_t=te(h.right,0),gt=te(h.top,0),At=te(h.bottom,0);m?U=g-2*(ot!==0||_t!==0?ot+_t:te(h.left,h.right)):D=w-2*(gt!==0||At!==0?gt+At:te(h.top,h.bottom))}await u({...t,availableWidth:U,availableHeight:D});const rt=await s.getDimensions(l.floating);return g!==rt.width||w!==rt.height?{reset:{rects:!0}}:{}}}};function Rs(){return typeof window<"u"}function rr(n){return ql(n)?(n.nodeName||"").toLowerCase():"#document"}function ee(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function _e(n){var t;return(t=(ql(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function ql(n){return Rs()?n instanceof Node||n instanceof ee(n).Node:!1}function ue(n){return Rs()?n instanceof Element||n instanceof ee(n).Element:!1}function xe(n){return Rs()?n instanceof HTMLElement||n instanceof ee(n).HTMLElement:!1}function Ra(n){return!Rs()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof ee(n).ShadowRoot}const mf=new Set(["inline","contents"]);function Bo(n){const{overflow:t,overflowX:e,overflowY:r,display:o}=de(n);return/auto|scroll|overlay|hidden|clip/.test(t+r+e)&&!mf.has(o)}const yf=new Set(["table","td","th"]);function bf(n){return yf.has(rr(n))}const wf=[":popover-open",":modal"];function Bs(n){return wf.some(t=>{try{return n.matches(t)}catch{return!1}})}const xf=["transform","translate","scale","rotate","perspective"],_f=["transform","translate","scale","rotate","perspective","filter"],Pf=["paint","layout","strict","content"];function Hi(n){const t=Ui(),e=ue(n)?de(n):n;return xf.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)||_f.some(r=>(e.willChange||"").includes(r))||Pf.some(r=>(e.contain||"").includes(r))}function Sf(n){let t=an(n);for(;xe(t)&&!$n(t);){if(Hi(t))return t;if(Bs(t))return null;t=an(t)}return null}function Ui(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Cf=new Set(["html","body","#document"]);function $n(n){return Cf.has(rr(n))}function de(n){return ee(n).getComputedStyle(n)}function Ls(n){return ue(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function an(n){if(rr(n)==="html")return n;const t=n.assignedSlot||n.parentNode||Ra(n)&&n.host||_e(n);return Ra(t)?t.host:t}function Yl(n){const t=an(n);return $n(t)?n.ownerDocument?n.ownerDocument.body:n.body:xe(t)&&Bo(t)?t:Yl(t)}function xr(n,t,e){var r;t===void 0&&(t=[]),e===void 0&&(e=!0);const o=Yl(n),i=o===((r=n.ownerDocument)==null?void 0:r.body),s=ee(o);if(i){const l=Ei(s);return t.concat(s,s.visualViewport||[],Bo(o)?o:[],l&&e?xr(l):[])}return t.concat(o,xr(o,[],e))}function Ei(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Gl(n){const t=de(n);let e=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=xe(n),i=o?n.offsetWidth:e,s=o?n.offsetHeight:r,l=os(e)!==i||os(r)!==s;return l&&(e=i,r=s),{width:e,height:r,$:l}}function qi(n){return ue(n)?n:n.contextElement}function Bn(n){const t=qi(n);if(!xe(t))return we(1);const e=t.getBoundingClientRect(),{width:r,height:o,$:i}=Gl(t);let s=(i?os(e.width):e.width)/r,l=(i?os(e.height):e.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const Of=we(0);function Xl(n){const t=ee(n);return!Ui()||!t.visualViewport?Of:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Af(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==ee(n)?!1:t}function Tn(n,t,e,r){t===void 0&&(t=!1),e===void 0&&(e=!1);const o=n.getBoundingClientRect(),i=qi(n);let s=we(1);t&&(r?ue(r)&&(s=Bn(r)):s=Bn(n));const l=Af(i,e,r)?Xl(i):we(0);let u=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,h=o.width/s.x,f=o.height/s.y;if(i){const v=ee(i),m=r&&ue(r)?ee(r):r;let g=v,w=Ei(g);for(;w&&r&&m!==g;){const P=Bn(w),S=w.getBoundingClientRect(),A=de(w),I=S.left+(w.clientLeft+parseFloat(A.paddingLeft))*P.x,_=S.top+(w.clientTop+parseFloat(A.paddingTop))*P.y;u*=P.x,d*=P.y,h*=P.x,f*=P.y,u+=I,d+=_,g=ee(w),w=Ei(g)}}return is({width:h,height:f,x:u,y:d})}function Ws(n,t){const e=Ls(n).scrollLeft;return t?t.left+e:Tn(_e(n)).left+e}function jl(n,t){const e=n.getBoundingClientRect(),r=e.left+t.scrollLeft-Ws(n,e),o=e.top+t.scrollTop;return{x:r,y:o}}function Ef(n){let{elements:t,rect:e,offsetParent:r,strategy:o}=n;const i=o==="fixed",s=_e(r),l=t?Bs(t.floating):!1;if(r===s||l&&i)return e;let u={scrollLeft:0,scrollTop:0},d=we(1);const h=we(0),f=xe(r);if((f||!f&&!i)&&((rr(r)!=="body"||Bo(s))&&(u=Ls(r)),xe(r))){const m=Tn(r);d=Bn(r),h.x=m.x+r.clientLeft,h.y=m.y+r.clientTop}const v=s&&!f&&!i?jl(s,u):we(0);return{width:e.width*d.x,height:e.height*d.y,x:e.x*d.x-u.scrollLeft*d.x+h.x+v.x,y:e.y*d.y-u.scrollTop*d.y+h.y+v.y}}function Tf(n){return Array.from(n.getClientRects())}function Ff(n){const t=_e(n),e=Ls(n),r=n.ownerDocument.body,o=te(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=te(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-e.scrollLeft+Ws(n);const l=-e.scrollTop;return de(r).direction==="rtl"&&(s+=te(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}const Ba=25;function Mf(n,t){const e=ee(n),r=_e(n),o=e.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){i=o.width,s=o.height;const h=Ui();(!h||h&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}const d=Ws(r);if(d<=0){const h=r.ownerDocument,f=h.body,v=getComputedStyle(f),m=h.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,g=Math.abs(r.clientWidth-f.clientWidth-m);g<=Ba&&(i-=g)}else d<=Ba&&(i+=d);return{width:i,height:s,x:l,y:u}}const If=new Set(["absolute","fixed"]);function kf(n,t){const e=Tn(n,!0,t==="fixed"),r=e.top+n.clientTop,o=e.left+n.clientLeft,i=xe(n)?Bn(n):we(1),s=n.clientWidth*i.x,l=n.clientHeight*i.y,u=o*i.x,d=r*i.y;return{width:s,height:l,x:u,y:d}}function La(n,t,e){let r;if(t==="viewport")r=Mf(n,e);else if(t==="document")r=Ff(_e(n));else if(ue(t))r=kf(t,e);else{const o=Xl(n);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return is(r)}function Zl(n,t){const e=an(n);return e===t||!ue(e)||$n(e)?!1:de(e).position==="fixed"||Zl(e,t)}function Df(n,t){const e=t.get(n);if(e)return e;let r=xr(n,[],!1).filter(l=>ue(l)&&rr(l)!=="body"),o=null;const i=de(n).position==="fixed";let s=i?an(n):n;for(;ue(s)&&!$n(s);){const l=de(s),u=Hi(s);!u&&l.position==="fixed"&&(o=null),(i?!u&&!o:!u&&l.position==="static"&&!!o&&If.has(o.position)||Bo(s)&&!u&&Zl(n,s))?r=r.filter(h=>h!==s):o=l,s=an(s)}return t.set(n,r),r}function Nf(n){let{element:t,boundary:e,rootBoundary:r,strategy:o}=n;const s=[...e==="clippingAncestors"?Bs(t)?[]:Df(t,this._c):[].concat(e),r],l=s[0],u=s.reduce((d,h)=>{const f=La(t,h,o);return d.top=te(f.top,d.top),d.right=sn(f.right,d.right),d.bottom=sn(f.bottom,d.bottom),d.left=te(f.left,d.left),d},La(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Rf(n){const{width:t,height:e}=Gl(n);return{width:t,height:e}}function Bf(n,t,e){const r=xe(t),o=_e(t),i=e==="fixed",s=Tn(n,!0,i,t);let l={scrollLeft:0,scrollTop:0};const u=we(0);function d(){u.x=Ws(o)}if(r||!r&&!i)if((rr(t)!=="body"||Bo(o))&&(l=Ls(t)),r){const m=Tn(t,!0,i,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else o&&d();i&&!r&&o&&d();const h=o&&!r&&!i?jl(o,l):we(0),f=s.left+l.scrollLeft-u.x-h.x,v=s.top+l.scrollTop-u.y-h.y;return{x:f,y:v,width:s.width,height:s.height}}function js(n){return de(n).position==="static"}function Wa(n,t){if(!xe(n)||de(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return _e(n)===e&&(e=e.ownerDocument.body),e}function Jl(n,t){const e=ee(n);if(Bs(n))return e;if(!xe(n)){let o=an(n);for(;o&&!$n(o);){if(ue(o)&&!js(o))return o;o=an(o)}return e}let r=Wa(n,t);for(;r&&bf(r)&&js(r);)r=Wa(r,t);return r&&$n(r)&&js(r)&&!Hi(r)?e:r||Sf(n)||e}const Lf=async function(n){const t=this.getOffsetParent||Jl,e=this.getDimensions,r=await e(n.floating);return{reference:Bf(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wf(n){return de(n).direction==="rtl"}const zf={convertOffsetParentRelativeRectToViewportRelativeRect:Ef,getDocumentElement:_e,getClippingRect:Nf,getOffsetParent:Jl,getElementRects:Lf,getClientRects:Tf,getDimensions:Rf,getScale:Bn,isElement:ue,isRTL:Wf};function Ql(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Kf(n,t){let e=null,r;const o=_e(n);function i(){var l;clearTimeout(r),(l=e)==null||l.disconnect(),e=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),i();const d=n.getBoundingClientRect(),{left:h,top:f,width:v,height:m}=d;if(l||t(),!v||!m)return;const g=Ho(f),w=Ho(o.clientWidth-(h+v)),P=Ho(o.clientHeight-(f+m)),S=Ho(h),I={rootMargin:-g+"px "+-w+"px "+-P+"px "+-S+"px",threshold:te(0,sn(1,u))||1};let _=!0;function F(L){const D=L[0].intersectionRatio;if(D!==u){if(!_)return s();D?s(!1,D):r=setTimeout(()=>{s(!1,1e-7)},1e3)}D===1&&!Ql(d,n.getBoundingClientRect())&&s(),_=!1}try{e=new IntersectionObserver(F,{...I,root:o.ownerDocument})}catch{e=new IntersectionObserver(F,I)}e.observe(n)}return s(!0),i}function Vf(n,t,e,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=qi(n),h=o||i?[...d?xr(d):[],...xr(t)]:[];h.forEach(S=>{o&&S.addEventListener("scroll",e,{passive:!0}),i&&S.addEventListener("resize",e)});const f=d&&l?Kf(d,e):null;let v=-1,m=null;s&&(m=new ResizeObserver(S=>{let[A]=S;A&&A.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var I;(I=m)==null||I.observe(t)})),e()}),d&&!u&&m.observe(d),m.observe(t));let g,w=u?Tn(n):null;u&&P();function P(){const S=Tn(n);w&&!Ql(w,S)&&e(),w=S,g=requestAnimationFrame(P)}return e(),()=>{var S;h.forEach(A=>{o&&A.removeEventListener("scroll",e),i&&A.removeEventListener("resize",e)}),f==null||f(),(S=m)==null||S.disconnect(),m=null,u&&cancelAnimationFrame(g)}}const Hf=hf,Uf=gf,qf=uf,Yf=pf,Gf=df,Xf=cf,jf=vf,Zf=(n,t,e)=>{const r=new Map,o={platform:zf,...e},i={...o.platform,_c:r};return lf(n,t,{...o,platform:i})};function pn(n){return typeof n=="function"?n():n}function $l(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function za(n,t){const e=$l(n);return Math.round(t*e)/e}function Ka(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 Jf(n){const t=n.whileElementsMounted,e=O(()=>pn(n.open)??!0),r=O(()=>pn(n.middleware)),o=O(()=>pn(n.transform)??!0),i=O(()=>pn(n.placement)??"bottom"),s=O(()=>pn(n.strategy)??"absolute"),l=O(()=>pn(n.sideOffset)??0),u=O(()=>pn(n.alignOffset)??0),d=n.reference;let h=j(0),f=j(0);const v=Be(null);let m=j(yr(c(s))),g=j(yr(c(i))),w=j(yr({})),P=j(!1);const S=O(()=>{const D=v.current?za(v.current,c(h)):c(h),U=v.current?za(v.current,c(f)):c(f);return c(o)?{position:c(m),left:"0",top:"0",transform:`translate(${D}px, ${U}px)`,...v.current&&$l(v.current)>=1.5&&{willChange:"transform"}}:{position:c(m),left:`${D}px`,top:`${U}px`}});let A;function I(){d.current===null||v.current===null||Zf(d.current,v.current,{middleware:c(r),placement:c(i),strategy:c(s)}).then(D=>{if(!c(e)&&c(h)!==0&&c(f)!==0){const U=Math.max(Math.abs(c(l)),Math.abs(c(u)),15);if(D.x<=U&&D.y<=U)return}x(h,D.x,!0),x(f,D.y,!0),x(m,D.strategy,!0),x(g,D.placement,!0),x(w,D.middlewareData,!0),x(P,!0)})}function _(){typeof A=="function"&&(A(),A=void 0)}function F(){if(_(),t===void 0){I();return}d.current===null||v.current===null||(A=t(d.current,v.current,I))}function L(){c(e)||x(P,!1)}return Wt(I),Wt(F),Wt(L),Wt(()=>_),{floating:v,reference:d,get strategy(){return c(m)},get placement(){return c(g)},get middlewareData(){return c(w)},get isPositioned(){return c(P)},get floatingStyles(){return c(S)},get update(){return I}}}const Qf={top:"bottom",right:"left",bottom:"top",left:"right"},Yi=new fn("Floating.Root"),Va=new fn("Floating.Content"),Gi=new fn("Floating.Root");class as{constructor(){E(this,"anchorNode",Be(null));E(this,"customAnchorNode",Be(null));E(this,"triggerNode",Be(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?Gi.set(new as):Yi.set(new as)}}var vo,Fs,po,Ms,mo,Is,yo,bo,wo,xo,_o,Po,So,Co,Oo,Ao,Eo,To,Fo,Mo,Io,ko,Do,No;const ks=class ks{constructor(t,e){E(this,"opts");E(this,"root");E(this,"contentRef",Be(null));E(this,"wrapperRef",Be(null));E(this,"arrowRef",Be(null));E(this,"contentAttachment",ce(this.contentRef));E(this,"wrapperAttachment",ce(this.wrapperRef));E(this,"arrowAttachment",ce(this.arrowRef));E(this,"arrowId",Be(Wi()));y(this,vo,O(()=>{if(typeof this.opts.style=="string")return Jc(this.opts.style);if(!this.opts.style)return{}}));y(this,Fs);y(this,po,new wu(()=>this.arrowRef.current??void 0));y(this,Ms,O(()=>{var t;return((t=a(this,po))==null?void 0:t.width)??0}));y(this,mo,O(()=>{var t;return((t=a(this,po))==null?void 0:t.height)??0}));y(this,Is,O(()=>{var t;return((t=this.opts.side)==null?void 0:t.current)+(this.opts.align.current!=="center"?`-${this.opts.align.current}`:"")}));y(this,yo,O(()=>Array.isArray(this.opts.collisionBoundary.current)?this.opts.collisionBoundary.current:[this.opts.collisionBoundary.current]));y(this,bo,O(()=>c(a(this,yo)).length>0));y(this,wo,O(()=>({padding:this.opts.collisionPadding.current,boundary:c(a(this,yo)).filter(Lu),altBoundary:this.hasExplicitBoundaries})));y(this,xo,j(void 0));y(this,_o,j(void 0));y(this,Po,j(void 0));y(this,So,j(void 0));y(this,Co,O(()=>[Hf({mainAxis:this.opts.sideOffset.current+c(a(this,mo)),alignmentAxis:this.opts.alignOffset.current}),this.opts.avoidCollisions.current&&Uf({mainAxis:!0,crossAxis:!1,limiter:this.opts.sticky.current==="partial"?jf():void 0,...this.detectOverflowOptions}),this.opts.avoidCollisions.current&&qf({...this.detectOverflowOptions}),Yf({...this.detectOverflowOptions,apply:({rects:t,availableWidth:e,availableHeight:r})=>{const{width:o,height:i}=t.reference;x(a(this,xo),e,!0),x(a(this,_o),r,!0),x(a(this,Po),o,!0),x(a(this,So),i,!0)}}),this.arrowRef.current&&Xf({element:this.arrowRef.current,padding:this.opts.arrowPadding.current}),$f({arrowWidth:c(a(this,Ms)),arrowHeight:c(a(this,mo))}),this.opts.hideWhenDetached.current&&Gf({strategy:"referenceHidden",...this.detectOverflowOptions})].filter(Boolean)));E(this,"floating");y(this,Oo,O(()=>th(this.floating.placement)));y(this,Ao,O(()=>eh(this.floating.placement)));y(this,Eo,O(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.x)??0}));y(this,To,O(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.y)??0}));y(this,Fo,O(()=>{var t;return((t=this.floating.middlewareData.arrow)==null?void 0:t.centerOffset)!==0}));y(this,Mo,j());y(this,Io,O(()=>Qf[this.placedSide]));y(this,ko,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":`${c(a(this,xo))}px`,"--bits-floating-available-height":`${c(a(this,_o))}px`,"--bits-floating-anchor-width":`${c(a(this,Po))}px`,"--bits-floating-anchor-height":`${c(a(this,So))}px`,...((r=this.floating.middlewareData.hide)==null?void 0:r.referenceHidden)&&{visibility:"hidden","pointer-events":"none"},...c(a(this,vo))},dir:this.opts.dir.current,...this.wrapperAttachment}}));y(this,Do,O(()=>({"data-side":this.placedSide,"data-align":this.placedAlign,style:Qc({...c(a(this,vo))}),...this.contentAttachment})));y(this,No,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),Kt(()=>t.customAnchor.current,r=>{this.root.customAnchorNode.current=r}),this.floating=Jf({strategy:()=>this.opts.strategy.current,placement:()=>c(a(this,Is)),middleware:()=>this.middleware,reference:this.root.anchorNode,whileElementsMounted:(...r)=>{var i;return Vf(...r,{animationFrame:((i=a(this,Fs))==null?void 0:i.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())}),Kt(()=>this.contentRef.current,r=>{if(!r)return;const o=Ii(r);this.contentZIndex=o.getComputedStyle(r).zIndex}),Wt(()=>{this.floating.floating.current=this.wrapperRef.current})}static create(t,e=!1){return e?Va.set(new ks(t,Gi.get())):Va.set(new ks(t,Yi.get()))}get hasExplicitBoundaries(){return c(a(this,bo))}set hasExplicitBoundaries(t){x(a(this,bo),t)}get detectOverflowOptions(){return c(a(this,wo))}set detectOverflowOptions(t){x(a(this,wo),t)}get middleware(){return c(a(this,Co))}set middleware(t){x(a(this,Co),t)}get placedSide(){return c(a(this,Oo))}set placedSide(t){x(a(this,Oo),t)}get placedAlign(){return c(a(this,Ao))}set placedAlign(t){x(a(this,Ao),t)}get arrowX(){return c(a(this,Eo))}set arrowX(t){x(a(this,Eo),t)}get arrowY(){return c(a(this,To))}set arrowY(t){x(a(this,To),t)}get cannotCenterArrow(){return c(a(this,Fo))}set cannotCenterArrow(t){x(a(this,Fo),t)}get contentZIndex(){return c(a(this,Mo))}set contentZIndex(t){x(a(this,Mo),t,!0)}get arrowBaseSide(){return c(a(this,Io))}set arrowBaseSide(t){x(a(this,Io),t)}get wrapperProps(){return c(a(this,ko))}set wrapperProps(t){x(a(this,ko),t)}get props(){return c(a(this,Do))}set props(t){x(a(this,Do),t)}get arrowStyle(){return c(a(this,No))}set arrowStyle(t){x(a(this,No),t)}};vo=new WeakMap,Fs=new WeakMap,po=new WeakMap,Ms=new WeakMap,mo=new WeakMap,Is=new WeakMap,yo=new WeakMap,bo=new WeakMap,wo=new WeakMap,xo=new WeakMap,_o=new WeakMap,Po=new WeakMap,So=new WeakMap,Co=new WeakMap,Oo=new WeakMap,Ao=new WeakMap,Eo=new WeakMap,To=new WeakMap,Fo=new WeakMap,Mo=new WeakMap,Io=new WeakMap,ko=new WeakMap,Do=new WeakMap,No=new WeakMap;let Ti=ks;class ls{constructor(t,e){E(this,"opts");E(this,"root");this.opts=t,this.root=e,t.virtualEl&&t.virtualEl.current?e.triggerNode=Za(t.virtualEl.current):e.triggerNode=t.ref}static create(t,e=!1){return e?new ls(t,Gi.get()):new ls(t,Yi.get())}}function $f(n){return{name:"transformOrigin",options:n,fn(t){var P,S,A;const{placement:e,rects:r,middlewareData:o}=t,s=((P=o.arrow)==null?void 0:P.centerOffset)!==0,l=s?0:n.arrowWidth,u=s?0:n.arrowHeight,[d,h]=Xi(e),f={start:"0%",center:"50%",end:"100%"}[h],v=(((S=o.arrow)==null?void 0:S.x)??0)+l/2,m=(((A=o.arrow)==null?void 0:A.y)??0)+u/2;let g="",w="";return d==="bottom"?(g=s?f:`${v}px`,w=`${-u}px`):d==="top"?(g=s?f:`${v}px`,w=`${r.floating.height+u}px`):d==="right"?(g=`${-u}px`,w=s?f:`${m}px`):d==="left"&&(g=`${r.floating.width+u}px`,w=s?f:`${m}px`),{data:{x:g,y:w}}}}}function Xi(n){const[t,e="center"]=n.split("-");return[t,e]}function th(n){return Xi(n)[0]}function eh(n){return Xi(n)[1]}function nh(n,t){G(t,!0);let e=b(t,"tooltip",3,!1);as.create(e());var r=N(),o=T(r);Y(o,()=>t.children??et),p(n,r),X()}function rh(n,t){G(t,!0);let e=b(t,"tooltip",3,!1);ls.create({id:M(()=>t.id),virtualEl:M(()=>t.virtualEl),ref:t.ref},e());var r=N(),o=T(r);Y(o,()=>t.children??et),p(n,r),X()}function oh(n,t){G(t,!0);let e=b(t,"side",3,"bottom"),r=b(t,"sideOffset",3,0),o=b(t,"align",3,"center"),i=b(t,"alignOffset",3,0),s=b(t,"arrowPadding",3,0),l=b(t,"avoidCollisions",3,!0),u=b(t,"collisionBoundary",19,()=>[]),d=b(t,"collisionPadding",3,0),h=b(t,"hideWhenDetached",3,!1),f=b(t,"onPlaced",3,()=>{}),v=b(t,"sticky",3,"partial"),m=b(t,"updatePositionStrategy",3,"optimized"),g=b(t,"strategy",3,"fixed"),w=b(t,"dir",3,"ltr"),P=b(t,"style",19,()=>({})),S=b(t,"wrapperId",19,Wi),A=b(t,"customAnchor",3,null),I=b(t,"tooltip",3,!1);const _=Ti.create({side:M(()=>e()),sideOffset:M(()=>r()),align:M(()=>o()),alignOffset:M(()=>i()),id:M(()=>t.id),arrowPadding:M(()=>s()),avoidCollisions:M(()=>l()),collisionBoundary:M(()=>u()),collisionPadding:M(()=>d()),hideWhenDetached:M(()=>h()),onPlaced:M(()=>f()),sticky:M(()=>v()),updatePositionStrategy:M(()=>m()),strategy:M(()=>g()),dir:M(()=>w()),style:M(()=>P()),enabled:M(()=>t.enabled),wrapperId:M(()=>S()),customAnchor:M(()=>A())},I()),F=O(()=>zt(_.wrapperProps,{style:{pointerEvents:"auto"}}));var L=N(),D=T(L);Y(D,()=>t.content??et,()=>({props:_.props,wrapperProps:c(F)})),p(n,L),X()}function sh(n,t){G(t,!0),Wc(()=>{var o;(o=t.onPlaced)==null||o.call(t)});var e=N(),r=T(e);Y(r,()=>t.content??et,()=>({props:{},wrapperProps:{}})),p(n,e),X()}function ih(n,t){let e=b(t,"isStatic",3,!1),r=nt(t,["$$slots","$$events","$$legacy","content","isStatic","onPlaced"]);var o=N(),i=T(o);{var s=u=>{sh(u,{get content(){return t.content},get onPlaced(){return t.onPlaced}})},l=u=>{oh(u,xt({get content(){return t.content},get onPlaced(){return t.onPlaced}},()=>r))};yt(i,u=>{e()?u(s):u(l,!1)})}p(n,o)}var ah=H("<!> <!>",1);function tc(n,t){G(t,!0);let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=b(t,"tooltip",3,!1),u=b(t,"contentPointerEvents",3,"auto"),d=nt(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"]);ih(n,{get isStatic(){return s()},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 i()},get enabled(){return t.enabled},get tooltip(){return l()},content:(f,v)=>{let m=()=>v==null?void 0:v().props,g=()=>v==null?void 0:v().wrapperProps;var w=ah(),P=T(w);{var S=_=>{rs(_,{get preventScroll(){return t.preventScroll}})},A=_=>{rs(_,{get preventScroll(){return t.preventScroll}})};yt(P,_=>{t.forceMount&&t.enabled?_(S):t.forceMount||_(A,1)})}var I=k(P,2);Ll(I,{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:(F,L)=>{let D=()=>L==null?void 0:L().props;kl(F,{get onEscapeKeydown(){return t.onEscapeKeydown},get escapeKeydownBehavior(){return t.escapeKeydownBehavior},get enabled(){return t.enabled},get ref(){return t.ref},children:(U,rt)=>{Il(U,{get id(){return t.id},get onInteractOutside(){return t.onInteractOutside},get onFocusOutside(){return t.onFocusOutside},get interactOutsideBehavior(){return e()},get isValidEvent(){return o()},get enabled(){return t.enabled},get ref(){return t.ref},children:(_t,gt)=>{let At=()=>gt==null?void 0:gt().props;zl(_t,{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:(mt,it)=>{var J=N(),at=T(J);{let $=O(()=>({props:zt(d,m(),At(),D(),{style:{pointerEvents:u()}}),wrapperProps:g()}));Y(at,()=>t.popper??et,()=>c($))}p(mt,J)},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{default:!0}})},$$slots:{focusScope:!0}}),p(f,w)},$$slots:{content:!0}}),X()}function lh(n,t){let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=nt(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 u=N(),d=T(u);{var h=f=>{tc(f,xt({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 i()},get isStatic(){return s()},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 o()},get onFocusOutside(){return t.onFocusOutside},forceMount:!1,get ref(){return t.ref}},()=>l))};yt(d,f=>{t.shouldRender&&f(h)})}p(n,u)}function ch(n,t){let e=b(t,"interactOutsideBehavior",3,"close"),r=b(t,"trapFocus",3,!0),o=b(t,"isValidEvent",3,()=>!1),i=b(t,"customAnchor",3,null),s=b(t,"isStatic",3,!1),l=nt(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"]);tc(n,xt({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 i()},get isStatic(){return s()},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 o()},get onFocusOutside(){return t.onFocusOutside}},()=>l,{forceMount:!0}))}var uh=H("<div><!></div>");function dh(n,t){const e=cn();G(t,!0);let r=b(t,"ref",15,null),o=b(t,"id",19,()=>un(e)),i=b(t,"disabled",3,!1),s=b(t,"onSelect",3,Pt),l=b(t,"closeOnSelect",3,!0),u=nt(t,["$$slots","$$events","$$legacy","child","children","ref","id","disabled","onSelect","closeOnSelect"]);const d=mi.create({id:M(()=>o()),disabled:M(()=>i()),onSelect:M(()=>s()),ref:M(()=>r(),w=>r(w)),closeOnSelect:M(()=>l())}),h=O(()=>zt(u,d.props));var f=N(),v=T(f);{var m=w=>{var P=N(),S=T(P);Y(S,()=>t.child,()=>({props:c(h)})),p(w,P)},g=w=>{var P=uh();Tt(P,()=>({...c(h)}));var S=z(P);Y(S,()=>t.children??et),K(P),p(w,P)};yt(v,w=>{t.child?w(m):w(g,!1)})}p(n,f),X()}function fh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=b(t,"onOpenChange",3,Pt),o=b(t,"onOpenChangeComplete",3,Pt);oi.create({variant:M(()=>"dialog"),open:M(()=>e(),l=>{e(l),r()(l)}),onOpenChangeComplete:M(()=>o())});var i=N(),s=T(i);Y(s,()=>t.children??et),p(n,i),X()}var hh=H("<button><!></button>");function gh(n,t){const e=cn();G(t,!0);let r=b(t,"id",19,()=>un(e)),o=b(t,"ref",15,null),i=b(t,"disabled",3,!1),s=nt(t,["$$slots","$$events","$$legacy","children","child","id","ref","disabled"]);const l=si.create({variant:M(()=>"close"),id:M(()=>r()),ref:M(()=>o(),m=>o(m)),disabled:M(()=>!!i())}),u=O(()=>zt(s,l.props));var d=N(),h=T(d);{var f=m=>{var g=N(),w=T(g);Y(w,()=>t.child,()=>({props:c(u)})),p(m,g)},v=m=>{var g=hh();Tt(g,()=>({...c(u)}));var w=z(g);Y(w,()=>t.children??et),K(g),p(m,g)};yt(h,m=>{t.child?m(f):m(v,!1)})}p(n,d),X()}var vh=H("<!> <!>",1),ph=H("<!> <div><!></div>",1);function mh(n,t){const e=cn();G(t,!0);let r=b(t,"id",19,()=>un(e)),o=b(t,"ref",15,null),i=b(t,"forceMount",3,!1),s=b(t,"onCloseAutoFocus",3,Pt),l=b(t,"onOpenAutoFocus",3,Pt),u=b(t,"onEscapeKeydown",3,Pt),d=b(t,"onInteractOutside",3,Pt),h=b(t,"trapFocus",3,!0),f=b(t,"preventScroll",3,!0),v=b(t,"restoreScrollDelay",3,null),m=nt(t,["$$slots","$$events","$$legacy","id","children","child","ref","forceMount","onCloseAutoFocus","onOpenAutoFocus","onEscapeKeydown","onInteractOutside","trapFocus","preventScroll","restoreScrollDelay"]);const g=li.create({id:M(()=>r()),ref:M(()=>o(),I=>o(I))}),w=O(()=>zt(m,g.props));var P=N(),S=T(P);{var A=I=>{Ll(I,{get ref(){return g.opts.ref},loop:!0,get trapFocus(){return h()},get enabled(){return g.root.opts.open.current},get onOpenAutoFocus(){return l()},get onCloseAutoFocus(){return s()},focusScope:(F,L)=>{let D=()=>L==null?void 0:L().props;kl(F,xt(()=>c(w),{get enabled(){return g.root.opts.open.current},get ref(){return g.opts.ref},onEscapeKeydown:U=>{u()(U),!U.defaultPrevented&&g.root.handleClose()},children:(U,rt)=>{Il(U,xt(()=>c(w),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},onInteractOutside:ot=>{d()(ot),!ot.defaultPrevented&&g.root.handleClose()},children:(ot,_t)=>{zl(ot,xt(()=>c(w),{get ref(){return g.opts.ref},get enabled(){return g.root.opts.open.current},children:(gt,At)=>{var mt=N(),it=T(mt);{var J=$=>{var St=vh(),kt=T(St);{var oe=Vt=>{rs(Vt,{get preventScroll(){return f()},get restoreScrollDelay(){return v()}})};yt(kt,Vt=>{g.root.opts.open.current&&Vt(oe)})}var Yt=k(kt,2);{let Vt=O(()=>({props:zt(c(w),D()),...g.snippetProps}));Y(Yt,()=>t.child,()=>c(Vt))}p($,St)},at=$=>{var St=ph(),kt=T(St);rs(kt,{get preventScroll(){return f()}});var oe=k(kt,2);Tt(oe,Vt=>({...Vt}),[()=>zt(c(w),D())]);var Yt=z(oe);Y(Yt,()=>t.children??et),K(oe),p($,St)};yt(it,$=>{t.child?$(J):$(at,!1)})}p(gt,mt)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};yt(S,I=>{(g.shouldRender||i())&&I(A)})}p(n,P),X()}function yh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=b(t,"dir",3,"ltr"),o=b(t,"onOpenChange",3,Pt),i=b(t,"onOpenChangeComplete",3,Pt),s=b(t,"_internal_variant",3,"dropdown-menu");const l=gi.create({variant:M(()=>s()),dir:M(()=>r()),onClose:()=>{e(!1),o()(!1)}});vi.create({open:M(()=>e(),u=>{e(u),o()(u)}),onOpenChangeComplete:M(()=>i())},l),nh(n,{children:(u,d)=>{var h=N(),f=T(h);Y(f,()=>t.children??et),p(u,h)},$$slots:{default:!0}}),X()}var bh=H("<div><div><!></div></div>"),wh=H("<div><div><!></div></div>");function xh(n,t){const e=cn();G(t,!0);let r=b(t,"id",19,()=>un(e)),o=b(t,"ref",15,null),i=b(t,"loop",3,!0),s=b(t,"onInteractOutside",3,Pt),l=b(t,"onEscapeKeydown",3,Pt),u=b(t,"onCloseAutoFocus",3,Pt),d=b(t,"forceMount",3,!1),h=b(t,"trapFocus",3,!1),f=nt(t,["$$slots","$$events","$$legacy","id","child","children","ref","loop","onInteractOutside","onEscapeKeydown","onCloseAutoFocus","forceMount","trapFocus","style"]);const v=pi.create({id:M(()=>r()),loop:M(()=>i()),ref:M(()=>o(),_=>o(_)),onCloseAutoFocus:M(()=>u())}),m=O(()=>zt(f,v.props));function g(_){if(v.handleInteractOutside(_),!_.defaultPrevented&&(s()(_),!_.defaultPrevented)){if(_.target&&_.target instanceof Element){const F=`[${v.parentMenu.root.getBitsAttr("sub-content")}]`;if(_.target.closest(F))return}v.parentMenu.onClose()}}function w(_){l()(_),!_.defaultPrevented&&v.parentMenu.onClose()}var P=N(),S=T(P);{var A=_=>{ch(_,xt(()=>c(m),()=>v.popperProps,{get ref(){return v.opts.ref},get enabled(){return v.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:w,get trapFocus(){return h()},get loop(){return i()},forceMount:!0,get id(){return r()},get shouldRender(){return v.shouldRender},popper:(L,D)=>{let U=()=>D==null?void 0:D().props,rt=()=>D==null?void 0:D().wrapperProps;const ot=O(()=>zt(U(),{style:Ka("dropdown-menu")},{style:t.style}));var _t=N(),gt=T(_t);{var At=it=>{var J=N(),at=T(J);{let $=O(()=>({props:c(ot),wrapperProps:rt(),...v.snippetProps}));Y(at,()=>t.child,()=>c($))}p(it,J)},mt=it=>{var J=bh();Tt(J,()=>({...rt()}));var at=z(J);Tt(at,()=>({...c(ot)}));var $=z(at);Y($,()=>t.children??et),K(at),K(J),p(it,J)};yt(gt,it=>{t.child?it(At):it(mt,!1)})}p(L,_t)},$$slots:{popper:!0}}))},I=_=>{lh(_,xt(()=>c(m),()=>v.popperProps,{get ref(){return v.opts.ref},get open(){return v.parentMenu.opts.open.current},onInteractOutside:g,onEscapeKeydown:w,get trapFocus(){return h()},get loop(){return i()},forceMount:!1,get id(){return r()},get shouldRender(){return v.shouldRender},popper:(L,D)=>{let U=()=>D==null?void 0:D().props,rt=()=>D==null?void 0:D().wrapperProps;const ot=O(()=>zt(U(),{style:Ka("dropdown-menu")},{style:t.style}));var _t=N(),gt=T(_t);{var At=it=>{var J=N(),at=T(J);{let $=O(()=>({props:c(ot),wrapperProps:rt(),...v.snippetProps}));Y(at,()=>t.child,()=>c($))}p(it,J)},mt=it=>{var J=wh();Tt(J,()=>({...rt()}));var at=z(J);Tt(at,()=>({...c(ot)}));var $=z(at);Y($,()=>t.children??et),K(at),K(J),p(it,J)};yt(gt,it=>{t.child?it(At):it(mt,!1)})}p(L,_t)},$$slots:{popper:!0}}))};yt(S,_=>{d()?_(A):d()||_(I,1)})}p(n,P),X()}var _h=H("<button><!></button>");function Ph(n,t){const e=cn();G(t,!0);let r=b(t,"id",19,()=>un(e)),o=b(t,"ref",15,null),i=b(t,"disabled",3,!1),s=b(t,"type",3,"button"),l=nt(t,["$$slots","$$events","$$legacy","id","ref","child","children","disabled","type"]);const u=yi.create({id:M(()=>r()),disabled:M(()=>i()??!1),ref:M(()=>o(),h=>o(h))}),d=O(()=>zt(l,u.props,{type:s()}));rh(n,{get id(){return r()},get ref(){return u.opts.ref},children:(h,f)=>{var v=N(),m=T(v);{var g=P=>{var S=N(),A=T(S);Y(A,()=>t.child,()=>({props:c(d)})),p(P,S)},w=P=>{var S=_h();Tt(S,()=>({...c(d)}));var A=z(S);Y(A,()=>t.children??et),K(S),p(P,S)};yt(m,P=>{t.child?P(g):P(w,!1)})}p(h,v)},$$slots:{default:!0}}),X()}function Sh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=nt(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=T(o);W(i,()=>fh,(s,l)=>{l(s,xt(()=>r,{get open(){return e()},set open(u){e(u)}}))}),p(n,o),X()}function Ch(n,t){let e=nt(t,["$$slots","$$events","$$legacy"]);var r=N(),o=T(r);W(o,()=>dl,(i,s)=>{s(i,xt(()=>e))}),p(n,r)}function Oh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=T(o);{let s=O(()=>ne("text-lg leading-none font-semibold",t.class));W(i,()=>Uu,(l,u)=>{u(l,xt({"data-slot":"dialog-title",get class(){return c(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}var Ah=H("<div><!></div>");function Eh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class","children"]);var o=Ah();Tt(o,s=>({"data-slot":"dialog-header",class:s,...r}),[()=>ne("flex flex-col gap-2 text-center sm:text-start",t.class)]);var i=z(o);Y(i,()=>t.children??et),K(o),dn(o,s=>e(s),()=>e()),p(n,o),X()}function Th(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=T(o);{let s=O(()=>ne("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));W(i,()=>Yd,(l,u)=>{u(l,xt({"data-slot":"dialog-overlay",get class(){return c(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}/**
|
||
* @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 Fh={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 Mh=kc("<svg><!><!></svg>");function or(n,t){G(t,!0);const e=b(t,"color",3,"currentColor"),r=b(t,"size",3,24),o=b(t,"strokeWidth",3,2),i=b(t,"absoluteStrokeWidth",3,!1),s=b(t,"iconNode",19,()=>[]),l=nt(t,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var u=Mh();Tt(u,f=>({...Fh,...l,width:r(),height:r(),stroke:e(),"stroke-width":f,class:["lucide-icon lucide",t.name&&`lucide-${t.name}`,t.class]}),[()=>i()?Number(o())*24/Number(r()):o()]);var d=z(u);rn(d,17,s,mn,(f,v)=>{var m=O(()=>Dc(c(v),2));let g=()=>c(m)[0],w=()=>c(m)[1];var P=N(),S=T(P);Vc(S,g,!0,(A,I)=>{Tt(A,()=>({...w()}))}),p(f,P)});var h=k(d);Y(h,()=>t.children??et),K(u),p(n,u),X()}function ec(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=nt(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];or(n,xt({name:"x"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=T(s);Y(l,()=>t.children??et),p(o,s)},$$slots:{default:!0}})),X()}var Ih=H('<!> <span class="sr-only">Close</span>',1),kh=H("<!> <!>",1),Dh=H("<!> <!>",1);function Nh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"showCloseButton",3,!0),o=nt(t,["$$slots","$$events","$$legacy","ref","class","portalProps","children","showCloseButton"]);Ch(n,xt(()=>t.portalProps,{children:(i,s)=>{var l=Dh(),u=T(l);W(u,()=>Th,(h,f)=>{f(h,{})});var d=k(u,2);{let h=O(()=>ne("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));W(d,()=>mh,(f,v)=>{v(f,xt({"data-slot":"dialog-content",get class(){return c(h)}},()=>o,{get ref(){return e()},set ref(m){e(m)},children:(m,g)=>{var w=kh(),P=T(w);Y(P,()=>t.children??et);var S=k(P,2);{var A=I=>{var _=N(),F=T(_);W(F,()=>gh,(L,D)=>{D(L,{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:(U,rt)=>{var ot=Ih(),_t=T(ot);ec(_t,{}),q(2),p(U,ot)},$$slots:{default:!0}})}),p(I,_)};yt(S,I=>{r()&&I(A)})}p(m,w)},$$slots:{default:!0}}))})}p(i,l)},$$slots:{default:!0}})),X()}function Rh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref","class"]);var o=N(),i=T(o);{let s=O(()=>ne("text-muted-foreground text-sm",t.class));W(i,()=>Xd,(l,u)=>{u(l,xt({"data-slot":"dialog-description",get class(){return c(s)}},()=>r,{get ref(){return e()},set ref(d){e(d)}}))})}p(n,o),X()}function Bh(n,t){G(t,!0);let e=b(t,"open",15,!1),r=nt(t,["$$slots","$$events","$$legacy","open"]);var o=N(),i=T(o);W(i,()=>yh,(s,l)=>{l(s,xt(()=>r,{get open(){return e()},set open(u){e(u)}}))}),p(n,o),X()}function nc(n,t){let e=nt(t,["$$slots","$$events","$$legacy"]);var r=N(),o=T(r);W(o,()=>dl,(i,s)=>{s(i,xt(()=>e))}),p(n,r)}function Lh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"sideOffset",3,4),o=nt(t,["$$slots","$$events","$$legacy","ref","sideOffset","portalProps","class"]);nc(n,xt(()=>t.portalProps,{children:(i,s)=>{var l=N(),u=T(l);{let d=O(()=>ne("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));W(u,()=>xh,(h,f)=>{f(h,xt({"data-slot":"dropdown-menu-content",get sideOffset(){return r()},get class(){return c(d)}},()=>o,{get ref(){return e()},set ref(v){e(v)}}))})}p(i,l)},$$slots:{default:!0}})),X()}function Ha(n,t){G(t,!0);let e=b(t,"ref",15,null),r=b(t,"variant",3,"default"),o=nt(t,["$$slots","$$events","$$legacy","ref","class","inset","variant"]);var i=N(),s=T(i);{let l=O(()=>ne("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));W(s,()=>dh,(u,d)=>{d(u,xt({"data-slot":"dropdown-menu-item",get"data-inset"(){return t.inset},get"data-variant"(){return r()},get class(){return c(l)}},()=>o,{get ref(){return e()},set ref(h){e(h)}}))})}p(n,i),X()}function Wh(n,t){G(t,!0);let e=b(t,"ref",15,null),r=nt(t,["$$slots","$$events","$$legacy","ref"]);var o=N(),i=T(o);W(i,()=>Ph,(s,l)=>{l(s,xt({"data-slot":"dropdown-menu-trigger"},()=>r,{get ref(){return e()},set ref(u){e(u)}}))}),p(n,o),X()}function zh(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=nt(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"}]];or(n,xt({name:"camera"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=T(s);Y(l,()=>t.children??et),p(o,s)},$$slots:{default:!0}})),X()}function Kh(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=nt(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"}]];or(n,xt({name:"ellipsis"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=T(s);Y(l,()=>t.children??et),p(o,s)},$$slots:{default:!0}})),X()}function Vh(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=nt(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"}]];or(n,xt({name:"pencil"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=T(s);Y(l,()=>t.children??et),p(o,s)},$$slots:{default:!0}})),X()}function Hh(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=nt(t,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];or(n,xt({name:"plus"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=T(s);Y(l,()=>t.children??et),p(o,s)},$$slots:{default:!0}})),X()}function Uh(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=nt(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"}]];or(n,xt({name:"trash-2"},()=>e,{get iconNode(){return r},children:(o,i)=>{var s=N(),l=T(s);Y(l,()=>t.children??et),p(o,s)},$$slots:{default:!0}})),X()}const qh=["EA","BX","CA","PK","PLT","LF"],Yh=["Framing","Insulation","Drywall","T-Bar","Painting","Masking","Misc"],Gh=["ACT","Channel","Fasteners","Finishing Materials","Adhesives","Mud","Corner Bead","Sanding","Tape","Metal Studs","Metal Tracks","FRP","Gyp","Insulation","Paint","Weatherproofing","Misc"];var Xh=H('<input type="hidden" name="id"/>'),jh=H('<p class="text-destructive text-sm"> </p>'),Zh=H('<video class="border-input w-full rounded-lg border" playsinline=""></video>',2),Jh=H("<!> Cancel",1),Qh=H('<div class="bg-background/95 fixed inset-0 z-50 flex flex-col items-center justify-center gap-4 p-4 backdrop-blur-sm" role="dialog" aria-label="Scan barcode"><div class="flex w-full max-w-sm flex-col gap-2"><!> <div class="flex gap-2"><!></div></div></div>'),$h=H("<option> </option>"),tg=H("<option> </option>"),eg=H("<option> </option>"),ng=H("<option> </option>"),rg=H('<p class="text-destructive text-sm"> </p>'),og=H('<form method="POST" class="flex flex-col gap-4"><!> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <!></div> <div class="space-y-2"><!> <div class="flex gap-2"><!> <!></div></div></div> <!> <div class="space-y-2"><!> <!></div> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <select id="UOM" name="UOM" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="space-y-2"><!> <!></div></div> <div class="space-y-2"><!> <!></div> <div class="grid grid-cols-2 gap-4"><div class="space-y-2"><!> <select id="Catagory" name="Catagory" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="space-y-2"><!> <select id="Sub_Catagory" name="Sub_Catagory" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div></div> <div class="space-y-2"><!> <select id="Parent" name="Parent" class="border-input bg-background flex h-9 w-full rounded-md border px-3 py-1 text-sm shadow-xs"><option>—</option><!></select></div> <div class="flex flex-wrap gap-6"><label class="flex items-center gap-2 text-sm"><input type="checkbox" name="Has_Parent" value="on" class="border-input size-4 rounded"/> Has Parent</label> <label class="flex items-center gap-2 text-sm"><input type="checkbox" name="Stock" value="on" class="border-input size-4 rounded"/> Stock</label></div> <!> <div class="flex justify-end gap-2"><!></div></form>');function sg(n,t){G(t,!0);let e=b(t,"item",3,null),r=b(t,"itemsForParent",19,()=>[]);const o=O(()=>!!e()),i=O(()=>e()?r().filter(C=>C.id!==e().id):r()),s=O(()=>{var C;return((C=e())==null?void 0:C.Item)??""}),l=O(()=>{var C;return((C=e())==null?void 0:C.SKU)??""}),u=O(()=>{var C;return((C=e())==null?void 0:C.Description)??""}),d=O(()=>{var C;return((C=e())==null?void 0:C.UOM)??""}),h=O(()=>{var C;return((C=e())==null?void 0:C.Cost)!=null?String(e().Cost):""}),f=O(()=>{var C;return((C=e())==null?void 0:C.Vendor)??""}),v=O(()=>{var C,R;return Array.isArray((C=e())==null?void 0:C.Catagory)?e().Catagory[0]:((R=e())==null?void 0:R.Catagory)??""}),m=O(()=>{var C,R;return Array.isArray((C=e())==null?void 0:C.Sub_Catagory)?e().Sub_Catagory[0]:((R=e())==null?void 0:R.Sub_Catagory)??""}),g=O(()=>{var C;return((C=e())==null?void 0:C.Parent)??""}),w=O(()=>{var C;return!!((C=e())!=null&&C.Has_Parent)}),P=O(()=>{var C;return!!((C=e())!=null&&C.Stock)});let S=j(""),A=j(!1),I=j(null),_=j(void 0),F=null,L=0;Wt(()=>{x(S,c(l),!0)});async function D(){if(typeof globalThis>"u"||"BarcodeDetector"in globalThis)return!0;try{const C=await Kc(()=>import("./Bd99md_0.js"),[],import.meta.url);return globalThis.BarcodeDetector=C.BarcodeDetector,!0}catch{return!1}}async function U(){if(x(I,null),!await D()){x(I,"Failed to load barcode scanner. Try again or use Chrome/Edge."),x(A,!0);return}try{F=await navigator.mediaDevices.getUserMedia({video:{facingMode:"environment",width:{ideal:1280},height:{ideal:720}}}),x(A,!0)}catch(R){x(I,R instanceof Error?R.message:"Could not access camera.",!0),x(A,!0)}}Wt(()=>{if(!(!c(A)||!F||!c(_)))return c(_).srcObject=F,c(_).play().then(()=>ot()).catch(()=>{}),()=>{c(_).srcObject&&(c(_).srcObject=null)}});const rt=300;function ot(){if(!c(A)||!c(_)||!("BarcodeDetector"in globalThis))return;const C=new globalThis.BarcodeDetector;let R=0;async function B(){if(!c(A)||!c(_))return;if(c(_).readyState<2){L=requestAnimationFrame(B);return}const Mt=Date.now();if(Mt-R>=rt){R=Mt;try{const Lt=await C.detect(c(_));if(Lt.length>0){x(S,Lt[0].rawValue,!0),_t();return}}catch{}}L=requestAnimationFrame(B)}B()}function _t(){x(A,!1),x(I,null),L&&(cancelAnimationFrame(L),L=0),F&&(F.getTracks().forEach(C=>C.stop()),F=null),c(_)&&c(_).srcObject&&(c(_).srcObject=null)}var gt=og(),At=z(gt);{var mt=C=>{var R=Xh();Uo(R),Ct(()=>nl(R,e().id)),p(C,R)};yt(At,C=>{c(o)&&C(mt)})}var it=k(At,2),J=z(it),at=z(J);Te(at,{for:"Item",children:(C,R)=>{q();var B=Z("Item");p(C,B)},$$slots:{default:!0}});var $=k(at,2);dr($,{id:"Item",name:"Item",get value(){return c(s)},required:!0}),K(J);var St=k(J,2),kt=z(St);Te(kt,{for:"SKU",children:(C,R)=>{q();var B=Z("SKU");p(C,B)},$$slots:{default:!0}});var oe=k(kt,2),Yt=z(oe);dr(Yt,{id:"SKU",name:"SKU",class:"flex-1",get value(){return c(S)},set value(C){x(S,C,!0)}});var Vt=k(Yt,2);qo(Vt,{type:"button",variant:"outline",size:"icon",onclick:U,title:"Scan barcode",children:(C,R)=>{zh(C,{class:"size-4"})},$$slots:{default:!0}}),K(oe),K(St),K(it);var He=k(it,2);{var Pe=C=>{var R=Qh(),B=z(R),Mt=z(B);{var Lt=Ae=>{var ae=jh(),Ee=z(ae,!0);K(ae),Ct(()=>Et(Ee,c(I))),p(Ae,ae)},Ks=Ae=>{var ae=Zh();ae.muted=!0,dn(ae,Ee=>x(_,Ee),()=>c(_)),p(Ae,ae)};yt(Mt,Ae=>{c(I)?Ae(Lt):Ae(Ks,!1)})}var Lo=k(Mt,2),Vs=z(Lo);qo(Vs,{type:"button",variant:"outline",class:"flex-1",onclick:_t,children:(Ae,ae)=>{var Ee=Jh(),gn=T(Ee);ec(gn,{class:"mr-2 size-4"}),q(),p(Ae,Ee)},$$slots:{default:!0}}),K(Lo),K(B),K(R),p(C,R)};yt(He,C=>{c(A)&&C(Pe)})}var Ht=k(He,2),$t=z(Ht);Te($t,{for:"Description",children:(C,R)=>{q();var B=Z("Description");p(C,B)},$$slots:{default:!0}});var fe=k($t,2);dr(fe,{id:"Description",name:"Description",get value(){return c(u)}}),K(Ht);var Dt=k(Ht,2),st=z(Dt),he=z(st);Te(he,{for:"UOM",children:(C,R)=>{q();var B=Z("UOM");p(C,B)},$$slots:{default:!0}});var Ue=k(he,2),se=z(Ue);se.value=se.__value="";var qe=k(se);rn(qe,17,()=>qh,mn,(C,R)=>{var B=$h(),Mt=z(B,!0);K(B);var Lt={};Ct(()=>{zo(B,c(d)===c(R)),Et(Mt,c(R)),Lt!==(Lt=c(R))&&(B.value=(B.__value=c(R))??"")}),p(C,B)}),K(Ue),K(st);var Se=k(st,2),Ye=z(Se);Te(Ye,{for:"Cost",children:(C,R)=>{q();var B=Z("Cost");p(C,B)},$$slots:{default:!0}});var Ce=k(Ye,2);dr(Ce,{id:"Cost",name:"Cost",type:"number",step:"any",get value(){return c(h)}}),K(Se),K(Dt);var ge=k(Dt,2),ve=z(ge);Te(ve,{for:"Vendor",children:(C,R)=>{q();var B=Z("Vendor");p(C,B)},$$slots:{default:!0}});var hn=k(ve,2);dr(hn,{id:"Vendor",name:"Vendor",get value(){return c(f)}}),K(ge);var Oe=k(ge,2),Ge=z(Oe),ct=z(Ge);Te(ct,{for:"Catagory",children:(C,R)=>{q();var B=Z("Catagory");p(C,B)},$$slots:{default:!0}});var ut=k(ct,2),lt=z(ut);lt.value=lt.__value="";var Nt=k(lt);rn(Nt,17,()=>Yh,mn,(C,R)=>{var B=tg(),Mt=z(B,!0);K(B);var Lt={};Ct(()=>{zo(B,c(v)===c(R)),Et(Mt,c(R)),Lt!==(Lt=c(R))&&(B.value=(B.__value=c(R))??"")}),p(C,B)}),K(ut),K(Ge);var dt=k(Ge,2),sr=z(dt);Te(sr,{for:"Sub_Catagory",children:(C,R)=>{q();var B=Z("Sub_Catagory");p(C,B)},$$slots:{default:!0}});var ir=k(sr,2),Mn=z(ir);Mn.value=Mn.__value="";var zs=k(Mn);rn(zs,17,()=>Gh,mn,(C,R)=>{var B=eg(),Mt=z(B,!0);K(B);var Lt={};Ct(()=>{zo(B,c(m)===c(R)),Et(Mt,c(R)),Lt!==(Lt=c(R))&&(B.value=(B.__value=c(R))??"")}),p(C,B)}),K(ir),K(dt),K(Oe);var ht=k(Oe,2),vt=z(ht);Te(vt,{for:"Parent",children:(C,R)=>{q();var B=Z("Parent");p(C,B)},$$slots:{default:!0}});var pt=k(vt,2),Rt=z(pt);Rt.value=Rt.__value="";var Q=k(Rt);rn(Q,17,()=>c(i),mn,(C,R)=>{var B=ng(),Mt=z(B,!0);K(B);var Lt={};Ct(()=>{zo(B,c(g)===c(R).id),Et(Mt,c(R).Item||c(R).SKU||c(R).id),Lt!==(Lt=c(R).id)&&(B.value=(B.__value=c(R).id)??"")}),p(C,B)}),K(pt),K(ht);var bt=k(ht,2),Bt=z(bt),Xt=z(Bt);Uo(Xt),q(),K(Bt);var Ot=k(Bt,2),ft=z(Ot);Uo(ft),q(),K(Ot),K(bt);var wt=k(bt,2);{var jt=C=>{var R=rg(),B=z(R,!0);K(R),Ct(()=>Et(B,t.error)),p(C,R)};yt(wt,C=>{t.error&&C(jt)})}var In=k(wt,2),ie=z(In);qo(ie,{type:"submit",children:(C,R)=>{q();var B=Z();Ct(()=>Et(B,t.submitLabel)),p(C,B)},$$slots:{default:!0}}),K(In),K(gt),$a(gt,(C,R)=>{var B;return(B=tl)==null?void 0:B(C,R)},()=>()=>async({update:C,result:R})=>{var B,Mt;await C(),R.type==="success"&&((B=R.data)!=null&&B.success)&&((Mt=t.onSuccess)==null||Mt.call(t))}),Ct(()=>{el(gt,"action",t.action),wa(Xt,c(w)),wa(ft,c(P))}),p(n,gt),X()}var ig=H("<!> New item",1),ag=H("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),lg=H('<span class="text-muted-foreground">—</span>'),cg=H("<!> <!>",1),ug=H('<span class="text-muted-foreground">—</span>'),dg=H("<!> <!>",1),fg=H('<span class="text-muted-foreground">No</span>'),hg=H('<span class="font-mono text-xs"> </span>'),gg=H('<span class="text-muted-foreground">—</span>'),vg=H("<!> Edit",1),pg=H("<!> Delete",1),mg=H('<!> <form method="POST" action="?/delete" class="hidden"><input type="hidden" name="id"/></form> <!>',1),yg=H("<!> <!>",1),bg=H("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),wg=H("<!> <!>",1),xg=H("<!> <!>",1),_g=H("<!> <!>",1),Pg=H('<main class="container mx-auto flex flex-col gap-6 py-8"><div class="flex items-center justify-between"><h1 class="text-2xl font-semibold">Stackq Items</h1> <div class="flex items-center gap-2"><span class="text-muted-foreground text-sm"> </span> <!></div></div> <!> <!></main>');function Rg(n,t){G(t,!0);let e=j(!1),r=j(null),o=j("create");const i=O(()=>{var F;return((F=t.data)==null?void 0:F.items)??[]}),s=O(()=>{var F;return((F=t.data)==null?void 0:F.itemsForParent)??[]});function l(F){return F==null?[]:Array.isArray(F)?F:[F]}function u(F){if(!F)return"—";try{return new Date(F).toLocaleDateString(void 0,{dateStyle:"short",timeStyle:"short"})}catch{return F}}function d(){x(r,null),x(o,"create"),x(e,!0)}function h(F){x(r,F,!0),x(o,"update"),x(e,!0)}function f(){x(e,!1),x(r,null)}const v=O(()=>{var F,L,D;return((F=t.data)==null?void 0:F.form)==="create"||((L=t.data)==null?void 0:L.form)==="update"?((D=t.data)==null?void 0:D.error)??null:null});Wt(()=>{var F,L;c(v)&&(((F=t.data)==null?void 0:F.form)==="create"||((L=t.data)==null?void 0:L.form)==="update")&&x(e,!0)});var m=Pg();Hc("1kn3tit",F=>{Nc(()=>{Rc.title="Items – Stackq"})});var g=z(m),w=k(z(g),2),P=z(w),S=z(P);K(P);var A=k(P,2);qo(A,{onclick:d,children:(F,L)=>{var D=ig(),U=T(D);Hh(U,{class:"mr-2 size-4"}),q(),p(F,D)},$$slots:{default:!0}}),K(w),K(g);var I=k(g,2);$c(I,{children:(F,L)=>{tu(F,{class:"p-0",children:(D,U)=>{var rt=N(),ot=T(rt);W(ot,()=>au,(_t,gt)=>{gt(_t,{children:(At,mt)=>{var it=wg(),J=T(it);W(J,()=>hu,($,St)=>{St($,{children:(kt,oe)=>{var Yt=N(),Vt=T(Yt);W(Vt,()=>Gs,(He,Pe)=>{Pe(He,{children:(Ht,$t)=>{var fe=ag(),Dt=T(fe);W(Dt,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("Item");p(lt,dt)},$$slots:{default:!0}})});var st=k(Dt,2);W(st,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("SKU");p(lt,dt)},$$slots:{default:!0}})});var he=k(st,2);W(he,()=>Zt,(ct,ut)=>{ut(ct,{class:"max-w-[200px]",children:(lt,Nt)=>{q();var dt=Z("Description");p(lt,dt)},$$slots:{default:!0}})});var Ue=k(he,2);W(Ue,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("UOM");p(lt,dt)},$$slots:{default:!0}})});var se=k(Ue,2);W(se,()=>Zt,(ct,ut)=>{ut(ct,{class:"text-right",children:(lt,Nt)=>{q();var dt=Z("Cost");p(lt,dt)},$$slots:{default:!0}})});var qe=k(se,2);W(qe,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("Vendor");p(lt,dt)},$$slots:{default:!0}})});var Se=k(qe,2);W(Se,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("Catagory");p(lt,dt)},$$slots:{default:!0}})});var Ye=k(Se,2);W(Ye,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("Sub_Catagory");p(lt,dt)},$$slots:{default:!0}})});var Ce=k(Ye,2);W(Ce,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("Has Parent");p(lt,dt)},$$slots:{default:!0}})});var ge=k(Ce,2);W(ge,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("Parent");p(lt,dt)},$$slots:{default:!0}})});var ve=k(ge,2);W(ve,()=>Zt,(ct,ut)=>{ut(ct,{children:(lt,Nt)=>{q();var dt=Z("Stock");p(lt,dt)},$$slots:{default:!0}})});var hn=k(ve,2);W(hn,()=>Zt,(ct,ut)=>{ut(ct,{class:"text-muted-foreground",children:(lt,Nt)=>{q();var dt=Z("created");p(lt,dt)},$$slots:{default:!0}})});var Oe=k(hn,2);W(Oe,()=>Zt,(ct,ut)=>{ut(ct,{class:"text-muted-foreground",children:(lt,Nt)=>{q();var dt=Z("updated");p(lt,dt)},$$slots:{default:!0}})});var Ge=k(Oe,2);W(Ge,()=>Zt,(ct,ut)=>{ut(ct,{class:"w-[70px]",children:(lt,Nt)=>{q();var dt=Z("Actions");p(lt,dt)},$$slots:{default:!0}})}),p(Ht,fe)},$$slots:{default:!0}})}),p(kt,Yt)},$$slots:{default:!0}})});var at=k(J,2);W(at,()=>cu,($,St)=>{St($,{children:(kt,oe)=>{var Yt=N(),Vt=T(Yt);{var He=Ht=>{var $t=N(),fe=T($t);W(fe,()=>Gs,(Dt,st)=>{st(Dt,{children:(he,Ue)=>{var se=N(),qe=T(se);W(qe,()=>Gt,(Se,Ye)=>{Ye(Se,{colspan:"14",class:"h-24 text-center text-muted-foreground",children:(Ce,ge)=>{q();var ve=Z("No items. Create one or check PocketBase collection name and auth.");p(Ce,ve)},$$slots:{default:!0}})}),p(he,se)},$$slots:{default:!0}})}),p(Ht,$t)},Pe=Ht=>{var $t=N(),fe=T($t);rn(fe,17,()=>c(i),Dt=>Dt.id,(Dt,st)=>{var he=N(),Ue=T(he);W(Ue,()=>Gs,(se,qe)=>{qe(se,{children:(Se,Ye)=>{var Ce=bg(),ge=T(Ce);W(ge,()=>Gt,(ht,vt)=>{vt(ht,{class:"font-medium",children:(pt,Rt)=>{q();var Q=Z();Ct(()=>Et(Q,c(st).Item??"—")),p(pt,Q)},$$slots:{default:!0}})});var ve=k(ge,2);W(ve,()=>Gt,(ht,vt)=>{vt(ht,{class:"font-mono text-xs",children:(pt,Rt)=>{q();var Q=Z();Ct(()=>Et(Q,c(st).SKU??"—")),p(pt,Q)},$$slots:{default:!0}})});var hn=k(ve,2);{let ht=O(()=>c(st).Description??"");W(hn,()=>Gt,(vt,pt)=>{pt(vt,{class:"max-w-[200px] truncate",get title(){return c(ht)},children:(Rt,Q)=>{q();var bt=Z();Ct(()=>Et(bt,c(st).Description??"—")),p(Rt,bt)},$$slots:{default:!0}})})}var Oe=k(hn,2);W(Oe,()=>Gt,(ht,vt)=>{vt(ht,{children:(pt,Rt)=>{ur(pt,{variant:"outline",children:(Q,bt)=>{q();var Bt=Z();Ct(()=>Et(Bt,c(st).UOM??"—")),p(Q,Bt)},$$slots:{default:!0}})},$$slots:{default:!0}})});var Ge=k(Oe,2);W(Ge,()=>Gt,(ht,vt)=>{vt(ht,{class:"text-right tabular-nums",children:(pt,Rt)=>{q();var Q=Z();Ct(bt=>Et(Q,bt),[()=>c(st).Cost!=null?Number(c(st).Cost).toLocaleString():"—"]),p(pt,Q)},$$slots:{default:!0}})});var ct=k(Ge,2);W(ct,()=>Gt,(ht,vt)=>{vt(ht,{class:"text-muted-foreground",children:(pt,Rt)=>{q();var Q=Z();Ct(()=>Et(Q,c(st).Vendor??"—")),p(pt,Q)},$$slots:{default:!0}})});var ut=k(ct,2);W(ut,()=>Gt,(ht,vt)=>{vt(ht,{children:(pt,Rt)=>{var Q=cg(),bt=T(Q);rn(bt,17,()=>l(c(st).Catagory),mn,(ft,wt)=>{ur(ft,{variant:"secondary",class:"mr-1 text-xs",children:(jt,In)=>{q();var ie=Z();Ct(()=>Et(ie,c(wt))),p(jt,ie)},$$slots:{default:!0}})});var Bt=k(bt,2);{var Xt=ft=>{var wt=lg();p(ft,wt)},Ot=O(()=>l(c(st).Catagory).length===0);yt(Bt,ft=>{c(Ot)&&ft(Xt)})}p(pt,Q)},$$slots:{default:!0}})});var lt=k(ut,2);W(lt,()=>Gt,(ht,vt)=>{vt(ht,{children:(pt,Rt)=>{var Q=dg(),bt=T(Q);rn(bt,17,()=>l(c(st).Sub_Catagory),mn,(ft,wt)=>{ur(ft,{variant:"outline",class:"mr-1 text-xs",children:(jt,In)=>{q();var ie=Z();Ct(()=>Et(ie,c(wt))),p(jt,ie)},$$slots:{default:!0}})});var Bt=k(bt,2);{var Xt=ft=>{var wt=ug();p(ft,wt)},Ot=O(()=>l(c(st).Sub_Catagory).length===0);yt(Bt,ft=>{c(Ot)&&ft(Xt)})}p(pt,Q)},$$slots:{default:!0}})});var Nt=k(lt,2);W(Nt,()=>Gt,(ht,vt)=>{vt(ht,{children:(pt,Rt)=>{var Q=N(),bt=T(Q);{var Bt=Ot=>{ur(Ot,{children:(ft,wt)=>{q();var jt=Z("Yes");p(ft,jt)},$$slots:{default:!0}})},Xt=Ot=>{var ft=fg();p(Ot,ft)};yt(bt,Ot=>{c(st).Has_Parent?Ot(Bt):Ot(Xt,!1)})}p(pt,Q)},$$slots:{default:!0}})});var dt=k(Nt,2);W(dt,()=>Gt,(ht,vt)=>{vt(ht,{class:"text-muted-foreground",children:(pt,Rt)=>{var Q=N(),bt=T(Q);{var Bt=ft=>{var wt=Z();Ct(()=>Et(wt,c(st).expand.Parent.Item??c(st).expand.Parent.SKU??c(st).Parent)),p(ft,wt)},Xt=ft=>{var wt=hg(),jt=z(wt,!0);K(wt),Ct(()=>Et(jt,c(st).Parent)),p(ft,wt)},Ot=ft=>{var wt=Z("—");p(ft,wt)};yt(bt,ft=>{var wt;(wt=c(st).expand)!=null&&wt.Parent?ft(Bt):c(st).Parent?ft(Xt,1):ft(Ot,!1)})}p(pt,Q)},$$slots:{default:!0}})});var sr=k(dt,2);W(sr,()=>Gt,(ht,vt)=>{vt(ht,{children:(pt,Rt)=>{var Q=N(),bt=T(Q);{var Bt=Ot=>{ur(Ot,{variant:"default",children:(ft,wt)=>{q();var jt=Z("Stock");p(ft,jt)},$$slots:{default:!0}})},Xt=Ot=>{var ft=gg();p(Ot,ft)};yt(bt,Ot=>{c(st).Stock?Ot(Bt):Ot(Xt,!1)})}p(pt,Q)},$$slots:{default:!0}})});var ir=k(sr,2);W(ir,()=>Gt,(ht,vt)=>{vt(ht,{class:"text-muted-foreground text-xs",children:(pt,Rt)=>{q();var Q=Z();Ct(bt=>Et(Q,bt),[()=>u(c(st).created)]),p(pt,Q)},$$slots:{default:!0}})});var Mn=k(ir,2);W(Mn,()=>Gt,(ht,vt)=>{vt(ht,{class:"text-muted-foreground text-xs",children:(pt,Rt)=>{q();var Q=Z();Ct(bt=>Et(Q,bt),[()=>u(c(st).updated)]),p(pt,Q)},$$slots:{default:!0}})});var zs=k(Mn,2);W(zs,()=>Gt,(ht,vt)=>{vt(ht,{children:(pt,Rt)=>{var Q=N(),bt=T(Q);W(bt,()=>Bh,(Bt,Xt)=>{Xt(Bt,{children:(Ot,ft)=>{var wt=yg(),jt=T(wt);W(jt,()=>Wh,(ie,C)=>{C(ie,{class:"border-0 bg-transparent hover:bg-muted inline-flex size-8 items-center justify-center rounded-md",children:(R,B)=>{Kh(R,{class:"size-4"})},$$slots:{default:!0}})});var In=k(jt,2);W(In,()=>nc,(ie,C)=>{C(ie,{children:(R,B)=>{var Mt=N(),Lt=T(Mt);W(Lt,()=>Lh,(Ks,Lo)=>{Lo(Ks,{align:"end",children:(Vs,Ae)=>{var ae=mg(),Ee=T(ae);W(Ee,()=>Ha,(ar,kn)=>{kn(ar,{onclick:()=>h(c(st)),children:(Dn,oc)=>{var lr=vg(),Hs=T(lr);Vh(Hs,{class:"mr-2 size-4"}),q(),p(Dn,lr)},$$slots:{default:!0}})});var gn=k(Ee,2),da=z(gn);Uo(da),K(gn),$a(gn,ar=>{var kn;return(kn=tl)==null?void 0:kn(ar)});var rc=k(gn,2);W(rc,()=>Ha,(ar,kn)=>{kn(ar,{class:"text-destructive focus:text-destructive cursor-pointer",onclick:()=>{var Dn;confirm("Delete this item? This cannot be undone.")&&((Dn=document.getElementById("delete-form-"+c(st).id))==null||Dn.requestSubmit())},children:(Dn,oc)=>{var lr=pg(),Hs=T(lr);Uh(Hs,{class:"mr-2 size-4"}),q(),p(Dn,lr)},$$slots:{default:!0}})}),Ct(()=>{el(gn,"id",`delete-form-${c(st).id??""}`),nl(da,c(st).id)}),p(Vs,ae)},$$slots:{default:!0}})}),p(R,Mt)},$$slots:{default:!0}})}),p(Ot,wt)},$$slots:{default:!0}})}),p(pt,Q)},$$slots:{default:!0}})}),p(Se,Ce)},$$slots:{default:!0}})}),p(Dt,he)}),p(Ht,$t)};yt(Vt,Ht=>{c(i).length===0?Ht(He):Ht(Pe,!1)})}p(kt,Yt)},$$slots:{default:!0}})}),p(At,it)},$$slots:{default:!0}})}),p(D,rt)},$$slots:{default:!0}})},$$slots:{default:!0}});var _=k(I,2);W(_,()=>Sh,(F,L)=>{L(F,{get open(){return c(e)},set open(D){x(e,D,!0)},children:(D,U)=>{var rt=N(),ot=T(rt);W(ot,()=>Nh,(_t,gt)=>{gt(_t,{class:"max-h-[90vh] overflow-y-auto sm:max-w-[500px]",children:(At,mt)=>{var it=_g(),J=T(it);W(J,()=>Eh,($,St)=>{St($,{children:(kt,oe)=>{var Yt=xg(),Vt=T(Yt);W(Vt,()=>Oh,(Pe,Ht)=>{Ht(Pe,{children:($t,fe)=>{q();var Dt=Z();Ct(()=>Et(Dt,c(r)?"Edit item":"New item")),p($t,Dt)},$$slots:{default:!0}})});var He=k(Vt,2);W(He,()=>Rh,(Pe,Ht)=>{Ht(Pe,{children:($t,fe)=>{q();var Dt=Z();Ct(()=>Et(Dt,c(r)?"Update the item below.":"Add a new Stackq item.")),p($t,Dt)},$$slots:{default:!0}})}),p(kt,Yt)},$$slots:{default:!0}})});var at=k(J,2);{let $=O(()=>c(r)?"?/update":"?/create"),St=O(()=>c(r)?"Update":"Create"),kt=O(()=>c(v)??null);sg(at,{get item(){return c(r)},get itemsForParent(){return c(s)},get action(){return c($)},get submitLabel(){return c(St)},get error(){return c(kt)},onSuccess:f})}p(At,it)},$$slots:{default:!0}})}),p(D,rt)},$$slots:{default:!0}})}),K(m),Ct(()=>Et(S,`${c(i).length??""} items`)),p(n,m),X()}export{Rg as default};
|