@segmentify/ui 0.0.48 → 0.0.49

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.
@@ -85,7 +85,7 @@ Avoid returning a new reference inside your input selector, e.g.
85
85
  ${s.left}px ${s.top}px
86
86
  )`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});process.env.NODE_ENV!=="production"&&(VD.displayName="InternalBackdrop");function hJ(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const $0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&($0.displayName="ComboboxRootContext");const G0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(G0.displayName="ComboboxFloatingContext");const H0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(H0.displayName="ComboboxDerivedItemsContext");const W0=b.createContext("");process.env.NODE_ENV!=="production"&&(W0.displayName="ComboboxInputValueContext");function Hn(){const e=b.useContext($0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(22));return e}function _f(){const e=b.useContext(G0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(23));return e}function Ii(){const e=b.useContext(H0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(24));return e}function z0(){return b.useContext(W0)}const gJ=(e,t)=>Object.is(e,t);function rs(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function mJ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:rs(t,r,n))}function gd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:rs(r,t,n))}function bJ(e,t,n){return e.filter(r=>!rs(t,r,n))}function mv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function q0(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function vJ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(q0(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 On(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 mv(e)}function $a(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?mv(e.value):mv(e)}function $D(e,t,n){function r(){return On(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]??r();if(Array.isArray(t)){const o=q0(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=o.find(s=>s.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=o.find(s=>s&&s.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function yJ(e,t,n){return e.reduce((r,o,i)=>(i>0&&r.push(", "),r.push(h.jsx(b.Fragment,{children:$D(o,t,n)},i)),r),[])}const be={id:De(e=>e.id),query:De(e=>e.query),items:De(e=>e.items),selectedValue:De(e=>e.selectedValue),hasSelectionChips:De(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:De(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:De((e,t)=>t?vJ(e.items):!1),open:De(e=>e.open),mounted:De(e=>e.mounted),forceMounted:De(e=>e.forceMounted),inline:De(e=>e.inline),activeIndex:De(e=>e.activeIndex),selectedIndex:De(e=>e.selectedIndex),isActive:De((e,t)=>e.activeIndex===t),isSelected:De((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(o=>rs(t,o,n)):rs(t,r,n)}),transitionStatus:De(e=>e.transitionStatus),popupProps:De(e=>e.popupProps),inputProps:De(e=>e.inputProps),triggerProps:De(e=>e.triggerProps),getItemProps:De(e=>e.getItemProps),positionerElement:De(e=>e.positionerElement),listElement:De(e=>e.listElement),triggerElement:De(e=>e.triggerElement),inputElement:De(e=>e.inputElement),popupSide:De(e=>e.popupSide),openMethod:De(e=>e.openMethod),inputInsidePopup:De(e=>e.inputInsidePopup),selectionMode:De(e=>e.selectionMode),listRef:De(e=>e.listRef),labelsRef:De(e=>e.labelsRef),popupRef:De(e=>e.popupRef),emptyRef:De(e=>e.emptyRef),inputRef:De(e=>e.inputRef),keyboardActiveRef:De(e=>e.keyboardActiveRef),chipsContainerRef:De(e=>e.chipsContainerRef),clearRef:De(e=>e.clearRef),valuesRef:De(e=>e.valuesRef),allValuesRef:De(e=>e.allValuesRef),name:De(e=>e.name),disabled:De(e=>e.disabled),readOnly:De(e=>e.readOnly),required:De(e=>e.required),grid:De(e=>e.grid),isGrouped:De(e=>e.isGrouped),virtualized:De(e=>e.virtualized),onOpenChangeComplete:De(e=>e.onOpenChangeComplete),openOnInputClick:De(e=>e.openOnInputClick),itemToStringLabel:De(e=>e.itemToStringLabel),isItemEqualToValue:De(e=>e.isItemEqualToValue),modal:De(e=>e.modal),autoHighlight:De(e=>e.autoHighlight),submitOnItemClick:De(e=>e.submitOnItemClick)};let eI=(function(e){return e.disabled="data-disabled",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 xJ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},wJ={valid(e){return e===null?null:e?{[eI.valid]:""}:{[eI.invalid]:""}}},GD=b.createContext({invalid:void 0,name:void 0,validityData:{state:xJ,errors:[],error:"",value:"",initialValue:null},setValidityData:Lt,disabled:void 0,touched:!1,setTouched:Lt,dirty:!1,setDirty:Lt,filled:!1,setFilled:Lt,focused:!1,setFocused:Lt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(GD.displayName="FieldRootContext");function bu(e=!0){const t=b.useContext(GD);if(t.setValidityData===Lt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Fr(28));return t}function CJ(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const HD=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Lt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(HD.displayName="FormContext");function WD(){return b.useContext(HD)}function SJ(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=WD(),{invalid:l,markedDirtyRef:u,validityData:c,setValidityData:d}=bu(),f=ke(e.getValue);Ge(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),c.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,c.initialValue,f]),Ge(()=>{!t||!r||a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:CJ(c,l),validate(p=!0){let g=n;g===void 0&&(g=f()),u.current=!0,p?so.flushSync(()=>s(g)):s(g)}})},[s,i,t,a,f,r,l,u,o,c,n]),Ge(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const zD=b.createContext({controlId:void 0,registerControlId:Lt,labelId:void 0,setLabelId:Lt,messageIds:[],setMessageIds:Lt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(zD.displayName="LabelableContext");function U0(){return b.useContext(zD)}function qD(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=U0(),s=oD(t),a=n?o:void 0,l=dr(()=>Symbol("labelable-control")),u=b.useRef(!1),c=b.useRef(t!=null),d=ke(()=>{!u.current||i===Lt||(u.current=!1,i(l.current,void 0))});return Ge(()=>{if(i===Lt)return;let f;if(n){const p=r?.current;Nt(p)&&p.closest("label")!=null?f=t??null:f=a??s}else if(t!=null)c.current=!0,f=t;else if(c.current)f=s;else{d();return}if(f===void 0){d();return}u.current=!0,i(l.current,f)},[t,r,a,i,n,s,l,d]),b.useEffect(()=>d,[d]),o??s}function EJ(e,t){return(n,r)=>{if(n==null)return!1;const o=On(n,t);return e.contains(o,r)}}function IJ(e,t,n){return(r,o)=>{if(r==null)return!1;if(!o)return!0;const i=On(r,t),s=n!=null?On(n,t):"";return s&&e.contains(s,o)&&s.length===o.length?!0:e.contains(i,o)}}const tI=new Map;function UD(e){return Array.isArray(e)?e.map(t=>UD(t)).join(","):e==null?"":String(e)}function RJ(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${UD(e.locale)}|${JSON.stringify(t)}`,r=tI.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(s,a,l){if(!a)return!0;const u=On(s,l);for(let c=0;c<=u.length-a.length;c+=1)if(o.compare(u.slice(c,c+a.length),a)===0)return!0;return!1},startsWith(s,a,l){if(!a)return!0;const u=On(s,l);return o.compare(u.slice(0,a.length),a)===0},endsWith(s,a,l){if(!a)return!0;const u=On(s,l),c=a.length;return u.length>=c&&o.compare(u.slice(u.length-c),a)===0}};return tI.set(n,i),i}const AJ=RJ;function oc(e,t){const n=b.useRef(e),r=ke(t);Ge(()=>{n.current!==e&&r(n.current)},[e,r]),Ge(()=>{n.current=e},[e])}const YD=Symbol("none"),$i={value:YD,index:-1};function TJ(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:u,name:c,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:g,grid:m=!1,items:v,filteredItems:y,filter:x,openOnInputClick:w=!0,autoHighlight:C=!1,keepHighlight:S=!1,highlightItemOnHover:R=!0,loopFocus:I=!0,itemToStringLabel:T,itemToStringValue:_,isItemEqualToValue:$=gJ,virtualized:A=!1,inline:M=!1,fillInputOnItemPress:N=!0,modal:B=!1,limit:j=-1,autoComplete:D="list",formAutoComplete:V,locale:G,submitOnItemClick:z=!1}=e,{clearErrors:H}=WD(),{setDirty:ne,validityData:W,shouldValidateOnChange:J,setFilled:K,name:U,disabled:oe,setTouched:X,setFocused:te,validationMode:Q,validation:se}=bu(),ae=qD({id:t}),L=AJ({locale:G}),[Z,k]=b.useState(!1),[ie,Y]=b.useState(null),le=b.useRef([]),pe=b.useRef([]),re=b.useRef(null),fe=b.useRef(null),de=b.useRef(null),ve=b.useRef(!0),we=b.useRef(!1),Se=b.useRef(null),Ye=b.useRef(null),at=b.useRef(null),Xe=b.useRef($i),Ue=b.useRef(null),rt=b.useRef([]),et=b.useRef([]),gt=oe||d,ct=U??c,ot=l==="multiple",mt=l==="single",Ot=a!==void 0||s!==void 0,Bt=v!==void 0,tt=y!==void 0;let Ze;C==="always"?Ze="always":Ze=C?"input-change":!1;const[ee,ye]=Rm({controlled:o,default:ot?r??Yu:r,name:"Combobox",state:"selectedValue"}),ge=b.useMemo(()=>x===null?()=>!0:x!==void 0?x:mt&&!Z?IJ(L,T,ee):EJ(L,T),[x,mt,ee,Z,L,T]),xe=dr(()=>Ot?s??"":mt?On(ee,T):"").current,[Ae,Ie]=Rm({controlled:a,default:xe,name:"Combobox",state:"inputValue"}),[qe,Pt]=Rm({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),lt=q0(v),it=ie??(Ae===""?"":String(Ae).trim()),_t=mt?On(ee,T):"",Et=mt&&!Z&&it!==""&&_t!==""&&_t.length===it.length&&L.contains(_t,it),sn=Et?"":it,br=Bt&&tt&&Et,zn=b.useMemo(()=>v?lt?v.flatMap(Ce=>Ce.items):v:Yu,[v,lt]),pn=b.useMemo(()=>{if(y&&!br)return y;if(!v)return Yu;if(lt){const Me=v,Ke=[];let It=0;for(const st of Me){if(j>-1&&It>=j)break;const Dt=sn===""?st.items:st.items.filter(zr=>ge(zr,sn,T));if(Dt.length===0)continue;const Zn=j>-1?j-It:1/0,Tn=Dt.slice(0,Zn);if(Tn.length>0){const zr={...st,items:Tn};Ke.push(zr),It+=Tn.length}}return Ke}if(sn==="")return j>-1?zn.slice(0,j):zn;const Ce=[];for(const Me of zn){if(j>-1&&Ce.length>=j)break;ge(Me,sn,T)&&Ce.push(Me)}return Ce},[y,br,v,lt,sn,j,ge,T,zn]),Qt=b.useMemo(()=>lt?pn.flatMap(Me=>Me.items):pn,[pn,lt]),Ve=dr(()=>new LD({id:ae,selectedValue:ee,open:qe,filter:ge,query:it,items:v,selectionMode:l,listRef:le,labelsRef:pe,popupRef:re,emptyRef:de,inputRef:fe,keyboardActiveRef:ve,chipsContainerRef:Se,clearRef:Ye,valuesRef:rt,allValuesRef:et,selectionEventRef:at,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,openOnInputClick:w,itemToStringLabel:T,isItemEqualToValue:$,modal:B,autoHighlight:Ze,submitOnItemClick:z,hasInputValue:Ot,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:M,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Lt,setOpen:Lt,setInputValue:Lt,setSelectedValue:Lt,setIndices:Lt,onItemHighlighted:Lt,handleSelection:Lt,getItemProps:()=>En,forceMount:Lt,requestSubmit:Lt})).current,qn=l==="none"?Ae:ee,Sa=b.useMemo(()=>l==="none"?qn:Array.isArray(ee)?ee.map(Ce=>$a(Ce,_)):$a(ee,_),[qn,_,l,ee]),Ni=ke(u),Oi=ke(n),Go=me(Ve,be.activeIndex),on=me(Ve,be.selectedIndex),Ho=me(Ve,be.positionerElement),Is=me(Ve,be.listElement),bo=me(Ve,be.triggerElement),Pi=me(Ve,be.inputElement),Cn=me(Ve,be.inline),Mt=me(Ve,be.inputInsidePopup),Ea=or(bo),{mounted:Rs,setMounted:Ia,transitionStatus:_i}=M0(qe),{openMethod:As,triggerProps:Hr,reset:Ts}=iJ(qe);SJ({id:ae,name:ct,commit:se.commit,value:qn,controlRef:Mt?Ea:fe,getValue:()=>Sa});const vr=ke(()=>{v?pe.current=Qt.map(Ce=>On(Ce,T)):Ve.set("forceMounted",!0)}),Un=b.useRef(ee);Ge(()=>{ee!==Un.current&&vr()},[vr,ee]);const an=ke(Ce=>{Ve.update(Ce);const Me=Ce.type||"none";if(Ce.activeIndex!==void 0)if(Ce.activeIndex===null)Xe.current!==$i&&(Xe.current=$i,Ni(void 0,Ba(Me,void 0,{index:-1})));else{const Ke=rt.current[Ce.activeIndex];Xe.current={value:Ke,index:Ce.activeIndex},Ni(Ke,Ba(Me,void 0,{index:Ce.activeIndex}))}}),An=ke((Ce,Me)=>{if(we.current=Me.reason===ei,e.onInputValueChange?.(Ce,Me),!Me.isCanceled){if(Me.reason===Ws){const Ke=Me.event,It=Ke.inputType;if(Ke.type==="compositionend"||It!=null&&It!==""&&It!=="insertReplacementText"){const Dt=Ce.trim()!=="";Dt&&k(!0),Ue.current={hasQuery:Dt},Dt&&Ze&&Ve.state.activeIndex==null&&Ve.set("activeIndex",0)}}Ie(Ce)}}),vo=ke((Ce,Me)=>{if(qe!==Ce&&(Me.reason==="escape-key"&&Bt&&Qt.length===0&&!Ve.state.emptyRef.current&&Me.allowPropagation(),e.onOpenChange?.(Ce,Me),!Me.isCanceled&&(!Ce&&Z&&(mt?(Cn||Y(it),it===""&&k(!1)):ot&&(Cn||Mt?an({activeIndex:null}):Y(it),An("",Qe(ei,Me.event)))),Pt(Ce),!Ce&&Mt&&(Me.reason===Rf||Me.reason===N0)&&(X(!0),te(!1),Q==="onBlur")))){const Ke=l==="none"?Ae:ee;se.commit(Ke)}}),Wo=ke((Ce,Me)=>{if(i?.(Ce,Me),Me.isCanceled)return;ye(Ce),(l==="none"&&re.current&&N||mt&&!Ve.state.inputInsidePopup)&&An(On(Ce,T),Qe(Me.reason,Me.event)),mt&&Ce!=null&&Me.reason!==Ws&&Z&&!Cn&&Y(it)}),Ra=ke((Ce,Me)=>{let Ke=Me;if(Ke===void 0){if(Go===null)return;Ke=rt.current[Go]}const It=Pn(Ce),st=at.current??Ce;at.current=null;const Dt=Qe(d7,st),Zn=It?.closest("a")?.getAttribute("href");if(Zn){Zn.startsWith("#")&&vo(!1,Dt);return}if(ot){const Tn=Array.isArray(ee)?ee:[],Uo=mJ(Tn,Ke,Ve.state.isItemEqualToValue)?bJ(Tn,Ke,Ve.state.isItemEqualToValue):[...Tn,Ke];if(Wo(Uo,Dt),!(fe.current?fe.current.value.trim()!=="":!1))return;Ve.state.inputInsidePopup?An("",Qe(ei,Dt.event)):vo(!1,Dt)}else Wo(Ke,Dt),vo(!1,Dt)}),Mi=ke(()=>{if(!Ve.state.submitOnItemClick)return;const Ce=Ve.state.inputElement?.form;Ce&&typeof Ce.requestSubmit=="function"&&Ce.requestSubmit()}),Wr=ke(()=>{if(Ia(!1),Oi?.(!1),k(!1),Ts(),Y(null),an(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ot&&fe.current&&fe.current.value!==""&&!we.current&&An("",Qe(ei)),mt)if(Ve.state.inputInsidePopup)fe.current&&fe.current.value!==""&&An("",Qe(ei));else{const Ce=On(ee,T);fe.current&&fe.current.value!==Ce&&An(Ce,Qe(Ce===""?ei:tr))}}),Di=b.useMemo(()=>Cn&&Ho?{current:Ho.closest('[role="dialog"]')}:re,[Cn,Ho]);Nf({enabled:!e.actionsRef,open:qe,ref:Di,onComplete(){qe||Wr()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:Wr}),[Wr]),Ge(function(){if(qe||l==="none")return;const Me=v?zn:et.current;if(ot){const Ke=Array.isArray(ee)?ee:[],It=Ke[Ke.length-1],st=gd(Me,It,$);an({selectedIndex:st===-1?null:st})}else{const Ke=gd(Me,ee,$);an({selectedIndex:Ke===-1?null:Ke})}},[qe,ee,v,l,zn,ot,$,an]),Ge(()=>{v&&(rt.current=Qt,le.current.length=Qt.length)},[v,Qt]),Ge(()=>{const Ce=Ue.current;if(Ce&&(Ce.hasQuery?Ze&&Ve.set("activeIndex",0):Ze==="always"&&Ve.set("activeIndex",0),Ue.current=null),!qe&&!Cn)return;const Ke=Bt||tt?Qt:rt.current,It=Ve.state.activeIndex;if(It==null){if(Ze==="always"&&Ke.length>0){Ve.set("activeIndex",0);return}Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(tr,void 0,{index:-1})));return}if(It>=Ke.length){Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(tr,void 0,{index:-1}))),Ve.set("activeIndex",null);return}const st=Ke[It],Dt=Xe.current.value,Zn=Dt!==YD&&rs(st,Dt,Ve.state.isItemEqualToValue);(Xe.current.index!==It||!Zn)&&(Xe.current={value:st,index:It},Ve.state.onItemHighlighted(st,Ba(tr,void 0,{index:It})))},[Go,Ze,tt,Bt,Qt,Cn,qe,Ve]),Ge(()=>{if(l==="none"){K(String(Ae)!=="");return}K(ot?Array.isArray(ee)&&ee.length>0:ee!=null)},[K,l,Ae,ee,ot]),b.useEffect(()=>{Bt&&Ze&&Qt.length===0&&an({activeIndex:null})},[Bt,Ze,Qt.length,an]),oc(it,()=>{!qe||it===""||it===String(xe)||k(!0)}),oc(ee,()=>{if(l!=="none"&&(H(ct),ne(ee!==W.initialValue),J()?se.commit(ee):se.commit(ee,!0),mt&&!Ot&&!Mt)){const Ce=On(ee,T);Ae!==Ce&&An(Ce,Qe(tr))}}),oc(Ae,()=>{l==="none"&&(H(ct),ne(Ae!==W.initialValue),J()?se.commit(Ae):se.commit(Ae,!0))}),oc(v,()=>{if(!mt||Ot||Mt||Z)return;const Ce=On(ee,T);Ae!==Ce&&An(Ce,Qe(tr))});const Yn=FD({open:Cn?!0:qe,onOpenChange:vo,elements:{reference:Mt?bo:Pi,floating:Ho}});let zo,qo;Cn||(zo=m?"grid":"listbox",qo=qe?"true":"false");const Aa=b.useMemo(()=>{const Ce=Pi?.tagName==="INPUT",Me=Ce||qe,Ke=Ce?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Me&&(Ke.role="combobox",Ke["aria-expanded"]=qo,Ke["aria-haspopup"]=zo,Ke["aria-controls"]=qe?Is?.id:void 0,Ke["aria-autocomplete"]=D),{reference:Ke,floating:{role:"presentation"}}},[Pi,qe,qo,zo,Is?.id,D]),Ta=DD(Yn,{enabled:!f&&!gt&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Mt?0:50,reason:p7}),Na=yZ(Yn,{enabled:!f&&!gt&&!Cn,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Cn?!0:void 0,outsidePress(Ce){const Me=Pn(Ce);return!ft(bo,Me)&&!ft(Ye.current,Me)&&!ft(Se.current,Me)}}),Oa=nJ(Yn,{enabled:!f&&!gt,id:ae,listRef:le,activeIndex:Go,selectedIndex:on,virtual:!0,loopFocus:I,allowEscape:I&&!Ze,focusItemOnOpen:Z||l==="none"&&!Ze?!1:"auto",focusItemOnHover:R,resetOnPointerLeave:!S,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:Yu,onNavigate(Ce,Me){!Me&&!qe||_i==="ending"||an(Me?{activeIndex:Ce,type:ve.current?"keyboard":"pointer"}:{activeIndex:Ce})}}),{getReferenceProps:yo,getFloatingProps:ki,getItemProps:ji}=KZ([Aa,Ta,Na,Oa]);hJ(()=>{Ve.update({inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,getItemProps:ji,setOpen:vo,setInputValue:An,setSelectedValue:Wo,setIndices:an,onItemHighlighted:Ni,handleSelection:Ra,forceMount:vr,requestSubmit:Mi})}),Ge(()=>{Ve.update({id:ae,selectedValue:ee,open:qe,mounted:Rs,transitionStatus:_i,items:v,inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,openMethod:As,getItemProps:ji,selectionMode:l,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,onOpenChangeComplete:Oi,openOnInputClick:w,itemToStringLabel:T,modal:B,autoHighlight:Ze,isItemEqualToValue:$,submitOnItemClick:z,hasInputValue:Ot,requestSubmit:Mi})},[Ve,ae,ee,qe,Rs,_i,v,ki,yo,ji,As,Hr,l,ct,gt,f,p,se,m,lt,A,Oi,w,T,B,$,z,Ot,M,Mi,Ze]);const xo=Ml(g,se.inputRef),kn=b.useMemo(()=>({query:it,hasItems:Bt,filteredItems:pn,flatFilteredItems:Qt}),[it,Bt,pn,Qt]),yr=b.useMemo(()=>Array.isArray(qn)?"":$a(qn,_),[qn,_]),xr=ot&&Array.isArray(ee)&&ee.length>0,Li=ot||l==="none"?void 0:ct,Xn=b.useMemo(()=>!ot||!Array.isArray(ee)||!ct?null:ee.map(Ce=>{const Me=$a(Ce,_);return h.jsx("input",{type:"hidden",name:ct,value:Me},Me)}),[ot,ee,ct,_]),Pa=h.jsxs(b.Fragment,{children:[e.children,h.jsx("input",{...se.getInputValidationProps({onFocus(){if(Mt){bo?.focus();return}(fe.current||bo)?.focus()},onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;const Me=Ce.target.value,Ke=Qe(tr,Ce.nativeEvent);function It(){if(ot)return;if(l==="none"){ne(Me!==W.initialValue),An(Me,Ke),J()&&se.commit(Me);return}const st=rt.current.find(Dt=>$a(Dt,_).toLowerCase()===Me.toLowerCase());st!=null&&(ne(st!==W.initialValue),Wo?.(st,Ke),J()&&se.commit(st))}v?It():(vr(),queueMicrotask(It))}}),id:ae&&Li==null?`${ae}-hidden-input`:void 0,name:Li,autoComplete:V,disabled:gt,required:p&&!xr,readOnly:f,value:yr,ref:xo,style:Li?sZ:L0,tabIndex:-1,"aria-hidden":!0}),Xn]});return h.jsx($0.Provider,{value:Ve,children:h.jsx(G0.Provider,{value:Yn,children:h.jsx(H0.Provider,{value:kn,children:h.jsx(W0.Provider,{value:Ae,children:Pa})})})})}const XD={...fJ,...wJ,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function NJ(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const i=parseFloat(n.width)||0,s=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,a),c=Math.max(t.height,s,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const ic=2,ZD=b.forwardRef(function(t,n){const{render:r,className:o,nativeButton:i=!0,disabled:s=!1,id:a,...l}=t,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:p,validation:g}=bu(),{labelId:m}=U0(),v=Hn(),{filteredItems:y}=Ii(),x=me(v,be.selectionMode),w=me(v,be.disabled),C=me(v,be.readOnly),S=me(v,be.required),R=me(v,be.mounted),I=me(v,be.popupSide),T=me(v,be.positionerElement),_=me(v,be.listElement),$=me(v,be.triggerProps),A=me(v,be.triggerElement),M=me(v,be.inputInsidePopup),N=me(v,be.id),B=me(v,be.open),j=me(v,be.selectedValue),D=me(v,be.activeIndex),V=me(v,be.selectedIndex),G=me(v,be.hasSelectedValue),z=_f(),H=z0(),ne=ns(),W=c||w||s,J=y.length===0,K=R&&T?I:null;qD({id:M?a:void 0});const U=M?a??N:a,oe=b.useRef("");function X(Y){oe.current=Y.pointerType}const te=z.useState("domReferenceElement");b.useEffect(()=>{M&&A&&A!==te&&z.set("domReferenceElement",A)},[A,te,z,M]);const{reference:Q}=rJ(z,{enabled:!B&&!C&&!w&&x==="single",listRef:v.state.labelsRef,activeIndex:D,selectedIndex:V,onMatch(Y){const le=v.state.valuesRef.current[Y];le!==void 0&&v.state.setSelectedValue(le,Qe("none"))}}),{reference:se}=DD(z,{enabled:!C&&!w,event:"mousedown"}),{buttonRef:ae,getButtonProps:L}=Af({native:i,disabled:W}),Z={...u,open:B,disabled:W,popupSide:K,listEmpty:J,placeholder:!G},k=ke(Y=>{v.set("triggerElement",Y)});return Dn("button",t,{ref:[n,ae,k],state:Z,props:[$,se,Q,{id:U,tabIndex:M?0:-1,role:M?"combobox":void 0,"aria-expanded":B?"true":"false","aria-haspopup":M?"dialog":"listbox","aria-controls":B?_?.id:void 0,"aria-required":M&&S||void 0,"aria-labelledby":m,onPointerDown:X,onPointerEnter:X,onFocus(){f(!0),!(W||C)&&ne.start(0,v.state.forceMount)},onBlur(Y){if(!ft(T,Y.relatedTarget)&&(d(!0),f(!1),p==="onBlur")){const le=x==="none"?H:j;g.commit(le)}},onMouseDown(Y){if(W||C||(M||z.set("domReferenceElement",Y.currentTarget),v.state.forceMount(),oe.current!=="touch"&&(v.state.inputRef.current?.focus(),M||Y.preventDefault()),B))return;const le=Wt(Y.currentTarget);function pe(re){if(!A)return;const fe=Pn(re),de=v.state.positionerElement,ve=v.state.listElement;if(ft(A,fe)||ft(de,fe)||ft(ve,fe)||fe===A)return;const we=NJ(A),Se=re.clientX>=we.left-ic&&re.clientX<=we.right+ic,Ye=re.clientY>=we.top-ic&&re.clientY<=we.bottom+ic;Se&&Ye||v.state.setOpen(!1,Qe("cancel-open",re))}M&&le.addEventListener("mouseup",pe,{once:!0})},onKeyDown(Y){W||C||(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Tt(Y),v.state.setOpen(!0,Qe(dl,Y.nativeEvent)),v.state.inputRef.current?.focus())}},g?g.getValidationProps(l):l,L],stateAttributesMapping:XD})});process.env.NODE_ENV!=="production"&&(ZD.displayName="ComboboxTrigger");const Y0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Y0.displayName="ComboboxChipsContext");function JD(){return b.useContext(Y0)}const X0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(X0.displayName="ComboboxPositionerContext");function Z0(e){const t=b.useContext(X0);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":Fr(21));return t}const J0=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,id:s,...a}=t,{state:l,disabled:u,setTouched:c,setFocused:d,validationMode:f,validation:p}=bu(),{labelId:g}=U0(),m=JD(),y=!!Z0(!0),x=Hn(),{filteredItems:w}=Ii(),C=z0(),S=JM(),R=me(x,be.required),I=me(x,be.disabled),T=me(x,be.readOnly),_=me(x,be.name),$=me(x,be.selectionMode),A=me(x,be.autoHighlight),M=me(x,be.inputProps),N=me(x,be.triggerProps),B=me(x,be.open),j=me(x,be.mounted),D=me(x,be.selectedValue),V=me(x,be.popupSide),G=me(x,be.positionerElement),z=me(x,be.id),H=me(x,be.inline),ne=!!A,W=j&&G?V:null,J=u||I||i,K=w.length===0,oe=oD(s??(y||H?void 0:z)),[X,te]=b.useState(null),Q=b.useRef(!1),se=b.useRef(null),ae=b.useRef(!1),L=ke(Y=>{const le=y||x.state.inline;le&&!x.state.hasInputValue&&x.state.setInputValue("",Qe(tr)),x.update({inputElement:Y,inputInsidePopup:le})}),Z={...l,open:B,disabled:J,readOnly:T,popupSide:W,listEmpty:K};function k(Y){if(!m)return;let le;const{highlightedChipIndex:pe}=m;if(pe!==void 0){if(Y.key==="ArrowLeft")Y.preventDefault(),pe>0?le=pe-1:le=void 0;else if(Y.key==="ArrowRight")Y.preventDefault(),pe<D.length-1?le=pe+1:le=void 0;else if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault();const re=pe>=D.length-1?D.length-2:pe;le=re>=0?re:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return le}return Y.key==="ArrowLeft"&&(Y.currentTarget.selectionStart??0)===0&&D.length>0?(Y.preventDefault(),le=Math.max(D.length-1,0)):Y.key==="Backspace"&&Y.currentTarget.value===""&&D.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Y.preventDefault()),le}return Dn("input",t,{state:Z,ref:[n,x.state.inputRef,L],props:[M,N,{type:"text",value:t.value??X??C,"aria-readonly":T||void 0,"aria-required":R||void 0,"aria-labelledby":g,disabled:J,readOnly:T,required:$==="none"?R:void 0,...$==="none"&&_&&{name:_},id:oe,onFocus(){if(d(!0),!H||!ae.current)return;ae.current=!1;const Y=se.current;Y==null||!Object.hasOwn(x.state.valuesRef.current,Y)||x.state.setIndices({activeIndex:Y})},onBlur(){c(!0),d(!1);const Y=x.state.activeIndex;if(H&&Y!==null&&A!=="always"&&(se.current=Y,ae.current=!0,x.state.setIndices({activeIndex:null})),f==="onBlur"){const le=$==="none"?C:D;p.commit(le)}},onCompositionStart(Y){ld||(Q.current=!0,te(Y.currentTarget.value))},onCompositionEnd(Y){Q.current=!1;const le=Y.currentTarget.value;te(null),x.state.setInputValue(le,Qe(Ws,Y.nativeEvent))},onChange(Y){const le=Y.nativeEvent.inputType,pe=!le||le==="insertReplacementText",re=Q.current||!pe;if(Q.current){const we=Y.currentTarget.value;te(we),we===""&&!x.state.openOnInputClick&&!x.state.inputInsidePopup&&x.state.setOpen(!1,Qe(ei,Y.nativeEvent));const Se=we.trim(),Ye=ne&&Se!=="";!T&&!J&&Se&&re&&(x.state.setOpen(!0,Qe(Ws,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!Ye&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"});return}x.state.setInputValue(Y.currentTarget.value,Qe(Ws,Y.nativeEvent));const fe=Y.currentTarget.value==="",de=Qe(ei,Y.nativeEvent);fe&&!x.state.inputInsidePopup&&($==="single"&&x.state.setSelectedValue(null,de),x.state.openOnInputClick||x.state.setOpen(!1,de));const ve=Y.currentTarget.value.trim();!T&&!J&&ve&&re&&(x.state.setOpen(!0,Qe(Ws,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!ne&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Y){if(J||T||Y.ctrlKey||Y.shiftKey||Y.altKey||Y.metaKey)return;x.state.keyboardActiveRef.current=!0;const le=Y.currentTarget,pe=le.scrollWidth-le.clientWidth,re=S==="rtl";if(Y.key==="Home"){Tt(Y);const ve=DE&&re?le.value.length:0;le.setSelectionRange(ve,ve),le.scrollLeft=0;return}if(Y.key==="End"){Tt(Y);const ve=DE&&re?0:le.value.length;le.setSelectionRange(ve,ve),le.scrollLeft=re?-pe:pe;return}if(!j&&Y.key==="Escape"){const ve=$==="multiple"&&Array.isArray(D)?D.length===0:D===null,we=Qe(rD,Y.nativeEvent),Se=$==="multiple"?[]:null;x.state.setInputValue("",we),x.state.setSelectedValue(Se,we),!ve&&!x.state.inline&&!we.isPropagationAllowed&&Y.stopPropagation();return}if(m&&Y.key==="Backspace"&&le.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(D)&&D.length>0){const ve=D.slice(0,-1);x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),x.state.setSelectedValue(ve,Qe(tr,Y.nativeEvent));return}const fe=m?.highlightedChipIndex!==void 0,de=k(Y);if(m?.setHighlightedChipIndex(de),de!==void 0?m?.chipsRef.current[de]?.focus():fe&&x.state.inputRef.current?.focus(),Y.which!==229&&Y.key==="Enter"&&B){const ve=x.state.activeIndex,we=Y.nativeEvent;if(ve===null){x.state.setOpen(!1,Qe(tr,we));return}Tt(Y);const Se=x.state.listRef.current[ve];Se&&(x.state.selectionEventRef.current=we,Se.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(a):a],stateAttributesMapping:XD})});process.env.NODE_ENV!=="production"&&(J0.displayName="ComboboxInput");const OJ={..._0,...dJ},KD=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,keepMounted:a=!1,...l}=t,{disabled:u}=bu(),c=Hn(),d=me(c,be.selectionMode),f=me(c,be.disabled),p=me(c,be.readOnly),g=me(c,be.open),m=me(c,be.selectedValue),v=me(c,be.hasSelectionChips),y=z0();let x=!1;d==="none"?x=y!=="":d==="single"?x=m!=null:x=v;const w=u||f||i,{buttonRef:C,getButtonProps:S}=Af({native:s,disabled:w}),{mounted:R,transitionStatus:I,setMounted:T}=M0(x),_={disabled:w,open:g,transitionStatus:I};Nf({open:x,ref:c.state.clearRef,onComplete(){x||T(!1)}});const $=Dn("button",t,{state:_,ref:[n,C,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(M){M.preventDefault()},onClick(M){if(w||p)return;const N=c.state.keyboardActiveRef;c.state.setInputValue("",Qe(NE,M.nativeEvent)),d!=="none"?(c.state.setSelectedValue(Array.isArray(m)?[]:null,Qe(NE,M.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:N.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:N.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},l,S],stateAttributesMapping:OJ});return a||R?$:null});process.env.NODE_ENV!=="production"&&(KD.displayName="ComboboxClear");const QD=b.createContext(null);process.env.NODE_ENV!=="production"&&(QD.displayName="GroupCollectionContext");function PJ(){return b.useContext(QD)}function _J(e){const{children:t}=e,{filteredItems:n}=Ii(),r=PJ(),o=r?r.items:n;return o?h.jsx(b.Fragment,{children:o.map(t)}):null}const ek=b.forwardRef(function(t,n){var r;const{render:o,className:i,children:s,...a}=t,l=Hn(),u=_f(),c=!!Z0(!0),{filteredItems:d}=Ii(),f=me(l,be.items),p=me(l,be.labelsRef),g=me(l,be.listRef),m=me(l,be.selectionMode),v=me(l,be.grid),y=me(l,be.popupProps),x=me(l,be.disabled),w=me(l,be.readOnly),C=me(l,be.virtualized),S=m==="multiple",R=d.length===0,I=ke(N=>{l.set("positionerElement",N)}),T=ke(N=>{l.set("listElement",N)}),_=b.useMemo(()=>typeof s=="function"?r||(r=h.jsx(_J,{children:s})):s,[s]),$={empty:R},A=u.useState("floatingId"),M=Dn("div",t,{state:$,ref:[n,T,c?null:I],props:[y,{children:_,tabIndex:-1,id:A,role:v?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(N){if(!(x||w)&&N.key==="Enter"){const B=l.state.activeIndex;if(B==null)return;Tt(N);const j=N.nativeEvent,D=l.state.listRef.current[B];D&&(l.state.selectionEventRef.current=j,D.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return C?M:h.jsx(XM,{elementsRef:g,labelsRef:f?void 0:p,children:M})});process.env.NODE_ENV!=="production"&&(ek.displayName="ComboboxList");const K0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(K0.displayName="ComboboxPortalContext");function MJ(){const e=b.useContext(K0);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":Fr(20));return e}const tk=b.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,i=Hn(),s=me(i,be.mounted),a=me(i,be.forceMounted);return s||r||a?h.jsx(K0.Provider,{value:r,children:h.jsx(MD,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(tk.displayName="ComboboxPortal");const DJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:d="real"}=ro(e,t)||{};if(u==null)return{};const f=yy(c),p={x:n,y:r},g=$d(o),m=Vd(g),v=await s.getDimensions(u),y=g==="y",x=y?"top":"left",w=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[g]-p[g]-i.floating[m],R=p[g]-i.reference[g],I=d==="real"?await s.getOffsetParent?.(u):a.floating;let T=a.floating[C]||i.floating[m];(!T||!await s.isElement?.(I))&&(T=a.floating[C]||i.floating[m]);const _=S/2-R/2,$=T/2-v[m]/2-1,A=Math.min(f[x],$),M=Math.min(f[w],$),N=A,B=T-v[m]-M,j=T/2-v[m]/2+_,D=Bc(N,j,B),V=!l.arrow&&Fo(o)!=null&&j!==D&&i.reference[m]/2-(j<N?A:M)-v[m]/2<0,G=V?j<N?j-N:j-B:0;return{[g]:p[g]+G,data:{[g]:D,centerOffset:j-D-G,...V&&{alignmentOffset:G}},reset:V}}}),kJ=(e,t)=>({...DJ(e),options:[e,t]}),jJ={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await XT().fn(e)).data?.referenceHidden||i}}}},LJ={sideX:"left",sideY:"top"};function nk(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function nI(e,t,n){const{rects:r,placement:o}=e;return{side:nk(t,Fn(o),n),align:Fo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function FJ(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:C}=e,[S,R]=b.useState(null);!g&&S!==null&&R(null);const I=m.side||"flip",T=m.align||"flip",_=m.fallbackAxisSide||"end",$=typeof t=="function"?t:void 0,A=ke($),M=$?A:t,N=or(t),j=JM()==="rtl",D=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],V=i==="center"?D:`${D}-${i}`;let G=l;const z=1,H=r==="bottom"?z:0,ne=r==="top"?z:0,W=r==="right"?z:0,J=r==="left"?z:0;typeof G=="number"?G={top:G+H,right:G+J,bottom:G+ne,left:G+W}:G&&(G={top:(G.top||0)+H,right:(G.right||0)+J,bottom:(G.bottom||0)+ne,left:(G.left||0)+W});const K={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},U=b.useRef(null),oe=or(o),X=or(s),se=[WT(tt=>{const Ze=nI(tt,r,j),ee=typeof oe.current=="function"?oe.current(Ze):oe.current,ye=typeof X.current=="function"?X.current(Ze):X.current;return{mainAxis:ee,crossAxis:ye,alignmentAxis:ye}},[typeof o!="function"?o:0,typeof s!="function"?s:0,j,r])],ae=T==="none"&&I!=="shift",L=!ae&&(u||v||I==="shift"),Z=I==="none"?null:UT({...K,padding:{top:G.top+z,right:G.right+z,bottom:G.bottom+z,left:G.left+z},mainAxis:!v&&I==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),k=ae?null:zT(tt=>{const Ze=Wt(tt.elements.floating).documentElement;return{...K,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:L,limiter:u||v?void 0:qT(ee=>{if(!U.current)return{};const{width:ye,height:ge}=U.current.getBoundingClientRect(),xe=ar(Fn(ee.placement)),Ae=xe==="y"?ye:ge,Ie=xe==="y"?G.left+G.right:G.top+G.bottom;return{offset:Ae/2+Ie/2}})}},[K,u,v,G,T]);I==="shift"||T==="shift"||i==="center"?se.push(k,Z):se.push(Z,k),se.push(YT({...K,apply({elements:{floating:tt},rects:{reference:Ze},availableWidth:ee,availableHeight:ye}){const ge=tt.style;ge.setProperty("--available-width",`${ee}px`),ge.setProperty("--available-height",`${ye}px`),ge.setProperty("--anchor-width",`${Ze.width}px`),ge.setProperty("--anchor-height",`${Ze.height}px`)}}),kJ(()=>({element:U.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(tt){const{elements:Ze,middlewareData:ee,placement:ye,rects:ge,y:xe}=tt,Ae=Fn(ye),Ie=ar(Ae),qe=U.current,Pt=ee.arrow?.x||0,lt=ee.arrow?.y||0,it=qe?.clientWidth||0,_t=qe?.clientHeight||0,Et=Pt+it/2,sn=lt+_t/2,br=Math.abs(ee.shift?.y||0),zn=ge.reference.height/2,pn=typeof o=="function"?o(nI(tt,r,j)):o,Qt=br>pn,Ve={top:`${Et}px calc(100% + ${pn}px)`,bottom:`${Et}px ${-pn}px`,left:`calc(100% + ${pn}px) ${sn}px`,right:`${-pn}px ${sn}px`}[Ae],qn=`${Et}px ${ge.reference.y+zn-xe}px`;return Ze.floating.style.setProperty("--transform-origin",L&&Ie==="y"&&Qt?qn:Ve),{}}},jJ,x),Ge(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const ie=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Y,elements:le,x:pe,y:re,middlewareData:fe,update:de,placement:ve,context:we,isPositioned:Se,floatingStyles:Ye}=JZ({rootContext:p,placement:V,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...tt)=>Gc(...tt,ie),nodeId:y,externalTree:C}),{sideX:at,sideY:Xe}=fe.adaptiveOrigin||LJ,Ue=Se?n:"fixed",rt=b.useMemo(()=>{const tt=x?{position:Ue,[at]:pe,[Xe]:re}:{position:Ue,...Ye};return Se||(tt.opacity=0),tt},[x,Ue,at,pe,Xe,re,Ye,Se]),et=b.useRef(null);Ge(()=>{if(!g)return;const tt=N.current,Ze=typeof tt=="function"?tt():tt,ye=(rI(Ze)?Ze.current:Ze)||null||null;ye!==et.current&&(Y.setPositionReference(ye),et.current=ye)},[g,Y,M,N]),b.useEffect(()=>{if(!g)return;const tt=N.current;typeof tt!="function"&&rI(tt)&&tt.current!==et.current&&(Y.setPositionReference(tt.current),et.current=tt.current)},[g,Y,M,N]),b.useEffect(()=>{if(f&&g&&le.domReference&&le.floating)return Gc(le.domReference,le.floating,de,ie)},[f,g,le,de,ie]);const gt=Fn(ve),ct=nk(r,gt,j),ot=Fo(ve)||"center",mt=!!fe.hide?.referenceHidden;Ge(()=>{w&&g&&Se&&R(gt)},[w,g,Se,gt]);const Ot=b.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Bt=fe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:rt,arrowStyles:Ot,arrowRef:U,arrowUncentered:Bt,side:ct,align:ot,physicalSide:gt,anchorHidden:mt,refs:Y,context:we,isPositioned:Se,update:de}),[rt,Ot,U,Bt,ct,ot,gt,mt,Y,we,Se,de])}function rI(e){return e!=null&&"current"in e}function rk(e){return e==="starting"?n7:En}const ok=b.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=o7,...y}=t,x=Hn(),{filteredItems:w}=Ii(),C=_f(),S=MJ(),R=me(x,be.modal),I=me(x,be.open),T=me(x,be.mounted),_=me(x,be.openMethod),$=me(x,be.triggerElement),A=me(x,be.inputElement),M=me(x,be.inputInsidePopup),N=me(x,be.transitionStatus),B=w.length===0,D=FJ({anchor:i??(M?$:A),floatingRootContext:C,positionMethod:s,mounted:T,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:v,lazyFlip:!0});rZ(I&&R&&_!=="touch",$);const V=b.useMemo(()=>{const W={...D.positionerStyles};return I||(W.pointerEvents="none"),{role:"presentation",hidden:!T,style:W}},[I,T,D.positionerStyles]),G={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:B};Ge(()=>{x.set("popupSide",D.side)},[x,D.side]);const z=b.useMemo(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,anchorHidden:D.anchorHidden,isPositioned:D.isPositioned}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.anchorHidden,D.isPositioned]),H=ke(W=>{x.set("positionerElement",W)}),ne=Dn("div",t,{state:G,ref:[n,H],props:[V,rk(N),y],stateAttributesMapping:BD});return h.jsxs(X0.Provider,{value:z,children:[T&&R&&h.jsx(VD,{inert:pJ(!I),cutout:A??$}),ne]})});process.env.NODE_ENV!=="production"&&(ok.displayName="ComboboxPositioner");const BJ={...BD,..._0},ik=b.forwardRef(function(t,n){const{render:r,className:o,initialFocus:i,finalFocus:s,...a}=t,l=Hn(),u=Z0(),c=_f(),{filteredItems:d}=Ii(),f=me(l,be.mounted),p=me(l,be.open),g=me(l,be.openMethod),m=me(l,be.transitionStatus),v=me(l,be.inputInsidePopup),y=me(l,be.inputElement),x=d.length===0;Nf({open:p,ref:l.state.popupRef,onComplete(){p&&l.state.onOpenChangeComplete(!0)}});const w={open:p,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:m,empty:x},C=Dn("div",t,{state:w,ref:[n,l.state.popupRef],props:[{role:v?"dialog":"presentation",tabIndex:-1,onFocus(T){const _=Pn(T.nativeEvent);g!=="touch"&&(ft(l.state.listElement,_)||_===T.currentTarget)&&l.state.inputRef.current?.focus()}},rk(m),a],stateAttributesMapping:BJ}),R=i===void 0?v?T=>T==="touch"?l.state.popupRef.current:y:!1:i;let I;return s!=null?I=s:I=v?void 0:!1,h.jsx(mZ,{context:c,disabled:!f,modal:!v,openInteractionType:g,initialFocus:R,returnFocus:I,children:C})});process.env.NODE_ENV!=="production"&&(ik.displayName="ComboboxPopup");const Q0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Q0.displayName="ComboboxItemContext");function sk(){const e=b.useContext(Q0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.":Fr(19));return e}const ak=b.createContext(!1);process.env.NODE_ENV!=="production"&&(ak.displayName="ComboboxRowContext");function VJ(){return b.useContext(ak)}const lk=b.memo(b.forwardRef(function(t,n){const{render:r,className:o,value:i=null,index:s,disabled:a=!1,nativeButton:l=!1,...u}=t,c=b.useRef(!1),d=b.useRef(null),f=aD({index:s,textRef:d,indexGuessBehavior:sD.GuessFromOrder}),p=Hn(),g=VJ(),{flatFilteredItems:m,hasItems:v}=Ii(),y=me(p,be.open),x=me(p,be.selectionMode),w=me(p,be.readOnly),C=me(p,be.virtualized),S=me(p,be.isItemEqualToValue),R=x!=="none",I=s??(C?gd(m,i,S):f.index),T=f.index!==-1,_=me(p,be.id),$=me(p,be.isActive,I),A=me(p,be.isSelected,i),M=me(p,be.getItemProps),N=b.useRef(null),B=_!=null&&T?`${_}-${I}`:void 0,j=A&&R;Ge(()=>{if(!(T&&(C||s!=null)))return;const U=p.state.listRef.current;return U[I]=N.current,()=>{delete U[I]}},[T,C,I,s,p]),Ge(()=>{if(!T||v)return;const K=p.state.valuesRef.current;return K[I]=i,x!=="none"&&p.state.allValuesRef.current.push(i),()=>{delete K[I]}},[T,v,I,i,p,x]),Ge(()=>{if(!y){c.current=!1;return}if(!T||v)return;const K=p.state.selectedValue,U=Array.isArray(K)?K[K.length-1]:K;rs(i,U,S)&&p.set("selectedIndex",I)},[T,v,y,p,I,i,S]);const D={disabled:a,selected:j,highlighted:$},V=M({active:$,selected:j});V.id=void 0,V.onFocus=void 0;const{getButtonProps:G,buttonRef:z}=Af({disabled:a,focusableWhenDisabled:!0,native:l});function H(K){function U(){p.state.handleSelection(K,i)}p.state.submitOnItemClick?(so.flushSync(U),p.state.requestSubmit()):U()}const ne={id:B,role:g?"gridcell":"option","aria-selected":R?j:void 0,tabIndex:void 0,onPointerDownCapture(K){c.current=!0,K.preventDefault()},onClick(K){a||w||H(K.nativeEvent)},onMouseUp(K){const U=c.current;c.current=!1,!(a||w||K.button!==0||U||!$)&&H(K.nativeEvent)}},W=Dn("div",t,{ref:[z,n,f.ref,N],state:D,props:[V,ne,u,G]}),J=b.useMemo(()=>({selected:j,textRef:d}),[j,d]);return h.jsx(Q0.Provider,{value:J,children:W})}));process.env.NODE_ENV!=="production"&&(lk.displayName="ComboboxItem");const uk=b.forwardRef(function(t,n){const{render:r,className:o,children:i,...s}=t,{filteredItems:a}=Ii(),l=Hn(),u=a.length===0?i:null;return Dn("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});process.env.NODE_ENV!=="production"&&(uk.displayName="ComboboxEmpty");const ck=b.forwardRef(function(t,n){const{className:r,render:o,orientation:i="horizontal",...s}=t;return Dn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},s]})});process.env.NODE_ENV!=="production"&&(ck.displayName="Separator");function $J(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...s}=e;return h.jsx(TJ,{...s,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function GJ(e){const{children:t,placeholder:n}=e,r=Hn(),o=me(r,be.itemToStringLabel),i=me(r,be.selectedValue),s=me(r,be.items),a=me(r,be.selectionMode)==="multiple",l=me(r,be.hasSelectedValue),u=!l&&n!=null&&t==null,c=me(r,be.hasNullItemLabel,u);let d=null;return typeof t=="function"?d=t(i):t!=null?d=t:!l&&n!=null&&!c?d=n:a&&Array.isArray(i)?d=yJ(i,s,o):d=$D(i,s,o),h.jsx(b.Fragment,{children:d})}const dk=b.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=sk();return r||o?h.jsx(fk,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(dk.displayName="ComboboxItemIndicator");const fk=b.memo(b.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=sk(),a=b.useRef(null),{transitionStatus:l,setMounted:u}=M0(s),d=Dn("span",e,{ref:[t,a],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:_0});return Nf({open:s,ref:a,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!=="production"&&(fk.displayName="Inner");const pk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Hn(),a=me(s,be.open),l=me(s,be.hasSelectionChips),[u,c]=b.useState(void 0);a&&u!==void 0&&c(void 0);const d=b.useRef([]),f=Dn("div",t,{ref:[n,s.state.chipsContainerRef],props:[l?{role:"toolbar"}:En,i]}),p=b.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:c,chipsRef:d}),[u,c,d]);return h.jsx(Y0.Provider,{value:p,children:h.jsx(XM,{elementsRef:d,children:f})})});process.env.NODE_ENV!=="production"&&(pk.displayName="ComboboxChips");const ex=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(ex.displayName="ComboboxChipContext");function HJ(){const e=b.useContext(ex);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":Fr(17));return e}const hk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Hn(),{setHighlightedChipIndex:a,chipsRef:l}=JD(),u=me(s,be.disabled),c=me(s,be.readOnly),d=me(s,be.selectedValue),{ref:f,index:p}=aD();function g(x){let w=p;if(x.key==="ArrowLeft")x.preventDefault(),p>0?w=p-1:w=void 0;else if(x.key==="ArrowRight")x.preventDefault(),p<d.length-1?w=p+1:w=void 0;else if(x.key==="Backspace"||x.key==="Delete"){const C=p>=d.length-1?d.length-2:p;w=C>=0?C:void 0,Tt(x),s.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),s.state.setSelectedValue(d.filter((S,R)=>R!==p),Qe(tr,x.nativeEvent))}else x.key==="Enter"||x.key===" "?(Tt(x),w=void 0):x.key==="ArrowDown"||x.key==="ArrowUp"?(Tt(x),s.state.setOpen(!0,Qe(dl,x.nativeEvent)),w=void 0):x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&(w=void 0);return w}const v=Dn("div",t,{ref:[n,f],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":c||void 0,onKeyDown(x){if(u||c)return;const w=g(x);so.flushSync(()=>{a(w)}),w===void 0?s.state.inputRef.current?.focus():l.current[w]?.focus()},onMouseDown(x){c||(x.preventDefault(),!u&&s.state.inputRef.current?.focus())}},i]}),y=b.useMemo(()=>({index:p}),[p]);return h.jsx(ex.Provider,{value:y,children:v})});process.env.NODE_ENV!=="production"&&(hk.displayName="ComboboxChip");const gk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,...a}=t,l=Hn(),{index:u}=HJ(),c=me(l,be.disabled),d=me(l,be.readOnly),f=me(l,be.selectedValue),p=me(l,be.isItemEqualToValue),g=c||i,{buttonRef:m,getButtonProps:v}=Af({native:s,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function x(S){const R=l.state.activeIndex;if(R==null)return;const I=gd(l.state.valuesRef.current,S,p);I!==-1&&R===I&&l.state.setIndices({activeIndex:null,type:l.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(S){const R=Qe(f7,S.nativeEvent),I=f[u];return x(I),l.state.setSelectedValue(f.filter((T,_)=>_!==u),R),l.state.inputRef.current?.focus(),R}return Dn("button",t,{ref:[n,m],state:y,props:[{tabIndex:-1,onClick(S){if(g||d)return;w(S).isPropagationAllowed||S.stopPropagation()},onKeyDown(S){g||d||(S.key==="Enter"||S.key===" ")&&(w(S).isPropagationAllowed||Tt(S))}},a,v]})});process.env.NODE_ENV!=="production"&&(gk.displayName="ComboboxChipRemove");function vu({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:F("ui:file:text-foreground ui:placeholder:text-muted-foreground ui:selection:bg-primary ui:selection:text-primary-foreground ui:dark:bg-input/30 ui:border-input ui:h-10 ui:w-full ui:min-w-0 ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-1 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:file:inline-flex ui:file:h-7 ui:file:border-0 ui:file:bg-transparent ui:file:text-sm ui:file:font-medium ui:disabled:pointer-events-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm","ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:focus-visible:ring-[3px]","ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive",e),...n})}function mk({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:F("ui:border-input ui:placeholder:text-muted-foreground ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:dark:bg-input/30 ui:flex ui:field-sizing-content ui:min-h-16 ui:w-full ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-2 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm",e),...t})}function WJ({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:F("ui:group/input-group ui:border-input ui:dark:bg-input/30 ui:relative ui:flex ui:w-full ui:items-center ui:rounded-md ui:border ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none","ui:h-9 ui:min-w-0 ui:has-[>textarea]:h-auto","ui:has-[>[data-align=inline-start]]:[&>input]:pl-2","ui:has-[>[data-align=inline-end]]:[&>input]:pr-2","ui:has-[>[data-align=block-start]]:h-auto ui:has-[>[data-align=block-start]]:flex-col ui:has-[>[data-align=block-start]]:[&>input]:pb-3","ui:has-[>[data-align=block-end]]:h-auto ui:has-[>[data-align=block-end]]:flex-col ui:has-[>[data-align=block-end]]:[&>input]:pt-3","ui:has-[[data-slot=input-group-control]:focus-visible]:border-ring ui:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 ui:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","ui:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ui:has-[[data-slot][aria-invalid=true]]:border-destructive ui:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const zJ=Si("ui:text-muted-foreground ui:flex ui:h-auto ui:cursor-text ui:items-center ui:justify-center ui:gap-2 ui:py-1.5 ui:text-sm ui:font-medium ui:select-none ui:[&>svg:not([class*=size-])]:size-4 ui:[&>kbd]:rounded-[calc(var(--radius)-5px)] ui:group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"ui:order-first ui:pl-3 ui:has-[>button]:ml-[-0.45rem] ui:has-[>kbd]:ml-[-0.35rem]","inline-end":"ui:order-last ui:pr-3 ui:has-[>button]:mr-[-0.45rem] ui:has-[>kbd]:mr-[-0.35rem]","block-start":"ui:order-first ui:w-full ui:justify-start ui:px-3 ui:pt-3 ui:[.border-b]:pb-3 ui:group-has-[>input]/input-group:pt-2.5","block-end":"ui:order-last ui:w-full ui:justify-start ui:px-3 ui:pb-3 ui:[.border-t]:pt-3 ui:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function qJ({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:F(zJ({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const UJ=Si("ui:text-sm ui:shadow-none ui:flex ui:gap-2 ui:items-center",{variants:{size:{xs:"ui:h-6 ui:gap-1 ui:px-2 ui:rounded-[calc(var(--radius)-5px)] ui:[&>svg:not([class*=size-])]:size-3.5 ui:has-[>svg]:px-2",sm:"ui:h-8 ui:px-2.5 ui:gap-1.5 ui:rounded-md ui:has-[>svg]:px-2.5","icon-xs":"ui:size-6 ui:rounded-[calc(var(--radius)-5px)] ui:p-0 ui:has-[>svg]:p-0","icon-sm":"ui:size-8 ui:p-0 ui:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function bk({className:e,type:t="button",variant:n="ghost",size:r="xs",...o}){return h.jsx(Jt,{type:t,"data-size":r,variant:n,className:F(UJ({size:r}),e),...o})}function YJ({className:e,...t}){return h.jsx(vu,{"data-slot":"input-group-control",className:F("ui:flex-1 ui:rounded-none ui:border-0 ui:bg-transparent ui:shadow-none ui:focus-visible:ring-0 ui:dark:bg-transparent",e),...t})}const XJ=$J;function km({...e}){return h.jsx(GJ,{"data-slot":"combobox-value",...e})}function vk({className:e,children:t,...n}){return h.jsxs(ZD,{"data-slot":"combobox-trigger",className:F("ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(_e.ChevronDownIcon,{"data-slot":"combobox-trigger-icon",className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4"})]})}function ZJ({className:e,...t}){return h.jsx(KD,{"data-slot":"combobox-clear",render:h.jsx(bk,{variant:"ghost",size:"icon-xs",className:"ui:rounded-md"}),className:F(e),...t,children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})}function oI({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:o=!1,...i}){return h.jsxs(WJ,{className:F("ui:w-auto ui:shrink-0",e),children:[h.jsx(J0,{render:h.jsx(YJ,{disabled:n}),...i}),h.jsxs(qJ,{align:"inline-end",children:[r&&h.jsx(bk,{size:"icon-xs",variant:"ghost",asChild:!0,"data-slot":"input-group-button",className:"ui:group-has-data-[slot=combobox-clear]/input-group:hidden ui:data-pressed:bg-transparent",disabled:n,children:h.jsx(vk,{className:"ui:rounded-md"})}),o&&h.jsx(ZJ,{disabled:n})]}),t]})}function JJ({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:o=0,anchor:i,...s}){return h.jsx(tk,{children:h.jsx(ok,{side:t,sideOffset:n,align:r,alignOffset:o,anchor:i,className:"ui:isolate ui:z-50",children:h.jsx(ik,{"data-slot":"combobox-content","data-chips":!!i,className:F("ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:flex ui:min-h-0 ui:max-h-96 ui:flex-col ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",e),...s})})})}function KJ({className:e,...t}){return h.jsx(ek,{"data-slot":"combobox-list",className:F("ui:min-h-0 ui:flex-1 ui:overflow-y-auto ui:scroll-py-1 ui:p-1 ui:data-empty:p-0",e),...t})}function QJ({className:e,children:t,...n}){return h.jsxs(lk,{"data-slot":"combobox-item",className:F("ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(dk,{"data-slot":"combobox-item-indicator",render:h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center"}),children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4 ui:pointer-coarse:size-5"})})]})}function eK({className:e,...t}){return h.jsx(uk,{"data-slot":"combobox-empty",className:F("ui:hidden ui:w-full ui:shrink-0 ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:text-muted-foreground ui:group-data-empty/combobox-content:flex",e),...t})}function tK({className:e,...t}){return h.jsx(ck,{"data-slot":"combobox-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function nK({className:e,...t}){return h.jsx(pk,{"data-slot":"combobox-chips",className:F("ui:dark:bg-input/30 ui:border-input ui:focus-within:border-ring ui:focus-within:ring-ring/50 ui:has-aria-invalid:ring-destructive/20 ui:dark:has-aria-invalid:ring-destructive/40 ui:has-aria-invalid:border-destructive ui:dark:has-aria-invalid:border-destructive/50 ui:flex ui:min-h-9 ui:flex-wrap ui:items-center ui:gap-1.5 ui:rounded-md ui:border ui:bg-transparent ui:bg-clip-padding ui:px-2.5 ui:py-1.5 ui:text-sm ui:shadow-xs ui:transition-[color,box-shadow] ui:focus-within:ring-[3px] ui:has-aria-invalid:ring-[3px] ui:has-data-[slot=combobox-chip]:px-1.5",e),...t})}function rK({className:e,children:t,showRemove:n=!0,...r}){return h.jsxs(hk,{"data-slot":"combobox-chip",className:F("ui:bg-muted ui:text-foreground ui:flex ui:h-[calc(--spacing(5.5))] ui:w-fit ui:items-center ui:justify-center ui:gap-1 ui:rounded-sm ui:px-1.5 ui:text-xs ui:font-medium ui:whitespace-nowrap ui:has-disabled:pointer-events-none ui:has-disabled:cursor-not-allowed ui:has-disabled:opacity-50 ui:has-data-[slot=combobox-chip-remove]:pr-0",e),...r,children:[t,n&&h.jsx(gk,{render:h.jsx(Jt,{variant:"ghost",size:"xs",className:"ui:hover:bg-transparent"}),className:"ui:-ml-1 ui:opacity-50 ui:hover:opacity-100","data-slot":"combobox-chip-remove",children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})]})}function oK({className:e,...t}){return h.jsx(J0,{"data-slot":"combobox-chip-input",className:F("ui:min-w-16 ui:flex-1 ui:outline-none",e),...t})}function iK(){return b.useRef(null)}const sK=e=>e.label,aK=(e,t)=>e.value===t.value,tx=({items:e,label:t,multiple:n=!1,hasClearButton:r=!1,disabled:o=!1,placeholder:i="Select...",containerClassName:s,emptyMessage:a="No results found.",hasAllOption:l=!1,allOptionLabel:u="All",inputMode:c="input",renderPopupTrigger:d,onInputChange:f,value:p,onValueChange:g})=>{const m=iK(),v=p??[],y=O.useMemo(()=>e.filter(R=>!R.disabled),[e]),x=n&&v.length===y.length&&y.length>0,w=O.useCallback(()=>{const I=v.length===y.length&&y.length>0?[]:y;g(I)},[y,v.length,g]),C=O.useCallback(R=>{Array.isArray(R)?g(R):g(R===null?[]:[R])},[g]),S=O.useCallback(R=>{f?.(R.target.value)},[f]);return h.jsxs("article",{className:s,children:[t&&h.jsx(mr,{className:"ui:mb-2",children:t}),h.jsxs(XJ,{multiple:n,autoHighlight:!0,items:e,itemToStringValue:sK,isItemEqualToValue:aK,disabled:o,value:n?v:v[0]??null,onValueChange:C,children:[h.jsxs(In,{children:[h.jsx(Vt,{condition:c==="popup",children:h.jsx(vk,{render:d?d(h.jsx(km,{placeholder:i}),v):h.jsx(Jt,{variant:"outline",className:"ui:w-full ui:font-normal ui:text-left ui:overflow-hidden ui:truncate ui:line-clamp-1",children:h.jsx(km,{placeholder:i})})})}),h.jsx(Vt,{condition:n&&c==="input",children:h.jsx(nK,{ref:m,className:"ui:w-full",children:h.jsx(km,{children:R=>h.jsxs(O.Fragment,{children:[R.map(I=>h.jsx(rK,{children:I.label},I.value)),h.jsx(oK,{placeholder:R.length?"":i,onChange:S})]})})})}),h.jsx(Vt,{condition:!n&&c==="input",children:h.jsx(oI,{className:"ui:w-full",placeholder:i,showClear:r,disabled:o,onChange:S})})]}),h.jsxs(JJ,{className:"ui:min-w-64",anchor:m&&n&&c==="input"?m:void 0,children:[c==="popup"&&h.jsx(oI,{showTrigger:!1,placeholder:"Search...",onChange:S}),h.jsx(eK,{children:a}),l&&n&&h.jsxs("div",{className:"ui:shrink-0 ui:group-data-empty/combobox-content:hidden",children:[h.jsx("div",{className:F("ui:p-1 ui:pb-0",c==="popup"?"ui:mt-1":""),children:h.jsxs("div",{role:"option","aria-selected":x,onClick:w,className:F("ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none","ui:hover:bg-accent ui:hover:text-accent-foreground"),children:[u,x&&h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center",children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4"})})]})}),h.jsx(tK,{})]}),h.jsx(KJ,{children:R=>h.jsx(QJ,{value:R,disabled:!!R?.disabled,children:R.label},R.value)})]})]})]})},lK="dd/MM/yyyy",uK=({date:e,format:t=lK})=>e?h.jsx(h.Fragment,{children:qi(e,t)}):null;function nx({...e}){return h.jsx(tG,{"data-slot":"popover",...e})}const Mf=b.forwardRef(({...e},t)=>h.jsx(yO,{"data-slot":"popover-trigger",ref:t,...e}));Mf.displayName=yO.displayName;const Df=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>h.jsx(nG,{children:h.jsx(xO,{ref:o,"data-slot":"popover-content",align:t,sideOffset:n,className:F("ui-lib-root ui:z-[102] ui:w-72 ui:rounded-md ui:border ui:bg-popover ui:p-4 ui:text-popover-foreground ui:shadow-md ui:outline-none ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",e),...r})}));Df.displayName=xO.displayName;const yk=b.forwardRef(({...e},t)=>h.jsx(vO,{"data-slot":"popover-anchor",ref:t,...e}));yk.displayName=vO.displayName;const xk=({start:e,end:t,onConfirm:n,className:r,triggerButtonClassName:o,label:i,placeholder:s,confirmLabel:a="Confirm",disabledCondition:l,dateLocale:u})=>{const[c,d]=O.useState(!1),[f,p]=O.useState(e&&t?{from:e,to:t}:void 0),g=()=>{!f?.from||!f?.to||(n({from:f.from,to:f.to}),d(!1))};return h.jsxs("div",{className:F("ui:grid ui:gap-2",r),children:[i&&h.jsx(mr,{children:i}),h.jsxs(nx,{open:c,onOpenChange:d,children:[h.jsx(Mf,{asChild:!0,children:h.jsxs(Jt,{id:"date",variant:"outline",className:F("ui:h-auto ui:text-muted-foreground ui:justify-start ui:text-left ui:font-normal",!f&&"ui:text-muted-foreground",o),children:[h.jsx(_e.Calendar,{className:"ui:h-4 ui:w-4"}),f?.from?f.to?h.jsxs(h.Fragment,{children:[qi(f.from,"LLL dd, y",{locale:u})," -",qi(f.to,"LLL dd, y",{locale:u})]}):qi(f.from,"LLL dd, y",{locale:u}):h.jsx("span",{children:s})]})}),h.jsxs(Df,{className:"ui:w-auto ui:p-0",align:"start",children:[h.jsx(e0,{mode:"range",defaultMonth:f?.from??new Date,selected:f,onSelect:p,numberOfMonths:2,disabled:l,locale:u}),h.jsx("div",{className:F("ui:px-3 ui:pb-4 ui:pt-2","ui:flex ui:justify-start ui:md:justify-end"),children:h.jsx(Jt,{variant:"success",onClick:g,className:"ui:w-full ui:md:w-max",children:a})})]})]})]})};function wk({value:e,onChange:t,className:n,inputClassName:r,name:o,placeholder:i,label:s}){const[a,l]=O.useState(e),u=O.useRef(null),c=O.useRef(t);O.useEffect(()=>{c.current=t},[t]);const d=O.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.length>=3?c.current(p):c.current("")},300)},[]),f=p=>{const g=decodeURIComponent(p);l(g),d(g)};return h.jsxs("search",{className:F("ui:w-full",n),children:[s&&h.jsx(mr,{htmlFor:o,className:"ui:leading-6 ui:w-full ui:mb-2",children:s}),h.jsx(vu,{type:"search",name:o,id:o,"data-test-id":o,placeholder:i,value:a,onChange:({target:p})=>f(p.value),className:F("ui:max-h-10",r),autoFocus:!0})]})}const cK=({banner:e,campaignName:t,isControlled:n,open:r,setOpen:o,imageClassName:i})=>h.jsxs(S0,{...n&&{open:r,onOpenChange:o},children:[!n&&h.jsx($M,{asChild:!0,children:h.jsx("div",{className:"ui:cursor-pointer",children:h.jsx("img",{className:F("ui:w-full ui:max-w-80 ui:mx-auto ui:mt-4! ui:scale-100 ui:hover:scale-110 ui:transition-all ui:duration-300 ui:aspect-video",i),src:e,alt:t})})}),h.jsxs(E0,{className:"ui:max-w-2xl",children:[h.jsx(I0,{children:h.jsx(R0,{children:t})}),h.jsx("img",{className:F("ui:w-full ui:aspect-video",i),src:e,alt:t})]})]});function dK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const Ck=O.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),yu=()=>{const e=O.useContext(Ck);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};dK(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
87
87
  [data-state=closed]
88
- ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function fK(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function pK(){return rx(/^Mac/)}function hK(){return rx(/^iPhone/)}function iI(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function gK(){return rx(/^iPad/)||pK()&&navigator.maxTouchPoints>1}function Sk(){return hK()||gK()}function rx(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const mK=24,bK=typeof window<"u"?O.useLayoutEffect:O.useEffect;function sI(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const jm=typeof document<"u"&&window.visualViewport;function aI(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Ek(e){for(aI(e)&&(e=e.parentElement);e&&!aI(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const vK=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let sc=0,Lm;function yK(e={}){let{isDisabled:t}=e;bK(()=>{if(!t)return sc++,sc===1&&Sk()&&(Lm=xK()),()=>{sc--,sc===0&&Lm?.()}},[t])}function xK(){let e,t=0,n=d=>{e=Ek(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&f>t||p>=g&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;bv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;bv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",jm&&(jm.height<window.innerHeight?requestAnimationFrame(()=>{lI(f)}):jm.addEventListener("resize",()=>lI(f),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,u=sI(wK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let c=sI(Ga(document,"touchstart",n,{passive:!1,capture:!0}),Ga(document,"touchmove",r,{passive:!1,capture:!0}),Ga(document,"touchend",o,{passive:!1,capture:!0}),Ga(document,"focus",i,!0),Ga(window,"scroll",s));return()=>{u(),c(),window.scrollTo(a,l)}}function wK(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ga(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function lI(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Ek(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+mK;i>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function bv(e){return e instanceof HTMLInputElement&&!vK.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function CK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function SK(...e){return t=>e.forEach(n=>CK(n,t))}function Ik(...e){return b.useCallback(SK(...e),e)}const Rk=new WeakMap;function nn(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Rk.set(e,r)}function EK(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Rk.get(e);n&&(e.style[t]=n[t])}const Yt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ac(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Yt(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Yt(t)?5:4]):null)}function IK(e){return 8*(Math.log(e+1)-2)}function Fm(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function RK(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const kt={DURATION:.5,EASE:[.32,.72,0,1]},Ak=.4,AK=.25,TK=100,Tk=8,Gi=16,vv=26,Bm="vaul-dragging";function Nk(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function NK({defaultProp:e,onChange:t}){const n=O.useState(e),[r]=n,o=O.useRef(r),i=Nk(t);return O.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Ok({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=NK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Nk(n),l=O.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function OK({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:s,direction:a="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=Ok({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=O.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);O.useEffect(()=>{function I(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const g=O.useMemo(()=>c===n?.[n.length-1]||null,[n,c]),m=O.useMemo(()=>{var I;return(I=n?.findIndex(T=>T===c))!=null?I:null},[n,c]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,y=O.useMemo(()=>{const I=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n?.map(_=>{const $=typeof _=="string";let A=0;if($&&(A=parseInt(_,10)),Yt(a)){const N=$?A:f?_*I.height:0;return f?a==="bottom"?I.height-N:-I.height+N:N}const M=$?A:f?_*I.width:0;return f?a==="right"?I.width-M:-I.width+M:M}))!=null?T:[]},[n,f,l]),x=O.useMemo(()=>m!==null?y?.[m]:null,[y,m]),w=O.useCallback(I=>{var T;const _=(T=y?.findIndex($=>$===I))!=null?T:null;s(_),nn(r.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Yt(a)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`}),y&&_!==y.length-1&&i!==void 0&&_!==i&&_<i?nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"0"}):nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(_,0)])},[r.current,n,y,i,o,d]);O.useEffect(()=>{if(c||e){var I;const T=(I=n?.findIndex(_=>_===e||_===c))!=null?I:-1;y&&T!==-1&&typeof y[T]=="number"&&w(y[T])}},[c,e,n,y,w]);function C({draggedDistance:I,closeDrawer:T,velocity:_,dismissible:$}){if(i===void 0)return;const A=a==="bottom"||a==="right"?(x??0)-I:(x??0)+I,M=m===i-1,N=m===0,B=I>0;if(M&&nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),!u&&_>2&&!B){$?T():w(y[0]);return}if(!u&&_>2&&B&&y&&n){w(y[n.length-1]);return}const j=y?.reduce((V,G)=>typeof V!="number"||typeof G!="number"?V:Math.abs(G-A)<Math.abs(V-A)?G:V),D=Yt(a)?window.innerHeight:window.innerWidth;if(_>Ak&&Math.abs(I)<D*.4){const V=B?1:-1;if(V>0&&g&&n){w(y[n.length-1]);return}if(N&&V<0&&$&&T(),m===null)return;w(y[m+V]);return}w(j)}function S({draggedDistance:I}){if(x===null)return;const T=a==="bottom"||a==="right"?x-I:x+I;(a==="bottom"||a==="right")&&T<y[y.length-1]||(a==="top"||a==="left")&&T>y[y.length-1]||nn(r.current,{transform:Yt(a)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function R(I,T){if(!n||typeof m!="number"||!y||i===void 0)return null;const _=m===i-1;if(m>=i&&T)return 0;if(_&&!T)return 1;if(!v&&!_)return null;const A=_?m+1:m-1,M=_?y[A]-y[A-1]:y[A+1]-y[A],N=I/Math.abs(M);return _?1-N:N}return{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:R,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:C,onDrag:S,snapPointsOffset:y}}const PK=()=>()=>{};function _K(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=yu(),i=O.useRef(null),s=O.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-vv)/window.innerWidth}O.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;RK(r&&!o?Fm(document.body,{background:"black"}):PK,Fm(l,{transformOrigin:Yt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`}));const u=Fm(l,{borderRadius:`${Tk}px`,overflow:"hidden",...Yt(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},kt.DURATION*1e3)}}},[t,n,s])}let Ha=null;function MK({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[s,a]=O.useState(()=>typeof window<"u"?window.location.href:""),l=O.useRef(0),u=O.useCallback(()=>{if(iI()&&Ha===null&&e&&!i){Ha={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&l.current>=f&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),c=O.useCallback(()=>{if(iI()&&Ha!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ha),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),Ha=null}},[s]);return O.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),O.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),O.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,r,s,t,n,u,c]),{restorePositionSetting:c}}function DK({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=AK,scrollLockTimeout:u=TK,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:x,noBodyStyles:w=!1,direction:C="bottom",defaultOpen:S=!1,disablePreventScroll:R=!0,snapToSequentialPoint:I=!1,preventScrollRestoration:T=!1,repositionInputs:_=!0,onAnimationEnd:$,container:A,autoFocus:M=!1}){var N,B;const[j=!1,D]=Ok({defaultProp:S,prop:e,onChange:ee=>{t?.(ee),!ee&&!x&&Xe(),setTimeout(()=>{$?.(ee)},kt.DURATION*1e3),ee&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[V,G]=O.useState(!1),[z,H]=O.useState(!1),[ne,W]=O.useState(!1),J=O.useRef(null),K=O.useRef(null),U=O.useRef(null),oe=O.useRef(null),X=O.useRef(null),te=O.useRef(!1),Q=O.useRef(null),se=O.useRef(0),ae=O.useRef(!1),L=O.useRef(!S),Z=O.useRef(0),k=O.useRef(null),ie=O.useRef(((N=k.current)==null?void 0:N.getBoundingClientRect().height)||0),Y=O.useRef(((B=k.current)==null?void 0:B.getBoundingClientRect().width)||0),le=O.useRef(0),pe=O.useCallback(ee=>{i&&ee===we.length-1&&(K.current=new Date)},[]),{activeSnapPoint:re,activeSnapPointIndex:fe,setActiveSnapPoint:de,onRelease:ve,snapPointsOffset:we,onDrag:Se,shouldFade:Ye,getPercentageDragged:at}=OK({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:k,fadeFromIndex:f,overlayRef:J,onSnapPointChange:pe,direction:C,container:A,snapToSequentialPoint:I});yK({isDisabled:!j||z||!v||ne||!V||!_||!R});const{restorePositionSetting:Xe}=MK({isOpen:j,modal:v,nested:x??!1,hasBeenOpened:V,preventScrollRestoration:T,noBodyStyles:w});function Ue(){return(window.innerWidth-vv)/window.innerWidth}function rt(ee){var ye,ge;!c&&!i||k.current&&!k.current.contains(ee.target)||(ie.current=((ye=k.current)==null?void 0:ye.getBoundingClientRect().height)||0,Y.current=((ge=k.current)==null?void 0:ge.getBoundingClientRect().width)||0,H(!0),U.current=new Date,Sk()&&window.addEventListener("touchend",()=>te.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),se.current=Yt(C)?ee.pageY:ee.pageX)}function et(ee,ye){var ge;let xe=ee;const Ae=(ge=window.getSelection())==null?void 0:ge.toString(),Ie=k.current?ac(k.current,C):null,qe=new Date;if(xe.tagName==="SELECT"||xe.hasAttribute("data-vaul-no-drag")||xe.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(K.current&&qe.getTime()-K.current.getTime()<500)return!1;if(Ie!==null&&(C==="bottom"?Ie>0:Ie<0))return!0;if(Ae&&Ae.length>0)return!1;if(X.current&&qe.getTime()-X.current.getTime()<u&&Ie===0||ye)return X.current=qe,!1;for(;xe;){if(xe.scrollHeight>xe.clientHeight){if(xe.scrollTop!==0)return X.current=new Date,!1;if(xe.getAttribute("role")==="dialog")return!0}xe=xe.parentNode}return!0}function gt(ee){if(k.current&&z){const ye=C==="bottom"||C==="right"?1:-1,ge=(se.current-(Yt(C)?ee.pageY:ee.pageX))*ye,xe=ge>0,Ae=i&&!c&&!xe;if(Ae&&fe===0)return;const Ie=Math.abs(ge),qe=document.querySelector("[data-vaul-drawer-wrapper]"),Pt=C==="bottom"||C==="top"?ie.current:Y.current;let lt=Ie/Pt;const it=at(Ie,xe);if(it!==null&&(lt=it),Ae&&lt>=1||!te.current&&!et(ee.target,xe))return;if(k.current.classList.add(Bm),te.current=!0,nn(k.current,{transition:"none"}),nn(J.current,{transition:"none"}),i&&Se({draggedDistance:ge}),xe&&!i){const Et=IK(ge),sn=Math.min(Et*-1,0)*ye;nn(k.current,{transform:Yt(C)?`translate3d(0, ${sn}px, 0)`:`translate3d(${sn}px, 0, 0)`});return}const _t=1-lt;if((Ye||f&&fe===f-1)&&(r?.(ee,lt),nn(J.current,{opacity:`${_t}`,transition:"none"},!0)),qe&&J.current&&s){const Et=Math.min(Ue()+lt*(1-Ue()),1),sn=8-lt*8,br=Math.max(0,14-lt*14);nn(qe,{borderRadius:`${sn}px`,transform:Yt(C)?`scale(${Et}) translate3d(0, ${br}px, 0)`:`scale(${Et}) translate3d(${br}px, 0, 0)`,transition:"none"},!0)}if(!i){const Et=Ie*ye;nn(k.current,{transform:Yt(C)?`translate3d(0, ${Et}px, 0)`:`translate3d(${Et}px, 0, 0)`})}}}O.useEffect(()=>{window.requestAnimationFrame(()=>{L.current=!0})},[]),O.useEffect(()=>{var ee;function ye(){if(!k.current||!_)return;const ge=document.activeElement;if(bv(ge)||ae.current){var xe;const Ae=((xe=window.visualViewport)==null?void 0:xe.height)||0,Ie=window.innerHeight;let qe=Ie-Ae;const Pt=k.current.getBoundingClientRect().height||0,lt=Pt>Ie*.8;le.current||(le.current=Pt);const it=k.current.getBoundingClientRect().top;if(Math.abs(Z.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&we&&fe){const _t=we[fe]||0;qe+=_t}if(Z.current=qe,Pt>Ae||ae.current){const _t=k.current.getBoundingClientRect().height;let Et=_t;_t>Ae&&(Et=Ae-(lt?it:vv)),m?k.current.style.height=`${_t-Math.max(qe,0)}px`:k.current.style.height=`${Math.max(Et,Ae-it)}px`}else fK()||(k.current.style.height=`${le.current}px`);i&&i.length>0&&!ae.current?k.current.style.bottom="0px":k.current.style.bottom=`${Math.max(qe,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",ye),()=>{var ge;return(ge=window.visualViewport)==null?void 0:ge.removeEventListener("resize",ye)}},[fe,i,we]);function ct(ee){mt(),y?.(),ee||D(!1),setTimeout(()=>{i&&de(i[0])},kt.DURATION*1e3)}function ot(){if(!k.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),ye=ac(k.current,C);nn(k.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),nn(J.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),s&&ye&&ye>0&&j&&nn(ee,{borderRadius:`${Tk}px`,overflow:"hidden",...Yt(C)?{transform:`scale(${Ue()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ue()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`},!0)}function mt(){!z||!k.current||(k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date)}function Ot(ee){if(!z||!k.current)return;k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date;const ye=ac(k.current,C);if(!ee||!et(ee.target,!1)||!ye||Number.isNaN(ye)||U.current===null)return;const ge=oe.current.getTime()-U.current.getTime(),xe=se.current-(Yt(C)?ee.pageY:ee.pageX),Ae=Math.abs(xe)/ge;if(Ae>.05&&(W(!0),setTimeout(()=>{W(!1)},200)),i){ve({draggedDistance:xe*(C==="bottom"||C==="right"?1:-1),closeDrawer:ct,velocity:Ae,dismissible:c}),o?.(ee,!0);return}if(C==="bottom"||C==="right"?xe>0:xe<0){ot(),o?.(ee,!0);return}if(Ae>Ak){ct(),o?.(ee,!1);return}var Ie;const qe=Math.min((Ie=k.current.getBoundingClientRect().height)!=null?Ie:0,window.innerHeight);var Pt;const lt=Math.min((Pt=k.current.getBoundingClientRect().width)!=null?Pt:0,window.innerWidth),it=C==="left"||C==="right";if(Math.abs(ye)>=(it?lt:qe)*l){ct(),o?.(ee,!1);return}o?.(ee,!0),ot()}O.useEffect(()=>(j&&(nn(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{EK(document.documentElement,"scrollBehavior")}),[j]);function Bt(ee){const ye=ee?(window.innerWidth-Gi)/window.innerWidth:1,ge=ee?-Gi:0;Q.current&&window.clearTimeout(Q.current),nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Yt(C)?`scale(${ye}) translate3d(0, ${ge}px, 0)`:`scale(${ye}) translate3d(${ge}px, 0, 0)`}),!ee&&k.current&&(Q.current=setTimeout(()=>{const xe=ac(k.current,C);nn(k.current,{transition:"none",transform:Yt(C)?`translate3d(0, ${xe}px, 0)`:`translate3d(${xe}px, 0, 0)`})},500))}function tt(ee,ye){if(ye<0)return;const ge=(window.innerWidth-Gi)/window.innerWidth,xe=ge+ye*(1-ge),Ae=-Gi+ye*Gi;nn(k.current,{transform:Yt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`,transition:"none"})}function Ze(ee,ye){const ge=Yt(C)?window.innerHeight:window.innerWidth,xe=ye?(ge-Gi)/ge:1,Ae=ye?-Gi:0;ye&&nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Yt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`})}return O.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),O.createElement(Xl,{defaultOpen:S,onOpenChange:ee=>{!c&&!ee||(ee?G(!0):ct(!0),D(ee))},open:j},O.createElement(Ck.Provider,{value:{activeSnapPoint:re,snapPoints:i,setActiveSnapPoint:de,drawerRef:k,overlayRef:J,onOpenChange:t,onPress:rt,onRelease:Ot,onDrag:gt,dismissible:c,shouldAnimate:L,handleOnly:d,isOpen:j,isDragging:z,shouldFade:Ye,closeDrawer:ct,onNestedDrag:tt,onNestedOpenChange:Bt,onNestedRelease:Ze,keyboardIsOpen:ae,modal:v,snapPointsOffset:we,activeSnapPointIndex:fe,direction:C,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:w,container:A,autoFocus:M}},n))}const Pk=O.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:s,modal:a,shouldAnimate:l}=yu(),u=Ik(t,n),c=r&&r.length>0;if(!a)return null;const d=O.useCallback(f=>o(f),[o]);return O.createElement(Jl,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&c?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});Pk.displayName="Drawer.Overlay";const _k=O.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:s,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:x,autoFocus:w}=yu(),[C,S]=O.useState(!1),R=Ik(o,i),I=O.useRef(null),T=O.useRef(null),_=O.useRef(!1),$=m&&m.length>0;_K();const A=(N,B,j=0)=>{if(_.current)return!0;const D=Math.abs(N.y),V=Math.abs(N.x),G=V>D,z=["bottom","right"].includes(B)?1:-1;if(B==="left"||B==="right"){if(!(N.x*z<0)&&V>=0&&V<=j)return G}else if(!(N.y*z<0)&&D>=0&&D<=j)return!G;return _.current=!0,!0};O.useEffect(()=>{$&&window.requestAnimationFrame(()=>{S(!0)})},[]);function M(N){I.current=null,_.current=!1,a(N)}return O.createElement(Kl,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":p&&$?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[d??0]}px`,...t}:t,onPointerDown:N=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,N),I.current={x:N.pageX,y:N.pageY},s(N))},onOpenAutoFocus:N=>{n?.(N),w||N.preventDefault()},onPointerDownOutside:N=>{if(e?.(N),!f||N.defaultPrevented){N.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:N=>{if(!f){N.preventDefault();return}},onPointerMove:N=>{if(T.current=N,y||(r.onPointerMove==null||r.onPointerMove.call(r,N),!I.current))return;const B=N.pageY-I.current.y,j=N.pageX-I.current.x,D=N.pointerType==="touch"?10:2;A({x:j,y:B},g,D)?l(N):(Math.abs(j)>D||Math.abs(B)>D)&&(I.current=null)},onPointerUp:N=>{r.onPointerUp==null||r.onPointerUp.call(r,N),I.current=null,_.current=!1,a(N)},onPointerOut:N=>{r.onPointerOut==null||r.onPointerOut.call(r,N),M(T.current)},onContextMenu:N=>{r.onContextMenu==null||r.onContextMenu.call(r,N),T.current&&M(T.current)}})});_k.displayName="Drawer.Content";const kK=250,jK=120,LK=O.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:f,onDrag:p}=yu(),g=O.useRef(null),m=O.useRef(!1);function v(){if(m.current){w();return}window.setTimeout(()=>{y()},jK)}function y(){if(i||e||m.current){w();return}if(w(),!s||s.length===0){u||o();return}if(a===s[s.length-1]&&u){o();return}const S=s.findIndex(I=>I===a);if(S===-1)return;const R=s[S+1];l(R)}function x(){g.current=window.setTimeout(()=>{m.current=!0},kK)}function w(){g.current&&window.clearTimeout(g.current),m.current=!1}return O.createElement("div",{onClick:v,onPointerCancel:w,onPointerDown:C=>{c&&f(C),x()},onPointerMove:C=>{c&&p(C)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},O.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});LK.displayName="Drawer.Handle";function FK(e){const t=yu(),{container:n=t.container,...r}=e;return O.createElement(Zl,{container:n,...r})}const Ri={Root:DK,Content:_k,Overlay:Pk,Trigger:jd,Portal:FK,Close:fs,Title:Ld,Description:Fd};function BK({...e}){return h.jsx(Ri.Root,{"data-slot":"drawer",...e})}function VK({...e}){return h.jsx(Ri.Trigger,{"data-slot":"drawer-trigger",...e})}function Mk({...e}){return h.jsx(Ri.Portal,{"data-slot":"drawer-portal",...e})}function $K({...e}){return h.jsx(Ri.Close,{"data-slot":"drawer-close",...e})}function Dk({className:e,...t}){return h.jsx(Ri.Overlay,{"data-slot":"drawer-overlay",className:F("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function GK({className:e,children:t,...n}){return h.jsxs(Mk,{"data-slot":"drawer-portal",children:[h.jsx(Dk,{}),h.jsxs(Ri.Content,{"data-slot":"drawer-content",className:F("ui:group/drawer-content ui:bg-background ui:fixed ui:flex ui:h-auto ui:flex-col ui:rounded-t-[10px] ui:z-100 ui:mt-24","ui:data-[vaul-drawer-direction=top]:inset-x-0 ui:data-[vaul-drawer-direction=top]:top-0 ui:data-[vaul-drawer-direction=top]:mb-24 ui:data-[vaul-drawer-direction=top]:max-h-[80vh] ui:data-[vaul-drawer-direction=top]:rounded-b-lg ui:data-[vaul-drawer-direction=top]:border-b","ui:data-[vaul-drawer-direction=bottom]:inset-x-0 ui:data-[vaul-drawer-direction=bottom]:bottom-0 ui:data-[vaul-drawer-direction=bottom]:mt-24 ui:data-[vaul-drawer-direction=bottom]:max-h-[80vh] ui:data-[vaul-drawer-direction=bottom]:rounded-t-lg ui:data-[vaul-drawer-direction=bottom]:border-t","ui:data-[vaul-drawer-direction=right]:inset-y-0 ui:data-[vaul-drawer-direction=right]:right-0 ui:data-[vaul-drawer-direction=right]:w-3/4 ui:data-[vaul-drawer-direction=right]:border-l ui:data-[vaul-drawer-direction=right]:sm:max-w-sm","ui:data-[vaul-drawer-direction=left]:inset-y-0 ui:data-[vaul-drawer-direction=left]:left-0 ui:data-[vaul-drawer-direction=left]:w-3/4 ui:data-[vaul-drawer-direction=left]:border-r ui:data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[h.jsx("div",{className:"ui:bg-muted ui:mx-auto ui:mt-4 ui:hidden ui:h-2 ui:w-[100px] ui:shrink-0 ui:rounded-full ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function HK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-header",className:F("ui:flex ui:flex-col ui:gap-0.5 ui:p-4 ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center ui:group-data-[vaul-drawer-direction=top]/drawer-content:text-center ui:md:gap-1.5 ui:md:text-left",e),...t})}function WK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-footer",className:F("ui:mt-auto ui:flex ui:flex-col ui:gap-2 ui:p-4",e),...t})}function zK({className:e,...t}){return h.jsx(Ri.Title,{"data-slot":"drawer-title",className:F("ui:text-foreground ui:font-semibold",e),...t})}function qK({className:e,...t}){return h.jsx(Ri.Description,{"data-slot":"drawer-description",className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function ox({...e}){return h.jsx(C3,{"data-slot":"dropdown-menu",...e})}function UK({...e}){return h.jsx(QN,{"data-slot":"dropdown-menu-portal",...e})}function ix({...e}){return h.jsx(S3,{"data-slot":"dropdown-menu-trigger",...e})}function sx({className:e,sideOffset:t=4,...n}){return h.jsx(QN,{children:h.jsx(E3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:max-h-(--radix-dropdown-menu-content-available-height) ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-x-hidden ui:overflow-y-auto ui:rounded-md ui:border ui:p-1 ui:shadow-md",e),...n})})}function YK({...e}){return h.jsx(I3,{"data-slot":"dropdown-menu-group",...e})}function kk({className:e,inset:t,variant:n="default",...r}){return h.jsx(A3,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[variant=destructive]:text-destructive ui:data-[variant=destructive]:focus:bg-destructive/10 ui:dark:data-[variant=destructive]:focus:bg-destructive/20 ui:data-[variant=destructive]:focus:text-destructive ui:data-[variant=destructive]:*:[svg]:!text-destructive ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r})}function yv({className:e,children:t,checked:n,...r}){return h.jsxs(T3,{"data-slot":"dropdown-menu-checkbox-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(eO,{children:h.jsx(_e.CheckIcon,{className:"ui:size-4"})})}),t]})}function XK({...e}){return h.jsx(N3,{"data-slot":"dropdown-menu-radio-group",...e})}function ZK({className:e,children:t,...n}){return h.jsxs(O3,{"data-slot":"dropdown-menu-radio-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(eO,{children:h.jsx(_e.CircleIcon,{className:"ui:size-2 ui:fill-current"})})}),t]})}function JK({className:e,inset:t,...n}){return h.jsx(R3,{"data-slot":"dropdown-menu-label","data-inset":t,className:F("ui:px-2 ui:py-1.5 ui:text-sm ui:font-medium ui:data-[inset]:pl-8",e),...n})}function KK({className:e,...t}){return h.jsx(P3,{"data-slot":"dropdown-menu-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function QK({className:e,...t}){return h.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:F("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}function eQ({...e}){return h.jsx(_3,{"data-slot":"dropdown-menu-sub",...e})}function tQ({className:e,inset:t,children:n,...r}){return h.jsxs(M3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[state=open]:bg-accent ui:data-[state=open]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(_e.ChevronRightIcon,{className:"ui:ml-auto ui:size-4"})]})}function nQ({className:e,...t}){return h.jsx(D3,{"data-slot":"dropdown-menu-sub-content",className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-hidden ui:rounded-md ui:border ui:p-1 ui:shadow-lg",e),...t})}function rQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:F("ui:flex ui:min-w-0 ui:flex-1 ui:flex-col ui:items-center ui:justify-center ui:gap-6 ui:rounded-lg ui:border-dashed ui:p-6 ui:text-center ui:text-balance ui:md:p-12",e),...t})}function oQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:F("ui:flex ui:max-w-sm ui:flex-col ui:items-center ui:gap-2 ui:text-center",e),...t})}const iQ=Si("ui:flex ui:shrink-0 ui:items-center ui:justify-center ui:mb-2 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0",{variants:{variant:{default:"ui:bg-transparent",icon:"ui:bg-muted ui:text-foreground ui:flex ui:size-10 ui:shrink-0 ui:items-center ui:justify-center ui:rounded-lg ui:[&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function sQ({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:F(iQ({variant:t,className:e})),...n})}function aQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:F("ui:text-lg ui:font-medium ui:tracking-tight",e),...t})}function lQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:F("ui:text-muted-foreground ui:[&>a:hover]:text-primary ui:text-sm/relaxed ui:[&>a]:underline ui:[&>a]:underline-offset-4",e),...t})}function uQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-content",className:F("ui:flex ui:w-full ui:max-w-sm ui:min-w-0 ui:flex-col ui:items-center ui:gap-4 ui:text-sm ui:text-balance",e),...t})}function jk({message:e,className:t}){return h.jsx("p",{className:F("ui:text-red-500 ui:text-xs ui:mt-2 ui:has-error",t),children:e})}const Lk=b.createContext(null),Fk=b.createContext(null),kf=()=>{const e=b.useContext(Lk),t=b.useContext(Fk);if(!e)throw new Error("useFormField must be used within <FormField>");if(!t)throw new Error("useFormField must be used within <FormItem>");const{id:n}=t,{name:r,error:o}=e;return{name:r,error:o,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`}},Br=e=>h.jsx(cr.Controller,{...e,render:t=>h.jsx(Lk.Provider,{value:{name:e.name,error:t.fieldState.error},children:e.render?.(t)})});function fr({className:e,...t}){const n=b.useId();return h.jsx(Fk.Provider,{value:{id:n},children:h.jsx("div",{"data-slot":"form-item",className:F("ui:grid ui:gap-2",e),...t})})}function oo({className:e,required:t=!1,...n}){const{error:r,formItemId:o}=kf();return h.jsxs(mr,{"data-slot":"form-label","data-error":!!r,htmlFor:o,className:F("ui:text-sm",r?"ui:text-destructive":"ui:text-black-950",e),...n,children:[n.children,t&&h.jsx("span",{className:"ui:text-destructive ml-1",children:"*"})]})}function pr(e){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=kf();return h.jsx(Bo,{"data-slot":"form-control",id:n,"aria-invalid":!!t,"aria-describedby":t?`${r} ${o}`:r,...e})}function po({className:e,...t}){const{formDescriptionId:n}=kf();return h.jsx("p",{"data-slot":"form-description",id:n,className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function Vr({className:e,showErrorPlaceholder:t,...n}){const{error:r,formMessageId:o}=kf(),i=r?String(r.message??""):n.children;return i?h.jsx("p",{"data-slot":"form-message",id:o,className:F("ui:text-destructive ui:text-sm",e),...n,children:i}):t?h.jsx("p",{className:"ui:h-4"}):null}const cQ=({name:e,control:t,formClassName:n,...r})=>{const o=cr.useFormContext(),i=t??o?.control;if(!i)throw new Error("FormCheckbox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:i,name:e,render:({field:s})=>h.jsxs(fr,{className:n,children:[h.jsx(pr,{children:h.jsx(YM,{...s,checked:!!s.value,onCheckedChange:s.onChange,...r})}),h.jsx(Vr,{})]})})};function ax({delayDuration:e=0,...t}){return h.jsx(n9,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function lx({...e}){return h.jsx(ax,{children:h.jsx(r9,{"data-slot":"tooltip",...e})})}function ux({...e}){return h.jsx(o9,{"data-slot":"tooltip-trigger",...e})}function jf({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(i_,{children:h.jsxs(s_,{"data-slot":"tooltip-content",sideOffset:t,className:F("ui:bg-foreground ui:text-background ui:animate-in ui:fade-in-0 ui:zoom-in-95 ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=closed]:zoom-out-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-fit ui:origin-(--radix-tooltip-content-transform-origin) ui:rounded-md ui:px-3 ui:py-1.5 ui:text-xs ui:text-balance",e),...r,children:[n,h.jsx(i9,{className:"ui:bg-foreground ui:fill-foreground ui:z-50 ui:size-2.5 ui:translate-y-[calc(-50%-2px)] ui:rotate-45 ui:rounded-[2px]"})]})})}const Bk=b.forwardRef(({children:e,...t},n)=>h.jsx(i_,{children:h.jsx(jf,{ref:n,...t,children:e})}));Bk.displayName=s_.displayName;const ya=({trigger:e,content:t,asChild:n=!0,wrapTrigger:r=!0,triggerClassName:o="",contentClassName:i="ui:max-w-sm",disableContent:s=!1,isPortal:a=!1})=>s?e:h.jsxs(lx,{children:[h.jsx(ux,{asChild:n,children:r?h.jsx("div",{className:F("ui:truncate",o),children:e}):e}),a?h.jsx(Bk,{className:i,children:t}):h.jsx(jf,{className:i,children:t})]}),dQ=({name:e,label:t,placeholder:n,items:r=[],description:o,multiple:i=!1,emptyMessage:s="No results found",containerClassName:a,hasClearButton:l=!1,hasAllOption:u=!1,allOptionLabel:c="All",disabled:d=!1,tooltipContent:f,control:p,inputMode:g="input"})=>{const m=cr.useFormContext(),v=p??m?.control;if(!v)throw new Error("FormCombobox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:v,name:e,render:({field:y})=>h.jsxs(fr,{className:F("ui:flex ui:flex-col",a),children:[t&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!f}),children:[t,f&&h.jsx(ya,{triggerClassName:"ui:order-last",content:f,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(tx,{items:r,multiple:i,value:y.value,onValueChange:y.onChange,placeholder:n,emptyMessage:s,disabled:d,hasClearButton:l,hasAllOption:u,allOptionLabel:c,inputMode:g}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},fQ=({name:e,control:t,disabledCondition:n=!1,label:r,placeholder:o,description:i,containerClassName:s,triggerClassName:a,showErrorPlaceholder:l})=>{const u=cr.useFormContext(),c=t??u?.control;if(!c)throw new Error("FormDatePicker must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(fr,{className:F("ui:flex ui:flex-col",s),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(oo,{children:r})})}),h.jsxs(nx,{children:[h.jsx(Mf,{asChild:!0,children:h.jsx(pr,{children:h.jsxs(Jt,{variant:"outline",className:F("ui:w-[240px] ui:pl-3 ui:text-left ui:font-normal",!d.value&&"ui:text-muted-foreground",a),children:[d.value?ti(new Date(d.value),"dd/MM/yyyy"):h.jsx("span",{children:o}),h.jsx(_e.CalendarIcon,{className:"ui:ml-auto ui:h-4 ui:w-4 ui:opacity-50"})]})})}),h.jsx(Df,{className:"ui:w-auto ui:p-0",align:"start",children:h.jsx(e0,{mode:"single",selected:d.value?new Date(d.value):void 0,onSelect:f=>{f&&d.onChange(f)},disabled:n,initialFocus:!0})})]}),h.jsx(In,{children:h.jsx(Vt,{condition:!!i,children:h.jsx(po,{children:i})})}),h.jsx(Vr,{showErrorPlaceholder:l})]})})},pQ=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},hQ=e=>e.type.startsWith("image/"),gQ=({uploadedFile:e,onRemove:t})=>h.jsx("div",{className:"ui:p-3 ui:bg-muted/50 ui:border ui:border-border ui:rounded-lg",children:h.jsxs("div",{className:"ui:flex ui:items-center ui:justify-between ui:gap-3",children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-3 ui:min-w-0",children:[hQ(e.file)?h.jsx("img",{src:e.url,alt:e.file.name,className:"ui:shrink-0 ui:w-10 ui:h-10 ui:object-cover ui:rounded-md"}):h.jsx("div",{className:"ui:shrink-0 ui:p-2 ui:bg-primary/10 ui:rounded-md",children:h.jsx(_e.FileText,{size:20,className:"ui:text-primary"})}),h.jsxs("div",{className:"ui:min-w-0",children:[h.jsx("p",{className:"ui:text-sm ui:font-medium ui:text-foreground ui:truncate",children:e.file.name}),h.jsx("p",{className:"ui:text-xs ui:text-muted-foreground",children:pQ(e.file.size)})]})]}),h.jsx(Do,{variant:"ghost",size:"sm",isIconOnly:!0,onClick:t,icon:h.jsx(_e.X,{size:16}),className:F("ui:shrink-0 ui:text-muted-foreground","ui:hover:text-destructive ui:hover:bg-destructive/10")})]})}),Vk=({name:e,control:t,label:n,uploadButtonLabel:r="Upload File",uploadingLabel:o="Uploading...",uploadFailedMessage:i="Upload failed",description:s,accept:a="*",disabled:l=!1,multiple:u=!1,containerClassName:c,tooltipContent:d,hasRequiredIndicator:f=!1,onUpload:p})=>{const g=cr.useFormContext(),m=t??g?.control;if(!m)throw new Error("FormFileUpload must be used within a FormProvider or receive a control prop");const v=O.useRef(null),[y,x]=O.useState(!1),w=async(S,R,I)=>{const T=S.target.files;if(T?.length){x(!0);try{if(u){const _=Array.from(T),$=[];for(const M of _){const N=p?await p(M):URL.createObjectURL(M);$.push({file:M,url:N})}const A=Array.isArray(I)?I:[];R([...A,...$])}else{const _=T[0],$=p?await p(_):URL.createObjectURL(_);R({file:_,url:$})}}catch(_){const $=_ instanceof Error?_.message:i;Jv.toast.error($)}finally{x(!1),v.current&&(v.current.value="")}}},C=(S,R,I)=>{if(u&&Array.isArray(R)&&I){const T=R.filter(_=>_!==I);S(T.length>0?T:null)}else S(null);v.current&&(v.current.value="")};return h.jsx(Br,{control:m,name:e,render:({field:S})=>{const R=S.value,I=u?Array.isArray(R)?R:[]:R&&"file"in R?[R]:[];return h.jsxs(fr,{className:F("ui:w-full",c),children:[n&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!d}),children:[n,f&&h.jsx("span",{children:"*"}),d&&h.jsx(ya,{content:d,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:text-muted-foreground ui:cursor-pointer"})})]}),h.jsx(pr,{children:h.jsxs("div",{className:"ui:space-y-3",children:[h.jsxs("div",{className:"ui:relative ui:inline-block",children:[h.jsx("input",{ref:v,type:"file",accept:a,multiple:u,onChange:T=>w(T,S.onChange,R),disabled:l||y,className:F("ui:absolute ui:inset-0 ui:w-full ui:h-full ui:opacity-0 ui:cursor-pointer","ui:disabled:cursor-not-allowed")}),h.jsx(Do,{variant:"outline",label:y?o:r,icon:y?h.jsx(_e.Loader2,{size:16,className:"ui:animate-spin"}):h.jsx(_e.Upload,{size:16}),disabled:l||y})]}),I.length>0&&h.jsx("div",{className:"ui:space-y-2",children:I.map((T,_)=>h.jsx(gQ,{uploadedFile:T,onRemove:()=>C(S.onChange,R,T)},`${T.file.name}-${T.file.size}-${_}`))})]})}),h.jsx(Vr,{}),s&&h.jsx(po,{children:s})]})}})};Vk.displayName="FormFileUpload";const cx=O.forwardRef(({name:e,label:t,labelVariant:n,type:r,value:o,onChange:i,description:s="",placeholder:a,className:l,inputClassName:u,isReadOnly:c=!1,hasRequiredIndicator:d=!1,...f},p)=>h.jsxs("article",{className:l,children:[t&&h.jsxs(mr,{variant:n,className:"ui:mb-2",children:[t,d&&h.jsx("span",{children:"*"})]}),h.jsx(vu,{ref:p,"data-test-id":e,placeholder:a,value:o,type:r,onChange:i,className:F({"ui:pointer-events-none ui:opacity-30":c},u),...f}),s&&h.jsx(If,{description:s})]})),mQ=({label:e,containerClassName:t,inputClassName:n,name:r,description:o,placeholder:i="",tooltipContent:s,hasRequiredIndicator:a=!1,control:l,...u})=>{const c=cr.useFormContext(),d=l??c?.control;if(!d)throw new Error("FormInput must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:d,name:r,render:({field:f})=>h.jsxs(fr,{className:F("ui:w-full",t),children:[h.jsxs(oo,{className:s?"ui:flex ui:items-center ui:gap-2":void 0,children:[e,a&&h.jsx("span",{children:"*"}),s&&h.jsx(ya,{content:s,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(pr,{children:h.jsx(cx,{...f,...u,placeholder:i,inputClassName:F(n)})}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},bQ=({label:e,name:t,containerClassName:n,description:r,placeholder:o,tooltipContent:i,control:s,hasRequiredIndicator:a=!1,...l})=>{const u=cr.useFormContext(),c=s??u?.control;if(!c)throw new Error("FormPassword must be used within a FormProvider or receive a control prop");const[d,f]=O.useState(!1),p=()=>{f(g=>!g)};return h.jsx(Br,{control:c,name:t,render:({field:g})=>h.jsxs(fr,{className:F("ui:w-full",n),children:[e&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!i}),children:[e,a&&h.jsx("span",{children:"*"}),i&&h.jsx(ya,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(pr,{children:h.jsxs("div",{className:"ui:relative",children:[h.jsx(cx,{...g,...l,type:d?"text":"password",placeholder:o,hasRequiredIndicator:a,inputClassName:"pr-8"}),h.jsx("button",{type:"button",onClick:p,className:"ui:absolute ui:right-3 ui:top-1/2 ui:-translate-y-1/2 ui:text-muted-foreground ui:hover:text-foreground ui:transition-colors",tabIndex:-1,children:d?h.jsx(_e.EyeOff,{size:16,className:"ui:cursor-pointer"}):h.jsx(_e.Eye,{size:16,className:"ui:cursor-pointer"})})]})}),r&&h.jsx(po,{children:r}),h.jsx(Vr,{})]})})};function $k({className:e,...t}){return h.jsx(fG,{"data-slot":"radio-group",className:F("ui:grid ui:gap-3",e),...t})}function Gk({className:e,...t}){return h.jsx(pG,{"data-slot":"radio-group-item",className:F("ui:p-0! ui:aspect-square ui:h-4 ui:w-4 ui:rounded-full ui:border ui:border-solid ui:border-primary ui:text-primary ui:bg-transparent ui:hover:bg-transparent ui:ring-offset-background ui:focus:outline-none ui:focus-visible:ring-2 ui:focus-visible:ring-ring ui:focus-visible:ring-offset-2 ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:transition-none",e),...t,children:h.jsx(hG,{"data-slot":"radio-group-indicator",className:"ui:relative ui:flex ui:items-center ui:justify-center",children:h.jsx(_e.CircleIcon,{className:"ui:fill-primary ui:absolute ui:top-1/2 ui:left-1/2 ui:size-2 ui:-translate-x-1/2 ui:-translate-y-1/2"})})})}const vQ=({name:e,label:t,items:n,control:r,containerClassName:o,itemClassName:i,itemLabelClassName:s,selectedClassName:a,description:l})=>{const u=cr.useFormContext(),c=r??u?.control;if(!c)throw new Error("FormRadio must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(fr,{className:F("ui:space-y-3",o),children:[t&&h.jsx(oo,{children:t}),h.jsx(pr,{children:h.jsx($k,{onValueChange:d.onChange,defaultValue:d.value,className:"ui:flex ui:flex-col ui:space-y-1",children:n.map(f=>h.jsxs(fr,{className:F("ui:flex ui:items-center ui:space-y-0",i,d.value===f.value&&a),children:[h.jsx(pr,{children:h.jsx(Gk,{value:f.value})}),h.jsx(oo,{className:F("ui:font-normal",s),children:f.label})]},f.value))})}),h.jsx(Vr,{}),l&&h.jsx(po,{children:l})]})})};function Hk({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const s=b.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return h.jsxs(IH,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:F("ui:relative ui:flex ui:w-full ui:touch-none ui:items-center ui:select-none ui:data-[disabled]:opacity-50 ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:min-h-44 ui:data-[orientation=vertical]:w-auto ui:data-[orientation=vertical]:flex-col",e),...i,children:[h.jsx(RH,{"data-slot":"slider-track",className:F("ui:bg-muted ui:relative ui:grow ui:overflow-hidden ui:rounded-full ui:data-[orientation=horizontal]:h-1.5 ui:data-[orientation=horizontal]:w-full ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:w-1.5"),children:h.jsx(AH,{"data-slot":"slider-range",className:F("ui:bg-primary ui:absolute ui:data-[orientation=horizontal]:h-full ui:data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(a,l)=>h.jsx(TH,{"data-slot":"slider-thumb",className:"ui:border-primary ui:ring-ring/50 ui:block ui:size-4 ui:shrink-0 ui:rounded-full ui:border ui:bg-white ui:shadow-sm ui:transition-[color,box-shadow] ui:hover:ring-4 ui:focus-visible:ring-4 ui:focus-visible:outline-hidden ui:disabled:pointer-events-none ui:disabled:opacity-50"},l))]})}const yQ=({name:e,control:t,label:n,description:r,min:o=0,max:i=100,step:s=1,leftLabel:a,rightLabel:l,showLabels:u=!0,complementaryField:c,onValueChange:d,containerClassName:f,labelClassName:p,showErrorPlaceholder:g=!1,tooltipContent:m,...v})=>{const y=cr.useFormContext(),x=t??y?.control;if(!x)throw new Error("FormSlider must be used within a FormProvider or receive a control prop");const w=O.useRef(!1),C=cr.useWatch({control:x,name:e});return h.jsx(Br,{control:x,name:e,render:({field:S})=>{const R=T=>{if(w.current)return;const _=T[0];w.current=!0,S.onChange(String(_)),c&&y?.setValue&&y.setValue(c,String(i-_),{shouldValidate:!0}),d&&d(_),setTimeout(()=>{w.current=!1},0)},I=Number(C)||o+(i-o)/2;return h.jsxs(fr,{className:F("ui:w-full",f),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!n,children:h.jsxs(oo,{className:F(p,{"ui:flex ui:items-center ui:gap-2":!!m}),children:[n,m&&h.jsx(ya,{content:m,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,color:"#737373",className:"ui:cursor-pointer"})})]})})}),h.jsx(pr,{children:h.jsxs("div",{className:"ui:space-y-2",children:[h.jsx(Hk,{value:[I],onValueChange:R,min:o,max:i,step:s,className:"ui:w-full",...v}),u&&h.jsxs("div",{className:"ui:flex ui:justify-between ui:text-sm ui:text-gray-600",children:[a&&h.jsxs("span",{children:[a,": ",I,i===100?"%":""]}),l&&h.jsxs("span",{children:[l,": ",c?i-I:I,i===100?"%":""]})]})]})}),h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(po,{className:"ui:text-xs",children:r})})}),h.jsx(Vr,{showErrorPlaceholder:g})]})}})};function Wk({className:e,...t}){return h.jsx(MH,{"data-slot":"switch",className:F("ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",e),...t,children:h.jsx(DH,{"data-slot":"switch-thumb",className:F("ui:bg-background ui:dark:data-[state=unchecked]:bg-foreground ui:dark:data-[state=checked]:bg-primary-foreground ui:pointer-events-none ui:block ui:size-4 ui:rounded-full ui:ring-0 ui:transition-transform ui:data-[state=checked]:translate-x-[calc(100%-2px)] ui:data-[state=unchecked]:translate-x-0")})})}const zk=({label:e,name:t,...n})=>h.jsxs("article",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(Wk,{id:t,...n}),h.jsx(mr,{htmlFor:t,children:e})]}),xQ=({name:e,label:t,description:n,control:r,...o})=>{const i=cr.useFormContext(),s=r??i?.control;if(!s)throw new Error("FormSwitch must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:s,name:e,render:({field:a})=>h.jsxs(fr,{children:[h.jsx(pr,{children:h.jsx(zk,{...a,...o,label:t})}),h.jsx(Vr,{}),n&&h.jsx(po,{children:n})]})})},qk=({textAreaClassName:e,value:t,onChange:n,label:r,...o})=>h.jsxs("article",{children:[r&&h.jsx(mr,{className:"ui:mb-2 ui:block",children:r}),h.jsx(mk,{className:F("ui:w-full",e),value:t,onChange:n,...o})]}),wQ=({label:e,name:t,description:n,placeholder:r,containerClassName:o,control:i,...s})=>{const a=cr.useFormContext(),l=i??a?.control;if(!l)throw new Error("FormTextarea must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:l,name:t,render:({field:u})=>h.jsxs(fr,{className:F("ui:w-full",o),children:[h.jsx(oo,{children:e}),h.jsx(pr,{children:h.jsx(qk,{placeholder:r,...u,...s})}),n&&h.jsx(po,{children:n}),h.jsx(Vr,{})]})})};function CQ({...e}){return h.jsx(G3,{"data-slot":"hover-card",...e})}function SQ({...e}){return h.jsx(H3,{"data-slot":"hover-card-trigger",...e})}function EQ({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(W3,{"data-slot":"hover-card-portal",children:h.jsx(z3,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-64 ui:origin-(--radix-hover-card-content-transform-origin) ui:rounded-md ui:border ui:p-4 ui:shadow-md ui:outline-hidden",e),...r})})}function IQ({name:e,className:t,...n}){return h.jsx("i",{className:F(`icon-${e}`,t),...n,children:h.jsxs("span",{className:"ui:for-screenreader-only",children:[e," icon"]})})}var RQ=Object.defineProperty,AQ=Object.defineProperties,TQ=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,Uk=Object.prototype.hasOwnProperty,Yk=Object.prototype.propertyIsEnumerable,uI=(e,t,n)=>t in e?RQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NQ=(e,t)=>{for(var n in t||(t={}))Uk.call(t,n)&&uI(e,n,t[n]);if(md)for(var n of md(t))Yk.call(t,n)&&uI(e,n,t[n]);return e},OQ=(e,t)=>AQ(e,TQ(t)),PQ=(e,t)=>{var n={};for(var r in e)Uk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&md)for(var r of md(e))t.indexOf(r)<0&&Yk.call(e,r)&&(n[r]=e[r]);return n};function _Q(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function MQ(e){let t=b.useRef();return b.useEffect(()=>{t.current=e}),t.current}var DQ=18,Xk=40,kQ=`${Xk}px`,jQ=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function LQ({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[o,i]=b.useState(!1),[s,a]=b.useState(!1),[l,u]=b.useState(!1),c=b.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&o&&s,[o,s,n]),d=b.useCallback(()=>{let f=e.current,p=t.current;if(!f||!p||l||n==="none")return;let g=f,m=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,y=m-DQ,x=v;document.querySelectorAll(jQ).length===0&&document.elementFromPoint(y,x)===f||(i(!0),u(!0))},[e,t,l,n]);return b.useEffect(()=>{let f=e.current;if(!f||n==="none")return;function p(){let m=window.innerWidth-f.getBoundingClientRect().right;a(m>=Xk)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,n]),b.useEffect(()=>{let f=r||document.activeElement===t.current;if(n==="none"||!f)return;let p=setTimeout(d,0),g=setTimeout(d,2e3),m=setTimeout(d,5e3),v=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(m),clearTimeout(v)}},[t,r,n,d]),{hasPWMBadge:o,willPushPWMBadge:c,PWM_BADGE_SPACE_WIDTH:kQ}}var FQ=b.createContext({}),Zk=b.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,maxLength:i,textAlign:s="left",pattern:a,placeholder:l,inputMode:u="numeric",onComplete:c,pushPasswordManagerStrategy:d="increase-width",pasteTransformer:f,containerClassName:p,noScriptCSSFallback:g=BQ,render:m,children:v}=n,y=PQ(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),x,w,C,S,R;let[I,T]=b.useState(typeof y.defaultValue=="string"?y.defaultValue:""),_=r??I,$=MQ(_),A=b.useCallback(k=>{o?.(k),T(k)},[o]),M=b.useMemo(()=>a?typeof a=="string"?new RegExp(a):a:null,[a]),N=b.useRef(null),B=b.useRef(null),j=b.useRef({value:_,onChange:A,isIOS:typeof window<"u"&&((w=(x=window?.CSS)==null?void 0:x.supports)==null?void 0:w.call(x,"-webkit-touch-callout","none"))}),D=b.useRef({prev:[(C=N.current)==null?void 0:C.selectionStart,(S=N.current)==null?void 0:S.selectionEnd,(R=N.current)==null?void 0:R.selectionDirection]});b.useImperativeHandle(t,()=>N.current,[]),b.useEffect(()=>{let k=N.current,ie=B.current;if(!k||!ie)return;j.current.value!==k.value&&j.current.onChange(k.value),D.current.prev=[k.selectionStart,k.selectionEnd,k.selectionDirection];function Y(){if(document.activeElement!==k){W(null),K(null);return}let re=k.selectionStart,fe=k.selectionEnd,de=k.selectionDirection,ve=k.maxLength,we=k.value,Se=D.current.prev,Ye=-1,at=-1,Xe;if(we.length!==0&&re!==null&&fe!==null){let gt=re===fe,ct=re===we.length&&we.length<ve;if(gt&&!ct){let ot=re;if(ot===0)Ye=0,at=1,Xe="forward";else if(ot===ve)Ye=ot-1,at=ot,Xe="backward";else if(ve>1&&we.length>1){let mt=0;if(Se[0]!==null&&Se[1]!==null){Xe=ot<Se[1]?"backward":"forward";let Ot=Se[0]===Se[1]&&Se[0]<ve;Xe==="backward"&&!Ot&&(mt=-1)}Ye=mt+ot,at=mt+ot+1}}Ye!==-1&&at!==-1&&Ye!==at&&N.current.setSelectionRange(Ye,at,Xe)}let Ue=Ye!==-1?Ye:re,rt=at!==-1?at:fe,et=Xe??de;W(Ue),K(rt),D.current.prev=[Ue,rt,et]}if(document.addEventListener("selectionchange",Y,{capture:!0}),Y(),document.activeElement===k&&H(!0),!document.getElementById("input-otp-style")){let re=document.createElement("style");if(re.id="input-otp-style",document.head.appendChild(re),re.sheet){let fe="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Wa(re.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Wa(re.sheet,`[data-input-otp]:autofill { ${fe} }`),Wa(re.sheet,`[data-input-otp]:-webkit-autofill { ${fe} }`),Wa(re.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Wa(re.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let le=()=>{ie&&ie.style.setProperty("--root-height",`${k.clientHeight}px`)};le();let pe=new ResizeObserver(le);return pe.observe(k),()=>{document.removeEventListener("selectionchange",Y,{capture:!0}),pe.disconnect()}},[]);let[V,G]=b.useState(!1),[z,H]=b.useState(!1),[ne,W]=b.useState(null),[J,K]=b.useState(null);b.useEffect(()=>{_Q(()=>{var k,ie,Y,le;(k=N.current)==null||k.dispatchEvent(new Event("input"));let pe=(ie=N.current)==null?void 0:ie.selectionStart,re=(Y=N.current)==null?void 0:Y.selectionEnd,fe=(le=N.current)==null?void 0:le.selectionDirection;pe!==null&&re!==null&&(W(pe),K(re),D.current.prev=[pe,re,fe])})},[_,z]),b.useEffect(()=>{$!==void 0&&_!==$&&$.length<i&&_.length===i&&c?.(_)},[i,c,$,_]);let U=LQ({containerRef:B,inputRef:N,pushPasswordManagerStrategy:d,isFocused:z}),oe=b.useCallback(k=>{let ie=k.currentTarget.value.slice(0,i);if(ie.length>0&&M&&!M.test(ie)){k.preventDefault();return}typeof $=="string"&&ie.length<$.length&&document.dispatchEvent(new Event("selectionchange")),A(ie)},[i,A,$,M]),X=b.useCallback(()=>{var k;if(N.current){let ie=Math.min(N.current.value.length,i-1),Y=N.current.value.length;(k=N.current)==null||k.setSelectionRange(ie,Y),W(ie),K(Y)}H(!0)},[i]),te=b.useCallback(k=>{var ie,Y;let le=N.current;if(!f&&(!j.current.isIOS||!k.clipboardData||!le))return;let pe=k.clipboardData.getData("text/plain"),re=f?f(pe):pe;k.preventDefault();let fe=(ie=N.current)==null?void 0:ie.selectionStart,de=(Y=N.current)==null?void 0:Y.selectionEnd,ve=(fe!==de?_.slice(0,fe)+re+_.slice(de):_.slice(0,fe)+re+_.slice(fe)).slice(0,i);if(ve.length>0&&M&&!M.test(ve))return;le.value=ve,A(ve);let we=Math.min(ve.length,i-1),Se=ve.length;le.setSelectionRange(we,Se),W(we),K(Se)},[i,A,M,_]),Q=b.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),se=b.useMemo(()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:s,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,s]),ae=b.useMemo(()=>b.createElement("input",OQ(NQ({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":_.length===0||void 0,"data-input-otp-mss":ne,"data-input-otp-mse":J,inputMode:u,pattern:M?.source,"aria-placeholder":l,style:se,maxLength:i,value:_,ref:N,onPaste:k=>{var ie;te(k),(ie=y.onPaste)==null||ie.call(y,k)},onChange:oe,onMouseOver:k=>{var ie;G(!0),(ie=y.onMouseOver)==null||ie.call(y,k)},onMouseLeave:k=>{var ie;G(!1),(ie=y.onMouseLeave)==null||ie.call(y,k)},onFocus:k=>{var ie;X(),(ie=y.onFocus)==null||ie.call(y,k)},onBlur:k=>{var ie;H(!1),(ie=y.onBlur)==null||ie.call(y,k)}})),[oe,X,te,u,se,i,J,ne,y,M?.source,_]),L=b.useMemo(()=>({slots:Array.from({length:i}).map((k,ie)=>{var Y;let le=z&&ne!==null&&J!==null&&(ne===J&&ie===ne||ie>=ne&&ie<J),pe=_[ie]!==void 0?_[ie]:null,re=_[0]!==void 0?null:(Y=l?.[ie])!=null?Y:null;return{char:pe,placeholderChar:re,isActive:le,hasFakeCaret:le&&pe===null}}),isFocused:z,isHovering:!y.disabled&&V}),[z,V,i,J,ne,y.disabled,_]),Z=b.useMemo(()=>m?m(L):b.createElement(FQ.Provider,{value:L},v),[v,L,m]);return b.createElement(b.Fragment,null,g!==null&&b.createElement("noscript",null,b.createElement("style",null,g)),b.createElement("div",{ref:B,"data-input-otp-container":!0,style:Q,className:p},Z,b.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ae)))});Zk.displayName="Input";function Wa(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var BQ=`
88
+ ){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function fK(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function pK(){return rx(/^Mac/)}function hK(){return rx(/^iPhone/)}function iI(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function gK(){return rx(/^iPad/)||pK()&&navigator.maxTouchPoints>1}function Sk(){return hK()||gK()}function rx(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const mK=24,bK=typeof window<"u"?O.useLayoutEffect:O.useEffect;function sI(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const jm=typeof document<"u"&&window.visualViewport;function aI(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Ek(e){for(aI(e)&&(e=e.parentElement);e&&!aI(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const vK=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let sc=0,Lm;function yK(e={}){let{isDisabled:t}=e;bK(()=>{if(!t)return sc++,sc===1&&Sk()&&(Lm=xK()),()=>{sc--,sc===0&&Lm?.()}},[t])}function xK(){let e,t=0,n=d=>{e=Ek(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&f>t||p>=g&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;bv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;bv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",jm&&(jm.height<window.innerHeight?requestAnimationFrame(()=>{lI(f)}):jm.addEventListener("resize",()=>lI(f),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,u=sI(wK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let c=sI(Ga(document,"touchstart",n,{passive:!1,capture:!0}),Ga(document,"touchmove",r,{passive:!1,capture:!0}),Ga(document,"touchend",o,{passive:!1,capture:!0}),Ga(document,"focus",i,!0),Ga(window,"scroll",s));return()=>{u(),c(),window.scrollTo(a,l)}}function wK(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ga(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function lI(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=Ek(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+mK;i>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function bv(e){return e instanceof HTMLInputElement&&!vK.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function CK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function SK(...e){return t=>e.forEach(n=>CK(n,t))}function Ik(...e){return b.useCallback(SK(...e),e)}const Rk=new WeakMap;function nn(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Rk.set(e,r)}function EK(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Rk.get(e);n&&(e.style[t]=n[t])}const Yt=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ac(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Yt(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Yt(t)?5:4]):null)}function IK(e){return 8*(Math.log(e+1)-2)}function Fm(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function RK(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const kt={DURATION:.5,EASE:[.32,.72,0,1]},Ak=.4,AK=.25,TK=100,Tk=8,Gi=16,vv=26,Bm="vaul-dragging";function Nk(e){const t=O.useRef(e);return O.useEffect(()=>{t.current=e}),O.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function NK({defaultProp:e,onChange:t}){const n=O.useState(e),[r]=n,o=O.useRef(r),i=Nk(t);return O.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Ok({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=NK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Nk(n),l=O.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function OK({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:s,direction:a="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=Ok({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=O.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);O.useEffect(()=>{function I(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const g=O.useMemo(()=>c===n?.[n.length-1]||null,[n,c]),m=O.useMemo(()=>{var I;return(I=n?.findIndex(T=>T===c))!=null?I:null},[n,c]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,y=O.useMemo(()=>{const I=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n?.map(_=>{const $=typeof _=="string";let A=0;if($&&(A=parseInt(_,10)),Yt(a)){const N=$?A:f?_*I.height:0;return f?a==="bottom"?I.height-N:-I.height+N:N}const M=$?A:f?_*I.width:0;return f?a==="right"?I.width-M:-I.width+M:M}))!=null?T:[]},[n,f,l]),x=O.useMemo(()=>m!==null?y?.[m]:null,[y,m]),w=O.useCallback(I=>{var T;const _=(T=y?.findIndex($=>$===I))!=null?T:null;s(_),nn(r.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Yt(a)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`}),y&&_!==y.length-1&&i!==void 0&&_!==i&&_<i?nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"0"}):nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(_,0)])},[r.current,n,y,i,o,d]);O.useEffect(()=>{if(c||e){var I;const T=(I=n?.findIndex(_=>_===e||_===c))!=null?I:-1;y&&T!==-1&&typeof y[T]=="number"&&w(y[T])}},[c,e,n,y,w]);function C({draggedDistance:I,closeDrawer:T,velocity:_,dismissible:$}){if(i===void 0)return;const A=a==="bottom"||a==="right"?(x??0)-I:(x??0)+I,M=m===i-1,N=m===0,B=I>0;if(M&&nn(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),!u&&_>2&&!B){$?T():w(y[0]);return}if(!u&&_>2&&B&&y&&n){w(y[n.length-1]);return}const j=y?.reduce((V,G)=>typeof V!="number"||typeof G!="number"?V:Math.abs(G-A)<Math.abs(V-A)?G:V),D=Yt(a)?window.innerHeight:window.innerWidth;if(_>Ak&&Math.abs(I)<D*.4){const V=B?1:-1;if(V>0&&g&&n){w(y[n.length-1]);return}if(N&&V<0&&$&&T(),m===null)return;w(y[m+V]);return}w(j)}function S({draggedDistance:I}){if(x===null)return;const T=a==="bottom"||a==="right"?x-I:x+I;(a==="bottom"||a==="right")&&T<y[y.length-1]||(a==="top"||a==="left")&&T>y[y.length-1]||nn(r.current,{transform:Yt(a)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function R(I,T){if(!n||typeof m!="number"||!y||i===void 0)return null;const _=m===i-1;if(m>=i&&T)return 0;if(_&&!T)return 1;if(!v&&!_)return null;const A=_?m+1:m-1,M=_?y[A]-y[A-1]:y[A+1]-y[A],N=I/Math.abs(M);return _?1-N:N}return{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:R,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:C,onDrag:S,snapPointsOffset:y}}const PK=()=>()=>{};function _K(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=yu(),i=O.useRef(null),s=O.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-vv)/window.innerWidth}O.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;RK(r&&!o?Fm(document.body,{background:"black"}):PK,Fm(l,{transformOrigin:Yt(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`}));const u=Fm(l,{borderRadius:`${Tk}px`,overflow:"hidden",...Yt(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},kt.DURATION*1e3)}}},[t,n,s])}let Ha=null;function MK({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[s,a]=O.useState(()=>typeof window<"u"?window.location.href:""),l=O.useRef(0),u=O.useCallback(()=>{if(iI()&&Ha===null&&e&&!i){Ha={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&l.current>=f&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),c=O.useCallback(()=>{if(iI()&&Ha!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ha),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),Ha=null}},[s]);return O.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),O.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),O.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,r,s,t,n,u,c]),{restorePositionSetting:c}}function DK({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=AK,scrollLockTimeout:u=TK,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:x,noBodyStyles:w=!1,direction:C="bottom",defaultOpen:S=!1,disablePreventScroll:R=!0,snapToSequentialPoint:I=!1,preventScrollRestoration:T=!1,repositionInputs:_=!0,onAnimationEnd:$,container:A,autoFocus:M=!1}){var N,B;const[j=!1,D]=Ok({defaultProp:S,prop:e,onChange:ee=>{t?.(ee),!ee&&!x&&Xe(),setTimeout(()=>{$?.(ee)},kt.DURATION*1e3),ee&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[V,G]=O.useState(!1),[z,H]=O.useState(!1),[ne,W]=O.useState(!1),J=O.useRef(null),K=O.useRef(null),U=O.useRef(null),oe=O.useRef(null),X=O.useRef(null),te=O.useRef(!1),Q=O.useRef(null),se=O.useRef(0),ae=O.useRef(!1),L=O.useRef(!S),Z=O.useRef(0),k=O.useRef(null),ie=O.useRef(((N=k.current)==null?void 0:N.getBoundingClientRect().height)||0),Y=O.useRef(((B=k.current)==null?void 0:B.getBoundingClientRect().width)||0),le=O.useRef(0),pe=O.useCallback(ee=>{i&&ee===we.length-1&&(K.current=new Date)},[]),{activeSnapPoint:re,activeSnapPointIndex:fe,setActiveSnapPoint:de,onRelease:ve,snapPointsOffset:we,onDrag:Se,shouldFade:Ye,getPercentageDragged:at}=OK({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:k,fadeFromIndex:f,overlayRef:J,onSnapPointChange:pe,direction:C,container:A,snapToSequentialPoint:I});yK({isDisabled:!j||z||!v||ne||!V||!_||!R});const{restorePositionSetting:Xe}=MK({isOpen:j,modal:v,nested:x??!1,hasBeenOpened:V,preventScrollRestoration:T,noBodyStyles:w});function Ue(){return(window.innerWidth-vv)/window.innerWidth}function rt(ee){var ye,ge;!c&&!i||k.current&&!k.current.contains(ee.target)||(ie.current=((ye=k.current)==null?void 0:ye.getBoundingClientRect().height)||0,Y.current=((ge=k.current)==null?void 0:ge.getBoundingClientRect().width)||0,H(!0),U.current=new Date,Sk()&&window.addEventListener("touchend",()=>te.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),se.current=Yt(C)?ee.pageY:ee.pageX)}function et(ee,ye){var ge;let xe=ee;const Ae=(ge=window.getSelection())==null?void 0:ge.toString(),Ie=k.current?ac(k.current,C):null,qe=new Date;if(xe.tagName==="SELECT"||xe.hasAttribute("data-vaul-no-drag")||xe.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(K.current&&qe.getTime()-K.current.getTime()<500)return!1;if(Ie!==null&&(C==="bottom"?Ie>0:Ie<0))return!0;if(Ae&&Ae.length>0)return!1;if(X.current&&qe.getTime()-X.current.getTime()<u&&Ie===0||ye)return X.current=qe,!1;for(;xe;){if(xe.scrollHeight>xe.clientHeight){if(xe.scrollTop!==0)return X.current=new Date,!1;if(xe.getAttribute("role")==="dialog")return!0}xe=xe.parentNode}return!0}function gt(ee){if(k.current&&z){const ye=C==="bottom"||C==="right"?1:-1,ge=(se.current-(Yt(C)?ee.pageY:ee.pageX))*ye,xe=ge>0,Ae=i&&!c&&!xe;if(Ae&&fe===0)return;const Ie=Math.abs(ge),qe=document.querySelector("[data-vaul-drawer-wrapper]"),Pt=C==="bottom"||C==="top"?ie.current:Y.current;let lt=Ie/Pt;const it=at(Ie,xe);if(it!==null&&(lt=it),Ae&&lt>=1||!te.current&&!et(ee.target,xe))return;if(k.current.classList.add(Bm),te.current=!0,nn(k.current,{transition:"none"}),nn(J.current,{transition:"none"}),i&&Se({draggedDistance:ge}),xe&&!i){const Et=IK(ge),sn=Math.min(Et*-1,0)*ye;nn(k.current,{transform:Yt(C)?`translate3d(0, ${sn}px, 0)`:`translate3d(${sn}px, 0, 0)`});return}const _t=1-lt;if((Ye||f&&fe===f-1)&&(r?.(ee,lt),nn(J.current,{opacity:`${_t}`,transition:"none"},!0)),qe&&J.current&&s){const Et=Math.min(Ue()+lt*(1-Ue()),1),sn=8-lt*8,br=Math.max(0,14-lt*14);nn(qe,{borderRadius:`${sn}px`,transform:Yt(C)?`scale(${Et}) translate3d(0, ${br}px, 0)`:`scale(${Et}) translate3d(${br}px, 0, 0)`,transition:"none"},!0)}if(!i){const Et=Ie*ye;nn(k.current,{transform:Yt(C)?`translate3d(0, ${Et}px, 0)`:`translate3d(${Et}px, 0, 0)`})}}}O.useEffect(()=>{window.requestAnimationFrame(()=>{L.current=!0})},[]),O.useEffect(()=>{var ee;function ye(){if(!k.current||!_)return;const ge=document.activeElement;if(bv(ge)||ae.current){var xe;const Ae=((xe=window.visualViewport)==null?void 0:xe.height)||0,Ie=window.innerHeight;let qe=Ie-Ae;const Pt=k.current.getBoundingClientRect().height||0,lt=Pt>Ie*.8;le.current||(le.current=Pt);const it=k.current.getBoundingClientRect().top;if(Math.abs(Z.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&we&&fe){const _t=we[fe]||0;qe+=_t}if(Z.current=qe,Pt>Ae||ae.current){const _t=k.current.getBoundingClientRect().height;let Et=_t;_t>Ae&&(Et=Ae-(lt?it:vv)),m?k.current.style.height=`${_t-Math.max(qe,0)}px`:k.current.style.height=`${Math.max(Et,Ae-it)}px`}else fK()||(k.current.style.height=`${le.current}px`);i&&i.length>0&&!ae.current?k.current.style.bottom="0px":k.current.style.bottom=`${Math.max(qe,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",ye),()=>{var ge;return(ge=window.visualViewport)==null?void 0:ge.removeEventListener("resize",ye)}},[fe,i,we]);function ct(ee){mt(),y?.(),ee||D(!1),setTimeout(()=>{i&&de(i[0])},kt.DURATION*1e3)}function ot(){if(!k.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),ye=ac(k.current,C);nn(k.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),nn(J.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),s&&ye&&ye>0&&j&&nn(ee,{borderRadius:`${Tk}px`,overflow:"hidden",...Yt(C)?{transform:`scale(${Ue()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ue()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`},!0)}function mt(){!z||!k.current||(k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date)}function Ot(ee){if(!z||!k.current)return;k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date;const ye=ac(k.current,C);if(!ee||!et(ee.target,!1)||!ye||Number.isNaN(ye)||U.current===null)return;const ge=oe.current.getTime()-U.current.getTime(),xe=se.current-(Yt(C)?ee.pageY:ee.pageX),Ae=Math.abs(xe)/ge;if(Ae>.05&&(W(!0),setTimeout(()=>{W(!1)},200)),i){ve({draggedDistance:xe*(C==="bottom"||C==="right"?1:-1),closeDrawer:ct,velocity:Ae,dismissible:c}),o?.(ee,!0);return}if(C==="bottom"||C==="right"?xe>0:xe<0){ot(),o?.(ee,!0);return}if(Ae>Ak){ct(),o?.(ee,!1);return}var Ie;const qe=Math.min((Ie=k.current.getBoundingClientRect().height)!=null?Ie:0,window.innerHeight);var Pt;const lt=Math.min((Pt=k.current.getBoundingClientRect().width)!=null?Pt:0,window.innerWidth),it=C==="left"||C==="right";if(Math.abs(ye)>=(it?lt:qe)*l){ct(),o?.(ee,!1);return}o?.(ee,!0),ot()}O.useEffect(()=>(j&&(nn(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{EK(document.documentElement,"scrollBehavior")}),[j]);function Bt(ee){const ye=ee?(window.innerWidth-Gi)/window.innerWidth:1,ge=ee?-Gi:0;Q.current&&window.clearTimeout(Q.current),nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Yt(C)?`scale(${ye}) translate3d(0, ${ge}px, 0)`:`scale(${ye}) translate3d(${ge}px, 0, 0)`}),!ee&&k.current&&(Q.current=setTimeout(()=>{const xe=ac(k.current,C);nn(k.current,{transition:"none",transform:Yt(C)?`translate3d(0, ${xe}px, 0)`:`translate3d(${xe}px, 0, 0)`})},500))}function tt(ee,ye){if(ye<0)return;const ge=(window.innerWidth-Gi)/window.innerWidth,xe=ge+ye*(1-ge),Ae=-Gi+ye*Gi;nn(k.current,{transform:Yt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`,transition:"none"})}function Ze(ee,ye){const ge=Yt(C)?window.innerHeight:window.innerWidth,xe=ye?(ge-Gi)/ge:1,Ae=ye?-Gi:0;ye&&nn(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Yt(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`})}return O.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),O.createElement(Xl,{defaultOpen:S,onOpenChange:ee=>{!c&&!ee||(ee?G(!0):ct(!0),D(ee))},open:j},O.createElement(Ck.Provider,{value:{activeSnapPoint:re,snapPoints:i,setActiveSnapPoint:de,drawerRef:k,overlayRef:J,onOpenChange:t,onPress:rt,onRelease:Ot,onDrag:gt,dismissible:c,shouldAnimate:L,handleOnly:d,isOpen:j,isDragging:z,shouldFade:Ye,closeDrawer:ct,onNestedDrag:tt,onNestedOpenChange:Bt,onNestedRelease:Ze,keyboardIsOpen:ae,modal:v,snapPointsOffset:we,activeSnapPointIndex:fe,direction:C,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:w,container:A,autoFocus:M}},n))}const Pk=O.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:s,modal:a,shouldAnimate:l}=yu(),u=Ik(t,n),c=r&&r.length>0;if(!a)return null;const d=O.useCallback(f=>o(f),[o]);return O.createElement(Jl,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&c?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});Pk.displayName="Drawer.Overlay";const _k=O.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:s,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:x,autoFocus:w}=yu(),[C,S]=O.useState(!1),R=Ik(o,i),I=O.useRef(null),T=O.useRef(null),_=O.useRef(!1),$=m&&m.length>0;_K();const A=(N,B,j=0)=>{if(_.current)return!0;const D=Math.abs(N.y),V=Math.abs(N.x),G=V>D,z=["bottom","right"].includes(B)?1:-1;if(B==="left"||B==="right"){if(!(N.x*z<0)&&V>=0&&V<=j)return G}else if(!(N.y*z<0)&&D>=0&&D<=j)return!G;return _.current=!0,!0};O.useEffect(()=>{$&&window.requestAnimationFrame(()=>{S(!0)})},[]);function M(N){I.current=null,_.current=!1,a(N)}return O.createElement(Kl,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":p&&$?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[d??0]}px`,...t}:t,onPointerDown:N=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,N),I.current={x:N.pageX,y:N.pageY},s(N))},onOpenAutoFocus:N=>{n?.(N),w||N.preventDefault()},onPointerDownOutside:N=>{if(e?.(N),!f||N.defaultPrevented){N.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:N=>{if(!f){N.preventDefault();return}},onPointerMove:N=>{if(T.current=N,y||(r.onPointerMove==null||r.onPointerMove.call(r,N),!I.current))return;const B=N.pageY-I.current.y,j=N.pageX-I.current.x,D=N.pointerType==="touch"?10:2;A({x:j,y:B},g,D)?l(N):(Math.abs(j)>D||Math.abs(B)>D)&&(I.current=null)},onPointerUp:N=>{r.onPointerUp==null||r.onPointerUp.call(r,N),I.current=null,_.current=!1,a(N)},onPointerOut:N=>{r.onPointerOut==null||r.onPointerOut.call(r,N),M(T.current)},onContextMenu:N=>{r.onContextMenu==null||r.onContextMenu.call(r,N),T.current&&M(T.current)}})});_k.displayName="Drawer.Content";const kK=250,jK=120,LK=O.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:f,onDrag:p}=yu(),g=O.useRef(null),m=O.useRef(!1);function v(){if(m.current){w();return}window.setTimeout(()=>{y()},jK)}function y(){if(i||e||m.current){w();return}if(w(),!s||s.length===0){u||o();return}if(a===s[s.length-1]&&u){o();return}const S=s.findIndex(I=>I===a);if(S===-1)return;const R=s[S+1];l(R)}function x(){g.current=window.setTimeout(()=>{m.current=!0},kK)}function w(){g.current&&window.clearTimeout(g.current),m.current=!1}return O.createElement("div",{onClick:v,onPointerCancel:w,onPointerDown:C=>{c&&f(C),x()},onPointerMove:C=>{c&&p(C)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},O.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});LK.displayName="Drawer.Handle";function FK(e){const t=yu(),{container:n=t.container,...r}=e;return O.createElement(Zl,{container:n,...r})}const Ri={Root:DK,Content:_k,Overlay:Pk,Trigger:jd,Portal:FK,Close:fs,Title:Ld,Description:Fd};function BK({...e}){return h.jsx(Ri.Root,{"data-slot":"drawer",...e})}function VK({...e}){return h.jsx(Ri.Trigger,{"data-slot":"drawer-trigger",...e})}function Mk({...e}){return h.jsx(Ri.Portal,{"data-slot":"drawer-portal",...e})}function $K({...e}){return h.jsx(Ri.Close,{"data-slot":"drawer-close",...e})}function Dk({className:e,...t}){return h.jsx(Ri.Overlay,{"data-slot":"drawer-overlay",className:F("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function GK({className:e,children:t,...n}){return h.jsxs(Mk,{"data-slot":"drawer-portal",children:[h.jsx(Dk,{}),h.jsxs(Ri.Content,{"data-slot":"drawer-content",className:F("ui:group/drawer-content ui:bg-background ui:fixed ui:flex ui:h-auto ui:flex-col ui:rounded-t-[10px] ui:z-100 ui:mt-24","ui:data-[vaul-drawer-direction=top]:inset-x-0 ui:data-[vaul-drawer-direction=top]:top-0 ui:data-[vaul-drawer-direction=top]:mb-24 ui:data-[vaul-drawer-direction=top]:max-h-[80vh] ui:data-[vaul-drawer-direction=top]:rounded-b-lg ui:data-[vaul-drawer-direction=top]:border-b","ui:data-[vaul-drawer-direction=bottom]:inset-x-0 ui:data-[vaul-drawer-direction=bottom]:bottom-0 ui:data-[vaul-drawer-direction=bottom]:mt-24 ui:data-[vaul-drawer-direction=bottom]:max-h-[80vh] ui:data-[vaul-drawer-direction=bottom]:rounded-t-lg ui:data-[vaul-drawer-direction=bottom]:border-t","ui:data-[vaul-drawer-direction=right]:inset-y-0 ui:data-[vaul-drawer-direction=right]:right-0 ui:data-[vaul-drawer-direction=right]:w-3/4 ui:data-[vaul-drawer-direction=right]:border-l ui:data-[vaul-drawer-direction=right]:sm:max-w-sm","ui:data-[vaul-drawer-direction=left]:inset-y-0 ui:data-[vaul-drawer-direction=left]:left-0 ui:data-[vaul-drawer-direction=left]:w-3/4 ui:data-[vaul-drawer-direction=left]:border-r ui:data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[h.jsx("div",{className:"ui:bg-muted ui:mx-auto ui:mt-4 ui:hidden ui:h-2 ui:w-[100px] ui:shrink-0 ui:rounded-full ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function HK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-header",className:F("ui:flex ui:flex-col ui:gap-0.5 ui:p-4 ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center ui:group-data-[vaul-drawer-direction=top]/drawer-content:text-center ui:md:gap-1.5 ui:md:text-left",e),...t})}function WK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-footer",className:F("ui:mt-auto ui:flex ui:flex-col ui:gap-2 ui:p-4",e),...t})}function zK({className:e,...t}){return h.jsx(Ri.Title,{"data-slot":"drawer-title",className:F("ui:text-foreground ui:font-semibold",e),...t})}function qK({className:e,...t}){return h.jsx(Ri.Description,{"data-slot":"drawer-description",className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function ox({...e}){return h.jsx(C3,{"data-slot":"dropdown-menu",...e})}function UK({...e}){return h.jsx(QN,{"data-slot":"dropdown-menu-portal",...e})}function ix({...e}){return h.jsx(S3,{"data-slot":"dropdown-menu-trigger",...e})}function sx({className:e,sideOffset:t=4,...n}){return h.jsx(QN,{children:h.jsx(E3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:max-h-(--radix-dropdown-menu-content-available-height) ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-x-hidden ui:overflow-y-auto ui:rounded-md ui:border ui:p-1 ui:shadow-md",e),...n})})}function YK({...e}){return h.jsx(I3,{"data-slot":"dropdown-menu-group",...e})}function kk({className:e,inset:t,variant:n="default",...r}){return h.jsx(A3,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[variant=destructive]:text-destructive ui:data-[variant=destructive]:focus:bg-destructive/10 ui:dark:data-[variant=destructive]:focus:bg-destructive/20 ui:data-[variant=destructive]:focus:text-destructive ui:data-[variant=destructive]:*:[svg]:!text-destructive ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r})}function yv({className:e,children:t,checked:n,...r}){return h.jsxs(T3,{"data-slot":"dropdown-menu-checkbox-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(eO,{children:h.jsx(_e.CheckIcon,{className:"ui:size-4"})})}),t]})}function XK({...e}){return h.jsx(N3,{"data-slot":"dropdown-menu-radio-group",...e})}function ZK({className:e,children:t,...n}){return h.jsxs(O3,{"data-slot":"dropdown-menu-radio-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(eO,{children:h.jsx(_e.CircleIcon,{className:"ui:size-2 ui:fill-current"})})}),t]})}function JK({className:e,inset:t,...n}){return h.jsx(R3,{"data-slot":"dropdown-menu-label","data-inset":t,className:F("ui:px-2 ui:py-1.5 ui:text-sm ui:font-medium ui:data-[inset]:pl-8",e),...n})}function KK({className:e,...t}){return h.jsx(P3,{"data-slot":"dropdown-menu-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function QK({className:e,...t}){return h.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:F("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}function eQ({...e}){return h.jsx(_3,{"data-slot":"dropdown-menu-sub",...e})}function tQ({className:e,inset:t,children:n,...r}){return h.jsxs(M3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[state=open]:bg-accent ui:data-[state=open]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(_e.ChevronRightIcon,{className:"ui:ml-auto ui:size-4"})]})}function nQ({className:e,...t}){return h.jsx(D3,{"data-slot":"dropdown-menu-sub-content",className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-hidden ui:rounded-md ui:border ui:p-1 ui:shadow-lg",e),...t})}function rQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:F("ui:flex ui:min-w-0 ui:flex-1 ui:flex-col ui:items-center ui:justify-center ui:gap-6 ui:rounded-lg ui:border-dashed ui:p-6 ui:text-center ui:text-balance ui:md:p-12",e),...t})}function oQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:F("ui:flex ui:max-w-sm ui:flex-col ui:items-center ui:gap-2 ui:text-center",e),...t})}const iQ=Si("ui:flex ui:shrink-0 ui:items-center ui:justify-center ui:mb-2 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0",{variants:{variant:{default:"ui:bg-transparent",icon:"ui:bg-muted ui:text-foreground ui:flex ui:size-10 ui:shrink-0 ui:items-center ui:justify-center ui:rounded-lg ui:[&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function sQ({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:F(iQ({variant:t,className:e})),...n})}function aQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:F("ui:text-lg ui:font-medium ui:tracking-tight",e),...t})}function lQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:F("ui:text-muted-foreground ui:[&>a:hover]:text-primary ui:text-sm/relaxed ui:[&>a]:underline ui:[&>a]:underline-offset-4",e),...t})}function uQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-content",className:F("ui:flex ui:w-full ui:max-w-sm ui:min-w-0 ui:flex-col ui:items-center ui:gap-4 ui:text-sm ui:text-balance",e),...t})}function jk({message:e,className:t}){return h.jsx("p",{className:F("ui:text-red-500 ui:text-xs ui:mt-2 ui:has-error",t),children:e})}const Lk=b.createContext(null),Fk=b.createContext(null),kf=()=>{const e=b.useContext(Lk),t=b.useContext(Fk);if(!e)throw new Error("useFormField must be used within <FormField>");if(!t)throw new Error("useFormField must be used within <FormItem>");const{id:n}=t,{name:r,error:o}=e;return{name:r,error:o,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`}},Br=e=>h.jsx(cr.Controller,{...e,render:t=>h.jsx(Lk.Provider,{value:{name:e.name,error:t.fieldState.error},children:e.render?.(t)})});function fr({className:e,...t}){const n=b.useId();return h.jsx(Fk.Provider,{value:{id:n},children:h.jsx("div",{"data-slot":"form-item",className:F("ui:grid ui:gap-2",e),...t})})}function oo({className:e,required:t=!1,...n}){const{error:r,formItemId:o}=kf();return h.jsxs(mr,{"data-slot":"form-label","data-error":!!r,htmlFor:o,className:F("ui:text-sm",r?"ui:text-destructive":"ui:text-black-950",e),...n,children:[n.children,t&&h.jsx("span",{className:"ui:text-destructive ml-1",children:"*"})]})}function pr(e){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=kf();return h.jsx(Bo,{"data-slot":"form-control",id:n,"aria-invalid":!!t,"aria-describedby":t?`${r} ${o}`:r,...e})}function po({className:e,...t}){const{formDescriptionId:n}=kf();return h.jsx("p",{"data-slot":"form-description",id:n,className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function Vr({className:e,showErrorPlaceholder:t,...n}){const{error:r,formMessageId:o}=kf(),i=r?String(r.message??""):n.children;return i?h.jsx("p",{"data-slot":"form-message",id:o,className:F("ui:text-destructive ui:text-sm",e),...n,children:i}):t?h.jsx("p",{className:"ui:h-4"}):null}const cQ=({name:e,control:t,formClassName:n,...r})=>{const o=cr.useFormContext(),i=t??o?.control;if(!i)throw new Error("FormCheckbox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:i,name:e,render:({field:s})=>h.jsxs(fr,{className:n,children:[h.jsx(pr,{children:h.jsx(YM,{...s,checked:!!s.value,onCheckedChange:s.onChange,...r})}),h.jsx(Vr,{})]})})};function ax({delayDuration:e=0,...t}){return h.jsx(n9,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function lx({...e}){return h.jsx(ax,{children:h.jsx(r9,{"data-slot":"tooltip",...e})})}function ux({...e}){return h.jsx(o9,{"data-slot":"tooltip-trigger",...e})}function jf({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(i_,{children:h.jsxs(s_,{"data-slot":"tooltip-content",sideOffset:t,className:F("ui:bg-foreground ui:text-background ui:animate-in ui:fade-in-0 ui:zoom-in-95 ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=closed]:zoom-out-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-fit ui:origin-(--radix-tooltip-content-transform-origin) ui:rounded-md ui:px-3 ui:py-1.5 ui:text-xs ui:text-balance",e),...r,children:[n,h.jsx(i9,{className:"ui:bg-foreground ui:fill-foreground ui:z-50 ui:size-2.5 ui:translate-y-[calc(-50%-2px)] ui:rotate-45 ui:rounded-[2px]"})]})})}const Bk=b.forwardRef(({children:e,...t},n)=>h.jsx(i_,{children:h.jsx(jf,{ref:n,...t,children:e})}));Bk.displayName=s_.displayName;const ya=({trigger:e,content:t,asChild:n=!0,wrapTrigger:r=!0,triggerClassName:o="",contentClassName:i="ui:max-w-sm",disableContent:s=!1,isPortal:a=!1})=>s?e:h.jsxs(lx,{children:[h.jsx(ux,{asChild:n,children:r?h.jsx("div",{className:F("ui:truncate",o),children:e}):e}),a?h.jsx(Bk,{className:i,children:t}):h.jsx(jf,{className:i,children:t})]}),dQ=({name:e,label:t,placeholder:n,items:r=[],description:o,multiple:i=!1,emptyMessage:s="No results found",containerClassName:a,hasClearButton:l=!1,hasAllOption:u=!1,allOptionLabel:c="All",disabled:d=!1,tooltipContent:f,control:p,inputMode:g="input"})=>{const m=cr.useFormContext(),v=p??m?.control;if(!v)throw new Error("FormCombobox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:v,name:e,render:({field:y})=>h.jsxs(fr,{className:F("ui:flex ui:flex-col",a),children:[t&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!f}),children:[t,f&&h.jsx(ya,{triggerClassName:"ui:order-last",content:f,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(tx,{items:r,multiple:i,value:y.value,onValueChange:y.onChange,placeholder:n,emptyMessage:s,disabled:d,hasClearButton:l,hasAllOption:u,allOptionLabel:c,inputMode:g}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},fQ=({name:e,control:t,disabledCondition:n=!1,label:r,placeholder:o,description:i,containerClassName:s,triggerClassName:a,showErrorPlaceholder:l})=>{const u=cr.useFormContext(),c=t??u?.control;if(!c)throw new Error("FormDatePicker must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(fr,{className:F("ui:flex ui:flex-col",s),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(oo,{children:r})})}),h.jsxs(nx,{children:[h.jsx(Mf,{asChild:!0,children:h.jsx(pr,{children:h.jsxs(Jt,{variant:"outline",className:F("ui:w-[240px] ui:pl-3 ui:text-left ui:font-normal",!d.value&&"ui:text-muted-foreground",a),children:[d.value?ti(new Date(d.value),"dd/MM/yyyy"):h.jsx("span",{children:o}),h.jsx(_e.CalendarIcon,{className:"ui:ml-auto ui:h-4 ui:w-4 ui:opacity-50"})]})})}),h.jsx(Df,{className:"ui:w-auto ui:p-0",align:"start",children:h.jsx(e0,{mode:"single",selected:d.value?new Date(d.value):void 0,onSelect:f=>{f&&d.onChange(f)},disabled:n,initialFocus:!0})})]}),h.jsx(In,{children:h.jsx(Vt,{condition:!!i,children:h.jsx(po,{children:i})})}),h.jsx(Vr,{showErrorPlaceholder:l})]})})},pQ=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},hQ=e=>e.type.startsWith("image/"),gQ=({uploadedFile:e,onRemove:t})=>h.jsx("div",{className:"ui:p-3 ui:bg-muted/50 ui:border ui:border-border ui:rounded-lg",children:h.jsxs("div",{className:"ui:flex ui:items-center ui:justify-between ui:gap-3",children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-3 ui:min-w-0",children:[hQ(e.file)?h.jsx("img",{src:e.url,alt:e.file.name,className:"ui:shrink-0 ui:w-10 ui:h-10 ui:object-cover ui:rounded-md"}):h.jsx("div",{className:"ui:shrink-0 ui:p-2 ui:bg-primary/10 ui:rounded-md",children:h.jsx(_e.FileText,{size:20,className:"ui:text-primary"})}),h.jsxs("div",{className:"ui:min-w-0",children:[h.jsx("p",{className:"ui:text-sm ui:font-medium ui:text-foreground ui:truncate",children:e.file.name}),h.jsx("p",{className:"ui:text-xs ui:text-muted-foreground",children:pQ(e.file.size)})]})]}),h.jsx(Do,{variant:"ghost",size:"sm",isIconOnly:!0,onClick:t,icon:h.jsx(_e.X,{size:16}),className:F("ui:shrink-0 ui:text-muted-foreground","ui:hover:text-destructive ui:hover:bg-destructive/10")})]})}),Vk=({name:e,control:t,label:n,uploadButtonLabel:r="Upload File",uploadingLabel:o="Uploading...",uploadFailedMessage:i="Upload failed",description:s,accept:a="*",disabled:l=!1,multiple:u=!1,containerClassName:c,tooltipContent:d,hasRequiredIndicator:f=!1,onUpload:p})=>{const g=cr.useFormContext(),m=t??g?.control;if(!m)throw new Error("FormFileUpload must be used within a FormProvider or receive a control prop");const v=O.useRef(null),[y,x]=O.useState(!1),w=async(S,R,I)=>{const T=S.target.files;if(T?.length){x(!0);try{if(u){const _=Array.from(T),$=[];for(const M of _){const N=p?await p(M):URL.createObjectURL(M);$.push({file:M,url:N})}const A=Array.isArray(I)?I:[];R([...A,...$])}else{const _=T[0],$=p?await p(_):URL.createObjectURL(_);R({file:_,url:$})}}catch(_){const $=_ instanceof Error?_.message:i;Jv.toast.error($)}finally{x(!1),v.current&&(v.current.value="")}}},C=(S,R,I)=>{if(u&&Array.isArray(R)&&I){const T=R.filter(_=>_!==I);S(T.length>0?T:null)}else S(null);v.current&&(v.current.value="")};return h.jsx(Br,{control:m,name:e,render:({field:S})=>{const R=S.value,I=u?Array.isArray(R)?R:[]:R&&"file"in R?[R]:[];return h.jsxs(fr,{className:F("ui:w-full",c),children:[n&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!d}),children:[n,f&&h.jsx("span",{children:"*"}),d&&h.jsx(ya,{content:d,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:text-muted-foreground ui:cursor-pointer"})})]}),h.jsx(pr,{children:h.jsxs("div",{className:"ui:space-y-3",children:[h.jsxs("div",{className:"ui:relative ui:inline-block",children:[h.jsx("input",{ref:v,type:"file",accept:a,multiple:u,onChange:T=>w(T,S.onChange,R),disabled:l||y,className:F("ui:absolute ui:inset-0 ui:w-full ui:h-full ui:opacity-0 ui:cursor-pointer","ui:disabled:cursor-not-allowed")}),h.jsx(Do,{variant:"outline",label:y?o:r,icon:y?h.jsx(_e.Loader2,{size:16,className:"ui:animate-spin"}):h.jsx(_e.Upload,{size:16}),disabled:l||y})]}),I.length>0&&h.jsx("div",{className:"ui:space-y-2",children:I.map((T,_)=>h.jsx(gQ,{uploadedFile:T,onRemove:()=>C(S.onChange,R,T)},`${T.file.name}-${T.file.size}-${_}`))})]})}),h.jsx(Vr,{}),s&&h.jsx(po,{children:s})]})}})};Vk.displayName="FormFileUpload";const cx=O.forwardRef(({name:e,label:t,labelVariant:n,type:r,value:o,onChange:i,description:s="",placeholder:a,className:l,inputClassName:u,isReadOnly:c=!1,hasRequiredIndicator:d=!1,...f},p)=>h.jsxs("article",{className:l,children:[t&&h.jsxs(mr,{variant:n,className:"ui:mb-2",children:[t,d&&h.jsx("span",{children:"*"})]}),h.jsx(vu,{ref:p,"data-test-id":e,placeholder:a,value:o,type:r,onChange:i,className:F({"ui:pointer-events-none ui:opacity-30":c},u),...f}),s&&h.jsx(If,{description:s})]})),mQ=({label:e,containerClassName:t,inputClassName:n,name:r,description:o,placeholder:i="",tooltipContent:s,hasRequiredIndicator:a=!1,control:l,...u})=>{const c=cr.useFormContext(),d=l??c?.control;if(!d)throw new Error("FormInput must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:d,name:r,render:({field:f})=>h.jsxs(fr,{className:F("ui:w-full",t),children:[h.jsxs(oo,{className:s?"ui:flex ui:items-center ui:gap-2":void 0,children:[e,a&&h.jsx("span",{children:"*"}),s&&h.jsx(ya,{content:s,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(pr,{children:h.jsx(cx,{...f,...u,placeholder:i,inputClassName:F(n)})}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},bQ=({label:e,name:t,containerClassName:n,description:r,placeholder:o,tooltipContent:i,control:s,hasRequiredIndicator:a=!1,...l})=>{const u=cr.useFormContext(),c=s??u?.control;if(!c)throw new Error("FormPassword must be used within a FormProvider or receive a control prop");const[d,f]=O.useState(!1),p=()=>{f(g=>!g)};return h.jsx(Br,{control:c,name:t,render:({field:g})=>h.jsxs(fr,{className:F("ui:w-full",n),children:[e&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!i}),children:[e,a&&h.jsx("span",{children:"*"}),i&&h.jsx(ya,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(pr,{children:h.jsxs("div",{className:"ui:relative",children:[h.jsx(cx,{...g,...l,type:d?"text":"password",placeholder:o,hasRequiredIndicator:a,inputClassName:"pr-8"}),h.jsx("button",{type:"button",onClick:p,className:"ui:absolute ui:right-3 ui:top-1/2 ui:-translate-y-1/2 ui:text-muted-foreground ui:hover:text-foreground ui:transition-colors",tabIndex:-1,children:d?h.jsx(_e.EyeOff,{size:16,className:"ui:cursor-pointer"}):h.jsx(_e.Eye,{size:16,className:"ui:cursor-pointer"})})]})}),r&&h.jsx(po,{children:r}),h.jsx(Vr,{})]})})};function $k({className:e,...t}){return h.jsx(fG,{"data-slot":"radio-group",className:F("ui:grid ui:gap-3",e),...t})}function Gk({className:e,...t}){return h.jsx(pG,{"data-slot":"radio-group-item",className:F("ui:p-0! ui:aspect-square ui:h-4 ui:w-4 ui:rounded-full ui:border ui:border-solid ui:border-primary ui:text-primary ui:bg-transparent ui:hover:bg-transparent ui:ring-offset-background ui:focus:outline-none ui:focus-visible:ring-2 ui:focus-visible:ring-ring ui:focus-visible:ring-offset-2 ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:transition-none",e),...t,children:h.jsx(hG,{"data-slot":"radio-group-indicator",className:"ui:relative ui:flex ui:items-center ui:justify-center",children:h.jsx(_e.CircleIcon,{className:"ui:fill-primary ui:absolute ui:top-1/2 ui:left-1/2 ui:size-2 ui:-translate-x-1/2 ui:-translate-y-1/2"})})})}const vQ=({name:e,label:t,items:n,control:r,containerClassName:o,itemClassName:i,itemLabelClassName:s,selectedClassName:a,description:l})=>{const u=cr.useFormContext(),c=r??u?.control;if(!c)throw new Error("FormRadio must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(fr,{className:F("ui:space-y-3",o),children:[t&&h.jsx(oo,{children:t}),h.jsx(pr,{children:h.jsx($k,{onValueChange:d.onChange,defaultValue:d.value,className:"ui:flex ui:flex-col ui:space-y-1",children:n.map(f=>h.jsxs(fr,{className:F("ui:flex ui:items-center ui:space-y-0",i,d.value===f.value&&a),children:[h.jsx(pr,{children:h.jsx(Gk,{value:f.value})}),h.jsx(oo,{className:F("ui:font-normal",s),children:f.label})]},f.value))})}),h.jsx(Vr,{}),l&&h.jsx(po,{children:l})]})})};function Hk({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const s=b.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return h.jsxs(IH,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:F("ui:relative ui:flex ui:w-full ui:touch-none ui:items-center ui:select-none ui:data-[disabled]:opacity-50 ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:min-h-44 ui:data-[orientation=vertical]:w-auto ui:data-[orientation=vertical]:flex-col",e),...i,children:[h.jsx(RH,{"data-slot":"slider-track",className:F("ui:bg-muted ui:relative ui:grow ui:overflow-hidden ui:rounded-full ui:data-[orientation=horizontal]:h-1.5 ui:data-[orientation=horizontal]:w-full ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:w-1.5"),children:h.jsx(AH,{"data-slot":"slider-range",className:F("ui:bg-primary ui:absolute ui:data-[orientation=horizontal]:h-full ui:data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(a,l)=>h.jsx(TH,{"data-slot":"slider-thumb",className:"ui:border-primary ui:ring-ring/50 ui:block ui:size-4 ui:shrink-0 ui:rounded-full ui:border ui:bg-white ui:shadow-sm ui:transition-[color,box-shadow] ui:hover:ring-4 ui:focus-visible:ring-4 ui:focus-visible:outline-hidden ui:disabled:pointer-events-none ui:disabled:opacity-50"},l))]})}const yQ=({name:e,control:t,label:n,description:r,min:o=0,max:i=100,step:s=1,leftLabel:a,rightLabel:l,showLabels:u=!0,complementaryField:c,onValueChange:d,containerClassName:f,labelClassName:p,showErrorPlaceholder:g=!1,tooltipContent:m,...v})=>{const y=cr.useFormContext(),x=t??y?.control;if(!x)throw new Error("FormSlider must be used within a FormProvider or receive a control prop");const w=O.useRef(!1),C=cr.useWatch({control:x,name:e});return h.jsx(Br,{control:x,name:e,render:({field:S})=>{const R=T=>{if(w.current)return;const _=T[0];w.current=!0,S.onChange(String(_)),c&&y?.setValue&&y.setValue(c,String(i-_),{shouldValidate:!0}),d&&d(_),setTimeout(()=>{w.current=!1},0)},I=Number(C)||o+(i-o)/2;return h.jsxs(fr,{className:F("ui:w-full",f),children:[h.jsx(In,{children:h.jsx(Vt,{condition:!!n,children:h.jsxs(oo,{className:F(p,{"ui:flex ui:items-center ui:gap-2":!!m}),children:[n,m&&h.jsx(ya,{content:m,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,color:"#737373",className:"ui:cursor-pointer"})})]})})}),h.jsx(pr,{children:h.jsxs("div",{className:"ui:space-y-2",children:[h.jsx(Hk,{value:[I],onValueChange:R,min:o,max:i,step:s,className:"ui:w-full",...v}),u&&h.jsxs("div",{className:"ui:flex ui:justify-between ui:text-sm ui:text-gray-600",children:[a&&h.jsxs("span",{children:[a,": ",I,i===100?"%":""]}),l&&h.jsxs("span",{children:[l,": ",c?i-I:I,i===100?"%":""]})]})]})}),h.jsx(In,{children:h.jsx(Vt,{condition:!!r,children:h.jsx(po,{className:"ui:text-xs",children:r})})}),h.jsx(Vr,{showErrorPlaceholder:g})]})}})};function Wk({className:e,...t}){return h.jsx(MH,{"data-slot":"switch",className:F("ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:p-0",e),...t,children:h.jsx(DH,{"data-slot":"switch-thumb",className:F("ui:bg-background ui:dark:data-[state=unchecked]:bg-foreground ui:dark:data-[state=checked]:bg-primary-foreground ui:pointer-events-none ui:block ui:size-4 ui:rounded-full ui:ring-0 ui:transition-transform ui:data-[state=checked]:translate-x-[calc(100%-2px)] ui:data-[state=unchecked]:translate-x-0")})})}const zk=({label:e,name:t,...n})=>h.jsxs("article",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx(Wk,{id:t,...n}),h.jsx(mr,{htmlFor:t,children:e})]}),xQ=({name:e,label:t,description:n,control:r,...o})=>{const i=cr.useFormContext(),s=r??i?.control;if(!s)throw new Error("FormSwitch must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:s,name:e,render:({field:a})=>h.jsxs(fr,{children:[h.jsx(pr,{children:h.jsx(zk,{...a,...o,label:t,checked:!!a.value,onCheckedChange:a.onChange})}),h.jsx(Vr,{}),n&&h.jsx(po,{children:n})]})})},qk=({textAreaClassName:e,value:t,onChange:n,label:r,...o})=>h.jsxs("article",{children:[r&&h.jsx(mr,{className:"ui:mb-2 ui:block",children:r}),h.jsx(mk,{className:F("ui:w-full",e),value:t,onChange:n,...o})]}),wQ=({label:e,name:t,description:n,placeholder:r,containerClassName:o,control:i,...s})=>{const a=cr.useFormContext(),l=i??a?.control;if(!l)throw new Error("FormTextarea must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:l,name:t,render:({field:u})=>h.jsxs(fr,{className:F("ui:w-full",o),children:[h.jsx(oo,{children:e}),h.jsx(pr,{children:h.jsx(qk,{placeholder:r,...u,...s})}),n&&h.jsx(po,{children:n}),h.jsx(Vr,{})]})})};function CQ({...e}){return h.jsx(G3,{"data-slot":"hover-card",...e})}function SQ({...e}){return h.jsx(H3,{"data-slot":"hover-card-trigger",...e})}function EQ({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(W3,{"data-slot":"hover-card-portal",children:h.jsx(z3,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-64 ui:origin-(--radix-hover-card-content-transform-origin) ui:rounded-md ui:border ui:p-4 ui:shadow-md ui:outline-hidden",e),...r})})}function IQ({name:e,className:t,...n}){return h.jsx("i",{className:F(`icon-${e}`,t),...n,children:h.jsxs("span",{className:"ui:for-screenreader-only",children:[e," icon"]})})}var RQ=Object.defineProperty,AQ=Object.defineProperties,TQ=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,Uk=Object.prototype.hasOwnProperty,Yk=Object.prototype.propertyIsEnumerable,uI=(e,t,n)=>t in e?RQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NQ=(e,t)=>{for(var n in t||(t={}))Uk.call(t,n)&&uI(e,n,t[n]);if(md)for(var n of md(t))Yk.call(t,n)&&uI(e,n,t[n]);return e},OQ=(e,t)=>AQ(e,TQ(t)),PQ=(e,t)=>{var n={};for(var r in e)Uk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&md)for(var r of md(e))t.indexOf(r)<0&&Yk.call(e,r)&&(n[r]=e[r]);return n};function _Q(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function MQ(e){let t=b.useRef();return b.useEffect(()=>{t.current=e}),t.current}var DQ=18,Xk=40,kQ=`${Xk}px`,jQ=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function LQ({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[o,i]=b.useState(!1),[s,a]=b.useState(!1),[l,u]=b.useState(!1),c=b.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&o&&s,[o,s,n]),d=b.useCallback(()=>{let f=e.current,p=t.current;if(!f||!p||l||n==="none")return;let g=f,m=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,y=m-DQ,x=v;document.querySelectorAll(jQ).length===0&&document.elementFromPoint(y,x)===f||(i(!0),u(!0))},[e,t,l,n]);return b.useEffect(()=>{let f=e.current;if(!f||n==="none")return;function p(){let m=window.innerWidth-f.getBoundingClientRect().right;a(m>=Xk)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,n]),b.useEffect(()=>{let f=r||document.activeElement===t.current;if(n==="none"||!f)return;let p=setTimeout(d,0),g=setTimeout(d,2e3),m=setTimeout(d,5e3),v=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(m),clearTimeout(v)}},[t,r,n,d]),{hasPWMBadge:o,willPushPWMBadge:c,PWM_BADGE_SPACE_WIDTH:kQ}}var FQ=b.createContext({}),Zk=b.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,maxLength:i,textAlign:s="left",pattern:a,placeholder:l,inputMode:u="numeric",onComplete:c,pushPasswordManagerStrategy:d="increase-width",pasteTransformer:f,containerClassName:p,noScriptCSSFallback:g=BQ,render:m,children:v}=n,y=PQ(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),x,w,C,S,R;let[I,T]=b.useState(typeof y.defaultValue=="string"?y.defaultValue:""),_=r??I,$=MQ(_),A=b.useCallback(k=>{o?.(k),T(k)},[o]),M=b.useMemo(()=>a?typeof a=="string"?new RegExp(a):a:null,[a]),N=b.useRef(null),B=b.useRef(null),j=b.useRef({value:_,onChange:A,isIOS:typeof window<"u"&&((w=(x=window?.CSS)==null?void 0:x.supports)==null?void 0:w.call(x,"-webkit-touch-callout","none"))}),D=b.useRef({prev:[(C=N.current)==null?void 0:C.selectionStart,(S=N.current)==null?void 0:S.selectionEnd,(R=N.current)==null?void 0:R.selectionDirection]});b.useImperativeHandle(t,()=>N.current,[]),b.useEffect(()=>{let k=N.current,ie=B.current;if(!k||!ie)return;j.current.value!==k.value&&j.current.onChange(k.value),D.current.prev=[k.selectionStart,k.selectionEnd,k.selectionDirection];function Y(){if(document.activeElement!==k){W(null),K(null);return}let re=k.selectionStart,fe=k.selectionEnd,de=k.selectionDirection,ve=k.maxLength,we=k.value,Se=D.current.prev,Ye=-1,at=-1,Xe;if(we.length!==0&&re!==null&&fe!==null){let gt=re===fe,ct=re===we.length&&we.length<ve;if(gt&&!ct){let ot=re;if(ot===0)Ye=0,at=1,Xe="forward";else if(ot===ve)Ye=ot-1,at=ot,Xe="backward";else if(ve>1&&we.length>1){let mt=0;if(Se[0]!==null&&Se[1]!==null){Xe=ot<Se[1]?"backward":"forward";let Ot=Se[0]===Se[1]&&Se[0]<ve;Xe==="backward"&&!Ot&&(mt=-1)}Ye=mt+ot,at=mt+ot+1}}Ye!==-1&&at!==-1&&Ye!==at&&N.current.setSelectionRange(Ye,at,Xe)}let Ue=Ye!==-1?Ye:re,rt=at!==-1?at:fe,et=Xe??de;W(Ue),K(rt),D.current.prev=[Ue,rt,et]}if(document.addEventListener("selectionchange",Y,{capture:!0}),Y(),document.activeElement===k&&H(!0),!document.getElementById("input-otp-style")){let re=document.createElement("style");if(re.id="input-otp-style",document.head.appendChild(re),re.sheet){let fe="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Wa(re.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Wa(re.sheet,`[data-input-otp]:autofill { ${fe} }`),Wa(re.sheet,`[data-input-otp]:-webkit-autofill { ${fe} }`),Wa(re.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Wa(re.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let le=()=>{ie&&ie.style.setProperty("--root-height",`${k.clientHeight}px`)};le();let pe=new ResizeObserver(le);return pe.observe(k),()=>{document.removeEventListener("selectionchange",Y,{capture:!0}),pe.disconnect()}},[]);let[V,G]=b.useState(!1),[z,H]=b.useState(!1),[ne,W]=b.useState(null),[J,K]=b.useState(null);b.useEffect(()=>{_Q(()=>{var k,ie,Y,le;(k=N.current)==null||k.dispatchEvent(new Event("input"));let pe=(ie=N.current)==null?void 0:ie.selectionStart,re=(Y=N.current)==null?void 0:Y.selectionEnd,fe=(le=N.current)==null?void 0:le.selectionDirection;pe!==null&&re!==null&&(W(pe),K(re),D.current.prev=[pe,re,fe])})},[_,z]),b.useEffect(()=>{$!==void 0&&_!==$&&$.length<i&&_.length===i&&c?.(_)},[i,c,$,_]);let U=LQ({containerRef:B,inputRef:N,pushPasswordManagerStrategy:d,isFocused:z}),oe=b.useCallback(k=>{let ie=k.currentTarget.value.slice(0,i);if(ie.length>0&&M&&!M.test(ie)){k.preventDefault();return}typeof $=="string"&&ie.length<$.length&&document.dispatchEvent(new Event("selectionchange")),A(ie)},[i,A,$,M]),X=b.useCallback(()=>{var k;if(N.current){let ie=Math.min(N.current.value.length,i-1),Y=N.current.value.length;(k=N.current)==null||k.setSelectionRange(ie,Y),W(ie),K(Y)}H(!0)},[i]),te=b.useCallback(k=>{var ie,Y;let le=N.current;if(!f&&(!j.current.isIOS||!k.clipboardData||!le))return;let pe=k.clipboardData.getData("text/plain"),re=f?f(pe):pe;k.preventDefault();let fe=(ie=N.current)==null?void 0:ie.selectionStart,de=(Y=N.current)==null?void 0:Y.selectionEnd,ve=(fe!==de?_.slice(0,fe)+re+_.slice(de):_.slice(0,fe)+re+_.slice(fe)).slice(0,i);if(ve.length>0&&M&&!M.test(ve))return;le.value=ve,A(ve);let we=Math.min(ve.length,i-1),Se=ve.length;le.setSelectionRange(we,Se),W(we),K(Se)},[i,A,M,_]),Q=b.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),se=b.useMemo(()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:s,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,s]),ae=b.useMemo(()=>b.createElement("input",OQ(NQ({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":_.length===0||void 0,"data-input-otp-mss":ne,"data-input-otp-mse":J,inputMode:u,pattern:M?.source,"aria-placeholder":l,style:se,maxLength:i,value:_,ref:N,onPaste:k=>{var ie;te(k),(ie=y.onPaste)==null||ie.call(y,k)},onChange:oe,onMouseOver:k=>{var ie;G(!0),(ie=y.onMouseOver)==null||ie.call(y,k)},onMouseLeave:k=>{var ie;G(!1),(ie=y.onMouseLeave)==null||ie.call(y,k)},onFocus:k=>{var ie;X(),(ie=y.onFocus)==null||ie.call(y,k)},onBlur:k=>{var ie;H(!1),(ie=y.onBlur)==null||ie.call(y,k)}})),[oe,X,te,u,se,i,J,ne,y,M?.source,_]),L=b.useMemo(()=>({slots:Array.from({length:i}).map((k,ie)=>{var Y;let le=z&&ne!==null&&J!==null&&(ne===J&&ie===ne||ie>=ne&&ie<J),pe=_[ie]!==void 0?_[ie]:null,re=_[0]!==void 0?null:(Y=l?.[ie])!=null?Y:null;return{char:pe,placeholderChar:re,isActive:le,hasFakeCaret:le&&pe===null}}),isFocused:z,isHovering:!y.disabled&&V}),[z,V,i,J,ne,y.disabled,_]),Z=b.useMemo(()=>m?m(L):b.createElement(FQ.Provider,{value:L},v),[v,L,m]);return b.createElement(b.Fragment,null,g!==null&&b.createElement("noscript",null,b.createElement("style",null,g)),b.createElement("div",{ref:B,"data-input-otp-container":!0,style:Q,className:p},Z,b.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ae)))});Zk.displayName="Input";function Wa(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var BQ=`
89
89
  [data-input-otp] {
90
90
  --nojs-bg: white !important;
91
91
  --nojs-fg: black !important;
@@ -29479,7 +29479,7 @@ function pK({ className: e, ...t }) {
29479
29479
  {
29480
29480
  "data-slot": "switch",
29481
29481
  className: F(
29482
- "ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",
29482
+ "ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:p-0",
29483
29483
  e
29484
29484
  ),
29485
29485
  ...t,
@@ -29514,7 +29514,7 @@ const hK = ({ label: e, name: t, ...n }) => /* @__PURE__ */ ee("article", { clas
29514
29514
  control: s,
29515
29515
  name: e,
29516
29516
  render: ({ field: a }) => /* @__PURE__ */ ee(kr, { children: [
29517
- /* @__PURE__ */ v(Lr, { children: /* @__PURE__ */ v(hK, { ...a, ...o, label: t }) }),
29517
+ /* @__PURE__ */ v(Lr, { children: /* @__PURE__ */ v(hK, { ...a, ...o, label: t, checked: !!a.value, onCheckedChange: a.onChange }) }),
29518
29518
  /* @__PURE__ */ v(bo, {}),
29519
29519
  n && /* @__PURE__ */ v(zo, { children: n })
29520
29520
  ] })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@segmentify/ui",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "A collection of reusable React UI components built with Tailwind CSS and Radix UI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,2 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
- export declare const Iphone15: ({ children }: PropsWithChildren) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
- type PreviewSingleButtonProps = {
3
- className?: string;
4
- };
5
- export declare const PreviewSingleButton: ({ children, className }: PropsWithChildren<PreviewSingleButtonProps>) => import("react/jsx-runtime").JSX.Element;
6
- export {};
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import type { VariantProps } from 'class-variance-authority';
3
- import { buttonVariants } from '../../lib/design-variants';
4
- import type { Union } from 'ts-toolbelt';
5
- type BaseProps = {
6
- title: string;
7
- description: string;
8
- onAction: () => void;
9
- children?: React.ReactNode;
10
- cancelLabel: string;
11
- actionLabel: string;
12
- actionVariant?: VariantProps<typeof buttonVariants>['variant'];
13
- };
14
- type ControlledProps = BaseProps & {
15
- controlled: true;
16
- open: boolean;
17
- setOpen: (open: boolean) => void;
18
- };
19
- type UncontrolledProps = BaseProps & {
20
- controlled?: false;
21
- };
22
- type Props = Union.Strict<ControlledProps | UncontrolledProps>;
23
- export declare const ConfirmationDialog: ({ title, description, onAction, children, cancelLabel, actionLabel, actionVariant, open, setOpen, controlled, }: Props) => import("react/jsx-runtime").JSX.Element;
24
- export {};
@@ -1,5 +0,0 @@
1
- import { MessagingPhoneProps } from '../../types/messaging';
2
- export declare const PreviewSMS: {
3
- ({ messageData }: MessagingPhoneProps): import("react/jsx-runtime").JSX.Element | null;
4
- displayName: string;
5
- };
@@ -1,15 +0,0 @@
1
- import { type PropsWithChildren } from 'react';
2
- type WhatsappMessageProps = {
3
- cards?: {
4
- image?: string;
5
- title?: string;
6
- content?: string;
7
- buttons: {
8
- text?: string;
9
- yupButtonsText?: string;
10
- }[];
11
- }[];
12
- includeTime?: boolean;
13
- };
14
- export declare const WhatsappMessage: ({ children, cards, includeTime }: PropsWithChildren<WhatsappMessageProps>) => import("react/jsx-runtime").JSX.Element;
15
- export {};