@radui/ui 0.0.28 → 0.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- 'use client';import e from"react";var r=function(){return r=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var o in r=arguments[t])Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o]);return e},r.apply(this,arguments)};function t(e,r){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)r.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(t[n[o]]=e[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;function n(e){var r,t,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=n(e[r]))&&(o&&(o+=" "),o+=t)}else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}function o(){for(var e,r,t=0,o="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=n(e))&&(o&&(o+=" "),o+=r);return o}var a=["div","span","button"].reduce((function(n,o){return n[o]=function(n){var o=e.forwardRef((function(o,a){var i=o.asChild,l=void 0!==i&&i,c=o.children,s=t(o,["asChild","children"]);return l&&e.isValidElement(c)?e.cloneElement(c,r(r({},s),{ref:a})):e.createElement(n,r(r({},s),{ref:a}),c)}));return o.displayName="Primitive.".concat(n),o}(o),n}),{}),i=function(n){var o=n.role,i=void 0===o?"button":o,l=n.label,c=void 0===l?"":l,s=n.description,d=void 0===s?"":s,u=n.disabled,f=void 0!==u&&u,p=n.children,v=t(n,["role","label","description","disabled","children"]);return c&&(v["aria-label"]=c),d&&(v["aria-description"]=d),f&&(v["aria-disabled"]="true",d||(v["aria-description"]="Disabled Button")),e.createElement(a.button,r({role:i,disabled:f},v),p)},l="Button",c=function(n){var a=n.children,c=n.type,s=void 0===c?"button":c,d=n.customRootClass,u=void 0===d?"":d,f=n.className,p=void 0===f?"":f,v=n.variant,b=void 0===v?"":v,y=n.size,m=void 0===y?"":y,h=t(n,["children","type","customRootClass","className","variant","size"]),O=function(e,r){if(void 0===e&&(e=""),e)return e;var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(u,l),g={};return b&&(g["data-button-variant"]=b),m&&(g["data-button-size"]=m),e.createElement(i,r({type:s,className:o(O,p)},g,h),a)};c.displayName=l;export{c as default};
1
+ 'use client';import e from"react";var r=function(){return r=Object.assign||function(e){for(var r,t=1,o=arguments.length;t<o;t++)for(var n in r=arguments[t])Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);return e},r.apply(this,arguments)};function t(e,r){var t={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0&&(t[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(e);n<o.length;n++)r.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(t[o[n]]=e[o[n]])}return t}"function"==typeof SuppressedError&&SuppressedError;function o(e){var r,t,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(r=0;r<a;r++)e[r]&&(t=o(e[r]))&&(n&&(n+=" "),n+=t)}else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function n(){for(var e,r,t=0,n="",a=arguments.length;t<a;t++)(e=arguments[t])&&(r=o(e))&&(n&&(n+=" "),n+=r);return n}var a=["div","span","button"].reduce((function(o,n){return o[n]=function(o){var n=e.forwardRef((function(n,a){var i=n.asChild,l=void 0!==i&&i,c=n.children,d=t(n,["asChild","children"]);return l&&e.isValidElement(c)?e.cloneElement(c,r(r({},d),{ref:a})):e.createElement(o,r(r({},d),{ref:a}),c)}));return n.displayName="Primitive.".concat(o),n}(n),o}),{}),i=function(o){var n=o.role,i=void 0===n?"button":n,l=o.label,c=void 0===l?"":l,d=o.description,s=void 0===d?"":d,u=o.disabled,f=void 0!==u&&u,p=o.children,v=t(o,["role","label","description","disabled","children"]);return c&&(v["aria-label"]=c),s&&(v["aria-description"]=s),f&&(v["aria-disabled"]="true",s||(v["aria-description"]="Disabled Button")),e.createElement(a.button,r({role:i,disabled:f},v),p)},l="Button",c=function(o){var a=o.children,c=o.type,d=void 0===c?"button":c,s=o.customRootClass,u=void 0===s?"":s,f=o.className,p=void 0===f?"":f,v=o.variant,b=void 0===v?"":v,y=o.size,m=void 0===y?"":y,h=o.color,O=void 0===h?"":h,g=t(o,["children","type","customRootClass","className","variant","size","color"]),E=function(e,r){if(void 0===e&&(e=""),e)return e;var t=r.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(u,l),j={};return b&&(j["data-button-variant"]=b),m&&(j["data-button-size"]=m),O&&(j["data-accent-color"]=O),e.createElement(i,r({type:d,className:n(E,p)},j,g),a)};c.displayName=l;export{c as default};
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var te=["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(","),ne="undefined"==typeof Element,re=ne?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oe=!ne&&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},ie=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)},le=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!ie(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{re.call(l,te)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var a=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),s=!ie(a,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(a&&s){var f=e(!0===a?l.children:a.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},ce=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ue=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))&&!ce(e)?0:e.tabIndex},ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},se=function(e){return"INPUT"===e.tagName},fe=function(e){return function(e){return se(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||oe(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)},de=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},pe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=re.call(e,"details>summary:first-of-type")?e.parentElement:e;if(re.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return de(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=oe(e);if(l&&!l.shadowRoot&&!0===r(l))return de(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,r,o,i=e&&oe(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&l;){var u,a,s;c=!(null===(a=l=null===(u=i=oe(l))||void 0===u?void 0:u.host)||void 0===a||null===(s=a.ownerDocument)||void 0===s||!s.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},me=function(e,t){return!(t.disabled||ie(t)||function(e){return se(e)&&"hidden"===e.type}(t)||pe(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!!re.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ve=function(e,t){return!(fe(t)||ue(t)<0||!me(e,t))},he=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ge=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=ue(e);return n<0&&t&&!ce(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(ae).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ye=function(e,t){var n;return n=(t=t||{}).getShadowRoot?le([e],t.includeContainer,{filter:ve.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:he}):function(e,t,n){if(ie(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(te));return t&&re.call(e,te)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ve.bind(null,t)),ge(n)};function we(e,t,n){let{reference:r,floating:o}=e;const i=$(t),l=Z(t),c=Y(l),u=U(t),a="y"===i,s=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:s,y:r.y-o.height};break;case"bottom":p={x:s,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(X(t)){case"start":p[l]-=d*(n&&a?-1:1);break;case"end":p[l]+=d*(n&&a?-1:1)}return p}async function be(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=K(t,e),m=J(p),v=c[d?"floating"===f?"reference":"floating":f],h=ee(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:s,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=ee(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function xe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ee(e){return I.some((t=>e[t]>=0))}function Re(e){const t=C(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=h(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=H(n)!==i||H(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Ce(e){return v(e)?e:e.contextElement}function Se(e){const t=Ce(e);if(!h(t))return W(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Re(t);let l=(i?H(n.width):n.width)/r,c=(i?H(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Le=W(0);function Oe(e){const t=d(e);return E()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Le}function Pe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ce(e);let l=W(1);t&&(r?v(r)&&(l=Se(r)):l=Se(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==d(e))&&t}(i,n,r)?Oe(i):W(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,s=o.width/l.x,f=o.height/l.y;if(i){const e=d(i),t=r&&v(r)?d(r):r;let n=e,o=T(n);for(;o&&r&&t!==n;){const e=Se(o),t=o.getBoundingClientRect(),r=C(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,s*=e.x,f*=e.y,u+=i,a+=l,n=d(o),o=T(n)}}return ee({width:s,height:f,x:u,y:a})}function Te(e,t){const n=S(e).scrollLeft;return t?t.left+n:Pe(p(e)).left+n}function Ae(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Te(e,r)),y:r.top+t.scrollTop}}function ke(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=d(e),r=p(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;const e=E();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(e,n);else if("document"===t)r=function(e){const t=p(e),n=S(e),r=e.ownerDocument.body,o=B(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=B(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Te(e);const c=-n.scrollTop;return"rtl"===C(r).direction&&(l+=B(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(p(e));else if(v(t))r=function(e,t){const n=Pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=h(e)?Se(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=Oe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ee(r)}function Me(e,t){const n=L(e);return!(n===t||!v(n)||R(n))&&("fixed"===C(n).position||Me(n,t))}function De(e,t,n){const r=h(t),o=p(t),i="fixed"===n,l=Pe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=W(0);if(r||!r&&!i)if(("body"!==f(t)||y(o))&&(c=S(t)),r){const e=Pe(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Te(o));const a=!o||r||i?W(0):Ae(o,c);return{x:l.left+c.scrollLeft-u.x-a.x,y:l.top+c.scrollTop-u.y-a.y,width:l.width,height:l.height}}function Ne(e){return"static"===C(e).position}function Ie(e,t){if(!h(e)||"fixed"===C(e).position)return null;if(t)return t(e);let n=e.offsetParent;return p(e)===n&&(n=n.ownerDocument.body),n}function Fe(e,t){const n=d(e);if(b(e))return n;if(!h(e)){let t=L(e);for(;t&&!R(t);){if(v(t)&&!Ne(t))return t;t=L(t)}return n}let r=Ie(e,t);for(;r&&w(r)&&Ne(r);)r=Ie(r,t);return r&&R(r)&&Ne(r)&&!x(r)?n:r||function(e){let t=L(e);for(;h(t)&&!R(t);){if(x(t))return t;if(b(t))return null;t=L(t)}return null}(e)||n}const Be={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=p(r),c=!!t&&b(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=W(1);const s=W(0),d=h(r);if((d||!d&&!i)&&(("body"!==f(r)||y(l))&&(u=S(r)),h(r))){const e=Pe(r);a=Se(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const m=!l||d||i?W(0):Ae(l,u,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+s.x+m.x,y:n.y*a.y-u.scrollTop*a.y+s.y+m.y}},getDocumentElement:p,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?b(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>v(e)&&"body"!==f(e))),o=null;const i="fixed"===C(e).position;let l=i?L(e):e;for(;v(l)&&!R(l);){const t=C(l),n=x(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||y(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=ke(t,n,o);return e.top=B(r.top,e.top),e.right=F(r.right,e.right),e.bottom=F(r.bottom,e.bottom),e.left=B(r.left,e.left),e}),ke(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Fe,getElementRects:async function(e){const t=this.getOffsetParent||Fe,n=this.getDimensions,r=await n(e.floating);return{reference:De(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}=Re(e);return{width:t,height:n}},getScale:Se,isElement:v,isRTL:function(e){return"rtl"===C(e).direction}};function He(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:u=!1}=r,a=Ce(e),s=o||i?[...a?P(a):[],...P(t)]:[];s.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=a&&c?function(e,t){let n,r=null;const o=p(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const{left:a,top:s,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const p={rootMargin:-j(s)+"px "+-j(o.clientWidth-(a+f))+"px "+-j(o.clientHeight-(s+d))+"px "+-j(a)+"px",threshold:B(0,F(1,u))||1};let m=!0;function v(e){const t=e[0].intersectionRatio;if(t!==u){if(!m)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}m=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(a,n):null;let d,m=-1,v=null;l&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!u&&v.observe(a),v.observe(t));let h=u?Pe(e):null;return u&&function t(){const r=Pe(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=v)||e.disconnect(),v=null,u&&cancelAnimationFrame(d)}}const je=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=U(n),c=X(n),u="y"===$(n),a=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=K(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*s,y:d*a}:{x:d*a,y:p*s}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}},We=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=K(e,t),a={x:n,y:r},s=await be(t,u),f=$(U(o)),d=q(f);let p=a[d],m=a[f];if(i){const e="y"===d?"bottom":"right";p=z(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";m=z(m+s["y"===f?"top":"left"],m,m-s[e])}const v=c.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Ve=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:a}=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=K(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=U(o),y=$(c),w=U(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(a.floating)),x=d||(w||!v?[Q(c)]:function(e){const t=Q(e);return[G(e),t,G(t)]}(c)),E="none"!==m;!d&&E&&x.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[]}}(U(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(G)))),i}(c,v,m,b));const R=[c,...x],C=await be(t,h),S=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(s&&S.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=X(e),o=Z(e),i=Y(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,b);S.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:S}],!S.every((e=>e<=0))){var O,P;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==(P=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var 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{}}}},_e=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=xe(await be(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ee(e)}}}case"escaped":{const e=xe(await be(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ee(e)}}}default:return{}}}}},ze=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:a,padding:s=0}=K(e,t)||{};if(null==a)return{};const f=J(s),d={x:n,y:r},p=Z(o),m=Y(p),v=await l.getDimensions(a),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,L=F(f[g],S),O=F(f[y],S),P=L,T=R-v[m]-O,A=R/2-v[m]/2+C,k=z(P,A,T),M=!u.arrow&&null!=X(o)&&A!==k&&i.reference[m]/2-(A<P?L:O)-v[m]/2<0,D=M?A<P?A-P:A-T:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:A-k-D,...M&&{alignmentOffset:D}},reset:M}}}),Ke=(e,t,n)=>{const r=new Map,o={platform:Be,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:s,y:f}=we(a,r,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,data:y,reset:w}=await v({x:s,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:a,platform:l,elements:{reference:e,floating:t}});s=null!=h?h:s,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&&(a=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:s,y:f}=we(a,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Ue="undefined"!=typeof document?n:r;function Xe(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(!Xe(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)&&!Xe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function qe(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ye(e,t){const n=qe(e);return Math.round(t*n)/n}function $e(t){const n=e.useRef(t);return Ue((()=>{n.current=t})),n}const Ze=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?ze({element:n.current,padding:r}).fn(t):{}:n?ze({element:n,padding:r}).fn(t):{};var o}}),Ge=(e,t)=>({...je(e),options:[e,t]}),Qe=(e,t)=>({...We(e),options:[e,t]}),Je=(e,t)=>({...Ve(e),options:[e,t]}),et=(e,t)=>({..._e(e),options:[e,t]}),tt={...e},nt=tt.useInsertionEffect||(e=>e());function rt(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return nt((()=>{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 ot="undefined"!=typeof document?n:r;function it(){return it=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},it.apply(this,arguments)}let lt=!1,ct=0;const ut=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ct++;const at=tt.useId||function(){const[t,n]=e.useState((()=>lt?ut():void 0));return ot((()=>{null==t&&n(ut())}),[]),e.useEffect((()=>{lt=!0}),[]),t};let st;"production"!==process.env.NODE_ENV&&(st=new Set);const ft=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:u=7,tipRadius:a=0,strokeWidth:s=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...h}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=st)&&e.has(o)||(null==(i=st)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const g=at(),[y,w]=e.useState(!1);if(ot((()=>{if(!o)return;"rtl"===C(o).direction&&w(!0)}),[o]),!o)return null;const[b,x]=r.split("-"),E="top"===b||"bottom"===b;let R=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(R=null);const S=2*s,L=S/2,O=c/2*(a/-8+1),P=u/2*a/4,T=!!p,A=R&&"end"===x?"bottom":"top";let k=R&&"end"===x?"right":"left";R&&y&&(k="end"===x?"left":"right");const M=null!=(null==i?void 0:i.x)?R||i.x:"",D=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+c+" L"+(c-O)+","+(u-P)+" Q"+c/2+","+u+" "+O+","+(u-P)+" Z",I={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",it({},h,{"aria-hidden":!0,ref:n,width:T?c:c+S,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[k]:M,[A]:D,[b]:E||T?"100%":"calc(100% - "+S/2+"px)",transform:[I,m].filter((e=>!!e)).join(" "),...v}}),S>0&&e.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:S+(p?0:1),d:N}),e.createElement("path",{stroke:S&&!p?h.fill:"none",d:N}),e.createElement("clipPath",{id:g},e.createElement("rect",{x:-L,y:L*(T?-1:1),width:c+S,height:c})))}));const dt=e.createContext(null),pt=e.createContext(null),mt=()=>{var t;return(null==(t=e.useContext(dt))?void 0:t.id)||null},vt=()=>e.useContext(pt);function ht(e){return"data-floating-ui-"+e}function gt(e){const t=o(e);return ot((()=>{t.current=e})),t}const yt=ht("safe-polygon");function wt(e,t,n){return n&&!k(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function bt(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 xt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Et(e,t){const n=ye(e,xt());"prev"===t&&n.reverse();const r=n.indexOf(function(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}(M(e)));return n.slice(r+1)[0]}function Rt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function Ct(e){ye(e,xt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function St(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 Lt={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 Ot(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Pt=e.forwardRef((function(t,n){const[r,o]=e.useState();ot((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Ot),()=>{document.removeEventListener("keydown",Ot)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[ht("focus-guard")]:"",style:Lt};return e.createElement("span",it({},t,i))})),Tt=e.createContext(null),At=ht("portal");function kt(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=at(),i=Mt(),[l,c]=e.useState(null),u=e.useRef(null);return ot((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),ot((()=>{if(!o)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(At,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),ot((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!v(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(At,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),s=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==u?void 0:u.modal,h=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!(!o&&!c);return e.useEffect((()=>{if(c&&i&&!m)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Rt(e)){("focusin"===e.type?St:Ct)(c)}}}),[c,i,m]),e.useEffect((()=>{c&&(h||St(c))}),[h,c]),e.createElement(Tt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:c,setFocusManagerState:a})),[i,c])},g&&c&&e.createElement(Pt,{"data-type":"outside",ref:s,onFocus:e=>{if(Rt(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Et(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),g&&c&&e.createElement("span",{"aria-owns":c.id,style:Lt}),c&&l.createPortal(n,c),g&&c&&e.createElement(Pt,{"data-type":"outside",ref:f,onFocus:e=>{if(Rt(e,c)){var t;null==(t=p.current)||t.focus()}else{const t=Et(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Mt=()=>e.useContext(Tt),Dt="data-floating-ui-focusable",Nt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},It={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ft=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 Bt(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=at(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),u=null!=mt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!v(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=st)&&e.has(o)||(null==(i=st)||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,s]=e.useState(o.reference),f=rt(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:s})),[]),p=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:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}function Ht(t){void 0===t&&(t={});const{nodeId:n}=t,r=Bt({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,u]=e.useState(null),[a,s]=e.useState(null),f=(null==i?void 0:i.domReference)||c,d=e.useRef(null),p=vt();ot((()=>{f&&(d.current=f)}),[f]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:u}={},transform:a=!0,whileElementsMounted:s,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);Xe(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=c||h,R=u||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),O=null!=s,P=$e(s),T=$e(i),A=$e(f),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};T.current&&(e.platform=T.current),Ke(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};M.current&&!Xe(L.current,t)&&(L.current=t,l.flushSync((()=>{p(t)})))}))}),[m,n,r,T,A]);Ue((()=>{!1===f&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Ue((()=>(M.current=!0,()=>{M.current=!1})),[]),Ue((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(P.current)return P.current(E,R,k);k()}}),[E,R,k,P,O]);const D=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=Ye(N.floating,d.x),n=Ye(N.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...qe(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,a,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:I})),[d,k,D,N,I])}({...t,elements:{...i,...a&&{reference:a}}}),h=e.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(v(e)||null===e)&&(d.current=e,u(e)),(v(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!v(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:h,domReference:d})),[m.refs,g,h]),w=e.useMemo((()=>({...m.elements,domReference:f})),[m.elements,f]),b=e.useMemo((()=>({...m,...o,refs:y,elements:w,nodeId:n})),[m,y,w,n,o]);return ot((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...m,context:b,refs:y,elements:w})),[m,y,w,b])}const jt="active",Wt="selected";function Vt(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[jt]:t,[Wt]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Dt]:""},...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&&[jt,Wt].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 _t=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var zt=function(n){var r=n.popperName,l=void 0===r?"":r,u=n.customRootClass,s=void 0===u?"":u;n.activationStrategy;var f=n.className,d=void 0===f?"":f,p=n.placement,m=void 0===p?"top":p,g=n.children,y=n.open,w=void 0!==y&&y;n.hoverDelay;var b=n.showArrow,x=void 0===b||b,S=n.pop,O=void 0===S?t.createElement(t.Fragment,null):S;!function(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]])}}(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var T,I,F=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(s,l),B=o(null),H=i(w),j=H[0],W=H[1],V=Ht({placement:m,whileElementsMounted:He,open:j,middleware:[(T={element:B,padding:4},{...Ze(T),options:[T,I]}),Ge(9),Je({mainAxis:!0,fallbackStrategy:"initialPlacement"}),Qe({crossAxis:!1}),et({strategy:"referenceHidden"})],onOpenChange:W}),_=V.refs,z=V.floatingStyles,K=V.context,U=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=null!=(r=_t.get(c))?r:c,a=at(),s=null!=mt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:a},..."menu"===u&&s&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,s,o,a,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":a}}}),[u,i,a,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])}(K),X=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:a=!0,outsidePressEvent:s="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:g}=n,y=vt(),w=rt("function"==typeof a?a:()=>!1),b="function"==typeof a?w:a,x=e.useRef(!1),S=e.useRef(!1),{escapeKey:O,outsidePress:T}=Ft(m),{escapeKey:k,outsidePress:I}=Ft(g),F=e.useRef(!1),B=rt((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(F.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?bt(y.nodesRef.current,n):[];if(!O&&(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=rt((e=>{var t;const n=()=>{var t;B(e),null==(t=N(e))||t.removeEventListener("keydown",n)};null==(t=N(e))||t.addEventListener("keydown",n)})),j=rt((e=>{var t;const n=x.current;x.current=!1;const r=S.current;if(S.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=N(e),u="["+ht("inert")+"]",a=M(i.floating).querySelectorAll(u);let f=v(c)?c:null;for(;f&&!R(f);){const e=L(f);if(R(e)||!v(e))break;f=e}if(a.length&&v(c)&&!c.matches("html,body")&&!A(c,i.floating)&&Array.from(a).every((e=>!A(f,e))))return;if(h(c)&&_){const t=R(c),n=C(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,a="rtl"===n.direction,s=u&&(a?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(s||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=y&&bt(y.nodesRef.current,d).some((t=>{var n;return D(e,null==(n=t.context)?void 0:n.elements.floating)}));if(D(e,i.floating)||D(e,i.domReference)||p)return;const m=y?bt(y.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=rt((e=>{var t;const n=()=>{var t;j(e),null==(t=N(e))||t.removeEventListener(s,n)};null==(t=N(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=O,l.current.__outsidePressBubbles=T;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),F.current=!0}function a(){e=window.setTimeout((()=>{F.current=!1}),E()?5:0)}const f=M(i.floating);u&&(f.addEventListener("keydown",k?H:B,k),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",a)),b&&f.addEventListener(s,I?W:j,I);let d=[];return p&&(v(i.domReference)&&(d=P(i.domReference)),v(i.floating)&&(d=d.concat(P(i.floating))),!v(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(P(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",k?H:B,k),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",a)),b&&f.removeEventListener(s,I?W:j,I),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,b,s,r,o,p,c,O,T,B,k,H,j,I,W]),e.useEffect((()=>{x.current=!1}),[b,s]);const V=e.useMemo((()=>({onKeyDown:B,...f&&{[Nt[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[B,o,f,d]),_=e.useMemo((()=>({onKeyDown:B,onMouseDown(){S.current=!0},onMouseUp(){S.current=!0},[It[s]]:()=>{x.current=!0}})),[B,s]);return e.useMemo((()=>c?{reference:V,floating:_}:{}),[c,V,_])}(K),q=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:a=0,handleClose:s=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=vt(),h=mt(),g=gt(s),y=gt(a),w=gt(r),b=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),L=e.useRef((()=>{})),O=e.useRef(!1),P=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!g.current)return;if(!r)return;function e(e){P()&&o(!1,e,"hover")}const t=M(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,g,P]);const T=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=wt(y.current,"close",b.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[y,o]),D=rt((()=>{L.current(),E.current=void 0})),N=rt((()=>{if(S.current){const e=M(c.floating).body;e.style.pointerEvents="",e.removeAttribute(yt),S.current=!1}})),I=rt((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&v(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!k(b.current)||d>0&&!wt(y.current,"open"))return;const t=wt(y.current,"open",b.current);t?x.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(I())return;L.current();const t=M(c.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),D(),I()||T(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!A(c.floating,e.relatedTarget))&&T(e)}function l(e){I()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),D(),I()||T(e)}})(e))}}),[c,u,t,f,d,p,T,D,N,o,r,w,m,y,g,i,I]),ot((()=>{var e;if(u&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&P()){S.current=!0;const e=c.floating;if(v(c.domReference)&&e){var t;const n=M(c.floating).body;n.setAttribute(yt,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===h)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,h,c,m,g,P]),ot((()=>{r||(b.current=void 0,O.current=!1,D(),N())}),[r,D,N]),e.useEffect((()=>()=>{D(),clearTimeout(x.current),clearTimeout(R.current),N()}),[u,c.domReference,D,N]);const F=e.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!k(b.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===b.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),B=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){I()||T(e.nativeEvent,!1)}})),[T,I]);return e.useMemo((()=>u?{reference:F,floating:B}:{}),[u,F,B])}(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=>Vt(e,t,"reference")),n),l=e.useCallback((e=>Vt(e,t,"floating")),r),c=e.useCallback((e=>Vt(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([q,U,X]),$=Y.getReferenceProps,Z=Y.getFloatingProps;return t.createElement("span",null,t.createElement("span",c({className:a("rad-ui-popper","".concat(F,"-reference-element"),d),ref:_.setReference},$({onClick:function(){console.log("click")}})),g),j&&t.createElement(kt,null," ",t.createElement("div",c({className:a("".concat(F,"-floating-element")),ref:_.setFloating,style:z},Z()),x&&t.createElement(ft,{className:a("rad-ui-arrow ".concat(F,"-arrow")),ref:B,context:K}),O)))},Kt=function(e){var n=e.list,r=void 0===n?[]:n;e.selected;return t.createElement("div",{className:"relative"},t.createElement(zt,{open:!1,placement:"bottom-start",popperName:"dropdown",pop:t.createElement((function(){return t.createElement("ul",{className:"bg-white px-2 py-2 shadow-lg rounded-md"},r.map((function(e,n){return t.createElement("li",{key:n},e.value)})))}),null)},t.createElement("span",null,"Dropdown")))};export{Kt as default};
5
+ */var te=["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(","),ne="undefined"==typeof Element,re=ne?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oe=!ne&&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},ie=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)},le=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!ie(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{re.call(l,te)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var a=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),s=!ie(a,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(a&&s){var f=e(!0===a?l.children:a.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},ce=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ue=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))&&!ce(e)?0:e.tabIndex},ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},se=function(e){return"INPUT"===e.tagName},fe=function(e){return function(e){return se(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||oe(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)},de=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},pe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=re.call(e,"details>summary:first-of-type")?e.parentElement:e;if(re.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return de(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=oe(e);if(l&&!l.shadowRoot&&!0===r(l))return de(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,r,o,i=e&&oe(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&l;){var u,a,s;c=!(null===(a=l=null===(u=i=oe(l))||void 0===u?void 0:u.host)||void 0===a||null===(s=a.ownerDocument)||void 0===s||!s.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},me=function(e,t){return!(t.disabled||ie(t)||function(e){return se(e)&&"hidden"===e.type}(t)||pe(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!!re.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ve=function(e,t){return!(fe(t)||ue(t)<0||!me(e,t))},he=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ge=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=ue(e);return n<0&&t&&!ce(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(ae).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ye=function(e,t){var n;return n=(t=t||{}).getShadowRoot?le([e],t.includeContainer,{filter:ve.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:he}):function(e,t,n){if(ie(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(te));return t&&re.call(e,te)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ve.bind(null,t)),ge(n)};function we(e,t,n){let{reference:r,floating:o}=e;const i=$(t),l=Z(t),c=Y(l),u=U(t),a="y"===i,s=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:s,y:r.y-o.height};break;case"bottom":p={x:s,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(X(t)){case"start":p[l]-=d*(n&&a?-1:1);break;case"end":p[l]+=d*(n&&a?-1:1)}return p}async function be(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=K(t,e),m=J(p),v=c[d?"floating"===f?"reference":"floating":f],h=ee(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:s,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=ee(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function xe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ee(e){return I.some((t=>e[t]>=0))}function Re(e){const t=C(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=h(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=H(n)!==i||H(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Ce(e){return v(e)?e:e.contextElement}function Se(e){const t=Ce(e);if(!h(t))return W(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Re(t);let l=(i?H(n.width):n.width)/r,c=(i?H(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Le=W(0);function Oe(e){const t=d(e);return E()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Le}function Pe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ce(e);let l=W(1);t&&(r?v(r)&&(l=Se(r)):l=Se(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==d(e))&&t}(i,n,r)?Oe(i):W(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,s=o.width/l.x,f=o.height/l.y;if(i){const e=d(i),t=r&&v(r)?d(r):r;let n=e,o=T(n);for(;o&&r&&t!==n;){const e=Se(o),t=o.getBoundingClientRect(),r=C(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,s*=e.x,f*=e.y,u+=i,a+=l,n=d(o),o=T(n)}}return ee({width:s,height:f,x:u,y:a})}function Te(e,t){const n=S(e).scrollLeft;return t?t.left+n:Pe(p(e)).left+n}function Ae(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Te(e,r)),y:r.top+t.scrollTop}}function ke(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=d(e),r=p(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;const e=E();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(e,n);else if("document"===t)r=function(e){const t=p(e),n=S(e),r=e.ownerDocument.body,o=B(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=B(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Te(e);const c=-n.scrollTop;return"rtl"===C(r).direction&&(l+=B(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(p(e));else if(v(t))r=function(e,t){const n=Pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=h(e)?Se(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=Oe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ee(r)}function Me(e,t){const n=L(e);return!(n===t||!v(n)||R(n))&&("fixed"===C(n).position||Me(n,t))}function De(e,t,n){const r=h(t),o=p(t),i="fixed"===n,l=Pe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=W(0);if(r||!r&&!i)if(("body"!==f(t)||y(o))&&(c=S(t)),r){const e=Pe(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Te(o));const a=!o||r||i?W(0):Ae(o,c);return{x:l.left+c.scrollLeft-u.x-a.x,y:l.top+c.scrollTop-u.y-a.y,width:l.width,height:l.height}}function Ne(e){return"static"===C(e).position}function Ie(e,t){if(!h(e)||"fixed"===C(e).position)return null;if(t)return t(e);let n=e.offsetParent;return p(e)===n&&(n=n.ownerDocument.body),n}function Fe(e,t){const n=d(e);if(b(e))return n;if(!h(e)){let t=L(e);for(;t&&!R(t);){if(v(t)&&!Ne(t))return t;t=L(t)}return n}let r=Ie(e,t);for(;r&&w(r)&&Ne(r);)r=Ie(r,t);return r&&R(r)&&Ne(r)&&!x(r)?n:r||function(e){let t=L(e);for(;h(t)&&!R(t);){if(x(t))return t;if(b(t))return null;t=L(t)}return null}(e)||n}const Be={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=p(r),c=!!t&&b(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=W(1);const s=W(0),d=h(r);if((d||!d&&!i)&&(("body"!==f(r)||y(l))&&(u=S(r)),h(r))){const e=Pe(r);a=Se(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const m=!l||d||i?W(0):Ae(l,u,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+s.x+m.x,y:n.y*a.y-u.scrollTop*a.y+s.y+m.y}},getDocumentElement:p,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?b(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>v(e)&&"body"!==f(e))),o=null;const i="fixed"===C(e).position;let l=i?L(e):e;for(;v(l)&&!R(l);){const t=C(l),n=x(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||y(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=ke(t,n,o);return e.top=B(r.top,e.top),e.right=F(r.right,e.right),e.bottom=F(r.bottom,e.bottom),e.left=B(r.left,e.left),e}),ke(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Fe,getElementRects:async function(e){const t=this.getOffsetParent||Fe,n=this.getDimensions,r=await n(e.floating);return{reference:De(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}=Re(e);return{width:t,height:n}},getScale:Se,isElement:v,isRTL:function(e){return"rtl"===C(e).direction}};function He(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:u=!1}=r,a=Ce(e),s=o||i?[...a?P(a):[],...P(t)]:[];s.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=a&&c?function(e,t){let n,r=null;const o=p(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const{left:a,top:s,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const p={rootMargin:-j(s)+"px "+-j(o.clientWidth-(a+f))+"px "+-j(o.clientHeight-(s+d))+"px "+-j(a)+"px",threshold:B(0,F(1,u))||1};let m=!0;function v(e){const t=e[0].intersectionRatio;if(t!==u){if(!m)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}m=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(a,n):null;let d,m=-1,v=null;l&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!u&&v.observe(a),v.observe(t));let h=u?Pe(e):null;return u&&function t(){const r=Pe(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=v)||e.disconnect(),v=null,u&&cancelAnimationFrame(d)}}const je=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=U(n),c=X(n),u="y"===$(n),a=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=K(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*s,y:d*a}:{x:d*a,y:p*s}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}},We=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=K(e,t),a={x:n,y:r},s=await be(t,u),f=$(U(o)),d=q(f);let p=a[d],m=a[f];if(i){const e="y"===d?"bottom":"right";p=z(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";m=z(m+s["y"===f?"top":"left"],m,m-s[e])}const v=c.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Ve=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:a}=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=K(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=U(o),y=$(c),w=U(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(a.floating)),x=d||(w||!v?[Q(c)]:function(e){const t=Q(e);return[G(e),t,G(t)]}(c)),E="none"!==m;!d&&E&&x.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[]}}(U(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(G)))),i}(c,v,m,b));const R=[c,...x],C=await be(t,h),S=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(s&&S.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=X(e),o=Z(e),i=Y(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,b);S.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:S}],!S.every((e=>e<=0))){var O,P;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==(P=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var 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{}}}},_e=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=xe(await be(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ee(e)}}}case"escaped":{const e=xe(await be(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ee(e)}}}default:return{}}}}},ze=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:a,padding:s=0}=K(e,t)||{};if(null==a)return{};const f=J(s),d={x:n,y:r},p=Z(o),m=Y(p),v=await l.getDimensions(a),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,L=F(f[g],S),O=F(f[y],S),P=L,T=R-v[m]-O,A=R/2-v[m]/2+C,k=z(P,A,T),M=!u.arrow&&null!=X(o)&&A!==k&&i.reference[m]/2-(A<P?L:O)-v[m]/2<0,D=M?A<P?A-P:A-T:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:A-k-D,...M&&{alignmentOffset:D}},reset:M}}}),Ke=(e,t,n)=>{const r=new Map,o={platform:Be,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:s,y:f}=we(a,r,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,data:y,reset:w}=await v({x:s,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:a,platform:l,elements:{reference:e,floating:t}});s=null!=h?h:s,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&&(a=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:s,y:f}=we(a,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Ue="undefined"!=typeof document?n:r;function Xe(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(!Xe(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)&&!Xe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function qe(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ye(e,t){const n=qe(e);return Math.round(t*n)/n}function $e(t){const n=e.useRef(t);return Ue((()=>{n.current=t})),n}const Ze=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?ze({element:n.current,padding:r}).fn(t):{}:n?ze({element:n,padding:r}).fn(t):{};var o}}),Ge=(e,t)=>({...je(e),options:[e,t]}),Qe=(e,t)=>({...We(e),options:[e,t]}),Je=(e,t)=>({...Ve(e),options:[e,t]}),et=(e,t)=>({..._e(e),options:[e,t]}),tt={...e},nt=tt.useInsertionEffect||(e=>e());function rt(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return nt((()=>{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 ot="undefined"!=typeof document?n:r;function it(){return it=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},it.apply(this,arguments)}let lt=!1,ct=0;const ut=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ct++;const at=tt.useId||function(){const[t,n]=e.useState((()=>lt?ut():void 0));return ot((()=>{null==t&&n(ut())}),[]),e.useEffect((()=>{lt=!0}),[]),t};let st;"production"!==process.env.NODE_ENV&&(st=new Set);const ft=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:u=7,tipRadius:a=0,strokeWidth:s=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...h}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=st)&&e.has(o)||(null==(i=st)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const g=at(),[y,w]=e.useState(!1);if(ot((()=>{if(!o)return;"rtl"===C(o).direction&&w(!0)}),[o]),!o)return null;const[b,x]=r.split("-"),E="top"===b||"bottom"===b;let R=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(R=null);const S=2*s,L=S/2,O=c/2*(a/-8+1),P=u/2*a/4,T=!!p,A=R&&"end"===x?"bottom":"top";let k=R&&"end"===x?"right":"left";R&&y&&(k="end"===x?"left":"right");const M=null!=(null==i?void 0:i.x)?R||i.x:"",D=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+c+" L"+(c-O)+","+(u-P)+" Q"+c/2+","+u+" "+O+","+(u-P)+" Z",I={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",it({},h,{"aria-hidden":!0,ref:n,width:T?c:c+S,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[k]:M,[A]:D,[b]:E||T?"100%":"calc(100% - "+S/2+"px)",transform:[I,m].filter((e=>!!e)).join(" "),...v}}),S>0&&e.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:S+(p?0:1),d:N}),e.createElement("path",{stroke:S&&!p?h.fill:"none",d:N}),e.createElement("clipPath",{id:g},e.createElement("rect",{x:-L,y:L*(T?-1:1),width:c+S,height:c})))}));const dt=e.createContext(null),pt=e.createContext(null),mt=()=>{var t;return(null==(t=e.useContext(dt))?void 0:t.id)||null},vt=()=>e.useContext(pt);function ht(e){return"data-floating-ui-"+e}function gt(e){const t=o(e);return ot((()=>{t.current=e})),t}const yt=ht("safe-polygon");function wt(e,t,n){return n&&!k(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function bt(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 xt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Et(e,t){const n=ye(e,xt());"prev"===t&&n.reverse();const r=n.indexOf(function(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}(M(e)));return n.slice(r+1)[0]}function Rt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function Ct(e){ye(e,xt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function St(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 Lt={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 Ot(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Pt=e.forwardRef((function(t,n){const[r,o]=e.useState();ot((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Ot),()=>{document.removeEventListener("keydown",Ot)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[ht("focus-guard")]:"",style:Lt};return e.createElement("span",it({},t,i))})),Tt=e.createContext(null),At=ht("portal");function kt(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=at(),i=Mt(),[l,c]=e.useState(null),u=e.useRef(null);return ot((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),ot((()=>{if(!o)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(At,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),ot((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!v(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(At,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),s=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==u?void 0:u.modal,h=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!(!o&&!c);return e.useEffect((()=>{if(c&&i&&!m)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Rt(e)){("focusin"===e.type?St:Ct)(c)}}}),[c,i,m]),e.useEffect((()=>{c&&(h||St(c))}),[h,c]),e.createElement(Tt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:c,setFocusManagerState:a})),[i,c])},g&&c&&e.createElement(Pt,{"data-type":"outside",ref:s,onFocus:e=>{if(Rt(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Et(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),g&&c&&e.createElement("span",{"aria-owns":c.id,style:Lt}),c&&l.createPortal(n,c),g&&c&&e.createElement(Pt,{"data-type":"outside",ref:f,onFocus:e=>{if(Rt(e,c)){var t;null==(t=p.current)||t.focus()}else{const t=Et(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Mt=()=>e.useContext(Tt),Dt="data-floating-ui-focusable",Nt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},It={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ft=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 Bt(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=at(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),u=null!=mt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!v(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=st)&&e.has(o)||(null==(i=st)||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,s]=e.useState(o.reference),f=rt(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:s})),[]),p=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:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}function Ht(t){void 0===t&&(t={});const{nodeId:n}=t,r=Bt({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,u]=e.useState(null),[a,s]=e.useState(null),f=(null==i?void 0:i.domReference)||c,d=e.useRef(null),p=vt();ot((()=>{f&&(d.current=f)}),[f]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:u}={},transform:a=!0,whileElementsMounted:s,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);Xe(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=c||h,R=u||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),O=null!=s,P=$e(s),T=$e(i),A=$e(f),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};T.current&&(e.platform=T.current),Ke(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};M.current&&!Xe(L.current,t)&&(L.current=t,l.flushSync((()=>{p(t)})))}))}),[m,n,r,T,A]);Ue((()=>{!1===f&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Ue((()=>(M.current=!0,()=>{M.current=!1})),[]),Ue((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(P.current)return P.current(E,R,k);k()}}),[E,R,k,P,O]);const D=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=Ye(N.floating,d.x),n=Ye(N.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...qe(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,a,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:I})),[d,k,D,N,I])}({...t,elements:{...i,...a&&{reference:a}}}),h=e.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(v(e)||null===e)&&(d.current=e,u(e)),(v(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!v(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:h,domReference:d})),[m.refs,g,h]),w=e.useMemo((()=>({...m.elements,domReference:f})),[m.elements,f]),b=e.useMemo((()=>({...m,...o,refs:y,elements:w,nodeId:n})),[m,y,w,n,o]);return ot((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...m,context:b,refs:y,elements:w})),[m,y,w,b])}const jt="active",Wt="selected";function Vt(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[jt]:t,[Wt]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Dt]:""},...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&&[jt,Wt].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 _t=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var zt=function(n){var r=n.popperName,l=void 0===r?"":r,u=n.customRootClass,s=void 0===u?"":u;n.activationStrategy;var f=n.className,d=void 0===f?"":f,p=n.placement,m=void 0===p?"top":p,g=n.children,y=n.open,w=void 0!==y&&y;n.hoverDelay;var b=n.showArrow,x=void 0===b||b,S=n.pop,O=void 0===S?t.createElement(t.Fragment,null):S;!function(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]])}}(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var T,I,F=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(s,l),B=o(null),H=i(w),j=H[0],W=H[1],V=Ht({placement:m,whileElementsMounted:He,open:j,middleware:[(T={element:B,padding:4},{...Ze(T),options:[T,I]}),Ge(9),Je({mainAxis:!0,fallbackStrategy:"initialPlacement"}),Qe({crossAxis:!1}),et({strategy:"referenceHidden"})],onOpenChange:W}),_=V.refs,z=V.floatingStyles,K=V.context,U=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=null!=(r=_t.get(c))?r:c,a=at(),s=null!=mt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:a},..."menu"===u&&s&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,s,o,a,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":a}}}),[u,i,a,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])}(K),X=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:a=!0,outsidePressEvent:s="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:g}=n,y=vt(),w=rt("function"==typeof a?a:()=>!1),b="function"==typeof a?w:a,x=e.useRef(!1),S=e.useRef(!1),{escapeKey:O,outsidePress:T}=Ft(m),{escapeKey:k,outsidePress:I}=Ft(g),F=e.useRef(!1),B=rt((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(F.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?bt(y.nodesRef.current,n):[];if(!O&&(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=rt((e=>{var t;const n=()=>{var t;B(e),null==(t=N(e))||t.removeEventListener("keydown",n)};null==(t=N(e))||t.addEventListener("keydown",n)})),j=rt((e=>{var t;const n=x.current;x.current=!1;const r=S.current;if(S.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=N(e),u="["+ht("inert")+"]",a=M(i.floating).querySelectorAll(u);let f=v(c)?c:null;for(;f&&!R(f);){const e=L(f);if(R(e)||!v(e))break;f=e}if(a.length&&v(c)&&!c.matches("html,body")&&!A(c,i.floating)&&Array.from(a).every((e=>!A(f,e))))return;if(h(c)&&_){const t=R(c),n=C(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,a="rtl"===n.direction,s=u&&(a?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(s||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=y&&bt(y.nodesRef.current,d).some((t=>{var n;return D(e,null==(n=t.context)?void 0:n.elements.floating)}));if(D(e,i.floating)||D(e,i.domReference)||p)return;const m=y?bt(y.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=rt((e=>{var t;const n=()=>{var t;j(e),null==(t=N(e))||t.removeEventListener(s,n)};null==(t=N(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=O,l.current.__outsidePressBubbles=T;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),F.current=!0}function a(){e=window.setTimeout((()=>{F.current=!1}),E()?5:0)}const f=M(i.floating);u&&(f.addEventListener("keydown",k?H:B,k),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",a)),b&&f.addEventListener(s,I?W:j,I);let d=[];return p&&(v(i.domReference)&&(d=P(i.domReference)),v(i.floating)&&(d=d.concat(P(i.floating))),!v(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(P(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",k?H:B,k),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",a)),b&&f.removeEventListener(s,I?W:j,I),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,b,s,r,o,p,c,O,T,B,k,H,j,I,W]),e.useEffect((()=>{x.current=!1}),[b,s]);const V=e.useMemo((()=>({onKeyDown:B,...f&&{[Nt[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[B,o,f,d]),_=e.useMemo((()=>({onKeyDown:B,onMouseDown(){S.current=!0},onMouseUp(){S.current=!0},[It[s]]:()=>{x.current=!0}})),[B,s]);return e.useMemo((()=>c?{reference:V,floating:_}:{}),[c,V,_])}(K),q=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:a=0,handleClose:s=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=vt(),h=mt(),g=gt(s),y=gt(a),w=gt(r),b=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),L=e.useRef((()=>{})),O=e.useRef(!1),P=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!g.current)return;if(!r)return;function e(e){P()&&o(!1,e,"hover")}const t=M(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,g,P]);const T=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=wt(y.current,"close",b.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[y,o]),D=rt((()=>{L.current(),E.current=void 0})),N=rt((()=>{if(S.current){const e=M(c.floating).body;e.style.pointerEvents="",e.removeAttribute(yt),S.current=!1}})),I=rt((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&v(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!k(b.current)||d>0&&!wt(y.current,"open"))return;const t=wt(y.current,"open",b.current);t?x.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(I())return;L.current();const t=M(c.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),D(),I()||T(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!A(c.floating,e.relatedTarget))&&T(e)}function l(e){I()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),D(),I()||T(e)}})(e))}}),[c,u,t,f,d,p,T,D,N,o,r,w,m,y,g,i,I]),ot((()=>{var e;if(u&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&P()){S.current=!0;const e=c.floating;if(v(c.domReference)&&e){var t;const n=M(c.floating).body;n.setAttribute(yt,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===h)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,h,c,m,g,P]),ot((()=>{r||(b.current=void 0,O.current=!1,D(),N())}),[r,D,N]),e.useEffect((()=>()=>{D(),clearTimeout(x.current),clearTimeout(R.current),N()}),[u,c.domReference,D,N]);const F=e.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!k(b.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===b.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),B=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){I()||T(e.nativeEvent,!1)}})),[T,I]);return e.useMemo((()=>u?{reference:F,floating:B}:{}),[u,F,B])}(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=>Vt(e,t,"reference")),n),l=e.useCallback((e=>Vt(e,t,"floating")),r),c=e.useCallback((e=>Vt(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([q,U,X]),$=Y.getReferenceProps,Z=Y.getFloatingProps;return t.createElement(t.Fragment,null,t.createElement("span",c({className:a("rad-ui-popper","".concat(F,"-reference-element"),d),ref:_.setReference},$({onClick:function(){console.log("click")}})),g),j&&t.createElement(kt,null," ",t.createElement("div",c({className:a("".concat(F,"-floating-element")),ref:_.setFloating,style:z},Z()),x&&t.createElement(ft,{className:a("rad-ui-arrow ".concat(F,"-arrow")),ref:B,context:K}),O)))},Kt=function(e){var n=e.list,r=void 0===n?[]:n;e.selected;return t.createElement("div",{className:"relative"},t.createElement(zt,{open:!1,placement:"bottom-start",popperName:"dropdown",pop:t.createElement((function(){return t.createElement("ul",{className:"bg-white px-2 py-2 shadow-lg rounded-md"},r.map((function(e,n){return t.createElement("li",{key:n},e.value)})))}),null)},t.createElement("span",null,"Dropdown")))};export{Kt as default};
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var ne=["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(","),re="undefined"==typeof Element,oe=re?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ie=!re&&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},le=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)},ce=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!le(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{oe.call(l,ne)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var a=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),s=!le(a,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(a&&s){var f=e(!0===a?l.children:a.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},ue=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ae=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))&&!ue(e)?0:e.tabIndex},se=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},fe=function(e){return"INPUT"===e.tagName},de=function(e){return function(e){return fe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ie(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)},pe=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},me=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=oe.call(e,"details>summary:first-of-type")?e.parentElement:e;if(oe.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return pe(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=ie(e);if(l&&!l.shadowRoot&&!0===r(l))return pe(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,r,o,i=e&&ie(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&l;){var u,a,s;c=!(null===(a=l=null===(u=i=ie(l))||void 0===u?void 0:u.host)||void 0===a||null===(s=a.ownerDocument)||void 0===s||!s.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ve=function(e,t){return!(t.disabled||le(t)||function(e){return fe(e)&&"hidden"===e.type}(t)||me(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!!oe.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},he=function(e,t){return!(de(t)||ae(t)<0||!ve(e,t))},ge=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ye=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=ae(e);return n<0&&t&&!ue(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(se).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},we=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ce([e],t.includeContainer,{filter:he.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ge}):function(e,t,n){if(le(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ne));return t&&oe.call(e,ne)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,he.bind(null,t)),ye(n)};function be(e,t,n){let{reference:r,floating:o}=e;const i=Z(t),l=G(t),c=$(l),u=X(t),a="y"===i,s=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:s,y:r.y-o.height};break;case"bottom":p={x:s,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(q(t)){case"start":p[l]-=d*(n&&a?-1:1);break;case"end":p[l]+=d*(n&&a?-1:1)}return p}async function xe(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=U(t,e),m=ee(p),v=c[d?"floating"===f?"reference":"floating":f],h=te(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:s,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=te(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function 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 Re(e){return F.some((t=>e[t]>=0))}function Ce(e){const t=S(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=j(n)!==i||j(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Se(e){return h(e)?e:e.contextElement}function Le(e){const t=Se(e);if(!g(t))return V(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ce(t);let l=(i?j(n.width):n.width)/r,c=(i?j(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Oe=V(0);function Te(e){const t=p(e);return R()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Oe}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?h(r)&&(l=Le(r)):l=Le(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==p(e))&&t}(i,n,r)?Te(i):V(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,s=o.width/l.x,f=o.height/l.y;if(i){const e=p(i),t=r&&h(r)?p(r):r;let n=e,o=A(n);for(;o&&r&&t!==n;){const e=Le(o),t=o.getBoundingClientRect(),r=S(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,s*=e.x,f*=e.y,u+=i,a+=l,n=p(o),o=A(n)}}return te({width:s,height:f,x:u,y:a})}function Ae(e,t){const n=L(e).scrollLeft;return t?t.left+n:Pe(m(e)).left+n}function ke(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 Me(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=p(e),r=m(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;const e=R();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(e,n);else if("document"===t)r=function(e){const t=m(e),n=L(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"===S(r).direction&&(l+=H(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(m(e));else if(h(t))r=function(e,t){const n=Pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=g(e)?Le(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=Te(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return te(r)}function De(e,t){const n=O(e);return!(n===t||!h(n)||C(n))&&("fixed"===S(n).position||De(n,t))}function Ne(e,t,n){const r=g(t),o=m(t),i="fixed"===n,l=Pe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=V(0);if(r||!r&&!i)if(("body"!==d(t)||w(o))&&(c=L(t)),r){const e=Pe(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Ae(o));const a=!o||r||i?V(0):ke(o,c);return{x:l.left+c.scrollLeft-u.x-a.x,y:l.top+c.scrollTop-u.y-a.y,width:l.width,height:l.height}}function Ie(e){return"static"===S(e).position}function Fe(e,t){if(!g(e)||"fixed"===S(e).position)return null;if(t)return t(e);let n=e.offsetParent;return m(e)===n&&(n=n.ownerDocument.body),n}function Be(e,t){const n=p(e);if(x(e))return n;if(!g(e)){let t=O(e);for(;t&&!C(t);){if(h(t)&&!Ie(t))return t;t=O(t)}return n}let r=Fe(e,t);for(;r&&b(r)&&Ie(r);)r=Fe(r,t);return r&&C(r)&&Ie(r)&&!E(r)?n:r||function(e){let t=O(e);for(;g(t)&&!C(t);){if(E(t))return t;if(x(t))return null;t=O(t)}return null}(e)||n}const He={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=m(r),c=!!t&&x(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=V(1);const s=V(0),f=g(r);if((f||!f&&!i)&&(("body"!==d(r)||w(l))&&(u=L(r)),g(r))){const e=Pe(r);a=Le(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const p=!l||f||i?V(0):ke(l,u,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+s.x+p.x,y:n.y*a.y-u.scrollTop*a.y+s.y+p.y}},getDocumentElement:m,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?x(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>h(e)&&"body"!==d(e))),o=null;const i="fixed"===S(e).position;let l=i?O(e):e;for(;h(l)&&!C(l);){const t=S(l),n=E(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||w(l)&&!n&&De(e,l))?r=r.filter((e=>e!==l)):o=t,l=O(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=Me(t,n,o);return e.top=H(r.top,e.top),e.right=B(r.right,e.right),e.bottom=B(r.bottom,e.bottom),e.left=H(r.left,e.left),e}),Me(t,l,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:Ne(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:Le,isElement:h,isRTL:function(e){return"rtl"===S(e).direction}};function je(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:u=!1}=r,a=Se(e),s=o||i?[...a?P(a):[],...P(t)]:[];s.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=a&&c?function(e,t){let n,r=null;const o=m(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const{left:a,top:s,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const p={rootMargin:-W(s)+"px "+-W(o.clientWidth-(a+f))+"px "+-W(o.clientHeight-(s+d))+"px "+-W(a)+"px",threshold:H(0,B(1,u))||1};let m=!0;function v(e){const t=e[0].intersectionRatio;if(t!==u){if(!m)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}m=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(a,n):null;let d,p=-1,v=null;l&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!u&&v.observe(a),v.observe(t));let h=u?Pe(e):null;return u&&function t(){const r=Pe(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=v)||e.disconnect(),v=null,u&&cancelAnimationFrame(d)}}const We=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=X(n),c=q(n),u="y"===Z(n),a=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=U(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*s,y:d*a}:{x:d*a,y:p*s}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}},Ve=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=U(e,t),a={x:n,y:r},s=await xe(t,u),f=Z(X(o)),d=Y(f);let p=a[d],m=a[f];if(i){const e="y"===d?"bottom":"right";p=K(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";m=K(m+s["y"===f?"top":"left"],m,m-s[e])}const v=c.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},_e=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:a}=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=U(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=X(o),y=Z(c),w=X(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(a.floating)),x=d||(w||!v?[J(c)]:function(e){const t=J(e);return[Q(e),t,Q(t)]}(c)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=q(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[]}}(X(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Q)))),i}(c,v,m,b));const R=[c,...x],C=await xe(t,h),S=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(s&&S.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=q(e),o=G(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=J(l)),[l,J(l)]}(o,l,b);S.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:S}],!S.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:L},reset:{placement:t}};let n=null==(T=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=L.filter((e=>{if(E){const t=Z(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:P[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},ze=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=U(e,t);switch(r){case"referenceHidden":{const e=Ee(await xe(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Re(e)}}}case"escaped":{const e=Ee(await xe(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Re(e)}}}default:return{}}}}},Ke=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:a,padding:s=0}=U(e,t)||{};if(null==a)return{};const f=ee(s),d={x:n,y:r},p=G(o),m=$(p),v=await l.getDimensions(a),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,L=B(f[g],S),O=B(f[y],S),T=L,P=R-v[m]-O,A=R/2-v[m]/2+C,k=K(T,A,P),M=!u.arrow&&null!=q(o)&&A!==k&&i.reference[m]/2-(A<T?L:O)-v[m]/2<0,D=M?A<T?A-T:A-P:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:A-k-D,...M&&{alignmentOffset:D}},reset:M}}}),Ue=(e,t,n)=>{const r=new Map,o={platform:He,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:s,y:f}=be(a,r,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,data:y,reset:w}=await v({x:s,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:a,platform:l,elements:{reference:e,floating:t}});s=null!=h?h:s,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&&(a=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:s,y:f}=be(a,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Xe="undefined"!=typeof document?n:r;function qe(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(!qe(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)&&!qe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ye(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $e(e,t){const n=Ye(e);return Math.round(t*n)/n}function Ze(t){const n=e.useRef(t);return Xe((()=>{n.current=t})),n}const Ge=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?Ke({element:n.current,padding:r}).fn(t):{}:n?Ke({element:n,padding:r}).fn(t):{};var o}}),Qe=(e,t)=>({...We(e),options:[e,t]}),Je=(e,t)=>({...Ve(e),options:[e,t]}),et=(e,t)=>({..._e(e),options:[e,t]}),tt=(e,t)=>({...ze(e),options:[e,t]}),nt={...e},rt=nt.useInsertionEffect||(e=>e());function ot(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return rt((()=>{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 it="undefined"!=typeof document?n:r;function lt(){return lt=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},lt.apply(this,arguments)}let ct=!1,ut=0;const at=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ut++;const st=nt.useId||function(){const[t,n]=e.useState((()=>ct?at():void 0));return it((()=>{null==t&&n(at())}),[]),e.useEffect((()=>{ct=!0}),[]),t};let ft;"production"!==process.env.NODE_ENV&&(ft=new Set);const dt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:u=7,tipRadius:a=0,strokeWidth:s=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...h}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ft)&&e.has(o)||(null==(i=ft)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const g=st(),[y,w]=e.useState(!1);if(it((()=>{if(!o)return;"rtl"===S(o).direction&&w(!0)}),[o]),!o)return null;const[b,x]=r.split("-"),E="top"===b||"bottom"===b;let R=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(R=null);const C=2*s,L=C/2,O=c/2*(a/-8+1),T=u/2*a/4,P=!!p,A=R&&"end"===x?"bottom":"top";let k=R&&"end"===x?"right":"left";R&&y&&(k="end"===x?"left":"right");const M=null!=(null==i?void 0:i.x)?R||i.x:"",D=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+c+" L"+(c-O)+","+(u-T)+" Q"+c/2+","+u+" "+O+","+(u-T)+" Z",I={top:P?"rotate(180deg)":"",left:P?"rotate(90deg)":"rotate(-90deg)",bottom:P?"":"rotate(180deg)",right:P?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",lt({},h,{"aria-hidden":!0,ref:n,width:P?c:c+C,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[k]:M,[A]:D,[b]:E||P?"100%":"calc(100% - "+C/2+"px)",transform:[I,m].filter((e=>!!e)).join(" "),...v}}),C>0&&e.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:C+(p?0:1),d:N}),e.createElement("path",{stroke:C&&!p?h.fill:"none",d:N}),e.createElement("clipPath",{id:g},e.createElement("rect",{x:-L,y:L*(P?-1:1),width:c+C,height:c})))}));const pt=e.createContext(null),mt=e.createContext(null),vt=()=>{var t;return(null==(t=e.useContext(pt))?void 0:t.id)||null},ht=()=>e.useContext(mt);function gt(e){return"data-floating-ui-"+e}function yt(e){const t=o(e);return it((()=>{t.current=e})),t}const wt=gt("safe-polygon");function bt(e,t,n){return n&&!M(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function xt(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 Et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Rt(e,t){const n=we(e,Et());"prev"===t&&n.reverse();const r=n.indexOf(function(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}(D(e)));return n.slice(r+1)[0]}function Ct(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!k(n,r)}function St(e){we(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 Ot={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 Tt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Pt=e.forwardRef((function(t,n){const[r,o]=e.useState();it((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Tt),()=>{document.removeEventListener("keydown",Tt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[gt("focus-guard")]:"",style:Ot};return e.createElement("span",lt({},t,i))})),At=e.createContext(null),kt=gt("portal");function Mt(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=st(),i=Dt(),[l,c]=e.useState(null),u=e.useRef(null);return it((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),it((()=>{if(!o)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(kt,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),it((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!h(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(kt,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),s=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==u?void 0:u.modal,v=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!(!o&&!c);return e.useEffect((()=>{if(c&&i&&!m)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Ct(e)){("focusin"===e.type?Lt:St)(c)}}}),[c,i,m]),e.useEffect((()=>{c&&(v||Lt(c))}),[v,c]),e.createElement(At.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:c,setFocusManagerState:a})),[i,c])},g&&c&&e.createElement(Pt,{"data-type":"outside",ref:s,onFocus:e=>{if(Ct(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Rt(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),g&&c&&e.createElement("span",{"aria-owns":c.id,style:Ot}),c&&l.createPortal(n,c),g&&c&&e.createElement(Pt,{"data-type":"outside",ref:f,onFocus:e=>{if(Ct(e,c)){var t;null==(t=p.current)||t.focus()}else{const t=Rt(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Dt=()=>e.useContext(At),Nt="data-floating-ui-focusable",It={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ft={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Bt=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 Ht(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=st(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),u=null!=vt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!h(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ft)&&e.has(o)||(null==(i=ft)||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,s]=e.useState(o.reference),f=ot(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:s})),[]),p=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:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}function jt(t){void 0===t&&(t={});const{nodeId:n}=t,r=Ht({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,u]=e.useState(null),[a,s]=e.useState(null),f=(null==i?void 0:i.domReference)||c,d=e.useRef(null),p=ht();it((()=>{f&&(d.current=f)}),[f]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:u}={},transform:a=!0,whileElementsMounted:s,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);qe(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=c||h,R=u||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),O=null!=s,T=Ze(s),P=Ze(i),A=Ze(f),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};P.current&&(e.platform=P.current),Ue(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};M.current&&!qe(L.current,t)&&(L.current=t,l.flushSync((()=>{p(t)})))}))}),[m,n,r,P,A]);Xe((()=>{!1===f&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Xe((()=>(M.current=!0,()=>{M.current=!1})),[]),Xe((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,O]);const D=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=$e(N.floating,d.x),n=$e(N.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...Ye(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,a,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:I})),[d,k,D,N,I])}({...t,elements:{...i,...a&&{reference:a}}}),v=e.useCallback((e=>{const t=h(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(h(e)||null===e)&&(d.current=e,u(e)),(h(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!h(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),w=e.useMemo((()=>({...m.elements,domReference:f})),[m.elements,f]),b=e.useMemo((()=>({...m,...o,refs:y,elements:w,nodeId:n})),[m,y,w,n,o]);return it((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...m,context:b,refs:y,elements:w})),[m,y,w,b])}const Wt="active",Vt="selected";function _t(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Wt]:t,[Vt]: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&&[Wt,Vt].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 zt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var Kt=function(n){var r=n.popperName,l=void 0===r?"":r,a=n.customRootClass,f=void 0===a?"":a;n.activationStrategy;var d=n.className,p=void 0===d?"":d,m=n.placement,v=void 0===m?"top":m,y=n.children,w=n.open,b=void 0!==w&&w;n.hoverDelay;var x=n.showArrow,E=void 0===x||x,L=n.pop,T=void 0===L?t.createElement(t.Fragment,null):L;u(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var A,F,B=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(f,l),H=o(null),j=i(b),W=j[0],V=j[1],_=jt({placement:v,whileElementsMounted:je,open:W,middleware:[(A={element:H,padding:4},{...Ge(A),options:[A,F]}),Qe(9),et({mainAxis:!0,fallbackStrategy:"initialPlacement"}),Je({crossAxis:!1}),tt({strategy:"referenceHidden"})],onOpenChange:V}),z=_.refs,K=_.floatingStyles,U=_.context,X=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=null!=(r=zt.get(c))?r:c,a=st(),s=null!=vt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:a},..."menu"===u&&s&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,s,o,a,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":a}}}),[u,i,a,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])}(U),q=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:a=!0,outsidePressEvent:s="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,y=ht(),w=ot("function"==typeof a?a:()=>!1),b="function"==typeof a?w:a,x=e.useRef(!1),E=e.useRef(!1),{escapeKey:L,outsidePress:T}=Bt(m),{escapeKey:A,outsidePress:M}=Bt(v),F=e.useRef(!1),B=ot((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(F.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?xt(y.nodesRef.current,n):[];if(!L&&(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=ot((e=>{var t;const n=()=>{var t;B(e),null==(t=I(e))||t.removeEventListener("keydown",n)};null==(t=I(e))||t.addEventListener("keydown",n)})),j=ot((e=>{var t;const n=x.current;x.current=!1;const r=E.current;if(E.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=I(e),u="["+gt("inert")+"]",a=D(i.floating).querySelectorAll(u);let f=h(c)?c:null;for(;f&&!C(f);){const e=O(f);if(C(e)||!h(e))break;f=e}if(a.length&&h(c)&&!c.matches("html,body")&&!k(c,i.floating)&&Array.from(a).every((e=>!k(f,e))))return;if(g(c)&&_){const t=C(c),n=S(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,a="rtl"===n.direction,s=u&&(a?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(s||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=y&&xt(y.nodesRef.current,d).some((t=>{var n;return N(e,null==(n=t.context)?void 0:n.elements.floating)}));if(N(e,i.floating)||N(e,i.domReference)||p)return;const m=y?xt(y.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ot((e=>{var t;const n=()=>{var t;j(e),null==(t=I(e))||t.removeEventListener(s,n)};null==(t=I(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=L,l.current.__outsidePressBubbles=T;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),F.current=!0}function a(){e=window.setTimeout((()=>{F.current=!1}),R()?5:0)}const f=D(i.floating);u&&(f.addEventListener("keydown",A?H:B,A),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",a)),b&&f.addEventListener(s,M?W:j,M);let d=[];return p&&(h(i.domReference)&&(d=P(i.domReference)),h(i.floating)&&(d=d.concat(P(i.floating))),!h(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(P(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",A?H:B,A),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",a)),b&&f.removeEventListener(s,M?W:j,M),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,b,s,r,o,p,c,L,T,B,A,H,j,M,W]),e.useEffect((()=>{x.current=!1}),[b,s]);const V=e.useMemo((()=>({onKeyDown:B,...f&&{[It[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[B,o,f,d]),_=e.useMemo((()=>({onKeyDown:B,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[Ft[s]]:()=>{x.current=!0}})),[B,s]);return e.useMemo((()=>c?{reference:V,floating:_}:{}),[c,V,_])}(U),Y=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:a=0,handleClose:s=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=ht(),v=vt(),g=yt(s),y=yt(a),w=yt(r),b=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),L=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(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=D(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,g,T]);const P=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=bt(y.current,"close",b.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[y,o]),A=ot((()=>{L.current(),E.current=void 0})),N=ot((()=>{if(S.current){const e=D(c.floating).body;e.style.pointerEvents="",e.removeAttribute(wt),S.current=!1}})),I=ot((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&h(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!M(b.current)||d>0&&!bt(y.current,"open"))return;const t=bt(y.current,"open",b.current);t?x.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(I())return;L.current();const t=D(c.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),A(),I()||P(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!k(c.floating,e.relatedTarget))&&P(e)}function l(e){I()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),A(),I()||P(e)}})(e))}}),[c,u,t,f,d,p,P,A,N,o,r,w,m,y,g,i,I]),it((()=>{var e;if(u&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){S.current=!0;const e=c.floating;if(h(c.domReference)&&e){var t;const n=D(c.floating).body;n.setAttribute(wt,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,v,c,m,g,T]),it((()=>{r||(b.current=void 0,O.current=!1,A(),N())}),[r,A,N]),e.useEffect((()=>()=>{A(),clearTimeout(x.current),clearTimeout(R.current),N()}),[u,c.domReference,A,N]);const F=e.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!M(b.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===b.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),B=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){I()||P(e.nativeEvent,!1)}})),[P,I]);return e.useMemo((()=>u?{reference:F,floating:B}:{}),[u,F,B])}(U,{}),$=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=>_t(e,t,"reference")),n),l=e.useCallback((e=>_t(e,t,"floating")),r),c=e.useCallback((e=>_t(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([Y,X,q]),Z=$.getReferenceProps,G=$.getFloatingProps;return t.createElement("span",null,t.createElement("span",c({className:s("rad-ui-popper","".concat(B,"-reference-element"),p),ref:z.setReference},Z({onClick:function(){console.log("click")}})),y),W&&t.createElement(Mt,null," ",t.createElement("div",c({className:s("".concat(B,"-floating-element")),ref:z.setFloating,style:K},G()),E&&t.createElement(dt,{className:s("rad-ui-arrow ".concat(B,"-arrow")),ref:H,context:U}),T)))},Ut=function(e){var n=e.children,r=e.label,o=void 0===r?"":r,i=e.placement,l=void 0===i?"top":i,a=u(e,["children","label","placement"]);return t.createElement(Kt,c({popperName:"Tooltip",pop:o,placement:l},a),n)};export{Ut as default};
5
+ */var ne=["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(","),re="undefined"==typeof Element,oe=re?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ie=!re&&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},le=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)},ce=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!le(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{oe.call(l,ne)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var a=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),s=!le(a,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(a&&s){var f=e(!0===a?l.children:a.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},ue=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ae=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))&&!ue(e)?0:e.tabIndex},se=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},fe=function(e){return"INPUT"===e.tagName},de=function(e){return function(e){return fe(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ie(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)},pe=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},me=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=oe.call(e,"details>summary:first-of-type")?e.parentElement:e;if(oe.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return pe(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=ie(e);if(l&&!l.shadowRoot&&!0===r(l))return pe(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,r,o,i=e&&ie(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&l;){var u,a,s;c=!(null===(a=l=null===(u=i=ie(l))||void 0===u?void 0:u.host)||void 0===a||null===(s=a.ownerDocument)||void 0===s||!s.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ve=function(e,t){return!(t.disabled||le(t)||function(e){return fe(e)&&"hidden"===e.type}(t)||me(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!!oe.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},he=function(e,t){return!(de(t)||ae(t)<0||!ve(e,t))},ge=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ye=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=ae(e);return n<0&&t&&!ue(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(se).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},we=function(e,t){var n;return n=(t=t||{}).getShadowRoot?ce([e],t.includeContainer,{filter:he.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:ge}):function(e,t,n){if(le(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ne));return t&&oe.call(e,ne)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,he.bind(null,t)),ye(n)};function be(e,t,n){let{reference:r,floating:o}=e;const i=Z(t),l=G(t),c=$(l),u=X(t),a="y"===i,s=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:s,y:r.y-o.height};break;case"bottom":p={x:s,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(q(t)){case"start":p[l]-=d*(n&&a?-1:1);break;case"end":p[l]+=d*(n&&a?-1:1)}return p}async function xe(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=U(t,e),m=ee(p),v=c[d?"floating"===f?"reference":"floating":f],h=te(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:s,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=te(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function 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 Re(e){return F.some((t=>e[t]>=0))}function Ce(e){const t=S(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=j(n)!==i||j(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Se(e){return h(e)?e:e.contextElement}function Le(e){const t=Se(e);if(!g(t))return V(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ce(t);let l=(i?j(n.width):n.width)/r,c=(i?j(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Oe=V(0);function Te(e){const t=p(e);return R()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Oe}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?h(r)&&(l=Le(r)):l=Le(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==p(e))&&t}(i,n,r)?Te(i):V(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,s=o.width/l.x,f=o.height/l.y;if(i){const e=p(i),t=r&&h(r)?p(r):r;let n=e,o=A(n);for(;o&&r&&t!==n;){const e=Le(o),t=o.getBoundingClientRect(),r=S(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,s*=e.x,f*=e.y,u+=i,a+=l,n=p(o),o=A(n)}}return te({width:s,height:f,x:u,y:a})}function Ae(e,t){const n=L(e).scrollLeft;return t?t.left+n:Pe(m(e)).left+n}function ke(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 Me(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=p(e),r=m(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;const e=R();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(e,n);else if("document"===t)r=function(e){const t=m(e),n=L(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"===S(r).direction&&(l+=H(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(m(e));else if(h(t))r=function(e,t){const n=Pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=g(e)?Le(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=Te(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return te(r)}function De(e,t){const n=O(e);return!(n===t||!h(n)||C(n))&&("fixed"===S(n).position||De(n,t))}function Ne(e,t,n){const r=g(t),o=m(t),i="fixed"===n,l=Pe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=V(0);if(r||!r&&!i)if(("body"!==d(t)||w(o))&&(c=L(t)),r){const e=Pe(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Ae(o));const a=!o||r||i?V(0):ke(o,c);return{x:l.left+c.scrollLeft-u.x-a.x,y:l.top+c.scrollTop-u.y-a.y,width:l.width,height:l.height}}function Ie(e){return"static"===S(e).position}function Fe(e,t){if(!g(e)||"fixed"===S(e).position)return null;if(t)return t(e);let n=e.offsetParent;return m(e)===n&&(n=n.ownerDocument.body),n}function Be(e,t){const n=p(e);if(x(e))return n;if(!g(e)){let t=O(e);for(;t&&!C(t);){if(h(t)&&!Ie(t))return t;t=O(t)}return n}let r=Fe(e,t);for(;r&&b(r)&&Ie(r);)r=Fe(r,t);return r&&C(r)&&Ie(r)&&!E(r)?n:r||function(e){let t=O(e);for(;g(t)&&!C(t);){if(E(t))return t;if(x(t))return null;t=O(t)}return null}(e)||n}const He={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=m(r),c=!!t&&x(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=V(1);const s=V(0),f=g(r);if((f||!f&&!i)&&(("body"!==d(r)||w(l))&&(u=L(r)),g(r))){const e=Pe(r);a=Le(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const p=!l||f||i?V(0):ke(l,u,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+s.x+p.x,y:n.y*a.y-u.scrollTop*a.y+s.y+p.y}},getDocumentElement:m,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?x(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>h(e)&&"body"!==d(e))),o=null;const i="fixed"===S(e).position;let l=i?O(e):e;for(;h(l)&&!C(l);){const t=S(l),n=E(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||w(l)&&!n&&De(e,l))?r=r.filter((e=>e!==l)):o=t,l=O(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=Me(t,n,o);return e.top=H(r.top,e.top),e.right=B(r.right,e.right),e.bottom=B(r.bottom,e.bottom),e.left=H(r.left,e.left),e}),Me(t,l,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:Ne(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:Le,isElement:h,isRTL:function(e){return"rtl"===S(e).direction}};function je(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:u=!1}=r,a=Se(e),s=o||i?[...a?P(a):[],...P(t)]:[];s.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=a&&c?function(e,t){let n,r=null;const o=m(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const{left:a,top:s,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const p={rootMargin:-W(s)+"px "+-W(o.clientWidth-(a+f))+"px "+-W(o.clientHeight-(s+d))+"px "+-W(a)+"px",threshold:H(0,B(1,u))||1};let m=!0;function v(e){const t=e[0].intersectionRatio;if(t!==u){if(!m)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}m=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(a,n):null;let d,p=-1,v=null;l&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!u&&v.observe(a),v.observe(t));let h=u?Pe(e):null;return u&&function t(){const r=Pe(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=v)||e.disconnect(),v=null,u&&cancelAnimationFrame(d)}}const We=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=X(n),c=q(n),u="y"===Z(n),a=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=U(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*s,y:d*a}:{x:d*a,y:p*s}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}},Ve=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=U(e,t),a={x:n,y:r},s=await xe(t,u),f=Z(X(o)),d=Y(f);let p=a[d],m=a[f];if(i){const e="y"===d?"bottom":"right";p=K(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";m=K(m+s["y"===f?"top":"left"],m,m-s[e])}const v=c.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},_e=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:a}=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=U(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=X(o),y=Z(c),w=X(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(a.floating)),x=d||(w||!v?[J(c)]:function(e){const t=J(e);return[Q(e),t,Q(t)]}(c)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=q(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[]}}(X(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(Q)))),i}(c,v,m,b));const R=[c,...x],C=await xe(t,h),S=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(s&&S.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=q(e),o=G(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=J(l)),[l,J(l)]}(o,l,b);S.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:S}],!S.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:L},reset:{placement:t}};let n=null==(T=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=L.filter((e=>{if(E){const t=Z(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:P[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},ze=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=U(e,t);switch(r){case"referenceHidden":{const e=Ee(await xe(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Re(e)}}}case"escaped":{const e=Ee(await xe(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Re(e)}}}default:return{}}}}},Ke=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:a,padding:s=0}=U(e,t)||{};if(null==a)return{};const f=ee(s),d={x:n,y:r},p=G(o),m=$(p),v=await l.getDimensions(a),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,L=B(f[g],S),O=B(f[y],S),T=L,P=R-v[m]-O,A=R/2-v[m]/2+C,k=K(T,A,P),M=!u.arrow&&null!=q(o)&&A!==k&&i.reference[m]/2-(A<T?L:O)-v[m]/2<0,D=M?A<T?A-T:A-P:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:A-k-D,...M&&{alignmentOffset:D}},reset:M}}}),Ue=(e,t,n)=>{const r=new Map,o={platform:He,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:s,y:f}=be(a,r,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,data:y,reset:w}=await v({x:s,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:a,platform:l,elements:{reference:e,floating:t}});s=null!=h?h:s,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&&(a=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:s,y:f}=be(a,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Xe="undefined"!=typeof document?n:r;function qe(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(!qe(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)&&!qe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ye(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $e(e,t){const n=Ye(e);return Math.round(t*n)/n}function Ze(t){const n=e.useRef(t);return Xe((()=>{n.current=t})),n}const Ge=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?Ke({element:n.current,padding:r}).fn(t):{}:n?Ke({element:n,padding:r}).fn(t):{};var o}}),Qe=(e,t)=>({...We(e),options:[e,t]}),Je=(e,t)=>({...Ve(e),options:[e,t]}),et=(e,t)=>({..._e(e),options:[e,t]}),tt=(e,t)=>({...ze(e),options:[e,t]}),nt={...e},rt=nt.useInsertionEffect||(e=>e());function ot(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return rt((()=>{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 it="undefined"!=typeof document?n:r;function lt(){return lt=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},lt.apply(this,arguments)}let ct=!1,ut=0;const at=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ut++;const st=nt.useId||function(){const[t,n]=e.useState((()=>ct?at():void 0));return it((()=>{null==t&&n(at())}),[]),e.useEffect((()=>{ct=!0}),[]),t};let ft;"production"!==process.env.NODE_ENV&&(ft=new Set);const dt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:u=7,tipRadius:a=0,strokeWidth:s=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...h}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ft)&&e.has(o)||(null==(i=ft)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const g=st(),[y,w]=e.useState(!1);if(it((()=>{if(!o)return;"rtl"===S(o).direction&&w(!0)}),[o]),!o)return null;const[b,x]=r.split("-"),E="top"===b||"bottom"===b;let R=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(R=null);const C=2*s,L=C/2,O=c/2*(a/-8+1),T=u/2*a/4,P=!!p,A=R&&"end"===x?"bottom":"top";let k=R&&"end"===x?"right":"left";R&&y&&(k="end"===x?"left":"right");const M=null!=(null==i?void 0:i.x)?R||i.x:"",D=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+c+" L"+(c-O)+","+(u-T)+" Q"+c/2+","+u+" "+O+","+(u-T)+" Z",I={top:P?"rotate(180deg)":"",left:P?"rotate(90deg)":"rotate(-90deg)",bottom:P?"":"rotate(180deg)",right:P?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",lt({},h,{"aria-hidden":!0,ref:n,width:P?c:c+C,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[k]:M,[A]:D,[b]:E||P?"100%":"calc(100% - "+C/2+"px)",transform:[I,m].filter((e=>!!e)).join(" "),...v}}),C>0&&e.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:C+(p?0:1),d:N}),e.createElement("path",{stroke:C&&!p?h.fill:"none",d:N}),e.createElement("clipPath",{id:g},e.createElement("rect",{x:-L,y:L*(P?-1:1),width:c+C,height:c})))}));const pt=e.createContext(null),mt=e.createContext(null),vt=()=>{var t;return(null==(t=e.useContext(pt))?void 0:t.id)||null},ht=()=>e.useContext(mt);function gt(e){return"data-floating-ui-"+e}function yt(e){const t=o(e);return it((()=>{t.current=e})),t}const wt=gt("safe-polygon");function bt(e,t,n){return n&&!M(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function xt(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 Et=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Rt(e,t){const n=we(e,Et());"prev"===t&&n.reverse();const r=n.indexOf(function(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}(D(e)));return n.slice(r+1)[0]}function Ct(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!k(n,r)}function St(e){we(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 Ot={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 Tt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Pt=e.forwardRef((function(t,n){const[r,o]=e.useState();it((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Tt),()=>{document.removeEventListener("keydown",Tt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[gt("focus-guard")]:"",style:Ot};return e.createElement("span",lt({},t,i))})),At=e.createContext(null),kt=gt("portal");function Mt(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=st(),i=Dt(),[l,c]=e.useState(null),u=e.useRef(null);return it((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),it((()=>{if(!o)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(kt,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),it((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!h(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(kt,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),s=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==u?void 0:u.modal,v=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!(!o&&!c);return e.useEffect((()=>{if(c&&i&&!m)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Ct(e)){("focusin"===e.type?Lt:St)(c)}}}),[c,i,m]),e.useEffect((()=>{c&&(v||Lt(c))}),[v,c]),e.createElement(At.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:c,setFocusManagerState:a})),[i,c])},g&&c&&e.createElement(Pt,{"data-type":"outside",ref:s,onFocus:e=>{if(Ct(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Rt(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),g&&c&&e.createElement("span",{"aria-owns":c.id,style:Ot}),c&&l.createPortal(n,c),g&&c&&e.createElement(Pt,{"data-type":"outside",ref:f,onFocus:e=>{if(Ct(e,c)){var t;null==(t=p.current)||t.focus()}else{const t=Rt(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Dt=()=>e.useContext(At),Nt="data-floating-ui-focusable",It={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ft={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Bt=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 Ht(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=st(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),u=null!=vt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!h(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ft)&&e.has(o)||(null==(i=ft)||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,s]=e.useState(o.reference),f=ot(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:s})),[]),p=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:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}function jt(t){void 0===t&&(t={});const{nodeId:n}=t,r=Ht({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,u]=e.useState(null),[a,s]=e.useState(null),f=(null==i?void 0:i.domReference)||c,d=e.useRef(null),p=ht();it((()=>{f&&(d.current=f)}),[f]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:u}={},transform:a=!0,whileElementsMounted:s,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);qe(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=c||h,R=u||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),O=null!=s,T=Ze(s),P=Ze(i),A=Ze(f),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};P.current&&(e.platform=P.current),Ue(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};M.current&&!qe(L.current,t)&&(L.current=t,l.flushSync((()=>{p(t)})))}))}),[m,n,r,P,A]);Xe((()=>{!1===f&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Xe((()=>(M.current=!0,()=>{M.current=!1})),[]),Xe((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,O]);const D=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=$e(N.floating,d.x),n=$e(N.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...Ye(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,a,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:I})),[d,k,D,N,I])}({...t,elements:{...i,...a&&{reference:a}}}),v=e.useCallback((e=>{const t=h(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(h(e)||null===e)&&(d.current=e,u(e)),(h(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!h(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),w=e.useMemo((()=>({...m.elements,domReference:f})),[m.elements,f]),b=e.useMemo((()=>({...m,...o,refs:y,elements:w,nodeId:n})),[m,y,w,n,o]);return it((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...m,context:b,refs:y,elements:w})),[m,y,w,b])}const Wt="active",Vt="selected";function _t(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Wt]:t,[Vt]: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&&[Wt,Vt].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 zt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var Kt=function(n){var r=n.popperName,l=void 0===r?"":r,a=n.customRootClass,f=void 0===a?"":a;n.activationStrategy;var d=n.className,p=void 0===d?"":d,m=n.placement,v=void 0===m?"top":m,y=n.children,w=n.open,b=void 0!==w&&w;n.hoverDelay;var x=n.showArrow,E=void 0===x||x,L=n.pop,T=void 0===L?t.createElement(t.Fragment,null):L;u(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var A,F,B=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(f,l),H=o(null),j=i(b),W=j[0],V=j[1],_=jt({placement:v,whileElementsMounted:je,open:W,middleware:[(A={element:H,padding:4},{...Ge(A),options:[A,F]}),Qe(9),et({mainAxis:!0,fallbackStrategy:"initialPlacement"}),Je({crossAxis:!1}),tt({strategy:"referenceHidden"})],onOpenChange:V}),z=_.refs,K=_.floatingStyles,U=_.context,X=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=null!=(r=zt.get(c))?r:c,a=st(),s=null!=vt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:a},..."menu"===u&&s&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,s,o,a,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":a}}}),[u,i,a,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])}(U),q=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:a=!0,outsidePressEvent:s="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,y=ht(),w=ot("function"==typeof a?a:()=>!1),b="function"==typeof a?w:a,x=e.useRef(!1),E=e.useRef(!1),{escapeKey:L,outsidePress:T}=Bt(m),{escapeKey:A,outsidePress:M}=Bt(v),F=e.useRef(!1),B=ot((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(F.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?xt(y.nodesRef.current,n):[];if(!L&&(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=ot((e=>{var t;const n=()=>{var t;B(e),null==(t=I(e))||t.removeEventListener("keydown",n)};null==(t=I(e))||t.addEventListener("keydown",n)})),j=ot((e=>{var t;const n=x.current;x.current=!1;const r=E.current;if(E.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=I(e),u="["+gt("inert")+"]",a=D(i.floating).querySelectorAll(u);let f=h(c)?c:null;for(;f&&!C(f);){const e=O(f);if(C(e)||!h(e))break;f=e}if(a.length&&h(c)&&!c.matches("html,body")&&!k(c,i.floating)&&Array.from(a).every((e=>!k(f,e))))return;if(g(c)&&_){const t=C(c),n=S(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,a="rtl"===n.direction,s=u&&(a?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(s||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=y&&xt(y.nodesRef.current,d).some((t=>{var n;return N(e,null==(n=t.context)?void 0:n.elements.floating)}));if(N(e,i.floating)||N(e,i.domReference)||p)return;const m=y?xt(y.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ot((e=>{var t;const n=()=>{var t;j(e),null==(t=I(e))||t.removeEventListener(s,n)};null==(t=I(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=L,l.current.__outsidePressBubbles=T;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),F.current=!0}function a(){e=window.setTimeout((()=>{F.current=!1}),R()?5:0)}const f=D(i.floating);u&&(f.addEventListener("keydown",A?H:B,A),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",a)),b&&f.addEventListener(s,M?W:j,M);let d=[];return p&&(h(i.domReference)&&(d=P(i.domReference)),h(i.floating)&&(d=d.concat(P(i.floating))),!h(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(P(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",A?H:B,A),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",a)),b&&f.removeEventListener(s,M?W:j,M),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,b,s,r,o,p,c,L,T,B,A,H,j,M,W]),e.useEffect((()=>{x.current=!1}),[b,s]);const V=e.useMemo((()=>({onKeyDown:B,...f&&{[It[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[B,o,f,d]),_=e.useMemo((()=>({onKeyDown:B,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[Ft[s]]:()=>{x.current=!0}})),[B,s]);return e.useMemo((()=>c?{reference:V,floating:_}:{}),[c,V,_])}(U),Y=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:a=0,handleClose:s=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=ht(),v=vt(),g=yt(s),y=yt(a),w=yt(r),b=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),L=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(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=D(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,g,T]);const P=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=bt(y.current,"close",b.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[y,o]),A=ot((()=>{L.current(),E.current=void 0})),N=ot((()=>{if(S.current){const e=D(c.floating).body;e.style.pointerEvents="",e.removeAttribute(wt),S.current=!1}})),I=ot((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&h(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!M(b.current)||d>0&&!bt(y.current,"open"))return;const t=bt(y.current,"open",b.current);t?x.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(I())return;L.current();const t=D(c.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),A(),I()||P(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!k(c.floating,e.relatedTarget))&&P(e)}function l(e){I()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),A(),I()||P(e)}})(e))}}),[c,u,t,f,d,p,P,A,N,o,r,w,m,y,g,i,I]),it((()=>{var e;if(u&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){S.current=!0;const e=c.floating;if(h(c.domReference)&&e){var t;const n=D(c.floating).body;n.setAttribute(wt,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,v,c,m,g,T]),it((()=>{r||(b.current=void 0,O.current=!1,A(),N())}),[r,A,N]),e.useEffect((()=>()=>{A(),clearTimeout(x.current),clearTimeout(R.current),N()}),[u,c.domReference,A,N]);const F=e.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!M(b.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===b.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),B=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){I()||P(e.nativeEvent,!1)}})),[P,I]);return e.useMemo((()=>u?{reference:F,floating:B}:{}),[u,F,B])}(U,{}),$=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=>_t(e,t,"reference")),n),l=e.useCallback((e=>_t(e,t,"floating")),r),c=e.useCallback((e=>_t(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([Y,X,q]),Z=$.getReferenceProps,G=$.getFloatingProps;return t.createElement(t.Fragment,null,t.createElement("span",c({className:s("rad-ui-popper","".concat(B,"-reference-element"),p),ref:z.setReference},Z({onClick:function(){console.log("click")}})),y),W&&t.createElement(Mt,null," ",t.createElement("div",c({className:s("".concat(B,"-floating-element")),ref:z.setFloating,style:K},G()),E&&t.createElement(dt,{className:s("rad-ui-arrow ".concat(B,"-arrow")),ref:H,context:U}),T)))},Ut=function(e){var n=e.children,r=e.label,o=void 0===r?"":r,i=e.placement,l=void 0===i?"top":i,a=u(e,["children","label","placement"]);return t.createElement(Kt,c({popperName:"Tooltip",pop:o,placement:l},a),n)};export{Ut as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@radui/ui",
3
- "version": "0.0.28",
3
+ "version": "0.0.29",
4
4
  "description": "",
5
5
  "main": "dist",
6
6
  "type": "module",
@@ -59,7 +59,7 @@
59
59
  "build:components": "npm run compile-components && npm run process-components",
60
60
  "build": "npm run prebuild && npm run build:css && NODE_OPTIONS='--max-old-space-size=4076' npm run build:components",
61
61
  "release": "npm publish --access public",
62
- "lint": "eslint --ext .js,.jsx,.ts,.tsx . --fix",
62
+ "lint": "eslint --ext .js,.jsx,.ts,.tsx . --fix && stylelint \"**/*.{css,scss,sass}\" --no-fix",
63
63
  "update-rad": "npm update @radui/ui",
64
64
  "setup:dependencies": "npm install --force",
65
65
  "setup": "npm run setup:dependencies"
@@ -124,6 +124,11 @@
124
124
  "sass": "^1.77.2",
125
125
  "sass-loader": "16.0.4",
126
126
  "storybook": "8.2.9",
127
+ "stylelint": "^16.12.0",
128
+ "stylelint-config-standard": "^36.0.1",
129
+ "stylelint-config-standard-scss": "^14.0.0",
130
+ "stylelint-config-tailwindcss": "^0.0.7",
131
+ "stylelint-scss": "^6.10.0",
127
132
  "tailwindcss": "3.4.1",
128
133
  "ts-jest": "29.1.1",
129
134
  "ts-node": "^10.9.2",