1import{o as e}from"./rolldown-runtime-C0FnF6B9.js";import{t}from"./react-C21x__mS.js";import{t as n}from"./jsx-runtime-BdxMnOeJ.js";import{At as r,C as i,F as a,Ht as o,Qt as s,R as c,T as l,U as u,V as d,W as f,Zt as p,_ as m,_n as h,a as g,b as _,c as ee,et as v,f as y,fn as b,g as x,gn as S,in as C,it as w,j as te,l as T,o as ne,rn as re,s as ie,sn as E,t as ae,tn as D,v as oe,vn as O,x as se,y as ce}from"./FloatingPortal-mXPXjvqj.js";import{t as le}from"./compiler-runtime-BWrCSgrt.js";import{t as ue}from"./CaretDown.es-BpnsLkgN.js";import{t as de}from"./Check.es-DbFMrZae.js";import{t as k}from"./style-DojpP95n.js";import{A as fe,E as pe,_ as A,a as me,b as j,g as M,h as he,j as ge,l as _e,m as ve,o as ye,r as N,s as be,t as P,u as xe,v as Se}from"./button-c662r0mB.js";import{t as Ce}from"./dist-pGwNriZB.js";import{E as we,F as Te,M as Ee,P as De,S as Oe,V as ke,a as Ae,i as je,k as Me,n as Ne,o as Pe,r as Fe,t as Ie,x as Le,y as Re}from"./useBaseUiId-DYL3x86k.js";import{i as ze,r as Be,t as Ve}from"./useValueChanged-Inp-ppx9.js";import{i as He,n as Ue,t as We}from"./useAnchoredPopupScrollLock-Da4oL19S.js";import{n as Ge,r as Ke,t as qe}from"./getPseudoElementBounds-Q9Fv6VCy.js";import{t as Je}from"./useControlled-BdyhqLqe.js";import{n as Ye,t as Xe}from"./useCompositeListItem-GjaKqcLA.js";import{a as Ze,c as Qe,i as $e,l as et,n as tt,o as nt,r as rt,s as F,t as I,u as it}from"./input-C8K8QbyU.js";import{i as at,n as ot,r as st,t as ct}from"./input-group-K0yEZW2Q.js";import{t as lt}from"./use-controlled-state-BdudJVi1.js";var L=e(t(),1),R=n(),ut=e(O(),1);function dt(e,t=!1){let{overflowY:n}=j(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}function ft(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=te(),a=we()!=null,o=Se(()=>new Le({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ae,floatingId:i,syncOnly:!1,nested:a})).current;return M(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=fe(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}function pt(e){let t=L.useRef(!0);t.current&&(t.current=!1,e())}function mt(e,t,n,r,i,a,o,s,c,l=2){let u=v(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return w(n.current,u)?void 0:u}var ht=L.createContext(void 0),gt=L.createContext(void 0),_t=L.createContext(void 0),vt=L.createContext(!1),yt=L.createContext(``);function z(){let e=L.useContext(ht);if(!e)throw Error(ve(22));return e}function B(){let e=L.useContext(gt);if(!e)throw Error(ve(23));return e}function bt(){let e=L.useContext(_t);if(!e)throw Error(ve(24));return e}function xt(){return L.useContext(yt)}function St(){return L.useContext(vt)}function Ct(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var wt=(e,t)=>Object.is(e,t);function Tt(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Et(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Ct(e,t,(e,t)=>Tt(e,t,n)):e!==t}function Dt(e,t,n){return e?e.some(e=>e!==void 0&&Tt(t,e,n)):!1}function Ot(e,t,n){return e?e.findIndex(e=>e!==void 0&&Tt(e,t,n)):-1}function kt(e,t){if(t!==wt)return n=>Dt(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function At(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(kt(t,n)):Ot(e,t,n);return i===-1?null:i}function V(e,t,n,r,i,a){return Dt(r,t,i)?a!=null&&e>a&&Dt(r,n[a],i)?a:e:e===a?At(n,r,i,!0):a}function jt(e,t,n){return e.filter(e=>!Tt(t,e,n))}function Mt(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function Nt(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function Pt(e){return Nt(e?.[0])}function Ft(e){return Pt(e)?e.flatMap(e=>e.items):e}function It(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Pt(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function Lt(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 Mt(e)}function Rt(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Mt(e.value):Mt(e)}function zt(e,t,n){function r(){return Lt(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=Ft(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function Bt(e,t,n){return e.reduce((e,r,i)=>(i>0&&e.push(`, `),e.push((0,R.jsx)(L.Fragment,{children:zt(r,t,n)},i)),e),[])}var Vt={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>
1t?It(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>Tt(t,e,n)):Tt(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemProps:e=>e.itemProps,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight};function Ht(e){return e==null?void 0:`${e}-popup`}function Ut(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function Wt(e,t,n){return(r,i)=>{if(r==null)return!1;if(!i)return!0;let a=t?.selected??t,o=n==null?``:Lt(n,a);return o&&e.contains(o,i)&&o.length===i.length?!0:e.contains(r,i,t)}}function Gt(e){return Array.isArray(e)?e.map(e=>Gt(e)).join(`,`):e==null?``:String(e)}var Kt=new Map;function qt(e={}){let t={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...e},n=`${Gt(e.locale)}|${JSON.stringify(t)}`,r=Kt.get(n);if(r)return r;let i=new Intl.Collator(e.locale,t),a={contains(e,t,n){if(!t)return!0;let r=Lt(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(i.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=Lt(e,n);return i.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=Lt(e,n),a=t.length;return r.length>=a&&i.compare(r.slice(r.length-a),t)===0}};return Kt.set(n,a),a}var Jt=qt;function Yt(e={}){let{multiple:t=!1,value:n,...r}=e,i=qt(r),a=L.useCallback((e,r,a)=>t?Ut(i,a)(e,r):Wt(i,a,n)(e,r),[i,n,t]);return L.useMemo(()=>({...i,contains:a}),[a,i])}var Xt=Symbol(`none`),Zt={value:Xt,index:-1};function Qt(e,t,n){let r=e.get(t);if(r!==void 0||n===wt)return r;for(let[r,i]of e)if(Tt(r,t,n))return i}function $t(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:a,onSelectedValueChange:o,defaultInputValue:d,inputValue:h,open:ee,defaultOpen:v=!1,selectionMode:y,onItemHighlighted:S,name:C,form:w,disabled:te=!1,readOnly:T=!1,required:re=!1,inputRef:ie,grid:E=!1,items:ae,filteredItems:D,filter:O,filterQuery:se,openOnInputClick:le=!0,autoHighlight:ue=!1,keepHighlight:de=!1,highlightItemOnHover:k=!0,loopFocus:fe=!0,itemToStringLabel:j,itemToStringValue:N,isItemEqualToValue:P=wt,virtualized:xe=!1,inline:Ce=!1,fillInputOnItemPress:we=!0,modal:Te=!1,limit:Ee=-1,autoComplete:De=`list`,formAutoComplete:Ae,locale:je,submitOnItemClick:Ne=!1}=e,{clearErrors:Fe}=$e(),{setDirty:Ie,validityData:Le,setFilled:ze,name:Be,disabled:We,setTouched:Ge,setFocused:qe,validationMode:Ye,validation:Xe}=Qe(),et=ke(),nt=tt({id:t}),rt=Jt({locale:je}),F=Array.isArray(ae)?null:ae;if(F&&typeof F.label!=`function`)throw Error(ve(100));let I=F?F.data:ae,it=F?.value,at=it?void 0:I,ot=L.useMemo(()=>{if(!D||!it)return;let e=Ft(D),t=e.map(it),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return Qt(n,r,i)}}},[D,it]),st=L.useMemo(()=>F?e=>F.label(e,P,e=>{let t=ot?.findItem(e,P);return t==null?Lt(e,j):F.itemLabel(t)}):j,[F,j,ot,P]),ct=L.useMemo(()=>F?Object.assign(e=>F.itemLabel(e),{selected:e=>Lt(e,st)}):j,[F,st,j]);function lt(e){return Lt(e,st)}let[ut,z]=L.useState(!1),[B,bt]=L.useState(null),xt=L.useRef(B),St=L.useRef([]),Ct=L.useRef([]),kt=L.useRef(null),V=L.useRef(null),Mt=L.useRef(null),Nt=L.useRef(null),It=L.useRef(null),zt=L.useRef(!0),Bt=L.useRef(!1),Ht=L.useRef(null),Wt=L.useRef(null),Gt=L.useRef(null),Kt=L.useRef(Zt),qt=L.useRef(null),Yt=L.useRef([]),$t=L.useRef(null),en=We||te,tn=Be??C,H=y===`multiple`,nn=y===`single`,rn=h!==void 0||d!==void 0,U=I!==void 0,an=D!==void 0,W;W=ue===`always`?`always`:ue?`input-change`:!1;let[G,on]=Je({controlled:a,default:H?r??me:r,name:`Combobox`,state:`selectedValue`}),sn=L.useMemo(()=>O===null?()=>!0:O===void 0?Ut(rt,ct):O,[O,rt,ct]),cn=Se(()=>rn?d??``:nn?lt(G):``).current,[K,ln]=Je({controlled:h,default:cn,name:`Combobox`,state:`inputValue`}),[q,un]=Je({controlled:ee,default:v,name:`Combobox`,state:`open`}),dn=Pt(I),J=!q&&B!==null?B:String(K).trim(),fn=nn?lt(G):``,pn=nn&&!ut&&J!==``&&fn.length===J.length&&rt.contains(fn,J),mn=pn?``:se??J,hn=U&&an&&pn&&(!F||F.hasValue(G,P)),gn=L.useMemo(()=>I?Ft(I):me,[I]),_n=L.useMemo(()=>
1{if(D&&!hn)return D;if(!I)return me;if(dn){let e=I,t=[],n=0;for(let r of e){if(Ee>-1&&n>=Ee)break;let e=Ee>-1?Ee-n:1/0,i=mn===``?r.items.slice(0,e):[];if(mn!==``)for(let t of r.items){if(i.length>=e)break;sn(t,mn,ct)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(mn===``)return Ee>-1?gn.slice(0,Ee):gn;let e=[];for(let t of gn){if(Ee>-1&&e.length>=Ee)break;sn(t,mn,ct)&&e.push(t)}return e},[D,hn,I,dn,mn,Ee,sn,ct,gn]),Y=L.useMemo(()=>{if(ot&&_n===D)return ot.values;let e=Ft(_n);return it?e.map(e=>it(e)):e},[_n,D,ot,it]),X=Se(()=>{let e=null;return Ce&&q&&U&&y!==`none`&&(e=At(Y,G,P,H)),new b({id:nt,labelId:void 0,selectedValue:G,open:q,items:at,selectionMode:y,name:tn,form:w,disabled:en,readOnly:T,required:re,grid:E,virtualized:xe,openOnInputClick:le,itemToStringLabel:st,isItemEqualToValue:P,modal:Te,autoHighlight:W,submitOnItemClick:Ne,hasInputValue:rn,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:Ce,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemProps:ye,positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:y===`none`},{onOpenChangeComplete:be,setOpen:be,setInputValue:be,setSelectedValue:be,setIndices:be,handleSelection:be,forceMount:be,requestSubmit:be,listRef:St,labelsRef:Ct,popupRef:kt,emptyRef:It,inputRef:V,startDismissRef:Mt,endDismissRef:Nt,keyboardActiveRef:zt,chipsContainerRef:Ht,clearRef:Wt,valuesRef:Yt,pointerDownItemRef:$t,selectionEventRef:Gt},Vt)}).current,vn=y===`none`?K:G,yn=L.useMemo(()=>y===`none`?vn:Array.isArray(G)?G.map(e=>Rt(e,N)):Rt(G,N),[vn,N,y,G]),bn=A(S),xn=A(n),Sn=X.useState(`activeIndex`),Cn=X.useState(`selectedIndex`),wn=X.useState(`positionerElement`),Tn=X.useState(`listElement`),En=X.useState(`triggerElement`),Dn=X.useState(`inputElement`),On=X.useState(`inputGroupElement`),Z=X.useState(`inline`),Q=X.useState(`inputInsidePopup`),kn=X.useState(`inputOwnsFormValue`),An=nn&&!Q&&K===fn,jn=Me(En),{mounted:Mn,setMounted:Nn,transitionStatus:Pn}=Re(q),{openMethod:Fn,triggerProps:In}=Ue(q),Ln=A(()=>yn);Ze(Q?jn:V,nt,vn,Ln,!en,C);let Rn=A(()=>{I?Ct.current=Y.map(lt):X.set(`forceMounted`,!0)}),$=A((e,t,n)=>{if(t===-1){if(Kt.current===Zt)return;Kt.current=Zt}else Kt.current={value:e,index:t};bn(e,ne(n,void 0,{index:t}))}),zn=A(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),X.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?$(void 0,-1,r):$(Yt.current[n],n,r)}),Bn=A((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Bt.current=n.reason===m,n.reason===`input-change`){q&&B!==null&&bt(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&z(!0),qt.current={hasQuery:e};let n=X.state.listElement;if(!X.state.virtualized&&n){let e=kt.current;for(let t of pe(n.firstElementChild??n)){if(!ge(t)||(e?!p(e,t):t.getAttribute(`role`)===`dialog`))break;if(dt(t)){t.scrollTop=0;break}}}e&&W&&X.state.activeIndex==null&&(q||Z)&&X.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&X.state.inputInsidePopup&&(qt.current={hasQuery:!1,selection:!0}
1);ln(t)}}),Vn=A(e=>{let t=!e&&Q&&!Z&&K!==``&&(String(K).trim()===B||K===fn);!e&&(t||K===``||An)&&z(!1),bt(null),t&&Bn(``,g(m))}),Hn=A((t,n)=>{if(q!==t&&(n.reason===`escape-key`&&U&&Y.length===0&&!It.current&&n.allowPropagation(),e.onOpenChange?.(t,n),!n.isCanceled&&(t&&B!==null&&Vn(n.reason===x),!t&&ut&&(nn?(Z||bt(J),J===``&&z(!1)):H&&(Z||bt(J),Q&&zn({activeIndex:null}),(!Q||Z)&&Bn(``,g(m,n.event,void 0,{isItemPress:n.reason===ce})))),un(t),!t&&Q&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(Ge(!0),qe(!1),Ye===`onBlur`)))){let e=y===`none`?K:G;Xe.commit(e)}}),Un=A((e,t)=>{o?.(e,t),!t.isCanceled&&(on(e),(y===`none`&&kt.current&&we||nn&&!X.state.inputInsidePopup)&&Bn(lt(e),g(t.reason,t.event)))}),Wn=A((e,t)=>{let n=s(e),r=Gt.current??e;Gt.current=null;let i=g(ce,r),a=n?.closest(`a`)?.getAttribute(`href`);if(a){a.startsWith(`#`)&&Hn(!1,i);return}if(H){let e=Array.isArray(G)?G:[],n=Dt(e,t,P),r=n?jt(e,t,P):[...e,t];if(Un(r,i),i.isCanceled||!(V.current&&V.current.value.trim()!==``))return;if(X.state.inputInsidePopup){Bn(``,g(m,i.event,void 0,{isItemPress:!0}));let e=qt.current;e&&!n&&(e.toggledValue=t)}else Hn(!1,i)}else{if(Un(t,i),i.isCanceled)return;Hn(!1,i)}}),Gn=A(()=>{let e=Xe.inputRef.current?.form??X.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Kn=A(()=>{if(Nn(!1),xn?.(!1),z(!1),bt(null),zn(y===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),H&&V.current&&V.current.value!==``&&!Bt.current&&Bn(``,g(m)),nn){if(X.state.inputInsidePopup)V.current&&V.current.value!==``&&Bn(``,g(m));else{let e=lt(G);V.current&&V.current.value!==e&&Bn(e,g(e===``?m:i))}}}),qn=L.useMemo(()=>Z&&wn?{current:wn.closest(`[role="dialog"]`)}:kt,[Z,wn]);c({enabled:!e.actionsRef,open:q,ref:qn,onComplete(){q||Kn()}}),L.useImperativeHandle(e.actionsRef,()=>({unmount:Kn}),[Kn]),M(function(){let e=xt.current!==null&&B===null;if(xt.current=B,q&&(!e||!U)||(q||($t.current=null),y===`none`))return;let t=U?Y:Yt.current;zn({selectedIndex:At(t,G,P,H)})},[q,B,G,y,H,U,Y,P,zn]),M(()=>{I&&(Yt.current=Y,St.current.length=Y.length)},[I,Y]),M(()=>{let e=qt.current;if(e){let t=q||Z||X.state.positionerElement?.hidden===!1;if(e.hasQuery)W&&t&&X.set(`activeIndex`,0),qt.current=null;else if(String(K).trim()===``&&(qt.current=null,t)){let t=e.selection;W===`always`&&!t&&X.state.selectionMode===`none`&&X.set(`activeIndex`,0),queueMicrotask(()=>{if(!X.state.open&&!X.state.inline||V.current&&V.current.value.trim()!==``)return;let n=X.state.selectedValue,r=X.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:X.state.selectionMode!==`none`&&n!=null){let t=U||an?Y:Yt.current,i=Ot(t,e.toggledValue,X.state.isItemEqualToValue);X.set(`activeIndex`,i===-1?At(t,n,X.state.isItemEqualToValue,r):i)}else t?X.set(`activeIndex`,null):W===`always`&&X.set(`activeIndex`,0)})}}if(!q&&!Z)return;let t=U||an?Y:Yt.current,n=X.state.activeIndex;if(n==null){if(W===`always`&&t.length>0){X.set(`activeIndex`,0);return}$(void 0,-1,i);return}if(n>=t.length){$(void 0,-1,i),X.set(`activeIndex`,null);return}let r=t[n],a=Kt.current.value,o=a!==Xt&&Tt(r,a,X.state.isItemEqualToValue);(Kt.current.index!==n||!o)&&$(r,n,i)},[Sn,W,$,an,U,Y,Z,q,X,K]),M(()=>{if(y===`none`){ze(String(K)!==``);return}ze(H?Array.isArray(G)&&G.length>0:G!=null)},[ze,y,K,G,H]),L.useEffect(()=>{U&&W&&Y.length===0&&zn({activeIndex:null})},[U,W,Y.length,zn]);function Jn(){q&&J!==``&&J!==String(cn)&&!An&&z(!0)}function Yn(){q&&B!==null&&Vn(!1)}let Xn=!1;function Zn(){!Xn&&K!==fn&&(Xn=!0,Bn(fn,g(i)))}function Qn(){y!==`none`&&(Fe(tn),Ie(Et(G,Le.initialValue,P)),Xe.change(G),nn&&!rn&&!Q&&Zn())}function $n(){nn&&!rn&&!Q&&!ut&&Zn()}function er(){y===`none`&&(Fe(tn),Ie(K!==Le.initialValue),Xe.change(K))}Ve(J,Jn),Ve(q,Yn),Ve(G,Qn),Ve(fn,$n),Ve(I,$n),Ve(K,er);let tr=ft({open:Z?!0:q,onOpenChange:Hn,elements:{reference:Q?En:Dn,floating:wn}}),nr=E?`grid`:`listbox`,rr=q||Z,ir=rr?`true`:`false`,ar=L.useMemo(()=>{let e=Dn?.tagName===`INPUT`,t=Dn==null||e,n=t||rr,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=ir,r[`aria-haspopup`]=nr,r[`aria-controls`]=rr?Tn?.id:void 0,r[`aria-autocomplete`]=T?`none`:De),{reference:r,floating:{role:`presentation`}}},[Dn,rr,ir,nr,Tn?.id,De,T]),or=He(tr,{enabled:!en&&le,event:`mousedown-only`,toggle:!1,touchOpenDelay:Q?0:100,reason:oe}),sr=Oe(tr,{enabled:!en&&!Z,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:Z?!0:void 0,outsidePress(e){let t=s(e);return!p(En,t)&&!p(Wt.current,t)&&!p(Ht.current,t)&&!p(On,t)}}),cr=Ke(tr,{enabled:!en,id:nt,listRef:St,activeIndex:Sn,selectedIndex:Cn,virtual:!0,loopFocus:fe,allowEscape:fe&&!W,focusItemOnOpen:ut||y===`none`&&!W?!1:`auto`,focu
1sItemOnHover:k,resetOnPointerLeave:!de,orientation:E?`horizontal`:void 0,rtl:et===`rtl`,disabledIndices:me,grid:E?mt:void 0,onNavigate(e,t){(t||q)&&Pn!==`ending`&&zn(t?{activeIndex:e,type:zt.current?_:l}:{activeIndex:e})}}),lr=L.useMemo(()=>he(cr.reference,{onKeyDown(e){E&&X.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},sr.reference,or.reference,ar.reference),[cr.reference,sr.reference,or.reference,ar.reference,E,X]),ur=L.useMemo(()=>he(Pe,sr.floating),[sr.floating]),dr=L.useMemo(()=>he(cr.floating,ar.floating),[cr.floating,ar.floating]),fr=L.useMemo(()=>{let e=cr.item;return e?{...e,onFocus:void 0}:ye},[cr.item]);X.useContextCallback(`setOpen`,Hn),X.useContextCallback(`setInputValue`,Bn),X.useContextCallback(`setSelectedValue`,Un),X.useContextCallback(`setIndices`,zn),X.useContextCallback(`handleSelection`,Wn),X.useContextCallback(`forceMount`,Rn),X.useContextCallback(`requestSubmit`,Gn),X.useContextCallback(`onOpenChangeComplete`,n),pt(()=>{X.update({inline:Ce,popupProps:ur,listProps:dr,inputProps:lr,triggerProps:In,itemProps:fr})});let pr={id:nt,selectedValue:G,open:q,mounted:Mn,transitionStatus:Pn,items:at,inline:Ce,popupProps:ur,listProps:dr,inputProps:lr,triggerProps:In,itemProps:fr,openMethod:Fn,selectionMode:y,name:tn,form:w,disabled:en,readOnly:T,required:re,grid:E,virtualized:xe,openOnInputClick:le,itemToStringLabel:st,modal:Te,autoHighlight:W,isItemEqualToValue:P,submitOnItemClick:Ne,hasInputValue:rn};M(()=>{X.update({...pr,inputOwnsFormValue:y===`none`&&(Ce||!X.state.inputInsidePopup)})},[X,...Object.values(pr)]);let mr=_e(ie,Xe.inputRef),hr=L.useMemo(()=>({query:J,hasItems:U,filteredItems:_n,flatFilteredValues:Y}),[J,U,_n,Y]),gr=L.useMemo(()=>Array.isArray(vn)?``:Rt(vn,N),[vn,N]),_r=H&&Array.isArray(G)&&G.length>0,vr=H||y===`none`&&kn?void 0:tn,yr=L.useMemo(()=>!H||!Array.isArray(G)||!tn?null:G.map(e=>{let t=Rt(e,N);return(0,R.jsx)(`input`,{type:`hidden`,form:w,name:tn,value:t,disabled:en},t)}),[H,G,w,tn,N,en]),br=(0,R.jsxs)(L.Fragment,{children:[e.children,(0,R.jsx)(`input`,{...Xe.getValidationProps(en,{onFocus(){if(Q){En?.focus();return}(V.current||En)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||en||T)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=g(i,e.nativeEvent),a=()=>Yt.current.findIndex(e=>Rt(e,N).toLowerCase()===n||lt(e).toLowerCase()===n);function o(){if(H)return;if(y===`none`){Bn(t,r);return}let e=a();e===-1&&(e=Yt.current.findIndex((e,t)=>{let r=Ct.current[t];return r!=null&&r.toLowerCase()===n}));let i=e===-1?void 0:Yt.current[e];i!=null&&Un?.(i,r)}nn&&(Rn(),I&&a()===-1&&X.set(`forceMounted`,!0)),queueMicrotask(o)}}),id:nt&&vr==null?`${nt}-hidden-input`:void 0,form:w,name:vr,autoComplete:Ae,disabled:en,required:re&&!_r,readOnly:T,value:gr,ref:mr,style:vr?f:u,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),yr]});return(0,R.jsx)(ht.Provider,{value:X,children:(0,R.jsx)(gt.Provider,{value:tr,children:(0,R.jsx)(vt.Provider,{value:U,children:(0,R.jsx)(_t.Provider,{value:hr,children:(0,R.jsx)(yt.Provider,{value:K,children:br})})})})})}var en=`data-popup-side`,tn=`data-list-empty`,H={...De,...it,popupSide:e=>e?{[en]:e}:null,listEmpty:e=>e?{[tn]:``}:null};function nn(e){return e==null?void 0:`${e}-label`}function rn(e,t){return e??t}function U(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function an(){return bt().filteredItems.length===0}function W(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function G(e,t){let n=e>=t-1?t-2:e;return n>=0?n:void 0}function on(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var sn=L.forwardRef(function(e,t){let{render:n,className:a,nativeButton:o=!0,disabled:c=!1,id:l,style:u,...d}=e,{state:f,disabled:m,setTouched:h,setFocused:_,validationMode:ee,validation:v}=Qe(),{labelId:y}=rt(),b=z(),x=b.useState(`selectionMode`),C=b.useState(`disabled`),w=b.useState(`readOnly`),te=b.useState(`required`),T=b.useState(`positionerElement`),ne=b.useState(`listElement`),re=b.useState(`popupId`),ae=b.useState(`triggerProps`),D=b.useState(`inputInsidePopup`),oe=b.useState(`id`),O=b.useState(`labelId`),ce=b.useState(`open`),le=b.useState(`selectedValue`),ue=b.useState(`activeIndex`),de=b.useState(`selectedIndex`),k=b.useState(`hasSelectedValue`),fe=B(),pe=xt(),me=E(),j=m||C||c,M=an(),he
1=U(b);tt({id:D?l:void 0});let ge=D?l??oe:l,_e=rn(y,O),ve;ce&&D?ve=re??Ht(oe):ce&&(ve=ne?.id);let ye=L.useRef(``);function be(e){ye.current=e.pointerType}let{reference:P}=Ge(fe,{enabled:!ce&&!w&&!C&&x===`single`,listRef:b.context.labelsRef,activeIndex:ue,selectedIndex:de,onMatch(e){let t=b.context.valuesRef.current[e];t!==void 0&&b.context.setSelectedValue(t,g(i))}}),{reference:Se}=He(fe,{enabled:!C,event:`mousedown`}),{buttonRef:Ce,getButtonProps:we}=xe({native:o,disabled:j}),Te={...f,readOnly:w,open:ce,disabled:j,popupSide:he,listEmpty:M,placeholder:x!==`none`&&!k},Ee=A(e=>{b.set(`triggerElement`,e)});return N(`button`,e,{ref:[t,Ce,Ee],state:Te,props:[ae,Se,P,{id:ge,tabIndex:D?0:-1,role:D?`combobox`:void 0,"aria-expanded":ce,"aria-haspopup":D?`dialog`:`listbox`,"aria-controls":ve,"aria-required":D&&te||void 0,"aria-readonly":D&&w||void 0,"aria-labelledby":_e,onPointerDown:be,onPointerEnter:be,onFocus(){_(!0),!j&&me.start(0,b.context.forceMount)},onBlur(e){if(!p(T,e.relatedTarget)&&(h(!0),_(!1),ee===`onBlur`)){let e=x===`none`?pe:le;v.commit(e)}},onMouseDown(e){if(j||(D||fe.set(`domReferenceElement`,e.currentTarget),b.context.forceMount(),ye.current!==`touch`&&(b.context.inputRef.current?.focus(),D||e.preventDefault()),ce))return;let t=S(e.currentTarget);function n(e){let t=b.state.triggerElement;if(!t)return;let n=s(e),r=b.state.positionerElement,i=b.state.listElement;p(t,n)||p(r,n)||p(i,n)||qe(e,t)||b.context.setOpen(!1,g(ie,e))}D&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(r(e),b.context.setOpen(!0,g(se,e.nativeEvent)),b.context.inputRef.current?.focus())}},v.getValidationProps(j,d),we],stateAttributesMapping:H})}),cn=L.createContext(void 0);function K(){return L.useContext(cn)}var ln=L.createContext(void 0);function q(e){let t=L.useContext(ln);if(t===void 0&&!e)throw Error(ve(21));return t}var un=L.forwardRef(function(e,t){let n=z(),{buttonRef:r,getButtonProps:i}=xe({native:!1}),a=_e(t,r);function o(e){n.context.setOpen(!1,g(T,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,R.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:f})}),dn=L.forwardRef(function(e,t){let{render:n,className:a,disabled:o=!1,id:s,style:c,...u}=e,{state:d,disabled:f,setTouched:p,setFocused:h,validationMode:ee,validation:v}=Qe(),{labelId:b}=rt(),S=K(),C=!!q(!0),w=z(),te=xt(),T=ke(),ne=w.useState(`required`),ie=w.useState(`disabled`),E=w.useState(`readOnly`),ae=w.useState(`name`),oe=w.useState(`form`),O=w.useState(`selectionMode`),se=w.useState(`autoHighlight`),ce=w.useState(`inputProps`),le=w.useState(`triggerProps`),ue=w.useState(`open`),de=w.useState(`mounted`),k=w.useState(`selectedValue`),fe=w.useState(`id`),pe=w.useState(`inline`),me=w.useState(`modal`),j=!!se,M=U(w),he=f||ie||o,ge=an(),_e=C||pe,ve=!_e||me,ye=Ie(s??(_e?void 0:fe)),be=C?et:d,[P,xe]=L.useState(null),Se=L.useRef(!1),Ce=L.useRef(null),we=L.useRef(!1),Te=O===`none`&&!C,Ee=A(e=>{let t=C||w.state.inline;t&&!w.state.hasInputValue&&w.context.setInputValue(``,g(i)),w.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:Te})}),De=C?u:v.getValidationProps(he,u);function Oe(){w.context.setIndices({activeIndex:null,selectedIndex:null,type:w.context.keyboardActiveRef.current?_:l})}function Ae(){w.context.keyboardActiveRef.current=!1}let je={...be,open:ue,disabled:he,readOnly:E,popupSide:M,listEmpty:ge};function Me(e){if(!S)return;let t,{highlightedChipIndex:n}=S,r=S.chipsRef.current.length,[i,a]=W(T);return n===void 0?(e.key===i&&(e.currentTarget.selectionStart??0)===0&&k.length>0&&(e.preventDefault(),t=r>0?r-1:void 0),t):(e.key===i?(e.preventDefault(),t=n>0?n-1:void 0):e.key===a?(e.preventDefault(),t=n<r-1?n+1:void 0):(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),t=G(n,k.length),Oe()),t)}let Ne=N(`input`,e,{state:je,ref:[t,w.context.inputRef,Ee],props:[ce,le,{value:P??te,"aria-readonly":E||void 0,"aria-required":ne||void 0,"aria-labelledby":b,disabled:he,readOnly:E,required:O===`none`?ne:void 0,form:oe,...Te&&ae&&{name:ae},id:ye,onFocus(){if(h(!0),!pe||!we.current)return;we.current=!1;let e=Ce.current;e!=null&&Object.hasOwn(w.context.valuesRef.current,e)&&w.context.setIndices({activeIndex:e})},onBlur(){p(!0),h(!1);let e=w.state.activeIndex;if(pe&&e!==null&&se!==`always`&&(Ce.current=e,we.current=!0,w.context.setIndices({activeIndex:null}
1)),ee===`onBlur`){let e=O===`none`?te:k;v.commit(e)}},onCompositionStart(e){re||(Se.current=!0,xe(e.currentTarget.value))},onCompositionEnd(e){Se.current=!1;let t=e.currentTarget.value;xe(null),w.context.setInputValue(t,g(x,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=Se.current||!r;function a(e){!E&&!he&&e&&i&&(w.context.setOpen(!0,g(x,t)),j||Oe())}if(Se.current){let n=e.currentTarget.value;xe(n),n===``&&!w.state.openOnInputClick&&!w.state.inputInsidePopup&&w.context.setOpen(!1,g(m,t));let r=n.trim(),i=j&&r!==``;a(r),ue&&w.state.activeIndex!==null&&!i&&Oe();return}let o=g(x,t);if(w.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=g(m,t);s&&!w.state.inputInsidePopup&&(O===`single`&&w.context.setSelectedValue(null,c),w.state.openOnInputClick||w.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),ue&&w.state.activeIndex!==null&&!j&&Oe()},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(w.context.keyboardActiveRef.current=!0,he||E){E&&e.key===`Enter`&&ue&&w.state.activeIndex!==null&&r(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,a=T===`rtl`;if(e.key===`Home`){r(e);let n=D&&a?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){r(e);let i=D&&a?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=a?-n:n;return}if(!de&&e.key===`Escape`){let t=O===`multiple`&&Array.isArray(k)?k.length===0:k===null,n=g(y,e.nativeEvent),r=O===`multiple`?[]:null;w.context.setInputValue(``,n),w.context.setSelectedValue(r,n),!t&&!w.state.inline&&!n.isPropagationAllowed&&e.stopPropagation();return}if(S&&e.key===`Backspace`&&t.value===``&&S.highlightedChipIndex===void 0&&Array.isArray(k)&&k.length>0){let t=S.chipsRef.current.length,n=t>0?t-1:k.length-1,r=k.filter((e,t)=>t!==n);Oe(),w.context.setSelectedValue(r,g(i,e.nativeEvent));return}let o=S?.highlightedChipIndex!==void 0,s=Me(e);if(S?.setHighlightedChipIndex(s),s===void 0?o&&w.context.inputRef.current?.focus():S?.chipsRef.current[s]?.focus(),e.which!==229&&e.key===`Enter`&&ue){let t=w.state.activeIndex,n=e.nativeEvent;if(t===null){if(pe)return;w.context.setOpen(!1,g(i,n));return}r(e),on(w,t,n)}},onPointerMove:Ae,onPointerDown:Ae},De],stateAttributesMapping:H}),Pe=C?(0,R.jsx)(F.Provider,{value:nt,children:Ne}):Ne;return(0,R.jsxs)(L.Fragment,{children:[ue&&ve&&(0,R.jsx)(un,{ref:w.context.startDismissRef}),Pe]})}),J={...o,...Te},fn=L.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...u}=e,{disabled:d}=Qe(),f=z(),p=f.useState(`selectionMode`),m=f.useState(`disabled`),h=f.useState(`readOnly`),v=f.useState(`open`),y=f.useState(`selectedValue`),b=f.useState(`hasSelectionChips`),x=xt(),S=!1;S=p===`none`?x!==``:p===`single`?y!=null:b;let C=d||m||i,{buttonRef:w,getButtonProps:te}=xe({native:a,disabled:C}),{mounted:T,transitionStatus:ne,setMounted:re}=Re(S),ie={disabled:C,visible:S,open:v,transitionStatus:ne};c({open:S,ref:f.context.clearRef,onComplete(){S||re(!1)}});let E=N(`button`,e,{state:ie,ref:[t,w,f.context.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(C||h)return;let t=f.context.keyboardActiveRef.current?_:l;f.context.setInputValue(``,g(ee,e.nativeEvent)),p===`none`?f.context.setIndices({activeIndex:null,type:t}):(f.context.setSelectedValue(Array.isArray(y)?[]:null,g(ee,e.nativeEvent)),f.context.setIndices({activeIndex:null,selectedIndex:null,type:t})),f.context.inputRef.current?.focus()}},u,te],stateAttributesMapping:J});return o||T?E:null}),pn=L.createContext(null);function mn(){return L.useContext(pn)}function hn(e){let{children:t,items:n}=e,r=L.useMemo(()=>({items:n}),[n]);return(0,R.jsx)(pn.Provider,{value:r,children:t})}function gn(e){let{children:t}=e,{filteredItems:n}=bt(),r=mn(),i=r?r.items:n;return(0,R.jsx)(L.Fragment,{children:i.map(t)})}var _n=L.forwardRef(function(e,t){var n;let{render:i,className:a,style:o,children:s,...c}=e,l=z(),u=B(),d=!!q(!0),{filteredItems:f,hasItems:p}=bt(),m=l.useState(`selectionMode`),h=l.useState(`grid`),g=l.useState(`readOnly`),_=l.useState(`listProps`),ee=l.useState(`virtualized`),v=l.useState(`forceMounted`),y=m===`multiple`,b=f.length===0,x=A(e=>
1{l.set(`positionerElement`,e)}),S=A(e=>{l.set(`listElement`,e)}),C=L.useMemo(()=>typeof s==`function`?n||=(0,R.jsx)(gn,{children:s}):s,[s]),w={empty:b},te=u.useState(`floatingId`),T=N(`div`,e,{state:w,ref:[t,S,d?null:x],props:[_,{children:C,tabIndex:-1,id:te,role:h?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!h&&g?!0:void 0,onKeyDown(e){if(!(l.state.disabled||l.state.readOnly)&&e.key===`Enter`){let t=l.state.activeIndex;if(t==null)return;r(e),on(l,t,e.nativeEvent)}},onKeyDownCapture(){l.context.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.context.keyboardActiveRef.current=!1}},c]});if(ee)return T;let ne=p&&!v?void 0:l.context.labelsRef;return(0,R.jsx)(Ye,{elementsRef:l.context.listRef,labelsRef:ne,children:T})}),Y=`â `;function X(e){let t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=null;for(;t.nextNode();){let e=t.currentNode;e.nodeValue!==``&&(n=e)}return n}function vn(){let e=E(),t=L.useRef(null);return L.useEffect(()=>{if(C)return;let n=t.current;if(n==null)return;let r=X(n);if(r==null)return;let i=r.data,a=`${i}${Y}`;return r.nodeValue=a,e.start(200,()=>{r.nodeValue===a&&(r.nodeValue=i)}),()=>{e.clear(),r.nodeValue===a&&(r.nodeValue=i)}},[t,e]),t}var yn=L.createContext(void 0);function bn(){let e=L.useContext(yn);if(e===void 0)throw Error(ve(20));return e}var xn=L.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=z(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,R.jsx)(yn.Provider,{value:n,children:(0,R.jsx)(ae,{ref:t,...r})}):null}),Sn=L.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:f=`clipping-ancestors`,collisionPadding:p,arrowPadding:m,sticky:
1h,disableAnchorTracking:g=!1,collisionAvoidance:_=a,style:ee,...v}=e,y=z(),b=B(),x=bn(),S=y.useState(`modal`),C=y.useState(`open`),w=y.useState(`mounted`),te=y.useState(`openMethod`),T=y.useState(`positionerElement`),ne=y.useState(`triggerElement`),re=y.useState(`inputElement`),ie=y.useState(`inputGroupElement`),E=y.useState(`inputInsidePopup`),ae=y.useState(`transitionStatus`),D=an(),oe=je({anchor:i??(E?ne:ie??re),floatingRootContext:b,positionMethod:o,mounted:w,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:m,collisionBoundary:f,collisionPadding:p,sticky:h,disableAnchorTracking:g,keepMounted:x,collisionAvoidance:_,lazyFlip:!0});We(C&&S,te===`touch`,T,ne);let O={open:C,side:oe.side,align:oe.align,anchorHidden:oe.anchorHidden,empty:D};M(()=>{y.set(`popupSide`,oe.side)},[y,oe.side]);let se=A(e=>{y.set(`positionerElement`,e)}),ce=Ne(e,O,{styles:oe.positionerStyles,transitionStatus:ae,props:v,refs:[t,se],hidden:!w,inert:!C});return(0,R.jsxs)(ln.Provider,{value:oe,children:[w&&S&&(0,R.jsx)(Be,{inert:d(!C),cutout:ie??re??ne}),ce]})}),Cn={...Ee,...o},wn=L.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...l}=e,u=z(),d=q(),f=B(),m=u.useState(`mounted`),h=u.useState(`open`),g=u.useState(`openMethod`),_=u.useState(`popupProps`),ee=u.useState(`transitionStatus`),v=u.useState(`inputInsidePopup`),y=u.useState(`inputElement`),b=u.useState(`modal`),x=u.useState(`id`),S=an(),C=l.id??(v?Ht(x):void 0);M(()=>(u.set(`popupId`,u.context.popupRef.current?.id||C),()=>{u.set(`popupId`,void 0)}),[u,C]),c({open:h,ref:u.context.popupRef,onComplete(){h&&u.context.onOpenChangeComplete(!0)}});let w={open:h,side:d.side,align:d.align,anchorHidden:d.anchorHidden,transitionStatus:ee,empty:S},te=N(`div`,e,{state:w,ref:[t,u.context.popupRef],props:[_,{id:C,role:v?`dialog`:`presentation`,onFocus(e){let t=s(e.nativeEvent);g!==`touch`&&(p(u.state.listElement,t)||t===e.currentTarget)&&u.context.inputRef.current?.focus()}},Fe(ee),l],stateAttributesMapping:Cn}),T=a===void 0?v?e=>e===`touch`?u.context.popupRef.current:y:!1:a,ne;ne=o??(v?void 0:!1);let re=!v||b;return(0,R.jsx)(ze,{context:f,disabled:!m,modal:re,openInteractionType:g,initialFocus:T,returnFocus:ne,getInsideElements:()=>[u.context.startDismissRef.current,u.context.endDismissRef.current],children:(0,R.jsxs)(L.Fragment,{children:[te,re&&(0,R.jsx)(un,{ref:u.context.endDismissRef})]})})}),Tn=L.createContext(void 0);function En(){let e=L.useContext(Tn);if(e===void 0)throw Error(ve(18));return e}var Dn=L.forwardRef(function(e,t){let{render:n,className:r,style:i,items:a,...o}=e,s=z().useState(`grid`),[c,l]=L.useState(),u=L.useMemo(()=>({labelId:c,setLabelId:l,items:a}),[c,l,a]),d=N(`div`,e,{ref:t,props:[{role:s?`rowgroup`:`group`,"aria-labelledby":c},o]}),f=(0,R.jsx)(Tn.Provider,{value:u,children:d});return a?(0,R.jsx)(hn,{items:a,children:f}):f}),On=L.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,{setLabelId:s}=En(),c=Ie(a);return M(()=>(s(c),()=>{s(e=>e===c?void 0:e)}),[c,s]),N(`div`,e,{ref:t,props:[{id:c,"aria-hidden":!0},o]})}),Z=L.createContext(void 0);function Q(){let e=L.useContext(Z);if(!e)throw Error(ve(19));return e}var kn=L.createContext(!1);function An(){return L.useContext(kn)}function jn(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=L.useRef(null),m=Xe({guess:!0,index:l,textRef:p}),h=z(),g=An(),_=St(),ee=h.useState(`selectionMode`),v=h.useState(`disabled`),y=h.useState(`readOnly`),b=h.useState(`isItemEqualToValue`),x=v||u,S=ee!==`none`,C=l??i??m.index,w=C!==-1,te=h.useState(`id`),T=h.useState(`isActive`,C),ne=h.useState(`isSelected`,c),re=h.useState(`itemProps`),ie=L.useRef(null),E=te!=null&&w?`${te}-${C}`:void 0,ae=ne&&S;M(()=>
1{if(!w||!r&&l==null)return;let e=h.context.listRef.current;return e[C]=ie.current,()=>{delete e[C]}},[w,r,C,l,h]),M(()=>{if(!w||_)return;let e=h.context.valuesRef.current;return e[C]=c,()=>{delete e[C]}},[w,_,C,c,h]),M(()=>{if(!w||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=V(C,c,h.context.valuesRef.current,e,b,t):Tt(c,e,b)&&(t=C),h.set(`selectedIndex`,t)},[w,_,h,C,c,b]);let{getButtonProps:D,buttonRef:oe}=xe({disabled:x,focusableWhenDisabled:!0,native:d,composite:!0}),O={disabled:x,selected:ae,highlighted:T};function se(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(ut.flushSync(t),h.context.requestSubmit()):t()}let ce={id:E,role:g?`gridcell`:`option`,"aria-selected":S?ae:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){x||y||se(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(x||y||e.button!==0||t||!T)&&se(e.nativeEvent)}},le=N(`div`,t,{ref:[oe,n,m.ref,ie],state:O,props:[re,ce,f,D]}),ue=L.useMemo(()=>({selected:ae,textRef:p}),[ae,p]);return(0,R.jsx)(Z.Provider,{value:ue,children:le})}function Mn(e){let{componentProps:t,forwardedRef:n}=e,r=z().useState(`isItemEqualToValue`),{flatFilteredValues:i}=bt(),a=Ot(i,t.value??null,r);return(0,R.jsx)(jn,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var Nn=L.memo(L.forwardRef(function(e,t){let n=z().useState(`virtualized`);return n&&e.index==null?(0,R.jsx)(Mn,{componentProps:e,forwardedRef:t}):(0,R.jsx)(jn,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})})),Pn=L.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{filteredItems:s}=bt(),c=z(),l=vn(),u=s.length===0?a:null;return N(`div`,e,{ref:[t,c.context.emptyRef,l],props:[{children:u,role:`status`,"aria-live":`polite`,"aria-atomic":!0},o]})});function Fn(e){let{multiple:t=!1,defaultValue:n,value:r,onValueChange:i,autoComplete:a,...o}=e;return(0,R.jsx)($t,{...o,selectionMode:t?`multiple`:`single`,selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:i,formAutoComplete:a})}function In(e){let{children:t,placeholder:n}=e,r=z(),i=r.useState(`itemToStringLabel`),a=r.useState(`selectedValue`),o=r.useState(`items`),s=r.useState(`selectionMode`)===`multiple`,c=r.useState(`hasSelectedValue`),l=!c&&n!=null&&t==null,u=r.useState(`hasNullItemLabel`,l),d=null;return d=typeof t==`function`?t(a):t??(!c&&n!=null&&!u?n:s&&Array.isArray(a)?Bt(a,o,i):zt(a,o,i)),(0,R.jsx)(L.Fragment,{children:d})}var Ln=L.forwardRef(function(e,t){let{selected:n}=Q();return e.keepMounted||n?(0,R.jsx)(Rn,{...e,ref:t}):null}),Rn=L.memo(L.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...s}=e,{selected:l}=Q(),u=L.useRef(null),{transitionStatus:d,setMounted:f}=Re(l),p=N(`span`,e,{ref:[t,u],state:{selected:l,transitionStatus:d},props:[{"aria-hidden":!0,children:`âï¸`},s],stateAttributesMapping:o});return c({batch:!0,enabled:!l,open:l,ref:u,onComplete(){l||f(!1)}}),p})),$=le(),zn=Fn,Bn=Yt;function Vn(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(In,{"data-slot":`combobox-value`,...n}),t[2]=n,t[3]=r),r}function Hn(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=k(`[&_svg:not([class*='size-'])]:size-4`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,R.jsx)(ue,{className:`pointer-events-none size-4 text-muted-foreground`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,R.jsxs)(sn,{"data-slot":`combobox-trigger`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Un(e){let t=(0,$.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,R.jsx)(st,{variant:`ghost`,size:`icon-xs`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=k(n),t[4]=n,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,R.jsx)(h,{className:`pointer-events-none`}),t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,R.jsx)(fn,{"data-slot":`combobox-clear`,render:i,className:a,...r,children:o}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}function Wn({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:i=!1,...a}){return(0,R.jsxs)(ct,{className:k(`w-auto`,e),children:[(0,R.jsx)(dn,{render:(0,R.jsx)(at,{disabled:n}),...a}
1),(r||i)&&(0,R.jsxs)(ot,{align:`inline-end`,children:[r&&(0,R.jsx)(st,{size:`icon-xs`,variant:`ghost`,render:(0,R.jsx)(Hn,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:n}),i&&(0,R.jsx)(Un,{disabled:n})]}),t]})}function Gn({className:e,side:t=`bottom`,sideOffset:n=6,align:r=`start`,alignOffset:i=0,anchor:a,...o}){return(0,R.jsx)(xn,{children:(0,R.jsx)(Sn,{side:t,sideOffset:n,align:r,alignOffset:i,anchor:a,className:`isolate z-50`,children:(0,R.jsx)(wn,{"data-slot":`combobox-content`,"data-chips":!!a,className:k(`group/combobox-content relative max-h-(--available-height) w-fit min-w-[calc(var(--anchor-width)+--spacing(7))] max-w-(--available-width) origin-(--transform-origin) overflow-hidden rounded-lg bg-popover/70 text-popover-foreground shadow-md ring-1 ring-foreground/10 transition-[opacity,scale] duration-150 ease-(--ease-out-strong) before:pointer-events-none before:absolute before:inset-0 before:-z-1 before:rounded-[inherit] before:backdrop-blur-2xl before:backdrop-saturate-150 data-[chips=true]:min-w-(--anchor-width) data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:duration-100 **:data-[slot$=-item]:data-highlighted:bg-foreground
1/10 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-9 *:data-[slot=input-group]:border-input/30 **:data-[slot$=-separator]:bg-foreground/5 *:data-[slot=input-group]:bg-input/30 **:data-[variant=destructive]:**:text-accent-foreground! **:data-[variant=destructive]:text-accent-foreground! *:data-[slot=input-group]:shadow-none **:data-[slot$=-trigger]:aria-expanded:bg-foreground/10! **:data-[slot$=-item]:focus:bg-foreground/10 **:data-[slot$=-trigger]:focus:bg-foreground/10 **:data-[variant=destructive]:focus:bg-foreground/10!`,e),...o})})})}function Kn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=k(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(_n,{"data-slot":`combobox-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function qn(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=k(`relative flex w-full cursor-default select-none items-center gap-2 rounded-md py-1 ps-1.5 pe-8 text-sm outline-hidden data-disabled:pointer-events-none data-highlighted:bg-accent data-highlighted:text-accent-foreground data-disabled:opacity-50 not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,R.jsx)(Ln,{render:(0,R.jsx)(`span`,{className:`pointer-events-none absolute inset-e-2 flex size-4 items-center justify-center`}),children:(0,R.jsx)(de,{className:`pointer-events-none`})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,R.jsxs)(Nn,{"data-slot":`combobox-item`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function Jn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=k(n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(Dn,{"data-slot":`combobox-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Yn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=k(`px-2 py-1.5 text-muted-foreground text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(On,{"data-slot":`combobox-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Xn(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(gn,{"data-slot":`combobox-collection`,...n}),t[2]=n,t[3]=r),r}function Zn(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=k(`hidden w-full justify-center py-2 text-center text-muted-foreground text-sm group-data-empty/combobox-content:flex`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(Pn,{"data-slot":`combobox-empty`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Qn=e=>(0,R.jsx)(qn,{value:e,disabled:e.disabled,children:e.label},String(e.value)),$n=e=>(0,R.jsxs)(Jn,{items:e.items,children:[e.label!==null&&e.label!==void 0?(0,R.jsx)(Yn,{children:e.label}):null,(0,R.jsx)(Xn,{children:Qn})]},e.key);function er(e){let{options:t,multiple:n=!1,disabled:r=!1,showClear:i=!1,placeholder:a,searchPlaceholder:o,emptyMessage:s,className:c,id:l,name:u,render:d}=e,{contains:f}=Bn(),p=L.useMemo(()=>new Map(t.map(e=>[String(e.value),e])),[t]),m=L.useMemo(()=>{let e=[],n=new Map,r=null,i=!1;for(let a of t){if(a.group===void 0){r||(r={key:`ungrouped`,value:``,label:null,items:[]},e.push(r)),r.items.push(a);continue}i=!0;let t=typeof a.group==`string`?{value:a.group,label:a.group}:a.group,o=n.get(t.value);o||(o={...t,key:`group:${t.value}`,items:[]},n.set(t.value,o),e.push(o)),o.items.push(a)}return i?e:null},[t]),h=L.useCallback(e=>n?!e||!Array.isArray(e)?[]:e.flatMap(e=>{let t=p.get(String(e));return t?[t]:[]}):e==null?null:p.get(String(e))??null,[p,n]),g=L.useMemo(()=>e.value===void 0?void 0:h(e.value),[e.value,h]),_=L.useMemo(()=>e.defaultValue===void 0?void 0:h(e.defaultValue),[e.defaultValue,h]),ee=L.useCallback(t=>{if(n){let n=Array.isArray(t)?t:t?[t]:[];e.onValueChange?.(n.length>0?n.map(e=>e.value):[])}else{let n=t&&!Array.isArray(t)?t.value:null,r=e.onValueChange;r?.(n??null)}}
1,[e,n]),[v,y]=lt({value:g,defaultValue:_,onChange:ee}),b=L.useCallback(e=>e.textValue??(typeof e.label==`string`?e.label:String(e.value)),[]),x=L.useCallback((e,t)=>String(e.value)===String(t.value),[]),S=L.useCallback((e,t)=>{let n=typeof e.label==`string`?e.label:e.textValue??String(e.value);return f(n,t)?!0:e.keywords?.some(e=>f(e,t))??!1},[f]),C=n?Array.isArray(v)&&v.length>0:v!=null,w=(0,R.jsx)(Hn,{id:l,disabled:r,render:d??(0,R.jsx)(P,{variant:`outline`,className:k(`justify-start text-left font-normal hover:bg-muted/20`,c)}),children:(0,R.jsx)(`span`,{className:k(`min-w-0 flex-1 truncate text-left`,i&&C&&`pe-7`),children:(0,R.jsx)(Vn,{placeholder:a??Ce._({id:`O_7I0o`})})})});return(0,R.jsxs)(zn,{name:u,items:m??t,filter:S,disabled:r,value:v,onValueChange:y,itemToStringLabel:b,isItemEqualToValue:x,...n?{multiple:!0}:{},children:[i?(0,R.jsxs)(`div`,{className:`relative w-full min-w-0`,children:[w,C&&(0,R.jsx)(Un,{"aria-label":Ce._({id:`FBIuPX`}),disabled:r,className:`absolute end-7 top-1/2 z-10 -translate-y-1/2 text-muted-foreground opacity-70 hover:opacity-100 focus-visible:opacity-100`})]}):w,(0,R.jsxs)(Gn,{children:[(0,R.jsx)(Wn,{showTrigger:!1,placeholder:o??a??Ce._({id:`YIix5Y`}),render:(0,R.jsx)(I,{disabled:r,className:`border-none focus-visible:border-none focus-visible:ring-0`})}),(0,R.jsx)(Zn,{children:s??Ce._({id:`MZbQHL`})}),(0,R.jsx)(Kn,{children:m?$n:Qn})]})]})}export{Ct as a,Gt as i,nn as n,rn as r,er as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.