1"use strict";(self.webpackChunkmatkahuolto_web=self.webpackChunkmatkahuolto_web||[]).push([[1833],{8568:function(e,n,t){var r;t.r(n),t.d(n,{Composite:function(){return _},CompositeItem:function(){return W},FloatingArrow:function(){return X},FloatingDelayGroup:function(){return ae},FloatingFocusManager:function(){return Ue},FloatingList:function(){return F},FloatingNode:function(){return ee},FloatingOverlay:function(){return Ve},FloatingPortal:function(){return Ne},FloatingTree:function(){return ne},arrow:function(){return f.UE},autoPlacement:function(){return f.RK},autoUpdate:function(){return d.ll},computePosition:function(){return d.rD},detectOverflow:function(){return d.__},flip:function(){return f.UU},getOverflowAncestors:function(){return l.v9},hide:function(){return f.jD},inline:function(){return f.mG},inner:function(){return Mn},limitShift:function(){return f.ER},offset:function(){return f.cY},platform:function(){return d.iD},safePolygon:function(){return Ln},shift:function(){return f.BN},size:function(){return f.Ej},useClick:function(){return Qe},useClientPoint:function(){return en},useDelayGroup:function(){return fe},useDelayGroupContext:function(){return se},useDismiss:function(){return on},useFloating:function(){return cn},useFloatingNodeId:function(){return J},useFloatingParentNodeId:function(){return $},useFloatingPortalNode:function(){return De},useFloatingRootContext:function(){return un},useFloatingTree:function(){return Q},useFocus:function(){return ln},useHover:function(){return ie},useId:function(){return U},useInnerOffset:function(){return Cn},useInteractions:function(){return dn},useListItem:function(){return j},useListNavigation:function(){return hn},useMergeRefs:function(){return v},useRole:function(){return bn},useTransitionStatus:function(){return xn},useTransitionStyles:function(){return wn},useTypeahead:function(){return kn}});var o=t(96540),u=t(66984),i=t(97193),c=t(74848),l=t(86635),s=t(49054),a=t(40961),f=t(34743),d=t(46885);function v(e){return o.useMemo((()=>e.every((e=>null==e))?null:n=>{e.forEach((e=>{"function"==typeof e?e(n):null!=e&&(e.current=n)}))}),e)}const m={...r||(r=t.t(o,2))},p=m.useInsertionEffect||(e=>e());function g(e){const n=o.useRef((()=>{0}));return p((()=>{n.current=e})),o.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}const h="ArrowUp",y="ArrowDown",b="ArrowLeft",E="ArrowRight";function R(e,n,t){return Math.floor(e/n)!==t}function x(e,n){return n<0||n>=e.current.length}function w(e,n){return I(e,{disabledIndices:n})}function k(e,n){return I(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:n})}function I(e,n){let{startingIndex:t=-1,decrement:r=!1,disabledIndices:o,amount:u=1}=void 0===n?{}:n;const i=e.current;let c=t;do{c+=r?-u:u}while(c>=0&&c<=i.length-1&&O(i,c,o));return c}function M(e,n){let{event:t,orientation:r,loop:o,rtl:c,cols:l,disabledIndices:s,minIndex:a,maxIndex:f,prevIndex:d,stopEvent:v=!1}=n,m=d;if(t.key===h){if(v&&(0,u.jo)(t),-1===d)m=f;else if(m=I(e,{startingIndex:m,amount:l,decrement:!0,disabledIndices:s}),o&&(d-l<a||m<0)){const e=d%l,n=f%l,t=f-(n-e);m=n===e?f:n>e?t:t-l}x(e,m)&&(m=d)}if(t.key===y&&(v&&(0,u.jo)(t),-1===d?m=a:(m=I(e,{startingIndex:d,amount:l,disabledIndices:s}),o&&d+l>f&&(m=I(e,{startingIndex:d%l-l,amount:l,disabledIndices:s}))),x(e,m)&&(m=d)),"both"===r){const n=(0,i.RI)(d/l);t.key===(c?b:E)&&(v&&(0,u.jo)(t),d%l!=l-1?(m=I(e,{startingIndex:d,disabledIndices:s}),o&&R(m,l,n)&&(m=I(e,{startingIndex:d-d%l-1,disabledIndices:s}))):o&&(m=I(e,{startingIndex:d-d%l-1,disabledIndices:s})),R(m,l,n)&&(m=d)),t.key===(c?E:b)&&(v&&(0,u.jo)(t),d%l!=0?(m=I(e,{startingIndex:d,decrement:!0,disabledIndices:s}),o&&R(m,l,n)&&(m=I(e,{startingIndex:d+(l-d%l),decrement:!0,disabledIndices:s}))):o&&(m=I(e,{startingIndex:d+(l-d%l),decrement:!0,disabledIndices:s})),R(m,l,n)&&(m=d));const r=(0,i.RI)(f/l)===n;x(e,m)&&(m=o&&r?t.key===(c?E:b)?f:I(e,{startingIndex:d-d%l-1,disabledIndices:s}):d)}return m}function C(e,n,t){const r=[];let o=0;return e.forEach(((e,u)=>{let{width:i,height:c}=e,l=!1;for(t&&(o=0);!l;){const e=[];for(let t=0;t<i;t++)for(let r=0;r<c;r++)e.push(o+t+r*n);o%n+i<=n&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=u})),l=!0):o++}})),[...r]}function T(e,n,t,r,o){if(-1===e)return-1;const u=t.indexOf(e),i=n[e];switch(o){case"tl":return u;case"tr":return i?u+i.width-1:u;case"bl":return i?u+(i.height-1)*r:u;case"br":return t.lastIndexOf(e)}}function L(e,n){return n.flatMap(((n,t)=>e.includes(n)?[t]:[]))}function O(e,n,t){if(t)return t.includes(n);const r=e[n];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var P="undefined"!=typeof document?o.useLayoutEffect:o.useEffect;function S(e,n){const t=e.compareDocumentPosition(n);return t&Node.DOCUMENT_POSITION_FOLLOWING||t&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:t&Node.DOCUMENT_POSITION_PRECEDING||t&Node.DOCUMENT_POSITION_CONTAINS?1:0}const A=o.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function F(e){const{children:n,elementsRef:t,labelsRef:r}=e,[u,i]=o.useState((()=>new Map)),l=o.useCallback((e=>{i((n=>new Map(n).set(e,null)))}),[]),s=o.useCallback((e=>{i((n=>{const t=new Map(n);return t.delete(e),t}))}),[]);return P((()=>{const e=new Map(u);
1Array.from(e.keys()).sort(S).forEach(((n,t)=>{e.set(n,t)})),function(e,n){if(e.size!==n.size)return!1;for(const[t,r]of e.entries())if(r!==n.get(t))return!1;return!0}(u,e)||i(e)}),[u]),(0,c.jsx)(A.Provider,{value:o.useMemo((()=>({register:l,unregister:s,map:u,elementsRef:t,labelsRef:r})),[l,s,u,t,r]),children:n})}function j(e){void 0===e&&(e={});const{label:n}=e,{register:t,unregister:r,map:u,elementsRef:i,labelsRef:c}=o.useContext(A),[l,s]=o.useState(null),a=o.useRef(null),f=o.useCallback((e=>{if(a.current=e,null!==l&&(i.current[l]=e,c)){var t;const r=void 0!==n;c.current[l]=r?n:null!=(t=null==e?void 0:e.textContent)?t:null}}),[l,i,c,n]);return P((()=>{const e=a.current;if(e)return t(e),()=>{r(e)}}),[t,r]),P((()=>{const e=a.current?u.get(a.current):null;null!=e&&s(e)}),[u]),o.useMemo((()=>({ref:f,index:null==l?-1:l})),[l,f])}function D(e,n){return"function"==typeof e?e(n):e?o.cloneElement(e,n):(0,c.jsx)("div",{...n})}const N=o.createContext({activeIndex:0,onNavigate:()=>{}}),q=[b,E],K=[h,y],Y=[...q,...K],_=o.forwardRef((function(e,n){const{render:t,orientation:r="both",loop:u=!0,rtl:i=!1,cols:l=1,disabledIndices:s,activeIndex:a,onNavigate:f,itemSizes:d,dense:v=!1,...m}=e,[p,R]=o.useState(0),P=null!=a?a:p,S=g(null!=f?f:R),A=o.useRef([]),j=t&&"function"!=typeof t?t.props:{},_=o.useMemo((()=>({activeIndex:P,onNavigate:S})),[P,S]),W=l>1;const H={...m,...j,ref:n,"aria-orientation":"both"===r?void 0:r,onKeyDown(e){null==m.onKeyDown||m.onKeyDown(e),null==j.onKeyDown||j.onKeyDown(e),function(e){if(!Y.includes(e.key))return;let n=P;const t=w(A,s),o=k(A,s),c=i?b:E,a=i?E:b;if(W){const a=d||Array.from({length:A.current.length},(()=>({width:1,height:1}))),f=C(a,l,v),m=f.findIndex((e=>null!=e&&!O(A.current,e,s))),p=f.reduce(((e,n,t)=>null==n||O(A.current,n,s)?e:t),-1),g=f[M({current:f.map((e=>e?A.current[e]:null))},{event:e,orientation:r,loop:u,rtl:i,cols:l,disabledIndices:L([...s||A.current.map(((e,n)=>O(A.current,n)?n:void 0)),void 0],f),minIndex:m,maxIndex:p,prevIndex:T(P>o?t:P,a,f,l,e.key===y?"bl":e.key===c?"tr":"tl")})];null!=g&&(n=g)}const f={horizontal:[c],vertical:[y],both:[c,y]}[r],m={horizontal:[a],vertical:[h],both:[a,h]}[r],p=W?Y:{horizontal:q,vertical:K,both:Y}[r];var g;n===P&&[...f,...m].includes(e.key)&&(n=u&&n===o&&f.includes(e.key)?t:u&&n===t&&m.includes(e.key)?o:I(A,{startingIndex:n,decrement:m.includes(e.key),disabledIndices:s})),n===P||x(A,n)||(e.stopPropagation(),p.includes(e.key)&&e.preventDefault(),S(n),null==(g=A.current[n])||g.focus())}(e)}};return(0,c.jsx)(N.Provider,{value:_,children:(0,c.jsx)(F,{elementsRef:A,children:D(t,H)})})})),W=o.forwardRef((function(e,n){const{render:t,...r}=e,u=t&&"function"!=typeof t?t.props:{},{activeIndex:i,onNavigate:c}=o.useContext(N),{ref:l,index:s}=j(),a=v([l,n,u.ref]),f=i===s;return D(t,{...r,...u,ref:a,tabIndex:f?0:-1,"data-active":f?"":void 0,onFocus(e){null==r.onFocus||r.onFocus(e),null==u.onFocus||u.onFocus(e),c(s)}})}));let H=!1,B=0;const z=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+B++;const U=m.useId||function(){const[e,n]=o.useState((()=>H?z():void 0));return P((()=>{null==e&&n(z())}),[]),o.useEffect((()=>{H=!0}),[]),e};const X=o.forwardRef((function(e,n){const{context:{placement:t,elements:{floating:r},middlewareData:{arrow:u,shift:i}},width:s=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:v,stroke:m,d:p,style:{transform:g,...h}={},...y}=e;const b=U(),[E,R]=o.useState(!1);if(P((()=>{if(!r)return;"rtl"===(0,l.L9)(r).direction&&R(!0)}),[r]),!r)return null;const[x,w]=t.split("-"),k="top"===x||"bottom"===x;let I=v;(k&&null!=i&&i.x||!k&&null!=i&&i.y)&&(I=null);const M=2*d,C=M/2,T=s/2*(f/-8+1),L=a/2*f/4,O=!!p,S=I&&"end"===w?"bottom":"top";let A=I&&"end"===w?"right":"left";I&&E&&(A="end"===w?"left":"right");const F=null!=(null==u?void 0:u.x)?I||u.x:"",j=null!=(null==u?void 0:u.y)?I||u.y:"",D=p||"M0,0 H"+s+" L"+(s-T)+","+(a-L)+" Q"+s/2+","+a+" "+T+","+(a-L)+" Z",N={top:O?"rotate(180deg)":"",left:O?"rotate(90deg)":"rotate(-90deg)",bottom:O?"":"rotate(180deg)",right:O?"rotate(-90deg)":"rotate(90deg)"}[x];return(0,c.jsxs)("svg",{...y,"aria-hidden":!0,ref:n,width:O?s:s+M,height:s,viewBox:"0 0 "+s+" "+(a>s?a:s),style:{position:"absolute",pointerEvents:"none",[A]:F,[S]:j,[x]:k||O?"100%":"calc(100% - "+M/2+"px)",transform:[N,g].filter((e=>!!e)).join(" "),...h},children:[M>0&&(0,c.jsx)("path",{clipPath:"url(#"+b+")",fill:"none",stroke:m,strokeWidth:M+(p?0:1),d:D}),(0,c.jsx)("path",{stroke:M&&!p?y.fill:"none",d:D}),(0,c.jsx)("clipPath",{id:b,children:(0,c.jsx)("rect",{x:-C,y:C*(O?-1:1),width:s+M,height:s})})]})}));function G(){const e=new Map;return{emit(n,t){var r;null==(r=e.get(n))||r.forEach((e=>e(t)))},on(n,t){e.set(n,[...e.get(n)||[],t])},off(n,t){var r;e.set(n,(null==(r=e.get(n))?void 0:r.filter((e=>e!==t)))||[])}}}const V=o.createContext(null),Z=o.createContext(null),$=()=>{var e;return(null==(e=o.useContext(V))?void 0:e.id)||null},Q=()=>o.useContext(Z);function J(e){const n=U(),t=Q(),r=$(),o=e||r;return P((()=>
1{if(!n)return;const e={id:n,parentId:o};return null==t||t.addNode(e),()=>{null==t||t.removeNode(e)}}),[t,n,o]),n}function ee(e){const{children:n,id:t}=e,r=$();return(0,c.jsx)(V.Provider,{value:o.useMemo((()=>({id:t,parentId:r})),[t,r]),children:n})}function ne(e){const{children:n}=e,t=o.useRef([]),r=o.useCallback((e=>{t.current=[...t.current,e]}),[]),u=o.useCallback((e=>{t.current=t.current.filter((n=>n!==e))}),[]),i=o.useState((()=>G()))[0];return(0,c.jsx)(Z.Provider,{value:o.useMemo((()=>({nodesRef:t,addNode:r,removeNode:u,events:i})),[r,u,i]),children:n})}function te(e){return"data-floating-ui-"+e}function re(e){const n=(0,o.useRef)(e);return P((()=>{n.current=e})),n}const oe=te("safe-polygon");function ue(e,n,t){return t&&!(0,u.Go)(t)?0:"number"==typeof e?e:null==e?void 0:e[n]}function ie(e,n){void 0===n&&(n={});const{open:t,onOpenChange:r,dataRef:i,events:c,elements:s}=e,{enabled:a=!0,delay:f=0,handleClose:d=null,mouseOnly:v=!1,restMs:m=0,move:p=!0}=n,h=Q(),y=$(),b=re(d),E=re(f),R=re(t),x=o.useRef(),w=o.useRef(-1),k=o.useRef(),I=o.useRef(-1),M=o.useRef(!0),C=o.useRef(!1),T=o.useRef((()=>{})),L=o.useRef(!1),O=o.useCallback((()=>{var e;const n=null==(e=i.current.openEvent)?void 0:e.type;return(null==n?void 0:n.includes("mouse"))&&"mousedown"!==n}),[i]);o.useEffect((()=>{if(a)return c.on("openchange",e),()=>{c.off("openchange",e)};function e(e){let{open:n}=e;n||(clearTimeout(w.current),clearTimeout(I.current),M.current=!0,L.current=!1)}}),[a,c]),o.useEffect((()=>{if(!a)return;if(!b.current)return;if(!t)return;function e(e){O()&&r(!1,e,"hover")}const n=(0,u.YE)(s.floating).documentElement;return n.addEventListener("mouseleave",e),()=>{n.removeEventListener("mouseleave",e)}}),[s.floating,t,r,a,b,O]);const S=o.useCallback((function(e,n,t){void 0===n&&(n=!0),void 0===t&&(t="hover");const o=ue(E.current,"close",x.current);o&&!k.current?(clearTimeout(w.current),w.current=window.setTimeout((()=>r(!1,e,t)),o)):n&&(clearTimeout(w.current),r(!1,e,t))}),[E,r]),A=g((()=>{T.current(),k.current=void 0})),F=g((()=>{if(C.current){const e=(0,u.YE)(s.floating).body;e.style.pointerEvents="",e.removeAttribute(oe),C.current=!1}})),j=g((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));o.useEffect((()=>{if(a&&(0,l.vq)(s.domReference)){var e;const r=s.domReference;return t&&r.addEventListener("mouseleave",c),null==(e=s.floating)||e.addEventListener("mouseleave",c),p&&r.addEventListener("mousemove",n,{once:!0}),r.addEventListener("mouseenter",n),r.addEventListener("mouseleave",o),()=>{var e;t&&r.removeEventListener("mouseleave",c),null==(e=s.floating)||e.removeEventListener("mouseleave",c),p&&r.removeEventListener("mousemove",n),r.removeEventListener("mouseenter",n),r.removeEventListener("mouseleave",o)}}function n(e){if(clearTimeout(w.current),M.current=!1,v&&!(0,u.Go)(x.current)||m>0&&!ue(E.current,"open"))return;const n=ue(E.current,"open",x.current);n?w.current=window.setTimeout((()=>{R.current||r(!0,e,"hover")}),n):t||r(!0,e,"hover")}function o(e){if(j())return;T.current();const n=(0,u.YE)(s.floating);if(clearTimeout(I.current),L.current=!1,b.current&&i.current.floatingContext){t||clearTimeout(w.current),k.current=b.current({...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){F(),A(),j()||S(e,!0,"safe-polygon")}});const r=k.current;return n.addEventListener("mousemove",r),void(T.current=()=>{n.removeEventListener("mousemove",r)})}("touch"!==x.current||!(0,u.gR)(s.floating,e.relatedTarget))&&S(e)}function c(e){j()||i.current.floatingContext&&(null==b.current||b.current({...i.current.floatingContext,tree:h,x:e.clientX,y:e.clientY,onClose(){F(),A(),j()||S(e)}})(e))}}),[s,a,e,v,m,p,S,A,F,r,t,R,h,E,b,i,j]),P((()=>{var e;if(a&&t&&null!=(e=b.current)&&e.__options.blockPointerEvents&&O()){C.current=!0;const e=s.floating;if((0,l.vq)(s.domReference)&&e){var n;const t=(0,u.YE)(s.floating).body;t.setAttribute(oe,"");const r=s.domReference,o=null==h||null==(n=h.nodesRef.current.find((e=>e.id===y)))||null==(n=n.context)?void 0:n.elements.floating;return o&&(o.style.pointerEvents=""),t.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{t.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[a,t,y,s,h,b,O]),P((()=>{t||(x.current=void 0,L.current=!1,A(),F())}),[t,A,F]),o.useEffect((()=>()=>{A(),clearTimeout(w.current),clearTimeout(I.current),F()}),[a,s.domReference,A,F]);const D=o.useMemo((()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:n}=e;function o(){M.current||R.current||r(!0,n,"hover")}v&&!(0,u.Go)(x.current)||t||0===m||L.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(I.current),"touch"===x.current?o():(L.current=!0,I.current=window.setTimeout(o,m)))}}}),[v,r,t,R,m]),N=o.useMemo((()=>({onMouseEnter(){clearTimeout(w.current)},onMouseLeave(e){j()||S(e.nativeEvent,!1)}})),[S,j]);return o.useMemo((()=>a?{reference:D,floating:N}:{}),[a,D,N])}const ce=()=>{},le=o.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:ce,setState:ce,isInstantPhase:!1}),se=()=>o.useContext(le);function ae(e){const{children:n,delay:t,timeoutMs:r=0}=e,[u,i]=o.useReducer(((e,n)=>({...e,...n})),{delay:t,timeoutMs:r,initialDelay:t,currentId:null,isInstantPhase:!1}),l=o.useRef(null),s=o.useCallback((e=>{i({currentId:e})}),[]);return P((()=>{u.currentId?null===l.current?l.current=u.currentId:u.isInstantPhase||i({isInstantPhase:!0}):(u.isInstantPhase&&i({isInstantPhase:!1}),l.current=null)}),[u.currentId,u.isInstantPhase]),(0,c.jsx)(le.Provider,{value:o.useMemo((()=>({...u,setState:i,setCurrentId:s})),[u,s]),children:n})}function fe(e,n){void 0===n&&(n={});const{open:t,onOpenChange:r,floatingId:o}=e,{id:u,enabled:i=!0}=n,c=null!=u?u:o,l=se(),{currentId:s,setCurrentId:a,initialDelay:f,setState:d,timeoutMs:v}=l;return P((()=>{i&&s&&(d({delay:{open:1,close:ue(f,"close")}}),s!==c&&r(!1))}),[i,c,r,d,s,f]),P((()=>{function e(){r(!1),d({delay:f,currentId:null})}if(i&&s&&!t&&s===c){if(v){const n=window.setTimeout(e,v);return()=>{clearTimeout(n)}}e()}}),[i,t,d,s,c,r,f,v]),P((()=>{i&&a!==ce&&t&&a(c)}),[i,t,a,c]),l}let de=0;function ve(e,n){void 0===n&&(n={});const{preventScroll:t=!1,cancelPrevious:r=!0,sync:o=!1}=n;r&&cancelAnimationFrame(de);const u=()=>null==e?void 0:e.focus({preventScroll:t});o?u():de=requestAnimationFrame(u)}function me(e,n){var t;let r=[],o=null==(t=e.find((e=>e.id===n)))?void 0:t.parentId;for(;o;){const n=e.find((e=>e.id===o));o=null==n?void 0:n.parentId,n&&(r=r.concat(n))}return r}function pe(e,n){let t=e.filter((e=>{var t;return e.parentId===n&&(null==(t=e.context)?void 0:t.open)})),r=t;for(;r.length;)r=e.filter((e=>{var n;return null==(n=r)?void 0:n.some((n=>{var t;return e.parentId===n.id&&(null==(t=e.context)?void 0:t.open)}))})),t=t.concat(r);return t}
1let ge=new WeakMap,he=new WeakSet,ye={},be=0;const Ee=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,Re=e=>e&&(e.host||Re(e.parentNode)),xe=(e,n)=>n.map((n=>{if(e.contains(n))return n;const t=Re(n);return e.contains(t)?t:null})).filter((e=>null!=e));function we(e,n,t){void 0===n&&(n=!1),void 0===t&&(t=!1);const r=(0,u.YE)(e[0]).body;return function(e,n,t,r){const o="data-floating-ui-inert",u=r?"inert":t?"aria-hidden":null,i=xe(n,e),c=new Set,s=new Set(i),a=[];ye[o]||(ye[o]=new WeakMap);const f=ye[o];return i.forEach((function e(n){n&&!c.has(n)&&(c.add(n),n.parentNode&&e(n.parentNode))})),function e(n){n&&!s.has(n)&&[].forEach.call(n.children,(n=>{if("script"!==(0,l.mq)(n))if(c.has(n))e(n);else{const e=u?n.getAttribute(u):null,t=null!==e&&"false"!==e,r=ge.get(n)||0,i=u?r+1:r,c=(f.get(n)||0)+1;ge.set(n,i),f.set(n,c),a.push(n),1===i&&t&&he.add(n),1===c&&n.setAttribute(o,""),!t&&u&&n.setAttribute(u,"true")}}))}(n),c.clear(),be++,()=>{a.forEach((e=>{const n=ge.get(e)||0,t=u?n-1:n,r=(f.get(e)||0)-1;ge.set(e,t),f.set(e,r),t||(!he.has(e)&&u&&e.removeAttribute(u),he.delete(e)),r||e.removeAttribute(o)})),be--,be||(ge=new WeakMap,ge=new WeakMap,he=new WeakSet,ye={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,n,t)}const ke=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ie(e,n){const t=(0,s.Kr)(e,ke());"prev"===n&&t.reverse();const r=t.indexOf((0,u.RS)((0,u.YE)(e)));return t.slice(r+1)[0]}function Me(){return Ie(document.body,"next")}function Ce(){return Ie(document.body,"prev")}function Te(e,n){const t=n||e.currentTarget,r=e.relatedTarget;return!r||!(0,u.gR)(t,r)}function Le(e){(0,s.Kr)(e,ke()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Oe(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const n=e.dataset.tabindex;delete e.dataset.tabindex,n?e.setAttribute("tabindex",n):e.removeAttribute("tabindex")}))}const Pe={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Se(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Ae=o.forwardRef((function(e,n){const[t,r]=o.useState();P((()=>((0,u.nr)()&&r("button"),document.addEventListener("keydown",Se),()=>{document.removeEventListener("keydown",Se)})),[]);const i={ref:n,tabIndex:0,role:t,"aria-hidden":!t||void 0,[te("focus-guard")]:"",style:Pe};return(0,c.jsx)("span",{...e,...i})})),Fe=o.createContext(null),je=te("portal");function De(e){void 0===e&&(e={});const{id:n,root:t}=e,r=U(),u=qe(),[i,c]=o.useState(null),s=o.useRef(null);return P((()=>()=>{null==i||i.remove(),queueMicrotask((()=>{s.current=null}))}),[i]),P((()=>{if(!r)return;if(s.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=r,t.setAttribute(je,""),e.appendChild(t),s.current=t,c(t)}),[n,r]),P((()=>{if(null===t)return;if(!r)return;if(s.current)return;let e=t||(null==u?void 0:u.portalNode);e&&!(0,l.vq)(e)&&(e=e.current),e=e||document.body;let o=null;n&&(o=document.createElement("div"),o.id=n,e.appendChild(o));const i=document.createElement("div");i.id=r,i.setAttribute(je,""),e=o||e,e.appendChild(i),s.current=i,c(i)}),[n,t,r,u]),i}function Ne(e){const{children:n,id:t,root:r,preserveTabOrder:u=!0}=e,i=De({id:t,root:r}),[l,s]=o.useState(null),f=o.useRef(null),d=o.useRef(null),v=o.useRef(null),m=o.useRef(null),p=null==l?void 0:l.modal,g=null==l?void 0:l.open,h=!!l&&!l.modal&&l.open&&u&&!(!r&&!i);return o.useEffect((()=>{if(i&&u&&!p)return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){if(i&&Te(e)){("focusin"===e.type?Oe:Le)(i)}}}),[i,u,p]),o.useEffect((()=>
1{i&&(g||Oe(i))}),[g,i]),(0,c.jsxs)(Fe.Provider,{value:o.useMemo((()=>({preserveTabOrder:u,beforeOutsideRef:f,afterOutsideRef:d,beforeInsideRef:v,afterInsideRef:m,portalNode:i,setFocusManagerState:s})),[u,i]),children:[h&&i&&(0,c.jsx)(Ae,{"data-type":"outside",ref:f,onFocus:e=>{if(Te(e,i)){var n;null==(n=v.current)||n.focus()}else{const e=Ce()||(null==l?void 0:l.domReference);null==e||e.focus()}}}),h&&i&&(0,c.jsx)("span",{"aria-owns":i.id,style:Pe}),i&&a.createPortal(n,i),h&&i&&(0,c.jsx)(Ae,{"data-type":"outside",ref:d,onFocus:e=>{if(Te(e,i)){var n;null==(n=m.current)||n.focus()}else{const n=Me()||(null==l?void 0:l.domReference);null==n||n.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const qe=()=>o.useContext(Fe),Ke="data-floating-ui-focusable";function Ye(e){return e?e.hasAttribute(Ke)?e:e.querySelector("["+Ke+"]")||e:null}const _e=20;let We=[];function He(e){We=We.filter((e=>e.isConnected)),e&&"body"!==(0,l.mq)(e)&&(We.push(e),We.length>_e&&(We=We.slice(-_e)))}function Be(){return We.slice().reverse().find((e=>e.isConnected))}const ze=o.forwardRef((function(e,n){return(0,c.jsx)("button",{...e,type:"button",ref:n,tabIndex:-1,style:Pe})}));function Ue(e){const{context:n,children:t,disabled:r=!1,order:i=["content"],guards:a=!0,initialFocus:f=0,returnFocus:d=!0,restoreFocus:m=!1,modal:p=!0,visuallyHiddenDismiss:h=!1,closeOnFocusOut:y=!0,outsideElementsInert:b=!1}=e,{open:E,onOpenChange:R,events:x,dataRef:w,elements:{domReference:k,floating:I}}=n,M=g((()=>{var e;return null==(e=w.current.floatingContext)?void 0:e.nodeId})),C="number"==typeof f&&f<0,T=(0,u.WZ)(k)&&C,L=Ee(),O=!L||a,S=!O||L&&b,A=re(i),F=re(f),j=re(d),D=Q(),N=qe(),q=o.useRef(null),K=o.useRef(null),Y=o.useRef(!1),_=o.useRef(!1),W=o.useRef(-1),H=null!=N,B=Ye(I),z=g((function(e){return void 0===e&&(e=B),e?(0,s.Kr)(e,ke()):[]})),U=g((e=>{const n=z(e);return A.current.map((e=>k&&"reference"===e?k:B&&"floating"===e?B:n)).filter(Boolean).flat()}));o.useEffect((()=>{if(r)return;if(!p)return;function e(e){if("Tab"===e.key){(0,u.gR)(B,(0,u.RS)((0,u.YE)(B)))&&0===z().length&&!T&&(0,u.jo)(e);const n=U(),t=(0,u.EW)(e);"reference"===A.current[0]&&t===k&&((0,u.jo)(e),e.shiftKey?ve(n[n.length-1]):ve(n[1])),"floating"===A.current[1]&&t===B&&e.shiftKey&&((0,u.jo)(e),ve(n[0]))}}const n=(0,u.YE)(B);return n.addEventListener("keydown",e),()=>{n.removeEventListener("keydown",e)}}),[r,k,B,p,A,T,z,U]),o.useEffect((()=>{if(!r&&I)return I.addEventListener("focusin",e),()=>{I.removeEventListener("focusin",e)};function e(e){const n=(0,u.EW)(e),t=z().indexOf(n);-1!==t&&(W.current=t)}}),[r,I,z]),o.useEffect((()=>{if(!r&&y)return I&&(0,l.sb)(k)?(k.addEventListener("focusout",n),k.addEventListener("pointerdown",e),I.addEventListener("focusout",n),()=>{k.removeEventListener("focusout",n),k.removeEventListener("pointerdown",e),I.removeEventListener("focusout",n)}):void 0;function e(){_.current=!0,setTimeout((()=>{_.current=!1}))}function n(e){const n=e.relatedTarget;queueMicrotask((()=>{const t=M(),r=!((0,u.gR)(k,n)||(0,u.gR)(I,n)||(0,u.gR)(n,I)||(0,u.gR)(null==N?void 0:N.portalNode,n)||null!=n&&n.hasAttribute(te("focus-guard"))||D&&(pe(D.nodesRef.current,t).find((e=>{var t,r;return(0,u.gR)(null==(t=e.context)?void 0:t.elements.floating,n)||(0,u.gR)(null==(r=e.context)?void 0:r.elements.domReference,n)}))||me(D.nodesRef.current,t).find((e=>{var t,r,o;return[null==(t=e.context)?void 0:t.elements.floating,Ye(null==(r=e.context)?void 0:r.elements.floating)].includes(n)||(null==(o=e.context)?void 0:o.elements.domReference)===n}))));if(m&&r&&(0,u.RS)((0,u.YE)(B))===(0,u.YE)(B).body){(0,l.sb)(B)&&B.focus();const e=W.current,n=z(),t=n[e]||n[n.length-1]||B;(0,l.sb)(t)&&t.focus()}!T&&p||!n||!r||_.current||n===Be()||(Y.current=!0,R(!1,e,"focus-out"))}))}}),[r,k,I,B,p,D,N,R,y,m,z,T,M]);const X=o.useRef(null),G=o.useRef(null),V=v([X,null==N?void 0:N.beforeInsideRef]),Z=v([G,null==N?void 0:N.afterInsideRef]);function $(e){return!r&&h&&p?(0,c.jsx)(ze,{ref:"start"===e?q:K,onClick:e=>R(!1,e.nativeEvent),children:"string"==typeof h?h:"Dismiss"}):null}o.useEffect((()=>{var e;if(r)return;if(!I)return;const n=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+te("portal")+"]"))||[]),t=D&&!p?me(null==D?void 0:D.nodesRef.current,M()).map((e=>{var n;return null==(n=e.context)?void 0:n.elements.floating})):[],o=[I,...n,...t,q.current,K.current,X.current,G.current,null==N?void 0:N.beforeOutsideRef.current,null==N?void 0:N.afterOutsideRef.current,A.current.includes("reference")||T?k:null].filter((e=>null!=e)),u=p||T?we(o,!S,S):we(o);return()=>{u()}}),[r,k,I,p,A,N,T,O,S,D,M]),P((()=>
1{if(r||!(0,l.sb)(B))return;const e=(0,u.YE)(B),n=(0,u.RS)(e);queueMicrotask((()=>{const e=U(B),t=F.current,r=("number"==typeof t?e[t]:t.current)||B,o=(0,u.gR)(B,n);C||o||!E||ve(r,{preventScroll:r===B})}))}),[r,E,B,C,U,F]),P((()=>{if(r||!B)return;let e=!1;const n=(0,u.YE)(B),t=(0,u.RS)(n);let o=w.current.openEvent;function i(n){let{open:t,reason:r,event:i,nested:c}=n;t&&(o=i),"escape-key"===r&&k&&He(k),["hover","safe-polygon"].includes(r)&&"mouseleave"===i.type&&(Y.current=!0),"outside-press"===r&&(c?(Y.current=!1,e=!0):Y.current=!((0,u.YF)(i)||(0,u.Pg)(i)))}He(t),x.on("openchange",i);const c=n.createElement("span");return c.setAttribute("tabindex","-1"),c.setAttribute("aria-hidden","true"),Object.assign(c.style,Pe),H&&k&&k.insertAdjacentElement("afterend",c),()=>{x.off("openchange",i);const t=(0,u.RS)(n),r=(0,u.gR)(I,t)||D&&pe(D.nodesRef.current,M()).some((e=>{var n;return(0,u.gR)(null==(n=e.context)?void 0:n.elements.floating,t)}));(r||o&&["click","mousedown"].includes(o.type))&&k&&He(k);const a="boolean"==typeof j.current?Be()||c:j.current.current||c;queueMicrotask((()=>{const o=function(e){const n=ke();return(0,s.AO)(e,n)?e:(0,s.Kr)(e,n)[0]||e}(a);j.current&&!Y.current&&(0,l.sb)(o)&&(o===t||t===n.body||r)&&o.focus({preventScroll:e}),c.remove()}))}}),[r,I,B,j,w,x,D,H,k,M]),o.useEffect((()=>{queueMicrotask((()=>{Y.current=!1}))}),[r]),P((()=>{if(!r&&N)return N.setFocusManagerState({modal:p,closeOnFocusOut:y,open:E,onOpenChange:R,domReference:k}),()=>{N.setFocusManagerState(null)}}),[r,N,p,E,R,y,k]),P((()=>{if(r)return;if(!B)return;if("function"!=typeof MutationObserver)return;if(C)return;const e=()=>{const e=B.getAttribute("tabindex"),n=z(),t=(0,u.RS)((0,u.YE)(I)),r=n.indexOf(t);-1!==r&&(W.current=r),A.current.includes("floating")||t!==k&&0===n.length?"0"!==e&&B.setAttribute("tabindex","0"):"-1"!==e&&B.setAttribute("tabindex","-1")};e();const n=new MutationObserver(e);return n.observe(B,{childList:!0,subtree:!0,attributes:!0}),()=>{n.disconnect()}}),[r,I,B,k,A,z,C]);const J=!r&&O&&(!p||!T)&&(H||p);return(0,c.jsxs)(c.Fragment,{children:[J&&(0,c.jsx)(Ae,{"data-type":"inside",ref:V,onFocus:e=>{if(p){const e=U();ve("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(Y.current=!1,Te(e,N.portalNode)){const e=Me()||k;null==e||e.focus()}else{var n;null==(n=N.beforeOutsideRef.current)||n.focus()}}}),!T&&$("start"),t,$("end"),J&&(0,c.jsx)(Ae,{"data-type":"inside",ref:Z,onFocus:e=>{if(p)ve(U()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(y&&(Y.current=!0),Te(e,N.portalNode)){const e=Ce()||k;null==e||e.focus()}else{var n;null==(n=N.afterOutsideRef.current)||n.focus()}}})]})}let Xe=0;let Ge=()=>{};const Ve=o.forwardRef((function(e,n){const{lockScroll:t=!1,...r}=e;return P((()=>{if(t)return Xe++,1===Xe&&(Ge=function(){const e=/iP(hone|ad|od)|iOS/.test((0,u.uo)()),n=document.body.style,t=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=n.left?parseFloat(n.left):window.scrollX,i=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",r&&(n[t]=r+"px"),e){var c,l;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,t=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(i-Math.floor(t))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[t]:""}),e&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{Xe--,0===Xe&&Ge()}}),[t]),(0,c.jsx)("div",{ref:n,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})}));function Ze(e){return(0,l.sb)(e.target)&&"BUTTON"===e.target.tagName}function $e(e){return(0,u.$u)(e)}function Qe(e,n){void 0===n&&(n={});const{open:t,onOpenChange:r,dataRef:i,elements:{domReference:c}}=e,{enabled:l=!0,event:s="click",toggle:a=!0,ignoreMouse:f=!1,keyboardHandlers:d=!0,stickIfOpen:v=!0}=n,m=o.useRef(),p=o.useRef(!1),g=o.useMemo((()=>({onPointerDown(e){m.current=e.pointerType},onMouseDown(e){const n=m.current;0===e.button&&"click"!==s&&((0,u.Go)(n,!0)&&f||(!t||!a||i.current.openEvent&&v&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const n=m.current;"mousedown"===s&&m.current?m.current=void 0:(0,u.Go)(n,!0)&&f||(!t||!a||i.current.openEvent&&v&&"click"!==i.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){m.current=void 0,e.defaultPrevented||!d||Ze(e)||(" "!==e.key||$e(c)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&r(!t||!a,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||Ze(e)||$e(c)||" "===e.key&&p.current&&(p.current=!1,r(!t||!a,e.nativeEvent,"click"))}})),[i,c,s,f,d,r,t,v,a]);return o.useMemo((()=>l?{reference:g}:{}),[l,g])}function Je(e){return null!=e&&null!=e.clientX}function en(e,n){void 0===n&&(n={});const{open:t,dataRef:r,elements:{floating:i,domReference:c},refs:s}=e,{enabled:a=!0,axis:f="both",x:d=null,y:v=null}=n,m=o.useRef(!1),p=o.useRef(null),[h,y]=o.useState(),[b,E]=o.useState([]),R=g(((e,n)=>{m.current||r.current.openEvent&&!Je(r.current.openEvent)||s.setPositionReference(function(e,n){let t=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var u;const i=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===n.axis||"both"===n.axis,l="y"===n.axis||"both"===n.axis,s=["mouseenter","mousemove"].includes((null==(u=n.dataRef.current.openEvent)?void 0:u.type)||"")&&"touch"!==n.pointerType;let a=i.width,f=i.height,d=i.x,v=i.y;return null==t&&n.x&&c&&(t=i.x-n.x),null==r&&n.y&&l&&(r=i.y-n.y),d-=t||0,v-=r||0,a=0,f=0,!o||s?(a="y"===n.axis?i.width:0,f="x"===n.axis?i.height:0,d=c&&null!=n.x?n.x:d,v=l&&null!=n.y?n.y:v):o&&!s&&(f="x"===n.axis?i.height:f,a="y"===n.axis?i.width:a),o=!0,{width:a,height:f,x:d,y:v,top:v,right:d+a,bottom:v+f,left:d}}}}(c,{x:e,y:n,axis:f,dataRef:r,pointerType:h}))})),x=g((e=>{null==d&&null==v&&(t?p.current||E([]):R(e.clientX,e.clientY))})),w=(0,u.Go)(h)?i:t,k=o.useCallback((()=>
1{if(!w||!a||null!=d||null!=v)return;const e=(0,l.zk)(i);function n(t){const r=(0,u.EW)(t);(0,u.gR)(i,r)?(e.removeEventListener("mousemove",n),p.current=null):R(t.clientX,t.clientY)}if(!r.current.openEvent||Je(r.current.openEvent)){e.addEventListener("mousemove",n);const t=()=>{e.removeEventListener("mousemove",n),p.current=null};return p.current=t,t}s.setPositionReference(c)}),[w,a,d,v,i,r,s,c,R]);o.useEffect((()=>k()),[k,b]),o.useEffect((()=>{a&&!i&&(m.current=!1)}),[a,i]),o.useEffect((()=>{!a&&t&&(m.current=!0)}),[a,t]),P((()=>{!a||null==d&&null==v||(m.current=!1,R(d,v))}),[a,d,v,R]);const I=o.useMemo((()=>{function e(e){let{pointerType:n}=e;y(n)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:x,onMouseEnter:x}}),[x]);return o.useMemo((()=>a?{reference:I}:{}),[a,I])}const nn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},tn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},rn=e=>{var n,t;return{escapeKey:"boolean"==typeof e?e:null!=(n=null==e?void 0:e.escapeKey)&&n,outsidePress:"boolean"==typeof e?e:null==(t=null==e?void 0:e.outsidePress)||t}};function on(e,n){void 0===n&&(n={});const{open:t,onOpenChange:r,elements:i,dataRef:c}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:v=!1,referencePressEvent:m="pointerdown",ancestorScroll:p=!1,bubbles:h,capture:y}=n,b=Q(),E=g("function"==typeof f?f:()=>!1),R="function"==typeof f?E:f,x=o.useRef(!1),w=o.useRef(!1),{escapeKey:k,outsidePress:I}=rn(h),{escapeKey:M,outsidePress:C}=rn(y),T=o.useRef(!1),L=g((e=>{var n;if(!t||!s||!a||"Escape"!==e.key)return;if(T.current)return;const o=null==(n=c.current.floatingContext)?void 0:n.nodeId,i=b?pe(b.nodesRef.current,o):[];if(!k&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((n=>{var t;null==(t=n.context)||!t.open||n.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}r(!1,(0,u.O_)(e)?e.nativeEvent:e,"escape-key")})),O=g((e=>{var n;const t=()=>{var n;L(e),null==(n=(0,u.EW)(e))||n.removeEventListener("keydown",t)};null==(n=(0,u.EW)(e))||n.addEventListener("keydown",t)})),P=g((e=>{var n;const t=x.current;x.current=!1;const o=w.current;if(w.current=!1,"click"===d&&o)return;if(t)return;if("function"==typeof R&&!R(e))return;const s=(0,u.EW)(e),a="["+te("inert")+"]",f=(0,u.YE)(i.floating).querySelectorAll(a);let v=(0,l.vq)(s)?s:null;for(;v&&!(0,l.eu)(v);){const e=(0,l.$4)(v);if((0,l.eu)(e)||!(0,l.vq)(e))break;v=e}if(f.length&&(0,l.vq)(s)&&!(0,u.tZ)(s)&&!(0,u.gR)(s,i.floating)&&Array.from(f).every((e=>!(0,u.gR)(v,e))))return;if((0,l.sb)(s)&&F){const n=(0,l.eu)(s),t=(0,l.L9)(s),r=/auto|scroll/,o=n||r.test(t.overflowX),u=n||r.test(t.overflowY),i=o&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,c=u&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,a="rtl"===t.direction,f=c&&(a?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),d=i&&e.offsetY>s.clientHeight;if(f||d)return}const m=null==(n=c.current.floatingContext)?void 0:n.nodeId,p=b&&pe(b.nodesRef.current,m).some((n=>{var t;return(0,u.F2)(e,null==(t=n.context)?void 0:t.elements.floating)}));if((0,u.F2)(e,i.floating)||(0,u.F2)(e,i.domReference)||p)return;const g=b?pe(b.nodesRef.current,m):[];if(g.length>0){let e=!0;if(g.forEach((n=>{var t;null==(t=n.context)||!t.open||n.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}r(!1,e,"outside-press")})),S=g((e=>{var n;const t=()=>{var n;P(e),null==(n=(0,u.EW)(e))||n.removeEventListener(d,t)};null==(n=(0,u.EW)(e))||n.addEventListener(d,t)}));o.useEffect((()=>{if(!t||!s)return;c.current.__escapeKeyBubbles=k,c.current.__outsidePressBubbles=I;let e=-1;function n(e){r(!1,e,"ancestor-scroll")}function o(){window.clearTimeout(e),T.current=!0}function f(){e=window.setTimeout((()=>{T.current=!1}),(0,l.Tc)()?5:0)}const v=(0,u.YE)(i.floating);a&&(v.addEventListener("keydown",M?O:L,M),v.addEventListener("compositionstart",o),v.addEventListener("compositionend",f)),R&&v.addEventListener(d,C?S:P,C);let m=[];return p&&((0,l.vq)(i.domReference)&&(m=(0,l.v9)(i.domReference)),(0,l.vq)(i.floating)&&(m=m.concat((0,l.v9)(i.floating))),!(0,l.vq)(i.reference)&&i.reference&&i.reference.contextElement&&(m=m.concat((0,l.v9)(i.reference.contextElement)))),m=m.filter((e=>{var n;
1return e!==(null==(n=v.defaultView)?void 0:n.visualViewport)})),m.forEach((e=>{e.addEventListener("scroll",n,{passive:!0})})),()=>{a&&(v.removeEventListener("keydown",M?O:L,M),v.removeEventListener("compositionstart",o),v.removeEventListener("compositionend",f)),R&&v.removeEventListener(d,C?S:P,C),m.forEach((e=>{e.removeEventListener("scroll",n)})),window.clearTimeout(e)}}),[c,i,a,R,d,t,r,p,s,k,I,L,M,O,P,C,S]),o.useEffect((()=>{x.current=!1}),[R,d]);const A=o.useMemo((()=>({onKeyDown:L,...v&&{[nn[m]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==m&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}})),[L,r,v,m]),F=o.useMemo((()=>({onKeyDown:L,onMouseDown(){w.current=!0},onMouseUp(){w.current=!0},[tn[d]]:()=>{x.current=!0}})),[L,d]);return o.useMemo((()=>s?{reference:A,floating:F}:{}),[s,A,F])}function un(e){const{open:n=!1,onOpenChange:t,elements:r}=e,u=U(),i=o.useRef({}),[c]=o.useState((()=>G())),l=null!=$();const[s,a]=o.useState(r.reference),f=g(((e,n,r)=>{i.current.openEvent=e?n:void 0,c.emit("openchange",{open:e,event:n,reason:r,nested:l}),null==t||t(e,n,r)})),d=o.useMemo((()=>({setPositionReference:a})),[]),v=o.useMemo((()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference})),[s,r.reference,r.floating]);return o.useMemo((()=>({dataRef:i,open:n,onOpenChange:f,elements:v,events:c,floatingId:u,refs:d})),[n,f,v,c,u,d])}function cn(e){void 0===e&&(e={});const{nodeId:n}=e,t=un({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||t,u=r.elements,[i,c]=o.useState(null),[s,a]=o.useState(null),d=(null==u?void 0:u.domReference)||i,v=o.useRef(null),m=Q();P((()=>{d&&(v.current=d)}),[d]);const p=(0,f.we)({...e,elements:{...u,...s&&{reference:s}}}),g=o.useCallback((e=>{const n=(0,l.vq)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(n),p.refs.setReference(n)}),[p.refs]),h=o.useCallback((e=>{((0,l.vq)(e)||null===e)&&(v.current=e,c(e)),((0,l.vq)(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!(0,l.vq)(e))&&p.refs.setReference(e)}),[p.refs]),y=o.useMemo((()=>({...p.refs,setReference:h,setPositionReference:g,domReference:v})),[p.refs,h,g]),b=o.useMemo((()=>({...p.elements,domReference:d})),[p.elements,d]),E=o.useMemo((()=>({...p,...r,refs:y,elements:b,nodeId:n})),[p,y,b,n,r]);return P((()=>{r.dataRef.current.floatingContext=E;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===n));e&&(e.context=E)})),o.useMemo((()=>({...p,context:E,refs:y,elements:b})),[p,y,b,E])}function ln(e,n){void 0===n&&(n={});const{open:t,onOpenChange:r,events:i,dataRef:c,elements:s}=e,{enabled:a=!0,visibleOnly:f=!0}=n,d=o.useRef(!1),v=o.useRef(),m=o.useRef(!0);o.useEffect((()=>{if(!a)return;const e=(0,l.zk)(s.domReference);function n(){!t&&(0,l.sb)(s.domReference)&&s.domReference===(0,u.RS)((0,u.YE)(s.domReference))&&(d.current=!0)}function r(){m.current=!0}return e.addEventListener("blur",n),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",n),e.removeEventListener("keydown",r,!0)}}),[s.domReference,t,a]),o.useEffect((()=>{if(a)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:n}=e;"reference-press"!==n&&"escape-key"!==n||(d.current=!0)}}),[i,a]),o.useEffect((()=>()=>{clearTimeout(v.current)}),[]);const p=o.useMemo((()=>({onPointerDown(e){(0,u.Pg)(e.nativeEvent)||(m.current=!1)},onMouseLeave(){d.current=!1},onFocus(e){if(d.current)return;const n=(0,u.EW)(e.nativeEvent);if(f&&(0,l.vq)(n))try{if((0,u.nr)()&&(0,u.cX)())throw Error();if(!n.matches(":focus-visible"))return}catch(t){if(!m.current&&!(0,u.$u)(n))return}r(!0,e.nativeEvent,"focus")},onBlur(e){d.current=!1;const n=e.relatedTarget,t=e.nativeEvent,o=(0,l.vq)(n)&&n.hasAttribute(te("focus-guard"))&&"outside"===n.getAttribute("data-type");v.current=window.setTimeout((()=>{var e;const i=(0,u.RS)(s.domReference?s.domReference.ownerDocument:document);(n||i!==s.domReference)&&((0,u.gR)(null==(e=c.current.floatingContext)?void 0:e.refs.floating.current,i)||(0,u.gR)(s.domReference,i)||o||r(!1,t,"focus"))}))}})),[c,s.domReference,r,f]);return o.useMemo((()=>a?{reference:p}:{}),[a,p])}const sn="active",an="selected";function fn(e,n,t){const r=new Map,o="item"===t;let u=e;if(o&&e){const{[sn]:n,[an]:t,...r}=e;u=r}return{..."floating"===t&&{tabIndex:-1,[Ke]:""},...u,...n.map((n=>{const r=n?n[t]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,n)=>
vendor: 2,565 bytes, line 1
1n?(Object.entries(n).forEach((n=>{let[t,u]=n;var i;o&&[sn,an].includes(t)||(0===t.indexOf("on")?(r.has(t)||r.set(t,[]),"function"==typeof u&&(null==(i=r.get(t))||i.push(u),e[t]=function(){for(var e,n=arguments.length,o=new Array(n),u=0;u<n;u++)o[u]=arguments[u];return null==(e=r.get(t))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[t]=u)})),e):e),{})}}function dn(e){void 0===e&&(e=[]);const n=e.map((e=>null==e?void 0:e.reference)),t=e.map((e=>null==e?void 0:e.floating)),r=e.map((e=>null==e?void 0:e.item)),u=o.useCallback((n=>fn(n,e,"reference")),n),i=o.useCallback((n=>fn(n,e,"floating")),t),c=o.useCallback((n=>fn(n,e,"item")),r);return o.useMemo((()=>({getReferenceProps:u,getFloatingProps:i,getItemProps:c})),[u,i,c])}function vn(e,n,t){switch(e){case"vertical":return n;case"horizontal":return t;default:return n||t}}function mn(e,n){return vn(n,e===h||e===y,e===b||e===E)}function pn(e,n,t){return vn(n,e===y,t?e===b:e===E)||"Enter"===e||" "===e||""===e}function gn(e,n,t){return vn(n,t?e===E:e===b,e===h)}function hn(e,n){const{open:t,onOpenChange:r,elements:i}=e,{listRef:c,activeIndex:s,onNavigate:a=()=>{},enabled:f=!0,selectedIndex:d=null,allowEscape:v=!1,loop:m=!1,nested:p=!1,rtl:h=!1,virtual:R=!1,focusItemOnOpen:S="auto",focusItemOnHover:A=!0,openOnArrowKeyDown:F=!0,disabledIndices:j,orientation:D="vertical",cols:N=1,scrollItemIntoView:q=!0,virtualItemRef:K,itemSizes:Y,dense:_=!1}=n;const W=re(Ye(i.floating)),H=$(),B=Q(),z=g((()=>{a(-1===G.current?null:G.current)})),U=(0,u.WZ)(i.domReference),X=o.useRef(S),G=o.useRef(null!=d?d:-1),V=o.useRef(null),Z=o.useRef(!0),J=o.useRef(z),ee=o.useRef(!!i.floating),ne=o.useRef(t),te=o.useRef(!1),oe=o.useRef(!1),ue=re(j),ie=re(t),ce=re(q),le=re(d),[se,ae]=o.useState(),[fe,de]=o.useState(),me=g((()=>{function e(e){R?(ae(e.id),null==B||B.events.emit("virtualfocus",e),K&&(K.current=e)):ve(e,{sync:te.current,preventScroll:!0})}const n=c.current[G.current];n&&e(n);(te.current?e=>e():requestAnimationFrame)((()=>{const t=c.current[G.current]||n;if(!t)return;n||e(t);const r=ce.current;r&&he&&(oe.current||!Z.current)&&(null==t.scrollIntoView||t.scrollIntoView("boolean"==typeof r?{block:"nearest",inline:"nearest"}:r))}))}));P((()=>{f&&(t&&i.floating?X.current&&null!=d&&(oe.current=!0,G.current=d,z()):ee.current&&(G.current=-1,J.current()))}),[f,t,i.floating,d,z]),P((()=>{if(f&&t&&i.floating)if(null==s){if(te.current=!1,null!=le.current)return;if(ee.current&&(G.current=-1,me()),(!ne.current||!ee.current)&&X.current&&(null!=V.current||!0===X.current&&null==V.current)){let e=0;const n=()=>
1{if(null==c.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(n)}e++}else G.current=null==V.current||pn(V.current,D,h)||p?w(c,ue.current):k(c,ue.current),V.current=null,z()};n()}}else x(c,s)||(G.current=s,me(),oe.current=!1)}),[f,t,i.floating,s,le,p,c,D,h,z,me,ue]),P((()=>{var e;if(!f||i.floating||!B||R||!ee.current)return;const n=B.nodesRef.current,t=null==(e=n.find((e=>e.id===H)))||null==(e=e.context)?void 0:e.elements.floating,r=(0,u.RS)((0,u.YE)(i.floating)),o=n.some((e=>e.context&&(0,u.gR)(e.context.elements.floating,r)));t&&!o&&Z.current&&t.focus({preventScroll:!0})}),[f,i.floating,B,H,R]),P((()=>{if(f&&B&&R&&!H)return B.events.on("virtualfocus",e),()=>{B.events.off("virtualfocus",e)};function e(e){de(e.id),K&&(K.current=e)}}),[f,B,R,H,K]),P((()=>{J.current=z,ne.current=t,ee.current=!!i.floating})),P((()=>{t||(V.current=null)}),[t]);const ge=null!=s,he=o.useMemo((()=>{function e(e){if(!t)return;const n=c.current.indexOf(e);-1!==n&&G.current!==n&&(G.current=n,z())}return{onFocus(n){let{currentTarget:t}=n;te.current=!0,e(t)},onClick:e=>{let{currentTarget:n}=e;return n.focus({preventScroll:!0})},...A&&{onMouseMove(n){let{currentTarget:t}=n;te.current=!0,oe.current=!1,e(t)},onPointerLeave(e){let{pointerType:n}=e;var t;Z.current&&"touch"!==n&&(te.current=!0,G.current=-1,z(),R||null==(t=W.current)||t.focus({preventScroll:!0}))}}}}),[t,W,A,c,z,R]),ye=g((e=>{if(Z.current=!1,te.current=!0,229===e.which)return;if(!ie.current&&e.currentTarget===W.current)return;if(p&&gn(e.key,D,h))return(0,u.jo)(e),r(!1,e.nativeEvent,"list-navigation"),void((0,l.sb)(i.domReference)&&(R?null==B||B.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const n=G.current,o=w(c,j),s=k(c,j);if(U||("Home"===e.key&&((0,u.jo)(e),G.current=o,z()),"End"===e.key&&((0,u.jo)(e),G.current=s,z())),N>1){const n=Y||Array.from({length:c.current.length},(()=>({width:1,height:1}))),t=C(n,N,_),r=t.findIndex((e=>null!=e&&!O(c.current,e,j))),u=t.reduce(((e,n,t)=>null==n||O(c.current,n,j)?e:t),-1),i=t[M({current:t.map((e=>null!=e?c.current[e]:null))},{event:e,orientation:D,loop:m,rtl:h,cols:N,disabledIndices:L([...j||c.current.map(((e,n)=>O(c.current,n)?n:void 0)),void 0],t),minIndex:r,maxIndex:u,prevIndex:T(G.current>s?o:G.current,n,t,N,e.key===y?"bl":e.key===(h?b:E)?"tr":"tl"),stopEvent:!0})];if(null!=i&&(G.current=i,z()),"both"===D)return}if(mn(e.key,D)){if((0,u.jo)(e),t&&!R&&(0,u.RS)(e.currentTarget.ownerDocument)===e.currentTarget)return G.current=pn(e.key,D,h)?o:s,void z();pn(e.key,D,h)?G.current=m?n>=s?v&&n!==c.current.length?-1:o:I(c,{startingIndex:n,disabledIndices:j}):Math.min(s,I(c,{startingIndex:n,disabledIndices:j})):G.current=m?n<=o?v&&-1!==n?c.current.length:s:I(c,{startingIndex:n,decrement:!0,disabledIndices:j}):Math.max(o,I(c,{startingIndex:n,decrement:!0,disabledIndices:j})),x(c,G.current)&&(G.current=-1),z()}})),be=o.useMemo((()=>R&&t&&ge&&{"aria-activedescendant":fe||se}),[R,t,ge,fe,se]),Ee=o.useMemo((()=>({"aria-orientation":"both"===D?void 0:D,...U?{}:be,onKeyDown:ye,onPointerMove(){Z.current=!0}})),[be,ye,D,U]),Re=o.useMemo((()=>{function e(e){"auto"===S&&(0,u.YF)(e.nativeEvent)&&(X.current=!0)}function n(e){X.current=S,"auto"===S&&(0,u.Pg)(e.nativeEvent)&&(X.current=!0)}return{...be,onKeyDown(e){Z.current=!1;const n=e.key.startsWith("Arrow"),o=["Home","End"].includes(e.key),i=n||o,l=function(e,n,t){return vn(n,t?e===b:e===E,e===y)}(e.key,D,h),s=gn(e.key,D,h),a=mn(e.key,D),f=(p?l:a)||"Enter"===e.key||""===e.key.trim();if(R&&t){const n=null==B?void 0:B.nodesRef.current.find((e=>null==e.parentId)),t=B&&n?function(e,n){let t,r=-1;return function n(o,u){u>r&&(t=o,r=u),pe(e,o).forEach((e=>{n(e.id,u+1)}))}(n,0),e.find((e=>e.id===t))}(B.nodesRef.current,n.id):null;if(i&&t&&K){const n=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(l||s){var v,m;const r=(null==(v=t.context)?void 0:v.elements.domReference)===e.currentTarget,o=s&&!r?null==(m=t.context)?void 0:m.elements.domReference:l?c.current.find((e=>(null==e?void 0:e.id)===se)):null;o&&((0,u.jo)(e),o.dispatchEvent(n),de(void 0))}var g;if((a||o)&&t.context)if(t.context.open&&t.parentId&&e.currentTarget!==t.context.elements.domReference)return(0,u.jo)(e),void(null==(g=t.context.elements.domReference)||g.dis
1patchEvent(n))}return ye(e)}(t||F||!n)&&(f&&(V.current=p&&a?null:e.key),p?l&&((0,u.jo)(e),t?(G.current=w(c,ue.current),z()):r(!0,e.nativeEvent,"list-navigation")):a&&(null!=d&&(G.current=d),(0,u.jo)(e),!t&&F?r(!0,e.nativeEvent,"list-navigation"):ye(e),t&&z()))},onFocus(){t&&!R&&(G.current=-1,z())},onPointerDown:n,onPointerEnter:n,onMouseDown:e,onClick:e}}),[se,be,ye,ue,S,c,p,z,r,t,F,D,h,d,B,R,K]);return o.useMemo((()=>f?{reference:Re,floating:Ee,item:he}:{}),[f,Re,Ee,he])}const yn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bn(e,n){var t;void 0===n&&(n={});const{open:r,floatingId:u}=e,{enabled:i=!0,role:c="dialog"}=n,l=null!=(t=yn.get(c))?t:c,s=U(),a=null!=$(),f=o.useMemo((()=>"tooltip"===l||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:r?u:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?u:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:s},..."menu"===l&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[l,u,a,r,s,c]),d=o.useMemo((()=>{const e={id:u,...l&&{role:l}};return"tooltip"===l||"label"===c?e:{...e,..."menu"===l&&{"aria-labelledby":s}}}),[l,u,s,c]),v=o.useCallback((e=>{let{active:n,selected:t}=e;const r={role:"option",...n&&{id:u+"-option"}};switch(c){case"select":return{...r,"aria-selected":n&&t};case"combobox":return{...r,...n&&{"aria-selected":!0}}}return{}}),[u,c]);return o.useMemo((()=>i?{reference:f,floating:d,item:v}:{}),[i,f,d,v])}const En=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,n)=>(n?"-":"")+e.toLowerCase()));function Rn(e,n){return"function"==typeof e?e(n):e}function xn(e,n){void 0===n&&(n={});const{open:t,elements:{floating:r}}=e,{duration:u=250}=n,i=("number"==typeof u?u:u.close)||0,[c,l]=o.useState("unmounted"),s=function(e,n){const[t,r]=o.useState(e);return e&&!t&&r(!0),o.useEffect((()=>{if(!e&&t){const e=setTimeout((()=>r(!1)),n);return()=>clearTimeout(e)}}),[e,t,n]),t}(t,i);return s||"close"!==c||l("unmounted"),P((()=>{if(r){if(t){l("initial");const e=requestAnimationFrame((()=>{l("open")}));return()=>{cancelAnimationFrame(e)}}l("close")}}),[t,r]),{isMounted:s,status:c}}function wn(e,n){void 0===n&&(n={});const{initial:t={opacity:0},open:r,close:u,common:i,duration:c=250}=n,l=e.placement,s=l.split("-")[0],a=o.useMemo((()=>({side:s,placement:l})),[s,l]),f="number"==typeof c,d=(f?c:c.open)||0,v=(f?c:c.close)||0,[m,p]=o.useState((()=>({...Rn(i,a),...Rn(t,a)}))),{isMounted:g,status:h}=xn(e,{duration:c}),y=re(t),b=re(r),E=re(u),R=re(i);return P((()=>{const e=Rn(y.current,a),n=Rn(E.current,a),t=Rn(R.current,a),r=Rn(b.current,a)||Object.keys(e).reduce(((e,n)=>(e[n]="",e)),{});if("initial"===h&&p((n=>({transitionProperty:n.transitionProperty,...t,...e}))),"open"===h&&p({transitionProperty:Object.keys(r).map(En).join(","),transitionDuration:d+"ms",...t,...r}),"close"===h){const r=n||e;p({transitionProperty:Object.keys(r).map(En).join(","),transitionDuration:v+"ms",...t,...r})}}),[v,E,y,b,R,d,h,a]),{isMounted:g,styles:m}}function kn(e,n){var t;const{open:r,dataRef:i}=e,{listRef:c,activeIndex:l,onMatch:s,onTypingChange:a,enabled:f=!0,findMatch:d=null,resetMs:v=750,ignoreKeys:m=[],selectedIndex:p=null}=n,h=o.useRef(),y=o.useRef(""),b=o.useRef(null!=(t=null!=p?p:l)?t:-1),E=o.useRef(null),R=g(s),x=g(a),w=re(d),k=re(m);P((()=>{r&&(clearTimeout(h.current),E.current=null,y.current="")}),[r]),P((()=>{var e;r&&""===y.current&&(b.current=null!=(e=null!=p?p:l)?e:-1)}),[r,p,l]);const I=g((e=>{e?i.current.typing||(i.current.typing=e,x(e)):i.current.typing&&(i.current.typing=e,x(e))})),M=g((e=>{function n(e,n,t){const r=w.current?w.current(n,t):n.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(t.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const t=c.current;if(y.current.length>0&&" "!==y.current[0]&&(-1===n(t,t,y.current)?I(!1):" "===e.key&&(0,u.jo)(e)),null==t||k.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&((0,u.jo)(e),I(!0));t.every((e=>{var n,t;return!e||(null==(n=e[0])?void 0:n.toLocaleLowerCase())!==(null==(t=e[1])?void 0:t.toLocaleLowerCase())}))&&y.current===e.key&&(y.current="",b.current=E.current),y.current+=e.key,clearTimeout(h.current),h.current=setTimeout((()=>{y.current="",b.current=E.current,I(!1)}),v);const o=b.current,i=n(t,[...t.slice((o||0)+1),...t.slice(0,(o||0)+1)],y.current);-1!==i?(R(i),E.current=i):" "!==e.key&&(y.current="",I(!1))})),C=o.useMemo((()=>({onKeyDown:M})),[M]),T=o.useMemo((()=>({onKeyDown:M,onKeyUp(e){" "===e.key&&I(!1)}})),[M,I]);return o.useMemo((()=>f?{reference:C,floating:T}:{}),[f,C,T])}function In(e,n){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:n}}}}const Mn=e=>({name:"inner",options:e,async fn(n){const{listRef:t,overflowRef:r,onFallbackChange:o,offset:u=0,index:c=0,minItemsVisible:l=4,referenceOverflowThreshold:s=0,scrollRef:v,...m}=(0,i._3)(e,n),{rects:p,elements:{floating:g}}=n,h=t.current[c],y=(null==v?void 0:v.current)||g,b=g.clientTop||y.clientTop,E=0!==g.clientTop,R=0!==y.clientTop,x=g===y;
1if(!h)return{};const w={...n,...await(0,f.cY)(-h.offsetTop-g.clientTop-p.reference.height/2-h.offsetHeight/2-u).fn(n)},k=await(0,d.__)(In(w,y.scrollHeight+b+g.clientTop),m),I=await(0,d.__)(w,{...m,elementContext:"reference"}),M=(0,i.T9)(0,k.top),C=w.y+M,T=(y.scrollHeight>y.clientHeight?e=>e:i.LI)((0,i.T9)(0,y.scrollHeight+(E&&x||R?2*b:0)-M-(0,i.T9)(0,k.bottom)));if(y.style.maxHeight=T+"px",y.scrollTop=M,o){const e=y.offsetHeight<h.offsetHeight*(0,i.jk)(l,t.current.length)-1||I.top>=-s||I.bottom>=-s;a.flushSync((()=>o(e)))}return r&&(r.current=await(0,d.__)(In({...w,y:C},y.offsetHeight+b+g.clientTop),m)),{y:C}}});function Cn(e,n){const{open:t,elements:r}=e,{enabled:i=!0,overflowRef:c,scrollRef:l,onChange:s}=n,f=g(s),d=o.useRef(!1),v=o.useRef(null),m=o.useRef(null);o.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!n||null==c.current)return;const t=e.deltaY,r=c.current.top>=-.5,o=c.current.bottom>=-.5,i=n.scrollHeight-n.clientHeight,l=t<0?-1:1,s=t<0?"max":"min";n.scrollHeight<=n.clientHeight||(!r&&t>0||!o&&t<0?(e.preventDefault(),a.flushSync((()=>{f((e=>e+Math[s](t,i*l)))}))):/firefox/i.test((0,u.$t)())&&(n.scrollTop+=t))}const n=(null==l?void 0:l.current)||r.floating;return t&&n?(n.addEventListener("wheel",e),requestAnimationFrame((()=>{v.current=n.scrollTop,null!=c.current&&(m.current={...c.current})})),()=>{v.current=null,m.current=null,n.removeEventListener("wheel",e)}):void 0}),[i,t,r.floating,c,l,f]);const p=o.useMemo((()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){const e=(null==l?void 0:l.current)||r.floating;if(c.current&&e&&d.current){if(null!==v.current){const n=e.scrollTop-v.current;(c.current.bottom<-.5&&n<-1||c.current.top<-.5&&n>1)&&a.flushSync((()=>f((e=>e+n))))}requestAnimationFrame((()=>{v.current=e.scrollTop}))}}})),[r.floating,f,c,l]);return o.useMemo((()=>i?{floating:p}:{}),[i,p])}function Tn(e,n){const[t,r]=e;let o=!1;const u=n.length;for(let i=0,c=u-1;i<u;c=i++){const[e,u]=n[i]||[0,0],[l,s]=n[c]||[0,0];u>=r!=s>=r&&t<=(l-e)*(r-u)/(s-u)+e&&(o=!o)}return o}function Ln(e){void 0===e&&(e={});const{buffer:n=.5,blockPointerEvents:t=!1,requireIntent:r=!0}=e;let o,i=!1,c=null,s=null,a=performance.now();const f=e=>{let{x:t,y:f,placement:d,elements:v,onClose:m,nodeId:p,tree:g}=e;return function(e){function h(){clearTimeout(o),m()}if(clearTimeout(o),!v.domReference||!v.floating||null==d||null==t||null==f)return;const{clientX:y,clientY:b}=e,E=[y,b],R=(0,u.EW)(e),x="mouseleave"===e.type,w=(0,u.gR)(v.floating,R),k=(0,u.gR)(v.domReference,R),I=v.domReference.getBoundingClientRect(),M=v.floating.getBoundingClientRect(),C=d.split("-")[0],T=t>M.right-M.width/2,L=f>M.bottom-M.height/2,O=function(e,n){return e[0]>=n.x&&e[0]<=n.x+n.width&&e[1]>=n.y&&e[1]<=n.y+n.height}(E,I),P=M.width>I.width,S=M.height>I.height,A=(P?I:M).left,F=(P?I:M).right,j=(S?I:M).top,D=(S?I:M).bottom;if(w&&(i=!0,!x))return;if(k&&(i=!1),k&&!x)return void(i=!0);if(x&&(0,l.vq)(e.relatedTarget)&&(0,u.gR)(v.floating,e.relatedTarget))return;if(g&&pe(g.nodesRef.current,p).some((e=>{let{context:n}=e;return null==n?void 0:n.open})))return;if("top"===C&&f>=I.bottom-1||"bottom"===C&&f<=I.top+1||"left"===C&&t>=I.right-1||"right"===C&&t<=I.left+1)return h();let N=[];switch(C){case"top":N=[[A,I.top+1],[A,M.bottom-1],[F,M.bottom-1],[F,I.top+1]];break;case"bottom":N=[[A,M.top+1],[A,I.bottom-1],[F,I.bottom-1],[F,M.top+1]];break;case"left":N=[[M.right-1,D],[M.right-1,j],[I.left+1,j],[I.left+1,D]];break;case"right":N=[[I.right-1,D],[I.right-1,j],[M.left+1,j],[M.left+1,D]]}if(!Tn([y,b],N)){if(i&&!O)return h();if(!x&&r){const n=function(e,n){const t=performance.now(),r=t-a;if(null===c||null===s||0===r)return c=e,s=n,a=t,null;const o=e-c,u=n-s,i=Math.sqrt(o*o+u*u);return c=e,s=n,a=t,i/r}(e.clientX,e.clientY);if(null!==n&&n<.1)return h()}Tn([y,b],function(e){let[t,r]=e;switch(C){case"top":return[[P?t+n/2:T?t+4*n:t-4*n,r+n+1],[P?t-n/2:T?t+4*n:t-4*n,r+n+1],...[[M.left,T||P?M.bottom-n:M.top],[M.right,T?P?M.bottom-n:M.top:M.bottom-n]]];case"bottom":return[[P?t+n/2:T?t+4*n:t-4*n,r-n],[P?t-n/2:T?t+4*n:t-4*n,r-n],...[[M.left,T||P?M.top+n:M.bottom],[M.right,T?P?M.top+n:M.bottom:M.top+n]]];case"left":{const e=[t+n+1,S?r+n/2:L?r+4*n:r-4*n],o=[t+n+1,S?r-n/2:L?r+4*n:r-4*n];return[...[[L||S?M.right-n:M.left,M.top],[L?S?M.right-n:M.left:M.right-n,M.bottom]],e,o]}case"right":return[[t-n,S?r+n/2:L?r+4*n:r-4*n],[t-n,S?r-n/2:L?r+4*n:r-4*n],...[[L||S?M.left+n:M.right,M.top],[L?S?M.left+n:M.right:M.left+n,M.bottom]]]}}([t,f]))?!i&&r&&(o=window.setTimeout(h,40)):h()}}};return f.__options={blockPointerEvents:t},f}}}]); 2//# sourceMappingURL=26770aaf-a1287ee1c3308bbe21b9.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.