@radui/ui 0.0.27 → 0.0.29

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=n({isOpen:!1,handleOpenChange:function(){},rootClass:"",handleOverlayClick:function(){}});function a(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=a(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function f(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=a(e))&&(r&&(r+=" "),r+=t);return r}function d(){return"undefined"!=typeof window}function p(e){return h(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=(h(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function h(e){return!!d()&&(e instanceof Node||e instanceof m(e).Node)}function g(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 E(e){return["table","td","th"].includes(p(e))}function x(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function R(e){const t=C(),n=g(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 g(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function A(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 k(e){const t=A(e);return O(t)?e.ownerDocument?e.ownerDocument.body:e.body:y(t)&&b(t)?t:k(t)}function T(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=k(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=m(o);if(i){const e=P(l);return t.concat(l,l.visualViewport||[],b(o)?o:[],e&&n?T(e):[])}return t.concat(o,T(o,[],n))}function P(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function M(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 D(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 I(){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 F(e){return!I().includes("jsdom/")&&(!j()&&0===e.width&&0===e.height||j()&&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 j(){const e=/android/i;return e.test(N())||e.test(I())}function W(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function B(e){return(null==e?void 0:e.ownerDocument)||document}function H(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 c}from"react";import*as u from"react-dom";var s=n({isOpen:!1,handleOpenChange:function(){},rootClass:"",handleOverlayClick:function(){}});function a(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=a(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function f(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=a(e))&&(r&&(r+=" "),r+=t);return r}function d(){return"undefined"!=typeof window}function p(e){return h(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=(h(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function h(e){return!!d()&&(e instanceof Node||e instanceof m(e).Node)}function g(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 E(e){return["table","td","th"].includes(p(e))}function x(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function R(e){const t=C(),n=g(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 g(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(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=k(e);return O(t)?e.ownerDocument?e.ownerDocument.body:e.body:y(t)&&b(t)?t:A(t)}function T(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=P(l);return t.concat(l,l.visualViewport||[],b(o)?o:[],e&&n?T(e):[])}return t.concat(o,T(o,[],n))}function P(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function M(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 N(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 D(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function I(){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 F(e){return!I().includes("jsdom/")&&(!j()&&0===e.width&&0===e.height||j()&&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 j(){const e=/android/i;return e.test(D())||e.test(I())}function W(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function B(e){return(null==e?void 0:e.ownerDocument)||document}function H(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 ce(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 ue(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))},he=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},ge=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},Ee=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},xe=function(e,t){return!(t.disabled||pe(t)||function(e){return ye(e)&&"hidden"===e.type}(t)||Ee(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)||he(t)<0||!xe(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=he(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(ge).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 Ae(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],h=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})),g="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:g,offsetParent:y,strategy:c}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function ke(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Te(e){return K.some((t=>e[t]>=0))}function Pe(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 Me(e){return g(e)?e:e.contextElement}function De(e){const t=Me(e);if(!y(t))return $(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pe(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 Ie(e){const t=m(e);return C()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ne}function Fe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Me(e);let l=$(1);t&&(r?g(r)&&(l=De(r)):l=De(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==m(e))&&t}(i,n,r)?Ie(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&&g(r)?m(r):r;let n=e,o=P(n);for(;o&&r&&t!==n;){const e=De(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=P(n)}}return ce({width:a,height:f,x:c,y:s})}function je(e,t){const n=L(e).scrollLeft;return t?t.left+n:Fe(v(e)).left+n}function We(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:je(e,r)),y:r.top+t.scrollTop}}function Be(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+je(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(g(t))r=function(e,t){const n=Fe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=y(e)?De(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=Ie(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ce(r)}function He(e,t){const n=A(e);return!(n===t||!g(n)||O(n))&&("fixed"===S(n).position||He(n,t))}function Ve(e,t,n){const r=y(t),o=v(t),i="fixed"===n,l=Fe(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=Fe(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=je(o));const s=!o||r||i?$(0):We(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(x(e))return n;if(!y(e)){let t=A(e);for(;t&&!O(t);){if(g(t)&&!_e(t))return t;t=A(t)}return n}let r=qe(e,t);for(;r&&E(r)&&_e(r);)r=qe(r,t);return r&&O(r)&&_e(r)&&!R(r)?n:r||function(e){let t=A(e);for(;y(t)&&!O(t);){if(R(t))return t;if(x(t))return null;t=A(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&&x(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=Fe(r);s=De(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?$(0):We(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?x(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=T(e,[],!1).filter((e=>g(e)&&"body"!==p(e))),o=null;const i="fixed"===S(e).position;let l=i?A(e):e;for(;g(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&&He(e,l))?r=r.filter((e=>e!==l)):o=t,l=A(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=Be(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}),Be(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}=Pe(e);return{width:t,height:n}},getScale:De,isElement:g,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 Ae(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,...h}=Q(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=J(o),y=re(u),w=J(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),E=d||(w||!v?[le(u)]:function(e){const t=le(e);return[ie(e),t,ie(t)]}(u)),x="none"!==m;!d&&x&&E.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,...E],C=await Ae(t,h),O=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&O.push(C[g]),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,A;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==(A=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(p){case"bestFit":{var k;const e=null==(k=S.filter((e=>{if(x){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:k[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=ke(await Ae(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Te(e)}}}case"escaped":{const e=ke(await Ae(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Te(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),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],E=d[p]-i.reference[p],x=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=x?x[w]:0;R&&await(null==l.isElement?void 0:l.isElement(x))||(R=u.floating[w]||i.floating[m]);const C=b/2-E/2,O=R/2-v[m]/2-1,S=X(f[g],O),L=X(f[y],O),A=S,k=R-v[m]-L,T=R/2-v[m]/2+C,P=G(A,T,k),M=!c.arrow&&null!=ee(o)&&T!==P&&i.reference[m]/2-(T<A?S:L)-v[m]/2<0,D=M?T<A?T-A:T-k:0;return{[p]:d[p]+D,data:{[p]:P,centerOffset:T-P-D,...M&&{alignmentOffset:D}},reset:M}}}),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:h,y:g,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!=h?h: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 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}={},...h}=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 g=pt(),[y,w]=e.useState(!1);if(ct((()=>{if(!o)return;"rtl"===S(o).direction&&w(!0)}),[o]),!o)return null;const[b,E]=r.split("-"),x="top"===b||"bottom"===b;let R=f;(x&&null!=l&&l.x||!x&&null!=l&&l.y)&&(R=null);const C=2*a,O=C/2,L=u/2*(s/-8+1),A=c/2*s/4,k=!!p,T=R&&"end"===E?"bottom":"top";let P=R&&"end"===E?"right":"left";R&&y&&(P="end"===E?"left":"right");const M=null!=(null==i?void 0:i.x)?R||i.x:"",D=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+u+" L"+(u-L)+","+(c-A)+" Q"+u/2+","+c+" "+L+","+(c-A)+" Z",I={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",st({},h,{"aria-hidden":!0,ref:n,width:k?u:u+C,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[P]:M,[T]:D,[b]:x||k?"100%":"calc(100% - "+C/2+"px)",transform:[I,m].filter((e=>!!e)).join(" "),...v}}),C>0&&e.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:C+(p?0:1),d:N}),e.createElement("path",{stroke:C&&!p?h.fill:"none",d:N}),e.createElement("clipPath",{id:g},e.createElement("rect",{x:-O,y:O*(k?-1:1),width:u+C,height:u})))}));const ht=e.createContext(null),gt=e.createContext(null),yt=()=>{var t;return(null==(t=e.useContext(ht))?void 0:t.id)||null},wt=()=>e.useContext(gt);function bt(e){return"data-floating-ui-"+e}function Et(e){const t=i(e);return ct((()=>{t.current=e})),t}const xt=bt("safe-polygon");function Rt(e,t,n){return n&&!W(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,At=new WeakSet,kt={},Tt=0;const Pt=e=>e&&(e.host||Pt(e.parentNode));function Mt(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=Pt(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];kt[o]||(kt[o]=new WeakMap);const f=kt[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&&At.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Tt++,()=>{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||(!At.has(e)&&i&&e.removeAttribute(i),At.delete(e)),n||e.removeAttribute(o)})),Tt--,Tt||(Lt=new WeakMap,Lt=new WeakMap,At=new WeakSet,kt={})}}function Dt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=B(e[0]).body;return Mt(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 It(e,t){const n=Se(e,Nt());"prev"===t&&n.reverse();const r=n.indexOf(M(B(e)));return n.slice(r+1)[0]}function Ft(){return It(document.body,"next")}function jt(){return It(document.body,"prev")}function Wt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!D(n,r)}function Bt(e){Se(e,Nt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ht(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&&!g(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&&!g(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,h=!!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&&Wt(e)){("focusin"===e.type?Ht:Bt)(l)}}}),[l,i,m]),e.useEffect((()=>{l&&(v||Ht(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])},h&&l&&e.createElement(qt,{"data-type":"outside",ref:a,onFocus:e=>{if(Wt(e,l)){var t;null==(t=d.current)||t.focus()}else{const e=jt()||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),h&&l&&e.createElement("span",{"aria-owns":l.id,style:Vt}),l&&c.createPortal(n,l),h&&l&&e.createElement(qt,{"data-type":"outside",ref:f,onFocus:e=>{if(Wt(e,l)){var t;null==(t=p.current)||t.focus()}else{const t=Ft()||(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:h,onOpenChange:g,events:w,dataRef:b,elements:{domReference:E,floating:x}}=n,R="number"==typeof u&&u<0,C=q(E)&&R,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,S=!O||l,L=!S||O&&p,A=Et(i),k=Et(u),T=Et(c),P=wt(),N=Ut(),I=e.useRef(null),W=e.useRef(null),H=e.useRef(!1),K=e.useRef(!1),X=e.useRef(-1),U=null!=N,Y=($=x)?$.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 A.current.map((e=>E&&"reference"===e?E:Y&&"floating"===e?Y:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!a)return;function e(e){if("Tab"===e.key){D(Y,M(B(Y)))&&0===z().length&&!C&&_(e);const t=Z(),n=V(e);"reference"===A.current[0]&&n===E&&(_(e),e.shiftKey?Ot(t[t.length-1]):Ot(t[1])),"floating"===A.current[1]&&n===Y&&e.shiftKey&&(_(e),Ot(t[0]))}}const t=B(Y);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,Y,a,A,C,z,Z]),e.useEffect((()=>{if(!o&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=V(e),n=z().indexOf(t);-1!==n&&(X.current=n)}}),[o,x,z]),e.useEffect((()=>{if(!o&&d)return x&&y(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(D(E,t)||D(x,t)||D(t,x)||D(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(bt("focus-guard"))||P&&(St(P.nodesRef.current,h).find((e=>{var n,r;return D(null==(n=e.context)?void 0:n.elements.floating,t)||D(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}(P.nodesRef.current,h).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&&M(B(Y))===B(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()||(H.current=!0,g(!1,e,"focus-out"))}))}}),[o,E,x,Y,a,h,P,N,g,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?I:W,onClick:e=>g(!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(x){const e=[x,...t,I.current,W.current,G.current,Q.current,null==N?void 0:N.beforeOutsideRef.current,null==N?void 0:N.afterOutsideRef.current,A.current.includes("reference")||C?E:null].filter((e=>null!=e)),n=a||C?Dt(e,!L,L):Dt(e);return()=>{n()}}}),[o,E,x,a,A,N,C,S,L]),ct((()=>{if(o||!y(Y))return;const e=M(B(Y));queueMicrotask((()=>{const t=Z(Y),n=k.current,r=("number"==typeof n?t[n]:n.current)||Y,o=D(Y,e);R||o||!m||Ot(r,{preventScroll:r===Y})}))}),[o,m,Y,R,Z,k]),ct((()=>{if(o||!Y)return;let e=!1;const t=B(Y),n=M(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&&(H.current=!0),"outside-press"===o&&(l?(H.current=!1,e=!0):H.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(j()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||F(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&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=M(t),o=D(x,n)||P&&St(P.nodesRef.current,h).some((e=>{var t;return D(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 T.current?Zt()||l:T.current.current||l;queueMicrotask((()=>{const r=Gt(u);T.current&&!H.current&&y(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,x,Y,T,b,v,w,P,h,U,E]),e.useEffect((()=>{queueMicrotask((()=>{H.current=!1}))}),[o]),ct((()=>{if(!o&&N)return N.setFocusManagerState({modal:a,closeOnFocusOut:d,open:m,onOpenChange:g,refs:v}),()=>{N.setFocusManagerState(null)}}),[o,N,a,m,g,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=M(B(x)),r=t.indexOf(n);-1!==r&&(X.current=r),A.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,x,Y,v,A,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(H.current=!1,Wt(e,N.portalNode)){const e=Ft()||E;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&&(H.current=!0),Wt(e,N.portalNode)){const e=jt()||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=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[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),E=e.useCallback((e=>{e!==O.current&&(O.current=e,w(e))}),[]),x=l||h,R=u||y,C=e.useRef(null),O=e.useRef(null),S=e.useRef(d),L=null!=a,A=nt(a),k=nt(i),T=nt(f),P=e.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:n,strategy:r,middleware:m};k.current&&(e.platform=k.current),Ge(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!1!==T.current};M.current&&!Je(S.current,t)&&(S.current=t,c.flushSync((()=>{p(t)})))}))}),[m,n,r,k,T]);Qe((()=>{!1===f&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Qe((()=>(M.current=!0,()=>{M.current=!1})),[]),Qe((()=>{if(x&&(C.current=x),R&&(O.current=R),x&&R){if(A.current)return A.current(x,R,P);P()}}),[x,R,P,A,L]);const D=e.useMemo((()=>({reference:C,floating:O,setReference:b,setFloating:E})),[b,E]),N=e.useMemo((()=>({reference:x,floating:R})),[x,R]),I=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:P,refs:D,elements:N,floatingStyles:I})),[d,P,D,N,I])}({...t,elements:{...i,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=g(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),m.refs.setReference(t)}),[m.refs]),h=e.useCallback((e=>{(g(e)||null===e)&&(d.current=e,u(e)),(g(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!g(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:h,setPositionReference:v,domReference:d})),[m.refs,h,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,h=wt(),w=ut("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,E=e.useRef(!1),x=e.useRef(!1),{escapeKey:R,outsidePress:L}=on(m),{escapeKey:k,outsidePress:P}=on(v),M=e.useRef(!1),N=ut((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(M.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=h?St(h.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")})),I=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)})),F=ut((e=>{var t;const n=E.current;E.current=!1;const r=x.current;if(x.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const u=V(e),c="["+bt("inert")+"]",s=B(i.floating).querySelectorAll(c);let f=g(u)?u:null;for(;f&&!O(f);){const e=A(f);if(O(e)||!g(e))break;f=e}if(s.length&&g(u)&&!u.matches("html,body")&&!D(u,i.floating)&&Array.from(s).every((e=>!D(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=h&&St(h.nodesRef.current,d).some((t=>{var n;return H(e,null==(n=t.context)?void 0:n.elements.floating)}));if(H(e,i.floating)||H(e,i.domReference)||p)return;const m=h?St(h.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")})),j=ut((e=>{var t;const n=()=>{var t;F(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),M.current=!0}function s(){e=window.setTimeout((()=>{M.current=!1}),C()?5:0)}const f=B(i.floating);c&&(f.addEventListener("keydown",k?I:N,k),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),b&&f.addEventListener(a,P?j:F,P);let d=[];return p&&(g(i.domReference)&&(d=T(i.domReference)),g(i.floating)&&(d=d.concat(T(i.floating))),!g(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(T(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",k?I:N,k),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),b&&f.removeEventListener(a,P?j:F,P),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,b,a,r,o,p,u,R,L,N,k,I,F,P,j]),e.useEffect((()=>{E.current=!1}),[b,a]);const W=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(){x.current=!0},onMouseUp(){x.current=!0},[rn[a]]:()=>{E.current=!0}})),[N,a]);return e.useMemo((()=>u?{reference:W,floating:_}:{}),[u,W,_])},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(),h=Et(a),y=Et(s),w=Et(r),b=e.useRef(),E=e.useRef(-1),x=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),O=e.useRef(!1),S=e.useRef((()=>{})),L=e.useRef(!1),A=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(E.current),clearTimeout(R.current),C.current=!0,L.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!h.current)return;if(!r)return;function e(e){A()&&o(!1,e,"hover")}const t=B(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,h,A]);const k=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&&!x.current?(clearTimeout(E.current),E.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(E.current),o(!1,e,n))}),[y,o]),T=ut((()=>{S.current(),x.current=void 0})),P=ut((()=>{if(O.current){const e=B(u.floating).body;e.style.pointerEvents="",e.removeAttribute(xt),O.current=!1}})),M=ut((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&g(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(E.current),C.current=!1,f&&!W(b.current)||d>0&&!Rt(y.current,"open"))return;const t=Rt(y.current,"open",b.current);t?E.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;S.current();const t=B(u.floating);if(clearTimeout(R.current),L.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(E.current),x.current=h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){P(),T(),M()||k(e,!0,"safe-polygon")}});const n=x.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!D(u.floating,e.relatedTarget))&&k(e)}function l(e){M()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){P(),T(),M()||k(e)}})(e))}}),[u,c,t,f,d,p,k,T,P,o,r,w,m,y,h,i,M]),ct((()=>{var e;if(c&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&A()){O.current=!0;const e=u.floating;if(g(u.domReference)&&e){var t;const n=B(u.floating).body;n.setAttribute(xt,"");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,h,A]),ct((()=>{r||(b.current=void 0,L.current=!1,T(),P())}),[r,T,P]),e.useEffect((()=>()=>{T(),clearTimeout(E.current),clearTimeout(R.current),P()}),[c,u.domReference,T,P]);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&&!W(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]),I=e.useMemo((()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(e){M()||k(e.nativeEvent,!1)}})),[k,M]);return e.useMemo((()=>c?{reference:N,floating:I}:{}),[c,N,I])},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="AlertDialog",pn=function(e){var n=e.children,r=e.customRootClass,o=void 0===r?"":r,i=e.open,u=e.onOpenChange,c=e.onClickOutside,a=void 0===c?function(){}:c,d=fn.useFloating().context,p=function(e,t){if(void 0===e&&(e=""),e)return e;var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(o,dn),m=l(i),v=m[0],h=m[1],g={isOpen:v,handleOpenChange:function(e){h(e),u(e)},floaterContext:d,rootClass:p,handleOverlayClick:function(){a()}};return t.createElement(s.Provider,{value:g},t.createElement("div",{className:f(p)},n))};pn.displayName=dn;var mn=function(e){var n=e.children,r=u(s),o=r.isOpen,i=r.rootClass;return t.createElement(t.Fragment,null,o&&t.createElement("div",{className:f("".concat(i,"-content"))},n))},vn=function(){return vn=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},vn.apply(this,arguments)};function hn(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 gn=["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=hn(n,["asChild","children"]);return i&&t.isValidElement(l)?t.cloneElement(l,vn(vn({},u),{ref:r})):t.createElement(e,vn(vn({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),yn=function(e){var n=e.role,r=void 0===n?"button":n,o=e.label,i=void 0===o?"":o,l=e.description,u=void 0===l?"":l,c=e.disabled,s=void 0!==c&&c,a=e.children,f=hn(e,["role","label","description","disabled","children"]);return i&&(f["aria-label"]=i),u&&(f["aria-description"]=u),s&&(f["aria-disabled"]="true",u||(f["aria-description"]="Disabled Button")),t.createElement(gn.button,vn({role:r,disabled:s},f),a)},wn=function(e){var n=e.children,r=hn(e,["children"]),o=u(s);o.isOpen;var i=o.handleOpenChange;return o.floaterContext,t.createElement(yn,vn({onClick:function(){return i(!0)}},r),n)},bn=function(e){var n=e.children,r=u(s).rootClass,o=document.getElementsByClassName(r)[0];return t.createElement(fn.Portal,{root:o||document.body},n)},En=function(){var e=u(s),n=e.isOpen,r=e.rootClass,o=e.handleOverlayClick;return t.createElement(t.Fragment,null,n&&t.createElement(fn.Overlay,{className:f("".concat(r,"-overlay")),onClick:o}))},xn=function(e){var n=e.children,r=u(s).handleOpenChange;return t.createElement(yn,{onClick:function(){return r(!1)}},n)},Rn=function(e){var n=e.children,r=u(s).handleOpenChange;return t.createElement(yn,{onClick:function(){return r(!1)}},n)},Cn=function(e){var n=e.children,r=e.open,o=void 0!==r&&r,i=e.onOpenChange,u=e.content,c=l(o),s=c[0];return c[1],t.createElement(pn,{open:s,onOpenChange:i},t.createElement(wn,null,n),t.createElement(bn,null,t.createElement(En,null),t.createElement(mn,null,u,t.createElement(xn,null,"Cancel"),t.createElement(Rn,null,"Action"))))};export{Cn as default};
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 c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}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))},he=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},ge=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},Ee=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,c=de(e);if(l&&!l.shadowRoot&&!0===r(l))return be(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.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,c=!1;if(i&&i!==e)for(c=!!(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));!c&&l;){var u,s,a;c=!(null===(s=l=null===(u=i=de(l))||void 0===u?void 0:u.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},xe=function(e,t){return!(t.disabled||pe(t)||function(e){return ye(e)&&"hidden"===e.type}(t)||Ee(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)||he(t)<0||!xe(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,c=function(e,t){var n=he(e);return n<0&&t&&!ve(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(ge).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),c=ne(l),u=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[c]/2-o[c]/2;let p;switch(u){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 ke(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Q(t,e),m=ce(p),v=c[d?"floating"===f?"reference":"floating":f],h=ue(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(c.floating)),boundary:s,rootBoundary:a,strategy:u})),g="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(c.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=ue(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.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 Te(e){return K.some((t=>e[t]>=0))}function Pe(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,c=Y(n)!==i||Y(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Me(e){return g(e)?e:e.contextElement}function Ne(e){const t=Me(e);if(!y(t))return $(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pe(t);let l=(i?Y(n.width):n.width)/r,c=(i?Y(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const De=$(0);function Ie(e){const t=m(e);return C()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:De}function Fe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Me(e);let l=$(1);t&&(r?g(r)&&(l=Ne(r)):l=Ne(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==m(e))&&t}(i,n,r)?Ie(i):$(0);let u=(o.left+c.x)/l.x,s=(o.top+c.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=m(i),t=r&&g(r)?m(r):r;let n=e,o=P(n);for(;o&&r&&t!==n;){const e=Ne(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;u*=e.x,s*=e.y,a*=e.x,f*=e.y,u+=i,s+=l,n=m(o),o=P(n)}}return ue({width:a,height:f,x:u,y:s})}function je(e,t){const n=L(e).scrollLeft;return t?t.left+n:Fe(v(e)).left+n}function We(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:je(e,r)),y:r.top+t.scrollTop}}function Be(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,c=0,u=0;if(o){i=o.width,l=o.height;const e=C();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(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+je(e);const c=-n.scrollTop;return"rtl"===S(r).direction&&(l+=U(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(v(e));else if(g(t))r=function(e,t){const n=Fe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=y(e)?Ne(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=Ie(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ue(r)}function He(e,t){const n=k(e);return!(n===t||!g(n)||O(n))&&("fixed"===S(n).position||He(n,t))}function Ve(e,t,n){const r=y(t),o=v(t),i="fixed"===n,l=Fe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=$(0);if(r||!r&&!i)if(("body"!==p(t)||b(o))&&(c=L(t)),r){const e=Fe(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=je(o));const s=!o||r||i?$(0):We(o,c);return{x:l.left+c.scrollLeft-u.x-s.x,y:l.top+c.scrollTop-u.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(x(e))return n;if(!y(e)){let t=k(e);for(;t&&!O(t);){if(g(t)&&!_e(t))return t;t=k(t)}return n}let r=qe(e,t);for(;r&&E(r)&&_e(r);)r=qe(r,t);return r&&O(r)&&_e(r)&&!R(r)?n:r||function(e){let t=k(e);for(;y(t)&&!O(t);){if(R(t))return t;if(x(t))return null;t=k(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),c=!!t&&x(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},s=$(1);const a=$(0),f=y(r);if((f||!f&&!i)&&(("body"!==p(r)||b(l))&&(u=L(r)),y(r))){const e=Fe(r);s=Ne(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?$(0):We(l,u,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-u.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?x(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=T(e,[],!1).filter((e=>g(e)&&"body"!==p(e))),o=null;const i="fixed"===S(e).position;let l=i?k(e):e;for(;g(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&&He(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],c=i.reduce(((e,n)=>{const r=Be(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}),Be(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.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}=Pe(e);return{width:t,height:n}},getScale:Ne,isElement:g,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:c}=t,u=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),c=ee(n),u="y"===re(n),s=["left","top"].includes(l)?-1:1,a=i&&u?-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 c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,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:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=Q(e,t),s={x:n,y:r},a=await ke(t,u),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=c.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:c,platform:u,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=Q(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=J(o),y=re(c),w=J(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(s.floating)),E=d||(w||!v?[le(c)]:function(e){const t=le(e);return[ie(e),t,ie(t)]}(c)),x="none"!==m;!d&&x&&E.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}(c,v,m,b));const R=[c,...E],C=await ke(t,h),O=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&O.push(C[g]),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,k;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==(k=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=S.filter((e=>{if(x){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=c}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 ke(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Te(e)}}}case"escaped":{const e=Ae(await ke(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Te(e)}}}default:return{}}}}},Ze=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:s,padding:a=0}=Q(e,t)||{};if(null==s)return{};const f=ce(a),d={x:n,y:r},p=oe(o),m=ne(p),v=await l.getDimensions(s),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],E=d[p]-i.reference[p],x=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=x?x[w]:0;R&&await(null==l.isElement?void 0:l.isElement(x))||(R=c.floating[w]||i.floating[m]);const C=b/2-E/2,O=R/2-v[m]/2-1,S=X(f[g],O),L=X(f[y],O),k=S,A=R-v[m]-L,T=R/2-v[m]/2+C,P=G(k,T,A),M=!u.arrow&&null!=ee(o)&&T!==P&&i.reference[m]/2-(T<k?S:L)-v[m]/2<0,N=M?T<k?T-k:T-A:0;return{[p]:d[p]+N,data:{[p]:P,centerOffset:T-P-N,...M&&{alignmentOffset:N}},reset:M}}}),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,c=i.filter(Boolean),u=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,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,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!=h?h: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 l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Le(s,d,u))),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 ct(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 ut="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 ut((()=>{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:c=14,height:u=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...h}=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 g=pt(),[y,w]=e.useState(!1);if(ut((()=>{if(!o)return;"rtl"===S(o).direction&&w(!0)}),[o]),!o)return null;const[b,E]=r.split("-"),x="top"===b||"bottom"===b;let R=f;(x&&null!=l&&l.x||!x&&null!=l&&l.y)&&(R=null);const C=2*a,O=C/2,L=c/2*(s/-8+1),k=u/2*s/4,A=!!p,T=R&&"end"===E?"bottom":"top";let P=R&&"end"===E?"right":"left";R&&y&&(P="end"===E?"left":"right");const M=null!=(null==i?void 0:i.x)?R||i.x:"",N=null!=(null==i?void 0:i.y)?R||i.y:"",D=p||"M0,0 H"+c+" L"+(c-L)+","+(u-k)+" Q"+c/2+","+u+" "+L+","+(u-k)+" Z",I={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({},h,{"aria-hidden":!0,ref:n,width:A?c:c+C,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[P]:M,[T]:N,[b]:x||A?"100%":"calc(100% - "+C/2+"px)",transform:[I,m].filter((e=>!!e)).join(" "),...v}}),C>0&&e.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:C+(p?0:1),d:D}),e.createElement("path",{stroke:C&&!p?h.fill:"none",d:D}),e.createElement("clipPath",{id:g},e.createElement("rect",{x:-O,y:O*(A?-1:1),width:c+C,height:c})))}));const ht=e.createContext(null),gt=e.createContext(null),yt=()=>{var t;return(null==(t=e.useContext(ht))?void 0:t.id)||null},wt=()=>e.useContext(gt);function bt(e){return"data-floating-ui-"+e}function Et(e){const t=i(e);return ut((()=>{t.current=e})),t}const xt=bt("safe-polygon");function Rt(e,t,n){return n&&!W(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,kt=new WeakSet,At={},Tt=0;const Pt=e=>e&&(e.host||Pt(e.parentNode));function Mt(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(c=t,e.map((e=>{if(c.contains(e))return e;const t=Pt(e);return c.contains(t)?t:null})).filter((e=>null!=e)));var c;const u=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||u.has(t))return;u.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(u.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&&kt.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),u.clear(),Tt++,()=>{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||(!kt.has(e)&&i&&e.removeAttribute(i),kt.delete(e)),n||e.removeAttribute(o)})),Tt--,Tt||(Lt=new WeakMap,Lt=new WeakMap,kt=new WeakSet,At={})}}function Nt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=B(e[0]).body;return Mt(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Dt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function It(e,t){const n=Se(e,Dt());"prev"===t&&n.reverse();const r=n.indexOf(M(B(e)));return n.slice(r+1)[0]}function Ft(){return It(document.body,"next")}function jt(){return It(document.body,"prev")}function Wt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!N(n,r)}function Bt(e){Se(e,Dt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Ht(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();ut((()=>(/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=Dt();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 ut((()=>{if(r)return Jt++,1===Jt&&(en=function(){const e=/iP(hone|ad|od)|iOS/.test(D()),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,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(c=window.visualViewport)?void 0:c.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({}),[c]=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)))||[])}}}())),u=null!=yt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!g(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=ct(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),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:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}const cn="active",un="selected";function sn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[cn]:t,[un]: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&&[cn,un].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,c]=e.useState(null),u=e.useRef(null);return ut((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),ut((()=>{if(!o)return;if(u.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),u.current=t,c(t)}),[n,o]),ut((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!g(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),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[c,s]=e.useState(null),a=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==c?void 0:c.modal,v=null==c?void 0:c.open,h=!!c&&!c.modal&&c.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&&Wt(e)){("focusin"===e.type?Ht:Bt)(l)}}}),[l,i,m]),e.useEffect((()=>{l&&(v||Ht(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])},h&&l&&e.createElement(qt,{"data-type":"outside",ref:a,onFocus:e=>{if(Wt(e,l)){var t;null==(t=d.current)||t.focus()}else{const e=jt()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),h&&l&&e.createElement("span",{"aria-owns":l.id,style:Vt}),l&&u.createPortal(n,l),h&&l&&e.createElement(qt,{"data-type":"outside",ref:f,onFocus:e=>{if(Wt(e,l)){var t;null==(t=p.current)||t.focus()}else{const t=Ft()||(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"))}}}))},Overlay:tn,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:c=0,returnFocus:u=!0,restoreFocus:s=!1,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0,outsideElementsInert:p=!1}=t,{open:m,refs:v,nodeId:h,onOpenChange:g,events:w,dataRef:b,elements:{domReference:E,floating:x}}=n,R="number"==typeof c&&c<0,C=q(E)&&R,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,S=!O||l,L=!S||O&&p,k=Et(i),A=Et(c),T=Et(u),P=wt(),D=Ut(),I=e.useRef(null),W=e.useRef(null),H=e.useRef(!1),K=e.useRef(!1),X=e.useRef(-1),U=null!=D,Y=($=x)?$.hasAttribute(Yt)?$:$.querySelector("["+Yt+"]")||$:null;var $;const z=ct((function(e){return void 0===e&&(e=Y),e?Se(e,Dt()):[]})),Z=ct((e=>{const t=z(e);return k.current.map((e=>E&&"reference"===e?E:Y&&"floating"===e?Y:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!a)return;function e(e){if("Tab"===e.key){N(Y,M(B(Y)))&&0===z().length&&!C&&_(e);const t=Z(),n=V(e);"reference"===k.current[0]&&n===E&&(_(e),e.shiftKey?Ot(t[t.length-1]):Ot(t[1])),"floating"===k.current[1]&&n===Y&&e.shiftKey&&(_(e),Ot(t[0]))}}const t=B(Y);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,E,Y,a,k,C,z,Z]),e.useEffect((()=>{if(!o&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=V(e),n=z().indexOf(t);-1!==n&&(X.current=n)}}),[o,x,z]),e.useEffect((()=>{if(!o&&d)return x&&y(E)?(E.addEventListener("focusout",t),E.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{E.removeEventListener("focusout",t),E.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(N(E,t)||N(x,t)||N(t,x)||N(null==D?void 0:D.portalNode,t)||null!=t&&t.hasAttribute(bt("focus-guard"))||P&&(St(P.nodesRef.current,h).find((e=>{var n,r;return N(null==(n=e.context)?void 0:n.elements.floating,t)||N(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}(P.nodesRef.current,h).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&&M(B(Y))===B(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()||(H.current=!0,g(!1,e,"focus-out"))}))}}),[o,E,x,Y,a,h,P,D,g,d,s,z,C]);const G=e.useRef(null),Q=e.useRef(null),J=ot([G,null==D?void 0:D.beforeInsideRef]),ee=ot([Q,null==D?void 0:D.afterInsideRef]);function te(t){return!o&&f&&a?e.createElement(Qt,{ref:"start"===t?I:W,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==D||null==(e=D.portalNode)?void 0:e.querySelectorAll("["+bt("portal")+"]"))||[]);if(x){const e=[x,...t,I.current,W.current,G.current,Q.current,null==D?void 0:D.beforeOutsideRef.current,null==D?void 0:D.afterOutsideRef.current,k.current.includes("reference")||C?E:null].filter((e=>null!=e)),n=a||C?Nt(e,!L,L):Nt(e);return()=>{n()}}}),[o,E,x,a,k,D,C,S,L]),ut((()=>{if(o||!y(Y))return;const e=M(B(Y));queueMicrotask((()=>{const t=Z(Y),n=A.current,r=("number"==typeof n?t[n]:n.current)||Y,o=N(Y,e);R||o||!m||Ot(r,{preventScroll:r===Y})}))}),[o,m,Y,R,Z,A]),ut((()=>{if(o||!Y)return;let e=!1;const t=B(Y),n=M(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&&(H.current=!0),"outside-press"===o&&(l?(H.current=!1,e=!0):H.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(j()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||F(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&&E&&E.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=M(t),o=N(x,n)||P&&St(P.nodesRef.current,h).some((e=>{var t;return N(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 c="boolean"==typeof T.current?Zt()||l:T.current.current||l;queueMicrotask((()=>{const r=Gt(c);T.current&&!H.current&&y(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,x,Y,T,b,v,w,P,h,U,E]),e.useEffect((()=>{queueMicrotask((()=>{H.current=!1}))}),[o]),ut((()=>{if(!o&&D)return D.setFocusManagerState({modal:a,closeOnFocusOut:d,open:m,onOpenChange:g,refs:v}),()=>{D.setFocusManagerState(null)}}),[o,D,a,m,g,v,d]),ut((()=>{if(o)return;if(!Y)return;if("function"!=typeof MutationObserver)return;if(R)return;const e=()=>{const e=Y.getAttribute("tabindex"),t=z(),n=M(B(x)),r=t.indexOf(n);-1!==r&&(X.current=r),k.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,x,Y,v,k,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!=D&&D.preserveTabOrder&&D.portalNode)if(H.current=!1,Wt(e,D.portalNode)){const e=Ft()||E;null==e||e.focus()}else{var t;null==(t=D.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!=D&&D.preserveTabOrder&&D.portalNode)if(d&&(H.current=!0),Wt(e,D.portalNode)){const e=jt()||E;null==e||e.focus()}else{var t;null==(t=D.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,c]=e.useState(null),[s,a]=e.useState(null),f=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=wt();ut((()=>{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: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,v]=e.useState(o);Je(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),E=e.useCallback((e=>{e!==O.current&&(O.current=e,w(e))}),[]),x=l||h,R=c||y,C=e.useRef(null),O=e.useRef(null),S=e.useRef(d),L=null!=a,k=nt(a),A=nt(i),T=nt(f),P=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!==T.current};M.current&&!Je(S.current,t)&&(S.current=t,u.flushSync((()=>{p(t)})))}))}),[m,n,r,A,T]);Qe((()=>{!1===f&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Qe((()=>(M.current=!0,()=>{M.current=!1})),[]),Qe((()=>{if(x&&(C.current=x),R&&(O.current=R),x&&R){if(k.current)return k.current(x,R,P);P()}}),[x,R,P,k,L]);const N=e.useMemo((()=>({reference:C,floating:O,setReference:b,setFloating:E})),[b,E]),D=e.useMemo((()=>({reference:x,floating:R})),[x,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=tt(D.floating,d.x),n=tt(D.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...et(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:P,refs:N,elements:D,floatingStyles:I})),[d,P,N,D,I])}({...t,elements:{...i,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=g(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),m.refs.setReference(t)}),[m.refs]),h=e.useCallback((e=>{(g(e)||null===e)&&(d.current=e,c(e)),(g(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!g(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:h,setPositionReference:v,domReference:d})),[m.refs,h,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 ut((()=>{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:c="dialog"}=n,u=null!=(r=an.get(c))?r:c,s=pt(),a=null!=yt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:s},..."menu"===u&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,a,o,s,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":s}}}),[u,i,s,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);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),c=e.useCallback((e=>sn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,h=wt(),w=ct("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,E=e.useRef(!1),x=e.useRef(!1),{escapeKey:R,outsidePress:L}=on(m),{escapeKey:A,outsidePress:P}=on(v),M=e.useRef(!1),D=ct((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(M.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=h?St(h.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")})),I=ct((e=>{var t;const n=()=>{var t;D(e),null==(t=V(e))||t.removeEventListener("keydown",n)};null==(t=V(e))||t.addEventListener("keydown",n)})),F=ct((e=>{var t;const n=E.current;E.current=!1;const r=x.current;if(x.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=V(e),u="["+bt("inert")+"]",s=B(i.floating).querySelectorAll(u);let f=g(c)?c:null;for(;f&&!O(f);){const e=k(f);if(O(e)||!g(e))break;f=e}if(s.length&&g(c)&&!c.matches("html,body")&&!N(c,i.floating)&&Array.from(s).every((e=>!N(f,e))))return;if(y(c)&&_){const t=O(c),n=S(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,s="rtl"===n.direction,a=u&&(s?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=h&&St(h.nodesRef.current,d).some((t=>{var n;return H(e,null==(n=t.context)?void 0:n.elements.floating)}));if(H(e,i.floating)||H(e,i.domReference)||p)return;const m=h?St(h.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")})),j=ct((e=>{var t;const n=()=>{var t;F(e),null==(t=V(e))||t.removeEventListener(a,n)};null==(t=V(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!c)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),M.current=!0}function s(){e=window.setTimeout((()=>{M.current=!1}),C()?5:0)}const f=B(i.floating);u&&(f.addEventListener("keydown",A?I:D,A),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),b&&f.addEventListener(a,P?j:F,P);let d=[];return p&&(g(i.domReference)&&(d=T(i.domReference)),g(i.floating)&&(d=d.concat(T(i.floating))),!g(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(T(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})})),()=>{u&&(f.removeEventListener("keydown",A?I:D,A),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),b&&f.removeEventListener(a,P?j:F,P),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,b,a,r,o,p,c,R,L,D,A,I,F,P,j]),e.useEffect((()=>{E.current=!1}),[b,a]);const W=e.useMemo((()=>({onKeyDown:D,...f&&{[nn[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[D,o,f,d]),_=e.useMemo((()=>({onKeyDown:D,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[rn[a]]:()=>{E.current=!0}})),[D,a]);return e.useMemo((()=>c?{reference:W,floating:_}:{}),[c,W,_])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=wt(),v=yt(),h=Et(a),y=Et(s),w=Et(r),b=e.useRef(),E=e.useRef(-1),x=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),O=e.useRef(!1),S=e.useRef((()=>{})),L=e.useRef(!1),k=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(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(E.current),clearTimeout(R.current),C.current=!0,L.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!h.current)return;if(!r)return;function e(e){k()&&o(!1,e,"hover")}const t=B(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,h,k]);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&&!x.current?(clearTimeout(E.current),E.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(E.current),o(!1,e,n))}),[y,o]),T=ct((()=>{S.current(),x.current=void 0})),P=ct((()=>{if(O.current){const e=B(c.floating).body;e.style.pointerEvents="",e.removeAttribute(xt),O.current=!1}})),M=ct((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&g(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.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=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(E.current),C.current=!1,f&&!W(b.current)||d>0&&!Rt(y.current,"open"))return;const t=Rt(y.current,"open",b.current);t?E.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(M())return;S.current();const t=B(c.floating);if(clearTimeout(R.current),L.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(E.current),x.current=h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){P(),T(),M()||A(e,!0,"safe-polygon")}});const n=x.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!N(c.floating,e.relatedTarget))&&A(e)}function l(e){M()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){P(),T(),M()||A(e)}})(e))}}),[c,u,t,f,d,p,A,T,P,o,r,w,m,y,h,i,M]),ut((()=>{var e;if(u&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&k()){O.current=!0;const e=c.floating;if(g(c.domReference)&&e){var t;const n=B(c.floating).body;n.setAttribute(xt,"");const r=c.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=""}}}}),[u,r,v,c,m,h,k]),ut((()=>{r||(b.current=void 0,L.current=!1,T(),P())}),[r,T,P]),e.useEffect((()=>()=>{T(),clearTimeout(E.current),clearTimeout(R.current),P()}),[u,c.domReference,T,P]);const D=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&&!W(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]),I=e.useMemo((()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(e){M()||A(e.nativeEvent,!1)}})),[A,M]);return e.useMemo((()=>u?{reference:D,floating:I}:{}),[u,D,I])},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="AlertDialog",pn=function(e){var n=e.children,r=e.customRootClass,o=void 0===r?"":r,i=e.open,c=e.onOpenChange,u=e.onClickOutside,a=void 0===u?function(){}:u,d=fn.useFloating().context,p=function(e,t){if(void 0===e&&(e=""),e)return e;var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(o,dn),m=l(i),v=m[0],h=m[1],g={isOpen:v,handleOpenChange:function(e){h(e),c(e)},floaterContext:d,rootClass:p,handleOverlayClick:function(){a()}};return t.createElement(s.Provider,{value:g},t.createElement("div",{className:f(p)},n))};pn.displayName=dn;var mn=function(e){var n=e.children,r=c(s),o=r.isOpen,i=r.rootClass;return t.createElement(t.Fragment,null,o&&t.createElement("div",{className:f("".concat(i,"-content"))},n))},vn=function(){return vn=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},vn.apply(this,arguments)};function hn(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 gn=["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,c=hn(n,["asChild","children"]);return i&&t.isValidElement(l)?t.cloneElement(l,vn(vn({},c),{ref:r})):t.createElement(e,vn(vn({},c),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),yn=function(e){var n=e.role,r=void 0===n?"button":n,o=e.label,i=void 0===o?"":o,l=e.description,c=void 0===l?"":l,u=e.disabled,s=void 0!==u&&u,a=e.children,f=hn(e,["role","label","description","disabled","children"]);return i&&(f["aria-label"]=i),c&&(f["aria-description"]=c),s&&(f["aria-disabled"]="true",c||(f["aria-description"]="Disabled Button")),t.createElement(gn.button,vn({role:r,disabled:s},f),a)},wn=function(e){var n=e.children,r=hn(e,["children"]),o=c(s),i=o.rootClass,l=o.handleOpenChange;return t.createElement(yn,vn({onClick:function(){return l(!0)}},r,{className:f("".concat(i,"-trigger"))}),n)},bn=function(e){var n=e.children,r=c(s).rootClass,o=document.getElementsByClassName(r)[0];return t.createElement(fn.Portal,{root:o||document.body},n)},En=function(){var e=c(s),n=e.isOpen,r=e.rootClass,o=e.handleOverlayClick;return t.createElement(t.Fragment,null,n&&t.createElement(fn.Overlay,{className:f("".concat(r,"-overlay")),onClick:o}))},xn=function(e){var n=e.children,r=c(s),o=r.rootClass,i=r.handleOpenChange;return t.createElement(yn,{onClick:function(){return i(!1)},className:f("".concat(o,"-cancel"))},n)},Rn=function(e){var n=e.children,r=c(s),o=r.rootClass,i=r.handleOpenChange;return t.createElement(yn,{onClick:function(){return i(!1)},className:f("".concat(o,"-action"))},n)},Cn=function(e){var n=e.children,r=e.open,o=void 0!==r&&r,i=e.onOpenChange,c=void 0===i?function(){}:i,u=e.content,s=l(o),a=s[0];return s[1],t.createElement(pn,{open:a,onOpenChange:c},t.createElement(wn,null,n),t.createElement(bn,null,t.createElement(En,null),t.createElement(mn,null,u,t.createElement(xn,null,"Cancel"),t.createElement(Rn,null,"Continue"))))};export{Cn as default};
@@ -1 +1 @@
1
- 'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}"function"==typeof SuppressedError&&SuppressedError;function o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=o(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function n(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}var a="Badge",c=function(o){var c=o.children,l=o.customRootClass,s=o.className,u=o.color,i=t(o,["children","customRootClass","className","color"]),f=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(l,a);return r.createElement("span",e({className:n(f,s),"data-accent-color":null!=u?u:void 0},i),c)};c.displayName=a;var l=function(e){var t=e.children;return r.createElement(r.Fragment,null,t)},s=function(o){var a=o.children,s=o.customRootClass,u=o.className,i=o.color,f=t(o,["children","customRootClass","className","color"]);return r.createElement(c,e({customRootClass:s,className:n(u),color:null!=i?i:void 0},f),r.createElement(l,null,a))};s.Root=c,s.Content=l;export{s as default};
1
+ 'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}"function"==typeof SuppressedError&&SuppressedError;function o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=o(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function n(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}var a="Badge",c=function(o){var c=o.children,l=o.customRootClass,s=o.className,i=o.color,u=t(o,["children","customRootClass","className","color"]),f=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(l,a);return r.createElement("span",e({className:n(f,s),"data-accent-color":null!=i?i:void 0},u),c)};c.displayName=a;var l=function(e){var t=e.children;return r.createElement(r.Fragment,null,t)},s=function(o){var n=o.children,a=o.customRootClass,s=void 0===a?"":a,i=o.className,u=void 0===i?"":i,f=o.color,p=t(o,["children","customRootClass","className","color"]);return r.createElement(c,e({customRootClass:s,className:u,color:null!=f?f:void 0},p),r.createElement(l,null,n))};s.Root=c,s.Content=l;export{s as default};
@@ -1 +1 @@
1
- 'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r){var e,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(o=t(r[e]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}function o(){for(var r,e,o=0,n="",a=arguments.length;o<a;o++)(r=arguments[o])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var n="BlockQuote",a=function(t){var a=t.children,c=t.customRootClass,l=t.className,s=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}(t,["children","customRootClass","className"]),f=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(c,n);return r.createElement("blockquote",e({className:o(f,l)},s),a)};a.displayName=n;export{a as default};
1
+ 'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r){var e,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(o=t(r[e]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}function o(){for(var r,e,o=0,n="",a=arguments.length;o<a;o++)(r=arguments[o])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var n="BlockQuote",a=function(t){var a=t.children,c=t.customRootClass,i=void 0===c?"":c,l=t.className,s=void 0===l?"":l,f=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}(t,["children","customRootClass","className"]),u=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(i,n);return r.createElement("blockquote",e({className:o(u,s)},f),a)};a.displayName=n;export{a 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,n=arguments.length;t<n;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 n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;function n(e){var r,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=n(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function o(){for(var e,r,t=0,o="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=n(e))&&(o&&(o+=" "),o+=r);return o}var a=["div","span","button"].reduce((function(n,o){return n[o]=function(n){var o=e.forwardRef((function(o,a){var i=o.asChild,l=void 0!==i&&i,c=o.children,s=t(o,["asChild","children"]);return l&&e.isValidElement(c)?e.cloneElement(c,r(r({},s),{ref:a})):e.createElement(n,r(r({},s),{ref:a}),c)}));return o.displayName="Primitive.".concat(n),o}(o),n}),{}),i=function(n){var o=n.role,i=void 0===o?"button":o,l=n.label,c=void 0===l?"":l,s=n.description,d=void 0===s?"":s,u=n.disabled,f=void 0!==u&&u,p=n.children,v=t(n,["role","label","description","disabled","children"]);return c&&(v["aria-label"]=c),d&&(v["aria-description"]=d),f&&(v["aria-disabled"]="true",d||(v["aria-description"]="Disabled Button")),e.createElement(a.button,r({role:i,disabled:f},v),p)},l="Button",c=function(n){var a=n.children,c=n.type,s=void 0===c?"button":c,d=n.customRootClass,u=void 0===d?"":d,f=n.className,p=void 0===f?"":f,v=n.variant,b=void 0===v?"":v,y=n.size,m=void 0===y?"":y,h=t(n,["children","type","customRootClass","className","variant","size"]),O=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)}(u,l),g={};return b&&(g["data-button-variant"]=b),m&&(g["data-button-size"]=m),e.createElement(i,r({type:s,className:o(O,p)},g,h),a)};c.displayName=l;export{c as default};
1
+ 'use client';import e from"react";var r=function(){return r=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},r.apply(this,arguments)};function t(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t}"function"==typeof SuppressedError&&SuppressedError;function o(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=o(e[r]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function n(){for(var e,r,t=0,n="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=o(e))&&(n&&(n+=" "),n+=r);return n}var a=["div","span","button"].reduce((function(o,n){return o[n]=function(o){var n=e.forwardRef((function(n,a){var i=n.asChild,l=void 0!==i&&i,c=n.children,d=t(n,["asChild","children"]);return l&&e.isValidElement(c)?e.cloneElement(c,r(r({},d),{ref:a})):e.createElement(o,r(r({},d),{ref:a}),c)}));return n.displayName="Primitive.".concat(o),n}(n),o}),{}),i=function(o){var n=o.role,i=void 0===n?"button":n,l=o.label,c=void 0===l?"":l,d=o.description,s=void 0===d?"":d,u=o.disabled,f=void 0!==u&&u,p=o.children,v=t(o,["role","label","description","disabled","children"]);return c&&(v["aria-label"]=c),s&&(v["aria-description"]=s),f&&(v["aria-disabled"]="true",s||(v["aria-description"]="Disabled Button")),e.createElement(a.button,r({role:i,disabled:f},v),p)},l="Button",c=function(o){var a=o.children,c=o.type,d=void 0===c?"button":c,s=o.customRootClass,u=void 0===s?"":s,f=o.className,p=void 0===f?"":f,v=o.variant,b=void 0===v?"":v,y=o.size,m=void 0===y?"":y,h=o.color,O=void 0===h?"":h,g=t(o,["children","type","customRootClass","className","variant","size","color"]),E=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)}(u,l),j={};return b&&(j["data-button-variant"]=b),m&&(j["data-button-size"]=m),O&&(j["data-accent-color"]=O),e.createElement(i,r({type:d,className:n(E,p)},j,g),a)};c.displayName=l;export{c as default};
@@ -0,0 +1 @@
1
+ 'use client';import e,{createContext as t,useRef as n,useState as r,useContext as a,useEffect as o,useId as l}from"react";function u(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=u(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function c(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=u(e))&&(r&&(r+=" "),r+=t);return r}var i=t({}),s=function(e){return e.querySelectorAll("[data-rad-ui-batch-element]")},d=function(e){var t=null;return e.forEach((function(e){e.hasAttribute("data-rad-ui-focus-element")&&(t=e)})),t},f=function(t){var a=t.children,o=t.customRootClass,l=t["aria-label"],u=n(null),f=function(e,t){if(void 0===e&&(e=""),e)return e;var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(o,"Disclosure"),v=r(null),m=v[0],p=v[1],h=r(null),E=h[0],b=h[1];return e.createElement(i.Provider,{value:{rootClass:f,activeItem:m,setActiveItem:p,disclosureRef:u,focusNextItem:function(){var e=function(e,t){void 0===t&&(t=!1);var n=d(e),r=null==n?void 0:n.nextElementSibling;return r||(t?e[0]:e[e.length-1])}(s(u.current));if(b(e),e){var t=e.querySelector("button");null==t||t.focus()}},focusPrevItem:function(){var e=function(e,t){void 0===t&&(t=!1);var n=d(e),r=null==n?void 0:n.previousElementSibling;return r||(t?e[e.length-1]:e[0])}(s(null==u?void 0:u.current));if(b(e),e){var t=e.querySelector("button");null==t||t.focus()}},focusItem:E,setFocusItem:b}},e.createElement("div",{className:c("".concat(f,"-root")),ref:u,role:"region","aria-label":l,"data-testid":"disclosure-root"},a))},v=function(){return v=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},v.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var m=t({}),p=function(t){var u=t.children,s=t.className,d=void 0===s?"":s,f=t.value,p=n(null),h=a(i),E=h.activeItem,b=h.rootClass,g=h.focusItem,y=r(f),I=y[0],A=y[1],C=r(!1),N=C[0],S=C[1];o((function(){S(E===I)}),[E,I]);var k=l(),w=!1;(null==g?void 0:g.id)==="disclosure-data-item-".concat(k)&&(w=!0);var x=function(){var e=null==p?void 0:p.current;e&&e.setAttribute("data-rad-ui-focus-element","")};return e.createElement(m.Provider,{value:{itemValue:I,setItemValue:A,handleBlurEvent:function(){var e=null==p?void 0:p.current;e&&e.removeAttribute("data-rad-ui-focus-element")},handleClickEvent:function(){x()},handleFocusEvent:function(){x()}}},e.createElement("div",v({className:c("".concat(b,"-item"),d),ref:p,"data-state":N?"open":"closed",id:"disclosure-data-item-".concat(k),role:"region","aria-labelledby":"disclosure-trigger-".concat(k),"aria-expanded":N,"data-rad-ui-batch-element":!0},w?{"data-rad-ui-focus-element":""}:{}),u))},h=function(t){var n=t.children,r=t.className,o=a(i),l=o.activeItem,u=o.setActiveItem,s=o.rootClass,d=o.focusNextItem,f=o.focusPrevItem,v=a(m),p=v.itemValue,h=v.handleBlurEvent,E=v.handleClickEvent,b=v.handleFocusEvent;return e.createElement("button",{type:"button",className:c("".concat(s,"-trigger"),r),onClick:function(){u(l===p?null:p),E()},onBlur:h,onFocus:function(){b()},onKeyDown:function(e){"ArrowDown"===e.key&&(e.preventDefault(),d()),"ArrowUp"===e.key&&(e.preventDefault(),f())},"aria-expanded":l===p,"aria-haspopup":"true"},n)},E=function(t){var n=t.children,r=t.className,o=void 0===r?"":r,l=a(i),u=l.activeItem,s=l.rootClass,d=a(m).itemValue;return e.createElement("div",{className:c("".concat(s,"-content"),o),hidden:u!==d,role:"region","aria-hidden":u!==d},n)},b=function(t){var n=t.items;return e.createElement(f,null,n.map((function(t,n){return e.createElement(p,{key:n,value:n},e.createElement(h,null,t.title),e.createElement(E,null,t.content))})))};b.Root=f,b.Item=p,b.Trigger=h,b.Content=E;export{b as default};