b(...m)).find(b=>b!==void 0)}}}else a[c]=d}),a),{})}}s(u4,"mergeProps");function Gc(t){t===void 0&&(t=[]);const e=t.map(o=>o?.reference),n=t.map(o=>o?.floating),r=t.map(o=>o?.item),i=wp.element.useCallback(o=>u4(o,t,"reference"),e),l=wp.element.useCallback(o=>u4(o,t,"floating"),n),a=wp.element.useCallback(o=>u4(o,t,"item"),r);return wp.element.useMemo(()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:a}),[i,l,a])}s(Gc,"useInteractions");const GG="Escape";function Hp(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}s(Hp,"doSwitch");function Up(t,e){return Hp(e,t===i9||t===Zp,t===Kc||t===qc)}s(Up,"isMainOrientationKey");function c4(t,e,n){return Hp(e,t===Zp,n?t===Kc:t===qc)||t==="Enter"||t===" "||t===""}s(c4,"isMainOrientationToEndKey");function x9(t,e,n){return Hp(e,n?t===Kc:t===qc,t===Zp)}s(x9,"isCrossOrientationOpenKey");function $9(t,e,n,r){const i=n?t===qc:t===Kc,l=t===i9;return e==="both"||e==="horizontal"&&r&&r>1?t===GG:Hp(e,i,l)}s($9,"isCrossOrientationCloseKey");function Gp(t,e){const{open:n,onOpenChange:r,elements:i,floatingId:l}=t,{listRef:a,activeIndex:o,onNavigate:u=s(()=>{},"unstable_onNavigate"),enabled:c=!0,selectedIndex:d=null,allowEscape:f=!1,loop:h=!1,nested:p=!1,rtl:m=!1,virtual:g=!1,focusItemOnOpen:b="auto",focusItemOnHover:O=!0,openOnArrowKeyDown:v=!0,disabledIndices:y=void 0,orientation:w="vertical",parentOrientation:S,cols:x=1,scrollItemIntoView:C=!0,virtualItemRef:R,itemSizes:P,dense:E=!1}=e;process.env.NODE_ENV!=="production"&&(f&&(h||_p("`useListNavigation` looping must be enabled to allow escaping."),g||_p("`useListNavigation` must be virtual to allow escaping.")),w==="vertical"&&x>1&&_p("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const M=Vp(i.floating),N=oi(M),V=i4(),$=Wp();Ct(()=>{t.dataRef.current.orientation=w},[t,w]);const D=zt(()=>{u(B.current===-1?null:B.current)}),k=GO(i.domReference),j=wp.element.useRef(b),B=wp.element.useRef(d??-1),T=wp.element.useRef(null),A=wp.element.useRef(!0),F=wp.element.useRef(D),_=wp.element.useRef(!!i.floating),X=wp.element.useRef(n),I=wp.element.useRef(!1),Q=wp.element.useRef(!1),Z=oi(y),z=oi(n),W=oi(C),K=oi(d),[q,U]=wp.element.useState(),[te,se]=wp.element.useState(),re=zt(()=>{function G(he){if(g){var Oe;(Oe=he.id)!=null&&Oe.endsWith("-fui-option")&&(he.id=l+"-"+Math.random().toString(16).slice(2,10)),U(he.id),$?.events.emit("virtualfocus",he),R&&(R.current=he)}else _a(he,{sync:I.current,preventScroll:!0})}s(G,"runFocus");const oe=a.current[B.current],le=Q.current;oe&&G(oe),(I.current?he=>he():requestAnimationFrame)(()=>{const he=a.current[B.current]||oe;if(!he)return;oe||G(he);const Oe=W.current;Oe&&Be&&(le||!A.current)&&(he.scrollIntoView==null||he.scrollIntoView(typeof Oe=="boolean"?{block:"nearest",inline:"nearest"}:Oe))})});Ct(()=>{c&&(n&&i.floating?j.current&&d!=null&&(Q.current=!0,B.current=d,D()):_.current&&(B.current=-1,F.current()))},[c,n,i.floating,d,D]),Ct(()=>{if(c&&n&&i.floating)if(o==null){if(I.current=!1,K.current!=null)return;if(_.current&&(B.current=-1,re()),(!X.current||!_.current)&&j.current&&(T.current!=null||j.current===!0&&T.current==null)){let G=0;const oe=s(()=>{a.current[0]==null?(G<2&&(G?requestAnimationFrame:queueMicrotask)(oe),G++):(B.current=T.current==null||c4(T.current,w,m)||p?e4(a,Z.current):IE(a,Z.current),T.current=null,D())},"waitForListPopulated");oe()}}else Zc(a,o)||(B.current=o,re(),Q.current=!1)},[c,n,i.floating,o,K,p,a,w,m,D,re,Z]),Ct(()=>{var G;if(!c||i.floating||!$||g||!_.current)return;const oe=$.nodesRef.current,le=(G=oe.find(Oe=>Oe.id===V))==null||(G=G.context)==null?void 0:G.elements.floating,Se=Ll(mr(i.floating)),he=oe.some(Oe=>Oe.context&&Mn(Oe.context.elements.floating,Se));le&&!he&&A.current&&le.focus({preventScroll:!0})},[c,i.floating,$,V,g]),Ct(()=>{if(!c||!$||!g||V)return;function G(oe){se(oe.id),R&&(R.current=oe)}return s(G,"handleVirtualFocus"),$.events.on("virtualfocus",G),()=>{$.events.off("virtualfocus",G)}},[c,$,g,V,R]),Ct(()=>{F.current=D,X.current=n,_.current=!!i.floating}),Ct(()=>{n||(T.current=null,j.current=b)},[n,b]);const we=o!=null,Be=wp.element.useMemo(()=>{function G(le){if(!z.current)return;const Se=a.current.indexOf(le);Se!==-1&&B.current!==Se&&(B.current=Se,D())}return s(G,"syncCurrentTarget"),{onFocus(le){let{currentTarget:Se}=le;I.current=!0,G(Se)},onClick:s(le=>{let{currentTarget:Se}=le;return Se.focus({preventScroll:!0})},"onClick"),onMouseMove(le){let{currentTarget:Se}=le;I.current=!0,Q.current=!1,O&&G(Se)},onPointerLeave(le){let{pointerType:Se}=le;if(!(!A.current||Se==="touch")&&(I.current=!0,!!O&&(B.current=-1,D(),!g))){var he;(he=N.current)==null||he.focus({preventScroll:!0})}}}},[z,N,O,a,D,g]),pe=wp.element.useCallback(()=>{var G;return S??($==null||(G=$.nodesRef.current.find(oe=>oe.id===V))==null||(G=G.context)==null||(G=G.dataRef)==null?void 0:G.current.orientation)},[V,$,S]),Ae=zt(G=>{if(A.current=!1,I.current=!0,G.which===229||!z.current&&G.currentTarget===N.current)return;if(p&&$9(G.key,w,m,x)){Up(G.key,pe())||Lt(G),r(!1,G.nativeEvent,"list-navigation"),jt(i.domReference)&&(g?$?.events.emit("virtualfocus",i.domReference):i.domReference.focus());return}const oe=B.current,le=e4(a,y),Se=IE(a,y);if(k||(G.key==="Home"&&(Lt(G),B.current=le,D()),G.key==="End"&&(Lt(G),B.current=Se,D())),x>1){const he=P||Array.from({length:a.current.length},()=>({width:1,height:1})),Oe=ZU(he,x,E),je=Oe.findIndex(me=>me!=null&&!Ip(a,me,y)),et=Oe.reduce((me,Me,H)=>Me!=null&&!Ip(a,Me,y)?H:me,-1),He=Oe[zU({current:Oe.map(me=>me!=null?a.current[me]:null)},{event:G,orientation:w,loop:h,rtl:m,cols:x,disabledIndices:_U([...(typeof y!="function"?y:null)||a.current.map((me,Me)=>Ip(a,Me,y)?Me:void 0),void 0],Oe),minIndex:je,maxIndex:et,prevIndex:JU(B.current>Se?le:B.current,he,Oe,x,G.key===Zp?"bl":G.key===(m?Kc:qc)?"tr":"tl"),stopEvent:!0})];if(He!=null&&(B.current=He,D()),w==="both")return}if(Up(G.key,w)){if(Lt(G),n&&!g&&Ll(G.currentTarget.ownerDocument)===G.currentTarget){B.current=c4(G.key,w,m)?le:Se,D();return}c4(G.key,w,m)?h?B.current=oe>=Se?f&&oe!==a.current.length?-1:le:tn(a,{startingIndex:oe,disabledIndices:y}):B.current=Math.min(Se,tn(a,{startingIndex:oe,disabledIndices:y})):h?B.current=oe<=le?f&&oe!==-1?a.current.length:Se:tn(a,{startingIndex:oe,decrement:!0,disabledIndices:y}):B.current=Math.max(le,tn(a,{startingIndex:oe,decrement:!0,disabledIndices:y})),Zc(a,B.current)&&(B.current=-1),D()}}),J=wp.element.useMemo(()=>g&&n&&we&&{"aria-activedescendant":te||q},[g,n,we,te,q]),ae=wp.element.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...k?{}:J,onKeyDown:Ae,onPointerMove(){A.current=!0}}),[J,Ae,w,k]),Xe=wp.element.useMemo(()=>{function G(le){b==="auto"&&QE(le.nativeEvent)&&(j.current=!0)}s(G,"checkVirtualMouse");function oe(le){j.current=b,b==="auto"&&VE(le.nativeEvent)&&(j.current=!0)}return s(oe,"checkVirtualPointer"),{...J,onKeyDown(le){A.current=!1;const Se=le.key.startsWith("Arrow"),he=["Home","End"].includes(le.key),Oe=Se||he,je=x9(le.key,w,m),et=$9(le.key,w,m,x),He=x9(le.key,pe(),m),me=Up(le.key,w),Me=(p?He:me)||le.key==="Enter"||le.key.trim()==="";if(g&&n){const Le=$?.nodesRef.current.find(zn=>zn.parentId==null),tt=$&&Le?QU($.nodesRef.current,Le.id):null;if(Oe&&tt&&R){const zn=new KeyboardEvent("keydown",{key:le.key,bubbles:!0});if(je||et){var H,ke;const wh=((H=tt.context)==null?void 0:H.elements.domReference)===le.currentTarget,lc=et&&!wh?(ke=tt.context)==null?void 0:ke.elements.domReference:je?a.current.find(Sa=>Sa?.id===q):null;lc&&(Lt(le),lc.dispatchEvent(zn),se(void 0))}if((me||he)&&tt.context&&tt.context.open&&tt.parentId&&le.currentTarget!==tt.context.elements.domReference){var De;Lt(le),(De=tt.context.elements.domReference)==null||De.dispatchEvent(zn);return}}return Ae(le)}if(!(!n&&!v&&Se)){if(Me){const Le=Up(le.key,pe());T.current=p&&Le?null:le.key}if(p){He&&(Lt(le),n?(B.current=e4(a,Z.current),D()):r(!0,le.nativeEvent,"list-navigation"));return}me&&(d!=null&&(B.current=d),Lt(le),!n&&v?r(!0,le.nativeEvent,"list-navigation"):Ae(le),n&&D())}},onFocus(){n&&!g&&(B.current=-1,D())},onPointerDown:oe,onPointerEnter:oe,onMouseDown:G,onClick:G}},[q,J,x,Ae,Z,b,a,p,D,r,n,v,w,pe,m,d,$,g,R]);return wp.element.useMemo(()=>c?{reference:Xe,floating:ae,item:Be}:{},[c,Xe,ae,Be])}s(Gp,"useListNavigation");const eee=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ed(t,e){var n,r;e===void 0&&(e={});const{open:i,elements:l,floatingId:a}=t,{enabled:o=!0,role:u="dialog"}=e,c=Jp(),d=((n=l.domReference)==null?void 0:n.id)||c,f=wp.element.useMemo(()=>{var v;return((v=Vp(l.floating))==null?void 0:v.id)||a},[l.floating,a]),h=(r=eee.get(u))!=null?r:u,m=i4()!=null,g=wp.element.useMemo(()=>h==="tooltip"||u==="label"?{["aria-"+(u==="label"?"labelledby":"describedby")]:i?f:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":h==="alertdialog"?"dialog":h,"aria-controls":i?f:void 0,...h==="listbox"&&{role:"combobox"},...h==="menu"&&{id:d},...h==="menu"&&m&&{role:"menuitem"},...u==="select"&&{"aria-autocomplete":"none"},...u==="combobox"&&{"aria-autocomplete":"list"}},[h,f,m,i,d,u]),b=wp.element.useMemo(()=>{const v={id:f,...h&&{role:h}};return h==="tooltip"||u==="label"?v:{...v,...h==="menu"&&{"aria-labelledby":d}}},[h,f,d,u]),O=wp.element.useCallback(v=>{let{active:y,selected:w}=v;const S={role:"option",...y&&{id:f+"-fui-option"}};switch(u){case"select":case"combobox":return{...S,"aria-selected":w}}return{}},[f,u]);return wp.element.useMemo(()=>o?{reference:g,floating:b,item:O}:{},[o,g,b,O])}s(ed,"useRole");function S9(t,e){var n;const{open:r,dataRef:i}=t,{listRef:l,activeIndex:a,onMatch:o,onTypingChange:u,enabled:c=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:h=[],selectedIndex:p=null}=e,m=wp.element.useRef(-1),g=wp.element.useRef(""),b=wp.element.useRef((n=p??a)!=null?n:-1),O=wp.element.useRef(null),v=zt(o),y=zt(u),w=oi(d),S=oi(h);Ct(()=>{r&&(l4(m),O.current=null,g.current="")},[r]),Ct(()=>{if(r&&g.current===""){var E;b.current=(E=p??a)!=null?E:-1}},[r,p,a]);const x=zt(E=>{E?i.current.typing||(i.current.typing=E,y(E)):i.current.typing&&(i.current.typing=E,y(E))}),C=zt(E=>{function M(k,j,B){const T=w.current?w.current(j,B):j.find(A=>A?.toLocaleLowerCase().indexOf(B.toLocaleLowerCase())===0);return T?k.indexOf(T):-1}s(M,"getMatchingIndex");const N=l.current;if(g.current.length>0&&g.current[0]!==" "&&(M(N,N,g.current)===-1?x(!1):E.key===" "&&Lt(E)),N==null||S.current.includes(E.key)||E.key.length!==1||E.ctrlKey||E.metaKey||E.altKey)return;r&&E.key!==" "&&(Lt(E),x(!0)),N.every(k=>{var j,B;return k?((j=k[0])==null?void 0:j.toLocaleLowerCase())!==((B=k[1])==null?void 0:B.toLocaleLowerCase()):!0})&&g.current===E.key&&(g.current="",b.current=O.current),g.current+=E.key,l4(m),m.current=window.setTimeout(()=>{g.current="",b.current=O.current,x(!1)},f);const $=b.current,D=M(N,[...N.slice(($||0)+1),...N.slice(0,($||0)+1)],g.current);D!==-1?(v(D),O.current=D):E.key!==" "&&(g.current="",x(!1))}),R=wp.element.useMemo(()=>({onKeyDown:C}),[C]),P=wp.element.useMemo(()=>({onKeyDown:C,onKeyUp(E){E.key===" "&&x(!1)}}),[C,x]);return wp.element.useMemo(()=>c?{reference:R,floating:P}:{},[c,R,P])}s(S9,"useTypeahead");const d4="tui",td=`${d4}-interface`,Wa=`${d4}-portal-root`,Xo=new WeakMap;function C9(t){const e=document.createElement("div");return e.id=t,e.style.cssText="position: fixed; inset: 0; pointer-events: none; z-index: var(--tui-layer-portal, 9999);",e}s(C9,"createPortalRoot");const em=`${d4}-global-interface`;function tee(){let t=document.getElementById(em);if(!t){t=document.createElement("div"),t.id=em,t.className=td;const e=document.body.getAttribute("data-theme")??document.documentElement.getAttribute("data-theme");e&&t.setAttribute("data-theme",e),document.body.appendChild(t)}return t}s(tee,"getOrCreateGlobalInterface");function R9(){const t=document.getElementById(em);if(!t)return;const e=document.querySelector(`.${td}:not(#${em})`);if(!e)return;const n=t.querySelector(`[id^="${Wa}"]`);n&&(e.appendChild(n),Xo.set(e,n)),t.childElementCount===0&&t.remove()}s(R9,"reconcileFallback");function k9(){R9();const t=document.getElementById(Wa);if(t)return t;let e=document.querySelector(`.${td}`);e||(e=tee());const n=C9(Wa);return e.appendChild(n),Xo.set(e,n),n}s(k9,"getPortalRoot");function Io(t){if(R9(),!t)return k9();const e=t.closest(`.${td}`);if(!e)return k9();const n=Xo.get(e);if(n&&e.contains(n))return n;const r=document.getElementById(Wa);if(r&&e.contains(r))return Xo.set(e,r),r;const i=e.querySelector(`[id^="${Wa}"]`);if(i)return Xo.set(e,i),i;const l=document.querySelectorAll(`.${td}`),a=Array.from(l).indexOf(e),o=a===0?Wa:`${Wa}-${a}`,u=C9(o);return e.appendChild(u),Xo.set(e,u),u}s(Io,"getPortalRootFor");const D9=wp.element.createContext(null);function f4(){const t=wp.element.useContext(D9);if(!t)throw new Error("Tooltip compound components must be used within