"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[501],{6456:(e,t,n)=>{n.d(t,{NI:()=>F,Rz:()=>O,YF:()=>E,aN:()=>N});var r,l=n(2265),u=n(2032),o=n(6236),c=n(899),i=n(4887),f=n(8139),s=n(5516);let a={...r||(r=n.t(l,2))},d=a.useInsertionEffect||(e=>e());function m(e){let t=l.useRef(()=>{});return d(()=>{t.current=e}),l.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r"floating-ui-"+Math.random().toString(36).slice(2,6)+h++,C=a.useId||function(){let[e,t]=l.useState(()=>p?v():void 0);return g(()=>{null==e&&t(v())},[]),l.useEffect(()=>{p=!0},[]),e},R=l.createContext(null),y=l.createContext(null),b=()=>{var e;return(null==(e=l.useContext(R))?void 0:e.id)||null},k=()=>l.useContext(y),M=()=>{},x=e=>e&&(e.host||x(e.parentNode)),S=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function E(e){void 0===e&&(e={});let{nodeId:t}=e,n=function(e){let{open:t=!1,onOpenChange:n,elements:r}=e,u=C(),o=l.useRef({}),[c]=l.useState(()=>(function(){let e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}})()),i=null!=b(),[f,s]=l.useState(r.reference),a=m((e,t,r)=>{o.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:r,nested:i}),null==n||n(e,t,r)}),d=l.useMemo(()=>({setPositionReference:s}),[]),g=l.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return l.useMemo(()=>({dataRef:o,open:t,onOpenChange:a,elements:g,events:c,floatingId:u,refs:d}),[t,a,g,c,u,d])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,u=r.elements,[o,i]=l.useState(null),[s,a]=l.useState(null),d=(null==u?void 0:u.domReference)||o,p=l.useRef(null),h=k();g(()=>{d&&(p.current=d)},[d]);let v=(0,f.YF)({...e,elements:{...u,...s&&{reference:s}}}),R=l.useCallback(e=>{let t=(0,c.kK)(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),v.refs.setReference(t)},[v.refs]),y=l.useCallback(e=>{((0,c.kK)(e)||null===e)&&(p.current=e,i(e)),((0,c.kK)(v.refs.reference.current)||null===v.refs.reference.current||null!==e&&!(0,c.kK)(e))&&v.refs.setReference(e)},[v.refs]),M=l.useMemo(()=>({...v.refs,setReference:y,setPositionReference:R,domReference:p}),[v.refs,y,R]),x=l.useMemo(()=>({...v.elements,domReference:d}),[v.elements,d]),S=l.useMemo(()=>({...v,...r,refs:M,elements:x,nodeId:t}),[v,M,x,t,r]);return g(()=>{r.dataRef.current.floatingContext=S;let e=null==h?void 0:h.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),l.useMemo(()=>({...v,context:S,refs:M,elements:x}),[v,M,x,S])}let H="active",T="selected";function w(e,t,n){let r=new Map,l="item"===n,u=e;if(l&&e){let{[H]:t,[T]:n,...r}=e;u=r}return{..."floating"===n&&{tabIndex:-1,"data-floating-ui-focusable":""},...u,...t.map(t=>{let r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,u]=t;if(!(l&&[H,T].includes(n))){if(0===n.indexOf("on")){if(r.has(n)||r.set(n,[]),"function"==typeof u){var o;null==(o=r.get(n))||o.push(u),e[n]=function(){for(var e,t=arguments.length,l=Array(t),u=0;ue(...l)).find(e=>void 0!==e)}}}else e[n]=u}}),e),{})}}function F(e){void 0===e&&(e=[]);let t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),u=l.useCallback(t=>w(t,e,"reference"),t),o=l.useCallback(t=>w(t,e,"floating"),n),c=l.useCallback(t=>w(t,e,"item"),r);return l.useMemo(()=>({getReferenceProps:u,getFloatingProps:o,getItemProps:c}),[u,o,c])}function K(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}let N=e=>({name:"inner",options:e,async fn(t){let{listRef:n,overflowRef:r,onFallbackChange:l,offset:u=0,index:c=0,minItemsVisible:a=4,referenceOverflowThreshold:d=0,scrollRef:m,...g}=(0,o.ku)(e,t),{rects:p,elements:{floating:h}}=t,v=n.current[c],C=(null==m?void 0:m.current)||h,R=h.clientTop||C.clientTop,y=0!==h.clientTop,b=0!==C.clientTop,k=h===C;if(!v)return{};let M={...t,...await (0,f.cv)(-v.offsetTop-h.clientTop-p.reference.height/2-v.offsetHeight/2-u).fn(t)},x=await (0,s.US)(K(M,C.scrollHeight+R+h.clientTop),g),S=await (0,s.US)(M,{...g,elementContext:"reference"}),E=(0,o.Fp)(0,x.top),H=M.y+E,T=(C.scrollHeight>C.clientHeight?e=>e:o.NM)((0,o.Fp)(0,C.scrollHeight+(y&&k||b?2*R:0)-E-(0,o.Fp)(0,x.bottom)));if(C.style.maxHeight=T+"px",C.scrollTop=E,l){let e=C.offsetHeight=-d||S.bottom>=-d;i.flushSync(()=>l(e))}return r&&(r.current=await (0,s.US)(K({...M,y:H},C.offsetHeight+R+h.clientTop),g)),{y:H}}});function O(e,t){let{open:n,elements:r}=e,{enabled:o=!0,overflowRef:c,scrollRef:f,onChange:s}=t,a=m(s),d=l.useRef(!1),g=l.useRef(null),p=l.useRef(null);l.useEffect(()=>{if(!o)return;function e(e){if(e.ctrlKey||!t||null==c.current)return;let n=e.deltaY,r=c.current.top>=-.5,l=c.current.bottom>=-.5,o=t.scrollHeight-t.clientHeight,f=n<0?-1:1,s=n<0?"max":"min";!(t.scrollHeight<=t.clientHeight)&&(!r&&n>0||!l&&n<0?(e.preventDefault(),i.flushSync(()=>{a(e=>e+Math[s](n,o*f))})):/firefox/i.test((0,u.ij)())&&(t.scrollTop+=n))}let t=(null==f?void 0:f.current)||r.floating;if(n&&t)return t.addEventListener("wheel",e),requestAnimationFrame(()=>{g.current=t.scrollTop,null!=c.current&&(p.current={...c.current})}),()=>{g.current=null,p.current=null,t.removeEventListener("wheel",e)}},[o,n,r.floating,c,f,a]);let h=l.useMemo(()=>({onKeyDown(){d.current=!0},onWheel(){d.current=!1},onPointerMove(){d.current=!1},onScroll(){let e=(null==f?void 0:f.current)||r.floating;if(c.current&&e&&d.current){if(null!==g.current){let t=e.scrollTop-g.current;(c.current.bottom<-.5&&t<-1||c.current.top<-.5&&t>1)&&i.flushSync(()=>a(e=>e+t))}requestAnimationFrame(()=>{g.current=e.scrollTop})}}}),[r.floating,a,c,f]);return l.useMemo(()=>o?{floating:h}:{},[o,h])}}}]);