@radui/ui 0.0.29 → 0.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- 'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as u}from"react";import*as c from"react-dom";var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var f=n({});function d(){return"undefined"!=typeof window}function p(e){return g(e)?(e.nodeName||"").toLowerCase():"#document"}function m(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function v(e){var t;return null==(t=(g(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function g(e){return!!d()&&(e instanceof Node||e instanceof m(e).Node)}function h(e){return!!d()&&(e instanceof Element||e instanceof m(e).Element)}function y(e){return!!d()&&(e instanceof HTMLElement||e instanceof m(e).HTMLElement)}function w(e){return!(!d()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof m(e).ShadowRoot)}function b(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function x(e){return["table","td","th"].includes(p(e))}function E(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function R(e){const t=C(),n=h(e)?S(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function C(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function O(e){return["html","body","#document"].includes(p(e))}function S(e){return m(e).getComputedStyle(e)}function L(e){return h(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function T(e){if("html"===p(e))return e;const t=e.assignedSlot||e.parentNode||w(e)&&e.host||v(e);return w(t)?t.host:t}function A(e){const t=T(e);return O(t)?e.ownerDocument?e.ownerDocument.body:e.body:y(t)&&b(t)?t:A(t)}function P(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=A(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=m(o);if(i){const e=k(l);return t.concat(l,l.visualViewport||[],b(o)?o:[],e&&n?P(e):[])}return t.concat(o,P(o,[],n))}function k(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function D(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function M(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function N(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function F(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function I(e){return!F().includes("jsdom/")&&(!W()&&0===e.width&&0===e.height||W()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function W(){const e=/android/i;return e.test(N())||e.test(F())}function j(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function H(e){return(null==e?void 0:e.ownerDocument)||document}function B(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function V(e){return"composedPath"in e?e.composedPath()[0]:e.target}function _(e){e.preventDefault(),e.stopPropagation()}function q(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return y(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}const K=["top","right","bottom","left"],X=Math.min,U=Math.max,Y=Math.round,$=e=>({x:e,y:e}),z={left:"right",right:"left",bottom:"top",top:"bottom"},Z={start:"end",end:"start"};function G(e,t,n){return U(e,X(t,n))}function Q(e,t){return"function"==typeof e?e(t):e}function J(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return"x"===e?"y":"x"}function ne(e){return"y"===e?"height":"width"}function re(e){return["top","bottom"].includes(J(e))?"y":"x"}function oe(e){return te(re(e))}function ie(e){return e.replace(/start|end/g,(e=>Z[e]))}function le(e){return e.replace(/left|right|bottom|top/g,(e=>z[e]))}function ue(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 ce(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}}
1
+ 'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as u}from"react";import{jsxs as c,jsx as s,Fragment as a}from"react/jsx-runtime";import*as f from"react-dom";var d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var m=n({});function v(){return"undefined"!=typeof window}function g(e){return w(e)?(e.nodeName||"").toLowerCase():"#document"}function h(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function y(e){var t;return null==(t=(w(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function w(e){return!!v()&&(e instanceof Node||e instanceof h(e).Node)}function b(e){return!!v()&&(e instanceof Element||e instanceof h(e).Element)}function x(e){return!!v()&&(e instanceof HTMLElement||e instanceof h(e).HTMLElement)}function E(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof h(e).ShadowRoot)}function R(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=A(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function C(e){return["table","td","th"].includes(g(e))}function S(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function O(e){const t=L(),n=b(e)?A(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function L(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function T(e){return["html","body","#document"].includes(g(e))}function A(e){return h(e).getComputedStyle(e)}function P(e){return b(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(e){if("html"===g(e))return e;const t=e.assignedSlot||e.parentNode||E(e)&&e.host||y(e);return E(t)?t.host:t}function D(e){const t=k(e);return T(t)?e.ownerDocument?e.ownerDocument.body:e.body:x(t)&&R(t)?t:D(t)}function M(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=D(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=h(o);if(i){const e=N(l);return t.concat(l,l.visualViewport||[],R(o)?o:[],e&&n?M(e):[])}return t.concat(o,M(o,[],n))}function N(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function F(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&E(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function W(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function j(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function H(e){return!j().includes("jsdom/")&&(!B()&&0===e.width&&0===e.height||B()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function B(){const e=/android/i;return e.test(W())||e.test(j())}function V(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function _(e){return(null==e?void 0:e.ownerDocument)||document}function q(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function K(e){return"composedPath"in e?e.composedPath()[0]:e.target}function X(e){e.preventDefault(),e.stopPropagation()}function U(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return x(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}const Y=["top","right","bottom","left"],$=Math.min,z=Math.max,Z=Math.round,G=e=>({x:e,y:e}),Q={left:"right",right:"left",bottom:"top",top:"bottom"},J={start:"end",end:"start"};function ee(e,t,n){return z(e,$(t,n))}function te(e,t){return"function"==typeof e?e(t):e}function ne(e){return e.split("-")[0]}function re(e){return e.split("-")[1]}function oe(e){return"x"===e?"y":"x"}function ie(e){return"y"===e?"height":"width"}function le(e){return["top","bottom"].includes(ne(e))?"y":"x"}function ue(e){return oe(le(e))}function ce(e){return e.replace(/start|end/g,(e=>J[e]))}function se(e){return e.replace(/left|right|bottom|top/g,(e=>Q[e]))}function ae(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 fe(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}}
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var se=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ae="undefined"==typeof Element,fe=ae?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,de=!ae&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},pe=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},me=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!pe(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{fe.call(l,se)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!pe(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},ve=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ge=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ve(e)?0:e.tabIndex},he=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ye=function(e){return"INPUT"===e.tagName},we=function(e){return function(e){return ye(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||de(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},be=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},xe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=fe.call(e,"details>summary:first-of-type")?e.parentElement:e;if(fe.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return be(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=de(e);if(l&&!l.shadowRoot&&!0===r(l))return be(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(function(e){var t,n,r,o,i=e&&de(e),l=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=de(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ee=function(e,t){return!(t.disabled||pe(t)||function(e){return ye(e)&&"hidden"===e.type}(t)||xe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!fe.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Re=function(e,t){return!(we(t)||ge(t)<0||!Ee(e,t))},Ce=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Oe=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=ge(e);return n<0&&t&&!ve(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(he).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Se=function(e,t){var n;return n=(t=t||{}).getShadowRoot?me([e],t.includeContainer,{filter:Re.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ce}):function(e,t,n){if(pe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(se));return t&&fe.call(e,se)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Re.bind(null,t)),Oe(n)};function Le(e,t,n){let{reference:r,floating:o}=e;const i=re(t),l=oe(t),u=ne(l),c=J(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[u]/2-o[u]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ee(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function Te(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Q(t,e),m=ue(p),v=u[d?"floating"===f?"reference":"floating":f],g=ce(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=ce(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function Ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pe(e){return K.some((t=>e[t]>=0))}function ke(e){const t=S(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=y(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Y(n)!==i||Y(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function De(e){return h(e)?e:e.contextElement}function Me(e){const t=De(e);if(!y(t))return $(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ke(t);let l=(i?Y(n.width):n.width)/r,u=(i?Y(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const Ne=$(0);function Fe(e){const t=m(e);return C()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ne}function Ie(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=De(e);let l=$(1);t&&(r?h(r)&&(l=Me(r)):l=Me(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==m(e))&&t}(i,n,r)?Fe(i):$(0);let c=(o.left+u.x)/l.x,s=(o.top+u.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=m(i),t=r&&h(r)?m(r):r;let n=e,o=k(n);for(;o&&r&&t!==n;){const e=Me(o),t=o.getBoundingClientRect(),r=S(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=m(o),o=k(n)}}return ce({width:a,height:f,x:c,y:s})}function We(e,t){const n=L(e).scrollLeft;return t?t.left+n:Ie(v(e)).left+n}function je(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:We(e,r)),y:r.top+t.scrollTop}}function He(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=m(e),r=v(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(o){i=o.width,l=o.height;const e=C();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=v(e),n=L(e),r=e.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=U(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+We(e);const u=-n.scrollTop;return"rtl"===S(r).direction&&(l+=U(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(v(e));else if(h(t))r=function(e,t){const n=Ie(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=y(e)?Me(e):$(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=Fe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ce(r)}function Be(e,t){const n=T(e);return!(n===t||!h(n)||O(n))&&("fixed"===S(n).position||Be(n,t))}function Ve(e,t,n){const r=y(t),o=v(t),i="fixed"===n,l=Ie(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=$(0);if(r||!r&&!i)if(("body"!==p(t)||b(o))&&(u=L(t)),r){const e=Ie(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=We(o));const s=!o||r||i?$(0):je(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.y-s.y,width:l.width,height:l.height}}function _e(e){return"static"===S(e).position}function qe(e,t){if(!y(e)||"fixed"===S(e).position)return null;if(t)return t(e);let n=e.offsetParent;return v(e)===n&&(n=n.ownerDocument.body),n}function Ke(e,t){const n=m(e);if(E(e))return n;if(!y(e)){let t=T(e);for(;t&&!O(t);){if(h(t)&&!_e(t))return t;t=T(t)}return n}let r=qe(e,t);for(;r&&x(r)&&_e(r);)r=qe(r,t);return r&&O(r)&&_e(r)&&!R(r)?n:r||function(e){let t=T(e);for(;y(t)&&!O(t);){if(R(t))return t;if(E(t))return null;t=T(t)}return null}(e)||n}const Xe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=v(r),u=!!t&&E(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=$(1);const a=$(0),f=y(r);if((f||!f&&!i)&&(("body"!==p(r)||b(l))&&(c=L(r)),y(r))){const e=Ie(r);s=Me(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?$(0):je(l,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.scrollTop*s.y+a.y+d.y}},getDocumentElement:v,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?E(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>h(e)&&"body"!==p(e))),o=null;const i="fixed"===S(e).position;let l=i?T(e):e;for(;h(l)&&!O(l);){const t=S(l),n=R(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||b(l)&&!n&&Be(e,l))?r=r.filter((e=>e!==l)):o=t,l=T(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=He(t,n,o);return e.top=U(r.top,e.top),e.right=X(r.right,e.right),e.bottom=X(r.bottom,e.bottom),e.left=U(r.left,e.left),e}),He(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Ke,getElementRects:async function(e){const t=this.getOffsetParent||Ke,n=this.getDimensions,r=await n(e.floating);return{reference:Ve(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}=ke(e);return{width:t,height:n}},getScale:Me,isElement:h,isRTL:function(e){return"rtl"===S(e).direction}},Ue=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=J(n),u=ee(n),c="y"===re(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-1:1,f=Q(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ye=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:l=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Q(e,t),s={x:n,y:r},a=await Te(t,c),f=re(J(o)),d=te(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=G(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=G(m+a["y"===f?"top":"left"],m,m-a[e])}const v=u.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},$e=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=Q(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=J(o),y=re(u),w=J(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[le(u)]:function(e){const t=le(e);return[ie(e),t,ie(t)]}(u)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=ee(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(J(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ie)))),i}(u,v,m,b));const R=[u,...x],C=await Te(t,g),O=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&O.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=ee(e),o=oe(e),i=ne(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=le(l)),[l,le(l)]}(o,l,b);O.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:O}],!O.every((e=>e<=0))){var L,T;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(T=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=S.filter((e=>{if(E){const t=re(e.placement);return t===y||"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:A[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},ze=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Q(e,t);switch(r){case"referenceHidden":{const e=Ae(await Te(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pe(e)}}}case"escaped":{const e=Ae(await Te(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pe(e)}}}default:return{}}}}},Ze=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:s,padding:a=0}=Q(e,t)||{};if(null==s)return{};const f=ue(a),d={x:n,y:r},p=oe(o),m=ne(p),v=await l.getDimensions(s),g="y"===p,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=u.floating[w]||i.floating[m]);const C=b/2-x/2,O=R/2-v[m]/2-1,S=X(f[h],O),L=X(f[y],O),T=S,A=R-v[m]-L,P=R/2-v[m]/2+C,k=G(T,P,A),D=!c.arrow&&null!=ee(o)&&P!==k&&i.reference[m]/2-(P<T?S:L)-v[m]/2<0,M=D?P<T?P-T:P-A:0;return{[p]:d[p]+M,data:{[p]:k,centerOffset:P-k-M,...D&&{alignmentOffset:M}},reset:D}}}),Ge=(e,t,n)=>{const r=new Map,o={platform:Xe,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Le(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Le(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Qe="undefined"!=typeof document?r:o;function Je(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Je(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Je(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function et(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tt(e,t){const n=et(e);return Math.round(t*n)/n}function nt(t){const n=e.useRef(t);return Qe((()=>{n.current=t})),n}const rt=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?Ze({element:n.current,padding:r}).fn(t):{}:n?Ze({element:n,padding:r}).fn(t):{};var o}});function ot(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const it={...e},lt=it.useInsertionEffect||(e=>e());function ut(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return lt((()=>{n.current=t})),e.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)}),[])}var ct="undefined"!=typeof document?r:o;function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},st.apply(this,arguments)}let at=!1,ft=0;const dt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ft++;const pt=it.useId||function(){const[t,n]=e.useState((()=>at?dt():void 0));return ct((()=>{null==t&&n(dt())}),[]),e.useEffect((()=>{at=!0}),[]),t};let mt;"production"!==process.env.NODE_ENV&&(mt=new Set);const vt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:u=14,height:c=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...g}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=mt)&&e.has(o)||(null==(i=mt)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const h=pt(),[y,w]=e.useState(!1);if(ct((()=>{if(!o)return;"rtl"===S(o).direction&&w(!0)}),[o]),!o)return null;const[b,x]=r.split("-"),E="top"===b||"bottom"===b;let R=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(R=null);const C=2*a,O=C/2,L=u/2*(s/-8+1),T=c/2*s/4,A=!!p,P=R&&"end"===x?"bottom":"top";let k=R&&"end"===x?"right":"left";R&&y&&(k="end"===x?"left":"right");const D=null!=(null==i?void 0:i.x)?R||i.x:"",M=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+u+" L"+(u-L)+","+(c-T)+" Q"+u/2+","+c+" "+L+","+(c-T)+" Z",F={top:A?"rotate(180deg)":"",left:A?"rotate(90deg)":"rotate(-90deg)",bottom:A?"":"rotate(180deg)",right:A?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",st({},g,{"aria-hidden":!0,ref:n,width:A?u:u+C,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[k]:D,[P]:M,[b]:E||A?"100%":"calc(100% - "+C/2+"px)",transform:[F,m].filter((e=>!!e)).join(" "),...v}}),C>0&&e.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:C+(p?0:1),d:N}),e.createElement("path",{stroke:C&&!p?g.fill:"none",d:N}),e.createElement("clipPath",{id:h},e.createElement("rect",{x:-O,y:O*(A?-1:1),width:u+C,height:u})))}));const gt=e.createContext(null),ht=e.createContext(null),yt=()=>{var t;return(null==(t=e.useContext(gt))?void 0:t.id)||null},wt=()=>e.useContext(ht);function bt(e){return"data-floating-ui-"+e}function xt(e){const t=i(e);return ct((()=>{t.current=e})),t}const Et=bt("safe-polygon");function Rt(e,t,n){return n&&!j(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Ct=0;function Ot(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ct);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ct=requestAnimationFrame(i)}function St(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Lt=new WeakMap,Tt=new WeakSet,At={},Pt=0;const kt=e=>e&&(e.host||kt(e.parentNode));function Dt(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=kt(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];At[o]||(At[o]=new WeakMap);const f=At[o];return l.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==p(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Lt.get(t)||0)+1,l=(f.get(t)||0)+1;Lt.set(t,r),f.set(t,l),a.push(t),1===r&&n&&Tt.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Pt++,()=>{a.forEach((e=>{const t=(Lt.get(e)||0)-1,n=(f.get(e)||0)-1;Lt.set(e,t),f.set(e,n),t||(!Tt.has(e)&&i&&e.removeAttribute(i),Tt.delete(e)),n||e.removeAttribute(o)})),Pt--,Pt||(Lt=new WeakMap,Lt=new WeakMap,Tt=new WeakSet,At={})}}function Mt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=H(e[0]).body;return Dt(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Nt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ft(e,t){const n=Se(e,Nt());"prev"===t&&n.reverse();const r=n.indexOf(D(H(e)));return n.slice(r+1)[0]}function It(){return Ft(document.body,"next")}function Wt(){return Ft(document.body,"prev")}function jt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!M(n,r)}function Ht(e){Se(e,Nt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Bt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Vt={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 _t(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const qt=e.forwardRef((function(t,n){const[r,o]=e.useState();ct((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",_t),()=>{document.removeEventListener("keydown",_t)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[bt("focus-guard")]:"",style:Vt};return e.createElement("span",st({},t,i))})),Kt=e.createContext(null),Xt=bt("portal");const Ut=()=>e.useContext(Kt),Yt="data-floating-ui-focusable";let $t=[];function zt(e){$t=$t.filter((e=>e.isConnected)),e&&"body"!==p(e)&&($t.push(e),$t.length>20&&($t=$t.slice(-20)))}function Zt(){return $t.slice().reverse().find((e=>e.isConnected))}function Gt(e){const t=Nt();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==fe.call(e,se)&&Re(t,e)}(e,t)?e:Se(e,t)[0]}const Qt=e.forwardRef((function(t,n){return e.createElement("button",st({},t,{type:"button",ref:n,tabIndex:-1,style:Vt}))}));let Jt=0;let en=()=>{};const tn=e.forwardRef((function(t,n){const{lockScroll:r=!1,...o}=t;return ct((()=>{if(r)return Jt++,1===Jt&&(en=function(){const e=/iP(hone|ad|od)|iOS/.test(N()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{Jt--,0===Jt&&en()}}),[r]),e.createElement("div",st({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))})),nn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},on=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function ln(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=pt(),l=e.useRef({}),[u]=e.useState((()=>function(){const 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)))||[])}}}())),c=null!=yt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!h(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=mt)&&e.has(o)||(null==(i=mt)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=ut(((e,t,n)=>{l.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:u,floatingId:i,refs:d})),[n,f,p,u,i,d])}const un="active",cn="selected";function sn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[un]:t,[cn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Yt]:""},...i,...t.map((t=>{const 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,i]=t;var l;o&&[un,cn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const an=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var fn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=pt(),i=Ut(),[l,u]=e.useState(null),c=e.useRef(null);return ct((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),ct((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(Xt,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),ct((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!h(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(Xt,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,s]=e.useState(null),a=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==u?void 0:u.modal,v=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!m)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&jt(e)){("focusin"===e.type?Bt:Ht)(l)}}}),[l,i,m]),e.useEffect((()=>{l&&(v||Bt(l))}),[v,l]),e.createElement(Kt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:l,setFocusManagerState:s})),[i,l])},g&&l&&e.createElement(qt,{"data-type":"outside",ref:a,onFocus:e=>{if(jt(e,l)){var t;null==(t=d.current)||t.focus()}else{const e=Wt()||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),g&&l&&e.createElement("span",{"aria-owns":l.id,style:Vt}),l&&c.createPortal(n,l),g&&l&&e.createElement(qt,{"data-type":"outside",ref:f,onFocus:e=>{if(jt(e,l)){var t;null==(t=p.current)||t.focus()}else{const t=It()||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))},Overlay:tn,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:c=!0,restoreFocus:s=!1,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0,outsideElementsInert:p=!1}=t,{open:m,refs:v,nodeId:g,onOpenChange:h,events:w,dataRef:b,elements:{domReference:x,floating:E}}=n,R="number"==typeof u&&u<0,C=q(x)&&R,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,S=!O||l,L=!S||O&&p,T=xt(i),A=xt(u),P=xt(c),k=wt(),N=Ut(),F=e.useRef(null),j=e.useRef(null),B=e.useRef(!1),K=e.useRef(!1),X=e.useRef(-1),U=null!=N,Y=($=E)?$.hasAttribute(Yt)?$:$.querySelector("["+Yt+"]")||$:null;var $;const z=ut((function(e){return void 0===e&&(e=Y),e?Se(e,Nt()):[]})),Z=ut((e=>{const t=z(e);return T.current.map((e=>x&&"reference"===e?x:Y&&"floating"===e?Y:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!a)return;function e(e){if("Tab"===e.key){M(Y,D(H(Y)))&&0===z().length&&!C&&_(e);const t=Z(),n=V(e);"reference"===T.current[0]&&n===x&&(_(e),e.shiftKey?Ot(t[t.length-1]):Ot(t[1])),"floating"===T.current[1]&&n===Y&&e.shiftKey&&(_(e),Ot(t[0]))}}const t=H(Y);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,x,Y,a,T,C,z,Z]),e.useEffect((()=>{if(!o&&E)return E.addEventListener("focusin",e),()=>{E.removeEventListener("focusin",e)};function e(e){const t=V(e),n=z().indexOf(t);-1!==n&&(X.current=n)}}),[o,E,z]),e.useEffect((()=>{if(!o&&d)return E&&y(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),E.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),E.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(M(x,t)||M(E,t)||M(t,E)||M(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(bt("focus-guard"))||k&&(St(k.nodesRef.current,g).find((e=>{var n,r;return M(null==(n=e.context)?void 0:n.elements.floating,t)||M(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(k.nodesRef.current,g).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(s&&n&&D(H(Y))===H(Y).body){y(Y)&&Y.focus();const e=X.current,t=z(),n=t[e]||t[t.length-1]||Y;y(n)&&n.focus()}!C&&a||!t||!n||K.current||t===Zt()||(B.current=!0,h(!1,e,"focus-out"))}))}}),[o,x,E,Y,a,g,k,N,h,d,s,z,C]);const G=e.useRef(null),Q=e.useRef(null),J=ot([G,null==N?void 0:N.beforeInsideRef]),ee=ot([Q,null==N?void 0:N.afterInsideRef]);function te(t){return!o&&f&&a?e.createElement(Qt,{ref:"start"===t?F:j,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+bt("portal")+"]"))||[]);if(E){const e=[E,...t,F.current,j.current,G.current,Q.current,null==N?void 0:N.beforeOutsideRef.current,null==N?void 0:N.afterOutsideRef.current,T.current.includes("reference")||C?x:null].filter((e=>null!=e)),n=a||C?Mt(e,!L,L):Mt(e);return()=>{n()}}}),[o,x,E,a,T,N,C,S,L]),ct((()=>{if(o||!y(Y))return;const e=D(H(Y));queueMicrotask((()=>{const t=Z(Y),n=A.current,r=("number"==typeof n?t[n]:n.current)||Y,o=M(Y,e);R||o||!m||Ot(r,{preventScroll:r===Y})}))}),[o,m,Y,R,Z,A]),ct((()=>{if(o||!Y)return;let e=!1;const t=H(Y),n=D(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&v.domReference.current&&zt(v.domReference.current),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(B.current=!0),"outside-press"===o&&(l?(B.current=!1,e=!0):B.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(W()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||I(i)))}zt(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Vt),U&&x&&x.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=D(t),o=M(E,n)||k&&St(k.nodesRef.current,g).some((e=>{var t;return M(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&v.domReference.current&&zt(v.domReference.current);const u="boolean"==typeof P.current?Zt()||l:P.current.current||l;queueMicrotask((()=>{const r=Gt(u);P.current&&!B.current&&y(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,E,Y,P,b,v,w,k,g,U,x]),e.useEffect((()=>{queueMicrotask((()=>{B.current=!1}))}),[o]),ct((()=>{if(!o&&N)return N.setFocusManagerState({modal:a,closeOnFocusOut:d,open:m,onOpenChange:h,refs:v}),()=>{N.setFocusManagerState(null)}}),[o,N,a,m,h,v,d]),ct((()=>{if(o)return;if(!Y)return;if("function"!=typeof MutationObserver)return;if(R)return;const e=()=>{const e=Y.getAttribute("tabindex"),t=z(),n=D(H(E)),r=t.indexOf(n);-1!==r&&(X.current=r),T.current.includes("floating")||n!==v.domReference.current&&0===t.length?"0"!==e&&Y.setAttribute("tabindex","0"):"-1"!==e&&Y.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Y,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,E,Y,v,T,z,R]);const ne=!o&&S&&(!a||!C)&&(U||a);return e.createElement(e.Fragment,null,ne&&e.createElement(qt,{"data-type":"inside",ref:J,onFocus:e=>{if(a){const e=Z();Ot("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(B.current=!1,jt(e,N.portalNode)){const e=It()||x;null==e||e.focus()}else{var t;null==(t=N.beforeOutsideRef.current)||t.focus()}}}),!C&&te("start"),r,te("end"),ne&&e.createElement(qt,{"data-type":"inside",ref:ee,onFocus:e=>{if(a)Ot(Z()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(d&&(B.current=!0),jt(e,N.portalNode)){const e=Wt()||x;null==e||e.focus()}else{var t;null==(t=N.afterOutsideRef.current)||t.focus()}}}))},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=ln({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,u]=e.useState(null),[s,a]=e.useState(null),f=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=wt();ct((()=>{f&&(d.current=f)}),[f]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);Je(m,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==O.current&&(O.current=e,w(e))}),[]),E=l||g,R=u||y,C=e.useRef(null),O=e.useRef(null),S=e.useRef(d),L=null!=a,T=nt(a),A=nt(i),P=nt(f),k=e.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),Ge(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};D.current&&!Je(S.current,t)&&(S.current=t,c.flushSync((()=>{p(t)})))}))}),[m,n,r,A,P]);Qe((()=>{!1===f&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const D=e.useRef(!1);Qe((()=>(D.current=!0,()=>{D.current=!1})),[]),Qe((()=>{if(E&&(C.current=E),R&&(O.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,L]);const M=e.useMemo((()=>({reference:C,floating:O,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=tt(N.floating,d.x),n=tt(N.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...et(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:M,elements:N,floatingStyles:F})),[d,k,M,N,F])}({...t,elements:{...i,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=h(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(h(e)||null===e)&&(d.current=e,u(e)),(h(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!h(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),w=e.useMemo((()=>({...m.elements,domReference:f})),[m.elements,f]),b=e.useMemo((()=>({...m,...o,refs:y,elements:w,nodeId:n})),[m,y,w,n,o]);return ct((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...m,context:b,refs:y,elements:w})),[m,y,w,b])},Arrow:vt,arrow:(e,t)=>({...rt(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=an.get(u))?r:u,s=pt(),a=null!=yt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>sn(e,t,"reference")),n),l=e.useCallback((e=>sn(e,t,"floating")),r),u=e.useCallback((e=>sn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,g=wt(),w=ut("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,x=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:L}=on(m),{escapeKey:A,outsidePress:k}=on(v),D=e.useRef(!1),N=ut((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(D.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=g?St(g.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),F=ut((e=>{var t;const n=()=>{var t;N(e),null==(t=V(e))||t.removeEventListener("keydown",n)};null==(t=V(e))||t.addEventListener("keydown",n)})),I=ut((e=>{var t;const n=x.current;x.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const u=V(e),c="["+bt("inert")+"]",s=H(i.floating).querySelectorAll(c);let f=h(u)?u:null;for(;f&&!O(f);){const e=T(f);if(O(e)||!h(e))break;f=e}if(s.length&&h(u)&&!u.matches("html,body")&&!M(u,i.floating)&&Array.from(s).every((e=>!M(f,e))))return;if(y(u)&&_){const t=O(u),n=S(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=g&&St(g.nodesRef.current,d).some((t=>{var n;return B(e,null==(n=t.context)?void 0:n.elements.floating)}));if(B(e,i.floating)||B(e,i.domReference)||p)return;const m=g?St(g.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ut((e=>{var t;const n=()=>{var t;I(e),null==(t=V(e))||t.removeEventListener(a,n)};null==(t=V(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=L;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),D.current=!0}function s(){e=window.setTimeout((()=>{D.current=!1}),C()?5:0)}const f=H(i.floating);c&&(f.addEventListener("keydown",A?F:N,A),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),b&&f.addEventListener(a,k?W:I,k);let d=[];return p&&(h(i.domReference)&&(d=P(i.domReference)),h(i.floating)&&(d=d.concat(P(i.floating))),!h(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(P(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(f.removeEventListener("keydown",A?F:N,A),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),b&&f.removeEventListener(a,k?W:I,k),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,b,a,r,o,p,u,R,L,N,A,F,I,k,W]),e.useEffect((()=>{x.current=!1}),[b,a]);const j=e.useMemo((()=>({onKeyDown:N,...f&&{[nn[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[N,o,f,d]),_=e.useMemo((()=>({onKeyDown:N,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[rn[a]]:()=>{x.current=!0}})),[N,a]);return e.useMemo((()=>u?{reference:j,floating:_}:{}),[u,j,_])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=wt(),v=yt(),g=xt(a),y=xt(s),w=xt(r),b=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),O=e.useRef(!1),S=e.useRef((()=>{})),L=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(c)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,L.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=H(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,g,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Rt(y.current,"close",b.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[y,o]),P=ut((()=>{S.current(),E.current=void 0})),k=ut((()=>{if(O.current){const e=H(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Et),O.current=!1}})),D=ut((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&h(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=u.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!j(b.current)||d>0&&!Rt(y.current,"open"))return;const t=Rt(y.current,"open",b.current);t?x.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(D())return;S.current();const t=H(u.floating);if(clearTimeout(R.current),L.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),D()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!M(u.floating,e.relatedTarget))&&A(e)}function l(e){D()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),D()||A(e)}})(e))}}),[u,c,t,f,d,p,A,P,k,o,r,w,m,y,g,i,D]),ct((()=>{var e;if(c&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){O.current=!0;const e=u.floating;if(h(u.domReference)&&e){var t;const n=H(u.floating).body;n.setAttribute(Et,"");const r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,v,u,m,g,T]),ct((()=>{r||(b.current=void 0,L.current=!1,P(),k())}),[r,P,k]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),k()}),[c,u.domReference,P,k]);const N=e.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!j(b.current)||r||0===d||L.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===b.current?n():(L.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),F=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){D()||A(e.nativeEvent,!1)}})),[A,D]);return e.useMemo((()=>c?{reference:N,floating:F}:{}),[c,N,F])},flip:(e,t)=>({...$e(e),options:[e,t]}),shift:(e,t)=>({...Ye(e),options:[e,t]}),hide:(e,t)=>({...ze(e),options:[e,t]}),offset:(e,t)=>({...Ue(e),options:[e,t]})},dn=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)};function pn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=pn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=pn(e))&&(r&&(r+=" "),r+=t);return r}var vn="HoverCard",gn=function(e){var n=e.children,r=e.open,o=void 0===r?void 0:r,u=e.onOpenChange,c=e.customRootClass,d=void 0===c?"":c,p=e.openDelay,m=void 0===p?100:p,v=e.closeDelay,g=void 0===v?200:v,h=a(e,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),y=dn(d,vn),w=dn(d,"".concat(vn,"-trigger")),b=i(null),x=fn.useFloating({placement:"bottom",strategy:"fixed",middleware:[fn.arrow({element:b}),fn.offset(10),fn.flip({mainAxis:!0})]}),E=x.refs,R=x.floatingStyles,C=x.context,O=l(!1),S=O[0],L=O[1],T=l(!1);T[0];var A=T[1],P=void 0!==o,k=P?o:S,D=function(e){P||L(e),null==u||u(e)},M=fn.useRole(C),N=fn.useDismiss(C),F=fn.useHover(C,{delay:100}),I=fn.useInteractions([F,M,N]),W=I.getReferenceProps,j=I.getFloatingProps,H={isOpen:k,handleOpenChange:D,floatingRefs:E,floatingStyles:R,floatingContext:C,arrowRef:b,getReferenceProps:W,getFloatingProps:j,rootClass:y,rootTriggerClass:w,closeWithDelay:function(){A(!0),setTimeout((function(){A((function(e){return e&&D(!1),e}))}),g)},closeWithoutDelay:function(){D(!1)},openWithDelay:function(){A(!1),setTimeout((function(){D(!0)}),m)}};return t.createElement(f.Provider,{value:H},t.createElement("div",s({className:mn(y)},h),n))},hn=["div","span","button"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,u=a(n,["asChild","children"]);return i&&t.isValidElement(l)?t.cloneElement(l,s(s({},u),{ref:r})):t.createElement(e,s(s({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),yn=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=a(e,["children","className"]),l=u(f),c=l.floatingRefs,d=l.closeWithDelay,p=l.openWithDelay,m=l.rootTriggerClass;return t.createElement(t.Fragment,null,t.createElement(hn.span,s({className:mn(m,o),onClick:function(){},onMouseEnter:p,onMouseLeave:d,ref:c.setReference},i),n))},wn=function(e){var n=e.children,r=e.rootElement,o=void 0===r?void 0:r,i=a(e,["children","rootElement"]),l=u(f).rootTriggerClass,c=o||document.getElementsByClassName(l)[0];return t.createElement(fn.Portal,s({root:c},i),n)},bn=function(e){var n=e.children,r=a(e,["children"]),i=u(f),l=i.isOpen,c=i.floatingRefs,d=i.floatingStyles,p=i.getFloatingProps,m=i.rootClass,v=i.closeWithDelay,g=i.closeWithoutDelay,h=i.openWithDelay;return o((function(){var e=function(){return g()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[g]),l?t.createElement("div",s({onPointerEnter:h,onPointerLeave:v,className:mn(m)},r,{ref:c.setFloating,style:d},p()),n):null},xn=function(e){var n=a(e,[]),r=u(f),o=r.floatingContext,i=r.arrowRef,l=r.rootClass;return t.createElement(fn.Arrow,s({className:mn("".concat(l,"-arrow"))},n,{context:o,ref:i}))},En=function(e){var n=e.children,r=e.onOpenChange,o=void 0===r?function(){}:r,i=e.content,l=void 0===i?void 0:i,u=e.customRootClass,c=void 0===u?"":u,f=e.openDelay,d=void 0===f?100:f,p=e.closeDelay,m=void 0===p?200:p,v=a(e,["children","onOpenChange","content","customRootClass","openDelay","closeDelay"]);return t.createElement(gn,s({open:void 0,onOpenChange:o,openDelay:d,closeDelay:m,customRootClass:c},v),t.createElement(yn,null,n),t.createElement(wn,null,t.createElement(bn,null,l,t.createElement(xn,null))))};export{En as default};
5
+ */var de=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),pe="undefined"==typeof Element,me=pe?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ve=!pe&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ge=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},he=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!ge(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{me.call(l,de)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!ge(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},ye=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},we=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ye(e)?0:e.tabIndex},be=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},xe=function(e){return"INPUT"===e.tagName},Ee=function(e){return function(e){return xe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ve(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},Re=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ce=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=me.call(e,"details>summary:first-of-type")?e.parentElement:e;if(me.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Re(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=ve(e);if(l&&!l.shadowRoot&&!0===r(l))return Re(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(function(e){var t,n,r,o,i=e&&ve(e),l=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=ve(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Se=function(e,t){return!(t.disabled||ge(t)||function(e){return xe(e)&&"hidden"===e.type}(t)||Ce(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!me.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Oe=function(e,t){return!(Ee(t)||we(t)<0||!Se(e,t))},Le=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Te=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=we(e);return n<0&&t&&!ye(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(be).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ae=function(e,t){var n;return n=(t=t||{}).getShadowRoot?he([e],t.includeContainer,{filter:Oe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Le}):function(e,t,n){if(ge(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(de));return t&&me.call(e,de)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Oe.bind(null,t)),Te(n)};function Pe(e,t,n){let{reference:r,floating:o}=e;const i=le(t),l=ue(t),u=ie(l),c=ne(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[u]/2-o[u]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(re(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function ke(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=te(t,e),m=ae(p),v=u[d?"floating"===f?"reference":"floating":f],g=fe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=fe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function De(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Me(e){return Y.some((t=>e[t]>=0))}function Ne(e){const t=A(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Z(n)!==i||Z(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Ie(e){return b(e)?e:e.contextElement}function Fe(e){const t=Ie(e);if(!x(t))return G(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ne(t);let l=(i?Z(n.width):n.width)/r,u=(i?Z(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const We=G(0);function je(e){const t=h(e);return L()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:We}function He(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ie(e);let l=G(1);t&&(r?b(r)&&(l=Fe(r)):l=Fe(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==h(e))&&t}(i,n,r)?je(i):G(0);let c=(o.left+u.x)/l.x,s=(o.top+u.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=h(i),t=r&&b(r)?h(r):r;let n=e,o=N(n);for(;o&&r&&t!==n;){const e=Fe(o),t=o.getBoundingClientRect(),r=A(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=h(o),o=N(n)}}return fe({width:a,height:f,x:c,y:s})}function Be(e,t){const n=P(e).scrollLeft;return t?t.left+n:He(y(e)).left+n}function Ve(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Be(e,r)),y:r.top+t.scrollTop}}function _e(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=h(e),r=y(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(o){i=o.width,l=o.height;const e=L();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=y(e),n=P(e),r=e.ownerDocument.body,o=z(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=z(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Be(e);const u=-n.scrollTop;return"rtl"===A(r).direction&&(l+=z(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(y(e));else if(b(t))r=function(e,t){const n=He(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?Fe(e):G(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=je(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fe(r)}function qe(e,t){const n=k(e);return!(n===t||!b(n)||T(n))&&("fixed"===A(n).position||qe(n,t))}function Ke(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=He(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=G(0);if(r||!r&&!i)if(("body"!==g(t)||R(o))&&(u=P(t)),r){const e=He(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=Be(o));const s=!o||r||i?G(0):Ve(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.y-s.y,width:l.width,height:l.height}}function Xe(e){return"static"===A(e).position}function Ue(e,t){if(!x(e)||"fixed"===A(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function Ye(e,t){const n=h(e);if(S(e))return n;if(!x(e)){let t=k(e);for(;t&&!T(t);){if(b(t)&&!Xe(t))return t;t=k(t)}return n}let r=Ue(e,t);for(;r&&C(r)&&Xe(r);)r=Ue(r,t);return r&&T(r)&&Xe(r)&&!O(r)?n:r||function(e){let t=k(e);for(;x(t)&&!T(t);){if(O(t))return t;if(S(t))return null;t=k(t)}return null}(e)||n}const $e={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),u=!!t&&S(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=G(1);const a=G(0),f=x(r);if((f||!f&&!i)&&(("body"!==g(r)||R(l))&&(c=P(r)),x(r))){const e=He(r);s=Fe(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?G(0):Ve(l,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.scrollTop*s.y+a.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?S(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=M(e,[],!1).filter((e=>b(e)&&"body"!==g(e))),o=null;const i="fixed"===A(e).position;let l=i?k(e):e;for(;b(l)&&!T(l);){const t=A(l),n=O(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&qe(e,l))?r=r.filter((e=>e!==l)):o=t,l=k(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=_e(t,n,o);return e.top=z(r.top,e.top),e.right=$(r.right,e.right),e.bottom=$(r.bottom,e.bottom),e.left=z(r.left,e.left),e}),_e(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Ye,getElementRects:async function(e){const t=this.getOffsetParent||Ye,n=this.getDimensions,r=await n(e.floating);return{reference:Ke(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}=Ne(e);return{width:t,height:n}},getScale:Fe,isElement:b,isRTL:function(e){return"rtl"===A(e).direction}},ze=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=ne(n),u=re(n),c="y"===le(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-1:1,f=te(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ze=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:l=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=te(e,t),s={x:n,y:r},a=await ke(t,c),f=le(ne(o)),d=oe(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=ee(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=ee(m+a["y"===f?"top":"left"],m,m-a[e])}const v=u.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Ge=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=te(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=ne(o),y=le(u),w=ne(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[se(u)]:function(e){const t=se(e);return[ce(e),t,ce(t)]}(u)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=re(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(ne(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ce)))),i}(u,v,m,b));const R=[u,...x],C=await ke(t,g),S=[];let O=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&S.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=re(e),o=ue(e),i=ie(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=se(l)),[l,se(l)]}(o,l,b);S.push(C[e[0]],C[e[1]])}if(O=[...O,{placement:o,overflows:S}],!S.every((e=>e<=0))){var L,T;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:O},reset:{placement:t}};let n=null==(T=O.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=O.filter((e=>{if(E){const t=le(e.placement);return t===y||"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:A[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},Qe=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=te(e,t);switch(r){case"referenceHidden":{const e=De(await ke(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Me(e)}}}case"escaped":{const e=De(await ke(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Me(e)}}}default:return{}}}}},Je=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:s,padding:a=0}=te(e,t)||{};if(null==s)return{};const f=ae(a),d={x:n,y:r},p=ue(o),m=ie(p),v=await l.getDimensions(s),g="y"===p,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=u.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,O=$(f[h],S),L=$(f[y],S),T=O,A=R-v[m]-L,P=R/2-v[m]/2+C,k=ee(T,P,A),D=!c.arrow&&null!=re(o)&&P!==k&&i.reference[m]/2-(P<T?O:L)-v[m]/2<0,M=D?P<T?P-T:P-A:0;return{[p]:d[p]+M,data:{[p]:k,centerOffset:P-k-M,...D&&{alignmentOffset:M}},reset:D}}}),et=(e,t,n)=>{const r=new Map,o={platform:$e,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Pe(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Pe(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var tt="undefined"!=typeof document?r:o;function nt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!nt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!nt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function rt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ot(e,t){const n=rt(e);return Math.round(t*n)/n}function it(t){const n=e.useRef(t);return tt((()=>{n.current=t})),n}const lt=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?Je({element:n.current,padding:r}).fn(t):{}:n?Je({element:n,padding:r}).fn(t):{};var o}});function ut(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const ct={...e},st=ct.useInsertionEffect||(e=>e());function at(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return st((()=>{n.current=t})),e.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)}),[])}var ft="undefined"!=typeof document?r:o;let dt=!1,pt=0;const mt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+pt++;const vt=ct.useId||function(){const[t,n]=e.useState((()=>dt?mt():void 0));return ft((()=>{null==t&&n(mt())}),[]),e.useEffect((()=>{dt=!0}),[]),t};let gt;"production"!==process.env.NODE_ENV&&(gt=new Set);const ht=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:u=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=gt)&&e.has(o)||(null==(i=gt)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=vt(),[b,x]=e.useState(!1);if(ft((()=>{if(!o)return;"rtl"===A(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let S=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(S=null);const O=2*d,L=O/2,T=u/2*(f/-8+1),P=a/2*f/4,k=!!v,D=S&&"end"===R?"bottom":"top";let M=S&&"end"===R?"right":"left";S&&b&&(M="end"===R?"left":"right");const N=null!=(null==i?void 0:i.x)?S||i.x:"",I=null!=(null==i?void 0:i.y)?S||i.y:"",F=v||"M0,0 H"+u+" L"+(u-T)+","+(a-P)+" Q"+u/2+","+a+" "+T+","+(a-P)+" Z",W={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[E];return c("svg",{...y,"aria-hidden":!0,ref:n,width:k?u:u+O,height:u,viewBox:"0 0 "+u+" "+(a>u?a:u),style:{position:"absolute",pointerEvents:"none",[M]:N,[D]:I,[E]:C||k?"100%":"calc(100% - "+O/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[O>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:O+(v?0:1),d:F}),s("path",{stroke:O&&!v?y.fill:"none",d:F}),s("clipPath",{id:w,children:s("rect",{x:-L,y:L*(k?-1:1),width:u+O,height:u})})]})}));const yt=e.createContext(null),wt=e.createContext(null),bt=()=>{var t;return(null==(t=e.useContext(yt))?void 0:t.id)||null},xt=()=>e.useContext(wt);function Et(e){return"data-floating-ui-"+e}function Rt(e){const t=i(e);return ft((()=>{t.current=e})),t}const Ct=Et("safe-polygon");function St(e,t,n){return n&&!V(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Ot=0;function Lt(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ot);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ot=requestAnimationFrame(i)}function Tt(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function At(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Pt=new WeakMap,kt=new WeakSet,Dt={},Mt=0;const Nt=e=>e&&(e.host||Nt(e.parentNode));function It(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=Nt(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];Dt[o]||(Dt[o]=new WeakMap);const f=Dt[o];return l.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==g(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Pt.get(t)||0,l=i?r+1:r,u=(f.get(t)||0)+1;Pt.set(t,l),f.set(t,u),a.push(t),1===l&&n&&kt.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Mt++,()=>{a.forEach((e=>{const t=Pt.get(e)||0,n=i?t-1:t,r=(f.get(e)||0)-1;Pt.set(e,n),f.set(e,r),n||(!kt.has(e)&&i&&e.removeAttribute(i),kt.delete(e)),r||e.removeAttribute(o)})),Mt--,Mt||(Pt=new WeakMap,Pt=new WeakMap,kt=new WeakSet,Dt={})}}function Ft(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=_(e[0]).body;return It(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Wt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function jt(e,t){const n=Ae(e,Wt());"prev"===t&&n.reverse();const r=n.indexOf(I(_(e)));return n.slice(r+1)[0]}function Ht(){return jt(document.body,"next")}function Bt(){return jt(document.body,"prev")}function Vt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!F(n,r)}function _t(e){Ae(e,Wt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function qt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Kt={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 Xt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Ut=e.forwardRef((function(t,n){const[r,o]=e.useState();ft((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Xt),()=>{document.removeEventListener("keydown",Xt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Et("focus-guard")]:"",style:Kt};return s("span",{...t,...i})})),Yt=e.createContext(null),$t=Et("portal");const zt=()=>e.useContext(Yt),Zt="data-floating-ui-focusable";function Gt(e){return e?e.hasAttribute(Zt)?e:e.querySelector("["+Zt+"]")||e:null}let Qt=[];function Jt(e){Qt=Qt.filter((e=>e.isConnected)),e&&"body"!==g(e)&&(Qt.push(e),Qt.length>20&&(Qt=Qt.slice(-20)))}function en(){return Qt.slice().reverse().find((e=>e.isConnected))}function tn(e){const t=Wt();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==me.call(e,de)&&Oe(t,e)}(e,t)?e:Ae(e,t)[0]||e}const nn=e.forwardRef((function(e,t){return s("button",{...e,type:"button",ref:t,tabIndex:-1,style:Kt})}));let rn=0;let on=()=>{};const ln=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return ft((()=>{if(n)return rn++,1===rn&&(on=function(){const e=/iP(hone|ad|od)|iOS/.test(W()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{rn--,0===rn&&on()}}),[n]),s("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})})),un={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},sn=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function an(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=vt(),l=e.useRef({}),[u]=e.useState((()=>function(){const 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)))||[])}}}())),c=null!=bt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=gt)&&e.has(o)||(null==(i=gt)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=at(((e,t,n)=>{l.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:u,floatingId:i,refs:d})),[n,f,p,u,i,d])}const fn="active",dn="selected";function pn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[fn]:t,[dn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Zt]:""},...i,...t.map((t=>{const 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,i]=t;var l;o&&[fn,dn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const mn=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var vn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=vt(),i=zt(),[l,u]=e.useState(null),c=e.useRef(null);return ft((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),ft((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute($t,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),ft((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute($t,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),g=null==u?void 0:u.modal,h=null==u?void 0:u.open,y=!!u&&!u.modal&&u.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!g)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&Vt(e)){("focusin"===e.type?qt:_t)(l)}}}),[l,i,g]),e.useEffect((()=>{l&&(h||qt(l))}),[h,l]),c(Yt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:a})),[i,l]),children:[y&&l&&s(Ut,{"data-type":"outside",ref:d,onFocus:e=>{if(Vt(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Bt()||(null==u?void 0:u.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:Kt}),l&&f.createPortal(n,l),y&&l&&s(Ut,{"data-type":"outside",ref:p,onFocus:e=>{if(Vt(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Ht()||(null==u?void 0:u.domReference);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})},Overlay:ln,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:f=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:g=!1}=t,{open:h,onOpenChange:y,events:w,dataRef:b,elements:{domReference:E,floating:R}}=n,C=at((()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId})),S="number"==typeof u&&u<0,O=U(E)&&S,L="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,T=!L||l,A=!T||L&&g,P=Rt(i),k=Rt(u),D=Rt(f),M=xt(),N=zt(),W=e.useRef(null),j=e.useRef(null),V=e.useRef(!1),q=e.useRef(!1),Y=e.useRef(-1),$=null!=N,z=Gt(R),Z=at((function(e){return void 0===e&&(e=z),e?Ae(e,Wt()):[]})),G=at((e=>{const t=Z(e);return P.current.map((e=>E&&"reference"===e?E:z&&"floating"===e?z:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){F(z,I(_(z)))&&0===Z().length&&!O&&X(e);const t=G(),n=K(e);"reference"===P.current[0]&&n===E&&(X(e),e.shiftKey?Lt(t[t.length-1]):Lt(t[1])),"floating"===P.current[1]&&n===z&&e.shiftKey&&(X(e),Lt(t[0]))}}const t=_(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,z,p,P,O,Z,G]),e.useEffect((()=>{if(!o&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=K(e),n=Z().indexOf(t);-1!==n&&(Y.current=n)}}),[o,R,Z]),e.useEffect((()=>{if(!o&&v)return R&&x(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=C(),r=!(F(E,t)||F(R,t)||F(t,R)||F(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(Et("focus-guard"))||M&&(At(M.nodesRef.current,n).find((e=>{var n,r;return F(null==(n=e.context)?void 0:n.elements.floating,t)||F(null==(r=e.context)?void 0:r.elements.domReference,t)}))||Tt(M.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Gt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&I(_(z))===_(z).body){x(z)&&z.focus();const e=Y.current,t=Z(),n=t[e]||t[t.length-1]||z;x(n)&&n.focus()}!O&&p||!t||!r||q.current||t===en()||(V.current=!0,y(!1,e,"focus-out"))}))}}),[o,E,R,z,p,M,N,y,v,d,Z,O,C]);const Q=e.useRef(null),J=e.useRef(null),ee=ut([Q,null==N?void 0:N.beforeInsideRef]),te=ut([J,null==N?void 0:N.afterInsideRef]);function ne(e){return!o&&m&&p?s(nn,{ref:"start"===e?W:j,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!R)return;const t=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+Et("portal")+"]"))||[]),n=M&&!p?Tt(null==M?void 0:M.nodesRef.current,C()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[R,...t,...n,W.current,j.current,Q.current,J.current,null==N?void 0:N.beforeOutsideRef.current,null==N?void 0:N.afterOutsideRef.current,P.current.includes("reference")||O?E:null].filter((e=>null!=e)),i=p||O?Ft(r,!A,A):Ft(r);return()=>{i()}}),[o,E,R,p,P,N,O,T,A,M,C]),ft((()=>{if(o||!x(z))return;const e=I(_(z));queueMicrotask((()=>{const t=G(z),n=k.current,r=("number"==typeof n?t[n]:n.current)||z,o=F(z,e);S||o||!h||Lt(r,{preventScroll:r===z})}))}),[o,h,z,S,G,k]),ft((()=>{if(o||!z)return;let e=!1;const t=_(z),n=I(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&E&&Jt(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(V.current=!0),"outside-press"===o&&(l?(V.current=!1,e=!0):V.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(B()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||H(i)))}Jt(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Kt),$&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=I(t),o=F(R,n)||M&&At(M.nodesRef.current,C()).some((e=>{var t;return F(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&Jt(E);const u="boolean"==typeof D.current?en()||l:D.current.current||l;queueMicrotask((()=>{const r=tn(u);D.current&&!V.current&&x(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,R,z,D,b,w,M,$,E,C]),e.useEffect((()=>{queueMicrotask((()=>{V.current=!1}))}),[o]),ft((()=>{if(!o&&N)return N.setFocusManagerState({modal:p,closeOnFocusOut:v,open:h,onOpenChange:y,domReference:E}),()=>{N.setFocusManagerState(null)}}),[o,N,p,h,y,v,E]),ft((()=>{if(o)return;if(!z)return;if("function"!=typeof MutationObserver)return;if(S)return;const e=()=>{const e=z.getAttribute("tabindex"),t=Z(),n=I(_(R)),r=t.indexOf(n);-1!==r&&(Y.current=r),P.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&z.setAttribute("tabindex","0"):"-1"!==e&&z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,R,z,E,P,Z,S]);const re=!o&&T&&(!p||!O)&&($||p);return c(a,{children:[re&&s(Ut,{"data-type":"inside",ref:ee,onFocus:e=>{if(p){const e=G();Lt("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(V.current=!1,Vt(e,N.portalNode)){const e=Ht()||E;null==e||e.focus()}else{var t;null==(t=N.beforeOutsideRef.current)||t.focus()}}}),!O&&ne("start"),r,ne("end"),re&&s(Ut,{"data-type":"inside",ref:te,onFocus:e=>{if(p)Lt(G()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(v&&(V.current=!0),Vt(e,N.portalNode)){const e=Bt()||E;null==e||e.focus()}else{var t;null==(t=N.afterOutsideRef.current)||t.focus()}}})]})},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=an({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,u]=e.useState(null),[c,s]=e.useState(null),a=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=xt();ft((()=>{a&&(d.current=a)}),[a]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:c=!0,whileElementsMounted:s,open:a}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);nt(m,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=l||g,R=u||y,C=e.useRef(null),S=e.useRef(null),O=e.useRef(d),L=null!=s,T=it(s),A=it(i),P=it(a),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),et(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};D.current&&!nt(O.current,t)&&(O.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,A,P]);tt((()=>{!1===a&&O.current.isPositioned&&(O.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[a]);const D=e.useRef(!1);tt((()=>(D.current=!0,()=>{D.current=!1})),[]),tt((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,L]);const M=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=ot(N.floating,d.x),n=ot(N.floating,d.y);return c?{...e,transform:"translate("+t+"px, "+n+"px)",...rt(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,c,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:M,elements:N,floatingStyles:I})),[d,k,M,N,I])}({...t,elements:{...i,...c&&{reference:c}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,u(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),h=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),y=e.useMemo((()=>({...m.elements,domReference:a})),[m.elements,a]),w=e.useMemo((()=>({...m,...o,refs:h,elements:y,nodeId:n})),[m,h,y,n,o]);return ft((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:h,elements:y})),[m,h,y,w])},Arrow:ht,arrow:(e,t)=>({...lt(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=mn.get(u))?r:u,s=vt(),a=null!=bt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>pn(e,t,"reference")),n),l=e.useCallback((e=>pn(e,t,"floating")),r),u=e.useCallback((e=>pn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,g=xt(),h=at("function"==typeof s?s:()=>!1),y="function"==typeof s?h:s,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=sn(m),{escapeKey:S,outsidePress:O}=sn(v),P=e.useRef(!1),D=at((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(P.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=g?At(g.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),N=at((e=>{var t;const n=()=>{var t;D(e),null==(t=K(e))||t.removeEventListener("keydown",n)};null==(t=K(e))||t.addEventListener("keydown",n)})),I=at((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const u=K(e),c="["+Et("inert")+"]",s=_(i.floating).querySelectorAll(c);let f=b(u)?u:null;for(;f&&!T(f);){const e=k(f);if(T(e)||!b(e))break;f=e}if(s.length&&b(u)&&!u.matches("html,body")&&!F(u,i.floating)&&Array.from(s).every((e=>!F(f,e))))return;if(x(u)&&H){const t=T(u),n=A(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=g&&At(g.nodesRef.current,d).some((t=>{var n;return q(e,null==(n=t.context)?void 0:n.elements.floating)}));if(q(e,i.floating)||q(e,i.domReference)||p)return;const m=g?At(g.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=at((e=>{var t;const n=()=>{var t;I(e),null==(t=K(e))||t.removeEventListener(a,n)};null==(t=K(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),P.current=!0}function s(){e=window.setTimeout((()=>{P.current=!1}),L()?5:0)}const f=_(i.floating);c&&(f.addEventListener("keydown",S?N:D,S),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),y&&f.addEventListener(a,O?W:I,O);let d=[];return p&&(b(i.domReference)&&(d=M(i.domReference)),b(i.floating)&&(d=d.concat(M(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(M(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(f.removeEventListener("keydown",S?N:D,S),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),y&&f.removeEventListener(a,O?W:I,O),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,y,a,r,o,p,u,R,C,D,S,N,I,O,W]),e.useEffect((()=>{w.current=!1}),[y,a]);const j=e.useMemo((()=>({onKeyDown:D,...f&&{[un[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[D,o,f,d]),H=e.useMemo((()=>({onKeyDown:D,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[cn[a]]:()=>{w.current=!0}})),[D,a]);return e.useMemo((()=>u?{reference:j,floating:H}:{}),[u,j,H])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=xt(),v=bt(),g=Rt(a),h=Rt(s),y=Rt(r),w=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),O=e.useRef((()=>{})),L=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(c)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,L.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=_(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,g,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=St(h.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[h,o]),P=at((()=>{O.current(),E.current=void 0})),k=at((()=>{if(S.current){const e=_(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Ct),S.current=!1}})),D=at((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&b(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=u.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!V(w.current)||d>0&&!St(h.current,"open"))return;const t=St(h.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(D())return;O.current();const t=_(u.floating);if(clearTimeout(R.current),L.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),D()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(O.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!F(u.floating,e.relatedTarget))&&A(e)}function l(e){D()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),D()||A(e)}})(e))}}),[u,c,t,f,d,p,A,P,k,o,r,y,m,h,g,i,D]),ft((()=>{var e;if(c&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){S.current=!0;const e=u.floating;if(b(u.domReference)&&e){var t;const n=_(u.floating).body;n.setAttribute(Ct,"");const r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,v,u,m,g,T]),ft((()=>{r||(w.current=void 0,L.current=!1,P(),k())}),[r,P,k]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),k()}),[c,u.domReference,P,k]);const M=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!V(w.current)||r||0===d||L.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(L.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),N=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){D()||A(e.nativeEvent,!1)}})),[A,D]);return e.useMemo((()=>c?{reference:M,floating:N}:{}),[c,M,N])},flip:(e,t)=>({...Ge(e),options:[e,t]}),shift:(e,t)=>({...Ze(e),options:[e,t]}),hide:(e,t)=>({...Qe(e),options:[e,t]}),offset:(e,t)=>({...ze(e),options:[e,t]})},gn=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)};function hn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=hn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=hn(e))&&(r&&(r+=" "),r+=t);return r}var wn="HoverCard",bn=function(e){var n=e.children,r=e.open,o=void 0===r?void 0:r,u=e.onOpenChange,c=e.customRootClass,s=void 0===c?"":c,a=e.openDelay,f=void 0===a?100:a,v=e.closeDelay,g=void 0===v?200:v,h=p(e,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),y=gn(s,wn),w=gn(s,"".concat(wn,"-trigger")),b=i(null),x=vn.useFloating({placement:"bottom",strategy:"fixed",middleware:[vn.arrow({element:b}),vn.offset(10),vn.flip({mainAxis:!0})]}),E=x.refs,R=x.floatingStyles,C=x.context,S=l(!1),O=S[0],L=S[1],T=l(!1);T[0];var A=T[1],P=void 0!==o,k=P?o:O,D=function(e){P||L(e),null==u||u(e)},M=vn.useRole(C),N=vn.useDismiss(C),I=vn.useHover(C,{delay:100}),F=vn.useInteractions([I,M,N]),W=F.getReferenceProps,j=F.getFloatingProps,H={isOpen:k,handleOpenChange:D,floatingRefs:E,floatingStyles:R,floatingContext:C,arrowRef:b,getReferenceProps:W,getFloatingProps:j,rootClass:y,rootTriggerClass:w,closeWithDelay:function(){A(!0),setTimeout((function(){A((function(e){return e&&D(!1),e}))}),g)},closeWithoutDelay:function(){D(!1)},openWithDelay:function(){A(!1),setTimeout((function(){D(!0)}),f)}};return t.createElement(m.Provider,{value:H},t.createElement("div",d({className:yn(y)},h),n))},xn=["div","span","button","input"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,u=p(n,["asChild","children"]);return i&&t.isValidElement(l)?t.cloneElement(l,d(d({},u),{ref:r})):t.createElement(e,d(d({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),En=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=p(e,["children","className"]),l=u(m),c=l.floatingRefs,s=l.closeWithDelay,a=l.openWithDelay,f=l.rootTriggerClass;return t.createElement(t.Fragment,null,t.createElement(xn.span,d({className:yn(f,o),onClick:function(){},onMouseEnter:a,onMouseLeave:s,ref:c.setReference},i),n))},Rn=function(e){var n=e.children,r=e.rootElement,o=void 0===r?void 0:r,i=p(e,["children","rootElement"]),l=u(m).rootTriggerClass,c=o||document.getElementsByClassName(l)[0];return t.createElement(vn.Portal,d({root:c},i),n)},Cn=function(e){var n=e.children,r=p(e,["children"]),i=u(m),l=i.isOpen,c=i.floatingRefs,s=i.floatingStyles,a=i.getFloatingProps,f=i.rootClass,v=i.closeWithDelay,g=i.closeWithoutDelay,h=i.openWithDelay;return o((function(){var e=function(){return g()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[g]),l?t.createElement("div",d({onPointerEnter:h,onPointerLeave:v,className:yn(f)},r,{ref:c.setFloating,style:s},a()),n):null},Sn=function(e){var n=p(e,[]),r=u(m),o=r.floatingContext,i=r.arrowRef,l=r.rootClass;return t.createElement(vn.Arrow,d({className:yn("".concat(l,"-arrow"))},n,{context:o,ref:i}))},On=function(e){var n=e.children,r=e.onOpenChange,o=void 0===r?function(){}:r,i=e.content,l=void 0===i?void 0:i,u=e.customRootClass,c=void 0===u?"":u,s=e.openDelay,a=void 0===s?100:s,f=e.closeDelay,m=void 0===f?200:f,v=p(e,["children","onOpenChange","content","customRootClass","openDelay","closeDelay"]);return t.createElement(bn,d({open:void 0,onOpenChange:o,openDelay:a,closeDelay:m,customRootClass:c},v),t.createElement(En,null,n),t.createElement(Rn,null,t.createElement(Cn,null,l,t.createElement(Sn,null))))};export{On as default};
@@ -1,5 +1,5 @@
1
- 'use client';import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o}from"react";import*as i from"react-dom";function u(){return"undefined"!=typeof window}function l(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function c(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function s(e){var t;return null==(t=(a(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function a(e){return!!u()&&(e instanceof Node||e instanceof c(e).Node)}function f(e){return!!u()&&(e instanceof Element||e instanceof c(e).Element)}function d(e){return!!u()&&(e instanceof HTMLElement||e instanceof c(e).HTMLElement)}function p(e){return!(!u()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof c(e).ShadowRoot)}function m(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=b(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function h(e){return["table","td","th"].includes(l(e))}function v(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function g(e){const t=y(),n=f(e)?b(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function y(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function w(e){return["html","body","#document"].includes(l(e))}function b(e){return c(e).getComputedStyle(e)}function x(e){return f(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function E(e){if("html"===l(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||s(e);return p(t)?t.host:t}function R(e){const t=E(e);return w(t)?e.ownerDocument?e.ownerDocument.body:e.body:d(t)&&m(t)?t:R(t)}function S(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=R(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=c(o);if(i){const e=C(u);return t.concat(u,u.visualViewport||[],m(o)?o:[],e&&n?S(e):[])}return t.concat(o,S(o,[],n))}function C(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function O(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function T(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function A(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function L(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function N(e){return!L().includes("jsdom/")&&(!k()&&0===e.width&&0===e.height||k()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function k(){const e=/android/i;return e.test(A())||e.test(L())}function M(e){return(null==e?void 0:e.ownerDocument)||document}function I(e){return"composedPath"in e?e.composedPath()[0]:e.target}function D(e){e.preventDefault(),e.stopPropagation()}function F(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return d(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}const P=Math.min,j=Math.max,W=Math.round,V=e=>({x:e,y:e});function B(e){return e.split("-")[0]}function q(e){return["top","bottom"].includes(B(e))?"y":"x"}function H(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}}
1
+ 'use client';import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o}from"react";import{jsxs as i,jsx as u,Fragment as l}from"react/jsx-runtime";import*as c from"react-dom";function s(){return"undefined"!=typeof window}function a(e){return p(e)?(e.nodeName||"").toLowerCase():"#document"}function f(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){var t;return null==(t=(p(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function p(e){return!!s()&&(e instanceof Node||e instanceof f(e).Node)}function m(e){return!!s()&&(e instanceof Element||e instanceof f(e).Element)}function h(e){return!!s()&&(e instanceof HTMLElement||e instanceof f(e).HTMLElement)}function v(e){return!(!s()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof f(e).ShadowRoot)}function g(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function y(e){return["table","td","th"].includes(a(e))}function w(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function b(e){const t=x(),n=m(e)?R(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function E(e){return["html","body","#document"].includes(a(e))}function R(e){return f(e).getComputedStyle(e)}function S(e){return m(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function C(e){if("html"===a(e))return e;const t=e.assignedSlot||e.parentNode||v(e)&&e.host||d(e);return v(t)?t.host:t}function T(e){const t=C(e);return E(t)?e.ownerDocument?e.ownerDocument.body:e.body:h(t)&&g(t)?t:T(t)}function A(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=T(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=f(o);if(i){const e=L(u);return t.concat(u,u.visualViewport||[],g(o)?o:[],e&&n?A(e):[])}return t.concat(o,A(o,[],n))}function L(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function N(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function O(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&v(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function k(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function M(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function I(e){return!M().includes("jsdom/")&&(!D()&&0===e.width&&0===e.height||D()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function D(){const e=/android/i;return e.test(k())||e.test(M())}function F(e){return(null==e?void 0:e.ownerDocument)||document}function P(e){return"composedPath"in e?e.composedPath()[0]:e.target}function W(e){e.preventDefault(),e.stopPropagation()}function j(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return h(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}const V=Math.min,B=Math.max,q=Math.round,H=e=>({x:e,y:e});function _(e){return e.split("-")[0]}function U(e){return["top","bottom"].includes(_(e))?"y":"x"}function $(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}}
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var _=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),U="undefined"==typeof Element,$=U?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,z=!U&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},X=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Y=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var u=i.shift();if(!X(u,!1))if("SLOT"===u.tagName){var l=u.assignedElements(),c=e(l.length?l:u.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:u,candidates:c})}else{$.call(u,_)&&r.filter(u)&&(n||!t.includes(u))&&o.push(u);var s=u.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(u),a=!X(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(u));if(s&&a){var f=e(!0===s?u.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:u,candidates:f})}else i.unshift.apply(i,u.children)}}return o},K=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},G=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!K(e)?0:e.tabIndex},J=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Q=function(e){return"INPUT"===e.tagName},Z=function(e){return function(e){return Q(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||z(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},ee=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},te=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=$.call(e,"details>summary:first-of-type")?e.parentElement:e;if($.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ee(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,l=z(e);if(u&&!u.shadowRoot&&!0===r(u))return ee(e);e=e.assignedSlot?e.assignedSlot:u||l===e.ownerDocument?u:l.host}e=i}if(function(e){var t,n,r,o,i=e&&z(e),u=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&u;){var c,s,a;l=!(null===(s=u=null===(c=i=z(u))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(u))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ne=function(e,t){return!(t.disabled||X(t)||function(e){return Q(e)&&"hidden"===e.type}(t)||te(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!$.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},re=function(e,t){return!(Z(t)||G(t)<0||!ne(e,t))},oe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ie=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,u=i?t.scopeParent:t,l=function(e,t){var n=G(e);return n<0&&t&&!K(e)?0:n}(u,i),c=i?e(t.candidates):u;0===l?i?n.push.apply(n,c):n.push(u):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:c})})),r.sort(J).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ue=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Y([e],t.includeContainer,{filter:re.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:oe}):function(e,t,n){if(X(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(_));return t&&$.call(e,_)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,re.bind(null,t)),ie(n)};function le(e,t,n){let{reference:r,floating:o}=e;const i=q(t),u=function(e){return"x"===q(e)?"y":"x"}(t),l="y"===u?"height":"width";const c=B(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(function(e){return e.split("-")[1]}(t)){case"start":p[u]-=d*(n&&s?-1:1);break;case"end":p[u]+=d*(n&&s?-1:1)}return p}function ce(e){const t=b(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=d(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,l=W(n)!==i||W(r)!==u;return l&&(n=i,r=u),{width:n,height:r,$:l}}function se(e){return f(e)?e:e.contextElement}function ae(e){const t=se(e);if(!d(t))return V(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ce(t);let u=(i?W(n.width):n.width)/r,l=(i?W(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),l&&Number.isFinite(l)||(l=1),{x:u,y:l}}const fe=V(0);function de(e){const t=c(e);return y()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:fe}function pe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=se(e);let u=V(1);t&&(r?f(r)&&(u=ae(r)):u=ae(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==c(e))&&t}(i,n,r)?de(i):V(0);let s=(o.left+l.x)/u.x,a=(o.top+l.y)/u.y,d=o.width/u.x,p=o.height/u.y;if(i){const e=c(i),t=r&&f(r)?c(r):r;let n=e,o=C(n);for(;o&&r&&t!==n;){const e=ae(o),t=o.getBoundingClientRect(),r=b(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,a*=e.y,d*=e.x,p*=e.y,s+=i,a+=u,n=c(o),o=C(n)}}return H({width:d,height:p,x:s,y:a})}function me(e,t){const n=x(e).scrollLeft;return t?t.left+n:pe(s(e)).left+n}function he(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:me(e,r)),y:r.top+t.scrollTop}}function ve(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=c(e),r=s(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,l=0,a=0;if(o){i=o.width,u=o.height;const e=y();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,a=o.offsetTop)}return{width:i,height:u,x:l,y:a}}(e,n);else if("document"===t)r=function(e){const t=s(e),n=x(e),r=e.ownerDocument.body,o=j(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=j(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+me(e);const l=-n.scrollTop;return"rtl"===b(r).direction&&(u+=j(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:l}}(s(e));else if(f(t))r=function(e,t){const n=pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=d(e)?ae(e):V(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=de(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return H(r)}function ge(e,t){const n=E(e);return!(n===t||!f(n)||w(n))&&("fixed"===b(n).position||ge(n,t))}function ye(e,t,n){const r=d(t),o=s(t),i="fixed"===n,u=pe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=V(0);if(r||!r&&!i)if(("body"!==l(t)||m(o))&&(c=x(t)),r){const e=pe(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=me(o));const f=!o||r||i?V(0):he(o,c);return{x:u.left+c.scrollLeft-a.x-f.x,y:u.top+c.scrollTop-a.y-f.y,width:u.width,height:u.height}}function we(e){return"static"===b(e).position}function be(e,t){if(!d(e)||"fixed"===b(e).position)return null;if(t)return t(e);let n=e.offsetParent;return s(e)===n&&(n=n.ownerDocument.body),n}function xe(e,t){const n=c(e);if(v(e))return n;if(!d(e)){let t=E(e);for(;t&&!w(t);){if(f(t)&&!we(t))return t;t=E(t)}return n}let r=be(e,t);for(;r&&h(r)&&we(r);)r=be(r,t);return r&&w(r)&&we(r)&&!g(r)?n:r||function(e){let t=E(e);for(;d(t)&&!w(t);){if(g(t))return t;if(v(t))return null;t=E(t)}return null}(e)||n}const Ee={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=s(r),c=!!t&&v(t.floating);if(r===u||c&&i)return n;let a={scrollLeft:0,scrollTop:0},f=V(1);const p=V(0),h=d(r);if((h||!h&&!i)&&(("body"!==l(r)||m(u))&&(a=x(r)),d(r))){const e=pe(r);f=ae(r),p.x=e.x+r.clientLeft,p.y=e.y+r.clientTop}const g=!u||h||i?V(0):he(u,a,!0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+p.x+g.x,y:n.y*f.y-a.scrollTop*f.y+p.y+g.y}},getDocumentElement:s,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?v(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=S(e,[],!1).filter((e=>f(e)&&"body"!==l(e))),o=null;const i="fixed"===b(e).position;let u=i?E(e):e;for(;f(u)&&!w(u);){const t=b(u),n=g(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||m(u)&&!n&&ge(e,u))?r=r.filter((e=>e!==u)):o=t,u=E(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=i[0],c=i.reduce(((e,n)=>{const r=ve(t,n,o);return e.top=j(r.top,e.top),e.right=P(r.right,e.right),e.bottom=P(r.bottom,e.bottom),e.left=j(r.left,e.left),e}),ve(t,u,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:xe,getElementRects:async function(e){const t=this.getOffsetParent||xe,n=this.getDimensions,r=await n(e.floating);return{reference:ye(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}=ce(e);return{width:t,height:n}},getScale:ae,isElement:f,isRTL:function(e){return"rtl"===b(e).direction}},Re=(e,t,n)=>{const r=new Map,o={platform:Ee,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,l=i.filter(Boolean),c=await(null==u.isRTL?void 0:u.isRTL(t));let s=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=le(s,r,c),d=r,p={},m=0;for(let n=0;n<l.length;n++){const{name:i,fn:h}=l[n],{x:v,y:g,data:y,reset:w}=await h({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:u,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=le(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Se="undefined"!=typeof document?n:r;function Ce(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Ce(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Ce(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Oe(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Te(e,t){const n=Oe(e);return Math.round(t*n)/n}function Ae(t){const n=e.useRef(t);return Se((()=>{n.current=t})),n}function Le(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const Ne={...e},ke=Ne.useInsertionEffect||(e=>e());function Me(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return ke((()=>{n.current=t})),e.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)}),[])}var Ie="undefined"!=typeof document?n:r;function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(this,arguments)}let Fe=!1,Pe=0;const je=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Pe++;const We=Ne.useId||function(){const[t,n]=e.useState((()=>Fe?je():void 0));return Ie((()=>{null==t&&n(je())}),[]),e.useEffect((()=>{Fe=!0}),[]),t};let Ve;"production"!==process.env.NODE_ENV&&(Ve=new Set);const Be=e.createContext(null),qe=e.createContext(null),He=()=>e.useContext(qe);function _e(e){return"data-floating-ui-"+e}function Ue(e){const t=o(e);return Ie((()=>{t.current=e})),t}let $e=0;function ze(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame($e);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():$e=requestAnimationFrame(i)}function Xe(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Ye=new WeakMap,Ke=new WeakSet,Ge={},Je=0;const Qe=e=>e&&(e.host||Qe(e.parentNode));function Ze(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=(c=t,e.map((e=>{if(c.contains(e))return e;const t=Qe(e);return c.contains(t)?t:null})).filter((e=>null!=e)));var c;const s=new Set,a=new Set(u),f=[];Ge[o]||(Ge[o]=new WeakMap);const d=Ge[o];return u.forEach((function e(t){if(!t||s.has(t))return;s.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==l(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Ye.get(t)||0)+1,u=(d.get(t)||0)+1;Ye.set(t,r),d.set(t,u),f.push(t),1===r&&n&&Ke.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),s.clear(),Je++,()=>{f.forEach((e=>{const t=(Ye.get(e)||0)-1,n=(d.get(e)||0)-1;Ye.set(e,t),d.set(e,n),t||(!Ke.has(e)&&i&&e.removeAttribute(i),Ke.delete(e)),n||e.removeAttribute(o)})),Je--,Je||(Ye=new WeakMap,Ye=new WeakMap,Ke=new WeakSet,Ge={})}}function et(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=M(e[0]).body;return Ze(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const tt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function nt(e,t){const n=ue(e,tt());"prev"===t&&n.reverse();const r=n.indexOf(O(M(e)));return n.slice(r+1)[0]}function rt(){return nt(document.body,"next")}function ot(){return nt(document.body,"prev")}function it(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!T(n,r)}function ut(e){ue(e,tt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function lt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ct={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 st(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const at=e.forwardRef((function(t,n){const[r,o]=e.useState();Ie((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",st),()=>{document.removeEventListener("keydown",st)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[_e("focus-guard")]:"",style:ct};return e.createElement("span",De({},t,i))})),ft=e.createContext(null),dt=_e("portal");function pt(t){const{children:n,id:r,root:o,preserveTabOrder:u=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=We(),i=mt(),[u,l]=e.useState(null),c=e.useRef(null);return Ie((()=>()=>{null==u||u.remove(),queueMicrotask((()=>{c.current=null}))}),[u]),Ie((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(dt,""),e.appendChild(t),c.current=t,l(t)}),[n,o]),Ie((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!f(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const u=document.createElement("div");u.id=o,u.setAttribute(dt,""),e=t||e,e.appendChild(u),c.current=u,l(u)}),[n,r,o,i]),u}({id:r,root:o}),[c,s]=e.useState(null),a=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),h=null==c?void 0:c.modal,v=null==c?void 0:c.open,g=!!c&&!c.modal&&c.open&&u&&!(!o&&!l);return e.useEffect((()=>{if(l&&u&&!h)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&it(e)){("focusin"===e.type?lt:ut)(l)}}}),[l,u,h]),e.useEffect((()=>{l&&(v||lt(l))}),[v,l]),e.createElement(ft.Provider,{value:e.useMemo((()=>({preserveTabOrder:u,beforeOutsideRef:a,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:m,portalNode:l,setFocusManagerState:s})),[u,l])},g&&l&&e.createElement(at,{"data-type":"outside",ref:a,onFocus:e=>{if(it(e,l)){var t;null==(t=p.current)||t.focus()}else{const e=ot()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),g&&l&&e.createElement("span",{"aria-owns":l.id,style:ct}),l&&i.createPortal(n,l),g&&l&&e.createElement(at,{"data-type":"outside",ref:d,onFocus:e=>{if(it(e,l)){var t;null==(t=m.current)||t.focus()}else{const t=rt()||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const mt=()=>e.useContext(ft),ht="data-floating-ui-focusable";let vt=[];function gt(e){vt=vt.filter((e=>e.isConnected)),e&&"body"!==l(e)&&(vt.push(e),vt.length>20&&(vt=vt.slice(-20)))}function yt(){return vt.slice().reverse().find((e=>e.isConnected))}function wt(e){const t=tt();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==$.call(e,_)&&re(t,e)}(e,t)?e:ue(e,t)[0]}const bt=e.forwardRef((function(t,n){return e.createElement("button",De({},t,{type:"button",ref:n,tabIndex:-1,style:ct}))}));function xt(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:u=!0,initialFocus:l=0,returnFocus:c=!0,restoreFocus:s=!1,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:p=!0,outsideElementsInert:m=!1}=t,{open:h,refs:v,nodeId:g,onOpenChange:y,events:w,dataRef:b,elements:{domReference:x,floating:E}}=n,R="number"==typeof l&&l<0,S=F(x)&&R,C="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,A=!C||u,L=!A||C&&m,P=Ue(i),j=Ue(l),W=Ue(c),V=He(),B=mt(),q=e.useRef(null),H=e.useRef(null),_=e.useRef(!1),U=e.useRef(!1),$=e.useRef(-1),z=null!=B,X=(Y=E)?Y.hasAttribute(ht)?Y:Y.querySelector("["+ht+"]")||Y:null;var Y;const K=Me((function(e){return void 0===e&&(e=X),e?ue(e,tt()):[]})),G=Me((e=>{const t=K(e);return P.current.map((e=>x&&"reference"===e?x:X&&"floating"===e?X:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!a)return;function e(e){if("Tab"===e.key){T(X,O(M(X)))&&0===K().length&&!S&&D(e);const t=G(),n=I(e);"reference"===P.current[0]&&n===x&&(D(e),e.shiftKey?ze(t[t.length-1]):ze(t[1])),"floating"===P.current[1]&&n===X&&e.shiftKey&&(D(e),ze(t[0]))}}const t=M(X);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,x,X,a,P,S,K,G]),e.useEffect((()=>{if(!o&&E)return E.addEventListener("focusin",e),()=>{E.removeEventListener("focusin",e)};function e(e){const t=I(e),n=K().indexOf(t);-1!==n&&($.current=n)}}),[o,E,K]),e.useEffect((()=>{if(!o&&p)return E&&d(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),E.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),E.removeEventListener("focusout",t)}):void 0;function e(){U.current=!0,setTimeout((()=>{U.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(T(x,t)||T(E,t)||T(t,E)||T(null==B?void 0:B.portalNode,t)||null!=t&&t.hasAttribute(_e("focus-guard"))||V&&(Xe(V.nodesRef.current,g).find((e=>{var n,r;return T(null==(n=e.context)?void 0:n.elements.floating,t)||T(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(V.nodesRef.current,g).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(s&&n&&O(M(X))===M(X).body){d(X)&&X.focus();const e=$.current,t=K(),n=t[e]||t[t.length-1]||X;d(n)&&n.focus()}!S&&a||!t||!n||U.current||t===yt()||(_.current=!0,y(!1,e,"focus-out"))}))}}),[o,x,E,X,a,g,V,B,y,p,s,K,S]);const J=e.useRef(null),Q=e.useRef(null),Z=Le([J,null==B?void 0:B.beforeInsideRef]),ee=Le([Q,null==B?void 0:B.afterInsideRef]);function te(t){return!o&&f&&a?e.createElement(bt,{ref:"start"===t?q:H,onClick:e=>y(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==B||null==(e=B.portalNode)?void 0:e.querySelectorAll("["+_e("portal")+"]"))||[]);if(E){const e=[E,...t,q.current,H.current,J.current,Q.current,null==B?void 0:B.beforeOutsideRef.current,null==B?void 0:B.afterOutsideRef.current,P.current.includes("reference")||S?x:null].filter((e=>null!=e)),n=a||S?et(e,!L,L):et(e);return()=>{n()}}}),[o,x,E,a,P,B,S,A,L]),Ie((()=>{if(o||!d(X))return;const e=O(M(X));queueMicrotask((()=>{const t=G(X),n=j.current,r=("number"==typeof n?t[n]:n.current)||X,o=T(X,e);R||o||!h||ze(r,{preventScroll:r===X})}))}),[o,h,X,R,G,j]),Ie((()=>{if(o||!X)return;let e=!1;const t=M(X),n=O(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:u}=t;n&&(r=i),"escape-key"===o&&v.domReference.current&&gt(v.domReference.current),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(_.current=!0),"outside-press"===o&&(u?(_.current=!1,e=!0):_.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(k()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||N(i)))}gt(n),w.on("openchange",i);const u=t.createElement("span");return u.setAttribute("tabindex","-1"),u.setAttribute("aria-hidden","true"),Object.assign(u.style,ct),z&&x&&x.insertAdjacentElement("afterend",u),()=>{w.off("openchange",i);const n=O(t),o=T(E,n)||V&&Xe(V.nodesRef.current,g).some((e=>{var t;return T(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&v.domReference.current&&gt(v.domReference.current);const l="boolean"==typeof W.current?yt()||u:W.current.current||u;queueMicrotask((()=>{const r=wt(l);W.current&&!_.current&&d(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),u.remove()}))}}),[o,E,X,W,b,v,w,V,g,z,x]),e.useEffect((()=>{queueMicrotask((()=>{_.current=!1}))}),[o]),Ie((()=>{if(!o&&B)return B.setFocusManagerState({modal:a,closeOnFocusOut:p,open:h,onOpenChange:y,refs:v}),()=>{B.setFocusManagerState(null)}}),[o,B,a,h,y,v,p]),Ie((()=>{if(o)return;if(!X)return;if("function"!=typeof MutationObserver)return;if(R)return;const e=()=>{const e=X.getAttribute("tabindex"),t=K(),n=O(M(E)),r=t.indexOf(n);-1!==r&&($.current=r),P.current.includes("floating")||n!==v.domReference.current&&0===t.length?"0"!==e&&X.setAttribute("tabindex","0"):"-1"!==e&&X.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(X,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,E,X,v,P,K,R]);const ne=!o&&A&&(!a||!S)&&(z||a);return e.createElement(e.Fragment,null,ne&&e.createElement(at,{"data-type":"inside",ref:Z,onFocus:e=>{if(a){const e=G();ze("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=B&&B.preserveTabOrder&&B.portalNode)if(_.current=!1,it(e,B.portalNode)){const e=rt()||x;null==e||e.focus()}else{var t;null==(t=B.beforeOutsideRef.current)||t.focus()}}}),!S&&te("start"),r,te("end"),ne&&e.createElement(at,{"data-type":"inside",ref:ee,onFocus:e=>{if(a)ze(G()[0]);else if(null!=B&&B.preserveTabOrder&&B.portalNode)if(p&&(_.current=!0),it(e,B.portalNode)){const e=ot()||x;null==e||e.focus()}else{var t;null==(t=B.afterOutsideRef.current)||t.focus()}}}))}let Et=0;let Rt=()=>{};const St=e.forwardRef((function(t,n){const{lockScroll:r=!1,...o}=t;return Ie((()=>{if(r)return Et++,1===Et&&(Rt=function(){const e=/iP(hone|ad|od)|iOS/.test(A()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var u,l;const e=(null==(u=window.visualViewport)?void 0:u.offsetLeft)||0,n=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{Et--,0===Et&&Rt()}}),[r]),e.createElement("div",De({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Ct(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=We(),u=e.useRef({}),[l]=e.useState((()=>function(){const 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)))||[])}}}())),c=null!=((null==(s=e.useContext(Be))?void 0:s.id)||null);var s;if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!f(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Ve)&&e.has(o)||(null==(i=Ve)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,d]=e.useState(o.reference),p=Me(((e,t,n)=>{u.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),m=e.useMemo((()=>({setPositionReference:d})),[]),h=e.useMemo((()=>({reference:a||o.reference||null,floating:o.floating||null,domReference:o.reference})),[a,o.reference,o.floating]);return e.useMemo((()=>({dataRef:u,open:n,onOpenChange:p,elements:h,events:l,floatingId:i,refs:m})),[n,p,h,l,i,m])}function Ot(t){void 0===t&&(t={});const{nodeId:n}=t,r=Ct({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,u=o.elements,[l,c]=e.useState(null),[s,a]=e.useState(null),d=(null==u?void 0:u.domReference)||l,p=e.useRef(null),m=He();Ie((()=>{d&&(p.current=d)}),[d]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:u,elements:{reference:l,floating:c}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);Ce(m,o)||h(o);const[v,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==C.current&&(C.current=e,w(e))}),[]),E=l||v,R=c||y,S=e.useRef(null),C=e.useRef(null),O=e.useRef(d),T=null!=a,A=Ae(a),L=Ae(u),N=Ae(f),k=e.useCallback((()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:m};L.current&&(e.platform=L.current),Re(S.current,C.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};M.current&&!Ce(O.current,t)&&(O.current=t,i.flushSync((()=>{p(t)})))}))}),[m,n,r,L,N]);Se((()=>{!1===f&&O.current.isPositioned&&(O.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Se((()=>(M.current=!0,()=>{M.current=!1})),[]),Se((()=>{if(E&&(S.current=E),R&&(C.current=R),E&&R){if(A.current)return A.current(E,R,k);k()}}),[E,R,k,A,T]);const I=e.useMemo((()=>({reference:S,floating:C,setReference:b,setFloating:x})),[b,x]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=Te(D.floating,d.x),n=Te(D.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...Oe(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:I,elements:D,floatingStyles:F})),[d,k,I,D,F])}({...t,elements:{...u,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),h.refs.setReference(t)}),[h.refs]),g=e.useCallback((e=>{(f(e)||null===e)&&(p.current=e,c(e)),(f(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!f(e))&&h.refs.setReference(e)}),[h.refs]),y=e.useMemo((()=>({...h.refs,setReference:g,setPositionReference:v,domReference:p})),[h.refs,g,v]),w=e.useMemo((()=>({...h.elements,domReference:d})),[h.elements,d]),b=e.useMemo((()=>({...h,...o,refs:y,elements:w,nodeId:n})),[h,y,w,n,o]);return Ie((()=>{o.dataRef.current.floatingContext=b;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...h,context:b,refs:y,elements:w})),[h,y,w,b])}var Tt=function(e){var n=e.open,r=void 0===n||n,o=e.onClose,i=e.children,u=Ot().context;return t.createElement("div",{className:"modal"},t.createElement("div",{className:"modal__content"},t.createElement("div",null,i),t.createElement("div",null,r&&t.createElement(pt,null,t.createElement(St,{className:"overlay",lockScroll:!0},t.createElement(xt,{context:u},t.createElement("div",{className:"fixed bg-black/80 overflow-auto w-screen h-screen grid place-items-center"},t.createElement("div",{className:"bg-white p-4 inline-block rounded-md shadow-lg"},t.createElement("button",{onClick:function(){o(!1)}},"Close"),t.createElement("div",null,"Modal Content",t.createElement("div",null,t.createElement("input",{type:"text",autoFocus:!0})))))))))))};export{Tt as Modal,Tt as default};
5
+ */var z=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),X="undefined"==typeof Element,Y=X?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,K=!X&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},G=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},J=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var u=i.shift();if(!G(u,!1))if("SLOT"===u.tagName){var l=u.assignedElements(),c=e(l.length?l:u.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:u,candidates:c})}else{Y.call(u,z)&&r.filter(u)&&(n||!t.includes(u))&&o.push(u);var s=u.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(u),a=!G(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(u));if(s&&a){var f=e(!0===s?u.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:u,candidates:f})}else i.unshift.apply(i,u.children)}}return o},Q=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Z=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Q(e)?0:e.tabIndex},ee=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},te=function(e){return"INPUT"===e.tagName},ne=function(e){return function(e){return te(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||K(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},re=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},oe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=Y.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Y.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return re(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,l=K(e);if(u&&!u.shadowRoot&&!0===r(u))return re(e);e=e.assignedSlot?e.assignedSlot:u||l===e.ownerDocument?u:l.host}e=i}if(function(e){var t,n,r,o,i=e&&K(e),u=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&u;){var c,s,a;l=!(null===(s=u=null===(c=i=K(u))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(u))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ie=function(e,t){return!(t.disabled||G(t)||function(e){return te(e)&&"hidden"===e.type}(t)||oe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Y.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ue=function(e,t){return!(ne(t)||Z(t)<0||!ie(e,t))},le=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ce=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,u=i?t.scopeParent:t,l=function(e,t){var n=Z(e);return n<0&&t&&!Q(e)?0:n}(u,i),c=i?e(t.candidates):u;0===l?i?n.push.apply(n,c):n.push(u):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:c})})),r.sort(ee).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},se=function(e,t){var n;return n=(t=t||{}).getShadowRoot?J([e],t.includeContainer,{filter:ue.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:le}):function(e,t,n){if(G(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(z));return t&&Y.call(e,z)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ue.bind(null,t)),ce(n)};function ae(e,t,n){let{reference:r,floating:o}=e;const i=U(t),u=function(e){return"x"===U(e)?"y":"x"}(t),l="y"===u?"height":"width";const c=_(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(function(e){return e.split("-")[1]}(t)){case"start":p[u]-=d*(n&&s?-1:1);break;case"end":p[u]+=d*(n&&s?-1:1)}return p}function fe(e){const t=R(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=h(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,l=q(n)!==i||q(r)!==u;return l&&(n=i,r=u),{width:n,height:r,$:l}}function de(e){return m(e)?e:e.contextElement}function pe(e){const t=de(e);if(!h(t))return H(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fe(t);let u=(i?q(n.width):n.width)/r,l=(i?q(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),l&&Number.isFinite(l)||(l=1),{x:u,y:l}}const me=H(0);function he(e){const t=f(e);return x()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:me}function ve(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=de(e);let u=H(1);t&&(r?m(r)&&(u=pe(r)):u=pe(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==f(e))&&t}(i,n,r)?he(i):H(0);let c=(o.left+l.x)/u.x,s=(o.top+l.y)/u.y,a=o.width/u.x,d=o.height/u.y;if(i){const e=f(i),t=r&&m(r)?f(r):r;let n=e,o=L(n);for(;o&&r&&t!==n;){const e=pe(o),t=o.getBoundingClientRect(),r=R(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,d*=e.y,c+=i,s+=u,n=f(o),o=L(n)}}return $({width:a,height:d,x:c,y:s})}function ge(e,t){const n=S(e).scrollLeft;return t?t.left+n:ve(d(e)).left+n}function ye(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:ge(e,r)),y:r.top+t.scrollTop}}function we(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=f(e),r=d(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,l=0,c=0;if(o){i=o.width,u=o.height;const e=x();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:u,x:l,y:c}}(e,n);else if("document"===t)r=function(e){const t=d(e),n=S(e),r=e.ownerDocument.body,o=B(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=B(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+ge(e);const l=-n.scrollTop;return"rtl"===R(r).direction&&(u+=B(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:l}}(d(e));else if(m(t))r=function(e,t){const n=ve(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=h(e)?pe(e):H(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=he(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $(r)}function be(e,t){const n=C(e);return!(n===t||!m(n)||E(n))&&("fixed"===R(n).position||be(n,t))}function xe(e,t,n){const r=h(t),o=d(t),i="fixed"===n,u=ve(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=H(0);if(r||!r&&!i)if(("body"!==a(t)||g(o))&&(l=S(t)),r){const e=ve(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=ge(o));const s=!o||r||i?H(0):ye(o,l);return{x:u.left+l.scrollLeft-c.x-s.x,y:u.top+l.scrollTop-c.y-s.y,width:u.width,height:u.height}}function Ee(e){return"static"===R(e).position}function Re(e,t){if(!h(e)||"fixed"===R(e).position)return null;if(t)return t(e);let n=e.offsetParent;return d(e)===n&&(n=n.ownerDocument.body),n}function Se(e,t){const n=f(e);if(w(e))return n;if(!h(e)){let t=C(e);for(;t&&!E(t);){if(m(t)&&!Ee(t))return t;t=C(t)}return n}let r=Re(e,t);for(;r&&y(r)&&Ee(r);)r=Re(r,t);return r&&E(r)&&Ee(r)&&!b(r)?n:r||function(e){let t=C(e);for(;h(t)&&!E(t);){if(b(t))return t;if(w(t))return null;t=C(t)}return null}(e)||n}const Ce={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=d(r),l=!!t&&w(t.floating);if(r===u||l&&i)return n;let c={scrollLeft:0,scrollTop:0},s=H(1);const f=H(0),p=h(r);if((p||!p&&!i)&&(("body"!==a(r)||g(u))&&(c=S(r)),h(r))){const e=ve(r);s=pe(r),f.x=e.x+r.clientLeft,f.y=e.y+r.clientTop}const m=!u||p||i?H(0):ye(u,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+f.x+m.x,y:n.y*s.y-c.scrollTop*s.y+f.y+m.y}},getDocumentElement:d,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?w(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=A(e,[],!1).filter((e=>m(e)&&"body"!==a(e))),o=null;const i="fixed"===R(e).position;let u=i?C(e):e;for(;m(u)&&!E(u);){const t=R(u),n=b(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||g(u)&&!n&&be(e,u))?r=r.filter((e=>e!==u)):o=t,u=C(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=i[0],l=i.reduce(((e,n)=>{const r=we(t,n,o);return e.top=B(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=B(r.left,e.left),e}),we(t,u,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Se,getElementRects:async function(e){const t=this.getOffsetParent||Se,n=this.getDimensions,r=await n(e.floating);return{reference:xe(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}=fe(e);return{width:t,height:n}},getScale:pe,isElement:m,isRTL:function(e){return"rtl"===R(e).direction}},Te=(e,t,n)=>{const r=new Map,o={platform:Ce,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,l=i.filter(Boolean),c=await(null==u.isRTL?void 0:u.isRTL(t));let s=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=ae(s,r,c),d=r,p={},m=0;for(let n=0;n<l.length;n++){const{name:i,fn:h}=l[n],{x:v,y:g,data:y,reset:w}=await h({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:u,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=ae(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Ae="undefined"!=typeof document?n:r;function Le(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Le(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Le(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ne(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oe(e,t){const n=Ne(e);return Math.round(t*n)/n}function ke(t){const n=e.useRef(t);return Ae((()=>{n.current=t})),n}function Me(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const Ie={...e},De=Ie.useInsertionEffect||(e=>e());function Fe(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return De((()=>{n.current=t})),e.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)}),[])}var Pe="undefined"!=typeof document?n:r;let We=!1,je=0;const Ve=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+je++;const Be=Ie.useId||function(){const[t,n]=e.useState((()=>We?Ve():void 0));return Pe((()=>{null==t&&n(Ve())}),[]),e.useEffect((()=>{We=!0}),[]),t};let qe;"production"!==process.env.NODE_ENV&&(qe=new Set);const He=e.createContext(null),_e=e.createContext(null),Ue=()=>e.useContext(_e);function $e(e){return"data-floating-ui-"+e}function ze(e){const t=o(e);return Pe((()=>{t.current=e})),t}let Xe=0;function Ye(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Xe);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Xe=requestAnimationFrame(i)}function Ke(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Ge(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Je=new WeakMap,Qe=new WeakSet,Ze={},et=0;const tt=e=>e&&(e.host||tt(e.parentNode));function nt(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=(l=t,e.map((e=>{if(l.contains(e))return e;const t=tt(e);return l.contains(t)?t:null})).filter((e=>null!=e)));var l;const c=new Set,s=new Set(u),f=[];Ze[o]||(Ze[o]=new WeakMap);const d=Ze[o];return u.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==a(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Je.get(t)||0,u=i?r+1:r,l=(d.get(t)||0)+1;Je.set(t,u),d.set(t,l),f.push(t),1===u&&n&&Qe.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),et++,()=>{f.forEach((e=>{const t=Je.get(e)||0,n=i?t-1:t,r=(d.get(e)||0)-1;Je.set(e,n),d.set(e,r),n||(!Qe.has(e)&&i&&e.removeAttribute(i),Qe.delete(e)),r||e.removeAttribute(o)})),et--,et||(Je=new WeakMap,Je=new WeakMap,Qe=new WeakSet,Ze={})}}function rt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=F(e[0]).body;return nt(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const ot=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function it(e,t){const n=se(e,ot());"prev"===t&&n.reverse();const r=n.indexOf(N(F(e)));return n.slice(r+1)[0]}function ut(){return it(document.body,"next")}function lt(){return it(document.body,"prev")}function ct(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!O(n,r)}function st(e){se(e,ot()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function at(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ft={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 dt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const pt=e.forwardRef((function(t,n){const[r,o]=e.useState();Pe((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",dt),()=>{document.removeEventListener("keydown",dt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[$e("focus-guard")]:"",style:ft};return u("span",{...t,...i})})),mt=e.createContext(null),ht=$e("portal");function vt(t){const{children:n,id:r,root:o,preserveTabOrder:l=!0}=t,s=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=Be(),i=gt(),[u,l]=e.useState(null),c=e.useRef(null);return Pe((()=>()=>{null==u||u.remove(),queueMicrotask((()=>{c.current=null}))}),[u]),Pe((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(ht,""),e.appendChild(t),c.current=t,l(t)}),[n,o]),Pe((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!m(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const u=document.createElement("div");u.id=o,u.setAttribute(ht,""),e=t||e,e.appendChild(u),c.current=u,l(u)}),[n,r,o,i]),u}({id:r,root:o}),[a,f]=e.useState(null),d=e.useRef(null),p=e.useRef(null),h=e.useRef(null),v=e.useRef(null),g=null==a?void 0:a.modal,y=null==a?void 0:a.open,w=!!a&&!a.modal&&a.open&&l&&!(!o&&!s);return e.useEffect((()=>{if(s&&l&&!g)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&ct(e)){("focusin"===e.type?at:st)(s)}}}),[s,l,g]),e.useEffect((()=>{s&&(y||at(s))}),[y,s]),i(mt.Provider,{value:e.useMemo((()=>({preserveTabOrder:l,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:h,afterInsideRef:v,portalNode:s,setFocusManagerState:f})),[l,s]),children:[w&&s&&u(pt,{"data-type":"outside",ref:d,onFocus:e=>{if(ct(e,s)){var t;null==(t=h.current)||t.focus()}else{const e=lt()||(null==a?void 0:a.domReference);null==e||e.focus()}}}),w&&s&&u("span",{"aria-owns":s.id,style:ft}),s&&c.createPortal(n,s),w&&s&&u(pt,{"data-type":"outside",ref:p,onFocus:e=>{if(ct(e,s)){var t;null==(t=v.current)||t.focus()}else{const t=ut()||(null==a?void 0:a.domReference);null==t||t.focus(),(null==a?void 0:a.closeOnFocusOut)&&(null==a||a.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const gt=()=>e.useContext(mt),yt="data-floating-ui-focusable";function wt(e){return e?e.hasAttribute(yt)?e:e.querySelector("["+yt+"]")||e:null}let bt=[];function xt(e){bt=bt.filter((e=>e.isConnected)),e&&"body"!==a(e)&&(bt.push(e),bt.length>20&&(bt=bt.slice(-20)))}function Et(){return bt.slice().reverse().find((e=>e.isConnected))}function Rt(e){const t=ot();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Y.call(e,z)&&ue(t,e)}(e,t)?e:se(e,t)[0]||e}const St=e.forwardRef((function(e,t){return u("button",{...e,type:"button",ref:t,tabIndex:-1,style:ft})}));function Ct(t){const{context:n,children:r,disabled:o=!1,order:c=["content"],guards:s=!0,initialFocus:a=0,returnFocus:f=!0,restoreFocus:d=!1,modal:p=!0,visuallyHiddenDismiss:m=!1,closeOnFocusOut:v=!0,outsideElementsInert:g=!1}=t,{open:y,onOpenChange:w,events:b,dataRef:x,elements:{domReference:E,floating:R}}=n,S=Fe((()=>{var e;return null==(e=x.current.floatingContext)?void 0:e.nodeId})),C="number"==typeof a&&a<0,T=j(E)&&C,A="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,L=!A||s,k=!L||A&&g,M=ze(c),V=ze(a),B=ze(f),q=Ue(),H=gt(),_=e.useRef(null),U=e.useRef(null),$=e.useRef(!1),z=e.useRef(!1),X=e.useRef(-1),Y=null!=H,K=wt(R),G=Fe((function(e){return void 0===e&&(e=K),e?se(e,ot()):[]})),J=Fe((e=>{const t=G(e);return M.current.map((e=>E&&"reference"===e?E:K&&"floating"===e?K:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!p)return;function e(e){if("Tab"===e.key){O(K,N(F(K)))&&0===G().length&&!T&&W(e);const t=J(),n=P(e);"reference"===M.current[0]&&n===E&&(W(e),e.shiftKey?Ye(t[t.length-1]):Ye(t[1])),"floating"===M.current[1]&&n===K&&e.shiftKey&&(W(e),Ye(t[0]))}}const t=F(K);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,K,p,M,T,G,J]),e.useEffect((()=>{if(!o&&R)return R.addEventListener("focusin",e),()=>{R.removeEventListener("focusin",e)};function e(e){const t=P(e),n=G().indexOf(t);-1!==n&&(X.current=n)}}),[o,R,G]),e.useEffect((()=>{if(!o&&v)return R&&h(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),R.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),R.removeEventListener("focusout",t)}):void 0;function e(){z.current=!0,setTimeout((()=>{z.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=S(),r=!(O(E,t)||O(R,t)||O(t,R)||O(null==H?void 0:H.portalNode,t)||null!=t&&t.hasAttribute($e("focus-guard"))||q&&(Ge(q.nodesRef.current,n).find((e=>{var n,r;return O(null==(n=e.context)?void 0:n.elements.floating,t)||O(null==(r=e.context)?void 0:r.elements.domReference,t)}))||Ke(q.nodesRef.current,n).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,wt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(d&&r&&N(F(K))===F(K).body){h(K)&&K.focus();const e=X.current,t=G(),n=t[e]||t[t.length-1]||K;h(n)&&n.focus()}!T&&p||!t||!r||z.current||t===Et()||($.current=!0,w(!1,e,"focus-out"))}))}}),[o,E,R,K,p,q,H,w,v,d,G,T,S]);const Q=e.useRef(null),Z=e.useRef(null),ee=Me([Q,null==H?void 0:H.beforeInsideRef]),te=Me([Z,null==H?void 0:H.afterInsideRef]);function ne(e){return!o&&m&&p?u(St,{ref:"start"===e?_:U,onClick:e=>w(!1,e.nativeEvent),children:"string"==typeof m?m:"Dismiss"}):null}e.useEffect((()=>{var e;if(o)return;if(!R)return;const t=Array.from((null==H||null==(e=H.portalNode)?void 0:e.querySelectorAll("["+$e("portal")+"]"))||[]),n=q&&!p?Ke(null==q?void 0:q.nodesRef.current,S()).map((e=>{var t;return null==(t=e.context)?void 0:t.elements.floating})):[],r=[R,...t,...n,_.current,U.current,Q.current,Z.current,null==H?void 0:H.beforeOutsideRef.current,null==H?void 0:H.afterOutsideRef.current,M.current.includes("reference")||T?E:null].filter((e=>null!=e)),i=p||T?rt(r,!k,k):rt(r);return()=>{i()}}),[o,E,R,p,M,H,T,L,k,q,S]),Pe((()=>{if(o||!h(K))return;const e=N(F(K));queueMicrotask((()=>{const t=J(K),n=V.current,r=("number"==typeof n?t[n]:n.current)||K,o=O(K,e);C||o||!y||Ye(r,{preventScroll:r===K})}))}),[o,y,K,C,J,V]),Pe((()=>{if(o||!K)return;let e=!1;const t=F(K),n=N(t);let r=x.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:u}=t;n&&(r=i),"escape-key"===o&&E&&xt(E),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&($.current=!0),"outside-press"===o&&(u?($.current=!1,e=!0):$.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(D()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||I(i)))}xt(n),b.on("openchange",i);const u=t.createElement("span");return u.setAttribute("tabindex","-1"),u.setAttribute("aria-hidden","true"),Object.assign(u.style,ft),Y&&E&&E.insertAdjacentElement("afterend",u),()=>{b.off("openchange",i);const n=N(t),o=O(R,n)||q&&Ge(q.nodesRef.current,S()).some((e=>{var t;return O(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&E&&xt(E);const l="boolean"==typeof B.current?Et()||u:B.current.current||u;queueMicrotask((()=>{const r=Rt(l);B.current&&!$.current&&h(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),u.remove()}))}}),[o,R,K,B,x,b,q,Y,E,S]),e.useEffect((()=>{queueMicrotask((()=>{$.current=!1}))}),[o]),Pe((()=>{if(!o&&H)return H.setFocusManagerState({modal:p,closeOnFocusOut:v,open:y,onOpenChange:w,domReference:E}),()=>{H.setFocusManagerState(null)}}),[o,H,p,y,w,v,E]),Pe((()=>{if(o)return;if(!K)return;if("function"!=typeof MutationObserver)return;if(C)return;const e=()=>{const e=K.getAttribute("tabindex"),t=G(),n=N(F(R)),r=t.indexOf(n);-1!==r&&(X.current=r),M.current.includes("floating")||n!==E&&0===t.length?"0"!==e&&K.setAttribute("tabindex","0"):"-1"!==e&&K.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(K,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,R,K,E,M,G,C]);const re=!o&&L&&(!p||!T)&&(Y||p);return i(l,{children:[re&&u(pt,{"data-type":"inside",ref:ee,onFocus:e=>{if(p){const e=J();Ye("reference"===c[0]?e[0]:e[e.length-1])}else if(null!=H&&H.preserveTabOrder&&H.portalNode)if($.current=!1,ct(e,H.portalNode)){const e=ut()||E;null==e||e.focus()}else{var t;null==(t=H.beforeOutsideRef.current)||t.focus()}}}),!T&&ne("start"),r,ne("end"),re&&u(pt,{"data-type":"inside",ref:te,onFocus:e=>{if(p)Ye(J()[0]);else if(null!=H&&H.preserveTabOrder&&H.portalNode)if(v&&($.current=!0),ct(e,H.portalNode)){const e=lt()||E;null==e||e.focus()}else{var t;null==(t=H.afterOutsideRef.current)||t.focus()}}})]})}let Tt=0;let At=()=>{};const Lt=e.forwardRef((function(e,t){const{lockScroll:n=!1,...r}=e;return Pe((()=>{if(n)return Tt++,1===Tt&&(At=function(){const e=/iP(hone|ad|od)|iOS/.test(k()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var u,l;const e=(null==(u=window.visualViewport)?void 0:u.offsetLeft)||0,n=(null==(l=window.visualViewport)?void 0:l.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{Tt--,0===Tt&&At()}}),[n]),u("div",{ref:t,...r,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}})}));function Nt(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=Be(),u=e.useRef({}),[l]=e.useState((()=>function(){const 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)))||[])}}}())),c=null!=((null==(s=e.useContext(He))?void 0:s.id)||null);var s;if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!m(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=qe)&&e.has(o)||(null==(i=qe)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,f]=e.useState(o.reference),d=Fe(((e,t,n)=>{u.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),p=e.useMemo((()=>({setPositionReference:f})),[]),h=e.useMemo((()=>({reference:a||o.reference||null,floating:o.floating||null,domReference:o.reference})),[a,o.reference,o.floating]);return e.useMemo((()=>({dataRef:u,open:n,onOpenChange:d,elements:h,events:l,floatingId:i,refs:p})),[n,d,h,l,i,p])}function Ot(t){void 0===t&&(t={});const{nodeId:n}=t,r=Nt({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[u,l]=e.useState(null),[s,a]=e.useState(null),f=(null==i?void 0:i.domReference)||u,d=e.useRef(null),p=Ue();Pe((()=>{f&&(d.current=f)}),[f]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:u,floating:l}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);Le(m,o)||h(o);const[v,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==C.current&&(C.current=e,w(e))}),[]),E=u||v,R=l||y,S=e.useRef(null),C=e.useRef(null),T=e.useRef(d),A=null!=a,L=ke(a),N=ke(i),O=ke(f),k=e.useCallback((()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:m};N.current&&(e.platform=N.current),Te(S.current,C.current,e).then((e=>{const t={...e,isPositioned:!1!==O.current};M.current&&!Le(T.current,t)&&(T.current=t,c.flushSync((()=>{p(t)})))}))}),[m,n,r,N,O]);Ae((()=>{!1===f&&T.current.isPositioned&&(T.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Ae((()=>(M.current=!0,()=>{M.current=!1})),[]),Ae((()=>{if(E&&(S.current=E),R&&(C.current=R),E&&R){if(L.current)return L.current(E,R,k);k()}}),[E,R,k,L,A]);const I=e.useMemo((()=>({reference:S,floating:C,setReference:b,setFloating:x})),[b,x]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=Oe(D.floating,d.x),n=Oe(D.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...Ne(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:I,elements:D,floatingStyles:F})),[d,k,I,D,F])}({...t,elements:{...i,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=m(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),h.refs.setReference(t)}),[h.refs]),g=e.useCallback((e=>{(m(e)||null===e)&&(d.current=e,l(e)),(m(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!m(e))&&h.refs.setReference(e)}),[h.refs]),y=e.useMemo((()=>({...h.refs,setReference:g,setPositionReference:v,domReference:d})),[h.refs,g,v]),w=e.useMemo((()=>({...h.elements,domReference:f})),[h.elements,f]),b=e.useMemo((()=>({...h,...o,refs:y,elements:w,nodeId:n})),[h,y,w,n,o]);return Pe((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...h,context:b,refs:y,elements:w})),[h,y,w,b])}var kt=function(e){var n=e.open,r=void 0===n||n,o=e.onClose,i=e.children,u=Ot().context;return t.createElement("div",{className:"modal"},t.createElement("div",{className:"modal__content"},t.createElement("div",null,i),t.createElement("div",null,r&&t.createElement(vt,null,t.createElement(Lt,{className:"overlay",lockScroll:!0},t.createElement(Ct,{context:u},t.createElement("div",{className:"fixed bg-black/80 overflow-auto w-screen h-screen grid place-items-center"},t.createElement("div",{className:"bg-white p-4 inline-block rounded-md shadow-lg"},t.createElement("button",{onClick:function(){o(!1)}},"Close"),t.createElement("div",null,"Modal Content",t.createElement("div",null,t.createElement("input",{type:"text",autoFocus:!0})))))))))))};export{kt as Modal,kt as default};
@@ -1 +1 @@
1
- 'use client';import e,{createContext as a,useContext as r}from"react";var t=function(){return t=Object.assign||function(e){for(var a,r=1,t=arguments.length;r<t;r++)for(var o in a=arguments[r])Object.prototype.hasOwnProperty.call(a,o)&&(e[o]=a[o]);return e},t.apply(this,arguments)};function o(e){var a,r,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(a=0;a<n;a++)e[a]&&(r=o(e[a]))&&(t&&(t+=" "),t+=r)}else for(r in e)e[r]&&(t&&(t+=" "),t+=r);return t}function n(){for(var e,a,r=0,t="",n=arguments.length;r<n;r++)(e=arguments[r])&&(a=o(e))&&(t&&(t+=" "),t+=a);return t}"function"==typeof SuppressedError&&SuppressedError;var l=function(e,a){if(void 0===e&&(e=""),e)return e;var r=a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(r)},u=a({value:0,minValue:0,maxValue:100}),i=function(a){var r=a.value,t=void 0===r?0:r,o=a.minValue,i=void 0===o?0:o,s=a.maxValue,m=void 0===s?100:s,v=a.children,f=a.customRootClass,p=l(f,c),d={value:t,minValue:i,maxValue:m};return e.createElement(u.Provider,{value:d},e.createElement("div",{className:n(p)},v))};function s(a){var t=a.customRootClass,o=a.renderLabel,i=l(t,c),s=r(u),m=s.value,v=s.minValue,f=s.maxValue,p=Math.min(Math.max(m,v),f);return e.createElement("div",{role:"progressbar",className:n("".concat(i,"-indicator")),style:{transform:"translateX(-".concat(f-p,"%)")},"aria-valuenow":p,"aria-valuemax":f,"aria-valuemin":v},null==o?void 0:o(m))}var c="Progress";function m(a){var r=a.value,o=void 0===r?0:r,n=a.maxValue,l=void 0===n?100:n,u=a.minValue,c=void 0===u?0:u,m=a.customRootClass,v=function(e,a){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&a.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)a.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(a,["value","maxValue","minValue","customRootClass"]);return e.createElement(i,{value:o,maxValue:l,minValue:c,customRootClass:m},e.createElement(s,t({customRootClass:m},v)))}m.Root=i,m.Indicator=s,m.displayName=c;export{c as COMPONENT_NAME,m as default};
1
+ 'use client';import e,{createContext as r,useContext as a}from"react";var o=function(){return o=Object.assign||function(e){for(var r,a=1,o=arguments.length;a<o;a++)for(var t in r=arguments[a])Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=r[t]);return e},o.apply(this,arguments)};function t(e){var r,a,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(a=t(e[r]))&&(o&&(o+=" "),o+=a)}else for(a in e)e[a]&&(o&&(o+=" "),o+=a);return o}function n(){for(var e,r,a=0,o="",n=arguments.length;a<n;a++)(e=arguments[a])&&(r=t(e))&&(o&&(o+=" "),o+=r);return o}"function"==typeof SuppressedError&&SuppressedError;var l=function(e,r){if(void 0===e&&(e=""),e)return e;var a=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(a)},u=r({value:0,minValue:0,maxValue:100}),i=function(r){var a=r.value,o=void 0===a?0:a,t=r.minValue,i=void 0===t?0:t,c=r.maxValue,m=void 0===c?100:c,v=r.children,f=r.customRootClass,p=l(f,s),d={value:o,minValue:i,maxValue:m};return e.createElement(u.Provider,{value:d},e.createElement("div",{className:n(p)},v))};function c(r){var t=r.customRootClass,i=r.renderLabel,c=r.color,m=void 0===c?"":c,v=l(t,s),f=a(u),p=f.value,d=f.minValue,y=f.maxValue,V=Math.min(Math.max(p,d),y),b={};return m&&(b["data-accent-color"]=m),e.createElement("div",o({role:"progressbar",className:n("".concat(v,"-indicator")),style:{transform:"translateX(-".concat(y-V,"%)")},"aria-valuenow":V,"aria-valuemax":y,"aria-valuemin":d},b),null==i?void 0:i(p))}var s="Progress";function m(r){var a=r.value,t=void 0===a?0:a,n=r.maxValue,l=void 0===n?100:n,u=r.minValue,s=void 0===u?0:u,m=r.customRootClass,v=r.color,f=void 0===v?"":v,p=function(e,r){var a={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(a[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(o=Object.getOwnPropertySymbols(e);t<o.length;t++)r.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t])&&(a[o[t]]=e[o[t]])}return a}(r,["value","maxValue","minValue","customRootClass","color"]);return e.createElement(i,{value:t,maxValue:l,minValue:s,customRootClass:m},e.createElement(c,o({customRootClass:m},p,{color:f})))}m.Root=i,m.Indicator=c,m.displayName=s;export{s as COMPONENT_NAME,m as default};
@@ -0,0 +1 @@
1
+ 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),l=["div","span","button","input"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,l=void 0!==c&&c,i=t.children,u=a(t,["asChild","children"]);return l&&e.isValidElement(i)?e.cloneElement(i,o(o({},u),{ref:r})):e.createElement(n,o(o({},u),{ref:r}),i)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),i=function(n){var t=n.name,r=void 0===t?"":t,c=n.value,i=void 0===c?"":c,u=n.checked,d=void 0!==u&&u,f=n.onClick,v=n.onChange,h=a(n,["name","value","checked","onClick","onChange"]),s={"data-checked":d.toString()};return e.createElement(l.input,o({id:i,type:"radio",value:i,name:r,onClick:function(e){var n,t=null===(n=e.target)||void 0===n?void 0:n.checked;"function"==typeof f&&f({value:i,checked:t})},onChange:function(e){var n=e.target.checked;"function"==typeof v&&v({value:i,checked:n})}},h,s))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,l=t.defaultChecked,i=void 0===l?"":l,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),v=n(i),h=v[0],s=v[1],m={checkedItem:h,setCheckedItem:s,onChange:function(e){s(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:m},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,l=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,v=d.checkedItem,h=d.onChange;return e.createElement("div",o({},u),e.createElement(i,{value:r,name:"radio",checked:v===r,onChange:function(e){f(r),"function"==typeof h&&h(r)}}),e.createElement("label",{htmlFor:r},l))};var v=r({defaultChecked:null,rootClass:"",onChange:null}),h={Root:function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,l=n.onChange,i=void 0===l?null:l,d=n.customRootClass,h=void 0===d?"":d,s=function(e,n){if(void 0===e&&(e=""),e)return e;var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(h,"RadioCards");return e.createElement(v.Provider,{value:{defaultChecked:c,rootClass:s,onChange:i}},e.createElement(u.Root,{className:f(s,o),customRootClass:h},t))},Item:function(n){var r=n.children,c=n.className,l=void 0===c?"":c,i=a(n,["children","className"]),d=t(v);d.defaultChecked,d.onChange;var h=d.rootClass;return e.createElement(u.Item,o({className:f("".concat(h,"-item"),l)},i),r)}};export{h as default};
@@ -1 +1 @@
1
- 'use client';import e from"react";var r=function(){return r=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},r.apply(this,arguments)};function t(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)r.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(t[a[o]]=e[a[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var a=function(a){a.role;var o=a.label,n=void 0===o?"":o,l=a.id,c=a.value,i=a.defaultChecked,u=a.onChange,d=a.checked,f=a.children,p=t(a,["role","label","id","value","defaultChecked","onChange","checked","children"]),s={"aria-label":n||void 0,"aria-checked":d?"true":"false","data-checked":d?"true":"false"};return e.createElement("div",null,e.createElement("input",r({type:"radio",id:l},s,p,{value:c,checked:i,onChange:u})),e.createElement("label",{htmlFor:l}," ",f))};function o(e){var r,t,a="";if("string"==typeof e||"number"==typeof e)a+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(r=0;r<n;r++)e[r]&&(t=o(e[r]))&&(a&&(a+=" "),a+=t)}else for(t in e)e[t]&&(a&&(a+=" "),a+=t);return a}function n(){for(var e,r,t=0,a="",n=arguments.length;t<n;t++)(e=arguments[t])&&(r=o(e))&&(a&&(a+=" "),a+=r);return a}var l=function(o){var l=o.children,c=o.type,i=void 0===c?"radio":c,u=o.className,d=void 0===u?"":u,f=o.customRootClass,p=void 0===f?"":f,s=t(o,["children","type","className","customRootClass"]),v=function(e,r){if(void 0===e&&(e=""),e)return e;var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(p,"RadioGroup");return e.createElement("div",{className:n(v,d),role:"radiogroup"},e.createElement(a,r({type:i},s),l))};export{l as default};
1
+ 'use client';import e,{useState as n,useContext as t,createContext as r}from"react";var o=function(){return o=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},o.apply(this,arguments)};function a(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=e.createContext({defaultChecked:null,onChange:null}),l=["div","span","button","input"].reduce((function(n,t){return n[t]=function(n){var t=e.forwardRef((function(t,r){var c=t.asChild,l=void 0!==c&&c,i=t.children,u=a(t,["asChild","children"]);return l&&e.isValidElement(i)?e.cloneElement(i,o(o({},u),{ref:r})):e.createElement(n,o(o({},u),{ref:r}),i)}));return t.displayName="Primitive.".concat(n),t}(t),n}),{}),i=function(n){var t=n.name,r=void 0===t?"":t,c=n.value,i=void 0===c?"":c,u=n.checked,d=void 0!==u&&u,f=n.onClick,v=n.onChange,h=a(n,["name","value","checked","onClick","onChange"]),s={"data-checked":d.toString()};return e.createElement(l.input,o({id:i,type:"radio",value:i,name:r,onClick:function(e){var n,t=null===(n=e.target)||void 0===n?void 0:n.checked;"function"==typeof f&&f({value:i,checked:t})},onChange:function(e){var n=e.target.checked;"function"==typeof v&&v({value:i,checked:n})}},h,s))},u={};function d(e){var n,t,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(n=0;n<o;n++)e[n]&&(t=d(e[n]))&&(r&&(r+=" "),r+=t)}else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function f(){for(var e,n,t=0,r="",o=arguments.length;t<o;t++)(e=arguments[t])&&(n=d(e))&&(r&&(r+=" "),r+=n);return r}u.Root=function(t){var r=t.children,l=t.defaultChecked,i=void 0===l?"":l,u=t.onChange,d=void 0===u?null:u,f=a(t,["children","defaultChecked","onChange"]),v=n(i),h=v[0],s=v[1],m={checkedItem:h,setCheckedItem:s,onChange:function(e){s(e),"function"==typeof d&&d(e)}};return e.createElement(c.Provider,{value:m},e.createElement("div",o({},f),r))},u.Item=function(n){var r=n.value,l=n.children,u=a(n,["value","children"]),d=t(c),f=d.setCheckedItem,v=d.checkedItem,h=d.onChange;return e.createElement("div",o({},u),e.createElement(i,{value:r,name:"radio",checked:v===r,onChange:function(e){f(r),"function"==typeof h&&h(r)}}),e.createElement("label",{htmlFor:r},l))};var v=r({defaultChecked:null,customRootClass:null,onChange:null}),h={Root:function(n){var t=n.children,r=n.className,o=void 0===r?"":r,a=n.defaultChecked,c=void 0===a?null:a,l=n.onChange,i=void 0===l?null:l,d=n.customRootClass,h=void 0===d?"":d,s=function(e,n){if(void 0===e&&(e=""),e)return e;var t=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(h,"RadioGroup");return e.createElement(v.Provider,{value:{defaultChecked:c,rootClass:s,onChange:i}},e.createElement(u.Root,{className:f(s,o),customRootClass:h},t))},Item:function(n){var r=n.children,c=n.className,l=void 0===c?"":c,i=a(n,["children","className"]),d=t(v);d.defaultChecked,d.onChange;var h=d.rootClass;return e.createElement(u.Item,o({className:f("".concat(h,"-item"),l)},i),r)}};export{h as default};