import{r as n,j as i,c as _e}from"./app-BwDemWQz.js";import{b as Te,c as _,u as $}from"./index-DxJALBsh.js";import{t as Ee,u as rt,v as st,p as be,w as lt,x as at,y as ct,V as it,z as dt,B as ut,E as pt,G as ft,H as mt,J as ht,K as gt,L as vt}from"./AppLayout-3zbhnyYw.js";import{b as xt,u as L,c as te}from"./Button-B-KWyoQR.js";import{u as St}from"./index-B0gxmCHE.js";import{c as Ne}from"./createLucideIcon-BASx8f0E.js";import{C as wt}from"./index-CkDmAPFS.js";/**
 * @license lucide-react v0.539.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:"m6 9 6 6 6-6",key:"qrunsl"}]],Re=Ne("chevron-down",yt);/**
 * @license lucide-react v0.539.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ct=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],bt=Ne("chevron-up",Ct);function Pe(t,[o,e]){return Math.min(e,Math.max(o,t))}function It(t,o=[]){let e=[];function s(d,a){const l=n.createContext(a),c=e.length;e=[...e,a];const u=x=>{var y;const{scope:S,children:T,...w}=x,p=((y=S==null?void 0:S[t])==null?void 0:y[c])||l,v=n.useMemo(()=>w,Object.values(w));return i.jsx(p.Provider,{value:v,children:T})};u.displayName=d+"Provider";function g(x,S){var p;const T=((p=S==null?void 0:S[t])==null?void 0:p[c])||l,w=n.useContext(T);if(w)return w;if(a!==void 0)return a;throw new Error(`\`${x}\` must be used within \`${d}\``)}return[u,g]}const r=()=>{const d=e.map(a=>n.createContext(a));return function(l){const c=(l==null?void 0:l[t])||d;return n.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return r.scopeName=t,[s,Tt(r,...o)]}function Tt(...t){const o=t[0];if(t.length===1)return o;const e=()=>{const s=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(d){const a=s.reduce((l,{useScope:c,scopeName:u})=>{const x=c(d)[`__scope${u}`];return{...l,...x}},{});return n.useMemo(()=>({[`__scope${o.scopeName}`]:a}),[a])}};return e.scopeName=o.scopeName,e}function je(t){const o=Pt(t),e=n.forwardRef((s,r)=>{const{children:d,...a}=s,l=n.Children.toArray(d),c=l.find(Et);if(c){const u=c.props.children,g=l.map(x=>x===c?n.Children.count(u)>1?n.Children.only(null):n.isValidElement(u)?u.props.children:null:x);return i.jsx(o,{...a,ref:r,children:n.isValidElement(u)?n.cloneElement(u,void 0,g):null})}return i.jsx(o,{...a,ref:r,children:d})});return e.displayName=`${t}.Slot`,e}function Pt(t){const o=n.forwardRef((e,s)=>{const{children:r,...d}=e;if(n.isValidElement(r)){const a=Rt(r),l=Nt(d,r.props);return r.type!==n.Fragment&&(l.ref=s?xt(s,a):a),n.cloneElement(r,l)}return n.Children.count(r)>1?n.Children.only(null):null});return o.displayName=`${t}.SlotClone`,o}var _t=Symbol("radix.slottable");function Et(t){return n.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===_t}function Nt(t,o){const e={...o};for(const s in o){const r=t[s],d=o[s];/^on[A-Z]/.test(s)?r&&d?e[s]=(...l)=>{const c=d(...l);return r(...l),c}:r&&(e[s]=r):s==="style"?e[s]={...r,...d}:s==="className"&&(e[s]=[r,d].filter(Boolean).join(" "))}return{...t,...e}}function Rt(t){var s,r;let o=(s=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:s.get,e=o&&"isReactWarning"in o&&o.isReactWarning;return e?t.ref:(o=(r=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:r.get,e=o&&"isReactWarning"in o&&o.isReactWarning,e?t.props.ref:t.props.ref||t.ref)}var jt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],j=jt.reduce((t,o)=>{const e=je(`Primitive.${o}`),s=n.forwardRef((r,d)=>{const{asChild:a,...l}=r,c=a?e:o;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),i.jsx(c,{...l,ref:d})});return s.displayName=`Primitive.${o}`,{...t,[o]:s}},{}),Mt=[" ","Enter","ArrowUp","ArrowDown"],At=[" ","Enter"],J="Select",[ie,de,Ot]=lt(J),[oe]=It(J,[Ot,Ee]),ue=Ee(),[Dt,G]=oe(J),[kt,Lt]=oe(J),Me=t=>{const{__scopeSelect:o,children:e,open:s,defaultOpen:r,onOpenChange:d,value:a,defaultValue:l,onValueChange:c,dir:u,name:g,autoComplete:x,disabled:S,required:T,form:w}=t,p=ue(o),[v,y]=n.useState(null),[f,h]=n.useState(null),[M,A]=n.useState(!1),ne=rt(u),[E,D]=Te({prop:s,defaultProp:r??!1,onChange:d,caller:J}),[F,q]=Te({prop:a,defaultProp:l,onChange:c,caller:J}),V=n.useRef(null),B=v?w||!!v.closest("form"):!0,[U,H]=n.useState(new Set),z=Array.from(U).map(N=>N.props.value).join(";");return i.jsx(st,{...p,children:i.jsxs(Dt,{required:T,scope:o,trigger:v,onTriggerChange:y,valueNode:f,onValueNodeChange:h,valueNodeHasChildren:M,onValueNodeHasChildrenChange:A,contentId:be(),value:F,onValueChange:q,open:E,onOpenChange:D,dir:ne,triggerPointerDownPosRef:V,disabled:S,children:[i.jsx(ie.Provider,{scope:o,children:i.jsx(kt,{scope:t.__scopeSelect,onNativeOptionAdd:n.useCallback(N=>{H(k=>new Set(k).add(N))},[]),onNativeOptionRemove:n.useCallback(N=>{H(k=>{const W=new Set(k);return W.delete(N),W})},[]),children:e})}),B?i.jsxs(et,{"aria-hidden":!0,required:T,tabIndex:-1,name:g,autoComplete:x,value:F,onChange:N=>q(N.target.value),disabled:S,form:w,children:[F===void 0?i.jsx("option",{value:""}):null,Array.from(U)]},z):null]})})};Me.displayName=J;var Ae="SelectTrigger",Oe=n.forwardRef((t,o)=>{const{__scopeSelect:e,disabled:s=!1,...r}=t,d=ue(e),a=G(Ae,e),l=a.disabled||s,c=L(o,a.onTriggerChange),u=de(e),g=n.useRef("touch"),[x,S,T]=ot(p=>{const v=u().filter(h=>!h.disabled),y=v.find(h=>h.value===a.value),f=nt(v,p,y);f!==void 0&&a.onValueChange(f.value)}),w=p=>{l||(a.onOpenChange(!0),T()),p&&(a.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return i.jsx(at,{asChild:!0,...d,children:i.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":tt(a.value)?"":void 0,...r,ref:c,onClick:_(r.onClick,p=>{p.currentTarget.focus(),g.current!=="mouse"&&w(p)}),onPointerDown:_(r.onPointerDown,p=>{g.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(w(p),p.preventDefault())}),onKeyDown:_(r.onKeyDown,p=>{const v=x.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&S(p.key),!(v&&p.key===" ")&&Mt.includes(p.key)&&(w(),p.preventDefault())})})})});Oe.displayName=Ae;var De="SelectValue",ke=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,children:d,placeholder:a="",...l}=t,c=G(De,e),{onValueNodeHasChildrenChange:u}=c,g=d!==void 0,x=L(o,c.onValueNodeChange);return $(()=>{u(g)},[u,g]),i.jsx(j.span,{...l,ref:x,style:{pointerEvents:"none"},children:tt(c.value)?i.jsx(i.Fragment,{children:a}):d})});ke.displayName=De;var Vt="SelectIcon",Le=n.forwardRef((t,o)=>{const{__scopeSelect:e,children:s,...r}=t;return i.jsx(j.span,{"aria-hidden":!0,...r,ref:o,children:s||"▼"})});Le.displayName=Vt;var Bt="SelectPortal",Ve=t=>i.jsx(ct,{asChild:!0,...t});Ve.displayName=Bt;var Q="SelectContent",Be=n.forwardRef((t,o)=>{const e=G(Q,t.__scopeSelect),[s,r]=n.useState();if($(()=>{r(new DocumentFragment)},[]),!e.open){const d=s;return d?_e.createPortal(i.jsx(He,{scope:t.__scopeSelect,children:i.jsx(ie.Slot,{scope:t.__scopeSelect,children:i.jsx("div",{children:t.children})})}),d):null}return i.jsx(ze,{...t,ref:o})});Be.displayName=Q;var O=10,[He,Y]=oe(Q),Ht="SelectContentImpl",zt=je("SelectContent.RemoveScroll"),ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,position:s="item-aligned",onCloseAutoFocus:r,onEscapeKeyDown:d,onPointerDownOutside:a,side:l,sideOffset:c,align:u,alignOffset:g,arrowPadding:x,collisionBoundary:S,collisionPadding:T,sticky:w,hideWhenDetached:p,avoidCollisions:v,...y}=t,f=G(Q,e),[h,M]=n.useState(null),[A,ne]=n.useState(null),E=L(o,m=>M(m)),[D,F]=n.useState(null),[q,V]=n.useState(null),B=de(e),[U,H]=n.useState(!1),z=n.useRef(!1);n.useEffect(()=>{if(h)return ut(h)},[h]),pt();const N=n.useCallback(m=>{const[P,...R]=B().map(b=>b.ref.current),[I]=R.slice(-1),C=document.activeElement;for(const b of m)if(b===C||(b==null||b.scrollIntoView({block:"nearest"}),b===P&&A&&(A.scrollTop=0),b===I&&A&&(A.scrollTop=A.scrollHeight),b==null||b.focus(),document.activeElement!==C))return},[B,A]),k=n.useCallback(()=>N([D,h]),[N,D,h]);n.useEffect(()=>{U&&k()},[U,k]);const{onOpenChange:W,triggerPointerDownPosRef:K}=f;n.useEffect(()=>{if(h){let m={x:0,y:0};const P=I=>{var C,b;m={x:Math.abs(Math.round(I.pageX)-(((C=K.current)==null?void 0:C.x)??0)),y:Math.abs(Math.round(I.pageY)-(((b=K.current)==null?void 0:b.y)??0))}},R=I=>{m.x<=10&&m.y<=10?I.preventDefault():h.contains(I.target)||W(!1),document.removeEventListener("pointermove",P),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",P),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",P),document.removeEventListener("pointerup",R,{capture:!0})}}},[h,W,K]),n.useEffect(()=>{const m=()=>W(!1);return window.addEventListener("blur",m),window.addEventListener("resize",m),()=>{window.removeEventListener("blur",m),window.removeEventListener("resize",m)}},[W]);const[pe,le]=ot(m=>{const P=B().filter(C=>!C.disabled),R=P.find(C=>C.ref.current===document.activeElement),I=nt(P,m,R);I&&setTimeout(()=>I.ref.current.focus())}),fe=n.useCallback((m,P,R)=>{const I=!z.current&&!R;(f.value!==void 0&&f.value===P||I)&&(F(m),I&&(z.current=!0))},[f.value]),me=n.useCallback(()=>h==null?void 0:h.focus(),[h]),ee=n.useCallback((m,P,R)=>{const I=!z.current&&!R;(f.value!==void 0&&f.value===P||I)&&V(m)},[f.value]),ae=s==="popper"?xe:We,re=ae===xe?{side:l,sideOffset:c,align:u,alignOffset:g,arrowPadding:x,collisionBoundary:S,collisionPadding:T,sticky:w,hideWhenDetached:p,avoidCollisions:v}:{};return i.jsx(He,{scope:e,content:h,viewport:A,onViewportChange:ne,itemRefCallback:fe,selectedItem:D,onItemLeave:me,itemTextRefCallback:ee,focusSelectedItem:k,selectedItemText:q,position:s,isPositioned:U,searchRef:pe,children:i.jsx(ft,{as:zt,allowPinchZoom:!0,children:i.jsx(mt,{asChild:!0,trapped:f.open,onMountAutoFocus:m=>{m.preventDefault()},onUnmountAutoFocus:_(r,m=>{var P;(P=f.trigger)==null||P.focus({preventScroll:!0}),m.preventDefault()}),children:i.jsx(ht,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:d,onPointerDownOutside:a,onFocusOutside:m=>m.preventDefault(),onDismiss:()=>f.onOpenChange(!1),children:i.jsx(ae,{role:"listbox",id:f.contentId,"data-state":f.open?"open":"closed",dir:f.dir,onContextMenu:m=>m.preventDefault(),...y,...re,onPlaced:()=>H(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...y.style},onKeyDown:_(y.onKeyDown,m=>{const P=m.ctrlKey||m.altKey||m.metaKey;if(m.key==="Tab"&&m.preventDefault(),!P&&m.key.length===1&&le(m.key),["ArrowUp","ArrowDown","Home","End"].includes(m.key)){let I=B().filter(C=>!C.disabled).map(C=>C.ref.current);if(["ArrowUp","End"].includes(m.key)&&(I=I.slice().reverse()),["ArrowUp","ArrowDown"].includes(m.key)){const C=m.target,b=I.indexOf(C);I=I.slice(b+1)}setTimeout(()=>N(I)),m.preventDefault()}})})})})})})});ze.displayName=Ht;var Wt="SelectItemAlignedPosition",We=n.forwardRef((t,o)=>{const{__scopeSelect:e,onPlaced:s,...r}=t,d=G(Q,e),a=Y(Q,e),[l,c]=n.useState(null),[u,g]=n.useState(null),x=L(o,E=>g(E)),S=de(e),T=n.useRef(!1),w=n.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:y,focusSelectedItem:f}=a,h=n.useCallback(()=>{if(d.trigger&&d.valueNode&&l&&u&&p&&v&&y){const E=d.trigger.getBoundingClientRect(),D=u.getBoundingClientRect(),F=d.valueNode.getBoundingClientRect(),q=y.getBoundingClientRect();if(d.dir!=="rtl"){const C=q.left-D.left,b=F.left-C,Z=E.left-b,X=E.width+Z,he=Math.max(X,D.width),ge=window.innerWidth-O,ve=Pe(b,[O,Math.max(O,ge-he)]);l.style.minWidth=X+"px",l.style.left=ve+"px"}else{const C=D.right-q.right,b=window.innerWidth-F.right-C,Z=window.innerWidth-E.right-b,X=E.width+Z,he=Math.max(X,D.width),ge=window.innerWidth-O,ve=Pe(b,[O,Math.max(O,ge-he)]);l.style.minWidth=X+"px",l.style.right=ve+"px"}const V=S(),B=window.innerHeight-O*2,U=p.scrollHeight,H=window.getComputedStyle(u),z=parseInt(H.borderTopWidth,10),N=parseInt(H.paddingTop,10),k=parseInt(H.borderBottomWidth,10),W=parseInt(H.paddingBottom,10),K=z+N+U+W+k,pe=Math.min(v.offsetHeight*5,K),le=window.getComputedStyle(p),fe=parseInt(le.paddingTop,10),me=parseInt(le.paddingBottom,10),ee=E.top+E.height/2-O,ae=B-ee,re=v.offsetHeight/2,m=v.offsetTop+re,P=z+N+m,R=K-P;if(P<=ee){const C=V.length>0&&v===V[V.length-1].ref.current;l.style.bottom="0px";const b=u.clientHeight-p.offsetTop-p.offsetHeight,Z=Math.max(ae,re+(C?me:0)+b+k),X=P+Z;l.style.height=X+"px"}else{const C=V.length>0&&v===V[0].ref.current;l.style.top="0px";const Z=Math.max(ee,z+p.offsetTop+(C?fe:0)+re)+R;l.style.height=Z+"px",p.scrollTop=P-ee+p.offsetTop}l.style.margin=`${O}px 0`,l.style.minHeight=pe+"px",l.style.maxHeight=B+"px",s==null||s(),requestAnimationFrame(()=>T.current=!0)}},[S,d.trigger,d.valueNode,l,u,p,v,y,d.dir,s]);$(()=>h(),[h]);const[M,A]=n.useState();$(()=>{u&&A(window.getComputedStyle(u).zIndex)},[u]);const ne=n.useCallback(E=>{E&&w.current===!0&&(h(),f==null||f(),w.current=!1)},[h,f]);return i.jsx(Ut,{scope:e,contentWrapper:l,shouldExpandOnScrollRef:T,onScrollButtonChange:ne,children:i.jsx("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:M},children:i.jsx(j.div,{...r,ref:x,style:{boxSizing:"border-box",maxHeight:"100%",...r.style}})})})});We.displayName=Wt;var Ft="SelectPopperPosition",xe=n.forwardRef((t,o)=>{const{__scopeSelect:e,align:s="start",collisionPadding:r=O,...d}=t,a=ue(e);return i.jsx(gt,{...a,...d,ref:o,align:s,collisionPadding:r,style:{boxSizing:"border-box",...d.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=Ft;var[Ut,Ie]=oe(Q,{}),Se="SelectViewport",Fe=n.forwardRef((t,o)=>{const{__scopeSelect:e,nonce:s,...r}=t,d=Y(Se,e),a=Ie(Se,e),l=L(o,d.onViewportChange),c=n.useRef(0);return i.jsxs(i.Fragment,{children:[i.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:s}),i.jsx(ie.Slot,{scope:e,children:i.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...r,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...r.style},onScroll:_(r.onScroll,u=>{const g=u.currentTarget,{contentWrapper:x,shouldExpandOnScrollRef:S}=a;if(S!=null&&S.current&&x){const T=Math.abs(c.current-g.scrollTop);if(T>0){const w=window.innerHeight-O*2,p=parseFloat(x.style.minHeight),v=parseFloat(x.style.height),y=Math.max(p,v);if(y<w){const f=y+T,h=Math.min(w,f),M=f-h;x.style.height=h+"px",x.style.bottom==="0px"&&(g.scrollTop=M>0?M:0,x.style.justifyContent="flex-end")}}}c.current=g.scrollTop})})})]})});Fe.displayName=Se;var Ue="SelectGroup",[Kt,$t]=oe(Ue),Gt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=be();return i.jsx(Kt,{scope:e,id:r,children:i.jsx(j.div,{role:"group","aria-labelledby":r,...s,ref:o})})});Gt.displayName=Ue;var Ke="SelectLabel",Yt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=$t(Ke,e);return i.jsx(j.div,{id:r.id,...s,ref:o})});Yt.displayName=Ke;var ce="SelectItem",[qt,$e]=oe(ce),Ge=n.forwardRef((t,o)=>{const{__scopeSelect:e,value:s,disabled:r=!1,textValue:d,...a}=t,l=G(ce,e),c=Y(ce,e),u=l.value===s,[g,x]=n.useState(d??""),[S,T]=n.useState(!1),w=L(o,f=>{var h;return(h=c.itemRefCallback)==null?void 0:h.call(c,f,s,r)}),p=be(),v=n.useRef("touch"),y=()=>{r||(l.onValueChange(s),l.onOpenChange(!1))};if(s==="")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 i.jsx(qt,{scope:e,value:s,disabled:r,textId:p,isSelected:u,onItemTextChange:n.useCallback(f=>{x(h=>h||((f==null?void 0:f.textContent)??"").trim())},[]),children:i.jsx(ie.ItemSlot,{scope:e,value:s,disabled:r,textValue:g,children:i.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":S?"":void 0,"aria-selected":u&&S,"data-state":u?"checked":"unchecked","aria-disabled":r||void 0,"data-disabled":r?"":void 0,tabIndex:r?void 0:-1,...a,ref:w,onFocus:_(a.onFocus,()=>T(!0)),onBlur:_(a.onBlur,()=>T(!1)),onClick:_(a.onClick,()=>{v.current!=="mouse"&&y()}),onPointerUp:_(a.onPointerUp,()=>{v.current==="mouse"&&y()}),onPointerDown:_(a.onPointerDown,f=>{v.current=f.pointerType}),onPointerMove:_(a.onPointerMove,f=>{var h;v.current=f.pointerType,r?(h=c.onItemLeave)==null||h.call(c):v.current==="mouse"&&f.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_(a.onPointerLeave,f=>{var h;f.currentTarget===document.activeElement&&((h=c.onItemLeave)==null||h.call(c))}),onKeyDown:_(a.onKeyDown,f=>{var M;((M=c.searchRef)==null?void 0:M.current)!==""&&f.key===" "||(At.includes(f.key)&&y(),f.key===" "&&f.preventDefault())})})})})});Ge.displayName=ce;var se="SelectItemText",Ye=n.forwardRef((t,o)=>{const{__scopeSelect:e,className:s,style:r,...d}=t,a=G(se,e),l=Y(se,e),c=$e(se,e),u=Lt(se,e),[g,x]=n.useState(null),S=L(o,y=>x(y),c.onItemTextChange,y=>{var f;return(f=l.itemTextRefCallback)==null?void 0:f.call(l,y,c.value,c.disabled)}),T=g==null?void 0:g.textContent,w=n.useMemo(()=>i.jsx("option",{value:c.value,disabled:c.disabled,children:T},c.value),[c.disabled,c.value,T]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(w),()=>v(w)),[p,v,w]),i.jsxs(i.Fragment,{children:[i.jsx(j.span,{id:c.textId,...d,ref:S}),c.isSelected&&a.valueNode&&!a.valueNodeHasChildren?_e.createPortal(d.children,a.valueNode):null]})});Ye.displayName=se;var qe="SelectItemIndicator",Ze=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return $e(qe,e).isSelected?i.jsx(j.span,{"aria-hidden":!0,...s,ref:o}):null});Ze.displayName=qe;var we="SelectScrollUpButton",Xe=n.forwardRef((t,o)=>{const e=Y(we,t.__scopeSelect),s=Ie(we,t.__scopeSelect),[r,d]=n.useState(!1),a=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let l=function(){const u=c.scrollTop>0;d(u)};const c=e.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[e.viewport,e.isPositioned]),r?i.jsx(Qe,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=e;l&&c&&(l.scrollTop=l.scrollTop-c.offsetHeight)}}):null});Xe.displayName=we;var ye="SelectScrollDownButton",Je=n.forwardRef((t,o)=>{const e=Y(ye,t.__scopeSelect),s=Ie(ye,t.__scopeSelect),[r,d]=n.useState(!1),a=L(o,s.onScrollButtonChange);return $(()=>{if(e.viewport&&e.isPositioned){let l=function(){const u=c.scrollHeight-c.clientHeight,g=Math.ceil(c.scrollTop)<u;d(g)};const c=e.viewport;return l(),c.addEventListener("scroll",l),()=>c.removeEventListener("scroll",l)}},[e.viewport,e.isPositioned]),r?i.jsx(Qe,{...t,ref:a,onAutoScroll:()=>{const{viewport:l,selectedItem:c}=e;l&&c&&(l.scrollTop=l.scrollTop+c.offsetHeight)}}):null});Je.displayName=ye;var Qe=n.forwardRef((t,o)=>{const{__scopeSelect:e,onAutoScroll:s,...r}=t,d=Y("SelectScrollButton",e),a=n.useRef(null),l=de(e),c=n.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return n.useEffect(()=>()=>c(),[c]),$(()=>{var g;const u=l().find(x=>x.ref.current===document.activeElement);(g=u==null?void 0:u.ref.current)==null||g.scrollIntoView({block:"nearest"})},[l]),i.jsx(j.div,{"aria-hidden":!0,...r,ref:o,style:{flexShrink:0,...r.style},onPointerDown:_(r.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(s,50))}),onPointerMove:_(r.onPointerMove,()=>{var u;(u=d.onItemLeave)==null||u.call(d),a.current===null&&(a.current=window.setInterval(s,50))}),onPointerLeave:_(r.onPointerLeave,()=>{c()})})}),Zt="SelectSeparator",Xt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t;return i.jsx(j.div,{"aria-hidden":!0,...s,ref:o})});Xt.displayName=Zt;var Ce="SelectArrow",Jt=n.forwardRef((t,o)=>{const{__scopeSelect:e,...s}=t,r=ue(e),d=G(Ce,e),a=Y(Ce,e);return d.open&&a.position==="popper"?i.jsx(vt,{...r,...s,ref:o}):null});Jt.displayName=Ce;var Qt="SelectBubbleInput",et=n.forwardRef(({__scopeSelect:t,value:o,...e},s)=>{const r=n.useRef(null),d=L(s,r),a=St(o);return n.useEffect(()=>{const l=r.current;if(!l)return;const c=window.HTMLSelectElement.prototype,g=Object.getOwnPropertyDescriptor(c,"value").set;if(a!==o&&g){const x=new Event("change",{bubbles:!0});g.call(l,o),l.dispatchEvent(x)}},[a,o]),i.jsx(j.select,{...e,style:{...it,...e.style},ref:d,defaultValue:o})});et.displayName=Qt;function tt(t){return t===""||t===void 0}function ot(t){const o=dt(t),e=n.useRef(""),s=n.useRef(0),r=n.useCallback(a=>{const l=e.current+a;o(l),(function c(u){e.current=u,window.clearTimeout(s.current),u!==""&&(s.current=window.setTimeout(()=>c(""),1e3))})(l)},[o]),d=n.useCallback(()=>{e.current="",window.clearTimeout(s.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(s.current),[]),[e,r,d]}function nt(t,o,e){const r=o.length>1&&Array.from(o).every(u=>u===o[0])?o[0]:o,d=e?t.indexOf(e):-1;let a=eo(t,Math.max(d,0));r.length===1&&(a=a.filter(u=>u!==e));const c=a.find(u=>u.textValue.toLowerCase().startsWith(r.toLowerCase()));return c!==e?c:void 0}function eo(t,o){return t.map((e,s)=>t[(o+s)%t.length])}var to=Me,oo=Oe,no=ke,ro=Le,so=Ve,lo=Be,ao=Fe,co=Ge,io=Ye,uo=Ze,po=Xe,fo=Je;function bo({...t}){return i.jsx(to,{"data-slot":"select",...t})}function Io({...t}){return i.jsx(no,{"data-slot":"select-value",...t})}function To({className:t,size:o="default",children:e,...s}){return i.jsxs(oo,{"data-slot":"select-trigger","data-size":o,className:te("flex w-fit items-center justify-between gap-2 rounded-md border bg-white px-3 py-2 text-sm shadow-xs transition-colors outline-none","border-gray-300 text-gray-900 hover:bg-gray-50","focus-visible:border-primary focus-visible:ring-2 focus-visible:ring-primary/40","disabled:cursor-not-allowed disabled:opacity-50","dark:bg-zinc-900 dark:border-gray-500 dark:text-neutral-200 dark:hover:bg-zinc-800","data-[size=default]:h-9 data-[size=sm]:h-8","*:data-[slot=select-value]:line-clamp-1 *: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",t),...s,children:[e,i.jsx(ro,{asChild:!0,children:i.jsx(Re,{className:"size-4 opacity-50"})})]})}function Po({className:t,children:o,position:e="popper",...s}){return i.jsx(so,{children:i.jsxs(lo,{"data-slot":"select-content",className:te("relative z-50 min-w-[8rem] overflow-hidden rounded-md border shadow-lg","bg-white text-gray-900 border-gray-200","dark:bg-zinc-900 dark:text-neutral-200 dark:border-gray-500","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",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,...s,children:[i.jsx(mo,{}),i.jsx(ao,{className:te("p-1 max-h-[200px] overflow-y-auto overscroll-contain",e==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),i.jsx(ho,{})]})})}function _o({className:t,children:o,...e}){return i.jsxs(co,{"data-slot":"select-item",className:te("relative flex w-full cursor-default select-none items-center gap-2 rounded-md py-1.5 pl-2 pr-8 text-sm outline-none transition-colors","text-gray-900 hover:bg-gray-100 focus:bg-gray-100","dark:text-neutral-200 dark:hover:bg-zinc-800 dark:focus:bg-zinc-800","data-[disabled]:pointer-events-none data-[disabled]:opacity-50","[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...e,children:[i.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:i.jsx(uo,{children:i.jsx(wt,{className:"size-4 text-primary"})})}),i.jsx(io,{children:o})]})}function mo({className:t,...o}){return i.jsx(po,{"data-slot":"select-scroll-up-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:i.jsx(bt,{className:"size-4"})})}function ho({className:t,...o}){return i.jsx(fo,{"data-slot":"select-scroll-down-button",className:te("flex cursor-default items-center justify-center py-1",t),...o,children:i.jsx(Re,{className:"size-4"})})}export{Re as C,bo as S,To as a,Io as b,Po as c,_o as d};
