1try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`7456b9a4-aa43-4b50-9c12-eeeeff70a1e6`,e._sentryDebugIdIdentifier=`sentry-dbid-7456b9a4-aa43-4b50-9c12-eeeeff70a1e6`)}catch{}import{o as e}from"./_sentry-release-injection-file-BIr0W1zm.js";import{n as t,t as n}from"./jsx-runtime-zj0ecbIi.js";import{t as r}from"./_baseIsEqual-B-3o87J9.js";import{A as i,C as a,N as o,o as s,t as c}from"./icon-0N4IT-9A-C9RTZSFF.js";import{t as l}from"./clsx-BOYpCVEp.js";import{t as u}from"./spinner-BYUvV30h-BZM10UIm.js";import{t as ee}from"./inline-stack-rdHU7il3-B6foOU35.js";import{o as d}from"./text-field-VL8P-7Zp-BpXWdHf_.js";import{t as te}from"./vanilla-extract-dynamic.esm-BAuagCvO.js";import{i as ne,n as re,r as ie,t as ae}from"./footer-B1koh-09-C7KEa3D0.js";import{A as oe,E as se,F as ce,I as le,M as ue,O as f,P as de,R as fe,S as pe,_ as me,d as p,g as he,h as ge,l as m,p as _e,v as h,w as ve}from"./portal-kQkfG3hE-D3Mki3Dc.js";import{A as ye,Ct as be,D as g,E as xe,M as Se,O as Ce,St as we,Tt as Te,_ as Ee,a as De,b as Oe,c as ke,d as Ae,et as je,f as Me,g as Ne,i as _,j as Pe,k as Fe,l as Ie,m as Le,o as v,p as Re,r as ze,s as y,t as b,u as Be,v as x,wt as S,x as Ve,y as C}from"./select.utils-Cn6KAhjA-CoH70XCY.js";import{a as He}from"./overlays-23B-WmXX-EMk_dnhZ.js";import{t as Ue}from"./yield-Il3yZbU6-DdFCr4rQ.js";import{a as We,c as w,o as Ge,r as Ke,s as qe,t as Je}from"./popover-CjxSO-UI-N6rVOJsj.js";import{t as Ye}from"./stack-BK_reuuA-B8iGEgst.js";import{t as T}from"./tag-t1jdqsKR-DHN8oQwB.js";import{c as Xe,o as Ze}from"./scrollable.css-XPQUJtyC-BUl6tKIP.js";function Qe(e,t){return r(e,t)}var E=e(t()),D=n(),$e=E.forwardRef(function(e,t){let{options:n=[],onDeselect:r,className:i,...a}=e,{restProps:s,sprinkleProps:c}=o(a,g),u=(0,E.useContext)(Je),d=u?.props?.canWrap??!1,te=u?.props?.size===`sm`;return(0,D.jsx)(Ye,{className:l(Xe.classNames.base,Ze,i),ref:t,overflow:`hidden`,alignBlock:`center`,py:te?`050`:`075`,...s,...c,children:(0,D.jsx)(ee,{alignBlock:`center`,gap:`050`,wrap:d,children:(n??[]).map(e=>(0,D.jsx)(T,{onDelete:()=>{r?.(e.value)},unsafe_withSpanDeleteButton:!0,unsafe_withDeleteButtonMouseDownStopPropagation:!0,whiteSpace:`nowrap`,flexShrink:`0`,isCompact:te,children:e.label},e.value))})})});$e.displayName=`PlumaSelectSelectedValueMulti`;function et(e){let t=s(),{isDisabled:n=!1,size:r,isSearchable:i=!1,searchInputValue:o,onSearchInput:c,isLoadingMore:l,shouldLoadMore:u,onLoadMore:ee,isOpen:d,defaultIsOpen:te,onOpenChange:ne,onOpen:re,onCloseComplete:ie,menuAnimationTransitionDuration:ae=t?.componentConfig?.PlumaSelect?.menuAnimationTransitionDuration??125,value:p=null,onChange:h=()=>{},onActiveChange:ye,options:be=[],isMulti:g=!1,optionComponent:xe=Ke,optionItemComponent:Se,iconComponent:we,valueComponent:Te,searchPlaceholder:je,searchAriaLabel:Pe,withTruncatedTooltip:Fe=!1,withVirtualizer:S=!1,virtualizerOptions:Ve,headerComponent:Ye,beforeOptionsComponent:T,footerComponent:Xe,paletteTitle:Ze,paletteHeaderMetaComponent:et,withPaletteCloseButton:O,onPaletteClose:tt,paletteHeaderComponent:nt,paletteCategories:rt,activePaletteCategoryId:k,defaultActivePaletteCategoryId:it,onPaletteCategoryChange:at,paletteCategoriesComponent:ot,paletteDetailComponent:st,paletteFooterComponent:ct,children:lt,middlewareOptions:ut,additionalMiddleware:dt,withCreate:A=!1,onCreate:ft,createOptionLabel:j,canCreateNewOption:M,showCreateOptionWhenEmpty:pt=!1,unsafe_initialSearchValue:mt,canWrap:ht=!1,unsafe_popoverClassName:gt,unsafe_popoverStyle:_t,unsafe_popoverSize:vt}=e,yt=(0,E.useRef)(d!=null),[bt,xt]=(0,E.useState)(te??!1),St=(0,E.useCallback)(e=>{yt.current||xt(e),ne?.(e)},[ne,xt]),N=yt.current?d??!1:bt,Ct=Te??(g?$e:Ke),P=(0,E.useMemo)(()=>b(be,{withCreate:A}),[be,A]),[wt,F]=(0,E.useState)(y(P,p)),I=(0,E.useMemo)(()=>Ie(P,p,wt),[P,p,wt]),Tt=w(I),L=o==null&&c==null,R=[...I.values()].some(e=>e===!0),z=(0,E.useMemo)(()=>Le(P),[P]),Et=(0,E.useMemo)(()=>Re(P),[P]),Dt=(0,E.useMemo)(()=>ke(P,I),[P,I]),B=(0,E.useMemo)(()=>v(P),[P]),V=(0,E.useMemo)(()=>Oe(p),[p]),Ot=w(V),H=(0,E.useMemo)(()=>ze(P,B,z,Dt,{withCreate:A,createOptionLabel:j,canCreateNewOption:M,showCreateOptionWhenEmpty:pt}),[P,B,z,Dt,A,j,M,pt]),[U,kt]=(0,E.useState)(mt??``),At=w(U),[jt,Mt]=(0,E.useState)(!1),W=o??U,Nt=(0,E.useRef)(W),Pt=(0,E.useRef)(k),Ft=(0,E.useMemo)(()=>!L||a(U)?null:De(P,U,z,I,{withCreate:A,canCreateNewOption:M,createOptionLabel:j}),[L,U,P,z,I,A,M,j]),G=(0,E.useMemo)(()=>!L&&!R||Ft==null?H:Ft,[L,R,H,Ft]);(0,E.useEffect)(()=>{G.groupCollapseState!=null&&jt===!0&&F(G.groupCollapseState),Mt(!1)},[G.groupCollapseState,jt]);let It=(0,E.useMemo)(()=>!L&&!R?H.filteredOptions:i&&!a(U)||R?G.filteredOptions:H.filteredOptions,[H.filteredOptions,L,G.filteredOptions,U,i,R]),Lt=(0,E.useMemo)(()=>
1{if(Array.isArray(V))return V.map(e=>e==null?null:z.meta.get(e)?.index??null);let e=V==null?null:z.meta.get(V)?.index??null;return e==null?[]:[e]},[V,z]),Rt=(0,E.useMemo)(()=>Array.isArray(V)||Lt.length===0?null:Lt[0],[V,Lt]),K=(0,E.useMemo)(()=>Me(p),[p]),zt=(0,E.useMemo)(()=>K==null?null:x(K)?K:z.meta.get(K)?.option??null,[K,z]),Bt=(0,E.useMemo)(()=>{if(p==null)return[];let e=[];return e=Array.isArray(p)?p.map(e=>x(e)?e:z.meta.get(e)?.option??null):x(p)?[p]:[z.meta.get(p)?.option??null],e.filter(e=>e!=null)},[p,z.meta]),[q,Vt]=(0,E.useState)(x(K)?K.value:K),Ht=w(q),J=(0,E.useCallback)(e=>{e!==Ht.current&&ye?.(e),Vt(e)},[ye,Vt]),Ut=(0,E.useRef)(q==null?null:z.meta.get(q));(0,E.useEffect)(()=>{Ut.current=q==null?null:z.meta.get(q)},[q,z]);let Wt=(0,E.useMemo)(()=>q==null?null:z.meta.get(q)?.index??null,[q,z]),Gt=(0,E.useRef)(G.filteredOptions),Kt=(0,E.useRef)(G.filteredOptionMeta),qt=(0,E.useRef)([...G.filteredOptionMeta.meta.keys()]),Jt=(0,E.useRef)(!1);(0,E.useEffect)(()=>{Gt.current=G.filteredOptions;let e=Nt.current!==W,t=Pt.current!==k;if(Nt.current=W,Pt.current=k,e&&(Jt.current=o!=null&&!a(W)),G.filteredOptionMeta!==Kt.current){Kt.current=G.filteredOptionMeta;let e=[...G.filteredOptionMeta.meta.keys()],n=!Qe(qt.current,e),r=e.length>qt.current.length&&qt.current.every((t,n)=>t===e[n]);qt.current=e;let s=o!=null&&Jt.current&&n&&!r;o!=null&&Jt.current&&n&&(Jt.current=!1);let c=(e=!1)=>{J((e?Ae:Be)(G.filteredOptions)?.value??null)},l=Ht.current;(o!=null||L||R)&&i&&!a(W)?t||s||l==null?c():G.filteredOptionMeta.meta.get(l)??c():l===_.value&&c(!0)}},[k,o,L,R,i,W,G.filteredOptionMeta,G.filteredOptions]);let Y=(0,E.useCallback)(e=>{F(t=>{let n=new Map(Ie(P,p,t)),r=n.get(e);if(r!=null)n.set(e,!r);else{let t=z.meta.get(e);n.set(e,!(t?.type===`group`&&t.option.defaultIsCollapsed===!0))}return n})},[P,F,p,z]),Yt=(0,E.useCallback)(e=>{kt(e),Mt(!0),a(e)&&L&&F(e=>y(P,p,e))},[L,P,p]),Xt=(0,E.useCallback)(e=>{if(e==null){J(null);return}let t=Et[e];t??J(null),J(t?.value??null)},[J,Et]),Zt=(0,E.useRef)([]);(0,E.useLayoutEffect)(()=>{S&&(Zt.current=[...Array(z.meta.size).fill(null)])},[S,z]);let X=(0,E.useRef)(B);(0,E.useEffect)(()=>{i&&(a(U)||!N?X.current=B:X.current=G.filteredSearchLabels)},[i,U,N,B,G.filteredSearchLabels]);let Qt=(0,E.useCallback)(e=>{e&&(kt(``),F(e=>y(P,p,e)),Ht.current??J(Ae(Gt.current)?.value??null)),St(e)},[kt,St,P,p,J,Ht,Gt]),Z=qe(ut),$t=me(),{refs:Q,floatingStyles:en,context:$}=he({nodeId:$t,placement:`bottom-start`,open:N,onOpenChange:Qt,whileElementsMounted:fe,middleware:[de(Z.offset),oe(Z.autoPlacement),ce(Z.shift),ue(Z.hide),le(He(Z.size,{apply({rects:e,elements:t,availableHeight:n}){let r=Math.min(n,480),i=e.reference.width,a=C({maxHeight:r,minWidth:i},vt);Object.assign(t.floating.style,a)}})),...dt??[]]}),tn=(0,E.useCallback)(e=>{n||Ce(z,e,Ot.current)||(e==null?h(null):e===_.value?ft?.(At.current):h(g?Ne(Ot.current,e,z):e),g||Qt(!1))},[h,Qt,g,ft,z,n]),{getReferenceProps:nn,getFloatingProps:rn}=pe([_e($,{enabled:!n,event:`mousedown`}),ge($,{enabled:!n}),se($,{enabled:!n,role:`listbox`})]),an=(0,E.useCallback)(e=>{e!=null&&Xt(e)},[Xt]),{getReferenceProps:on,getFloatingProps:sn,getItemProps:cn}=pe([ve($,{enabled:!n,listRef:Zt,activeIndex:Wt,selectedIndex:Rt,onNavigate:N?an:void 0,loop:!0,virtual:i,disabledIndices:S?G.disabledOptionIndexArray:void 0}),f($,{enabled:n?!1:i?!N:!0,listRef:X,activeIndex:Wt,selectedIndex:Rt,onMatch:e=>{if(N)Xt(e);else if(e==null)tn(null);else{let t=Et[e];tn(e==null?null:t?.value??null)}}})]),ln=(0,E.useMemo)(()=>({setReference:Q.setReference,getReferenceProps:e=>nn(on(e))}),[Q.setReference,nn,on]),un=(0,E.useMemo)(()=>({setFloating:Q.setFloating,getFloatingProps:e=>{if(!i)return rn(sn(e));let{"aria-activedescendant":t,...n}=rn(sn(e));return n},styles:en}),[Q.setFloating,rn,sn,i,en]),dn=(0,E.useCallback)(e=>{if(Ut.current?.type===`group`){let{value:t}=Ut.current.option;if(Ee(z,t))return;if(e.key===`Enter`&&(e.preventDefault(),Y(t)),Ut.current.option.isCollapsible??!1){let n=Tt.current.get(t)===!0;e.key===`ArrowRight`&&n&&(e.preventDefault(),Y(t)),e.key===`ArrowLeft`&&!n&&(e.preventDefault(),Y(t))}}},[Y,z]),fn=(0,E.useMemo)(()=>({getInputProps:e=>{let t=t=>{let n=dn(t);if(n!==void 0)return n;if(!(t.defaultPrevented??!1)&&e?.onKeyDown!=null)return e.onKeyDown(t)},{onFocus:n,...r}=on({...e,onKeyDown:t});return{...r,onFocus:e?.onFocus??void 0}},searchValue:o??U,onSearchInput:e=>{c==null?Yt(e.target.value):c(e)}}),[on,U,o,c]),pn=(0,E.useMemo)(()=>({elementsRef:Zt,labelsRef:X}),[Zt,X]),mn=(0,E.useMemo)(()=>({getItemProps:cn}),[cn]),hn=(0,E.useMemo)(()=>({selectedValue:V,activeValue:q,handleSelect:tn,options:It,selectedOption:zt,selectedOptions:Bt,o
1ptionMeta:z,filteredOptionMeta:G.filteredOptionMeta,virtualFocus:i,groupCollapseState:I,setGroupCollapseState:F,toggleGroupCollapseState:Y}),[V,q,tn,It,zt,Bt,z,G.filteredOptionMeta,i,I,F,Y]),gn=(0,E.useMemo)(()=>({isSearchable:i,searchPlaceholder:je,searchAriaLabel:Pe,canWrap:ht,menuAnimationTransitionDuration:ae,size:r,optionComponent:xe,optionItemComponent:Se,iconComponent:we,valueComponent:Ct,withTruncatedTooltip:Fe,withVirtualizer:S,virtualizerOptions:Ve,headerComponent:Ye,beforeOptionsComponent:T,footerComponent:Xe,paletteTitle:Ze,paletteHeaderMetaComponent:et,withPaletteCloseButton:O,onPaletteClose:tt,paletteHeaderComponent:nt,paletteCategories:rt,activePaletteCategoryId:k,defaultActivePaletteCategoryId:it,onPaletteCategoryChange:at,paletteCategoriesComponent:ot,paletteDetailComponent:st,paletteFooterComponent:ct,unsafe_popoverClassName:gt,unsafe_popoverStyle:_t}),[i,je,Pe,ht,ae,r,xe,Se,we,Ct,Fe,S,Ve,Ye,T,Xe,Ze,et,O,tt,nt,rt,k,it,at,ot,st,ct,gt,_t]),_n=(0,E.useMemo)(()=>({floatingContext:$,reference:ln,floating:un,searchInput:fn,list:pn,listItem:mn,state:hn,props:gn}),[$,ln,un,fn,pn,mn,hn,gn]);return(0,D.jsxs)(Je.Provider,{value:_n,children:[(0,D.jsx)(Ue,{props:_n,children:lt}),(0,D.jsx)(m,{id:$t,children:(0,D.jsx)(We,{floatingFocusManagerModal:Ge({categories:rt,categoriesComponent:ot,detailComponent:st}),isLoadingMore:l,onLoadMore:ee,shouldLoadMore:u,onOpen:re,onCloseComplete:ie})})]})}function O(e){return h()==null?(0,D.jsx)(p,{children:(0,D.jsx)(et,{...e})}):(0,D.jsx)(et,{...e})}O.displayName=`PlumaSelectController`;var tt=E.forwardRef(function(e,t){return(0,D.jsx)(D.Fragment,{children:(0,D.jsx)(O,{...e,children:(0,D.jsx)(nt,{ref:t,...e})})})});tt.displayName=`PlumaSelect`;var nt=E.forwardRef(function(e,t){let n=(0,E.useContext)(Je),{id:r,label:s,ariaLabel:ee,ariaLabelledby:oe,description:se,ariaDescribedby:ce,error:le,isInvalid:ue,isDisabled:f=!1,withCenterBaseline:de,unsafe_inputClassName:fe,unsafe_labelClassName:pe,unsafe_descriptionClassName:me,unsafe_errorClassName:p,unsafe_footerClassName:he,className:ge,size:m,icon:_e,isLoading:h=!1,name:ve,isMulti:g=!1,isClearable:Ce,elementBefore:Ee,elementAfter:De}=e,Oe=_e!=null||Ee!=null,{restProps:ke,sprinkleProps:Ae}=o(e,xe),{style:Me,...Ne}=ke,{selectedValue:_,selectedOption:Ie,selectedOptions:Le,handleSelect:v}=n.state,Re=Array.isArray(_)?_.join(`,`):_??``,ze=Array.isArray(_)?_.length>0:_!=null,y=Le.length>0,b=n.props.valueComponent,Be=b===Ke,x=Ce===!0,C=f===!0||!ze,He=(0,E.useMemo)(()=>C?-1:0,[C]),Ue=(0,E.useCallback)(()=>{f||v(null)},[f,v]),We=(0,E.useCallback)(e=>{e.stopPropagation()},[]),w=(0,E.useCallback)(e=>{e.stopPropagation(),e.preventDefault()},[]),Ge=(0,E.useCallback)(e=>{e.stopPropagation(),(e.key===`Enter`||e.key===` `)&&Ue()},[Ue]),qe=x?h&&!C:h,Ye=x?h&&C:!1,T=[h].filter(e=>e).length;return(0,D.jsx)(ie,{componentName:`PlumaSelect`,ref:t,id:r,label:s,ariaLabel:ee,ariaLabelledby:oe,description:se,ariaDescribedby:ce,error:le,isInvalid:ue,isDisabled:f,className:ge,withCenterBaseline:de,unsafe_inputClassName:fe,unsafe_labelClassName:pe,unsafe_errorClassName:p,unsafe_descriptionClassName:me,unsafe_footerClassName:he,style:[Me??{},te({[Te]:`${T}`})],...Ne,...Ae,children:({inputProps:t,labelProps:o,footerProps:s})=>(0,D.jsxs)(E.Fragment,{children:[o.shouldShow?(0,D.jsx)(re,{}):null,(0,D.jsxs)(ne,{children:[(0,D.jsxs)(i,{as:`button`,type:`button`,className:l(Ve({...e}),t.className),"aria-disabled":t.isDisabled===!0?!0:void 0,id:t.id,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-describedby":t.ariaDescribedby,"aria-invalid":t.isInvalid,ref:n.reference.setReference,...n.reference.getReferenceProps(),children:[Oe?(0,D.jsxs)(d,{className:Fe,children:[_e==null?null:(0,D.jsx)(c,{name:_e,color:t.isDisabled===!0?`disabled`:`subtle`,size:m===`sm`?`sm`:`md`}),Ee??null]}):null,(0,D.jsx)(i,{className:Se,children:y?g?(0,D.jsx)(b,{options:Le,onDeselect:v}):Be?(0,D.jsx)(b,{option:Ie,optionIconSize:m===`sm`?`sm`:`md`,shouldShowDescription:!1}):(0,D.jsx)(b,{option:Ie,optionIconSize:m===`sm`?`sm`:`md`}):a(e.placeholder)?null:(0,D.jsx)(i,{truncate:!0,children:e.placeholder})}),(0,D.jsxs)(d,{className:ye,children:[qe?(0,D.jsx)(i,{className:Pe,children:(0,D.jsx)(u,{"aria-label":`Loadingâ¦`})}):null,x?(0,D.jsx)(i,{className:C?be:null,children:(0,D.jsx)(i,{role:`button`,className:l(we,je),"aria-label":`Clear field`,"aria-disabled":t.isDisabled===!0?!0:void 0,tabIndex:He,onClick:Ue,onMouseDown:We,onKeyDown:w,onKeyUp:Ge,children:(0,D.jsx)(c,{className:S,name:`close`,size:m===`sm`?`sm`:`md`,role:`presentation`})})}):null,Ye?(0,D.jsx)(i,{className:Pe,children:(0,D.jsx)(u,{"aria-label":`Loadingâ¦`})}):null,De??null,(0,D.jsx)(c,{name:`chevron-down`,color:t.isDisabled===!0?`disabled`:`base`,size:m===`sm`?`sm`:`md`})]})]}),(0,D.jsx)(i,{as:`input`,name:ve,value:Re,readOnly:!0,visuallyHidden:`true`,"aria-hidden":`true`,tabIndex:-1})]}),s.shouldShow?(0,D.jsx)(ae,{}):null]},r)},r)});export{O as n,Qe as r,tt as t}; 2//# sourceMappingURL=select-CkSH9iKm-CUG3Q8g8.js.map
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.