import{c as _e}from"./button-CZmOQP7j.js";import{r as o,j as n,c as Ne}from"./app-BBZbvTSO.js";import{c as be}from"./scroll-area-hNGxDuJk.js";import{u as Pe,c as nt,a as _,b as $}from"./index-CbDI-tXU.js";import{c as rt}from"./index-IvSACaye.js";import{u as k,a as st,c as te}from"./utils-YhN_nlHn.js";import{u as at}from"./index-BosTFUDi.js";import{b as Ie,P as lt,u as ct,h as it,a as dt,R as ut,F as pt,D as ft}from"./Combination-9YgcTppv.js";import{c as Ee,R as mt,A as ht,C as vt,a as gt}from"./index-hDbW6ayQ.js";import{P as j}from"./index-13DH8-b5.js";import{u as xt}from"./index-BCYyBCUm.js";import{V as St}from"./tooltip-CRkL5R4V.js";import{C as Re}from"./chevron-down-DDM9YQ48.js";import{C as wt}from"./check-yuW7wFtQ.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const yt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ct=_e("ChevronUp",yt);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const It=[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]],Co=_e("Filter",It);var Tt=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],J="Select",[ie,de,Pt]=rt(J),[oe,Io]=nt(J,[Pt,Ee]),ue=Ee(),[_t,G]=oe(J),[Nt,Et]=oe(J),je=t=>{const{__scopeSelect:r,children:e,open:i,defaultOpen:c,onOpenChange:p,value:a,defaultValue:l,onValueChange:s,dir:f,name:g,autoComplete:w,disabled:b,required:P,form:T}=t,d=ue(r),[v,y]=o.useState(null),[u,h]=o.useState(null),[M,A]=o.useState(!1),ne=at(f),[N,O]=Pe({prop:i,defaultProp:c??!1,onChange:p,caller:J}),[W,q]=Pe({prop:a,defaultProp:l,onChange:s,caller:J}),B=o.useRef(null),V=v?T||!!v.closest("form"):!0,[z,H]=o.useState(new Set),F=Array.from(z).map(E=>E.props.value).join(";");return n.jsx(mt,{...d,children:n.jsxs(_t,{required:P,scope:r,trigger:v,onTriggerChange:y,valueNode:u,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:Ie(),value:W,onValueChange:q,open:N,onOpenChange:O,dir:ne,triggerPointerDownPosRef:B,disabled:b,children:[n.jsx(ie.Provider,{scope:r,children:n.jsx(Nt,{scope:t.__scopeSelect,onNativeOptionAdd:o.useCallback(E=>{H(L=>new Set(L).add(E))},[]),onNativeOptionRemove:o.useCallback(E=>{H(L=>{const U=new Set(L);return U.delete(E),U})},[]),children:e})}),V?n.jsxs(Qe,{"aria-hidden":!0,required:P,tabIndex:-1,name:g,autoComplete:w,value:W,onChange:E=>q(E.target.value),disabled:b,form:T,children:[W===void 0?n.jsx("option",{value:""}):null,Array.from(z)]},F):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=o.forwardRef((t,r)=>{const{__scopeSelect:e,disabled:i=!1,...c}=t,p=ue(e),a=G(Me,e),l=a.disabled||i,s=k(r,a.onTriggerChange),f=de(e),g=o.useRef("touch"),[w,b,P]=tt(d=>{const v=f().filter(h=>!h.disabled),y=v.find(h=>h.value===a.value),u=ot(v,d,y);u!==void 0&&a.onValueChange(u.value)}),T=d=>{l||(a.onOpenChange(!0),P()),d&&(a.triggerPointerDownPosRef.current={x:Math.round(d.pageX),y:Math.round(d.pageY)})};return n.jsx(ht,{asChild:!0,...p,children:n.jsx(j.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(a.value)?"":void 0,...c,ref:s,onClick:_(c.onClick,d=>{d.currentTarget.focus(),g.current!=="mouse"&&T(d)}),onPointerDown:_(c.onPointerDown,d=>{g.current=d.pointerType;const v=d.target;v.hasPointerCapture(d.pointerId)&&v.releasePointerCapture(d.pointerId),d.button===0&&d.ctrlKey===!1&&d.pointerType==="mouse"&&(T(d),d.preventDefault())}),onKeyDown:_(c.onKeyDown,d=>{const v=w.current!=="";!(d.ctrlKey||d.altKey||d.metaKey)&&d.key.length===1&&b(d.key),!(v&&d.key===" ")&&Tt.includes(d.key)&&(T(),d.preventDefault())})})})});Ae.displayName=Me;var De="SelectValue",Oe=o.forwardRef((t,r)=>{const{__scopeSelect:e,className:i,style:c,children:p,placeholder:a="",...l}=t,s=G(De,e),{onValueNodeHasChildrenChange:f}=s,g=p!==void 0,w=k(r,s.onValueNodeChange);return $(()=>{f(g)},[f,g]),n.jsx(j.span,{...l,ref:w,style:{pointerEvents:"none"},children:et(s.value)?n.jsx(n.Fragment,{children:a}):p})});Oe.displayName=De;var Rt="SelectIcon",Le=o.forwardRef((t,r)=>{const{__scopeSelect:e,children:i,...c}=t;return n.jsx(j.span,{"aria-hidden":!0,...c,ref:r,children:i||"▼"})});Le.displayName=Rt;var jt="SelectPortal",ke=t=>n.jsx(lt,{asChild:!0,...t});ke.displayName=jt;var Q="SelectContent",Be=o.forwardRef((t,r)=>{const e=G(Q,t.__scopeSelect),[i,c]=o.useState();if($(()=>{c(new DocumentFragment)},[]),!e.open){const p=i;return p?Ne.createPortal(n.jsx(Ve,{scope:t.__scopeSelect,children:n.jsx(ie.Slot,{scope:t.__scopeSelect,children:n.jsx("div",{children:t.children})})}),p):null}return n.jsx(He,{...t,ref:r})});Be.displayName=Q;var D=10,[Ve,Y]=oe(Q),Mt="SelectContentImpl",At=st("SelectContent.RemoveScroll"),He=o.forwardRef((t,r)=>{const{__scopeSelect:e,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:p,onPointerDownOutside:a,side:l,sideOffset:s,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:b,collisionPadding:P,sticky:T,hideWhenDetached:d,avoidCollisions:v,...y}=t,u=G(Q,e),[h,M]=o.useState(null),[A,ne]=o.useState(null),N=k(r,m=>M(m)),[O,W]=o.useState(null),[q,B]=o.useState(null),V=de(e),[z,H]=o.useState(!1),F=o.useRef(!1);o.useEffect(()=>{if(h)return it(h)},[h]),dt();const E=o.useCallback(m=>{const[I,...R]=V().map(S=>S.ref.current),[C]=R.slice(-1),x=document.activeElement;for(const S of m)if(S===x||(S==null||S.scrollIntoView({block:"nearest"}),S===I&&A&&(A.scrollTop=0),S===C&&A&&(A.scrollTop=A.scrollHeight),S==null||S.focus(),document.activeElement!==x))return},[V,A]),L=o.useCallback(()=>E([O,h]),[E,O,h]);o.useEffect(()=>{z&&L()},[z,L]);const{onOpenChange:U,triggerPointerDownPosRef:K}=u;o.useEffect(()=>{if(h){let m={x:0,y:0};const I=C=>{var x,S;m={x:Math.abs(Math.round(C.pageX)-(((x=K.current)==null?void 0:x.x)??0)),y:Math.abs(Math.round(C.pageY)-(((S=K.current)==null?void 0:S.y)??0))}},R=C=>{m.x<=10&&m.y<=10?C.preventDefault():h.contains(C.target)||U(!1),document.removeEventListener("pointermove",I),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",I),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",R,{capture:!0})}}},[h,U,K]),o.useEffect(()=>{const m=()=>U(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[U]);const[pe,ae]=tt(m=>{const I=V().filter(x=>!x.disabled),R=I.find(x=>x.ref.current===document.activeElement),C=ot(I,m,R);C&&setTimeout(()=>C.ref.current.focus())}),fe=o.useCallback((m,I,R)=>{const C=!F.current&&!R;(u.value!==void 0&&u.value===I||C)&&(W(m),C&&(F.current=!0))},[u.value]),me=o.useCallback(()=>h==null?void 0:h.focus(),[h]),ee=o.useCallback((m,I,R)=>{const C=!F.current&&!R;(u.value!==void 0&&u.value===I||C)&&B(m)},[u.value]),le=i==="popper"?xe:Fe,re=le===xe?{side:l,sideOffset:s,align:f,alignOffset:g,arrowPadding:w,collisionBoundary:b,collisionPadding:P,sticky:T,hideWhenDetached:d,avoidCollisions:v}:{};return n.jsx(Ve,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:O,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:L,selectedItemText:q,position:i,isPositioned:z,searchRef:pe,children:n.jsx(ut,{as:At,allowPinchZoom:!0,children:n.jsx(pt,{asChild:!0,trapped:u.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:_(c,m=>{var I;(I=u.trigger)==null||I.focus({preventScroll:!0}),m.preventDefault()}),children:n.jsx(ft,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>u.onOpenChange(!1),children:n.jsx(le,{role:"listbox",id:u.contentId,"data-state":u.open?"open":"closed",dir:u.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:N,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:_(y.onKeyDown,m=>{const I=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!I&&m.key.length===1&&ae(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let C=V().filter(x=>!x.disabled).map(x=>x.ref.current);if(["ArrowUp","End"].includes(m.key)&&(C=C.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const x=m.target,S=C.indexOf(x);C=C.slice(S+1)}setTimeout(()=>E(C)),m.preventDefault()}})})})})})})});He.displayName=Mt;var Dt="SelectItemAlignedPosition",Fe=o.forwardRef((t,r)=>{const{__scopeSelect:e,onPlaced:i,...c}=t,p=G(Q,e),a=Y(Q,e),[l,s]=o.useState(null),[f,g]=o.useState(null),w=k(r,N=>g(N)),b=de(e),P=o.useRef(!1),T=o.useRef(!0),{viewport:d,selectedItem:v,selectedItemText:y,focusSelectedItem:u}=a,h=o.useCallback(()=>{if(p.trigger&&p.valueNode&&l&&f&&d&&v&&y){const N=p.trigger.getBoundingClientRect(),O=f.getBoundingClientRect(),W=p.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(p.dir!=="rtl"){const x=q.left-O.left,S=W.left-x,X=N.left-S,Z=N.width+X,he=Math.max(Z,O.width),ve=window.innerWidth-D,ge=be(S,[D,Math.max(D,ve-he)]);l.style.minWidth=Z+"px",l.style.left=ge+"px"}else{const x=O.right-q.right,S=window.innerWidth-W.right-x,X=window.innerWidth-N.right-S,Z=N.width+X,he=Math.max(Z,O.width),ve=window.innerWidth-D,ge=be(S,[D,Math.max(D,ve-he)]);l.style.minWidth=Z+"px",l.style.right=ge+"px"}const B=b(),V=window.innerHeight-D*2,z=d.scrollHeight,H=window.getComputedStyle(f),F=parseInt(H.borderTopWidth,10),E=parseInt(H.paddingTop,10),L=parseInt(H.borderBottomWidth,10),U=parseInt(H.paddingBottom,10),K=F+E+z+U+L,pe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(d),fe=parseInt(ae.paddingTop,10),me=parseInt(ae.paddingBottom,10),ee=N.top+N.height/2-D,le=V-ee,re=v.offsetHeight/2,m=v.offsetTop+re,I=F+E+m,R=K-I;if(I<=ee){const x=B.length>0&&v===B[B.length-1].ref.current;l.style.bottom="0px";const S=f.clientHeight-d.offsetTop-d.offsetHeight,X=Math.max(le,re+(x?me:0)+S+L),Z=I+X;l.style.height=Z+"px"}else{const x=B.length>0&&v===B[0].ref.current;l.style.top="0px";const X=Math.max(ee,F+d.offsetTop+(x?fe:0)+re)+R;l.style.height=X+"px",d.scrollTop=I-ee+d.offsetTop}l.style.margin=`${D}px 0`,l.style.minHeight=pe+"px",l.style.maxHeight=V+"px",i==null||i(),requestAnimationFrame(()=>P.current=!0)}},[b,p.trigger,p.valueNode,l,f,d,v,y,p.dir,i]);$(()=>h(),[h]);const[M,A]=o.useState();$(()=>{f&&A(window.getComputedStyle(f).zIndex)},[f]);const ne=o.useCallback(N=>{N&&T.current===!0&&(h(),u==null||u(),T.current=!1)},[h,u]);return n.jsx(Lt,{scope:e,contentWrapper:l,shouldExpandOnScrollRef:P,onScrollButtonChange:ne,children:n.jsx("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:n.jsx(j.div,{...c,ref:w,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});Fe.displayName=Dt;var Ot="SelectPopperPosition",xe=o.forwardRef((t,r)=>{const{__scopeSelect:e,align:i="start",collisionPadding:c=D,...p}=t,a=ue(e);return n.jsx(vt,{...a,...p,ref:r,align:i,collisionPadding:c,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});xe.displayName=Ot;var[Lt,Te]=oe(Q,{}),Se="SelectViewport",Ue=o.forwardRef((t,r)=>{const{__scopeSelect:e,nonce:i,...c}=t,p=Y(Se,e),a=Te(Se,e),l=k(r,p.onViewportChange),s=o.useRef(0);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),n.jsx(ie.Slot,{scope:e,children:n.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:_(c.onScroll,f=>{const g=f.currentTarget,{contentWrapper:w,shouldExpandOnScrollRef:b}=a;if(b!=null&&b.current&&w){const P=Math.abs(s.current-g.scrollTop);if(P>0){const T=window.innerHeight-D*2,d=parseFloat(w.style.minHeight),v=parseFloat(w.style.height),y=Math.max(d,v);if(y<T){const u=y+P,h=Math.min(T,u),M=u-h;w.style.height=h+"px",w.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,w.style.justifyContent="flex-end")}}}s.current=g.scrollTop})})})]})});Ue.displayName=Se;var We="SelectGroup",[kt,Bt]=oe(We),Vt=o.forwardRef((t,r)=>{const{__scopeSelect:e,...i}=t,c=Ie();return n.jsx(kt,{scope:e,id:c,children:n.jsx(j.div,{role:"group","aria-labelledby":c,...i,ref:r})})});Vt.displayName=We;var ze="SelectLabel",Ht=o.forwardRef((t,r)=>{const{__scopeSelect:e,...i}=t,c=Bt(ze,e);return n.jsx(j.div,{id:c.id,...i,ref:r})});Ht.displayName=ze;var ce="SelectItem",[Ft,Ke]=oe(ce),$e=o.forwardRef((t,r)=>{const{__scopeSelect:e,value:i,disabled:c=!1,textValue:p,...a}=t,l=G(ce,e),s=Y(ce,e),f=l.value===i,[g,w]=o.useState(p??""),[b,P]=o.useState(!1),T=k(r,u=>{var h;return(h=s.itemRefCallback)==null?void 0:h.call(s,u,i,c)}),d=Ie(),v=o.useRef("touch"),y=()=>{c||(l.onValueChange(i),l.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return n.jsx(Ft,{scope:e,value:i,disabled:c,textId:d,isSelected:f,onItemTextChange:o.useCallback(u=>{w(h=>h||((u==null?void 0:u.textContent)??"").trim())},[]),children:n.jsx(ie.ItemSlot,{scope:e,value:i,disabled:c,textValue:g,children:n.jsx(j.div,{role:"option","aria-labelledby":d,"data-highlighted":b?"":void 0,"aria-selected":f&&b,"data-state":f?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...a,ref:T,onFocus:_(a.onFocus,()=>P(!0)),onBlur:_(a.onBlur,()=>P(!1)),onClick:_(a.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:_(a.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:_(a.onPointerDown,u=>{v.current=u.pointerType}),onPointerMove:_(a.onPointerMove,u=>{var h;v.current=u.pointerType,c?(h=s.onItemLeave)==null||h.call(s):v.current==="mouse"&&u.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(a.onPointerLeave,u=>{var h;u.currentTarget===document.activeElement&&((h=s.onItemLeave)==null||h.call(s))}),onKeyDown:_(a.onKeyDown,u=>{var M;((M=s.searchRef)==null?void 0:M.current)!==""&&u.key===" "||(bt.includes(u.key)&&y(),u.key===" "&&u.preventDefault())})})})})});$e.displayName=ce;var se="SelectItemText",Ge=o.forwardRef((t,r)=>{const{__scopeSelect:e,className:i,style:c,...p}=t,a=G(se,e),l=Y(se,e),s=Ke(se,e),f=Et(se,e),[g,w]=o.useState(null),b=k(r,y=>w(y),s.onItemTextChange,y=>{var u;return(u=l.itemTextRefCallback)==null?void 0:u.call(l,y,s.value,s.disabled)}),P=g==null?void 0:g.textContent,T=o.useMemo(()=>n.jsx("option",{value:s.value,disabled:s.disabled,children:P},s.value),[s.disabled,s.value,P]),{onNativeOptionAdd:d,onNativeOptionRemove:v}=f;return $(()=>(d(T),()=>v(T)),[d,v,T]),n.jsxs(n.Fragment,{children:[n.jsx(j.span,{id:s.textId,...p,ref:b}),s.isSelected&&a.valueNode&&!a.valueNodeHasChildren?Ne.createPortal(p.children,a.valueNode):null]})});Ge.displayName=se;var Ye="SelectItemIndicator",qe=o.forwardRef((t,r)=>{const{__scopeSelect:e,...i}=t;return Ke(Ye,e).isSelected?n.jsx(j.span,{"aria-hidden":!0,...i,ref:r}):null});qe.displayName=Ye;var we="SelectScrollUpButton",Xe=o.forwardRef((t,r)=>{const e=Y(we,t.__scopeSelect),i=Te(we,t.__scopeSelect),[c,p]=o.useState(!1),a=k(r,i.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let l=function(){const f=s.scrollTop>0;p(f)};const s=e.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[e.viewport,e.isPositioned]),c?n.jsx(Je,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:s}=e;l&&s&&(l.scrollTop=l.scrollTop-s.offsetHeight)}}):null});Xe.displayName=we;var ye="SelectScrollDownButton",Ze=o.forwardRef((t,r)=>{const e=Y(ye,t.__scopeSelect),i=Te(ye,t.__scopeSelect),[c,p]=o.useState(!1),a=k(r,i.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let l=function(){const f=s.scrollHeight-s.clientHeight,g=Math.ceil(s.scrollTop)<f;p(g)};const s=e.viewport;return l(),s.addEventListener("scroll",l),()=>s.removeEventListener("scroll",l)}},[e.viewport,e.isPositioned]),c?n.jsx(Je,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:s}=e;l&&s&&(l.scrollTop=l.scrollTop+s.offsetHeight)}}):null});Ze.displayName=ye;var Je=o.forwardRef((t,r)=>{const{__scopeSelect:e,onAutoScroll:i,...c}=t,p=Y("SelectScrollButton",e),a=o.useRef(null),l=de(e),s=o.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return o.useEffect(()=>()=>s(),[s]),$(()=>{var g;const f=l().find(w=>w.ref.current===document.activeElement);(g=f==null?void 0:f.ref.current)==null||g.scrollIntoView({block:"nearest"})},[l]),n.jsx(j.div,{"aria-hidden":!0,...c,ref:r,style:{flexShrink:0,...c.style},onPointerDown:_(c.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(i,50))}),onPointerMove:_(c.onPointerMove,()=>{var f;(f=p.onItemLeave)==null||f.call(p),a.current===null&&(a.current=window.setInterval(i,50))}),onPointerLeave:_(c.onPointerLeave,()=>{s()})})}),Ut="SelectSeparator",Wt=o.forwardRef((t,r)=>{const{__scopeSelect:e,...i}=t;return n.jsx(j.div,{"aria-hidden":!0,...i,ref:r})});Wt.displayName=Ut;var Ce="SelectArrow",zt=o.forwardRef((t,r)=>{const{__scopeSelect:e,...i}=t,c=ue(e),p=G(Ce,e),a=Y(Ce,e);return p.open&&a.position==="popper"?n.jsx(gt,{...c,...i,ref:r}):null});zt.displayName=Ce;var Kt="SelectBubbleInput",Qe=o.forwardRef(({__scopeSelect:t,value:r,...e},i)=>{const c=o.useRef(null),p=k(i,c),a=xt(r);return o.useEffect(()=>{const l=c.current;if(!l)return;const s=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(s,"value").set;if(a!==r&&g){const w=new Event("change",{bubbles:!0});g.call(l,r),l.dispatchEvent(w)}},[a,r]),n.jsx(j.select,{...e,style:{...St,...e.style},ref:p,defaultValue:r})});Qe.displayName=Kt;function et(t){return t===""||t===void 0}function tt(t){const r=ct(t),e=o.useRef(""),i=o.useRef(0),c=o.useCallback(a=>{const l=e.current+a;r(l),function s(f){e.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>s(""),1e3))}(l)},[r]),p=o.useCallback(()=>{e.current="",window.clearTimeout(i.current)},[]);return o.useEffect(()=>()=>window.clearTimeout(i.current),[]),[e,c,p]}function ot(t,r,e){const c=r.length>1&&Array.from(r).every(f=>f===r[0])?r[0]:r,p=e?t.indexOf(e):-1;let a=$t(t,Math.max(p,0));c.length===1&&(a=a.filter(f=>f!==e));const s=a.find(f=>f.textValue.toLowerCase().startsWith(c.toLowerCase()));return s!==e?s:void 0}function $t(t,r){return t.map((e,i)=>t[(r+i)%t.length])}var Gt=je,Yt=Ae,qt=Oe,Xt=Le,Zt=ke,Jt=Be,Qt=Ue,eo=$e,to=Ge,oo=qe,no=Xe,ro=Ze;function To({...t}){return n.jsx(Gt,{"data-slot":"select",...t})}function bo({...t}){return n.jsx(qt,{"data-slot":"select-value",...t})}function Po({className:t,children:r,...e}){return n.jsxs(Yt,{"data-slot":"select-trigger",className:te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&>span]:line-clamp-1",t),...e,children:[r,n.jsx(Xt,{asChild:!0,children:n.jsx(Re,{className:"size-4 opacity-50"})})]})}function _o({className:t,children:r,position:e="popper",...i}){return n.jsx(Zt,{children:n.jsxs(Jt,{"data-slot":"select-content",className:te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border shadow-md",e==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:e,...i,children:[n.jsx(so,{}),n.jsx(Qt,{className:te("p-1",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),n.jsx(ao,{})]})})}function No({className:t,children:r,...e}){return n.jsxs(eo,{"data-slot":"select-item",className:te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...e,children:[n.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:n.jsx(oo,{children:n.jsx(wt,{className:"size-4"})})}),n.jsx(to,{children:r})]})}function so({className:t,...r}){return n.jsx(no,{"data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...r,children:n.jsx(Ct,{className:"size-4"})})}function ao({className:t,...r}){return n.jsx(ro,{"data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...r,children:n.jsx(Re,{className:"size-4"})})}export{Co as F,To as S,Po as a,bo as b,_o as c,No as d};
