@als-tp/als-react-ts-ui 0.1.1 → 0.1.3

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.
@@ -17,5 +17,5 @@ Avoid returning a new reference inside your input selector, e.g.
17
17
  ${i.right}px ${i.bottom}px,
18
18
  ${i.right}px ${i.top}px,
19
19
  ${i.left}px ${i.top}px
20
- )`}return P.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Co.displayName="InternalBackdrop");const Lc=a.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=kt(),i=s.useState("mounted"),c=s.useState("modal");return i||o?P.jsx(Kr.Provider,{value:o,children:P.jsxs(Eo,{ref:n,...r,children:[i&&c===!0&&P.jsx(Co,{ref:s.context.internalBackdropRef,inert:Ro(!open)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(Lc.displayName="DialogPortal");let Js={},Qs={},ei="";function nm(e){if(typeof document>"u")return!1;const t=Ke(e);return De(t).innerWidth-t.documentElement.clientWidth>0}function om(e){const t=Ke(e),n=t.documentElement,o=t.body,r=Kt(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function rm(e){const t=Ke(e),n=t.documentElement,o=t.body,r=De(n);let s=0,i=0;const c=Ie.create(),u=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(Ii&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),m=r.getComputedStyle(o),E=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Js={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ei=n.style.scrollBehavior,Qs={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,x=p.overflowY==="scroll"||m.overflowY==="scroll",v=p.overflowX==="scroll"||m.overflowX==="scroll",R=Math.max(0,r.innerWidth-n.clientWidth),_=Math.max(0,r.innerHeight-n.clientHeight),T=parseFloat(m.marginTop)+parseFloat(m.marginBottom),N=parseFloat(m.marginLeft)+parseFloat(m.marginRight),F=Kt(n)?n:o;if(u){n.style.scrollbarGutter=E,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(b||x)&&(n.style.overflowY="scroll"),(y||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:T||_?`calc(100dvh - ${T+_}px)`:"100dvh",width:N||R?`calc(100vw - ${N+R}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,Js),Object.assign(o.style,Qs),u||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ei)}function d(){f(),c.request(l)}return l(),r.addEventListener("resize",d),()=>{c.cancel(),f(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",d)}}class sm{lockCount=0;restore=null;timeoutLock=pt.create();timeoutUnlock=pt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Ke(t).documentElement,r=De(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=nt;return}const s=Cu||!nm(t);this.restore=s?om(t):rm(t)}}const im=new sm;function Gr(e=!0,t=null){X(()=>{if(e)return im.acquire(t)},[e,t])}function cm(e){const t=a.useRef(""),n=a.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:a.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function kc(e){const[t,n]=a.useState(null),o=Q((c,u)=>{e||n(u)}),r=a.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=cm(o);return a.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}function am(e){const{store:t,parentContext:n,actionsRef:o}=e,r=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),c=t.useState("popupElement"),{openMethod:u,triggerProps:l,reset:f}=kc(r);_c(t);const{forceUnmount:d}=Tc(r,t,()=>{f()}),p=Q(L=>{const k=ge(L);return k.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},k}),m=a.useCallback(()=>{t.setOpen(!1,p(xi))},[t,p]);a.useImperativeHandle(o,()=>({unmount:d,close:m}),[d,m]);const g=Nc({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,E]=a.useState(0),b=h===0,y=Mc(g),x=Ur(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(L){if("button"in L&&L.button!==0||"touches"in L&&L.touches.length!==1)return!1;const k=qe(L);if(b&&!s){const A=k;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===A||t.context.backdropRef.current===A||xe(A,c)&&!A?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:b});Gr(r&&i===!0,c);const{getReferenceProps:v,getFloatingProps:R,getTriggerProps:_}=Mn([y,x]);t.useContextCallback("onNestedDialogOpen",L=>{E(L+1)}),t.useContextCallback("onNestedDialogClose",()=>{E(0)}),a.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,h]);const T=a.useMemo(()=>v(l),[v,l]),N=a.useMemo(()=>_(l),[_,l]),F=a.useMemo(()=>R(),[R]);t.useSyncedValues({openMethod:u,activeTriggerProps:T,inactiveTriggerProps:N,popupProps:F,floatingRootContext:g,nestedOpenDialogCount:h})}const lm={...Pc,modal:se(e=>e.modal),nested:se(e=>e.nested),nestedOpenDialogCount:se(e=>e.nestedOpenDialogCount),disablePointerDismissal:se(e=>e.disablePointerDismissal),openMethod:se(e=>e.openMethod),descriptionElementId:se(e=>e.descriptionElementId),titleElementId:se(e=>e.titleElementId),viewportElement:se(e=>e.viewportElement),role:se(e=>e.role)};class um extends Wr{constructor(t){super(fm(t),{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),triggerElements:new So,onOpenChange:void 0,onOpenChangeComplete:void 0},lm)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const r={open:t},s=n.trigger?.id??null;(s||t)&&(r.activeTriggerId=s,r.activeTriggerElement=n.trigger??null),this.update(r)}}function fm(e={}){return{...Oc(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function dm(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:f,defaultTriggerId:d=null}=e,p=kt(!0),m=!!p,g=Je(()=>l?.store??new um({open:n??o,activeTriggerId:f!==void 0?f:d,modal:c,disablePointerDismissal:i,nested:m})).current;g.useControlledProp("open",n,o),g.useControlledProp("activeTriggerId",f,d),g.useSyncedValues({disablePointerDismissal:i,nested:m,modal:c}),g.useContextCallback("onOpenChange",r),g.useContextCallback("onOpenChangeComplete",s);const h=g.useState("payload");am({store:g,actionsRef:u,parentContext:p?.store.context});const E=a.useMemo(()=>({store:g}),[g]);return P.jsx(Lr.Provider,{value:E,children:typeof t=="function"?t({payload:h}):t})}const Fc=a.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:c}=kt(),u=ut(s);return c.useSyncedValueWithCleanup("titleElementId",u),ye("h2",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(Fc.displayName="DialogTitle");const Vc=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...f}=t,d=kt(!0),p=l?.store??d?.store;if(!p)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":Ae(79));const m=ut(c),g=p.useState("floatingRootContext"),h=p.useState("isOpenedByTrigger",m),[E,b]=a.useState(null),{registerTrigger:y,isMountedByThisTrigger:x}=Cc(m,E,p,{payload:u}),{getButtonProps:v,buttonRef:R}=St({disabled:s,native:i}),_=Hr(g,{enabled:g!=null}),T=Mn([_]),N=a.useMemo(()=>({disabled:s,open:h}),[s,h]),F=p.useState("triggerProps",x);return ye("button",t,{state:N,ref:[R,n,y,b],props:[T.getReferenceProps(),F,{[Er]:"",id:m},f,v],stateAttributesMapping:kr})});process.env.NODE_ENV!=="production"&&(Vc.displayName="DialogTrigger");const pm="_backdrop_n0fed_10",mm="_popup_n0fed_32",gm="_title_n0fed_137",hm="_description_n0fed_150",ym="_close_n0fed_161",bm="_closeIcon_n0fed_194",vm="_trigger_n0fed_203",bt={backdrop:pm,popup:mm,"popup--default":"_popup--default_n0fed_59","popup--centered":"_popup--centered_n0fed_74","popup--fullscreen":"_popup--fullscreen_n0fed_89","popup--sm":"_popup--sm_n0fed_111","popup--md":"_popup--md_n0fed_117","popup--lg":"_popup--lg_n0fed_123",title:gm,description:hm,close:ym,closeIcon:bm,trigger:vm},jc=ne.createContext({variant:"default",size:"md"}),Em=()=>ne.useContext(jc),$c=ne.forwardRef(({open:e,defaultOpen:t=!1,onOpenChange:n,modal:o=!0,variant:r="default",size:s="md",children:i})=>P.jsx(jc.Provider,{value:{variant:r,size:s},children:P.jsx(dm,{open:e,defaultOpen:t,onOpenChange:n,modal:o,children:i})}));$c.displayName="ALSDialog.Root";const Bc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.trigger,e].filter(Boolean).join(" ");return P.jsx(Vc,{ref:n,className:o,nativeButton:!1,render:r=>ne.cloneElement(t,r)})});Bc.displayName="ALSDialog.Trigger";const Hc=ne.forwardRef(({className:e},t)=>{const n=[bt.backdrop,e].filter(Boolean).join(" ");return P.jsx(cc,{ref:t,className:n})});Hc.displayName="ALSDialog.Backdrop";const zc=({container:e,keepMounted:t=!1,children:n})=>P.jsx(Lc,{container:e,keepMounted:t,children:n});zc.displayName="ALSDialog.Portal";const Uc=ne.forwardRef(({className:e,children:t},n)=>{const{variant:o,size:r}=Em(),s=[bt.popup,bt[`popup--${o}`],bt[`popup--${r}`],e].filter(Boolean).join(" ");return P.jsx(Dc,{ref:n,className:s,children:t})});Uc.displayName="ALSDialog.Popup";const Wc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.title,e].filter(Boolean).join(" ");return P.jsx(Fc,{ref:n,className:o,children:t})});Wc.displayName="ALSDialog.Title";const qc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.description,e].filter(Boolean).join(" ");return P.jsx(lc,{ref:n,className:o,children:t})});qc.displayName="ALSDialog.Description";const Kc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.close,e].filter(Boolean).join(" ");return P.jsx(ac,{ref:n,className:o,children:t||P.jsx(xm,{})})});Kc.displayName="ALSDialog.Close";const xm=()=>P.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:bt.closeIcon,children:P.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Sm={Root:$c,Trigger:Bc,Backdrop:Hc,Portal:zc,Popup:Uc,Title:Wc,Description:qc,Close:Kc},wm="_root_1yzve_1",Rm={root:wm};function Cm(e){return P.jsx("div",{className:Rm.root})}const _m="_root_o7syy_1",Tm={root:_m};function Om(e){return P.jsx("div",{className:Tm.root})}const Pm="_root_199mu_1",Am={root:Pm};function Nm(e){return P.jsx("div",{className:Am.root})}let ti=(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 Im={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Gc={valid(e){return e===null?null:e?{[ti.valid]:""}:{[ti.invalid]:""}}},Yc=a.createContext({invalid:void 0,name:void 0,validityData:{state:Im,errors:[],error:"",value:"",initialValue:null},setValidityData:nt,disabled:void 0,touched:!1,setTouched:nt,dirty:!1,setDirty:nt,filled:!1,setFilled:nt,focused:!1,setFocused:nt,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=ze)=>e,getInputValidationProps:(e=ze)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Yc.displayName="FieldRootContext");function An(e=!0){const t=a.useContext(Yc);if(t.setValidityData===nt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Ae(28));return t}const Xc=a.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:nt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Xc.displayName="FormContext");function Zc(){return a.useContext(Xc)}const Jc=a.createContext({controlId:void 0,setControlId:nt,labelId:void 0,setLabelId:nt,messageIds:[],setMessageIds:nt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Jc.displayName="LabelableContext");function _o(){return a.useContext(Jc)}function Mm(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Qc(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,setControlId:s}=_o(),i=ut(t);return X(()=>{if(!(!n&&!t||s===nt)){if(n){const c=o?.current;_e(c)&&c.closest("label")!=null?s(t??null):s(r??i)}else t&&s(t);return()=>{t&&s(void 0)}}},[t,o,r,s,n,i]),r??i}function ea(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:c}=Zc(),{invalid:u,markedDirtyRef:l,validityData:f,setValidityData:d}=An(),p=Q(e.getValue);X(()=>{if(!t)return;let m=n;m===void 0&&(m=p()),f.initialValue===null&&m!==null&&d(g=>({...g,initialValue:m}))},[t,d,n,f.initialValue,p]),X(()=>{!t||!o||c.current.fields.set(o,{getValue:p,name:r,controlRef:s,validityData:Mm(f,u),validate(){let m=n;m===void 0&&(m=p()),l.current=!0,rt.flushSync(()=>i(m))}})},[i,s,t,c,p,o,u,l,r,f,n]),X(()=>{const m=c.current.fields;return()=>{o&&m.delete(o)}},[c,o])}const ta=a.forwardRef(function(t,n){const{render:o,className:r,id:s,name:i,value:c,disabled:u=!1,onValueChange:l,defaultValue:f,...d}=t,{state:p,name:m,disabled:g}=An(),h=g||u,E=m??i,b=a.useMemo(()=>({...p,disabled:h}),[p,h]),{setTouched:y,setDirty:x,validityData:v,setFocused:R,setFilled:_,validationMode:T,validation:N}=An(),{labelId:F}=_o(),L=Qc({id:s});X(()=>{const O=c!=null;N.inputRef.current?.value||O&&c!==""?_(!0):O&&c===""&&_(!1)},[N.inputRef,_,c]);const[k,A]=Cn({controlled:c,default:f,name:"FieldControl",state:"value"}),w=c!==void 0,I=Q((O,D)=>{l?.(O,D),!D.isCanceled&&A(O)});return ea({id:L,name:E,commit:N.commit,value:k,getValue:()=>N.inputRef.current?.value,controlRef:N.inputRef}),ye("input",t,{ref:n,state:b,props:[{id:L,disabled:h,name:E,ref:N.inputRef,"aria-labelledby":F,...w?{value:k}:{defaultValue:f},onChange(O){const D=O.currentTarget.value;I(D,ge(ln,O.nativeEvent)),x(D!==v.initialValue),_(D!=="")},onFocus(){R(!0)},onBlur(O){y(!0),R(!1),T==="onBlur"&&N.commit(O.currentTarget.value)},onKeyDown(O){O.currentTarget.tagName==="INPUT"&&O.key==="Enter"&&(y(!0),N.commit(O.currentTarget.value))}},N.getInputValidationProps(),d],stateAttributesMapping:Gc})});process.env.NODE_ENV!=="production"&&(ta.displayName="FieldControl");const na=a.forwardRef(function(t,n){return P.jsx(ta,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(na.displayName="Input");const Dm="_input_1ph0q_5",Wn={input:Dm,"input--outlined":"_input--outlined_1ph0q_25","input--filled":"_input--filled_1ph0q_40","input--sm":"_input--sm_1ph0q_59","input--md":"_input--md_1ph0q_64","input--lg":"_input--lg_1ph0q_69","input--success":"_input--success_1ph0q_78","input--warning":"_input--warning_1ph0q_87","input--error":"_input--error_1ph0q_96"},oa=ne.forwardRef(({variant:e="outlined",size:t="md",status:n="default",className:o,disabled:r=!1,...s},i)=>{const c=[Wn.input,Wn[`input--${e}`],Wn[`input--${t}`],Wn[`input--${n}`],o].filter(Boolean).join(" ");return P.jsx(na,{ref:i,className:c,disabled:r,...s})});oa.displayName="ALSInput";const Lm="_root_so1gq_1",km={root:Lm};function Fm(e){return P.jsx("div",{className:km.root})}const Vm="_root_g8l8f_1",jm={root:Vm};function $m(e){return P.jsx("div",{className:jm.root})}const Bm="_root_krv6e_1",Hm={root:Bm};function zm(e){return P.jsx("div",{className:Hm.root})}const Um="_root_qmqvr_1",Wm={root:Um};function qm(e){return P.jsx("div",{className:Wm.root})}const Km="_root_1jbox_1",Gm={root:Km};function Ym(e){return P.jsx("div",{className:Gm.root})}const Yr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Yr.displayName="PopoverRootContext");function gt(e){const t=a.useContext(Yr);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.":Ae(47));return t}function Xm(){return{...Oc(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const Zm={...Pc,disabled:se(e=>e.disabled),instantType:se(e=>e.instantType),openMethod:se(e=>e.openMethod),openChangeReason:se(e=>e.openChangeReason),modal:se(e=>e.modal),stickIfOpen:se(e=>e.stickIfOpen),titleElementId:se(e=>e.titleElementId),descriptionElementId:se(e=>e.descriptionElementId),openOnHover:se(e=>e.openOnHover),closeDelay:se(e=>e.closeDelay)};class Xr extends Wr{constructor(t){const n={...Xm(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:a.createRef(),beforeContentFocusGuardRef:a.createRef(),stickIfOpenTimeout:new pt,triggerElements:new So},Zm)}setOpen=(t,n)=>{const o=n.reason===ot,r=n.reason===ht&&n.event.detail===0,s=!t&&(n.reason===Ei||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const u=()=>{const l={open:t,openChangeReason:n.reason},f=n.trigger?.id??null;(f||t)&&(l.activeTriggerId=f,l.activeTriggerElement=n.trigger??null),this.update(l)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(zl,()=>{this.set("stickIfOpen",!1)}),rt.flushSync(u)):u(),r||s?this.set("instantType",r?"click":"dismiss"):n.reason===Ut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const o=Je(()=>t??new Xr(n)).current;return io(o.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function ni({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,modal:i=!1,handle:c,triggerId:u,defaultTriggerId:l=null}=e,f=Xr.useStore(c?.store,{open:n??o,modal:i,activeTriggerId:u!==void 0?u:l});f.useControlledProp("open",n,o),f.useControlledProp("activeTriggerId",u,l);const d=f.useState("open"),p=f.useState("positionerElement"),m=f.useState("payload"),g=f.useState("openChangeReason");f.useContextCallback("onOpenChange",r),f.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:E,reset:b}=kc(d);_c(f);const{forceUnmount:y}=Tc(d,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null}),b()});Gr(d&&i===!0&&g!==ot&&h!=="touch",p),a.useEffect(()=>{d||f.context.stickIfOpenTimeout.clear()},[f,d]);const x=a.useCallback(C=>{const O=ge(C);return O.preventUnmountOnClose=()=>{f.set("preventUnmountingOnClose",!0)},O},[f]),v=a.useCallback(()=>{f.setOpen(!1,x(xi))},[f,x]);a.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:v}),[y,v]);const R=Nc({popupStore:f,onOpenChange:f.setOpen}),_=Ur(R,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=Mc(R),{getReferenceProps:N,getFloatingProps:F,getTriggerProps:L}=Mn([_,T]),k=a.useMemo(()=>N(E),[N,E]),A=a.useMemo(()=>L(E),[L,E]),w=a.useMemo(()=>F(),[F]);f.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:k,inactiveTriggerProps:A,popupProps:w,floatingRootContext:R,nested:Vt()!=null});const I=a.useMemo(()=>({store:f}),[f]);return P.jsx(Yr.Provider,{value:I,children:typeof t=="function"?t({payload:m}):t})}function Jm(e){return gt(!0)?P.jsx(ni,{props:e}):P.jsx(pd,{children:P.jsx(ni,{props:e})})}const Qm=300,ra=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,handle:c,payload:u,openOnHover:l=!1,delay:f=Qm,closeDelay:d=0,id:p,...m}=t,g=gt(!0),h=c?.store??g?.store;if(!h)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.":Ae(74));const E=ut(p),b=h.useState("isTriggerActive",E),y=h.useState("floatingRootContext"),x=h.useState("isOpenedByTrigger",E),[v,R]=a.useState(null),{registerTrigger:_,isMountedByThisTrigger:T}=Cc(E,v,h,{payload:u,disabled:s,openOnHover:l,closeDelay:d}),N=h.useState("openChangeReason"),F=h.useState("stickIfOpen"),L=h.useState("openMethod"),k=zp(y,{enabled:y!=null&&l&&(L!=="touch"||N!==ht),mouseOnly:!0,move:!1,handleClose:Zp(),restMs:f,delay:{close:d},triggerElement:v,isActiveTrigger:b}),A=Hr(y,{enabled:y!=null,stickIfOpen:F}),w=Mn([A]),I=h.useState("triggerProps",T),C=a.useMemo(()=>({disabled:s,open:x}),[s,x]),{getButtonProps:O,buttonRef:D}=St({disabled:s,native:i}),S=a.useMemo(()=>({open(Y){return Y&&N===ht?ic.open(Y):kr.open(Y)}}),[N]),M=ye("button",t,{state:C,ref:[D,n,_,R],props:[w.getReferenceProps(),k,I,{[Er]:"",id:E},m,O],stateAttributesMapping:S}),$=a.useRef(null),z=Q(Y=>{rt.flushSync(()=>{h.setOpen(!1,ge(Ut,Y.nativeEvent,Y.currentTarget))}),uf($.current)?.focus()}),Z=Q(Y=>{const te=h.select("positionerElement");if(te&&Jt(Y,te))h.context.beforeContentFocusGuardRef.current?.focus();else{rt.flushSync(()=>{h.setOpen(!1,ge(Ut,Y.nativeEvent,Y.currentTarget))});let G=lf(v);for(;G!==null&&xe(te,G)||G?.hasAttribute("aria-hidden");){const H=G;if(G=Nr(G),G===H)break}G?.focus()}});return b?P.jsxs(a.Fragment,{children:[P.jsx(dt,{ref:$,onFocus:z}),P.jsx(a.Fragment,{children:M},E),P.jsx(dt,{ref:h.context.triggerFocusTargetRef,onFocus:Z})]}):P.jsx(a.Fragment,{children:M},E)});process.env.NODE_ENV!=="production"&&(ra.displayName="PopoverTrigger");const Zr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Zr.displayName="PopoverPortalContext");function eg(){const e=a.useContext(Zr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Portal> is missing.":Ae(45));return e}const sa=a.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=gt();return s.useState("mounted")||o?P.jsx(Zr.Provider,{value:o,children:P.jsx(Eo,{ref:n,...r,renderGuards:!1})}):null});process.env.NODE_ENV!=="production"&&(sa.displayName="PopoverPortal");const Jr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jr.displayName="PopoverPositionerContext");function ia(){const e=a.useContext(Jr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.":Ae(46));return e}const tg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:l,padding:f=0,offsetParent:d="real"}=Et(e,t)||{};if(l==null)return{};const p=$i(f),m={x:n,y:o},g=Ar(r),h=Pr(g),E=await i.getDimensions(l),b=g==="y",y=b?"top":"left",x=b?"bottom":"right",v=b?"clientHeight":"clientWidth",R=s.reference[h]+s.reference[g]-m[g]-s.floating[h],_=m[g]-s.reference[g],T=d==="real"?await i.getOffsetParent?.(l):c.floating;let N=c.floating[v]||s.floating[h];(!N||!await i.isElement?.(T))&&(N=c.floating[v]||s.floating[h]);const F=R/2-_/2,L=N/2-E[h]/2-1,k=Math.min(p[y],L),A=Math.min(p[x],L),w=k,I=N-E[h]-A,C=N/2-E[h]/2+F,O=ir(w,C,I),D=!u.arrow&&Dt(r)!=null&&C!==O&&s.reference[h]/2-(C<w?k:A)-E[h]/2<0,S=D?C<w?C-w:C-I:0;return{[g]:m[g]+S,data:{[g]:O,centerOffset:C-O-S,...D&&{alignmentOffset:S}},reset:D}}}),ng=(e,t)=>({...tg(e),options:[e,t]}),og={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await cp().fn(e)).data?.referenceHidden||s}}}},Xn={sideX:"left",sideY:"top"},rg={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:c}=e,u=De(r),l=u.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Xn};const d=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&u?.visualViewport)p={width:u.visualViewport.width,height:u.visualViewport.height};else if(d===u){const y=Ke(r);p={width:y.documentElement.clientWidth,height:y.documentElement.clientHeight}}else await s.isElement?.(d)&&(p=await s.getDimensions(d));const m=Ze(c);let g=t,h=n;m==="left"&&(g=p.width-(t+o.width)),m==="top"&&(h=p.height-(n+o.height));const E=m==="left"?"right":Xn.sideX,b=m==="top"?"bottom":Xn.sideY;return{x:g,y:h,data:{sideX:E,sideY:b}}}};function ca(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function oi(e,t,n){const{rects:o,placement:r}=e;return{side:ca(t,Ze(r),n),align:Dt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function aa(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:f=5,disableAnchorTracking:d=!1,keepMounted:p=!1,floatingRootContext:m,mounted:g,collisionAvoidance:h,shiftCrossAxis:E=!1,nodeId:b,adaptiveOrigin:y,lazyFlip:x=!1,externalTree:v}=e,[R,_]=a.useState(null);!g&&R!==null&&_(null);const T=h.side||"flip",N=h.align||"flip",F=h.fallbackAxisSide||"end",L=typeof t=="function"?t:void 0,k=Q(L),A=L?k:t,w=Ve(t),C=hr()==="rtl",O=R||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":C?"left":"right","inline-start":C?"right":"left"}[o],D=s==="center"?O:`${O}-${s}`;let S=u;const M=1,$=o==="bottom"?M:0,z=o==="top"?M:0,Z=o==="right"?M:0,Y=o==="left"?M:0;typeof S=="number"?S={top:S+$,right:S+Y,bottom:S+z,left:S+Z}:S&&(S={top:(S.top||0)+$,right:(S.right||0)+Y,bottom:(S.bottom||0)+z,left:(S.left||0)+Z});const te={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:S},G=a.useRef(null),H=Ve(r),j=Ve(i),Ee=[np(Te=>{const Ne=oi(Te,o,C),Be=typeof H.current=="function"?H.current(Ne):H.current,ke=typeof j.current=="function"?j.current(Ne):j.current;return{mainAxis:Be,crossAxis:ke,alignmentAxis:ke}},[typeof r!="function"?r:0,typeof i!="function"?i:0,C,o])],B=N==="none"&&T!=="shift",ie=!B&&(l||E||T==="shift"),oe=T==="none"?null:sp({...te,padding:{top:S.top+M,right:S.right+M,bottom:S.bottom+M,left:S.left+M},mainAxis:!E&&T==="flip",crossAxis:N==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),Se=B?null:op(Te=>{const Ne=Ke(Te.elements.floating).documentElement;return{...te,rootBoundary:E?{x:0,y:0,width:Ne.clientWidth,height:Ne.clientHeight}:void 0,mainAxis:N!=="none",crossAxis:ie,limiter:l||E?void 0:rp(Be=>{if(!G.current)return{};const{width:ke,height:be}=G.current.getBoundingClientRect(),Pe=at(Ze(Be.placement)),Fe=Pe==="y"?ke:be,Ue=Pe==="y"?S.left+S.right:S.top+S.bottom;return{offset:Fe/2+Ue/2}})}},[te,l,E,S,N]);T==="shift"||N==="shift"||s==="center"?Ee.push(Se,oe):Ee.push(oe,Se),Ee.push(ip({...te,apply({elements:{floating:Te},rects:{reference:Ne},availableWidth:Be,availableHeight:ke}){Object.entries({"--available-width":`${Be}px`,"--available-height":`${ke}px`,"--anchor-width":`${Ne.width}px`,"--anchor-height":`${Ne.height}px`}).forEach(([be,Pe])=>{Te.style.setProperty(be,Pe)})}}),ng(()=>({element:G.current||document.createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Te){const{elements:Ne,middlewareData:Be,placement:ke,rects:be,y:Pe}=Te,Fe=Ze(ke),Ue=at(Fe),Ye=G.current,wt=Be.arrow?.x||0,Dn=Be.arrow?.y||0,Oo=Ye?.clientWidth||0,hl=Ye?.clientHeight||0,Po=wt+Oo/2,ms=Dn+hl/2,yl=Math.abs(Be.shift?.y||0),bl=be.reference.height/2,gn=typeof r=="function"?r(oi(Te,o,C)):r,vl=yl>gn,El={top:`${Po}px calc(100% + ${gn}px)`,bottom:`${Po}px ${-gn}px`,left:`calc(100% + ${gn}px) ${ms}px`,right:`${-gn}px ${ms}px`}[Fe],xl=`${Po}px ${be.reference.y+bl-Pe}px`;return Ne.floating.style.setProperty("--transform-origin",ie&&Ue==="y"&&vl?xl:El),{}}},og,y),X(()=>{!g&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,m]);const U=a.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:K,elements:W,x:pe,y:le,middlewareData:re,update:V,placement:ce,context:ee,isPositioned:q,floatingStyles:J}=Fp({rootContext:m,placement:D,middleware:Ee,strategy:n,whileElementsMounted:p?void 0:(...Te)=>js(...Te,U),nodeId:b,externalTree:v}),{sideX:ue,sideY:fe}=re.adaptiveOrigin||Xn,Re=q?n:"fixed",we=a.useMemo(()=>y?{position:Re,[ue]:pe,[fe]:le}:{position:Re,...J},[y,Re,ue,pe,fe,le,J]),Ce=a.useRef(null);X(()=>{if(!g)return;const Te=w.current,Ne=typeof Te=="function"?Te():Te,ke=(ri(Ne)?Ne.current:Ne)||null||null;ke!==Ce.current&&(K.setPositionReference(ke),Ce.current=ke)},[g,K,A,w]),a.useEffect(()=>{if(!g)return;const Te=w.current;typeof Te!="function"&&ri(Te)&&Te.current!==Ce.current&&(K.setPositionReference(Te.current),Ce.current=Te.current)},[g,K,A,w]),a.useEffect(()=>{if(p&&g&&W.domReference&&W.floating)return js(W.domReference,W.floating,V,U)},[p,g,W,V,U]);const $e=Ze(ce),st=ca(o,$e,C),Oe=Dt(ce)||"center",et=!!re.hide?.referenceHidden;X(()=>{x&&g&&q&&_($e)},[x,g,q,$e]);const Ge=a.useMemo(()=>({position:"absolute",top:re.arrow?.y,left:re.arrow?.x}),[re.arrow]),it=re.arrow?.centerOffset!==0;return a.useMemo(()=>({positionerStyles:we,arrowStyles:Ge,arrowRef:G,arrowUncentered:it,side:st,align:Oe,physicalSide:$e,anchorHidden:et,refs:K,context:ee,isPositioned:q,update:V}),[we,Ge,G,it,st,Oe,$e,et,K,ee,q,V])}function ri(e){return e!=null&&"current"in e}function Qr(e){return e==="starting"?Ul:ze}const la=a.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="bottom",align:u="center",sideOffset:l=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p=5,arrowPadding:m=5,sticky:g=!1,disableAnchorTracking:h=!1,collisionAvoidance:E=ql,...b}=t,{store:y}=gt(),x=eg(),v=fd(),R=y.useState("floatingRootContext"),_=y.useState("mounted"),T=y.useState("open"),N=y.useState("openMethod"),F=y.useState("openChangeReason"),L=y.useState("activeTriggerElement"),k=y.useState("modal"),A=y.useState("positionerElement"),w=y.useState("instantType"),I=y.useState("transitionStatus"),C=a.useRef(null),O=co(A,!1,!1),D=aa({anchor:s,floatingRootContext:R,positionMethod:i,mounted:_,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:d,collisionPadding:p,sticky:g,disableAnchorTracking:h,keepMounted:x,nodeId:v,collisionAvoidance:E,adaptiveOrigin:rg}),S=a.useMemo(()=>{const te={};return T||(te.pointerEvents="none"),{role:"presentation",hidden:!_,style:{...D.positionerStyles,...te}}},[T,_,D.positionerStyles]),M=a.useMemo(()=>({props:S,...D}),[S,D]),$=R?.select("domReferenceElement");X(()=>{const te=$,G=C.current;if(te&&(C.current=te),G&&te&&te!==G){y.set("instantType",void 0);const H=new AbortController;return O(()=>{y.set("instantType","trigger-change")},H.signal),()=>{H.abort()}}},[$,O,y]);const z=a.useMemo(()=>({open:T,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:w}),[T,M.side,M.align,M.anchorHidden,w]),Z=a.useCallback(te=>{y.set("positionerElement",te)},[y]),Y=ye("div",t,{state:z,props:[M.props,Qr(I),b],ref:[n,Z],stateAttributesMapping:Ft});return P.jsxs(Jr.Provider,{value:M,children:[_&&k===!0&&F!==ot&&N!=="touch"&&P.jsx(Co,{ref:y.context.internalBackdropRef,inert:Ro(!T),cutout:L}),P.jsx(dd,{id:v,children:Y})]})});process.env.NODE_ENV!=="production"&&(la.displayName="PopoverPositioner");function si(e){const t=Qe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Me(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o;return(sn(n)!==s||sn(o)!==i)&&(n=s,o=i),{width:n,height:o}}const sg=typeof ResizeObserver<"u",ig=()=>!0;function cg(e){const{popupElement:t,positionerElement:n,content:o,mounted:r,enabled:s=ig,onMeasureLayout:i,onMeasureLayoutComplete:c}=e,u=a.useRef(!0),l=co(t,!0,!1),f=un(),d=a.useRef(null),p=Q(i),m=Q(c);X(()=>{if(!r||!s()||!sg){u.current=!0,d.current=null;return}if(!t||!n)return;const g=new ResizeObserver(_=>{const T=_[0];T&&(d.current===null?d.current={width:Math.ceil(T.borderBoxSize[0].inlineSize),height:Math.ceil(T.borderBoxSize[0].blockSize)}:(d.current.width=Math.ceil(T.borderBoxSize[0].inlineSize),d.current.height=Math.ceil(T.borderBoxSize[0].blockSize)))});g.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const h=yn(t,"position","static"),E=yn(t,"transform","none"),b=yn(t,"scale","1"),y=yn(n,"--available-width","max-content"),x=yn(n,"--available-height","max-content");if(p?.(),u.current||d.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const _=si(t);return n.style.setProperty("--positioner-width",`${_.width}px`),n.style.setProperty("--positioner-height",`${_.height}px`),h(),E(),b(),y(),x(),m?.(null,_),u.current=!1,()=>{g.disconnect()}}t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto"),n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const v=si(t);t.style.setProperty("--popup-width",`${d.current.width}px`),t.style.setProperty("--popup-height",`${d.current.height}px`),h(),E(),y(),x(),m?.(d.current,v),n.style.setProperty("--positioner-width",`${v.width}px`),n.style.setProperty("--positioner-height",`${v.height}px`);const R=new AbortController;return f.request(()=>{t.style.setProperty("--popup-width",`${v.width}px`),t.style.setProperty("--popup-height",`${v.height}px`),l(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},R.signal)}),()=>{g.disconnect(),R.abort(),f.cancel()}},[o,t,n,l,f,s,r,p,m])}function yn(e,t,n){const o=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,o)}}const ua=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ua.displayName="ToolbarRootContext");function fa(e){return a.useContext(ua)}const ag={...Ft,...It},da=a.forwardRef(function(t,n){const{className:o,render:r,initialFocus:s,finalFocus:i,...c}=t,{store:u}=gt(),l=ia(),f=fa()!=null,d=hr(),p=u.useState("open"),m=u.useState("openMethod"),g=u.useState("instantType"),h=u.useState("transitionStatus"),E=u.useState("popupProps"),b=u.useState("titleElementId"),y=u.useState("descriptionElementId"),x=u.useState("modal"),v=u.useState("mounted"),R=u.useState("openChangeReason"),_=u.useState("popupElement"),T=u.useState("payload"),N=u.useState("positionerElement"),F=u.useState("activeTriggerElement"),L=u.useState("floatingRootContext");Lt({open:p,ref:u.context.popupRef,onComplete(){p&&u.context.onOpenChangeComplete?.(!0)}});const k=u.useState("disabled"),A=u.useState("openOnHover"),w=u.useState("closeDelay");Bp(L,{enabled:A&&!k,closeDelay:w});function I(Y){return Y==="touch"?u.context.popupRef.current:!0}const C=s===void 0?I:s,O=a.useMemo(()=>({open:p,side:l.side,align:l.align,instant:g,transitionStatus:h}),[p,l.side,l.align,g,h]),D=a.useCallback(Y=>{u.set("popupElement",Y)},[u]);function S(){L.context.events.emit("measure-layout")}function M(Y,te){L.context.events.emit("measure-layout-complete",{previousDimensions:Y,nextDimensions:te})}cg({popupElement:_,positionerElement:N,mounted:v,content:T,enabled:()=>u.context.triggerElements.size>1,onMeasureLayout:S,onMeasureLayoutComplete:M});const z=a.useMemo(()=>{let Y=l.side==="top",te=l.side==="left";return d==="rtl"?(Y=Y||l.side==="inline-end",te=te||l.side==="inline-end"):(Y=Y||l.side==="inline-start",te=te||l.side==="inline-start"),Y?{position:"absolute",[l.side==="top"?"bottom":"top"]:"0",[te?"right":"left"]:"0"}:ze},[l.side,d]),Z=ye("div",t,{state:O,ref:[n,u.context.popupRef,D],props:[E,{"aria-labelledby":b,"aria-describedby":y,style:z,onKeyDown(Y){f&&Dr.has(Y.key)&&Y.stopPropagation()}},Qr(h),c],stateAttributesMapping:ag});return P.jsx(Br,{context:L,openInteractionType:m,modal:x==="trap-focus",disabled:!v||R===ot,initialFocus:C,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Me(F)?F:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:Z})});process.env.NODE_ENV!=="production"&&(da.displayName="PopoverPopup");const pa=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=gt(),c=i.useState("open"),{arrowRef:u,side:l,align:f,arrowUncentered:d,arrowStyles:p}=ia(),m=a.useMemo(()=>({open:c,side:l,align:f,uncentered:d}),[c,l,f,d]);return ye("div",t,{state:m,ref:[n,u],props:[{style:p,"aria-hidden":!0},s],stateAttributesMapping:Ft})});process.env.NODE_ENV!=="production"&&(pa.displayName="PopoverArrow");const lg={...Ft,...It},ma=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=gt(),c=i.useState("open"),u=i.useState("mounted"),l=i.useState("transitionStatus"),f=i.useState("openChangeReason"),d=a.useMemo(()=>({open:c,transitionStatus:l}),[c,l]);return ye("div",t,{state:d,ref:[i.context.backdropRef,n],props:[{role:"presentation",hidden:!u,style:{pointerEvents:f===ot?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:lg})});process.env.NODE_ENV!=="production"&&(ma.displayName="PopoverBackdrop");const ga=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i}=gt(),c=ut(s.id);return X(()=>(i.set("titleElementId",c),()=>{i.set("titleElementId",void 0)}),[i,c]),ye("h2",t,{ref:n,props:[{id:c},s]})});process.env.NODE_ENV!=="production"&&(ga.displayName="PopoverTitle");const ha=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i}=gt(),c=ut(s.id);return X(()=>(i.set("descriptionElementId",c),()=>{i.set("descriptionElementId",void 0)}),[i,c]),ye("p",t,{ref:n,props:[{id:c},s]})});process.env.NODE_ENV!=="production"&&(ha.displayName="PopoverDescription");const ya=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{buttonRef:u,getButtonProps:l}=St({disabled:s,focusableWhenDisabled:!1,native:i}),{store:f}=gt();return ye("button",t,{ref:[n,u],props:[{onClick(p){f.setOpen(!1,ge(vi,p.nativeEvent,p.currentTarget))}},c,l]})});process.env.NODE_ENV!=="production"&&(ya.displayName="PopoverClose");const ug="_popup_1w2m7_1",fg="_arrow_1w2m7_25",dg="_title_1w2m7_35",pg="_description_1w2m7_42",mg="_close_1w2m7_49",gg="_backdrop_1w2m7_76",pn={popup:ug,arrow:fg,title:dg,description:pg,close:mg,backdrop:gg},ba=Jm,va=a.forwardRef(function({children:t,...n},o){return P.jsx(ra,{...n,ref:o,nativeButton:!1,render:r=>a.cloneElement(t,r)})}),Ea=sa,xa=a.forwardRef(function(t,n){return P.jsx(la,{...t,ref:n})}),Sa=a.forwardRef(function({className:t,...n},o){return P.jsx(da,{...n,className:`${pn.popup} ${t||""}`,ref:o})}),wa=a.forwardRef(function({className:t,...n},o){return P.jsx(pa,{...n,className:`${pn.arrow} ${t||""}`,ref:o})}),Ra=a.forwardRef(function({className:t,...n},o){return P.jsx(ga,{...n,className:`${pn.title} ${t||""}`,ref:o})}),Ca=a.forwardRef(function({className:t,...n},o){return P.jsx(ha,{...n,className:`${pn.description} ${t||""}`,ref:o})}),_a=a.forwardRef(function({className:t,...n},o){return P.jsx(ya,{...n,className:`${pn.close} ${t||""}`,ref:o})}),Ta=a.forwardRef(function({className:t,...n},o){return P.jsx(ma,{...n,className:`${pn.backdrop} ${t||""}`,ref:o})}),hg={Root:ba,Trigger:va,Portal:Ea,Positioner:xa,Popup:Sa,Arrow:wa,Title:Ra,Description:Ca,Close:_a,Backdrop:Ta},yg="_root_1iiym_1",bg={root:yg};function vg(e){return P.jsx("div",{className:bg.root})}const Eg="_root_1hnog_1",xg={root:Eg};function Sg(e){return P.jsx("div",{className:xg.root})}const wg="_root_1ei9z_1",Rg={root:wg};function Cg(e){return P.jsx("div",{className:Rg.root})}const _g="_root_1kuso_1",Tg={root:_g};function Og(e){return P.jsx("div",{className:Tg.root})}function Pg(e){const t=a.useRef(!0);t.current&&(t.current=!1,e())}const es=a.createContext(null);process.env.NODE_ENV!=="production"&&(es.displayName="SelectRootContext");const ts=a.createContext(null);process.env.NODE_ENV!=="production"&&(ts.displayName="SelectFloatingContext");function jt(){const e=a.useContext(es);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.":Ae(60));return e}function Oa(){const e=a.useContext(ts);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.":Ae(61));return e}const Ag=(e,t)=>Object.is(e,t);function an(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function qo(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:an(o,t,n))}function dr(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:an(o,t,n))}function Ng(e,t,n){return e.filter(o=>!an(o,t,n))}function pr(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Ig(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function En(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 pr(e)}function Zn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?pr(e.value):pr(e)}function Mg(e,t,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]??En(e,n);if(Array.isArray(t)){const o=Ig(t)?t.flatMap(r=>r.items):t;if(e==null){const r=o.find(s=>s.value==null);return r&&r.label!=null?r.label:En(e,n)}if(typeof e!="object"){const r=o.find(s=>s&&s.value===e);return r&&r.label!=null?r.label:En(e,n)}if("value"in e){const r=o.find(s=>s&&s.value===e.value);if(r&&r.label!=null)return r.label}}return En(e,n)}function Dg(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>En(n,t)).join(", ")}const he={id:se(e=>e.id),modal:se(e=>e.modal),multiple:se(e=>e.multiple),items:se(e=>e.items),itemToStringLabel:se(e=>e.itemToStringLabel),itemToStringValue:se(e=>e.itemToStringValue),isItemEqualToValue:se(e=>e.isItemEqualToValue),value:se(e=>e.value),open:se(e=>e.open),mounted:se(e=>e.mounted),forceMount:se(e=>e.forceMount),transitionStatus:se(e=>e.transitionStatus),touchModality:se(e=>e.touchModality),activeIndex:se(e=>e.activeIndex),selectedIndex:se(e=>e.selectedIndex),isActive:se((e,t)=>e.activeIndex===t),isSelected:se((e,t,n)=>{const o=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>an(s,n,o)):e.selectedIndex===t&&e.selectedIndex!==null?!0:an(r,n,o)}),isSelectedByFocus:se((e,t)=>e.selectedIndex===t),popupProps:se(e=>e.popupProps),triggerProps:se(e=>e.triggerProps),triggerElement:se(e=>e.triggerElement),positionerElement:se(e=>e.positionerElement),listElement:se(e=>e.listElement),scrollUpArrowVisible:se(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:se(e=>e.scrollDownArrowVisible),hasScrollArrows:se(e=>e.hasScrollArrows),serializedValue:se(e=>{const{multiple:t,value:n,itemToStringValue:o}=e;return t&&Array.isArray(n)&&n.length===0?"":Zn(n,o)})};function Lg(e,t){const n=a.useRef(e),o=Q(t);X(()=>{n.current!==e&&o(n.current)},[e,o]),X(()=>{n.current=e},[e])}function kg(e){const{id:t,value:n,defaultValue:o=null,onValueChange:r,open:s,defaultOpen:i=!1,onOpenChange:c,name:u,disabled:l=!1,readOnly:f=!1,required:d=!1,modal:p=!0,actionsRef:m,inputRef:g,onOpenChangeComplete:h,items:E,multiple:b=!1,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v=Ag,children:R}=e,{clearErrors:_}=Zc(),{setDirty:T,shouldValidateOnChange:N,validityData:F,setFilled:L,name:k,disabled:A,validation:w}=An(),{controlId:I}=_o(),C=Qc({id:t}),O=A||l,D=k??u,[S,M]=Cn({controlled:n,default:b?o??Jo:o,name:"Select",state:"value"}),[$,z]=Cn({controlled:s,default:i,name:"Select",state:"open"}),Z=a.useRef([]),Y=a.useRef([]),te=a.useRef(null),G=a.useRef(null),H=a.useRef(0),j=a.useRef(null),ae=a.useRef([]),de=a.useRef(!1),Ee=a.useRef(!1),B=a.useRef(null),ie=a.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),oe=a.useRef(!1),{mounted:Se,setMounted:U,transitionStatus:K}=ao($),W=Je(()=>new tn({id:C,modal:p,multiple:b,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v,value:S,open:$,mounted:Se,transitionStatus:K,items:E,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,pe=ve(W,he.activeIndex),le=ve(W,he.selectedIndex),re=ve(W,he.triggerElement),V=ve(W,he.positionerElement),ce=a.useMemo(()=>b&&Array.isArray(S)&&S.length===0?"":Zn(S,x),[b,S,x]),ee=Ve(W.state.triggerElement);ea({id:C,commit:w.commit,value:S,controlRef:ee,name:D,getValue:()=>S});const q=a.useRef(S);X(()=>{S!==q.current&&W.set("forceMount",!0)},[W,S]),X(()=>{L(S!==null)},[S,L]),X(function(){if($)return;const Pe=ae.current;if(b){const Ue=Array.isArray(S)?S:[];if(Ue.length===0){W.set("selectedIndex",null);return}const Ye=Ue[Ue.length-1],wt=dr(Pe,Ye,v);W.set("selectedIndex",wt===-1?null:wt);return}const Fe=dr(Pe,S,v);W.set("selectedIndex",Fe===-1?null:Fe)},[b,$,S,ae,v,W]),Lg(S,()=>{_(D),T(S!==F.initialValue),N()?w.commit(S):w.commit(S,!0)});const J=Q((be,Pe)=>{if(c?.(be,Pe),!Pe.isCanceled&&(z(be),!be&&W.state.activeIndex!==null)){const Fe=Z.current[W.state.activeIndex];queueMicrotask(()=>{Fe?.setAttribute("tabindex","-1")})}}),ue=Q(()=>{U(!1),W.set("activeIndex",null),h?.(!1)});Lt({enabled:!m,open:$,ref:te,onComplete(){$||ue()}}),a.useImperativeHandle(m,()=>({unmount:ue}),[ue]);const fe=Q((be,Pe)=>{r?.(be,Pe),!Pe.isCanceled&&M(be)}),Re=Q(()=>{const be=W.state.listElement||te.current;if(!be)return;const Pe=be.scrollTop,Fe=be.scrollTop+be.clientHeight,Ue=Pe>1,Ye=Fe<be.scrollHeight-1;W.state.scrollUpArrowVisible!==Ue&&W.set("scrollUpArrowVisible",Ue),W.state.scrollDownArrowVisible!==Ye&&W.set("scrollDownArrowVisible",Ye)}),we=Ac({open:$,onOpenChange:J,elements:{reference:re,floating:V}}),Ce=Hr(we,{enabled:!f&&!O,event:"mousedown"}),$e=Ur(we,{bubbles:!1}),st=Kp(we,{enabled:!f&&!O,listRef:Z,activeIndex:pe,selectedIndex:le,disabledIndices:Jo,onNavigate(be){be===null&&!$||W.set("activeIndex",be)},focusItemOnHover:!1}),Oe=Yp(we,{enabled:!f&&!O&&($||!b),listRef:Y,activeIndex:pe,selectedIndex:le,onMatch(be){$?W.set("activeIndex",be):fe(ae.current[be],ge("none"))},onTypingChange(be){de.current=be}}),{getReferenceProps:et,getFloatingProps:Ge,getItemProps:it}=Mn([Ce,$e,st,Oe]);Pg(()=>{W.update({popupProps:Ge(),triggerProps:et()})}),X(()=>{W.update({id:C,modal:p,multiple:b,value:S,open:$,mounted:Se,transitionStatus:K,popupProps:Ge(),triggerProps:et(),items:E,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v})},[W,C,p,b,S,$,Se,K,Ge,et,E,y,x,v]);const Te=a.useMemo(()=>({store:W,name:D,required:d,disabled:O,readOnly:f,multiple:b,itemToStringLabel:y,itemToStringValue:x,setValue:fe,setOpen:J,listRef:Z,popupRef:te,scrollHandlerRef:G,handleScrollArrowVisibility:Re,scrollArrowsMountedCountRef:H,getItemProps:it,events:we.context.events,valueRef:j,valuesRef:ae,labelsRef:Y,typingRef:de,selectionRef:ie,selectedItemTextRef:B,validation:w,onOpenChangeComplete:h,keyboardActiveRef:Ee,alignItemWithTriggerActiveRef:oe,initialValueRef:q}),[W,D,d,O,f,b,y,x,fe,J,it,we.context.events,w,h,Re]),Ne=Pt(g,w.inputRef),Be=b&&Array.isArray(S)&&S.length>0,ke=a.useMemo(()=>!b||!Array.isArray(S)||!D?null:S.map(be=>{const Pe=Zn(be,x);return P.jsx("input",{type:"hidden",name:D,value:Pe},Pe)}),[b,S,D,x]);return P.jsx(es.Provider,{value:Te,children:P.jsxs(ts.Provider,{value:we,children:[R,P.jsx("input",{...w.getInputValidationProps({onFocus(){W.state.triggerElement?.focus()},onChange(be){if(be.nativeEvent.defaultPrevented)return;const Pe=be.target.value,Fe=ge(ln,be.nativeEvent);function Ue(){if(b)return;const Ye=ae.current.find(wt=>Zn(wt,x).toLowerCase()===Pe.toLowerCase());Ye!=null&&(T(Ye!==F.initialValue),fe(Ye,Fe),N()&&w.commit(Ye))}W.set("forceMount",!0),queueMicrotask(Ue)}}),id:t||I||void 0,name:b?void 0:D,value:ce,disabled:O,required:d&&!Be,readOnly:f,ref:Ne,style:vo,tabIndex:-1,"aria-hidden":!0}),ke]})})}function Fg(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV==="test")return t;const n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,l=Math.max(t.width,s,c),f=Math.max(t.height,i,u),d=l-t.width,p=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-p/2,bottom:t.bottom+p/2}}const qn=2,Vg={...ic,...Gc,value:()=>null},Pa=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{setTouched:u,setFocused:l,validationMode:f,state:d,disabled:p}=An(),{labelId:m}=_o(),{store:g,setOpen:h,selectionRef:E,validation:b,readOnly:y,alignItemWithTriggerActiveRef:x,disabled:v,keyboardActiveRef:R}=jt(),_=p||v||s,T=ve(g,he.open),N=ve(g,he.value),F=ve(g,he.triggerProps),L=ve(g,he.positionerElement),k=ve(g,he.listElement),A=ve(g,he.serializedValue),w=Ve(L),I=a.useRef(null),C=Xe(),O=Xe(),{getButtonProps:D,buttonRef:S}=St({disabled:_,native:i}),M=Q(H=>{g.set("triggerElement",H)}),$=Pt(n,I,S,M),z=Xe(),Z=Xe();a.useEffect(()=>{if(T)return Z.start(200,()=>{E.current.allowUnselectedMouseUp=!0,z.start(200,()=>{E.current.allowSelectedMouseUp=!0})}),()=>{z.clear(),Z.clear()};E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},O.clear()},[T,E,O,z,Z]);const Y=a.useMemo(()=>k?.id??_n(L)?.id,[k,L]),te=vr(F,{role:"combobox","aria-expanded":T?"true":"false","aria-haspopup":"listbox","aria-controls":T?Y:void 0,"aria-labelledby":m,"aria-readonly":y||void 0,tabIndex:_?-1:0,ref:$,onFocus(H){l(!0),T&&x.current&&h(!1,ge(Ut,H.nativeEvent)),C.start(0,()=>{g.set("forceMount",!0)})},onBlur(){u(!0),l(!1),f==="onBlur"&&b.commit(N)},onPointerMove({pointerType:H}){R.current=!1,g.set("touchModality",H==="touch")},onPointerDown({pointerType:H}){g.set("touchModality",H==="touch")},onKeyDown(){R.current=!0},onMouseDown(H){if(T)return;const j=Ke(H.currentTarget);function ae(de){if(!I.current)return;const Ee=de.target;if(xe(I.current,Ee)||xe(w.current,Ee)||Ee===I.current)return;const B=Fg(I.current);de.clientX>=B.left-qn&&de.clientX<=B.right+qn&&de.clientY>=B.top-qn&&de.clientY<=B.bottom+qn||h(!1,ge(Zl,de))}O.start(0,()=>{j.addEventListener("mouseup",ae,{once:!0})})}},b.getValidationProps,c,D);te.role="combobox";const G=a.useMemo(()=>({...d,open:T,disabled:_,value:N,readOnly:y,placeholder:!A}),[d,T,_,N,y,A]);return ye("button",t,{ref:[n,I],state:G,stateAttributesMapping:Vg,props:te})});process.env.NODE_ENV!=="production"&&(Pa.displayName="SelectTrigger");const jg={value:()=>null},Aa=a.forwardRef(function(t,n){const{className:o,render:r,children:s,...i}=t,{store:c,valueRef:u}=jt(),l=ve(c,he.value),f=ve(c,he.items),d=ve(c,he.itemToStringLabel),p=ve(c,he.serializedValue),m=a.useMemo(()=>({value:l,placeholder:!p}),[l,p]),g=typeof s=="function"?s(l):s??(Array.isArray(l)?Dg(l,d):Mg(l,f,d));return ye("span",t,{state:m,ref:[n,u],props:[{children:g},i],stateAttributesMapping:jg})});process.env.NODE_ENV!=="production"&&(Aa.displayName="SelectValue");const Na=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=jt(),c=ve(i,he.open),u=a.useMemo(()=>({open:c}),[c]);return ye("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:kr})});process.env.NODE_ENV!=="production"&&(Na.displayName="SelectIcon");const Ia=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ia.displayName="SelectPortalContext");const Ma=a.forwardRef(function(t,n){const{store:o}=jt(),r=ve(o,he.mounted),s=ve(o,he.forceMount);return r||s?P.jsx(Ia.Provider,{value:!0,children:P.jsx(Eo,{ref:n,...t})}):null});process.env.NODE_ENV!=="production"&&(Ma.displayName="SelectPortal");const ns=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ns.displayName="SelectPositionerContext");function $g(){const e=a.useContext(ns);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.":Ae(59));return e}function so(e,t){e&&Object.assign(e.style,t)}const Bg={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Hg={position:"fixed"},Da=a.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:c="bottom",align:u="center",sideOffset:l=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p,arrowPadding:m=5,sticky:g=!1,disableAnchorTracking:h,alignItemWithTrigger:E=!0,collisionAvoidance:b=Wl,...y}=t,{store:x,listRef:v,labelsRef:R,alignItemWithTriggerActiveRef:_,selectedItemTextRef:T,valuesRef:N,initialValueRef:F,popupRef:L,setValue:k}=jt(),A=Oa(),w=ve(x,he.open),I=ve(x,he.mounted),C=ve(x,he.modal),O=ve(x,he.value),D=ve(x,he.touchModality),S=ve(x,he.positionerElement),M=ve(x,he.triggerElement),$=ve(x,he.isItemEqualToValue),z=a.useRef(null),Z=a.useRef(null),[Y,te]=a.useState(E),G=I&&Y&&!D;!I&&Y!==E&&te(E),X(()=>{I||(he.scrollUpArrowVisible(x.state)&&x.set("scrollUpArrowVisible",!1),he.scrollDownArrowVisible(x.state)&&x.set("scrollDownArrowVisible",!1))},[x,I]),a.useImperativeHandle(_,()=>G),Gr((G||C)&&w&&!D,M);const H=aa({anchor:o,floatingRootContext:A,positionMethod:r,mounted:I,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:d,collisionPadding:p,sticky:g,disableAnchorTracking:h??G,collisionAvoidance:b,keepMounted:!0}),j=G?"none":H.side,ae=G?Hg:H.positionerStyles,de=a.useMemo(()=>{const K={};return w||(K.pointerEvents="none"),{role:"presentation",hidden:!I,style:{...ae,...K}}},[w,I,ae]),Ee=a.useMemo(()=>({open:w,side:j,align:H.align,anchorHidden:H.anchorHidden}),[w,j,H.align,H.anchorHidden]),B=Q(K=>{x.set("positionerElement",K)}),ie=ye("div",t,{ref:[n,B],state:Ee,stateAttributesMapping:Ft,props:[de,y]}),oe=a.useRef(0),Se=Q(K=>{if(K.size===0&&oe.current===0||N.current.length===0)return;const W=oe.current;if(oe.current=K.size,K.size===W)return;const pe=ge(ln);if(W!==0&&!x.state.multiple&&O!==null&&dr(N.current,O,$)===-1){const re=F.current,ce=re!=null&&qo(N.current,re,$)?re:null;k(ce,pe),ce===null&&(x.set("selectedIndex",null),T.current=null)}if(W!==0&&x.state.multiple&&Array.isArray(O)){const le=O.filter(re=>qo(N.current,re,$));(le.length!==O.length||le.some(re=>!qo(O,re,$)))&&(k(le,pe),le.length===0&&(x.set("selectedIndex",null),T.current=null))}if(w&&G){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const le={height:""};so(S,le),so(L.current,le)}}),U=a.useMemo(()=>({...H,side:j,alignItemWithTriggerActive:G,setControlledAlignItemWithTrigger:te,scrollUpArrowRef:z,scrollDownArrowRef:Z}),[H,j,G,te]);return P.jsx(fi,{elementsRef:v,labelsRef:R,onMapChange:Se,children:P.jsxs(ns.Provider,{value:U,children:[I&&C&&P.jsx(Co,{inert:Ro(!w),cutout:M}),ie]})})});process.env.NODE_ENV!=="production"&&(Da.displayName="SelectPositioner");function La(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Kn="base-ui-disable-scrollbar",ii={className:Kn,element:P.jsx("style",{href:Kn,precedence:"base-ui:low",children:`.${Kn}{scrollbar-width:none}.${Kn}::-webkit-scrollbar{display:none}`})},zg={...Ft,...It},ka=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i,popupRef:c,onOpenChangeComplete:u,setOpen:l,valueRef:f,selectedItemTextRef:d,keyboardActiveRef:p,multiple:m,handleScrollArrowVisibility:g,scrollHandlerRef:h}=jt(),{side:E,align:b,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:x,scrollDownArrowRef:v,scrollUpArrowRef:R}=$g(),_=fa()!=null,T=Oa(),N=Xe(),F=ve(i,he.id),L=ve(i,he.open),k=ve(i,he.mounted),A=ve(i,he.popupProps),w=ve(i,he.transitionStatus),I=ve(i,he.triggerElement),C=ve(i,he.positionerElement),O=ve(i,he.listElement),D=a.useRef(0),S=a.useRef(!1),M=a.useRef(0),$=a.useRef(!1),z=a.useRef({}),Z=un(),Y=Q(j=>{if(!C||!c.current||!$.current)return;if(S.current||!y){g();return}const ae=C.style.top==="0px",de=C.style.bottom==="0px",Ee=C.getBoundingClientRect().height,B=Ke(C),ie=getComputedStyle(C),oe=parseFloat(ie.marginTop),Se=parseFloat(ie.marginBottom),U=B.documentElement.clientHeight-oe-Se,K=j.scrollTop,W=j.scrollHeight,pe=j.clientHeight,le=W-pe;let re=null,V=null,ce=!1;if(ae){const ee=le-K,q=Ee+ee,J=Math.min(q,U);re=J,J!==U?V=le:ce=!0}else if(de){const ee=K-0,q=Ee+ee,J=Math.min(q,U),ue=q-U;re=J,J!==U?V=0:(ce=!0,K<le&&(V=K-(ee-ue)))}re!=null&&(C.style.height=`${re}px`),V!=null&&(j.scrollTop=V),ce&&(S.current=!0),g()});a.useImperativeHandle(h,()=>Y,[Y]),Lt({open:L,ref:c,onComplete(){L&&u?.(!0)}});const te=a.useMemo(()=>({open:L,transitionStatus:w,side:E,align:b}),[L,w,E,b]);X(()=>{!C||!c.current||Object.keys(z.current).length||(z.current={top:C.style.top||"0",left:C.style.left||"0",right:C.style.right,height:C.style.height,bottom:C.style.bottom,minHeight:C.style.minHeight,maxHeight:C.style.maxHeight,marginTop:C.style.marginTop,marginBottom:C.style.marginBottom})},[c,C]),X(()=>{k||y||($.current=!1,S.current=!1,D.current=0,M.current=0,so(C,z.current))},[k,y,C,c]),X(()=>{const j=c.current;if(!(!k||!I||!C||!j)){if(!y){$.current=!0,Z.request(g);return}queueMicrotask(()=>{const ae=getComputedStyle(C),de=getComputedStyle(j),Ee=Ke(I),B=De(C),ie=I.getBoundingClientRect(),oe=C.getBoundingClientRect(),Se=ie.left,U=ie.height,K=O||j,W=K.scrollHeight,pe=parseFloat(de.borderBottomWidth),le=parseFloat(ae.marginTop)||10,re=parseFloat(ae.marginBottom)||10,V=parseFloat(ae.minHeight)||100,ce=5,ee=5,q=20,J=Ee.documentElement.clientHeight-le-re,ue=Ee.documentElement.clientWidth,fe=J-ie.bottom+U,Re=d.current,we=f.current;let Ce=0,$e=0;if(Re&&we){const Fe=we.getBoundingClientRect(),Ue=Re.getBoundingClientRect(),Ye=Fe.left-Se,wt=Ue.left-oe.left,Dn=Fe.top-ie.top+Fe.height/2,Oo=Ue.top-oe.top+Ue.height/2;Ce=Ye-wt,$e=Oo-Dn}const st=fe+$e+re+pe;let Oe=Math.min(J,st);const et=J-le-re,Ge=st-Oe,it=Math.max(ce,Se+Ce),Te=ue-ee,Ne=Math.max(0,it+oe.width-Te);C.style.left=`${it-Ne}px`,C.style.height=`${Oe}px`,C.style.maxHeight="auto",C.style.marginTop=`${le}px`,C.style.marginBottom=`${re}px`,j.style.height="100%";const Be=K.scrollHeight-K.clientHeight,ke=Ge>=Be;ke&&(Oe=Math.min(J,oe.height)-(Ge-Be));const be=ie.top<q||ie.bottom>J-q||Oe<Math.min(W,V),Pe=(B.visualViewport?.scale??1)!==1&&Ii;if(be||Pe){$.current=!0,so(C,z.current),rt.flushSync(()=>x(!1));return}if(ke){const Fe=Math.max(0,J-st);C.style.top=oe.height>=et?"0":`${Fe}px`,C.style.height=`${Oe}px`,K.scrollTop=K.scrollHeight-K.clientHeight,D.current=Math.max(V,Oe)}else C.style.bottom="0",D.current=Math.max(V,Oe),K.scrollTop=Ge;D.current===J&&(S.current=!0),g(),setTimeout(()=>{$.current=!0})})}},[i,k,C,I,f,d,c,g,y,x,Z,v,R,O]),a.useEffect(()=>{if(!y||!C||!k)return;const j=De(C);function ae(de){l(!1,ge(Jl,de))}return j.addEventListener("resize",ae),()=>{j.removeEventListener("resize",ae)}},[l,y,C,k]);const G={...O?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":m||void 0,id:`${F}-list`},onKeyDown(j){p.current=!0,_&&Dr.has(j.key)&&j.stopPropagation()},onMouseMove(){p.current=!1},onPointerLeave(j){if(La(j)||j.pointerType==="touch")return;const ae=j.currentTarget;N.start(0,()=>{i.set("activeIndex",null),ae.focus({preventScroll:!0})})},onScroll(j){O||h.current?.(j.currentTarget)},...y&&{style:O?{height:"100%"}:Bg}},H=ye("div",t,{ref:[n,c],state:te,stateAttributesMapping:zg,props:[A,G,Qr(w),{className:!O&&y?ii.className:void 0},s]});return P.jsxs(a.Fragment,{children:[ii.element,P.jsx(Br,{context:T,modal:!1,disabled:!k,restoreFocus:!0,children:H})]})});process.env.NODE_ENV!=="production"&&(ka.displayName="SelectPopup");const os=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(os.displayName="SelectItemContext");function rs(){const e=a.useContext(os);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.":Ae(57));return e}const Fa=a.memo(a.forwardRef(function(t,n){const{render:o,className:r,value:s=null,label:i,disabled:c=!1,nativeButton:u=!1,...l}=t,f=a.useRef(null),d=Ci({label:i,textRef:f,indexGuessBehavior:Ri.GuessFromOrder}),{store:p,getItemProps:m,setOpen:g,setValue:h,selectionRef:E,typingRef:b,valuesRef:y,keyboardActiveRef:x,multiple:v}=jt(),R=Xe(),_=ve(p,he.isActive,d.index),T=ve(p,he.isSelected,d.index,s),N=ve(p,he.isSelectedByFocus,d.index),F=ve(p,he.isItemEqualToValue),L=d.index,k=L!==-1,A=a.useRef(null),w=Ve(L);X(()=>{if(!k)return;const G=y.current;return G[L]=s,()=>{delete G[L]}},[k,L,s,y]),X(()=>{if(!k)return;const G=p.state.value;let H=G;v&&Array.isArray(G)&&G.length>0&&(H=G[G.length-1]),H!==void 0&&an(H,s,F)&&p.set("selectedIndex",L)},[k,L,v,F,p,s]);const I=a.useMemo(()=>({disabled:c,selected:T,highlighted:_}),[c,T,_]),C=m({active:_,selected:T});C.onFocus=void 0,C.id=void 0;const O=a.useRef(null),D=a.useRef("mouse"),S=a.useRef(!1),{getButtonProps:M,buttonRef:$}=St({disabled:c,focusableWhenDisabled:!0,native:u});function z(G){const H=p.state.value;if(v){const j=Array.isArray(H)?H:[],ae=T?Ng(j,s,F):[...j,s];h(ae,ge(No,G))}else h(s,ge(No,G)),g(!1,ge(No,G))}const Z={role:"option","aria-selected":T,"aria-disabled":c||void 0,tabIndex:_?0:-1,onFocus(){p.set("activeIndex",L)},onMouseEnter(){!x.current&&p.state.selectedIndex===null&&p.set("activeIndex",L)},onMouseMove(){p.set("activeIndex",L)},onMouseLeave(G){x.current||La(G)||R.start(0,()=>{p.state.activeIndex===L&&p.set("activeIndex",null)})},onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(G){O.current=G.key,p.set("activeIndex",L)},onClick(G){S.current=!1,!(G.type==="keydown"&&O.current===null)&&(c||O.current===" "&&b.current||D.current!=="touch"&&!_||(O.current=null,z(G.nativeEvent)))},onPointerEnter(G){D.current=G.pointerType},onPointerDown(G){D.current=G.pointerType,S.current=!0},onMouseUp(G){if(c)return;if(S.current){S.current=!1;return}const H=!E.current.allowSelectedMouseUp&&T,j=!E.current.allowUnselectedMouseUp&&!T;H||j||D.current!=="touch"&&!_||z(G.nativeEvent)}},Y=ye("div",t,{ref:[$,n,d.ref,A],state:I,props:[C,Z,l,M]}),te=a.useMemo(()=>({selected:T,indexRef:w,textRef:f,selectedByFocus:N,hasRegistered:k}),[T,w,f,N,k]);return P.jsx(os.Provider,{value:te,children:Y})}));process.env.NODE_ENV!=="production"&&(Fa.displayName="SelectItem");const Va=a.forwardRef(function(t,n){const o=t.keepMounted??!1,{selected:r}=rs();return o||r?P.jsx(ja,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(Va.displayName="SelectItemIndicator");const ja=a.memo(a.forwardRef((e,t)=>{const{render:n,className:o,keepMounted:r,...s}=e,{selected:i}=rs(),c=a.useRef(null),{transitionStatus:u,setMounted:l}=ao(i),f=a.useMemo(()=>({selected:i,transitionStatus:u}),[i,u]),d=ye("span",e,{ref:[t,c],state:f,props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:It});return Lt({open:i,ref:c,onComplete(){i||l(!1)}}),d}));process.env.NODE_ENV!=="production"&&(ja.displayName="Inner");const $a=a.memo(a.forwardRef(function(t,n){const{indexRef:o,textRef:r,selectedByFocus:s,hasRegistered:i}=rs(),{selectedItemTextRef:c}=jt(),{className:u,render:l,...f}=t,d=a.useCallback(m=>{if(!m||!i)return;const g=c.current===null||!c.current.isConnected;(s||g&&o.current===0)&&(c.current=m)},[c,o,s,i]);return ye("div",t,{ref:[d,n,r],props:f})}));process.env.NODE_ENV!=="production"&&($a.displayName="SelectItemText");const ss=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ss.displayName="SelectGroupContext");function Ug(){const e=a.useContext(ss);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.":Ae(56));return e}const Ba=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,[i,c]=a.useState(),u=a.useMemo(()=>({labelId:i,setLabelId:c}),[i,c]),l=ye("div",t,{ref:n,props:[{role:"group","aria-labelledby":i},s]});return P.jsx(ss.Provider,{value:u,children:l})});process.env.NODE_ENV!=="production"&&(Ba.displayName="SelectGroup");const Ha=a.forwardRef(function(t,n){const{className:o,render:r,id:s,...i}=t,{setLabelId:c}=Ug(),u=ut(s);return X(()=>{c(u)},[u,c]),ye("div",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(Ha.displayName="SelectGroupLabel");const za=a.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t,c=a.useMemo(()=>({orientation:s}),[s]);return ye("div",t,{state:c,ref:n,props:[{role:"separator","aria-orientation":s},i]})});process.env.NODE_ENV!=="production"&&(za.displayName="Separator");const Wg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),ci=e=>{const t=qg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ua=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),Kg=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Gg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Yg=ne.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:s,iconNode:i,...c},u)=>ne.createElement("svg",{ref:u,...Gg,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Ua("lucide",r),...!s&&!Kg(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,f])=>ne.createElement(l,f)),...Array.isArray(s)?s:[s]]));const Wa=(e,t)=>{const n=ne.forwardRef(({className:o,...r},s)=>ne.createElement(Yg,{ref:s,iconNode:t,className:Ua(`lucide-${Wg(ci(e))}`,`lucide-${e}`,o),...r}));return n.displayName=ci(e),n};const Xg=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zg=Wa("check",Xg);const Jg=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qg=Wa("chevron-down",Jg);function qa(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=qa(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Yt(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=qa(e))&&(o&&(o+=" "),o+=t);return o}const eh="_trigger_krl6a_1",th="_icon_krl6a_40",nh="_popup_krl6a_48",oh="_item_krl6a_69",rh="_itemIndicator_krl6a_99",sh="_group_krl6a_107",ih="_label_krl6a_111",ch="_separator_krl6a_118",At={trigger:eh,icon:th,popup:nh,item:oh,itemIndicator:rh,group:sh,label:ih,separator:ch};function ah(e){return P.jsx(kg,{...e})}const Ka=a.forwardRef(({className:e,children:t,placeholder:n,renderValue:o,...r},s)=>{const i=(c,u)=>!u.value||Array.isArray(u.value)&&u.value.length===0?P.jsx("span",{...c,children:n||"Select..."}):Array.isArray(u.value)?P.jsx("span",{...c,children:u.value.join(", ")}):P.jsx("span",{...c,children:String(u.value)});return P.jsxs(Pa,{ref:s,className:Yt(At.trigger,e),...r,children:[P.jsx(Aa,{render:o||i}),P.jsx(Na,{className:At.icon,children:P.jsx(Qg,{size:16})})]})});Ka.displayName="ALSSelect.Trigger";function lh(e){return P.jsx(Ma,{...e})}const Ga=a.forwardRef(({className:e,...t},n)=>P.jsx(Da,{ref:n,className:Yt(e),sideOffset:4,...t}));Ga.displayName="ALSSelect.Positioner";const Ya=a.forwardRef(({className:e,...t},n)=>P.jsx(ka,{ref:n,className:Yt(At.popup,e),...t}));Ya.displayName="ALSSelect.Popup";const Xa=a.forwardRef(({className:e,children:t,...n},o)=>P.jsxs(Fa,{ref:o,className:Yt(At.item,e),...n,children:[P.jsx($a,{children:t}),P.jsx(Va,{className:At.itemIndicator,children:P.jsx(Zg,{size:16})})]}));Xa.displayName="ALSSelect.Item";const Za=a.forwardRef(({className:e,...t},n)=>P.jsx(Ba,{ref:n,className:Yt(At.group,e),...t}));Za.displayName="ALSSelect.Group";const Ja=a.forwardRef(({className:e,...t},n)=>P.jsx(Ha,{ref:n,className:Yt(At.label,e),...t}));Ja.displayName="ALSSelect.Label";const Qa=a.forwardRef(({className:e,...t},n)=>P.jsx(za,{ref:n,className:Yt(At.separator,e),...t}));Qa.displayName="ALSSelect.Separator";const uh={Root:ah,Trigger:Ka,Portal:lh,Positioner:Ga,Popup:Ya,Item:Xa,Group:Za,Label:Ja,Separator:Qa},fh="_root_qrq0m_1",dh={root:fh};function ph(e){return P.jsx("div",{className:dh.root})}const mh="_root_10n3a_1",gh={root:mh};function hh(e){return P.jsx("div",{className:gh.root})}const yh="_root_1vneq_1",bh={root:yh};function vh(e){return P.jsx("div",{className:bh.root})}const Eh="_root_1gw46_1",xh={root:Eh};function Sh(e){return P.jsx("div",{className:xh.root})}let ai=0;function el(e){return ai+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ai}`}const To=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(To.displayName="ToastContext");function is(){const e=a.useContext(To);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Ae(73));return e}function Ko(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const tl=function(t){const{children:n,timeout:o=5e3,limit:r=3,toastManager:s}=t,[i,c]=a.useState([]),[u,l]=a.useState(!1),[f,d]=a.useState(!1),[p,m]=a.useState(null);i.length===0&&(u&&l(!1),f&&d(!1));const g=u||f,h=a.useRef(new Map),E=a.useRef(null),b=a.useRef(!0),y=a.useRef(!1);function x(w){const I=ct(Ke(E.current));if(!E.current||!xe(E.current,I)||!sr(I))return;const C=i.findIndex(S=>S.id===w);let O=null,D=C+1;for(;D<i.length;){if(i[D].transitionStatus!=="ending"){O=i[D];break}D+=1}if(!O)for(D=C-1;D>=0;){if(i[D].transitionStatus!=="ending"){O=i[D];break}D-=1}O?O.ref?.current?.focus():p?.focus({preventScroll:!0})}const v=Q(()=>{y.current||(y.current=!0,h.current.forEach(w=>{if(w.timeout){w.timeout.clear();const I=Date.now()-w.start,C=w.delay-I;w.remaining=C>0?C:0}}))}),R=Q(()=>{y.current&&(y.current=!1,h.current.forEach((w,I)=>{w.remaining=w.remaining>0?w.remaining:w.delay,w.timeout??=pt.create(),w.timeout.start(w.remaining,()=>{h.current.delete(I),w.callback()}),w.start=Date.now()}))}),_=Q(w=>{c(O=>{const D=O.map(M=>M.id===w?{...M,transitionStatus:"ending",height:0}:M),S=D.filter(M=>M.transitionStatus!=="ending");return D.map(M=>{if(M.transitionStatus==="ending")return M;const $=S.indexOf(M)>=r;return{...M,limited:$}})});const I=h.current.get(w);I&&I.timeout&&(I.timeout.clear(),h.current.delete(w)),i.find(O=>O.id===w)?.onClose?.(),x(w),i.length===1&&(l(!1),d(!1))}),T=Q(w=>{c(C=>C.filter(O=>O.id!==w)),i.find(C=>C.id===w)?.onRemove?.()}),N=Q((w,I,C)=>{const O=Date.now(),D=b.current&&!u&&!f,S=D?pt.create():void 0;S?.start(I,()=>{h.current.delete(w),C()}),h.current.set(w,{timeout:S,start:D?O:0,delay:I,remaining:I,callback:C})}),F=Q(w=>{const I=w.id||el("toast"),C={...w,id:I,transitionStatus:"starting"};c(D=>{const S=[C,...D],M=S.filter($=>$.transitionStatus!=="ending");if(M.length>r){const $=M.length-r,z=M.slice(-$);return S.map(Z=>z.some(Y=>Y.id===Z.id)?{...Z,limited:!0}:{...Z,limited:!1})}return S.map($=>({...$,limited:!1}))});const O=C.timeout??o;return C.type!=="loading"&&O>0&&N(I,O,()=>_(I)),(u||f||!b.current)&&v(),I}),L=Q((w,I)=>{c(C=>C.map(O=>O.id===w?{...O,...I}:O))}),k=Q((w,I)=>{const C=Ko(I.loading),O=F({...C,type:"loading"}),D=w.then(S=>{const M=Ko(I.success,S);L(O,{...M,type:"success"});const $=M.timeout??o;return $>0&&N(O,$,()=>_(O)),(u||f||!b.current)&&v(),S}).catch(S=>{const M=Ko(I.error,S);L(O,{...M,type:"error"});const $=M.timeout??o;return $>0&&N(O,$,()=>_(O)),(u||f||!b.current)&&v(),Promise.reject(S)});return{}.hasOwnProperty.call(I,"setPromise")&&I.setPromise(D),D});a.useEffect(function(){return s?s[" subscribe"](({action:C,options:O})=>{const D=O.id;C==="promise"&&O.promise?k(O.promise,O):C==="update"&&D?L(D,O):C==="close"&&D?_(D):F(O)}):void 0},[F,L,N,o,s,k,_]);const A=a.useMemo(()=>({toasts:i,setToasts:c,hovering:u,setHovering:l,focused:f,setFocused:d,expanded:g,add:F,close:_,remove:T,update:L,promise:k,pauseTimers:v,resumeTimers:R,prevFocusElement:p,setPrevFocusElement:m,viewportRef:E,scheduleTimer:N,windowFocusedRef:b}),[F,_,f,u,g,v,p,k,T,R,N,i,L]);return P.jsx(To.Provider,{value:A,children:n})};process.env.NODE_ENV!=="production"&&(tl.displayName="ToastProvider");const nl=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(nl.displayName="ToastViewportContext");let wh=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const ol=a.forwardRef(function(t,n){const{render:o,className:r,children:s,...i}=t,{toasts:c,pauseTimers:u,resumeTimers:l,setHovering:f,setFocused:d,viewportRef:p,windowFocusedRef:m,prevFocusElement:g,setPrevFocusElement:h,expanded:E,focused:b}=is(),y=a.useRef(!1),x=a.useRef(!1),v=c.length,R=c[0]?.height??0,_=a.useMemo(()=>c.some(S=>S.transitionStatus==="ending"),[c]);a.useEffect(()=>{if(!p.current)return;function S($){v!==0&&$.key==="F6"&&$.target!==p.current&&($.preventDefault(),h(ct(Ke(p.current))),p.current?.focus({preventScroll:!0}),u(),d(!0))}const M=De(p.current);return M.addEventListener("keydown",S),()=>{M.removeEventListener("keydown",S)}},[u,d,h,v,p]),a.useEffect(()=>{if(!p.current||!v)return;const S=De(p.current);function M(z){z.target===S&&(m.current=!1,u())}function $(z){if(z.relatedTarget||z.target===S)return;const Z=qe(z),Y=ct(Ke(p.current));(!xe(p.current,Z)||!sr(Y))&&l(),setTimeout(()=>{m.current=!0})}return S.addEventListener("blur",M,!0),S.addEventListener("focus",$,!0),()=>{S.removeEventListener("blur",M,!0),S.removeEventListener("focus",$,!0)}},[u,l,p,m,d,v]),a.useEffect(()=>{const S=p.current;if(!S||v===0)return;const M=Ke(S);function $(z){if(z.pointerType!=="touch")return;const Z=qe(z);xe(S,Z)||(l(),f(!1),d(!1))}return M.addEventListener("pointerdown",$,!0),()=>{M.removeEventListener("pointerdown",$,!0)}},[v,l,d,f,p]);function T(S){p.current&&(y.current=!0,S.relatedTarget===p.current?c[0]?.ref?.current?.focus():g?.focus({preventScroll:!0}))}function N(S){S.key==="Tab"&&S.shiftKey&&S.target===p.current&&(S.preventDefault(),g?.focus({preventScroll:!0}),l())}a.useEffect(()=>{!m.current||_||!x.current||(l(),f(!1),x.current=!1)},[_,l,f,m]);function F(){u(),f(!0),x.current=!1}function L(){c.some(S=>S.transitionStatus==="ending")?x.current=!0:(l(),f(!1))}function k(){if(y.current){y.current=!1;return}b||sr(Ke(p.current).activeElement)&&(d(!0),u())}function A(S){!b||xe(p.current,S.relatedTarget)||(d(!1),l())}const w={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:F,onMouseMove:F,onMouseLeave:L,onFocus:k,onBlur:A,onKeyDown:N,onClick:k},I=a.useMemo(()=>({expanded:E}),[E]),C=ye("div",t,{ref:[n,p],state:I,props:[w,{style:{[wh.frontmostHeight]:R?`${R}px`:void 0}},i,{children:P.jsxs(a.Fragment,{children:[v>0&&g&&P.jsx(dt,{onFocus:T}),s,v>0&&g&&P.jsx(dt,{onFocus:T})]})}]}),O=a.useMemo(()=>({viewportRef:p}),[p]),D=a.useMemo(()=>c.filter(S=>S.priority==="high"),[c]);return P.jsxs(nl.Provider,{value:O,children:[v>0&&g&&P.jsx(dt,{onFocus:T}),C,!b&&D.length>0&&P.jsx("div",{style:vo,children:D.map(S=>P.jsxs("div",{role:"alert","aria-atomic":!0,children:[P.jsx("div",{children:S.title}),P.jsx("div",{children:S.description})]},S.id))})]})});process.env.NODE_ENV!=="production"&&(ol.displayName="ToastViewport");const cs=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(cs.displayName="ToastRootContext");function qt(){const e=a.useContext(cs);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":Ae(66));return e}let $t=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const Rh={...It,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},bn=40,Ch=10,Rt=.5,_h=1;function li(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Th(e){const n=window.getComputedStyle(e).transform;let o=0,r=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const c=i[1].split(", ").map(parseFloat);c.length===6?(o=c[4],r=c[5],s=Math.sqrt(c[0]*c[0]+c[1]*c[1])):c.length===16&&(o=c[12],r=c[13],s=c[0])}}return{x:o,y:r,scale:s}}const rl=a.forwardRef(function(t,n){const{toast:o,render:r,className:s,swipeDirection:i=["down","right"],...c}=t,u=o.positionerProps?.anchor!==void 0;let l=[];u||(l=Array.isArray(i)?i:[i]);const f=l.length>0,{toasts:d,focused:p,close:m,remove:g,setToasts:h,pauseTimers:E,expanded:b,setHovering:y}=is(),[x,v]=a.useState(void 0),[R,_]=a.useState(!1),[T,N]=a.useState(!1),[F,L]=a.useState(!1),[k,A]=a.useState({x:0,y:0}),[w,I]=a.useState({x:0,y:0,scale:1}),[C,O]=a.useState(),[D,S]=a.useState(),[M,$]=a.useState(null),z=a.useRef(null),Z=a.useRef({x:0,y:0}),Y=a.useRef({x:0,y:0,scale:1}),te=a.useRef(void 0),G=a.useRef(0),H=a.useRef(!1),j=a.useRef({x:0,y:0}),ae=a.useRef(!1),de=a.useMemo(()=>d.indexOf(o),[o,d]),Ee=a.useMemo(()=>d.filter(q=>q.transitionStatus!=="ending").indexOf(o),[o,d]),B=a.useMemo(()=>d.slice(0,d.indexOf(o)).reduce((q,J)=>q+(J.height||0),0),[d,o]);Lt({open:o.transitionStatus!=="ending",ref:z,onComplete(){o.transitionStatus==="ending"&&g(o.id)}});const ie=Q(()=>{const q=z.current;if(!q)return;const J=q.style.height;q.style.height="auto";const ue=q.offsetHeight;q.style.height=J,h(fe=>fe.map(Re=>Re.id===o.id?{...Re,ref:z,height:ue,transitionStatus:void 0}:Re))});X(ie,[ie]);function oe(q,J){let ue=q,fe=J;return!l.includes("left")&&!l.includes("right")?ue=q>0?q**Rt:-(Math.abs(q)**Rt):(!l.includes("right")&&q>0&&(ue=q**Rt),!l.includes("left")&&q<0&&(ue=-(Math.abs(q)**Rt))),!l.includes("up")&&!l.includes("down")?fe=J>0?J**Rt:-(Math.abs(J)**Rt):(!l.includes("down")&&J>0&&(fe=J**Rt),!l.includes("up")&&J<0&&(fe=-(Math.abs(J)**Rt))),{x:ue,y:fe}}function Se(q){if(q.button!==0)return;q.pointerType==="touch"&&E();const J=qe(q.nativeEvent);if(!(J&&J.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(H.current=!1,te.current=void 0,G.current=0,Z.current={x:q.clientX,y:q.clientY},j.current=Z.current,z.current){const fe=Th(z.current);Y.current=fe,I(fe),A({x:fe.x,y:fe.y})}y(!0),_(!0),N(!1),$(null),ae.current=!0,z.current?.setPointerCapture(q.pointerId)}}function U(q){if(!R)return;q.preventDefault(),ae.current&&(Z.current={x:q.clientX,y:q.clientY},ae.current=!1);const{clientY:J,clientX:ue,movementX:fe,movementY:Re}=q;(Re<0&&J>j.current.y||Re>0&&J<j.current.y)&&(j.current={x:j.current.x,y:J}),(fe<0&&ue>j.current.x||fe>0&&ue<j.current.x)&&(j.current={x:ue,y:j.current.y});const we=ue-Z.current.x,Ce=J-Z.current.y,$e=J-j.current.y,st=ue-j.current.x;if(!T&&Math.sqrt(we*we+Ce*Ce)>=_h&&(N(!0),M===null)){const Ne=l.includes("left")||l.includes("right"),Be=l.includes("up")||l.includes("down");if(Ne&&Be){const ke=Math.abs(we),be=Math.abs(Ce);$(ke>be?"horizontal":"vertical")}}let Oe;if(!te.current)M==="vertical"?Ce>0?Oe="down":Ce<0&&(Oe="up"):M==="horizontal"?we>0?Oe="right":we<0&&(Oe="left"):Math.abs(we)>=Math.abs(Ce)?Oe=we>0?"right":"left":Oe=Ce>0?"down":"up",Oe&&l.includes(Oe)&&(te.current=Oe,G.current=li(Oe,we,Ce),v(Oe));else{const Te=te.current,Ne=li(Te,st,$e);Ne>bn?(H.current=!1,v(Te)):G.current-Ne>=Ch&&(H.current=!0)}const et=oe(we,Ce);let Ge=Y.current.x,it=Y.current.y;M==="horizontal"?(l.includes("left")||l.includes("right"))&&(Ge+=et.x):(M==="vertical"||(l.includes("left")||l.includes("right"))&&(Ge+=et.x),(l.includes("up")||l.includes("down"))&&(it+=et.y)),A({x:Ge,y:it})}function K(q){if(!R)return;if(_(!1),N(!1),$(null),z.current?.releasePointerCapture(q.pointerId),H.current){A({x:w.x,y:w.y}),v(void 0);return}let J=!1;const ue=k.x-w.x,fe=k.y-w.y;let Re;for(const we of l){switch(we){case"right":ue>bn&&(J=!0,Re="right");break;case"left":ue<-bn&&(J=!0,Re="left");break;case"down":fe>bn&&(J=!0,Re="down");break;case"up":fe<-bn&&(J=!0,Re="up");break}if(J)break}J?(v(Re),L(!0),m(o.id)):(A({x:w.x,y:w.y}),v(void 0))}function W(q){if(q.key==="Escape"){if(!z.current||!xe(z.current,ct(Ke(z.current))))return;m(o.id)}}a.useEffect(()=>{if(!f)return;const q=z.current;if(!q)return;function J(ue){xe(q,ue.target)&&ue.preventDefault()}return q.addEventListener("touchmove",J,{passive:!1}),()=>{q.removeEventListener("touchmove",J)}},[f]);function pe(){if(!R&&k.x===w.x&&k.y===w.y&&!F)return{[$t.swipeMovementX]:"0px",[$t.swipeMovementY]:"0px"};const q=k.x-w.x,J=k.y-w.y;return{transition:R?"none":void 0,transform:R?`translateX(${k.x}px) translateY(${k.y}px) scale(${w.scale})`:void 0,[$t.swipeMovementX]:`${q}px`,[$t.swipeMovementY]:`${J}px`}}const le=o.priority==="high",re={role:le?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":D,"aria-hidden":le&&!p?!0:void 0,onPointerDown:f?Se:void 0,onPointerMove:f?U:void 0,onPointerUp:f?K:void 0,onKeyDown:W,inert:Ro(o.limited),style:{...pe(),[$t.index]:o.transitionStatus==="ending"?de:Ee,[$t.offsetY]:`${B}px`,[$t.height]:o.height?`${o.height}px`:void 0}},V=a.useMemo(()=>({rootRef:z,toast:o,titleId:C,setTitleId:O,descriptionId:D,setDescriptionId:S,swiping:R,swipeDirection:x,recalculateHeight:ie,index:de,visibleIndex:Ee,expanded:b}),[o,C,D,R,x,ie,de,Ee,b]),ce=a.useMemo(()=>({transitionStatus:o.transitionStatus,expanded:b,limited:o.limited||!1,type:o.type,swiping:V.swiping,swipeDirection:V.swipeDirection}),[b,o.transitionStatus,o.limited,o.type,V.swiping,V.swipeDirection]),ee=ye("div",t,{ref:[n,V.rootRef],state:ce,stateAttributesMapping:Rh,props:[re,c]});return P.jsx(cs.Provider,{value:V,children:ee})});process.env.NODE_ENV!=="production"&&(rl.displayName="ToastRoot");const sl=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=qt(),l=a.useRef(null);X(()=>{const m=l.current;if(!m||(u(),typeof ResizeObserver!="function"))return;const g=new ResizeObserver(u);return g.observe(m),()=>{g.disconnect()}},[u]);const f=i>0,d=a.useMemo(()=>({expanded:c,behind:f}),[c,f]);return ye("div",t,{ref:[n,l],state:d,props:s})});process.env.NODE_ENV!=="production"&&(sl.displayName="ToastContent");const il=a.forwardRef(function(t,n){const{render:o,className:r,id:s,children:i,...c}=t,{toast:u}=qt(),l=i??u.description,f=!!l,d=Nt(s),{setDescriptionId:p}=qt();X(()=>{if(f)return p(d),()=>{p(void 0)}},[f,d,p]);const m=a.useMemo(()=>({type:u.type}),[u.type]),g=ye("p",t,{ref:n,state:m,props:{...c,id:d,children:l}});return f?g:null});process.env.NODE_ENV!=="production"&&(il.displayName="ToastDescription");const cl=a.forwardRef(function(t,n){const{render:o,className:r,id:s,children:i,...c}=t,{toast:u}=qt(),l=i??u.title,f=!!l,d=Nt(s),{setTitleId:p}=qt();X(()=>{if(f)return p(d),()=>{p(void 0)}},[f,d,p]);const m=a.useMemo(()=>({type:u.type}),[u.type]),g=ye("h2",t,{ref:n,state:m,props:{...c,id:d,children:l}});return f?g:null});process.env.NODE_ENV!=="production"&&(cl.displayName="ToastTitle");const al=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s,nativeButton:i=!0,...c}=t,{close:u,expanded:l}=is(),{toast:f}=qt(),{getButtonProps:d,buttonRef:p}=St({disabled:s,native:i}),m=a.useMemo(()=>({type:f.type}),[f.type]);return ye("button",t,{ref:[n,p],state:m,props:[{"aria-hidden":!l,onClick(){u(f.id)}},c,d]})});process.env.NODE_ENV!=="production"&&(al.displayName="ToastClose");const ll=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=qt(),l=u.actionProps?.children??c.children,f=!!l,{getButtonProps:d,buttonRef:p}=St({disabled:s,native:i}),m=a.useMemo(()=>({type:u.type}),[u.type]),g=ye("button",t,{ref:[n,p],state:m,props:[c,u.actionProps,d,{children:l}]});return f?g:null});process.env.NODE_ENV!=="production"&&(ll.displayName="ToastAction");const ul=a.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,...c}=t,{portalNode:u,portalSubtree:l}=pc({container:r,ref:n,componentProps:t,elementProps:c});return!l&&!u?null:P.jsxs(a.Fragment,{children:[l,u&&rt.createPortal(o,u)]})});process.env.NODE_ENV!=="production"&&(ul.displayName="FloatingPortalLite");const Oh=ul;function fl(){const e=a.useContext(To);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Ae(73));const{toasts:t,add:n,close:o,update:r,promise:s}=e;return a.useMemo(()=>({toasts:t,add:n,close:o,update:r,promise:s}),[t,n,o,r,s])}function Ph(){const e=[];function t(n){e.forEach(o=>o(n))}return{" subscribe":function(o){return e.push(o),()=>{const r=e.indexOf(o);r!==-1&&e.splice(r,1)}},add(n){const o=n.id||el("toast"),r={...n,id:o,transitionStatus:"starting"};return t({action:"add",options:r}),o},close(n){t({action:"close",options:{id:n}})},update(n,o){t({action:"update",options:{...o,id:n}})},promise(n,o){let r=n;return t({action:"promise",options:{...o,promise:n,setPromise(s){r=s}}}),r}}}const Ah="_viewport_x4zrf_2",Nh="_root_x4zrf_16",Ih="_content_x4zrf_120",Mh="_title_x4zrf_133",Dh="_description_x4zrf_158",Lh="_action_x4zrf_166",kh="_close_x4zrf_194",Fh="_closeIcon_x4zrf_225",xt={viewport:Ah,root:Nh,"root--success":"_root--success_x4zrf_99","root--error":"_root--error_x4zrf_103","root--warning":"_root--warning_x4zrf_107","root--info":"_root--info_x4zrf_111","root--default":"_root--default_x4zrf_115",content:Ih,title:Mh,description:Dh,action:Lh,close:kh,closeIcon:Fh},dl=({limit:e=3,timeout:t=5e3,toastManager:n,children:o})=>P.jsx(tl,{limit:e,timeout:t,toastManager:n,children:o});dl.displayName="ALSToast.Provider";const pl=({container:e,children:t})=>P.jsx(Oh,{container:e,children:t});pl.displayName="ALSToast.Portal";const ml=ne.forwardRef(({className:e,style:t},n)=>{const{toasts:o}=fl(),r=[xt.viewport,e].filter(Boolean).join(" ");return P.jsx(ol,{ref:n,className:r,style:t,children:o.slice().map((s,i)=>P.jsx(as,{toast:s,style:{"--toast-index":i},children:P.jsxs(ls,{children:[s.title&&P.jsx(us,{children:s.title}),s.description&&P.jsx(fs,{children:s.description}),s.actionProps&&P.jsx(ds,{...s.actionProps}),P.jsx(ps,{})]})},s.id))})});ml.displayName="ALSToast.Viewport";const as=ne.forwardRef(({toast:e,swipeDirection:t=["down","right"],className:n,style:o,children:r},s)=>{const i=e.type||"default",c=[xt.root,xt[`root--${i}`],n].filter(Boolean).join(" ");return P.jsx(rl,{ref:s,toast:e,swipeDirection:t,className:c,style:o,children:r})});as.displayName="ALSToast.Root";const ls=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.content,e].filter(Boolean).join(" ");return P.jsx(sl,{ref:o,className:r,style:t,children:n})});ls.displayName="ALSToast.Content";const us=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.title,e].filter(Boolean).join(" ");return P.jsx(cl,{ref:o,className:r,style:t,children:n})});us.displayName="ALSToast.Title";const fs=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.description,e].filter(Boolean).join(" ");return P.jsx(il,{ref:o,className:r,style:t,children:n})});fs.displayName="ALSToast.Description";const ds=ne.forwardRef(({className:e,style:t,children:n,onClick:o},r)=>{const s=[xt.action,e].filter(Boolean).join(" ");return P.jsx(ll,{ref:r,className:s,style:t,onClick:o,children:n})});ds.displayName="ALSToast.Action";const ps=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.close,e].filter(Boolean).join(" ");return P.jsx(al,{ref:o,className:r,style:t,children:n||P.jsx(Vh,{})})});ps.displayName="ALSToast.Close";const Vh=()=>P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:xt.closeIcon,children:P.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jh={Provider:dl,Portal:pl,Viewport:ml,Root:as,Content:ls,Title:us,Description:fs,Action:ds,Close:ps,useToastManager:fl,createToastManager:Ph},$h="_root_19t9o_1",Bh={root:$h};function Hh(e){return P.jsx("div",{className:Bh.root})}const zh="_root_u2979_1",Uh={root:zh};function Wh(e){return P.jsx("div",{className:Uh.root})}const qh="_root_6lo3f_1",Kh={root:qh};function Gh(e){return P.jsx("div",{className:Kh.root})}const Yh="_root_z5dqm_1",Xh={root:Yh};function Zh(e){return P.jsx("div",{className:Xh.root})}const Jh="_layout_hwro4_4",Qh="_layoutLeft_hwro4_28",ey="_layoutRight_hwro4_38",ty="_layoutAsideHidden_hwro4_48",ny="_layoutAsideFullHeight_hwro4_58",oy="_header_hwro4_77",ry="_headerSticky_hwro4_93",sy="_headerFixed_hwro4_98",iy="_headerRelative_hwro4_106",cy="_headerHideOnScroll_hwro4_110",ay="_headerElevated_hwro4_122",ly="_headerTransparent_hwro4_127",uy="_headerWithFullHeightAside_hwro4_133",fy="_layoutAsideCollapsed_hwro4_141",dy="_aside_hwro4_150",py="_asideFullHeight_hwro4_169",my="_asideContent_hwro4_203",gy="_asideContentCollapsed_hwro4_235",hy="_asideRelative_hwro4_240",yy="_asideFixed_hwro4_244",by="_asideCollapsed_hwro4_276",vy="_asideOverlay_hwro4_327",Ey="_asideOverlayClosing_hwro4_370",xy="_asideOverlayBackdrop_hwro4_401",Sy="_asideOverlayBackdropClosing_hwro4_421",wy="_asideResizeHandle_hwro4_437",Ry="_asideResizing_hwro4_470",Cy="_main_hwro4_490",_y="_mainPaddingNone_hwro4_522",Ty="_mainPaddingSm_hwro4_526",Oy="_mainPaddingMd_hwro4_530",Py="_mainPaddingLg_hwro4_534",Ay="_mainPaddingXl_hwro4_538",Ny="_mainFullWidth_hwro4_543",Iy="_mainWithFullHeightAside_hwro4_548",My="_footer_hwro4_565",Dy="_footerRelative_hwro4_577",Ly="_footerSticky_hwro4_581",ky="_footerFixed_hwro4_588",Fy="_footerWithFullHeightAside_hwro4_598",me={layout:Jh,layoutLeft:Qh,layoutRight:ey,layoutAsideHidden:ty,layoutAsideFullHeight:ny,header:oy,headerSticky:ry,headerFixed:sy,headerRelative:iy,headerHideOnScroll:cy,headerElevated:ay,headerTransparent:ly,headerWithFullHeightAside:uy,layoutAsideCollapsed:fy,aside:dy,asideFullHeight:py,asideContent:my,asideContentCollapsed:gy,asideRelative:hy,asideFixed:yy,asideCollapsed:by,asideOverlay:vy,asideOverlayClosing:Ey,asideOverlayBackdrop:xy,asideOverlayBackdropClosing:Sy,asideResizeHandle:wy,asideResizing:Ry,main:Cy,mainPaddingNone:_y,mainPaddingSm:Ty,mainPaddingMd:Oy,mainPaddingLg:Py,mainPaddingXl:Ay,mainFullWidth:Ny,mainWithFullHeightAside:Iy,footer:My,footerRelative:Dy,footerSticky:Ly,footerFixed:ky,footerWithFullHeightAside:Fy},mn=ne.createContext({asidePosition:"left",asideHidden:!1,asideCollapsed:!1,asideFullHeight:!1,headerBehavior:"sticky",scrollY:0,mainRef:null,registerAside:()=>{},registerHeader:()=>{}}),Vy=()=>ne.useContext(mn),jy=(e,t=10)=>{const[n,o]=ne.useState("up"),[r,s]=ne.useState(0),i=ne.useRef(0);return ne.useEffect(()=>{const c=e.current;if(!c)return;const u=()=>{const l=c.scrollTop;s(l),!(Math.abs(l-i.current)<t)&&(o(l>i.current?"down":"up"),i.current=l)};return c.addEventListener("scroll",u,{passive:!0}),()=>c.removeEventListener("scroll",u)},[e,t]),{scrollDirection:n,scrollY:r}},$y=({children:e,className:t="",behavior:n="sticky",scrollThreshold:o=50,elevated:r=!1,transparent:s=!1,height:i})=>{const{scrollY:c,registerHeader:u,asideFullHeight:l}=ne.useContext(mn),[f,d]=ne.useState(!1),[p,m]=ne.useState(s);ne.useEffect(()=>{u(n)},[n,u]),ne.useEffect(()=>{r&&d(c>0),s&&m(c<o)},[c,n,o,r,s]);const g={fixed:me.headerFixed,sticky:me.headerSticky,relative:me.headerRelative,hideOnScroll:me.headerHideOnScroll}[n],h=[me.header,g,f&&me.headerElevated,p&&me.headerTransparent,l&&me.headerWithFullHeightAside,t].filter(Boolean).join(" "),E=i?{"--header-custom-height":typeof i=="number"?`${i}px`:i}:{};return P.jsx("header",{className:h,style:E,children:e})},gl=({children:e,className:t="",collapsed:n=!1,hidden:o=!1,variant:r="relative",width:s,collapsedWidth:i,resizable:c=!1,minWidth:u=200,maxWidth:l=500,onWidthChange:f,overlay:d=!1,onOverlayClose:p,collapsedContent:m,transitionDuration:g=300,fullHeight:h=!1})=>{const{registerAside:E,asidePosition:b}=ne.useContext(mn),[y,x]=ne.useState(null),[v,R]=ne.useState(!1),[_,T]=ne.useState(!1),N=ne.useRef(null);ne.useEffect(()=>{E(n,o,h)},[n,o,h,E]);const F=ne.useCallback(()=>{p&&(T(!0),setTimeout(()=>{T(!1),p()},g))},[p,g]),L=ne.useCallback(C=>{c&&(C.preventDefault(),R(!0))},[c]);if(ne.useEffect(()=>{if(!v)return;const C=D=>{if(!N.current)return;const S=N.current.getBoundingClientRect();let M;b==="right"?M=S.right-D.clientX:M=D.clientX-S.left;const $=Math.min(Math.max(M,u),l);x($),f?.($)},O=()=>{R(!1)};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",O)}},[v,u,l,f,b]),o)return null;const k=r==="fixed"?me.asideFixed:me.asideRelative,A=[me.aside,k,n&&me.asideCollapsed,d&&me.asideOverlay,d&&_&&me.asideOverlayClosing,v&&me.asideResizing,h&&me.asideFullHeight,t].filter(Boolean).join(" "),w={...s&&!n&&!y&&{"--aside-width":typeof s=="number"?`${s}px`:s},...i&&n&&{"--aside-collapsed-width":typeof i=="number"?`${i}px`:i},...y&&!n&&{"--aside-width":`${y}px`},"--aside-transition-duration":`${g}ms`},I=[me.asideContent,n&&me.asideContentCollapsed].filter(Boolean).join(" ");return P.jsxs(P.Fragment,{children:[d&&P.jsx("div",{className:`${me.asideOverlayBackdrop} ${_?me.asideOverlayBackdropClosing:""}`,onClick:F,"aria-hidden":"true"}),P.jsxs("aside",{ref:N,className:A,style:w,children:[P.jsx("div",{className:I,children:n&&m?m:e}),c&&!n&&P.jsx("div",{className:me.asideResizeHandle,onMouseDown:L,role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar"})]})]})},By=({children:e,className:t="",maxWidth:n,centered:o=!1,padding:r="lg"})=>{const{asideHidden:s,asideFullHeight:i,mainRef:c}=ne.useContext(mn),u={none:me.mainPaddingNone,sm:me.mainPaddingSm,md:me.mainPaddingMd,lg:me.mainPaddingLg,xl:me.mainPaddingXl}[r],l=[me.main,s&&me.mainFullWidth,i&&me.mainWithFullHeightAside,u,t].filter(Boolean).join(" "),f={...n&&{maxWidth:typeof n=="number"?`${n}px`:n},...o&&{margin:"0 auto"}};return P.jsx("main",{ref:c,className:l,children:n||o?P.jsx("div",{style:f,children:e}):e})},Hy=({children:e,className:t="",variant:n="relative",height:o})=>{const{asideFullHeight:r}=ne.useContext(mn),s={fixed:me.footerFixed,sticky:me.footerSticky,relative:me.footerRelative}[n],i=[me.footer,s,r&&me.footerWithFullHeightAside,t].filter(Boolean).join(" "),c=o?{"--footer-custom-height":typeof o=="number"?`${o}px`:o}:{};return P.jsx("footer",{className:i,style:c,children:e})},zy=({children:e,className:t="",asidePosition:n="left"})=>{const[o,r]=ne.useState(!1),[s,i]=ne.useState(!1),[c,u]=ne.useState(!1),[l,f]=ne.useState("sticky"),d=ne.useRef(null),{scrollY:p}=jy(d),m=ne.useCallback((y,x,v)=>{i(y),r(x),u(v)},[]),g=ne.useCallback(y=>{f(y)},[]);ne.useEffect(()=>{ne.Children.toArray(e).some(x=>ne.isValidElement(x)&&x.type===gl&&!x.props.hidden)||r(!0)},[e]);const h=n==="right"?me.layoutRight:me.layoutLeft,E=[me.layout,h,s&&me.layoutAsideCollapsed,o&&me.layoutAsideHidden,c&&me.layoutAsideFullHeight,t].filter(Boolean).join(" "),b={asidePosition:n,asideHidden:o,asideCollapsed:s,asideFullHeight:c,headerBehavior:l,scrollY:p,mainRef:d,registerAside:m,registerHeader:g};return P.jsx(mn.Provider,{value:b,children:P.jsx("div",{className:E,children:e})})},Uy=Object.assign({Root:zy,Header:$y,Aside:gl,Main:By,Footer:Hy});exports.ALSAccordion=Af;exports.ALSAlertDialog=Mf;exports.ALSAutocomplete=kf;exports.ALSAvatar=jf;exports.ALSButton=sc;exports.ALSCheckbox=Wf;exports.ALSCheckboxGroup=Gf;exports.ALSCollapsible=Zf;exports.ALSCombobox=ed;exports.ALSContextMenu=od;exports.ALSDialog=Sm;exports.ALSField=Cm;exports.ALSFieldset=Om;exports.ALSForm=Nm;exports.ALSInput=oa;exports.ALSMenu=Fm;exports.ALSMenubar=$m;exports.ALSMeter=zm;exports.ALSNavigationMenu=qm;exports.ALSNumberField=Ym;exports.ALSPopover=hg;exports.ALSPopoverArrow=wa;exports.ALSPopoverBackdrop=Ta;exports.ALSPopoverClose=_a;exports.ALSPopoverDescription=Ca;exports.ALSPopoverPopup=Sa;exports.ALSPopoverPortal=Ea;exports.ALSPopoverPositioner=xa;exports.ALSPopoverRoot=ba;exports.ALSPopoverTitle=Ra;exports.ALSPopoverTrigger=va;exports.ALSPreviewCard=vg;exports.ALSProgress=Sg;exports.ALSRadio=Cg;exports.ALSScrollArea=Og;exports.ALSSelect=uh;exports.ALSSeparator=ph;exports.ALSSlider=hh;exports.ALSSwitch=vh;exports.ALSTabs=Sh;exports.ALSToast=jh;exports.ALSToggle=Hh;exports.ALSToggleGroup=Wh;exports.ALSToolbar=Gh;exports.ALSTooltip=Zh;exports.MainLayout=Uy;exports.useLayout=Vy;
20
+ )`}return P.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})});process.env.NODE_ENV!=="production"&&(Co.displayName="InternalBackdrop");const Lc=a.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=kt(),i=s.useState("mounted"),c=s.useState("modal");return i||o?P.jsx(Kr.Provider,{value:o,children:P.jsxs(Eo,{ref:n,...r,children:[i&&c===!0&&P.jsx(Co,{ref:s.context.internalBackdropRef,inert:Ro(!open)}),t.children]})}):null});process.env.NODE_ENV!=="production"&&(Lc.displayName="DialogPortal");let Js={},Qs={},ei="";function nm(e){if(typeof document>"u")return!1;const t=Ke(e);return De(t).innerWidth-t.documentElement.clientWidth>0}function om(e){const t=Ke(e),n=t.documentElement,o=t.body,r=Kt(n)?n:o,s=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=s}}function rm(e){const t=Ke(e),n=t.documentElement,o=t.body,r=De(n);let s=0,i=0;const c=Ie.create(),u=typeof CSS<"u"&&CSS.supports?.("scrollbar-gutter","stable");if(Ii&&(r.visualViewport?.scale??1)!==1)return()=>{};function l(){const p=r.getComputedStyle(n),m=r.getComputedStyle(o),E=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,Js={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ei=n.style.scrollBehavior,Qs={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,y=n.scrollWidth>n.clientWidth,x=p.overflowY==="scroll"||m.overflowY==="scroll",v=p.overflowX==="scroll"||m.overflowX==="scroll",R=Math.max(0,r.innerWidth-n.clientWidth),_=Math.max(0,r.innerHeight-n.clientHeight),T=parseFloat(m.marginTop)+parseFloat(m.marginBottom),N=parseFloat(m.marginLeft)+parseFloat(m.marginRight),F=Kt(n)?n:o;if(u){n.style.scrollbarGutter=E,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(b||x)&&(n.style.overflowY="scroll"),(y||v)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:T||_?`calc(100dvh - ${T+_}px)`:"100dvh",width:N||R?`calc(100vw - ${N+R}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,Js),Object.assign(o.style,Qs),u||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ei)}function d(){f(),c.request(l)}return l(),r.addEventListener("resize",d),()=>{c.cancel(),f(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",d)}}class sm{lockCount=0;restore=null;timeoutLock=pt.create();timeoutUnlock=pt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Ke(t).documentElement,r=De(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=nt;return}const s=Cu||!nm(t);this.restore=s?om(t):rm(t)}}const im=new sm;function Gr(e=!0,t=null){X(()=>{if(e)return im.acquire(t)},[e,t])}function cm(e){const t=a.useRef(""),n=a.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:a.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r&&e(r,r.pointerType),e(r,t.current),t.current=""},[e]),onPointerDown:n}}function kc(e){const[t,n]=a.useState(null),o=Q((c,u)=>{e||n(u)}),r=a.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=cm(o);return a.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}function am(e){const{store:t,parentContext:n,actionsRef:o}=e,r=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),c=t.useState("popupElement"),{openMethod:u,triggerProps:l,reset:f}=kc(r);_c(t);const{forceUnmount:d}=Tc(r,t,()=>{f()}),p=Q(L=>{const k=ge(L);return k.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},k}),m=a.useCallback(()=>{t.setOpen(!1,p(xi))},[t,p]);a.useImperativeHandle(o,()=>({unmount:d,close:m}),[d,m]);const g=Nc({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[h,E]=a.useState(0),b=h===0,y=Mc(g),x=Ur(g,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(L){if("button"in L&&L.button!==0||"touches"in L&&L.touches.length!==1)return!1;const k=qe(L);if(b&&!s){const A=k;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===A||t.context.backdropRef.current===A||xe(A,c)&&!A?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:b});Gr(r&&i===!0,c);const{getReferenceProps:v,getFloatingProps:R,getTriggerProps:_}=Mn([y,x]);t.useContextCallback("onNestedDialogOpen",L=>{E(L+1)}),t.useContextCallback("onNestedDialogClose",()=>{E(0)}),a.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(h),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,h]);const T=a.useMemo(()=>v(l),[v,l]),N=a.useMemo(()=>_(l),[_,l]),F=a.useMemo(()=>R(),[R]);t.useSyncedValues({openMethod:u,activeTriggerProps:T,inactiveTriggerProps:N,popupProps:F,floatingRootContext:g,nestedOpenDialogCount:h})}const lm={...Pc,modal:se(e=>e.modal),nested:se(e=>e.nested),nestedOpenDialogCount:se(e=>e.nestedOpenDialogCount),disablePointerDismissal:se(e=>e.disablePointerDismissal),openMethod:se(e=>e.openMethod),descriptionElementId:se(e=>e.descriptionElementId),titleElementId:se(e=>e.titleElementId),viewportElement:se(e=>e.viewportElement),role:se(e=>e.role)};class um extends Wr{constructor(t){super(fm(t),{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),triggerElements:new So,onOpenChange:void 0,onOpenChangeComplete:void 0},lm)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const r={open:t},s=n.trigger?.id??null;(s||t)&&(r.activeTriggerId=s,r.activeTriggerElement=n.trigger??null),this.update(r)}}function fm(e={}){return{...Oc(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function dm(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:c=!0,actionsRef:u,handle:l,triggerId:f,defaultTriggerId:d=null}=e,p=kt(!0),m=!!p,g=Je(()=>l?.store??new um({open:n??o,activeTriggerId:f!==void 0?f:d,modal:c,disablePointerDismissal:i,nested:m})).current;g.useControlledProp("open",n,o),g.useControlledProp("activeTriggerId",f,d),g.useSyncedValues({disablePointerDismissal:i,nested:m,modal:c}),g.useContextCallback("onOpenChange",r),g.useContextCallback("onOpenChangeComplete",s);const h=g.useState("payload");am({store:g,actionsRef:u,parentContext:p?.store.context});const E=a.useMemo(()=>({store:g}),[g]);return P.jsx(Lr.Provider,{value:E,children:typeof t=="function"?t({payload:h}):t})}const Fc=a.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:c}=kt(),u=ut(s);return c.useSyncedValueWithCleanup("titleElementId",u),ye("h2",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(Fc.displayName="DialogTitle");const Vc=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:c,payload:u,handle:l,...f}=t,d=kt(!0),p=l?.store??d?.store;if(!p)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle.":Ae(79));const m=ut(c),g=p.useState("floatingRootContext"),h=p.useState("isOpenedByTrigger",m),[E,b]=a.useState(null),{registerTrigger:y,isMountedByThisTrigger:x}=Cc(m,E,p,{payload:u}),{getButtonProps:v,buttonRef:R}=St({disabled:s,native:i}),_=Hr(g,{enabled:g!=null}),T=Mn([_]),N=a.useMemo(()=>({disabled:s,open:h}),[s,h]),F=p.useState("triggerProps",x);return ye("button",t,{state:N,ref:[R,n,y,b],props:[T.getReferenceProps(),F,{[Er]:"",id:m},f,v],stateAttributesMapping:kr})});process.env.NODE_ENV!=="production"&&(Vc.displayName="DialogTrigger");const pm="_backdrop_n0fed_10",mm="_popup_n0fed_32",gm="_title_n0fed_137",hm="_description_n0fed_150",ym="_close_n0fed_161",bm="_closeIcon_n0fed_194",vm="_trigger_n0fed_203",bt={backdrop:pm,popup:mm,"popup--default":"_popup--default_n0fed_59","popup--centered":"_popup--centered_n0fed_74","popup--fullscreen":"_popup--fullscreen_n0fed_89","popup--sm":"_popup--sm_n0fed_111","popup--md":"_popup--md_n0fed_117","popup--lg":"_popup--lg_n0fed_123",title:gm,description:hm,close:ym,closeIcon:bm,trigger:vm},jc=ne.createContext({variant:"default",size:"md"}),Em=()=>ne.useContext(jc),$c=ne.forwardRef(({open:e,defaultOpen:t=!1,onOpenChange:n,modal:o=!0,variant:r="default",size:s="md",children:i})=>P.jsx(jc.Provider,{value:{variant:r,size:s},children:P.jsx(dm,{open:e,defaultOpen:t,onOpenChange:n,modal:o,children:i})}));$c.displayName="ALSDialog.Root";const Bc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.trigger,e].filter(Boolean).join(" ");return P.jsx(Vc,{ref:n,className:o,nativeButton:!1,render:r=>ne.cloneElement(t,r)})});Bc.displayName="ALSDialog.Trigger";const Hc=ne.forwardRef(({className:e},t)=>{const n=[bt.backdrop,e].filter(Boolean).join(" ");return P.jsx(cc,{ref:t,className:n})});Hc.displayName="ALSDialog.Backdrop";const zc=({container:e,keepMounted:t=!1,children:n})=>P.jsx(Lc,{container:e,keepMounted:t,children:n});zc.displayName="ALSDialog.Portal";const Uc=ne.forwardRef(({className:e,children:t},n)=>{const{variant:o,size:r}=Em(),s=[bt.popup,bt[`popup--${o}`],bt[`popup--${r}`],e].filter(Boolean).join(" ");return P.jsx(Dc,{ref:n,className:s,children:t})});Uc.displayName="ALSDialog.Popup";const Wc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.title,e].filter(Boolean).join(" ");return P.jsx(Fc,{ref:n,className:o,children:t})});Wc.displayName="ALSDialog.Title";const qc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.description,e].filter(Boolean).join(" ");return P.jsx(lc,{ref:n,className:o,children:t})});qc.displayName="ALSDialog.Description";const Kc=ne.forwardRef(({className:e,children:t},n)=>{const o=[bt.close,e].filter(Boolean).join(" ");return P.jsx(ac,{ref:n,className:o,children:t||P.jsx(xm,{})})});Kc.displayName="ALSDialog.Close";const xm=()=>P.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:bt.closeIcon,children:P.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),Sm={Root:$c,Trigger:Bc,Backdrop:Hc,Portal:zc,Popup:Uc,Title:Wc,Description:qc,Close:Kc},wm="_root_1yzve_1",Rm={root:wm};function Cm(e){return P.jsx("div",{className:Rm.root})}const _m="_root_o7syy_1",Tm={root:_m};function Om(e){return P.jsx("div",{className:Tm.root})}const Pm="_root_199mu_1",Am={root:Pm};function Nm(e){return P.jsx("div",{className:Am.root})}let ti=(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 Im={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Gc={valid(e){return e===null?null:e?{[ti.valid]:""}:{[ti.invalid]:""}}},Yc=a.createContext({invalid:void 0,name:void 0,validityData:{state:Im,errors:[],error:"",value:"",initialValue:null},setValidityData:nt,disabled:void 0,touched:!1,setTouched:nt,dirty:!1,setDirty:nt,filled:!1,setFilled:nt,focused:!1,setFocused:nt,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=ze)=>e,getInputValidationProps:(e=ze)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(Yc.displayName="FieldRootContext");function An(e=!0){const t=a.useContext(Yc);if(t.setValidityData===nt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Ae(28));return t}const Xc=a.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:nt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(Xc.displayName="FormContext");function Zc(){return a.useContext(Xc)}const Jc=a.createContext({controlId:void 0,setControlId:nt,labelId:void 0,setLabelId:nt,messageIds:[],setMessageIds:nt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(Jc.displayName="LabelableContext");function _o(){return a.useContext(Jc)}function Mm(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Qc(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,setControlId:s}=_o(),i=ut(t);return X(()=>{if(!(!n&&!t||s===nt)){if(n){const c=o?.current;_e(c)&&c.closest("label")!=null?s(t??null):s(r??i)}else t&&s(t);return()=>{t&&s(void 0)}}},[t,o,r,s,n,i]),r??i}function ea(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:c}=Zc(),{invalid:u,markedDirtyRef:l,validityData:f,setValidityData:d}=An(),p=Q(e.getValue);X(()=>{if(!t)return;let m=n;m===void 0&&(m=p()),f.initialValue===null&&m!==null&&d(g=>({...g,initialValue:m}))},[t,d,n,f.initialValue,p]),X(()=>{!t||!o||c.current.fields.set(o,{getValue:p,name:r,controlRef:s,validityData:Mm(f,u),validate(){let m=n;m===void 0&&(m=p()),l.current=!0,rt.flushSync(()=>i(m))}})},[i,s,t,c,p,o,u,l,r,f,n]),X(()=>{const m=c.current.fields;return()=>{o&&m.delete(o)}},[c,o])}const ta=a.forwardRef(function(t,n){const{render:o,className:r,id:s,name:i,value:c,disabled:u=!1,onValueChange:l,defaultValue:f,...d}=t,{state:p,name:m,disabled:g}=An(),h=g||u,E=m??i,b=a.useMemo(()=>({...p,disabled:h}),[p,h]),{setTouched:y,setDirty:x,validityData:v,setFocused:R,setFilled:_,validationMode:T,validation:N}=An(),{labelId:F}=_o(),L=Qc({id:s});X(()=>{const O=c!=null;N.inputRef.current?.value||O&&c!==""?_(!0):O&&c===""&&_(!1)},[N.inputRef,_,c]);const[k,A]=Cn({controlled:c,default:f,name:"FieldControl",state:"value"}),w=c!==void 0,I=Q((O,D)=>{l?.(O,D),!D.isCanceled&&A(O)});return ea({id:L,name:E,commit:N.commit,value:k,getValue:()=>N.inputRef.current?.value,controlRef:N.inputRef}),ye("input",t,{ref:n,state:b,props:[{id:L,disabled:h,name:E,ref:N.inputRef,"aria-labelledby":F,...w?{value:k}:{defaultValue:f},onChange(O){const D=O.currentTarget.value;I(D,ge(ln,O.nativeEvent)),x(D!==v.initialValue),_(D!=="")},onFocus(){R(!0)},onBlur(O){y(!0),R(!1),T==="onBlur"&&N.commit(O.currentTarget.value)},onKeyDown(O){O.currentTarget.tagName==="INPUT"&&O.key==="Enter"&&(y(!0),N.commit(O.currentTarget.value))}},N.getInputValidationProps(),d],stateAttributesMapping:Gc})});process.env.NODE_ENV!=="production"&&(ta.displayName="FieldControl");const na=a.forwardRef(function(t,n){return P.jsx(ta,{ref:n,...t})});process.env.NODE_ENV!=="production"&&(na.displayName="Input");const Dm="_input_1ph0q_5",Wn={input:Dm,"input--outlined":"_input--outlined_1ph0q_25","input--filled":"_input--filled_1ph0q_40","input--sm":"_input--sm_1ph0q_59","input--md":"_input--md_1ph0q_64","input--lg":"_input--lg_1ph0q_69","input--success":"_input--success_1ph0q_78","input--warning":"_input--warning_1ph0q_87","input--error":"_input--error_1ph0q_96"},oa=ne.forwardRef(({variant:e="outlined",size:t="md",status:n="default",className:o,disabled:r=!1,...s},i)=>{const c=[Wn.input,Wn[`input--${e}`],Wn[`input--${t}`],Wn[`input--${n}`],o].filter(Boolean).join(" ");return P.jsx(na,{ref:i,className:c,disabled:r,...s})});oa.displayName="ALSInput";const Lm="_root_so1gq_1",km={root:Lm};function Fm(e){return P.jsx("div",{className:km.root})}const Vm="_root_g8l8f_1",jm={root:Vm};function $m(e){return P.jsx("div",{className:jm.root})}const Bm="_root_krv6e_1",Hm={root:Bm};function zm(e){return P.jsx("div",{className:Hm.root})}const Um="_root_qmqvr_1",Wm={root:Um};function qm(e){return P.jsx("div",{className:Wm.root})}const Km="_root_1jbox_1",Gm={root:Km};function Ym(e){return P.jsx("div",{className:Gm.root})}const Yr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Yr.displayName="PopoverRootContext");function gt(e){const t=a.useContext(Yr);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverRootContext is missing. Popover parts must be placed within <Popover.Root>.":Ae(47));return t}function Xm(){return{...Oc(),disabled:!1,modal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,nested:!1,openOnHover:!1,closeDelay:0}}const Zm={...Pc,disabled:se(e=>e.disabled),instantType:se(e=>e.instantType),openMethod:se(e=>e.openMethod),openChangeReason:se(e=>e.openChangeReason),modal:se(e=>e.modal),stickIfOpen:se(e=>e.stickIfOpen),titleElementId:se(e=>e.titleElementId),descriptionElementId:se(e=>e.descriptionElementId),openOnHover:se(e=>e.openOnHover),closeDelay:se(e=>e.closeDelay)};class Xr extends Wr{constructor(t){const n={...Xm(),...t};n.open&&t?.mounted===void 0&&(n.mounted=!0),super(n,{popupRef:a.createRef(),backdropRef:a.createRef(),internalBackdropRef:a.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:a.createRef(),beforeContentFocusGuardRef:a.createRef(),stickIfOpenTimeout:new pt,triggerElements:new So},Zm)}setOpen=(t,n)=>{const o=n.reason===ot,r=n.reason===ht&&n.event.detail===0,s=!t&&(n.reason===Ei||n.reason==null);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested,triggerElement:n.trigger};this.state.floatingRootContext.context.events?.emit("openchange",i);const u=()=>{const l={open:t,openChangeReason:n.reason},f=n.trigger?.id??null;(f||t)&&(l.activeTriggerId=f,l.activeTriggerElement=n.trigger??null),this.update(l)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(zl,()=>{this.set("stickIfOpen",!1)}),rt.flushSync(u)):u(),r||s?this.set("instantType",r?"click":"dismiss"):n.reason===Ut?this.set("instantType","focus"):this.set("instantType",void 0)};static useStore(t,n){const o=Je(()=>t??new Xr(n)).current;return io(o.disposeEffect),o}disposeEffect=()=>this.context.stickIfOpenTimeout.disposeEffect()}function ni({props:e}){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,modal:i=!1,handle:c,triggerId:u,defaultTriggerId:l=null}=e,f=Xr.useStore(c?.store,{open:n??o,modal:i,activeTriggerId:u!==void 0?u:l});f.useControlledProp("open",n,o),f.useControlledProp("activeTriggerId",u,l);const d=f.useState("open"),p=f.useState("positionerElement"),m=f.useState("payload"),g=f.useState("openChangeReason");f.useContextCallback("onOpenChange",r),f.useContextCallback("onOpenChangeComplete",s);const{openMethod:h,triggerProps:E,reset:b}=kc(d);_c(f);const{forceUnmount:y}=Tc(d,f,()=>{f.update({stickIfOpen:!0,openChangeReason:null}),b()});Gr(d&&i===!0&&g!==ot&&h!=="touch",p),a.useEffect(()=>{d||f.context.stickIfOpenTimeout.clear()},[f,d]);const x=a.useCallback(C=>{const O=ge(C);return O.preventUnmountOnClose=()=>{f.set("preventUnmountingOnClose",!0)},O},[f]),v=a.useCallback(()=>{f.setOpen(!1,x(xi))},[f,x]);a.useImperativeHandle(e.actionsRef,()=>({unmount:y,close:v}),[y,v]);const R=Nc({popupStore:f,onOpenChange:f.setOpen}),_=Ur(R,{outsidePressEvent:{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),T=Mc(R),{getReferenceProps:N,getFloatingProps:F,getTriggerProps:L}=Mn([_,T]),k=a.useMemo(()=>N(E),[N,E]),A=a.useMemo(()=>L(E),[L,E]),w=a.useMemo(()=>F(),[F]);f.useSyncedValues({modal:i,openMethod:h,activeTriggerProps:k,inactiveTriggerProps:A,popupProps:w,floatingRootContext:R,nested:Vt()!=null});const I=a.useMemo(()=>({store:f}),[f]);return P.jsx(Yr.Provider,{value:I,children:typeof t=="function"?t({payload:m}):t})}function Jm(e){return gt(!0)?P.jsx(ni,{props:e}):P.jsx(pd,{children:P.jsx(ni,{props:e})})}const Qm=300,ra=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,handle:c,payload:u,openOnHover:l=!1,delay:f=Qm,closeDelay:d=0,id:p,...m}=t,g=gt(!0),h=c?.store??g?.store;if(!h)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Trigger> must be either used within a <Popover.Root> component or provided with a handle.":Ae(74));const E=ut(p),b=h.useState("isTriggerActive",E),y=h.useState("floatingRootContext"),x=h.useState("isOpenedByTrigger",E),[v,R]=a.useState(null),{registerTrigger:_,isMountedByThisTrigger:T}=Cc(E,v,h,{payload:u,disabled:s,openOnHover:l,closeDelay:d}),N=h.useState("openChangeReason"),F=h.useState("stickIfOpen"),L=h.useState("openMethod"),k=zp(y,{enabled:y!=null&&l&&(L!=="touch"||N!==ht),mouseOnly:!0,move:!1,handleClose:Zp(),restMs:f,delay:{close:d},triggerElement:v,isActiveTrigger:b}),A=Hr(y,{enabled:y!=null,stickIfOpen:F}),w=Mn([A]),I=h.useState("triggerProps",T),C=a.useMemo(()=>({disabled:s,open:x}),[s,x]),{getButtonProps:O,buttonRef:D}=St({disabled:s,native:i}),S=a.useMemo(()=>({open(Y){return Y&&N===ht?ic.open(Y):kr.open(Y)}}),[N]),M=ye("button",t,{state:C,ref:[D,n,_,R],props:[w.getReferenceProps(),k,I,{[Er]:"",id:E},m,O],stateAttributesMapping:S}),$=a.useRef(null),z=Q(Y=>{rt.flushSync(()=>{h.setOpen(!1,ge(Ut,Y.nativeEvent,Y.currentTarget))}),uf($.current)?.focus()}),Z=Q(Y=>{const te=h.select("positionerElement");if(te&&Jt(Y,te))h.context.beforeContentFocusGuardRef.current?.focus();else{rt.flushSync(()=>{h.setOpen(!1,ge(Ut,Y.nativeEvent,Y.currentTarget))});let G=lf(v);for(;G!==null&&xe(te,G)||G?.hasAttribute("aria-hidden");){const H=G;if(G=Nr(G),G===H)break}G?.focus()}});return b?P.jsxs(a.Fragment,{children:[P.jsx(dt,{ref:$,onFocus:z}),P.jsx(a.Fragment,{children:M},E),P.jsx(dt,{ref:h.context.triggerFocusTargetRef,onFocus:Z})]}):P.jsx(a.Fragment,{children:M},E)});process.env.NODE_ENV!=="production"&&(ra.displayName="PopoverTrigger");const Zr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Zr.displayName="PopoverPortalContext");function eg(){const e=a.useContext(Zr);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Popover.Portal> is missing.":Ae(45));return e}const sa=a.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=gt();return s.useState("mounted")||o?P.jsx(Zr.Provider,{value:o,children:P.jsx(Eo,{ref:n,...r,renderGuards:!1})}):null});process.env.NODE_ENV!=="production"&&(sa.displayName="PopoverPortal");const Jr=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Jr.displayName="PopoverPositionerContext");function ia(){const e=a.useContext(Jr);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: PopoverPositionerContext is missing. PopoverPositioner parts must be placed within <Popover.Positioner>.":Ae(46));return e}const tg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:c,middlewareData:u}=t,{element:l,padding:f=0,offsetParent:d="real"}=Et(e,t)||{};if(l==null)return{};const p=$i(f),m={x:n,y:o},g=Ar(r),h=Pr(g),E=await i.getDimensions(l),b=g==="y",y=b?"top":"left",x=b?"bottom":"right",v=b?"clientHeight":"clientWidth",R=s.reference[h]+s.reference[g]-m[g]-s.floating[h],_=m[g]-s.reference[g],T=d==="real"?await i.getOffsetParent?.(l):c.floating;let N=c.floating[v]||s.floating[h];(!N||!await i.isElement?.(T))&&(N=c.floating[v]||s.floating[h]);const F=R/2-_/2,L=N/2-E[h]/2-1,k=Math.min(p[y],L),A=Math.min(p[x],L),w=k,I=N-E[h]-A,C=N/2-E[h]/2+F,O=ir(w,C,I),D=!u.arrow&&Dt(r)!=null&&C!==O&&s.reference[h]/2-(C<w?k:A)-E[h]/2<0,S=D?C<w?C-w:C-I:0;return{[g]:m[g]+S,data:{[g]:O,centerOffset:C-O-S,...D&&{alignmentOffset:S}},reset:D}}}),ng=(e,t)=>({...tg(e),options:[e,t]}),og={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await cp().fn(e)).data?.referenceHidden||s}}}},Xn={sideX:"left",sideY:"top"},rg={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:o},elements:{floating:r},platform:s,strategy:i,placement:c}=e,u=De(r),l=u.getComputedStyle(r);if(!(l.transitionDuration!=="0s"&&l.transitionDuration!==""))return{x:t,y:n,data:Xn};const d=await s.getOffsetParent?.(r);let p={width:0,height:0};if(i==="fixed"&&u?.visualViewport)p={width:u.visualViewport.width,height:u.visualViewport.height};else if(d===u){const y=Ke(r);p={width:y.documentElement.clientWidth,height:y.documentElement.clientHeight}}else await s.isElement?.(d)&&(p=await s.getDimensions(d));const m=Ze(c);let g=t,h=n;m==="left"&&(g=p.width-(t+o.width)),m==="top"&&(h=p.height-(n+o.height));const E=m==="left"?"right":Xn.sideX,b=m==="top"?"bottom":Xn.sideY;return{x:g,y:h,data:{sideX:E,sideY:b}}}};function ca(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function oi(e,t,n){const{rects:o,placement:r}=e;return{side:ca(t,Ze(r),n),align:Dt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function aa(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:c,collisionPadding:u=5,sticky:l=!1,arrowPadding:f=5,disableAnchorTracking:d=!1,keepMounted:p=!1,floatingRootContext:m,mounted:g,collisionAvoidance:h,shiftCrossAxis:E=!1,nodeId:b,adaptiveOrigin:y,lazyFlip:x=!1,externalTree:v}=e,[R,_]=a.useState(null);!g&&R!==null&&_(null);const T=h.side||"flip",N=h.align||"flip",F=h.fallbackAxisSide||"end",L=typeof t=="function"?t:void 0,k=Q(L),A=L?k:t,w=Ve(t),C=hr()==="rtl",O=R||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":C?"left":"right","inline-start":C?"right":"left"}[o],D=s==="center"?O:`${O}-${s}`;let S=u;const M=1,$=o==="bottom"?M:0,z=o==="top"?M:0,Z=o==="right"?M:0,Y=o==="left"?M:0;typeof S=="number"?S={top:S+$,right:S+Y,bottom:S+z,left:S+Z}:S&&(S={top:(S.top||0)+$,right:(S.right||0)+Y,bottom:(S.bottom||0)+z,left:(S.left||0)+Z});const te={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:S},G=a.useRef(null),H=Ve(r),j=Ve(i),Ee=[np(Te=>{const Ne=oi(Te,o,C),Be=typeof H.current=="function"?H.current(Ne):H.current,ke=typeof j.current=="function"?j.current(Ne):j.current;return{mainAxis:Be,crossAxis:ke,alignmentAxis:ke}},[typeof r!="function"?r:0,typeof i!="function"?i:0,C,o])],B=N==="none"&&T!=="shift",ie=!B&&(l||E||T==="shift"),oe=T==="none"?null:sp({...te,padding:{top:S.top+M,right:S.right+M,bottom:S.bottom+M,left:S.left+M},mainAxis:!E&&T==="flip",crossAxis:N==="flip"?"alignment":!1,fallbackAxisSideDirection:F}),Se=B?null:op(Te=>{const Ne=Ke(Te.elements.floating).documentElement;return{...te,rootBoundary:E?{x:0,y:0,width:Ne.clientWidth,height:Ne.clientHeight}:void 0,mainAxis:N!=="none",crossAxis:ie,limiter:l||E?void 0:rp(Be=>{if(!G.current)return{};const{width:ke,height:be}=G.current.getBoundingClientRect(),Pe=at(Ze(Be.placement)),Fe=Pe==="y"?ke:be,Ue=Pe==="y"?S.left+S.right:S.top+S.bottom;return{offset:Fe/2+Ue/2}})}},[te,l,E,S,N]);T==="shift"||N==="shift"||s==="center"?Ee.push(Se,oe):Ee.push(oe,Se),Ee.push(ip({...te,apply({elements:{floating:Te},rects:{reference:Ne},availableWidth:Be,availableHeight:ke}){Object.entries({"--available-width":`${Be}px`,"--available-height":`${ke}px`,"--anchor-width":`${Ne.width}px`,"--anchor-height":`${Ne.height}px`}).forEach(([be,Pe])=>{Te.style.setProperty(be,Pe)})}}),ng(()=>({element:G.current||document.createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Te){const{elements:Ne,middlewareData:Be,placement:ke,rects:be,y:Pe}=Te,Fe=Ze(ke),Ue=at(Fe),Ye=G.current,wt=Be.arrow?.x||0,Dn=Be.arrow?.y||0,Oo=Ye?.clientWidth||0,hl=Ye?.clientHeight||0,Po=wt+Oo/2,ms=Dn+hl/2,yl=Math.abs(Be.shift?.y||0),bl=be.reference.height/2,gn=typeof r=="function"?r(oi(Te,o,C)):r,vl=yl>gn,El={top:`${Po}px calc(100% + ${gn}px)`,bottom:`${Po}px ${-gn}px`,left:`calc(100% + ${gn}px) ${ms}px`,right:`${-gn}px ${ms}px`}[Fe],xl=`${Po}px ${be.reference.y+bl-Pe}px`;return Ne.floating.style.setProperty("--transform-origin",ie&&Ue==="y"&&vl?xl:El),{}}},og,y),X(()=>{!g&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,m]);const U=a.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:K,elements:W,x:pe,y:le,middlewareData:re,update:V,placement:ce,context:ee,isPositioned:q,floatingStyles:J}=Fp({rootContext:m,placement:D,middleware:Ee,strategy:n,whileElementsMounted:p?void 0:(...Te)=>js(...Te,U),nodeId:b,externalTree:v}),{sideX:ue,sideY:fe}=re.adaptiveOrigin||Xn,Re=q?n:"fixed",we=a.useMemo(()=>y?{position:Re,[ue]:pe,[fe]:le}:{position:Re,...J},[y,Re,ue,pe,fe,le,J]),Ce=a.useRef(null);X(()=>{if(!g)return;const Te=w.current,Ne=typeof Te=="function"?Te():Te,ke=(ri(Ne)?Ne.current:Ne)||null||null;ke!==Ce.current&&(K.setPositionReference(ke),Ce.current=ke)},[g,K,A,w]),a.useEffect(()=>{if(!g)return;const Te=w.current;typeof Te!="function"&&ri(Te)&&Te.current!==Ce.current&&(K.setPositionReference(Te.current),Ce.current=Te.current)},[g,K,A,w]),a.useEffect(()=>{if(p&&g&&W.domReference&&W.floating)return js(W.domReference,W.floating,V,U)},[p,g,W,V,U]);const $e=Ze(ce),st=ca(o,$e,C),Oe=Dt(ce)||"center",et=!!re.hide?.referenceHidden;X(()=>{x&&g&&q&&_($e)},[x,g,q,$e]);const Ge=a.useMemo(()=>({position:"absolute",top:re.arrow?.y,left:re.arrow?.x}),[re.arrow]),it=re.arrow?.centerOffset!==0;return a.useMemo(()=>({positionerStyles:we,arrowStyles:Ge,arrowRef:G,arrowUncentered:it,side:st,align:Oe,physicalSide:$e,anchorHidden:et,refs:K,context:ee,isPositioned:q,update:V}),[we,Ge,G,it,st,Oe,$e,et,K,ee,q,V])}function ri(e){return e!=null&&"current"in e}function Qr(e){return e==="starting"?Ul:ze}const la=a.forwardRef(function(t,n){const{render:o,className:r,anchor:s,positionMethod:i="absolute",side:c="bottom",align:u="center",sideOffset:l=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p=5,arrowPadding:m=5,sticky:g=!1,disableAnchorTracking:h=!1,collisionAvoidance:E=ql,...b}=t,{store:y}=gt(),x=eg(),v=fd(),R=y.useState("floatingRootContext"),_=y.useState("mounted"),T=y.useState("open"),N=y.useState("openMethod"),F=y.useState("openChangeReason"),L=y.useState("activeTriggerElement"),k=y.useState("modal"),A=y.useState("positionerElement"),w=y.useState("instantType"),I=y.useState("transitionStatus"),C=a.useRef(null),O=co(A,!1,!1),D=aa({anchor:s,floatingRootContext:R,positionMethod:i,mounted:_,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:d,collisionPadding:p,sticky:g,disableAnchorTracking:h,keepMounted:x,nodeId:v,collisionAvoidance:E,adaptiveOrigin:rg}),S=a.useMemo(()=>{const te={};return T||(te.pointerEvents="none"),{role:"presentation",hidden:!_,style:{...D.positionerStyles,...te}}},[T,_,D.positionerStyles]),M=a.useMemo(()=>({props:S,...D}),[S,D]),$=R?.select("domReferenceElement");X(()=>{const te=$,G=C.current;if(te&&(C.current=te),G&&te&&te!==G){y.set("instantType",void 0);const H=new AbortController;return O(()=>{y.set("instantType","trigger-change")},H.signal),()=>{H.abort()}}},[$,O,y]);const z=a.useMemo(()=>({open:T,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:w}),[T,M.side,M.align,M.anchorHidden,w]),Z=a.useCallback(te=>{y.set("positionerElement",te)},[y]),Y=ye("div",t,{state:z,props:[M.props,Qr(I),b],ref:[n,Z],stateAttributesMapping:Ft});return P.jsxs(Jr.Provider,{value:M,children:[_&&k===!0&&F!==ot&&N!=="touch"&&P.jsx(Co,{ref:y.context.internalBackdropRef,inert:Ro(!T),cutout:L}),P.jsx(dd,{id:v,children:Y})]})});process.env.NODE_ENV!=="production"&&(la.displayName="PopoverPositioner");function si(e){const t=Qe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Me(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o;return(sn(n)!==s||sn(o)!==i)&&(n=s,o=i),{width:n,height:o}}const sg=typeof ResizeObserver<"u",ig=()=>!0;function cg(e){const{popupElement:t,positionerElement:n,content:o,mounted:r,enabled:s=ig,onMeasureLayout:i,onMeasureLayoutComplete:c}=e,u=a.useRef(!0),l=co(t,!0,!1),f=un(),d=a.useRef(null),p=Q(i),m=Q(c);X(()=>{if(!r||!s()||!sg){u.current=!0,d.current=null;return}if(!t||!n)return;const g=new ResizeObserver(_=>{const T=_[0];T&&(d.current===null?d.current={width:Math.ceil(T.borderBoxSize[0].inlineSize),height:Math.ceil(T.borderBoxSize[0].blockSize)}:(d.current.width=Math.ceil(T.borderBoxSize[0].inlineSize),d.current.height=Math.ceil(T.borderBoxSize[0].blockSize)))});g.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const h=yn(t,"position","static"),E=yn(t,"transform","none"),b=yn(t,"scale","1"),y=yn(n,"--available-width","max-content"),x=yn(n,"--available-height","max-content");if(p?.(),u.current||d.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const _=si(t);return n.style.setProperty("--positioner-width",`${_.width}px`),n.style.setProperty("--positioner-height",`${_.height}px`),h(),E(),b(),y(),x(),m?.(null,_),u.current=!1,()=>{g.disconnect()}}t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto"),n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const v=si(t);t.style.setProperty("--popup-width",`${d.current.width}px`),t.style.setProperty("--popup-height",`${d.current.height}px`),h(),E(),y(),x(),m?.(d.current,v),n.style.setProperty("--positioner-width",`${v.width}px`),n.style.setProperty("--positioner-height",`${v.height}px`);const R=new AbortController;return f.request(()=>{t.style.setProperty("--popup-width",`${v.width}px`),t.style.setProperty("--popup-height",`${v.height}px`),l(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},R.signal)}),()=>{g.disconnect(),R.abort(),f.cancel()}},[o,t,n,l,f,s,r,p,m])}function yn(e,t,n){const o=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,o)}}const ua=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ua.displayName="ToolbarRootContext");function fa(e){return a.useContext(ua)}const ag={...Ft,...It},da=a.forwardRef(function(t,n){const{className:o,render:r,initialFocus:s,finalFocus:i,...c}=t,{store:u}=gt(),l=ia(),f=fa()!=null,d=hr(),p=u.useState("open"),m=u.useState("openMethod"),g=u.useState("instantType"),h=u.useState("transitionStatus"),E=u.useState("popupProps"),b=u.useState("titleElementId"),y=u.useState("descriptionElementId"),x=u.useState("modal"),v=u.useState("mounted"),R=u.useState("openChangeReason"),_=u.useState("popupElement"),T=u.useState("payload"),N=u.useState("positionerElement"),F=u.useState("activeTriggerElement"),L=u.useState("floatingRootContext");Lt({open:p,ref:u.context.popupRef,onComplete(){p&&u.context.onOpenChangeComplete?.(!0)}});const k=u.useState("disabled"),A=u.useState("openOnHover"),w=u.useState("closeDelay");Bp(L,{enabled:A&&!k,closeDelay:w});function I(Y){return Y==="touch"?u.context.popupRef.current:!0}const C=s===void 0?I:s,O=a.useMemo(()=>({open:p,side:l.side,align:l.align,instant:g,transitionStatus:h}),[p,l.side,l.align,g,h]),D=a.useCallback(Y=>{u.set("popupElement",Y)},[u]);function S(){L.context.events.emit("measure-layout")}function M(Y,te){L.context.events.emit("measure-layout-complete",{previousDimensions:Y,nextDimensions:te})}cg({popupElement:_,positionerElement:N,mounted:v,content:T,enabled:()=>u.context.triggerElements.size>1,onMeasureLayout:S,onMeasureLayoutComplete:M});const z=a.useMemo(()=>{let Y=l.side==="top",te=l.side==="left";return d==="rtl"?(Y=Y||l.side==="inline-end",te=te||l.side==="inline-end"):(Y=Y||l.side==="inline-start",te=te||l.side==="inline-start"),Y?{position:"absolute",[l.side==="top"?"bottom":"top"]:"0",[te?"right":"left"]:"0"}:ze},[l.side,d]),Z=ye("div",t,{state:O,ref:[n,u.context.popupRef,D],props:[E,{"aria-labelledby":b,"aria-describedby":y,style:z,onKeyDown(Y){f&&Dr.has(Y.key)&&Y.stopPropagation()}},Qr(h),c],stateAttributesMapping:ag});return P.jsx(Br,{context:L,openInteractionType:m,modal:x==="trap-focus",disabled:!v||R===ot,initialFocus:C,returnFocus:i,restoreFocus:"popup",previousFocusableElement:Me(F)?F:void 0,nextFocusableElement:u.context.triggerFocusTargetRef,beforeContentFocusGuardRef:u.context.beforeContentFocusGuardRef,children:Z})});process.env.NODE_ENV!=="production"&&(da.displayName="PopoverPopup");const pa=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=gt(),c=i.useState("open"),{arrowRef:u,side:l,align:f,arrowUncentered:d,arrowStyles:p}=ia(),m=a.useMemo(()=>({open:c,side:l,align:f,uncentered:d}),[c,l,f,d]);return ye("div",t,{state:m,ref:[n,u],props:[{style:p,"aria-hidden":!0},s],stateAttributesMapping:Ft})});process.env.NODE_ENV!=="production"&&(pa.displayName="PopoverArrow");const lg={...Ft,...It},ma=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=gt(),c=i.useState("open"),u=i.useState("mounted"),l=i.useState("transitionStatus"),f=i.useState("openChangeReason"),d=a.useMemo(()=>({open:c,transitionStatus:l}),[c,l]);return ye("div",t,{state:d,ref:[i.context.backdropRef,n],props:[{role:"presentation",hidden:!u,style:{pointerEvents:f===ot?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},s],stateAttributesMapping:lg})});process.env.NODE_ENV!=="production"&&(ma.displayName="PopoverBackdrop");const ga=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i}=gt(),c=ut(s.id);return X(()=>(i.set("titleElementId",c),()=>{i.set("titleElementId",void 0)}),[i,c]),ye("h2",t,{ref:n,props:[{id:c},s]})});process.env.NODE_ENV!=="production"&&(ga.displayName="PopoverTitle");const ha=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i}=gt(),c=ut(s.id);return X(()=>(i.set("descriptionElementId",c),()=>{i.set("descriptionElementId",void 0)}),[i,c]),ye("p",t,{ref:n,props:[{id:c},s]})});process.env.NODE_ENV!=="production"&&(ha.displayName="PopoverDescription");const ya=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{buttonRef:u,getButtonProps:l}=St({disabled:s,focusableWhenDisabled:!1,native:i}),{store:f}=gt();return ye("button",t,{ref:[n,u],props:[{onClick(p){f.setOpen(!1,ge(vi,p.nativeEvent,p.currentTarget))}},c,l]})});process.env.NODE_ENV!=="production"&&(ya.displayName="PopoverClose");const ug="_popup_1w2m7_1",fg="_arrow_1w2m7_25",dg="_title_1w2m7_35",pg="_description_1w2m7_42",mg="_close_1w2m7_49",gg="_backdrop_1w2m7_76",pn={popup:ug,arrow:fg,title:dg,description:pg,close:mg,backdrop:gg},ba=Jm,va=a.forwardRef(function({children:t,...n},o){return P.jsx(ra,{...n,ref:o,nativeButton:!1,render:r=>a.cloneElement(t,r)})}),Ea=sa,xa=a.forwardRef(function(t,n){return P.jsx(la,{...t,ref:n})}),Sa=a.forwardRef(function({className:t,...n},o){return P.jsx(da,{...n,className:`${pn.popup} ${t||""}`,ref:o})}),wa=a.forwardRef(function({className:t,...n},o){return P.jsx(pa,{...n,className:`${pn.arrow} ${t||""}`,ref:o})}),Ra=a.forwardRef(function({className:t,...n},o){return P.jsx(ga,{...n,className:`${pn.title} ${t||""}`,ref:o})}),Ca=a.forwardRef(function({className:t,...n},o){return P.jsx(ha,{...n,className:`${pn.description} ${t||""}`,ref:o})}),_a=a.forwardRef(function({className:t,...n},o){return P.jsx(ya,{...n,className:`${pn.close} ${t||""}`,ref:o})}),Ta=a.forwardRef(function({className:t,...n},o){return P.jsx(ma,{...n,className:`${pn.backdrop} ${t||""}`,ref:o})}),hg={Root:ba,Trigger:va,Portal:Ea,Positioner:xa,Popup:Sa,Arrow:wa,Title:Ra,Description:Ca,Close:_a,Backdrop:Ta},yg="_root_1iiym_1",bg={root:yg};function vg(e){return P.jsx("div",{className:bg.root})}const Eg="_root_1hnog_1",xg={root:Eg};function Sg(e){return P.jsx("div",{className:xg.root})}const wg="_root_1ei9z_1",Rg={root:wg};function Cg(e){return P.jsx("div",{className:Rg.root})}const _g="_root_1kuso_1",Tg={root:_g};function Og(e){return P.jsx("div",{className:Tg.root})}function Pg(e){const t=a.useRef(!0);t.current&&(t.current=!1,e())}const es=a.createContext(null);process.env.NODE_ENV!=="production"&&(es.displayName="SelectRootContext");const ts=a.createContext(null);process.env.NODE_ENV!=="production"&&(ts.displayName="SelectFloatingContext");function jt(){const e=a.useContext(es);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectRootContext is missing. Select parts must be placed within <Select.Root>.":Ae(60));return e}function Oa(){const e=a.useContext(ts);if(e===null)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectFloatingContext is missing. Select parts must be placed within <Select.Root>.":Ae(61));return e}const Ag=(e,t)=>Object.is(e,t);function an(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function qo(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:an(o,t,n))}function dr(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:an(o,t,n))}function Ng(e,t,n){return e.filter(o=>!an(o,t,n))}function pr(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Ig(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function En(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 pr(e)}function Zn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?pr(e.value):pr(e)}function Mg(e,t,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]??En(e,n);if(Array.isArray(t)){const o=Ig(t)?t.flatMap(r=>r.items):t;if(e==null){const r=o.find(s=>s.value==null);return r&&r.label!=null?r.label:En(e,n)}if(typeof e!="object"){const r=o.find(s=>s&&s.value===e);return r&&r.label!=null?r.label:En(e,n)}if("value"in e){const r=o.find(s=>s&&s.value===e.value);if(r&&r.label!=null)return r.label}}return En(e,n)}function Dg(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>En(n,t)).join(", ")}const he={id:se(e=>e.id),modal:se(e=>e.modal),multiple:se(e=>e.multiple),items:se(e=>e.items),itemToStringLabel:se(e=>e.itemToStringLabel),itemToStringValue:se(e=>e.itemToStringValue),isItemEqualToValue:se(e=>e.isItemEqualToValue),value:se(e=>e.value),open:se(e=>e.open),mounted:se(e=>e.mounted),forceMount:se(e=>e.forceMount),transitionStatus:se(e=>e.transitionStatus),touchModality:se(e=>e.touchModality),activeIndex:se(e=>e.activeIndex),selectedIndex:se(e=>e.selectedIndex),isActive:se((e,t)=>e.activeIndex===t),isSelected:se((e,t,n)=>{const o=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>an(s,n,o)):e.selectedIndex===t&&e.selectedIndex!==null?!0:an(r,n,o)}),isSelectedByFocus:se((e,t)=>e.selectedIndex===t),popupProps:se(e=>e.popupProps),triggerProps:se(e=>e.triggerProps),triggerElement:se(e=>e.triggerElement),positionerElement:se(e=>e.positionerElement),listElement:se(e=>e.listElement),scrollUpArrowVisible:se(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:se(e=>e.scrollDownArrowVisible),hasScrollArrows:se(e=>e.hasScrollArrows),serializedValue:se(e=>{const{multiple:t,value:n,itemToStringValue:o}=e;return t&&Array.isArray(n)&&n.length===0?"":Zn(n,o)})};function Lg(e,t){const n=a.useRef(e),o=Q(t);X(()=>{n.current!==e&&o(n.current)},[e,o]),X(()=>{n.current=e},[e])}function kg(e){const{id:t,value:n,defaultValue:o=null,onValueChange:r,open:s,defaultOpen:i=!1,onOpenChange:c,name:u,disabled:l=!1,readOnly:f=!1,required:d=!1,modal:p=!0,actionsRef:m,inputRef:g,onOpenChangeComplete:h,items:E,multiple:b=!1,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v=Ag,children:R}=e,{clearErrors:_}=Zc(),{setDirty:T,shouldValidateOnChange:N,validityData:F,setFilled:L,name:k,disabled:A,validation:w}=An(),{controlId:I}=_o(),C=Qc({id:t}),O=A||l,D=k??u,[S,M]=Cn({controlled:n,default:b?o??Jo:o,name:"Select",state:"value"}),[$,z]=Cn({controlled:s,default:i,name:"Select",state:"open"}),Z=a.useRef([]),Y=a.useRef([]),te=a.useRef(null),G=a.useRef(null),H=a.useRef(0),j=a.useRef(null),ae=a.useRef([]),de=a.useRef(!1),Ee=a.useRef(!1),B=a.useRef(null),ie=a.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),oe=a.useRef(!1),{mounted:Se,setMounted:U,transitionStatus:K}=ao($),W=Je(()=>new tn({id:C,modal:p,multiple:b,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v,value:S,open:$,mounted:Se,transitionStatus:K,items:E,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,pe=ve(W,he.activeIndex),le=ve(W,he.selectedIndex),re=ve(W,he.triggerElement),V=ve(W,he.positionerElement),ce=a.useMemo(()=>b&&Array.isArray(S)&&S.length===0?"":Zn(S,x),[b,S,x]),ee=Ve(W.state.triggerElement);ea({id:C,commit:w.commit,value:S,controlRef:ee,name:D,getValue:()=>S});const q=a.useRef(S);X(()=>{S!==q.current&&W.set("forceMount",!0)},[W,S]),X(()=>{L(S!==null)},[S,L]),X(function(){if($)return;const Pe=ae.current;if(b){const Ue=Array.isArray(S)?S:[];if(Ue.length===0){W.set("selectedIndex",null);return}const Ye=Ue[Ue.length-1],wt=dr(Pe,Ye,v);W.set("selectedIndex",wt===-1?null:wt);return}const Fe=dr(Pe,S,v);W.set("selectedIndex",Fe===-1?null:Fe)},[b,$,S,ae,v,W]),Lg(S,()=>{_(D),T(S!==F.initialValue),N()?w.commit(S):w.commit(S,!0)});const J=Q((be,Pe)=>{if(c?.(be,Pe),!Pe.isCanceled&&(z(be),!be&&W.state.activeIndex!==null)){const Fe=Z.current[W.state.activeIndex];queueMicrotask(()=>{Fe?.setAttribute("tabindex","-1")})}}),ue=Q(()=>{U(!1),W.set("activeIndex",null),h?.(!1)});Lt({enabled:!m,open:$,ref:te,onComplete(){$||ue()}}),a.useImperativeHandle(m,()=>({unmount:ue}),[ue]);const fe=Q((be,Pe)=>{r?.(be,Pe),!Pe.isCanceled&&M(be)}),Re=Q(()=>{const be=W.state.listElement||te.current;if(!be)return;const Pe=be.scrollTop,Fe=be.scrollTop+be.clientHeight,Ue=Pe>1,Ye=Fe<be.scrollHeight-1;W.state.scrollUpArrowVisible!==Ue&&W.set("scrollUpArrowVisible",Ue),W.state.scrollDownArrowVisible!==Ye&&W.set("scrollDownArrowVisible",Ye)}),we=Ac({open:$,onOpenChange:J,elements:{reference:re,floating:V}}),Ce=Hr(we,{enabled:!f&&!O,event:"mousedown"}),$e=Ur(we,{bubbles:!1}),st=Kp(we,{enabled:!f&&!O,listRef:Z,activeIndex:pe,selectedIndex:le,disabledIndices:Jo,onNavigate(be){be===null&&!$||W.set("activeIndex",be)},focusItemOnHover:!1}),Oe=Yp(we,{enabled:!f&&!O&&($||!b),listRef:Y,activeIndex:pe,selectedIndex:le,onMatch(be){$?W.set("activeIndex",be):fe(ae.current[be],ge("none"))},onTypingChange(be){de.current=be}}),{getReferenceProps:et,getFloatingProps:Ge,getItemProps:it}=Mn([Ce,$e,st,Oe]);Pg(()=>{W.update({popupProps:Ge(),triggerProps:et()})}),X(()=>{W.update({id:C,modal:p,multiple:b,value:S,open:$,mounted:Se,transitionStatus:K,popupProps:Ge(),triggerProps:et(),items:E,itemToStringLabel:y,itemToStringValue:x,isItemEqualToValue:v})},[W,C,p,b,S,$,Se,K,Ge,et,E,y,x,v]);const Te=a.useMemo(()=>({store:W,name:D,required:d,disabled:O,readOnly:f,multiple:b,itemToStringLabel:y,itemToStringValue:x,setValue:fe,setOpen:J,listRef:Z,popupRef:te,scrollHandlerRef:G,handleScrollArrowVisibility:Re,scrollArrowsMountedCountRef:H,getItemProps:it,events:we.context.events,valueRef:j,valuesRef:ae,labelsRef:Y,typingRef:de,selectionRef:ie,selectedItemTextRef:B,validation:w,onOpenChangeComplete:h,keyboardActiveRef:Ee,alignItemWithTriggerActiveRef:oe,initialValueRef:q}),[W,D,d,O,f,b,y,x,fe,J,it,we.context.events,w,h,Re]),Ne=Pt(g,w.inputRef),Be=b&&Array.isArray(S)&&S.length>0,ke=a.useMemo(()=>!b||!Array.isArray(S)||!D?null:S.map(be=>{const Pe=Zn(be,x);return P.jsx("input",{type:"hidden",name:D,value:Pe},Pe)}),[b,S,D,x]);return P.jsx(es.Provider,{value:Te,children:P.jsxs(ts.Provider,{value:we,children:[R,P.jsx("input",{...w.getInputValidationProps({onFocus(){W.state.triggerElement?.focus()},onChange(be){if(be.nativeEvent.defaultPrevented)return;const Pe=be.target.value,Fe=ge(ln,be.nativeEvent);function Ue(){if(b)return;const Ye=ae.current.find(wt=>Zn(wt,x).toLowerCase()===Pe.toLowerCase());Ye!=null&&(T(Ye!==F.initialValue),fe(Ye,Fe),N()&&w.commit(Ye))}W.set("forceMount",!0),queueMicrotask(Ue)}}),id:t||I||void 0,name:b?void 0:D,value:ce,disabled:O,required:d&&!Be,readOnly:f,ref:Ne,style:vo,tabIndex:-1,"aria-hidden":!0}),ke]})})}function Fg(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV==="test")return t;const n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,c=parseFloat(o.width)||0,u=parseFloat(o.height)||0,l=Math.max(t.width,s,c),f=Math.max(t.height,i,u),d=l-t.width,p=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-p/2,bottom:t.bottom+p/2}}const qn=2,Vg={...ic,...Gc,value:()=>null},Pa=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...c}=t,{setTouched:u,setFocused:l,validationMode:f,state:d,disabled:p}=An(),{labelId:m}=_o(),{store:g,setOpen:h,selectionRef:E,validation:b,readOnly:y,alignItemWithTriggerActiveRef:x,disabled:v,keyboardActiveRef:R}=jt(),_=p||v||s,T=ve(g,he.open),N=ve(g,he.value),F=ve(g,he.triggerProps),L=ve(g,he.positionerElement),k=ve(g,he.listElement),A=ve(g,he.serializedValue),w=Ve(L),I=a.useRef(null),C=Xe(),O=Xe(),{getButtonProps:D,buttonRef:S}=St({disabled:_,native:i}),M=Q(H=>{g.set("triggerElement",H)}),$=Pt(n,I,S,M),z=Xe(),Z=Xe();a.useEffect(()=>{if(T)return Z.start(200,()=>{E.current.allowUnselectedMouseUp=!0,z.start(200,()=>{E.current.allowSelectedMouseUp=!0})}),()=>{z.clear(),Z.clear()};E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},O.clear()},[T,E,O,z,Z]);const Y=a.useMemo(()=>k?.id??_n(L)?.id,[k,L]),te=vr(F,{role:"combobox","aria-expanded":T?"true":"false","aria-haspopup":"listbox","aria-controls":T?Y:void 0,"aria-labelledby":m,"aria-readonly":y||void 0,tabIndex:_?-1:0,ref:$,onFocus(H){l(!0),T&&x.current&&h(!1,ge(Ut,H.nativeEvent)),C.start(0,()=>{g.set("forceMount",!0)})},onBlur(){u(!0),l(!1),f==="onBlur"&&b.commit(N)},onPointerMove({pointerType:H}){R.current=!1,g.set("touchModality",H==="touch")},onPointerDown({pointerType:H}){g.set("touchModality",H==="touch")},onKeyDown(){R.current=!0},onMouseDown(H){if(T)return;const j=Ke(H.currentTarget);function ae(de){if(!I.current)return;const Ee=de.target;if(xe(I.current,Ee)||xe(w.current,Ee)||Ee===I.current)return;const B=Fg(I.current);de.clientX>=B.left-qn&&de.clientX<=B.right+qn&&de.clientY>=B.top-qn&&de.clientY<=B.bottom+qn||h(!1,ge(Zl,de))}O.start(0,()=>{j.addEventListener("mouseup",ae,{once:!0})})}},b.getValidationProps,c,D);te.role="combobox";const G=a.useMemo(()=>({...d,open:T,disabled:_,value:N,readOnly:y,placeholder:!A}),[d,T,_,N,y,A]);return ye("button",t,{ref:[n,I],state:G,stateAttributesMapping:Vg,props:te})});process.env.NODE_ENV!=="production"&&(Pa.displayName="SelectTrigger");const jg={value:()=>null},Aa=a.forwardRef(function(t,n){const{className:o,render:r,children:s,...i}=t,{store:c,valueRef:u}=jt(),l=ve(c,he.value),f=ve(c,he.items),d=ve(c,he.itemToStringLabel),p=ve(c,he.serializedValue),m=a.useMemo(()=>({value:l,placeholder:!p}),[l,p]),g=typeof s=="function"?s(l):s??(Array.isArray(l)?Dg(l,d):Mg(l,f,d));return ye("span",t,{state:m,ref:[n,u],props:[{children:g},i],stateAttributesMapping:jg})});process.env.NODE_ENV!=="production"&&(Aa.displayName="SelectValue");const Na=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=jt(),c=ve(i,he.open),u=a.useMemo(()=>({open:c}),[c]);return ye("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:kr})});process.env.NODE_ENV!=="production"&&(Na.displayName="SelectIcon");const Ia=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(Ia.displayName="SelectPortalContext");const Ma=a.forwardRef(function(t,n){const{store:o}=jt(),r=ve(o,he.mounted),s=ve(o,he.forceMount);return r||s?P.jsx(Ia.Provider,{value:!0,children:P.jsx(Eo,{ref:n,...t})}):null});process.env.NODE_ENV!=="production"&&(Ma.displayName="SelectPortal");const ns=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ns.displayName="SelectPositionerContext");function $g(){const e=a.useContext(ns);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectPositionerContext is missing. SelectPositioner parts must be placed within <Select.Positioner>.":Ae(59));return e}function so(e,t){e&&Object.assign(e.style,t)}const Bg={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Hg={position:"fixed"},Da=a.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:c="bottom",align:u="center",sideOffset:l=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:p,arrowPadding:m=5,sticky:g=!1,disableAnchorTracking:h,alignItemWithTrigger:E=!0,collisionAvoidance:b=Wl,...y}=t,{store:x,listRef:v,labelsRef:R,alignItemWithTriggerActiveRef:_,selectedItemTextRef:T,valuesRef:N,initialValueRef:F,popupRef:L,setValue:k}=jt(),A=Oa(),w=ve(x,he.open),I=ve(x,he.mounted),C=ve(x,he.modal),O=ve(x,he.value),D=ve(x,he.touchModality),S=ve(x,he.positionerElement),M=ve(x,he.triggerElement),$=ve(x,he.isItemEqualToValue),z=a.useRef(null),Z=a.useRef(null),[Y,te]=a.useState(E),G=I&&Y&&!D;!I&&Y!==E&&te(E),X(()=>{I||(he.scrollUpArrowVisible(x.state)&&x.set("scrollUpArrowVisible",!1),he.scrollDownArrowVisible(x.state)&&x.set("scrollDownArrowVisible",!1))},[x,I]),a.useImperativeHandle(_,()=>G),Gr((G||C)&&w&&!D,M);const H=aa({anchor:o,floatingRootContext:A,positionMethod:r,mounted:I,side:c,sideOffset:l,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:d,collisionPadding:p,sticky:g,disableAnchorTracking:h??G,collisionAvoidance:b,keepMounted:!0}),j=G?"none":H.side,ae=G?Hg:H.positionerStyles,de=a.useMemo(()=>{const K={};return w||(K.pointerEvents="none"),{role:"presentation",hidden:!I,style:{...ae,...K}}},[w,I,ae]),Ee=a.useMemo(()=>({open:w,side:j,align:H.align,anchorHidden:H.anchorHidden}),[w,j,H.align,H.anchorHidden]),B=Q(K=>{x.set("positionerElement",K)}),ie=ye("div",t,{ref:[n,B],state:Ee,stateAttributesMapping:Ft,props:[de,y]}),oe=a.useRef(0),Se=Q(K=>{if(K.size===0&&oe.current===0||N.current.length===0)return;const W=oe.current;if(oe.current=K.size,K.size===W)return;const pe=ge(ln);if(W!==0&&!x.state.multiple&&O!==null&&dr(N.current,O,$)===-1){const re=F.current,ce=re!=null&&qo(N.current,re,$)?re:null;k(ce,pe),ce===null&&(x.set("selectedIndex",null),T.current=null)}if(W!==0&&x.state.multiple&&Array.isArray(O)){const le=O.filter(re=>qo(N.current,re,$));(le.length!==O.length||le.some(re=>!qo(O,re,$)))&&(k(le,pe),le.length===0&&(x.set("selectedIndex",null),T.current=null))}if(w&&G){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const le={height:""};so(S,le),so(L.current,le)}}),U=a.useMemo(()=>({...H,side:j,alignItemWithTriggerActive:G,setControlledAlignItemWithTrigger:te,scrollUpArrowRef:z,scrollDownArrowRef:Z}),[H,j,G,te]);return P.jsx(fi,{elementsRef:v,labelsRef:R,onMapChange:Se,children:P.jsxs(ns.Provider,{value:U,children:[I&&C&&P.jsx(Co,{inert:Ro(!w),cutout:M}),ie]})})});process.env.NODE_ENV!=="production"&&(Da.displayName="SelectPositioner");function La(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const Kn="base-ui-disable-scrollbar",ii={className:Kn,element:P.jsx("style",{href:Kn,precedence:"base-ui:low",children:`.${Kn}{scrollbar-width:none}.${Kn}::-webkit-scrollbar{display:none}`})},zg={...Ft,...It},ka=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{store:i,popupRef:c,onOpenChangeComplete:u,setOpen:l,valueRef:f,selectedItemTextRef:d,keyboardActiveRef:p,multiple:m,handleScrollArrowVisibility:g,scrollHandlerRef:h}=jt(),{side:E,align:b,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:x,scrollDownArrowRef:v,scrollUpArrowRef:R}=$g(),_=fa()!=null,T=Oa(),N=Xe(),F=ve(i,he.id),L=ve(i,he.open),k=ve(i,he.mounted),A=ve(i,he.popupProps),w=ve(i,he.transitionStatus),I=ve(i,he.triggerElement),C=ve(i,he.positionerElement),O=ve(i,he.listElement),D=a.useRef(0),S=a.useRef(!1),M=a.useRef(0),$=a.useRef(!1),z=a.useRef({}),Z=un(),Y=Q(j=>{if(!C||!c.current||!$.current)return;if(S.current||!y){g();return}const ae=C.style.top==="0px",de=C.style.bottom==="0px",Ee=C.getBoundingClientRect().height,B=Ke(C),ie=getComputedStyle(C),oe=parseFloat(ie.marginTop),Se=parseFloat(ie.marginBottom),U=B.documentElement.clientHeight-oe-Se,K=j.scrollTop,W=j.scrollHeight,pe=j.clientHeight,le=W-pe;let re=null,V=null,ce=!1;if(ae){const ee=le-K,q=Ee+ee,J=Math.min(q,U);re=J,J!==U?V=le:ce=!0}else if(de){const ee=K-0,q=Ee+ee,J=Math.min(q,U),ue=q-U;re=J,J!==U?V=0:(ce=!0,K<le&&(V=K-(ee-ue)))}re!=null&&(C.style.height=`${re}px`),V!=null&&(j.scrollTop=V),ce&&(S.current=!0),g()});a.useImperativeHandle(h,()=>Y,[Y]),Lt({open:L,ref:c,onComplete(){L&&u?.(!0)}});const te=a.useMemo(()=>({open:L,transitionStatus:w,side:E,align:b}),[L,w,E,b]);X(()=>{!C||!c.current||Object.keys(z.current).length||(z.current={top:C.style.top||"0",left:C.style.left||"0",right:C.style.right,height:C.style.height,bottom:C.style.bottom,minHeight:C.style.minHeight,maxHeight:C.style.maxHeight,marginTop:C.style.marginTop,marginBottom:C.style.marginBottom})},[c,C]),X(()=>{k||y||($.current=!1,S.current=!1,D.current=0,M.current=0,so(C,z.current))},[k,y,C,c]),X(()=>{const j=c.current;if(!(!k||!I||!C||!j)){if(!y){$.current=!0,Z.request(g);return}queueMicrotask(()=>{const ae=getComputedStyle(C),de=getComputedStyle(j),Ee=Ke(I),B=De(C),ie=I.getBoundingClientRect(),oe=C.getBoundingClientRect(),Se=ie.left,U=ie.height,K=O||j,W=K.scrollHeight,pe=parseFloat(de.borderBottomWidth),le=parseFloat(ae.marginTop)||10,re=parseFloat(ae.marginBottom)||10,V=parseFloat(ae.minHeight)||100,ce=5,ee=5,q=20,J=Ee.documentElement.clientHeight-le-re,ue=Ee.documentElement.clientWidth,fe=J-ie.bottom+U,Re=d.current,we=f.current;let Ce=0,$e=0;if(Re&&we){const Fe=we.getBoundingClientRect(),Ue=Re.getBoundingClientRect(),Ye=Fe.left-Se,wt=Ue.left-oe.left,Dn=Fe.top-ie.top+Fe.height/2,Oo=Ue.top-oe.top+Ue.height/2;Ce=Ye-wt,$e=Oo-Dn}const st=fe+$e+re+pe;let Oe=Math.min(J,st);const et=J-le-re,Ge=st-Oe,it=Math.max(ce,Se+Ce),Te=ue-ee,Ne=Math.max(0,it+oe.width-Te);C.style.left=`${it-Ne}px`,C.style.height=`${Oe}px`,C.style.maxHeight="auto",C.style.marginTop=`${le}px`,C.style.marginBottom=`${re}px`,j.style.height="100%";const Be=K.scrollHeight-K.clientHeight,ke=Ge>=Be;ke&&(Oe=Math.min(J,oe.height)-(Ge-Be));const be=ie.top<q||ie.bottom>J-q||Oe<Math.min(W,V),Pe=(B.visualViewport?.scale??1)!==1&&Ii;if(be||Pe){$.current=!0,so(C,z.current),rt.flushSync(()=>x(!1));return}if(ke){const Fe=Math.max(0,J-st);C.style.top=oe.height>=et?"0":`${Fe}px`,C.style.height=`${Oe}px`,K.scrollTop=K.scrollHeight-K.clientHeight,D.current=Math.max(V,Oe)}else C.style.bottom="0",D.current=Math.max(V,Oe),K.scrollTop=Ge;D.current===J&&(S.current=!0),g(),setTimeout(()=>{$.current=!0})})}},[i,k,C,I,f,d,c,g,y,x,Z,v,R,O]),a.useEffect(()=>{if(!y||!C||!k)return;const j=De(C);function ae(de){l(!1,ge(Jl,de))}return j.addEventListener("resize",ae),()=>{j.removeEventListener("resize",ae)}},[l,y,C,k]);const G={...O?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":m||void 0,id:`${F}-list`},onKeyDown(j){p.current=!0,_&&Dr.has(j.key)&&j.stopPropagation()},onMouseMove(){p.current=!1},onPointerLeave(j){if(La(j)||j.pointerType==="touch")return;const ae=j.currentTarget;N.start(0,()=>{i.set("activeIndex",null),ae.focus({preventScroll:!0})})},onScroll(j){O||h.current?.(j.currentTarget)},...y&&{style:O?{height:"100%"}:Bg}},H=ye("div",t,{ref:[n,c],state:te,stateAttributesMapping:zg,props:[A,G,Qr(w),{className:!O&&y?ii.className:void 0},s]});return P.jsxs(a.Fragment,{children:[ii.element,P.jsx(Br,{context:T,modal:!1,disabled:!k,restoreFocus:!0,children:H})]})});process.env.NODE_ENV!=="production"&&(ka.displayName="SelectPopup");const os=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(os.displayName="SelectItemContext");function rs(){const e=a.useContext(os);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>.":Ae(57));return e}const Fa=a.memo(a.forwardRef(function(t,n){const{render:o,className:r,value:s=null,label:i,disabled:c=!1,nativeButton:u=!1,...l}=t,f=a.useRef(null),d=Ci({label:i,textRef:f,indexGuessBehavior:Ri.GuessFromOrder}),{store:p,getItemProps:m,setOpen:g,setValue:h,selectionRef:E,typingRef:b,valuesRef:y,keyboardActiveRef:x,multiple:v}=jt(),R=Xe(),_=ve(p,he.isActive,d.index),T=ve(p,he.isSelected,d.index,s),N=ve(p,he.isSelectedByFocus,d.index),F=ve(p,he.isItemEqualToValue),L=d.index,k=L!==-1,A=a.useRef(null),w=Ve(L);X(()=>{if(!k)return;const G=y.current;return G[L]=s,()=>{delete G[L]}},[k,L,s,y]),X(()=>{if(!k)return;const G=p.state.value;let H=G;v&&Array.isArray(G)&&G.length>0&&(H=G[G.length-1]),H!==void 0&&an(H,s,F)&&p.set("selectedIndex",L)},[k,L,v,F,p,s]);const I=a.useMemo(()=>({disabled:c,selected:T,highlighted:_}),[c,T,_]),C=m({active:_,selected:T});C.onFocus=void 0,C.id=void 0;const O=a.useRef(null),D=a.useRef("mouse"),S=a.useRef(!1),{getButtonProps:M,buttonRef:$}=St({disabled:c,focusableWhenDisabled:!0,native:u});function z(G){const H=p.state.value;if(v){const j=Array.isArray(H)?H:[],ae=T?Ng(j,s,F):[...j,s];h(ae,ge(No,G))}else h(s,ge(No,G)),g(!1,ge(No,G))}const Z={role:"option","aria-selected":T,"aria-disabled":c||void 0,tabIndex:_?0:-1,onFocus(){p.set("activeIndex",L)},onMouseEnter(){!x.current&&p.state.selectedIndex===null&&p.set("activeIndex",L)},onMouseMove(){p.set("activeIndex",L)},onMouseLeave(G){x.current||La(G)||R.start(0,()=>{p.state.activeIndex===L&&p.set("activeIndex",null)})},onTouchStart(){E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(G){O.current=G.key,p.set("activeIndex",L)},onClick(G){S.current=!1,!(G.type==="keydown"&&O.current===null)&&(c||O.current===" "&&b.current||D.current!=="touch"&&!_||(O.current=null,z(G.nativeEvent)))},onPointerEnter(G){D.current=G.pointerType},onPointerDown(G){D.current=G.pointerType,S.current=!0},onMouseUp(G){if(c)return;if(S.current){S.current=!1;return}const H=!E.current.allowSelectedMouseUp&&T,j=!E.current.allowUnselectedMouseUp&&!T;H||j||D.current!=="touch"&&!_||z(G.nativeEvent)}},Y=ye("div",t,{ref:[$,n,d.ref,A],state:I,props:[C,Z,l,M]}),te=a.useMemo(()=>({selected:T,indexRef:w,textRef:f,selectedByFocus:N,hasRegistered:k}),[T,w,f,N,k]);return P.jsx(os.Provider,{value:te,children:Y})}));process.env.NODE_ENV!=="production"&&(Fa.displayName="SelectItem");const Va=a.forwardRef(function(t,n){const o=t.keepMounted??!1,{selected:r}=rs();return o||r?P.jsx(ja,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(Va.displayName="SelectItemIndicator");const ja=a.memo(a.forwardRef((e,t)=>{const{render:n,className:o,keepMounted:r,...s}=e,{selected:i}=rs(),c=a.useRef(null),{transitionStatus:u,setMounted:l}=ao(i),f=a.useMemo(()=>({selected:i,transitionStatus:u}),[i,u]),d=ye("span",e,{ref:[t,c],state:f,props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:It});return Lt({open:i,ref:c,onComplete(){i||l(!1)}}),d}));process.env.NODE_ENV!=="production"&&(ja.displayName="Inner");const $a=a.memo(a.forwardRef(function(t,n){const{indexRef:o,textRef:r,selectedByFocus:s,hasRegistered:i}=rs(),{selectedItemTextRef:c}=jt(),{className:u,render:l,...f}=t,d=a.useCallback(m=>{if(!m||!i)return;const g=c.current===null||!c.current.isConnected;(s||g&&o.current===0)&&(c.current=m)},[c,o,s,i]);return ye("div",t,{ref:[d,n,r],props:f})}));process.env.NODE_ENV!=="production"&&($a.displayName="SelectItemText");const ss=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(ss.displayName="SelectGroupContext");function Ug(){const e=a.useContext(ss);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: SelectGroupContext is missing. SelectGroup parts must be placed within <Select.Group>.":Ae(56));return e}const Ba=a.forwardRef(function(t,n){const{className:o,render:r,...s}=t,[i,c]=a.useState(),u=a.useMemo(()=>({labelId:i,setLabelId:c}),[i,c]),l=ye("div",t,{ref:n,props:[{role:"group","aria-labelledby":i},s]});return P.jsx(ss.Provider,{value:u,children:l})});process.env.NODE_ENV!=="production"&&(Ba.displayName="SelectGroup");const Ha=a.forwardRef(function(t,n){const{className:o,render:r,id:s,...i}=t,{setLabelId:c}=Ug(),u=ut(s);return X(()=>{c(u)},[u,c]),ye("div",t,{ref:n,props:[{id:u},i]})});process.env.NODE_ENV!=="production"&&(Ha.displayName="SelectGroupLabel");const za=a.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t,c=a.useMemo(()=>({orientation:s}),[s]);return ye("div",t,{state:c,ref:n,props:[{role:"separator","aria-orientation":s},i]})});process.env.NODE_ENV!=="production"&&(za.displayName="Separator");const Wg=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),qg=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),ci=e=>{const t=qg(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ua=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),Kg=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Gg={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Yg=ne.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:s,iconNode:i,...c},u)=>ne.createElement("svg",{ref:u,...Gg,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Ua("lucide",r),...!s&&!Kg(c)&&{"aria-hidden":"true"},...c},[...i.map(([l,f])=>ne.createElement(l,f)),...Array.isArray(s)?s:[s]]));const Wa=(e,t)=>{const n=ne.forwardRef(({className:o,...r},s)=>ne.createElement(Yg,{ref:s,iconNode:t,className:Ua(`lucide-${Wg(ci(e))}`,`lucide-${e}`,o),...r}));return n.displayName=ci(e),n};const Xg=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Zg=Wa("check",Xg);const Jg=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Qg=Wa("chevron-down",Jg);function qa(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=qa(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Yt(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=qa(e))&&(o&&(o+=" "),o+=t);return o}const eh="_trigger_krl6a_1",th="_icon_krl6a_40",nh="_popup_krl6a_48",oh="_item_krl6a_69",rh="_itemIndicator_krl6a_99",sh="_group_krl6a_107",ih="_label_krl6a_111",ch="_separator_krl6a_118",At={trigger:eh,icon:th,popup:nh,item:oh,itemIndicator:rh,group:sh,label:ih,separator:ch};function ah(e){return P.jsx(kg,{...e})}const Ka=a.forwardRef(({className:e,children:t,placeholder:n,renderValue:o,...r},s)=>{const i=(c,u)=>!u.value||Array.isArray(u.value)&&u.value.length===0?P.jsx("span",{...c,children:n||"Select..."}):Array.isArray(u.value)?P.jsx("span",{...c,children:u.value.join(", ")}):P.jsx("span",{...c,children:String(u.value)});return P.jsxs(Pa,{ref:s,className:Yt(At.trigger,e),...r,children:[P.jsx(Aa,{render:o||i}),P.jsx(Na,{className:At.icon,children:P.jsx(Qg,{size:16})})]})});Ka.displayName="ALSSelect.Trigger";function lh(e){return P.jsx(Ma,{...e})}const Ga=a.forwardRef(({className:e,...t},n)=>P.jsx(Da,{ref:n,className:Yt(e),sideOffset:4,...t}));Ga.displayName="ALSSelect.Positioner";const Ya=a.forwardRef(({className:e,...t},n)=>P.jsx(ka,{ref:n,className:Yt(At.popup,e),...t}));Ya.displayName="ALSSelect.Popup";const Xa=a.forwardRef(({className:e,children:t,...n},o)=>P.jsxs(Fa,{ref:o,className:Yt(At.item,e),...n,children:[P.jsx($a,{children:t}),P.jsx(Va,{className:At.itemIndicator,children:P.jsx(Zg,{size:16})})]}));Xa.displayName="ALSSelect.Item";const Za=a.forwardRef(({className:e,...t},n)=>P.jsx(Ba,{ref:n,className:Yt(At.group,e),...t}));Za.displayName="ALSSelect.Group";const Ja=a.forwardRef(({className:e,...t},n)=>P.jsx(Ha,{ref:n,className:Yt(At.label,e),...t}));Ja.displayName="ALSSelect.Label";const Qa=a.forwardRef(({className:e,...t},n)=>P.jsx(za,{ref:n,className:Yt(At.separator,e),...t}));Qa.displayName="ALSSelect.Separator";const uh={Root:ah,Trigger:Ka,Portal:lh,Positioner:Ga,Popup:Ya,Item:Xa,Group:Za,Label:Ja,Separator:Qa},fh="_root_qrq0m_1",dh={root:fh};function ph(e){return P.jsx("div",{className:dh.root})}const mh="_root_10n3a_1",gh={root:mh};function hh(e){return P.jsx("div",{className:gh.root})}const yh="_root_1vneq_1",bh={root:yh};function vh(e){return P.jsx("div",{className:bh.root})}const Eh="_root_1gw46_1",xh={root:Eh};function Sh(e){return P.jsx("div",{className:xh.root})}let ai=0;function el(e){return ai+=1,`${e}-${Math.random().toString(36).slice(2,6)}-${ai}`}const To=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(To.displayName="ToastContext");function is(){const e=a.useContext(To);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Ae(73));return e}function Ko(e,t){if(typeof e=="string")return{description:e};if(typeof e=="function"){const n=e(t);return typeof n=="string"?{description:n}:n}return e}const tl=function(t){const{children:n,timeout:o=5e3,limit:r=3,toastManager:s}=t,[i,c]=a.useState([]),[u,l]=a.useState(!1),[f,d]=a.useState(!1),[p,m]=a.useState(null);i.length===0&&(u&&l(!1),f&&d(!1));const g=u||f,h=a.useRef(new Map),E=a.useRef(null),b=a.useRef(!0),y=a.useRef(!1);function x(w){const I=ct(Ke(E.current));if(!E.current||!xe(E.current,I)||!sr(I))return;const C=i.findIndex(S=>S.id===w);let O=null,D=C+1;for(;D<i.length;){if(i[D].transitionStatus!=="ending"){O=i[D];break}D+=1}if(!O)for(D=C-1;D>=0;){if(i[D].transitionStatus!=="ending"){O=i[D];break}D-=1}O?O.ref?.current?.focus():p?.focus({preventScroll:!0})}const v=Q(()=>{y.current||(y.current=!0,h.current.forEach(w=>{if(w.timeout){w.timeout.clear();const I=Date.now()-w.start,C=w.delay-I;w.remaining=C>0?C:0}}))}),R=Q(()=>{y.current&&(y.current=!1,h.current.forEach((w,I)=>{w.remaining=w.remaining>0?w.remaining:w.delay,w.timeout??=pt.create(),w.timeout.start(w.remaining,()=>{h.current.delete(I),w.callback()}),w.start=Date.now()}))}),_=Q(w=>{c(O=>{const D=O.map(M=>M.id===w?{...M,transitionStatus:"ending",height:0}:M),S=D.filter(M=>M.transitionStatus!=="ending");return D.map(M=>{if(M.transitionStatus==="ending")return M;const $=S.indexOf(M)>=r;return{...M,limited:$}})});const I=h.current.get(w);I&&I.timeout&&(I.timeout.clear(),h.current.delete(w)),i.find(O=>O.id===w)?.onClose?.(),x(w),i.length===1&&(l(!1),d(!1))}),T=Q(w=>{c(C=>C.filter(O=>O.id!==w)),i.find(C=>C.id===w)?.onRemove?.()}),N=Q((w,I,C)=>{const O=Date.now(),D=b.current&&!u&&!f,S=D?pt.create():void 0;S?.start(I,()=>{h.current.delete(w),C()}),h.current.set(w,{timeout:S,start:D?O:0,delay:I,remaining:I,callback:C})}),F=Q(w=>{const I=w.id||el("toast"),C={...w,id:I,transitionStatus:"starting"};c(D=>{const S=[C,...D],M=S.filter($=>$.transitionStatus!=="ending");if(M.length>r){const $=M.length-r,z=M.slice(-$);return S.map(Z=>z.some(Y=>Y.id===Z.id)?{...Z,limited:!0}:{...Z,limited:!1})}return S.map($=>({...$,limited:!1}))});const O=C.timeout??o;return C.type!=="loading"&&O>0&&N(I,O,()=>_(I)),(u||f||!b.current)&&v(),I}),L=Q((w,I)=>{c(C=>C.map(O=>O.id===w?{...O,...I}:O))}),k=Q((w,I)=>{const C=Ko(I.loading),O=F({...C,type:"loading"}),D=w.then(S=>{const M=Ko(I.success,S);L(O,{...M,type:"success"});const $=M.timeout??o;return $>0&&N(O,$,()=>_(O)),(u||f||!b.current)&&v(),S}).catch(S=>{const M=Ko(I.error,S);L(O,{...M,type:"error"});const $=M.timeout??o;return $>0&&N(O,$,()=>_(O)),(u||f||!b.current)&&v(),Promise.reject(S)});return{}.hasOwnProperty.call(I,"setPromise")&&I.setPromise(D),D});a.useEffect(function(){return s?s[" subscribe"](({action:C,options:O})=>{const D=O.id;C==="promise"&&O.promise?k(O.promise,O):C==="update"&&D?L(D,O):C==="close"&&D?_(D):F(O)}):void 0},[F,L,N,o,s,k,_]);const A=a.useMemo(()=>({toasts:i,setToasts:c,hovering:u,setHovering:l,focused:f,setFocused:d,expanded:g,add:F,close:_,remove:T,update:L,promise:k,pauseTimers:v,resumeTimers:R,prevFocusElement:p,setPrevFocusElement:m,viewportRef:E,scheduleTimer:N,windowFocusedRef:b}),[F,_,f,u,g,v,p,k,T,R,N,i,L]);return P.jsx(To.Provider,{value:A,children:n})};process.env.NODE_ENV!=="production"&&(tl.displayName="ToastProvider");const nl=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(nl.displayName="ToastViewportContext");let wh=(function(e){return e.frontmostHeight="--toast-frontmost-height",e})({});const ol=a.forwardRef(function(t,n){const{render:o,className:r,children:s,...i}=t,{toasts:c,pauseTimers:u,resumeTimers:l,setHovering:f,setFocused:d,viewportRef:p,windowFocusedRef:m,prevFocusElement:g,setPrevFocusElement:h,expanded:E,focused:b}=is(),y=a.useRef(!1),x=a.useRef(!1),v=c.length,R=c[0]?.height??0,_=a.useMemo(()=>c.some(S=>S.transitionStatus==="ending"),[c]);a.useEffect(()=>{if(!p.current)return;function S($){v!==0&&$.key==="F6"&&$.target!==p.current&&($.preventDefault(),h(ct(Ke(p.current))),p.current?.focus({preventScroll:!0}),u(),d(!0))}const M=De(p.current);return M.addEventListener("keydown",S),()=>{M.removeEventListener("keydown",S)}},[u,d,h,v,p]),a.useEffect(()=>{if(!p.current||!v)return;const S=De(p.current);function M(z){z.target===S&&(m.current=!1,u())}function $(z){if(z.relatedTarget||z.target===S)return;const Z=qe(z),Y=ct(Ke(p.current));(!xe(p.current,Z)||!sr(Y))&&l(),setTimeout(()=>{m.current=!0})}return S.addEventListener("blur",M,!0),S.addEventListener("focus",$,!0),()=>{S.removeEventListener("blur",M,!0),S.removeEventListener("focus",$,!0)}},[u,l,p,m,d,v]),a.useEffect(()=>{const S=p.current;if(!S||v===0)return;const M=Ke(S);function $(z){if(z.pointerType!=="touch")return;const Z=qe(z);xe(S,Z)||(l(),f(!1),d(!1))}return M.addEventListener("pointerdown",$,!0),()=>{M.removeEventListener("pointerdown",$,!0)}},[v,l,d,f,p]);function T(S){p.current&&(y.current=!0,S.relatedTarget===p.current?c[0]?.ref?.current?.focus():g?.focus({preventScroll:!0}))}function N(S){S.key==="Tab"&&S.shiftKey&&S.target===p.current&&(S.preventDefault(),g?.focus({preventScroll:!0}),l())}a.useEffect(()=>{!m.current||_||!x.current||(l(),f(!1),x.current=!1)},[_,l,f,m]);function F(){u(),f(!0),x.current=!1}function L(){c.some(S=>S.transitionStatus==="ending")?x.current=!0:(l(),f(!1))}function k(){if(y.current){y.current=!1;return}b||sr(Ke(p.current).activeElement)&&(d(!0),u())}function A(S){!b||xe(p.current,S.relatedTarget)||(d(!1),l())}const w={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:F,onMouseMove:F,onMouseLeave:L,onFocus:k,onBlur:A,onKeyDown:N,onClick:k},I=a.useMemo(()=>({expanded:E}),[E]),C=ye("div",t,{ref:[n,p],state:I,props:[w,{style:{[wh.frontmostHeight]:R?`${R}px`:void 0}},i,{children:P.jsxs(a.Fragment,{children:[v>0&&g&&P.jsx(dt,{onFocus:T}),s,v>0&&g&&P.jsx(dt,{onFocus:T})]})}]}),O=a.useMemo(()=>({viewportRef:p}),[p]),D=a.useMemo(()=>c.filter(S=>S.priority==="high"),[c]);return P.jsxs(nl.Provider,{value:O,children:[v>0&&g&&P.jsx(dt,{onFocus:T}),C,!b&&D.length>0&&P.jsx("div",{style:vo,children:D.map(S=>P.jsxs("div",{role:"alert","aria-atomic":!0,children:[P.jsx("div",{children:S.title}),P.jsx("div",{children:S.description})]},S.id))})]})});process.env.NODE_ENV!=="production"&&(ol.displayName="ToastViewport");const cs=a.createContext(void 0);process.env.NODE_ENV!=="production"&&(cs.displayName="ToastRootContext");function qt(){const e=a.useContext(cs);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ToastRootContext is missing. Toast parts must be used within <Toast.Root>.":Ae(66));return e}let $t=(function(e){return e.index="--toast-index",e.offsetY="--toast-offset-y",e.height="--toast-height",e.swipeMovementX="--toast-swipe-movement-x",e.swipeMovementY="--toast-swipe-movement-y",e})({});const Rh={...It,swipeDirection(e){return e?{"data-swipe-direction":e}:null}},bn=40,Ch=10,Rt=.5,_h=1;function li(e,t,n){switch(e){case"up":return-n;case"down":return n;case"left":return-t;case"right":return t;default:return 0}}function Th(e){const n=window.getComputedStyle(e).transform;let o=0,r=0,s=1;if(n&&n!=="none"){const i=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(i){const c=i[1].split(", ").map(parseFloat);c.length===6?(o=c[4],r=c[5],s=Math.sqrt(c[0]*c[0]+c[1]*c[1])):c.length===16&&(o=c[12],r=c[13],s=c[0])}}return{x:o,y:r,scale:s}}const rl=a.forwardRef(function(t,n){const{toast:o,render:r,className:s,swipeDirection:i=["down","right"],...c}=t,u=o.positionerProps?.anchor!==void 0;let l=[];u||(l=Array.isArray(i)?i:[i]);const f=l.length>0,{toasts:d,focused:p,close:m,remove:g,setToasts:h,pauseTimers:E,expanded:b,setHovering:y}=is(),[x,v]=a.useState(void 0),[R,_]=a.useState(!1),[T,N]=a.useState(!1),[F,L]=a.useState(!1),[k,A]=a.useState({x:0,y:0}),[w,I]=a.useState({x:0,y:0,scale:1}),[C,O]=a.useState(),[D,S]=a.useState(),[M,$]=a.useState(null),z=a.useRef(null),Z=a.useRef({x:0,y:0}),Y=a.useRef({x:0,y:0,scale:1}),te=a.useRef(void 0),G=a.useRef(0),H=a.useRef(!1),j=a.useRef({x:0,y:0}),ae=a.useRef(!1),de=a.useMemo(()=>d.indexOf(o),[o,d]),Ee=a.useMemo(()=>d.filter(q=>q.transitionStatus!=="ending").indexOf(o),[o,d]),B=a.useMemo(()=>d.slice(0,d.indexOf(o)).reduce((q,J)=>q+(J.height||0),0),[d,o]);Lt({open:o.transitionStatus!=="ending",ref:z,onComplete(){o.transitionStatus==="ending"&&g(o.id)}});const ie=Q(()=>{const q=z.current;if(!q)return;const J=q.style.height;q.style.height="auto";const ue=q.offsetHeight;q.style.height=J,h(fe=>fe.map(Re=>Re.id===o.id?{...Re,ref:z,height:ue,transitionStatus:void 0}:Re))});X(ie,[ie]);function oe(q,J){let ue=q,fe=J;return!l.includes("left")&&!l.includes("right")?ue=q>0?q**Rt:-(Math.abs(q)**Rt):(!l.includes("right")&&q>0&&(ue=q**Rt),!l.includes("left")&&q<0&&(ue=-(Math.abs(q)**Rt))),!l.includes("up")&&!l.includes("down")?fe=J>0?J**Rt:-(Math.abs(J)**Rt):(!l.includes("down")&&J>0&&(fe=J**Rt),!l.includes("up")&&J<0&&(fe=-(Math.abs(J)**Rt))),{x:ue,y:fe}}function Se(q){if(q.button!==0)return;q.pointerType==="touch"&&E();const J=qe(q.nativeEvent);if(!(J&&J.closest('button,a,input,textarea,[role="button"],[data-swipe-ignore]'))){if(H.current=!1,te.current=void 0,G.current=0,Z.current={x:q.clientX,y:q.clientY},j.current=Z.current,z.current){const fe=Th(z.current);Y.current=fe,I(fe),A({x:fe.x,y:fe.y})}y(!0),_(!0),N(!1),$(null),ae.current=!0,z.current?.setPointerCapture(q.pointerId)}}function U(q){if(!R)return;q.preventDefault(),ae.current&&(Z.current={x:q.clientX,y:q.clientY},ae.current=!1);const{clientY:J,clientX:ue,movementX:fe,movementY:Re}=q;(Re<0&&J>j.current.y||Re>0&&J<j.current.y)&&(j.current={x:j.current.x,y:J}),(fe<0&&ue>j.current.x||fe>0&&ue<j.current.x)&&(j.current={x:ue,y:j.current.y});const we=ue-Z.current.x,Ce=J-Z.current.y,$e=J-j.current.y,st=ue-j.current.x;if(!T&&Math.sqrt(we*we+Ce*Ce)>=_h&&(N(!0),M===null)){const Ne=l.includes("left")||l.includes("right"),Be=l.includes("up")||l.includes("down");if(Ne&&Be){const ke=Math.abs(we),be=Math.abs(Ce);$(ke>be?"horizontal":"vertical")}}let Oe;if(!te.current)M==="vertical"?Ce>0?Oe="down":Ce<0&&(Oe="up"):M==="horizontal"?we>0?Oe="right":we<0&&(Oe="left"):Math.abs(we)>=Math.abs(Ce)?Oe=we>0?"right":"left":Oe=Ce>0?"down":"up",Oe&&l.includes(Oe)&&(te.current=Oe,G.current=li(Oe,we,Ce),v(Oe));else{const Te=te.current,Ne=li(Te,st,$e);Ne>bn?(H.current=!1,v(Te)):G.current-Ne>=Ch&&(H.current=!0)}const et=oe(we,Ce);let Ge=Y.current.x,it=Y.current.y;M==="horizontal"?(l.includes("left")||l.includes("right"))&&(Ge+=et.x):(M==="vertical"||(l.includes("left")||l.includes("right"))&&(Ge+=et.x),(l.includes("up")||l.includes("down"))&&(it+=et.y)),A({x:Ge,y:it})}function K(q){if(!R)return;if(_(!1),N(!1),$(null),z.current?.releasePointerCapture(q.pointerId),H.current){A({x:w.x,y:w.y}),v(void 0);return}let J=!1;const ue=k.x-w.x,fe=k.y-w.y;let Re;for(const we of l){switch(we){case"right":ue>bn&&(J=!0,Re="right");break;case"left":ue<-bn&&(J=!0,Re="left");break;case"down":fe>bn&&(J=!0,Re="down");break;case"up":fe<-bn&&(J=!0,Re="up");break}if(J)break}J?(v(Re),L(!0),m(o.id)):(A({x:w.x,y:w.y}),v(void 0))}function W(q){if(q.key==="Escape"){if(!z.current||!xe(z.current,ct(Ke(z.current))))return;m(o.id)}}a.useEffect(()=>{if(!f)return;const q=z.current;if(!q)return;function J(ue){xe(q,ue.target)&&ue.preventDefault()}return q.addEventListener("touchmove",J,{passive:!1}),()=>{q.removeEventListener("touchmove",J)}},[f]);function pe(){if(!R&&k.x===w.x&&k.y===w.y&&!F)return{[$t.swipeMovementX]:"0px",[$t.swipeMovementY]:"0px"};const q=k.x-w.x,J=k.y-w.y;return{transition:R?"none":void 0,transform:R?`translateX(${k.x}px) translateY(${k.y}px) scale(${w.scale})`:void 0,[$t.swipeMovementX]:`${q}px`,[$t.swipeMovementY]:`${J}px`}}const le=o.priority==="high",re={role:le?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":C,"aria-describedby":D,"aria-hidden":le&&!p?!0:void 0,onPointerDown:f?Se:void 0,onPointerMove:f?U:void 0,onPointerUp:f?K:void 0,onKeyDown:W,inert:Ro(o.limited),style:{...pe(),[$t.index]:o.transitionStatus==="ending"?de:Ee,[$t.offsetY]:`${B}px`,[$t.height]:o.height?`${o.height}px`:void 0}},V=a.useMemo(()=>({rootRef:z,toast:o,titleId:C,setTitleId:O,descriptionId:D,setDescriptionId:S,swiping:R,swipeDirection:x,recalculateHeight:ie,index:de,visibleIndex:Ee,expanded:b}),[o,C,D,R,x,ie,de,Ee,b]),ce=a.useMemo(()=>({transitionStatus:o.transitionStatus,expanded:b,limited:o.limited||!1,type:o.type,swiping:V.swiping,swipeDirection:V.swipeDirection}),[b,o.transitionStatus,o.limited,o.type,V.swiping,V.swipeDirection]),ee=ye("div",t,{ref:[n,V.rootRef],state:ce,stateAttributesMapping:Rh,props:[re,c]});return P.jsx(cs.Provider,{value:V,children:ee})});process.env.NODE_ENV!=="production"&&(rl.displayName="ToastRoot");const sl=a.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{visibleIndex:i,expanded:c,recalculateHeight:u}=qt(),l=a.useRef(null);X(()=>{const m=l.current;if(!m||(u(),typeof ResizeObserver!="function"))return;const g=new ResizeObserver(u);return g.observe(m),()=>{g.disconnect()}},[u]);const f=i>0,d=a.useMemo(()=>({expanded:c,behind:f}),[c,f]);return ye("div",t,{ref:[n,l],state:d,props:s})});process.env.NODE_ENV!=="production"&&(sl.displayName="ToastContent");const il=a.forwardRef(function(t,n){const{render:o,className:r,id:s,children:i,...c}=t,{toast:u}=qt(),l=i??u.description,f=!!l,d=Nt(s),{setDescriptionId:p}=qt();X(()=>{if(f)return p(d),()=>{p(void 0)}},[f,d,p]);const m=a.useMemo(()=>({type:u.type}),[u.type]),g=ye("p",t,{ref:n,state:m,props:{...c,id:d,children:l}});return f?g:null});process.env.NODE_ENV!=="production"&&(il.displayName="ToastDescription");const cl=a.forwardRef(function(t,n){const{render:o,className:r,id:s,children:i,...c}=t,{toast:u}=qt(),l=i??u.title,f=!!l,d=Nt(s),{setTitleId:p}=qt();X(()=>{if(f)return p(d),()=>{p(void 0)}},[f,d,p]);const m=a.useMemo(()=>({type:u.type}),[u.type]),g=ye("h2",t,{ref:n,state:m,props:{...c,id:d,children:l}});return f?g:null});process.env.NODE_ENV!=="production"&&(cl.displayName="ToastTitle");const al=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s,nativeButton:i=!0,...c}=t,{close:u,expanded:l}=is(),{toast:f}=qt(),{getButtonProps:d,buttonRef:p}=St({disabled:s,native:i}),m=a.useMemo(()=>({type:f.type}),[f.type]);return ye("button",t,{ref:[n,p],state:m,props:[{"aria-hidden":!l,onClick(){u(f.id)}},c,d]})});process.env.NODE_ENV!=="production"&&(al.displayName="ToastClose");const ll=a.forwardRef(function(t,n){const{render:o,className:r,disabled:s,nativeButton:i=!0,...c}=t,{toast:u}=qt(),l=u.actionProps?.children??c.children,f=!!l,{getButtonProps:d,buttonRef:p}=St({disabled:s,native:i}),m=a.useMemo(()=>({type:u.type}),[u.type]),g=ye("button",t,{ref:[n,p],state:m,props:[c,u.actionProps,d,{children:l}]});return f?g:null});process.env.NODE_ENV!=="production"&&(ll.displayName="ToastAction");const ul=a.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,...c}=t,{portalNode:u,portalSubtree:l}=pc({container:r,ref:n,componentProps:t,elementProps:c});return!l&&!u?null:P.jsxs(a.Fragment,{children:[l,u&&rt.createPortal(o,u)]})});process.env.NODE_ENV!=="production"&&(ul.displayName="FloatingPortalLite");const Oh=ul;function fl(){const e=a.useContext(To);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: useToastManager must be used within <Toast.Provider>.":Ae(73));const{toasts:t,add:n,close:o,update:r,promise:s}=e;return a.useMemo(()=>({toasts:t,add:n,close:o,update:r,promise:s}),[t,n,o,r,s])}function Ph(){const e=[];function t(n){e.forEach(o=>o(n))}return{" subscribe":function(o){return e.push(o),()=>{const r=e.indexOf(o);r!==-1&&e.splice(r,1)}},add(n){const o=n.id||el("toast"),r={...n,id:o,transitionStatus:"starting"};return t({action:"add",options:r}),o},close(n){t({action:"close",options:{id:n}})},update(n,o){t({action:"update",options:{...o,id:n}})},promise(n,o){let r=n;return t({action:"promise",options:{...o,promise:n,setPromise(s){r=s}}}),r}}}const Ah="_viewport_x4zrf_2",Nh="_root_x4zrf_16",Ih="_content_x4zrf_120",Mh="_title_x4zrf_133",Dh="_description_x4zrf_158",Lh="_action_x4zrf_166",kh="_close_x4zrf_194",Fh="_closeIcon_x4zrf_225",xt={viewport:Ah,root:Nh,"root--success":"_root--success_x4zrf_99","root--error":"_root--error_x4zrf_103","root--warning":"_root--warning_x4zrf_107","root--info":"_root--info_x4zrf_111","root--default":"_root--default_x4zrf_115",content:Ih,title:Mh,description:Dh,action:Lh,close:kh,closeIcon:Fh},dl=({limit:e=3,timeout:t=5e3,toastManager:n,children:o})=>P.jsx(tl,{limit:e,timeout:t,toastManager:n,children:o});dl.displayName="ALSToast.Provider";const pl=({container:e,children:t})=>P.jsx(Oh,{container:e,children:t});pl.displayName="ALSToast.Portal";const ml=ne.forwardRef(({className:e,style:t},n)=>{const{toasts:o}=fl(),r=[xt.viewport,e].filter(Boolean).join(" ");return P.jsx(ol,{ref:n,className:r,style:t,children:o.slice().map((s,i)=>P.jsx(as,{toast:s,style:{"--toast-index":i},children:P.jsxs(ls,{children:[s.title&&P.jsx(us,{children:s.title}),s.description&&P.jsx(fs,{children:s.description}),s.actionProps&&P.jsx(ds,{...s.actionProps}),P.jsx(ps,{})]})},s.id))})});ml.displayName="ALSToast.Viewport";const as=ne.forwardRef(({toast:e,swipeDirection:t=["down","right"],className:n,style:o,children:r},s)=>{const i=e.type||"default",c=[xt.root,xt[`root--${i}`],n].filter(Boolean).join(" ");return P.jsx(rl,{ref:s,toast:e,swipeDirection:t,className:c,style:o,children:r})});as.displayName="ALSToast.Root";const ls=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.content,e].filter(Boolean).join(" ");return P.jsx(sl,{ref:o,className:r,style:t,children:n})});ls.displayName="ALSToast.Content";const us=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.title,e].filter(Boolean).join(" ");return P.jsx(cl,{ref:o,className:r,style:t,children:n})});us.displayName="ALSToast.Title";const fs=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.description,e].filter(Boolean).join(" ");return P.jsx(il,{ref:o,className:r,style:t,children:n})});fs.displayName="ALSToast.Description";const ds=ne.forwardRef(({className:e,style:t,children:n,onClick:o},r)=>{const s=[xt.action,e].filter(Boolean).join(" ");return P.jsx(ll,{ref:r,className:s,style:t,onClick:o,children:n})});ds.displayName="ALSToast.Action";const ps=ne.forwardRef(({className:e,style:t,children:n},o)=>{const r=[xt.close,e].filter(Boolean).join(" ");return P.jsx(al,{ref:o,className:r,style:t,children:n||P.jsx(Vh,{})})});ps.displayName="ALSToast.Close";const Vh=()=>P.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:xt.closeIcon,children:P.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jh={Provider:dl,Portal:pl,Viewport:ml,Root:as,Content:ls,Title:us,Description:fs,Action:ds,Close:ps,useToastManager:fl,createToastManager:Ph},$h="_root_19t9o_1",Bh={root:$h};function Hh(e){return P.jsx("div",{className:Bh.root})}const zh="_root_u2979_1",Uh={root:zh};function Wh(e){return P.jsx("div",{className:Uh.root})}const qh="_root_6lo3f_1",Kh={root:qh};function Gh(e){return P.jsx("div",{className:Kh.root})}const Yh="_root_z5dqm_1",Xh={root:Yh};function Zh(e){return P.jsx("div",{className:Xh.root})}const Jh="_layout_8124k_4",Qh="_layoutLeft_8124k_27",ey="_layoutRight_8124k_37",ty="_layoutAsideHidden_8124k_47",ny="_layoutAsideFullHeight_8124k_57",oy="_header_8124k_76",ry="_headerSticky_8124k_92",sy="_headerFixed_8124k_97",iy="_headerRelative_8124k_105",cy="_headerHideOnScroll_8124k_109",ay="_headerElevated_8124k_121",ly="_headerTransparent_8124k_126",uy="_headerWithFullHeightAside_8124k_132",fy="_layoutAsideCollapsed_8124k_140",dy="_aside_8124k_149",py="_asideFullHeight_8124k_168",my="_asideContent_8124k_202",gy="_asideContentCollapsed_8124k_234",hy="_asideRelative_8124k_239",yy="_asideFixed_8124k_243",by="_asideCollapsed_8124k_275",vy="_asideOverlay_8124k_326",Ey="_asideOverlayClosing_8124k_369",xy="_asideOverlayBackdrop_8124k_400",Sy="_asideOverlayBackdropClosing_8124k_420",wy="_asideResizeHandle_8124k_436",Ry="_asideResizing_8124k_469",Cy="_main_8124k_489",_y="_mainPaddingNone_8124k_521",Ty="_mainPaddingSm_8124k_525",Oy="_mainPaddingMd_8124k_529",Py="_mainPaddingLg_8124k_533",Ay="_mainPaddingXl_8124k_537",Ny="_mainFullWidth_8124k_542",Iy="_mainWithFullHeightAside_8124k_547",My="_footer_8124k_564",Dy="_footerRelative_8124k_576",Ly="_footerSticky_8124k_580",ky="_footerFixed_8124k_587",Fy="_footerWithFullHeightAside_8124k_597",me={layout:Jh,layoutLeft:Qh,layoutRight:ey,layoutAsideHidden:ty,layoutAsideFullHeight:ny,header:oy,headerSticky:ry,headerFixed:sy,headerRelative:iy,headerHideOnScroll:cy,headerElevated:ay,headerTransparent:ly,headerWithFullHeightAside:uy,layoutAsideCollapsed:fy,aside:dy,asideFullHeight:py,asideContent:my,asideContentCollapsed:gy,asideRelative:hy,asideFixed:yy,asideCollapsed:by,asideOverlay:vy,asideOverlayClosing:Ey,asideOverlayBackdrop:xy,asideOverlayBackdropClosing:Sy,asideResizeHandle:wy,asideResizing:Ry,main:Cy,mainPaddingNone:_y,mainPaddingSm:Ty,mainPaddingMd:Oy,mainPaddingLg:Py,mainPaddingXl:Ay,mainFullWidth:Ny,mainWithFullHeightAside:Iy,footer:My,footerRelative:Dy,footerSticky:Ly,footerFixed:ky,footerWithFullHeightAside:Fy},mn=ne.createContext({asidePosition:"left",asideHidden:!1,asideCollapsed:!1,asideFullHeight:!1,headerBehavior:"sticky",scrollY:0,mainRef:null,registerAside:()=>{},registerHeader:()=>{}}),Vy=()=>ne.useContext(mn),jy=(e,t=10)=>{const[n,o]=ne.useState("up"),[r,s]=ne.useState(0),i=ne.useRef(0);return ne.useEffect(()=>{const c=e.current;if(!c)return;const u=()=>{const l=c.scrollTop;s(l),!(Math.abs(l-i.current)<t)&&(o(l>i.current?"down":"up"),i.current=l)};return c.addEventListener("scroll",u,{passive:!0}),()=>c.removeEventListener("scroll",u)},[e,t]),{scrollDirection:n,scrollY:r}},$y=({children:e,className:t="",behavior:n="sticky",scrollThreshold:o=50,elevated:r=!1,transparent:s=!1,height:i})=>{const{scrollY:c,registerHeader:u,asideFullHeight:l}=ne.useContext(mn),[f,d]=ne.useState(!1),[p,m]=ne.useState(s);ne.useEffect(()=>{u(n)},[n,u]),ne.useEffect(()=>{r&&d(c>0),s&&m(c<o)},[c,n,o,r,s]);const g={fixed:me.headerFixed,sticky:me.headerSticky,relative:me.headerRelative,hideOnScroll:me.headerHideOnScroll}[n],h=[me.header,g,f&&me.headerElevated,p&&me.headerTransparent,l&&me.headerWithFullHeightAside,t].filter(Boolean).join(" "),E=i?{"--header-custom-height":typeof i=="number"?`${i}px`:i}:{};return P.jsx("header",{className:h,style:E,children:e})},gl=({children:e,className:t="",collapsed:n=!1,hidden:o=!1,variant:r="relative",width:s,collapsedWidth:i,resizable:c=!1,minWidth:u=200,maxWidth:l=500,onWidthChange:f,overlay:d=!1,onOverlayClose:p,collapsedContent:m,transitionDuration:g=300,fullHeight:h=!1})=>{const{registerAside:E,asidePosition:b}=ne.useContext(mn),[y,x]=ne.useState(null),[v,R]=ne.useState(!1),[_,T]=ne.useState(!1),N=ne.useRef(null);ne.useEffect(()=>{E(n,o,h)},[n,o,h,E]);const F=ne.useCallback(()=>{p&&(T(!0),setTimeout(()=>{T(!1),p()},g))},[p,g]),L=ne.useCallback(C=>{c&&(C.preventDefault(),R(!0))},[c]);if(ne.useEffect(()=>{if(!v)return;const C=D=>{if(!N.current)return;const S=N.current.getBoundingClientRect();let M;b==="right"?M=S.right-D.clientX:M=D.clientX-S.left;const $=Math.min(Math.max(M,u),l);x($),f?.($)},O=()=>{R(!1)};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",O)}},[v,u,l,f,b]),o)return null;const k=r==="fixed"?me.asideFixed:me.asideRelative,A=[me.aside,k,n&&me.asideCollapsed,d&&me.asideOverlay,d&&_&&me.asideOverlayClosing,v&&me.asideResizing,h&&me.asideFullHeight,t].filter(Boolean).join(" "),w={...s&&!n&&!y&&{"--aside-width":typeof s=="number"?`${s}px`:s},...i&&n&&{"--aside-collapsed-width":typeof i=="number"?`${i}px`:i},...y&&!n&&{"--aside-width":`${y}px`},"--aside-transition-duration":`${g}ms`},I=[me.asideContent,n&&me.asideContentCollapsed].filter(Boolean).join(" ");return P.jsxs(P.Fragment,{children:[d&&P.jsx("div",{className:`${me.asideOverlayBackdrop} ${_?me.asideOverlayBackdropClosing:""}`,onClick:F,"aria-hidden":"true"}),P.jsxs("aside",{ref:N,className:A,style:w,children:[P.jsx("div",{className:I,children:n&&m?m:e}),c&&!n&&P.jsx("div",{className:me.asideResizeHandle,onMouseDown:L,role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar"})]})]})},By=({children:e,className:t="",maxWidth:n,centered:o=!1,padding:r="lg"})=>{const{asideHidden:s,asideFullHeight:i,mainRef:c}=ne.useContext(mn),u={none:me.mainPaddingNone,sm:me.mainPaddingSm,md:me.mainPaddingMd,lg:me.mainPaddingLg,xl:me.mainPaddingXl}[r],l=[me.main,s&&me.mainFullWidth,i&&me.mainWithFullHeightAside,u,t].filter(Boolean).join(" "),f={...n&&{maxWidth:typeof n=="number"?`${n}px`:n},...o&&{margin:"0 auto"}};return P.jsx("main",{ref:c,className:l,children:n||o?P.jsx("div",{style:f,children:e}):e})},Hy=({children:e,className:t="",variant:n="relative",height:o})=>{const{asideFullHeight:r}=ne.useContext(mn),s={fixed:me.footerFixed,sticky:me.footerSticky,relative:me.footerRelative}[n],i=[me.footer,s,r&&me.footerWithFullHeightAside,t].filter(Boolean).join(" "),c=o?{"--footer-custom-height":typeof o=="number"?`${o}px`:o}:{};return P.jsx("footer",{className:i,style:c,children:e})},zy=({children:e,className:t="",asidePosition:n="left"})=>{const[o,r]=ne.useState(!1),[s,i]=ne.useState(!1),[c,u]=ne.useState(!1),[l,f]=ne.useState("sticky"),d=ne.useRef(null),{scrollY:p}=jy(d),m=ne.useCallback((y,x,v)=>{i(y),r(x),u(v)},[]),g=ne.useCallback(y=>{f(y)},[]);ne.useEffect(()=>{ne.Children.toArray(e).some(x=>ne.isValidElement(x)&&x.type===gl&&!x.props.hidden)||r(!0)},[e]);const h=n==="right"?me.layoutRight:me.layoutLeft,E=[me.layout,h,s&&me.layoutAsideCollapsed,o&&me.layoutAsideHidden,c&&me.layoutAsideFullHeight,t].filter(Boolean).join(" "),b={asidePosition:n,asideHidden:o,asideCollapsed:s,asideFullHeight:c,headerBehavior:l,scrollY:p,mainRef:d,registerAside:m,registerHeader:g};return P.jsx(mn.Provider,{value:b,children:P.jsx("div",{className:E,children:e})})},Uy=Object.assign({Root:zy,Header:$y,Aside:gl,Main:By,Footer:Hy});exports.ALSAccordion=Af;exports.ALSAlertDialog=Mf;exports.ALSAutocomplete=kf;exports.ALSAvatar=jf;exports.ALSButton=sc;exports.ALSCheckbox=Wf;exports.ALSCheckboxGroup=Gf;exports.ALSCollapsible=Zf;exports.ALSCombobox=ed;exports.ALSContextMenu=od;exports.ALSDialog=Sm;exports.ALSField=Cm;exports.ALSFieldset=Om;exports.ALSForm=Nm;exports.ALSInput=oa;exports.ALSMenu=Fm;exports.ALSMenubar=$m;exports.ALSMeter=zm;exports.ALSNavigationMenu=qm;exports.ALSNumberField=Ym;exports.ALSPopover=hg;exports.ALSPopoverArrow=wa;exports.ALSPopoverBackdrop=Ta;exports.ALSPopoverClose=_a;exports.ALSPopoverDescription=Ca;exports.ALSPopoverPopup=Sa;exports.ALSPopoverPortal=Ea;exports.ALSPopoverPositioner=xa;exports.ALSPopoverRoot=ba;exports.ALSPopoverTitle=Ra;exports.ALSPopoverTrigger=va;exports.ALSPreviewCard=vg;exports.ALSProgress=Sg;exports.ALSRadio=Cg;exports.ALSScrollArea=Og;exports.ALSSelect=uh;exports.ALSSeparator=ph;exports.ALSSlider=hh;exports.ALSSwitch=vh;exports.ALSTabs=Sh;exports.ALSToast=jh;exports.ALSToggle=Hh;exports.ALSToggleGroup=Wh;exports.ALSToolbar=Gh;exports.ALSTooltip=Zh;exports.MainLayout=Uy;exports.useLayout=Vy;
21
21
  //# sourceMappingURL=als-react-ts-ui.cjs.map