vibora 7.5.1 → 7.5.2

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.
package/bin/vibora.js CHANGED
@@ -32629,7 +32629,7 @@ function installUv() {
32629
32629
  var package_default = {
32630
32630
  name: "vibora",
32631
32631
  private: true,
32632
- version: "7.5.1",
32632
+ version: "7.5.2",
32633
32633
  description: "Harness Attention. Orchestrate Agents. Ship.",
32634
32634
  license: "PolyForm-Shield-1.0.0",
32635
32635
  type: "module",
@@ -22,7 +22,7 @@ Error generating stack: `+k.message+`
22
22
  `:"",C=T&&!T.startsWith(`
23
23
  `)?`
24
24
  `:"",R=S+w+_+C+T;t(R)}else t(e+(e?`
25
- `:"")+_)}catch(_){Lt.error(a("errors.imageUploadFailed")),Dt.kanban.error("Upload error",{error:String(_)})}finally{o(!1)}return}}};return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"relative",children:[p.jsx(kw,{ref:l,value:e,onChange:d=>t(d.target.value),onPaste:f,className:Ue(s&&"opacity-50",n),disabled:s||r,...i}),s&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 rounded-md",children:p.jsx("span",{className:"text-sm text-muted-foreground",children:a("status.uploading")})})]}),u.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2",children:u.map((d,m)=>p.jsx("a",{href:eH(d),target:"_blank",rel:"noopener noreferrer",className:"block",children:p.jsx("img",{src:eH(d),alt:`Attachment ${m+1}`,className:"h-16 w-auto rounded border object-cover hover:opacity-80 transition-opacity"})},m))})]})}function Ao({className:e,...t}){return p.jsx("label",{"data-slot":"label",className:Ue("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const Rne=A.forwardRef(function(t,n){const{className:r,render:i,orientation:a="horizontal",...s}=t,o=A.useMemo(()=>({orientation:a}),[a]);return Ct("div",t,{state:o,ref:n,props:[{role:"separator","aria-orientation":a},s]})});function TEe({className:e,orientation:t="horizontal",...n}){return p.jsx(Rne,{"data-slot":"separator",orientation:t,className:Ue("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function mm({className:e,...t}){return p.jsx("div",{"data-slot":"field-group",className:Ue("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const AEe=Cd("data-[invalid=true]:text-destructive gap-2 group/field flex w-full",{variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function yr({className:e,orientation:t="vertical",...n}){return p.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:Ue(AEe({orientation:t}),e),...n})}function xr({className:e,...t}){return p.jsx(Ao,{"data-slot":"field-label",className:Ue("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function io({className:e,...t}){return p.jsx("p",{"data-slot":"field-description",className:Ue("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Nne(e){const t=A.useRef(!0);t.current&&(t.current=!1,e())}const Ine=A.createContext(null),Dne=A.createContext(null);function zl(){const e=A.useContext(Ine);if(e===null)throw new Error(on(60));return e}function Lne(){const e=A.useContext(Dne);if(e===null)throw new Error(on(61));return e}const Pne=(e,t)=>Object.is(e,t);function zu(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wf(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:zu(r,t,n))}function gm(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:zu(r,t,n))}function Mne(e,t,n){return e.filter(r=>!zu(r,t,n))}function ND(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function jne(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function mi(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 ND(e)}function No(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?ND(e.value):ND(e)}function kEe(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]??mi(e,n);if(Array.isArray(t)){const r=jne(t)?t.flatMap(i=>i.items):t;if(e==null){const i=r.find(a=>a.value==null);return i&&i.label!=null?i.label:mi(e,n)}if(typeof e!="object"){const i=r.find(a=>a&&a.value===e);return i&&i.label!=null?i.label:mi(e,n)}if("value"in e){const i=r.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return mi(e,n)}function OEe(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>mi(n,t)).join(", ")}const Qt={id:He(e=>e.id),modal:He(e=>e.modal),multiple:He(e=>e.multiple),items:He(e=>e.items),itemToStringLabel:He(e=>e.itemToStringLabel),itemToStringValue:He(e=>e.itemToStringValue),isItemEqualToValue:He(e=>e.isItemEqualToValue),value:He(e=>e.value),open:He(e=>e.open),mounted:He(e=>e.mounted),forceMount:He(e=>e.forceMount),transitionStatus:He(e=>e.transitionStatus),openMethod:He(e=>e.openMethod),activeIndex:He(e=>e.activeIndex),selectedIndex:He(e=>e.selectedIndex),isActive:He((e,t)=>e.activeIndex===t),isSelected:He((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>zu(a,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:zu(i,n,r)}),isSelectedByFocus:He((e,t)=>e.selectedIndex===t),popupProps:He(e=>e.popupProps),triggerProps:He(e=>e.triggerProps),triggerElement:He(e=>e.triggerElement),positionerElement:He(e=>e.positionerElement),listElement:He(e=>e.listElement),scrollUpArrowVisible:He(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:He(e=>e.scrollDownArrowVisible),hasScrollArrows:He(e=>e.hasScrollArrows),serializedValue:He(e=>{const{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?"":No(n,r)})};function Jc(e,t){const n=A.useRef(e),r=Ye(t);nt(()=>{n.current!==e&&r(n.current)},[e,r]),nt(()=>{n.current=e},[e])}function REe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:o,name:l,disabled:u=!1,readOnly:f=!1,required:d=!1,modal:m=!0,actionsRef:g,inputRef:x,onOpenChangeComplete:_,items:b,multiple:y=!1,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:T=Pne,highlightItemOnHover:w=!0,children:C}=e,{clearErrors:R}=fg(),{setDirty:O,shouldValidateOnChange:N,validityData:D,setFilled:L,name:z,disabled:P,validation:q}=Ka(),{controlId:H}=$l(),F=k0({id:t}),G=P||u,V=z??l,[B,j]=Wa({controlled:n,default:y?r??ya:r,name:"Select",state:"value"}),[$,Y]=Wa({controlled:a,default:s,name:"Select",state:"open"}),W=A.useRef([]),ee=A.useRef([]),oe=A.useRef(null),ae=A.useRef(null),Z=A.useRef(0),K=A.useRef(null),Q=A.useRef([]),te=A.useRef(!1),ne=A.useRef(!1),J=A.useRef(null),ve=A.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ge=A.useRef(!1),{mounted:fe,setMounted:Ee,transitionStatus:_e}=go($),{openMethod:Ve,triggerProps:Ce,reset:Me}=Aw($),Ae=Di(()=>new jf({id:F,modal:m,multiple:y,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:T,value:B,open:$,mounted:fe,transitionStatus:_e,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,pe=Qe(Ae,Qt.activeIndex),de=Qe(Ae,Qt.selectedIndex),ke=Qe(Ae,Qt.triggerElement),De=Qe(Ae,Qt.positionerElement),me=A.useMemo(()=>y&&Array.isArray(B)&&B.length===0?"":No(B,S),[y,B,S]),ye=A.useMemo(()=>y&&Array.isArray(B)?B.map(_t=>No(_t,S)):No(B,S),[y,B,S]),xe=Er(Ae.state.triggerElement);pg({id:F,commit:q.commit,value:B,controlRef:xe,name:V,getValue:()=>ye});const je=A.useRef(B);nt(()=>{B!==je.current&&Ae.set("forceMount",!0)},[Ae,B]),nt(()=>{L(B!==null)},[B,L]),nt(function(){if($)return;const Yt=Q.current;if(y){const Pe=Array.isArray(B)?B:[];if(Pe.length===0){Ae.set("selectedIndex",null);return}const tt=Pe[Pe.length-1],vt=gm(Yt,tt,T);Ae.set("selectedIndex",vt===-1?null:vt);return}const Vt=gm(Yt,B,T);Ae.set("selectedIndex",Vt===-1?null:Vt)},[y,$,B,Q,T,Ae]),Jc(B,()=>{R(V),O(B!==D.initialValue),N()?q.commit(B):q.commit(B,!0)});const Ge=Ye((_t,Yt)=>{if(o?.(_t,Yt),!Yt.isCanceled&&(Y(_t),!_t&&Ae.state.activeIndex!==null)){const Vt=W.current[Ae.state.activeIndex];queueMicrotask(()=>{Vt?.setAttribute("tabindex","-1")})}}),gt=Ye(()=>{Ee(!1),Ae.set("activeIndex",null),Me(),_?.(!1)});Li({enabled:!g,open:$,ref:oe,onComplete(){$||gt()}}),A.useImperativeHandle(g,()=>({unmount:gt}),[gt]);const at=Ye((_t,Yt)=>{i?.(_t,Yt),!Yt.isCanceled&&j(_t)}),ut=Ye(()=>{const _t=Ae.state.listElement||oe.current;if(!_t)return;const Yt=_t.scrollTop,Vt=_t.scrollTop+_t.clientHeight,Pe=Yt>1,tt=Vt<_t.scrollHeight-1;Ae.state.scrollUpArrowVisible!==Pe&&Ae.set("scrollUpArrowVisible",Pe),Ae.state.scrollDownArrowVisible!==tt&&Ae.set("scrollDownArrowVisible",tt)}),$e=bw({open:$,onOpenChange:Ge,elements:{reference:ke,floating:De}}),pt=sg($e,{enabled:!f&&!G,event:"mousedown"}),Se=og($e,{bubbles:!1}),Be=$M($e,{enabled:!f&&!G,listRef:W,activeIndex:pe,selectedIndex:de,disabledIndices:ya,onNavigate(_t){_t===null&&!$||Ae.set("activeIndex",_t)},focusItemOnHover:!1}),Je=zM($e,{enabled:!f&&!G&&($||!y),listRef:ee,activeIndex:pe,selectedIndex:de,onMatch(_t){$?Ae.set("activeIndex",_t):at(Q.current[_t],lt("none"))},onTypingChange(_t){te.current=_t}}),{getReferenceProps:ct,getFloatingProps:ht,getItemProps:mn}=Od([pt,Se,Be,Je]),Bt=A.useMemo(()=>zo(ct(),Ce),[ct,Ce]);Nne(()=>{Ae.update({popupProps:ht(),triggerProps:Bt})}),nt(()=>{Ae.update({id:F,modal:m,multiple:y,value:B,open:$,mounted:fe,transitionStatus:_e,popupProps:ht(),triggerProps:Bt,items:b,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:T,openMethod:Ve})},[Ae,F,m,y,B,$,fe,_e,ht,Bt,b,v,S,T,Ve]);const Mt=A.useMemo(()=>({store:Ae,name:V,required:d,disabled:G,readOnly:f,multiple:y,itemToStringLabel:v,itemToStringValue:S,highlightItemOnHover:w,setValue:at,setOpen:Ge,listRef:W,popupRef:oe,scrollHandlerRef:ae,handleScrollArrowVisibility:ut,scrollArrowsMountedCountRef:Z,getItemProps:mn,events:$e.context.events,valueRef:K,valuesRef:Q,labelsRef:ee,typingRef:te,selectionRef:ve,selectedItemTextRef:J,validation:q,onOpenChangeComplete:_,keyboardActiveRef:ne,alignItemWithTriggerActiveRef:ge,initialValueRef:je}),[Ae,V,d,G,f,y,v,S,w,at,Ge,mn,$e.context.events,q,_,ut]),dt=Ga(x,q.inputRef),rn=y&&Array.isArray(B)&&B.length>0,Ut=A.useMemo(()=>!y||!Array.isArray(B)||!V?null:B.map(_t=>{const Yt=No(_t,S);return p.jsx("input",{type:"hidden",name:V,value:Yt},Yt)}),[y,B,V,S]);return p.jsx(Ine.Provider,{value:Mt,children:p.jsxs(Dne.Provider,{value:$e,children:[C,p.jsx("input",{...q.getInputValidationProps({onFocus(){Ae.state.triggerElement?.focus()},onChange(_t){if(_t.nativeEvent.defaultPrevented)return;const Yt=_t.target.value,Vt=lt(Vr,_t.nativeEvent);function Pe(){if(y)return;const tt=Q.current.find(vt=>No(vt,S).toLowerCase()===Yt.toLowerCase());tt!=null&&(O(tt!==D.initialValue),at(tt,Vt),N()&&q.commit(tt))}Ae.set("forceMount",!0),queueMicrotask(Pe)}}),id:t||H||void 0,name:y?void 0:V,value:me,disabled:G,required:d&&!rn,readOnly:f,ref:dt,style:kd,tabIndex:-1,"aria-hidden":!0}),Ut]})})}function i3(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const a=parseFloat(n.width)||0,s=parseFloat(n.height)||0,o=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,a,o),f=Math.max(t.height,s,l),d=u-t.width,m=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-m/2,bottom:t.bottom+m/2}}const Yx=2,NEe={...dm,...nc,value:()=>null},IEe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,...o}=t,{setTouched:l,setFocused:u,validationMode:f,state:d,disabled:m}=Ka(),{labelId:g}=$l(),{store:x,setOpen:_,selectionRef:b,validation:y,readOnly:v,alignItemWithTriggerActiveRef:S,disabled:T,keyboardActiveRef:w}=zl(),C=m||T||a,R=Qe(x,Qt.open),O=Qe(x,Qt.value),N=Qe(x,Qt.triggerProps),D=Qe(x,Qt.positionerElement),L=Qe(x,Qt.listElement),z=Qe(x,Qt.serializedValue),P=Er(D),q=A.useRef(null),H=zn(),F=zn(),{getButtonProps:G,buttonRef:V}=ua({disabled:C,native:s}),B=Ye(ae=>{x.set("triggerElement",ae)}),j=Ga(n,q,V,B),$=zn(),Y=zn();A.useEffect(()=>{if(R)return Y.start(200,()=>{b.current.allowUnselectedMouseUp=!0,$.start(200,()=>{b.current.allowSelectedMouseUp=!0})}),()=>{$.clear(),Y.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},F.clear()},[R,b,F,$,Y]);const W=A.useMemo(()=>L?.id??Zv(D)?.id,[L,D]),ee=zo(N,{role:"combobox","aria-expanded":R?"true":"false","aria-haspopup":"listbox","aria-controls":R?W:void 0,"aria-labelledby":g,"aria-readonly":v||void 0,tabIndex:C?-1:0,ref:j,onFocus(ae){u(!0),R&&S.current&&_(!1,lt(Ho,ae.nativeEvent)),H.start(0,()=>{x.set("forceMount",!0)})},onBlur(){l(!0),u(!1),f==="onBlur"&&y.commit(O)},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(ae){if(R)return;const Z=Zi(ae.currentTarget);function K(Q){if(!q.current)return;const te=Q.target;if(Rt(q.current,te)||Rt(P.current,te)||te===q.current)return;const ne=i3(q.current);Q.clientX>=ne.left-Yx&&Q.clientX<=ne.right+Yx&&Q.clientY>=ne.top-Yx&&Q.clientY<=ne.bottom+Yx||_(!1,lt(xte,Q))}F.start(0,()=>{Z.addEventListener("mouseup",K,{once:!0})})}},y.getValidationProps,o,G);ee.role="combobox";const oe=A.useMemo(()=>({...d,open:R,disabled:C,value:O,readOnly:v,placeholder:!z}),[d,R,C,O,v,z]);return Ct("button",t,{ref:[n,q],state:oe,stateAttributesMapping:NEe,props:ee})}),DEe={value:()=>null},LEe=A.forwardRef(function(t,n){const{className:r,render:i,children:a,...s}=t,{store:o,valueRef:l}=zl(),u=Qe(o,Qt.value),f=Qe(o,Qt.items),d=Qe(o,Qt.itemToStringLabel),m=Qe(o,Qt.serializedValue),g=A.useMemo(()=>({value:u,placeholder:!m}),[u,m]),x=typeof a=="function"?a(u):a??(Array.isArray(u)?OEe(u,d):kEe(u,f,d));return Ct("span",t,{state:g,ref:[n,l],props:[{children:x},s],stateAttributesMapping:DEe})}),PEe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s}=zl(),o=Qe(s,Qt.open),l=A.useMemo(()=>({open:o}),[o]);return Ct("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:xw})}),MEe=A.createContext(void 0),jEe=A.forwardRef(function(t,n){const{store:r}=zl(),i=Qe(r,Qt.mounted),a=Qe(r,Qt.forceMount);return i||a?p.jsx(MEe.Provider,{value:!0,children:p.jsx(y0,{ref:n,...t})}):null}),Fne=A.createContext(void 0);function a3(){const e=A.useContext(Fne);if(!e)throw new Error(on(59));return e}function EE(e,t){e&&Object.assign(e.style,t)}const Bne={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},FEe={position:"fixed"},BEe=A.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_,alignItemWithTrigger:b=!0,collisionAvoidance:y=cw,...v}=t,{store:S,listRef:T,labelsRef:w,alignItemWithTriggerActiveRef:C,selectedItemTextRef:R,valuesRef:O,initialValueRef:N,popupRef:D,setValue:L}=zl(),z=Lne(),P=Qe(S,Qt.open),q=Qe(S,Qt.mounted),H=Qe(S,Qt.modal),F=Qe(S,Qt.value),G=Qe(S,Qt.openMethod),V=Qe(S,Qt.positionerElement),B=Qe(S,Qt.triggerElement),j=Qe(S,Qt.isItemEqualToValue),$=A.useRef(null),Y=A.useRef(null),[W,ee]=A.useState(b),oe=q&&W&&G!=="touch";!q&&W!==b&&ee(b),nt(()=>{q||(Qt.scrollUpArrowVisible(S.state)&&S.set("scrollUpArrowVisible",!1),Qt.scrollDownArrowVisible(S.state)&&S.set("scrollDownArrowVisible",!1))},[S,q]),A.useImperativeHandle(C,()=>oe),Tw((oe||H)&&P&&G!=="touch",B);const ae=T0({anchor:r,floatingRootContext:z,positionMethod:i,mounted:q,side:o,sideOffset:u,align:l,alignOffset:f,arrowPadding:g,collisionBoundary:d,collisionPadding:m,sticky:x,disableAnchorTracking:_??oe,collisionAvoidance:y,keepMounted:!0}),Z=oe?"none":ae.side,K=oe?FEe:ae.positionerStyles,Q=A.useMemo(()=>{const Ee={};return P||(Ee.pointerEvents="none"),{role:"presentation",hidden:!q,style:{...K,...Ee}}},[P,q,K]),te=A.useMemo(()=>({open:P,side:Z,align:ae.align,anchorHidden:ae.anchorHidden}),[P,Z,ae.align,ae.anchorHidden]),ne=Ye(Ee=>{S.set("positionerElement",Ee)}),J=Ct("div",t,{ref:[n,ne],state:te,stateAttributesMapping:Qa,props:[Q,v]}),ve=A.useRef(0),ge=Ye(Ee=>{if(Ee.size===0&&ve.current===0||O.current.length===0)return;const _e=ve.current;if(ve.current=Ee.size,Ee.size===_e)return;const Ve=lt(Vr);if(_e!==0&&!S.state.multiple&&F!==null&&gm(O.current,F,j)===-1){const Me=N.current,pe=Me!=null&&wf(O.current,Me,j)?Me:null;L(pe,Ve),pe===null&&(S.set("selectedIndex",null),R.current=null)}if(_e!==0&&S.state.multiple&&Array.isArray(F)){const Ce=F.filter(Me=>wf(O.current,Me,j));(Ce.length!==F.length||Ce.some(Me=>!wf(F,Me,j)))&&(L(Ce,Ve),Ce.length===0&&(S.set("selectedIndex",null),R.current=null))}if(P&&oe){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ce={height:""};EE(V,Ce),EE(D.current,Ce)}}),fe=A.useMemo(()=>({...ae,side:Z,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:$,scrollDownArrowRef:Y}),[ae,Z,oe,ee]);return p.jsx(_0,{elementsRef:T,labelsRef:w,onMapChange:ge,children:p.jsxs(Fne.Provider,{value:fe,children:[q&&H&&p.jsx(Cw,{inert:lg(!P),cutout:B}),J]})})});function Une(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 Xx="base-ui-disable-scrollbar",ly={className:Xx,element:p.jsx("style",{href:Xx,precedence:"base-ui:low",children:`.${Xx}{scrollbar-width:none}.${Xx}::-webkit-scrollbar{display:none}`})},UEe=A.createContext(void 0);function s3(e){return A.useContext(UEe)}const $Ee={...Qa,...Za},zEe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{store:s,popupRef:o,onOpenChangeComplete:l,setOpen:u,valueRef:f,selectedItemTextRef:d,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:x,scrollHandlerRef:_}=zl(),{side:b,align:y,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:S,scrollDownArrowRef:T,scrollUpArrowRef:w}=a3(),C=s3()!=null,R=Lne(),O=zn(),N=Qe(s,Qt.id),D=Qe(s,Qt.open),L=Qe(s,Qt.mounted),z=Qe(s,Qt.popupProps),P=Qe(s,Qt.transitionStatus),q=Qe(s,Qt.triggerElement),H=Qe(s,Qt.positionerElement),F=Qe(s,Qt.listElement),G=A.useRef(0),V=A.useRef(!1),B=A.useRef(0),j=A.useRef(!1),$=A.useRef({}),Y=Nu(),W=Ye(Z=>{if(!H||!o.current||!j.current)return;if(V.current||!v){x();return}const K=H.style.top==="0px",Q=H.style.bottom==="0px",te=H.getBoundingClientRect().height,ne=Zi(H),J=getComputedStyle(H),ve=parseFloat(J.marginTop),ge=parseFloat(J.marginBottom),fe=ne.documentElement.clientHeight-ve-ge,Ee=Z.scrollTop,_e=Z.scrollHeight,Ve=Z.clientHeight,Ce=_e-Ve;let Me=null,Ae=null,pe=!1;if(K){const de=Ce-Ee,ke=te+de,De=Math.min(ke,fe);Me=De,De!==fe?Ae=Ce:pe=!0}else if(Q){const de=Ee-0,ke=te+de,De=Math.min(ke,fe),me=ke-fe;Me=De,De!==fe?Ae=0:(pe=!0,Ee<Ce&&(Ae=Ee-(de-me)))}Me!=null&&(H.style.height=`${Me}px`),Ae!=null&&(Z.scrollTop=Ae),pe&&(V.current=!0),x()});A.useImperativeHandle(_,()=>W,[W]),Li({open:D,ref:o,onComplete(){D&&l?.(!0)}});const ee=A.useMemo(()=>({open:D,transitionStatus:P,side:b,align:y}),[D,P,b,y]);nt(()=>{!H||!o.current||Object.keys($.current).length||($.current={top:H.style.top||"0",left:H.style.left||"0",right:H.style.right,height:H.style.height,bottom:H.style.bottom,minHeight:H.style.minHeight,maxHeight:H.style.maxHeight,marginTop:H.style.marginTop,marginBottom:H.style.marginBottom})},[o,H]),nt(()=>{L||v||(j.current=!1,V.current=!1,G.current=0,B.current=0,EE(H,$.current))},[L,v,H,o]),nt(()=>{const Z=o.current;if(!(!L||!q||!H||!Z)){if(!v){j.current=!0,Y.request(x);return}queueMicrotask(()=>{const K=getComputedStyle(H),Q=getComputedStyle(Z),te=Zi(q),ne=jr(H),J=q.getBoundingClientRect(),ve=H.getBoundingClientRect(),ge=J.left,fe=J.height,Ee=F||Z,_e=Ee.scrollHeight,Ve=parseFloat(Q.borderBottomWidth),Ce=parseFloat(K.marginTop)||10,Me=parseFloat(K.marginBottom)||10,Ae=parseFloat(K.minHeight)||100,pe=5,de=5,ke=20,De=te.documentElement.clientHeight-Ce-Me,me=te.documentElement.clientWidth,ye=De-J.bottom+fe,xe=d.current,je=f.current;let Ge=0,gt=0;if(xe&&je){const Mt=je.getBoundingClientRect(),dt=xe.getBoundingClientRect(),rn=Mt.left-ge,Ut=dt.left-ve.left,_t=Mt.top-J.top+Mt.height/2,Yt=dt.top-ve.top+dt.height/2;Ge=rn-Ut,gt=Yt-_t}const at=ye+gt+Me+Ve;let ut=Math.min(De,at);const $e=De-Ce-Me,pt=at-ut,Se=Math.max(pe,ge+Ge),Be=me-de,Je=Math.max(0,Se+ve.width-Be);H.style.left=`${Se-Je}px`,H.style.height=`${ut}px`,H.style.maxHeight="auto",H.style.marginTop=`${Ce}px`,H.style.marginBottom=`${Me}px`,Z.style.height="100%";const ct=Ee.scrollHeight-Ee.clientHeight,ht=pt>=ct;ht&&(ut=Math.min(De,ve.height)-(pt-ct));const mn=J.top<ke||J.bottom>De-ke||ut<Math.min(_e,Ae),Bt=(ne.visualViewport?.scale??1)!==1&&xM;if(mn||Bt){j.current=!0,EE(H,$.current),Ur.flushSync(()=>S(!1));return}if(ht){const Mt=Math.max(0,De-at);H.style.top=ve.height>=$e?"0":`${Mt}px`,H.style.height=`${ut}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,G.current=Math.max(Ae,ut)}else H.style.bottom="0",G.current=Math.max(Ae,ut),Ee.scrollTop=pt;G.current===De&&(V.current=!0),x(),setTimeout(()=>{j.current=!0})})}},[s,L,H,q,f,d,o,x,v,S,Y,T,w,F]),A.useEffect(()=>{if(!v||!H||!L)return;const Z=jr(H);function K(Q){u(!1,lt(d0e,Q))}return Z.addEventListener("resize",K),()=>{Z.removeEventListener("resize",K)}},[u,v,H,L]);const oe={...F?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${N}-list`},onKeyDown(Z){m.current=!0,C&&WM.has(Z.key)&&Z.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(Z){if(Une(Z)||Z.pointerType==="touch")return;const K=Z.currentTarget;O.start(0,()=>{s.set("activeIndex",null),K.focus({preventScroll:!0})})},onScroll(Z){F||_.current?.(Z.currentTarget)},...v&&{style:F?{height:"100%"}:Bne}},ae=Ct("div",t,{ref:[n,o],state:ee,stateAttributesMapping:$Ee,props:[z,oe,cg(P),{className:!F&&v?ly.className:void 0},a]});return p.jsxs(A.Fragment,{children:[ly.element,p.jsx(pw,{context:R,modal:!1,disabled:!L,restoreFocus:!0,children:ae})]})}),HEe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s,scrollHandlerRef:o}=zl(),{alignItemWithTriggerActive:l}=a3(),u=Qe(s,Qt.hasScrollArrows),f=Qe(s,Qt.openMethod),d=Qe(s,Qt.multiple),g={id:`${Qe(s,Qt.id)}-list`,role:"listbox","aria-multiselectable":d||void 0,onScroll(_){o.current?.(_.currentTarget)},...l&&{style:Bne},className:u&&f!=="touch"?ly.className:void 0},x=Ye(_=>{s.set("listElement",_)});return Ct("div",t,{ref:[n,x],props:[g,a]})}),$ne=A.createContext(void 0);function o3(){const e=A.useContext($ne);if(!e)throw new Error(on(57));return e}const WEe=A.memo(A.forwardRef(function(t,n){const{render:r,className:i,value:a=null,label:s,disabled:o=!1,nativeButton:l=!1,...u}=t,f=A.useRef(null),d=ug({label:s,textRef:f,indexGuessBehavior:qM.GuessFromOrder}),{store:m,getItemProps:g,setOpen:x,setValue:_,selectionRef:b,typingRef:y,valuesRef:v,keyboardActiveRef:S,multiple:T,highlightItemOnHover:w}=zl(),C=zn(),R=Qe(m,Qt.isActive,d.index),O=Qe(m,Qt.isSelected,d.index,a),N=Qe(m,Qt.isSelectedByFocus,d.index),D=Qe(m,Qt.isItemEqualToValue),L=d.index,z=L!==-1,P=A.useRef(null),q=Er(L);nt(()=>{if(!z)return;const ae=v.current;return ae[L]=a,()=>{delete ae[L]}},[z,L,a,v]),nt(()=>{if(!z)return;const ae=m.state.value;let Z=ae;T&&Array.isArray(ae)&&ae.length>0&&(Z=ae[ae.length-1]),Z!==void 0&&zu(Z,a,D)&&m.set("selectedIndex",L)},[z,L,T,D,m,a]);const H=A.useMemo(()=>({disabled:o,selected:O,highlighted:R}),[o,O,R]),F=g({active:R,selected:O});F.onFocus=void 0,F.id=void 0;const G=A.useRef(null),V=A.useRef("mouse"),B=A.useRef(!1),{getButtonProps:j,buttonRef:$}=ua({disabled:o,focusableWhenDisabled:!0,native:l});function Y(ae){const Z=m.state.value;if(T){const K=Array.isArray(Z)?Z:[],Q=O?Mne(K,a,D):[...K,a];_(Q,lt(Pf,ae))}else _(a,lt(Pf,ae)),x(!1,lt(Pf,ae))}const W={role:"option","aria-selected":O,"aria-disabled":o||void 0,tabIndex:R?0:-1,onFocus(){m.set("activeIndex",L)},onMouseEnter(){!S.current&&m.state.selectedIndex===null&&m.set("activeIndex",L)},onMouseMove(){w&&m.set("activeIndex",L)},onMouseLeave(ae){!w||S.current||Une(ae)||C.start(0,()=>{m.state.activeIndex===L&&m.set("activeIndex",null)})},onTouchStart(){b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ae){G.current=ae.key,m.set("activeIndex",L)},onClick(ae){B.current=!1,!(ae.type==="keydown"&&G.current===null)&&(o||G.current===" "&&y.current||V.current!=="touch"&&!R||(G.current=null,Y(ae.nativeEvent)))},onPointerEnter(ae){V.current=ae.pointerType},onPointerDown(ae){V.current=ae.pointerType,B.current=!0},onMouseUp(ae){if(o)return;if(B.current){B.current=!1;return}const Z=!b.current.allowSelectedMouseUp&&O,K=!b.current.allowUnselectedMouseUp&&!O;Z||K||V.current!=="touch"&&!R||Y(ae.nativeEvent)}},ee=Ct("div",t,{ref:[$,n,d.ref,P],state:H,props:[F,W,u,j]}),oe=A.useMemo(()=>({selected:O,indexRef:q,textRef:f,selectedByFocus:N,hasRegistered:z}),[O,q,f,N,z]);return p.jsx($ne.Provider,{value:oe,children:ee})})),VEe=A.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=o3();return r||i?p.jsx(qEe,{...t,ref:n}):null}),qEe=A.memo(A.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=o3(),o=A.useRef(null),{transitionStatus:l,setMounted:u}=go(s),f=A.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),d=Ct("span",e,{ref:[t,o],state:f,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Za});return Li({open:s,ref:o,onComplete(){s||u(!1)}}),d})),GEe=A.memo(A.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:a,hasRegistered:s}=o3(),{selectedItemTextRef:o}=zl(),{className:l,render:u,...f}=t,d=A.useCallback(g=>{if(!g||!s)return;const x=o.current===null||!o.current.isConnected;(a||x&&r.current===0)&&(o.current=g)},[o,r,a,s]);return Ct("div",t,{ref:[d,n,i],props:f})})),zne=A.forwardRef(function(t,n){const{render:r,className:i,direction:a,keepMounted:s=!1,...o}=t,{store:l,popupRef:u,listRef:f,handleScrollArrowVisibility:d,scrollArrowsMountedCountRef:m}=zl(),{side:g,scrollDownArrowRef:x,scrollUpArrowRef:_}=a3(),b=a==="up"?Qt.scrollUpArrowVisible:Qt.scrollDownArrowVisible,y=Qe(l,b),v=Qe(l,Qt.openMethod),S=y&&v!=="touch",T=zn(),w=a==="up"?_:x,{transitionStatus:C,setMounted:R}=go(S);nt(()=>(m.current+=1,l.state.hasScrollArrows||l.set("hasScrollArrows",!0),()=>{m.current=Math.max(0,m.current-1),m.current===0&&l.state.hasScrollArrows&&l.set("hasScrollArrows",!1)}),[l,m]),Li({open:S,ref:w,onComplete(){S||R(!1)}});const O=A.useMemo(()=>({direction:a,visible:S,side:g,transitionStatus:C}),[a,S,g,C]),D=Ct("div",t,{ref:[n,w],state:O,props:[{"aria-hidden":!0,children:a==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(z){if(z.movementX===0&&z.movementY===0||T.isStarted())return;l.set("activeIndex",null);function P(){const q=l.state.listElement??u.current;if(!q)return;l.set("activeIndex",null),d();const H=q.scrollTop===0,F=Math.round(q.scrollTop+q.clientHeight)>=q.scrollHeight;if(f.current.length===0&&(a==="up"?l.set("scrollUpArrowVisible",!H):l.set("scrollDownArrowVisible",!F)),a==="up"&&H||a==="down"&&F){T.clear();return}if((l.state.listElement||u.current)&&f.current&&f.current.length>0){const V=f.current,B=w.current?.offsetHeight||0;if(a==="up"){let j=0;const $=q.scrollTop+B;for(let W=0;W<V.length;W+=1){const ee=V[W];if(ee&&ee.offsetTop>=$){j=W;break}}const Y=Math.max(0,j-1);if(Y<j){const W=V[Y];W&&(q.scrollTop=Math.max(0,W.offsetTop-B))}else q.scrollTop=0}else{let j=V.length-1;const $=q.scrollTop+q.clientHeight-B;for(let W=0;W<V.length;W+=1){const ee=V[W];if(ee&&ee.offsetTop+ee.offsetHeight>$){j=Math.max(0,W-1);break}}const Y=Math.min(V.length-1,j+1);if(Y>j){const W=V[Y];W&&(q.scrollTop=W.offsetTop+W.offsetHeight-q.clientHeight+B)}else q.scrollTop=q.scrollHeight-q.clientHeight}}T.start(40,P)}T.start(40,P)},onMouseLeave(){T.clear()}},o]});return S||s?D:null}),KEe=A.forwardRef(function(t,n){return p.jsx(zne,{...t,ref:n,direction:"down"})}),YEe=A.forwardRef(function(t,n){return p.jsx(zne,{...t,ref:n,direction:"up"})}),Gi=REe;function Ki({className:e,...t}){return p.jsx(LEe,{"data-slot":"select-value",className:Ue("flex flex-1 text-left",e),...t})}function Yi({className:e,size:t="default",children:n,...r}){return p.jsxs(IEe,{"data-slot":"select-trigger","data-size":t,className:Ue("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,p.jsx(PEe,{render:p.jsx(se,{icon:pne,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Xi({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:a=0,alignItemWithTrigger:s=!0,...o}){return p.jsx(jEe,{children:p.jsx(BEe,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:s,className:"isolate z-50",children:p.jsxs(zEe,{"data-slot":"select-content",className:Ue("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...o,children:[p.jsx(XEe,{}),p.jsx(HEe,{children:t}),p.jsx(ZEe,{})]})})})}function wn({className:e,children:t,...n}){return p.jsxs(WEe,{"data-slot":"select-item",className:Ue("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[p.jsx(GEe,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),p.jsx(VEe,{render:p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:p.jsx(se,{icon:Lr,strokeWidth:2,className:"pointer-events-none"})})]})}function XEe({className:e,...t}){return p.jsx(YEe,{"data-slot":"select-scroll-up-button",className:Ue("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:p.jsx(se,{icon:KM,strokeWidth:2})})}function ZEe({className:e,...t}){return p.jsx(KEe,{"data-slot":"select-scroll-down-button",className:Ue("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:p.jsx(se,{icon:A0,strokeWidth:2})})}const Hne=A.createContext(void 0);function l3(){const e=A.useContext(Hne);if(e===void 0)throw new Error(on(64));return e}let QEe=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const u3={tabActivationDirection:e=>({[QEe.activationDirection]:e})},JEe=A.forwardRef(function(t,n){const{className:r,defaultValue:i=0,onValueChange:a,orientation:s="horizontal",render:o,value:l,...u}=t,f=ec(),d=Object.hasOwn(t,"defaultValue"),m=A.useRef([]),[g,x]=A.useState(()=>new Map),[_,b]=Wa({controlled:l,default:i,name:"Tabs",state:"value"}),y=l!==void 0,[v,S]=A.useState(()=>new Map),[T,w]=A.useState("none"),C=Ye((G,V)=>{a?.(G,V),!V.isCanceled&&(b(G),w(V.activationDirection))}),R=Ye((G,V)=>{x(B=>{if(B.get(G)===V)return B;const j=new Map(B);return j.set(G,V),j})}),O=Ye((G,V)=>{x(B=>{if(!B.has(G)||B.get(G)!==V)return B;const j=new Map(B);return j.delete(G),j})}),N=A.useCallback(G=>g.get(G),[g]),D=A.useCallback(G=>{for(const V of v.values())if(G===V?.value)return V?.id},[v]),L=A.useCallback(G=>{if(G===void 0)return null;for(const[V,B]of v.entries())if(B!=null&&G===(B.value??B.index))return V;return null},[v]),z=A.useMemo(()=>({direction:f,getTabElementBySelectedValue:L,getTabIdByPanelValue:D,getTabPanelIdByValue:N,onValueChange:C,orientation:s,registerMountedTabPanel:R,setTabMap:S,unregisterMountedTabPanel:O,tabActivationDirection:T,value:_}),[f,L,D,N,C,s,R,S,O,T,_]),P=A.useMemo(()=>{for(const G of v.values())if(G!=null&&G.value===_)return G},[v,_]),q=A.useMemo(()=>{for(const G of v.values())if(G!=null&&!G.disabled)return G.value},[v]);nt(()=>{if(y||v.size===0)return;const G=P?.disabled,V=P==null&&_!==null;if(d&&G&&_===i||!G&&!V)return;const j=q??null;_!==j&&(b(j),w("none"))},[i,q,d,y,P,w,b,v,_]);const F=Ct("div",t,{state:{orientation:s,tabActivationDirection:T},ref:n,props:u,stateAttributesMapping:u3});return p.jsx(Hne.Provider,{value:z,children:p.jsx(_0,{elementsRef:m,children:F})})}),Wne=A.createContext(void 0);function eSe(){const e=A.useContext(Wne);if(e===void 0)throw new Error(on(65));return e}const tSe=A.forwardRef(function(t,n){const{className:r,disabled:i=!1,render:a,value:s,id:o,nativeButton:l=!0,...u}=t,{value:f,getTabPanelIdByValue:d,orientation:m}=l3(),{activateOnFocus:g,highlightedTabIndex:x,onTabActivation:_,setHighlightedTabIndex:b,tabsListElement:y}=eSe(),v=ui(o),S=A.useMemo(()=>({disabled:i,id:v,value:s}),[i,v,s]),{compositeProps:T,compositeRef:w,index:C}=Qte({metadata:S}),R=s===f,O=A.useRef(!1);nt(()=>{if(O.current){O.current=!1;return}if(!(R&&C>-1&&x!==C))return;const B=y;if(B!=null){const j=ro(Zi(B));if(j&&Rt(B,j))return}i||b(C)},[R,C,x,b,i,y]);const{getButtonProps:N,buttonRef:D}=ua({disabled:i,native:l,focusableWhenDisabled:!0}),L=d(s),z=A.useRef(!1),P=A.useRef(!1);function q(B){R||i||_(s,lt(Vr,B.nativeEvent,void 0,{activationDirection:"none"}))}function H(B){R||(C>-1&&!i&&b(C),!i&&g&&(!z.current||z.current&&P.current)&&_(s,lt(Vr,B.nativeEvent,void 0,{activationDirection:"none"})))}function F(B){if(R||i)return;z.current=!0;function j(){z.current=!1,P.current=!1}(!B.button||B.button===0)&&(P.current=!0,Zi(B.currentTarget).addEventListener("pointerup",j,{once:!0}))}const G=A.useMemo(()=>({disabled:i,active:R,orientation:m}),[i,R,m]);return Ct("button",t,{state:G,ref:[n,D,w],props:[T,{role:"tab","aria-controls":L,"aria-selected":R,id:v,onClick:q,onFocus:H,onPointerDown:F,[VM]:R?"":void 0,onKeyDownCapture(){O.current=!0}},u,N]})});let nSe=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const rSe=A.forwardRef(function(t,n){const{className:r,value:i,render:a,keepMounted:s=!1,...o}=t,{value:l,getTabIdByPanelValue:u,orientation:f,tabActivationDirection:d,registerMountedTabPanel:m,unregisterMountedTabPanel:g}=l3(),x=ui(),_=A.useMemo(()=>({id:x,value:i}),[x,i]),{ref:b,index:y}=ug({metadata:_}),v=i!==l,S=u(i),T=A.useMemo(()=>({hidden:v,orientation:f,tabActivationDirection:d}),[v,f,d]),w=Ct("div",t,{state:T,ref:[n,b],props:[{"aria-labelledby":S,hidden:v,id:x??void 0,role:"tabpanel",tabIndex:v?-1:0,[nSe.index]:y},o],stateAttributesMapping:u3});return nt(()=>{if(!(v&&!s)&&x!=null)return m(i,x),()=>{g(i,x)}},[v,s,i,x,m,g]),!v||s?w:null}),iSe=A.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:s,...o}=t,{getTabElementBySelectedValue:l,onValueChange:u,orientation:f,value:d,setTabMap:m,tabActivationDirection:g}=l3(),[x,_]=A.useState(0),[b,y]=A.useState(null),v=aSe(d,f,b,l),S=Ye((R,O)=>{if(R!==d){const N=v(R);O.activationDirection=N,u(R,O)}}),T=A.useMemo(()=>({orientation:f,tabActivationDirection:g}),[f,g]),w={"aria-orientation":f==="vertical"?"vertical":void 0,role:"tablist"},C=A.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:x,onTabActivation:S,setHighlightedTabIndex:_,tabsListElement:b,value:d}),[r,x,S,_,b,d]);return p.jsx(Wne.Provider,{value:C,children:p.jsx(w0,{render:s,className:i,state:T,refs:[n,y],props:[w,o],stateAttributesMapping:u3,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:a,orientation:f,onHighlightedIndexChange:_,onMapChange:m,disabledIndices:ya})})});function tH(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),s=n-i,o=r-a;return{left:s,top:o}}function aSe(e,t,n,r){const[i,a]=A.useState(null);return nt(()=>{if(e==null||n==null){a(null);return}const s=r(e);if(s==null){a(null);return}const{left:o,top:l}=tH(s,n);a(t==="horizontal"?o:l)},[t,r,n,e]),A.useCallback(s=>{if(s===e)return"none";if(s==null)return a(null),"none";if(s!=null&&n!=null){const o=r(s);if(o!=null){const{left:l,top:u}=tH(o,n);if(i==null)return a(t==="horizontal"?l:u),"none";if(t==="horizontal"){if(l<i)return a(l),"left";if(l>i)return a(l),"right"}else{if(u<i)return a(u),"up";if(u>i)return a(u),"down"}}}return"none"},[r,t,i,n,e])}function Mo({className:e,orientation:t="horizontal",...n}){return p.jsx(JEe,{"data-slot":"tabs","data-orientation":t,className:Ue("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const sSe=Cd("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function jo({className:e,variant:t="default",...n}){return p.jsx(iSe,{"data-slot":"tabs-list","data-variant":t,className:Ue(sSe({variant:t}),e),...n})}function _r({className:e,...t}){return p.jsx(tSe,{"data-slot":"tabs-trigger",className:Ue("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Pr({className:e,...t}){return p.jsx(rSe,{"data-slot":"tabs-content",className:Ue("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function oSe(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:s,handle:o,triggerId:l,defaultTriggerId:u=null}=e,f=tc(),d=!!f,m=Di(()=>o?.store??new Sne({open:n??r,activeTriggerId:l!==void 0?l:u,modal:!0,disablePointerDismissal:!0,nested:d,role:"alertdialog"})).current;m.useControlledProp("open",n,r),m.useControlledProp("activeTriggerId",l,u),m.useSyncedValue("nested",d),m.useContextCallback("onOpenChange",i),m.useContextCallback("onOpenChangeComplete",a);const g=m.useState("payload");Ene({store:m,actionsRef:s,parentContext:f?.store.context});const x=A.useMemo(()=>({store:m}),[m]);return p.jsx(r3.Provider,{value:x,children:typeof t=="function"?t({payload:g}):t})}const Vne=A.createContext(void 0),qne=A.createContext(void 0),Gne=A.createContext(void 0),Kne=A.createContext("");function rc(){const e=A.useContext(Vne);if(!e)throw new Error(on(22));return e}function Ow(){const e=A.useContext(qne);if(!e)throw new Error(on(23));return e}function gp(){const e=A.useContext(Gne);if(!e)throw new Error(on(24));return e}function c3(){return A.useContext(Kne)}const bt={id:He(e=>e.id),query:He(e=>e.query),items:He(e=>e.items),selectedValue:He(e=>e.selectedValue),open:He(e=>e.open),mounted:He(e=>e.mounted),forceMounted:He(e=>e.forceMounted),inline:He(e=>e.inline),activeIndex:He(e=>e.activeIndex),selectedIndex:He(e=>e.selectedIndex),isActive:He((e,t)=>e.activeIndex===t),isSelected:He((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(i=>zu(i,t,n)):zu(r,t,n)}),transitionStatus:He(e=>e.transitionStatus),popupProps:He(e=>e.popupProps),inputProps:He(e=>e.inputProps),triggerProps:He(e=>e.triggerProps),getItemProps:He(e=>e.getItemProps),positionerElement:He(e=>e.positionerElement),listElement:He(e=>e.listElement),triggerElement:He(e=>e.triggerElement),inputElement:He(e=>e.inputElement),popupSide:He(e=>e.popupSide),openMethod:He(e=>e.openMethod),inputInsidePopup:He(e=>e.inputInsidePopup),selectionMode:He(e=>e.selectionMode),listRef:He(e=>e.listRef),labelsRef:He(e=>e.labelsRef),popupRef:He(e=>e.popupRef),emptyRef:He(e=>e.emptyRef),inputRef:He(e=>e.inputRef),keyboardActiveRef:He(e=>e.keyboardActiveRef),chipsContainerRef:He(e=>e.chipsContainerRef),clearRef:He(e=>e.clearRef),valuesRef:He(e=>e.valuesRef),allValuesRef:He(e=>e.allValuesRef),name:He(e=>e.name),disabled:He(e=>e.disabled),readOnly:He(e=>e.readOnly),required:He(e=>e.required),grid:He(e=>e.grid),isGrouped:He(e=>e.isGrouped),virtualized:He(e=>e.virtualized),onOpenChangeComplete:He(e=>e.onOpenChangeComplete),openOnInputClick:He(e=>e.openOnInputClick),itemToStringLabel:He(e=>e.itemToStringLabel),isItemEqualToValue:He(e=>e.isItemEqualToValue),modal:He(e=>e.modal),autoHighlight:He(e=>e.autoHighlight),submitOnItemClick:He(e=>e.submitOnItemClick)};function lSe(e,t){return(n,r)=>{if(n==null)return!1;const i=mi(n,t);return e.contains(i,r)}}function uSe(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;const a=mi(r,t),s=n!=null?mi(n,t):"";return s&&e.contains(s,i)&&s.length===i.length?!0:e.contains(a,i)}}const nH=new Map;function Yne(e){return Array.isArray(e)?e.map(t=>Yne(t)).join(","):e==null?"":String(e)}function cSe(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Yne(e.locale)}|${JSON.stringify(t)}`,r=nH.get(n);if(r)return r;const i=new Intl.Collator(e.locale,t),a={contains(s,o,l){if(!o)return!0;const u=mi(s,l);for(let f=0;f<=u.length-o.length;f+=1)if(i.compare(u.slice(f,f+o.length),o)===0)return!0;return!1},startsWith(s,o,l){if(!o)return!0;const u=mi(s,l);return i.compare(u.slice(0,o.length),o)===0},endsWith(s,o,l){if(!o)return!0;const u=mi(s,l),f=o.length;return u.length>=f&&i.compare(u.slice(u.length-f),o)===0}};return nH.set(n,a),a}const dSe=cSe,Xne=Symbol("none"),sf={value:Xne,index:-1};function fSe(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:s,inputValue:o,selectionMode:l="none",onItemHighlighted:u,name:f,disabled:d=!1,readOnly:m=!1,required:g=!1,inputRef:x,grid:_=!1,items:b,filteredItems:y,filter:v,openOnInputClick:S=!0,autoHighlight:T=!1,keepHighlight:w=!1,highlightItemOnHover:C=!0,itemToStringLabel:R,itemToStringValue:O,isItemEqualToValue:N=Pne,virtualized:D=!1,inline:L=!1,fillInputOnItemPress:z=!0,modal:P=!1,limit:q=-1,autoComplete:H="list",locale:F,submitOnItemClick:G=!1}=e,{clearErrors:V}=fg(),{setDirty:B,validityData:j,shouldValidateOnChange:$,setFilled:Y,name:W,disabled:ee,validation:oe}=Ka(),ae=k0({id:t}),Z=dSe({locale:F}),[K,Q]=A.useState(!1),[te,ne]=A.useState(null),J=A.useRef([]),ve=A.useRef([]),ge=A.useRef(null),fe=A.useRef(null),Ee=A.useRef(null),_e=A.useRef(!0),Ve=A.useRef(!1),Ce=A.useRef(null),Me=A.useRef(null),Ae=A.useRef(null),pe=A.useRef(sf),de=A.useRef(null),ke=A.useRef([]),De=A.useRef([]),me=ee||d,ye=W??f,xe=l==="multiple",je=l==="single",Ge=o!==void 0||s!==void 0,gt=b!==void 0,at=y!==void 0;let ut;T==="always"?ut="always":ut=T?"input-change":!1;const[$e,pt]=Wa({controlled:i,default:xe?r??ya:r,name:"Combobox",state:"selectedValue"}),Se=A.useMemo(()=>v===null?()=>!0:v!==void 0?v:je&&!K?uSe(Z,R,$e):lSe(Z,R),[v,je,$e,K,Z,R]),Be=Di(()=>Ge?s??"":je?mi($e,R):"").current,[Je,ct]=Wa({controlled:o,default:Be,name:"Combobox",state:"inputValue"}),[ht,mn]=Wa({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),Bt=jne(b),Mt=te??(Je===""?"":String(Je).trim()),dt=je?mi($e,R):"",rn=je&&!K&&Mt!==""&&dt!==""&&dt.length===Mt.length&&Z.contains(dt,Mt),Ut=rn?"":Mt,_t=gt&&at&&rn,Yt=A.useMemo(()=>b?Bt?b.flatMap(mt=>mt.items):b:ya,[b,Bt]),Vt=A.useMemo(()=>{if(y&&!_t)return y;if(!b)return ya;if(Bt){const Pt=b,tn=[];let ir=0;for(const Dr of Pt){if(q>-1&&ir>=q)break;const Qr=Ut===""?Dr.items:Dr.items.filter(tu=>Se(tu,Ut,R));if(Qr.length===0)continue;const Jl=q>-1?q-ir:1/0,eu=Qr.slice(0,Jl);if(eu.length>0){const tu={...Dr,items:eu};tn.push(tu),ir+=eu.length}}return tn}if(Ut==="")return q>-1?Yt.slice(0,q):Yt;const mt=[];for(const Pt of Yt){if(q>-1&&mt.length>=q)break;Se(Pt,Ut,R)&&mt.push(Pt)}return mt},[y,_t,b,Bt,Ut,q,Se,R,Yt]),Pe=A.useMemo(()=>Bt?Vt.flatMap(Pt=>Pt.items):Vt,[Vt,Bt]),tt=Di(()=>new jf({id:ae,selectedValue:$e,open:ht,filter:Se,query:Mt,items:b,selectionMode:l,listRef:J,labelsRef:ve,popupRef:ge,emptyRef:Ee,inputRef:fe,keyboardActiveRef:_e,chipsContainerRef:Ce,clearRef:Me,valuesRef:ke,allValuesRef:De,selectionEventRef:Ae,name:ye,disabled:me,readOnly:m,required:g,grid:_,isGrouped:Bt,virtualized:D,openOnInputClick:S,itemToStringLabel:R,isItemEqualToValue:N,modal:P,autoHighlight:ut,submitOnItemClick:G,hasInputValue:Ge,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:L,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Vn,setOpen:Vn,setInputValue:Vn,setSelectedValue:Vn,setIndices:Vn,onItemHighlighted:Vn,handleSelection:Vn,getItemProps:()=>Jn,forceMount:Vn,requestSubmit:Vn})).current,vt=l==="none"?Je:$e,Nn=A.useMemo(()=>l==="none"?vt:Array.isArray($e)?$e.map(mt=>No(mt,O)):No($e,O),[vt,O,l,$e]),On=Ye(u),Xn=Ye(n),rr=Qe(tt,bt.activeIndex),Zl=Qe(tt,bt.selectedIndex),Ei=Qe(tt,bt.positionerElement),Or=Qe(tt,bt.listElement),hr=Qe(tt,bt.triggerElement),rs=Qe(tt,bt.inputElement),ji=Qe(tt,bt.inline),is=Qe(tt,bt.inputInsidePopup),Mp=Er(hr),{mounted:Ql,setMounted:nl,transitionStatus:rl}=go(ht),{openMethod:Oa,triggerProps:qt,reset:il}=Aw(ht);pg({id:ae,name:ye,commit:oe.commit,value:vt,controlRef:is?Mp:fe,getValue:()=>Nn});const Ra=Ye(()=>{b?ve.current=Pe.map(mt=>mi(mt,R)):tt.set("forceMounted",!0)}),Rr=A.useRef($e);nt(()=>{$e!==Rr.current&&Ra()},[Ra,$e]);const Si=Ye(mt=>{tt.update(mt);const Pt=mt.type||"none";if(mt.activeIndex!==void 0)if(mt.activeIndex===null)pe.current!==sf&&(pe.current=sf,On(void 0,zb(Pt,void 0,{index:-1})));else{const tn=ke.current[mt.activeIndex];pe.current={value:tn,index:mt.activeIndex},On(tn,zb(Pt,void 0,{index:mt.activeIndex}))}}),Fi=Ye((mt,Pt)=>{if(Ve.current=Pt.reason===Vc,e.onInputValueChange?.(mt,Pt),!Pt.isCanceled){if(Pt.reason===_f){const tn=mt.trim()!=="";tn&&Q(!0),de.current={hasQuery:tn},tn&&ut&&tt.state.activeIndex==null&&tt.set("activeIndex",0)}ct(mt)}}),pa=Ye((mt,Pt)=>{ht!==mt&&(Pt.reason==="escape-key"&&gt&&Pe.length===0&&!tt.state.emptyRef.current&&Pt.allowPropagation(),e.onOpenChange?.(mt,Pt),!Pt.isCanceled&&(!mt&&K&&(je?(ne(Mt),Mt===""&&Q(!1)):xe&&(ji||is?Si({activeIndex:null}):ne(Mt),Fi("",lt(Vc,Pt.event)))),mn(mt)))}),as=Ye((mt,Pt)=>{if(a?.(mt,Pt),Pt.isCanceled)return;pt(mt),(l==="none"&&ge.current&&z||je&&!tt.state.inputInsidePopup)&&Fi(mi(mt,R),lt(Pt.reason,Pt.event)),je&&mt!=null&&Pt.reason!==_f&&K&&ne(Mt)}),Hg=Ye((mt,Pt)=>{let tn=Pt;if(tn===void 0){if(rr===null)return;tn=ke.current[rr]}const ir=Mr(mt),Dr=Ae.current??mt;Ae.current=null;const Qr=lt(Pf,Dr),Jl=ir?.closest("a")?.getAttribute("href");if(Jl){Jl.startsWith("#")&&pa(!1,Qr);return}if(xe){const eu=Array.isArray($e)?$e:[],_o=wf(eu,tn,tt.state.isItemEqualToValue)?Mne(eu,tn,tt.state.isItemEqualToValue):[...eu,tn];if(as(_o,Qr),!(fe.current?fe.current.value.trim()!=="":!1))return;tt.state.inputInsidePopup?Fi("",lt(Vc,Qr.event)):pa(!1,Qr)}else as(tn,Qr),pa(!1,Qr)}),dc=Ye(()=>{if(!tt.state.submitOnItemClick)return;const mt=tt.state.inputElement?.form;mt&&typeof mt.requestSubmit=="function"&&mt.requestSubmit()}),fc=Ye(()=>{if(nl(!1),Xn?.(!1),Q(!1),il(),ne(null),Si(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),xe&&fe.current&&fe.current.value!==""&&!Ve.current&&Fi("",lt(Vc)),je)if(tt.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Fi("",lt(Vc));else{const mt=mi($e,R);fe.current&&fe.current.value!==mt&&Fi(mt,lt(mt===""?Vc:Vr))}}),Wg=A.useMemo(()=>ji&&Ei?{current:Ei.closest('[role="dialog"]')}:ge,[ji,Ei]);Li({enabled:!e.actionsRef,open:ht,ref:Wg,onComplete(){ht||fc()}}),A.useImperativeHandle(e.actionsRef,()=>({unmount:fc}),[fc]),nt(function(){if(ht||l==="none")return;const Pt=b?Yt:De.current;if(xe){const tn=Array.isArray($e)?$e:[],ir=tn[tn.length-1],Dr=gm(Pt,ir,N);Si({selectedIndex:Dr===-1?null:Dr})}else{const tn=gm(Pt,$e,N);Si({selectedIndex:tn===-1?null:tn})}},[ht,$e,b,l,Yt,xe,N,Si]),nt(()=>{b&&(ke.current=Pe,J.current.length=Pe.length)},[b,Pe]),nt(()=>{const mt=de.current;if(mt&&(mt.hasQuery?ut&&tt.set("activeIndex",0):ut==="always"&&tt.set("activeIndex",0),de.current=null),!ht&&!ji)return;const tn=gt||at?Pe:ke.current,ir=tt.state.activeIndex;if(ir==null){if(ut==="always"&&tn.length>0){tt.set("activeIndex",0);return}pe.current!==sf&&(pe.current=sf,tt.state.onItemHighlighted(void 0,zb(Vr,void 0,{index:-1})));return}if(ir>=tn.length){pe.current!==sf&&(pe.current=sf,tt.state.onItemHighlighted(void 0,zb(Vr,void 0,{index:-1}))),tt.set("activeIndex",null);return}const Dr=tn[ir],Qr=pe.current.value,Jl=Qr!==Xne&&tt.state.isItemEqualToValue(Dr,Qr);(pe.current.index!==ir||!Jl)&&(pe.current={value:Dr,index:ir},tt.state.onItemHighlighted(Dr,zb(Vr,void 0,{index:ir})))},[rr,ut,at,gt,Pe,ji,ht,tt]),nt(()=>{if(!b||l==="none")return;const mt=Yt;if(xe){const ir=Array.isArray($e)?$e:ya,Dr=ir.filter(Qr=>wf(mt,Qr,tt.state.isItemEqualToValue));Dr.length!==ir.length&&pt(Dr);return}if($e==null?!0:wf(mt,$e,tt.state.isItemEqualToValue))return;let tn=null;if(r!=null&&wf(mt,r,tt.state.isItemEqualToValue)&&(tn=r),pt(tn),!tt.state.inputInsidePopup){const ir=mi(tn,R);fe.current&&fe.current.value!==ir&&Fi(ir,lt(Vr))}},[b,Yt,xe,l,$e,r,pt,R,tt,Fi]),nt(()=>{if(l==="none"){Y(String(Je)!=="");return}Y(xe?Array.isArray($e)&&$e.length>0:$e!=null)},[Y,l,Je,$e,xe]),A.useEffect(()=>{gt&&ut&&Pe.length===0&&Si({activeIndex:null})},[gt,ut,Pe.length,Si]),Jc(Mt,()=>{!ht||Mt===""||Mt===String(Be)||Q(!0)}),Jc($e,()=>{if(l!=="none"&&(V(ye),B($e!==j.initialValue),$()?oe.commit($e):oe.commit($e,!0),xe&&tt.state.selectedIndex!==null&&(!Array.isArray($e)||$e.length===0)&&Si({activeIndex:null,selectedIndex:null}),je&&!Ge&&!is)){const mt=mi($e,R);Je!==mt&&Fi(mt,lt(Vr))}}),Jc(Je,()=>{l==="none"&&(V(ye),B(Je!==j.initialValue),$()?oe.commit(Je):oe.commit(Je,!0))}),Jc(b,()=>{if(!je||Ge||is||K)return;const mt=mi($e,R);Je!==mt&&Fi(mt,lt(Vr))});const xo=bw({open:ji?!0:ht,onOpenChange:pa,elements:{reference:is?hr:rs,floating:Ei}});let al,ha;ji||(al=_?"grid":"listbox",ha=ht?"true":"false");const ci=A.useMemo(()=>{const mt=rs?.tagName==="INPUT",Pt=mt||ht,tn=mt?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Pt&&(tn.role="combobox",tn["aria-expanded"]=ha,tn["aria-haspopup"]=al,tn["aria-controls"]=ht?Or?.id:void 0,tn["aria-autocomplete"]=H),{reference:tn,floating:{role:"presentation"}}},[rs,ht,ha,al,Or?.id,H]),jp=sg(xo,{enabled:!m&&!me&&S,event:"mousedown-only",toggle:!1,touchOpenDelay:is?0:50}),Vg=og(xo,{enabled:!m&&!me&&!ji,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:ji?!0:void 0,outsidePress(mt){const Pt=Mr(mt);return!Rt(hr,Pt)&&!Rt(Me.current,Pt)&&!Rt(Ce.current,Pt)}}),Xe=$M(xo,{enabled:!m&&!me,id:ae,listRef:J,activeIndex:rr,selectedIndex:Zl,virtual:!0,loopFocus:!0,allowEscape:!ut,focusItemOnOpen:K||l==="none"&&!ut?!1:"auto",focusItemOnHover:C,resetOnPointerLeave:!w,cols:_?2:1,orientation:_?"horizontal":void 0,disabledIndices:ya,onNavigate(mt,Pt){!Pt&&!ht||rl==="ending"||Si(Pt?{activeIndex:mt,type:_e.current?"keyboard":"pointer"}:{activeIndex:mt})}}),{getReferenceProps:zt,getFloatingProps:Nr,getItemProps:wi}=Od([ci,jp,Vg,Xe]);Nne(()=>{tt.update({inline:L,popupProps:Nr(),inputProps:zt(),triggerProps:qt,getItemProps:wi,setOpen:pa,setInputValue:Fi,setSelectedValue:as,setIndices:Si,onItemHighlighted:On,handleSelection:Hg,forceMount:Ra,requestSubmit:dc})}),nt(()=>{tt.update({id:ae,selectedValue:$e,open:ht,mounted:Ql,transitionStatus:rl,items:b,inline:L,popupProps:Nr(),inputProps:zt(),triggerProps:qt,openMethod:Oa,getItemProps:wi,selectionMode:l,name:ye,disabled:me,readOnly:m,required:g,grid:_,isGrouped:Bt,virtualized:D,onOpenChangeComplete:Xn,openOnInputClick:S,itemToStringLabel:R,modal:P,autoHighlight:ut,isItemEqualToValue:N,submitOnItemClick:G,hasInputValue:Ge,requestSubmit:dc})},[tt,ae,$e,ht,Ql,rl,b,Nr,zt,wi,Oa,qt,l,ye,me,m,g,oe,_,Bt,D,Xn,S,R,P,N,G,Ge,L,dc,ut]);const Ir=Ga(x,oe.inputRef),Fp=A.useMemo(()=>({query:Mt,filteredItems:Vt,flatFilteredItems:Pe}),[Mt,Vt,Pe]),b1=A.useMemo(()=>Array.isArray(vt)?"":No(vt,O),[vt,O]),qg=xe&&Array.isArray($e)&&$e.length>0,pc=A.useMemo(()=>!xe||!Array.isArray($e)||!ye?null:$e.map(mt=>{const Pt=No(mt,O);return p.jsx("input",{type:"hidden",name:ye,value:Pt},Pt)}),[xe,$e,ye,O]),v1=p.jsxs(A.Fragment,{children:[e.children,p.jsx("input",{...oe.getInputValidationProps({onFocus(){if(is){hr?.focus();return}(fe.current||hr)?.focus()},onChange(mt){if(mt.nativeEvent.defaultPrevented)return;const Pt=mt.target.value,tn=lt(_f,mt.nativeEvent);function ir(){if(xe)return;if(l==="none"){B(Pt!==j.initialValue),Fi(Pt,tn),$()&&oe.commit(Pt);return}const Dr=ke.current.find(Qr=>No(Qr,O).toLowerCase()===Pt.toLowerCase());Dr!=null&&(B(Dr!==j.initialValue),as?.(Dr,tn),$()&&oe.commit(Dr))}b?ir():(Ra(),queueMicrotask(ir))}}),id:ae,name:xe||l==="none"?void 0:ye,disabled:me,required:g&&!qg,readOnly:m,value:b1,ref:Ir,style:kd,tabIndex:-1,"aria-hidden":!0}),pc]});return p.jsx(Vne.Provider,{value:tt,children:p.jsx(qne.Provider,{value:xo,children:p.jsx(Gne.Provider,{value:Fp,children:p.jsx(Kne.Provider,{value:Je,children:v1})})})})}const Zx=2,pSe={...dm,...nc},hSe=A.forwardRef(function(t,n){const{render:r,className:i,nativeButton:a=!0,disabled:s=!1,...o}=t,{state:l,disabled:u,setTouched:f,setFocused:d,validationMode:m,validation:g}=Ka(),{labelId:x}=$l(),_=rc(),b=Qe(_,bt.selectionMode),y=Qe(_,bt.disabled),v=Qe(_,bt.readOnly),S=Qe(_,bt.listElement),T=Qe(_,bt.triggerProps),w=Qe(_,bt.triggerElement),C=Qe(_,bt.inputInsidePopup),R=Qe(_,bt.open),O=Qe(_,bt.selectedValue),N=Qe(_,bt.activeIndex),D=Qe(_,bt.selectedIndex),L=Ow(),z=c3(),P=zn(),q=u||y||s,H=A.useRef("");function F(oe){H.current=oe.pointerType}const G=L.select("domReferenceElement");A.useEffect(()=>{C&&w&&w!==G&&L.set("domReferenceElement",w)},[w,G,L,C]);const{reference:V}=zM(L,{enabled:!R&&!v&&!y&&b==="single",listRef:_.state.labelsRef,activeIndex:N,selectedIndex:D,onMatch(oe){const ae=_.state.valuesRef.current[oe];ae!==void 0&&_.state.setSelectedValue(ae,lt("none"))}}),{reference:B}=sg(L,{enabled:!v&&!y,event:"mousedown"}),{buttonRef:j,getButtonProps:$}=ua({native:a,disabled:q}),Y=A.useMemo(()=>({...l,open:R,disabled:q}),[l,R,q]),W=Ye(oe=>{_.set("triggerElement",oe)});return Ct("button",t,{ref:[n,j,W],state:Y,props:[T,B,V,{tabIndex:C?0:-1,disabled:q,role:C?"combobox":void 0,"aria-expanded":R?"true":"false","aria-haspopup":C?"dialog":"listbox","aria-controls":R?S?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":x,onPointerDown:F,onPointerEnter:F,onFocus(){d(!0),!(q||v)&&P.start(0,_.state.forceMount)},onBlur(){if(f(!0),d(!1),m==="onBlur"){const oe=b==="none"?z:O;g.commit(oe)}},onMouseDown(oe){if(q||v||(C||L.set("domReferenceElement",oe.currentTarget),_.state.forceMount(),H.current!=="touch"&&(_.state.inputRef.current?.focus(),C||oe.preventDefault()),R))return;const ae=Zi(oe.currentTarget);function Z(K){if(!w)return;const Q=Mr(K),te=_.state.positionerElement,ne=_.state.listElement;if(Rt(w,Q)||Rt(te,Q)||Rt(ne,Q)||Q===w)return;const J=i3(w),ve=K.clientX>=J.left-Zx&&K.clientX<=J.right+Zx,ge=K.clientY>=J.top-Zx&&K.clientY<=J.bottom+Zx;ve&&ge||_.state.setOpen(!1,lt("cancel-open",K))}C&&ae.addEventListener("mouseup",Z,{once:!0})},onKeyDown(oe){q||v||(oe.key==="ArrowDown"||oe.key==="ArrowUp")&&(Wr(oe),_.state.setOpen(!0,lt(Hh,oe.nativeEvent)),_.state.inputRef.current?.focus())}},g?g.getValidationProps(o):o,$],stateAttributesMapping:pSe})}),mSe=A.createContext(void 0);function gSe(){return A.useContext(mSe)}const Zne=A.createContext(void 0);function d3(e){const t=A.useContext(Zne);if(t===void 0&&!e)throw new Error(on(21));return t}const bSe={...dm,...nc,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},vSe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,id:s,...o}=t,{state:l,disabled:u,setTouched:f,setFocused:d,validationMode:m,validation:g}=Ka(),{labelId:x}=$l(),_=gSe(),y=!!d3(!0),v=rc(),{filteredItems:S}=gp(),T=c3(),w=ui(s),C=ec(),R=Qe(v,bt.disabled),O=Qe(v,bt.readOnly),N=Qe(v,bt.name),D=Qe(v,bt.selectionMode),L=Qe(v,bt.autoHighlight),z=Qe(v,bt.inputProps),P=Qe(v,bt.triggerProps),q=Qe(v,bt.open),H=Qe(v,bt.mounted),F=Qe(v,bt.selectedValue),G=Qe(v,bt.popupSide),V=Qe(v,bt.positionerElement),B=!!L,j=H&&V?G:null,$=u||R||a,Y=S.length===0,[W,ee]=A.useState(null),oe=A.useRef(!1),ae=Ye(te=>{const ne=y||v.state.inline;ne&&!v.state.hasInputValue&&v.state.setInputValue("",lt(Vr)),v.update({inputElement:te,inputInsidePopup:ne})}),Z=A.useMemo(()=>({...l,open:q,disabled:$,readOnly:O,popupSide:j,listEmpty:Y}),[l,q,$,O,j,Y]);function K(te){if(!_)return;let ne;const{highlightedChipIndex:J}=_;if(J!==void 0){if(te.key==="ArrowLeft")te.preventDefault(),J>0?ne=J-1:ne=void 0;else if(te.key==="ArrowRight")te.preventDefault(),J<F.length-1?ne=J+1:ne=void 0;else if(te.key==="Backspace"||te.key==="Delete"){te.preventDefault();const ve=J>=F.length-1?F.length-2:J;ne=ve>=0?ve:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return ne}return te.key==="ArrowLeft"&&(te.currentTarget.selectionStart??0)===0&&F.length>0?(te.preventDefault(),ne=Math.max(F.length-1,0)):te.key==="Backspace"&&te.currentTarget.value===""&&F.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),te.preventDefault()),ne}return Ct("input",t,{state:Z,ref:[n,v.state.inputRef,ae],props:[z,P,{type:"text",value:t.value??W??T,"aria-readonly":O||void 0,"aria-labelledby":x,disabled:$,readOnly:O,...D==="none"&&N&&{name:N},id:w,onFocus(){d(!0)},onBlur(){if(f(!0),d(!1),m==="onBlur"){const te=D==="none"?T:F;g.commit(te)}},onCompositionStart(te){fE||(oe.current=!0,ee(te.currentTarget.value))},onCompositionEnd(te){oe.current=!1;const ne=te.currentTarget.value;ee(null),v.state.setInputValue(ne,lt(_f,te.nativeEvent))},onChange(te){if(oe.current){const ge=te.currentTarget.value;ee(ge),ge===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,lt(Vc,te.nativeEvent));const fe=ge.trim(),Ee=B&&fe!=="";!O&&!$&&fe!==""&&(v.state.setOpen(!0,lt(_f,te.nativeEvent)),B||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),q&&v.state.activeIndex!==null&&!Ee&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(te.currentTarget.value,lt(_f,te.nativeEvent));const ne=te.currentTarget.value==="",J=lt(Vc,te.nativeEvent);ne&&!v.state.inputInsidePopup&&(D==="single"&&v.state.setSelectedValue(null,J),v.state.openOnInputClick||v.state.setOpen(!1,J));const ve=te.currentTarget.value.trim();!O&&!$&&ve!==""&&(v.state.setOpen(!0,lt(_f,te.nativeEvent)),B||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),q&&v.state.activeIndex!==null&&!B&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(te){if($||O||te.ctrlKey||te.shiftKey||te.altKey||te.metaKey)return;v.state.keyboardActiveRef.current=!0;const ne=te.currentTarget,J=ne.scrollWidth-ne.clientWidth,ve=C==="rtl";if(te.key==="Home"){Wr(te);const fe=pz&&ve?ne.value.length:0;ne.setSelectionRange(fe,fe),ne.scrollLeft=0;return}if(te.key==="End"){Wr(te);const fe=pz&&ve?0:ne.value.length;ne.setSelectionRange(fe,fe),ne.scrollLeft=ve?-J:J;return}if(!H&&te.key==="Escape"){const fe=D==="multiple"&&Array.isArray(F)?F.length===0:F===null,Ee=lt(v0,te.nativeEvent),_e=D==="multiple"?[]:null;v.state.setInputValue("",Ee),v.state.setSelectedValue(_e,Ee),!fe&&!v.state.inline&&!Ee.isPropagationAllowed&&te.stopPropagation();return}if(_&&te.key==="Backspace"&&ne.value===""&&_.highlightedChipIndex===void 0&&Array.isArray(F)&&F.length>0){const fe=F.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),v.state.setSelectedValue(fe,lt(Vr,te.nativeEvent));return}const ge=K(te);if(_?.setHighlightedChipIndex(ge),ge!==void 0?_?.chipsRef.current[ge]?.focus():v.state.inputRef.current?.focus(),te.which!==229&&te.key==="Enter"&&q){const fe=v.state.activeIndex,Ee=te.nativeEvent;if(fe===null){v.state.setOpen(!1,lt(Vr,Ee));return}Wr(te);const _e=v.state.listRef.current[fe];_e&&(v.state.selectionEventRef.current=Ee,_e.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},g?g.getValidationProps(o):o],stateAttributesMapping:bSe})}),ySe={...Za,...xw},xSe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,keepMounted:o=!1,...l}=t,{disabled:u}=Ka(),f=rc(),d=Qe(f,bt.selectionMode),m=Qe(f,bt.disabled),g=Qe(f,bt.readOnly),x=Qe(f,bt.open),_=Qe(f,bt.selectedValue),b=c3();let y=!1;d==="none"?y=b!=="":d==="single"?y=_!=null:y=Array.isArray(_)&&_.length>0;const v=u||m||a,{buttonRef:S,getButtonProps:T}=ua({native:s,disabled:v}),{mounted:w,transitionStatus:C,setMounted:R}=go(y),O=A.useMemo(()=>({disabled:v,open:x,transitionStatus:C}),[v,x,C]);Li({open:y,ref:f.state.clearRef,onComplete(){y||R(!1)}});const N=Ct("button",t,{state:O,ref:[n,S,f.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":g||void 0,onMouseDown(L){L.preventDefault()},onClick(L){if(v||g)return;const z=f.state.keyboardActiveRef;f.state.setInputValue("",lt(xz,L.nativeEvent)),d!=="none"?(f.state.setSelectedValue(Array.isArray(_)?[]:null,lt(xz,L.nativeEvent)),f.state.setIndices({activeIndex:null,selectedIndex:null,type:z.current?"keyboard":"pointer"})):f.state.setIndices({activeIndex:null,type:z.current?"keyboard":"pointer"}),f.state.inputRef.current?.focus()}},l,T],stateAttributesMapping:ySe});return o||w?N:null}),_Se=A.createContext(null);function ESe(){return A.useContext(_Se)}function SSe(e){const{children:t}=e,{filteredItems:n}=gp(),r=ESe(),i=r?r.items:n;return i?p.jsx(A.Fragment,{children:i.map(t)}):null}const wSe=A.forwardRef(function(t,n){var r;const{render:i,className:a,children:s,...o}=t,l=rc(),u=Ow(),f=!!d3(!0),{filteredItems:d}=gp(),m=Qe(l,bt.items),g=Qe(l,bt.labelsRef),x=Qe(l,bt.listRef),_=Qe(l,bt.selectionMode),b=Qe(l,bt.grid),y=Qe(l,bt.popupProps),v=Qe(l,bt.disabled),S=Qe(l,bt.readOnly),T=Qe(l,bt.virtualized),w=_==="multiple",C=d.length===0,R=Ye(P=>{l.set("positionerElement",P)}),O=Ye(P=>{l.set("listElement",P)}),N=A.useMemo(()=>typeof s=="function"?r||(r=p.jsx(SSe,{children:s})):s,[s]),D=A.useMemo(()=>({empty:C}),[C]),L=u.useState("floatingId"),z=Ct("div",t,{state:D,ref:[n,O,f?null:R],props:[y,{children:N,tabIndex:-1,id:L,role:b?"grid":"listbox","aria-multiselectable":w?"true":void 0,onKeyDown(P){if(!(v||S)&&P.key==="Enter"){const q=l.state.activeIndex;if(q==null)return;Wr(P);const H=P.nativeEvent,F=l.state.listRef.current[q];F&&(l.state.selectionEventRef.current=H,F.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},o]});return T?z:p.jsx(_0,{elementsRef:x,labelsRef:m?void 0:g,children:z})}),Qne=A.createContext(void 0);function CSe(){const e=A.useContext(Qne);if(e===void 0)throw new Error(on(20));return e}const TSe=A.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,a=rc(),s=Qe(a,bt.mounted),o=Qe(a,bt.forceMounted);return s||r||o?p.jsx(Qne.Provider,{value:r,children:p.jsx(y0,{ref:n,...i})}):null}),ASe=A.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_=!1,collisionAvoidance:b=cw,...y}=t,v=rc(),{filteredItems:S}=gp(),T=Ow(),w=CSe(),C=Qe(v,bt.modal),R=Qe(v,bt.open),O=Qe(v,bt.mounted),N=Qe(v,bt.openMethod),D=Qe(v,bt.triggerElement),L=Qe(v,bt.inputElement),z=Qe(v,bt.inputInsidePopup),P=S.length===0,H=T0({anchor:a??(z?D:L),floatingRootContext:T,positionMethod:s,mounted:O,side:o,sideOffset:u,align:l,alignOffset:f,arrowPadding:g,collisionBoundary:d,collisionPadding:m,sticky:x,disableAnchorTracking:_,keepMounted:w,collisionAvoidance:b,lazyFlip:!0});Tw(R&&C&&N!=="touch",D);const F=A.useMemo(()=>{const $={...H.positionerStyles};return R||($.pointerEvents="none"),{role:"presentation",hidden:!O,style:$}},[R,O,H.positionerStyles]),G=A.useMemo(()=>({open:R,side:H.side,align:H.align,anchorHidden:H.anchorHidden,empty:P}),[R,H.side,H.align,H.anchorHidden,P]);nt(()=>{v.set("popupSide",H.side)},[v,H.side]);const V=A.useMemo(()=>({side:H.side,align:H.align,arrowRef:H.arrowRef,arrowUncentered:H.arrowUncentered,arrowStyles:H.arrowStyles,anchorHidden:H.anchorHidden,isPositioned:H.isPositioned}),[H.side,H.align,H.arrowRef,H.arrowUncentered,H.arrowStyles,H.anchorHidden,H.isPositioned]),B=Ye($=>{v.set("positionerElement",$)}),j=Ct("div",t,{state:G,ref:[n,B],props:[F,y],stateAttributesMapping:Qa});return p.jsxs(Zne.Provider,{value:V,children:[O&&C&&p.jsx(Cw,{inert:lg(!R),cutout:L??D}),j]})}),kSe={...Qa,...Za},OSe=A.forwardRef(function(t,n){const{render:r,className:i,initialFocus:a,finalFocus:s,...o}=t,l=rc(),u=d3(),f=Ow(),{filteredItems:d}=gp(),m=Qe(l,bt.mounted),g=Qe(l,bt.open),x=Qe(l,bt.openMethod),_=Qe(l,bt.transitionStatus),b=Qe(l,bt.inputInsidePopup),y=Qe(l,bt.inputElement),v=d.length===0;Li({open:g,ref:l.state.popupRef,onComplete(){g&&l.state.onOpenChangeComplete(!0)}});const S=A.useMemo(()=>({open:g,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:_,empty:v}),[g,u.side,u.align,u.anchorHidden,_,v]),T=Ct("div",t,{state:S,ref:[n,l.state.popupRef],props:[{role:b?"dialog":"presentation",tabIndex:-1,onFocus(O){const N=Mr(O.nativeEvent);x!=="touch"&&(Rt(l.state.listElement,N)||N===O.currentTarget)&&l.state.inputRef.current?.focus()}},cg(_),o],stateAttributesMapping:kSe}),C=a===void 0?b?O=>O==="touch"?l.state.popupRef.current:y:!1:a;let R;return s!=null?R=s:R=b?void 0:!1,p.jsx(pw,{context:f,disabled:!m,modal:!b,openInteractionType:x,initialFocus:C,returnFocus:R,children:T})}),Jne=A.createContext(void 0);function ere(){const e=A.useContext(Jne);if(!e)throw new Error(on(19));return e}const RSe=A.createContext(!1);function NSe(){return A.useContext(RSe)}const ISe=A.memo(A.forwardRef(function(t,n){const{render:r,className:i,value:a=null,index:s,disabled:o=!1,nativeButton:l=!1,...u}=t,f=A.useRef(!1),d=A.useRef(null),m=ug({index:s,textRef:d,indexGuessBehavior:qM.GuessFromOrder}),g=rc(),x=NSe(),{flatFilteredItems:_}=gp(),b=Qe(g,bt.open),y=Qe(g,bt.selectionMode),v=Qe(g,bt.readOnly),S=Qe(g,bt.virtualized),T=Qe(g,bt.isItemEqualToValue),w=y!=="none",C=s??(S?gm(_,a,T):m.index),R=m.index!==-1,O=Qe(g,bt.id),N=Qe(g,bt.isActive,C),D=Qe(g,bt.isSelected,a),L=Qe(g,bt.items),z=Qe(g,bt.getItemProps),P=A.useRef(null),q=O!=null&&R?`${O}-${C}`:void 0,H=D&&w;nt(()=>{if(!(R&&(S||s!=null)))return;const oe=g.state.listRef.current;return oe[C]=P.current,()=>{delete oe[C]}},[R,S,C,s,g]),nt(()=>{if(!R||L)return;const ee=g.state.valuesRef.current;return ee[C]=a,y!=="none"&&g.state.allValuesRef.current.push(a),()=>{delete ee[C]}},[R,L,C,a,g,y]),nt(()=>{if(!b){f.current=!1;return}if(!R||L)return;const ee=g.state.selectedValue,oe=Array.isArray(ee)?ee[ee.length-1]:ee;zu(oe,a,T)&&g.set("selectedIndex",C)},[R,L,b,g,C,a,T]);const F=A.useMemo(()=>({disabled:o,selected:H,highlighted:N}),[o,H,N]),G=z({active:N,selected:H});G.id=void 0,G.onFocus=void 0;const{getButtonProps:V,buttonRef:B}=ua({disabled:o,focusableWhenDisabled:!0,native:l});function j(ee){function oe(){g.state.handleSelection(ee,a)}g.state.submitOnItemClick?(Ur.flushSync(oe),g.state.requestSubmit()):oe()}const $={id:q,role:x?"gridcell":"option","aria-disabled":o||void 0,"aria-selected":w?H:void 0,tabIndex:void 0,onPointerDownCapture(ee){f.current=!0,ee.preventDefault()},onClick(ee){o||v||j(ee.nativeEvent)},onMouseUp(ee){const oe=f.current;f.current=!1,!(o||v||ee.button!==0||oe||!N)&&j(ee.nativeEvent)}},Y=Ct("div",t,{ref:[B,n,m.ref,P],state:F,props:[G,$,u,V]}),W=A.useMemo(()=>({selected:H,textRef:d}),[H,d]);return p.jsx(Jne.Provider,{value:W,children:Y})})),DSe=A.forwardRef(function(t,n){const{render:r,className:i,children:a,...s}=t,{filteredItems:o}=gp(),l=rc(),u=o.length===0?a:null;return Ct("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});let rH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function tre(e){return A.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[rH.checked]:""}:{[rH.unchecked]:""}},...nc}),[e.indeterminate])}const nre=A.createContext(void 0);function LSe(){const e=A.useContext(nre);if(e===void 0)throw new Error(on(14));return e}const PSe="data-parent",MSe=A.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a=!1,disabled:s=!1,id:o,indeterminate:l=!1,inputRef:u,name:f,onCheckedChange:d,parent:m=!1,readOnly:g=!1,render:x,required:_=!1,uncheckedValue:b,value:y,nativeButton:v=!1,...S}=t,{clearErrors:T}=fg(),{disabled:w,name:C,setDirty:R,setFilled:O,setFocused:N,setTouched:D,state:L,validationMode:z,validityData:P,shouldValidateOnChange:q,validation:H}=Ka(),F=Tne(),{labelId:G,controlId:V,setControlId:B,getDescriptionProps:j}=$l(),$=SEe(),Y=$?.parent,W=Y&&$.allValues,ee=w||F.disabled||$?.disabled||s,oe=C??f,ae=y??oe,Z=ui(),K=ui();let Q=V;W?Q=m?K:`${Y.id}-${ae}`:o&&(Q=o);let te={};W&&(m?te=$.parent.getParentProps():ae&&(te=$.parent.getChildProps(ae)));const ne=Ye(d),{checked:J=r,indeterminate:ve=l,onCheckedChange:ge,...fe}=te,Ee=$?.value,_e=$?.setValue,Ve=$?.defaultValue,Ce=A.useRef(null),{getButtonProps:Me,buttonRef:Ae}=ua({disabled:ee,native:v}),pe=$?.validation??H,[de,ke]=Wa({controlled:ae&&Ee&&!m?Ee.includes(ae):J,default:ae&&Ve&&!m?Ve.includes(ae):a,name:"Checkbox",state:"checked"});nt(()=>{if(B!==Vn)return B(Q),()=>{B(void 0)}},[Q,$,B,m]),pg({enabled:!$,id:Z,commit:pe.commit,value:de,controlRef:Ce,name:oe,getValue:()=>de});const De=A.useRef(null),me=Ga(u,De,pe.inputRef);nt(()=>{De.current&&(De.current.indeterminate=ve,de&&O(!0))},[de,ve,O]),Jc(de,()=>{$&&!m||(T(oe),O(de),R(de!==P.initialValue),q()?pe.commit(de):pe.commit(de,!0))});const ye=zo({checked:de,disabled:ee,name:m?void 0:oe,id:Q??void 0,required:_,ref:me,style:kd,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const $e=ut.target.checked,pt=lt(Vr,ut.nativeEvent);if(ge?.($e,pt),ne($e,pt),!pt.isCanceled&&(ke($e),ae&&Ee&&_e&&!m)){const Se=$e?[...Ee,ae]:Ee.filter(Be=>Be!==ae);_e(Se,pt)}},onFocus(){Ce.current?.focus()}},y!==void 0?{value:($?de&&y:y)||""}:Jn,j,$?pe.getValidationProps:pe.getInputValidationProps),xe=W?!!J:de,je=W&&ve||l;A.useEffect(()=>{Y&&ae&&Y.disabledStatesRef.current.set(ae,ee)},[Y,ee,ae]);const Ge=A.useMemo(()=>({...L,checked:xe,disabled:ee,readOnly:g,required:_,indeterminate:je}),[L,xe,ee,g,_,je]),gt=tre(Ge),at=Ct("span",t,{state:Ge,ref:[Ae,Ce,n,$?.registerControlRef],props:[{id:Z,role:"checkbox","aria-checked":ve?"mixed":de,"aria-readonly":g||void 0,"aria-required":_||void 0,"aria-labelledby":G,[PSe]:m?"":void 0,onFocus(){N(!0)},onBlur(){const ut=De.current;ut&&(D(!0),N(!1),z==="onBlur"&&pe.commit($?Ee:ut.checked))},onClick(ut){g||ee||(ut.preventDefault(),De.current?.click())}},j,pe.getValidationProps,S,fe,Me],stateAttributesMapping:gt});return p.jsxs(nre.Provider,{value:Ge,children:[at,!de&&!$&&oe&&!m&&b!==void 0&&p.jsx("input",{type:"hidden",name:oe,value:b}),p.jsx("input",{...ye})]})}),jSe=A.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=LSe(),l=o.checked||o.indeterminate,{transitionStatus:u,setMounted:f}=go(l),d=A.useRef(null),m=A.useMemo(()=>({...o,transitionStatus:u}),[o,u]);Li({open:l,ref:d,onComplete(){l||f(!1)}});const g=tre(o),x=A.useMemo(()=>({...g,...Za,...nc}),[g]),_=a||l,b=Ct("span",t,{enabled:_,ref:[n,d],state:m,stateAttributesMapping:x,props:s});return _?b:null});function FSe(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,...a}=e;return p.jsx(fSe,{...a,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i})}const BSe=A.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=ere();return r||i?p.jsx(USe,{...t,ref:n}):null}),USe=A.memo(A.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=ere(),o=A.useRef(null),{transitionStatus:l,setMounted:u}=go(s),f=A.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),d=Ct("span",e,{ref:[t,o],state:f,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Za});return Li({open:s,ref:o,onComplete(){s||u(!1)}}),d})),$Se=A.createContext(void 0);function Rw(e=!0){const t=A.useContext($Se);if(t===void 0&&!e)throw new Error(on(25));return t}const rre=A.createContext(void 0);function f3(e){const t=A.useContext(rre);if(t===void 0&&!e)throw new Error(on(33));return t}const ire=A.createContext(void 0);function Rd(e){const t=A.useContext(ire);if(t===void 0&&!e)throw new Error(on(36));return t}const are={type:"regular-item"};function sre(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,nativeButton:s,itemMetadata:o,nodeId:l}=e,u=A.useRef(null),f=Rw(!0),d=f!==void 0,{events:m}=a.useState("floatingTreeRoot"),{getButtonProps:g,buttonRef:x}=ua({disabled:n,focusableWhenDisabled:!0,native:s}),_=A.useCallback(y=>zo({id:i,role:"menuitem",tabIndex:r?0:-1,onMouseMove(v){l&&m.emit("itemhover",{nodeId:l,target:v.currentTarget})},onMouseEnter(){o.type==="submenu-trigger"&&o.setActive()},onKeyUp(v){v.key===" "&&a.context.typingRef.current&&v.preventBaseUIHandler()},onClick(v){t&&m.emit("close",{domEvent:v,reason:Pf})},onMouseUp(v){if(f){const S=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,d&&S&&Math.abs(v.clientX-S.x)<=1&&Math.abs(v.clientY-S.y)<=1)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!d||v.button===2)&&o.type==="regular-item"&&u.current.click()}},y,g),[i,r,g,t,m,a,d,f,o,l]),b=Ga(u,x);return A.useMemo(()=>({getItemProps:_,itemRef:b}),[_,b])}let iH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const ore={checked(e){return e?{[iH.checked]:""}:{[iH.unchecked]:""}},...Za},zSe=A.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!0,...f}=t,d=ug({label:s}),m=f3(!0),g=ui(a),{store:x}=Rd(),_=x.useState("isActive",d.index),b=x.useState("itemProps"),{getItemProps:y,itemRef:v}=sre({closeOnClick:u,disabled:l,highlighted:_,id:g,store:x,nativeButton:o,nodeId:m?.nodeId,itemMetadata:are}),S=A.useMemo(()=>({disabled:l,highlighted:_}),[l,_]);return Ct("div",t,{state:S,props:[b,f,y],ref:[v,n,d.ref]})}),HSe={...Qa,...Za},WSe=A.forwardRef(function(t,n){const{render:r,className:i,finalFocus:a,...s}=t,{store:o}=Rd(),{side:l,align:u}=f3(),f=s3()!=null,d=o.useState("open"),m=o.useState("transitionStatus"),g=o.useState("popupProps"),x=o.useState("mounted"),_=o.useState("instantType"),b=o.useState("activeTriggerElement"),y=o.useState("parent"),v=o.useState("lastOpenChangeReason"),S=o.useState("rootId"),T=o.useState("floatingRootContext"),w=o.useState("floatingTreeRoot"),C=o.useState("closeDelay"),R=o.useState("activeTriggerElement");Li({open:d,ref:o.context.popupRef,onComplete(){d&&o.context.onOpenChangeComplete?.(!0)}}),A.useEffect(()=>{function P(q){o.setOpen(!1,lt(q.reason,q.domEvent))}return w.events.on("close",P),()=>{w.events.off("close",P)}},[w.events,o]);const O=o.useState("hoverEnabled"),N=o.useState("disabled");Fte(T,{enabled:O&&!N&&y.type!=="context-menu"&&y.type!=="menubar",closeDelay:C});const D=A.useMemo(()=>({transitionStatus:m,side:l,align:u,open:d,nested:y.type==="menu",instant:_}),[m,l,u,d,y.type,_]),L=Ct("div",t,{state:D,ref:[n,o.context.popupRef],stateAttributesMapping:HSe,props:[g,{onKeyDown(P){f&&WM.has(P.key)&&P.stopPropagation()}},cg(m),s,{"data-rootownerid":S}]});let z=y.type===void 0||y.type==="context-menu";return(b||y.type==="menubar"&&v!==fw)&&(z=!0),p.jsx(pw,{context:T,modal:!1,disabled:!x,returnFocus:a===void 0?z:a,initialFocus:y.type!=="menu",restoreFocus:!0,externalTree:y.type!=="menubar"?w:void 0,previousFocusableElement:R,nextFocusableElement:y.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:L})}),lre=A.createContext(void 0);function VSe(){const e=A.useContext(lre);if(e===void 0)throw new Error(on(32));return e}const qSe=A.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=Rd();return a.useState("mounted")||r?p.jsx(lre.Provider,{value:r,children:p.jsx(y0,{ref:n,...i})}):null}),GSe=A.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o,align:l,sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_=!1,collisionAvoidance:b=cw,...y}=t,{store:v}=Rd(),S=VSe(),T=Rw(!0),w=v.useState("parent"),C=v.useState("floatingRootContext"),R=v.useState("floatingTreeRoot"),O=v.useState("mounted"),N=v.useState("open"),D=v.useState("modal"),L=v.useState("activeTriggerElement"),z=v.useState("lastOpenChangeReason"),P=v.useState("floatingNodeId"),q=v.useState("floatingParentNodeId");let H=r,F=u,G=f,V=l,B=b;w.type==="context-menu"&&(H=r??w.context?.anchor,V=V??"start",!o&&V!=="center"&&(G=t.alignOffset??2,F=t.sideOffset??-5));let j=o,$=V;w.type==="menu"?(j=j??"inline-end",$=$??"start",B=t.collisionAvoidance??bM):w.type==="menubar"&&(j=j??"bottom",$=$??"start");const Y=w.type==="context-menu",W=T0({anchor:H,floatingRootContext:C,positionMethod:T?"fixed":i,mounted:O,side:j,sideOffset:F,align:$,alignOffset:G,arrowPadding:Y?0:g,collisionBoundary:d,collisionPadding:m,sticky:x,nodeId:P,keepMounted:S,disableAnchorTracking:_,collisionAvoidance:B,shiftCrossAxis:Y,externalTree:R}),ee=A.useMemo(()=>{const te={};return N||(te.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...W.positionerStyles,...te}}},[N,O,W.positionerStyles]);A.useEffect(()=>{function te(ne){ne.open?(ne.parentNodeId===P&&v.set("hoverEnabled",!1),ne.nodeId!==P&&ne.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,lt(pv))):ne.parentNodeId===P&&ne.reason!==pv&&v.set("hoverEnabled",!0)}return R.events.on("menuopenchange",te),()=>{R.events.off("menuopenchange",te)}},[v,R.events,P]),A.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function te(ne){if(ne.open||ne.nodeId!==v.select("floatingParentNodeId"))return;const J=ne.reason??pv;v.setOpen(!1,lt(J))}return R.events.on("menuopenchange",te),()=>{R.events.off("menuopenchange",te)}},[R.events,v]),A.useEffect(()=>{function te(ne){!N||ne.nodeId!==v.select("floatingParentNodeId")||ne.target&&L&&L!==ne.target&&v.setOpen(!1,lt(pv))}return R.events.on("itemhover",te),()=>{R.events.off("itemhover",te)}},[R.events,N,L,v]),A.useEffect(()=>{const te={open:N,nodeId:P,parentNodeId:q,reason:v.select("lastOpenChangeReason")};R.events.emit("menuopenchange",te)},[R.events,N,v,P,q]);const oe=A.useMemo(()=>({open:N,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:w.type==="menu"}),[N,W.side,W.align,W.anchorHidden,w.type]),ae=A.useMemo(()=>({side:W.side,align:W.align,arrowRef:W.arrowRef,arrowUncentered:W.arrowUncentered,arrowStyles:W.arrowStyles,nodeId:W.context.nodeId}),[W.side,W.align,W.arrowRef,W.arrowUncentered,W.arrowStyles,W.context.nodeId]),Z=Ct("div",t,{state:oe,stateAttributesMapping:Qa,ref:[n,v.useStateSetter("positionerElement")],props:[ee,y]}),K=O&&w.type!=="menu"&&(w.type!=="menubar"&&D&&z!==Tr||w.type==="menubar"&&w.context.modal);let Q=null;return w.type==="menubar"?Q=w.context.contentElement:w.type===void 0&&(Q=L),p.jsxs(rre.Provider,{value:ae,children:[K&&p.jsx(Cw,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:lg(!N),cutout:Q}),p.jsx(vte,{id:P,children:p.jsx(_0,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:Z})})]})}),ure=A.createContext(void 0);function KSe(){const e=A.useContext(ure);if(e===void 0)throw new Error(on(34));return e}const YSe=A.memo(A.forwardRef(function(t,n){const{render:r,className:i,value:a,defaultValue:s,onValueChange:o,disabled:l=!1,...u}=t,[f,d]=Wa({controlled:a,default:s,name:"MenuRadioGroup"}),m=Ye(o),g=Ye((y,v)=>{m?.(y,v),!v.isCanceled&&d(y)}),x=A.useMemo(()=>({disabled:l}),[l]),_=Ct("div",t,{state:x,ref:n,props:{role:"group","aria-disabled":l||void 0,...u}}),b=A.useMemo(()=>({value:f,setValue:g,disabled:l}),[f,g,l]);return p.jsx(ure.Provider,{value:b,children:_})})),cre=A.createContext(void 0);function XSe(){const e=A.useContext(cre);if(e===void 0)throw new Error(on(35));return e}const ZSe=A.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!1,value:f,...d}=t,m=ug({label:s}),g=f3(!0),x=ui(a),{store:_}=Rd(),b=_.useState("isActive",m.index),y=_.useState("itemProps"),{value:v,setValue:S,disabled:T}=KSe(),w=T||l,C=v===f,{getItemProps:R,itemRef:O}=sre({closeOnClick:u,disabled:w,highlighted:b,id:x,store:_,nativeButton:o,nodeId:g?.nodeId,itemMetadata:are}),N=A.useMemo(()=>({disabled:w,highlighted:b,checked:C}),[w,b,C]),D=Ye(z=>{const P={...lt(Pf,z.nativeEvent),preventUnmountOnClose:()=>{}};S(f,P)}),L=Ct("div",t,{state:N,stateAttributesMapping:ore,props:[y,{role:"menuitemradio","aria-checked":C,onClick:D},d,R],ref:[O,n,m.ref]});return p.jsx(cre.Provider,{value:N,children:L})}),QSe=A.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=XSe(),l=A.useRef(null),{transitionStatus:u,setMounted:f}=go(o.checked);Li({open:o.checked,ref:l,onComplete(){o.checked||f(!1)}});const d=A.useMemo(()=>({checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:u}),[o.checked,o.disabled,o.highlighted,u]);return Ct("span",t,{state:d,stateAttributesMapping:ore,ref:[n,l],props:{"aria-hidden":!0,...s},enabled:a||o.checked})}),JSe=A.createContext(null);function dre(e){return A.useContext(JSe)}const ewe={...BM,disabled:He(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:He(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:He(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:He(e=>e.stickIfOpen),parent:He(e=>e.parent),rootId:He(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:He(e=>e.activeIndex),isActive:He((e,t)=>e.activeIndex===t),hoverEnabled:He(e=>e.hoverEnabled),instantType:He(e=>e.instantType),lastOpenChangeReason:He(e=>e.openChangeReason),floatingTreeRoot:He(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:He(e=>e.floatingNodeId),floatingParentNodeId:He(e=>e.floatingParentNodeId),itemProps:He(e=>e.itemProps),closeDelay:He(e=>e.closeDelay),keyboardEventRelay:He(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class p3 extends mw{constructor(t){super({...twe(),...t},{positionerRef:A.createRef(),popupRef:A.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:A.createRef(),beforeContentFocusGuardRef:A.createRef(),onOpenChangeComplete:void 0,triggerElements:new x0},ewe),this.observe(He(n=>n.allowMouseEnter),(n,r)=>{this.state.parent.type==="menu"&&n!==r&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){return Di(()=>t??new p3(n)).current}unsubscribeParentListener=null}function twe(){return{...FM(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new kM,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Jn,keyboardEventRelay:void 0,closeDelay:0}}const nwe=A.createContext(void 0);function rwe(){return A.useContext(nwe)}function iwe(e){const{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:s=!1,modal:o,loopFocus:l=!0,orientation:u="vertical",actionsRef:f,closeParentOnEsc:d=!1,handle:m,triggerId:g,defaultTriggerId:x=null,highlightItemOnHover:_=!0}=e,b=Rw(!0),y=Rd(!0),v=dre(),S=rwe(),T=A.useMemo(()=>S&&y?{type:"menu",store:y.store}:v?{type:"menubar",context:v}:b&&!y?{type:"context-menu",context:b}:{type:void 0},[b,y,v,S]),w=p3.useStore(m?.store,{parent:T}),C=w.useState("floatingTreeRoot"),R=OM(C),O=Go();nt(()=>{b&&!y?w.update({parent:{type:"context-menu",context:b},floatingNodeId:R,floatingParentNodeId:O}):y&&w.update({floatingNodeId:R,floatingParentNodeId:O})},[b,y,R,O,w]),w.useControlledProp("open",n,a),w.useControlledProp("activeTriggerId",g,x),w.useContextCallback("onOpenChangeComplete",i);const N=w.useState("open"),D=w.useState("activeTriggerElement"),L=w.useState("positionerElement"),z=w.useState("hoverEnabled"),P=w.useState("modal"),q=w.useState("disabled"),H=w.useState("lastOpenChangeReason"),F=w.useState("parent"),G=w.useState("activeIndex"),V=w.useState("payload"),B=w.useState("floatingParentNodeId"),j=A.useRef(null),$=B!=null;let Y;w.useSyncedValues({disabled:s,modal:F.type===void 0?o:void 0,rootId:Ad()});const{openMethod:W,triggerProps:ee,reset:oe}=Aw(N);MM(w);const{forceUnmount:ae}=jM(N,w,()=>{w.update({allowMouseEnter:!1,stickIfOpen:!0}),oe()}),Z=A.useRef(F.type!=="context-menu"),K=zn();A.useEffect(()=>{if(N||(j.current=null),F.type==="context-menu"){if(!N){K.clear(),Z.current=!1;return}K.start(500,()=>{Z.current=!0})}},[K,N,F.type]),Tw(N&&P&&H!==Tr&&W!=="touch",L),nt(()=>{!N&&!z&&w.set("hoverEnabled",!0)},[N,z,w]);const Q=A.useRef(!0),te=zn(),ne=Ye(($e,pt)=>{const Se=pt.reason;if(N===$e&&pt.trigger===D||(pt.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},!$e&&pt.trigger==null&&(pt.trigger=D??void 0),r?.($e,pt),pt.isCanceled))return;const Be={open:$e,nativeEvent:pt.event,reason:pt.reason,nested:$};Y?.emit("openchange",Be);const Je=pt.event;if($e===!1&&Je?.type==="click"&&Je.pointerType==="touch"&&!Q.current)return;if(!$e&&G!==null){const Bt=w.context.itemDomElements.current[G];queueMicrotask(()=>{Bt?.setAttribute("tabindex","-1")})}$e&&Se===Jv?(Q.current=!1,te.start(300,()=>{Q.current=!0})):(Q.current=!0,te.clear());const ct=(Se===Ru||Se===Pf)&&Je.detail===0&&Je?.isTrusted,ht=!$e&&(Se===v0||Se==null);function mn(){const Bt={open:$e,openChangeReason:Se};j.current=pt.event??null;const Mt=pt.trigger?.id??null;(Mt||$e)&&(Bt.activeTriggerId=Mt,Bt.activeTriggerElement=pt.trigger??null),w.update(Bt)}Se===Tr?Ur.flushSync(mn):mn(),F.type==="menubar"&&(Se===Jv||Se===Ho||Se===Tr||Se===Hh||Se===pv)?w.set("instantType","group"):ct||ht?w.set("instantType",ct?"click":"dismiss"):w.set("instantType",void 0)}),J=A.useCallback($e=>{const pt=lt($e);return pt.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},pt},[w]),ve=A.useCallback(()=>{w.setOpen(!1,J(RM))},[w,J]);A.useImperativeHandle(f,()=>({unmount:ae,close:ve}),[ae,ve]);let ge;F.type==="context-menu"&&(ge=F.context),A.useImperativeHandle(ge?.positionerRef,()=>L,[L]),A.useImperativeHandle(ge?.actionsRef,()=>({setOpen:ne}),[ne]);const fe=UM({popupStore:w,onOpenChange:ne});Y=fe.context.events,A.useEffect(()=>{const $e=({open:pt,eventDetails:Se})=>ne(pt,Se);return Y.on("setOpen",$e),()=>{Y?.off("setOpen",$e)}},[Y,ne]);const Ee=og(fe,{enabled:!q,bubbles:d&&F.type==="menu",outsidePress(){return F.type!=="context-menu"||j.current?.type==="contextmenu"?!0:Z.current},externalTree:$?C:void 0}),_e=Ute(fe,{role:"menu"}),Ve=ec(),Ce=A.useCallback($e=>{w.select("activeIndex")!==$e&&w.set("activeIndex",$e)},[w]),Me=$M(fe,{enabled:!q,listRef:w.context.itemDomElements,activeIndex:G,nested:F.type!==void 0,loopFocus:l,orientation:u,parentOrientation:F.type==="menubar"?F.context.orientation:void 0,rtl:Ve==="rtl",disabledIndices:ya,onNavigate:Ce,openOnArrowKeyDown:F.type!=="context-menu",externalTree:$?C:void 0,focusItemOnHover:_}),Ae=A.useCallback($e=>{w.context.typingRef.current=$e},[w]),pe=zM(fe,{listRef:w.context.itemLabels,activeIndex:G,resetMs:Ave,onMatch:$e=>{N&&$e!==G&&w.set("activeIndex",$e)},onTypingChange:Ae}),{getReferenceProps:de,getFloatingProps:ke,getItemProps:De,getTriggerProps:me}=Od([Ee,_e,Me,pe]),ye=A.useMemo(()=>{const $e=zo(de(),{onMouseEnter(){w.set("hoverEnabled",!0)},onMouseMove(){w.set("allowMouseEnter",!0)}},ee);return delete $e.role,$e},[de,w,ee]),xe=A.useMemo(()=>{const $e=me();if(!$e)return $e;const pt=zo($e,ee);return delete pt.role,delete pt["aria-controls"],pt},[me,ee]),je=Nu(),Ge=A.useMemo(()=>ke({onMouseEnter(){F.type==="menu"&&je.request(()=>w.set("hoverEnabled",!1))},onMouseMove(){w.set("allowMouseEnter",!0)},onClick(){w.select("hoverEnabled")&&w.set("hoverEnabled",!1)},onKeyDown($e){const pt=w.select("keyboardEventRelay");pt&&!$e.isPropagationStopped()&&pt($e)}}),[ke,F.type,je,w]),gt=A.useMemo(()=>De(),[De]);w.useSyncedValues({floatingRootContext:fe,activeTriggerProps:ye,inactiveTriggerProps:xe,popupProps:Ge,itemProps:gt});const at=A.useMemo(()=>({store:w,parent:T}),[w,T]),ut=p.jsx(ire.Provider,{value:at,children:typeof t=="function"?t({payload:V}):t});return F.type===void 0||F.type==="context-menu"?p.jsx(yte,{externalTree:C,children:ut}):ut}function fre(e){if(ur(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!_l(e))return fre(Il(e))}function awe(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=A.useRef(!1);return A.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,Zi(a.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:a=>{i.current&&(i.current=!1,a.preventBaseUIHandler())}}:Jn,[t,n,r])}const Qx=2,swe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,id:o,openOnHover:l,delay:u=100,closeDelay:f=0,handle:d,payload:m,...g}=t,x=Rd(!0),_=d?.store??x?.store;if(!_)throw new Error(on(85));const b=ui(o),y=_.useState("isTriggerActive",b),v=_.useState("floatingRootContext"),S=_.useState("isOpenedByTrigger",b),T=A.useRef(null),w=lwe(),C=mM(!0),R=Ko(),O=A.useMemo(()=>R??new kM,[R]),N=OM(O),D=Go(),{registerTrigger:L,isMountedByThisTrigger:z}=PM(b,T,_,{payload:m,closeDelay:f,parent:w,floatingTreeRoot:O,floatingNodeId:N,floatingParentNodeId:D,keyboardEventRelay:C?.relayKeyboardEvent}),P=_.useState("disabled"),q=a||P||w.type==="menubar"&&w.context.disabled,{getButtonProps:H,buttonRef:F}=ua({disabled:q,native:s});A.useEffect(()=>{!S&&w.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,S,w.type]);const G=A.useRef(null),V=zn(),B=Ye(_e=>{if(!G.current)return;V.clear(),_.context.allowMouseUpTriggerRef.current=!1;const Ve=_e.target;if(Rt(G.current,Ve)||Rt(_.select("positionerElement"),Ve)||Ve===G.current||Ve!=null&&fre(Ve)===_.select("rootId"))return;const Ce=i3(G.current);_e.clientX>=Ce.left-Qx&&_e.clientX<=Ce.right+Qx&&_e.clientY>=Ce.top-Qx&&_e.clientY<=Ce.bottom+Qx||O.events.emit("close",{domEvent:_e,reason:xte})});A.useEffect(()=>{S&&_.select("lastOpenChangeReason")===Tr&&Zi(G.current).addEventListener("mouseup",B,{once:!0})},[S,B,_]);const j=w.type==="menubar"&&w.context.hasSubmenuOpen,Y=Bte(v,{enabled:(l??j??!1)&&!q&&w.type!=="context-menu"&&(w.type!=="menubar"||j&&!z),handleClose:HM({blockPointerEvents:w.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:w.type===void 0?u:void 0,delay:{close:f},triggerElementRef:T,externalTree:O,isActiveTrigger:y}),W=owe(S,_.select("lastOpenChangeReason")),ee=sg(v,{enabled:!q&&w.type!=="context-menu",event:S&&w.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0?W:!1}),oe=Mte(v,{enabled:!q&&(w.type!=="menubar"&&S||j)}),ae=awe({open:S,enabled:w.type==="menubar",mouseDownAction:"open"}),Z=Od([ee,oe]),K=w.type==="menubar",Q=A.useMemo(()=>({disabled:q,open:S}),[q,S]),te=_.useState("triggerProps",z),ne=[G,n,F,L,T],J=[Z.getReferenceProps(),Y??Jn,te,{"aria-haspopup":"menu",id:b,onMouseDown:_e=>{if(_.select("open"))return;V.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),Zi(_e.currentTarget).addEventListener("mouseup",B,{once:!0})}},K?{role:"menuitem"}:{},ae,g,H],ve=A.useRef(null),ge=Ye(_e=>{Ur.flushSync(()=>{_.setOpen(!1,lt(Ho,_e.nativeEvent,_e.currentTarget))}),a0e(ve.current)?.focus()}),fe=Ye(_e=>{const Ve=_.select("positionerElement");if(Ve&&Po(_e,Ve))_.context.beforeContentFocusGuardRef.current?.focus();else{Ur.flushSync(()=>{_.setOpen(!1,lt(Ho,_e.nativeEvent,_e.currentTarget))});let Ce=i0e(T.current);for(;Ce!==null&&Rt(Ve,Ce)||Ce?.hasAttribute("aria-hidden");){const Me=Ce;if(Ce=b0(Ce),Ce===Me)break}Ce?.focus()}}),Ee=Ct("button",t,{enabled:!K,stateAttributesMapping:dm,state:Q,ref:ne,props:J});return K?p.jsx(C0,{tag:"button",render:r,className:i,state:Q,refs:ne,props:J,stateAttributesMapping:dm}):S?p.jsxs(A.Fragment,{children:[p.jsx(Dl,{ref:ve,onFocus:ge},`${b}-pre-focus-guard`),p.jsx(A.Fragment,{children:Ee},b),p.jsx(Dl,{ref:_.context.triggerFocusTargetRef,onFocus:fe},`${b}-post-focus-guard`)]}):p.jsx(A.Fragment,{children:Ee},b)});function owe(e,t){const n=zn(),[r,i]=A.useState(!1);return nt(()=>{e&&t==="trigger-hover"?(i(!0),n.start(Ree,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function lwe(){const e=Rw(!0),t=Rd(!0),n=dre();return A.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function yu(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const uwe=typeof ResizeObserver<"u",cwe=()=>!0;function dwe(e){const{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=cwe,onMeasureLayout:s,onMeasureLayoutComplete:o,side:l,direction:u}=e,f=A.useRef(!0),d=LM(t,!0,!1),m=Nu(),g=A.useRef(null),x=Ye(s),_=Ye(o),b=A.useMemo(()=>{let y=l==="top",v=l==="left";return u==="rtl"?(y=y||l==="inline-end",v=v||l==="inline-end"):(y=y||l==="inline-start",v=v||l==="inline-start"),y?{position:"absolute",[l==="top"?"bottom":"top"]:"0",[v?"right":"left"]:"0"}:Jn},[l,u]);nt(()=>{if(!i||!a()||!uwe){f.current=!0,g.current=null;return}if(!t||!n)return;Object.entries(b).forEach(([N,D])=>{t.style.setProperty(N,D)});const y=new ResizeObserver(N=>{const D=N[0];D&&(g.current===null?g.current={width:Math.ceil(D.borderBoxSize[0].inlineSize),height:Math.ceil(D.borderBoxSize[0].blockSize)}:(g.current.width=Math.ceil(D.borderBoxSize[0].inlineSize),g.current.height=Math.ceil(D.borderBoxSize[0].blockSize)))});y.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const v=Hb(t,"position","static"),S=Hb(t,"transform","none"),T=Hb(t,"scale","1"),w=Hb(n,"--available-width","max-content"),C=Hb(n,"--available-height","max-content");if(x?.(),f.current||g.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const N=ty(t);return n.style.setProperty("--positioner-width",`${N.width}px`),n.style.setProperty("--positioner-height",`${N.height}px`),v(),S(),T(),w(),C(),_?.(null,N),f.current=!1,()=>{y.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 R=ty(t);t.style.setProperty("--popup-width",`${g.current.width}px`),t.style.setProperty("--popup-height",`${g.current.height}px`),v(),S(),w(),C(),_?.(g.current,R),n.style.setProperty("--positioner-width",`${R.width}px`),n.style.setProperty("--positioner-height",`${R.height}px`);const O=new AbortController;return m.request(()=>{t.style.setProperty("--popup-width",`${R.width}px`),t.style.setProperty("--popup-height",`${R.height}px`),d(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},O.signal)}),()=>{y.disconnect(),O.abort(),m.cancel()}},[r,t,n,d,m,a,i,x,_,b])}function Hb(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}const fwe=A.forwardRef(function(t,n){const{children:r,container:i,className:a,render:s,...o}=t,{portalNode:l,portalSubtree:u}=Cte({container:i,ref:n,componentProps:t,elementProps:o});return!u&&!l?null:p.jsxs(A.Fragment,{children:[u,l&&Ur.createPortal(r,l)]})});let aH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const ID={checked(e){return e?{[aH.checked]:""}:{[aH.unchecked]:""}},...Za,...nc},pre=A.createContext({disabled:void 0,readOnly:void 0,required:void 0,name:void 0,checkedValue:"",setCheckedValue:Vn,onValueChange:Vn,touched:!1,setTouched:Vn,registerControlRef:Vn});function pwe(){return A.useContext(pre)}const hre=A.createContext(void 0);function hwe(){const e=A.useContext(hre);if(e===void 0)throw new Error(on(52));return e}const mwe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,readOnly:s=!1,required:o=!1,value:l,inputRef:u,nativeButton:f=!1,id:d,...m}=t,{disabled:g,readOnly:x,required:_,checkedValue:b,setCheckedValue:y,touched:v,setTouched:S,validation:T,registerControlRef:w}=pwe(),{setDirty:C,validityData:R,setTouched:O,setFilled:N,state:D,disabled:L}=Ka(),z=Tne(),{labelId:P,getDescriptionProps:q}=$l(),H=L||z.disabled||g||a,F=x||s,G=_||o,V=b===l,B=A.useRef(null),j=A.useRef(null),$=Ga(u,j);nt(()=>{j.current?.checked&&N(!0)},[N]);const Y=ui(),W=k0({id:d,implicit:!1,controlRef:B}),ee={role:"radio","aria-checked":V,"aria-required":G||void 0,"aria-disabled":H||void 0,"aria-readonly":F||void 0,"aria-labelledby":P,[VM]:V?"":void 0,id:Y,disabled:H,onKeyDown(ge){ge.key==="Enter"&&ge.preventDefault()},onClick(ge){ge.defaultPrevented||H||F||(ge.preventDefault(),j.current?.click())},onFocus(ge){ge.defaultPrevented||H||F||!v||(j.current?.click(),S(!1))}},{getButtonProps:oe,buttonRef:ae}=ua({disabled:H,native:f}),Z=A.useMemo(()=>({type:"radio",ref:$,id:W,tabIndex:-1,style:kd,"aria-hidden":!0,disabled:H,checked:V,required:G,readOnly:F,onChange(ge){if(ge.nativeEvent.defaultPrevented||H||F||l===void 0)return;const fe=lt(Vr,ge.nativeEvent);fe.isCanceled||(O(!0),C(l!==R.initialValue),N(!0),y(l,fe))},onFocus(){B.current?.focus()}}),[V,H,W,$,F,G,y,C,O,N,R.initialValue,l]),K=A.useMemo(()=>({...D,required:G,disabled:H,readOnly:F,checked:V}),[D,H,F,V,G]),Q=A.useMemo(()=>K,[K]),te=y!==Vn,ne=[n,w,B,ae],J=[ee,q,T?.getValidationProps??Jn,m,oe],ve=Ct("span",t,{enabled:!te,state:K,ref:ne,props:J,stateAttributesMapping:ID});return p.jsxs(hre.Provider,{value:Q,children:[te?p.jsx(C0,{tag:"span",render:r,className:i,state:K,refs:ne,props:J,stateAttributesMapping:ID}):ve,p.jsx("input",{...Z})]})}),gwe=A.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=hwe(),l=o.checked,{transitionStatus:u,setMounted:f}=go(l),d=A.useMemo(()=>({...o,transitionStatus:u}),[o,u]),m=A.useRef(null),g=a||l,x=Ct("span",t,{enabled:g,ref:[n,m],state:d,props:s,stateAttributesMapping:ID});return Li({open:l,ref:m,onComplete(){l||f(!1)}}),g?x:null}),bwe=[Gte],vwe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a,readOnly:s,required:o,onValueChange:l,value:u,defaultValue:f,name:d,inputRef:m,id:g,...x}=t,{setTouched:_,setFocused:b,shouldValidateOnChange:y,validationMode:v,name:S,disabled:T,state:w,validation:C,setDirty:R,setFilled:O,validityData:N}=Ka(),{labelId:D}=$l(),{clearErrors:L}=fg(),z=gEe(!0),P=T||a,q=S??d,H=ui(g),[F,G]=Wa({controlled:u,default:f,name:"RadioGroup",state:"value"}),V=Ye(l),B=Ye((J,ve)=>{V(J,ve),!ve.isCanceled&&G(J)}),j=A.useRef(null),$=Ye(J=>{j.current==null&&J!=null&&(j.current=J)});pg({id:H,commit:C.commit,value:F,controlRef:j,name:q,getValue:()=>F??null}),Jc(F,()=>{L(q),R(F!==N.initialValue),O(F!=null),y()?C.commit(F):C.commit(F,!0)});const[Y,W]=A.useState(!1),ee=Ye(J=>{Rt(J.currentTarget,J.relatedTarget)||(_(!0),b(!1),v==="onBlur"&&C.commit(F))}),oe=Ye(J=>{J.key.startsWith("Arrow")&&(_(!0),W(!0),b(!0))}),ae=A.useMemo(()=>F==null?"":typeof F=="string"?F:JSON.stringify(F),[F]),Z=Ga(C.inputRef,m),K=zo({value:ae,ref:Z,id:H,name:ae?q:void 0,disabled:P,readOnly:s,required:o,"aria-labelledby":x["aria-labelledby"]??z?.legendId,"aria-hidden":!0,tabIndex:-1,style:kd,onChange:Vn,onFocus(){j.current?.focus()}},C.getInputValidationProps),Q=A.useMemo(()=>({...w,disabled:P??!1,required:o??!1,readOnly:s??!1}),[w,P,s,o]),te=A.useMemo(()=>({...w,checkedValue:F,disabled:P,validation:C,name:q,onValueChange:V,readOnly:s,registerControlRef:$,required:o,setCheckedValue:B,setTouched:W,touched:Y}),[F,P,C,w,q,V,s,$,o,B,W,Y]),ne={role:"radiogroup","aria-required":o||void 0,"aria-disabled":P||void 0,"aria-readonly":s||void 0,"aria-labelledby":D,onFocus(){b(!0)},onBlur:ee,onKeyDownCapture:oe};return p.jsxs(pre.Provider,{value:te,children:[p.jsx(w0,{render:r,className:i,state:Q,props:[ne,C.getValidationProps,x],refs:[n],stateAttributesMapping:nc,enableHomeAndEndKeys:!1,modifierKeys:bwe}),p.jsx("input",{...K})]})}),mre=A.createContext(void 0);function Nw(){const e=A.useContext(mre);if(e===void 0)throw new Error(on(53));return e}let SE=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Jx=500,sH=16;function uo(e,t,n){if(!e)return 0;const r=getComputedStyle(e),i=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}let ywe=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),vh=(function(e){return e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const h3={hasOverflowX:e=>e?{[vh.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[vh.hasOverflowY]:""}:null,overflowXStart:e=>e?{[vh.overflowXStart]:""}:null,overflowXEnd:e=>e?{[vh.overflowXEnd]:""}:null,overflowYStart:e=>e?{[vh.overflowYStart]:""}:null,overflowYEnd:e=>e?{[vh.overflowYEnd]:""}:null,cornerHidden:()=>null},oH={width:0,height:0},xwe={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},_we=A.forwardRef(function(t,n){const{render:r,className:i,overflowEdgeThreshold:a,...s}=t,[o,l]=A.useState(!1),[u,f]=A.useState(!1),[d,m]=A.useState(!1),[g,x]=A.useState(oH),[_,b]=A.useState(oH),[y,v]=A.useState(!1),[S,T]=A.useState(xwe),w=ui(),C=A.useRef(null),R=A.useRef(null),O=A.useRef(null),N=A.useRef(null),D=A.useRef(null),L=A.useRef(null),z=A.useRef(null),P=A.useRef(!1),q=A.useRef(0),H=A.useRef(0),F=A.useRef(0),G=A.useRef(0),V=A.useRef("vertical"),B=zn(),j=zn(),$=A.useRef({x:0,y:0}),[Y,W]=A.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),ee=Ewe(a),oe=Ye(ge=>{const fe=ge.x-$.current.x,Ee=ge.y-$.current.y;$.current=ge,Ee!==0&&(m(!0),B.start(Jx,()=>{m(!1)})),fe!==0&&(f(!0),j.start(Jx,()=>{f(!1)}))}),ae=Ye(ge=>{ge.button===0&&(P.current=!0,q.current=ge.clientY,H.current=ge.clientX,V.current=ge.currentTarget.getAttribute(ywe.orientation),R.current&&(F.current=R.current.scrollTop,G.current=R.current.scrollLeft),D.current&&V.current==="vertical"&&D.current.setPointerCapture(ge.pointerId),L.current&&V.current==="horizontal"&&L.current.setPointerCapture(ge.pointerId))}),Z=Ye(ge=>{if(!P.current)return;const fe=ge.clientY-q.current,Ee=ge.clientX-H.current;if(R.current){const _e=R.current.scrollHeight,Ve=R.current.clientHeight,Ce=R.current.scrollWidth,Me=R.current.clientWidth;if(D.current&&O.current&&V.current==="vertical"){const Ae=uo(O.current,"padding","y"),pe=uo(D.current,"margin","y"),de=D.current.offsetHeight,ke=O.current.offsetHeight-de-Ae-pe,De=fe/ke;R.current.scrollTop=F.current+De*(_e-Ve),ge.preventDefault(),m(!0),B.start(Jx,()=>{m(!1)})}if(L.current&&N.current&&V.current==="horizontal"){const Ae=uo(N.current,"padding","x"),pe=uo(L.current,"margin","x"),de=L.current.offsetWidth,ke=N.current.offsetWidth-de-Ae-pe,De=Ee/ke;R.current.scrollLeft=G.current+De*(Ce-Me),ge.preventDefault(),f(!0),j.start(Jx,()=>{f(!1)})}}}),K=Ye(ge=>{P.current=!1,D.current&&V.current==="vertical"&&D.current.releasePointerCapture(ge.pointerId),L.current&&V.current==="horizontal"&&L.current.releasePointerCapture(ge.pointerId)});function Q(ge){const fe=ge.pointerType==="touch";if(v(fe),!fe){const Ee=Rt(C.current,ge.target);l(Ee)}}const te=A.useMemo(()=>({hasOverflowX:!Y.scrollbarXHidden,hasOverflowY:!Y.scrollbarYHidden,overflowXStart:S.xStart,overflowXEnd:S.xEnd,overflowYStart:S.yStart,overflowYEnd:S.yEnd,cornerHidden:Y.cornerHidden}),[Y.scrollbarXHidden,Y.scrollbarYHidden,Y.cornerHidden,S]),ne={role:"presentation",onPointerEnter:Q,onPointerMove:Q,onPointerDown({pointerType:ge}){v(ge==="touch")},onPointerLeave(){l(!1)},style:{position:"relative",[SE.scrollAreaCornerHeight]:`${g.height}px`,[SE.scrollAreaCornerWidth]:`${g.width}px`}},J=Ct("div",t,{state:te,ref:[n,C],props:[ne,s],stateAttributesMapping:h3}),ve=A.useMemo(()=>({handlePointerDown:ae,handlePointerMove:Z,handlePointerUp:K,handleScroll:oe,cornerSize:g,setCornerSize:x,thumbSize:_,setThumbSize:b,touchModality:y,cornerRef:z,scrollingX:u,setScrollingX:f,scrollingY:d,setScrollingY:m,hovering:o,setHovering:l,viewportRef:R,rootRef:C,scrollbarYRef:O,scrollbarXRef:N,thumbYRef:D,thumbXRef:L,rootId:w,hiddenState:Y,setHiddenState:W,overflowEdges:S,setOverflowEdges:T,viewportState:te,overflowEdgeThreshold:ee}),[ae,Z,K,oe,g,_,y,z,u,f,d,m,o,l,R,C,O,N,D,L,w,Y,S,te,ee]);return p.jsxs(mre.Provider,{value:ve,children:[ly.element,J]})});function Ewe(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const Swe=A.createContext(void 0);function wwe(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(i=>{i.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let ed=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({}),lH=!1;function Cwe(){lH||xM||(typeof CSS<"u"&&"registerProperty"in CSS&&[ed.scrollAreaOverflowXStart,ed.scrollAreaOverflowXEnd,ed.scrollAreaOverflowYStart,ed.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),lH=!0)}const Twe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{viewportRef:s,scrollbarYRef:o,scrollbarXRef:l,thumbYRef:u,thumbXRef:f,cornerRef:d,setCornerSize:m,setThumbSize:g,rootId:x,setHiddenState:_,hiddenState:b,handleScroll:y,setHovering:v,setOverflowEdges:S,overflowEdges:T,overflowEdgeThreshold:w}=Nw(),C=ec(),R=A.useRef(!0),O=zn(),N=zn();function D(){const G=s.current,V=o.current,B=l.current,j=u.current,$=f.current,Y=d.current;if(!G)return;const W=G.scrollHeight,ee=G.scrollWidth,oe=G.clientHeight,ae=G.clientWidth,Z=G.scrollTop,K=G.scrollLeft;if(W===0||ee===0)return;const Q=oe>=W,te=ae>=ee,ne=ae/ee,J=oe/W,ve=Math.max(0,ee-ae),ge=Math.max(0,W-oe);let fe=0,Ee=0;te||(C==="rtl"?fe=yu(-K,0,ve):fe=yu(K,0,ve),Ee=ve-fe);const _e=Q?0:yu(Z,0,ge),Ve=Q?0:ge-_e,Ce=te?0:ae,Me=Q?0:oe,Ae=uo(B,"padding","x"),pe=uo(V,"padding","y"),de=uo($,"margin","x"),ke=uo(j,"margin","y"),De=Ce-Ae-de,me=Me-pe-ke,ye=B?Math.min(B.offsetWidth,De):De,xe=V?Math.min(V.offsetHeight,me):me,je=Math.max(sH,ye*ne),Ge=Math.max(sH,xe*J);if(g(Be=>Be.height===Ge&&Be.width===je?Be:{width:je,height:Ge}),V&&j){const Be=V.offsetHeight-Ge-pe-ke,Je=W-oe,ct=Je===0?0:Z/Je,ht=Math.min(Be,Math.max(0,ct*Be));j.style.transform=`translate3d(0,${ht}px,0)`}if(B&&$){const Be=B.offsetWidth-je-Ae-de,Je=ee-ae,ct=Je===0?0:K/Je,ht=C==="rtl"?yu(ct*Be,-Be,0):yu(ct*Be,0,Be);$.style.transform=`translate3d(${ht}px,0,0)`}const gt=yu(fe,0,ve),at=yu(Ee,0,ve),ut=yu(_e,0,ge),$e=yu(Ve,0,ge),pt=[[ed.scrollAreaOverflowXStart,gt],[ed.scrollAreaOverflowXEnd,at],[ed.scrollAreaOverflowYStart,ut],[ed.scrollAreaOverflowYEnd,$e]];for(const[Be,Je]of pt)G.style.setProperty(Be,`${Je}px`);if(Y){if(te||Q)m({width:0,height:0});else if(!te&&!Q){const Be=V?.offsetWidth||0,Je=B?.offsetHeight||0;m({width:Be,height:Je})}}_(Be=>{const Je=Q||te;return Be.scrollbarYHidden===Q&&Be.scrollbarXHidden===te&&Be.cornerHidden===Je?Be:{scrollbarYHidden:Q,scrollbarXHidden:te,cornerHidden:Je}});const Se={xStart:!te&&gt>w.xStart,xEnd:!te&&at>w.xEnd,yStart:!Q&&ut>w.yStart,yEnd:!Q&&$e>w.yEnd};S(Be=>Be.xStart===Se.xStart&&Be.xEnd===Se.xEnd&&Be.yStart===Se.yStart&&Be.yEnd===Se.yEnd?Be:Se)}const L=Ye(()=>{Ur.flushSync(D)});nt(()=>s.current?(Cwe(),wwe(s.current,L)):void 0,[L,s]),nt(()=>{queueMicrotask(L)},[L,b,C]),nt(()=>{s.current?.matches(":hover")&&v(!0)},[s,v]),A.useEffect(()=>{const G=s.current;if(typeof ResizeObserver>"u"||!G)return;const V=new ResizeObserver(L);return V.observe(G),N.start(0,()=>{Promise.all(G.getAnimations({subtree:!0}).map(B=>B.finished)).then(L).catch(()=>{})}),()=>{V.disconnect(),N.clear()}},[L,s,N]);function z(){R.current=!1}const P={role:"presentation",...x&&{"data-id":`${x}-viewport`},...(!b.scrollbarXHidden||!b.scrollbarYHidden)&&{tabIndex:0},className:ly.className,style:{overflow:"scroll"},onScroll(){s.current&&(L(),R.current||y({x:s.current.scrollLeft,y:s.current.scrollTop}),O.start(100,()=>{R.current=!0}))},onWheel:z,onTouchMove:z,onPointerMove:z,onPointerEnter:z,onKeyDown:z},q=A.useMemo(()=>({hasOverflowX:!b.scrollbarXHidden,hasOverflowY:!b.scrollbarYHidden,overflowXStart:T.xStart,overflowXEnd:T.xEnd,overflowYStart:T.yStart,overflowYEnd:T.yEnd,cornerHidden:b.cornerHidden}),[b.scrollbarXHidden,b.scrollbarYHidden,b.cornerHidden,T]),H=Ct("div",t,{ref:[n,s],state:q,props:[P,a],stateAttributesMapping:h3}),F=A.useMemo(()=>({computeThumbPosition:L}),[L]);return p.jsx(Swe.Provider,{value:F,children:H})}),gre=A.createContext(void 0);function Awe(){const e=A.useContext(gre);if(e===void 0)throw new Error(on(54));return e}let wE=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const kwe=A.forwardRef(function(t,n){const{render:r,className:i,orientation:a="vertical",keepMounted:s=!1,...o}=t,{hovering:l,scrollingX:u,scrollingY:f,hiddenState:d,overflowEdges:m,scrollbarYRef:g,scrollbarXRef:x,viewportRef:_,thumbYRef:b,thumbXRef:y,handlePointerDown:v,handlePointerUp:S,rootId:T,thumbSize:w}=Nw(),C=A.useMemo(()=>({hovering:l,scrolling:{horizontal:u,vertical:f}[a],orientation:a,hasOverflowX:!d.scrollbarXHidden,hasOverflowY:!d.scrollbarYHidden,overflowXStart:m.xStart,overflowXEnd:m.xEnd,overflowYStart:m.yStart,overflowYEnd:m.yEnd,cornerHidden:d.cornerHidden}),[l,u,f,a,d,m]),R=ec();A.useEffect(()=>{const P=_.current,q=a==="vertical"?g.current:x.current;if(!q)return;function H(F){if(!(!P||!q||F.ctrlKey)){if(F.preventDefault(),a==="vertical"){if(P.scrollTop===0&&F.deltaY<0)return}else if(P.scrollLeft===0&&F.deltaX<0)return;if(a==="vertical"){if(P.scrollTop===P.scrollHeight-P.clientHeight&&F.deltaY>0)return}else if(P.scrollLeft===P.scrollWidth-P.clientWidth&&F.deltaX>0)return;a==="vertical"?P.scrollTop+=F.deltaY:P.scrollLeft+=F.deltaX}}return q.addEventListener("wheel",H,{passive:!1}),()=>{q.removeEventListener("wheel",H)}},[a,x,g,_]);const O={...T&&{"data-id":`${T}-scrollbar`},onPointerDown(P){if(P.button===0&&P.currentTarget===P.target&&_.current){if(b.current&&g.current&&a==="vertical"){const q=uo(b.current,"margin","y"),H=uo(g.current,"padding","y"),F=b.current.offsetHeight,G=g.current.getBoundingClientRect(),V=P.clientY-G.top-F/2-H+q/2,B=_.current.scrollHeight,j=_.current.clientHeight,$=g.current.offsetHeight-F-H-q,W=V/$*(B-j);_.current.scrollTop=W}if(y.current&&x.current&&a==="horizontal"){const q=uo(y.current,"margin","x"),H=uo(x.current,"padding","x"),F=y.current.offsetWidth,G=x.current.getBoundingClientRect(),V=P.clientX-G.left-F/2-H+q/2,B=_.current.scrollWidth,j=_.current.clientWidth,$=x.current.offsetWidth-F-H-q,Y=V/$;let W;R==="rtl"?(W=(1-Y)*(B-j),_.current.scrollLeft<=0&&(W=-W)):W=Y*(B-j),_.current.scrollLeft=W}v(P)}},onPointerUp:S,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...a==="vertical"&&{top:0,bottom:`var(${SE.scrollAreaCornerHeight})`,insetInlineEnd:0,[wE.scrollAreaThumbHeight]:`${w.height}px`},...a==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${SE.scrollAreaCornerWidth})`,bottom:0,[wE.scrollAreaThumbWidth]:`${w.width}px`}}},N=Ct("div",t,{ref:[n,a==="vertical"?g:x],state:C,props:[O,o],stateAttributesMapping:h3}),D=A.useMemo(()=>({orientation:a}),[a]),L=a==="vertical"?d.scrollbarYHidden:d.scrollbarXHidden;return s||!L?p.jsx(gre.Provider,{value:D,children:N}):null}),Owe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{thumbYRef:s,thumbXRef:o,handlePointerDown:l,handlePointerMove:u,handlePointerUp:f,setScrollingX:d,setScrollingY:m}=Nw(),{orientation:g}=Awe(),x=A.useMemo(()=>({orientation:g}),[g]);return Ct("div",t,{ref:[n,g==="vertical"?s:o],state:x,props:[{onPointerDown:l,onPointerMove:u,onPointerUp(b){g==="vertical"&&m(!1),g==="horizontal"&&d(!1),f(b)},style:{...g==="vertical"&&{height:`var(${wE.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${wE.scrollAreaThumbWidth})`}}},a]})}),Rwe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{cornerRef:s,cornerSize:o,hiddenState:l}=Nw(),u=Ct("div",t,{ref:[n,s],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},a]});return l.cornerHidden?null:u}),bre=A.createContext(void 0);function Nwe(){const e=A.useContext(bre);if(e===void 0)throw new Error(on(63));return e}let uH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const vre={...nc,checked(e){return e?{[uH.checked]:""}:{[uH.unchecked]:""}}},Iwe=A.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a,id:s,inputRef:o,name:l,nativeButton:u=!1,onCheckedChange:f,readOnly:d=!1,required:m=!1,disabled:g=!1,render:x,uncheckedValue:_,...b}=t,{clearErrors:y}=fg(),{state:v,setTouched:S,setDirty:T,validityData:w,setFilled:C,setFocused:R,shouldValidateOnChange:O,validationMode:N,disabled:D,name:L,validation:z}=Ka(),{labelId:P}=$l(),q=D||g,H=L??l,F=Ye(f),G=A.useRef(null),V=Ga(G,o,z.inputRef),B=A.useRef(null),j=ui(),$=k0({id:s,implicit:!1,controlRef:B}),[Y,W]=Wa({controlled:r,default:!!a,name:"Switch",state:"checked"});pg({id:j,commit:z.commit,value:Y,controlRef:B,name:H,getValue:()=>Y}),nt(()=>{G.current&&C(G.current.checked)},[G,C]),Jc(Y,()=>{y(H),T(Y!==w.initialValue),C(Y),O()?z.commit(Y):z.commit(Y,!0)});const{getButtonProps:ee,buttonRef:oe}=ua({disabled:q,native:u}),ae={id:j,role:"switch","aria-checked":Y,"aria-readonly":d||void 0,"aria-labelledby":P,onFocus(){q||R(!0)},onBlur(){const te=G.current;!te||q||(S(!0),R(!1),N==="onBlur"&&z.commit(te.checked))},onClick(te){d||q||(te.preventDefault(),G?.current?.click())}},Z=A.useMemo(()=>zo({checked:Y,disabled:q,id:$,name:H,required:m,style:kd,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(te){if(te.nativeEvent.defaultPrevented)return;const ne=te.target.checked,J=lt(Vr,te.nativeEvent);F?.(ne,J),!J.isCanceled&&W(ne)},onFocus(){B.current?.focus()}},z.getInputValidationProps),[Y,q,V,$,H,F,m,W,z]),K=A.useMemo(()=>({...v,checked:Y,disabled:q,readOnly:d,required:m}),[v,Y,q,d,m]),Q=Ct("span",t,{state:K,ref:[n,B,oe],props:[ae,z.getValidationProps,b,ee],stateAttributesMapping:vre});return p.jsxs(bre.Provider,{value:K,children:[Q,!Y&&H&&_!==void 0&&p.jsx("input",{type:"hidden",name:H,value:_}),p.jsx("input",{...Z})]})}),Dwe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{state:s}=Ka(),o=Nwe(),l={...s,...o};return Ct("span",t,{state:l,ref:n,stateAttributesMapping:vre,props:a})}),yre=A.createContext(void 0);function Lwe(e=!0){const t=A.useContext(yre);if(t===void 0&&!e)throw new Error(on(7));return t}const Pwe=A.forwardRef(function(t,n){const{className:r,defaultPressed:i=!1,disabled:a=!1,form:s,onPressedChange:o,pressed:l,render:u,type:f,value:d,nativeButton:m=!0,...g}=t,x=ui(d||void 0),_=Lwe(),b=_?.value??[],y=_?void 0:i,v=(a||_?.disabled)??!1,[S,T]=Wa({controlled:_?b?.indexOf(x)>-1:l,default:y,name:"Toggle",state:"pressed"}),w=Ye((z,P)=>{x&&_?.setGroupValue?.(x,z,P),o?.(z,P)}),{getButtonProps:C,buttonRef:R}=ua({disabled:v,native:m}),O=A.useMemo(()=>({disabled:v,pressed:S}),[v,S]),N=[R,n],D=[{"aria-pressed":S,onClick(z){const P=!S,q=lt(Vr,z.nativeEvent);w(P,q),!q.isCanceled&&T(P)}},g,C],L=Ct("button",t,{enabled:!_,state:O,ref:N,props:D});return _?p.jsx(C0,{tag:"button",render:u,className:r,state:O,refs:N,props:D}):L});let Mwe=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const cH={multiple(e){return e?{[Mwe.multiple]:""}:null}},jwe=A.forwardRef(function(t,n){const{defaultValue:r,disabled:i=!1,loopFocus:a=!0,onValueChange:s,orientation:o="horizontal",multiple:l=!1,value:u,className:f,render:d,...m}=t,g=s3(),x=A.useMemo(()=>{if(u===void 0)return r??[]},[u,r]),_=(g?.disabled??!1)||i,[b,y]=Wa({controlled:u,default:x,name:"ToggleGroup",state:"value"}),v=Ye((R,O,N)=>{let D;if(l?(D=b.slice(),O?D.push(R):D.splice(b.indexOf(R),1)):D=O?[R]:[],Array.isArray(D)){if(s?.(D,N),N.isCanceled)return;y(D)}}),S=A.useMemo(()=>({disabled:_,multiple:l,orientation:o}),[_,o,l]),T=A.useMemo(()=>({disabled:_,orientation:o,setGroupValue:v,value:b}),[_,o,v,b]),w={role:"group"},C=Ct("div",t,{enabled:!!g,state:S,ref:n,props:[w,m],stateAttributesMapping:cH});return p.jsx(yre.Provider,{value:T,children:g?C:p.jsx(w0,{render:d,className:f,state:S,refs:[n],props:[w,m],stateAttributesMapping:cH,loopFocus:a})})}),xre=A.createContext(void 0);function O0(e){const t=A.useContext(xre);if(t===void 0&&!e)throw new Error(on(72));return t}const Fwe={...BM,disabled:He(e=>e.disabled),instantType:He(e=>e.instantType),isInstantPhase:He(e=>e.isInstantPhase),trackCursorAxis:He(e=>e.trackCursorAxis),disableHoverablePopup:He(e=>e.disableHoverablePopup),lastOpenChangeReason:He(e=>e.openChangeReason),closeDelay:He(e=>e.closeDelay)};class m3 extends mw{constructor(t){super({...Bwe(),...t},{popupRef:A.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new x0},Fwe)}setOpen=(t,n)=>{const r=n.reason,i=r===Tr,a=t&&r===Jv,s=!t&&(r===Ru||r===v0);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const o=()=>{const l={open:t,openChangeReason:r};a?l.instantType="focus":s?l.instantType="dismiss":r===Tr&&(l.instantType=void 0);const u=n.trigger?.id??null;(u||t)&&(l.activeTriggerId=u,l.activeTriggerElement=n.trigger??null),this.update(l)};i?Ur.flushSync(o):o()};static useStore(t,n){const r=Di(()=>t??new m3(n)).current,i=UM({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}}function Bwe(){return{...FM(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function Uwe(e){const{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a="none",actionsRef:s,onOpenChange:o,onOpenChangeComplete:l,handle:u,triggerId:f,defaultTriggerId:d=null,children:m}=e,g=m3.useStore(u?.store,{open:r??n,activeTriggerId:f!==void 0?f:d});g.useControlledProp("open",r,n),g.useControlledProp("activeTriggerId",f,d),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",l);const x=g.useState("open"),_=g.useState("activeTriggerId"),b=g.useState("payload");g.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});const y=!t&&x;nt(()=>{x&&t&&g.setOpen(!1,lt(c0e))},[x,t,g]),g.useSyncedValue("disabled",t),MM(g);const{forceUnmount:v,transitionStatus:S}=jM(y,g),T=g.useState("isInstantPhase"),w=g.useState("instantType"),C=g.useState("lastOpenChangeReason"),R=A.useRef(null);nt(()=>{S==="ending"&&C===Vr||S!=="ending"&&T?(w!=="delay"&&(R.current=w),g.set("instantType","delay")):R.current!==null&&(g.set("instantType",R.current),R.current=null)},[S,T,C,w,g]),nt(()=>{y&&_==null&&g.set("payload",void 0)},[g,_,y]);const O=A.useCallback(()=>{g.setOpen(!1,$we(g,RM))},[g]);A.useImperativeHandle(s,()=>({unmount:v,close:O}),[v,O]);const N=g.useState("floatingRootContext"),D=Mte(N,{enabled:!t}),L=og(N,{enabled:!t,referencePress:!0}),z=A0e(N,{enabled:!t&&a!=="none",axis:a==="none"?void 0:a}),{getReferenceProps:P,getFloatingProps:q,getTriggerProps:H}=Od([D,L,z]),F=A.useMemo(()=>P(),[P]),G=A.useMemo(()=>H(),[H]),V=A.useMemo(()=>q(),[q]);return g.useSyncedValues({floatingRootContext:N,activeTriggerProps:F,inactiveTriggerProps:G,popupProps:V}),p.jsx(xre.Provider,{value:g,children:typeof m=="function"?m({payload:b}):m})}function $we(e,t){const n=lt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const _re=A.createContext(void 0);function zwe(){return A.useContext(_re)}const Hwe=600,Wwe=A.forwardRef(function(t,n){const{className:r,render:i,handle:a,payload:s,disabled:o,delay:l,closeDelay:u,id:f,...d}=t,m=O0(!0),g=a?.store??m;if(!g)throw new Error(on(82));const x=ui(f),_=g.useState("isTriggerActive",x),b=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",x),v=A.useRef(null),S=l??Hwe,T=u??0,{registerTrigger:w,isMountedByThisTrigger:C}=PM(x,v,g,{payload:s,closeDelay:T}),R=zwe(),{delayRef:O,isInstantPhase:N,hasProvider:D}=g0e(b,{open:y});g.useSyncedValue("isInstantPhase",N);const L=g.useState("disabled"),z=o??L,P=g.useState("trackCursorAxis"),q=g.useState("disableHoverablePopup"),H=Bte(b,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!q&&P!=="both"?HM():null,restMs(){const B=R?.delay,j=typeof O.current=="object"?O.current.open:void 0;let $=S;return D&&(j!==0?$=l??B??S:$=0),$},delay(){const B=typeof O.current=="object"?O.current.close:void 0;let j=T;return u==null&&D&&(j=B),{close:j}},triggerElementRef:v,isActiveTrigger:_}),F=A.useMemo(()=>({open:y}),[y]),G=g.useState("triggerProps",C);return Ct("button",t,{state:F,ref:[n,w,v],props:[H,G,{id:x},d],stateAttributesMapping:xw})}),Ere=A.createContext(void 0);function Vwe(){const e=A.useContext(Ere);if(e===void 0)throw new Error(on(70));return e}const qwe=A.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return O0().useState("mounted")||r?p.jsx(Ere.Provider,{value:r,children:p.jsx(fwe,{ref:n,...i})}):null}),Sre=A.createContext(void 0);function wre(){const e=A.useContext(Sre);if(e===void 0)throw new Error(on(71));return e}const Gwe=A.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="top",align:l="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_=!1,collisionAvoidance:b=bM,...y}=t,v=O0(),S=Vwe(),T=v.useState("open"),w=v.useState("mounted"),C=v.useState("trackCursorAxis"),R=v.useState("disableHoverablePopup"),O=v.useState("floatingRootContext"),N=v.useState("instantType"),D=v.useState("transitionStatus"),L=T0({anchor:a,positionMethod:s,floatingRootContext:O,mounted:w,side:o,sideOffset:u,align:l,alignOffset:f,collisionBoundary:d,collisionPadding:m,sticky:x,arrowPadding:g,disableAnchorTracking:_,keepMounted:S,collisionAvoidance:b,adaptiveOrigin:ene}),z=A.useMemo(()=>{const F={};return(!T||C==="both"||R)&&(F.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...L.positionerStyles,...F}}},[T,C,R,w,L.positionerStyles]),P=A.useMemo(()=>({open:T,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:C!=="none"?"tracking-cursor":N}),[T,L.side,L.align,L.anchorHidden,C,N]),q=A.useMemo(()=>({...P,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[P,L.arrowRef,L.arrowStyles,L.arrowUncentered]),H=Ct("div",t,{state:P,props:[z,cg(D),y],ref:[n,v.useStateSetter("positionerElement")],stateAttributesMapping:Qa});return p.jsx(Sre.Provider,{value:q,children:H})}),Kwe={...Qa,...Za},Ywe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,s=O0(),{side:o,align:l}=wre(),u=s.useState("open"),f=s.useState("mounted"),d=s.useState("instantType"),m=s.useState("transitionStatus"),g=s.useState("popupProps"),x=s.useState("payload"),_=s.useState("popupElement"),b=s.useState("positionerElement"),y=s.useState("floatingRootContext"),v=ec();Li({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}});function S(){y.context.events.emit("measure-layout")}function T(D,L){y.context.events.emit("measure-layout-complete",{previousDimensions:D,nextDimensions:L})}const w=A.useCallback(()=>s.context.triggerElements.size>1,[s]);dwe({popupElement:_,positionerElement:b,mounted:f,content:x,enabled:w,onMeasureLayout:S,onMeasureLayoutComplete:T,side:o,direction:v});const C=s.useState("disabled"),R=s.useState("closeDelay");Fte(y,{enabled:!C,closeDelay:R});const O=A.useMemo(()=>({open:u,side:o,align:l,instant:d,transitionStatus:m}),[u,o,l,d,m]);return Ct("div",t,{state:O,ref:[n,s.context.popupRef,s.useStateSetter("popupElement")],props:[g,cg(m),a],stateAttributesMapping:Kwe})}),Xwe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,o=O0().useState("instantType"),{open:l,arrowRef:u,side:f,align:d,arrowUncentered:m,arrowStyles:g}=wre(),x=A.useMemo(()=>({open:l,side:f,align:d,uncentered:m,instant:o}),[l,f,d,m,o]);return Ct("div",t,{state:x,ref:[n,u],props:[{style:g,"aria-hidden":!0},a],stateAttributesMapping:Qa})}),Zwe=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,a=A.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),s=A.useMemo(()=>({open:n,close:r}),[n,r]);return p.jsx(_re.Provider,{value:a,children:p.jsx(m0e,{delay:s,timeoutMs:i,children:t.children})})};function Qwe(e){return Ct(e.defaultTagName??"div",e,e)}function Jwe({className:e,...t}){return p.jsx("div",{"data-slot":"input-group",role:"group",className:Ue("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot=input-group-control]:focus-visible]:ring-inset has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[[data-slot][aria-invalid=true]]:ring-inset h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const eCe=Cd("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function tCe({className:e,align:t="inline-start",...n}){return p.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Ue(eCe({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const nCe=Cd("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Cre({className:e,type:t="button",variant:n="ghost",size:r="xs",...i}){return p.jsx(Ie,{type:t,"data-size":r,variant:n,className:Ue(nCe({size:r}),e),...i})}function rCe({className:e,...t}){return p.jsx(Xt,{"data-slot":"input-group-control",className:Ue("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const iCe=FSe;function aCe({className:e,children:t,...n}){return p.jsxs(hSe,{"data-slot":"combobox-trigger",className:Ue("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,p.jsx(se,{icon:A0,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function sCe({className:e,...t}){return p.jsx(xSe,{"data-slot":"combobox-clear",render:p.jsx(Cre,{variant:"ghost",size:"icon-xs"}),className:Ue(e),...t,children:p.jsx(se,{icon:Xr,strokeWidth:2,className:"pointer-events-none"})})}function oCe({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return p.jsxs(Jwe,{className:Ue("w-auto",e),children:[p.jsx(vSe,{render:p.jsx(rCe,{disabled:n}),...a}),p.jsxs(tCe,{align:"inline-end",children:[r&&p.jsx(Cre,{size:"icon-xs",variant:"ghost",render:p.jsx(aCe,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),i&&p.jsx(sCe,{disabled:n})]}),t]})}function lCe({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:i=0,anchor:a,...s}){return p.jsx(TSe,{children:p.jsx(ASe,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:"isolate z-50",children:p.jsx(OSe,{"data-slot":"combobox-content","data-chips":!!a,className:Ue("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...s})})})}function uCe({className:e,...t}){return p.jsx(wSe,{"data-slot":"combobox-list",className:Ue("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function cCe({className:e,children:t,...n}){return p.jsxs(ISe,{"data-slot":"combobox-item",className:Ue("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,p.jsx(BSe,{render:p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:p.jsx(se,{icon:Lr,strokeWidth:2,className:"pointer-events-none"})})]})}function dCe({className:e,...t}){return p.jsx(DSe,{"data-slot":"combobox-empty",className:Ue("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}const fCe=Cd("hover:text-foreground hover:bg-accent/20 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[state=on]:hover:bg-accent gap-1 rounded-md text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-3.5 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border-input hover:bg-accent/20 border bg-transparent"},size:{default:"h-7 min-w-7 px-2",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-1.5 text-[0.625rem] [&_svg:not([class*='size-'])]:size-3",lg:"h-8 min-w-8 px-2"}},defaultVariants:{variant:"default",size:"default"}}),Tre=A.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function pCe({className:e,variant:t,size:n,spacing:r=0,orientation:i="horizontal",children:a,...s}){return p.jsx(jwe,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:Ue("rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",e),...s,children:p.jsx(Tre.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function dH({className:e,children:t,variant:n="default",size:r="default",...i}){const a=A.useContext(Tre);return p.jsx(Pwe,{"data-slot":"toggle-group-item","data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:Ue("group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",fCe({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}async function xt(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Request failed"}));throw new Error(r.error||"Request failed")}return n.json()}const vd="";function g3(){return yn({queryKey:["tasks"],queryFn:()=>xt(`${vd}/api/tasks`)})}function Are(e){return yn({queryKey:["tasks",e],queryFn:()=>xt(`${vd}/api/tasks/${e}`),enabled:!!e})}function hCe(){const e=kn();return fn({mutationFn:t=>xt(`${vd}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function mCe(){const e=kn();return fn({mutationFn:({taskId:t,status:n,position:r})=>xt(`${vd}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:r})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function Iw(){const e=kn();return fn({mutationFn:({taskId:t,updates:n})=>xt(`${vd}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function Dw(){const e=kn();return fn({mutationFn:({taskId:t,deleteLinkedWorktree:n})=>{const r=n?`${vd}/api/tasks/${t}?deleteLinkedWorktree=true`:`${vd}/api/tasks/${t}`;return xt(r,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}function gCe(){const e=kn();return fn({mutationFn:({ids:t,deleteLinkedWorktrees:n})=>xt(`${vd}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t,deleteLinkedWorktrees:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}const R0="";function bCe(e){return yn({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return xt(`${R0}/api/fs/list${t}`)},enabled:e!==null})}function kre(e){return yn({queryKey:["git","branches",e],queryFn:()=>xt(`${R0}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function vCe(e,t={}){const{staged:n=!1,ignoreWhitespace:r=!1,includeUntracked:i=!1,baseBranch:a}=t;return yn({queryKey:["git","diff",e,n,r,i,a],queryFn:()=>{const s=new URLSearchParams({path:e,...n&&{staged:"true"},...r&&{ignoreWhitespace:"true"},...i&&{includeUntracked:"true"},...a&&{baseBranch:a}});return xt(`${R0}/api/git/diff?${s}`)},enabled:!!e,refetchInterval:5e3})}function yCe(e){return yn({queryKey:["git","status",e],queryFn:()=>xt(`${R0}/api/git/status?path=${encodeURIComponent(e)}`),enabled:!!e,refetchInterval:5e3})}async function xCe(e){return xt(`${R0}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const Hl="",Ln={PORT:"server.port",WORKTREE_BASE_PATH:"worktree_base_path",HOME_DIR:"home_dir",DEFAULT_GIT_REPOS_DIR:"paths.defaultGitReposDir",EDITOR_APP:"editor.app",EDITOR_HOST:"editor.host",EDITOR_SSH_PORT:"editor.sshPort",LINEAR_API_KEY:"integrations.linearApiKey",GITHUB_PAT:"integrations.githubPat",LANGUAGE:"appearance.language",SYNC_CLAUDE_CODE_THEME:"appearance.syncClaudeCodeTheme",CLAUDE_CODE_LIGHT_THEME:"appearance.claudeCodeLightTheme",CLAUDE_CODE_DARK_THEME:"appearance.claudeCodeDarkTheme"},_Ce=7777;function js(e){return yn({queryKey:["config",e],queryFn:()=>xt(`${Hl}/api/config/${e}`)})}function Ore(){const e=js(Ln.PORT);return{...e,data:e.data?.value??_Ce,isDefault:e.data?.isDefault??!0}}function ECe(){const e=js(Ln.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??""}}function SCe(){const e=js(Ln.HOME_DIR);return{...e,data:e.data?.value??""}}function b3(){const e=js(Ln.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function N0(){const e=js(Ln.EDITOR_APP);return{...e,data:e.data?.value??"vscode",isDefault:e.data?.isDefault??!0}}function I0(){const e=js(Ln.EDITOR_HOST);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function D0(){const e=js(Ln.EDITOR_SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function wCe(){const e=js(Ln.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function CCe(){const e=js(Ln.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function TCe(){const e=js(Ln.LANGUAGE);return{...e,data:e.data?.value??null,isDefault:e.data?.isDefault??!0}}function ACe(){const e=js(Ln.SYNC_CLAUDE_CODE_THEME);return{...e,data:!!e.data?.value,isDefault:e.data?.isDefault??!0}}const fH=["light","light-ansi","light-daltonized","dark","dark-ansi","dark-daltonized"];function kCe(){const e=js(Ln.CLAUDE_CODE_LIGHT_THEME);return{...e,data:e.data?.value??"light-ansi",isDefault:e.data?.isDefault??!0}}function OCe(){const e=js(Ln.CLAUDE_CODE_DARK_THEME);return{...e,data:e.data?.value??"dark-ansi",isDefault:e.data?.isDefault??!0}}function Rre(){const e=kn();return fn({mutationFn:({key:t,value:n})=>xt(`${Hl}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]}),n===Ln.GITHUB_PAT&&(e.invalidateQueries({queryKey:["github-user"]}),e.invalidateQueries({queryKey:["github-prs"]}),e.invalidateQueries({queryKey:["github-issues"]}),e.invalidateQueries({queryKey:["github-orgs"]}))}})}function RCe(){const e=kn();return fn({mutationFn:t=>xt(`${Hl}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function NCe(){return yn({queryKey:["config","notifications"],queryFn:()=>xt(`${Hl}/api/config/notifications`)})}function ICe(){const e=kn();return fn({mutationFn:t=>xt(`${Hl}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function DCe(){return fn({mutationFn:e=>xt(`${Hl}/api/config/notifications/test/${e}`,{method:"POST"})})}function LCe(){return yn({queryKey:["config","z-ai"],queryFn:()=>xt(`${Hl}/api/config/z-ai`)})}function PCe(){const e=kn();return fn({mutationFn:t=>xt(`${Hl}/api/config/z-ai`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","z-ai"]}),e.invalidateQueries({queryKey:["monitoring","claude-usage"]})}})}function Nre(){return yn({queryKey:["config","developer-mode"],queryFn:()=>xt(`${Hl}/api/config/developer-mode`),staleTime:1/0})}function MCe(){return fn({mutationFn:()=>xt(`${Hl}/api/config/restart`,{method:"POST"})})}const Hu="";function hg(){return yn({queryKey:["repositories"],queryFn:()=>xt(`${Hu}/api/repositories`)})}function jCe(e){return yn({queryKey:["repositories",e],queryFn:()=>xt(`${Hu}/api/repositories/${e}`),enabled:!!e})}function Ire(){const e=kn();return fn({mutationFn:t=>xt(`${Hu}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function FCe(){const e=kn();return fn({mutationFn:t=>xt(`${Hu}/api/repositories/clone`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function BCe(){const e=kn();return fn({mutationFn:({id:t,updates:n})=>xt(`${Hu}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function Dre(){const e=kn();return fn({mutationFn:({id:t,deleteDirectory:n=!1})=>{const r=n?`${Hu}/api/repositories/${t}?deleteDirectory=true`:`${Hu}/api/repositories/${t}`;return xt(r,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function UCe(){return fn({mutationFn:e=>xt(`${Hu}/api/repositories/scan`,{method:"POST",body:JSON.stringify(e?{directory:e}:{})})})}function $Ce(){const e=kn();return fn({mutationFn:t=>xt(`${Hu}/api/repositories/bulk`,{method:"POST",body:JSON.stringify({repositories:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function mg({className:e,children:t,...n}){return p.jsxs(_we,{"data-slot":"scroll-area",className:Ue("relative",e),...n,children:[p.jsx(Twe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),p.jsx(zCe,{}),p.jsx(Rwe,{})]})}function zCe({className:e,orientation:t="vertical",...n}){return p.jsx(kwe,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Ue("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:p.jsx(Owe,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function td({open:e,onOpenChange:t,onSelect:n,initialPath:r}){const[i,a]=A.useState(r||null),[s,o]=A.useState(""),[l,u]=A.useState("");A.useEffect(()=>{e&&(a(r||null),o(""),u(""))},[e,r]);const{data:f,isLoading:d,error:m}=bCe(e?i??"":null),g=S=>{f&&(a(f.path+"/"+S),u(""))},x=()=>{f?.parent&&f.parent!==f.path&&(a(f.parent),u(""))},_=()=>{a(null),u("")},b=()=>{s.trim()&&(a(s.trim()),u(""))},y=S=>{n(S),t(!1)},v=f?.entries.filter(S=>S.name.toLowerCase().includes(l.toLowerCase()));return p.jsx(Yo,{open:e,onOpenChange:t,children:p.jsxs(Xo,{className:"sm:max-w-lg overflow-x-hidden max-w-[calc(100vw-2rem)]",children:[p.jsxs(Bl,{children:[p.jsx(Ul,{children:"Select Git Repository"}),p.jsx(mp,{children:"Choose an existing git repository"})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),p.jsx(TEe,{}),p.jsxs("div",{className:"space-y-1 min-w-0",children:[p.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),p.jsxs("div",{className:"flex gap-2 min-w-0",children:[p.jsx(Xt,{value:s,onChange:S=>o(S.target.value),placeholder:"/path/to/your/project",onKeyDown:S=>S.key==="Enter"&&b(),className:"flex-1 min-w-0"}),p.jsx(Ie,{variant:"outline",size:"sm",onClick:b,className:"shrink-0",children:"Go"})]})]}),p.jsxs("div",{className:"space-y-1 min-w-0",children:[p.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),p.jsxs("div",{className:"relative",children:[p.jsx(se,{icon:dg,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),p.jsx(Xt,{value:l,onChange:S=>u(S.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx(Ie,{variant:"outline",size:"icon-sm",onClick:_,title:"Home",className:"shrink-0",children:p.jsx(se,{icon:Qxe,size:14,strokeWidth:2})}),p.jsx(Ie,{variant:"outline",size:"icon-sm",onClick:x,disabled:!f||f.parent===f.path,title:"Parent directory",className:"shrink-0",children:p.jsx(se,{icon:KM,size:14,strokeWidth:2})}),p.jsx("code",{className:"min-w-0 flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate overflow-hidden",children:f?.path||"~"}),p.jsxs(Ie,{variant:"outline",size:"sm",onClick:()=>f&&y(f.path),disabled:!f,className:"shrink-0 max-sm:px-2",title:"Select current directory",children:[p.jsx(se,{icon:kD,size:14,strokeWidth:2,className:"sm:hidden"}),p.jsx("span",{className:"max-sm:hidden",children:"Select Current"})]})]}),p.jsx(mg,{className:"h-64 border rounded-md min-w-0",children:p.jsxs("div",{className:"p-1 min-w-0",children:[d&&p.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),m&&p.jsx("div",{className:"text-destructive text-xs p-3",children:m.message}),f&&v&&p.jsxs(p.Fragment,{children:[v.length===0&&p.jsx("div",{className:"text-muted-foreground text-xs p-3",children:l?"No matches found":"Empty directory"}),v.map(S=>p.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group min-w-0",children:S.type==="directory"?p.jsxs(p.Fragment,{children:[p.jsx(se,{icon:S.isGitRepo?kD:sa,size:16,strokeWidth:2,className:"text-accent shrink-0"}),p.jsx("button",{onClick:()=>g(S.name),className:"flex-1 text-left text-xs truncate hover:underline min-w-0",children:S.name}),S.isGitRepo&&p.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-accent/50 text-accent font-medium shrink-0",children:[p.jsx("span",{className:"max-sm:hidden",children:"git repo"}),p.jsx("span",{className:"sm:hidden",children:"git"})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"w-4 shrink-0"}),p.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate min-w-0",children:S.name})]})},S.name))]})]})}),p.jsxs(Lu,{children:[p.jsx(Ff,{render:p.jsx(Ie,{variant:"outline"}),children:"Cancel"}),p.jsx(Ie,{onClick:()=>f&&y(f.path),disabled:!f,children:"Select Path"})]})]})})}function HCe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function WCe(e){const t=e.trim().split(/\s+/).slice(0,4).join(" "),n=HCe(t);if(!n)return"";const r=Math.random().toString(36).substring(2,6);return`${n}-${r}`}function v3({open:e,onOpenChange:t,defaultRepository:n,showTrigger:r=!0}={}){const{t:i}=It("tasks"),{t:a}=It("common"),[s,o]=A.useState(!1),l=e??s,u=t??o,[f,d]=A.useState(!1),[m,g]=A.useState(""),[x,_]=A.useState(""),[b,y]=A.useState(""),[v,S]=A.useState(""),[T,w]=A.useState(""),[C,R]=A.useState(""),[O,N]=A.useState("default"),[D,L]=A.useState(!1),[z,P]=A.useState(null),[q,H]=A.useState("browse"),[F,G]=A.useState(""),[V,B]=A.useState(null),[j,$]=A.useState(!1),Y=Zr(),W=hCe(),ee=Ire(),oe=A.useRef(null),{data:ae}=ECe(),{data:Z}=b3(),{data:K}=hg(),{data:Q,isLoading:te}=kre(b||null),ne=z?K?.find(Ce=>Ce.id===z):null,J=A.useMemo(()=>{if(!K)return[];if(ne&&F===ne.displayName||!F.trim())return K;const Ce=F.toLowerCase();return K.filter(Me=>Me.displayName.toLowerCase().includes(Ce)||Me.path.toLowerCase().includes(Ce))},[K,F,ne]);A.useEffect(()=>{K&&K.length>0?H("saved"):H("browse")},[K]),A.useEffect(()=>{if(l){if(n)P(n.id),y(n.path),G(n.displayName),H("saved");else if(K&&K.length>0){const Ce=K[0];P(Ce.id),y(Ce.path),G(Ce.displayName),H("saved")}}},[l,n,K]),A.useEffect(()=>{S(Q?Q.defaultBranch||Q.branches[0]||"main":"")},[Q,b]);const ve=Ce=>{g(Ce),R(WCe(Ce))},ge=async Ce=>{B(null),$(!0);try{if(!(await xCe(Ce)).isGitRepo){B(i("createModal.errors.notGitRepo")),$(!1);return}if(y(Ce),P(null),!K?.find(pe=>pe.path===Ce)){const pe=Ce.split("/").pop()||"Unknown";ee.mutate({path:Ce,displayName:pe})}}catch(Me){B(Me instanceof Error?Me.message:i("createModal.errors.validationFailed"))}finally{$(!1)}},fe=Ce=>{if(Ce.preventDefault(),!m.trim()||!b)return;const Me=b.split("/").pop()||"repo",Ae=T.trim()||C,pe=`${ae}/${Ae}`;W.mutate({title:m.trim(),description:x.trim(),aiMode:O,repoPath:b,repoName:Me,baseBranch:v||"main",branch:Ae,worktreePath:pe,copyFiles:ne?.copyFiles||void 0,startupScript:ne?.startupScript||void 0,claudeOptions:ne?.claudeOptions||void 0},{onSuccess:de=>{const ke=x.trim()?{aiMode:O,description:x.trim()}:{aiMode:O};u(!1),g(""),_(""),y(""),S(""),w(""),R(""),N("default"),L(!1),P(null),G(""),B(null),H(K&&K.length>0?"saved":"browse"),Y({to:"/tasks/$taskId",params:{taskId:de.id},state:ke})},onError:de=>{Lt.error(i("createModal.errors.createFailed"),{description:de instanceof Error?de.message:String(de)})}})},Ee=!W.isPending&&!!m.trim()&&!!b;ga("meta+enter",()=>{oe.current&&oe.current.requestSubmit()},{enabled:l&&Ee,allowInInput:!0,ignoreContext:!0,deps:[l,Ee]});const _e=T.trim()||C,Ve=_e?`${ae}/${_e}`:"";return p.jsxs(p.Fragment,{children:[p.jsxs(Yo,{open:l,onOpenChange:u,children:[r&&p.jsxs(cEe,{render:p.jsx(Ie,{size:"sm"}),children:[p.jsx(se,{icon:e3,size:16,strokeWidth:2,"data-slot":"icon",className:"-translate-y-px"}),i("newTask")]}),p.jsx(Xo,{className:"sm:max-w-md max-h-[80dvh] flex flex-col overflow-hidden",children:p.jsxs("form",{ref:oe,onSubmit:fe,className:"flex flex-col min-h-0 flex-1",children:[p.jsxs(Bl,{className:"shrink-0",children:[p.jsx(Ul,{children:i("createModal.title")}),p.jsx(mp,{children:i("createModal.description")})]}),p.jsxs(mm,{className:"mt-4 pb-4 overflow-y-auto min-h-0 flex-1",children:[p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"title",children:i("createModal.fields.title")}),p.jsx(Xt,{id:"title",value:m,onChange:Ce=>ve(Ce.target.value),placeholder:i("createModal.fields.titlePlaceholder"),required:!0})]}),p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"description",children:i("createModal.fields.description")}),p.jsx(One,{id:"description",value:x,onValueChange:Ce=>{_(Ce),D||N(Ce.trim()?"plan":"default")},placeholder:i("createModal.fields.descriptionPlaceholder"),rows:2})]}),p.jsxs(yr,{children:[p.jsx(xr,{children:i("createModal.fields.aiMode")}),p.jsxs(pCe,{value:[O],onValueChange:Ce=>{const Me=Array.isArray(Ce)?Ce[0]:Ce;Me&&(N(Me),L(!0))},className:"w-full",variant:"outline",children:[p.jsx(dH,{value:"plan",className:"flex-1",children:i("createModal.aiModes.plan")}),p.jsx(dH,{value:"default",className:"flex-1",children:i("createModal.aiModes.default")})]})]}),p.jsxs(yr,{children:[p.jsx(xr,{children:i("createModal.fields.repository")}),p.jsxs(Mo,{value:q,onValueChange:Ce=>{H(Ce),B(null)},children:[p.jsxs(jo,{children:[p.jsx(_r,{value:"saved",disabled:!K?.length,children:i("createModal.tabs.saved")}),p.jsx(_r,{value:"browse",children:i("createModal.tabs.browse")})]}),p.jsx(Pr,{value:"saved",className:"mt-2",children:p.jsxs(iCe,{value:z||"",onValueChange:Ce=>{const Me=K?.find(Ae=>Ae.id===Ce);Me&&(P(Ce),y(Me.path),G(Me.displayName),B(null))},inputValue:F,onInputValueChange:Ce=>{G(Ce),ne&&Ce!==ne.displayName&&P(null)},itemToStringLabel:Ce=>K?.find(Me=>Me.id===Ce)?.displayName||"",children:[p.jsx(oCe,{placeholder:i("createModal.searchRepositories"),className:"w-full"}),p.jsx(lCe,{children:p.jsxs(uCe,{children:[p.jsx(dCe,{children:i("createModal.noRepositoriesFound")}),J.map(Ce=>p.jsx(cCe,{value:Ce.id,children:Ce.displayName},Ce.id))]})})]})}),p.jsx(Pr,{value:"browse",className:"mt-2",children:p.jsxs(Ie,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>d(!0),disabled:j,children:[p.jsx(se,{icon:sa,size:14,strokeWidth:2,className:"mr-2"}),j?p.jsx("span",{className:"text-muted-foreground",children:a("status.validating")}):b&&!z?p.jsx("span",{className:"truncate",children:b}):p.jsx("span",{className:"text-muted-foreground group-hover/button:text-accent-foreground",children:i("createModal.selectFolder")})]})})]}),V&&p.jsx("p",{className:"text-sm text-destructive",children:V}),b&&!V&&p.jsx(io,{className:"font-mono text-xs truncate",children:b})]}),p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"baseBranch",children:i("createModal.fields.baseBranch")}),p.jsxs(Gi,{value:v,onValueChange:Ce=>S(Ce??""),disabled:!b||te,children:[p.jsx(Yi,{className:"w-full",children:p.jsx(Ki,{children:v||p.jsx("span",{className:"text-muted-foreground",children:i(b?te?"createModal.loadingBranches":"createModal.selectBranch":"createModal.selectRepositoryFirst")})})}),p.jsx(Xi,{children:Q?.branches.map(Ce=>p.jsxs(wn,{value:Ce,children:[Ce,Ce===Q.current&&p.jsx("span",{className:"text-muted-foreground ml-2",children:i("createModal.current")})]},Ce))})]})]}),p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"branch",children:i("createModal.fields.branchName")}),p.jsx(Xt,{id:"branch",value:T,onChange:Ce=>w(Ce.target.value),placeholder:C||i("createModal.fields.branchPlaceholder")}),Ve&&p.jsxs(io,{children:[i("createModal.worktreePrefix")," ",Ve]}),!T.trim()&&C&&p.jsx(io,{children:i("createModal.branchAutoGenerated",{branch:C})})]})]}),p.jsxs(Lu,{className:"mt-4 shrink-0",children:[p.jsx(Ff,{render:p.jsx(Ie,{variant:"outline",type:"button",className:"border-destructive text-destructive hover:bg-destructive hover:text-white"}),children:a("buttons.cancel")}),p.jsx(Ie,{type:"submit",disabled:W.isPending||!m.trim()||!b,children:W.isPending?a("status.creating"):i("createModal.createTask")})]})]})})]}),p.jsx(td,{open:f,onOpenChange:d,onSelect:ge,initialPath:Z||void 0})]})}const pH=[{to:"/tasks",icon:pm,labelKey:"header.tasks",matchPrefix:!0},{to:"/terminals",icon:_w,labelKey:"header.terminals",matchPrefix:!1},{to:"/repositories",icon:Cu,labelKey:"header.repositories",matchPrefix:!0},{to:"/apps",icon:tp,labelKey:"header.apps",matchPrefix:!0},{to:"/review",icon:Du,labelKey:"header.review",matchPrefix:!0},{to:"/monitoring",icon:ane,labelKey:"header.monitoring",matchPrefix:!0}];function VCe({onNewTaskRef:e,onOpenCommandPalette:t}){const{t:n}=It("navigation"),{location:r}=xi(),i=r.pathname,[a,s]=A.useState(!1),o=(l,u)=>u?i.startsWith(l):i===l;return A.useEffect(()=>{e?.(()=>s(!0))},[e]),p.jsxs("header",{className:"sticky top-0 z-10 flex h-10 shrink-0 items-center justify-between border-b border-border bg-card px-4 max-sm:px-2",children:[p.jsxs("div",{className:"flex min-w-0 items-center gap-4 max-sm:gap-2",children:[p.jsx(d_e,{className:"sm:hidden",children:p.jsx(f_e,{children:p.jsxs(p_e,{children:[p.jsxs(m_e,{className:"bg-transparent hover:bg-muted/50 data-open:bg-muted/50 gap-1 px-2",children:[p.jsx(se,{icon:cne,size:16,strokeWidth:2}),p.jsx("span",{className:"sr-only",children:"Menu"})]}),p.jsx(g_e,{className:"min-w-48",children:pH.map(l=>p.jsxs(v_e,{href:l.to,active:o(l.to,l.matchPrefix),render:p.jsx(cr,{to:l.to}),children:[p.jsx(se,{icon:l.icon,size:16,strokeWidth:2}),n(l.labelKey)]},l.to))})]})})}),p.jsx("nav",{className:"hidden items-center gap-1 sm:flex",children:pH.map(l=>{const u=o(l.to,l.matchPrefix);return p.jsxs(cr,{to:l.to,className:Ue("relative flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium transition-colors",u?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",u?"after:opacity-100":"after:opacity-0"),children:[p.jsx(se,{icon:l.icon,size:16,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{children:n(l.labelKey)})]},l.to)})})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[p.jsx(v3,{open:a,onOpenChange:s}),p.jsx(Ie,{variant:"ghost",size:"icon-sm",onClick:t,title:n("header.commandPalette",{shortcut:"⌘K"}),className:"hidden sm:inline-flex",children:p.jsx(se,{icon:TD,size:16,strokeWidth:2})}),p.jsx("a",{href:"https://www.vibora.dev/guide/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center rounded-md p-1.5 text-foreground/60 transition-colors hover:text-foreground",title:n("header.help"),children:p.jsx(se,{icon:lne,size:16,strokeWidth:2})}),p.jsx(cr,{to:"/settings",className:Ue("relative flex items-center justify-center rounded-md p-1.5 transition-colors",i==="/settings"?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",i==="/settings"?"after:opacity-100":"after:opacity-0"),children:p.jsx(se,{icon:fne,size:16,strokeWidth:2})})]})]})}function qCe(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const GCe=10,KCe=2e3;function YCe(){const e=kn(),t=Zr(),{resolvedTheme:n}=Sd(),r=A.useRef(null),i=A.useRef(void 0),a=A.useRef(0),s=A.useRef(void 0),o=A.useCallback(u=>{try{const f=JSON.parse(u.data);if(f.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(f.type==="notification"&&"payload"in f){let d=function(){const L=S&&!T?"/goat.jpeg":"/logo.png";if(y!==!1){const P={description:x,icon:p.jsx("img",{src:L,alt:"",className:"size-8 shrink-0 aspect-square rounded-sm object-cover"}),...b&&{action:{label:"View",onClick:()=>t({to:"/tasks/$taskId",params:{taskId:b}})}}};switch(_){case"success":Lt.success(g,P);break;case"error":Lt.error(g,P);break;case"warning":Lt.warning(g,P);break;default:Lt.info(g,P);break}}if(v!==!1&&"Notification"in window&&window.parent===window&&Notification.permission==="granted"&&new Notification(g,{body:x,icon:L,tag:m}),S){const q="vibora:lastSoundPlayed",H=Date.now(),F=localStorage.getItem(q);if(F){const V=parseInt(F.split(":")[0]);if(H-V<1e3)return}const G=`${H}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(q,G),setTimeout(()=>{if(localStorage.getItem(q)!==G)return;let V=!1;const B=()=>{if(V)return;V=!0,new Audio("/sounds/goat-bleat.mp3").play().catch(()=>{})},j=new Audio("/api/uploads/sound");j.onerror=B,j.play().catch(B)},50)}window.parent!==window&&window.parent.postMessage({type:"vibora:notification",title:g,message:x,notificationType:_},"*")};const{id:m,title:g,message:x,notificationType:_,taskId:b,showToast:y,showDesktop:v,playSound:S,isCustomSound:T}=f.payload,w=`vibora:notification:${m}`,C=50,R=1e4;if(localStorage.getItem(w))return;const N=`${Date.now()}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(w,N),setTimeout(()=>{localStorage.getItem(w)===N&&(setTimeout(()=>localStorage.removeItem(w),R),d())},C)}}catch{}},[e,t,n]),l=A.useCallback(()=>{const u=r.current;if(u&&(u.readyState===WebSocket.CONNECTING||u.readyState===WebSocket.OPEN))return;const f=qCe(),d=new WebSocket(f);r.current=d,d.onopen=()=>{a.current=0},d.onmessage=o,d.onclose=()=>{r.current===d&&(r.current=null),a.current<GCe&&(a.current++,i.current=setTimeout(()=>{s.current?.()},KCe))},d.onerror=()=>{}},[o]);s.current=l,A.useEffect(()=>{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[]),A.useEffect(()=>(l(),()=>{i.current&&clearTimeout(i.current);const u=r.current;u&&(u.readyState===WebSocket.OPEN&&u.close(),r.current=null)}),[l])}const XCe={save:"Save Changes",cancel:"Cancel",delete:"Delete",create:"Create",reset:"Reset to default",browse:"Browse",clearFilters:"Clear filters"},ZCe={loading:"Loading...",saving:"Saving...",saved:"Saved",error:"Error",calculating:"calculating...",validating:"Validating...",creating:"Creating...",deleting:"Deleting...",loggingIn:"Logging in...",uploading:"Uploading..."},QCe={justNow:"just now",minuteAgo:"1 minute ago",minutesAgo:"{{count}} minutes ago",hourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",dayAgo:"1 day ago",daysAgo:"{{count}} days ago"},JCe={one:"{{count}} result",other:"{{count}} results"},eTe={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},tTe={loginTitle:"Login to Vibora",username:"Username",password:"Password",login:"Login",loginFailed:"Login failed"},nTe={sentToClaude:"Sent to Claude Code",noTerminal:"No terminal available",syncedFromMain:"Synced from main",mergedToMain:"Merged to main",pushedToOrigin:"Pushed to origin",parentSynced:"Parent synced with origin",prCreated:"PR created",prExists:"PR already exists"},rTe={imageUploadFailed:"Failed to upload image",terminalNotConnected:"Terminal not connected",terminalNotConnectedDesc:"Please wait for the connection to establish"},iTe={manualDnsRequired:"Manual DNS required",manualDnsRequiredDesc:"Cloudflare API token not configured. You must create DNS records manually for your domains.",deployToApply:"Deploy to apply changes",deployToApplyDesc:"Domain configuration saved. Deploy the app for changes to take effect.",unknownRepo:"Unknown repo",service:"service",services:"services",exposed:"exposed",lastDeployed:"Last deployed",stop:"Stop",deploy:"Deploy",deploying:"Deploying...",building:"Building...",cancelDeploy:"Cancel",cancelling:"Cancelling...",delete:"Delete",deleting:"Deleting...",searchApps:"Search apps...",allRepos:"All repos",newApp:"New App",createApp:"Create App",noAppsYet:"No apps yet. Create your first app to get started!",noAppsMatch:"No apps match your search.",failedToLoadApps:"Failed to load apps",deleteApp:"Delete App",deleteAppConfirm:'Are you sure you want to delete "{{name}}"? This will stop all containers and remove the app configuration. This action cannot be undone.',cancel:"Cancel",appNotFound:"App not found",backToApps:"Back to Apps",tabs:{general:"General",deployments:"Deployments",logs:"Logs",environment:"Environment",domains:"Domains",monitoring:"Monitoring"},general:{deploy:"Deploy",autodeploy:"Autodeploy",noCache:"No-cache",notifications:"Notifications",services:"Services",noServicesConfigured:"No services configured"},compose:{title:"Compose File",repoNotFound:"Repository path not found",unsaved:"Unsaved",edit:"Edit",done:"Done"},logs:{title:"Logs",description:"Watch the logs of the application in real time",allContainers:"All containers",lines:"lines",copy:"Copy",copied:"Copied",download:"Download",refresh:"Refresh",noLogs:"No logs available"},deployments:{title:"Deployments",description:"See the last 10 deployments for this compose",noDeployments:"No deployments yet",view:"View",statusDone:"Done",statusError:"Error",statusBuilding:"Building",deployment:"Deployment",seeDetails:"See all the details of this deployment",noBuildLogs:"No build logs available"},environment:{title:"Environment Variables",description:"Set environment variables for Docker Compose builds. These will be available during the build and in your containers.",placeholder:`DATABASE_URL=postgres://...
25
+ `:"")+_)}catch(_){Lt.error(a("errors.imageUploadFailed")),Dt.kanban.error("Upload error",{error:String(_)})}finally{o(!1)}return}}};return p.jsxs("div",{className:"space-y-2",children:[p.jsxs("div",{className:"relative",children:[p.jsx(kw,{ref:l,value:e,onChange:d=>t(d.target.value),onPaste:f,className:Ue(s&&"opacity-50",n),disabled:s||r,...i}),s&&p.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-background/50 rounded-md",children:p.jsx("span",{className:"text-sm text-muted-foreground",children:a("status.uploading")})})]}),u.length>0&&p.jsx("div",{className:"flex flex-wrap gap-2",children:u.map((d,m)=>p.jsx("a",{href:eH(d),target:"_blank",rel:"noopener noreferrer",className:"block",children:p.jsx("img",{src:eH(d),alt:`Attachment ${m+1}`,className:"h-16 w-auto rounded border object-cover hover:opacity-80 transition-opacity"})},m))})]})}function Ao({className:e,...t}){return p.jsx("label",{"data-slot":"label",className:Ue("gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",e),...t})}const Rne=A.forwardRef(function(t,n){const{className:r,render:i,orientation:a="horizontal",...s}=t,o=A.useMemo(()=>({orientation:a}),[a]);return Ct("div",t,{state:o,ref:n,props:[{role:"separator","aria-orientation":a},s]})});function TEe({className:e,orientation:t="horizontal",...n}){return p.jsx(Rne,{"data-slot":"separator",orientation:t,className:Ue("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",e),...n})}function mm({className:e,...t}){return p.jsx("div",{"data-slot":"field-group",className:Ue("gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",e),...t})}const AEe=Cd("data-[invalid=true]:text-destructive gap-2 group/field flex w-full",{variants:{orientation:{vertical:"flex-col [&>*]:w-full [&>.sr-only]:w-auto",horizontal:"flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",responsive:"flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px"}},defaultVariants:{orientation:"vertical"}});function yr({className:e,orientation:t="vertical",...n}){return p.jsx("div",{role:"group","data-slot":"field","data-orientation":t,className:Ue(AEe({orientation:t}),e),...n})}function xr({className:e,...t}){return p.jsx(Ao,{"data-slot":"field-label",className:Ue("has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug","has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",e),...t})}function io({className:e,...t}){return p.jsx("p",{"data-slot":"field-description",className:Ue("text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance","last:mt-0 nth-last-2:-mt-1","[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",e),...t})}function Nne(e){const t=A.useRef(!0);t.current&&(t.current=!1,e())}const Ine=A.createContext(null),Dne=A.createContext(null);function zl(){const e=A.useContext(Ine);if(e===null)throw new Error(on(60));return e}function Lne(){const e=A.useContext(Dne);if(e===null)throw new Error(on(61));return e}const Pne=(e,t)=>Object.is(e,t);function zu(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function wf(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:zu(r,t,n))}function gm(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:zu(r,t,n))}function Mne(e,t,n){return e.filter(r=>!zu(r,t,n))}function ND(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function jne(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function mi(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 ND(e)}function No(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?ND(e.value):ND(e)}function kEe(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]??mi(e,n);if(Array.isArray(t)){const r=jne(t)?t.flatMap(i=>i.items):t;if(e==null){const i=r.find(a=>a.value==null);return i&&i.label!=null?i.label:mi(e,n)}if(typeof e!="object"){const i=r.find(a=>a&&a.value===e);return i&&i.label!=null?i.label:mi(e,n)}if("value"in e){const i=r.find(a=>a&&a.value===e.value);if(i&&i.label!=null)return i.label}}return mi(e,n)}function OEe(e,t){return!Array.isArray(e)||e.length===0?"":e.map(n=>mi(n,t)).join(", ")}const Qt={id:He(e=>e.id),modal:He(e=>e.modal),multiple:He(e=>e.multiple),items:He(e=>e.items),itemToStringLabel:He(e=>e.itemToStringLabel),itemToStringValue:He(e=>e.itemToStringValue),isItemEqualToValue:He(e=>e.isItemEqualToValue),value:He(e=>e.value),open:He(e=>e.open),mounted:He(e=>e.mounted),forceMount:He(e=>e.forceMount),transitionStatus:He(e=>e.transitionStatus),openMethod:He(e=>e.openMethod),activeIndex:He(e=>e.activeIndex),selectedIndex:He(e=>e.selectedIndex),isActive:He((e,t)=>e.activeIndex===t),isSelected:He((e,t,n)=>{const r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>zu(a,n,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:zu(i,n,r)}),isSelectedByFocus:He((e,t)=>e.selectedIndex===t),popupProps:He(e=>e.popupProps),triggerProps:He(e=>e.triggerProps),triggerElement:He(e=>e.triggerElement),positionerElement:He(e=>e.positionerElement),listElement:He(e=>e.listElement),scrollUpArrowVisible:He(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:He(e=>e.scrollDownArrowVisible),hasScrollArrows:He(e=>e.hasScrollArrows),serializedValue:He(e=>{const{multiple:t,value:n,itemToStringValue:r}=e;return t&&Array.isArray(n)&&n.length===0?"":No(n,r)})};function Jc(e,t){const n=A.useRef(e),r=Ye(t);nt(()=>{n.current!==e&&r(n.current)},[e,r]),nt(()=>{n.current=e},[e])}function REe(e){const{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:s=!1,onOpenChange:o,name:l,disabled:u=!1,readOnly:f=!1,required:d=!1,modal:m=!0,actionsRef:g,inputRef:x,onOpenChangeComplete:_,items:b,multiple:y=!1,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:T=Pne,highlightItemOnHover:w=!0,children:C}=e,{clearErrors:R}=fg(),{setDirty:O,shouldValidateOnChange:N,validityData:D,setFilled:L,name:z,disabled:P,validation:q}=Ka(),{controlId:H}=$l(),F=k0({id:t}),G=P||u,V=z??l,[B,j]=Wa({controlled:n,default:y?r??ya:r,name:"Select",state:"value"}),[$,Y]=Wa({controlled:a,default:s,name:"Select",state:"open"}),W=A.useRef([]),ee=A.useRef([]),oe=A.useRef(null),ae=A.useRef(null),Z=A.useRef(0),K=A.useRef(null),Q=A.useRef([]),te=A.useRef(!1),ne=A.useRef(!1),J=A.useRef(null),ve=A.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),ge=A.useRef(!1),{mounted:fe,setMounted:Ee,transitionStatus:_e}=go($),{openMethod:Ve,triggerProps:Ce,reset:Me}=Aw($),Ae=Di(()=>new jf({id:F,modal:m,multiple:y,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:T,value:B,open:$,mounted:fe,transitionStatus:_e,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,pe=Qe(Ae,Qt.activeIndex),de=Qe(Ae,Qt.selectedIndex),ke=Qe(Ae,Qt.triggerElement),De=Qe(Ae,Qt.positionerElement),me=A.useMemo(()=>y&&Array.isArray(B)&&B.length===0?"":No(B,S),[y,B,S]),ye=A.useMemo(()=>y&&Array.isArray(B)?B.map(_t=>No(_t,S)):No(B,S),[y,B,S]),xe=Er(Ae.state.triggerElement);pg({id:F,commit:q.commit,value:B,controlRef:xe,name:V,getValue:()=>ye});const je=A.useRef(B);nt(()=>{B!==je.current&&Ae.set("forceMount",!0)},[Ae,B]),nt(()=>{L(B!==null)},[B,L]),nt(function(){if($)return;const Yt=Q.current;if(y){const Pe=Array.isArray(B)?B:[];if(Pe.length===0){Ae.set("selectedIndex",null);return}const tt=Pe[Pe.length-1],vt=gm(Yt,tt,T);Ae.set("selectedIndex",vt===-1?null:vt);return}const Vt=gm(Yt,B,T);Ae.set("selectedIndex",Vt===-1?null:Vt)},[y,$,B,Q,T,Ae]),Jc(B,()=>{R(V),O(B!==D.initialValue),N()?q.commit(B):q.commit(B,!0)});const Ge=Ye((_t,Yt)=>{if(o?.(_t,Yt),!Yt.isCanceled&&(Y(_t),!_t&&Ae.state.activeIndex!==null)){const Vt=W.current[Ae.state.activeIndex];queueMicrotask(()=>{Vt?.setAttribute("tabindex","-1")})}}),gt=Ye(()=>{Ee(!1),Ae.set("activeIndex",null),Me(),_?.(!1)});Li({enabled:!g,open:$,ref:oe,onComplete(){$||gt()}}),A.useImperativeHandle(g,()=>({unmount:gt}),[gt]);const at=Ye((_t,Yt)=>{i?.(_t,Yt),!Yt.isCanceled&&j(_t)}),ut=Ye(()=>{const _t=Ae.state.listElement||oe.current;if(!_t)return;const Yt=_t.scrollTop,Vt=_t.scrollTop+_t.clientHeight,Pe=Yt>1,tt=Vt<_t.scrollHeight-1;Ae.state.scrollUpArrowVisible!==Pe&&Ae.set("scrollUpArrowVisible",Pe),Ae.state.scrollDownArrowVisible!==tt&&Ae.set("scrollDownArrowVisible",tt)}),$e=bw({open:$,onOpenChange:Ge,elements:{reference:ke,floating:De}}),pt=sg($e,{enabled:!f&&!G,event:"mousedown"}),Se=og($e,{bubbles:!1}),Be=$M($e,{enabled:!f&&!G,listRef:W,activeIndex:pe,selectedIndex:de,disabledIndices:ya,onNavigate(_t){_t===null&&!$||Ae.set("activeIndex",_t)},focusItemOnHover:!1}),Je=zM($e,{enabled:!f&&!G&&($||!y),listRef:ee,activeIndex:pe,selectedIndex:de,onMatch(_t){$?Ae.set("activeIndex",_t):at(Q.current[_t],lt("none"))},onTypingChange(_t){te.current=_t}}),{getReferenceProps:ct,getFloatingProps:ht,getItemProps:mn}=Od([pt,Se,Be,Je]),Bt=A.useMemo(()=>zo(ct(),Ce),[ct,Ce]);Nne(()=>{Ae.update({popupProps:ht(),triggerProps:Bt})}),nt(()=>{Ae.update({id:F,modal:m,multiple:y,value:B,open:$,mounted:fe,transitionStatus:_e,popupProps:ht(),triggerProps:Bt,items:b,itemToStringLabel:v,itemToStringValue:S,isItemEqualToValue:T,openMethod:Ve})},[Ae,F,m,y,B,$,fe,_e,ht,Bt,b,v,S,T,Ve]);const Mt=A.useMemo(()=>({store:Ae,name:V,required:d,disabled:G,readOnly:f,multiple:y,itemToStringLabel:v,itemToStringValue:S,highlightItemOnHover:w,setValue:at,setOpen:Ge,listRef:W,popupRef:oe,scrollHandlerRef:ae,handleScrollArrowVisibility:ut,scrollArrowsMountedCountRef:Z,getItemProps:mn,events:$e.context.events,valueRef:K,valuesRef:Q,labelsRef:ee,typingRef:te,selectionRef:ve,selectedItemTextRef:J,validation:q,onOpenChangeComplete:_,keyboardActiveRef:ne,alignItemWithTriggerActiveRef:ge,initialValueRef:je}),[Ae,V,d,G,f,y,v,S,w,at,Ge,mn,$e.context.events,q,_,ut]),dt=Ga(x,q.inputRef),rn=y&&Array.isArray(B)&&B.length>0,Ut=A.useMemo(()=>!y||!Array.isArray(B)||!V?null:B.map(_t=>{const Yt=No(_t,S);return p.jsx("input",{type:"hidden",name:V,value:Yt},Yt)}),[y,B,V,S]);return p.jsx(Ine.Provider,{value:Mt,children:p.jsxs(Dne.Provider,{value:$e,children:[C,p.jsx("input",{...q.getInputValidationProps({onFocus(){Ae.state.triggerElement?.focus()},onChange(_t){if(_t.nativeEvent.defaultPrevented)return;const Yt=_t.target.value,Vt=lt(Vr,_t.nativeEvent);function Pe(){if(y)return;const tt=Q.current.find(vt=>No(vt,S).toLowerCase()===Yt.toLowerCase());tt!=null&&(O(tt!==D.initialValue),at(tt,Vt),N()&&q.commit(tt))}Ae.set("forceMount",!0),queueMicrotask(Pe)}}),id:t||H||void 0,name:y?void 0:V,value:me,disabled:G,required:d&&!rn,readOnly:f,ref:dt,style:kd,tabIndex:-1,"aria-hidden":!0}),Ut]})})}function i3(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const a=parseFloat(n.width)||0,s=parseFloat(n.height)||0,o=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,a,o),f=Math.max(t.height,s,l),d=u-t.width,m=f-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-m/2,bottom:t.bottom+m/2}}const Yx=2,NEe={...dm,...nc,value:()=>null},IEe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,...o}=t,{setTouched:l,setFocused:u,validationMode:f,state:d,disabled:m}=Ka(),{labelId:g}=$l(),{store:x,setOpen:_,selectionRef:b,validation:y,readOnly:v,alignItemWithTriggerActiveRef:S,disabled:T,keyboardActiveRef:w}=zl(),C=m||T||a,R=Qe(x,Qt.open),O=Qe(x,Qt.value),N=Qe(x,Qt.triggerProps),D=Qe(x,Qt.positionerElement),L=Qe(x,Qt.listElement),z=Qe(x,Qt.serializedValue),P=Er(D),q=A.useRef(null),H=zn(),F=zn(),{getButtonProps:G,buttonRef:V}=ua({disabled:C,native:s}),B=Ye(ae=>{x.set("triggerElement",ae)}),j=Ga(n,q,V,B),$=zn(),Y=zn();A.useEffect(()=>{if(R)return Y.start(200,()=>{b.current.allowUnselectedMouseUp=!0,$.start(200,()=>{b.current.allowSelectedMouseUp=!0})}),()=>{$.clear(),Y.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},F.clear()},[R,b,F,$,Y]);const W=A.useMemo(()=>L?.id??Zv(D)?.id,[L,D]),ee=zo(N,{role:"combobox","aria-expanded":R?"true":"false","aria-haspopup":"listbox","aria-controls":R?W:void 0,"aria-labelledby":g,"aria-readonly":v||void 0,tabIndex:C?-1:0,ref:j,onFocus(ae){u(!0),R&&S.current&&_(!1,lt(Ho,ae.nativeEvent)),H.start(0,()=>{x.set("forceMount",!0)})},onBlur(){l(!0),u(!1),f==="onBlur"&&y.commit(O)},onPointerMove(){w.current=!1},onKeyDown(){w.current=!0},onMouseDown(ae){if(R)return;const Z=Zi(ae.currentTarget);function K(Q){if(!q.current)return;const te=Q.target;if(Rt(q.current,te)||Rt(P.current,te)||te===q.current)return;const ne=i3(q.current);Q.clientX>=ne.left-Yx&&Q.clientX<=ne.right+Yx&&Q.clientY>=ne.top-Yx&&Q.clientY<=ne.bottom+Yx||_(!1,lt(xte,Q))}F.start(0,()=>{Z.addEventListener("mouseup",K,{once:!0})})}},y.getValidationProps,o,G);ee.role="combobox";const oe=A.useMemo(()=>({...d,open:R,disabled:C,value:O,readOnly:v,placeholder:!z}),[d,R,C,O,v,z]);return Ct("button",t,{ref:[n,q],state:oe,stateAttributesMapping:NEe,props:ee})}),DEe={value:()=>null},LEe=A.forwardRef(function(t,n){const{className:r,render:i,children:a,...s}=t,{store:o,valueRef:l}=zl(),u=Qe(o,Qt.value),f=Qe(o,Qt.items),d=Qe(o,Qt.itemToStringLabel),m=Qe(o,Qt.serializedValue),g=A.useMemo(()=>({value:u,placeholder:!m}),[u,m]),x=typeof a=="function"?a(u):a??(Array.isArray(u)?OEe(u,d):kEe(u,f,d));return Ct("span",t,{state:g,ref:[n,l],props:[{children:x},s],stateAttributesMapping:DEe})}),PEe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s}=zl(),o=Qe(s,Qt.open),l=A.useMemo(()=>({open:o}),[o]);return Ct("span",t,{state:l,ref:n,props:[{"aria-hidden":!0,children:"▼"},a],stateAttributesMapping:xw})}),MEe=A.createContext(void 0),jEe=A.forwardRef(function(t,n){const{store:r}=zl(),i=Qe(r,Qt.mounted),a=Qe(r,Qt.forceMount);return i||a?p.jsx(MEe.Provider,{value:!0,children:p.jsx(y0,{ref:n,...t})}):null}),Fne=A.createContext(void 0);function a3(){const e=A.useContext(Fne);if(!e)throw new Error(on(59));return e}function EE(e,t){e&&Object.assign(e.style,t)}const Bne={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},FEe={position:"fixed"},BEe=A.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_,alignItemWithTrigger:b=!0,collisionAvoidance:y=cw,...v}=t,{store:S,listRef:T,labelsRef:w,alignItemWithTriggerActiveRef:C,selectedItemTextRef:R,valuesRef:O,initialValueRef:N,popupRef:D,setValue:L}=zl(),z=Lne(),P=Qe(S,Qt.open),q=Qe(S,Qt.mounted),H=Qe(S,Qt.modal),F=Qe(S,Qt.value),G=Qe(S,Qt.openMethod),V=Qe(S,Qt.positionerElement),B=Qe(S,Qt.triggerElement),j=Qe(S,Qt.isItemEqualToValue),$=A.useRef(null),Y=A.useRef(null),[W,ee]=A.useState(b),oe=q&&W&&G!=="touch";!q&&W!==b&&ee(b),nt(()=>{q||(Qt.scrollUpArrowVisible(S.state)&&S.set("scrollUpArrowVisible",!1),Qt.scrollDownArrowVisible(S.state)&&S.set("scrollDownArrowVisible",!1))},[S,q]),A.useImperativeHandle(C,()=>oe),Tw((oe||H)&&P&&G!=="touch",B);const ae=T0({anchor:r,floatingRootContext:z,positionMethod:i,mounted:q,side:o,sideOffset:u,align:l,alignOffset:f,arrowPadding:g,collisionBoundary:d,collisionPadding:m,sticky:x,disableAnchorTracking:_??oe,collisionAvoidance:y,keepMounted:!0}),Z=oe?"none":ae.side,K=oe?FEe:ae.positionerStyles,Q=A.useMemo(()=>{const Ee={};return P||(Ee.pointerEvents="none"),{role:"presentation",hidden:!q,style:{...K,...Ee}}},[P,q,K]),te=A.useMemo(()=>({open:P,side:Z,align:ae.align,anchorHidden:ae.anchorHidden}),[P,Z,ae.align,ae.anchorHidden]),ne=Ye(Ee=>{S.set("positionerElement",Ee)}),J=Ct("div",t,{ref:[n,ne],state:te,stateAttributesMapping:Qa,props:[Q,v]}),ve=A.useRef(0),ge=Ye(Ee=>{if(Ee.size===0&&ve.current===0||O.current.length===0)return;const _e=ve.current;if(ve.current=Ee.size,Ee.size===_e)return;const Ve=lt(Vr);if(_e!==0&&!S.state.multiple&&F!==null&&gm(O.current,F,j)===-1){const Me=N.current,pe=Me!=null&&wf(O.current,Me,j)?Me:null;L(pe,Ve),pe===null&&(S.set("selectedIndex",null),R.current=null)}if(_e!==0&&S.state.multiple&&Array.isArray(F)){const Ce=F.filter(Me=>wf(O.current,Me,j));(Ce.length!==F.length||Ce.some(Me=>!wf(F,Me,j)))&&(L(Ce,Ve),Ce.length===0&&(S.set("selectedIndex",null),R.current=null))}if(P&&oe){S.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ce={height:""};EE(V,Ce),EE(D.current,Ce)}}),fe=A.useMemo(()=>({...ae,side:Z,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:ee,scrollUpArrowRef:$,scrollDownArrowRef:Y}),[ae,Z,oe,ee]);return p.jsx(_0,{elementsRef:T,labelsRef:w,onMapChange:ge,children:p.jsxs(Fne.Provider,{value:fe,children:[q&&H&&p.jsx(Cw,{inert:lg(!P),cutout:B}),J]})})});function Une(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 Xx="base-ui-disable-scrollbar",ly={className:Xx,element:p.jsx("style",{href:Xx,precedence:"base-ui:low",children:`.${Xx}{scrollbar-width:none}.${Xx}::-webkit-scrollbar{display:none}`})},UEe=A.createContext(void 0);function s3(e){return A.useContext(UEe)}const $Ee={...Qa,...Za},zEe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{store:s,popupRef:o,onOpenChangeComplete:l,setOpen:u,valueRef:f,selectedItemTextRef:d,keyboardActiveRef:m,multiple:g,handleScrollArrowVisibility:x,scrollHandlerRef:_}=zl(),{side:b,align:y,alignItemWithTriggerActive:v,setControlledAlignItemWithTrigger:S,scrollDownArrowRef:T,scrollUpArrowRef:w}=a3(),C=s3()!=null,R=Lne(),O=zn(),N=Qe(s,Qt.id),D=Qe(s,Qt.open),L=Qe(s,Qt.mounted),z=Qe(s,Qt.popupProps),P=Qe(s,Qt.transitionStatus),q=Qe(s,Qt.triggerElement),H=Qe(s,Qt.positionerElement),F=Qe(s,Qt.listElement),G=A.useRef(0),V=A.useRef(!1),B=A.useRef(0),j=A.useRef(!1),$=A.useRef({}),Y=Nu(),W=Ye(Z=>{if(!H||!o.current||!j.current)return;if(V.current||!v){x();return}const K=H.style.top==="0px",Q=H.style.bottom==="0px",te=H.getBoundingClientRect().height,ne=Zi(H),J=getComputedStyle(H),ve=parseFloat(J.marginTop),ge=parseFloat(J.marginBottom),fe=ne.documentElement.clientHeight-ve-ge,Ee=Z.scrollTop,_e=Z.scrollHeight,Ve=Z.clientHeight,Ce=_e-Ve;let Me=null,Ae=null,pe=!1;if(K){const de=Ce-Ee,ke=te+de,De=Math.min(ke,fe);Me=De,De!==fe?Ae=Ce:pe=!0}else if(Q){const de=Ee-0,ke=te+de,De=Math.min(ke,fe),me=ke-fe;Me=De,De!==fe?Ae=0:(pe=!0,Ee<Ce&&(Ae=Ee-(de-me)))}Me!=null&&(H.style.height=`${Me}px`),Ae!=null&&(Z.scrollTop=Ae),pe&&(V.current=!0),x()});A.useImperativeHandle(_,()=>W,[W]),Li({open:D,ref:o,onComplete(){D&&l?.(!0)}});const ee=A.useMemo(()=>({open:D,transitionStatus:P,side:b,align:y}),[D,P,b,y]);nt(()=>{!H||!o.current||Object.keys($.current).length||($.current={top:H.style.top||"0",left:H.style.left||"0",right:H.style.right,height:H.style.height,bottom:H.style.bottom,minHeight:H.style.minHeight,maxHeight:H.style.maxHeight,marginTop:H.style.marginTop,marginBottom:H.style.marginBottom})},[o,H]),nt(()=>{L||v||(j.current=!1,V.current=!1,G.current=0,B.current=0,EE(H,$.current))},[L,v,H,o]),nt(()=>{const Z=o.current;if(!(!L||!q||!H||!Z)){if(!v){j.current=!0,Y.request(x);return}queueMicrotask(()=>{const K=getComputedStyle(H),Q=getComputedStyle(Z),te=Zi(q),ne=jr(H),J=q.getBoundingClientRect(),ve=H.getBoundingClientRect(),ge=J.left,fe=J.height,Ee=F||Z,_e=Ee.scrollHeight,Ve=parseFloat(Q.borderBottomWidth),Ce=parseFloat(K.marginTop)||10,Me=parseFloat(K.marginBottom)||10,Ae=parseFloat(K.minHeight)||100,pe=5,de=5,ke=20,De=te.documentElement.clientHeight-Ce-Me,me=te.documentElement.clientWidth,ye=De-J.bottom+fe,xe=d.current,je=f.current;let Ge=0,gt=0;if(xe&&je){const Mt=je.getBoundingClientRect(),dt=xe.getBoundingClientRect(),rn=Mt.left-ge,Ut=dt.left-ve.left,_t=Mt.top-J.top+Mt.height/2,Yt=dt.top-ve.top+dt.height/2;Ge=rn-Ut,gt=Yt-_t}const at=ye+gt+Me+Ve;let ut=Math.min(De,at);const $e=De-Ce-Me,pt=at-ut,Se=Math.max(pe,ge+Ge),Be=me-de,Je=Math.max(0,Se+ve.width-Be);H.style.left=`${Se-Je}px`,H.style.height=`${ut}px`,H.style.maxHeight="auto",H.style.marginTop=`${Ce}px`,H.style.marginBottom=`${Me}px`,Z.style.height="100%";const ct=Ee.scrollHeight-Ee.clientHeight,ht=pt>=ct;ht&&(ut=Math.min(De,ve.height)-(pt-ct));const mn=J.top<ke||J.bottom>De-ke||ut<Math.min(_e,Ae),Bt=(ne.visualViewport?.scale??1)!==1&&xM;if(mn||Bt){j.current=!0,EE(H,$.current),Ur.flushSync(()=>S(!1));return}if(ht){const Mt=Math.max(0,De-at);H.style.top=ve.height>=$e?"0":`${Mt}px`,H.style.height=`${ut}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,G.current=Math.max(Ae,ut)}else H.style.bottom="0",G.current=Math.max(Ae,ut),Ee.scrollTop=pt;G.current===De&&(V.current=!0),x(),setTimeout(()=>{j.current=!0})})}},[s,L,H,q,f,d,o,x,v,S,Y,T,w,F]),A.useEffect(()=>{if(!v||!H||!L)return;const Z=jr(H);function K(Q){u(!1,lt(d0e,Q))}return Z.addEventListener("resize",K),()=>{Z.removeEventListener("resize",K)}},[u,v,H,L]);const oe={...F?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":g||void 0,id:`${N}-list`},onKeyDown(Z){m.current=!0,C&&WM.has(Z.key)&&Z.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(Z){if(Une(Z)||Z.pointerType==="touch")return;const K=Z.currentTarget;O.start(0,()=>{s.set("activeIndex",null),K.focus({preventScroll:!0})})},onScroll(Z){F||_.current?.(Z.currentTarget)},...v&&{style:F?{height:"100%"}:Bne}},ae=Ct("div",t,{ref:[n,o],state:ee,stateAttributesMapping:$Ee,props:[z,oe,cg(P),{className:!F&&v?ly.className:void 0},a]});return p.jsxs(A.Fragment,{children:[ly.element,p.jsx(pw,{context:R,modal:!1,disabled:!L,restoreFocus:!0,children:ae})]})}),HEe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,{store:s,scrollHandlerRef:o}=zl(),{alignItemWithTriggerActive:l}=a3(),u=Qe(s,Qt.hasScrollArrows),f=Qe(s,Qt.openMethod),d=Qe(s,Qt.multiple),g={id:`${Qe(s,Qt.id)}-list`,role:"listbox","aria-multiselectable":d||void 0,onScroll(_){o.current?.(_.currentTarget)},...l&&{style:Bne},className:u&&f!=="touch"?ly.className:void 0},x=Ye(_=>{s.set("listElement",_)});return Ct("div",t,{ref:[n,x],props:[g,a]})}),$ne=A.createContext(void 0);function o3(){const e=A.useContext($ne);if(!e)throw new Error(on(57));return e}const WEe=A.memo(A.forwardRef(function(t,n){const{render:r,className:i,value:a=null,label:s,disabled:o=!1,nativeButton:l=!1,...u}=t,f=A.useRef(null),d=ug({label:s,textRef:f,indexGuessBehavior:qM.GuessFromOrder}),{store:m,getItemProps:g,setOpen:x,setValue:_,selectionRef:b,typingRef:y,valuesRef:v,keyboardActiveRef:S,multiple:T,highlightItemOnHover:w}=zl(),C=zn(),R=Qe(m,Qt.isActive,d.index),O=Qe(m,Qt.isSelected,d.index,a),N=Qe(m,Qt.isSelectedByFocus,d.index),D=Qe(m,Qt.isItemEqualToValue),L=d.index,z=L!==-1,P=A.useRef(null),q=Er(L);nt(()=>{if(!z)return;const ae=v.current;return ae[L]=a,()=>{delete ae[L]}},[z,L,a,v]),nt(()=>{if(!z)return;const ae=m.state.value;let Z=ae;T&&Array.isArray(ae)&&ae.length>0&&(Z=ae[ae.length-1]),Z!==void 0&&zu(Z,a,D)&&m.set("selectedIndex",L)},[z,L,T,D,m,a]);const H=A.useMemo(()=>({disabled:o,selected:O,highlighted:R}),[o,O,R]),F=g({active:R,selected:O});F.onFocus=void 0,F.id=void 0;const G=A.useRef(null),V=A.useRef("mouse"),B=A.useRef(!1),{getButtonProps:j,buttonRef:$}=ua({disabled:o,focusableWhenDisabled:!0,native:l});function Y(ae){const Z=m.state.value;if(T){const K=Array.isArray(Z)?Z:[],Q=O?Mne(K,a,D):[...K,a];_(Q,lt(Pf,ae))}else _(a,lt(Pf,ae)),x(!1,lt(Pf,ae))}const W={role:"option","aria-selected":O,"aria-disabled":o||void 0,tabIndex:R?0:-1,onFocus(){m.set("activeIndex",L)},onMouseEnter(){!S.current&&m.state.selectedIndex===null&&m.set("activeIndex",L)},onMouseMove(){w&&m.set("activeIndex",L)},onMouseLeave(ae){!w||S.current||Une(ae)||C.start(0,()=>{m.state.activeIndex===L&&m.set("activeIndex",null)})},onTouchStart(){b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ae){G.current=ae.key,m.set("activeIndex",L)},onClick(ae){B.current=!1,!(ae.type==="keydown"&&G.current===null)&&(o||G.current===" "&&y.current||V.current!=="touch"&&!R||(G.current=null,Y(ae.nativeEvent)))},onPointerEnter(ae){V.current=ae.pointerType},onPointerDown(ae){V.current=ae.pointerType,B.current=!0},onMouseUp(ae){if(o)return;if(B.current){B.current=!1;return}const Z=!b.current.allowSelectedMouseUp&&O,K=!b.current.allowUnselectedMouseUp&&!O;Z||K||V.current!=="touch"&&!R||Y(ae.nativeEvent)}},ee=Ct("div",t,{ref:[$,n,d.ref,P],state:H,props:[F,W,u,j]}),oe=A.useMemo(()=>({selected:O,indexRef:q,textRef:f,selectedByFocus:N,hasRegistered:z}),[O,q,f,N,z]);return p.jsx($ne.Provider,{value:oe,children:ee})})),VEe=A.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=o3();return r||i?p.jsx(qEe,{...t,ref:n}):null}),qEe=A.memo(A.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=o3(),o=A.useRef(null),{transitionStatus:l,setMounted:u}=go(s),f=A.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),d=Ct("span",e,{ref:[t,o],state:f,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Za});return Li({open:s,ref:o,onComplete(){s||u(!1)}}),d})),GEe=A.memo(A.forwardRef(function(t,n){const{indexRef:r,textRef:i,selectedByFocus:a,hasRegistered:s}=o3(),{selectedItemTextRef:o}=zl(),{className:l,render:u,...f}=t,d=A.useCallback(g=>{if(!g||!s)return;const x=o.current===null||!o.current.isConnected;(a||x&&r.current===0)&&(o.current=g)},[o,r,a,s]);return Ct("div",t,{ref:[d,n,i],props:f})})),zne=A.forwardRef(function(t,n){const{render:r,className:i,direction:a,keepMounted:s=!1,...o}=t,{store:l,popupRef:u,listRef:f,handleScrollArrowVisibility:d,scrollArrowsMountedCountRef:m}=zl(),{side:g,scrollDownArrowRef:x,scrollUpArrowRef:_}=a3(),b=a==="up"?Qt.scrollUpArrowVisible:Qt.scrollDownArrowVisible,y=Qe(l,b),v=Qe(l,Qt.openMethod),S=y&&v!=="touch",T=zn(),w=a==="up"?_:x,{transitionStatus:C,setMounted:R}=go(S);nt(()=>(m.current+=1,l.state.hasScrollArrows||l.set("hasScrollArrows",!0),()=>{m.current=Math.max(0,m.current-1),m.current===0&&l.state.hasScrollArrows&&l.set("hasScrollArrows",!1)}),[l,m]),Li({open:S,ref:w,onComplete(){S||R(!1)}});const O=A.useMemo(()=>({direction:a,visible:S,side:g,transitionStatus:C}),[a,S,g,C]),D=Ct("div",t,{ref:[n,w],state:O,props:[{"aria-hidden":!0,children:a==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(z){if(z.movementX===0&&z.movementY===0||T.isStarted())return;l.set("activeIndex",null);function P(){const q=l.state.listElement??u.current;if(!q)return;l.set("activeIndex",null),d();const H=q.scrollTop===0,F=Math.round(q.scrollTop+q.clientHeight)>=q.scrollHeight;if(f.current.length===0&&(a==="up"?l.set("scrollUpArrowVisible",!H):l.set("scrollDownArrowVisible",!F)),a==="up"&&H||a==="down"&&F){T.clear();return}if((l.state.listElement||u.current)&&f.current&&f.current.length>0){const V=f.current,B=w.current?.offsetHeight||0;if(a==="up"){let j=0;const $=q.scrollTop+B;for(let W=0;W<V.length;W+=1){const ee=V[W];if(ee&&ee.offsetTop>=$){j=W;break}}const Y=Math.max(0,j-1);if(Y<j){const W=V[Y];W&&(q.scrollTop=Math.max(0,W.offsetTop-B))}else q.scrollTop=0}else{let j=V.length-1;const $=q.scrollTop+q.clientHeight-B;for(let W=0;W<V.length;W+=1){const ee=V[W];if(ee&&ee.offsetTop+ee.offsetHeight>$){j=Math.max(0,W-1);break}}const Y=Math.min(V.length-1,j+1);if(Y>j){const W=V[Y];W&&(q.scrollTop=W.offsetTop+W.offsetHeight-q.clientHeight+B)}else q.scrollTop=q.scrollHeight-q.clientHeight}}T.start(40,P)}T.start(40,P)},onMouseLeave(){T.clear()}},o]});return S||s?D:null}),KEe=A.forwardRef(function(t,n){return p.jsx(zne,{...t,ref:n,direction:"down"})}),YEe=A.forwardRef(function(t,n){return p.jsx(zne,{...t,ref:n,direction:"up"})}),Gi=REe;function Ki({className:e,...t}){return p.jsx(LEe,{"data-slot":"select-value",className:Ue("flex flex-1 text-left",e),...t})}function Yi({className:e,size:t="default",children:n,...r}){return p.jsxs(IEe,{"data-slot":"select-trigger","data-size":t,className:Ue("border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,p.jsx(PEe,{render:p.jsx(se,{icon:pne,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})})]})}function Xi({className:e,children:t,side:n="bottom",sideOffset:r=4,align:i="center",alignOffset:a=0,alignItemWithTrigger:s=!0,...o}){return p.jsx(jEe,{children:p.jsx(BEe,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:s,className:"isolate z-50",children:p.jsxs(zEe,{"data-slot":"select-content",className:Ue("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto",e),...o,children:[p.jsx(XEe,{}),p.jsx(HEe,{children:t}),p.jsx(ZEe,{})]})})})}function wn({className:e,children:t,...n}){return p.jsxs(WEe,{"data-slot":"select-item",className:Ue("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[p.jsx(GEe,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),p.jsx(VEe,{render:p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:p.jsx(se,{icon:Lr,strokeWidth:2,className:"pointer-events-none"})})]})}function XEe({className:e,...t}){return p.jsx(YEe,{"data-slot":"select-scroll-up-button",className:Ue("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full",e),...t,children:p.jsx(se,{icon:KM,strokeWidth:2})})}function ZEe({className:e,...t}){return p.jsx(KEe,{"data-slot":"select-scroll-down-button",className:Ue("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full",e),...t,children:p.jsx(se,{icon:A0,strokeWidth:2})})}const Hne=A.createContext(void 0);function l3(){const e=A.useContext(Hne);if(e===void 0)throw new Error(on(64));return e}let QEe=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const u3={tabActivationDirection:e=>({[QEe.activationDirection]:e})},JEe=A.forwardRef(function(t,n){const{className:r,defaultValue:i=0,onValueChange:a,orientation:s="horizontal",render:o,value:l,...u}=t,f=ec(),d=Object.hasOwn(t,"defaultValue"),m=A.useRef([]),[g,x]=A.useState(()=>new Map),[_,b]=Wa({controlled:l,default:i,name:"Tabs",state:"value"}),y=l!==void 0,[v,S]=A.useState(()=>new Map),[T,w]=A.useState("none"),C=Ye((G,V)=>{a?.(G,V),!V.isCanceled&&(b(G),w(V.activationDirection))}),R=Ye((G,V)=>{x(B=>{if(B.get(G)===V)return B;const j=new Map(B);return j.set(G,V),j})}),O=Ye((G,V)=>{x(B=>{if(!B.has(G)||B.get(G)!==V)return B;const j=new Map(B);return j.delete(G),j})}),N=A.useCallback(G=>g.get(G),[g]),D=A.useCallback(G=>{for(const V of v.values())if(G===V?.value)return V?.id},[v]),L=A.useCallback(G=>{if(G===void 0)return null;for(const[V,B]of v.entries())if(B!=null&&G===(B.value??B.index))return V;return null},[v]),z=A.useMemo(()=>({direction:f,getTabElementBySelectedValue:L,getTabIdByPanelValue:D,getTabPanelIdByValue:N,onValueChange:C,orientation:s,registerMountedTabPanel:R,setTabMap:S,unregisterMountedTabPanel:O,tabActivationDirection:T,value:_}),[f,L,D,N,C,s,R,S,O,T,_]),P=A.useMemo(()=>{for(const G of v.values())if(G!=null&&G.value===_)return G},[v,_]),q=A.useMemo(()=>{for(const G of v.values())if(G!=null&&!G.disabled)return G.value},[v]);nt(()=>{if(y||v.size===0)return;const G=P?.disabled,V=P==null&&_!==null;if(d&&G&&_===i||!G&&!V)return;const j=q??null;_!==j&&(b(j),w("none"))},[i,q,d,y,P,w,b,v,_]);const F=Ct("div",t,{state:{orientation:s,tabActivationDirection:T},ref:n,props:u,stateAttributesMapping:u3});return p.jsx(Hne.Provider,{value:z,children:p.jsx(_0,{elementsRef:m,children:F})})}),Wne=A.createContext(void 0);function eSe(){const e=A.useContext(Wne);if(e===void 0)throw new Error(on(65));return e}const tSe=A.forwardRef(function(t,n){const{className:r,disabled:i=!1,render:a,value:s,id:o,nativeButton:l=!0,...u}=t,{value:f,getTabPanelIdByValue:d,orientation:m}=l3(),{activateOnFocus:g,highlightedTabIndex:x,onTabActivation:_,setHighlightedTabIndex:b,tabsListElement:y}=eSe(),v=ui(o),S=A.useMemo(()=>({disabled:i,id:v,value:s}),[i,v,s]),{compositeProps:T,compositeRef:w,index:C}=Qte({metadata:S}),R=s===f,O=A.useRef(!1);nt(()=>{if(O.current){O.current=!1;return}if(!(R&&C>-1&&x!==C))return;const B=y;if(B!=null){const j=ro(Zi(B));if(j&&Rt(B,j))return}i||b(C)},[R,C,x,b,i,y]);const{getButtonProps:N,buttonRef:D}=ua({disabled:i,native:l,focusableWhenDisabled:!0}),L=d(s),z=A.useRef(!1),P=A.useRef(!1);function q(B){R||i||_(s,lt(Vr,B.nativeEvent,void 0,{activationDirection:"none"}))}function H(B){R||(C>-1&&!i&&b(C),!i&&g&&(!z.current||z.current&&P.current)&&_(s,lt(Vr,B.nativeEvent,void 0,{activationDirection:"none"})))}function F(B){if(R||i)return;z.current=!0;function j(){z.current=!1,P.current=!1}(!B.button||B.button===0)&&(P.current=!0,Zi(B.currentTarget).addEventListener("pointerup",j,{once:!0}))}const G=A.useMemo(()=>({disabled:i,active:R,orientation:m}),[i,R,m]);return Ct("button",t,{state:G,ref:[n,D,w],props:[T,{role:"tab","aria-controls":L,"aria-selected":R,id:v,onClick:q,onFocus:H,onPointerDown:F,[VM]:R?"":void 0,onKeyDownCapture(){O.current=!0}},u,N]})});let nSe=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const rSe=A.forwardRef(function(t,n){const{className:r,value:i,render:a,keepMounted:s=!1,...o}=t,{value:l,getTabIdByPanelValue:u,orientation:f,tabActivationDirection:d,registerMountedTabPanel:m,unregisterMountedTabPanel:g}=l3(),x=ui(),_=A.useMemo(()=>({id:x,value:i}),[x,i]),{ref:b,index:y}=ug({metadata:_}),v=i!==l,S=u(i),T=A.useMemo(()=>({hidden:v,orientation:f,tabActivationDirection:d}),[v,f,d]),w=Ct("div",t,{state:T,ref:[n,b],props:[{"aria-labelledby":S,hidden:v,id:x??void 0,role:"tabpanel",tabIndex:v?-1:0,[nSe.index]:y},o],stateAttributesMapping:u3});return nt(()=>{if(!(v&&!s)&&x!=null)return m(i,x),()=>{g(i,x)}},[v,s,i,x,m,g]),!v||s?w:null}),iSe=A.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:i,loopFocus:a=!0,render:s,...o}=t,{getTabElementBySelectedValue:l,onValueChange:u,orientation:f,value:d,setTabMap:m,tabActivationDirection:g}=l3(),[x,_]=A.useState(0),[b,y]=A.useState(null),v=aSe(d,f,b,l),S=Ye((R,O)=>{if(R!==d){const N=v(R);O.activationDirection=N,u(R,O)}}),T=A.useMemo(()=>({orientation:f,tabActivationDirection:g}),[f,g]),w={"aria-orientation":f==="vertical"?"vertical":void 0,role:"tablist"},C=A.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:x,onTabActivation:S,setHighlightedTabIndex:_,tabsListElement:b,value:d}),[r,x,S,_,b,d]);return p.jsx(Wne.Provider,{value:C,children:p.jsx(w0,{render:s,className:i,state:T,refs:[n,y],props:[w,o],stateAttributesMapping:u3,highlightedIndex:x,enableHomeAndEndKeys:!0,loopFocus:a,orientation:f,onHighlightedIndexChange:_,onMapChange:m,disabledIndices:ya})})});function tH(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),s=n-i,o=r-a;return{left:s,top:o}}function aSe(e,t,n,r){const[i,a]=A.useState(null);return nt(()=>{if(e==null||n==null){a(null);return}const s=r(e);if(s==null){a(null);return}const{left:o,top:l}=tH(s,n);a(t==="horizontal"?o:l)},[t,r,n,e]),A.useCallback(s=>{if(s===e)return"none";if(s==null)return a(null),"none";if(s!=null&&n!=null){const o=r(s);if(o!=null){const{left:l,top:u}=tH(o,n);if(i==null)return a(t==="horizontal"?l:u),"none";if(t==="horizontal"){if(l<i)return a(l),"left";if(l>i)return a(l),"right"}else{if(u<i)return a(u),"up";if(u>i)return a(u),"down"}}}return"none"},[r,t,i,n,e])}function Mo({className:e,orientation:t="horizontal",...n}){return p.jsx(JEe,{"data-slot":"tabs","data-orientation":t,className:Ue("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col",e),...n})}const sSe=Cd("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function jo({className:e,variant:t="default",...n}){return p.jsx(iSe,{"data-slot":"tabs-list","data-variant":t,className:Ue(sSe({variant:t}),e),...n})}function _r({className:e,...t}){return p.jsx(tSe,{"data-slot":"tabs-trigger",className:Ue("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-xs font-medium group-data-vertical/tabs:py-[calc(--spacing(1.25))] [&_svg:not([class*='size-'])]:size-3.5 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function Pr({className:e,...t}){return p.jsx(rSe,{"data-slot":"tabs-content",className:Ue("text-xs/relaxed flex-1 min-h-0 outline-none",e),...t})}function oSe(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,actionsRef:s,handle:o,triggerId:l,defaultTriggerId:u=null}=e,f=tc(),d=!!f,m=Di(()=>o?.store??new Sne({open:n??r,activeTriggerId:l!==void 0?l:u,modal:!0,disablePointerDismissal:!0,nested:d,role:"alertdialog"})).current;m.useControlledProp("open",n,r),m.useControlledProp("activeTriggerId",l,u),m.useSyncedValue("nested",d),m.useContextCallback("onOpenChange",i),m.useContextCallback("onOpenChangeComplete",a);const g=m.useState("payload");Ene({store:m,actionsRef:s,parentContext:f?.store.context});const x=A.useMemo(()=>({store:m}),[m]);return p.jsx(r3.Provider,{value:x,children:typeof t=="function"?t({payload:g}):t})}const Vne=A.createContext(void 0),qne=A.createContext(void 0),Gne=A.createContext(void 0),Kne=A.createContext("");function rc(){const e=A.useContext(Vne);if(!e)throw new Error(on(22));return e}function Ow(){const e=A.useContext(qne);if(!e)throw new Error(on(23));return e}function gp(){const e=A.useContext(Gne);if(!e)throw new Error(on(24));return e}function c3(){return A.useContext(Kne)}const bt={id:He(e=>e.id),query:He(e=>e.query),items:He(e=>e.items),selectedValue:He(e=>e.selectedValue),open:He(e=>e.open),mounted:He(e=>e.mounted),forceMounted:He(e=>e.forceMounted),inline:He(e=>e.inline),activeIndex:He(e=>e.activeIndex),selectedIndex:He(e=>e.selectedIndex),isActive:He((e,t)=>e.activeIndex===t),isSelected:He((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(i=>zu(i,t,n)):zu(r,t,n)}),transitionStatus:He(e=>e.transitionStatus),popupProps:He(e=>e.popupProps),inputProps:He(e=>e.inputProps),triggerProps:He(e=>e.triggerProps),getItemProps:He(e=>e.getItemProps),positionerElement:He(e=>e.positionerElement),listElement:He(e=>e.listElement),triggerElement:He(e=>e.triggerElement),inputElement:He(e=>e.inputElement),popupSide:He(e=>e.popupSide),openMethod:He(e=>e.openMethod),inputInsidePopup:He(e=>e.inputInsidePopup),selectionMode:He(e=>e.selectionMode),listRef:He(e=>e.listRef),labelsRef:He(e=>e.labelsRef),popupRef:He(e=>e.popupRef),emptyRef:He(e=>e.emptyRef),inputRef:He(e=>e.inputRef),keyboardActiveRef:He(e=>e.keyboardActiveRef),chipsContainerRef:He(e=>e.chipsContainerRef),clearRef:He(e=>e.clearRef),valuesRef:He(e=>e.valuesRef),allValuesRef:He(e=>e.allValuesRef),name:He(e=>e.name),disabled:He(e=>e.disabled),readOnly:He(e=>e.readOnly),required:He(e=>e.required),grid:He(e=>e.grid),isGrouped:He(e=>e.isGrouped),virtualized:He(e=>e.virtualized),onOpenChangeComplete:He(e=>e.onOpenChangeComplete),openOnInputClick:He(e=>e.openOnInputClick),itemToStringLabel:He(e=>e.itemToStringLabel),isItemEqualToValue:He(e=>e.isItemEqualToValue),modal:He(e=>e.modal),autoHighlight:He(e=>e.autoHighlight),submitOnItemClick:He(e=>e.submitOnItemClick)};function lSe(e,t){return(n,r)=>{if(n==null)return!1;const i=mi(n,t);return e.contains(i,r)}}function uSe(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;const a=mi(r,t),s=n!=null?mi(n,t):"";return s&&e.contains(s,i)&&s.length===i.length?!0:e.contains(a,i)}}const nH=new Map;function Yne(e){return Array.isArray(e)?e.map(t=>Yne(t)).join(","):e==null?"":String(e)}function cSe(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${Yne(e.locale)}|${JSON.stringify(t)}`,r=nH.get(n);if(r)return r;const i=new Intl.Collator(e.locale,t),a={contains(s,o,l){if(!o)return!0;const u=mi(s,l);for(let f=0;f<=u.length-o.length;f+=1)if(i.compare(u.slice(f,f+o.length),o)===0)return!0;return!1},startsWith(s,o,l){if(!o)return!0;const u=mi(s,l);return i.compare(u.slice(0,o.length),o)===0},endsWith(s,o,l){if(!o)return!0;const u=mi(s,l),f=o.length;return u.length>=f&&i.compare(u.slice(u.length-f),o)===0}};return nH.set(n,a),a}const dSe=cSe,Xne=Symbol("none"),sf={value:Xne,index:-1};function fSe(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:s,inputValue:o,selectionMode:l="none",onItemHighlighted:u,name:f,disabled:d=!1,readOnly:m=!1,required:g=!1,inputRef:x,grid:_=!1,items:b,filteredItems:y,filter:v,openOnInputClick:S=!0,autoHighlight:T=!1,keepHighlight:w=!1,highlightItemOnHover:C=!0,itemToStringLabel:R,itemToStringValue:O,isItemEqualToValue:N=Pne,virtualized:D=!1,inline:L=!1,fillInputOnItemPress:z=!0,modal:P=!1,limit:q=-1,autoComplete:H="list",locale:F,submitOnItemClick:G=!1}=e,{clearErrors:V}=fg(),{setDirty:B,validityData:j,shouldValidateOnChange:$,setFilled:Y,name:W,disabled:ee,validation:oe}=Ka(),ae=k0({id:t}),Z=dSe({locale:F}),[K,Q]=A.useState(!1),[te,ne]=A.useState(null),J=A.useRef([]),ve=A.useRef([]),ge=A.useRef(null),fe=A.useRef(null),Ee=A.useRef(null),_e=A.useRef(!0),Ve=A.useRef(!1),Ce=A.useRef(null),Me=A.useRef(null),Ae=A.useRef(null),pe=A.useRef(sf),de=A.useRef(null),ke=A.useRef([]),De=A.useRef([]),me=ee||d,ye=W??f,xe=l==="multiple",je=l==="single",Ge=o!==void 0||s!==void 0,gt=b!==void 0,at=y!==void 0;let ut;T==="always"?ut="always":ut=T?"input-change":!1;const[$e,pt]=Wa({controlled:i,default:xe?r??ya:r,name:"Combobox",state:"selectedValue"}),Se=A.useMemo(()=>v===null?()=>!0:v!==void 0?v:je&&!K?uSe(Z,R,$e):lSe(Z,R),[v,je,$e,K,Z,R]),Be=Di(()=>Ge?s??"":je?mi($e,R):"").current,[Je,ct]=Wa({controlled:o,default:Be,name:"Combobox",state:"inputValue"}),[ht,mn]=Wa({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),Bt=jne(b),Mt=te??(Je===""?"":String(Je).trim()),dt=je?mi($e,R):"",rn=je&&!K&&Mt!==""&&dt!==""&&dt.length===Mt.length&&Z.contains(dt,Mt),Ut=rn?"":Mt,_t=gt&&at&&rn,Yt=A.useMemo(()=>b?Bt?b.flatMap(mt=>mt.items):b:ya,[b,Bt]),Vt=A.useMemo(()=>{if(y&&!_t)return y;if(!b)return ya;if(Bt){const Pt=b,tn=[];let ir=0;for(const Dr of Pt){if(q>-1&&ir>=q)break;const Qr=Ut===""?Dr.items:Dr.items.filter(tu=>Se(tu,Ut,R));if(Qr.length===0)continue;const Jl=q>-1?q-ir:1/0,eu=Qr.slice(0,Jl);if(eu.length>0){const tu={...Dr,items:eu};tn.push(tu),ir+=eu.length}}return tn}if(Ut==="")return q>-1?Yt.slice(0,q):Yt;const mt=[];for(const Pt of Yt){if(q>-1&&mt.length>=q)break;Se(Pt,Ut,R)&&mt.push(Pt)}return mt},[y,_t,b,Bt,Ut,q,Se,R,Yt]),Pe=A.useMemo(()=>Bt?Vt.flatMap(Pt=>Pt.items):Vt,[Vt,Bt]),tt=Di(()=>new jf({id:ae,selectedValue:$e,open:ht,filter:Se,query:Mt,items:b,selectionMode:l,listRef:J,labelsRef:ve,popupRef:ge,emptyRef:Ee,inputRef:fe,keyboardActiveRef:_e,chipsContainerRef:Ce,clearRef:Me,valuesRef:ke,allValuesRef:De,selectionEventRef:Ae,name:ye,disabled:me,readOnly:m,required:g,grid:_,isGrouped:Bt,virtualized:D,openOnInputClick:S,itemToStringLabel:R,isItemEqualToValue:N,modal:P,autoHighlight:ut,submitOnItemClick:G,hasInputValue:Ge,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:L,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Vn,setOpen:Vn,setInputValue:Vn,setSelectedValue:Vn,setIndices:Vn,onItemHighlighted:Vn,handleSelection:Vn,getItemProps:()=>Jn,forceMount:Vn,requestSubmit:Vn})).current,vt=l==="none"?Je:$e,Nn=A.useMemo(()=>l==="none"?vt:Array.isArray($e)?$e.map(mt=>No(mt,O)):No($e,O),[vt,O,l,$e]),On=Ye(u),Xn=Ye(n),rr=Qe(tt,bt.activeIndex),Zl=Qe(tt,bt.selectedIndex),Ei=Qe(tt,bt.positionerElement),Or=Qe(tt,bt.listElement),hr=Qe(tt,bt.triggerElement),rs=Qe(tt,bt.inputElement),ji=Qe(tt,bt.inline),is=Qe(tt,bt.inputInsidePopup),Mp=Er(hr),{mounted:Ql,setMounted:nl,transitionStatus:rl}=go(ht),{openMethod:Oa,triggerProps:qt,reset:il}=Aw(ht);pg({id:ae,name:ye,commit:oe.commit,value:vt,controlRef:is?Mp:fe,getValue:()=>Nn});const Ra=Ye(()=>{b?ve.current=Pe.map(mt=>mi(mt,R)):tt.set("forceMounted",!0)}),Rr=A.useRef($e);nt(()=>{$e!==Rr.current&&Ra()},[Ra,$e]);const Si=Ye(mt=>{tt.update(mt);const Pt=mt.type||"none";if(mt.activeIndex!==void 0)if(mt.activeIndex===null)pe.current!==sf&&(pe.current=sf,On(void 0,zb(Pt,void 0,{index:-1})));else{const tn=ke.current[mt.activeIndex];pe.current={value:tn,index:mt.activeIndex},On(tn,zb(Pt,void 0,{index:mt.activeIndex}))}}),Fi=Ye((mt,Pt)=>{if(Ve.current=Pt.reason===Vc,e.onInputValueChange?.(mt,Pt),!Pt.isCanceled){if(Pt.reason===_f){const tn=mt.trim()!=="";tn&&Q(!0),de.current={hasQuery:tn},tn&&ut&&tt.state.activeIndex==null&&tt.set("activeIndex",0)}ct(mt)}}),pa=Ye((mt,Pt)=>{ht!==mt&&(Pt.reason==="escape-key"&&gt&&Pe.length===0&&!tt.state.emptyRef.current&&Pt.allowPropagation(),e.onOpenChange?.(mt,Pt),!Pt.isCanceled&&(!mt&&K&&(je?(ne(Mt),Mt===""&&Q(!1)):xe&&(ji||is?Si({activeIndex:null}):ne(Mt),Fi("",lt(Vc,Pt.event)))),mn(mt)))}),as=Ye((mt,Pt)=>{if(a?.(mt,Pt),Pt.isCanceled)return;pt(mt),(l==="none"&&ge.current&&z||je&&!tt.state.inputInsidePopup)&&Fi(mi(mt,R),lt(Pt.reason,Pt.event)),je&&mt!=null&&Pt.reason!==_f&&K&&ne(Mt)}),Hg=Ye((mt,Pt)=>{let tn=Pt;if(tn===void 0){if(rr===null)return;tn=ke.current[rr]}const ir=Mr(mt),Dr=Ae.current??mt;Ae.current=null;const Qr=lt(Pf,Dr),Jl=ir?.closest("a")?.getAttribute("href");if(Jl){Jl.startsWith("#")&&pa(!1,Qr);return}if(xe){const eu=Array.isArray($e)?$e:[],_o=wf(eu,tn,tt.state.isItemEqualToValue)?Mne(eu,tn,tt.state.isItemEqualToValue):[...eu,tn];if(as(_o,Qr),!(fe.current?fe.current.value.trim()!=="":!1))return;tt.state.inputInsidePopup?Fi("",lt(Vc,Qr.event)):pa(!1,Qr)}else as(tn,Qr),pa(!1,Qr)}),dc=Ye(()=>{if(!tt.state.submitOnItemClick)return;const mt=tt.state.inputElement?.form;mt&&typeof mt.requestSubmit=="function"&&mt.requestSubmit()}),fc=Ye(()=>{if(nl(!1),Xn?.(!1),Q(!1),il(),ne(null),Si(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),xe&&fe.current&&fe.current.value!==""&&!Ve.current&&Fi("",lt(Vc)),je)if(tt.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Fi("",lt(Vc));else{const mt=mi($e,R);fe.current&&fe.current.value!==mt&&Fi(mt,lt(mt===""?Vc:Vr))}}),Wg=A.useMemo(()=>ji&&Ei?{current:Ei.closest('[role="dialog"]')}:ge,[ji,Ei]);Li({enabled:!e.actionsRef,open:ht,ref:Wg,onComplete(){ht||fc()}}),A.useImperativeHandle(e.actionsRef,()=>({unmount:fc}),[fc]),nt(function(){if(ht||l==="none")return;const Pt=b?Yt:De.current;if(xe){const tn=Array.isArray($e)?$e:[],ir=tn[tn.length-1],Dr=gm(Pt,ir,N);Si({selectedIndex:Dr===-1?null:Dr})}else{const tn=gm(Pt,$e,N);Si({selectedIndex:tn===-1?null:tn})}},[ht,$e,b,l,Yt,xe,N,Si]),nt(()=>{b&&(ke.current=Pe,J.current.length=Pe.length)},[b,Pe]),nt(()=>{const mt=de.current;if(mt&&(mt.hasQuery?ut&&tt.set("activeIndex",0):ut==="always"&&tt.set("activeIndex",0),de.current=null),!ht&&!ji)return;const tn=gt||at?Pe:ke.current,ir=tt.state.activeIndex;if(ir==null){if(ut==="always"&&tn.length>0){tt.set("activeIndex",0);return}pe.current!==sf&&(pe.current=sf,tt.state.onItemHighlighted(void 0,zb(Vr,void 0,{index:-1})));return}if(ir>=tn.length){pe.current!==sf&&(pe.current=sf,tt.state.onItemHighlighted(void 0,zb(Vr,void 0,{index:-1}))),tt.set("activeIndex",null);return}const Dr=tn[ir],Qr=pe.current.value,Jl=Qr!==Xne&&tt.state.isItemEqualToValue(Dr,Qr);(pe.current.index!==ir||!Jl)&&(pe.current={value:Dr,index:ir},tt.state.onItemHighlighted(Dr,zb(Vr,void 0,{index:ir})))},[rr,ut,at,gt,Pe,ji,ht,tt]),nt(()=>{if(!b||l==="none")return;const mt=Yt;if(xe){const ir=Array.isArray($e)?$e:ya,Dr=ir.filter(Qr=>wf(mt,Qr,tt.state.isItemEqualToValue));Dr.length!==ir.length&&pt(Dr);return}if($e==null?!0:wf(mt,$e,tt.state.isItemEqualToValue))return;let tn=null;if(r!=null&&wf(mt,r,tt.state.isItemEqualToValue)&&(tn=r),pt(tn),!tt.state.inputInsidePopup){const ir=mi(tn,R);fe.current&&fe.current.value!==ir&&Fi(ir,lt(Vr))}},[b,Yt,xe,l,$e,r,pt,R,tt,Fi]),nt(()=>{if(l==="none"){Y(String(Je)!=="");return}Y(xe?Array.isArray($e)&&$e.length>0:$e!=null)},[Y,l,Je,$e,xe]),A.useEffect(()=>{gt&&ut&&Pe.length===0&&Si({activeIndex:null})},[gt,ut,Pe.length,Si]),Jc(Mt,()=>{!ht||Mt===""||Mt===String(Be)||Q(!0)}),Jc($e,()=>{if(l!=="none"&&(V(ye),B($e!==j.initialValue),$()?oe.commit($e):oe.commit($e,!0),xe&&tt.state.selectedIndex!==null&&(!Array.isArray($e)||$e.length===0)&&Si({activeIndex:null,selectedIndex:null}),je&&!Ge&&!is)){const mt=mi($e,R);Je!==mt&&Fi(mt,lt(Vr))}}),Jc(Je,()=>{l==="none"&&(V(ye),B(Je!==j.initialValue),$()?oe.commit(Je):oe.commit(Je,!0))}),Jc(b,()=>{if(!je||Ge||is||K)return;const mt=mi($e,R);Je!==mt&&Fi(mt,lt(Vr))});const xo=bw({open:ji?!0:ht,onOpenChange:pa,elements:{reference:is?hr:rs,floating:Ei}});let al,ha;ji||(al=_?"grid":"listbox",ha=ht?"true":"false");const ci=A.useMemo(()=>{const mt=rs?.tagName==="INPUT",Pt=mt||ht,tn=mt?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Pt&&(tn.role="combobox",tn["aria-expanded"]=ha,tn["aria-haspopup"]=al,tn["aria-controls"]=ht?Or?.id:void 0,tn["aria-autocomplete"]=H),{reference:tn,floating:{role:"presentation"}}},[rs,ht,ha,al,Or?.id,H]),jp=sg(xo,{enabled:!m&&!me&&S,event:"mousedown-only",toggle:!1,touchOpenDelay:is?0:50}),Vg=og(xo,{enabled:!m&&!me&&!ji,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:ji?!0:void 0,outsidePress(mt){const Pt=Mr(mt);return!Rt(hr,Pt)&&!Rt(Me.current,Pt)&&!Rt(Ce.current,Pt)}}),Xe=$M(xo,{enabled:!m&&!me,id:ae,listRef:J,activeIndex:rr,selectedIndex:Zl,virtual:!0,loopFocus:!0,allowEscape:!ut,focusItemOnOpen:K||l==="none"&&!ut?!1:"auto",focusItemOnHover:C,resetOnPointerLeave:!w,cols:_?2:1,orientation:_?"horizontal":void 0,disabledIndices:ya,onNavigate(mt,Pt){!Pt&&!ht||rl==="ending"||Si(Pt?{activeIndex:mt,type:_e.current?"keyboard":"pointer"}:{activeIndex:mt})}}),{getReferenceProps:zt,getFloatingProps:Nr,getItemProps:wi}=Od([ci,jp,Vg,Xe]);Nne(()=>{tt.update({inline:L,popupProps:Nr(),inputProps:zt(),triggerProps:qt,getItemProps:wi,setOpen:pa,setInputValue:Fi,setSelectedValue:as,setIndices:Si,onItemHighlighted:On,handleSelection:Hg,forceMount:Ra,requestSubmit:dc})}),nt(()=>{tt.update({id:ae,selectedValue:$e,open:ht,mounted:Ql,transitionStatus:rl,items:b,inline:L,popupProps:Nr(),inputProps:zt(),triggerProps:qt,openMethod:Oa,getItemProps:wi,selectionMode:l,name:ye,disabled:me,readOnly:m,required:g,grid:_,isGrouped:Bt,virtualized:D,onOpenChangeComplete:Xn,openOnInputClick:S,itemToStringLabel:R,modal:P,autoHighlight:ut,isItemEqualToValue:N,submitOnItemClick:G,hasInputValue:Ge,requestSubmit:dc})},[tt,ae,$e,ht,Ql,rl,b,Nr,zt,wi,Oa,qt,l,ye,me,m,g,oe,_,Bt,D,Xn,S,R,P,N,G,Ge,L,dc,ut]);const Ir=Ga(x,oe.inputRef),Fp=A.useMemo(()=>({query:Mt,filteredItems:Vt,flatFilteredItems:Pe}),[Mt,Vt,Pe]),b1=A.useMemo(()=>Array.isArray(vt)?"":No(vt,O),[vt,O]),qg=xe&&Array.isArray($e)&&$e.length>0,pc=A.useMemo(()=>!xe||!Array.isArray($e)||!ye?null:$e.map(mt=>{const Pt=No(mt,O);return p.jsx("input",{type:"hidden",name:ye,value:Pt},Pt)}),[xe,$e,ye,O]),v1=p.jsxs(A.Fragment,{children:[e.children,p.jsx("input",{...oe.getInputValidationProps({onFocus(){if(is){hr?.focus();return}(fe.current||hr)?.focus()},onChange(mt){if(mt.nativeEvent.defaultPrevented)return;const Pt=mt.target.value,tn=lt(_f,mt.nativeEvent);function ir(){if(xe)return;if(l==="none"){B(Pt!==j.initialValue),Fi(Pt,tn),$()&&oe.commit(Pt);return}const Dr=ke.current.find(Qr=>No(Qr,O).toLowerCase()===Pt.toLowerCase());Dr!=null&&(B(Dr!==j.initialValue),as?.(Dr,tn),$()&&oe.commit(Dr))}b?ir():(Ra(),queueMicrotask(ir))}}),id:ae,name:xe||l==="none"?void 0:ye,disabled:me,required:g&&!qg,readOnly:m,value:b1,ref:Ir,style:kd,tabIndex:-1,"aria-hidden":!0}),pc]});return p.jsx(Vne.Provider,{value:tt,children:p.jsx(qne.Provider,{value:xo,children:p.jsx(Gne.Provider,{value:Fp,children:p.jsx(Kne.Provider,{value:Je,children:v1})})})})}const Zx=2,pSe={...dm,...nc},hSe=A.forwardRef(function(t,n){const{render:r,className:i,nativeButton:a=!0,disabled:s=!1,...o}=t,{state:l,disabled:u,setTouched:f,setFocused:d,validationMode:m,validation:g}=Ka(),{labelId:x}=$l(),_=rc(),b=Qe(_,bt.selectionMode),y=Qe(_,bt.disabled),v=Qe(_,bt.readOnly),S=Qe(_,bt.listElement),T=Qe(_,bt.triggerProps),w=Qe(_,bt.triggerElement),C=Qe(_,bt.inputInsidePopup),R=Qe(_,bt.open),O=Qe(_,bt.selectedValue),N=Qe(_,bt.activeIndex),D=Qe(_,bt.selectedIndex),L=Ow(),z=c3(),P=zn(),q=u||y||s,H=A.useRef("");function F(oe){H.current=oe.pointerType}const G=L.select("domReferenceElement");A.useEffect(()=>{C&&w&&w!==G&&L.set("domReferenceElement",w)},[w,G,L,C]);const{reference:V}=zM(L,{enabled:!R&&!v&&!y&&b==="single",listRef:_.state.labelsRef,activeIndex:N,selectedIndex:D,onMatch(oe){const ae=_.state.valuesRef.current[oe];ae!==void 0&&_.state.setSelectedValue(ae,lt("none"))}}),{reference:B}=sg(L,{enabled:!v&&!y,event:"mousedown"}),{buttonRef:j,getButtonProps:$}=ua({native:a,disabled:q}),Y=A.useMemo(()=>({...l,open:R,disabled:q}),[l,R,q]),W=Ye(oe=>{_.set("triggerElement",oe)});return Ct("button",t,{ref:[n,j,W],state:Y,props:[T,B,V,{tabIndex:C?0:-1,disabled:q,role:C?"combobox":void 0,"aria-expanded":R?"true":"false","aria-haspopup":C?"dialog":"listbox","aria-controls":R?S?.id:void 0,"aria-readonly":v||void 0,"aria-labelledby":x,onPointerDown:F,onPointerEnter:F,onFocus(){d(!0),!(q||v)&&P.start(0,_.state.forceMount)},onBlur(){if(f(!0),d(!1),m==="onBlur"){const oe=b==="none"?z:O;g.commit(oe)}},onMouseDown(oe){if(q||v||(C||L.set("domReferenceElement",oe.currentTarget),_.state.forceMount(),H.current!=="touch"&&(_.state.inputRef.current?.focus(),C||oe.preventDefault()),R))return;const ae=Zi(oe.currentTarget);function Z(K){if(!w)return;const Q=Mr(K),te=_.state.positionerElement,ne=_.state.listElement;if(Rt(w,Q)||Rt(te,Q)||Rt(ne,Q)||Q===w)return;const J=i3(w),ve=K.clientX>=J.left-Zx&&K.clientX<=J.right+Zx,ge=K.clientY>=J.top-Zx&&K.clientY<=J.bottom+Zx;ve&&ge||_.state.setOpen(!1,lt("cancel-open",K))}C&&ae.addEventListener("mouseup",Z,{once:!0})},onKeyDown(oe){q||v||(oe.key==="ArrowDown"||oe.key==="ArrowUp")&&(Wr(oe),_.state.setOpen(!0,lt(Hh,oe.nativeEvent)),_.state.inputRef.current?.focus())}},g?g.getValidationProps(o):o,$],stateAttributesMapping:pSe})}),mSe=A.createContext(void 0);function gSe(){return A.useContext(mSe)}const Zne=A.createContext(void 0);function d3(e){const t=A.useContext(Zne);if(t===void 0&&!e)throw new Error(on(21));return t}const bSe={...dm,...nc,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null},vSe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,id:s,...o}=t,{state:l,disabled:u,setTouched:f,setFocused:d,validationMode:m,validation:g}=Ka(),{labelId:x}=$l(),_=gSe(),y=!!d3(!0),v=rc(),{filteredItems:S}=gp(),T=c3(),w=ui(s),C=ec(),R=Qe(v,bt.disabled),O=Qe(v,bt.readOnly),N=Qe(v,bt.name),D=Qe(v,bt.selectionMode),L=Qe(v,bt.autoHighlight),z=Qe(v,bt.inputProps),P=Qe(v,bt.triggerProps),q=Qe(v,bt.open),H=Qe(v,bt.mounted),F=Qe(v,bt.selectedValue),G=Qe(v,bt.popupSide),V=Qe(v,bt.positionerElement),B=!!L,j=H&&V?G:null,$=u||R||a,Y=S.length===0,[W,ee]=A.useState(null),oe=A.useRef(!1),ae=Ye(te=>{const ne=y||v.state.inline;ne&&!v.state.hasInputValue&&v.state.setInputValue("",lt(Vr)),v.update({inputElement:te,inputInsidePopup:ne})}),Z=A.useMemo(()=>({...l,open:q,disabled:$,readOnly:O,popupSide:j,listEmpty:Y}),[l,q,$,O,j,Y]);function K(te){if(!_)return;let ne;const{highlightedChipIndex:J}=_;if(J!==void 0){if(te.key==="ArrowLeft")te.preventDefault(),J>0?ne=J-1:ne=void 0;else if(te.key==="ArrowRight")te.preventDefault(),J<F.length-1?ne=J+1:ne=void 0;else if(te.key==="Backspace"||te.key==="Delete"){te.preventDefault();const ve=J>=F.length-1?F.length-2:J;ne=ve>=0?ve:void 0,v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return ne}return te.key==="ArrowLeft"&&(te.currentTarget.selectionStart??0)===0&&F.length>0?(te.preventDefault(),ne=Math.max(F.length-1,0)):te.key==="Backspace"&&te.currentTarget.value===""&&F.length>0&&(v.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),te.preventDefault()),ne}return Ct("input",t,{state:Z,ref:[n,v.state.inputRef,ae],props:[z,P,{type:"text",value:t.value??W??T,"aria-readonly":O||void 0,"aria-labelledby":x,disabled:$,readOnly:O,...D==="none"&&N&&{name:N},id:w,onFocus(){d(!0)},onBlur(){if(f(!0),d(!1),m==="onBlur"){const te=D==="none"?T:F;g.commit(te)}},onCompositionStart(te){fE||(oe.current=!0,ee(te.currentTarget.value))},onCompositionEnd(te){oe.current=!1;const ne=te.currentTarget.value;ee(null),v.state.setInputValue(ne,lt(_f,te.nativeEvent))},onChange(te){if(oe.current){const ge=te.currentTarget.value;ee(ge),ge===""&&!v.state.openOnInputClick&&!v.state.inputInsidePopup&&v.state.setOpen(!1,lt(Vc,te.nativeEvent));const fe=ge.trim(),Ee=B&&fe!=="";!O&&!$&&fe!==""&&(v.state.setOpen(!0,lt(_f,te.nativeEvent)),B||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),q&&v.state.activeIndex!==null&&!Ee&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"});return}v.state.setInputValue(te.currentTarget.value,lt(_f,te.nativeEvent));const ne=te.currentTarget.value==="",J=lt(Vc,te.nativeEvent);ne&&!v.state.inputInsidePopup&&(D==="single"&&v.state.setSelectedValue(null,J),v.state.openOnInputClick||v.state.setOpen(!1,J));const ve=te.currentTarget.value.trim();!O&&!$&&ve!==""&&(v.state.setOpen(!0,lt(_f,te.nativeEvent)),B||v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})),q&&v.state.activeIndex!==null&&!B&&v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(te){if($||O||te.ctrlKey||te.shiftKey||te.altKey||te.metaKey)return;v.state.keyboardActiveRef.current=!0;const ne=te.currentTarget,J=ne.scrollWidth-ne.clientWidth,ve=C==="rtl";if(te.key==="Home"){Wr(te);const fe=pz&&ve?ne.value.length:0;ne.setSelectionRange(fe,fe),ne.scrollLeft=0;return}if(te.key==="End"){Wr(te);const fe=pz&&ve?0:ne.value.length;ne.setSelectionRange(fe,fe),ne.scrollLeft=ve?-J:J;return}if(!H&&te.key==="Escape"){const fe=D==="multiple"&&Array.isArray(F)?F.length===0:F===null,Ee=lt(v0,te.nativeEvent),_e=D==="multiple"?[]:null;v.state.setInputValue("",Ee),v.state.setSelectedValue(_e,Ee),!fe&&!v.state.inline&&!Ee.isPropagationAllowed&&te.stopPropagation();return}if(_&&te.key==="Backspace"&&ne.value===""&&_.highlightedChipIndex===void 0&&Array.isArray(F)&&F.length>0){const fe=F.slice(0,-1);v.state.setIndices({activeIndex:null,selectedIndex:null,type:v.state.keyboardActiveRef.current?"keyboard":"pointer"}),v.state.setSelectedValue(fe,lt(Vr,te.nativeEvent));return}const ge=K(te);if(_?.setHighlightedChipIndex(ge),ge!==void 0?_?.chipsRef.current[ge]?.focus():v.state.inputRef.current?.focus(),te.which!==229&&te.key==="Enter"&&q){const fe=v.state.activeIndex,Ee=te.nativeEvent;if(fe===null){v.state.setOpen(!1,lt(Vr,Ee));return}Wr(te);const _e=v.state.listRef.current[fe];_e&&(v.state.selectionEventRef.current=Ee,_e.click(),v.state.selectionEventRef.current=null)}},onPointerMove(){v.state.keyboardActiveRef.current=!1},onPointerDown(){v.state.keyboardActiveRef.current=!1}},g?g.getValidationProps(o):o],stateAttributesMapping:bSe})}),ySe={...Za,...xw},xSe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,keepMounted:o=!1,...l}=t,{disabled:u}=Ka(),f=rc(),d=Qe(f,bt.selectionMode),m=Qe(f,bt.disabled),g=Qe(f,bt.readOnly),x=Qe(f,bt.open),_=Qe(f,bt.selectedValue),b=c3();let y=!1;d==="none"?y=b!=="":d==="single"?y=_!=null:y=Array.isArray(_)&&_.length>0;const v=u||m||a,{buttonRef:S,getButtonProps:T}=ua({native:s,disabled:v}),{mounted:w,transitionStatus:C,setMounted:R}=go(y),O=A.useMemo(()=>({disabled:v,open:x,transitionStatus:C}),[v,x,C]);Li({open:y,ref:f.state.clearRef,onComplete(){y||R(!1)}});const N=Ct("button",t,{state:O,ref:[n,S,f.state.clearRef],props:[{tabIndex:-1,children:"x",disabled:v,"aria-readonly":g||void 0,onMouseDown(L){L.preventDefault()},onClick(L){if(v||g)return;const z=f.state.keyboardActiveRef;f.state.setInputValue("",lt(xz,L.nativeEvent)),d!=="none"?(f.state.setSelectedValue(Array.isArray(_)?[]:null,lt(xz,L.nativeEvent)),f.state.setIndices({activeIndex:null,selectedIndex:null,type:z.current?"keyboard":"pointer"})):f.state.setIndices({activeIndex:null,type:z.current?"keyboard":"pointer"}),f.state.inputRef.current?.focus()}},l,T],stateAttributesMapping:ySe});return o||w?N:null}),_Se=A.createContext(null);function ESe(){return A.useContext(_Se)}function SSe(e){const{children:t}=e,{filteredItems:n}=gp(),r=ESe(),i=r?r.items:n;return i?p.jsx(A.Fragment,{children:i.map(t)}):null}const wSe=A.forwardRef(function(t,n){var r;const{render:i,className:a,children:s,...o}=t,l=rc(),u=Ow(),f=!!d3(!0),{filteredItems:d}=gp(),m=Qe(l,bt.items),g=Qe(l,bt.labelsRef),x=Qe(l,bt.listRef),_=Qe(l,bt.selectionMode),b=Qe(l,bt.grid),y=Qe(l,bt.popupProps),v=Qe(l,bt.disabled),S=Qe(l,bt.readOnly),T=Qe(l,bt.virtualized),w=_==="multiple",C=d.length===0,R=Ye(P=>{l.set("positionerElement",P)}),O=Ye(P=>{l.set("listElement",P)}),N=A.useMemo(()=>typeof s=="function"?r||(r=p.jsx(SSe,{children:s})):s,[s]),D=A.useMemo(()=>({empty:C}),[C]),L=u.useState("floatingId"),z=Ct("div",t,{state:D,ref:[n,O,f?null:R],props:[y,{children:N,tabIndex:-1,id:L,role:b?"grid":"listbox","aria-multiselectable":w?"true":void 0,onKeyDown(P){if(!(v||S)&&P.key==="Enter"){const q=l.state.activeIndex;if(q==null)return;Wr(P);const H=P.nativeEvent,F=l.state.listRef.current[q];F&&(l.state.selectionEventRef.current=H,F.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},o]});return T?z:p.jsx(_0,{elementsRef:x,labelsRef:m?void 0:g,children:z})}),Qne=A.createContext(void 0);function CSe(){const e=A.useContext(Qne);if(e===void 0)throw new Error(on(20));return e}const TSe=A.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,a=rc(),s=Qe(a,bt.mounted),o=Qe(a,bt.forceMounted);return s||r||o?p.jsx(Qne.Provider,{value:r,children:p.jsx(y0,{ref:n,...i})}):null}),ASe=A.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="bottom",align:l="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_=!1,collisionAvoidance:b=cw,...y}=t,v=rc(),{filteredItems:S}=gp(),T=Ow(),w=CSe(),C=Qe(v,bt.modal),R=Qe(v,bt.open),O=Qe(v,bt.mounted),N=Qe(v,bt.openMethod),D=Qe(v,bt.triggerElement),L=Qe(v,bt.inputElement),z=Qe(v,bt.inputInsidePopup),P=S.length===0,H=T0({anchor:a??(z?D:L),floatingRootContext:T,positionMethod:s,mounted:O,side:o,sideOffset:u,align:l,alignOffset:f,arrowPadding:g,collisionBoundary:d,collisionPadding:m,sticky:x,disableAnchorTracking:_,keepMounted:w,collisionAvoidance:b,lazyFlip:!0});Tw(R&&C&&N!=="touch",D);const F=A.useMemo(()=>{const $={...H.positionerStyles};return R||($.pointerEvents="none"),{role:"presentation",hidden:!O,style:$}},[R,O,H.positionerStyles]),G=A.useMemo(()=>({open:R,side:H.side,align:H.align,anchorHidden:H.anchorHidden,empty:P}),[R,H.side,H.align,H.anchorHidden,P]);nt(()=>{v.set("popupSide",H.side)},[v,H.side]);const V=A.useMemo(()=>({side:H.side,align:H.align,arrowRef:H.arrowRef,arrowUncentered:H.arrowUncentered,arrowStyles:H.arrowStyles,anchorHidden:H.anchorHidden,isPositioned:H.isPositioned}),[H.side,H.align,H.arrowRef,H.arrowUncentered,H.arrowStyles,H.anchorHidden,H.isPositioned]),B=Ye($=>{v.set("positionerElement",$)}),j=Ct("div",t,{state:G,ref:[n,B],props:[F,y],stateAttributesMapping:Qa});return p.jsxs(Zne.Provider,{value:V,children:[O&&C&&p.jsx(Cw,{inert:lg(!R),cutout:L??D}),j]})}),kSe={...Qa,...Za},OSe=A.forwardRef(function(t,n){const{render:r,className:i,initialFocus:a,finalFocus:s,...o}=t,l=rc(),u=d3(),f=Ow(),{filteredItems:d}=gp(),m=Qe(l,bt.mounted),g=Qe(l,bt.open),x=Qe(l,bt.openMethod),_=Qe(l,bt.transitionStatus),b=Qe(l,bt.inputInsidePopup),y=Qe(l,bt.inputElement),v=d.length===0;Li({open:g,ref:l.state.popupRef,onComplete(){g&&l.state.onOpenChangeComplete(!0)}});const S=A.useMemo(()=>({open:g,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:_,empty:v}),[g,u.side,u.align,u.anchorHidden,_,v]),T=Ct("div",t,{state:S,ref:[n,l.state.popupRef],props:[{role:b?"dialog":"presentation",tabIndex:-1,onFocus(O){const N=Mr(O.nativeEvent);x!=="touch"&&(Rt(l.state.listElement,N)||N===O.currentTarget)&&l.state.inputRef.current?.focus()}},cg(_),o],stateAttributesMapping:kSe}),C=a===void 0?b?O=>O==="touch"?l.state.popupRef.current:y:!1:a;let R;return s!=null?R=s:R=b?void 0:!1,p.jsx(pw,{context:f,disabled:!m,modal:!b,openInteractionType:x,initialFocus:C,returnFocus:R,children:T})}),Jne=A.createContext(void 0);function ere(){const e=A.useContext(Jne);if(!e)throw new Error(on(19));return e}const RSe=A.createContext(!1);function NSe(){return A.useContext(RSe)}const ISe=A.memo(A.forwardRef(function(t,n){const{render:r,className:i,value:a=null,index:s,disabled:o=!1,nativeButton:l=!1,...u}=t,f=A.useRef(!1),d=A.useRef(null),m=ug({index:s,textRef:d,indexGuessBehavior:qM.GuessFromOrder}),g=rc(),x=NSe(),{flatFilteredItems:_}=gp(),b=Qe(g,bt.open),y=Qe(g,bt.selectionMode),v=Qe(g,bt.readOnly),S=Qe(g,bt.virtualized),T=Qe(g,bt.isItemEqualToValue),w=y!=="none",C=s??(S?gm(_,a,T):m.index),R=m.index!==-1,O=Qe(g,bt.id),N=Qe(g,bt.isActive,C),D=Qe(g,bt.isSelected,a),L=Qe(g,bt.items),z=Qe(g,bt.getItemProps),P=A.useRef(null),q=O!=null&&R?`${O}-${C}`:void 0,H=D&&w;nt(()=>{if(!(R&&(S||s!=null)))return;const oe=g.state.listRef.current;return oe[C]=P.current,()=>{delete oe[C]}},[R,S,C,s,g]),nt(()=>{if(!R||L)return;const ee=g.state.valuesRef.current;return ee[C]=a,y!=="none"&&g.state.allValuesRef.current.push(a),()=>{delete ee[C]}},[R,L,C,a,g,y]),nt(()=>{if(!b){f.current=!1;return}if(!R||L)return;const ee=g.state.selectedValue,oe=Array.isArray(ee)?ee[ee.length-1]:ee;zu(oe,a,T)&&g.set("selectedIndex",C)},[R,L,b,g,C,a,T]);const F=A.useMemo(()=>({disabled:o,selected:H,highlighted:N}),[o,H,N]),G=z({active:N,selected:H});G.id=void 0,G.onFocus=void 0;const{getButtonProps:V,buttonRef:B}=ua({disabled:o,focusableWhenDisabled:!0,native:l});function j(ee){function oe(){g.state.handleSelection(ee,a)}g.state.submitOnItemClick?(Ur.flushSync(oe),g.state.requestSubmit()):oe()}const $={id:q,role:x?"gridcell":"option","aria-disabled":o||void 0,"aria-selected":w?H:void 0,tabIndex:void 0,onPointerDownCapture(ee){f.current=!0,ee.preventDefault()},onClick(ee){o||v||j(ee.nativeEvent)},onMouseUp(ee){const oe=f.current;f.current=!1,!(o||v||ee.button!==0||oe||!N)&&j(ee.nativeEvent)}},Y=Ct("div",t,{ref:[B,n,m.ref,P],state:F,props:[G,$,u,V]}),W=A.useMemo(()=>({selected:H,textRef:d}),[H,d]);return p.jsx(Jne.Provider,{value:W,children:Y})})),DSe=A.forwardRef(function(t,n){const{render:r,className:i,children:a,...s}=t,{filteredItems:o}=gp(),l=rc(),u=o.length===0?a:null;return Ct("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});let rH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});function tre(e){return A.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[rH.checked]:""}:{[rH.unchecked]:""}},...nc}),[e.indeterminate])}const nre=A.createContext(void 0);function LSe(){const e=A.useContext(nre);if(e===void 0)throw new Error(on(14));return e}const PSe="data-parent",MSe=A.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a=!1,disabled:s=!1,id:o,indeterminate:l=!1,inputRef:u,name:f,onCheckedChange:d,parent:m=!1,readOnly:g=!1,render:x,required:_=!1,uncheckedValue:b,value:y,nativeButton:v=!1,...S}=t,{clearErrors:T}=fg(),{disabled:w,name:C,setDirty:R,setFilled:O,setFocused:N,setTouched:D,state:L,validationMode:z,validityData:P,shouldValidateOnChange:q,validation:H}=Ka(),F=Tne(),{labelId:G,controlId:V,setControlId:B,getDescriptionProps:j}=$l(),$=SEe(),Y=$?.parent,W=Y&&$.allValues,ee=w||F.disabled||$?.disabled||s,oe=C??f,ae=y??oe,Z=ui(),K=ui();let Q=V;W?Q=m?K:`${Y.id}-${ae}`:o&&(Q=o);let te={};W&&(m?te=$.parent.getParentProps():ae&&(te=$.parent.getChildProps(ae)));const ne=Ye(d),{checked:J=r,indeterminate:ve=l,onCheckedChange:ge,...fe}=te,Ee=$?.value,_e=$?.setValue,Ve=$?.defaultValue,Ce=A.useRef(null),{getButtonProps:Me,buttonRef:Ae}=ua({disabled:ee,native:v}),pe=$?.validation??H,[de,ke]=Wa({controlled:ae&&Ee&&!m?Ee.includes(ae):J,default:ae&&Ve&&!m?Ve.includes(ae):a,name:"Checkbox",state:"checked"});nt(()=>{if(B!==Vn)return B(Q),()=>{B(void 0)}},[Q,$,B,m]),pg({enabled:!$,id:Z,commit:pe.commit,value:de,controlRef:Ce,name:oe,getValue:()=>de});const De=A.useRef(null),me=Ga(u,De,pe.inputRef);nt(()=>{De.current&&(De.current.indeterminate=ve,de&&O(!0))},[de,ve,O]),Jc(de,()=>{$&&!m||(T(oe),O(de),R(de!==P.initialValue),q()?pe.commit(de):pe.commit(de,!0))});const ye=zo({checked:de,disabled:ee,name:m?void 0:oe,id:Q??void 0,required:_,ref:me,style:kd,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const $e=ut.target.checked,pt=lt(Vr,ut.nativeEvent);if(ge?.($e,pt),ne($e,pt),!pt.isCanceled&&(ke($e),ae&&Ee&&_e&&!m)){const Se=$e?[...Ee,ae]:Ee.filter(Be=>Be!==ae);_e(Se,pt)}},onFocus(){Ce.current?.focus()}},y!==void 0?{value:($?de&&y:y)||""}:Jn,j,$?pe.getValidationProps:pe.getInputValidationProps),xe=W?!!J:de,je=W&&ve||l;A.useEffect(()=>{Y&&ae&&Y.disabledStatesRef.current.set(ae,ee)},[Y,ee,ae]);const Ge=A.useMemo(()=>({...L,checked:xe,disabled:ee,readOnly:g,required:_,indeterminate:je}),[L,xe,ee,g,_,je]),gt=tre(Ge),at=Ct("span",t,{state:Ge,ref:[Ae,Ce,n,$?.registerControlRef],props:[{id:Z,role:"checkbox","aria-checked":ve?"mixed":de,"aria-readonly":g||void 0,"aria-required":_||void 0,"aria-labelledby":G,[PSe]:m?"":void 0,onFocus(){N(!0)},onBlur(){const ut=De.current;ut&&(D(!0),N(!1),z==="onBlur"&&pe.commit($?Ee:ut.checked))},onClick(ut){g||ee||(ut.preventDefault(),De.current?.click())}},j,pe.getValidationProps,S,fe,Me],stateAttributesMapping:gt});return p.jsxs(nre.Provider,{value:Ge,children:[at,!de&&!$&&oe&&!m&&b!==void 0&&p.jsx("input",{type:"hidden",name:oe,value:b}),p.jsx("input",{...ye})]})}),jSe=A.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=LSe(),l=o.checked||o.indeterminate,{transitionStatus:u,setMounted:f}=go(l),d=A.useRef(null),m=A.useMemo(()=>({...o,transitionStatus:u}),[o,u]);Li({open:l,ref:d,onComplete(){l||f(!1)}});const g=tre(o),x=A.useMemo(()=>({...g,...Za,...nc}),[g]),_=a||l,b=Ct("span",t,{enabled:_,ref:[n,d],state:m,stateAttributesMapping:x,props:s});return _?b:null});function FSe(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,...a}=e;return p.jsx(fSe,{...a,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i})}const BSe=A.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:i}=ere();return r||i?p.jsx(USe,{...t,ref:n}):null}),USe=A.memo(A.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:i,...a}=e,{selected:s}=ere(),o=A.useRef(null),{transitionStatus:l,setMounted:u}=go(s),f=A.useMemo(()=>({selected:s,transitionStatus:l}),[s,l]),d=Ct("span",e,{ref:[t,o],state:f,props:[{"aria-hidden":!0,children:"✔️"},a],stateAttributesMapping:Za});return Li({open:s,ref:o,onComplete(){s||u(!1)}}),d})),$Se=A.createContext(void 0);function Rw(e=!0){const t=A.useContext($Se);if(t===void 0&&!e)throw new Error(on(25));return t}const rre=A.createContext(void 0);function f3(e){const t=A.useContext(rre);if(t===void 0&&!e)throw new Error(on(33));return t}const ire=A.createContext(void 0);function Rd(e){const t=A.useContext(ire);if(t===void 0&&!e)throw new Error(on(36));return t}const are={type:"regular-item"};function sre(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,nativeButton:s,itemMetadata:o,nodeId:l}=e,u=A.useRef(null),f=Rw(!0),d=f!==void 0,{events:m}=a.useState("floatingTreeRoot"),{getButtonProps:g,buttonRef:x}=ua({disabled:n,focusableWhenDisabled:!0,native:s}),_=A.useCallback(y=>zo({id:i,role:"menuitem",tabIndex:r?0:-1,onMouseMove(v){l&&m.emit("itemhover",{nodeId:l,target:v.currentTarget})},onMouseEnter(){o.type==="submenu-trigger"&&o.setActive()},onKeyUp(v){v.key===" "&&a.context.typingRef.current&&v.preventBaseUIHandler()},onClick(v){t&&m.emit("close",{domEvent:v,reason:Pf})},onMouseUp(v){if(f){const S=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,d&&S&&Math.abs(v.clientX-S.x)<=1&&Math.abs(v.clientY-S.y)<=1)return}u.current&&a.context.allowMouseUpTriggerRef.current&&(!d||v.button===2)&&o.type==="regular-item"&&u.current.click()}},y,g),[i,r,g,t,m,a,d,f,o,l]),b=Ga(u,x);return A.useMemo(()=>({getItemProps:_,itemRef:b}),[_,b])}let iH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.highlighted="data-highlighted",e})({});const ore={checked(e){return e?{[iH.checked]:""}:{[iH.unchecked]:""}},...Za},zSe=A.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!0,...f}=t,d=ug({label:s}),m=f3(!0),g=ui(a),{store:x}=Rd(),_=x.useState("isActive",d.index),b=x.useState("itemProps"),{getItemProps:y,itemRef:v}=sre({closeOnClick:u,disabled:l,highlighted:_,id:g,store:x,nativeButton:o,nodeId:m?.nodeId,itemMetadata:are}),S=A.useMemo(()=>({disabled:l,highlighted:_}),[l,_]);return Ct("div",t,{state:S,props:[b,f,y],ref:[v,n,d.ref]})}),HSe={...Qa,...Za},WSe=A.forwardRef(function(t,n){const{render:r,className:i,finalFocus:a,...s}=t,{store:o}=Rd(),{side:l,align:u}=f3(),f=s3()!=null,d=o.useState("open"),m=o.useState("transitionStatus"),g=o.useState("popupProps"),x=o.useState("mounted"),_=o.useState("instantType"),b=o.useState("activeTriggerElement"),y=o.useState("parent"),v=o.useState("lastOpenChangeReason"),S=o.useState("rootId"),T=o.useState("floatingRootContext"),w=o.useState("floatingTreeRoot"),C=o.useState("closeDelay"),R=o.useState("activeTriggerElement");Li({open:d,ref:o.context.popupRef,onComplete(){d&&o.context.onOpenChangeComplete?.(!0)}}),A.useEffect(()=>{function P(q){o.setOpen(!1,lt(q.reason,q.domEvent))}return w.events.on("close",P),()=>{w.events.off("close",P)}},[w.events,o]);const O=o.useState("hoverEnabled"),N=o.useState("disabled");Fte(T,{enabled:O&&!N&&y.type!=="context-menu"&&y.type!=="menubar",closeDelay:C});const D=A.useMemo(()=>({transitionStatus:m,side:l,align:u,open:d,nested:y.type==="menu",instant:_}),[m,l,u,d,y.type,_]),L=Ct("div",t,{state:D,ref:[n,o.context.popupRef],stateAttributesMapping:HSe,props:[g,{onKeyDown(P){f&&WM.has(P.key)&&P.stopPropagation()}},cg(m),s,{"data-rootownerid":S}]});let z=y.type===void 0||y.type==="context-menu";return(b||y.type==="menubar"&&v!==fw)&&(z=!0),p.jsx(pw,{context:T,modal:!1,disabled:!x,returnFocus:a===void 0?z:a,initialFocus:y.type!=="menu",restoreFocus:!0,externalTree:y.type!=="menubar"?w:void 0,previousFocusableElement:R,nextFocusableElement:y.type===void 0?o.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.type===void 0?o.context.beforeContentFocusGuardRef:void 0,children:L})}),lre=A.createContext(void 0);function VSe(){const e=A.useContext(lre);if(e===void 0)throw new Error(on(32));return e}const qSe=A.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t,{store:a}=Rd();return a.useState("mounted")||r?p.jsx(lre.Provider,{value:r,children:p.jsx(y0,{ref:n,...i})}):null}),GSe=A.forwardRef(function(t,n){const{anchor:r,positionMethod:i="absolute",className:a,render:s,side:o,align:l,sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_=!1,collisionAvoidance:b=cw,...y}=t,{store:v}=Rd(),S=VSe(),T=Rw(!0),w=v.useState("parent"),C=v.useState("floatingRootContext"),R=v.useState("floatingTreeRoot"),O=v.useState("mounted"),N=v.useState("open"),D=v.useState("modal"),L=v.useState("activeTriggerElement"),z=v.useState("lastOpenChangeReason"),P=v.useState("floatingNodeId"),q=v.useState("floatingParentNodeId");let H=r,F=u,G=f,V=l,B=b;w.type==="context-menu"&&(H=r??w.context?.anchor,V=V??"start",!o&&V!=="center"&&(G=t.alignOffset??2,F=t.sideOffset??-5));let j=o,$=V;w.type==="menu"?(j=j??"inline-end",$=$??"start",B=t.collisionAvoidance??bM):w.type==="menubar"&&(j=j??"bottom",$=$??"start");const Y=w.type==="context-menu",W=T0({anchor:H,floatingRootContext:C,positionMethod:T?"fixed":i,mounted:O,side:j,sideOffset:F,align:$,alignOffset:G,arrowPadding:Y?0:g,collisionBoundary:d,collisionPadding:m,sticky:x,nodeId:P,keepMounted:S,disableAnchorTracking:_,collisionAvoidance:B,shiftCrossAxis:Y,externalTree:R}),ee=A.useMemo(()=>{const te={};return N||(te.pointerEvents="none"),{role:"presentation",hidden:!O,style:{...W.positionerStyles,...te}}},[N,O,W.positionerStyles]);A.useEffect(()=>{function te(ne){ne.open?(ne.parentNodeId===P&&v.set("hoverEnabled",!1),ne.nodeId!==P&&ne.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,lt(pv))):ne.parentNodeId===P&&ne.reason!==pv&&v.set("hoverEnabled",!0)}return R.events.on("menuopenchange",te),()=>{R.events.off("menuopenchange",te)}},[v,R.events,P]),A.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function te(ne){if(ne.open||ne.nodeId!==v.select("floatingParentNodeId"))return;const J=ne.reason??pv;v.setOpen(!1,lt(J))}return R.events.on("menuopenchange",te),()=>{R.events.off("menuopenchange",te)}},[R.events,v]),A.useEffect(()=>{function te(ne){!N||ne.nodeId!==v.select("floatingParentNodeId")||ne.target&&L&&L!==ne.target&&v.setOpen(!1,lt(pv))}return R.events.on("itemhover",te),()=>{R.events.off("itemhover",te)}},[R.events,N,L,v]),A.useEffect(()=>{const te={open:N,nodeId:P,parentNodeId:q,reason:v.select("lastOpenChangeReason")};R.events.emit("menuopenchange",te)},[R.events,N,v,P,q]);const oe=A.useMemo(()=>({open:N,side:W.side,align:W.align,anchorHidden:W.anchorHidden,nested:w.type==="menu"}),[N,W.side,W.align,W.anchorHidden,w.type]),ae=A.useMemo(()=>({side:W.side,align:W.align,arrowRef:W.arrowRef,arrowUncentered:W.arrowUncentered,arrowStyles:W.arrowStyles,nodeId:W.context.nodeId}),[W.side,W.align,W.arrowRef,W.arrowUncentered,W.arrowStyles,W.context.nodeId]),Z=Ct("div",t,{state:oe,stateAttributesMapping:Qa,ref:[n,v.useStateSetter("positionerElement")],props:[ee,y]}),K=O&&w.type!=="menu"&&(w.type!=="menubar"&&D&&z!==Tr||w.type==="menubar"&&w.context.modal);let Q=null;return w.type==="menubar"?Q=w.context.contentElement:w.type===void 0&&(Q=L),p.jsxs(rre.Provider,{value:ae,children:[K&&p.jsx(Cw,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:lg(!N),cutout:Q}),p.jsx(vte,{id:P,children:p.jsx(_0,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:Z})})]})}),ure=A.createContext(void 0);function KSe(){const e=A.useContext(ure);if(e===void 0)throw new Error(on(34));return e}const YSe=A.memo(A.forwardRef(function(t,n){const{render:r,className:i,value:a,defaultValue:s,onValueChange:o,disabled:l=!1,...u}=t,[f,d]=Wa({controlled:a,default:s,name:"MenuRadioGroup"}),m=Ye(o),g=Ye((y,v)=>{m?.(y,v),!v.isCanceled&&d(y)}),x=A.useMemo(()=>({disabled:l}),[l]),_=Ct("div",t,{state:x,ref:n,props:{role:"group","aria-disabled":l||void 0,...u}}),b=A.useMemo(()=>({value:f,setValue:g,disabled:l}),[f,g,l]);return p.jsx(ure.Provider,{value:b,children:_})})),cre=A.createContext(void 0);function XSe(){const e=A.useContext(cre);if(e===void 0)throw new Error(on(35));return e}const ZSe=A.forwardRef(function(t,n){const{render:r,className:i,id:a,label:s,nativeButton:o=!1,disabled:l=!1,closeOnClick:u=!1,value:f,...d}=t,m=ug({label:s}),g=f3(!0),x=ui(a),{store:_}=Rd(),b=_.useState("isActive",m.index),y=_.useState("itemProps"),{value:v,setValue:S,disabled:T}=KSe(),w=T||l,C=v===f,{getItemProps:R,itemRef:O}=sre({closeOnClick:u,disabled:w,highlighted:b,id:x,store:_,nativeButton:o,nodeId:g?.nodeId,itemMetadata:are}),N=A.useMemo(()=>({disabled:w,highlighted:b,checked:C}),[w,b,C]),D=Ye(z=>{const P={...lt(Pf,z.nativeEvent),preventUnmountOnClose:()=>{}};S(f,P)}),L=Ct("div",t,{state:N,stateAttributesMapping:ore,props:[y,{role:"menuitemradio","aria-checked":C,onClick:D},d,R],ref:[O,n,m.ref]});return p.jsx(cre.Provider,{value:N,children:L})}),QSe=A.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=XSe(),l=A.useRef(null),{transitionStatus:u,setMounted:f}=go(o.checked);Li({open:o.checked,ref:l,onComplete(){o.checked||f(!1)}});const d=A.useMemo(()=>({checked:o.checked,disabled:o.disabled,highlighted:o.highlighted,transitionStatus:u}),[o.checked,o.disabled,o.highlighted,u]);return Ct("span",t,{state:d,stateAttributesMapping:ore,ref:[n,l],props:{"aria-hidden":!0,...s},enabled:a||o.checked})}),JSe=A.createContext(null);function dre(e){return A.useContext(JSe)}const ewe={...BM,disabled:He(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:He(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:He(e=>e.parent.type==="menu"?e.parent.store.select("allowMouseEnter"):e.allowMouseEnter),stickIfOpen:He(e=>e.stickIfOpen),parent:He(e=>e.parent),rootId:He(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:He(e=>e.activeIndex),isActive:He((e,t)=>e.activeIndex===t),hoverEnabled:He(e=>e.hoverEnabled),instantType:He(e=>e.instantType),lastOpenChangeReason:He(e=>e.openChangeReason),floatingTreeRoot:He(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:He(e=>e.floatingNodeId),floatingParentNodeId:He(e=>e.floatingParentNodeId),itemProps:He(e=>e.itemProps),closeDelay:He(e=>e.closeDelay),keyboardEventRelay:He(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class p3 extends mw{constructor(t){super({...twe(),...t},{positionerRef:A.createRef(),popupRef:A.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:A.createRef(),beforeContentFocusGuardRef:A.createRef(),onOpenChangeComplete:void 0,triggerElements:new x0},ewe),this.observe(He(n=>n.allowMouseEnter),(n,r)=>{this.state.parent.type==="menu"&&n!==r&&this.state.parent.store.set("allowMouseEnter",n)}),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){return Di(()=>t??new p3(n)).current}unsubscribeParentListener=null}function twe(){return{...FM(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new kM,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Jn,keyboardEventRelay:void 0,closeDelay:0}}const nwe=A.createContext(void 0);function rwe(){return A.useContext(nwe)}function iwe(e){const{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:s=!1,modal:o,loopFocus:l=!0,orientation:u="vertical",actionsRef:f,closeParentOnEsc:d=!1,handle:m,triggerId:g,defaultTriggerId:x=null,highlightItemOnHover:_=!0}=e,b=Rw(!0),y=Rd(!0),v=dre(),S=rwe(),T=A.useMemo(()=>S&&y?{type:"menu",store:y.store}:v?{type:"menubar",context:v}:b&&!y?{type:"context-menu",context:b}:{type:void 0},[b,y,v,S]),w=p3.useStore(m?.store,{parent:T}),C=w.useState("floatingTreeRoot"),R=OM(C),O=Go();nt(()=>{b&&!y?w.update({parent:{type:"context-menu",context:b},floatingNodeId:R,floatingParentNodeId:O}):y&&w.update({floatingNodeId:R,floatingParentNodeId:O})},[b,y,R,O,w]),w.useControlledProp("open",n,a),w.useControlledProp("activeTriggerId",g,x),w.useContextCallback("onOpenChangeComplete",i);const N=w.useState("open"),D=w.useState("activeTriggerElement"),L=w.useState("positionerElement"),z=w.useState("hoverEnabled"),P=w.useState("modal"),q=w.useState("disabled"),H=w.useState("lastOpenChangeReason"),F=w.useState("parent"),G=w.useState("activeIndex"),V=w.useState("payload"),B=w.useState("floatingParentNodeId"),j=A.useRef(null),$=B!=null;let Y;w.useSyncedValues({disabled:s,modal:F.type===void 0?o:void 0,rootId:Ad()});const{openMethod:W,triggerProps:ee,reset:oe}=Aw(N);MM(w);const{forceUnmount:ae}=jM(N,w,()=>{w.update({allowMouseEnter:!1,stickIfOpen:!0}),oe()}),Z=A.useRef(F.type!=="context-menu"),K=zn();A.useEffect(()=>{if(N||(j.current=null),F.type==="context-menu"){if(!N){K.clear(),Z.current=!1;return}K.start(500,()=>{Z.current=!0})}},[K,N,F.type]),Tw(N&&P&&H!==Tr&&W!=="touch",L),nt(()=>{!N&&!z&&w.set("hoverEnabled",!0)},[N,z,w]);const Q=A.useRef(!0),te=zn(),ne=Ye(($e,pt)=>{const Se=pt.reason;if(N===$e&&pt.trigger===D||(pt.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},!$e&&pt.trigger==null&&(pt.trigger=D??void 0),r?.($e,pt),pt.isCanceled))return;const Be={open:$e,nativeEvent:pt.event,reason:pt.reason,nested:$};Y?.emit("openchange",Be);const Je=pt.event;if($e===!1&&Je?.type==="click"&&Je.pointerType==="touch"&&!Q.current)return;if(!$e&&G!==null){const Bt=w.context.itemDomElements.current[G];queueMicrotask(()=>{Bt?.setAttribute("tabindex","-1")})}$e&&Se===Jv?(Q.current=!1,te.start(300,()=>{Q.current=!0})):(Q.current=!0,te.clear());const ct=(Se===Ru||Se===Pf)&&Je.detail===0&&Je?.isTrusted,ht=!$e&&(Se===v0||Se==null);function mn(){const Bt={open:$e,openChangeReason:Se};j.current=pt.event??null;const Mt=pt.trigger?.id??null;(Mt||$e)&&(Bt.activeTriggerId=Mt,Bt.activeTriggerElement=pt.trigger??null),w.update(Bt)}Se===Tr?Ur.flushSync(mn):mn(),F.type==="menubar"&&(Se===Jv||Se===Ho||Se===Tr||Se===Hh||Se===pv)?w.set("instantType","group"):ct||ht?w.set("instantType",ct?"click":"dismiss"):w.set("instantType",void 0)}),J=A.useCallback($e=>{const pt=lt($e);return pt.preventUnmountOnClose=()=>{w.set("preventUnmountingOnClose",!0)},pt},[w]),ve=A.useCallback(()=>{w.setOpen(!1,J(RM))},[w,J]);A.useImperativeHandle(f,()=>({unmount:ae,close:ve}),[ae,ve]);let ge;F.type==="context-menu"&&(ge=F.context),A.useImperativeHandle(ge?.positionerRef,()=>L,[L]),A.useImperativeHandle(ge?.actionsRef,()=>({setOpen:ne}),[ne]);const fe=UM({popupStore:w,onOpenChange:ne});Y=fe.context.events,A.useEffect(()=>{const $e=({open:pt,eventDetails:Se})=>ne(pt,Se);return Y.on("setOpen",$e),()=>{Y?.off("setOpen",$e)}},[Y,ne]);const Ee=og(fe,{enabled:!q,bubbles:d&&F.type==="menu",outsidePress(){return F.type!=="context-menu"||j.current?.type==="contextmenu"?!0:Z.current},externalTree:$?C:void 0}),_e=Ute(fe,{role:"menu"}),Ve=ec(),Ce=A.useCallback($e=>{w.select("activeIndex")!==$e&&w.set("activeIndex",$e)},[w]),Me=$M(fe,{enabled:!q,listRef:w.context.itemDomElements,activeIndex:G,nested:F.type!==void 0,loopFocus:l,orientation:u,parentOrientation:F.type==="menubar"?F.context.orientation:void 0,rtl:Ve==="rtl",disabledIndices:ya,onNavigate:Ce,openOnArrowKeyDown:F.type!=="context-menu",externalTree:$?C:void 0,focusItemOnHover:_}),Ae=A.useCallback($e=>{w.context.typingRef.current=$e},[w]),pe=zM(fe,{listRef:w.context.itemLabels,activeIndex:G,resetMs:Ave,onMatch:$e=>{N&&$e!==G&&w.set("activeIndex",$e)},onTypingChange:Ae}),{getReferenceProps:de,getFloatingProps:ke,getItemProps:De,getTriggerProps:me}=Od([Ee,_e,Me,pe]),ye=A.useMemo(()=>{const $e=zo(de(),{onMouseEnter(){w.set("hoverEnabled",!0)},onMouseMove(){w.set("allowMouseEnter",!0)}},ee);return delete $e.role,$e},[de,w,ee]),xe=A.useMemo(()=>{const $e=me();if(!$e)return $e;const pt=zo($e,ee);return delete pt.role,delete pt["aria-controls"],pt},[me,ee]),je=Nu(),Ge=A.useMemo(()=>ke({onMouseEnter(){F.type==="menu"&&je.request(()=>w.set("hoverEnabled",!1))},onMouseMove(){w.set("allowMouseEnter",!0)},onClick(){w.select("hoverEnabled")&&w.set("hoverEnabled",!1)},onKeyDown($e){const pt=w.select("keyboardEventRelay");pt&&!$e.isPropagationStopped()&&pt($e)}}),[ke,F.type,je,w]),gt=A.useMemo(()=>De(),[De]);w.useSyncedValues({floatingRootContext:fe,activeTriggerProps:ye,inactiveTriggerProps:xe,popupProps:Ge,itemProps:gt});const at=A.useMemo(()=>({store:w,parent:T}),[w,T]),ut=p.jsx(ire.Provider,{value:at,children:typeof t=="function"?t({payload:V}):t});return F.type===void 0||F.type==="context-menu"?p.jsx(yte,{externalTree:C,children:ut}):ut}function fre(e){if(ur(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!_l(e))return fre(Il(e))}function awe(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,i=A.useRef(!1);return A.useMemo(()=>t?{onMouseDown:a=>{(n==="open"&&!r||n==="close"&&r)&&(i.current=!0,Zi(a.currentTarget).addEventListener("click",()=>{i.current=!1},{once:!0}))},onClick:a=>{i.current&&(i.current=!1,a.preventBaseUIHandler())}}:Jn,[t,n,r])}const Qx=2,swe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,nativeButton:s=!0,id:o,openOnHover:l,delay:u=100,closeDelay:f=0,handle:d,payload:m,...g}=t,x=Rd(!0),_=d?.store??x?.store;if(!_)throw new Error(on(85));const b=ui(o),y=_.useState("isTriggerActive",b),v=_.useState("floatingRootContext"),S=_.useState("isOpenedByTrigger",b),T=A.useRef(null),w=lwe(),C=mM(!0),R=Ko(),O=A.useMemo(()=>R??new kM,[R]),N=OM(O),D=Go(),{registerTrigger:L,isMountedByThisTrigger:z}=PM(b,T,_,{payload:m,closeDelay:f,parent:w,floatingTreeRoot:O,floatingNodeId:N,floatingParentNodeId:D,keyboardEventRelay:C?.relayKeyboardEvent}),P=_.useState("disabled"),q=a||P||w.type==="menubar"&&w.context.disabled,{getButtonProps:H,buttonRef:F}=ua({disabled:q,native:s});A.useEffect(()=>{!S&&w.type===void 0&&(_.context.allowMouseUpTriggerRef.current=!1)},[_,S,w.type]);const G=A.useRef(null),V=zn(),B=Ye(_e=>{if(!G.current)return;V.clear(),_.context.allowMouseUpTriggerRef.current=!1;const Ve=_e.target;if(Rt(G.current,Ve)||Rt(_.select("positionerElement"),Ve)||Ve===G.current||Ve!=null&&fre(Ve)===_.select("rootId"))return;const Ce=i3(G.current);_e.clientX>=Ce.left-Qx&&_e.clientX<=Ce.right+Qx&&_e.clientY>=Ce.top-Qx&&_e.clientY<=Ce.bottom+Qx||O.events.emit("close",{domEvent:_e,reason:xte})});A.useEffect(()=>{S&&_.select("lastOpenChangeReason")===Tr&&Zi(G.current).addEventListener("mouseup",B,{once:!0})},[S,B,_]);const j=w.type==="menubar"&&w.context.hasSubmenuOpen,Y=Bte(v,{enabled:(l??j??!1)&&!q&&w.type!=="context-menu"&&(w.type!=="menubar"||j&&!z),handleClose:HM({blockPointerEvents:w.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:w.type===void 0?u:void 0,delay:{close:f},triggerElementRef:T,externalTree:O,isActiveTrigger:y}),W=owe(S,_.select("lastOpenChangeReason")),ee=sg(v,{enabled:!q&&w.type!=="context-menu",event:S&&w.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0?W:!1}),oe=Mte(v,{enabled:!q&&(w.type!=="menubar"&&S||j)}),ae=awe({open:S,enabled:w.type==="menubar",mouseDownAction:"open"}),Z=Od([ee,oe]),K=w.type==="menubar",Q=A.useMemo(()=>({disabled:q,open:S}),[q,S]),te=_.useState("triggerProps",z),ne=[G,n,F,L,T],J=[Z.getReferenceProps(),Y??Jn,te,{"aria-haspopup":"menu",id:b,onMouseDown:_e=>{if(_.select("open"))return;V.start(200,()=>{_.context.allowMouseUpTriggerRef.current=!0}),Zi(_e.currentTarget).addEventListener("mouseup",B,{once:!0})}},K?{role:"menuitem"}:{},ae,g,H],ve=A.useRef(null),ge=Ye(_e=>{Ur.flushSync(()=>{_.setOpen(!1,lt(Ho,_e.nativeEvent,_e.currentTarget))}),a0e(ve.current)?.focus()}),fe=Ye(_e=>{const Ve=_.select("positionerElement");if(Ve&&Po(_e,Ve))_.context.beforeContentFocusGuardRef.current?.focus();else{Ur.flushSync(()=>{_.setOpen(!1,lt(Ho,_e.nativeEvent,_e.currentTarget))});let Ce=i0e(T.current);for(;Ce!==null&&Rt(Ve,Ce)||Ce?.hasAttribute("aria-hidden");){const Me=Ce;if(Ce=b0(Ce),Ce===Me)break}Ce?.focus()}}),Ee=Ct("button",t,{enabled:!K,stateAttributesMapping:dm,state:Q,ref:ne,props:J});return K?p.jsx(C0,{tag:"button",render:r,className:i,state:Q,refs:ne,props:J,stateAttributesMapping:dm}):S?p.jsxs(A.Fragment,{children:[p.jsx(Dl,{ref:ve,onFocus:ge},`${b}-pre-focus-guard`),p.jsx(A.Fragment,{children:Ee},b),p.jsx(Dl,{ref:_.context.triggerFocusTargetRef,onFocus:fe},`${b}-post-focus-guard`)]}):p.jsx(A.Fragment,{children:Ee},b)});function owe(e,t){const n=zn(),[r,i]=A.useState(!1);return nt(()=>{e&&t==="trigger-hover"?(i(!0),n.start(Ree,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function lwe(){const e=Rw(!0),t=Rd(!0),n=dre();return A.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function yu(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const uwe=typeof ResizeObserver<"u",cwe=()=>!0;function dwe(e){const{popupElement:t,positionerElement:n,content:r,mounted:i,enabled:a=cwe,onMeasureLayout:s,onMeasureLayoutComplete:o,side:l,direction:u}=e,f=A.useRef(!0),d=LM(t,!0,!1),m=Nu(),g=A.useRef(null),x=Ye(s),_=Ye(o),b=A.useMemo(()=>{let y=l==="top",v=l==="left";return u==="rtl"?(y=y||l==="inline-end",v=v||l==="inline-end"):(y=y||l==="inline-start",v=v||l==="inline-start"),y?{position:"absolute",[l==="top"?"bottom":"top"]:"0",[v?"right":"left"]:"0"}:Jn},[l,u]);nt(()=>{if(!i||!a()||!uwe){f.current=!0,g.current=null;return}if(!t||!n)return;Object.entries(b).forEach(([N,D])=>{t.style.setProperty(N,D)});const y=new ResizeObserver(N=>{const D=N[0];D&&(g.current===null?g.current={width:Math.ceil(D.borderBoxSize[0].inlineSize),height:Math.ceil(D.borderBoxSize[0].blockSize)}:(g.current.width=Math.ceil(D.borderBoxSize[0].inlineSize),g.current.height=Math.ceil(D.borderBoxSize[0].blockSize)))});y.observe(t),t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto");const v=Hb(t,"position","static"),S=Hb(t,"transform","none"),T=Hb(t,"scale","1"),w=Hb(n,"--available-width","max-content"),C=Hb(n,"--available-height","max-content");if(x?.(),f.current||g.current===null){n.style.setProperty("--positioner-width","max-content"),n.style.setProperty("--positioner-height","max-content");const N=ty(t);return n.style.setProperty("--positioner-width",`${N.width}px`),n.style.setProperty("--positioner-height",`${N.height}px`),v(),S(),T(),w(),C(),_?.(null,N),f.current=!1,()=>{y.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 R=ty(t);t.style.setProperty("--popup-width",`${g.current.width}px`),t.style.setProperty("--popup-height",`${g.current.height}px`),v(),S(),w(),C(),_?.(g.current,R),n.style.setProperty("--positioner-width",`${R.width}px`),n.style.setProperty("--positioner-height",`${R.height}px`);const O=new AbortController;return m.request(()=>{t.style.setProperty("--popup-width",`${R.width}px`),t.style.setProperty("--popup-height",`${R.height}px`),d(()=>{t.style.setProperty("--popup-width","auto"),t.style.setProperty("--popup-height","auto")},O.signal)}),()=>{y.disconnect(),O.abort(),m.cancel()}},[r,t,n,d,m,a,i,x,_,b])}function Hb(e,t,n){const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{e.style.setProperty(t,r)}}const fwe=A.forwardRef(function(t,n){const{children:r,container:i,className:a,render:s,...o}=t,{portalNode:l,portalSubtree:u}=Cte({container:i,ref:n,componentProps:t,elementProps:o});return!u&&!l?null:p.jsxs(A.Fragment,{children:[u,l&&Ur.createPortal(r,l)]})});let aH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const ID={checked(e){return e?{[aH.checked]:""}:{[aH.unchecked]:""}},...Za,...nc},pre=A.createContext({disabled:void 0,readOnly:void 0,required:void 0,name:void 0,checkedValue:"",setCheckedValue:Vn,onValueChange:Vn,touched:!1,setTouched:Vn,registerControlRef:Vn});function pwe(){return A.useContext(pre)}const hre=A.createContext(void 0);function hwe(){const e=A.useContext(hre);if(e===void 0)throw new Error(on(52));return e}const mwe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a=!1,readOnly:s=!1,required:o=!1,value:l,inputRef:u,nativeButton:f=!1,id:d,...m}=t,{disabled:g,readOnly:x,required:_,checkedValue:b,setCheckedValue:y,touched:v,setTouched:S,validation:T,registerControlRef:w}=pwe(),{setDirty:C,validityData:R,setTouched:O,setFilled:N,state:D,disabled:L}=Ka(),z=Tne(),{labelId:P,getDescriptionProps:q}=$l(),H=L||z.disabled||g||a,F=x||s,G=_||o,V=b===l,B=A.useRef(null),j=A.useRef(null),$=Ga(u,j);nt(()=>{j.current?.checked&&N(!0)},[N]);const Y=ui(),W=k0({id:d,implicit:!1,controlRef:B}),ee={role:"radio","aria-checked":V,"aria-required":G||void 0,"aria-disabled":H||void 0,"aria-readonly":F||void 0,"aria-labelledby":P,[VM]:V?"":void 0,id:Y,disabled:H,onKeyDown(ge){ge.key==="Enter"&&ge.preventDefault()},onClick(ge){ge.defaultPrevented||H||F||(ge.preventDefault(),j.current?.click())},onFocus(ge){ge.defaultPrevented||H||F||!v||(j.current?.click(),S(!1))}},{getButtonProps:oe,buttonRef:ae}=ua({disabled:H,native:f}),Z=A.useMemo(()=>({type:"radio",ref:$,id:W,tabIndex:-1,style:kd,"aria-hidden":!0,disabled:H,checked:V,required:G,readOnly:F,onChange(ge){if(ge.nativeEvent.defaultPrevented||H||F||l===void 0)return;const fe=lt(Vr,ge.nativeEvent);fe.isCanceled||(O(!0),C(l!==R.initialValue),N(!0),y(l,fe))},onFocus(){B.current?.focus()}}),[V,H,W,$,F,G,y,C,O,N,R.initialValue,l]),K=A.useMemo(()=>({...D,required:G,disabled:H,readOnly:F,checked:V}),[D,H,F,V,G]),Q=A.useMemo(()=>K,[K]),te=y!==Vn,ne=[n,w,B,ae],J=[ee,q,T?.getValidationProps??Jn,m,oe],ve=Ct("span",t,{enabled:!te,state:K,ref:ne,props:J,stateAttributesMapping:ID});return p.jsxs(hre.Provider,{value:Q,children:[te?p.jsx(C0,{tag:"span",render:r,className:i,state:K,refs:ne,props:J,stateAttributesMapping:ID}):ve,p.jsx("input",{...Z})]})}),gwe=A.forwardRef(function(t,n){const{render:r,className:i,keepMounted:a=!1,...s}=t,o=hwe(),l=o.checked,{transitionStatus:u,setMounted:f}=go(l),d=A.useMemo(()=>({...o,transitionStatus:u}),[o,u]),m=A.useRef(null),g=a||l,x=Ct("span",t,{enabled:g,ref:[n,m],state:d,props:s,stateAttributesMapping:ID});return Li({open:l,ref:m,onComplete(){l||f(!1)}}),g?x:null}),bwe=[Gte],vwe=A.forwardRef(function(t,n){const{render:r,className:i,disabled:a,readOnly:s,required:o,onValueChange:l,value:u,defaultValue:f,name:d,inputRef:m,id:g,...x}=t,{setTouched:_,setFocused:b,shouldValidateOnChange:y,validationMode:v,name:S,disabled:T,state:w,validation:C,setDirty:R,setFilled:O,validityData:N}=Ka(),{labelId:D}=$l(),{clearErrors:L}=fg(),z=gEe(!0),P=T||a,q=S??d,H=ui(g),[F,G]=Wa({controlled:u,default:f,name:"RadioGroup",state:"value"}),V=Ye(l),B=Ye((J,ve)=>{V(J,ve),!ve.isCanceled&&G(J)}),j=A.useRef(null),$=Ye(J=>{j.current==null&&J!=null&&(j.current=J)});pg({id:H,commit:C.commit,value:F,controlRef:j,name:q,getValue:()=>F??null}),Jc(F,()=>{L(q),R(F!==N.initialValue),O(F!=null),y()?C.commit(F):C.commit(F,!0)});const[Y,W]=A.useState(!1),ee=Ye(J=>{Rt(J.currentTarget,J.relatedTarget)||(_(!0),b(!1),v==="onBlur"&&C.commit(F))}),oe=Ye(J=>{J.key.startsWith("Arrow")&&(_(!0),W(!0),b(!0))}),ae=A.useMemo(()=>F==null?"":typeof F=="string"?F:JSON.stringify(F),[F]),Z=Ga(C.inputRef,m),K=zo({value:ae,ref:Z,id:H,name:ae?q:void 0,disabled:P,readOnly:s,required:o,"aria-labelledby":x["aria-labelledby"]??z?.legendId,"aria-hidden":!0,tabIndex:-1,style:kd,onChange:Vn,onFocus(){j.current?.focus()}},C.getInputValidationProps),Q=A.useMemo(()=>({...w,disabled:P??!1,required:o??!1,readOnly:s??!1}),[w,P,s,o]),te=A.useMemo(()=>({...w,checkedValue:F,disabled:P,validation:C,name:q,onValueChange:V,readOnly:s,registerControlRef:$,required:o,setCheckedValue:B,setTouched:W,touched:Y}),[F,P,C,w,q,V,s,$,o,B,W,Y]),ne={role:"radiogroup","aria-required":o||void 0,"aria-disabled":P||void 0,"aria-readonly":s||void 0,"aria-labelledby":D,onFocus(){b(!0)},onBlur:ee,onKeyDownCapture:oe};return p.jsxs(pre.Provider,{value:te,children:[p.jsx(w0,{render:r,className:i,state:Q,props:[ne,C.getValidationProps,x],refs:[n],stateAttributesMapping:nc,enableHomeAndEndKeys:!1,modifierKeys:bwe}),p.jsx("input",{...K})]})}),mre=A.createContext(void 0);function Nw(){const e=A.useContext(mre);if(e===void 0)throw new Error(on(53));return e}let SE=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Jx=500,sH=16;function uo(e,t,n){if(!e)return 0;const r=getComputedStyle(e),i=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${i}Start`])+parseFloat(r[`${t}${i}End`])}let ywe=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),vh=(function(e){return e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const h3={hasOverflowX:e=>e?{[vh.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[vh.hasOverflowY]:""}:null,overflowXStart:e=>e?{[vh.overflowXStart]:""}:null,overflowXEnd:e=>e?{[vh.overflowXEnd]:""}:null,overflowYStart:e=>e?{[vh.overflowYStart]:""}:null,overflowYEnd:e=>e?{[vh.overflowYEnd]:""}:null,cornerHidden:()=>null},oH={width:0,height:0},xwe={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},_we=A.forwardRef(function(t,n){const{render:r,className:i,overflowEdgeThreshold:a,...s}=t,[o,l]=A.useState(!1),[u,f]=A.useState(!1),[d,m]=A.useState(!1),[g,x]=A.useState(oH),[_,b]=A.useState(oH),[y,v]=A.useState(!1),[S,T]=A.useState(xwe),w=ui(),C=A.useRef(null),R=A.useRef(null),O=A.useRef(null),N=A.useRef(null),D=A.useRef(null),L=A.useRef(null),z=A.useRef(null),P=A.useRef(!1),q=A.useRef(0),H=A.useRef(0),F=A.useRef(0),G=A.useRef(0),V=A.useRef("vertical"),B=zn(),j=zn(),$=A.useRef({x:0,y:0}),[Y,W]=A.useState({scrollbarYHidden:!1,scrollbarXHidden:!1,cornerHidden:!1}),ee=Ewe(a),oe=Ye(ge=>{const fe=ge.x-$.current.x,Ee=ge.y-$.current.y;$.current=ge,Ee!==0&&(m(!0),B.start(Jx,()=>{m(!1)})),fe!==0&&(f(!0),j.start(Jx,()=>{f(!1)}))}),ae=Ye(ge=>{ge.button===0&&(P.current=!0,q.current=ge.clientY,H.current=ge.clientX,V.current=ge.currentTarget.getAttribute(ywe.orientation),R.current&&(F.current=R.current.scrollTop,G.current=R.current.scrollLeft),D.current&&V.current==="vertical"&&D.current.setPointerCapture(ge.pointerId),L.current&&V.current==="horizontal"&&L.current.setPointerCapture(ge.pointerId))}),Z=Ye(ge=>{if(!P.current)return;const fe=ge.clientY-q.current,Ee=ge.clientX-H.current;if(R.current){const _e=R.current.scrollHeight,Ve=R.current.clientHeight,Ce=R.current.scrollWidth,Me=R.current.clientWidth;if(D.current&&O.current&&V.current==="vertical"){const Ae=uo(O.current,"padding","y"),pe=uo(D.current,"margin","y"),de=D.current.offsetHeight,ke=O.current.offsetHeight-de-Ae-pe,De=fe/ke;R.current.scrollTop=F.current+De*(_e-Ve),ge.preventDefault(),m(!0),B.start(Jx,()=>{m(!1)})}if(L.current&&N.current&&V.current==="horizontal"){const Ae=uo(N.current,"padding","x"),pe=uo(L.current,"margin","x"),de=L.current.offsetWidth,ke=N.current.offsetWidth-de-Ae-pe,De=Ee/ke;R.current.scrollLeft=G.current+De*(Ce-Me),ge.preventDefault(),f(!0),j.start(Jx,()=>{f(!1)})}}}),K=Ye(ge=>{P.current=!1,D.current&&V.current==="vertical"&&D.current.releasePointerCapture(ge.pointerId),L.current&&V.current==="horizontal"&&L.current.releasePointerCapture(ge.pointerId)});function Q(ge){const fe=ge.pointerType==="touch";if(v(fe),!fe){const Ee=Rt(C.current,ge.target);l(Ee)}}const te=A.useMemo(()=>({hasOverflowX:!Y.scrollbarXHidden,hasOverflowY:!Y.scrollbarYHidden,overflowXStart:S.xStart,overflowXEnd:S.xEnd,overflowYStart:S.yStart,overflowYEnd:S.yEnd,cornerHidden:Y.cornerHidden}),[Y.scrollbarXHidden,Y.scrollbarYHidden,Y.cornerHidden,S]),ne={role:"presentation",onPointerEnter:Q,onPointerMove:Q,onPointerDown({pointerType:ge}){v(ge==="touch")},onPointerLeave(){l(!1)},style:{position:"relative",[SE.scrollAreaCornerHeight]:`${g.height}px`,[SE.scrollAreaCornerWidth]:`${g.width}px`}},J=Ct("div",t,{state:te,ref:[n,C],props:[ne,s],stateAttributesMapping:h3}),ve=A.useMemo(()=>({handlePointerDown:ae,handlePointerMove:Z,handlePointerUp:K,handleScroll:oe,cornerSize:g,setCornerSize:x,thumbSize:_,setThumbSize:b,touchModality:y,cornerRef:z,scrollingX:u,setScrollingX:f,scrollingY:d,setScrollingY:m,hovering:o,setHovering:l,viewportRef:R,rootRef:C,scrollbarYRef:O,scrollbarXRef:N,thumbYRef:D,thumbXRef:L,rootId:w,hiddenState:Y,setHiddenState:W,overflowEdges:S,setOverflowEdges:T,viewportState:te,overflowEdgeThreshold:ee}),[ae,Z,K,oe,g,_,y,z,u,f,d,m,o,l,R,C,O,N,D,L,w,Y,S,te,ee]);return p.jsxs(mre.Provider,{value:ve,children:[ly.element,J]})});function Ewe(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,e?.xStart||0),xEnd:Math.max(0,e?.xEnd||0),yStart:Math.max(0,e?.yStart||0),yEnd:Math.max(0,e?.yEnd||0)}}const Swe=A.createContext(void 0);function wwe(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(i=>{i.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let ed=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({}),lH=!1;function Cwe(){lH||xM||(typeof CSS<"u"&&"registerProperty"in CSS&&[ed.scrollAreaOverflowXStart,ed.scrollAreaOverflowXEnd,ed.scrollAreaOverflowYStart,ed.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),lH=!0)}const Twe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{viewportRef:s,scrollbarYRef:o,scrollbarXRef:l,thumbYRef:u,thumbXRef:f,cornerRef:d,setCornerSize:m,setThumbSize:g,rootId:x,setHiddenState:_,hiddenState:b,handleScroll:y,setHovering:v,setOverflowEdges:S,overflowEdges:T,overflowEdgeThreshold:w}=Nw(),C=ec(),R=A.useRef(!0),O=zn(),N=zn();function D(){const G=s.current,V=o.current,B=l.current,j=u.current,$=f.current,Y=d.current;if(!G)return;const W=G.scrollHeight,ee=G.scrollWidth,oe=G.clientHeight,ae=G.clientWidth,Z=G.scrollTop,K=G.scrollLeft;if(W===0||ee===0)return;const Q=oe>=W,te=ae>=ee,ne=ae/ee,J=oe/W,ve=Math.max(0,ee-ae),ge=Math.max(0,W-oe);let fe=0,Ee=0;te||(C==="rtl"?fe=yu(-K,0,ve):fe=yu(K,0,ve),Ee=ve-fe);const _e=Q?0:yu(Z,0,ge),Ve=Q?0:ge-_e,Ce=te?0:ae,Me=Q?0:oe,Ae=uo(B,"padding","x"),pe=uo(V,"padding","y"),de=uo($,"margin","x"),ke=uo(j,"margin","y"),De=Ce-Ae-de,me=Me-pe-ke,ye=B?Math.min(B.offsetWidth,De):De,xe=V?Math.min(V.offsetHeight,me):me,je=Math.max(sH,ye*ne),Ge=Math.max(sH,xe*J);if(g(Be=>Be.height===Ge&&Be.width===je?Be:{width:je,height:Ge}),V&&j){const Be=V.offsetHeight-Ge-pe-ke,Je=W-oe,ct=Je===0?0:Z/Je,ht=Math.min(Be,Math.max(0,ct*Be));j.style.transform=`translate3d(0,${ht}px,0)`}if(B&&$){const Be=B.offsetWidth-je-Ae-de,Je=ee-ae,ct=Je===0?0:K/Je,ht=C==="rtl"?yu(ct*Be,-Be,0):yu(ct*Be,0,Be);$.style.transform=`translate3d(${ht}px,0,0)`}const gt=yu(fe,0,ve),at=yu(Ee,0,ve),ut=yu(_e,0,ge),$e=yu(Ve,0,ge),pt=[[ed.scrollAreaOverflowXStart,gt],[ed.scrollAreaOverflowXEnd,at],[ed.scrollAreaOverflowYStart,ut],[ed.scrollAreaOverflowYEnd,$e]];for(const[Be,Je]of pt)G.style.setProperty(Be,`${Je}px`);if(Y){if(te||Q)m({width:0,height:0});else if(!te&&!Q){const Be=V?.offsetWidth||0,Je=B?.offsetHeight||0;m({width:Be,height:Je})}}_(Be=>{const Je=Q||te;return Be.scrollbarYHidden===Q&&Be.scrollbarXHidden===te&&Be.cornerHidden===Je?Be:{scrollbarYHidden:Q,scrollbarXHidden:te,cornerHidden:Je}});const Se={xStart:!te&&gt>w.xStart,xEnd:!te&&at>w.xEnd,yStart:!Q&&ut>w.yStart,yEnd:!Q&&$e>w.yEnd};S(Be=>Be.xStart===Se.xStart&&Be.xEnd===Se.xEnd&&Be.yStart===Se.yStart&&Be.yEnd===Se.yEnd?Be:Se)}const L=Ye(()=>{Ur.flushSync(D)});nt(()=>s.current?(Cwe(),wwe(s.current,L)):void 0,[L,s]),nt(()=>{queueMicrotask(L)},[L,b,C]),nt(()=>{s.current?.matches(":hover")&&v(!0)},[s,v]),A.useEffect(()=>{const G=s.current;if(typeof ResizeObserver>"u"||!G)return;const V=new ResizeObserver(L);return V.observe(G),N.start(0,()=>{Promise.all(G.getAnimations({subtree:!0}).map(B=>B.finished)).then(L).catch(()=>{})}),()=>{V.disconnect(),N.clear()}},[L,s,N]);function z(){R.current=!1}const P={role:"presentation",...x&&{"data-id":`${x}-viewport`},...(!b.scrollbarXHidden||!b.scrollbarYHidden)&&{tabIndex:0},className:ly.className,style:{overflow:"scroll"},onScroll(){s.current&&(L(),R.current||y({x:s.current.scrollLeft,y:s.current.scrollTop}),O.start(100,()=>{R.current=!0}))},onWheel:z,onTouchMove:z,onPointerMove:z,onPointerEnter:z,onKeyDown:z},q=A.useMemo(()=>({hasOverflowX:!b.scrollbarXHidden,hasOverflowY:!b.scrollbarYHidden,overflowXStart:T.xStart,overflowXEnd:T.xEnd,overflowYStart:T.yStart,overflowYEnd:T.yEnd,cornerHidden:b.cornerHidden}),[b.scrollbarXHidden,b.scrollbarYHidden,b.cornerHidden,T]),H=Ct("div",t,{ref:[n,s],state:q,props:[P,a],stateAttributesMapping:h3}),F=A.useMemo(()=>({computeThumbPosition:L}),[L]);return p.jsx(Swe.Provider,{value:F,children:H})}),gre=A.createContext(void 0);function Awe(){const e=A.useContext(gre);if(e===void 0)throw new Error(on(54));return e}let wE=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const kwe=A.forwardRef(function(t,n){const{render:r,className:i,orientation:a="vertical",keepMounted:s=!1,...o}=t,{hovering:l,scrollingX:u,scrollingY:f,hiddenState:d,overflowEdges:m,scrollbarYRef:g,scrollbarXRef:x,viewportRef:_,thumbYRef:b,thumbXRef:y,handlePointerDown:v,handlePointerUp:S,rootId:T,thumbSize:w}=Nw(),C=A.useMemo(()=>({hovering:l,scrolling:{horizontal:u,vertical:f}[a],orientation:a,hasOverflowX:!d.scrollbarXHidden,hasOverflowY:!d.scrollbarYHidden,overflowXStart:m.xStart,overflowXEnd:m.xEnd,overflowYStart:m.yStart,overflowYEnd:m.yEnd,cornerHidden:d.cornerHidden}),[l,u,f,a,d,m]),R=ec();A.useEffect(()=>{const P=_.current,q=a==="vertical"?g.current:x.current;if(!q)return;function H(F){if(!(!P||!q||F.ctrlKey)){if(F.preventDefault(),a==="vertical"){if(P.scrollTop===0&&F.deltaY<0)return}else if(P.scrollLeft===0&&F.deltaX<0)return;if(a==="vertical"){if(P.scrollTop===P.scrollHeight-P.clientHeight&&F.deltaY>0)return}else if(P.scrollLeft===P.scrollWidth-P.clientWidth&&F.deltaX>0)return;a==="vertical"?P.scrollTop+=F.deltaY:P.scrollLeft+=F.deltaX}}return q.addEventListener("wheel",H,{passive:!1}),()=>{q.removeEventListener("wheel",H)}},[a,x,g,_]);const O={...T&&{"data-id":`${T}-scrollbar`},onPointerDown(P){if(P.button===0&&P.currentTarget===P.target&&_.current){if(b.current&&g.current&&a==="vertical"){const q=uo(b.current,"margin","y"),H=uo(g.current,"padding","y"),F=b.current.offsetHeight,G=g.current.getBoundingClientRect(),V=P.clientY-G.top-F/2-H+q/2,B=_.current.scrollHeight,j=_.current.clientHeight,$=g.current.offsetHeight-F-H-q,W=V/$*(B-j);_.current.scrollTop=W}if(y.current&&x.current&&a==="horizontal"){const q=uo(y.current,"margin","x"),H=uo(x.current,"padding","x"),F=y.current.offsetWidth,G=x.current.getBoundingClientRect(),V=P.clientX-G.left-F/2-H+q/2,B=_.current.scrollWidth,j=_.current.clientWidth,$=x.current.offsetWidth-F-H-q,Y=V/$;let W;R==="rtl"?(W=(1-Y)*(B-j),_.current.scrollLeft<=0&&(W=-W)):W=Y*(B-j),_.current.scrollLeft=W}v(P)}},onPointerUp:S,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...a==="vertical"&&{top:0,bottom:`var(${SE.scrollAreaCornerHeight})`,insetInlineEnd:0,[wE.scrollAreaThumbHeight]:`${w.height}px`},...a==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${SE.scrollAreaCornerWidth})`,bottom:0,[wE.scrollAreaThumbWidth]:`${w.width}px`}}},N=Ct("div",t,{ref:[n,a==="vertical"?g:x],state:C,props:[O,o],stateAttributesMapping:h3}),D=A.useMemo(()=>({orientation:a}),[a]),L=a==="vertical"?d.scrollbarYHidden:d.scrollbarXHidden;return s||!L?p.jsx(gre.Provider,{value:D,children:N}):null}),Owe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{thumbYRef:s,thumbXRef:o,handlePointerDown:l,handlePointerMove:u,handlePointerUp:f,setScrollingX:d,setScrollingY:m}=Nw(),{orientation:g}=Awe(),x=A.useMemo(()=>({orientation:g}),[g]);return Ct("div",t,{ref:[n,g==="vertical"?s:o],state:x,props:[{onPointerDown:l,onPointerMove:u,onPointerUp(b){g==="vertical"&&m(!1),g==="horizontal"&&d(!1),f(b)},style:{...g==="vertical"&&{height:`var(${wE.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${wE.scrollAreaThumbWidth})`}}},a]})}),Rwe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{cornerRef:s,cornerSize:o,hiddenState:l}=Nw(),u=Ct("div",t,{ref:[n,s],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:o.width,height:o.height}},a]});return l.cornerHidden?null:u}),bre=A.createContext(void 0);function Nwe(){const e=A.useContext(bre);if(e===void 0)throw new Error(on(63));return e}let uH=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const vre={...nc,checked(e){return e?{[uH.checked]:""}:{[uH.unchecked]:""}}},Iwe=A.forwardRef(function(t,n){const{checked:r,className:i,defaultChecked:a,id:s,inputRef:o,name:l,nativeButton:u=!1,onCheckedChange:f,readOnly:d=!1,required:m=!1,disabled:g=!1,render:x,uncheckedValue:_,...b}=t,{clearErrors:y}=fg(),{state:v,setTouched:S,setDirty:T,validityData:w,setFilled:C,setFocused:R,shouldValidateOnChange:O,validationMode:N,disabled:D,name:L,validation:z}=Ka(),{labelId:P}=$l(),q=D||g,H=L??l,F=Ye(f),G=A.useRef(null),V=Ga(G,o,z.inputRef),B=A.useRef(null),j=ui(),$=k0({id:s,implicit:!1,controlRef:B}),[Y,W]=Wa({controlled:r,default:!!a,name:"Switch",state:"checked"});pg({id:j,commit:z.commit,value:Y,controlRef:B,name:H,getValue:()=>Y}),nt(()=>{G.current&&C(G.current.checked)},[G,C]),Jc(Y,()=>{y(H),T(Y!==w.initialValue),C(Y),O()?z.commit(Y):z.commit(Y,!0)});const{getButtonProps:ee,buttonRef:oe}=ua({disabled:q,native:u}),ae={id:j,role:"switch","aria-checked":Y,"aria-readonly":d||void 0,"aria-labelledby":P,onFocus(){q||R(!0)},onBlur(){const te=G.current;!te||q||(S(!0),R(!1),N==="onBlur"&&z.commit(te.checked))},onClick(te){d||q||(te.preventDefault(),G?.current?.click())}},Z=A.useMemo(()=>zo({checked:Y,disabled:q,id:$,name:H,required:m,style:kd,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(te){if(te.nativeEvent.defaultPrevented)return;const ne=te.target.checked,J=lt(Vr,te.nativeEvent);F?.(ne,J),!J.isCanceled&&W(ne)},onFocus(){B.current?.focus()}},z.getInputValidationProps),[Y,q,V,$,H,F,m,W,z]),K=A.useMemo(()=>({...v,checked:Y,disabled:q,readOnly:d,required:m}),[v,Y,q,d,m]),Q=Ct("span",t,{state:K,ref:[n,B,oe],props:[ae,z.getValidationProps,b,ee],stateAttributesMapping:vre});return p.jsxs(bre.Provider,{value:K,children:[Q,!Y&&H&&_!==void 0&&p.jsx("input",{type:"hidden",name:H,value:_}),p.jsx("input",{...Z})]})}),Dwe=A.forwardRef(function(t,n){const{render:r,className:i,...a}=t,{state:s}=Ka(),o=Nwe(),l={...s,...o};return Ct("span",t,{state:l,ref:n,stateAttributesMapping:vre,props:a})}),yre=A.createContext(void 0);function Lwe(e=!0){const t=A.useContext(yre);if(t===void 0&&!e)throw new Error(on(7));return t}const Pwe=A.forwardRef(function(t,n){const{className:r,defaultPressed:i=!1,disabled:a=!1,form:s,onPressedChange:o,pressed:l,render:u,type:f,value:d,nativeButton:m=!0,...g}=t,x=ui(d||void 0),_=Lwe(),b=_?.value??[],y=_?void 0:i,v=(a||_?.disabled)??!1,[S,T]=Wa({controlled:_?b?.indexOf(x)>-1:l,default:y,name:"Toggle",state:"pressed"}),w=Ye((z,P)=>{x&&_?.setGroupValue?.(x,z,P),o?.(z,P)}),{getButtonProps:C,buttonRef:R}=ua({disabled:v,native:m}),O=A.useMemo(()=>({disabled:v,pressed:S}),[v,S]),N=[R,n],D=[{"aria-pressed":S,onClick(z){const P=!S,q=lt(Vr,z.nativeEvent);w(P,q),!q.isCanceled&&T(P)}},g,C],L=Ct("button",t,{enabled:!_,state:O,ref:N,props:D});return _?p.jsx(C0,{tag:"button",render:u,className:r,state:O,refs:N,props:D}):L});let Mwe=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const cH={multiple(e){return e?{[Mwe.multiple]:""}:null}},jwe=A.forwardRef(function(t,n){const{defaultValue:r,disabled:i=!1,loopFocus:a=!0,onValueChange:s,orientation:o="horizontal",multiple:l=!1,value:u,className:f,render:d,...m}=t,g=s3(),x=A.useMemo(()=>{if(u===void 0)return r??[]},[u,r]),_=(g?.disabled??!1)||i,[b,y]=Wa({controlled:u,default:x,name:"ToggleGroup",state:"value"}),v=Ye((R,O,N)=>{let D;if(l?(D=b.slice(),O?D.push(R):D.splice(b.indexOf(R),1)):D=O?[R]:[],Array.isArray(D)){if(s?.(D,N),N.isCanceled)return;y(D)}}),S=A.useMemo(()=>({disabled:_,multiple:l,orientation:o}),[_,o,l]),T=A.useMemo(()=>({disabled:_,orientation:o,setGroupValue:v,value:b}),[_,o,v,b]),w={role:"group"},C=Ct("div",t,{enabled:!!g,state:S,ref:n,props:[w,m],stateAttributesMapping:cH});return p.jsx(yre.Provider,{value:T,children:g?C:p.jsx(w0,{render:d,className:f,state:S,refs:[n],props:[w,m],stateAttributesMapping:cH,loopFocus:a})})}),xre=A.createContext(void 0);function O0(e){const t=A.useContext(xre);if(t===void 0&&!e)throw new Error(on(72));return t}const Fwe={...BM,disabled:He(e=>e.disabled),instantType:He(e=>e.instantType),isInstantPhase:He(e=>e.isInstantPhase),trackCursorAxis:He(e=>e.trackCursorAxis),disableHoverablePopup:He(e=>e.disableHoverablePopup),lastOpenChangeReason:He(e=>e.openChangeReason),closeDelay:He(e=>e.closeDelay)};class m3 extends mw{constructor(t){super({...Bwe(),...t},{popupRef:A.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new x0},Fwe)}setOpen=(t,n)=>{const r=n.reason,i=r===Tr,a=t&&r===Jv,s=!t&&(r===Ru||r===v0);if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},this.context.onOpenChange?.(t,n),n.isCanceled)return;const o=()=>{const l={open:t,openChangeReason:r};a?l.instantType="focus":s?l.instantType="dismiss":r===Tr&&(l.instantType=void 0);const u=n.trigger?.id??null;(u||t)&&(l.activeTriggerId=u,l.activeTriggerElement=n.trigger??null),this.update(l)};i?Ur.flushSync(o):o()};static useStore(t,n){const r=Di(()=>t??new m3(n)).current,i=UM({popupStore:r,onOpenChange:r.setOpen});return r.state.floatingRootContext=i,r}}function Bwe(){return{...FM(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0}}function Uwe(e){const{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a="none",actionsRef:s,onOpenChange:o,onOpenChangeComplete:l,handle:u,triggerId:f,defaultTriggerId:d=null,children:m}=e,g=m3.useStore(u?.store,{open:r??n,activeTriggerId:f!==void 0?f:d});g.useControlledProp("open",r,n),g.useControlledProp("activeTriggerId",f,d),g.useContextCallback("onOpenChange",o),g.useContextCallback("onOpenChangeComplete",l);const x=g.useState("open"),_=g.useState("activeTriggerId"),b=g.useState("payload");g.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i});const y=!t&&x;nt(()=>{x&&t&&g.setOpen(!1,lt(c0e))},[x,t,g]),g.useSyncedValue("disabled",t),MM(g);const{forceUnmount:v,transitionStatus:S}=jM(y,g),T=g.useState("isInstantPhase"),w=g.useState("instantType"),C=g.useState("lastOpenChangeReason"),R=A.useRef(null);nt(()=>{S==="ending"&&C===Vr||S!=="ending"&&T?(w!=="delay"&&(R.current=w),g.set("instantType","delay")):R.current!==null&&(g.set("instantType",R.current),R.current=null)},[S,T,C,w,g]),nt(()=>{y&&_==null&&g.set("payload",void 0)},[g,_,y]);const O=A.useCallback(()=>{g.setOpen(!1,$we(g,RM))},[g]);A.useImperativeHandle(s,()=>({unmount:v,close:O}),[v,O]);const N=g.useState("floatingRootContext"),D=Mte(N,{enabled:!t}),L=og(N,{enabled:!t,referencePress:!0}),z=A0e(N,{enabled:!t&&a!=="none",axis:a==="none"?void 0:a}),{getReferenceProps:P,getFloatingProps:q,getTriggerProps:H}=Od([D,L,z]),F=A.useMemo(()=>P(),[P]),G=A.useMemo(()=>H(),[H]),V=A.useMemo(()=>q(),[q]);return g.useSyncedValues({floatingRootContext:N,activeTriggerProps:F,inactiveTriggerProps:G,popupProps:V}),p.jsx(xre.Provider,{value:g,children:typeof m=="function"?m({payload:b}):m})}function $we(e,t){const n=lt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const _re=A.createContext(void 0);function zwe(){return A.useContext(_re)}const Hwe=600,Wwe=A.forwardRef(function(t,n){const{className:r,render:i,handle:a,payload:s,disabled:o,delay:l,closeDelay:u,id:f,...d}=t,m=O0(!0),g=a?.store??m;if(!g)throw new Error(on(82));const x=ui(f),_=g.useState("isTriggerActive",x),b=g.useState("floatingRootContext"),y=g.useState("isOpenedByTrigger",x),v=A.useRef(null),S=l??Hwe,T=u??0,{registerTrigger:w,isMountedByThisTrigger:C}=PM(x,v,g,{payload:s,closeDelay:T}),R=zwe(),{delayRef:O,isInstantPhase:N,hasProvider:D}=g0e(b,{open:y});g.useSyncedValue("isInstantPhase",N);const L=g.useState("disabled"),z=o??L,P=g.useState("trackCursorAxis"),q=g.useState("disableHoverablePopup"),H=Bte(b,{enabled:!z,mouseOnly:!0,move:!1,handleClose:!q&&P!=="both"?HM():null,restMs(){const B=R?.delay,j=typeof O.current=="object"?O.current.open:void 0;let $=S;return D&&(j!==0?$=l??B??S:$=0),$},delay(){const B=typeof O.current=="object"?O.current.close:void 0;let j=T;return u==null&&D&&(j=B),{close:j}},triggerElementRef:v,isActiveTrigger:_}),F=A.useMemo(()=>({open:y}),[y]),G=g.useState("triggerProps",C);return Ct("button",t,{state:F,ref:[n,w,v],props:[H,G,{id:x},d],stateAttributesMapping:xw})}),Ere=A.createContext(void 0);function Vwe(){const e=A.useContext(Ere);if(e===void 0)throw new Error(on(70));return e}const qwe=A.forwardRef(function(t,n){const{keepMounted:r=!1,...i}=t;return O0().useState("mounted")||r?p.jsx(Ere.Provider,{value:r,children:p.jsx(fwe,{ref:n,...i})}):null}),Sre=A.createContext(void 0);function wre(){const e=A.useContext(Sre);if(e===void 0)throw new Error(on(71));return e}const Gwe=A.forwardRef(function(t,n){const{render:r,className:i,anchor:a,positionMethod:s="absolute",side:o="top",align:l="center",sideOffset:u=0,alignOffset:f=0,collisionBoundary:d="clipping-ancestors",collisionPadding:m=5,arrowPadding:g=5,sticky:x=!1,disableAnchorTracking:_=!1,collisionAvoidance:b=bM,...y}=t,v=O0(),S=Vwe(),T=v.useState("open"),w=v.useState("mounted"),C=v.useState("trackCursorAxis"),R=v.useState("disableHoverablePopup"),O=v.useState("floatingRootContext"),N=v.useState("instantType"),D=v.useState("transitionStatus"),L=T0({anchor:a,positionMethod:s,floatingRootContext:O,mounted:w,side:o,sideOffset:u,align:l,alignOffset:f,collisionBoundary:d,collisionPadding:m,sticky:x,arrowPadding:g,disableAnchorTracking:_,keepMounted:S,collisionAvoidance:b,adaptiveOrigin:ene}),z=A.useMemo(()=>{const F={};return(!T||C==="both"||R)&&(F.pointerEvents="none"),{role:"presentation",hidden:!w,style:{...L.positionerStyles,...F}}},[T,C,R,w,L.positionerStyles]),P=A.useMemo(()=>({open:T,side:L.side,align:L.align,anchorHidden:L.anchorHidden,instant:C!=="none"?"tracking-cursor":N}),[T,L.side,L.align,L.anchorHidden,C,N]),q=A.useMemo(()=>({...P,arrowRef:L.arrowRef,arrowStyles:L.arrowStyles,arrowUncentered:L.arrowUncentered}),[P,L.arrowRef,L.arrowStyles,L.arrowUncentered]),H=Ct("div",t,{state:P,props:[z,cg(D),y],ref:[n,v.useStateSetter("positionerElement")],stateAttributesMapping:Qa});return p.jsx(Sre.Provider,{value:q,children:H})}),Kwe={...Qa,...Za},Ywe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,s=O0(),{side:o,align:l}=wre(),u=s.useState("open"),f=s.useState("mounted"),d=s.useState("instantType"),m=s.useState("transitionStatus"),g=s.useState("popupProps"),x=s.useState("payload"),_=s.useState("popupElement"),b=s.useState("positionerElement"),y=s.useState("floatingRootContext"),v=ec();Li({open:u,ref:s.context.popupRef,onComplete(){u&&s.context.onOpenChangeComplete?.(!0)}});function S(){y.context.events.emit("measure-layout")}function T(D,L){y.context.events.emit("measure-layout-complete",{previousDimensions:D,nextDimensions:L})}const w=A.useCallback(()=>s.context.triggerElements.size>1,[s]);dwe({popupElement:_,positionerElement:b,mounted:f,content:x,enabled:w,onMeasureLayout:S,onMeasureLayoutComplete:T,side:o,direction:v});const C=s.useState("disabled"),R=s.useState("closeDelay");Fte(y,{enabled:!C,closeDelay:R});const O=A.useMemo(()=>({open:u,side:o,align:l,instant:d,transitionStatus:m}),[u,o,l,d,m]);return Ct("div",t,{state:O,ref:[n,s.context.popupRef,s.useStateSetter("popupElement")],props:[g,cg(m),a],stateAttributesMapping:Kwe})}),Xwe=A.forwardRef(function(t,n){const{className:r,render:i,...a}=t,o=O0().useState("instantType"),{open:l,arrowRef:u,side:f,align:d,arrowUncentered:m,arrowStyles:g}=wre(),x=A.useMemo(()=>({open:l,side:f,align:d,uncentered:m,instant:o}),[l,f,d,m,o]);return Ct("div",t,{state:x,ref:[n,u],props:[{style:g,"aria-hidden":!0},a],stateAttributesMapping:Qa})}),Zwe=function(t){const{delay:n,closeDelay:r,timeout:i=400}=t,a=A.useMemo(()=>({delay:n,closeDelay:r}),[n,r]),s=A.useMemo(()=>({open:n,close:r}),[n,r]);return p.jsx(_re.Provider,{value:a,children:p.jsx(m0e,{delay:s,timeoutMs:i,children:t.children})})};function Qwe(e){return Ct(e.defaultTagName??"div",e,e)}function Jwe({className:e,...t}){return p.jsx("div",{"data-slot":"input-group",role:"group",className:Ue("border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot=input-group-control]:focus-visible]:ring-inset has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[[data-slot][aria-invalid=true]]:ring-inset h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",e),...t})}const eCe=Cd("text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",{variants:{align:{"inline-start":"pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first","inline-end":"pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last","block-start":"px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start","block-end":"px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start"}},defaultVariants:{align:"inline-start"}});function tCe({className:e,align:t="inline-start",...n}){return p.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:Ue(eCe({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const nCe=Cd("gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",{variants:{size:{xs:"h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",sm:"","icon-xs":"size-6 p-0 has-[>svg]:p-0","icon-sm":"size-8 p-0 has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function Cre({className:e,type:t="button",variant:n="ghost",size:r="xs",...i}){return p.jsx(Ie,{type:t,"data-size":r,variant:n,className:Ue(nCe({size:r}),e),...i})}function rCe({className:e,...t}){return p.jsx(Xt,{"data-slot":"input-group-control",className:Ue("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1",e),...t})}const iCe=FSe;function aCe({className:e,children:t,...n}){return p.jsxs(hSe,{"data-slot":"combobox-trigger",className:Ue("[&_svg:not([class*='size-'])]:size-3.5",e),...n,children:[t,p.jsx(se,{icon:A0,strokeWidth:2,className:"text-muted-foreground size-3.5 pointer-events-none"})]})}function sCe({className:e,...t}){return p.jsx(xSe,{"data-slot":"combobox-clear",render:p.jsx(Cre,{variant:"ghost",size:"icon-xs"}),className:Ue(e),...t,children:p.jsx(se,{icon:Xr,strokeWidth:2,className:"pointer-events-none"})})}function oCe({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return p.jsxs(Jwe,{className:Ue("w-auto",e),children:[p.jsx(vSe,{render:p.jsx(rCe,{disabled:n}),...a}),p.jsxs(tCe,{align:"inline-end",children:[r&&p.jsx(Cre,{size:"icon-xs",variant:"ghost",render:p.jsx(aCe,{}),"data-slot":"input-group-button",className:"group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent",disabled:n}),i&&p.jsx(sCe,{disabled:n})]}),t]})}function lCe({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:i=0,anchor:a,...s}){return p.jsx(TSe,{children:p.jsx(ASe,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:"isolate z-50",children:p.jsx(OSe,{"data-slot":"combobox-content","data-chips":!!a,className:Ue("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",e),...s})})})}function uCe({className:e,...t}){return p.jsx(wSe,{"data-slot":"combobox-list",className:Ue("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",e),...t})}function cCe({className:e,children:t,...n}){return p.jsxs(ISe,{"data-slot":"combobox-item",className:Ue("data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[t,p.jsx(BSe,{render:p.jsx("span",{className:"pointer-events-none absolute right-2 flex items-center justify-center"}),children:p.jsx(se,{icon:Lr,strokeWidth:2,className:"pointer-events-none"})})]})}function dCe({className:e,...t}){return p.jsx(DSe,{"data-slot":"combobox-empty",className:Ue("text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",e),...t})}const fCe=Cd("hover:text-foreground hover:bg-accent/20 focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive aria-pressed:bg-accent aria-pressed:text-accent-foreground aria-pressed:hover:bg-accent data-[state=on]:bg-accent data-[state=on]:text-accent-foreground data-[state=on]:hover:bg-accent gap-1 rounded-md text-xs font-medium transition-all [&_svg:not([class*='size-'])]:size-3.5 group/toggle inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",{variants:{variant:{default:"bg-transparent",outline:"border-input hover:bg-accent/20 border bg-transparent"},size:{default:"h-7 min-w-7 px-2",sm:"h-6 min-w-6 rounded-[min(var(--radius-md),8px)] px-1.5 text-[0.625rem] [&_svg:not([class*='size-'])]:size-3",lg:"h-8 min-w-8 px-2"}},defaultVariants:{variant:"default",size:"default"}}),Tre=A.createContext({size:"default",variant:"default",spacing:0,orientation:"horizontal"});function pCe({className:e,variant:t,size:n,spacing:r=0,orientation:i="horizontal",children:a,...s}){return p.jsx(jwe,{"data-slot":"toggle-group","data-variant":t,"data-size":n,"data-spacing":r,"data-orientation":i,style:{"--gap":r},className:Ue("rounded-md data-[size=sm]:rounded-[min(var(--radius-md),8px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch",e),...s,children:p.jsx(Tre.Provider,{value:{variant:t,size:n,spacing:r,orientation:i},children:a})})}function dH({className:e,children:t,variant:n="default",size:r="default",...i}){const a=A.useContext(Tre);return p.jsx(Pwe,{"data-slot":"toggle-group-item","data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:Ue("group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-md group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-md group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-md group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-md shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t",fCe({variant:a.variant||n,size:a.size||r}),e),...i,children:t})}async function xt(e,t){const n=await fetch(e,{...t,headers:{"Content-Type":"application/json",...t?.headers}});if(!n.ok){const r=await n.json().catch(()=>({error:"Request failed"}));throw new Error(r.error||"Request failed")}return n.json()}const vd="";function g3(){return yn({queryKey:["tasks"],queryFn:()=>xt(`${vd}/api/tasks`)})}function Are(e){return yn({queryKey:["tasks",e],queryFn:()=>xt(`${vd}/api/tasks/${e}`),enabled:!!e})}function hCe(){const e=kn();return fn({mutationFn:t=>xt(`${vd}/api/tasks`,{method:"POST",body:JSON.stringify({...t,status:"IN_PROGRESS"})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function mCe(){const e=kn();return fn({mutationFn:({taskId:t,status:n,position:r})=>xt(`${vd}/api/tasks/${t}/status`,{method:"PATCH",body:JSON.stringify({status:n,position:r})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]})}})}function Iw(){const e=kn();return fn({mutationFn:({taskId:t,updates:n})=>xt(`${vd}/api/tasks/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{taskId:n})=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["tasks",n]})}})}function Dw(){const e=kn();return fn({mutationFn:({taskId:t,deleteLinkedWorktree:n})=>{const r=n?`${vd}/api/tasks/${t}?deleteLinkedWorktree=true`:`${vd}/api/tasks/${t}`;return xt(r,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}function gCe(){const e=kn();return fn({mutationFn:({ids:t,deleteLinkedWorktrees:n})=>xt(`${vd}/api/tasks/bulk`,{method:"DELETE",body:JSON.stringify({ids:t,deleteLinkedWorktrees:n})}),onSuccess:()=>{e.invalidateQueries({queryKey:["tasks"]}),e.invalidateQueries({queryKey:["worktrees"]})}})}const R0="";function bCe(e){return yn({queryKey:["fs","list",e],queryFn:()=>{const t=e?`?path=${encodeURIComponent(e)}`:"";return xt(`${R0}/api/fs/list${t}`)},enabled:e!==null})}function kre(e){return yn({queryKey:["git","branches",e],queryFn:()=>xt(`${R0}/api/git/branches?repo=${encodeURIComponent(e)}`),enabled:!!e})}function vCe(e,t={}){const{staged:n=!1,ignoreWhitespace:r=!1,includeUntracked:i=!1,baseBranch:a}=t;return yn({queryKey:["git","diff",e,n,r,i,a],queryFn:()=>{const s=new URLSearchParams({path:e,...n&&{staged:"true"},...r&&{ignoreWhitespace:"true"},...i&&{includeUntracked:"true"},...a&&{baseBranch:a}});return xt(`${R0}/api/git/diff?${s}`)},enabled:!!e,refetchInterval:5e3})}function yCe(e){return yn({queryKey:["git","status",e],queryFn:()=>xt(`${R0}/api/git/status?path=${encodeURIComponent(e)}`),enabled:!!e,refetchInterval:5e3})}async function xCe(e){return xt(`${R0}/api/fs/is-git-repo?path=${encodeURIComponent(e)}`)}const Hl="",Ln={PORT:"server.port",WORKTREE_BASE_PATH:"worktree_base_path",HOME_DIR:"home_dir",DEFAULT_GIT_REPOS_DIR:"paths.defaultGitReposDir",EDITOR_APP:"editor.app",EDITOR_HOST:"editor.host",EDITOR_SSH_PORT:"editor.sshPort",LINEAR_API_KEY:"integrations.linearApiKey",GITHUB_PAT:"integrations.githubPat",LANGUAGE:"appearance.language",SYNC_CLAUDE_CODE_THEME:"appearance.syncClaudeCodeTheme",CLAUDE_CODE_LIGHT_THEME:"appearance.claudeCodeLightTheme",CLAUDE_CODE_DARK_THEME:"appearance.claudeCodeDarkTheme"},_Ce=7777;function js(e){return yn({queryKey:["config",e],queryFn:()=>xt(`${Hl}/api/config/${e}`)})}function Ore(){const e=js(Ln.PORT);return{...e,data:e.data?.value??_Ce,isDefault:e.data?.isDefault??!0}}function ECe(){const e=js(Ln.WORKTREE_BASE_PATH);return{...e,data:e.data?.value??""}}function SCe(){const e=js(Ln.HOME_DIR);return{...e,data:e.data?.value??""}}function b3(){const e=js(Ln.DEFAULT_GIT_REPOS_DIR);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function N0(){const e=js(Ln.EDITOR_APP);return{...e,data:e.data?.value??"vscode",isDefault:e.data?.isDefault??!0}}function I0(){const e=js(Ln.EDITOR_HOST);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function D0(){const e=js(Ln.EDITOR_SSH_PORT);return{...e,data:e.data?.value??22,isDefault:e.data?.isDefault??!0}}function wCe(){const e=js(Ln.LINEAR_API_KEY);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function CCe(){const e=js(Ln.GITHUB_PAT);return{...e,data:e.data?.value??"",isDefault:e.data?.isDefault??!0}}function TCe(){const e=js(Ln.LANGUAGE);return{...e,data:e.data?.value??null,isDefault:e.data?.isDefault??!0}}function ACe(){const e=js(Ln.SYNC_CLAUDE_CODE_THEME);return{...e,data:!!e.data?.value,isDefault:e.data?.isDefault??!0}}const fH=["light","light-ansi","light-daltonized","dark","dark-ansi","dark-daltonized"];function kCe(){const e=js(Ln.CLAUDE_CODE_LIGHT_THEME);return{...e,data:e.data?.value??"light-ansi",isDefault:e.data?.isDefault??!0}}function OCe(){const e=js(Ln.CLAUDE_CODE_DARK_THEME);return{...e,data:e.data?.value??"dark-ansi",isDefault:e.data?.isDefault??!0}}function Rre(){const e=kn();return fn({mutationFn:({key:t,value:n})=>xt(`${Hl}/api/config/${t}`,{method:"PUT",body:JSON.stringify({value:n})}),onSuccess:(t,{key:n})=>{e.invalidateQueries({queryKey:["config",n]}),n===Ln.GITHUB_PAT&&(e.invalidateQueries({queryKey:["github-user"]}),e.invalidateQueries({queryKey:["github-prs"]}),e.invalidateQueries({queryKey:["github-issues"]}),e.invalidateQueries({queryKey:["github-orgs"]}))}})}function RCe(){const e=kn();return fn({mutationFn:t=>xt(`${Hl}/api/config/${t}`,{method:"DELETE"}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:["config",n]})}})}function NCe(){return yn({queryKey:["config","notifications"],queryFn:()=>xt(`${Hl}/api/config/notifications`)})}function ICe(){const e=kn();return fn({mutationFn:t=>xt(`${Hl}/api/config/notifications`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","notifications"]})}})}function DCe(){return fn({mutationFn:e=>xt(`${Hl}/api/config/notifications/test/${e}`,{method:"POST"})})}function LCe(){return yn({queryKey:["config","z-ai"],queryFn:()=>xt(`${Hl}/api/config/z-ai`)})}function PCe(){const e=kn();return fn({mutationFn:t=>xt(`${Hl}/api/config/z-ai`,{method:"PUT",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["config","z-ai"]}),e.invalidateQueries({queryKey:["monitoring","claude-usage"]})}})}function Nre(){return yn({queryKey:["config","developer-mode"],queryFn:()=>xt(`${Hl}/api/config/developer-mode`),staleTime:1/0})}function MCe(){return fn({mutationFn:()=>xt(`${Hl}/api/config/restart`,{method:"POST"})})}const Hu="";function hg(){return yn({queryKey:["repositories"],queryFn:()=>xt(`${Hu}/api/repositories`)})}function jCe(e){return yn({queryKey:["repositories",e],queryFn:()=>xt(`${Hu}/api/repositories/${e}`),enabled:!!e})}function Ire(){const e=kn();return fn({mutationFn:t=>xt(`${Hu}/api/repositories`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function FCe(){const e=kn();return fn({mutationFn:t=>xt(`${Hu}/api/repositories/clone`,{method:"POST",body:JSON.stringify(t)}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function BCe(){const e=kn();return fn({mutationFn:({id:t,updates:n})=>xt(`${Hu}/api/repositories/${t}`,{method:"PATCH",body:JSON.stringify(n)}),onSuccess:(t,{id:n})=>{e.invalidateQueries({queryKey:["repositories"]}),e.invalidateQueries({queryKey:["repositories",n]})}})}function Dre(){const e=kn();return fn({mutationFn:({id:t,deleteDirectory:n=!1})=>{const r=n?`${Hu}/api/repositories/${t}?deleteDirectory=true`:`${Hu}/api/repositories/${t}`;return xt(r,{method:"DELETE"})},onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function UCe(){return fn({mutationFn:e=>xt(`${Hu}/api/repositories/scan`,{method:"POST",body:JSON.stringify(e?{directory:e}:{})})})}function $Ce(){const e=kn();return fn({mutationFn:t=>xt(`${Hu}/api/repositories/bulk`,{method:"POST",body:JSON.stringify({repositories:t})}),onSuccess:()=>{e.invalidateQueries({queryKey:["repositories"]})}})}function mg({className:e,children:t,...n}){return p.jsxs(_we,{"data-slot":"scroll-area",className:Ue("relative",e),...n,children:[p.jsx(Twe,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),p.jsx(zCe,{}),p.jsx(Rwe,{})]})}function zCe({className:e,orientation:t="vertical",...n}){return p.jsx(kwe,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Ue("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",e),...n,children:p.jsx(Owe,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function td({open:e,onOpenChange:t,onSelect:n,initialPath:r}){const[i,a]=A.useState(r||null),[s,o]=A.useState(""),[l,u]=A.useState("");A.useEffect(()=>{e&&(a(r||null),o(""),u(""))},[e,r]);const{data:f,isLoading:d,error:m}=bCe(e?i??"":null),g=S=>{f&&(a(f.path+"/"+S),u(""))},x=()=>{f?.parent&&f.parent!==f.path&&(a(f.parent),u(""))},_=()=>{a(null),u("")},b=()=>{s.trim()&&(a(s.trim()),u(""))},y=S=>{n(S),t(!1)},v=f?.entries.filter(S=>S.name.toLowerCase().includes(l.toLowerCase()));return p.jsx(Yo,{open:e,onOpenChange:t,children:p.jsxs(Xo,{className:"sm:max-w-lg overflow-x-hidden max-w-[calc(100vw-2rem)]",children:[p.jsxs(Bl,{children:[p.jsx(Ul,{children:"Select Git Repository"}),p.jsx(mp,{children:"Choose an existing git repository"})]}),p.jsx("p",{className:"text-xs text-muted-foreground",children:"Click folder names to navigate • Use action buttons to select"}),p.jsx(TEe,{}),p.jsxs("div",{className:"space-y-1 min-w-0",children:[p.jsx("label",{className:"text-xs font-medium",children:"Enter path manually:"}),p.jsxs("div",{className:"flex gap-2 min-w-0",children:[p.jsx(Xt,{value:s,onChange:S=>o(S.target.value),placeholder:"/path/to/your/project",onKeyDown:S=>S.key==="Enter"&&b(),className:"flex-1 min-w-0"}),p.jsx(Ie,{variant:"outline",size:"sm",onClick:b,className:"shrink-0",children:"Go"})]})]}),p.jsxs("div",{className:"space-y-1 min-w-0",children:[p.jsx("label",{className:"text-xs font-medium",children:"Search current directory:"}),p.jsxs("div",{className:"relative",children:[p.jsx(se,{icon:dg,size:14,strokeWidth:2,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),p.jsx(Xt,{value:l,onChange:S=>u(S.target.value),placeholder:"Filter folders and files...",className:"pl-8"})]})]}),p.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[p.jsx(Ie,{variant:"outline",size:"icon-sm",onClick:_,title:"Home",className:"shrink-0",children:p.jsx(se,{icon:Qxe,size:14,strokeWidth:2})}),p.jsx(Ie,{variant:"outline",size:"icon-sm",onClick:x,disabled:!f||f.parent===f.path,title:"Parent directory",className:"shrink-0",children:p.jsx(se,{icon:KM,size:14,strokeWidth:2})}),p.jsx("code",{className:"min-w-0 flex-1 text-xs bg-muted/50 px-2 py-1 rounded truncate overflow-hidden",children:f?.path||"~"}),p.jsxs(Ie,{variant:"outline",size:"sm",onClick:()=>f&&y(f.path),disabled:!f,className:"shrink-0 max-sm:px-2",title:"Select current directory",children:[p.jsx(se,{icon:kD,size:14,strokeWidth:2,className:"sm:hidden"}),p.jsx("span",{className:"max-sm:hidden",children:"Select Current"})]})]}),p.jsx(mg,{className:"h-64 border rounded-md min-w-0",children:p.jsxs("div",{className:"p-1 min-w-0",children:[d&&p.jsx("div",{className:"text-muted-foreground text-xs p-3",children:"Loading..."}),m&&p.jsx("div",{className:"text-destructive text-xs p-3",children:m.message}),f&&v&&p.jsxs(p.Fragment,{children:[v.length===0&&p.jsx("div",{className:"text-muted-foreground text-xs p-3",children:l?"No matches found":"Empty directory"}),v.map(S=>p.jsx("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded hover:bg-muted group min-w-0",children:S.type==="directory"?p.jsxs(p.Fragment,{children:[p.jsx(se,{icon:S.isGitRepo?kD:sa,size:16,strokeWidth:2,className:"text-accent shrink-0"}),p.jsx("button",{onClick:()=>g(S.name),className:"flex-1 text-left text-xs truncate hover:underline min-w-0",children:S.name}),S.isGitRepo&&p.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded border border-accent/50 text-accent font-medium shrink-0",children:[p.jsx("span",{className:"max-sm:hidden",children:"git repo"}),p.jsx("span",{className:"sm:hidden",children:"git"})]})]}):p.jsxs(p.Fragment,{children:[p.jsx("span",{className:"w-4 shrink-0"}),p.jsx("span",{className:"flex-1 text-xs text-muted-foreground truncate min-w-0",children:S.name})]})},S.name))]})]})}),p.jsxs(Lu,{children:[p.jsx(Ff,{render:p.jsx(Ie,{variant:"outline"}),children:"Cancel"}),p.jsx(Ie,{onClick:()=>f&&y(f.path),disabled:!f,children:"Select Path"})]})]})})}function HCe(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function WCe(e){const t=e.trim().split(/\s+/).slice(0,4).join(" "),n=HCe(t);if(!n)return"";const r=Math.random().toString(36).substring(2,6);return`${n}-${r}`}function v3({open:e,onOpenChange:t,defaultRepository:n,showTrigger:r=!0}={}){const{t:i}=It("tasks"),{t:a}=It("common"),[s,o]=A.useState(!1),l=e??s,u=t??o,[f,d]=A.useState(!1),[m,g]=A.useState(""),[x,_]=A.useState(""),[b,y]=A.useState(""),[v,S]=A.useState(""),[T,w]=A.useState(""),[C,R]=A.useState(""),[O,N]=A.useState("default"),[D,L]=A.useState(!1),[z,P]=A.useState(null),[q,H]=A.useState("browse"),[F,G]=A.useState(""),[V,B]=A.useState(null),[j,$]=A.useState(!1),Y=Zr(),W=hCe(),ee=Ire(),oe=A.useRef(null),{data:ae}=ECe(),{data:Z}=b3(),{data:K}=hg(),{data:Q,isLoading:te}=kre(b||null),ne=z?K?.find(Ce=>Ce.id===z):null,J=A.useMemo(()=>{if(!K)return[];if(ne&&F===ne.displayName||!F.trim())return K;const Ce=F.toLowerCase();return K.filter(Me=>Me.displayName.toLowerCase().includes(Ce)||Me.path.toLowerCase().includes(Ce))},[K,F,ne]);A.useEffect(()=>{K&&K.length>0?H("saved"):H("browse")},[K]),A.useEffect(()=>{if(l){if(n)P(n.id),y(n.path),G(n.displayName),H("saved");else if(K&&K.length>0){const Ce=K[0];P(Ce.id),y(Ce.path),G(Ce.displayName),H("saved")}}},[l,n,K]),A.useEffect(()=>{S(Q?Q.defaultBranch||Q.branches[0]||"main":"")},[Q,b]);const ve=Ce=>{g(Ce),R(WCe(Ce))},ge=async Ce=>{B(null),$(!0);try{if(!(await xCe(Ce)).isGitRepo){B(i("createModal.errors.notGitRepo")),$(!1);return}y(Ce);const Ae=K?.find(pe=>pe.path===Ce);if(Ae)P(Ae.id);else{P(null);const pe=Ce.split("/").pop()||"Unknown";ee.mutate({path:Ce,displayName:pe})}}catch(Me){B(Me instanceof Error?Me.message:i("createModal.errors.validationFailed"))}finally{$(!1)}},fe=Ce=>{if(Ce.preventDefault(),!m.trim()||!b)return;const Me=b.split("/").pop()||"repo",Ae=T.trim()||C,pe=`${ae}/${Ae}`;W.mutate({title:m.trim(),description:x.trim(),aiMode:O,repoPath:b,repoName:Me,baseBranch:v||"main",branch:Ae,worktreePath:pe,copyFiles:ne?.copyFiles||void 0,startupScript:ne?.startupScript||void 0,claudeOptions:ne?.claudeOptions||void 0},{onSuccess:de=>{const ke=x.trim()?{aiMode:O,description:x.trim()}:{aiMode:O};u(!1),g(""),_(""),y(""),S(""),w(""),R(""),N("default"),L(!1),P(null),G(""),B(null),H(K&&K.length>0?"saved":"browse"),Y({to:"/tasks/$taskId",params:{taskId:de.id},state:ke})},onError:de=>{Lt.error(i("createModal.errors.createFailed"),{description:de instanceof Error?de.message:String(de)})}})},Ee=!W.isPending&&!!m.trim()&&!!b;ga("meta+enter",()=>{oe.current&&oe.current.requestSubmit()},{enabled:l&&Ee,allowInInput:!0,ignoreContext:!0,deps:[l,Ee]});const _e=T.trim()||C,Ve=_e?`${ae}/${_e}`:"";return p.jsxs(p.Fragment,{children:[p.jsxs(Yo,{open:l,onOpenChange:u,children:[r&&p.jsxs(cEe,{render:p.jsx(Ie,{size:"sm"}),children:[p.jsx(se,{icon:e3,size:16,strokeWidth:2,"data-slot":"icon",className:"-translate-y-px"}),i("newTask")]}),p.jsx(Xo,{className:"sm:max-w-md max-h-[80dvh] flex flex-col overflow-hidden",children:p.jsxs("form",{ref:oe,onSubmit:fe,className:"flex flex-col min-h-0 flex-1",children:[p.jsxs(Bl,{className:"shrink-0",children:[p.jsx(Ul,{children:i("createModal.title")}),p.jsx(mp,{children:i("createModal.description")})]}),p.jsxs(mm,{className:"mt-4 pb-4 overflow-y-auto min-h-0 flex-1",children:[p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"title",children:i("createModal.fields.title")}),p.jsx(Xt,{id:"title",value:m,onChange:Ce=>ve(Ce.target.value),placeholder:i("createModal.fields.titlePlaceholder"),required:!0})]}),p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"description",children:i("createModal.fields.description")}),p.jsx(One,{id:"description",value:x,onValueChange:Ce=>{_(Ce),D||N(Ce.trim()?"plan":"default")},placeholder:i("createModal.fields.descriptionPlaceholder"),rows:2})]}),p.jsxs(yr,{children:[p.jsx(xr,{children:i("createModal.fields.aiMode")}),p.jsxs(pCe,{value:[O],onValueChange:Ce=>{const Me=Array.isArray(Ce)?Ce[0]:Ce;Me&&(N(Me),L(!0))},className:"w-full",variant:"outline",children:[p.jsx(dH,{value:"plan",className:"flex-1",children:i("createModal.aiModes.plan")}),p.jsx(dH,{value:"default",className:"flex-1",children:i("createModal.aiModes.default")})]})]}),p.jsxs(yr,{children:[p.jsx(xr,{children:i("createModal.fields.repository")}),p.jsxs(Mo,{value:q,onValueChange:Ce=>{H(Ce),B(null)},children:[p.jsxs(jo,{children:[p.jsx(_r,{value:"saved",disabled:!K?.length,children:i("createModal.tabs.saved")}),p.jsx(_r,{value:"browse",children:i("createModal.tabs.browse")})]}),p.jsx(Pr,{value:"saved",className:"mt-2",children:p.jsxs(iCe,{value:z||"",onValueChange:Ce=>{const Me=K?.find(Ae=>Ae.id===Ce);Me&&(P(Ce),y(Me.path),G(Me.displayName),B(null))},inputValue:F,onInputValueChange:Ce=>{G(Ce),ne&&Ce!==ne.displayName&&P(null)},itemToStringLabel:Ce=>K?.find(Me=>Me.id===Ce)?.displayName||"",children:[p.jsx(oCe,{placeholder:i("createModal.searchRepositories"),className:"w-full"}),p.jsx(lCe,{children:p.jsxs(uCe,{children:[p.jsx(dCe,{children:i("createModal.noRepositoriesFound")}),J.map(Ce=>p.jsx(cCe,{value:Ce.id,children:Ce.displayName},Ce.id))]})})]})}),p.jsx(Pr,{value:"browse",className:"mt-2",children:p.jsxs(Ie,{type:"button",variant:"outline",className:"w-full justify-start font-normal",onClick:()=>d(!0),disabled:j,children:[p.jsx(se,{icon:sa,size:14,strokeWidth:2,className:"mr-2"}),j?p.jsx("span",{className:"text-muted-foreground",children:a("status.validating")}):b&&!z?p.jsx("span",{className:"truncate",children:b}):p.jsx("span",{className:"text-muted-foreground group-hover/button:text-accent-foreground",children:i("createModal.selectFolder")})]})})]}),V&&p.jsx("p",{className:"text-sm text-destructive",children:V}),b&&!V&&p.jsx(io,{className:"font-mono text-xs truncate",children:b})]}),p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"baseBranch",children:i("createModal.fields.baseBranch")}),p.jsxs(Gi,{value:v,onValueChange:Ce=>S(Ce??""),disabled:!b||te,children:[p.jsx(Yi,{className:"w-full",children:p.jsx(Ki,{children:v||p.jsx("span",{className:"text-muted-foreground",children:i(b?te?"createModal.loadingBranches":"createModal.selectBranch":"createModal.selectRepositoryFirst")})})}),p.jsx(Xi,{children:Q?.branches.map(Ce=>p.jsxs(wn,{value:Ce,children:[Ce,Ce===Q.current&&p.jsx("span",{className:"text-muted-foreground ml-2",children:i("createModal.current")})]},Ce))})]})]}),p.jsxs(yr,{children:[p.jsx(xr,{htmlFor:"branch",children:i("createModal.fields.branchName")}),p.jsx(Xt,{id:"branch",value:T,onChange:Ce=>w(Ce.target.value),placeholder:C||i("createModal.fields.branchPlaceholder")}),Ve&&p.jsxs(io,{children:[i("createModal.worktreePrefix")," ",Ve]}),!T.trim()&&C&&p.jsx(io,{children:i("createModal.branchAutoGenerated",{branch:C})})]})]}),p.jsxs(Lu,{className:"mt-4 shrink-0",children:[p.jsx(Ff,{render:p.jsx(Ie,{variant:"outline",type:"button",className:"border-destructive text-destructive hover:bg-destructive hover:text-white"}),children:a("buttons.cancel")}),p.jsx(Ie,{type:"submit",disabled:W.isPending||!m.trim()||!b,children:W.isPending?a("status.creating"):i("createModal.createTask")})]})]})})]}),p.jsx(td,{open:f,onOpenChange:d,onSelect:ge,initialPath:Z||void 0})]})}const pH=[{to:"/tasks",icon:pm,labelKey:"header.tasks",matchPrefix:!0},{to:"/terminals",icon:_w,labelKey:"header.terminals",matchPrefix:!1},{to:"/repositories",icon:Cu,labelKey:"header.repositories",matchPrefix:!0},{to:"/apps",icon:tp,labelKey:"header.apps",matchPrefix:!0},{to:"/review",icon:Du,labelKey:"header.review",matchPrefix:!0},{to:"/monitoring",icon:ane,labelKey:"header.monitoring",matchPrefix:!0}];function VCe({onNewTaskRef:e,onOpenCommandPalette:t}){const{t:n}=It("navigation"),{location:r}=xi(),i=r.pathname,[a,s]=A.useState(!1),o=(l,u)=>u?i.startsWith(l):i===l;return A.useEffect(()=>{e?.(()=>s(!0))},[e]),p.jsxs("header",{className:"sticky top-0 z-10 flex h-10 shrink-0 items-center justify-between border-b border-border bg-card px-4 max-sm:px-2",children:[p.jsxs("div",{className:"flex min-w-0 items-center gap-4 max-sm:gap-2",children:[p.jsx(d_e,{className:"sm:hidden",children:p.jsx(f_e,{children:p.jsxs(p_e,{children:[p.jsxs(m_e,{className:"bg-transparent hover:bg-muted/50 data-open:bg-muted/50 gap-1 px-2",children:[p.jsx(se,{icon:cne,size:16,strokeWidth:2}),p.jsx("span",{className:"sr-only",children:"Menu"})]}),p.jsx(g_e,{className:"min-w-48",children:pH.map(l=>p.jsxs(v_e,{href:l.to,active:o(l.to,l.matchPrefix),render:p.jsx(cr,{to:l.to}),children:[p.jsx(se,{icon:l.icon,size:16,strokeWidth:2}),n(l.labelKey)]},l.to))})]})})}),p.jsx("nav",{className:"hidden items-center gap-1 sm:flex",children:pH.map(l=>{const u=o(l.to,l.matchPrefix);return p.jsxs(cr,{to:l.to,className:Ue("relative flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium transition-colors",u?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",u?"after:opacity-100":"after:opacity-0"),children:[p.jsx(se,{icon:l.icon,size:16,strokeWidth:2,"data-slot":"icon"}),p.jsx("span",{children:n(l.labelKey)})]},l.to)})})]}),p.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[p.jsx(v3,{open:a,onOpenChange:s}),p.jsx(Ie,{variant:"ghost",size:"icon-sm",onClick:t,title:n("header.commandPalette",{shortcut:"⌘K"}),className:"hidden sm:inline-flex",children:p.jsx(se,{icon:TD,size:16,strokeWidth:2})}),p.jsx("a",{href:"https://www.vibora.dev/guide/",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center rounded-md p-1.5 text-foreground/60 transition-colors hover:text-foreground",title:n("header.help"),children:p.jsx(se,{icon:lne,size:16,strokeWidth:2})}),p.jsx(cr,{to:"/settings",className:Ue("relative flex items-center justify-center rounded-md p-1.5 transition-colors",i==="/settings"?"bg-background text-foreground":"text-foreground/60 hover:text-foreground","after:absolute after:inset-x-0 after:bottom-0 after:h-0.5 after:bg-foreground after:transition-opacity",i==="/settings"?"after:opacity-100":"after:opacity-0"),children:p.jsx(se,{icon:fne,size:16,strokeWidth:2})})]})]})}function qCe(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`}const GCe=10,KCe=2e3;function YCe(){const e=kn(),t=Zr(),{resolvedTheme:n}=Sd(),r=A.useRef(null),i=A.useRef(void 0),a=A.useRef(0),s=A.useRef(void 0),o=A.useCallback(u=>{try{const f=JSON.parse(u.data);if(f.type==="task:updated")e.invalidateQueries({queryKey:["tasks"]});else if(f.type==="notification"&&"payload"in f){let d=function(){const L=S&&!T?"/goat.jpeg":"/logo.png";if(y!==!1){const P={description:x,icon:p.jsx("img",{src:L,alt:"",className:"size-8 shrink-0 aspect-square rounded-sm object-cover"}),...b&&{action:{label:"View",onClick:()=>t({to:"/tasks/$taskId",params:{taskId:b}})}}};switch(_){case"success":Lt.success(g,P);break;case"error":Lt.error(g,P);break;case"warning":Lt.warning(g,P);break;default:Lt.info(g,P);break}}if(v!==!1&&"Notification"in window&&window.parent===window&&Notification.permission==="granted"&&new Notification(g,{body:x,icon:L,tag:m}),S){const q="vibora:lastSoundPlayed",H=Date.now(),F=localStorage.getItem(q);if(F){const V=parseInt(F.split(":")[0]);if(H-V<1e3)return}const G=`${H}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(q,G),setTimeout(()=>{if(localStorage.getItem(q)!==G)return;let V=!1;const B=()=>{if(V)return;V=!0,new Audio("/sounds/goat-bleat.mp3").play().catch(()=>{})},j=new Audio("/api/uploads/sound");j.onerror=B,j.play().catch(B)},50)}window.parent!==window&&window.parent.postMessage({type:"vibora:notification",title:g,message:x,notificationType:_},"*")};const{id:m,title:g,message:x,notificationType:_,taskId:b,showToast:y,showDesktop:v,playSound:S,isCustomSound:T}=f.payload,w=`vibora:notification:${m}`,C=50,R=1e4;if(localStorage.getItem(w))return;const N=`${Date.now()}:${Math.random().toString(36).slice(2)}`;localStorage.setItem(w,N),setTimeout(()=>{localStorage.getItem(w)===N&&(setTimeout(()=>localStorage.removeItem(w),R),d())},C)}}catch{}},[e,t,n]),l=A.useCallback(()=>{const u=r.current;if(u&&(u.readyState===WebSocket.CONNECTING||u.readyState===WebSocket.OPEN))return;const f=qCe(),d=new WebSocket(f);r.current=d,d.onopen=()=>{a.current=0},d.onmessage=o,d.onclose=()=>{r.current===d&&(r.current=null),a.current<GCe&&(a.current++,i.current=setTimeout(()=>{s.current?.()},KCe))},d.onerror=()=>{}},[o]);s.current=l,A.useEffect(()=>{"Notification"in window&&Notification.permission==="default"&&Notification.requestPermission()},[]),A.useEffect(()=>(l(),()=>{i.current&&clearTimeout(i.current);const u=r.current;u&&(u.readyState===WebSocket.OPEN&&u.close(),r.current=null)}),[l])}const XCe={save:"Save Changes",cancel:"Cancel",delete:"Delete",create:"Create",reset:"Reset to default",browse:"Browse",clearFilters:"Clear filters"},ZCe={loading:"Loading...",saving:"Saving...",saved:"Saved",error:"Error",calculating:"calculating...",validating:"Validating...",creating:"Creating...",deleting:"Deleting...",loggingIn:"Logging in...",uploading:"Uploading..."},QCe={justNow:"just now",minuteAgo:"1 minute ago",minutesAgo:"{{count}} minutes ago",hourAgo:"1 hour ago",hoursAgo:"{{count}} hours ago",dayAgo:"1 day ago",daysAgo:"{{count}} days ago"},JCe={one:"{{count}} result",other:"{{count}} results"},eTe={IN_PROGRESS:"In Progress",IN_REVIEW:"In Review",DONE:"Done",CANCELED:"Canceled",ORPHANED:"Orphaned"},tTe={loginTitle:"Login to Vibora",username:"Username",password:"Password",login:"Login",loginFailed:"Login failed"},nTe={sentToClaude:"Sent to Claude Code",noTerminal:"No terminal available",syncedFromMain:"Synced from main",mergedToMain:"Merged to main",pushedToOrigin:"Pushed to origin",parentSynced:"Parent synced with origin",prCreated:"PR created",prExists:"PR already exists"},rTe={imageUploadFailed:"Failed to upload image",terminalNotConnected:"Terminal not connected",terminalNotConnectedDesc:"Please wait for the connection to establish"},iTe={manualDnsRequired:"Manual DNS required",manualDnsRequiredDesc:"Cloudflare API token not configured. You must create DNS records manually for your domains.",deployToApply:"Deploy to apply changes",deployToApplyDesc:"Domain configuration saved. Deploy the app for changes to take effect.",unknownRepo:"Unknown repo",service:"service",services:"services",exposed:"exposed",lastDeployed:"Last deployed",stop:"Stop",deploy:"Deploy",deploying:"Deploying...",building:"Building...",cancelDeploy:"Cancel",cancelling:"Cancelling...",delete:"Delete",deleting:"Deleting...",searchApps:"Search apps...",allRepos:"All repos",newApp:"New App",createApp:"Create App",noAppsYet:"No apps yet. Create your first app to get started!",noAppsMatch:"No apps match your search.",failedToLoadApps:"Failed to load apps",deleteApp:"Delete App",deleteAppConfirm:'Are you sure you want to delete "{{name}}"? This will stop all containers and remove the app configuration. This action cannot be undone.',cancel:"Cancel",appNotFound:"App not found",backToApps:"Back to Apps",tabs:{general:"General",deployments:"Deployments",logs:"Logs",environment:"Environment",domains:"Domains",monitoring:"Monitoring"},general:{deploy:"Deploy",autodeploy:"Autodeploy",noCache:"No-cache",notifications:"Notifications",services:"Services",noServicesConfigured:"No services configured"},compose:{title:"Compose File",repoNotFound:"Repository path not found",unsaved:"Unsaved",edit:"Edit",done:"Done"},logs:{title:"Logs",description:"Watch the logs of the application in real time",allContainers:"All containers",lines:"lines",copy:"Copy",copied:"Copied",download:"Download",refresh:"Refresh",noLogs:"No logs available"},deployments:{title:"Deployments",description:"See the last 10 deployments for this compose",noDeployments:"No deployments yet",view:"View",statusDone:"Done",statusError:"Error",statusBuilding:"Building",deployment:"Deployment",seeDetails:"See all the details of this deployment",noBuildLogs:"No build logs available"},environment:{title:"Environment Variables",description:"Set environment variables for Docker Compose builds. These will be available during the build and in your containers.",placeholder:`DATABASE_URL=postgres://...
26
26
  API_KEY=your-api-key
27
27
  # Comments are supported`,save:"Save Environment",showValues:"Show values",hideValues:"Hide values",unsavedChanges:"You have unsaved changes"},domains:{title:"Domain Configuration",description:"Configure which services are exposed and their domain mappings",expose:"Expose",exposeRequiresPort:"No port configured. Add a port mapping to your compose file.",domain:"Domain",noDomain:"No domain configured",portRequired:"Port required",editDomain:"Edit domain",noServices:"No services configured. Deploy the app first to see available services.",save:"Save"},streaming:{pulling:"Pulling code...",building:"Building containers...",starting:"Starting services...",configuring:"Configuring routing...",done:"Deployment complete!",failed:"Deployment failed",cancelled:"Deployment cancelled",preparing:"Preparing...",waitingForLogs:"Waiting for logs..."},dnsConfigRequired:"DNS configuration required",settings:"Settings",status:{running:"Running",building:"Building",failed:"Failed",stopped:"Stopped"},monitoring:{title:"Resource Usage",description:"Real-time CPU and memory usage for each service",cpu:"CPU",memory:"Memory",noContainers:"No running containers found",dockerUnavailable:"Docker stats not available",serviceTotal:"Service Total"}},aTe={buttons:XCe,status:ZCe,time:QCe,results:JCe,statuses:eTe,auth:tTe,git:nTe,errors:rTe,apps:iTe},sTe={tasks:"Tasks",terminals:"Terminals",worktrees:"Worktrees",repositories:"Repositories",apps:"Apps",review:"Review",monitoring:"Monitoring",settings:"Settings",commandPalette:"Command Palette ({{shortcut}})",help:"Documentation"},oTe={placeholder:"Type a command or search...",noResults:"No commands found.",categories:{navigation:"Navigation",actions:"Actions"},commands:{goToTasks:"Go to Tasks",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",newTask:"New Task",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts"}},lTe={title:"Keyboard Shortcuts",groups:{navigation:"Navigation",actions:"Actions",terminals:"Terminals (Desktop)",general:"General"},labels:{goToTasks:"Go to Tasks",goToTerminals:"Go to Terminals",goToTaskTerminals:"Go to Task Terminals",goToRepositories:"Go to Repositories",goToApps:"Go to Apps",goToReview:"Go to Review",goToMonitoring:"Go to Monitoring",goToSettings:"Go to Settings",commandPalette:"Command Palette",newTask:"New Task",openInEditor:"Open in Editor",keyboardShortcuts:"Keyboard Shortcuts",closeModal:"Close Modal",newTerminal:"New Terminal",closeTerminal:"Close Terminal",submitForm:"Submit Form"}},uTe={title:"Open in Editor",description:"Open a folder in {{editor}}",pathLabel:"Path",pathPlaceholder:"~/projects/my-project",pathHint:"Supports ~ for home directory",browse:"Browse",cancel:"Cancel",open:"Open"},cTe={header:sTe,commandPalette:oTe,shortcuts:lTe,openInEditor:uTe},dTe="Tasks",fTe="Search",pTe="All Repos",hTe="New Task",mTe={title:"Create New Task",description:"Create a new task with a git worktree for isolated development.",fields:{title:"Title",titlePlaceholder:"Add user authentication",description:"Description",descriptionPlaceholder:"Implement OAuth2 login flow...",aiMode:"AI Mode",repository:"Repository",baseBranch:"Base Branch",branchName:"Branch Name",branchPlaceholder:"auto-generated-from-title"},aiModes:{plan:"Plan",default:"Default"},tabs:{saved:"Repos",browse:"Browse"},worktreePrefix:"Worktree:",branchAutoGenerated:'Will use "{{branch}}" if left empty.',selectFolder:"Select folder...",searchRepositories:"Search repositories...",noRepositoriesFound:"No repositories found",selectRepositoryFirst:"Select repository first",loadingBranches:"Loading branches...",selectBranch:"Select branch",current:"(current)",createTask:"Create Task",errors:{notGitRepo:"Selected folder is not a git repository",validationFailed:"Failed to validate repository",createFailed:"Failed to create task"}},gTe={title:dTe,searchPlaceholder:fTe,allRepos:pTe,newTask:hTe,createModal:mTe},bTe="Settings",vTe={server:"Server",serverDefaults:"Server & Defaults",paths:"Paths",editor:"Editor",integrations:"Integrations",zai:"z.ai",notifications:"Notifications",appearance:"Appearance",developer:"Developer"},yTe={port:{label:"Port",description:"Requires restart"},startupCommand:{label:"Startup Command",description:"Command for new task terminals"},gitReposDir:{label:"Git Repos Directory",description:"Starting directory for repo picker"},editor:{app:{label:"Editor",description:"Code editor for opening worktrees",options:{vscode:"VS Code",cursor:"Cursor",windsurf:"Windsurf",zed:"Zed",antigravity:"Antigravity"}},host:{label:"Remote Host",description:"For SSH URLs when code is on a remote machine",placeholder:"e.g., my-server.tailnet.ts.net"},sshPort:{label:"SSH Port",description:"Remote SSH port (default 22)"}},linear:{label:"Linear",description:"API key for ticket sync"},github:{label:"GitHub",description:"PAT for Issues & PRs"},cloudflare:{label:"Cloudflare",placeholder:"Enter API token...",description:"API token for automatic DNS records"},zai:{enable:"Enable",apiKey:"API Key",description:"Configures Claude Code to use z.ai proxy",modelMappings:"Model Mappings",haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},language:{label:"Language",description:"Interface language",options:{auto:"Auto-detect",en:"English",zh:"Chinese (Simplified)"}},theme:{label:"Theme",description:"Color theme for the interface",options:{system:"System",light:"Light",dark:"Dark"}},syncClaudeTheme:{label:"Sync Claude Code",description:"Automatically update Claude Code's theme when Vibora switches between light and dark mode"},claudeCodeTheme:{light:"Light mode",dark:"Dark mode",options:{light:"Light","light-ansi":"Light ANSI","light-daltonized":"Light (colorblind)",dark:"Dark","dark-ansi":"Dark ANSI","dark-daltonized":"Dark (colorblind)"}}},xTe={enable:"Enable Notifications",toast:"In-app Toast",toastDescription:"Show toast notifications in the Vibora interface",desktop:"Desktop Notifications",desktopDescription:"Show native desktop or browser notifications",sound:"Sound",slack:"Slack",discord:"Discord",pushover:"Pushover",appToken:"App Token",userKey:"User Key",testSuccess:"{{channel}} test successful",testFailed:"{{channel}} test failed: {{error}}",uploadSound:"Upload custom sound",deleteSound:"Remove custom sound",testSound:"Test sound",soundUploaded:"Custom sound uploaded",soundUploadFailed:"Failed to upload sound: {{error}}",soundDeleted:"Custom sound removed",soundDeleteFailed:"Failed to remove custom sound",customSoundActive:"Custom sound active"},_Te={restartButton:"Restart Vibora",restarting:"Restarting...",restartDescription:"Rebuild and restart the Vibora server. If the build fails, the server will continue running.",restartFailed:"Restart failed",checkLogs:"Build may have failed. Check journalctl --user -u vibora for details."},ETe={title:"Unsaved Changes",description:"You have unsaved changes that will be lost if you leave this page.",stay:"Stay",leave:"Leave"},STe={title:bTe,sections:vTe,fields:yTe,notifications:xTe,developer:_Te,unsavedChanges:ETe},wTe="Review",CTe={pullRequests:"Pull Requests",issues:"Issues"},TTe={pr:{created:"Created by me",assigned:"Assigned to me",reviewRequested:"Review requests",mentioned:"Mentioned"},issue:{assigned:"Assigned to me",created:"Created by me",mentioned:"Mentioned"},allOrgs:"All Orgs",allOrganizations:"All Organizations",viboraReposOnly:"Vibora repos only"},ATe={tokenRequired:"GitHub Token Required",tokenDescription:"To view your issues and pull requests, add a GitHub Personal Access Token in Settings.",requiredScopes:"Required scopes:",scopes:{repo:"(for private repositories)",readUser:"(for user info)",readOrg:"(for organization list)"},generateToken:"Generate Token",goToSettings:"Go to Settings"},kTe={loading:"Loading...",failedToLoad:"Failed to load pull requests",empty:{all:"No open pull requests",created:"No pull requests created by you",assigned:"No pull requests assigned to you",reviewRequested:"No pull requests awaiting your review",mentioned:"No pull requests mentioning you"},draft:"Draft"},OTe={loading:"Loading...",failedToLoad:"Failed to load issues",empty:{assigned:"No issues assigned to you",created:"No issues created by you",mentioned:"No issues mentioning you"}},RTe={title:wTe,tabs:CTe,filters:TTe,github:ATe,prs:kTe,issues:OTe},NTe="Worktrees",ITe={total:"{{count}} total",orphaned:"{{count}} orphaned"},DTe={button:"Clean up ({{count}})",title:"Delete Completed Worktrees",description:"This will permanently delete {{count}} worktree(s).",linkedTasksWillBeDeleted:"Their linked tasks will also be deleted.",alsoDeleteLinkedTasks:"Also delete linked tasks",done:"Done",canceled:"Canceled",cannotUndo:"This action cannot be undone."},LTe={noMatch:"No worktrees match the selected filters.",noWorktrees:"No worktrees found. Worktrees are created when you create tasks."},PTe={failedToLoad:"Failed to load worktrees: {{message}}"},MTe={title:NTe,summary:ITe,cleanup:DTe,delete:{title:"Delete Worktree",description:"This will permanently delete the worktree directory at",linkedTaskWillBeDeleted:'The linked task "{{title}}" will also be deleted.',alsoDeleteLinkedTask:'Also delete linked task "{{title}}"',cannotUndo:"This action cannot be undone.",button:"Delete {{count}}"},empty:LTe,error:PTe},jTe="Monitoring",FTe={claude:"Claude Instances",system:"System Metrics",processes:"Processes",vibora:"Vibora Servers",worktrees:"Worktrees",usage:"Usage Limits"},BTe={showAllInstances:"Show all instances",instanceCount:"{{count}} instance(s) running",totalRam:"{{ram}} MB total",headers:{terminal:"Terminal",task:"Task",ram:"RAM",actions:"Actions",pid:"PID",workingDirectory:"Working Dir",source:"Source"},noTask:"(no task)",kill:"Kill",killing:"Killing...",killSelected:"Kill {{count}} selected",source:{vibora:"Vibora: {{name}}",external:"External"},empty:"No Claude instances running",emptyVibora:" in Vibora terminals",error:"Failed to load Claude instances: {{message}}"},UTe={cpuUsage:"CPU Usage",memoryUsage:"Memory Usage",memoryLabels:{used:"Used",cache:"Cache / Buffers"},diskUsage:"Disk Usage ({{path}})",error:"Failed to load system metrics: {{message}}",timeWindows:{"1m":"1 min","10m":"10 min","1h":"1 hour","3h":"3 hours","6h":"6 hours","12h":"12 hours","24h":"24 hours"}},$Te={topProcesses:"Top Processes",sortBy:{memory:"By Memory",cpu:"By CPU"},headers:{pid:"PID",name:"Name",command:"Command",memory:"Memory"},empty:"No processes found",error:"Failed to load processes: {{message}}",containers:"Containers",containersEmpty:"No containers running",containersUnavailable:"Docker/Podman not available"},zTe={description:"Running Vibora dev servers",instanceCount:"{{count}} instance(s) running",headers:{port:"Port",mode:"Mode",directory:"Directory",ram:"RAM",actions:"Actions"},mode:{dev:"Dev",prod:"Prod"},vite:"Vite",kill:"Kill",killing:"Killing...",empty:"No Vibora instances running",error:"Failed to load Vibora instances: {{message}}"},HTe={fiveHourBlock:"5-Hour Block",sevenDayRolling:"7-Day Rolling",opusWeekly:"Opus Weekly",sonnetWeekly:"Sonnet Weekly",resetsIn:"Resets in {{time}}",resetsAt:"Resets {{time}}",weekProgress:"{{percent}}% through week",unavailable:"Claude Code usage data not available. Make sure you're logged in to Claude Code.",error:"Failed to load usage data: {{message}}"},WTe={title:jTe,tabs:FTe,claude:BTe,system:UTe,processes:$Te,vibora:zTe,usage:HTe},VTe="Tasks",qTe="New Terminal",GTe="All Repos",KTe={title:"Edit Tab",name:"Name",namePlaceholder:"Tab name",directory:"Directory",directoryPlaceholder:"Select a directory...",clearDirectory:"Clear directory",cancel:"Cancel",save:"Save"},YTe={title:"New Tab",create:"Create"},XTe={taskTerminals:VTe,newTerminal:qTe,allRepos:GTe,editTab:KTe,newTab:YTe},ZTe="Repositories",QTe="{{count}} total",JTe="Search repositories...",eAe="New Task",tAe="Tasks",nAe="Terminal",rAe="Editor",iAe="Application",aAe="Applications",sAe="Create App",oAe={title:"Docker Compose Required",description:"To create an app for deployment, this repository needs a Docker Compose file.",instructions:"Create a docker-compose.yml file in your repository.",close:"Got it"},lAe="Settings",uAe="Add Repository",cAe="Scan Directory",dAe="Open in Terminal",fAe="Open in {{editor}}",pAe={openInVSCode:"Open in VS Code"},hAe={title:"Add Repository",description:"Add a git repository from a URL or local path, or scan a directory.",tabs:{add:"Add",scan:"Scan",template:"From Template"},inputLabel:"Repository URL or path",inputPlaceholder:"https://github.com/user/repo or /local/path",browse:"Browse...",cloneOptions:"Clone Options",targetDirectory:"Clone to directory",folderName:"Folder name",willCloneTo:"Will clone to",cloning:"Cloning repository...",adding:"Adding...",cloneFailed:"Failed to clone repository",createFailed:"Failed to add repository",cancel:"Cancel",add:"Add",retry:"Retry",fields:{path:"Repository Path",pathPlaceholder:"Select repository...",displayName:"Display Name",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects."}},mAe={button:"New Project",title:"Create New Project",back:"Back",next:"Next",create:"Create Project",steps:{template:{description:"Select a template to create your project from.",sectionTitle:"Copier Template",sectionDescription:"Select a saved template or enter a URL/path.",learnMore:"Learn more",savedTemplates:"Saved Templates",selectTemplate:"Select a template...",or:"or",customUrl:"Custom Template URL/Path"},questions:{title:"Template Questions",description:"Configure your project.",noQuestions:"This template has no configuration questions."},output:{title:"Output Location",description:"Choose where to create your project.",projectName:"Project Name",outputDirectory:"Output Directory",selectDirectory:"Select directory...",willCreate:"Will create",trust:"Trust template"},creating:{description:"Creating your project...",inProgress:"Running Copier..."}}},gAe={title:"Scan Directory for Repositories",description:"Find and add multiple git repositories from a directory.",directoryLabel:"Directory to scan",directoryPlaceholder:"Enter directory path",browse:"Browse...",scan:"Scan",foundRepos:"Found {{count}} repositories",selectAll:"Select all",selectNone:"Select none",noReposFound:"No git repositories found in this directory.",alreadyAdded:"Already added",adding:"Adding repositories...",scanFailed:"Failed to scan directory",addFailed:"Failed to add repositories",cancel:"Cancel",addSelected:"Add {{count}} selected"},bAe={noRepositories:"No repositories added yet. Add a repository for quick access when creating tasks.",noMatches:"No repositories match your search."},vAe={failedToLoad:"Failed to load repositories: {{message}}"},yAe={breadcrumb:"Repositories",notFound:"Repository not found",save:"Save",saving:"Saving...",saved:"Repository saved",failedToSave:"Failed to save repository",tabs:{settings:"Settings",workspace:"Workspace"},mobileWorkspace:{terminal:"Terminal",files:"Files"},settings:{displayName:"Display Name",startupScript:"Startup Script",startupScriptPlaceholder:"npm install && npm run dev",startupScriptDescription:"Command to run in the terminal when creating a worktree.",claudeOptions:"Claude Options",claudeOptionsDescription:"CLI flags passed to Claude when starting a task.",claudeOptionsFlag:"Flag",claudeOptionsValue:"Value",addClaudeOption:"Add option",copyFiles:"Copy Files",copyFilesPlaceholder:".env, config.local.json",copyFilesDescription:"Comma-separated glob patterns for files to copy into new worktrees.",isCopierTemplate:"Use as Copier Template",isCopierTemplateDescription:"Mark as a template for creating new projects with Copier."},workspace:{connectingToTerminal:"Connecting to terminal server...",initializingTerminal:"Initializing terminal..."}},xAe={title:ZTe,total:QTe,searchPlaceholder:JTe,newTask:eAe,viewTasks:tAe,terminal:nAe,editor:rAe,application:iAe,applications:aAe,createApp:sAe,createAppDialog:oAe,settings:lAe,addRepository:uAe,scanDirectory:cAe,openInTerminal:dAe,openInEditor:fAe,card:pAe,delete:{title:"Delete Repository",description:'This will remove "{{name}}" from Vibora. The actual repository files will not be affected.',button:"Delete",deleting:"Deleting...",alsoDeleteDirectory:"Also delete the directory from disk",deleteDirectoryWarning:"This will permanently delete all files in the repository. This action cannot be undone."},addModal:hAe,newProject:mAe,bulkAdd:gAe,empty:bAe,error:vAe,detailView:yAe},_Ae={save:"保存更改",cancel:"取消",delete:"删除",create:"创建",reset:"重置为默认值",browse:"浏览",clearFilters:"清除筛选"},EAe={loading:"加载中...",saving:"保存中...",saved:"已保存",error:"错误",calculating:"计算中...",validating:"验证中...",creating:"创建中...",deleting:"删除中...",loggingIn:"登录中...",uploading:"上传中..."},SAe={justNow:"刚刚",minuteAgo:"1 分钟前",minutesAgo:"{{count}} 分钟前",hourAgo:"1 小时前",hoursAgo:"{{count}} 小时前",dayAgo:"1 天前",daysAgo:"{{count}} 天前"},wAe={one:"{{count}} 个结果",other:"{{count}} 个结果"},CAe={IN_PROGRESS:"进行中",IN_REVIEW:"审核中",DONE:"已完成",CANCELED:"已取消",ORPHANED:"孤立"},TAe={loginTitle:"登录 Vibora",username:"用户名",password:"密码",login:"登录",loginFailed:"登录失败"},AAe={sentToClaude:"已发送到 Claude Code",noTerminal:"没有可用的终端",syncedFromMain:"已从 main 同步",mergedToMain:"已合并到 main",pushedToOrigin:"已推送到 origin",parentSynced:"父仓库已与 origin 同步",prCreated:"PR 已创建",prExists:"PR 已存在"},kAe={imageUploadFailed:"图片上传失败",terminalNotConnected:"终端未连接",terminalNotConnectedDesc:"请等待连接建立"},OAe={manualDnsRequired:"需要手动配置 DNS",manualDnsRequiredDesc:"未配置 Cloudflare API 令牌。您需要手动为域名创建 DNS 记录。",deployToApply:"部署以应用更改",deployToApplyDesc:"域名配置已保存。部署应用程序以使更改生效。",unknownRepo:"未知仓库",service:"服务",services:"服务",exposed:"已暴露",lastDeployed:"上次部署",stop:"停止",deploy:"部署",deploying:"部署中...",building:"构建中...",cancelDeploy:"取消",cancelling:"取消中...",delete:"删除",deleting:"删除中...",searchApps:"搜索应用...",allRepos:"所有仓库",newApp:"新建应用",createApp:"创建应用",noAppsYet:"暂无应用。创建您的第一个应用开始使用!",noAppsMatch:"没有匹配的应用。",failedToLoadApps:"加载应用失败",deleteApp:"删除应用",deleteAppConfirm:'确定要删除 "{{name}}" 吗?这将停止所有容器并删除应用配置。此操作无法撤销。',cancel:"取消",appNotFound:"应用未找到",backToApps:"返回应用列表",tabs:{general:"概览",deployments:"部署记录",logs:"日志",environment:"环境变量",domains:"域名"},general:{deploy:"部署",autodeploy:"自动部署",noCache:"无缓存",notifications:"通知",services:"服务",noServicesConfigured:"未配置服务"},compose:{title:"Compose 文件",repoNotFound:"未找到仓库路径",unsaved:"未保存",edit:"编辑",done:"完成"},logs:{title:"日志",description:"实时查看应用程序日志",allContainers:"所有容器",lines:"行",copy:"复制",copied:"已复制",download:"下载",refresh:"刷新",noLogs:"暂无日志"},deployments:{title:"部署记录",description:"查看此 Compose 的最近 10 次部署",noDeployments:"暂无部署记录",view:"查看",statusDone:"完成",statusError:"错误",statusBuilding:"构建中",deployment:"部署",seeDetails:"查看此部署的详细信息",noBuildLogs:"暂无构建日志"},environment:{title:"环境变量",description:"设置 Docker Compose 构建的环境变量。这些变量在构建期间和容器中都可用。",placeholder:`DATABASE_URL=postgres://...
28
28
  API_KEY=your-api-key
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/png" href="/logo.png" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Vibora - Harness Attention. Ship.</title>
8
- <script type="module" crossorigin src="/assets/index-Dkyt7PuR.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-oEWLASTY.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-_oJ5ZjNK.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibora",
3
- "version": "7.5.1",
3
+ "version": "7.5.2",
4
4
  "description": "Harness Attention. Orchestrate Agents. Ship.",
5
5
  "license": "PolyForm-Shield-1.0.0",
6
6
  "repository": {