UNPKG

@getontime/cli

Version:

Time keeping for live events

2 lines 49.1 kB
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./Button-legacy-DpgzgT04.js","./useIsSmallScreen-legacy-DavgXfPB.js","./constants-legacy-CvecvM28.js"],function(e,t){var n,r,o,l,i,s,u,c,a,d,f,p,m,g,h,v,b,y,w,x,R,I,_,M,A,T,S,E,C,k,D,O,P,N,V,j,U,F,H,B,L,W,z,q,K,$,Y,G,X,J,Q,Z,ee,te,ne,re,oe,le,ie,se,ue,ce,ae,de,fe,pe,me,ge,he,ve,be,ye,we,xe,Re,Ie,_e,Me,Ae,Te,Se,Ee,Ce,ke,De,Oe,Pe,Ne,Ve,je,Ue,Fe,He,Be,Le,We,ze,qe,Ke,$e,Ye,Ge,Xe,Je,Qe,Ze,et,tt,nt,rt,ot,lt,it,st,ut,ct,at,dt,ft,pt,mt,gt,ht,vt,bt,yt,wt,xt,Rt,It,_t,Mt,At,Tt,St,Et,Ct,kt,Dt,Ot;function Pt(e,t={}){const{enabled:n=!0,event:r="click",toggle:o=!0,ignoreMouse:l=!1,stickIfOpen:s=!0,touchOpenDelay:u=0,reason:c=i}=t,a="rootStore"in e?e.rootStore:e,d=a.context.dataRef,f=je.useRef(void 0),p=F(),m=E(),g=je.useMemo(()=>{function e(e,t,n,r){const o=W(c,t,n);e&&"touch"===r&&u>0?m.start(u,()=>{a.setOpen(!0,o)}):a.setOpen(e,o)}function t(e,t,n){const r=d.current.openEvent,l=a.select("domReferenceElement")!==t;return!((!e||!l)&&e&&o&&(!r||!s||n(r.type)))}return{onPointerDown(e){f.current=e.pointerType},onMouseDown(n){const o=f.current,i=n.nativeEvent,s=a.select("open");if(0!==n.button||"click"===r||z(o,!0)&&l)return;const u=t(s,n.currentTarget,e=>"click"===e||"mousedown"===e),c=D(i);if(Ae(c))return void e(u,i,c,o);const d=n.currentTarget;p.request(()=>{e(u,i,d,o)})},onClick(n){if("mousedown-only"===r)return;const o=f.current;"mousedown"===r&&o?f.current=void 0:z(o,!0)&&l||e(t(a.select("open"),n.currentTarget,e=>"click"===e||"mousedown"===e||"keydown"===e||"keyup"===e),n.nativeEvent,n.currentTarget,o)},onKeyDown(){f.current=void 0}}},[d,r,l,c,a,s,o,p,m,u]);return je.useMemo(()=>n?{reference:g}:y,[n,g])}function Nt(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Vt(e,t){return Nt(t,"ArrowUp"===e||"ArrowDown"===e,"ArrowLeft"===e||"ArrowRight"===e)}function jt(e,t,n){return Nt(t,"ArrowDown"===e,n?"ArrowLeft"===e:"ArrowRight"===e)||"Enter"===e||" "===e||""===e}function Ut(e,t){const{listRef:n,activeIndex:r,onNavigate:o=()=>{},enabled:l=!0,selectedIndex:i=null,allowEscape:c=!1,loopFocus:m=!1,nested:g=!1,rtl:v=!1,virtual:b=!1,focusItemOnOpen:y="auto",focusItemOnHover:x=!0,openOnArrowKeyDown:I=!0,disabledIndices:_,orientation:M="vertical",parentOrientation:A,id:S,resetOnPointerLeave:E=!0,externalTree:C,grid:k}=t,N=null!=k,j="rootStore"in e?e.rootStore:e,U=j.useState("open"),B=j.useState("floatingElement"),z=j.useState("domReferenceElement"),q=j.context.dataRef,K=d(B),Y=T(z),G=ve(K),X=L(),Q=oe(C),Z=je.useRef(y),ee=je.useRef(i??-1),ne=je.useRef(null),re=je.useRef(!0),ie=ae(e=>{o(-1===ee.current?null:ee.current,e)}),se=je.useRef(!!B),ue=je.useRef(U),ce=je.useRef(!1),de=je.useRef(!1),fe=je.useRef(null),ge=ve(_),he=ve(U),be=ve(i),ye=ve(E),we=F(),xe=F(),Re=ae(()=>{function e(e){b?Q?.events.emit("virtualfocus",e):fe.current=Ie(e,{sync:ce.current,preventScroll:!0})}const t=n.current[ee.current],r=de.current;t&&e(t),(ce.current?e=>e():e=>we.request(e))(()=>{const o=n.current[ee.current]||t;o&&(t||e(o),!Ee||!r&&re.current||o.scrollIntoView?.({block:"nearest",inline:"nearest"}))})});a(()=>{q.current.orientation=M},[q,M]),a(()=>{l&&(U&&B?(ee.current=i??-1,Z.current&&null!=i&&(de.current=!0,ie())):se.current&&(ee.current=-1,ie()))},[l,U,B,i,ie]),a(()=>{if(l)if(U){if(B)if(null==r){if(ce.current=!1,null!=be.current)return;if(se.current&&(ee.current=-1,Re()),(!ue.current||!se.current)&&Z.current&&(null!=ne.current||!0===Z.current&&null==ne.current)){let e=0;const t=()=>{null==n.current[0]?(e<2&&(e?e=>xe.request(e):queueMicrotask)(t),e+=1):(ee.current=null==ne.current||jt(ne.current,M,v)||g?te(n):s(n),ne.current=null,ie())};t()}}else w(n.current,r)||(ee.current=r,Re(),de.current=!1)}else ce.current=!1},[l,U,B,r,be,g,n,M,v,ie,Re,xe]),a(()=>{if(!l||B||!Q||b||!se.current)return;const e=Q.nodesRef.current,t=e.find(e=>e.id===X)?.context?.elements.floating,n=O(J(z??t??null)),r=e.some(e=>e.context&&p(e.context.elements.floating,n));t&&!r&&re.current&&t.focus({preventScroll:!0})},[l,B,z,Q,X,b]),a(()=>{ue.current=U,se.current=!!B}),a(()=>{U||(ne.current=null,Z.current=y)},[U,y]);const _e=null!=r,Me=ae(e=>{if(!he.current)return;const t=n.current.indexOf(e.currentTarget);-1===t||ee.current===t&&r===t||(ee.current=t,ie(e))}),Ae=ae(()=>A??Q?.nodesRef.current.find(e=>e.id===X)?.context?.dataRef?.current.orientation),Te=ae(()=>te(n,ge.current)),Se=ae(e=>{if(re.current=!1,ce.current=!0,229===e.which)return;if(!he.current&&e.currentTarget===G.current)return;if(g&&function(e,t,n,r){return"both"===t||"horizontal"===t&&r?e===Ue:Nt(t,n?e===h:e===f,e===me)}(e.key,M,v,N))return Vt(e.key,Ae())||le(e),j.setOpen(!1,W(u,e.nativeEvent)),void(H(z)&&(b?Q?.events.emit("virtualfocus",z):z.focus()));const t=ee.current,r=te(n,_),o=s(n,_);if(Y||("Home"===e.key&&(le(e),ee.current=r,ie(e)),"End"===e.key&&(le(e),ee.current=o,ie(e))),null!=k){const t=k(e,ee.current,n,M,m,v,_,r,o);if(null!=t&&(ee.current=t,ie(e)),"both"===M)return}if(Vt(e.key,M)){if(le(e),U&&!b&&O(e.currentTarget.ownerDocument)===e.currentTarget)return ee.current=jt(e.key,M,v)?r:o,void ie(e);jt(e.key,M,v)?m?t>=o?c&&t!==n.current.length?ee.current=-1:(ce.current=!1,ee.current=r):ee.current=R(n.current,{startingIndex:t,disabledIndices:_}):ee.current=Math.min(o,R(n.current,{startingIndex:t,disabledIndices:_})):m?t<=r?c&&-1!==t?ee.current=n.current.length:(ce.current=!1,ee.current=o):ee.current=R(n.current,{startingIndex:t,decrement:!0,disabledIndices:_}):ee.current=Math.max(r,R(n.current,{startingIndex:t,decrement:!0,disabledIndices:_})),w(n.current,ee.current)&&(ee.current=-1),ie(e)}}),Ee=je.useMemo(()=>({onFocus(e){ce.current=!0,Me(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){ce.current=!0,de.current=!1,x&&Me(e)},onPointerLeave(e){if(!he.current||!re.current||"touch"===e.pointerType)return;ce.current=!0;const t=e.relatedTarget;if(x&&!n.current.includes(t)&&ye.current&&(fe.current?.(),fe.current=null,ee.current=-1,ie(e),!b)){const e=G.current,t=O(J(e));e&&p(e,t)&&e.focus({preventScroll:!0})}}}),[Me,he,G,x,n,ie,ye,b]),Ce=je.useMemo(()=>b&&U&&_e&&{"aria-activedescendant":`${S}-${r}`},[b,U,_e,S,r]),ke=je.useMemo(()=>({"aria-orientation":"both"===M?void 0:M,...Y?{}:Ce,onKeyDown(e){if("Tab"===e.key&&e.shiftKey&&U&&!b){const t=D(e.nativeEvent);if(t&&!p(G.current,t))return;return le(e),j.setOpen(!1,W(V,e.nativeEvent)),void(H(z)&&z.focus())}Se(e)},onPointerMove(){re.current=!0}}),[Ce,Se,G,M,Y,j,U,b,z]),De=je.useMemo(()=>{function e(e){j.setOpen(!0,W(u,e.nativeEvent,e.currentTarget))}function t(e){"auto"===y&&$(e.nativeEvent)&&(Z.current=!b)}function n(e){Z.current=y,"auto"===y&&pe(e.nativeEvent)&&(Z.current=!0)}return{onKeyDown(t){const n=j.select("open");re.current=!1;const r=t.key.startsWith("Arrow"),o=function(e,t,n){return Nt(t,n?e===f:e===h,e===P)}(t.key,Ae(),v),l=Vt(t.key,M),i=(g?o:l)||"Enter"===t.key||""===t.key.trim();if(b&&n)return Se(t);if(n||I||!r){if(i){const e=Vt(t.key,Ae());ne.current=g&&e?null:t.key}g?o&&(le(t),n?(ee.current=Te(),ie(t)):e(t)):l&&(null!=be.current&&(ee.current=be.current),le(t),!n&&I?e(t):Se(t),n&&ie(t))}},onFocus(e){j.select("open")&&!b&&(ee.current=-1,ie(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[Se,y,Te,g,ie,j,I,M,Ae,v,be,b]),Oe=je.useMemo(()=>({...Ce,...De}),[Ce,De]);return je.useMemo(()=>l?{reference:Oe,floating:ke,item:Ee,trigger:De}:{},[l,Oe,ke,De,Ee])}function Ft(e,t){const{listRef:n,elementsRef:r,activeIndex:o,onMatch:l,disabledIndices:i,onTyping:s,enabled:u=!0,resetMs:c=750,selectedIndex:d=null}=t,f="rootStore"in e?e.rootStore:e,m=f.useState("open"),g=E(),h=je.useRef(""),y=je.useRef(d??o??-1),w=je.useRef(null),x=ae(e=>{function t(e){return!(!function(e){const t=r?.current[e];return!t||b(t)}(e)||null!=i&&M(v,e,i))}function u(e,n,r=0){if(0===e.length)return-1;const o=(r%e.length+e.length)%e.length,l=n.toLowerCase();for(let i=0;i<e.length;i+=1){const n=(o+i)%e.length;if(e[n]?.toLowerCase().startsWith(l)&&t(n))return n}return-1}const a=n.current;if(h.current.length>0&&" "===e.key&&(le(e),s?.(!0)),h.current.length>0&&" "!==h.current[0]&&-1===u(a,h.current)&&" "!==e.key&&s?.(!1),null==a||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;m&&" "!==e.key&&(le(e),s?.(!0));const f=""===h.current;f&&(y.current=d??o??-1),a.every((e,n)=>!e||!t(n)||e[0]?.toLowerCase()!==e[1]?.toLowerCase())&&h.current===e.key&&(h.current="",y.current=w.current),h.current+=e.key,g.start(c,()=>{h.current="",y.current=w.current,s?.(!1)});const p=((f?d??o??-1:y.current)??0)+1,x=u(a,h.current,p);-1!==x?(l?.(x),w.current=x):" "!==e.key&&(h.current="",s?.(!1))}),R=ae(e=>{const t=e.relatedTarget,n=f.select("domReferenceElement"),r=f.select("floatingElement");p(n,t)||p(r,t)||(g.clear(),h.current="",y.current=w.current,s?.(!1))});a(()=>{(m||null===d)&&(g.clear(),w.current=null,""!==h.current&&(h.current=""))},[m,d,g]),a(()=>{m&&""===h.current&&(y.current=d??o??-1)},[m,d,o]);const I=je.useMemo(()=>({onKeyDown:x,onBlur:R}),[x,R]);return je.useMemo(()=>u?{reference:I,floating:I}:{},[u,I])}function Ht(e=!1){const t=je.useContext(Fe);if(void 0===t&&!e)throw new Error(k(16));return t}function Bt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:o=!0,composite:l}=e,i=je.useRef(null),s=Ht(!0),u=l??void 0!==s,{props:c}=function(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:o=0,isNativeButton:l}=e,i=r&&!1!==t,s=r&&!1===t;return{props:je.useMemo(()=>{const e={onKeyDown(e){n&&t&&"Tab"!==e.key&&e.preventDefault()}};return r||(e.tabIndex=o,!l&&n&&(e.tabIndex=t?o:-1)),(l&&(t||i)||!l&&n)&&(e["aria-disabled"]=n),!l||t&&!s||(e.disabled=n),e},[r,n,t,i,s,l,o])}}({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:r,isNativeButton:o}),d=je.useCallback(()=>{const e=i.current;Lt(e)&&u&&t&&void 0===c.disabled&&e.disabled&&(e.disabled=!1)},[t,c.disabled,u]);return a(d,[d]),{getButtonProps:je.useCallback((e={})=>{const{onClick:n,onMouseDown:r,onKeyUp:l,onKeyDown:i,onPointerDown:s,...a}=e;return Me({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t)return;if(we(e),i?.(e),e.baseUIHandlerPrevented)return;const r=e.target===e.currentTarget,l=e.currentTarget,s=Lt(l),c=!o&&(a=l,Boolean("A"===a?.tagName&&a?.href));var a;const d=r&&(o?s:!c),f="Enter"===e.key,p=" "===e.key,m=l.getAttribute("role"),g=m?.startsWith("menuitem")||"option"===m||"gridcell"===m;if(r&&u&&p){if(e.defaultPrevented&&g)return;return e.preventDefault(),void(c||o&&s?(l.click(),e.preventBaseUIHandler()):d&&(n?.(e),e.preventBaseUIHandler()))}d&&(o||!p&&!f||e.preventDefault(),!o&&f&&n?.(e))},onKeyUp(e){t||(we(e),l?.(e),e.target===e.currentTarget&&o&&u&&Lt(e.currentTarget)&&" "===e.key?e.preventDefault():e.baseUIHandlerPrevented||e.target!==e.currentTarget||o||u||" "!==e.key||n?.(e))},onPointerDown(e){t?e.preventDefault():s?.(e)}},o?{type:"button"}:{role:"button"},c,a)},[t,c,u,o]),buttonRef:ae(e=>{i.current=e,d()})}}function Lt(e){return H(e)&&"BUTTON"===e.tagName}function Wt(e,t){const n=je.useRef(e),r=ae(t);a(()=>{n.current!==e&&r(n.current)},[e,r]),a(()=>{n.current=e},[e])}function zt(e,t){const{onClick:n,onPointerDown:r}=function(e){const t=je.useRef(""),n=je.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:je.useCallback(n=>{0!==n.detail?(e(n,"pointerType"in n?n.pointerType:t.current),t.current=""):e(n,"keyboard")},[e]),onPointerDown:n}}(ae((n,r)=>{("function"==typeof e?e():e)||t(r||(_e?"touch":""))}));return je.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function qt(e){const[t,n]=je.useState(null),r=zt(e,n);return Wt(e,t=>{t&&!e&&n(null)}),je.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Kt(e){return null==e||e.hasAttribute("disabled")||"true"===e.getAttribute("aria-disabled")}function $t({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=je.useRef(void 0!==e),[l,i]=je.useState(t);return[o?e:l,je.useCallback(e=>{o||i(e)},[])]}function Yt(){const e=je.useContext(He);if(null===e)throw new Error(k(60));return e}function Gt(){const e=je.useContext(Be);if(null===e)throw new Error(k(61));return e}function Xt(e=!0){const t=je.useContext(Ye);if(t.setValidityData===_&&!e)throw new Error(k(28));return t}function Jt(e,t,n,r,o=!0,l){const{registerFieldControl:i}=Xt(),s=je.useRef(null);s.current||(s.current=Symbol()),a(()=>{const u=s.current;if(u&&o)return i(u,{controlRef:e,getValue:r,id:t,name:l,value:n}),()=>{i(u,void 0)}},[e,o,r,t,l,i,n])}function Qt(){return je.useContext(Ge)}function Zt(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:l}=Qt(),i=C(t),s=n?o:void 0,u=re(()=>Symbol("labelable-control")),c=je.useRef(!1),d=je.useRef(null!=t),f=ae(()=>{c.current&&l!==_&&(c.current=!1,l(u.current,void 0))});return a(()=>{if(l===_)return;let e;if(n){const n=r?.current;e=Q(n)&&null!=n.closest("label")?t??null:s??i}else if(null!=t)d.current=!0,e=t;else{if(!d.current)return void f();e=i}void 0!==e?(c.current=!0,l(u.current,e)):f()},[t,r,s,l,n,i,u,f]),je.useEffect(()=>f,[f]),o??i}function en(e,t,n){return null==e||null==t?Object.is(e,t):n(e,t)}function tn(e,t,n){return!(!e||0===e.length)&&e.some(e=>void 0!==e&&en(t,e,n))}function nn(e,t,n){return e&&0!==e.length?e.findIndex(e=>void 0!==e&&en(e,t,n)):-1}function rn(e,t,n){return e.filter(e=>!en(t,e,n))}function on(e){if(null==e)return"";if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function ln(e){return null!=e&&e.length>0&&"object"==typeof e[0]&&null!=e[0]&&"items"in e[0]}function sn(e){if(!Array.isArray(e))return null!=e&&"null"in e;const t=e;if(ln(t)){for(const e of t)for(const t of e.items)if(t&&null==t.value&&null!=t.label)return!0;return!1}for(const n of t)if(n&&null==n.value&&null!=n.label)return!0;return!1}function un(e,t){if(t&&null!=e)return t(e)??"";if(e&&"object"==typeof e){if("label"in e&&null!=e.label)return String(e.label);if("value"in e)return String(e.value)}return on(e)}function cn(e,t){return t&&null!=e?t(e)??"":on(e&&"object"==typeof e&&"value"in e&&"label"in e?e.value:e)}function an(e,t,n){function r(){return un(e,n)}if(n&&null!=e)return n(e);if(e&&"object"==typeof e&&"label"in e&&null!=e.label)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const n=t,o=ln(n)?n.flatMap(e=>e.items):n;if(null==e||"object"!=typeof e){const t=o.find(t=>t.value===e);return t&&null!=t.label?t.label:r()}if("value"in e){const t=o.find(t=>t&&t.value===e.value);if(t&&null!=t.label)return t.label}}return r()}function dn(){return je.useContext(Ze)}function fn(e,t,n=(e,t)=>e===t){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function pn(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function mn(e,t){return Math.max(0,e-t)}function gn(e,t){if(t<=0)return 0;const n=pn(e,0,t),r=t-n,o=n<=1,l=r<=1;return o&&l?n<=r?0:t:o?0:l?t:n}function hn(e){const{id:t,value:n,defaultValue:r=null,onValueChange:o,open:i,defaultOpen:s=!1,onOpenChange:u,name:c,form:d,autoComplete:f,disabled:p=!1,readOnly:m=!1,required:h=!1,modal:b=!0,actionsRef:w,inputRef:x,onOpenChangeComplete:R,items:_,multiple:M=!1,itemToStringLabel:A,itemToStringValue:T,isItemEqualToValue:S=Xe,highlightItemOnHover:E=!0,children:C}=e,{clearErrors:k}=dn(),{setDirty:D,setTouched:O,setFocused:P,validityData:V,setFilled:j,name:U,disabled:F,validation:H,validationMode:L}=Xt(),z=Zt({id:t}),q=F||p,$=U??c,[Y,G]=$t({controlled:n,default:M?r??v:r,name:"Select",state:"value"}),[X,J]=$t({controlled:i,default:s,name:"Select",state:"open"}),Q=je.useRef([]),Z=je.useRef([]),ee=je.useRef(null),te=je.useRef(null),ne=je.useRef(0),oe=je.useRef(null),le=je.useRef([]),se=je.useRef(!1),ce=je.useRef(null),de=je.useRef(null),fe=je.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),pe=je.useRef(!1),{mounted:me,setMounted:be,transitionStatus:ye}=N(X),{openMethod:we,triggerProps:xe}=qt(X),Ie=re(()=>new l({id:z,labelId:void 0,modal:b,multiple:M,itemToStringLabel:A,itemToStringValue:T,isItemEqualToValue:S,value:Y,open:X,mounted:me,transitionStatus:ye,items:_,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,_e=K(Ie,Qe.activeIndex),Ae=K(Ie,Qe.selectedIndex),Se=K(Ie,Qe.triggerElement),Ee=K(Ie,Qe.positionerElement),Ce=function(e){const[t,n]=je.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}(we),ke=we??Ce??null,De=je.useMemo(()=>M?"":cn(Y,T),[M,Y,T]),Oe=je.useMemo(()=>M&&Array.isArray(Y)?Y.map(e=>cn(e,T)):cn(Y,T),[M,Y,T]);Jt(ve(Ie.state.triggerElement),z,Y,ae(()=>Oe),!q,c);const Pe=je.useRef(Y),Ne=M?Array.isArray(Y)&&Y.length>0:null!=Y&&""!==cn(Y,T);a(()=>{Y!==Pe.current&&Ie.set("forceMount",!0)},[Ie,Y]),a(()=>{j(Ne)},[Ne,j]),a(function(){const e=le.current;let t;if(M){const n=Array.isArray(Y)?Y:[];if(0===n.length)t=null;else{const r=nn(e,n[n.length-1],S);t=-1===r?null:r}}else{const n=nn(e,Y,S);t=-1===n?null:n}null===t&&(de.current=null),X||Ie.set("selectedIndex",t)},[Ne,M,X,Y,le,S,Ie,de]),Wt(Y,()=>{k($),D(function(e){const t=V.initialValue;return Array.isArray(e)&&Array.isArray(t)?!fn(e,t,(e,t)=>en(e,t,S)):e!==t}(Y)),H.change(Y)});const Ve=ae((e,t)=>{u?.(e,t),t.isCanceled||(J(e),e||"focus-out"!==t.reason&&"outside-press"!==t.reason||(O(!0),P(!1),"onBlur"===L&&H.commit(Y)))}),Ue=ae(()=>{be(!1),Ie.update({activeIndex:null,openMethod:null}),R?.(!1)});g({enabled:!w,open:X,ref:ee,onComplete(){X||Ue()}}),je.useImperativeHandle(w,()=>({unmount:Ue}),[Ue]);const Fe=ae((e,t)=>{o?.(e,t),t.isCanceled||G(e)}),Le=ae(()=>{const e=Ie.state.listElement||ee.current;if(!e)return;const t=mn(e.scrollHeight,e.clientHeight),n=gn(e.scrollTop,t),r=n>0,o=n<t;Ie.state.scrollUpArrowVisible!==r&&Ie.set("scrollUpArrowVisible",r),Ie.state.scrollDownArrowVisible!==o&&Ie.set("scrollDownArrowVisible",o)}),We=Te({open:X,onOpenChange:Ve,elements:{reference:Se,floating:Ee}}),ze=Pt(We,{enabled:!m&&!q,event:"mousedown"}),qe=he(We),Ke=Ut(We,{enabled:!m&&!q,listRef:Q,activeIndex:_e,selectedIndex:Ae,disabledIndices:v,onNavigate(e){(null!==e||X)&&Ie.set("activeIndex",e)},focusItemOnHover:E}),$e=Ft(We,{enabled:!m&&!q&&(X||!M),listRef:Z,activeIndex:_e,selectedIndex:Ae,disabledIndices:e=>Kt(Q.current[e]),onMatch(e){X?Ie.set("activeIndex",e):Fe(le.current[e],W("none"))},onTyping(e){se.current=e}}),Ye=je.useMemo(()=>{const e=Me($e.reference,Ke.reference,qe.reference,ze.reference,xe);return z&&(e.id=z),e},[ze.reference,$e.reference,Ke.reference,qe.reference,xe,z]),Ge=je.useMemo(()=>Me(I,$e.floating,Ke.floating,qe.floating),[$e.floating,Ke.floating,qe.floating]),Ze=Ke.item??y;ue(()=>{Ie.update({popupProps:Ge,triggerProps:Ye})}),a(()=>{Ie.update({id:z,modal:b,multiple:M,value:Y,open:X,mounted:me,transitionStatus:ye,popupProps:Ge,triggerProps:Ye,items:_,itemToStringLabel:A,itemToStringValue:T,isItemEqualToValue:S,openMethod:ke})},[Ie,z,b,M,Y,X,me,ye,Ge,Ye,_,A,T,S,ke]);const et=je.useMemo(()=>({store:Ie,name:$,required:h,disabled:q,readOnly:m,multiple:M,highlightItemOnHover:E,setValue:Fe,setOpen:Ve,listRef:Q,popupRef:ee,scrollHandlerRef:te,handleScrollArrowVisibility:Le,scrollArrowsMountedCountRef:ne,itemProps:Ze,valueRef:oe,valuesRef:le,labelsRef:Z,typingRef:se,selectionRef:fe,firstItemTextRef:ce,selectedItemTextRef:de,validation:H,onOpenChangeComplete:R,alignItemWithTriggerActiveRef:pe,initialValueRef:Pe}),[Ie,$,h,q,m,M,E,Fe,Ve,Ze,H,R,Le]),tt=B(x,H.inputRef),nt=M&&Array.isArray(Y)&&Y.length>0,rt=M?void 0:$,ot=je.useMemo(()=>M&&Array.isArray(Y)&&$?Y.map(e=>{const t=cn(e,T);return(0,Je.jsx)("input",{type:"hidden",form:d,name:$,value:t,disabled:q},t)}):null,[M,Y,d,$,T,q]);return(0,Je.jsx)(He.Provider,{value:et,children:(0,Je.jsxs)(Be.Provider,{value:We,children:[C,(0,Je.jsx)("input",{...H.getValidationProps(q,{onFocus(){Ie.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||q||m)return;const t=e.currentTarget.value,n=W(Re,e.nativeEvent);Ie.set("forceMount",!0),queueMicrotask(function(){if(M)return;const e=t.toLowerCase();let r=le.current.findIndex(t=>cn(t,T).toLowerCase()===e||un(t,A).toLowerCase()===e);-1===r&&(r=le.current.findIndex((t,n)=>{const r=Z.current[n];return null!=r&&r.toLowerCase()===e}));const o=-1===r?void 0:le.current[r];null!=o&&Fe(o,n)})}}),id:z&&null==rt?`${z}-hidden-input`:void 0,form:d,name:rt,autoComplete:f,value:De,disabled:q,required:h&&!nt,readOnly:m,ref:tt,style:$?ge:ie,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),ot]})})}function vn(e,t){return e??t}function bn(e){const t=e.getBoundingClientRect(),n=se(e);if(Y)return t;const r=n.getComputedStyle(e,"::before"),o=n.getComputedStyle(e,"::after");if("none"===r.content&&"none"===o.content)return t;const l=parseFloat(r.width)||0,i=parseFloat(r.height)||0,s=parseFloat(o.width)||0,u=parseFloat(o.height)||0,c=Math.max(t.width,l,s),a=Math.max(t.height,i,u),d=c-t.width,f=a-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function yn(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:o}=e,l=ae(o),i=je.useRef(0),s=re(xn).current,u=re(wn).current,[c,d]=je.useState(0),f=je.useRef(c),p=ae((e,t)=>{u.set(e,t??null),f.current+=1,d(f.current)}),m=ae(e=>{u.delete(e),f.current+=1,d(f.current)}),g=je.useMemo(()=>{const e=new Map;return Array.from(u.keys()).filter(e=>e.isConnected).sort(Rn).forEach((t,n)=>{const r=u.get(t)??{};e.set(t,{...r,index:n})}),e},[u,c]);a(()=>{if("function"!=typeof MutationObserver||0===g.size)return;const e=new MutationObserver(e=>{const t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),0===t.size&&(f.current+=1,d(f.current))});return g.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[g]),a(()=>{f.current===c&&(n.current.length!==g.size&&(n.current.length=g.size),r&&r.current.length!==g.size&&(r.current.length=g.size),i.current=g.size),l(g)},[l,g,n,r,c]),a(()=>()=>{n.current=[]},[n]),a(()=>()=>{r&&(r.current=[])},[r]);const h=ae(e=>(s.add(e),()=>{s.delete(e)}));a(()=>{s.forEach(e=>e(g))},[s,g]);const v=je.useMemo(()=>({register:p,unregister:m,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:i}),[p,m,h,n,r,i]);return(0,Je.jsx)(st.Provider,{value:v,children:t})}function wn(){return new Map}function xn(){return new Set}function Rn(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}function In(){const e=je.useContext(ut);if(!e)throw new Error(k(59));return e}function _n(e,t){e&&Object.assign(e.style,t)}function Mn(e,t,n,r){const[o,l]=je.useState(!1);a(()=>{if(!e||!t||null==n)return void l(!1);const r=J(n).documentElement.clientWidth,o=n.offsetWidth;l(r>0&&o>0&&o>=r-at)},[e,t,n]),X(e&&(!t||o),r)}function An(e){const t=je.useContext(gt);if(void 0===t&&!e)throw new Error(k(69));return t}function Tn(){return je.useContext(ht)??vt}function Sn(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function En(e){return mn(e.scrollHeight,e.clientHeight)}function Cn(e){return ke.getScale(e)}function kn(e,t,n){return e/n[t]}function Dn(e,t){return A({x:kn(e.x,"x",t),y:kn(e.y,"y",t),width:kn(e.width,"x",t),height:kn(e.height,"y",t)})}function On(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:o,index:l}=e,{register:i,unregister:s,subscribeMapChange:u,elementsRef:c,labelsRef:d,nextIndexRef:f}=je.useContext(st),p=je.useRef(-1),[m,g]=je.useState(l??(o===Rt.GuessFromOrder?()=>{if(-1===p.current){const e=f.current;f.current+=1,p.current=e}return p.current}:-1)),h=je.useRef(null),v=je.useCallback(e=>{if(h.current=e,-1!==m&&null!==e&&(c.current[m]=e,d)){const n=void 0!==t;d.current[m]=n?t:r?.current?.textContent??e.textContent}},[m,c,d,t,r]);return a(()=>{if(null!=l)return;const e=h.current;return e?(i(e,n),()=>{s(e)}):void 0},[l,i,s,n]),a(()=>{if(null==l)return u(e=>{const t=h.current?e.get(h.current)?.index:null;null!=t&&g(t)})},[l,u,g]),{ref:v,index:m}}function Pn(){const e=je.useContext(It);if(!e)throw new Error(k(57));return e}return e({C:nn,D:Qt,E:Zt,F:Kt,H:Ft,I:qt,L:zt,O:Jt,P:$t,R:Wt,T:tn,U:Ut,V:Ht,W:Pt,_:ln,b:on,c:Mn,d:vn,f:gn,g:sn,h:dn,i:Tn,j:Xt,l:yn,m:fn,o:An,p:pn,r:On,t:function({options:e,fluid:t,size:n="medium",...r}){return(0,Je.jsxs)(hn,{items:e,...r,children:[(0,Je.jsxs)(tt,{className:Pe([Ot.select,Ot[n],t&&Ot.fluid]),children:[(0,Je.jsx)(rt,{}),(0,Je.jsx)(ot,{className:Ot.selectIcon,children:(0,Je.jsx)(Oe,{})})]}),(0,Je.jsx)(it,{children:(0,Je.jsxs)(ft,{side:"bottom",align:"start",children:[(0,Je.jsx)(Dt,{className:Ot.scrollArrow,keepMounted:!0}),(0,Je.jsxs)(yt,{className:Ot.popup,children:[(0,Je.jsx)(Et,{}),(0,Je.jsx)(xt,{className:Ot.list,children:e.map(({disabled:e,label:t,value:n})=>(0,Je.jsxs)(_t,{className:Ot.item,value:n,disabled:e,children:[(0,Je.jsx)(Mt,{className:Ot.itemIndicator,children:(0,Je.jsx)(Ne,{className:Ot.itemIndicatorIcon})}),(0,Je.jsx)(Tt,{className:Ot.itemLabel,children:t})]},String(n)))})]}),(0,Je.jsx)(kt,{className:Ot.scrollArrow,keepMounted:!0})]})})]})},u:bn,v:un,w:rn,x:en,y:cn,z:Bt}),{setters:[function(e){n=e.a,r=e.n,o=e.t},function(e){l=e.$,i=e.An,s=e.At,u=e.Cn,c=e.D,a=e.Er,d=e.Fn,f=e.Gn,p=e.Hn,m=e.J,g=e.K,h=e.Kn,v=e.Mn,b=e.Mt,y=e.Nn,w=e.Nt,x=e.O,R=e.Ot,I=e.P,_=e.Pn,M=e.Pt,A=e.Qt,T=e.Rn,S=e.Sn,E=e.Sr,C=e.T,e.Tn,k=e.Tr,D=e.Un,O=e.Vn,P=e.Wn,N=e.Y,V=e._n,j=e._r,U=e._t,F=e.an,H=e.ar,B=e.cn,L=e.ct,W=e.dn,z=e.dr,q=e.dt,K=e.et,$=e.fr,Y=e.hr,G=e.ht,X=e.i,J=e.in,Q=e.ir,Z=e.it,ee=e.jn,te=e.jt,ne=e.k,re=e.kr,oe=e.lt,le=e.mr,ie=e.nn,se=e.nr,ue=e.nt,ce=e.o,ae=e.on,de=e.p,fe=e.pn,pe=e.pr,me=e.qn,ge=e.rn,he=e.rt,ve=e.sn,be=e.tt,ye=e.un,we=e.vt,xe=e.w,Re=e.wn,Ie=e.xt,_e=e.yr,Me=e.yt,Ae=e.zn},function(e){Te=e.B,Se=e.F,Ee=e.M,Ce=e.N,ke=e.V,De=e.j,Oe=e.l},function(e){Pe=e.K,Ne=e.lt}],execute:function(){(Ve=document.createElement("style")).textContent='._blink_69vaw_1{animation:1s step-start infinite _blink_69vaw_1}@keyframes _blink_69vaw_1{0%{opacity:1}50%{opacity:.2}}._fourtyfive_69vaw_13{transform:rotate(45deg)}._select_69vaw_17{box-sizing:border-box;color:#e2e2e2;white-space:nowrap;background-color:#262626;border:1px solid transparent;border-radius:3px;justify-content:space-between;align-items:center;gap:.5rem;height:2rem;padding-left:.5rem;padding-right:.5rem;font-size:1rem;font-weight:400;display:flex}._select_69vaw_17:hover:not([data-disabled]){background-color:#2d2d2d}._select_69vaw_17:active:not([data-disabled]),._select_69vaw_17[data-popup-open]{background-color:#404040}._select_69vaw_17[data-disabled]{opacity:.4;cursor:not-allowed}._select_69vaw_17:focus-visible{outline-offset:2px;outline:2px solid #578af4}._medium_69vaw_51{height:2rem}._large_69vaw_55{height:2.5rem}._fluid_69vaw_59{width:100%}._selectIcon_69vaw_63{color:#e2e2e2}._popup_69vaw_67{box-sizing:border-box;color:#f6f6f6;background-color:#262626;border:1px solid #404040;border-radius:3px;padding:2px;font-size:1rem}._popup_69vaw_67[data-side=start]{transition:50%;transform:100%;opacity:1}._list_69vaw_82{box-sizing:border-box;max-height:20rem;max-height:var(--available-height);padding-top:.25rem;padding-bottom:.25rem;scroll-padding-block:1.5rem;position:relative;overflow-y:auto}._item_69vaw_92{box-sizing:border-box;min-width:var(--anchor-width);outline:0;grid-template-columns:.75rem 1fr;align-items:center;gap:.25rem;padding:.25rem .5rem;scroll-margin-block:1rem;line-height:1rem;display:grid}._item_69vaw_92[data-highlighted]{z-index:0;background-color:#2b5abc;position:relative}._itemIndicator_69vaw_110{grid-column-start:1}._itemIndicatorIcon_69vaw_114{width:.75rem;height:.75rem;display:block}._itemLabel_69vaw_120{grid-column-start:2}._scrollArrow_69vaw_124{color:#f6f6f6;z-index:1;visibility:hidden;background-color:#404040;place-content:center;width:100%;height:1rem;font-size:.5rem;display:grid}._scrollArrow_69vaw_124[data-visible]{visibility:visible}._scrollArrow_69vaw_124:before{content:"";width:100%;height:100%;position:absolute;left:0}._scrollArrow_69vaw_124[data-direction=up]{border-radius:3px 3px 0 0}._scrollArrow_69vaw_124[data-direction=up]:before{top:-100%}._scrollArrow_69vaw_124[data-direction=down]{border-radius:0 0 3px 3px;bottom:0}._scrollArrow_69vaw_124[data-direction=down]:before{bottom:-100%}\n/*$vite$:1*/',document.head.appendChild(Ve),function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="59a9a62e-82d4-4153-a455-f3cd158e1142",e._sentryDebugIdIdentifier="sentry-dbid-59a9a62e-82d4-4153-a455-f3cd158e1142")}catch(e){}}(),je=n(r(),1),Ue="Escape",e("B",Fe=je.createContext(void 0)),He=je.createContext(null),Be=je.createContext(null),Le=function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e}({}),We={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},e("M",ze={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1}),qe={disabled:!1,...ze},e("N",Ke={valid:e=>null===e?null:e?{[Le.valid]:""}:{[Le.invalid]:""}}),e("k",$e={invalid:void 0,name:void 0,validityData:{state:We,errors:[],error:"",value:"",initialValue:null},setValidityData:_,disabled:void 0,touched:ze.touched,setTouched:_,dirty:ze.dirty,setDirty:_,filled:ze.filled,setFilled:_,focused:ze.focused,setFocused:_,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:qe,markedDirtyRef:{current:!1},registerFieldControl:_,validation:{getValidationProps:(e,t=y)=>t,inputRef:{current:null},registerInput:_,commit:async()=>{},change:_}}),e("A",Ye=je.createContext($e)),Ge=je.createContext({controlId:void 0,registerControlId:_,labelId:void 0,setLabelId:_,messageIds:[],setMessageIds:_,getDescriptionProps:e=>e}),e("S",Xe=(e,t)=>Object.is(e,t)),Je=o(),Qe={id:be(e=>e.id),labelId:be(e=>e.labelId),modal:be(e=>e.modal),multiple:be(e=>e.multiple),items:be(e=>e.items),itemToStringLabel:be(e=>e.itemToStringLabel),itemToStringValue:be(e=>e.itemToStringValue),isItemEqualToValue:be(e=>e.isItemEqualToValue),value:be(e=>e.value),hasSelectedValue:be(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return null!=t&&(n&&Array.isArray(t)?t.length>0:""!==cn(t,r))}),hasNullItemLabel:be((e,t)=>!!t&&sn(e.items)),open:be(e=>e.open),mounted:be(e=>e.mounted),forceMount:be(e=>e.forceMount),transitionStatus:be(e=>e.transitionStatus),openMethod:be(e=>e.openMethod),activeIndex:be(e=>e.activeIndex),selectedIndex:be(e=>e.selectedIndex),isActive:be((e,t)=>e.activeIndex===t),isSelected:be((e,t)=>{const n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>en(t,e,n)):en(t,r,n)}),isSelectedByFocus:be((e,t)=>e.selectedIndex===t),popupProps:be(e=>e.popupProps),triggerProps:be(e=>e.triggerProps),triggerElement:be(e=>e.triggerElement),positionerElement:be(e=>e.positionerElement),listElement:be(e=>e.listElement),popupSide:be(e=>e.popupSide),scrollUpArrowVisible:be(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:be(e=>e.scrollDownArrowVisible),hasScrollArrows:be(e=>e.hasScrollArrows)},Ze=je.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:_,validationMode:"onSubmit",submitAttemptedRef:{current:!1}}),et={...x,...Ke,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},tt=je.forwardRef(function(e,t){const{render:n,className:r,id:o,disabled:l=!1,nativeButton:i=!0,style:s,...u}=e,{setTouched:c,setFocused:a,validationMode:f,state:m,disabled:g}=Xt(),{labelId:h}=Qt(),{store:v,setOpen:b,selectionRef:y,validation:w,readOnly:x,required:R,alignItemWithTriggerActiveRef:I,disabled:_}=Yt(),M=g||_||l,A=K(v,Qe.open),T=K(v,Qe.mounted),S=K(v,Qe.value),C=K(v,Qe.triggerProps),k=K(v,Qe.positionerElement),D=K(v,Qe.listElement),O=K(v,Qe.popupSide),P=K(v,Qe.id),N=K(v,Qe.labelId),V=K(v,Qe.hasSelectedValue),j=T&&k?O:null,F=o??P,H=vn(h,N);Zt({id:F});const B=ve(k),L=je.useRef(null),{getButtonProps:z,buttonRef:q}=Bt({disabled:M,native:i}),$=ae(e=>{v.set("triggerElement",e)}),Y=E(),G=E(),X=E();je.useEffect(()=>{if(A)return X.start(400,()=>{y.current.allowUnselectedMouseUp=!0,y.current.allowSelectedMouseUp=!0}),()=>{X.clear()};y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},G.clear()},[A,y,G,X]);const Q=Me(C,{id:F,role:"combobox","aria-expanded":A?"true":"false","aria-haspopup":"listbox","aria-controls":A?D?.id??d(k)?.id:void 0,"aria-labelledby":H,"aria-readonly":x||void 0,"aria-required":R||void 0,tabIndex:M?-1:0,onFocus(e){a(!0),A&&I.current&&b(!1,W(Re,e.nativeEvent)),Y.start(0,()=>{v.set("forceMount",!0)})},onBlur(e){p(k,e.relatedTarget)||(c(!0),a(!1),"onBlur"===f&&w.commit(S))},onMouseDown(e){if(A)return;const t=J(e.currentTarget);function n(e){if(!L.current)return;const t=e.target;if(p(L.current,t)||p(B.current,t))return;const n=bn(L.current);e.clientX>=n.left-2&&e.clientX<=n.right+2&&e.clientY>=n.top-2&&e.clientY<=n.bottom+2||b(!1,W(fe,e))}G.start(0,()=>{t.addEventListener("mouseup",n,{once:!0})})}},u,z),Z=w.getValidationProps(M,Q);Z.role="combobox";const ee={...m,open:A,disabled:M,value:S,readOnly:x,popupSide:j,placeholder:!V};return U("button",e,{ref:[t,L,q,$],state:ee,stateAttributesMapping:et,props:Z})}),nt={value:()=>null},rt=je.forwardRef(function(e,t){const{className:n,render:r,children:o,placeholder:l,style:i,...s}=e,{store:u,valueRef:c}=Yt(),a=K(u,Qe.value),d=K(u,Qe.items),f=K(u,Qe.itemToStringLabel),p=K(u,Qe.hasSelectedValue),m=!p&&null!=l&&null==o,g=K(u,Qe.hasNullItemLabel,m),h={value:a,placeholder:!p};let v=null;return v="function"==typeof o?o(a):null!=o?o:p||null==l||g?Array.isArray(a)?function(e,t,n){return e.reduce((e,r,o)=>(o>0&&e.push(", "),e.push((0,Je.jsx)(je.Fragment,{children:an(r,t,n)},o)),e),[])}(a,d,f):an(a,d,f):l,U("span",e,{state:h,ref:[t,c],props:[{children:v},s],stateAttributesMapping:nt})}),ot=je.forwardRef(function(e,t){const{render:n,className:r,style:o,...l}=e,{store:i}=Yt();return U("span",e,{state:{open:K(i,Qe.open)},ref:t,props:[{"aria-hidden":!0,children:"▼"},l],stateAttributesMapping:ne})}),lt=je.createContext(void 0),it=je.forwardRef(function(e,t){const{store:n}=Yt(),r=K(n,Qe.mounted),o=K(n,Qe.forceMount);return r||o?(0,Je.jsx)(lt.Provider,{value:!0,children:(0,Je.jsx)(q,{ref:t,...e})}):null}),st=je.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}}),ut=je.createContext(void 0),ct={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},at=20,dt={position:"fixed"},ft=je.forwardRef(function(e,t){const{anchor:n,positionMethod:r="absolute",className:o,render:l,side:i="bottom",align:s="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f,arrowPadding:p=5,sticky:m=!1,disableAnchorTracking:g,alignItemWithTrigger:h=!0,collisionAvoidance:v=G,style:b,...y}=e,{store:w,listRef:x,labelsRef:R,alignItemWithTriggerActiveRef:I,selectedItemTextRef:_,valuesRef:M,initialValueRef:A,popupRef:T,setValue:S}=Yt(),E=Gt(),C=K(w,Qe.open),k=K(w,Qe.mounted),D=K(w,Qe.modal),O=K(w,Qe.value),P=K(w,Qe.openMethod),N=K(w,Qe.positionerElement),V=K(w,Qe.triggerElement),j=K(w,Qe.isItemEqualToValue),U=K(w,Qe.transitionStatus),F=je.useRef(null),H=je.useRef(null),[B,L]=je.useState(h),z=k&&B&&"touch"!==P;k||B===h||L(h),a(()=>{k||(Qe.scrollUpArrowVisible(w.state)&&w.set("scrollUpArrowVisible",!1),Qe.scrollDownArrowVisible(w.state)&&w.set("scrollDownArrowVisible",!1))},[w,k]),je.useImperativeHandle(I,()=>z),Mn((z||D)&&C,"touch"===P,N,V);const q=Ce({anchor:n,floatingRootContext:E,positionMethod:r,mounted:k,side:i,sideOffset:u,align:s,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:g??z,collisionAvoidance:v,keepMounted:!0}),$=z?"none":q.side,Y=z?dt:q.positionerStyles,X={open:C,side:$,align:q.align,anchorHidden:q.anchorHidden};a(()=>{w.set("popupSide",q.side)},[w,q.side]);const J=De(e,X,{styles:Y,transitionStatus:U,props:y,refs:[t,ae(e=>{w.set("positionerElement",e)})],hidden:!k,inert:!C}),Q=je.useRef(0),Z=ae(e=>{if(0===e.size&&0===Q.current)return;if(0===M.current.length)return;const t=Q.current;if(Q.current=e.size,e.size===t)return;const n=W(Re);if(0!==t&&!w.state.multiple&&null!==O&&-1===nn(M.current,O,j)){const e=A.current,t=null!=e&&-1!==nn(M.current,e,j)?e:null;S(t,n),null===t&&(w.set("selectedIndex",null),_.current=null)}if(0!==t&&w.state.multiple&&Array.isArray(O)){const e=e=>-1!==nn(M.current,e,j),t=O.filter(t=>e(t));(t.length!==O.length||t.some(e=>!tn(O,e,j)))&&(S(t,n),0===t.length&&(w.set("selectedIndex",null),_.current=null))}if(C&&z){w.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const e={height:""};_n(N,e),_n(T.current,e)}}),ee=je.useMemo(()=>({...q,side:$,alignItemWithTriggerActive:z,setControlledAlignItemWithTrigger:L,scrollUpArrowRef:F,scrollDownArrowRef:H}),[q,$,z,L]);return(0,Je.jsx)(yn,{elementsRef:x,labelsRef:R,onMapChange:Z,children:(0,Je.jsxs)(ut.Provider,{value:ee,children:[k&&D&&(0,Je.jsx)(ce,{inert:xe(!C),cutout:V}),J]})})}),e("s",mt={className:pt="base-ui-disable-scrollbar",getElement:e=>(0,Je.jsx)("style",{nonce:e,href:pt,precedence:"base-ui:low",children:`.${pt}{scrollbar-width:none}.${pt}::-webkit-scrollbar{display:none}`})}),e("a",gt=je.createContext(void 0)),ht=je.createContext(void 0),vt={disableStyleElements:!1},bt={...c,...m},yt=je.forwardRef(function(e,t){const{render:n,className:r,style:o,finalFocus:l,...i}=e,{store:s,popupRef:u,onOpenChangeComplete:c,setOpen:d,valueRef:f,firstItemTextRef:p,selectedItemTextRef:m,multiple:h,handleScrollArrowVisibility:v,scrollHandlerRef:b,listRef:y,highlightItemOnHover:w}=Yt(),{side:x,align:R,alignItemWithTriggerActive:I,isPositioned:_,setControlledAlignItemWithTrigger:M}=In(),A=null!=An(!0),T=Gt(),S=Se(),{nonce:E,disableStyleElements:C}=Tn(),k=K(s,Qe.id),D=K(s,Qe.open),O=K(s,Qe.openMethod),P=K(s,Qe.mounted),N=K(s,Qe.popupProps),V=K(s,Qe.transitionStatus),H=K(s,Qe.triggerElement),B=K(s,Qe.positionerElement),L=K(s,Qe.listElement),z=je.useRef(!1),q=je.useRef(!1),$=je.useRef({}),Y=F(),G=ae(e=>{if(!B||!u.current||!q.current)return;if(z.current||!I)return void v();const t="0px"===B.style.top,n="0px"===B.style.bottom;if(!t&&!n)return void v();const r=Cn(B),o=kn(B.getBoundingClientRect().height,"y",r),l=J(B),i=se(B),s=i.getComputedStyle(B),c=parseFloat(s.marginTop),a=parseFloat(s.marginBottom),d=Sn(i.getComputedStyle(u.current)),f=Math.min(l.documentElement.clientHeight-c-a,d),p=e.scrollTop,m=En(e);let g=0,h=null,b=!1,y=!1;const w=e=>{B.style.height=`${e}px`},x=t?m-p:p,R=Math.min(o+x,f);if(g=R,x<=1)((t,n)=>{const r=pn(t,0,f-o);r>0&&w(o+r),e.scrollTop=n,f-(o+r)<=1&&(z.current=!0),v()})(x,t?m:0);else{if(f-R>1?t?y=!0:h=0:(b=!0,n&&p<m&&(h=p-(x-(o+x-f)))),g=Math.ceil(g),0!==g&&w(g),y||null!=h){const t=En(e),n=y?t:pn(h,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(b||g>=f-1)&&(z.current=!0),v()}});je.useImperativeHandle(b,()=>G,[G]),g({open:D,ref:u,onComplete(){D&&c?.(!0)}});const X={open:D,transitionStatus:V,side:x,align:R};a(()=>{B&&u.current&&!Object.keys($.current).length&&($.current={top:B.style.top||"0",left:B.style.left||"0",right:B.style.right,height:B.style.height,bottom:B.style.bottom,minHeight:B.style.minHeight,maxHeight:B.style.maxHeight,marginTop:B.style.marginTop,marginBottom:B.style.marginBottom})},[u,B]),a(()=>{D||I||(q.current=!1,z.current=!1,_n(B,$.current))},[D,I,B,u]),a(()=>{const e=u.current;if(!D||!H||!B||!e||I&&!_||"ending"===s.state.transitionStatus)return;if(!I)return q.current=!0,Y.request(v),void e.style.removeProperty("--transform-origin");const t=function(e){const{style:t}=e,n={};for(const[r,o]of wt)n[r]=t.getPropertyValue(r),t.setProperty(r,o,"important");return()=>{for(const[e]of wt){const r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}(e);e.style.removeProperty("--transform-origin");try{let t=m.current;t?.isConnected||(t=!Qe.hasSelectedValue(s.state)&&p.current?.isConnected?p.current:null);const n=f.current,r=se(B),o=r.getComputedStyle(B),l=r.getComputedStyle(e),i=J(H),u=Cn(H),c=Dn(H.getBoundingClientRect(),u),a=Dn(B.getBoundingClientRect(),u),d=c.height,g=L||e,h=g.scrollHeight,b=parseFloat(l.borderBottomWidth),x=parseFloat(o.marginTop)||10,R=parseFloat(o.marginBottom)||10,I=parseFloat(o.minHeight)||100,_=Sn(l),A=5,T=5,E=20,C=i.documentElement.clientHeight-x-R,k=i.documentElement.clientWidth,D=C-c.bottom+d;let O,P="rtl"===S?c.right-a.width:c.left,N=0;if(t&&n){const e=Dn(n.getBoundingClientRect(),u);O=Dn(t.getBoundingClientRect(),u),P=a.left+("rtl"===S?e.right-O.right:e.left-O.left);const r=e.top-c.top+e.height/2;N=O.top-a.top+O.height/2-r}const V=D+N+R+b;let U=Math.min(C,V);const F=C-x-R,W=V-U,K=k-T;B.style.left=`${pn(P,A,K-a.width)}px`,B.style.height=`${U}px`,B.style.maxHeight="none",B.style.marginTop=`${x}px`,B.style.marginBottom=`${R}px`,e.style.height="100%";const Y=En(g),G=W>=Y-1;G&&(U=Math.min(C,a.height)-(W-Y));const X=c.top<E||c.bottom>C-E||Math.ceil(U)+1<Math.min(h,I),Q=1!==(r.visualViewport?.scale??1)&&j;if(X||Q)return q.current=!0,_n(B,$.current),void M(!1);const Z=Math.max(I,U);if(G){const e=Math.max(0,C-V);B.style.top=a.height>=F?"0":`${e}px`,B.style.height=`${U}px`,g.scrollTop=En(g)}else B.style.bottom="0",g.scrollTop=W;if(O){const t=a.top,n=a.height,r=O.top+O.height/2,o=pn(n>0?(r-t)/n*100:50,0,100);e.style.setProperty("--transform-origin",`50% ${o}%`)}(Z===C||U>=_)&&(z.current=!0),v(),w&&null===s.state.selectedIndex&&null===s.state.activeIndex&&null!=y.current[0]&&s.set("activeIndex",0),q.current=!0}finally{t()}},[s,D,B,H,f,p,m,u,v,I,M,Y,L,y,w,S,_]),je.useEffect(()=>{if(!I||!B||!D)return;const e=se(B);return ye(e,"resize",function(e){d(!1,W(ee,e))})},[d,I,B,D]);const Q={...L?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":h||void 0,id:`${k}-list`},onKeyDown(e){A&&de.has(e.key)&&e.stopPropagation()},onScroll(e){L||G(e.currentTarget)},...I&&{style:L?{height:"100%"}:ct}},te=U("div",e,{ref:[t,u],state:X,stateAttributesMapping:bt,props:[N,Q,Ee(V),{className:!L&&I?mt.className:void 0},i]});return(0,Je.jsxs)(je.Fragment,{children:[!C&&mt.getElement(E),(0,Je.jsx)(Z,{context:T,modal:!1,disabled:!P,openInteractionType:O,returnFocus:l,restoreFocus:!0,children:te})]})}),wt=[["transform","none"],["scale","1"],["translate","0 0"]],xt=je.forwardRef(function(e,t){const{render:n,className:r,style:o,...l}=e,{store:i,scrollHandlerRef:s}=Yt(),{alignItemWithTriggerActive:u}=In(),c=K(i,Qe.hasScrollArrows),a=K(i,Qe.openMethod),d=K(i,Qe.multiple),f={id:`${K(i,Qe.id)}-list`,role:"listbox","aria-multiselectable":d||void 0,onScroll(e){s.current?.(e.currentTarget)},...u&&{style:ct},className:c&&"touch"!==a?mt.className:void 0};return U("div",e,{ref:[t,ae(e=>{i.set("listElement",e)})],props:[f,l]})}),e("n",Rt=function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e}({})),It=je.createContext(void 0),_t=je.memo(je.forwardRef(function(e,t){const{render:n,className:r,style:o,value:l=null,label:i,disabled:s=!1,nativeButton:u=!1,...c}=e,d=je.useRef(null),f=On({label:i,textRef:d,indexGuessBehavior:Rt.GuessFromOrder}),{store:p,itemProps:m,setOpen:g,setValue:h,selectionRef:v,typingRef:b,valuesRef:y,multiple:w,selectedItemTextRef:x,disabled:R,readOnly:I}=Yt(),_=K(p,Qe.isActive,f.index),M=K(p,Qe.open),A=K(p,Qe.isSelected,l),T=K(p,Qe.isSelectedByFocus,f.index),E=K(p,Qe.isItemEqualToValue),C=f.index,k=-1!==C,D=je.useRef(null);a(()=>{if(!k)return;const e=y.current;return e[C]=l,()=>{delete e[C]}},[k,C,l,y]),a(()=>{if(!k)return;const e=p.state.value;let t=e;w&&Array.isArray(e)&&(t=e.length>0?e[e.length-1]:void 0),void 0!==t&&en(l,t,E)&&(p.set("selectedIndex",C),d.current&&(x.current=d.current))},[k,C,w,E,p,l,x]);const O=je.useRef(null),P=je.useRef("mouse"),N=je.useRef(!1),{getButtonProps:V,buttonRef:j}=Bt({disabled:s,focusableWhenDisabled:!0,native:u,composite:!0}),F={disabled:s,selected:A,highlighted:_};function H(){v.current.dragY=0}const B={role:"option","aria-selected":A,tabIndex:M&&_?0:-1,onKeyDown(e){O.current=e.key,p.set("activeIndex",C)," "===e.key&&b.current&&e.preventDefault()},onClick(e){const t="click"===e.type&&"touch"!==P.current,n=e.nativeEvent.pointerType,r=t&&$(e.nativeEvent)&&(void 0!==n||_),o=t&&!r&&!N.current;N.current=!1,"keydown"===e.type&&null===O.current||s||"keydown"===e.type&&" "===O.current&&b.current||o||(O.current=null,function(e){if(R||I)return;const t=p.state.value;if(w){const n=Array.isArray(t)?t:[];h(A?rn(n,l,E):[...n,l],W(S,e))}else h(l,W(S,e)),g(!1,W(S,e))}(e.nativeEvent))},onPointerEnter(e){P.current=e.pointerType},onPointerMove(e){if("mouse"===e.pointerType&&1===e.buttons){const t=v.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){P.current=e.pointerType,N.current=!0,H()},onMouseUp(){if(H(),s||"touch"===P.current)return;if(N.current)return;const e=!v.current.allowSelectedMouseUp&&A,t=!v.current.allowUnselectedMouseUp&&!A;e||t||(N.current=!0,D.current?.click(),N.current=!1)}},L=U("div",e,{ref:[j,t,f.ref,D],state:F,props:[m,B,c,V]}),z=je.useMemo(()=>({selected:A,index:C,textRef:d,selectedByFocus:T,hasRegistered:k}),[A,C,d,T,k]);return(0,Je.jsx)(It.Provider,{value:z,children:L})})),Mt=je.forwardRef(function(e,t){const n=e.keepMounted??!1,{selected:r}=Pn();return n||r?(0,Je.jsx)(At,{...e,ref:t}):null}),At=je.memo(je.forwardRef((e,t)=>{const{render:n,className:r,style:o,keepMounted:l,...i}=e,{selected:s}=Pn(),u=je.useRef(null),{transitionStatus:c,setMounted:a}=N(s),d=U("span",e,{ref:[t,u],state:{selected:s,transitionStatus:c},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:m});return g({open:s,ref:u,onComplete(){s||a(!1)}}),d})),Tt=je.memo(je.forwardRef(function(e,t){const{index:n,textRef:r,selectedByFocus:o,hasRegistered:l}=Pn(),{firstItemTextRef:i,selectedItemTextRef:s}=Yt(),{render:u,className:c,style:a,...d}=e;return U("div",e,{ref:[je.useCallback(e=>{e&&(l&&0===n&&(i.current=e),l&&o&&(s.current=e))},[i,s,n,o,l]),t,r],props:d})})),St={...c,...m},Et=je.forwardRef(function(e,t){const{render:n,className:r,style:o,...l}=e,{store:i}=Yt(),{side:s,align:u,arrowRef:c,arrowStyles:a,arrowUncentered:d,alignItemWithTriggerActive:f}=In(),p=U("div",e,{state:{open:K(i,Qe.open),side:s,align:u,uncentered:d},ref:[c,t],props:[{style:a,"aria-hidden":!0},l],stateAttributesMapping:St});return f?null:p}),Ct=je.forwardRef(function(e,t){const{render:n,className:r,style:o,direction:l,keepMounted:i=!1,...s}=e,u="up"===l,{store:c,popupRef:d,listRef:f,handleScrollArrowVisibility:p,scrollArrowsMountedCountRef:h}=Yt(),{side:v,scrollDownArrowRef:b,scrollUpArrowRef:y}=In(),w=K(c,u?Qe.scrollUpArrowVisible:Qe.scrollDownArrowVisible),x=K(c,Qe.openMethod),R=w&&"touch"!==x,I=E(),_=u?y:b,{mounted:M,transitionStatus:A,setMounted:T}=N(R);a(()=>(h.current+=1,c.state.hasScrollArrows||c.set("hasScrollArrows",!0),()=>{h.current=Math.max(0,h.current-1),0===h.current&&c.state.hasScrollArrows&&c.set("hasScrollArrows",!1)}),[c,h]),g({open:R,ref:_,onComplete(){R||T(!1)}});const S=U("div",e,{ref:[t,_],state:{direction:l,visible:R,side:v,transitionStatus:A},props:[{"aria-hidden":!0,children:u?"▲":"▼",style:{position:"absolute"},onMouseMove(e){0===e.movementX&&0===e.movementY||I.isStarted()||(c.set("activeIndex",null),I.start(40,function e(){const t=c.state.listElement??d.current;if(!t)return;c.set("activeIndex",null),p();const n=mn(t.scrollHeight,t.clientHeight),r=gn(t.scrollTop,n),o=r===(u?0:n),l=f.current;if(r!==t.scrollTop&&(t.scrollTop=r),0===l.length&&c.set(u?"scrollUpArrowVisible":"scrollDownArrowVisible",!o),o)I.clear();else{if(l.length>0){const e=_.current?.offsetHeight||0;t.scrollTop=function(e,t,n,r,o,l){if(t){let t=0;const r=n+o-1;for(let n=0;n<e.length;n+=1){const o=e[n];if(o&&o.offsetTop>=r){t=n;break}}const i=Math.max(0,t-1),s=e[i];return i<t&&s?gn(s.offsetTop-o,l):0}let i=e.length-1;const s=n+r-o+1;for(let a=0;a<e.length;a+=1){const t=e[a];if(t&&t.offsetTop+t.offsetHeight>s){i=Math.max(0,a-1);break}}const u=Math.min(e.length-1,i+1),c=e[u];return u>i&&c?gn(c.offsetTop+c.offsetHeight-r+o,l):l}(l,u,r,t.clientHeight,e,n)}I.start(40,e)}}))},onMouseLeave(){I.clear()}},s],stateAttributesMapping:m});return M||i?S:null}),kt=je.forwardRef(function(e,t){return(0,Je.jsx)(Ct,{...e,ref:t,direction:"down"})}),Dt=je.forwardRef(function(e,t){return(0,Je.jsx)(Ct,{...e,ref:t,direction:"up"})}),Ot={blink:"_blink_69vaw_1",fourtyfive:"_fourtyfive_69vaw_13",select:"_select_69vaw_17",medium:"_medium_69vaw_51",large:"_large_69vaw_55",fluid:"_fluid_69vaw_59",selectIcon:"_selectIcon_69vaw_63",popup:"_popup_69vaw_67",list:"_list_69vaw_82",item:"_item_69vaw_92",itemIndicator:"_itemIndicator_69vaw_110",itemIndicatorIcon:"_itemIndicatorIcon_69vaw_114",itemLabel:"_itemLabel_69vaw_120",scrollArrow:"_scrollArrow_69vaw_124"}}}}); //# sourceMappingURL=Select-legacy-DHLEukf3.js.map