tmex-cli 0.6.8 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +0,0 @@
1
- var Et=e=>{throw TypeError(e)};var gt=(e,t,n)=>t.has(e)||Et("Cannot "+n);var F=(e,t,n)=>(gt(e,t,"read from private field"),n?n.call(e):t.get(e)),qe=(e,t,n)=>t.has(e)?Et("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),We=(e,t,n,o)=>(gt(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),Ye=(e,t,n)=>(gt(e,t,"access private method"),n);import{T as on,U as rn,V as Ct,W as ln,X as Dt,a as an,r as s,Y as cn,Z as un,c as Rt,j as v,q as Ie,_ as ut,$ as H,a0 as dn,a1 as Ft,a2 as kt,a3 as Pt,a4 as wt,a5 as fn,a6 as pn,a7 as f,a8 as It,a9 as gn,aa as we,ab as He,ac as dt,ad as hn,ae as mn,af as xn,ag as bn,ah as vn,ai as yn,aj as Bt,ak as Sn,al as zt,am as Rn,an as wn,ao as je,ap as Mt,aq as Vt,ar as In,as as Mn,at as Tn,au as An,av as En,aw as _t,ax as ze,ay as Cn,az as Ee,aA as Pn,aB as Vn,aC as bt,aD as ht,aE as Hn,aF as jn,aG as Nn,aH as Un,aI as Ln,aJ as On,aK as Dn,aL as Fn,aM as kn,aN as Bn,aO as qt,aP as Wt,aQ as zn,aR as _n,aS as qn,aT as mt,aU as Ht,aV as Wn,aW as Yn,aX as vt,aY as $n,aZ as Kn,a_ as Yt,a$ as Xn,b0 as Gn,b1 as Jn,b2 as xt}from"./index-YVZKH9DX.js";import{u as Zn}from"./useValueChanged-CFS5t0R_.js";var Pe,De,he,Ve,Ne,at,yt,Ot,Qn=(Ot=class extends on{constructor(t,n){super();qe(this,Ne);qe(this,Pe);qe(this,De);qe(this,he);qe(this,Ve);We(this,Pe,t),this.setOptions(n),this.bindMethods(),Ye(this,Ne,at).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var o;const n=this.options;this.options=F(this,Pe).defaultMutationOptions(t),rn(this.options,n)||F(this,Pe).getMutationCache().notify({type:"observerOptionsUpdated",mutation:F(this,he),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Ct(n.mutationKey)!==Ct(this.options.mutationKey)?this.reset():((o=F(this,he))==null?void 0:o.state.status)==="pending"&&F(this,he).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=F(this,he))==null||t.removeObserver(this)}onMutationUpdate(t){Ye(this,Ne,at).call(this),Ye(this,Ne,yt).call(this,t)}getCurrentResult(){return F(this,De)}reset(){var t;(t=F(this,he))==null||t.removeObserver(this),We(this,he,void 0),Ye(this,Ne,at).call(this),Ye(this,Ne,yt).call(this)}mutate(t,n){var o;return We(this,Ve,n),(o=F(this,he))==null||o.removeObserver(this),We(this,he,F(this,Pe).getMutationCache().build(F(this,Pe),this.options)),F(this,he).addObserver(this),F(this,he).execute(t)}},Pe=new WeakMap,De=new WeakMap,he=new WeakMap,Ve=new WeakMap,Ne=new WeakSet,at=function(){var n;const t=((n=F(this,he))==null?void 0:n.state)??ln();We(this,De,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},yt=function(t){Dt.batch(()=>{var n,o,g,r,p,c,u,N;if(F(this,Ve)&&this.hasListeners()){const S=F(this,De).variables,R=F(this,De).context,m={client:F(this,Pe),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(o=(n=F(this,Ve)).onSuccess)==null||o.call(n,t.data,S,R,m)}catch(C){Promise.reject(C)}try{(r=(g=F(this,Ve)).onSettled)==null||r.call(g,t.data,null,S,R,m)}catch(C){Promise.reject(C)}}else if((t==null?void 0:t.type)==="error"){try{(c=(p=F(this,Ve)).onError)==null||c.call(p,t.error,S,R,m)}catch(C){Promise.reject(C)}try{(N=(u=F(this,Ve)).onSettled)==null||N.call(u,void 0,t.error,S,R,m)}catch(C){Promise.reject(C)}}}this.listeners.forEach(S=>{S(F(this,De))})})},Ot);function Ds(e,t){const n=an(),[o]=s.useState(()=>new Qn(n,e));s.useEffect(()=>{o.setOptions(e)},[o,e]);const g=s.useSyncExternalStore(s.useCallback(p=>o.subscribe(Dt.batchCalls(p)),[o]),()=>o.getCurrentResult(),()=>o.getCurrentResult()),r=s.useCallback((p,c)=>{o.mutate(p,c).catch(cn)},[o]);if(g.error&&un(o.options.throwOnError,[g.error]))throw g.error;return{...g,mutate:r,mutateAsync:g.mutate}}/**
2
- * @license lucide-react v0.564.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const es=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ts=Rt("check",es);/**
7
- * @license lucide-react v0.564.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const ns=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],$t=Rt("chevron-down",ns);/**
12
- * @license lucide-react v0.564.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const ss=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],os=Rt("chevron-up",ss);function Fs({className:e,size:t="default",...n}){return v.jsx("div",{"data-slot":"card","data-size":t,className:Ie("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-xl py-4 text-sm ring-1 has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl group/card flex flex-col",e),...n})}function ks({className:e,...t}){return v.jsx("div",{"data-slot":"card-header",className:Ie("gap-1 rounded-t-xl px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",e),...t})}function Bs({className:e,...t}){return v.jsx("div",{"data-slot":"card-title",className:Ie("text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",e),...t})}function zs({className:e,...t}){return v.jsx("div",{"data-slot":"card-description",className:Ie("text-muted-foreground text-sm",e),...t})}function _s({className:e,...t}){return v.jsx("div",{"data-slot":"card-content",className:Ie("px-4 group-data-[size=sm]/card:px-3",e),...t})}const Kt=s.createContext(null),Xt=s.createContext(null);function Ce(){const e=s.useContext(Kt);if(e===null)throw new Error(ut(60));return e}function Gt(){const e=s.useContext(Xt);if(e===null)throw new Error(ut(61));return e}const rs=(e,t)=>Object.is(e,t);function Ke(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function ls(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:Ke(t,o,n))}function tt(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:Ke(o,t,n))}function is(e,t,n){return e.filter(o=>!Ke(t,o,n))}function St(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Jt(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function as(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Jt(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function cs(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return St(e)}function $e(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?St(e.value):St(e)}function Zt(e,t,n){function o(){return cs(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const g=Jt(t)?t.flatMap(r=>r.items):t;if(e==null||typeof e!="object"){const r=g.find(p=>p.value===e);return r&&r.label!=null?r.label:o()}if("value"in e){const r=g.find(p=>p&&p.value===e.value);if(r&&r.label!=null)return r.label}}return o()}function us(e,t,n){return e.reduce((o,g,r)=>(r>0&&o.push(", "),o.push(v.jsx(s.Fragment,{children:Zt(g,t,n)},r)),o),[])}const a={id:H(e=>e.id),modal:H(e=>e.modal),multiple:H(e=>e.multiple),items:H(e=>e.items),itemToStringLabel:H(e=>e.itemToStringLabel),itemToStringValue:H(e=>e.itemToStringValue),isItemEqualToValue:H(e=>e.isItemEqualToValue),value:H(e=>e.value),hasSelectedValue:H(e=>{const{value:t,multiple:n,itemToStringValue:o}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:$e(t,o)!==""}),hasNullItemLabel:H((e,t)=>t?as(e.items):!1),open:H(e=>e.open),mounted:H(e=>e.mounted),forceMount:H(e=>e.forceMount),transitionStatus:H(e=>e.transitionStatus),openMethod:H(e=>e.openMethod),activeIndex:H(e=>e.activeIndex),selectedIndex:H(e=>e.selectedIndex),isActive:H((e,t)=>e.activeIndex===t),isSelected:H((e,t,n)=>{const o=e.isItemEqualToValue,g=e.value;return e.multiple?Array.isArray(g)&&g.some(r=>Ke(n,r,o)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ke(n,g,o)}),isSelectedByFocus:H((e,t)=>e.selectedIndex===t),popupProps:H(e=>e.popupProps),triggerProps:H(e=>e.triggerProps),triggerElement:H(e=>e.triggerElement),positionerElement:H(e=>e.positionerElement),listElement:H(e=>e.listElement),scrollUpArrowVisible:H(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:H(e=>e.scrollDownArrowVisible),hasScrollArrows:H(e=>e.hasScrollArrows)};function ds(e){const{id:t,value:n,defaultValue:o=null,onValueChange:g,open:r,defaultOpen:p=!1,onOpenChange:c,name:u,autoComplete:N,disabled:S=!1,readOnly:R=!1,required:m=!1,modal:C=!0,actionsRef:Q,inputRef:A,onOpenChangeComplete:U,items:L,multiple:M=!1,itemToStringLabel:b,itemToStringValue:y,isItemEqualToValue:z=rs,highlightItemOnHover:ve=!0,children:ne}=e,{clearErrors:k}=dn(),{setDirty:K,setTouched:ue,setFocused:B,shouldValidateOnChange:_,validityData:q,setFilled:x,name:oe,disabled:X,validation:D,validationMode:G}=Ft(),l=kt({id:t}),E=X||S,P=oe??u,[i,le]=Pt({controlled:n,default:M?o??Vt:o,name:"Select",state:"value"}),[h,W]=Pt({controlled:r,default:p,name:"Select",state:"open"}),d=s.useRef([]),j=s.useRef([]),ee=s.useRef(null),Me=s.useRef(null),Ue=s.useRef(0),T=s.useRef(null),V=s.useRef([]),de=s.useRef(!1),se=s.useRef(!1),ie=s.useRef(null),me=s.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),J=s.useRef(!1),{mounted:re,setMounted:fe,transitionStatus:Y}=wt(h),{openMethod:te,triggerProps:$,reset:pe}=fn(h),w=pn(()=>new In({id:l,modal:C,multiple:M,itemToStringLabel:b,itemToStringValue:y,isItemEqualToValue:z,value:i,open:h,mounted:re,transitionStatus:Y,items:L,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Te=f(w,a.activeIndex),Re=f(w,a.selectedIndex),Le=f(w,a.triggerElement),_e=f(w,a.positionerElement),Z=s.useMemo(()=>M&&Array.isArray(i)&&i.length===0?"":$e(i,y),[M,i,y]),xe=s.useMemo(()=>M&&Array.isArray(i)?i.map(I=>$e(I,y)):$e(i,y),[M,i,y]),ge=It(w.state.triggerElement);gn({id:l,commit:D.commit,value:i,controlRef:ge,name:P,getValue:()=>xe});const ye=s.useRef(i);we(()=>{i!==ye.current&&w.set("forceMount",!0)},[w,i]),we(()=>{x(M?Array.isArray(i)&&i.length>0:i!=null)},[M,i,x]),we(function(){if(h)return;const O=V.current;if(M){const Se=Array.isArray(i)?i:[];if(Se.length===0){w.set("selectedIndex",null);return}const be=Se[Se.length-1],Oe=tt(O,be,z);w.set("selectedIndex",Oe===-1?null:Oe);return}const ce=tt(O,i,z);w.set("selectedIndex",ce===-1?null:ce)},[M,h,i,V,z,w]),Zn(i,()=>{k(P),K(i!==q.initialValue),_()?D.commit(i):D.commit(i,!0)});const Xe=He((I,O)=>{if(c==null||c(I,O),!O.isCanceled&&(W(I),!I&&(O.reason===Tn||O.reason===An)&&(ue(!0),B(!1),G==="onBlur"&&D.commit(i)),!I&&w.state.activeIndex!==null)){const ce=d.current[w.state.activeIndex];queueMicrotask(()=>{ce==null||ce.setAttribute("tabindex","-1")})}}),Ge=He(()=>{fe(!1),w.set("activeIndex",null),pe(),U==null||U(!1)});dt({enabled:!Q,open:h,ref:ee,onComplete(){h||Ge()}}),s.useImperativeHandle(Q,()=>({unmount:Ge}),[Ge]);const Fe=He((I,O)=>{g==null||g(I,O),!O.isCanceled&&le(I)}),Je=He(()=>{const I=w.state.listElement||ee.current;if(!I)return;const O=I.scrollTop,ce=I.scrollTop+I.clientHeight,Se=O>1,be=ce<I.scrollHeight-1;w.state.scrollUpArrowVisible!==Se&&w.set("scrollUpArrowVisible",Se),w.state.scrollDownArrowVisible!==be&&w.set("scrollDownArrowVisible",be)}),ae=hn({open:h,onOpenChange:Xe,elements:{reference:Le,floating:_e}}),nt=mn(ae,{enabled:!R&&!E,event:"mousedown"}),st=xn(ae,{bubbles:!1}),Ze=bn(ae,{enabled:!R&&!E,listRef:d,activeIndex:Te,selectedIndex:Re,disabledIndices:Vt,onNavigate(I){I===null&&!h||w.set("activeIndex",I)},focusItemOnHover:!1}),Ae=vn(ae,{enabled:!R&&!E&&(h||!M),listRef:j,activeIndex:Te,selectedIndex:Re,onMatch(I){h?w.set("activeIndex",I):Fe(V.current[I],je("none"))},onTypingChange(I){de.current=I}}),{getReferenceProps:ot,getFloatingProps:ke,getItemProps:Qe}=yn([nt,st,Ze,Ae]),et=s.useMemo(()=>Bt(ot(),$,l?{id:l}:Mn),[ot,$,l]);Sn(()=>{w.update({popupProps:ke(),triggerProps:et})}),we(()=>{w.update({id:l,modal:C,multiple:M,value:i,open:h,mounted:re,transitionStatus:Y,popupProps:ke(),triggerProps:et,items:L,itemToStringLabel:b,itemToStringValue:y,isItemEqualToValue:z,openMethod:te})},[w,l,C,M,i,h,re,Y,ke,et,L,b,y,z,te]);const ft=s.useMemo(()=>({store:w,name:P,required:m,disabled:E,readOnly:R,multiple:M,itemToStringLabel:b,itemToStringValue:y,highlightItemOnHover:ve,setValue:Fe,setOpen:Xe,listRef:d,popupRef:ee,scrollHandlerRef:Me,handleScrollArrowVisibility:Je,scrollArrowsMountedCountRef:Ue,getItemProps:Qe,events:ae.context.events,valueRef:T,valuesRef:V,labelsRef:j,typingRef:de,selectionRef:me,selectedItemTextRef:ie,validation:D,onOpenChangeComplete:U,keyboardActiveRef:se,alignItemWithTriggerActiveRef:J,initialValueRef:ye}),[w,P,m,E,R,M,b,y,ve,Fe,Xe,Qe,ae.context.events,D,U,Je]),rt=zt(A,D.inputRef),lt=M&&Array.isArray(i)&&i.length>0,pt=s.useMemo(()=>!M||!Array.isArray(i)||!P?null:i.map(I=>{const O=$e(I,y);return v.jsx("input",{type:"hidden",name:P,value:O},O)}),[M,i,P,y]);return v.jsx(Kt.Provider,{value:ft,children:v.jsxs(Xt.Provider,{value:ae,children:[ne,v.jsx("input",{...D.getInputValidationProps({onFocus(){var I;(I=w.state.triggerElement)==null||I.focus({focusVisible:!0})},onChange(I){if(I.nativeEvent.defaultPrevented)return;const O=I.target.value,ce=je(Mt,I.nativeEvent);function Se(){if(M)return;const be=V.current.find(Oe=>$e(Oe,y).toLowerCase()===O.toLowerCase());be!=null&&(K(be!==q.initialValue),Fe(be,ce),_()&&D.commit(be))}w.set("forceMount",!0),queueMicrotask(Se)}}),name:M?void 0:P,autoComplete:N,value:Z,disabled:E,required:m&&!lt,readOnly:R,ref:rt,style:P?Rn:wn,tabIndex:-1,"aria-hidden":!0}),pt]})})}const it=2,fs=400,jt=200,ps={...Vn,...Pn,value:()=>null},gs=s.forwardRef(function(t,n){const{render:o,className:g,id:r,disabled:p=!1,nativeButton:c=!0,...u}=t,{setTouched:N,setFocused:S,validationMode:R,state:m,disabled:C}=Ft(),{labelId:Q}=En(),{store:A,setOpen:U,selectionRef:L,validation:M,readOnly:b,required:y,alignItemWithTriggerActiveRef:z,disabled:ve,keyboardActiveRef:ne}=Ce(),k=C||ve||p,K=f(A,a.open),ue=f(A,a.value),B=f(A,a.triggerProps),_=f(A,a.positionerElement),q=f(A,a.listElement),x=f(A,a.id),oe=f(A,a.hasSelectedValue),X=!oe&&K,D=f(A,a.hasNullItemLabel,X),G=r??x;kt({id:G});const l=It(_),E=s.useRef(null),{getButtonProps:P,buttonRef:i}=_t({disabled:k,native:c}),le=He(V=>{A.set("triggerElement",V)}),h=zt(n,E,i,le),W=ze(),d=ze(),j=ze(),ee=ze();s.useEffect(()=>{if(K)return!(oe||D)?j.start(fs,()=>{L.current.allowUnselectedMouseUp=!0,L.current.allowSelectedMouseUp=!0}):ee.start(jt,()=>{L.current.allowUnselectedMouseUp=!0,j.start(jt,()=>{L.current.allowSelectedMouseUp=!0})}),()=>{j.clear(),ee.clear()};L.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},d.clear()},[K,oe,D,L,d,j,ee]);const Me=s.useMemo(()=>{var V;return(q==null?void 0:q.id)??((V=Cn(_))==null?void 0:V.id)},[q,_]),Ue=Bt(B,{id:G,role:"combobox","aria-expanded":K?"true":"false","aria-haspopup":"listbox","aria-controls":K?Me:void 0,"aria-labelledby":Q,"aria-readonly":b||void 0,"aria-required":y||void 0,tabIndex:k?-1:0,ref:h,onFocus(V){S(!0),K&&z.current&&U(!1,je(Mt,V.nativeEvent)),W.start(0,()=>{A.set("forceMount",!0)})},onBlur(V){ht(_,V.relatedTarget)||(N(!0),S(!1),R==="onBlur"&&M.commit(ue))},onPointerMove(){ne.current=!1},onKeyDown(){ne.current=!0},onMouseDown(V){if(K)return;const de=bt(V.currentTarget);function se(ie){if(!E.current)return;const me=ie.target;if(ht(E.current,me)||ht(l.current,me)||me===E.current)return;const J=Hn(E.current);ie.clientX>=J.left-it&&ie.clientX<=J.right+it&&ie.clientY>=J.top-it&&ie.clientY<=J.bottom+it||U(!1,je(jn,ie))}d.start(0,()=>{de.addEventListener("mouseup",se,{once:!0})})}},M.getValidationProps,u,P);Ue.role="combobox";const T={...m,open:K,disabled:k,value:ue,readOnly:b,placeholder:!oe};return Ee("button",t,{ref:[n,E],state:T,stateAttributesMapping:ps,props:Ue})}),hs={value:()=>null},ms=s.forwardRef(function(t,n){const{className:o,render:g,children:r,placeholder:p,...c}=t,{store:u,valueRef:N}=Ce(),S=f(u,a.value),R=f(u,a.items),m=f(u,a.itemToStringLabel),C=f(u,a.hasSelectedValue),Q=!C&&p!=null&&r==null,A=f(u,a.hasNullItemLabel,Q),U={value:S,placeholder:!C};let L=null;return typeof r=="function"?L=r(S):r!=null?L=r:!C&&p!=null&&!A?L=p:Array.isArray(S)?L=us(S,R,m):L=Zt(S,R,m),Ee("span",t,{state:U,ref:[n,N],props:[{children:L},c],stateAttributesMapping:hs})}),xs=s.forwardRef(function(t,n){const{className:o,render:g,...r}=t,{store:p}=Ce(),u={open:f(p,a.open)};return Ee("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},r],stateAttributesMapping:Nn})}),bs=s.createContext(void 0),vs=s.forwardRef(function(t,n){const{store:o}=Ce(),g=f(o,a.mounted),r=f(o,a.forceMount);return g||r?v.jsx(bs.Provider,{value:!0,children:v.jsx(Un,{ref:n,...t})}):null}),Qt=s.createContext(void 0);function Tt(){const e=s.useContext(Qt);if(!e)throw new Error(ut(59));return e}function ct(e,t){e&&Object.assign(e.style,t)}const en={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},ys={position:"fixed"},Ss=s.forwardRef(function(t,n){const{anchor:o,positionMethod:g="absolute",className:r,render:p,side:c="bottom",align:u="center",sideOffset:N=0,alignOffset:S=0,collisionBoundary:R="clipping-ancestors",collisionPadding:m,arrowPadding:C=5,sticky:Q=!1,disableAnchorTracking:A,alignItemWithTrigger:U=!0,collisionAvoidance:L=Ln,...M}=t,{store:b,listRef:y,labelsRef:z,alignItemWithTriggerActiveRef:ve,selectedItemTextRef:ne,valuesRef:k,initialValueRef:K,popupRef:ue,setValue:B}=Ce(),_=Gt(),q=f(b,a.open),x=f(b,a.mounted),oe=f(b,a.modal),X=f(b,a.value),D=f(b,a.openMethod),G=f(b,a.positionerElement),l=f(b,a.triggerElement),E=f(b,a.isItemEqualToValue),P=f(b,a.transitionStatus),i=s.useRef(null),le=s.useRef(null),[h,W]=s.useState(U),d=x&&h&&D!=="touch";!x&&h!==U&&W(U),we(()=>{x||(a.scrollUpArrowVisible(b.state)&&b.set("scrollUpArrowVisible",!1),a.scrollDownArrowVisible(b.state)&&b.set("scrollDownArrowVisible",!1))},[b,x]),s.useImperativeHandle(ve,()=>d),On((d||oe)&&q&&D!=="touch",l);const j=Dn({anchor:o,floatingRootContext:_,positionMethod:g,mounted:x,side:c,sideOffset:N,align:u,alignOffset:S,arrowPadding:C,collisionBoundary:R,collisionPadding:m,sticky:Q,disableAnchorTracking:A??d,collisionAvoidance:L,keepMounted:!0}),ee=d?"none":j.side,Me=d?ys:j.positionerStyles,Ue=s.useMemo(()=>{const J={};return q||(J.pointerEvents="none"),{role:"presentation",hidden:!x,style:{...Me,...J}}},[q,x,Me]),T={open:q,side:ee,align:j.align,anchorHidden:j.anchorHidden},V=He(J=>{b.set("positionerElement",J)}),de=Ee("div",t,{ref:[n,V],state:T,stateAttributesMapping:qt,props:[Ue,Wt(P),M]}),se=s.useRef(0),ie=He(J=>{if(J.size===0&&se.current===0||k.current.length===0)return;const re=se.current;if(se.current=J.size,J.size===re)return;const fe=je(Mt);if(re!==0&&!b.state.multiple&&X!==null&&tt(k.current,X,E)===-1){const te=K.current,pe=te!=null&&tt(k.current,te,E)!==-1?te:null;B(pe,fe),pe===null&&(b.set("selectedIndex",null),ne.current=null)}if(re!==0&&b.state.multiple&&Array.isArray(X)){const Y=$=>tt(k.current,$,E)!==-1,te=X.filter($=>Y($));(te.length!==X.length||te.some($=>!ls(X,$,E)))&&(B(te,fe),te.length===0&&(b.set("selectedIndex",null),ne.current=null))}if(q&&d){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Y={height:""};ct(G,Y),ct(ue.current,Y)}}),me=s.useMemo(()=>({...j,side:ee,alignItemWithTriggerActive:d,setControlledAlignItemWithTrigger:W,scrollUpArrowRef:i,scrollDownArrowRef:le}),[j,ee,d,W]);return v.jsx(Fn,{elementsRef:y,labelsRef:z,onMapChange:ie,children:v.jsxs(Qt.Provider,{value:me,children:[x&&oe&&v.jsx(kn,{inert:Bn(!q),cutout:l}),de]})})});function tn(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Be=1,Rs={...qt,...Yt},ws=s.forwardRef(function(t,n){const{render:o,className:g,finalFocus:r,...p}=t,{store:c,popupRef:u,onOpenChangeComplete:N,setOpen:S,valueRef:R,selectedItemTextRef:m,keyboardActiveRef:C,multiple:Q,handleScrollArrowVisibility:A,scrollHandlerRef:U,highlightItemOnHover:L}=Ce(),{side:M,align:b,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:z,scrollDownArrowRef:ve,scrollUpArrowRef:ne}=Tt(),k=zn()!=null,K=Gt(),{nonce:ue,disableStyleElements:B}=_n(),_=ze(),q=f(c,a.id),x=f(c,a.open),oe=f(c,a.mounted),X=f(c,a.popupProps),D=f(c,a.transitionStatus),G=f(c,a.triggerElement),l=f(c,a.positionerElement),E=f(c,a.listElement),P=s.useRef(0),i=s.useRef(!1),le=s.useRef(0),h=s.useRef(!1),W=s.useRef({}),d=qn(),j=He(T=>{if(!l||!u.current||!h.current)return;if(i.current||!y){A();return}const V=l.style.top==="0px",de=l.style.bottom==="0px",se=l.getBoundingClientRect().height,ie=bt(l),me=getComputedStyle(l),J=parseFloat(me.marginTop),re=parseFloat(me.marginBottom),fe=Nt(getComputedStyle(u.current)),Y=Math.min(ie.documentElement.clientHeight-J-re,fe),te=T.scrollTop,$=Ut(T);let pe=0,w=null,Te=!1,Re=!1;const Le=Z=>{l.style.height=`${Z}px`},_e=(Z,xe)=>{const ge=mt(Z,0,Y-se);ge>0&&Le(se+ge),T.scrollTop=xe,Y-(se+ge)<=Be&&(i.current=!0),A()};if(V){const Z=$-te,xe=se+Z,ge=Math.min(xe,Y);if(pe=ge,Z<=Be){_e(Z,$);return}Y-ge>Be?Re=!0:Te=!0}else if(de){const Z=te,xe=se+Z,ge=Math.min(xe,Y),ye=xe-Y;if(pe=ge,Z<=Be){_e(Z,0);return}Y-ge>Be?w=0:(Te=!0,te<$&&(w=te-(Z-ye)))}if(pe=Math.ceil(pe),pe!==0&&Le(pe),Re||w!=null){const Z=Ut(T),xe=Re?Z:mt(w,0,Z);Math.abs(T.scrollTop-xe)>Be&&(T.scrollTop=xe)}(Te||pe>=Y-Be)&&(i.current=!0),A()});s.useImperativeHandle(U,()=>j,[j]),dt({open:x,ref:u,onComplete(){x&&(N==null||N(!0))}});const ee={open:x,transitionStatus:D,side:M,align:b};we(()=>{!l||!u.current||Object.keys(W.current).length||(W.current={top:l.style.top||"0",left:l.style.left||"0",right:l.style.right,height:l.style.height,bottom:l.style.bottom,minHeight:l.style.minHeight,maxHeight:l.style.maxHeight,marginTop:l.style.marginTop,marginBottom:l.style.marginBottom})},[u,l]),we(()=>{x||y||(h.current=!1,i.current=!1,P.current=0,le.current=0,ct(l,W.current))},[x,y,l,u]),we(()=>{const T=u.current;if(!(!x||!G||!l||!T||c.state.transitionStatus==="ending")){if(!y){h.current=!0,d.request(A),T.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var de;const V=Is(T);T.style.removeProperty("--transform-origin");try{const se=getComputedStyle(l),ie=getComputedStyle(T),me=bt(G),J=Ht(l),re=G.getBoundingClientRect(),fe=l.getBoundingClientRect(),Y=re.left,te=re.height,$=E||T,pe=$.scrollHeight,w=parseFloat(ie.borderBottomWidth),Te=parseFloat(se.marginTop)||10,Re=parseFloat(se.marginBottom)||10,Le=parseFloat(se.minHeight)||100,_e=Nt(ie),Z=5,xe=5,ge=20,ye=me.documentElement.clientHeight-Te-Re,Xe=me.documentElement.clientWidth,Ge=ye-re.bottom+te,Fe=m.current,Je=R.current;let ae,nt=0,st=0;if(Fe&&Je){const O=Je.getBoundingClientRect();ae=Fe.getBoundingClientRect();const ce=O.left-Y,Se=ae.left-fe.left,be=O.top-re.top+O.height/2,Oe=ae.top-fe.top+ae.height/2;nt=ce-Se,st=Oe-be}const Ze=Ge+st+Re+w;let Ae=Math.min(ye,Ze);const ot=ye-Te-Re,ke=Ze-Ae,Qe=Math.max(Z,Y+nt),et=Xe-xe,ft=Math.max(0,Qe+fe.width-et);l.style.left=`${Qe-ft}px`,l.style.height=`${Ae}px`,l.style.maxHeight="auto",l.style.marginTop=`${Te}px`,l.style.marginBottom=`${Re}px`,T.style.height="100%";const rt=$.scrollHeight-$.clientHeight,lt=ke>=rt;lt&&(Ae=Math.min(ye,fe.height)-(ke-rt));const pt=re.top<ge||re.bottom>ye-ge||Ae<Math.min(pe,Le),I=(((de=J.visualViewport)==null?void 0:de.scale)??1)!==1&&Wn;if(pt||I){h.current=!0,ct(l,W.current),Yn.flushSync(()=>z(!1));return}if(lt){const O=Math.max(0,ye-Ze);l.style.top=fe.height>=ot?"0":`${O}px`,l.style.height=`${Ae}px`,$.scrollTop=$.scrollHeight-$.clientHeight,P.current=Math.max(Le,Ae)}else l.style.bottom="0",P.current=Math.max(Le,Ae),$.scrollTop=ke;if(ae){const O=fe.top,ce=fe.height,Se=ae.top+ae.height/2,be=ce>0?(Se-O)/ce*100:50,Oe=mt(be,0,100);T.style.setProperty("--transform-origin",`50% ${Oe}%`)}(P.current===ye||Ae>=_e)&&(i.current=!0),A(),setTimeout(()=>{h.current=!0})}finally{V()}})}},[c,x,l,G,R,m,u,A,y,z,d,ve,ne,E]),s.useEffect(()=>{if(!y||!l||!x)return;const T=Ht(l);function V(de){S(!1,je(Kn,de))}return T.addEventListener("resize",V),()=>{T.removeEventListener("resize",V)}},[S,y,l,x]);const Me={...E?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":Q||void 0,id:`${q}-list`},onKeyDown(T){C.current=!0,k&&Xn.has(T.key)&&T.stopPropagation()},onMouseMove(){C.current=!1},onPointerLeave(T){if(!L||tn(T)||T.pointerType==="touch")return;const V=T.currentTarget;_.start(0,()=>{c.set("activeIndex",null),V.focus({preventScroll:!0})})},onScroll(T){E||j(T.currentTarget)},...y&&{style:E?{height:"100%"}:en}},Ue=Ee("div",t,{ref:[n,u],state:ee,stateAttributesMapping:Rs,props:[X,Me,Wt(D),{className:!E&&y?vt.className:void 0},p]});return v.jsxs(s.Fragment,{children:[!B&&vt.getElement(ue),v.jsx($n,{context:K,modal:!1,disabled:!oe,returnFocus:r,restoreFocus:!0,children:Ue})]})});function Nt(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Ut(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const Lt=[["transform","none"],["scale","1"],["translate","0 0"]];function Is(e){const{style:t}=e,n={};for(const[o,g]of Lt)n[o]=t.getPropertyValue(o),t.setProperty(o,g,"important");return()=>{for(const[o]of Lt){const g=n[o];g?t.setProperty(o,g):t.removeProperty(o)}}}const Ms=s.forwardRef(function(t,n){const{className:o,render:g,...r}=t,{store:p,scrollHandlerRef:c}=Ce(),{alignItemWithTriggerActive:u}=Tt(),N=f(p,a.hasScrollArrows),S=f(p,a.openMethod),R=f(p,a.multiple),C={id:`${f(p,a.id)}-list`,role:"listbox","aria-multiselectable":R||void 0,onScroll(A){var U;(U=c.current)==null||U.call(c,A.currentTarget)},...u&&{style:en},className:N&&S!=="touch"?vt.className:void 0},Q=He(A=>{p.set("listElement",A)});return Ee("div",t,{ref:[n,Q],props:[C,r]})}),nn=s.createContext(void 0);function At(){const e=s.useContext(nn);if(!e)throw new Error(ut(57));return e}const Ts=s.memo(s.forwardRef(function(t,n){const{render:o,className:g,value:r=null,label:p,disabled:c=!1,nativeButton:u=!1,...N}=t,S=s.useRef(null),R=Gn({label:p,textRef:S,indexGuessBehavior:Jn.GuessFromOrder}),{store:m,getItemProps:C,setOpen:Q,setValue:A,selectionRef:U,typingRef:L,valuesRef:M,keyboardActiveRef:b,multiple:y,highlightItemOnHover:z}=Ce(),ve=ze(),ne=f(m,a.isActive,R.index),k=f(m,a.isSelected,R.index,r),K=f(m,a.isSelectedByFocus,R.index),ue=f(m,a.isItemEqualToValue),B=R.index,_=B!==-1,q=s.useRef(null),x=It(B);we(()=>{if(!_)return;const d=M.current;return d[B]=r,()=>{delete d[B]}},[_,B,r,M]),we(()=>{if(!_)return;const d=m.state.value;let j=d;y&&Array.isArray(d)&&d.length>0&&(j=d[d.length-1]),j!==void 0&&Ke(r,j,ue)&&m.set("selectedIndex",B)},[_,B,y,ue,m,r]);const oe={disabled:c,selected:k,highlighted:ne},X=C({active:ne,selected:k});X.onFocus=void 0,X.id=void 0;const D=s.useRef(null),G=s.useRef("mouse"),l=s.useRef(!1),{getButtonProps:E,buttonRef:P}=_t({disabled:c,focusableWhenDisabled:!0,native:u});function i(d){const j=m.state.value;if(y){const ee=Array.isArray(j)?j:[],Me=k?is(ee,r,ue):[...ee,r];A(Me,je(xt,d))}else A(r,je(xt,d)),Q(!1,je(xt,d))}const le={role:"option","aria-selected":k,tabIndex:ne?0:-1,onFocus(){m.set("activeIndex",B)},onMouseEnter(){!b.current&&m.state.selectedIndex===null&&z&&m.set("activeIndex",B)},onMouseMove(){z&&m.set("activeIndex",B)},onMouseLeave(d){!z||b.current||tn(d)||ve.start(0,()=>{m.state.activeIndex===B&&m.set("activeIndex",null)})},onTouchStart(){U.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(d){D.current=d.key,m.set("activeIndex",B)},onClick(d){l.current=!1,!(d.type==="keydown"&&D.current===null)&&(c||D.current===" "&&L.current||G.current!=="touch"&&!ne||(D.current=null,i(d.nativeEvent)))},onPointerEnter(d){G.current=d.pointerType},onPointerDown(d){G.current=d.pointerType,l.current=!0},onMouseUp(d){if(c)return;if(l.current){l.current=!1;return}const j=!U.current.allowSelectedMouseUp&&k,ee=!U.current.allowUnselectedMouseUp&&!k;j||ee||G.current!=="touch"&&!ne||i(d.nativeEvent)}},h=Ee("div",t,{ref:[P,n,R.ref,q],state:oe,props:[X,le,N,E]}),W=s.useMemo(()=>({selected:k,indexRef:x,textRef:S,selectedByFocus:K,hasRegistered:_}),[k,x,S,K,_]);return v.jsx(nn.Provider,{value:W,children:h})})),As=s.forwardRef(function(t,n){const o=t.keepMounted??!1,{selected:g}=At();return o||g?v.jsx(Es,{...t,ref:n}):null}),Es=s.memo(s.forwardRef((e,t)=>{const{render:n,className:o,keepMounted:g,...r}=e,{selected:p}=At(),c=s.useRef(null),{transitionStatus:u,setMounted:N}=wt(p),R=Ee("span",e,{ref:[t,c],state:{selected:p,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},r],stateAttributesMapping:Yt});return dt({open:p,ref:c,onComplete(){p||N(!1)}}),R})),Cs=s.memo(s.forwardRef(function(t,n){const{indexRef:o,textRef:g,selectedByFocus:r,hasRegistered:p}=At(),{selectedItemTextRef:c}=Ce(),{className:u,render:N,...S}=t,R=s.useCallback(C=>{if(!C||!p)return;const Q=c.current===null||!c.current.isConnected;(r||Q&&o.current===0)&&(c.current=C)},[c,o,r,p]);return Ee("div",t,{ref:[R,n,g],props:S})})),sn=s.forwardRef(function(t,n){const{render:o,className:g,direction:r,keepMounted:p=!1,...c}=t,{store:u,popupRef:N,listRef:S,handleScrollArrowVisibility:R,scrollArrowsMountedCountRef:m}=Ce(),{side:C,scrollDownArrowRef:Q,scrollUpArrowRef:A}=Tt(),U=r==="up"?a.scrollUpArrowVisible:a.scrollDownArrowVisible,L=f(u,U),M=f(u,a.openMethod),b=L&&M!=="touch",y=ze(),z=r==="up"?A:Q,{transitionStatus:ve,setMounted:ne}=wt(b);we(()=>(m.current+=1,u.state.hasScrollArrows||u.set("hasScrollArrows",!0),()=>{m.current=Math.max(0,m.current-1),m.current===0&&u.state.hasScrollArrows&&u.set("hasScrollArrows",!1)}),[u,m]),dt({open:b,ref:z,onComplete(){b||ne(!1)}});const ue=Ee("div",t,{ref:[n,z],state:{direction:r,visible:b,side:C,transitionStatus:ve},props:[{"aria-hidden":!0,children:r==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(_){if(_.movementX===0&&_.movementY===0||y.isStarted())return;u.set("activeIndex",null);function q(){var G;const x=u.state.listElement??N.current;if(!x)return;u.set("activeIndex",null),R();const oe=x.scrollTop===0,X=Math.round(x.scrollTop+x.clientHeight)>=x.scrollHeight;if(S.current.length===0&&(r==="up"?u.set("scrollUpArrowVisible",!oe):u.set("scrollDownArrowVisible",!X)),r==="up"&&oe||r==="down"&&X){y.clear();return}if((u.state.listElement||N.current)&&S.current&&S.current.length>0){const l=S.current,E=((G=z.current)==null?void 0:G.offsetHeight)||0;if(r==="up"){let P=0;const i=x.scrollTop+E;for(let h=0;h<l.length;h+=1){const W=l[h];if(W&&W.offsetTop>=i){P=h;break}}const le=Math.max(0,P-1);if(le<P){const h=l[le];h&&(x.scrollTop=Math.max(0,h.offsetTop-E))}else x.scrollTop=0}else{let P=l.length-1;const i=x.scrollTop+x.clientHeight-E;for(let h=0;h<l.length;h+=1){const W=l[h];if(W&&W.offsetTop+W.offsetHeight>i){P=Math.max(0,h-1);break}}const le=Math.min(l.length-1,P+1);if(le>P){const h=l[le];h&&(x.scrollTop=h.offsetTop+h.offsetHeight-x.clientHeight+E)}else x.scrollTop=x.scrollHeight-x.clientHeight}}y.start(40,q)}y.start(40,q)},onMouseLeave(){y.clear()}},c]});return b||p?ue:null}),Ps=s.forwardRef(function(t,n){return v.jsx(sn,{...t,ref:n,direction:"down"})}),Vs=s.forwardRef(function(t,n){return v.jsx(sn,{...t,ref:n,direction:"up"})}),qs=ds;function Ws({className:e,...t}){return v.jsx(ms,{"data-slot":"select-value",className:Ie("flex flex-1 text-left",e),...t})}function Ys({className:e,size:t="default",children:n,...o}){return v.jsxs(gs,{"data-slot":"select-trigger","data-size":t,className:Ie("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 aria-invalid:ring-2 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...o,children:[n,v.jsx(xs,{render:v.jsx($t,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function $s({className:e,children:t,side:n="bottom",sideOffset:o=4,align:g="center",alignOffset:r=0,alignItemWithTrigger:p=!0,...c}){return v.jsx(vs,{children:v.jsx(Ss,{side:n,sideOffset:o,align:g,alignOffset:r,alignItemWithTrigger:p,className:"isolate z-50",children:v.jsxs(ws,{"data-slot":"select-content","data-align-trigger":p,className:Ie("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...c,children:[v.jsx(Hs,{}),v.jsx(Ms,{children:t}),v.jsx(js,{})]})})})}function Ks({className:e,children:t,...n}){return v.jsxs(Ts,{"data-slot":"select-item",className:Ie("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[v.jsx(Cs,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),v.jsx(As,{render:v.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:v.jsx(ts,{className:"pointer-events-none"})})]})}function Hs({className:e,...t}){return v.jsx(Vs,{"data-slot":"select-scroll-up-button",className:Ie("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",e),...t,children:v.jsx(os,{})})}function js({className:e,...t}){return v.jsx(Ps,{"data-slot":"select-scroll-down-button",className:Ie("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",e),...t,children:v.jsx($t,{})})}export{Fs as C,qs as S,ks as a,Bs as b,_s as c,Ys as d,Ws as e,$s as f,Ks as g,zs as h,Ds as u};
17
- //# sourceMappingURL=select-CD0ieoCm.js.map
@@ -1,12 +0,0 @@
1
- import{c as N,r as s,_ as ne,aA as se,a0 as re,a1 as L,av as ie,ab as ce,al as oe,bf as le,a2 as ue,a3 as fe,a9 as he,aa as pe,aw as me,aj as ke,az as _,j as f,as as ve,am as ge,an as be,ao as xe,ap as ye,q as Ce}from"./index-YVZKH9DX.js";import{u as we}from"./useValueChanged-CFS5t0R_.js";/**
2
- * @license lucide-react v0.564.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const ze=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Ke=N("loader-circle",ze);/**
7
- * @license lucide-react v0.564.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const Pe=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],Ve=N("send",Pe),q=s.createContext(void 0);function Ee(){const e=s.useContext(q);if(e===void 0)throw new Error(ne(63));return e}let F=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const S={...se,checked(e){return e?{[F.checked]:""}:{[F.unchecked]:""}}},Ie=s.forwardRef(function(r,o){const{checked:w,className:T,defaultChecked:k,id:v,inputRef:g,name:b,nativeButton:x=!1,onCheckedChange:O,readOnly:h=!1,required:l=!1,disabled:H=!1,render:Me,uncheckedValue:z,value:y,...J}=r,{clearErrors:U}=re(),{state:P,setTouched:Y,setDirty:$,validityData:G,setFilled:C,setFocused:E,shouldValidateOnChange:Q,validationMode:W,disabled:X,name:Z,validation:d}=L(),{labelId:D}=ie(),n=X||H,i=Z??b,p=ce(O),c=s.useRef(null),I=oe(c,g,d.inputRef),m=s.useRef(null),R=le(),M=ue({id:v,implicit:!1,controlRef:m}),j=x?void 0:M,[t,B]=fe({controlled:w,default:!!k,name:"Switch",state:"checked"});he({id:R,commit:d.commit,value:t,controlRef:m,name:i,getValue:()=>t}),pe(()=>{c.current&&C(c.current.checked)},[c,C]),we(t,()=>{U(i),$(t!==G.initialValue),C(t),Q()?d.commit(t):d.commit(t,!0)});const{getButtonProps:A,buttonRef:ee}=me({disabled:n,native:x}),ae={id:x?M:R,role:"switch","aria-checked":t,"aria-readonly":h||void 0,"aria-required":l||void 0,"aria-labelledby":D,onFocus(){n||E(!0)},onBlur(){const a=c.current;!a||n||(Y(!0),E(!1),W==="onBlur"&&d.commit(a.checked))},onClick(a){var u;h||n||(a.preventDefault(),(u=c.current)==null||u.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:a.shiftKey,ctrlKey:a.ctrlKey,altKey:a.altKey,metaKey:a.metaKey})))}},te=s.useMemo(()=>ke({checked:t,disabled:n,id:j,name:i,required:l,style:i?ge:be,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:I,onChange(a){if(a.nativeEvent.defaultPrevented)return;const u=a.target.checked,V=xe(ye,a.nativeEvent);p==null||p(u,V),!V.isCanceled&&B(u)},onFocus(){var a;(a=m.current)==null||a.focus()}},d.getInputValidationProps,y!==void 0?{value:y}:ve),[t,n,I,j,i,p,l,B,d,y]),K=s.useMemo(()=>({...P,checked:t,disabled:n,readOnly:h,required:l}),[P,t,n,h,l]),de=_("span",r,{state:K,ref:[o,m,ee],props:[ae,d.getValidationProps,J,A],stateAttributesMapping:S});return f.jsxs(q.Provider,{value:K,children:[de,!t&&i&&z!==void 0&&f.jsx("input",{type:"hidden",name:i,value:z}),f.jsx("input",{...te})]})}),Re=s.forwardRef(function(r,o){const{render:w,className:T,...k}=r,{state:v}=L(),g=Ee(),b={...v,...g};return _("span",r,{state:b,ref:o,stateAttributesMapping:S,props:k})});function Fe({className:e,size:r="default",...o}){return f.jsx(Ie,{"data-slot":"switch","data-size":r,className:Ce("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...o,children:f.jsx(Re,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}export{Ke as L,Fe as S,Ve as a};
12
- //# sourceMappingURL=switch-B4Od47H9.js.map
@@ -1,7 +0,0 @@
1
- import{c as r,r as s,ab as n,aa as c}from"./index-YVZKH9DX.js";/**
2
- * @license lucide-react v0.564.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const u=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],d=r("trash-2",u);function p(a,o){const t=s.useRef(a),e=n(o);c(()=>{t.current!==a&&e(t.current)},[a,e]),c(()=>{t.current=a},[a])}export{d as T,p as u};
7
- //# sourceMappingURL=useValueChanged-CFS5t0R_.js.map