import{r as e,a as t,R as n,b as r,c as o,d as i}from"./chunk-CLN-lmR0.js";var a,s,l={exports:{}},c={};var u=(s||(s=1,l.exports=function(){if(a)return c;a=1;var t=e(),n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(e,t,r){var a,l={},c=null,u=null;for(a in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)o.call(t,a)&&!s.hasOwnProperty(a)&&(l[a]=t[a]);if(e&&e.defaultProps)for(a in t=e.defaultProps)void 0===l[a]&&(l[a]=t[a]);return{$$typeof:n,type:e,key:c,ref:u,props:l,_owner:i.current}}return c.Fragment=r,c.jsx=l,c.jsxs=l,c}()),l.exports);function d(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function f(...e){return t=>{let n=!1;const r=e.map(e=>{const r=d(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t{const{children:o,...i}=e,a=t.Children.toArray(o),s=a.find(y);if(s){const e=s.props.children,o=a.map(n=>n===s?t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null:n);return u.jsx(n,{...i,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,o):null})}return u.jsx(n,{...i,ref:r,children:o})});return r.displayName=`${e}.Slot`,r}var h=v("Slot");function m(e){const n=t.forwardRef((e,n)=>{const{children:r,...o}=e;if(t.isValidElement(r)){const e=function(e){var t,n;let r=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;if(o)return e.ref;if(r=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=r&&"isReactWarning"in r&&r.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==t.Fragment&&(i.ref=n?f(n,e):e),t.cloneElement(r,i)}return t.Children.count(r)>1?t.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var g=Symbol("radix.slottable");function w(e){const t=({children:e})=>u.jsx(u.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=g,t}function y(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===g}function b(e,[t,n]){return Math.min(n,Math.max(t,e))}function x(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(null==e||e(r),!1===n||!r.defaultPrevented)return null==t?void 0:t(r)}}function C(e,n=[]){let r=[];const o=()=>{const n=r.map(e=>t.createContext(e));return function(r){const o=(null==r?void 0:r[e])||n;return t.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])}};return o.scopeName=e,[function(n,o){const i=t.createContext(o),a=r.length;r=[...r,o];const s=n=>{var r;const{scope:o,children:s,...l}=n,c=(null==(r=null==o?void 0:o[e])?void 0:r[a])||i,d=t.useMemo(()=>l,Object.values(l));return u.jsx(c.Provider,{value:d,children:s})};return s.displayName=n+"Provider",[s,function(r,s){var l;const c=(null==(l=null==s?void 0:s[e])?void 0:l[a])||i,u=t.useContext(c);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},E(o,...n)]}function E(...e){const n=e[0];if(1===e.length)return n;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const o=r.reduce((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]}),{});return t.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}function S(e){const t=e+"CollectionProvider",[r,o]=C(t),[i,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:t,children:r}=e,o=n.useRef(null),a=n.useRef(new Map).current;return u.jsx(i,{scope:t,itemMap:a,collectionRef:o,children:r})};s.displayName=t;const l=e+"CollectionSlot",c=v(l),d=n.forwardRef((e,t)=>{const{scope:n,children:r}=e,o=p(t,a(l,n).collectionRef);return u.jsx(c,{ref:o,children:r})});d.displayName=l;const f=e+"CollectionItemSlot",h="data-radix-collection-item",m=v(f),g=n.forwardRef((e,t)=>{const{scope:r,children:o,...i}=e,s=n.useRef(null),l=p(t,s),c=a(f,r);return n.useEffect(()=>(c.itemMap.set(s,{ref:s,...i}),()=>{c.itemMap.delete(s)})),u.jsx(m,{[h]:"",ref:l,children:o})});return g.displayName=f,[{Provider:s,Slot:d,ItemSlot:g},function(t){const r=a(e+"CollectionConsumer",t);return n.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},o]}var R=t.createContext(void 0);function _(e){const n=t.useContext(R);return e||n||"ltr"}var T=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,n)=>{const r=v(`Primitive.${n}`),o=t.forwardRef((e,t)=>{const{asChild:o,...i}=e,a=o?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),u.jsx(a,{...i,ref:t})});return o.displayName=`Primitive.${n}`,{...e,[n]:o}},{});function P(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}function D(e){const n=t.useRef(e);return t.useEffect(()=>{n.current=e}),t.useMemo(()=>(...e)=>{var t;return null==(t=n.current)?void 0:t.call(n,...e)},[])}var j,k="dismissableLayer.update",M="dismissableLayer.pointerDownOutside",O="dismissableLayer.focusOutside",A=t.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),N=t.forwardRef((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,d=t.useContext(A),[f,v]=t.useState(null),h=(null==f?void 0:f.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,m]=t.useState({}),g=p(n,e=>v(e)),w=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=w.indexOf(y),C=f?w.indexOf(f):-1,E=d.layersWithOutsidePointerEventsDisabled.size>0,S=C>=b,R=function(e,n=(null==globalThis?void 0:globalThis.document)){const r=D(e),o=t.useRef(!1),i=t.useRef(()=>{});return t.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){F(M,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...d.branches].some(e=>e.contains(t));S&&!n&&(null==i||i(e),null==s||s(e),e.defaultPrevented||null==l||l())},h),_=function(e,n=(null==globalThis?void 0:globalThis.document)){const r=D(e),o=t.useRef(!1);return t.useEffect(()=>{const e=e=>{if(e.target&&!o.current){F(O,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(null==a||a(e),null==s||s(e),e.defaultPrevented||null==l||l())},h);return function(e,n=(null==globalThis?void 0:globalThis.document)){const r=D(e);t.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{C===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},h),t.useEffect(()=>{if(f)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(j=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),L(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=j)}},[f,h,r,d]),t.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),L())},[f,d]),t.useEffect(()=>{const e=()=>m({});return document.addEventListener(k,e),()=>document.removeEventListener(k,e)},[]),u.jsx(T.div,{...c,ref:g,style:{pointerEvents:E?S?"auto":"none":void 0,...e.style},onFocusCapture:x(e.onFocusCapture,_.onFocusCapture),onBlurCapture:x(e.onBlurCapture,_.onBlurCapture),onPointerDownCapture:x(e.onPointerDownCapture,R.onPointerDownCapture)})});N.displayName="DismissableLayer";var I=t.forwardRef((e,n)=>{const r=t.useContext(A),o=t.useRef(null),i=p(n,o);return t.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),u.jsx(T.div,{...e,ref:i})});function L(){const e=new CustomEvent(k);document.dispatchEvent(e)}function F(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?P(o,i):o.dispatchEvent(i)}I.displayName="DismissableLayerBranch";var K=N,H=I,W=0;function B(){t.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??V()),document.body.insertAdjacentElement("beforeend",e[1]??V()),W++,()=>{1===W&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),W--}},[])}function V(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var z="focusScope.autoFocusOnMount",U="focusScope.autoFocusOnUnmount",$={bubbles:!1,cancelable:!0},X=t.forwardRef((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=e,[l,c]=t.useState(null),d=D(i),f=D(a),v=t.useRef(null),h=p(n,e=>c(e)),m=t.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;t.useEffect(()=>{if(o){let e=function(e){if(m.paused||!l)return;const t=e.target;l.contains(t)?v.current=t:Z(v.current,{select:!0})},t=function(e){if(m.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||Z(v.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Z(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,l,m.paused]),t.useEffect(()=>{if(l){J.add(m);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(z,$);l.addEventListener(z,d),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(Z(r,{select:t}),document.activeElement!==n)return}((e=Y(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&Z(l))}return()=>{l.removeEventListener(z,d),setTimeout(()=>{const e=new CustomEvent(U,$);l.addEventListener(U,f),l.dispatchEvent(e),e.defaultPrevented||Z(t??document.body,{select:!0}),l.removeEventListener(U,f),J.remove(m)},0)}}var e},[l,d,f,m]);const g=t.useCallback(e=>{if(!r&&!o)return;if(m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,i]=function(e){const t=Y(e),n=q(t,e),r=q(t.reverse(),e);return[n,r]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&Z(i,{select:!0})):(e.preventDefault(),r&&Z(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,m.paused]);return u.jsx(T.div,{tabIndex:-1,...s,ref:h,onKeyDown:g})});function Y(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function q(e,t){for(const n of e)if(!G(n,{upTo:t}))return n}function G(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Z(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}X.displayName="FocusScope";var J=function(){let e=[];return{add(t){const n=e[0];t!==n&&(null==n||n.pause()),e=Q(e,t),e.unshift(t)},remove(t){var n;e=Q(e,t),null==(n=e[0])||n.resume()}}}();function Q(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var ee=(null==globalThis?void 0:globalThis.document)?t.useLayoutEffect:()=>{},te=o[" useId ".trim().toString()]||(()=>{}),ne=0;function re(e){const[n,r]=t.useState(te());return ee(()=>{r(e=>e??String(ne++))},[e]),n?`radix-${n}`:""}const oe=["top","right","bottom","left"],ie=Math.min,ae=Math.max,se=Math.round,le=Math.floor,ce=e=>({x:e,y:e}),ue={left:"right",right:"left",bottom:"top",top:"bottom"},de={start:"end",end:"start"};function fe(e,t,n){return ae(e,ie(t,n))}function pe(e,t){return"function"==typeof e?e(t):e}function ve(e){return e.split("-")[0]}function he(e){return e.split("-")[1]}function me(e){return"x"===e?"y":"x"}function ge(e){return"y"===e?"height":"width"}const we=new Set(["top","bottom"]);function ye(e){return we.has(ve(e))?"y":"x"}function be(e){return me(ye(e))}function xe(e){return e.replace(/start|end/g,e=>de[e])}const Ce=["left","right"],Ee=["right","left"],Se=["top","bottom"],Re=["bottom","top"];function _e(e,t,n,r){const o=he(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Ee:Ce:t?Ce:Ee;case"left":case"right":return t?Se:Re;default:return[]}}(ve(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(xe)))),i}function Te(e){return e.replace(/left|right|bottom|top/g,e=>ue[e])}function Pe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function De(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function je(e,t,n){let{reference:r,floating:o}=e;const i=ye(t),a=be(t),s=ge(a),l=ve(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(he(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function ke(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=pe(t,e),v=Pe(p),h=s[f?"floating"===d?"reference":"floating":d],m=De(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),g="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=De(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:w,strategy:l}):g);return{top:(m.top-b.top+v.top)/y.y,bottom:(b.bottom-m.bottom+v.bottom)/y.y,left:(m.left-b.left+v.left)/y.x,right:(b.right-m.right+v.right)/y.x}}function Me(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Oe(e){return oe.some(t=>e[t]>=0)}const Ae=new Set(["left","top"]);function Ne(){return"undefined"!=typeof window}function Ie(e){return Ke(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Fe(e){var t;return null==(t=(Ke(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ke(e){return!!Ne()&&(e instanceof Node||e instanceof Le(e).Node)}function He(e){return!!Ne()&&(e instanceof Element||e instanceof Le(e).Element)}function We(e){return!!Ne()&&(e instanceof HTMLElement||e instanceof Le(e).HTMLElement)}function Be(e){return!(!Ne()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot)}const Ve=new Set(["inline","contents"]);function ze(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=nt(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Ve.has(o)}const Ue=new Set(["table","td","th"]);function $e(e){return Ue.has(Ie(e))}const Xe=[":popover-open",":modal"];function Ye(e){return Xe.some(t=>{try{return e.matches(t)}catch(n){return!1}})}const qe=["transform","translate","scale","rotate","perspective"],Ge=["transform","translate","scale","rotate","perspective","filter"],Ze=["paint","layout","strict","content"];function Je(e){const t=Qe(),n=He(e)?nt(e):e;return qe.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||Ge.some(e=>(n.willChange||"").includes(e))||Ze.some(e=>(n.contain||"").includes(e))}function Qe(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const et=new Set(["html","body","#document"]);function tt(e){return et.has(Ie(e))}function nt(e){return Le(e).getComputedStyle(e)}function rt(e){return He(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ot(e){if("html"===Ie(e))return e;const t=e.assignedSlot||e.parentNode||Be(e)&&e.host||Fe(e);return Be(t)?t.host:t}function it(e){const t=ot(e);return tt(t)?e.ownerDocument?e.ownerDocument.body:e.body:We(t)&&ze(t)?t:it(t)}function at(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=it(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Le(o);if(i){const e=st(a);return t.concat(a,a.visualViewport||[],ze(o)?o:[],e&&n?at(e):[])}return t.concat(o,at(o,[],n))}function st(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lt(e){const t=nt(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=We(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=se(n)!==i||se(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function ct(e){return He(e)?e:e.contextElement}function ut(e){const t=ct(e);if(!We(t))return ce(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=lt(t);let a=(i?se(n.width):n.width)/r,s=(i?se(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const dt=ce(0);function ft(e){const t=Le(e);return Qe()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:dt}function pt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ct(e);let a=ce(1);t&&(r?He(r)&&(a=ut(r)):a=ut(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Le(e))&&t}(i,n,r)?ft(i):ce(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=Le(i),t=r&&He(r)?Le(r):r;let n=e,o=st(n);for(;o&&r&&t!==n;){const e=ut(o),t=o.getBoundingClientRect(),r=nt(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=Le(o),o=st(n)}}return De({width:u,height:d,x:l,y:c})}function vt(e,t){const n=rt(e).scrollLeft;return t?t.left+n:pt(Fe(e)).left+n}function ht(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vt(e,n),y:n.top+t.scrollTop}}const mt=new Set(["absolute","fixed"]);function gt(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Le(e),r=Fe(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=Qe();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=vt(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Fe(e),n=rt(e),r=e.ownerDocument.body,o=ae(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ae(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+vt(e);const s=-n.scrollTop;return"rtl"===nt(r).direction&&(a+=ae(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Fe(e));else if(He(t))r=function(e,t){const n=pt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=We(e)?ut(e):ce(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ft(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return De(r)}function wt(e,t){const n=ot(e);return!(n===t||!He(n)||tt(n))&&("fixed"===nt(n).position||wt(n,t))}function yt(e,t,n){const r=We(t),o=Fe(t),i="fixed"===n,a=pt(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=ce(0);function c(){l.x=vt(o)}if(r||!r&&!i)if(("body"!==Ie(t)||ze(o))&&(s=rt(t)),r){const e=pt(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?ce(0):ht(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function bt(e){return"static"===nt(e).position}function xt(e,t){if(!We(e)||"fixed"===nt(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function Ct(e,t){const n=Le(e);if(Ye(e))return n;if(!We(e)){let t=ot(e);for(;t&&!tt(t);){if(He(t)&&!bt(t))return t;t=ot(t)}return n}let r=xt(e,t);for(;r&&$e(r)&&bt(r);)r=xt(r,t);return r&&tt(r)&&bt(r)&&!Je(r)?n:r||function(e){let t=ot(e);for(;We(t)&&!tt(t);){if(Je(t))return t;if(Ye(t))return null;t=ot(t)}return null}(e)||n}const Et={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Fe(r),s=!!t&&Ye(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=ce(1);const u=ce(0),d=We(r);if((d||!d&&!i)&&(("body"!==Ie(r)||ze(a))&&(l=rt(r)),We(r))){const e=pt(r);c=ut(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!a||d||i?ce(0):ht(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Fe,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?Ye(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=at(e,[],!1).filter(e=>He(e)&&"body"!==Ie(e)),o=null;const i="fixed"===nt(e).position;let a=i?ot(e):e;for(;He(a)&&!tt(a);){const t=nt(a),n=Je(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&mt.has(o.position)||ze(a)&&!n&&wt(e,a))?r=r.filter(e=>e!==a):o=t,a=ot(a)}return t.set(e,r),r}(t,this._c):[].concat(n),r],a=i[0],s=i.reduce((e,n)=>{const r=gt(t,n,o);return e.top=ae(r.top,e.top),e.right=ie(r.right,e.right),e.bottom=ie(r.bottom,e.bottom),e.left=ae(r.left,e.left),e},gt(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Ct,getElementRects:async function(e){const t=this.getOffsetParent||Ct,n=this.getDimensions,r=await n(e.floating);return{reference:yt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=lt(e);return{width:t,height:n}},getScale:ut,isElement:He,isRTL:function(e){return"rtl"===nt(e).direction}};function St(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rt(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=ct(e),u=o||i?[...c?at(c):[],...at(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=Fe(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const v={rootMargin:-le(d)+"px "+-le(o.clientWidth-(u+f))+"px "+-le(o.clientHeight-(d+p))+"px "+-le(u)+"px",threshold:ae(0,ie(1,l))||1};let h=!0;function m(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||St(c,e.getBoundingClientRect())||a(),h=!1}try{r=new IntersectionObserver(m,{...v,root:o.ownerDocument})}catch(g){r=new IntersectionObserver(m,v)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,v=null;a&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),c&&!l&&v.observe(c),v.observe(t));let h=l?pt(e):null;return l&&function t(){const r=pt(e);h&&!St(h,r)&&n();h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=v)||e.disconnect(),v=null,l&&cancelAnimationFrame(f)}}const _t=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=ve(n),s=he(n),l="y"===ye(n),c=Ae.has(a)?-1:1,u=i&&l?-1:1,d=pe(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:v}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof v&&(p="end"===s?-1*v:v),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Tt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=pe(e,t),c={x:n,y:r},u=await ke(t,l),d=ye(ve(o)),f=me(d);let p=c[f],v=c[d];if(i){const e="y"===f?"bottom":"right";p=fe(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";v=fe(v+u["y"===d?"top":"left"],v,v-u[e])}const h=s.fn({...t,[f]:p,[d]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[f]:i,[d]:a}}}}}},Pt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:h=!0,...m}=pe(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=ve(o),w=ye(s),y=ve(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(y||!h?[Te(s)]:function(e){const t=Te(e);return[xe(e),t,xe(t)]}(s)),C="none"!==v;!f&&C&&x.push(..._e(s,h,v,b));const E=[s,...x],S=await ke(t,m),R=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&R.push(S[g]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=he(e),o=be(e),i=ge(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Te(a)),[a,Te(a)]}(o,a,b);R.push(S[e[0]],S[e[1]])}if(_=[..._,{placement:o,overflows:R}],!R.every(e=>e<=0)){var T,P;const e=((null==(T=i.flip)?void 0:T.index)||0)+1,t=E[e];if(t){if(!("alignment"===d&&w!==ye(t))||_.every(e=>ye(e.placement)!==w||e.overflows[0]>0))return{data:{index:e,overflows:_},reset:{placement:t}}}let n=null==(P=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var D;const e=null==(D=_.filter(e=>{if(C){const t=ye(e.placement);return t===w||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:D[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Dt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=pe(e,t),u=await ke(t,c),d=ve(o),f=he(o),p="y"===ye(o),{width:v,height:h}=i.floating;let m,g;"top"===d||"bottom"===d?(m=d,g=f===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(g=d,m="end"===f?"top":"bottom");const w=h-u.top-u.bottom,y=v-u.left-u.right,b=ie(h-u[m],w),x=ie(v-u[g],y),C=!t.middlewareData.shift;let E=b,S=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(S=y),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=w),C&&!f){const e=ae(u.left,0),t=ae(u.right,0),n=ae(u.top,0),r=ae(u.bottom,0);p?S=v-2*(0!==e||0!==t?e+t:ae(u.left,u.right)):E=h-2*(0!==n||0!==r?n+r:ae(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:E});const R=await a.getDimensions(s.floating);return v!==R.width||h!==R.height?{reset:{rects:!0}}:{}}}},jt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=pe(e,t);switch(r){case"referenceHidden":{const e=Me(await ke(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Oe(e)}}}case"escaped":{const e=Me(await ke(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Oe(e)}}}default:return{}}}}},kt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=pe(e,t)||{};if(null==c)return{};const d=Pe(u),f={x:n,y:r},p=be(o),v=ge(p),h=await a.getDimensions(c),m="y"===p,g=m?"top":"left",w=m?"bottom":"right",y=m?"clientHeight":"clientWidth",b=i.reference[v]+i.reference[p]-f[p]-i.floating[v],x=f[p]-i.reference[p],C=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let E=C?C[y]:0;E&&await(null==a.isElement?void 0:a.isElement(C))||(E=s.floating[y]||i.floating[v]);const S=b/2-x/2,R=E/2-h[v]/2-1,_=ie(d[g],R),T=ie(d[w],R),P=_,D=E-h[v]-T,j=E/2-h[v]/2+S,k=fe(P,j,D),M=!l.arrow&&null!=he(o)&&j!==k&&i.reference[v]/2-(jn&&(p=n)}if(c){var g,w;const e="y"===f?"width":"height",t=Ae.has(ve(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(g=a.offset)?void 0:g[d])||0)+(t?0:m.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(w=a.offset)?void 0:w[d])||0)-(t?m.crossAxis:0);vr&&(v=r)}return{[f]:p,[d]:v}}}},Ot=(e,t,n)=>{const r=new Map,o={platform:Et,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=je(c,r,l),f=r,p={},v=0;for(let h=0;h{n.current=e}),n}const Kt=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?kt({element:n.current,padding:r}).fn(t):{}:n?kt({element:n,padding:r}).fn(t):{};var o}}),Ht=(e,t)=>({..._t(e),options:[e,t]}),Wt=(e,t)=>({...Tt(e),options:[e,t]}),Bt=(e,t)=>({...Mt(e),options:[e,t]}),Vt=(e,t)=>({...Pt(e),options:[e,t]}),zt=(e,t)=>({...Dt(e),options:[e,t]}),Ut=(e,t)=>({...jt(e),options:[e,t]}),$t=(e,t)=>({...Kt(e),options:[e,t]});var Xt=t.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return u.jsx(T.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});Xt.displayName="Arrow";var Yt=Xt;function qt(e){const[n,r]=t.useState(void 0);return ee(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t))return;if(!t.length)return;const n=t[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;r({width:o,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),n}var Gt="Popper",[Zt,Jt]=C(Gt),[Qt,en]=Zt(Gt),tn=e=>{const{__scopePopper:n,children:r}=e,[o,i]=t.useState(null);return u.jsx(Qt,{scope:n,anchor:o,onAnchorChange:i,children:r})};tn.displayName=Gt;var nn="PopperAnchor",rn=t.forwardRef((e,n)=>{const{__scopePopper:r,virtualRef:o,...i}=e,a=en(nn,r),s=t.useRef(null),l=p(n,s),c=t.useRef(null);return t.useEffect(()=>{const e=c.current;c.current=(null==o?void 0:o.current)||s.current,e!==c.current&&a.onAnchorChange(c.current)}),o?null:u.jsx(T.div,{...i,ref:l})});rn.displayName=nn;var on="PopperContent",[an,sn]=Zt(on),ln=t.forwardRef((e,n)=>{var o,i,a,s,l,c;const{__scopePopper:d,side:f="bottom",sideOffset:v=0,align:h="center",alignOffset:m=0,arrowPadding:g=0,avoidCollisions:w=!0,collisionBoundary:y=[],collisionPadding:b=0,sticky:x="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:S,...R}=e,_=en(on,d),[P,j]=t.useState(null),k=p(n,e=>j(e)),[M,O]=t.useState(null),A=qt(M),N=(null==A?void 0:A.width)??0,I=(null==A?void 0:A.height)??0,L=f+("center"!==h?"-"+h:""),F="number"==typeof b?b:{top:0,right:0,bottom:0,left:0,...b},K=Array.isArray(y)?y:[y],H=K.length>0,W={padding:F,boundary:K.filter(fn),altBoundary:H},{refs:B,floatingStyles:V,placement:z,isPositioned:U,middlewareData:$}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a,elements:{reference:s,floating:l}={},transform:c=!0,whileElementsMounted:u,open:d}=e,[f,p]=t.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[v,h]=t.useState(i);Nt(v,i)||h(i);const[m,g]=t.useState(null),[w,y]=t.useState(null),b=t.useCallback(e=>{e!==S.current&&(S.current=e,g(e))},[]),x=t.useCallback(e=>{e!==R.current&&(R.current=e,y(e))},[]),C=s||m,E=l||w,S=t.useRef(null),R=t.useRef(null),_=t.useRef(f),T=null!=u,P=Ft(u),D=Ft(a),j=Ft(d),k=t.useCallback(()=>{if(!S.current||!R.current)return;const e={placement:n,strategy:o,middleware:v};D.current&&(e.platform=D.current),Ot(S.current,R.current,e).then(e=>{const t={...e,isPositioned:!1!==j.current};M.current&&!Nt(_.current,t)&&(_.current=t,r.flushSync(()=>{p(t)}))})},[v,n,o,D,j]);At(()=>{!1===d&&_.current.isPositioned&&(_.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[d]);const M=t.useRef(!1);At(()=>(M.current=!0,()=>{M.current=!1}),[]),At(()=>{if(C&&(S.current=C),E&&(R.current=E),C&&E){if(P.current)return P.current(C,E,k);k()}},[C,E,k,P,T]);const O=t.useMemo(()=>({reference:S,floating:R,setReference:b,setFloating:x}),[b,x]),A=t.useMemo(()=>({reference:C,floating:E}),[C,E]),N=t.useMemo(()=>{const e={position:o,left:0,top:0};if(!A.floating)return e;const t=Lt(A.floating,f.x),n=Lt(A.floating,f.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...It(A.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:t,top:n}},[o,c,A.floating,f.x,f.y]);return t.useMemo(()=>({...f,update:k,refs:O,elements:A,floatingStyles:N}),[f,k,O,A,N])}({strategy:"fixed",placement:L,whileElementsMounted:(...e)=>Rt(...e,{animationFrame:"always"===E}),elements:{reference:_.anchor},middleware:[Ht({mainAxis:v+I,alignmentAxis:m}),w&&Wt({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?Bt():void 0,...W}),w&&Vt({...W}),zt({...W,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),M&&$t({element:M,padding:g}),pn({arrowWidth:N,arrowHeight:I}),C&&Ut({strategy:"referenceHidden",...W})]}),[X,Y]=vn(z),q=D(S);ee(()=>{U&&(null==q||q())},[U,q]);const G=null==(o=$.arrow)?void 0:o.x,Z=null==(i=$.arrow)?void 0:i.y,J=0!==(null==(a=$.arrow)?void 0:a.centerOffset),[Q,te]=t.useState();return ee(()=>{P&&te(window.getComputedStyle(P).zIndex)},[P]),u.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:U?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[null==(s=$.transformOrigin)?void 0:s.x,null==(l=$.transformOrigin)?void 0:l.y].join(" "),...(null==(c=$.hide)?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(an,{scope:d,placedSide:X,onArrowChange:O,arrowX:G,arrowY:Z,shouldHideArrow:J,children:u.jsx(T.div,{"data-side":X,"data-align":Y,...R,ref:k,style:{...R.style,animation:U?void 0:"none"}})})})});ln.displayName=on;var cn="PopperArrow",un={top:"bottom",right:"left",bottom:"top",left:"right"},dn=t.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=sn(cn,n),i=un[o.placedSide];return u.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:u.jsx(Yt,{...r,ref:t,style:{...r.style,display:"block"}})})});function fn(e){return null!==e}dn.displayName=cn;var pn=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o;const{placement:i,rects:a,middlewareData:s}=t,l=0!==(null==(n=s.arrow)?void 0:n.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,f]=vn(i),p={start:"0%",center:"50%",end:"100%"}[f],v=((null==(r=s.arrow)?void 0:r.x)??0)+c/2,h=((null==(o=s.arrow)?void 0:o.y)??0)+u/2;let m="",g="";return"bottom"===d?(m=l?p:`${v}px`,g=-u+"px"):"top"===d?(m=l?p:`${v}px`,g=`${a.floating.height+u}px`):"right"===d?(m=-u+"px",g=l?p:`${h}px`):"left"===d&&(m=`${a.floating.width+u}px`,g=l?p:`${h}px`),{data:{x:m,y:g}}}});function vn(e){const[t,n="center"]=e.split("-");return[t,n]}var hn=tn,mn=rn,gn=ln,wn=dn,yn=t.forwardRef((e,n)=>{var r;const{container:o,...a}=e,[s,l]=t.useState(!1);ee(()=>l(!0),[]);const c=o||s&&(null==(r=null==globalThis?void 0:globalThis.document)?void 0:r.body);return c?i.createPortal(u.jsx(T.div,{...a,ref:n}),c):null});yn.displayName="Portal";var bn=o[" useInsertionEffect ".trim().toString()]||ee;function xn({prop:e,defaultProp:n,onChange:r=()=>{},caller:o}){const[i,a,s]=function({defaultProp:e,onChange:n}){const[r,o]=t.useState(e),i=t.useRef(r),a=t.useRef(n);return bn(()=>{a.current=n},[n]),t.useEffect(()=>{var e;i.current!==r&&(null==(e=a.current)||e.call(a,r),i.current=r)},[r,i]),[r,o,a]}({defaultProp:n,onChange:r}),l=void 0!==e,c=l?e:i;{const n=t.useRef(void 0!==e);t.useEffect(()=>{const e=n.current;if(e!==l){}n.current=l},[l,o])}const u=t.useCallback(t=>{var n;if(l){const r=function(e){return"function"==typeof e}(t)?t(e):t;r!==e&&(null==(n=s.current)||n.call(s,r))}else a(t)},[l,e,a,s]);return[c,u]}function Cn(e){const n=t.useRef({value:e,previous:e});return t.useMemo(()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous),[e])}var En=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Sn=t.forwardRef((e,t)=>u.jsx(T.span,{...e,ref:t,style:{...En,...e.style}}));Sn.displayName="VisuallyHidden";var Rn=Sn,_n=new WeakMap,Tn=new WeakMap,Pn={},Dn=0,jn=function(e){return e&&(e.host||jn(e.parentNode))},kn=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=jn(t);return n&&e.contains(n)?n:null}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);Pn[n]||(Pn[n]=new WeakMap);var i=Pn[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(_n.get(e)||0)+1,c=(i.get(e)||0)+1;_n.set(e,l),i.set(e,c),a.push(e),1===l&&o&&Tn.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(d){}})};return u(t),s.clear(),Dn++,function(){a.forEach(function(e){var t=_n.get(e)-1,o=i.get(e)-1;_n.set(e,t),i.set(e,o),t||(Tn.has(e)||e.removeAttribute(r),Tn.delete(e)),o||e.removeAttribute(n)}),--Dn||(_n=new WeakMap,_n=new WeakMap,Tn=new WeakMap,Pn={})}},Mn=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),kn(r,o,n,"aria-hidden")):function(){return null}},On=function(){return On=Object.assign||function(e){for(var t,n=1,r=arguments.length;n