@radui/ui 0.0.23 → 0.0.25

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,{useLayoutEffect as n,useEffect as r,useRef as o}from"react";import*as i from"react-dom";function l(e){return s(e)?(e.nodeName||"").toLowerCase():"#document"}function u(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function c(e){var t;return null==(t=(s(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function s(e){return e instanceof Node||e instanceof u(e).Node}function a(e){return e instanceof Element||e instanceof u(e).Element}function f(e){return e instanceof HTMLElement||e instanceof u(e).HTMLElement}function d(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof u(e).ShadowRoot)}function p(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=w(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function m(e){return["table","td","th"].includes(l(e))}function h(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function v(e){const t=g(),n=a(e)?w(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 g(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function y(e){return["html","body","#document"].includes(l(e))}function w(e){return u(e).getComputedStyle(e)}function b(e){return a(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function x(e){if("html"===l(e))return e;const t=e.assignedSlot||e.parentNode||d(e)&&e.host||c(e);return d(t)?t.host:t}function E(e){const t=x(e);return y(t)?e.ownerDocument?e.ownerDocument.body:e.body:f(t)&&p(t)?t:E(t)}function R(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=E(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=u(o);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(l);return t.concat(l,l.visualViewport||[],p(o)?o:[],e&&n?R(e):[])}return t.concat(o,R(o,[],n))}function S(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 C(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&d(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function O(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function T(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function N(e){return!T().includes("jsdom/")&&(!L()&&0===e.width&&0===e.height||L()&&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 L(){const e=/android/i;return e.test(O())||e.test(T())}function A(e){return(null==e?void 0:e.ownerDocument)||document}function k(e){return"composedPath"in e?e.composedPath()[0]:e.target}const M="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function I(e){e.preventDefault(),e.stopPropagation()}function D(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return f(e)&&e.matches(M)}(e))}const F=Math.min,P=Math.max,W=Math.round,j=e=>({x:e,y:e});function V(e){return e.split("-")[0]}function B(e){return["top","bottom"].includes(V(e))?"y":"x"}function H(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}
1
+ 'use client';import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o}from"react";import*as i from"react-dom";function l(){return"undefined"!=typeof window}function u(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function c(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function s(e){var t;return null==(t=(a(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function a(e){return!!l()&&(e instanceof Node||e instanceof c(e).Node)}function f(e){return!!l()&&(e instanceof Element||e instanceof c(e).Element)}function d(e){return!!l()&&(e instanceof HTMLElement||e instanceof c(e).HTMLElement)}function p(e){return!(!l()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof c(e).ShadowRoot)}function m(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=b(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function h(e){return["table","td","th"].includes(u(e))}function v(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function g(e){const t=y(),n=f(e)?b(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function y(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function w(e){return["html","body","#document"].includes(u(e))}function b(e){return c(e).getComputedStyle(e)}function x(e){return f(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function E(e){if("html"===u(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||s(e);return p(t)?t.host:t}function R(e){const t=E(e);return w(t)?e.ownerDocument?e.ownerDocument.body:e.body:d(t)&&m(t)?t:R(t)}function S(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=R(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=c(o);if(i){const e=C(l);return t.concat(l,l.visualViewport||[],m(o)?o:[],e&&n?S(e):[])}return t.concat(o,S(o,[],n))}function C(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function T(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function O(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&p(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function A(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function L(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function N(e){return!L().includes("jsdom/")&&(!k()&&0===e.width&&0===e.height||k()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function k(){const e=/android/i;return e.test(A())||e.test(L())}function M(e){return(null==e?void 0:e.ownerDocument)||document}function I(e){return"composedPath"in e?e.composedPath()[0]:e.target}function D(e){e.preventDefault(),e.stopPropagation()}function F(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return d(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}const P=Math.min,j=Math.max,W=Math.round,V=e=>({x:e,y:e});function B(e){return e.split("-")[0]}function H(e){return["top","bottom"].includes(B(e))?"y":"x"}function q(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 q=["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(","),_="undefined"==typeof Element,U=_?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$=!_&&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},z=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)},X=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!z(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{U.call(l,q)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!z(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},Y=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},K=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))&&!Y(e)?0:e.tabIndex},G=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},J=function(e){return"INPUT"===e.tagName},Q=function(e){return function(e){return J(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||$(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)},Z=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=U.call(e,"details>summary:first-of-type")?e.parentElement:e;if(U.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Z(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=$(e);if(l&&!l.shadowRoot&&!0===r(l))return Z(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&&$(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=$(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},te=function(e,t){return!(t.disabled||z(t)||function(e){return J(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!!U.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ne=function(e,t){return!(Q(t)||K(t)<0||!te(e,t))},re=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=K(e);return n<0&&t&&!Y(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(G).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ie=function(e,t){var n;return n=(t=t||{}).getShadowRoot?X([e],t.includeContainer,{filter:ne.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:re}):function(e,t,n){if(z(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(q));return t&&U.call(e,q)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ne.bind(null,t)),oe(n)},le=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==U.call(e,q)&&ne(t,e)};function ue(e,t,n){let{reference:r,floating:o}=e;const i=B(t),l=function(e){return"x"===B(e)?"y":"x"}(t),u="y"===l?"height":"width";const c=V(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(function(e){return e.split("-")[1]}(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}function ce(e){const t=w(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=f(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=W(n)!==i||W(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function se(e){return a(e)?e:e.contextElement}function ae(e){const t=se(e);if(!f(t))return j(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ce(t);let l=(i?W(n.width):n.width)/r,u=(i?W(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const fe=j(0);function de(e){const t=u(e);return g()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:fe}function pe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=se(e);let l=j(1);t&&(r?a(r)&&(l=ae(r)):l=ae(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==u(e))&&t}(i,n,r)?de(i):j(0);let s=(o.left+c.x)/l.x,f=(o.top+c.y)/l.y,d=o.width/l.x,p=o.height/l.y;if(i){const e=u(i),t=r&&a(r)?u(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=ae(o),t=o.getBoundingClientRect(),r=w(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,f*=e.y,d*=e.x,p*=e.y,s+=i,f+=l,n=u(o),o=n.frameElement}}return H({width:d,height:p,x:s,y:f})}function me(e){return pe(c(e)).left+b(e).scrollLeft}function he(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=u(e),r=c(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const e=g();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}(e,n);else if("document"===t)r=function(e){const t=c(e),n=b(e),r=e.ownerDocument.body,o=P(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=P(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+me(e);const u=-n.scrollTop;return"rtl"===w(r).direction&&(l+=P(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(c(e));else if(a(t))r=function(e,t){const n=pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=f(e)?ae(e):j(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=de(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return H(r)}function ve(e,t){const n=x(e);return!(n===t||!a(n)||y(n))&&("fixed"===w(n).position||ve(n,t))}function ge(e,t,n){const r=f(t),o=c(t),i="fixed"===n,u=pe(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=j(0);if(r||!r&&!i)if(("body"!==l(t)||p(o))&&(s=b(t)),r){const e=pe(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=me(o));return{x:u.left+s.scrollLeft-a.x,y:u.top+s.scrollTop-a.y,width:u.width,height:u.height}}function ye(e){return"static"===w(e).position}function we(e,t){return f(e)&&"fixed"!==w(e).position?t?t(e):e.offsetParent:null}function be(e,t){const n=u(e);if(h(e))return n;if(!f(e)){let t=x(e);for(;t&&!y(t);){if(a(t)&&!ye(t))return t;t=x(t)}return n}let r=we(e,t);for(;r&&m(r)&&ye(r);)r=we(r,t);return r&&y(r)&&ye(r)&&!v(r)?n:r||function(e){let t=x(e);for(;f(t)&&!y(t);){if(v(t))return t;if(h(t))return null;t=x(t)}return null}(e)||n}const xe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=c(r),s=!!t&&h(t.floating);if(r===u||s&&i)return n;let a={scrollLeft:0,scrollTop:0},d=j(1);const m=j(0),v=f(r);if((v||!v&&!i)&&(("body"!==l(r)||p(u))&&(a=b(r)),f(r))){const e=pe(r);d=ae(r),m.x=e.x+r.clientLeft,m.y=e.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-a.scrollLeft*d.x+m.x,y:n.y*d.y-a.scrollTop*d.y+m.y}},getDocumentElement:c,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?h(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=R(e,[],!1).filter((e=>a(e)&&"body"!==l(e))),o=null;const i="fixed"===w(e).position;let u=i?x(e):e;for(;a(u)&&!y(u);){const t=w(u),n=v(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||p(u)&&!n&&ve(e,u))?r=r.filter((e=>e!==u)):o=t,u=x(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=i[0],c=i.reduce(((e,n)=>{const r=he(t,n,o);return e.top=P(r.top,e.top),e.right=F(r.right,e.right),e.bottom=F(r.bottom,e.bottom),e.left=P(r.left,e.left),e}),he(t,u,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:be,getElementRects:async function(e){const t=this.getOffsetParent||be,n=this.getDimensions,r=await n(e.floating);return{reference:ge(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ce(e);return{width:t,height:n}},getScale:ae,isElement:a,isRTL:function(e){return"rtl"===w(e).direction}},Ee=(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}=ue(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:h}=u[n],{x:v,y:g,data:y,reset:w}=await h({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=ue(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Re="undefined"!=typeof document?n:r;function Se(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(!Se(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)&&!Se(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ce(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oe(e,t){const n=Ce(e);return Math.round(t*n)/n}function Te(t){const n=e.useRef(t);return Re((()=>{n.current=t})),n}const Ne={...e},Le=Ne.useInsertionEffect||(e=>e());function Ae(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Le((()=>{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)}),[])}let ke=0;function Me(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(ke);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():ke=requestAnimationFrame(i)}var Ie="undefined"!=typeof document?n:r;function De(){return De=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},De.apply(this,arguments)}let Fe=!1,Pe=0;const We=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Pe++;const je=Ne.useId||function(){const[t,n]=e.useState((()=>Fe?We():void 0));return Ie((()=>{null==t&&n(We())}),[]),e.useEffect((()=>{Fe=!0}),[]),t};let Ve;"production"!==process.env.NODE_ENV&&(Ve=new Set);const Be=e.createContext(null),He=e.createContext(null),qe=()=>{var t;return(null==(t=e.useContext(Be))?void 0:t.id)||null},_e=()=>e.useContext(He);function Ue(e){return"data-floating-ui-"+e}function $e(e){const t=o(e);return Ie((()=>{t.current=e})),t}function ze(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 Xe=new WeakMap,Ye=new WeakSet,Ke={},Ge=0;const Je=e=>e&&(e.host||Je(e.parentNode)),Qe=(e,t)=>t.map((t=>{if(e.contains(t))return t;const n=Je(t);return e.contains(n)?n:null})).filter((e=>null!=e));function Ze(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=A(e[0]).body;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=Qe(t,e),c=new Set,s=new Set(u),a=[];Ke[o]||(Ke[o]=new WeakMap);const f=Ke[o];return u.forEach((function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))})),function e(t){t&&!s.has(t)&&[].forEach.call(t.children,(t=>{if("script"!==l(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Xe.get(t)||0)+1,l=(f.get(t)||0)+1;Xe.set(t,r),f.set(t,l),a.push(t),1===r&&n&&Ye.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Ge++,()=>{a.forEach((e=>{const t=(Xe.get(e)||0)-1,n=(f.get(e)||0)-1;Xe.set(e,t),f.set(e,n),t||(!Ye.has(e)&&i&&e.removeAttribute(i),Ye.delete(e)),n||e.removeAttribute(o)})),Ge--,Ge||(Xe=new WeakMap,Xe=new WeakMap,Ye=new WeakSet,Ke={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(e,t){const n=ie(e,et());"prev"===t&&n.reverse();const r=n.indexOf(S(A(e)));return n.slice(r+1)[0]}function nt(){return tt(document.body,"next")}function rt(){return tt(document.body,"prev")}function ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!C(n,r)}function it(e){ie(e,et()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function lt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ut={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 ct(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const st=e.forwardRef((function(t,n){const[r,o]=e.useState();Ie((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",ct),()=>{document.removeEventListener("keydown",ct)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Ue("focus-guard")]:"",style:ut};return e.createElement("span",De({},t,i))})),at=e.createContext(null),ft=Ue("portal");function dt(t){const{children:n,id:r,root:o=null,preserveTabOrder:l=!0}=t,u=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=je(),i=pt(),[l,u]=e.useState(null),c=e.useRef(null);return Ie((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),Ie((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(ft,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),Ie((()=>{if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!a(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(ft,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[c,s]=e.useState(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),h=!!c&&!c.modal&&c.open&&l&&!(!o&&!u);return e.useEffect((()=>{if(u&&l&&(null==c||!c.modal))return u.addEventListener("focusin",e,!0),u.addEventListener("focusout",e,!0),()=>{u.removeEventListener("focusin",e,!0),u.removeEventListener("focusout",e,!0)};function e(e){if(u&&ot(e)){("focusin"===e.type?lt:it)(u)}}}),[u,l,null==c?void 0:c.modal]),e.createElement(at.Provider,{value:e.useMemo((()=>({preserveTabOrder:l,beforeOutsideRef:f,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:m,portalNode:u,setFocusManagerState:s})),[l,u])},h&&u&&e.createElement(st,{"data-type":"outside",ref:f,onFocus:e=>{if(ot(e,u)){var t;null==(t=p.current)||t.focus()}else{const e=rt()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),h&&u&&e.createElement("span",{"aria-owns":u.id,style:ut}),u&&i.createPortal(n,u),h&&u&&e.createElement(st,{"data-type":"outside",ref:d,onFocus:e=>{if(ot(e,u)){var t;null==(t=m.current)||t.focus()}else{const t=nt()||(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))}}}))}const pt=()=>e.useContext(at),mt=20;let ht=[];function vt(e){ht=ht.filter((e=>e.isConnected));let t=e;if(t&&"body"!==l(t)){if(!le(t,et())){const e=ie(t,et())[0];e&&(t=e)}ht.push(t),ht.length>mt&&(ht=ht.slice(-mt))}}function gt(){return ht.slice().reverse().find((e=>e.isConnected))}const yt=e.forwardRef((function(t,n){return e.createElement("button",De({},t,{type:"button",ref:n,tabIndex:-1,style:ut}))}));function wt(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:d=!1,closeOnFocusOut:p=!0}=t,{open:m,refs:h,nodeId:v,onOpenChange:g,events:y,dataRef:w,floatingId:b,elements:{domReference:x,floating:E}}=n,R="number"==typeof u&&u<0,O=D(x)&&R,T="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||l,M=$e(i),F=$e(u),P=$e(c),W=_e(),j=pt(),V=e.useRef(null),B=e.useRef(null),H=e.useRef(!1),q=e.useRef(!1),_=e.useRef(-1),U=null!=j,$=null==E?void 0:E.firstElementChild,z=(null==$?void 0:$.id)===b?$:E,X=Ae((function(e){return void 0===e&&(e=z),e?ie(e,et()):[]})),Y=Ae((e=>{const t=X(e);return M.current.map((e=>x&&"reference"===e?x:z&&"floating"===e?z:t)).filter(Boolean).flat()}));function K(t){return!o&&d&&a?e.createElement(yt,{ref:"start"===t?V:B,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}e.useEffect((()=>{if(o)return;if(!a)return;function e(e){if("Tab"===e.key){C(z,S(A(z)))&&0===X().length&&!O&&I(e);const t=Y(),n=k(e);"reference"===M.current[0]&&n===x&&(I(e),e.shiftKey?Me(t[t.length-1]):Me(t[1])),"floating"===M.current[1]&&n===z&&e.shiftKey&&(I(e),Me(t[0]))}}const t=A(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,x,z,a,M,O,X,Y]),e.useEffect((()=>{if(!o&&E)return E.addEventListener("focusin",e),()=>{E.removeEventListener("focusin",e)};function e(e){const t=k(e),n=X().indexOf(t);-1!==n&&(_.current=n)}}),[o,E,X]),e.useEffect((()=>{if(!o&&p)return E&&f(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),E.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),E.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(C(x,t)||C(E,t)||C(t,E)||C(null==j?void 0:j.portalNode,t)||null!=t&&t.hasAttribute(Ue("focus-guard"))||W&&(ze(W.nodesRef.current,v).find((e=>{var n,r;return C(null==(n=e.context)?void 0:n.elements.floating,t)||C(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}(W.nodesRef.current,v).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&&S(A(z))===A(z).body){f(z)&&(null==z||z.focus());const e=_.current,t=X(),n=t[e]||t[t.length-1]||z;f(n)&&n.focus()}!O&&a||!t||!n||q.current||t===gt()||(H.current=!0,g(!1,e))}))}}),[o,x,E,z,a,v,W,j,g,p,s,X,O]),e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==j||null==(e=j.portalNode)?void 0:e.querySelectorAll("["+Ue("portal")+"]"))||[]);if(E){const e=[E,...t,V.current,B.current,M.current.includes("reference")||O?x:null].filter((e=>null!=e)),n=a||O?Ze(e,T,!T):Ze(e);return()=>{n()}}}),[o,x,E,a,M,j,O,T]),Ie((()=>{if(o||!f(z))return;const e=S(A(z));queueMicrotask((()=>{const t=Y(z),n=F.current,r=("number"==typeof n?t[n]:n.current)||z,o=C(z,e);R||o||!m||Me(r,{preventScroll:r===z})}))}),[o,m,z,R,Y,F]),Ie((()=>{if(o||!z)return;let e=!1;const t=A(z),n=S(t);let r=w.current.openEvent;const i=h.domReference.current;function l(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&h.domReference.current&&vt(h.domReference.current),"hover"===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)||(L()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||N(i)))}return vt(n),y.on("openchange",l),()=>{y.off("openchange",l);const o=S(t),u=C(E,o)||W&&ze(W.nodesRef.current,v).some((e=>{var t;return C(null==(t=e.context)?void 0:t.elements.floating,o)}));(u||r&&["click","mousedown"].includes(r.type))&&h.domReference.current&&vt(h.domReference.current);const c=i||n,s=ie(A(c).body,et());queueMicrotask((()=>{let n=gt();!n&&f(c)&&E&&(n=function(e,t,n){const r=e.indexOf(t);function o(t){const o=Ue("focus-guard");let i=r+(t?1:0),l=e[i];for(;l&&(!l.isConnected||l.hasAttribute(o)||C(n,l));)t?i++:i--,l=e[i];return l}return o(!0)||o(!1)}(s,c,E)),P.current&&!H.current&&f(n)&&(n===o||o===t.body||u)&&n.focus({preventScroll:e})}))}}),[o,E,z,P,w,h,y,W,v]),Ie((()=>{if(!o&&j)return j.setFocusManagerState({modal:a,closeOnFocusOut:p,open:m,onOpenChange:g,refs:h}),()=>{j.setFocusManagerState(null)}}),[o,j,a,m,g,h,p]),Ie((()=>{if(o)return;if(!z)return;if("function"!=typeof MutationObserver)return;if(R)return;const e=()=>{const e=z.getAttribute("tabindex"),t=X(),n=S(A(E)),r=t.indexOf(n);-1!==r&&(_.current=r),M.current.includes("floating")||n!==h.domReference.current&&0===t.length?"0"!==e&&z.setAttribute("tabindex","0"):"-1"!==e&&z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,E,z,h,M,X,R]);const G=!o&&T&&(!a||!O)&&(U||a);return e.createElement(e.Fragment,null,G&&e.createElement(st,{"data-type":"inside",ref:null==j?void 0:j.beforeInsideRef,onFocus:e=>{if(a){const e=Y();Me("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(H.current=!1,ot(e,j.portalNode)){const e=nt()||x;null==e||e.focus()}else{var t;null==(t=j.beforeOutsideRef.current)||t.focus()}}}),!O&&K("start"),r,K("end"),G&&e.createElement(st,{"data-type":"inside",ref:null==j?void 0:j.afterInsideRef,onFocus:e=>{if(a)Me(Y()[0]);else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(p&&(H.current=!0),ot(e,j.portalNode)){const e=rt()||x;null==e||e.focus()}else{var t;null==(t=j.afterOutsideRef.current)||t.focus()}}}))}const bt=new Set,xt=e.forwardRef((function(t,n){const{lockScroll:r=!1,...o}=t,i=je();return Ie((()=>{if(!r)return;bt.add(i);const e=/iP(hone|ad|od)|iOS/.test(O()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,l=t.left?parseFloat(t.left):window.scrollX,u=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[n]=o+"px"),e){var c,s;const e=(null==(c=window.visualViewport)?void 0:c.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(u-Math.floor(n))+"px",left:-(l-Math.floor(e))+"px",right:"0"})}return()=>{bt.delete(i),0===bt.size&&(Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(l,u)))}}),[i,r]),e.createElement("div",De({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Et(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=je(),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!=qe();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!a(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Ve)&&e.has(o)||(null==(i=Ve)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,f]=e.useState(o.reference),d=Ae(((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)})),p=e.useMemo((()=>({setPositionReference:f})),[]),m=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:d,elements:m,events:u,floatingId:i,refs:p})),[n,d,m,u,i,p])}function Rt(t){void 0===t&&(t={});const{nodeId:n}=t,r=Et({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,l=o.elements,[u,c]=e.useState(null),[s,f]=e.useState(null),d=(null==l?void 0:l.reference)||u,p=e.useRef(null),m=_e();Ie((()=>{d&&(p.current=d)}),[d]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:l,elements:{reference:u,floating:c}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);Se(m,o)||h(o);const[v,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==C.current&&(C.current=e,w(e))}),[]),E=u||v,R=c||y,S=e.useRef(null),C=e.useRef(null),O=e.useRef(d),T=null!=a,N=Te(a),L=Te(l),A=e.useCallback((()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:m};L.current&&(e.platform=L.current),Ee(S.current,C.current,e).then((e=>{const t={...e,isPositioned:!0};k.current&&!Se(O.current,t)&&(O.current=t,i.flushSync((()=>{p(t)})))}))}),[m,n,r,L]);Re((()=>{!1===f&&O.current.isPositioned&&(O.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const k=e.useRef(!1);Re((()=>(k.current=!0,()=>{k.current=!1})),[]),Re((()=>{if(E&&(S.current=E),R&&(C.current=R),E&&R){if(N.current)return N.current(E,R,A);A()}}),[E,R,A,N,T]);const M=e.useMemo((()=>({reference:S,floating:C,setReference:b,setFloating:x})),[b,x]),I=e.useMemo((()=>({reference:E,floating:R})),[E,R]),D=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!I.floating)return e;const t=Oe(I.floating,d.x),n=Oe(I.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...Ce(I.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,I.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:A,refs:M,elements:I,floatingStyles:D})),[d,A,M,I,D])}({...t,elements:{...l,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=a(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;f(t),h.refs.setReference(t)}),[h.refs]),g=e.useCallback((e=>{(a(e)||null===e)&&(p.current=e,c(e)),(a(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!a(e))&&h.refs.setReference(e)}),[h.refs]),y=e.useMemo((()=>({...h.refs,setReference:g,setPositionReference:v,domReference:p})),[h.refs,g,v]),w=e.useMemo((()=>({...h.elements,domReference:d})),[h.elements,d]),b=e.useMemo((()=>({...h,...o,refs:y,elements:w,nodeId:n})),[h,y,w,n,o]);return Ie((()=>{o.dataRef.current.floatingContext=b;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...h,context:b,refs:y,elements:w})),[h,y,w,b])}var St=function(e){var n=e.open,r=void 0===n||n,o=e.onClose,i=e.children,l=Rt().context;return t.createElement("div",{className:"modal"},t.createElement("div",{className:"modal__content"},t.createElement("div",null,i),t.createElement("div",null,r&&t.createElement(dt,null,t.createElement(xt,{className:"overlay",lockScroll:!0},t.createElement(wt,{context:l},t.createElement("div",{className:"fixed bg-black/80 overflow-auto w-screen h-screen grid place-items-center"},t.createElement("div",{className:"bg-white p-4 inline-block rounded-md shadow-lg"},t.createElement("button",{onClick:function(){o(!1)}},"Close"),t.createElement("div",null,"Modal Content",t.createElement("div",null,t.createElement("input",{type:"text",autoFocus:!0})))))))))))};export{St as Modal,St as default};
5
+ */var _=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),U="undefined"==typeof Element,$=U?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,z=!U&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},X=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},Y=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!X(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{$.call(l,_)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!X(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},K=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},G=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!K(e)?0:e.tabIndex},J=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Q=function(e){return"INPUT"===e.tagName},Z=function(e){return function(e){return Q(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||z(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},ee=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},te=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=$.call(e,"details>summary:first-of-type")?e.parentElement:e;if($.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ee(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=z(e);if(l&&!l.shadowRoot&&!0===r(l))return ee(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&&z(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=z(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},ne=function(e,t){return!(t.disabled||X(t)||function(e){return Q(e)&&"hidden"===e.type}(t)||te(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!$.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},re=function(e,t){return!(Z(t)||G(t)<0||!ne(e,t))},oe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ie=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=G(e);return n<0&&t&&!K(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(J).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},le=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Y([e],t.includeContainer,{filter:re.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:oe}):function(e,t,n){if(X(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(_));return t&&$.call(e,_)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,re.bind(null,t)),ie(n)};function ue(e,t,n){let{reference:r,floating:o}=e;const i=H(t),l=function(e){return"x"===H(e)?"y":"x"}(t),u="y"===l?"height":"width";const c=B(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[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(function(e){return e.split("-")[1]}(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}function ce(e){const t=b(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=d(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=W(n)!==i||W(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function se(e){return f(e)?e:e.contextElement}function ae(e){const t=se(e);if(!d(t))return V(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ce(t);let l=(i?W(n.width):n.width)/r,u=(i?W(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const fe=V(0);function de(e){const t=c(e);return y()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:fe}function pe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=se(e);let l=V(1);t&&(r?f(r)&&(l=ae(r)):l=ae(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==c(e))&&t}(i,n,r)?de(i):V(0);let s=(o.left+u.x)/l.x,a=(o.top+u.y)/l.y,d=o.width/l.x,p=o.height/l.y;if(i){const e=c(i),t=r&&f(r)?c(r):r;let n=e,o=C(n);for(;o&&r&&t!==n;){const e=ae(o),t=o.getBoundingClientRect(),r=b(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,a*=e.y,d*=e.x,p*=e.y,s+=i,a+=l,n=c(o),o=C(n)}}return q({width:d,height:p,x:s,y:a})}function me(e,t){const n=x(e).scrollLeft;return t?t.left+n:pe(s(e)).left+n}function he(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:me(e,r)),y:r.top+t.scrollTop}}function ve(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=c(e),r=s(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,a=0;if(o){i=o.width,l=o.height;const e=y();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:u,y:a}}(e,n);else if("document"===t)r=function(e){const t=s(e),n=x(e),r=e.ownerDocument.body,o=j(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=j(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+me(e);const u=-n.scrollTop;return"rtl"===b(r).direction&&(l+=j(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(s(e));else if(f(t))r=function(e,t){const n=pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=d(e)?ae(e):V(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=de(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return q(r)}function ge(e,t){const n=E(e);return!(n===t||!f(n)||w(n))&&("fixed"===b(n).position||ge(n,t))}function ye(e,t,n){const r=d(t),o=s(t),i="fixed"===n,l=pe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=V(0);if(r||!r&&!i)if(("body"!==u(t)||m(o))&&(c=x(t)),r){const e=pe(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&(a.x=me(o));const f=!o||r||i?V(0):he(o,c);return{x:l.left+c.scrollLeft-a.x-f.x,y:l.top+c.scrollTop-a.y-f.y,width:l.width,height:l.height}}function we(e){return"static"===b(e).position}function be(e,t){if(!d(e)||"fixed"===b(e).position)return null;if(t)return t(e);let n=e.offsetParent;return s(e)===n&&(n=n.ownerDocument.body),n}function xe(e,t){const n=c(e);if(v(e))return n;if(!d(e)){let t=E(e);for(;t&&!w(t);){if(f(t)&&!we(t))return t;t=E(t)}return n}let r=be(e,t);for(;r&&h(r)&&we(r);)r=be(r,t);return r&&w(r)&&we(r)&&!g(r)?n:r||function(e){let t=E(e);for(;d(t)&&!w(t);){if(g(t))return t;if(v(t))return null;t=E(t)}return null}(e)||n}const Ee={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=s(r),c=!!t&&v(t.floating);if(r===l||c&&i)return n;let a={scrollLeft:0,scrollTop:0},f=V(1);const p=V(0),h=d(r);if((h||!h&&!i)&&(("body"!==u(r)||m(l))&&(a=x(r)),d(r))){const e=pe(r);f=ae(r),p.x=e.x+r.clientLeft,p.y=e.y+r.clientTop}const g=!l||h||i?V(0):he(l,a,!0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+p.x+g.x,y:n.y*f.y-a.scrollTop*f.y+p.y+g.y}},getDocumentElement:s,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?v(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=S(e,[],!1).filter((e=>f(e)&&"body"!==u(e))),o=null;const i="fixed"===b(e).position;let l=i?E(e):e;for(;f(l)&&!w(l);){const t=b(l),n=g(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||m(l)&&!n&&ge(e,l))?r=r.filter((e=>e!==l)):o=t,l=E(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=ve(t,n,o);return e.top=j(r.top,e.top),e.right=P(r.right,e.right),e.bottom=P(r.bottom,e.bottom),e.left=j(r.left,e.left),e}),ve(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:xe,getElementRects:async function(e){const t=this.getOffsetParent||xe,n=this.getDimensions,r=await n(e.floating);return{reference:ye(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ce(e);return{width:t,height:n}},getScale:ae,isElement:f,isRTL:function(e){return"rtl"===b(e).direction}},Re=(e,t,n)=>{const r=new Map,o={platform:Ee,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform: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}=ue(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:h}=u[n],{x:v,y:g,data:y,reset:w}=await h({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=ue(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Se="undefined"!=typeof document?n:r;function Ce(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Ce(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Ce(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Te(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Oe(e,t){const n=Te(e);return Math.round(t*n)/n}function Ae(t){const n=e.useRef(t);return Se((()=>{n.current=t})),n}const Le={...e},Ne=Le.useInsertionEffect||(e=>e());function ke(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Ne((()=>{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)}),[])}let Me=0;function Ie(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Me);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Me=requestAnimationFrame(i)}var De="undefined"!=typeof document?n:r;function Fe(){return Fe=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},Fe.apply(this,arguments)}let Pe=!1,je=0;const We=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+je++;const Ve=Le.useId||function(){const[t,n]=e.useState((()=>Pe?We():void 0));return De((()=>{null==t&&n(We())}),[]),e.useEffect((()=>{Pe=!0}),[]),t};let Be;"production"!==process.env.NODE_ENV&&(Be=new Set);const He=e.createContext(null),qe=e.createContext(null),_e=()=>e.useContext(qe);function Ue(e){return"data-floating-ui-"+e}function $e(e){const t=o(e);return De((()=>{t.current=e})),t}function ze(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 Xe=new WeakMap,Ye=new WeakSet,Ke={},Ge=0;const Je=e=>e&&(e.host||Je(e.parentNode));function Qe(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=Je(e);return c.contains(t)?t:null})).filter((e=>null!=e)));var c;const s=new Set,a=new Set(l),f=[];Ke[o]||(Ke[o]=new WeakMap);const d=Ke[o];return l.forEach((function e(t){if(!t||s.has(t))return;s.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==u(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Xe.get(t)||0)+1,l=(d.get(t)||0)+1;Xe.set(t,r),d.set(t,l),f.push(t),1===r&&n&&Ye.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),s.clear(),Ge++,()=>{f.forEach((e=>{const t=(Xe.get(e)||0)-1,n=(d.get(e)||0)-1;Xe.set(e,t),d.set(e,n),t||(!Ye.has(e)&&i&&e.removeAttribute(i),Ye.delete(e)),n||e.removeAttribute(o)})),Ge--,Ge||(Xe=new WeakMap,Xe=new WeakMap,Ye=new WeakSet,Ke={})}}function Ze(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=M(e[0]).body;return Qe(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function tt(e,t){const n=le(e,et());"prev"===t&&n.reverse();const r=n.indexOf(T(M(e)));return n.slice(r+1)[0]}function nt(){return tt(document.body,"next")}function rt(){return tt(document.body,"prev")}function ot(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!O(n,r)}function it(e){le(e,et()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function lt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const ut={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 ct(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const st=e.forwardRef((function(t,n){const[r,o]=e.useState();De((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",ct),()=>{document.removeEventListener("keydown",ct)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[Ue("focus-guard")]:"",style:ut};return e.createElement("span",Fe({},t,i))})),at=e.createContext(null),ft=Ue("portal");function dt(t){const{children:n,id:r,root:o,preserveTabOrder:l=!0}=t,u=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=Ve(),i=pt(),[l,u]=e.useState(null),c=e.useRef(null);return De((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),De((()=>{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(ft,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),De((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!f(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(ft,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[c,s]=e.useState(null),a=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),h=null==c?void 0:c.modal,v=null==c?void 0:c.open,g=!!c&&!c.modal&&c.open&&l&&!(!o&&!u);return e.useEffect((()=>{if(u&&l&&!h)return u.addEventListener("focusin",e,!0),u.addEventListener("focusout",e,!0),()=>{u.removeEventListener("focusin",e,!0),u.removeEventListener("focusout",e,!0)};function e(e){if(u&&ot(e)){("focusin"===e.type?lt:it)(u)}}}),[u,l,h]),e.useEffect((()=>{u&&(v||lt(u))}),[v,u]),e.createElement(at.Provider,{value:e.useMemo((()=>({preserveTabOrder:l,beforeOutsideRef:a,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:m,portalNode:u,setFocusManagerState:s})),[l,u])},g&&u&&e.createElement(st,{"data-type":"outside",ref:a,onFocus:e=>{if(ot(e,u)){var t;null==(t=p.current)||t.focus()}else{const e=rt()||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),g&&u&&e.createElement("span",{"aria-owns":u.id,style:ut}),u&&i.createPortal(n,u),g&&u&&e.createElement(st,{"data-type":"outside",ref:d,onFocus:e=>{if(ot(e,u)){var t;null==(t=m.current)||t.focus()}else{const t=nt()||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const pt=()=>e.useContext(at),mt="data-floating-ui-focusable";let ht=[];function vt(e){ht=ht.filter((e=>e.isConnected));let t=e;if(t&&"body"!==u(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==$.call(e,_)&&re(t,e)}(t,et())){const e=le(t,et())[0];e&&(t=e)}ht.push(t),ht.length>20&&(ht=ht.slice(-20))}}function gt(){return ht.slice().reverse().find((e=>e.isConnected))}const yt=e.forwardRef((function(t,n){return e.createElement("button",Fe({},t,{type:"button",ref:n,tabIndex:-1,style:ut}))}));function wt(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:p=!0}=t,{open:m,refs:h,nodeId:v,onOpenChange:g,events:y,dataRef:w,floatingId:b,elements:{domReference:x,floating:E}}=n,R="number"==typeof u&&u<0,S=F(x)&&R,C="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||l,A=$e(i),L=$e(u),P=$e(c),j=_e(),W=pt(),V=e.useRef(null),B=e.useRef(null),H=e.useRef(!1),q=e.useRef(!1),_=e.useRef(-1),U=null!=W,$=(z=E)?z.hasAttribute(mt)?z:z.querySelector("["+mt+"]")||z:null;var z;const X=ke((function(e){return void 0===e&&(e=$),e?le(e,et()):[]})),Y=ke((e=>{const t=X(e);return A.current.map((e=>x&&"reference"===e?x:$&&"floating"===e?$:t)).filter(Boolean).flat()}));function K(t){return!o&&f&&a?e.createElement(yt,{ref:"start"===t?V:B,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}e.useEffect((()=>{H.current=!1}),[o]),e.useEffect((()=>{if(o)return;if(!a)return;function e(e){if("Tab"===e.key){O($,T(M($)))&&0===X().length&&!S&&D(e);const t=Y(),n=I(e);"reference"===A.current[0]&&n===x&&(D(e),e.shiftKey?Ie(t[t.length-1]):Ie(t[1])),"floating"===A.current[1]&&n===$&&e.shiftKey&&(D(e),Ie(t[0]))}}const t=M($);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,x,$,a,A,S,X,Y]),e.useEffect((()=>{if(!o&&E)return E.addEventListener("focusin",e),()=>{E.removeEventListener("focusin",e)};function e(e){const t=I(e),n=X().indexOf(t);-1!==n&&(_.current=n)}}),[o,E,X]),e.useEffect((()=>{if(!o&&p)return E&&d(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),E.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),E.removeEventListener("focusout",t)}):void 0;function e(){q.current=!0,setTimeout((()=>{q.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(O(x,t)||O(E,t)||O(t,E)||O(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Ue("focus-guard"))||j&&(ze(j.nodesRef.current,v).find((e=>{var n,r;return O(null==(n=e.context)?void 0:n.elements.floating,t)||O(null==(r=e.context)?void 0:r.elements.domReference,t)}))||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}(j.nodesRef.current,v).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&&T(M($))===M($).body){d($)&&$.focus();const e=_.current,t=X(),n=t[e]||t[t.length-1]||$;d(n)&&n.focus()}!S&&a||!t||!n||q.current||t===gt()||(H.current=!0,g(!1,e,"focus-out"))}))}}),[o,x,E,$,a,v,j,W,g,p,s,X,S]),e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Ue("portal")+"]"))||[]);if(E){const e=[E,...t,V.current,B.current,A.current.includes("reference")||S?x:null].filter((e=>null!=e)),n=a||S?Ze(e,C,!C):Ze(e);return()=>{n()}}}),[o,x,E,a,A,W,S,C]),De((()=>{if(o||!d($))return;const e=T(M($));queueMicrotask((()=>{const t=Y($),n=L.current,r=("number"==typeof n?t[n]:n.current)||$,o=O($,e);R||o||!m||Ie(r,{preventScroll:r===$})}))}),[o,m,$,R,Y,L]),De((()=>{if(o||!$)return;let e=!1;const t=M($),n=T(t);let r=w.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&h.domReference.current&&vt(h.domReference.current),"hover"===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)||(k()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||N(i)))}vt(n),y.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,ut),U&&x&&x.insertAdjacentElement("afterend",l),()=>{y.off("openchange",i);const n=T(t),o=O(E,n)||j&&ze(j.nodesRef.current,v).some((e=>{var t;return O(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&h.domReference.current&&vt(h.domReference.current);const u="boolean"==typeof P.current?gt()||l:P.current.current||l;queueMicrotask((()=>{P.current&&!H.current&&d(u)&&(u===n||n===t.body||o)&&u.focus({preventScroll:e}),l.remove()}))}}),[o,E,$,P,w,h,y,j,v,U,x]),De((()=>{if(!o&&W)return W.setFocusManagerState({modal:a,closeOnFocusOut:p,open:m,onOpenChange:g,refs:h}),()=>{W.setFocusManagerState(null)}}),[o,W,a,m,g,h,p]),De((()=>{if(o)return;if(!$)return;if("function"!=typeof MutationObserver)return;if(R)return;const e=()=>{const e=$.getAttribute("tabindex"),t=X(),n=T(M(E)),r=t.indexOf(n);-1!==r&&(_.current=r),A.current.includes("floating")||n!==h.domReference.current&&0===t.length?"0"!==e&&$.setAttribute("tabindex","0"):"-1"!==e&&$.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe($,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,E,$,h,A,X,R]);const G=!o&&C&&(!a||!S)&&(U||a);return e.createElement(e.Fragment,null,G&&e.createElement(st,{"data-type":"inside",ref:null==W?void 0:W.beforeInsideRef,onFocus:e=>{if(a){const e=Y();Ie("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(H.current=!1,ot(e,W.portalNode)){const e=nt()||x;null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!S&&K("start"),r,K("end"),G&&e.createElement(st,{"data-type":"inside",ref:null==W?void 0:W.afterInsideRef,onFocus:e=>{if(a)Ie(Y()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(p&&(H.current=!0),ot(e,W.portalNode)){const e=rt()||x;null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}}))}let bt=0;let xt=()=>{};const Et=e.forwardRef((function(t,n){const{lockScroll:r=!1,...o}=t;return De((()=>{if(r)return bt++,1===bt&&(xt=function(){const e=/iP(hone|ad|od)|iOS/.test(A()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var 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))}}()),()=>{bt--,0===bt&&xt()}}),[r]),e.createElement("div",Fe({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))}));function Rt(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=Ve(),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!=((null==(s=e.useContext(He))?void 0:s.id)||null);var s;if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!f(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Be)&&e.has(o)||(null==(i=Be)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,d]=e.useState(o.reference),p=ke(((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)})),m=e.useMemo((()=>({setPositionReference:d})),[]),h=e.useMemo((()=>({reference:a||o.reference||null,floating:o.floating||null,domReference:o.reference})),[a,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:p,elements:h,events:u,floatingId:i,refs:m})),[n,p,h,u,i,m])}function St(t){void 0===t&&(t={});const{nodeId:n}=t,r=Rt({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,l=o.elements,[u,c]=e.useState(null),[s,a]=e.useState(null),d=(null==l?void 0:l.domReference)||u,p=e.useRef(null),m=_e();De((()=>{d&&(p.current=d)}),[d]);const h=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:l,elements:{reference:u,floating:c}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=e.useState(o);Ce(m,o)||h(o);const[v,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==S.current&&(S.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==C.current&&(C.current=e,w(e))}),[]),E=u||v,R=c||y,S=e.useRef(null),C=e.useRef(null),T=e.useRef(d),O=null!=a,A=Ae(a),L=Ae(l),N=Ae(f),k=e.useCallback((()=>{if(!S.current||!C.current)return;const e={placement:n,strategy:r,middleware:m};L.current&&(e.platform=L.current),Re(S.current,C.current,e).then((e=>{const t={...e,isPositioned:!1!==N.current};M.current&&!Ce(T.current,t)&&(T.current=t,i.flushSync((()=>{p(t)})))}))}),[m,n,r,L,N]);Se((()=>{!1===f&&T.current.isPositioned&&(T.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Se((()=>(M.current=!0,()=>{M.current=!1})),[]),Se((()=>{if(E&&(S.current=E),R&&(C.current=R),E&&R){if(A.current)return A.current(E,R,k);k()}}),[E,R,k,A,O]);const I=e.useMemo((()=>({reference:S,floating:C,setReference:b,setFloating:x})),[b,x]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=Oe(D.floating,d.x),n=Oe(D.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...Te(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:I,elements:D,floatingStyles:F})),[d,k,I,D,F])}({...t,elements:{...l,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),h.refs.setReference(t)}),[h.refs]),g=e.useCallback((e=>{(f(e)||null===e)&&(p.current=e,c(e)),(f(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!f(e))&&h.refs.setReference(e)}),[h.refs]),y=e.useMemo((()=>({...h.refs,setReference:g,setPositionReference:v,domReference:p})),[h.refs,g,v]),w=e.useMemo((()=>({...h.elements,domReference:d})),[h.elements,d]),b=e.useMemo((()=>({...h,...o,refs:y,elements:w,nodeId:n})),[h,y,w,n,o]);return De((()=>{o.dataRef.current.floatingContext=b;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...h,context:b,refs:y,elements:w})),[h,y,w,b])}var Ct=function(e){var n=e.open,r=void 0===n||n,o=e.onClose,i=e.children,l=St().context;return t.createElement("div",{className:"modal"},t.createElement("div",{className:"modal__content"},t.createElement("div",null,i),t.createElement("div",null,r&&t.createElement(dt,null,t.createElement(Et,{className:"overlay",lockScroll:!0},t.createElement(wt,{context:l},t.createElement("div",{className:"fixed bg-black/80 overflow-auto w-screen h-screen grid place-items-center"},t.createElement("div",{className:"bg-white p-4 inline-block rounded-md shadow-lg"},t.createElement("button",{onClick:function(){o(!1)}},"Close"),t.createElement("div",null,"Modal Content",t.createElement("div",null,t.createElement("input",{type:"text",autoFocus:!0})))))))))))};export{Ct as Modal,Ct as default};
@@ -0,0 +1 @@
1
+ 'use client';import e from"react";var r=function(){return r=Object.assign||function(e){for(var r,t=1,a=arguments.length;t<a;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},r.apply(this,arguments)};function t(e,r){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&r.indexOf(a)<0&&(t[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(a=Object.getOwnPropertySymbols(e);o<a.length;o++)r.indexOf(a[o])<0&&Object.prototype.propertyIsEnumerable.call(e,a[o])&&(t[a[o]]=e[a[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var a=function(a){a.role;var o=a.label,n=void 0===o?"":o,c=a.id,l=a.value,i=a.defaultChecked,d=a.onChange,u=a.checked,p=a.children,s=t(a,["role","label","id","value","defaultChecked","onChange","checked","children"]),f={"aria-label":n||void 0,"aria-checked":u?"true":"false","data-checked":u?"true":"false"};return e.createElement("div",null,e.createElement("input",r({type:"radio",id:c},f,s,{value:l,checked:i,onChange:d})),e.createElement("label",{htmlFor:c}," ",p))},o=function(o){var n=o.children,c=o.type,l=void 0===c?"radio":c,i=o.className,d=void 0===i?"":i,u=o.customRootClass,p=void 0===u?"":u,s=t(o,["children","type","className","customRootClass"]),f=function(e,r){void 0===e&&(e=""),void 0===r&&(r="");var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(r?"".concat("rad-ui","-").concat(t):"")}(p,"RadioGroup");return e.createElement("div",{className:"".concat(f," ").concat(d),role:"radiogroup"},e.createElement(a,r({type:l},s),n))};export{o as default};
@@ -0,0 +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"==typeof SuppressedError&&SuppressedError;var t="Skeleton",o=function(o){var n=o.loading,a=void 0===n||n,c=o.className,l=void 0===c?"":c,s=o.customRootClass,i=void 0===s?"":s,p=o.children,u=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}(o,["loading","className","customRootClass","children"]);if(!a)return p;var f=function(r,e){void 0===r&&(r=""),void 0===e&&(e="");var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return r||(e?"".concat("rad-ui","-").concat(t):"")}(i,t);return r.createElement("span",e({className:"".concat(f," ").concat(l)},u),p)};o.displayName=t;export{o as default};
@@ -1 +1 @@
1
- 'use client';import e,{useState as t}from"react";var r=function(){return r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var o="Switch",n=function(n){n.children;var c=n.customRootClass,a=void 0===c?"":c;n.className,n.color;var l=n.defaultChecked,s=n.checked,i=n.onChange,p=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(n,["children","customRootClass","className","color","defaultChecked","checked","onChange"]),u=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");var r=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?"".concat("rad-ui","-").concat(r):"")}(a,o),f=t(s||l),d=f[0],h=f[1];return e.createElement(e.Fragment,null,e.createElement("input",r({type:"checkbox",className:"".concat(u)},p,{checked:d})),e.createElement("button",{type:"button",onClick:function(){var e=!d;h(e),i(e)},role:"switch"},d?"on":"off"))};n.displayName=o;export{n as default};
1
+ 'use client';import e,{useState as t}from"react";var r=function(){return r=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var o="Switch",n=function(n){n.children;var c=n.customRootClass,a=void 0===c?"":c;n.className,n.color;var l=n.defaultChecked,s=n.checked,i=n.onChange,p=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]])}return r}(n,["children","customRootClass","className","color","defaultChecked","checked","onChange"]),u=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");var r=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?"".concat("rad-ui","-").concat(r):"")}(a,o),f=t(s||l),d=f[0],h=f[1];return e.createElement(e.Fragment,null,e.createElement("input",r({type:"checkbox",className:"".concat(u)},p,{checked:d})),e.createElement("button",{type:"button",onClick:function(){var e=!d;h(e),i(e)},role:"switch"}))};n.displayName=o;export{n as default};
@@ -1 +1 @@
1
- 'use client';import e,{createContext as a,useContext as t,useRef as n,useEffect as r,useState as o}from"react";var c=function(){return c=Object.assign||function(e){for(var a,t=1,n=arguments.length;t<n;t++)for(var r in a=arguments[t])Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);return e},c.apply(this,arguments)};function l(e,a){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&a.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)a.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;var i=function(e,a){void 0===e&&(e=""),void 0===a&&(a="");var t=a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(a?"".concat("rad-ui","-").concat(t):"")},s=a(null),u=function(a){var o=a.tab,u=a.setActiveTab,v=a.activeTab,b=a.className,f=a.customRootClass,m=a.index,d=l(a,["tab","setActiveTab","activeTab","className","customRootClass","index"]),p=t(s);p.tabs;var T=p.previousTab,y=p.nextTab,N=n(null);r((function(){v===o.value&&N.current.focus()}),[v]);var E=i(f,"TabTrigger"),g=v===o.value;return e.createElement("button",c({ref:N,role:"tab",key:m,className:"".concat(E," ").concat(g?"active":""," ").concat(b)},d,{onKeyDown:function(e){"ArrowLeft"==e.key&&T(),"ArrowRight"==e.key&&y()},onClick:function(){return function(e){u(e.value)}(o)}}),e.createElement("span",{className:"".concat(E,"-inner")},o.label))};u.displayName="TabTrigger";var v="TabList",b=function(a){var n=a.className,r=void 0===n?"":n,o=a.customRootClass,c=i(void 0===o?"":o,v),l=t(s),b=l.tabs,f=l.activeTab,m=l.setActiveTab;return e.createElement("div",{role:"tablist","aria-orientation":"horizontal","aria-label":"todo",className:"".concat(c," ").concat(r)},b.map((function(a,t){return e.createElement(u,{activeTab:f,setActiveTab:m,key:t,tab:a,index:t})})))};b.displayName=v;var f="TabContent",m=function(a){var n=a.className,r=a.customRootClass,o=i(r,f),c=t(s),l=c.tabs,u=c.activeTab;return c.setActiveTab,e.createElement("div",{className:"".concat(o," ").concat(n)},l.map((function(a,t){return a.value===u?e.createElement("div",{key:t},a.content):null})))};m.displayName=f;var d="Tabs",p=function(a){var t=a.children,n=a.defaultTab,r=void 0===n?"":n,u=a.customRootClass,v=a.tabs,b=void 0===v?[]:v,f=a.className,m=a.color,p=l(a,["children","defaultTab","customRootClass","tabs","className","color"]),T=i(u,d),y=o(r||b[0].value||""),N=y[0],E=y[1];return e.createElement(s.Provider,{value:{activeTab:N,setActiveTab:E,nextTab:function(){var e=b.findIndex((function(e){return e.value===N}))+1;e<b.length&&E(b[e].value)},previousTab:function(){var e=b.findIndex((function(e){return e.value===N}))-1;e>=0&&E(b[e].value)},tabs:b}},e.createElement("div",c({className:"".concat(T," ").concat(f),"data-accent-color":m},p),t))};p.displayName=d;var T=function(a){var t=a.tabs,n=void 0===t?[]:t;l(a,["tabs"]);var r=o(n[0].value||"");r[0],r[1];var c=n[0].value||"";return e.createElement(p,{tabs:n,defaultTab:c},e.createElement(b,null),e.createElement(m,null))};T.List=b,T.Content=m,T.Root=p;export{T as default};
1
+ 'use client';import t,{createContext as e,useContext as a,useRef as n,useState as r}from"react";var o=function(){return o=Object.assign||function(t){for(var e,a=1,n=arguments.length;a<n;a++)for(var r in e=arguments[a])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)};function c(t,e){var a={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(a[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(a[n[r]]=t[n[r]])}return a}"function"==typeof SuppressedError&&SuppressedError;var l=e(null),u=function(e){var n=e.className,r=void 0===n?"":n,o=e.children,c=a(l).rootClass;return t.createElement("div",{role:"tablist","aria-orientation":"horizontal","aria-label":"todo",className:"".concat(c,"-list ").concat(r)},o)};u.displayName="TabList";var i=function(e){var r=e.tab,u=e.className,i=void 0===u?"":u,s=c(e,["tab","className"]),v=a(l),b=v.previousTab,f=v.nextTab,d=v.activeTab,m=v.setActiveTab,p=v.rootClass,y=n(null),T=d===r.value;return t.createElement("button",o({ref:y,role:"tab",className:"".concat(p,"-trigger ").concat(T?"active":""," ").concat(i)},s,{onKeyDown:function(t){"ArrowLeft"==t.key&&b(),"ArrowRight"==t.key&&f()},onClick:function(){return function(t){m(t.value)}(r)},onFocus:function(){return function(t){var e;y.current&&(null===(e=y.current)||void 0===e||e.focus()),m(t.value)}(r)},tabIndex:T?0:-1,"data-rad-ui-batch-element":!0}),r.label)};i.displayName="TabTrigger";var s=function(t,e){void 0===t&&(t=""),void 0===e&&(e="");var a=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return t||(e?"".concat("rad-ui","-").concat(a):"")},v="TabContent",b=function(e){var n=e.className,r=e.customRootClass,o=s(r,v),c=a(l),u=c.tabs,i=c.activeTab;return c.setActiveTab,t.createElement("div",{className:"".concat(o," ").concat(n)},u.map((function(e,a){return e.value===i?t.createElement("div",{key:a},e.content):null})))};b.displayName=v;var f=function(t){return t.querySelectorAll("[data-rad-ui-batch-element]")},d=function(t){var e=null;return t.forEach((function(t){t.hasAttribute("data-rad-ui-focus-element")&&(e=t)})),e},m="Tabs",p=function(e){var a=e.children,u=e.defaultTab,i=void 0===u?"":u,v=e.customRootClass,b=e.tabs,p=void 0===b?[]:b,y=e.className,T=e.color,E=c(e,["children","defaultTab","customRootClass","tabs","className","color"]),h=s(v,m),g=n(null),N=r(i||p[0].value||""),O={rootClass:h,activeTab:N[0],setActiveTab:N[1],nextTab:function(){var t=function(t){var e=d(t),a=null==e?void 0:e.nextElementSibling;return a||t[t.length-1]}(f(null==g?void 0:g.current));t.focus()},previousTab:function(){var t=function(t){var e=d(t),a=null==e?void 0:e.previousElementSibling;return a||t[0]}(f(null==g?void 0:g.current));t.focus()},tabs:p};return t.createElement(l.Provider,{value:O},t.createElement("div",o({ref:g,className:"".concat(h," ").concat(y),"data-accent-color":T},E),a))};p.displayName=m;var y=function(e){var a=e.tabs,n=void 0===a?[]:a;c(e,["tabs"]);var r=n[0].value||"";return t.createElement(p,{tabs:n,defaultTab:r},t.createElement(u,null,n.map((function(e){return t.createElement(i,{key:e.value,tab:e})}))),t.createElement(b,null))};y.List=u,y.Content=b,y.Root=p;export{y as default};
@@ -1 +1 @@
1
- 'use client';import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o,useState as i}from"react";import*as l from"react-dom";var c=function(){return c=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},c.apply(this,arguments)};function s(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;function u(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function a(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function f(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function d(e){return e instanceof Node||e instanceof a(e).Node}function m(e){return e instanceof Element||e instanceof a(e).Element}function p(e){return e instanceof HTMLElement||e instanceof a(e).HTMLElement}function g(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof a(e).ShadowRoot)}function v(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=E(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function h(e){return["table","td","th"].includes(u(e))}function y(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function w(e){const t=x(),n=m(e)?E(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 x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function b(e){return["html","body","#document"].includes(u(e))}function E(e){return a(e).getComputedStyle(e)}function R(e){return m(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function C(e){if("html"===u(e))return e;const t=e.assignedSlot||e.parentNode||g(e)&&e.host||f(e);return g(t)?t.host:t}function P(e){const t=C(e);return b(t)?e.ownerDocument?e.ownerDocument.body:e.body:p(t)&&v(t)?t:P(t)}function L(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=P(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=a(o);if(i){const e=function(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}(l);return t.concat(l,l.visualViewport||[],v(o)?o:[],e&&n?L(e):[])}return t.concat(o,L(o,[],n))}function O(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function k(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function T(e){return(null==e?void 0:e.ownerDocument)||document}function M(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 S(e){return"composedPath"in e?e.composedPath()[0]:e.target}const A=["top","right","bottom","left"],D=Math.min,N=Math.max,F=Math.round,H=Math.floor,W=e=>({x:e,y:e}),I={left:"right",right:"left",bottom:"top",top:"bottom"},j={start:"end",end:"start"};function B(e,t,n){return N(e,D(t,n))}function _(e,t){return"function"==typeof e?e(t):e}function V(e){return e.split("-")[0]}function K(e){return e.split("-")[1]}function z(e){return"x"===e?"y":"x"}function X(e){return"y"===e?"height":"width"}function $(e){return["top","bottom"].includes(V(e))?"y":"x"}function Y(e){return z($(e))}function q(e){return e.replace(/start|end/g,(e=>j[e]))}function U(e){return e.replace(/left|right|bottom|top/g,(e=>I[e]))}function Z(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 Q(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function G(e,t,n){let{reference:r,floating:o}=e;const i=$(t),l=Y(t),c=X(l),s=V(t),u="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 m;switch(s){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(K(t)){case"start":m[l]-=d*(n&&u?-1:1);break;case"end":m[l]+=d*(n&&u?-1:1)}return m}async function J(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=_(t,e),p=Z(m),g=c[d?"floating"===f?"reference":"floating":f],v=Q(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:a,strategy:s})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(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},x=Q(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:h,offsetParent:y,strategy:s}):h);return{top:(v.top-x.top+p.top)/w.y,bottom:(x.bottom-v.bottom+p.bottom)/w.y,left:(v.left-x.left+p.left)/w.x,right:(x.right-v.right+p.right)/w.x}}function ee(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 A.some((t=>e[t]>=0))}function ne(e){const t=E(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=p(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=F(n)!==i||F(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function re(e){return m(e)?e:e.contextElement}function oe(e){const t=re(e);if(!p(t))return W(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ne(t);let l=(i?F(n.width):n.width)/r,c=(i?F(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const ie=W(0);function le(e){const t=a(e);return x()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ie}function ce(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=re(e);let l=W(1);t&&(r?m(r)&&(l=oe(r)):l=oe(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==a(e))&&t}(i,n,r)?le(i):W(0);let s=(o.left+c.x)/l.x,u=(o.top+c.y)/l.y,f=o.width/l.x,d=o.height/l.y;if(i){const e=a(i),t=r&&m(r)?a(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=oe(o),t=o.getBoundingClientRect(),r=E(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,u*=e.y,f*=e.x,d*=e.y,s+=i,u+=l,n=a(o),o=n.frameElement}}return Q({width:f,height:d,x:s,y:u})}function se(e){return ce(f(e)).left+R(e).scrollLeft}function ue(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=a(e),r=f(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,s=0;if(o){i=o.width,l=o.height;const e=x();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=f(e),n=R(e),r=e.ownerDocument.body,o=N(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=N(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+se(e);const c=-n.scrollTop;return"rtl"===E(r).direction&&(l+=N(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(f(e));else if(m(t))r=function(e,t){const n=ce(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=p(e)?oe(e):W(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=le(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return Q(r)}function ae(e,t){const n=C(e);return!(n===t||!m(n)||b(n))&&("fixed"===E(n).position||ae(n,t))}function fe(e,t,n){const r=p(t),o=f(t),i="fixed"===n,l=ce(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=W(0);if(r||!r&&!i)if(("body"!==u(t)||v(o))&&(c=R(t)),r){const e=ce(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=se(o));return{x:l.left+c.scrollLeft-s.x,y:l.top+c.scrollTop-s.y,width:l.width,height:l.height}}function de(e){return"static"===E(e).position}function me(e,t){return p(e)&&"fixed"!==E(e).position?t?t(e):e.offsetParent:null}function pe(e,t){const n=a(e);if(y(e))return n;if(!p(e)){let t=C(e);for(;t&&!b(t);){if(m(t)&&!de(t))return t;t=C(t)}return n}let r=me(e,t);for(;r&&h(r)&&de(r);)r=me(r,t);return r&&b(r)&&de(r)&&!w(r)?n:r||function(e){let t=C(e);for(;p(t)&&!b(t);){if(w(t))return t;if(y(t))return null;t=C(t)}return null}(e)||n}const ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=f(r),c=!!t&&y(t.floating);if(r===l||c&&i)return n;let s={scrollLeft:0,scrollTop:0},a=W(1);const d=W(0),m=p(r);if((m||!m&&!i)&&(("body"!==u(r)||v(l))&&(s=R(r)),p(r))){const e=ce(r);a=oe(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+d.x,y:n.y*a.y-s.scrollTop*a.y+d.y}},getDocumentElement:f,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?y(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=L(e,[],!1).filter((e=>m(e)&&"body"!==u(e))),o=null;const i="fixed"===E(e).position;let l=i?C(e):e;for(;m(l)&&!b(l);){const t=E(l),n=w(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||v(l)&&!n&&ae(e,l))?r=r.filter((e=>e!==l)):o=t,l=C(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=ue(t,n,o);return e.top=N(r.top,e.top),e.right=D(r.right,e.right),e.bottom=D(r.bottom,e.bottom),e.left=N(r.left,e.left),e}),ue(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:pe,getElementRects:async function(e){const t=this.getOffsetParent||pe,n=this.getDimensions,r=await n(e.floating);return{reference:fe(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ne(e);return{width:t,height:n}},getScale:oe,isElement:m,isRTL:function(e){return"rtl"===E(e).direction}};function ve(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,u=re(e),a=o||i?[...u?L(u):[],...L(t)]:[];a.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=u&&c?function(e,t){let n,r=null;const o=f(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const{left:u,top:a,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const m={rootMargin:-H(a)+"px "+-H(o.clientWidth-(u+f))+"px "+-H(o.clientHeight-(a+d))+"px "+-H(u)+"px",threshold:N(0,D(1,s))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==s){if(!p)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(u,n):null;let m,p=-1,g=null;l&&(g=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=g)||e.observe(t)}))),n()})),u&&!s&&g.observe(u),g.observe(t));let v=s?ce(e):null;return s&&function t(){const r=ce(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;a.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=g)||e.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const he=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,s=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=V(n),c=K(n),s="y"===$(n),u=["left","top"].includes(l)?-1:1,a=i&&s?-1:1,f=_(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),s?{x:m*a,y:d*u}:{x:d*u,y:m*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,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}}},...s}=_(e,t),u={x:n,y:r},a=await J(t,s),f=$(V(o)),d=z(f);let m=u[d],p=u[f];if(i){const e="y"===d?"bottom":"right";m=B(m+a["y"===d?"top":"left"],m,m-a[e])}if(l){const e="y"===f?"bottom":"right";p=B(p+a["y"===f?"top":"left"],p,p-a[e])}const g=c.fn({...t,[d]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r}}}}},we=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:s,elements:u}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=_(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=V(o),y=$(c),w=V(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(u.floating)),b=d||(w||!g?[U(c)]:function(e){const t=U(e);return[q(e),t,q(t)]}(c)),E="none"!==p;!d&&E&&b.push(...function(e,t,n,r){const o=K(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[]}}(V(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(q)))),i}(c,g,p,x));const R=[c,...b],C=await J(t,v),P=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&P.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=K(e),o=Y(e),i=X(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=U(l)),[l,U(l)]}(o,l,x);P.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:P}],!P.every((e=>e<=0))){var O,k;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(k=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:k.placement;if(!n)switch(m){case"bestFit":{var T;const e=null==(T=L.filter((e=>{if(E){const t=$(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:T[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},xe=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=_(e,t);switch(r){case"referenceHidden":{const e=ee(await J(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:te(e)}}}case"escaped":{const e=ee(await J(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:te(e)}}}default:return{}}}}},be=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:s}=t,{element:u,padding:a=0}=_(e,t)||{};if(null==u)return{};const f=Z(a),d={x:n,y:r},m=Y(o),p=X(m),g=await l.getDimensions(u),v="y"===m,h=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[m]-d[m]-i.floating[p],b=d[m]-i.reference[m],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[p]);const C=x/2-b/2,P=R/2-g[p]/2-1,L=D(f[h],P),O=D(f[y],P),k=L,T=R-g[p]-O,M=R/2-g[p]/2+C,S=B(k,M,T),A=!s.arrow&&null!=K(o)&&M!==S&&i.reference[p]/2-(M<k?L:O)-g[p]/2<0,N=A?M<k?M-k:M-T:0;return{[m]:d[m]+N,data:{[m]:S,centerOffset:M-S-N,...A&&{alignmentOffset:N}},reset:A}}}),Ee=(e,t,n)=>{const r=new Map,o={platform:ge,...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),s=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=G(u,r,s),d=r,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:v,y:h,data:y,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:u,platform:l,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(u=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=G(u,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var Re="undefined"!=typeof document?n:r;function Ce(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Ce(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Ce(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Pe(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Le(e,t){const n=Pe(e);return Math.round(t*n)/n}function Oe(t){const n=e.useRef(t);return Re((()=>{n.current=t})),n}const ke=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?be({element:n.current,padding:r}).fn(t):{}:n?be({element:n,padding:r}).fn(t):{};var o}}),Te=(e,t)=>({...he(e),options:[e,t]}),Me=(e,t)=>({...ye(e),options:[e,t]}),Se=(e,t)=>({...we(e),options:[e,t]}),Ae=(e,t)=>({...xe(e),options:[e,t]}),De={...e},Ne=De.useInsertionEffect||(e=>e());function Fe(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Ne((()=>{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 He="undefined"!=typeof document?n:r;function We(){return We=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},We.apply(this,arguments)}let Ie=!1,je=0;const Be=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+je++;const _e=De.useId||function(){const[t,n]=e.useState((()=>Ie?Be():void 0));return He((()=>{null==t&&n(Be())}),[]),e.useEffect((()=>{Ie=!0}),[]),t};let Ve;"production"!==process.env.NODE_ENV&&(Ve=new Set);const Ke=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i}},width:l=14,height:c=7,tipRadius:s=0,strokeWidth:u=0,staticOffset:a,stroke:f,d:d,style:{transform:m,...p}={},...g}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Ve)&&e.has(o)||(null==(i=Ve)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const v=_e(),[h,y]=e.useState(!1);if(He((()=>{if(!o)return;"rtl"===E(o).direction&&y(!0)}),[o]),!o)return null;const w=2*u,x=w/2,b=l/2*(s/-8+1),R=c/2*s/4,[C,P]=r.split("-"),L=!!d,O="top"===C||"bottom"===C,k=a&&"end"===P?"bottom":"top";let T=a&&"end"===P?"right":"left";a&&h&&(T="end"===P?"left":"right");const M=null!=(null==i?void 0:i.x)?a||i.x:"",S=null!=(null==i?void 0:i.y)?a||i.y:"",A=d||"M0,0 H"+l+" L"+(l-b)+","+(c-R)+" Q"+l/2+","+c+" "+b+","+(c-R)+" Z",D={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[C];return e.createElement("svg",We({},g,{"aria-hidden":!0,ref:n,width:L?l:l+w,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[T]:M,[k]:S,[C]:O||L?"100%":"calc(100% - "+w/2+"px)",transform:""+D+(null!=m?m:""),...p}}),w>0&&e.createElement("path",{clipPath:"url(#"+v+")",fill:"none",stroke:f,strokeWidth:w+(d?0:1),d:A}),e.createElement("path",{stroke:w&&!d?g.fill:"none",d:A}),e.createElement("clipPath",{id:v},e.createElement("rect",{x:-x,y:x*(L?-1:1),width:l+w,height:l})))}));const ze=e.createContext(null),Xe=e.createContext(null),$e=()=>{var t;return(null==(t=e.useContext(ze))?void 0:t.id)||null},Ye=()=>e.useContext(Xe);function qe(e){return"data-floating-ui-"+e}function Ue(e){const t=o(e);return He((()=>{t.current=e})),t}const Ze=qe("safe-polygon");function Qe(e,t,n){return n&&!k(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Ge(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const Je={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},et={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},tt=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 nt(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=_e(),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)))||[])}}}())),s=null!=$e();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!m(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Ve)&&e.has(o)||(null==(i=Ve)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,a]=e.useState(o.reference),f=Fe(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:s}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:u||o.reference||null,floating:o.floating||null,domReference:o.reference})),[u,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])}function rt(t){void 0===t&&(t={});const{nodeId:n}=t,r=nt({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,s]=e.useState(null),[u,a]=e.useState(null),f=(null==i?void 0:i.reference)||c,d=e.useRef(null),p=Ye();He((()=>{f&&(d.current=f)}),[f]);const g=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:s}={},transform:u=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,g]=e.useState(o);Ce(p,o)||g(o);const[v,h]=e.useState(null),[y,w]=e.useState(null),x=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),b=e.useCallback((e=>{e!==P.current&&(P.current=e,w(e))}),[]),E=c||v,R=s||y,C=e.useRef(null),P=e.useRef(null),L=e.useRef(d),O=null!=a,k=Oe(a),T=Oe(i),M=e.useCallback((()=>{if(!C.current||!P.current)return;const e={placement:n,strategy:r,middleware:p};T.current&&(e.platform=T.current),Ee(C.current,P.current,e).then((e=>{const t={...e,isPositioned:!0};S.current&&!Ce(L.current,t)&&(L.current=t,l.flushSync((()=>{m(t)})))}))}),[p,n,r,T]);Re((()=>{!1===f&&L.current.isPositioned&&(L.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const S=e.useRef(!1);Re((()=>(S.current=!0,()=>{S.current=!1})),[]),Re((()=>{if(E&&(C.current=E),R&&(P.current=R),E&&R){if(k.current)return k.current(E,R,M);M()}}),[E,R,M,k,O]);const A=e.useMemo((()=>({reference:C,floating:P,setReference:x,setFloating:b})),[x,b]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),N=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=Le(D.floating,d.x),n=Le(D.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...Pe(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:M,refs:A,elements:D,floatingStyles:N})),[d,M,A,D,N])}({...t,elements:{...i,...u&&{reference:u}}}),v=e.useCallback((e=>{const t=m(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),g.refs.setReference(t)}),[g.refs]),h=e.useCallback((e=>{(m(e)||null===e)&&(d.current=e,s(e)),(m(g.refs.reference.current)||null===g.refs.reference.current||null!==e&&!m(e))&&g.refs.setReference(e)}),[g.refs]),y=e.useMemo((()=>({...g.refs,setReference:h,setPositionReference:v,domReference:d})),[g.refs,h,v]),w=e.useMemo((()=>({...g.elements,domReference:f})),[g.elements,f]),x=e.useMemo((()=>({...g,...o,refs:y,elements:w,nodeId:n})),[g,y,w,n,o]);return He((()=>{o.dataRef.current.floatingContext=x;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=x)})),e.useMemo((()=>({...g,context:x,refs:y,elements:w})),[g,y,w,x])}const ot="active",it="selected";function lt(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[ot]:t,[it]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1},...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&&[ot,it].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 ct=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var st=function(n){var r=n.popperName,l=void 0===r?"":r,u=n.customRootClass,a=void 0===u?"":u;n.activationStrategy;var f=n.className,d=void 0===f?"":f,g=n.placement,v=void 0===g?"top":g,h=n.children,y=n.open,w=void 0!==y&&y;n.hoverDelay;var x=n.showArrow,R=void 0===x||x,P=n.pop,A=void 0===P?t.createElement(t.Fragment,null):P;s(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var D,N,F=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?"".concat("rad-ui","-").concat(n):"")}(a,l),H=o(null),W=i(w),I=W[0],j=W[1],B=rt({placement:v,whileElementsMounted:ve,open:I,middleware:[(D={element:H},{...ke(D),options:[D,N]}),Te(9),Se({mainAxis:!0,fallbackStrategy:"initialPlacement"}),Me({crossAxis:!1}),Ae({strategy:"referenceHidden"})],onOpenChange:j}),_=B.refs,V=B.floatingStyles,K=B.context,z=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,s=null!=(r=ct.get(c))?r:c,u=_e(),a=null!=$e(),f=e.useMemo((()=>"tooltip"===s||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":o?i:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:u},..."menu"===s&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[s,i,a,o,u,c]),d=e.useMemo((()=>{const e={id:i,...s&&{role:s}};return"tooltip"===s||"label"===c?e:{...e,..."menu"===s&&{"aria-labelledby":u}}}),[s,i,u,c]),m=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:m}:{}),[l,f,d,m])}(K),X=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:s=!0,outsidePress:u=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:g=!1,bubbles:v,capture:h}=n,y=Ye(),w=Fe("function"==typeof u?u:()=>!1),x="function"==typeof u?w:u,R=e.useRef(!1),P=e.useRef(!1),{escapeKey:k,outsidePress:A}=tt(v),{escapeKey:D,outsidePress:N}=tt(h),F=Fe((e=>{var t;if(!r||!c||!s||"Escape"!==e.key)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?Ge(y.nodesRef.current,n):[];if(!k&&(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")})),H=Fe((e=>{var t;const n=()=>{var t;F(e),null==(t=S(e))||t.removeEventListener("keydown",n)};null==(t=S(e))||t.addEventListener("keydown",n)})),W=Fe((e=>{var t;const n=R.current;R.current=!1;const r=P.current;if(P.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof x&&!x(e))return;const c=S(e),s="["+qe("inert")+"]",u=T(i.floating).querySelectorAll(s);let f=m(c)?c:null;for(;f&&!b(f);){const e=C(f);if(b(e)||!m(e))break;f=e}if(u.length&&m(c)&&!c.matches("html,body")&&!O(c,i.floating)&&Array.from(u).every((e=>!O(f,e))))return;if(p(c)&&B){const t=c.clientWidth>0&&c.scrollWidth>c.clientWidth,n=c.clientHeight>0&&c.scrollHeight>c.clientHeight;let r=n&&e.offsetX>c.clientWidth;if(n&&"rtl"===E(c).direction&&(r=e.offsetX<=c.offsetWidth-c.clientWidth),r||t&&e.offsetY>c.clientHeight)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,g=y&&Ge(y.nodesRef.current,d).some((t=>{var n;return M(e,null==(n=t.context)?void 0:n.elements.floating)}));if(M(e,i.floating)||M(e,i.domReference)||g)return;const v=y?Ge(y.nodesRef.current,d):[];if(v.length>0){let e=!0;if(v.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),I=Fe((e=>{var t;const n=()=>{var t;W(e),null==(t=S(e))||t.removeEventListener(a,n)};null==(t=S(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!c)return;function e(e){o(!1,e,"ancestor-scroll")}l.current.__escapeKeyBubbles=k,l.current.__outsidePressBubbles=A;const t=T(i.floating);s&&t.addEventListener("keydown",D?H:F,D),x&&t.addEventListener(a,N?I:W,N);let n=[];return g&&(m(i.domReference)&&(n=L(i.domReference)),m(i.floating)&&(n=n.concat(L(i.floating))),!m(i.reference)&&i.reference&&i.reference.contextElement&&(n=n.concat(L(i.reference.contextElement)))),n=n.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),n.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{s&&t.removeEventListener("keydown",D?H:F,D),x&&t.removeEventListener(a,N?I:W,N),n.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[l,i,s,x,a,r,o,g,c,k,A,F,D,H,W,N,I]),e.useEffect((()=>{R.current=!1}),[x,a]);const j=e.useMemo((()=>({onKeyDown:F,[Je[d]]:e=>{f&&o(!1,e.nativeEvent,"reference-press")}})),[F,o,f,d]),B=e.useMemo((()=>({onKeyDown:F,onMouseDown(){P.current=!0},onMouseUp(){P.current=!0},[et[a]]:()=>{R.current=!0}})),[F,a]);return e.useMemo((()=>c?{reference:j,floating:B}:{}),[c,j,B])}(K),$=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:s=!0,delay:u=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,g=Ye(),v=$e(),h=Ue(a),y=Ue(u),w=Ue(r),x=e.useRef(),b=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),P=e.useRef(!1),L=e.useRef((()=>{})),M=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(s)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(R.current),C.current=!0)}}),[s,l]),e.useEffect((()=>{if(!s)return;if(!h.current)return;if(!r)return;function e(e){M()&&o(!1,e,"hover")}const t=T(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,s,h,M]);const S=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Qe(y.current,"close",x.current);r&&!E.current?(clearTimeout(b.current),b.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(b.current),o(!1,e,n))}),[y,o]),A=Fe((()=>{L.current(),E.current=void 0})),D=Fe((()=>{if(P.current){const e=T(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Ze),P.current=!1}}));e.useEffect((()=>{if(s&&m(c.domReference)){var e;const t=c.domReference;return r&&t.addEventListener("mouseleave",u),null==(e=c.floating)||e.addEventListener("mouseleave",u),p&&t.addEventListener("mousemove",n,{once:!0}),t.addEventListener("mouseenter",n),t.addEventListener("mouseleave",l),()=>{var e;r&&t.removeEventListener("mouseleave",u),null==(e=c.floating)||e.removeEventListener("mouseleave",u),p&&t.removeEventListener("mousemove",n),t.removeEventListener("mouseenter",n),t.removeEventListener("mouseleave",l)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function n(e){if(clearTimeout(b.current),C.current=!1,f&&!k(x.current)||d>0&&!Qe(y.current,"open"))return;const t=Qe(y.current,"open",x.current);t?b.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):o(!0,e,"hover")}function l(e){if(t())return;L.current();const n=T(c.floating);if(clearTimeout(R.current),h.current&&i.current.floatingContext){r||clearTimeout(b.current),E.current=h.current({...i.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){D(),A(),S(e,!0,"safe-polygon")}});const t=E.current;return n.addEventListener("mousemove",t),void(L.current=()=>{n.removeEventListener("mousemove",t)})}("touch"!==x.current||!O(c.floating,e.relatedTarget))&&S(e)}function u(e){t()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){D(),A(),S(e)}})(e))}}),[c,s,t,f,d,p,S,A,D,o,r,w,g,y,h,i]),He((()=>{var e;if(s&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&M()){const e=T(c.floating).body;e.setAttribute(Ze,""),e.style.pointerEvents="none",P.current=!0;const n=c.floating;if(m(c.domReference)&&n){var t;const e=c.domReference,r=null==g||null==(t=g.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return r&&(r.style.pointerEvents=""),e.style.pointerEvents="auto",n.style.pointerEvents="auto",()=>{e.style.pointerEvents="",n.style.pointerEvents=""}}}}),[s,r,v,c,g,h,M]),He((()=>{r||(x.current=void 0,A(),D())}),[r,A,D]),e.useEffect((()=>()=>{A(),clearTimeout(b.current),clearTimeout(R.current),D()}),[s,c.domReference,A,D]);const N=e.useMemo((()=>{function e(e){x.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&&!k(x.current)||r||0===d||(clearTimeout(R.current),"touch"===x.current?n():R.current=window.setTimeout(n,d))}}}),[f,o,r,w,d]),F=e.useMemo((()=>({onMouseEnter(){clearTimeout(b.current)},onMouseLeave(e){S(e.nativeEvent,!1)}})),[S]);return e.useMemo((()=>s?{reference:N,floating:F}:{}),[s,N,F])}(K,{}),Y=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=>lt(e,t,"reference")),n),l=e.useCallback((e=>lt(e,t,"floating")),r),c=e.useCallback((e=>lt(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([$,z,X]),q=Y.getReferenceProps,U=Y.getFloatingProps;return t.createElement("span",null,t.createElement("span",c({className:"rad-ui-popper ".concat(F,"-reference-element ").concat(d),ref:_.setReference},q({onClick:function(){console.log("click")}})),h),I&&t.createElement("div",c({className:"".concat(F,"-floating-element"),ref:_.setFloating,style:V},U()),R&&t.createElement(Ke,{className:"rad-ui-arrow ".concat(F,"-arrow"),ref:H,context:K}),A))},ut=function(e){var n=e.children;e.label;var r=s(e,["children","label"]);return t.createElement("div",null,t.createElement(st,c({popperName:"Tooltip",pop:"hello"},r),n))};export{ut as default};
1
+ 'use client';import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o,useState as i}from"react";import*as l from"react-dom";var c=function(){return c=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},c.apply(this,arguments)};function s(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;function u(){return"undefined"!=typeof window}function a(e){return m(e)?(e.nodeName||"").toLowerCase():"#document"}function f(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function d(e){var t;return null==(t=(m(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function m(e){return!!u()&&(e instanceof Node||e instanceof f(e).Node)}function p(e){return!!u()&&(e instanceof Element||e instanceof f(e).Element)}function g(e){return!!u()&&(e instanceof HTMLElement||e instanceof f(e).HTMLElement)}function v(e){return!(!u()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof f(e).ShadowRoot)}function h(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=R(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function y(e){return["table","td","th"].includes(a(e))}function w(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function x(e){const t=b(),n=p(e)?R(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 b(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function E(e){return["html","body","#document"].includes(a(e))}function R(e){return f(e).getComputedStyle(e)}function C(e){return p(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function L(e){if("html"===a(e))return e;const t=e.assignedSlot||e.parentNode||v(e)&&e.host||d(e);return v(t)?t.host:t}function P(e){const t=L(e);return E(t)?e.ownerDocument?e.ownerDocument.body:e.body:g(t)&&h(t)?t:P(t)}function O(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=P(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=f(o);if(i){const e=T(l);return t.concat(l,l.visualViewport||[],h(o)?o:[],e&&n?O(e):[])}return t.concat(o,O(o,[],n))}function T(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function k(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&v(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function M(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function S(e){return(null==e?void 0:e.ownerDocument)||document}function A(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 D(e){return"composedPath"in e?e.composedPath()[0]:e.target}const N=["top","right","bottom","left"],F=Math.min,H=Math.max,W=Math.round,j=Math.floor,B=e=>({x:e,y:e}),I={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function V(e,t,n){return H(e,F(t,n))}function K(e,t){return"function"==typeof e?e(t):e}function z(e){return e.split("-")[0]}function X(e){return e.split("-")[1]}function Y(e){return"x"===e?"y":"x"}function $(e){return"y"===e?"height":"width"}function q(e){return["top","bottom"].includes(z(e))?"y":"x"}function U(e){return Y(q(e))}function Z(e){return e.replace(/start|end/g,(e=>_[e]))}function Q(e){return e.replace(/left|right|bottom|top/g,(e=>I[e]))}function G(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 J(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function ee(e,t,n){let{reference:r,floating:o}=e;const i=q(t),l=U(t),c=$(l),s=z(t),u="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 m;switch(s){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(X(t)){case"start":m[l]-=d*(n&&u?-1:1);break;case"end":m[l]+=d*(n&&u?-1:1)}return m}async function te(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=K(t,e),p=G(m),g=c[d?"floating"===f?"reference":"floating":f],v=J(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:a,strategy:s})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(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},x=J(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:h,offsetParent:y,strategy:s}):h);return{top:(v.top-x.top+p.top)/w.y,bottom:(x.bottom-v.bottom+p.bottom)/w.y,left:(v.left-x.left+p.left)/w.x,right:(x.right-v.right+p.right)/w.x}}function ne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function re(e){return N.some((t=>e[t]>=0))}function oe(e){const t=R(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=g(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=W(n)!==i||W(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function ie(e){return p(e)?e:e.contextElement}function le(e){const t=ie(e);if(!g(t))return B(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=oe(t);let l=(i?W(n.width):n.width)/r,c=(i?W(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const ce=B(0);function se(e){const t=f(e);return b()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ce}function ue(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ie(e);let l=B(1);t&&(r?p(r)&&(l=le(r)):l=le(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==f(e))&&t}(i,n,r)?se(i):B(0);let s=(o.left+c.x)/l.x,u=(o.top+c.y)/l.y,a=o.width/l.x,d=o.height/l.y;if(i){const e=f(i),t=r&&p(r)?f(r):r;let n=e,o=T(n);for(;o&&r&&t!==n;){const e=le(o),t=o.getBoundingClientRect(),r=R(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,u*=e.y,a*=e.x,d*=e.y,s+=i,u+=l,n=f(o),o=T(n)}}return J({width:a,height:d,x:s,y:u})}function ae(e,t){const n=C(e).scrollLeft;return t?t.left+n:ue(d(e)).left+n}function fe(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:ae(e,r)),y:r.top+t.scrollTop}}function de(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=f(e),r=d(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,s=0;if(o){i=o.width,l=o.height;const e=b();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=d(e),n=C(e),r=e.ownerDocument.body,o=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ae(e);const c=-n.scrollTop;return"rtl"===R(r).direction&&(l+=H(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(d(e));else if(p(t))r=function(e,t){const n=ue(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=g(e)?le(e):B(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=se(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return J(r)}function me(e,t){const n=L(e);return!(n===t||!p(n)||E(n))&&("fixed"===R(n).position||me(n,t))}function pe(e,t,n){const r=g(t),o=d(t),i="fixed"===n,l=ue(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=B(0);if(r||!r&&!i)if(("body"!==a(t)||h(o))&&(c=C(t)),r){const e=ue(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=ae(o));const u=!o||r||i?B(0):fe(o,c);return{x:l.left+c.scrollLeft-s.x-u.x,y:l.top+c.scrollTop-s.y-u.y,width:l.width,height:l.height}}function ge(e){return"static"===R(e).position}function ve(e,t){if(!g(e)||"fixed"===R(e).position)return null;if(t)return t(e);let n=e.offsetParent;return d(e)===n&&(n=n.ownerDocument.body),n}function he(e,t){const n=f(e);if(w(e))return n;if(!g(e)){let t=L(e);for(;t&&!E(t);){if(p(t)&&!ge(t))return t;t=L(t)}return n}let r=ve(e,t);for(;r&&y(r)&&ge(r);)r=ve(r,t);return r&&E(r)&&ge(r)&&!x(r)?n:r||function(e){let t=L(e);for(;g(t)&&!E(t);){if(x(t))return t;if(w(t))return null;t=L(t)}return null}(e)||n}const ye={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=d(r),c=!!t&&w(t.floating);if(r===l||c&&i)return n;let s={scrollLeft:0,scrollTop:0},u=B(1);const f=B(0),m=g(r);if((m||!m&&!i)&&(("body"!==a(r)||h(l))&&(s=C(r)),g(r))){const e=ue(r);u=le(r),f.x=e.x+r.clientLeft,f.y=e.y+r.clientTop}const p=!l||m||i?B(0):fe(l,s,!0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-s.scrollLeft*u.x+f.x+p.x,y:n.y*u.y-s.scrollTop*u.y+f.y+p.y}},getDocumentElement:d,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?w(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=O(e,[],!1).filter((e=>p(e)&&"body"!==a(e))),o=null;const i="fixed"===R(e).position;let l=i?L(e):e;for(;p(l)&&!E(l);){const t=R(l),n=x(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||h(l)&&!n&&me(e,l))?r=r.filter((e=>e!==l)):o=t,l=L(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=de(t,n,o);return e.top=H(r.top,e.top),e.right=F(r.right,e.right),e.bottom=F(r.bottom,e.bottom),e.left=H(r.left,e.left),e}),de(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:he,getElementRects:async function(e){const t=this.getOffsetParent||he,n=this.getDimensions,r=await n(e.floating);return{reference:pe(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}=oe(e);return{width:t,height:n}},getScale:le,isElement:p,isRTL:function(e){return"rtl"===R(e).direction}};function we(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,u=ie(e),a=o||i?[...u?O(u):[],...O(t)]:[];a.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=u&&c?function(e,t){let n,r=null;const o=d(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const{left:u,top:a,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const m={rootMargin:-j(a)+"px "+-j(o.clientWidth-(u+f))+"px "+-j(o.clientHeight-(a+d))+"px "+-j(u)+"px",threshold:H(0,F(1,s))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==s){if(!p)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(u,n):null;let m,p=-1,g=null;l&&(g=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=g)||e.observe(t)}))),n()})),u&&!s&&g.observe(u),g.observe(t));let v=s?ue(e):null;return s&&function t(){const r=ue(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;a.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=g)||e.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const xe=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,s=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=z(n),c=X(n),s="y"===q(n),u=["left","top"].includes(l)?-1:1,a=i&&s?-1:1,f=K(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),s?{x:m*a,y:d*u}:{x:d*u,y:m*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},be=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}}},...s}=K(e,t),u={x:n,y:r},a=await te(t,s),f=q(z(o)),d=Y(f);let m=u[d],p=u[f];if(i){const e="y"===d?"bottom":"right";m=V(m+a["y"===d?"top":"left"],m,m-a[e])}if(l){const e="y"===f?"bottom":"right";p=V(p+a["y"===f?"top":"left"],p,p-a[e])}const g=c.fn({...t,[d]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[d]:i,[f]:l}}}}}},Ee=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:s,elements:u}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=K(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=z(o),y=q(c),w=z(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(u.floating)),b=d||(w||!g?[Q(c)]:function(e){const t=Q(e);return[Z(e),t,Z(t)]}(c)),E="none"!==p;!d&&E&&b.push(...function(e,t,n,r){const o=X(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[]}}(z(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Z)))),i}(c,g,p,x));const R=[c,...b],C=await te(t,v),L=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&L.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=X(e),o=U(e),i=$(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Q(l)),[l,Q(l)]}(o,l,x);L.push(C[e[0]],C[e[1]])}if(P=[...P,{placement:o,overflows:L}],!L.every((e=>e<=0))){var O,T;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(T=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(m){case"bestFit":{var k;const e=null==(k=P.filter((e=>{if(E){const t=q(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=c}if(o!==n)return{reset:{placement:n}}}return{}}}},Re=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=K(e,t);switch(r){case"referenceHidden":{const e=ne(await te(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:re(e)}}}case"escaped":{const e=ne(await te(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:re(e)}}}default:return{}}}}},Ce=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:s}=t,{element:u,padding:a=0}=K(e,t)||{};if(null==u)return{};const f=G(a),d={x:n,y:r},m=U(o),p=$(m),g=await l.getDimensions(u),v="y"===m,h=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[m]-d[m]-i.floating[p],b=d[m]-i.reference[m],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[p]);const C=x/2-b/2,L=R/2-g[p]/2-1,P=F(f[h],L),O=F(f[y],L),T=P,k=R-g[p]-O,M=R/2-g[p]/2+C,S=V(T,M,k),A=!s.arrow&&null!=X(o)&&M!==S&&i.reference[p]/2-(M<T?P:O)-g[p]/2<0,D=A?M<T?M-T:M-k:0;return{[m]:d[m]+D,data:{[m]:S,centerOffset:M-S-D,...A&&{alignmentOffset:D}},reset:A}}}),Le=(e,t,n)=>{const r=new Map,o={platform:ye,...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),s=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=ee(u,r,s),d=r,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:v,y:h,data:y,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:u,platform:l,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(u=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=ee(u,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var Pe="undefined"!=typeof document?n:r;function Oe(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(!Oe(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)&&!Oe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Te(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ke(e,t){const n=Te(e);return Math.round(t*n)/n}function Me(t){const n=e.useRef(t);return Pe((()=>{n.current=t})),n}const Se=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?Ce({element:n.current,padding:r}).fn(t):{}:n?Ce({element:n,padding:r}).fn(t):{};var o}}),Ae=(e,t)=>({...xe(e),options:[e,t]}),De=(e,t)=>({...be(e),options:[e,t]}),Ne=(e,t)=>({...Ee(e),options:[e,t]}),Fe=(e,t)=>({...Re(e),options:[e,t]}),He={...e},We=He.useInsertionEffect||(e=>e());function je(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return We((()=>{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 Be="undefined"!=typeof document?n:r;function Ie(){return Ie=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},Ie.apply(this,arguments)}let _e=!1,Ve=0;const Ke=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ve++;const ze=He.useId||function(){const[t,n]=e.useState((()=>_e?Ke():void 0));return Be((()=>{null==t&&n(Ke())}),[]),e.useEffect((()=>{_e=!0}),[]),t};let Xe;"production"!==process.env.NODE_ENV&&(Xe=new Set);const Ye=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:s=7,tipRadius:u=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:p,...g}={},...v}=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=Xe)&&e.has(o)||(null==(i=Xe)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const h=ze(),[y,w]=e.useState(!1);if(Be((()=>{if(!o)return;"rtl"===R(o).direction&&w(!0)}),[o]),!o)return null;const[x,b]=r.split("-"),E="top"===x||"bottom"===x;let C=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(C=null);const L=2*a,P=L/2,O=c/2*(u/-8+1),T=s/2*u/4,k=!!m,M=C&&"end"===b?"bottom":"top";let S=C&&"end"===b?"right":"left";C&&y&&(S="end"===b?"left":"right");const A=null!=(null==i?void 0:i.x)?C||i.x:"",D=null!=(null==i?void 0:i.y)?C||i.y:"",N=m||"M0,0 H"+c+" L"+(c-O)+","+(s-T)+" Q"+c/2+","+s+" "+O+","+(s-T)+" Z",F={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return e.createElement("svg",Ie({},v,{"aria-hidden":!0,ref:n,width:k?c:c+L,height:c,viewBox:"0 0 "+c+" "+(s>c?s:c),style:{position:"absolute",pointerEvents:"none",[S]:A,[M]:D,[x]:E||k?"100%":"calc(100% - "+L/2+"px)",transform:[F,p].filter((e=>!!e)).join(" "),...g}}),L>0&&e.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:L+(m?0:1),d:N}),e.createElement("path",{stroke:L&&!m?v.fill:"none",d:N}),e.createElement("clipPath",{id:h},e.createElement("rect",{x:-P,y:P*(k?-1:1),width:c+L,height:c})))}));const $e=e.createContext(null),qe=e.createContext(null),Ue=()=>{var t;return(null==(t=e.useContext($e))?void 0:t.id)||null},Ze=()=>e.useContext(qe);function Qe(e){return"data-floating-ui-"+e}function Ge(e){const t=o(e);return Be((()=>{t.current=e})),t}const Je=Qe("safe-polygon");function et(e,t,n){return n&&!M(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function tt(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}const nt="data-floating-ui-focusable",rt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ot={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},it=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 lt(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=ze(),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)))||[])}}}())),s=null!=Ue();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!p(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=Xe)&&e.has(o)||(null==(i=Xe)||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[u,a]=e.useState(o.reference),f=je(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:s}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),m=e.useMemo((()=>({reference:u||o.reference||null,floating:o.floating||null,domReference:o.reference})),[u,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:m,events:c,floatingId:i,refs:d})),[n,f,m,c,i,d])}function ct(t){void 0===t&&(t={});const{nodeId:n}=t,r=lt({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,s]=e.useState(null),[u,a]=e.useState(null),f=(null==i?void 0:i.domReference)||c,d=e.useRef(null),m=Ze();Be((()=>{f&&(d.current=f)}),[f]);const g=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:s}={},transform:u=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,g]=e.useState(o);Oe(p,o)||g(o);const[v,h]=e.useState(null),[y,w]=e.useState(null),x=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),b=e.useCallback((e=>{e!==L.current&&(L.current=e,w(e))}),[]),E=c||v,R=s||y,C=e.useRef(null),L=e.useRef(null),P=e.useRef(d),O=null!=a,T=Me(a),k=Me(i),M=Me(f),S=e.useCallback((()=>{if(!C.current||!L.current)return;const e={placement:n,strategy:r,middleware:p};k.current&&(e.platform=k.current),Le(C.current,L.current,e).then((e=>{const t={...e,isPositioned:!1!==M.current};A.current&&!Oe(P.current,t)&&(P.current=t,l.flushSync((()=>{m(t)})))}))}),[p,n,r,k,M]);Pe((()=>{!1===f&&P.current.isPositioned&&(P.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const A=e.useRef(!1);Pe((()=>(A.current=!0,()=>{A.current=!1})),[]),Pe((()=>{if(E&&(C.current=E),R&&(L.current=R),E&&R){if(T.current)return T.current(E,R,S);S()}}),[E,R,S,T,O]);const D=e.useMemo((()=>({reference:C,floating:L,setReference:x,setFloating:b})),[x,b]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=ke(N.floating,d.x),n=ke(N.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...Te(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:S,refs:D,elements:N,floatingStyles:F})),[d,S,D,N,F])}({...t,elements:{...i,...u&&{reference:u}}}),v=e.useCallback((e=>{const t=p(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),g.refs.setReference(t)}),[g.refs]),h=e.useCallback((e=>{(p(e)||null===e)&&(d.current=e,s(e)),(p(g.refs.reference.current)||null===g.refs.reference.current||null!==e&&!p(e))&&g.refs.setReference(e)}),[g.refs]),y=e.useMemo((()=>({...g.refs,setReference:h,setPositionReference:v,domReference:d})),[g.refs,h,v]),w=e.useMemo((()=>({...g.elements,domReference:f})),[g.elements,f]),x=e.useMemo((()=>({...g,...o,refs:y,elements:w,nodeId:n})),[g,y,w,n,o]);return Be((()=>{o.dataRef.current.floatingContext=x;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===n));e&&(e.context=x)})),e.useMemo((()=>({...g,context:x,refs:y,elements:w})),[g,y,w,x])}const st="active",ut="selected";function at(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[st]:t,[ut]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[nt]:""},...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&&[st,ut].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 ft=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var dt=function(n){var r=n.popperName,l=void 0===r?"":r,u=n.customRootClass,a=void 0===u?"":u;n.activationStrategy;var f=n.className,d=void 0===f?"":f,m=n.placement,v=void 0===m?"top":m,h=n.children,y=n.open,w=void 0!==y&&y;n.hoverDelay;var x=n.showArrow,C=void 0===x||x,P=n.pop,T=void 0===P?t.createElement(t.Fragment,null):P;s(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var N,F,H=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?"".concat("rad-ui","-").concat(n):"")}(a,l),W=o(null),j=i(w),B=j[0],I=j[1],_=ct({placement:v,whileElementsMounted:we,open:B,middleware:[(N={element:W},{...Se(N),options:[N,F]}),Ae(9),Ne({mainAxis:!0,fallbackStrategy:"initialPlacement"}),De({crossAxis:!1}),Fe({strategy:"referenceHidden"})],onOpenChange:I}),V=_.refs,K=_.floatingStyles,z=_.context,X=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,s=null!=(r=ft.get(c))?r:c,u=ze(),a=null!=Ue(),f=e.useMemo((()=>"tooltip"===s||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":o?i:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:u},..."menu"===s&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[s,i,a,o,u,c]),d=e.useMemo((()=>{const e={id:i,...s&&{role:s}};return"tooltip"===s||"label"===c?e:{...e,..."menu"===s&&{"aria-labelledby":u}}}),[s,i,u,c]),m=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:m}:{}),[l,f,d,m])}(z),Y=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:s=!0,outsidePress:u=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:m=!1,bubbles:v,capture:h}=n,y=Ze(),w=je("function"==typeof u?u:()=>!1),x="function"==typeof u?w:u,C=e.useRef(!1),P=e.useRef(!1),{escapeKey:T,outsidePress:M}=it(v),{escapeKey:N,outsidePress:F}=it(h),H=e.useRef(!1),W=je((e=>{var t;if(!r||!c||!s||"Escape"!==e.key)return;if(H.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?tt(y.nodesRef.current,n):[];if(!T&&(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")})),j=je((e=>{var t;const n=()=>{var t;W(e),null==(t=D(e))||t.removeEventListener("keydown",n)};null==(t=D(e))||t.addEventListener("keydown",n)})),B=je((e=>{var t;const n=C.current;C.current=!1;const r=P.current;if(P.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof x&&!x(e))return;const c=D(e),s="["+Qe("inert")+"]",u=S(i.floating).querySelectorAll(s);let f=p(c)?c:null;for(;f&&!E(f);){const e=L(f);if(E(e)||!p(e))break;f=e}if(u.length&&p(c)&&!c.matches("html,body")&&!k(c,i.floating)&&Array.from(u).every((e=>!k(f,e))))return;if(g(c)&&V){const t=c.clientWidth>0&&c.scrollWidth>c.clientWidth,n=c.clientHeight>0&&c.scrollHeight>c.clientHeight;let r=n&&e.offsetX>c.clientWidth;if(n&&"rtl"===R(c).direction&&(r=e.offsetX<=c.offsetWidth-c.clientWidth),r||t&&e.offsetY>c.clientHeight)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,m=y&&tt(y.nodesRef.current,d).some((t=>{var n;return A(e,null==(n=t.context)?void 0:n.elements.floating)}));if(A(e,i.floating)||A(e,i.domReference)||m)return;const v=y?tt(y.nodesRef.current,d):[];if(v.length>0){let e=!0;if(v.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),I=je((e=>{var t;const n=()=>{var t;B(e),null==(t=D(e))||t.removeEventListener(a,n)};null==(t=D(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=T,l.current.__outsidePressBubbles=M;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),H.current=!0}function u(){e=window.setTimeout((()=>{H.current=!1}),b()?5:0)}const f=S(i.floating);s&&(f.addEventListener("keydown",N?j:W,N),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",u)),x&&f.addEventListener(a,F?I:B,F);let d=[];return m&&(p(i.domReference)&&(d=O(i.domReference)),p(i.floating)&&(d=d.concat(O(i.floating))),!p(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(O(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})})),()=>{s&&(f.removeEventListener("keydown",N?j:W,N),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",u)),x&&f.removeEventListener(a,F?I:B,F),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,s,x,a,r,o,m,c,T,M,W,N,j,B,F,I]),e.useEffect((()=>{C.current=!1}),[x,a]);const _=e.useMemo((()=>({onKeyDown:W,[rt[d]]:e=>{f&&o(!1,e.nativeEvent,"reference-press")}})),[W,o,f,d]),V=e.useMemo((()=>({onKeyDown:W,onMouseDown(){P.current=!0},onMouseUp(){P.current=!0},[ot[a]]:()=>{C.current=!0}})),[W,a]);return e.useMemo((()=>c?{reference:_,floating:V}:{}),[c,_,V])}(z),$=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:s=!0,delay:u=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:m=!0}=n,g=Ze(),v=Ue(),h=Ge(a),y=Ge(u),w=Ge(r),x=e.useRef(),b=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),L=e.useRef(!1),P=e.useRef((()=>{})),O=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(s)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[s,l]),e.useEffect((()=>{if(!s)return;if(!h.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=S(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,s,h,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=et(y.current,"close",x.current);r&&!E.current?(clearTimeout(b.current),b.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(b.current),o(!1,e,n))}),[y,o]),D=je((()=>{P.current(),E.current=void 0})),N=je((()=>{if(L.current){const e=S(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Je),L.current=!1}}));e.useEffect((()=>{if(s&&p(c.domReference)){var e;const t=c.domReference;return r&&t.addEventListener("mouseleave",u),null==(e=c.floating)||e.addEventListener("mouseleave",u),m&&t.addEventListener("mousemove",n,{once:!0}),t.addEventListener("mouseenter",n),t.addEventListener("mouseleave",l),()=>{var e;r&&t.removeEventListener("mouseleave",u),null==(e=c.floating)||e.removeEventListener("mouseleave",u),m&&t.removeEventListener("mousemove",n),t.removeEventListener("mouseenter",n),t.removeEventListener("mouseleave",l)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function n(e){if(clearTimeout(b.current),C.current=!1,f&&!M(x.current)||d>0&&!et(y.current,"open"))return;const t=et(y.current,"open",x.current);t?b.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):o(!0,e,"hover")}function l(e){if(t())return;P.current();const n=S(c.floating);if(clearTimeout(R.current),O.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(b.current),E.current=h.current({...i.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),D(),A(e,!0,"safe-polygon")}});const t=E.current;return n.addEventListener("mousemove",t),void(P.current=()=>{n.removeEventListener("mousemove",t)})}("touch"!==x.current||!k(c.floating,e.relatedTarget))&&A(e)}function u(e){t()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),D(),A(e)}})(e))}}),[c,s,t,f,d,m,A,D,N,o,r,w,g,y,h,i]),Be((()=>{var e;if(s&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&T()){L.current=!0;const e=c.floating;if(p(c.domReference)&&e){var t;const n=S(c.floating).body;n.setAttribute(Je,"");const r=c.domReference,o=null==g||null==(t=g.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=""}}}}),[s,r,v,c,g,h,T]),Be((()=>{r||(x.current=void 0,O.current=!1,D(),N())}),[r,D,N]),e.useEffect((()=>()=>{D(),clearTimeout(b.current),clearTimeout(R.current),N()}),[s,c.domReference,D,N]);const F=e.useMemo((()=>{function e(e){x.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&&!M(x.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===x.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),H=e.useMemo((()=>({onMouseEnter(){clearTimeout(b.current)},onMouseLeave(e){A(e.nativeEvent,!1)}})),[A]);return e.useMemo((()=>s?{reference:F,floating:H}:{}),[s,F,H])}(z,{}),q=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=>at(e,t,"reference")),n),l=e.useCallback((e=>at(e,t,"floating")),r),c=e.useCallback((e=>at(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([$,X,Y]),U=q.getReferenceProps,Z=q.getFloatingProps;return t.createElement("span",null,t.createElement("span",c({className:"rad-ui-popper ".concat(H,"-reference-element ").concat(d),ref:V.setReference},U({onClick:function(){console.log("click")}})),h),B&&t.createElement("div",c({className:"".concat(H,"-floating-element"),ref:V.setFloating,style:K},Z()),C&&t.createElement(Ye,{className:"rad-ui-arrow ".concat(H,"-arrow"),ref:W,context:z}),T))},mt=function(e){var n=e.children;e.label;var r=s(e,["children","label"]);return t.createElement("div",null,t.createElement(dt,c({popperName:"Tooltip",pop:"hello"},r),n))};export{mt as default};
@@ -0,0 +1 @@
1
+ 'use client';import e,{createContext as n,useRef as t,useId as r,useState as l,useContext as o}from"react";var a=function(){return a=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var l in n=arguments[t])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},a.apply(this,arguments)};function i(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(r=Object.getOwnPropertySymbols(e);l<r.length;l++)n.indexOf(r[l])<0&&Object.prototype.propertyIsEnumerable.call(e,r[l])&&(t[r[l]]=e[r[l]])}return t}"function"==typeof SuppressedError&&SuppressedError;var c=n({}),u=function(e){return e.querySelectorAll("[data-rad-ui-batch-element]")},d=function(e){var n=null;return e.forEach((function(e){e.hasAttribute("data-rad-ui-focus-element")&&(n=e)})),n},s=function(n){var r=n.children,l=i(n,["children"]),o=t(null);return e.createElement(c.Provider,{value:{treeRef:o,moveUp:function(){var e=u(null==o?void 0:o.current);console.log(e);var n=function(e){var n=d(e),t=null==n?void 0:n.previousElementSibling;return t||e[0]}(e);return n},moveDown:function(){var e=u(null==o?void 0:o.current);console.log(e);var n=function(e){var n=d(e),t=null==n?void 0:n.nextElementSibling;return t||e[e.length-1]}(e);return n}}},e.createElement("div",a({},l,{ref:o}),r))},v=function(n){var t=n.role,r=void 0===t?"button":t,l=n.label,o=void 0===l?"":l,c=n.description,u=void 0===c?"":c,d=n.disabled,s=void 0!==d&&d,v=n.children,m=i(n,["role","label","description","disabled","children"]);return o&&(m["aria-label"]=o),u&&(m["aria-description"]=u),s&&(m["aria-disabled"]="true",u||(m["aria-description"]="Disabled Button")),e.createElement("button",a({role:r,disabled:s},m),v)},m=function(n){var u=n.children,d=n.item,s=n.level,f=void 0===s?0:s,p=n.className,b=void 0===p?"":p,y=i(n,["children","item","level","className"]),g=r(),E=t(null),h=l(!1),w=h[0],O=h[1],k=l(!1),D=k[0],x=k[1],S=o(c),j=S.moveUp,P=S.moveDown,A=function(e){if("down"===e){var n=P();console.log(n),n&&n.focus()}else if("up"===e){var t=j();console.log(t),t&&t.focus()}};return e.createElement(e.Fragment,null,e.createElement(v,a({className:b,ref:E,onClick:function(){console.log("clicked",g),O(!w)},"data-rad-ui-batch-element":!0,id:"tree-data-item-".concat(g),onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),console.log("trapped")),"ArrowDown"===e.key&&(e.preventDefault(),A("down")),"ArrowUp"===e.key&&(e.preventDefault(),A("up"))},onFocus:function(){x(!0)},onBlur:function(){x(!1)},style:{display:"block",alignItems:"center",gap:"0.5rem"}},D&&{"data-rad-ui-focus-element":!0},y),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"}},e.createElement("div",null,w?"v":">"),e.createElement("div",null,u))),w&&d.items&&e.createElement(e.Fragment,null,d.items.map((function(n){var t=f+1;return e.createElement(m,{level:t,key:n.label,item:n},n.label)}))))},f=function(n){n.children;var t=n.items,r=void 0===t?[]:t,l=i(n,["children","items"]);return e.createElement(s,a({},l),r.map((function(n){return e.createElement(e.Fragment,null,e.createElement(m,{key:n.label,expanded:n.expanded,item:n,level:0},n.label))})))};f.displayName="Tree";export{f as default};