@radui/ui 0.0.29 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.js +2 -2
- package/dist/components/Avatar.js +1 -1
- package/dist/components/AvatarGroup.js +1 -1
- package/dist/components/Badge.js +1 -1
- package/dist/components/BlockQuote.js +1 -1
- package/dist/components/Button.js +1 -1
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/Dropdown.js +2 -2
- package/dist/components/HoverCard.js +2 -2
- package/dist/components/Modal.js +2 -2
- package/dist/components/Progress.js +1 -1
- package/dist/components/RadioCards.js +1 -0
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/Separator.js +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Tooltip.js +2 -2
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.js +1 -1
- package/dist/themes/default.css +1 -1
- package/package.json +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var t=function(){return t=Object.assign||function(r){for(var t,
|
|
1
|
+
'use client';import r from"react";var t=function(){return t=Object.assign||function(r){for(var t,o=1,e=arguments.length;o<e;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r},t.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function o(r){var t,e,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(t=0;t<a;t++)r[t]&&(e=o(r[t]))&&(n&&(n+=" "),n+=e)}else for(e in r)r[e]&&(n&&(n+=" "),n+=e);return n}function e(){for(var r,t,e=0,n="",a=arguments.length;e<a;e++)(r=arguments[e])&&(t=o(r))&&(n&&(n+=" "),n+=t);return n}var n="Separator",a=function(o){var a=o.orientation,c=void 0===a?"horizontal":a,i=o.className,l=o.customRootClass,s=o.color,f=void 0===s?"":s,p=function(r,t){var o={};for(var e in r)Object.prototype.hasOwnProperty.call(r,e)&&t.indexOf(e)<0&&(o[e]=r[e]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(r);n<e.length;n++)t.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(r,e[n])&&(o[e[n]]=r[e[n]])}return o}(o,["orientation","className","customRootClass","color"]),u=function(r,t){if(void 0===r&&(r=""),r)return r;var o=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(o)}(l,n),y="".concat(u,"vertical"===c?"-vertical":"-horizontal"),v={};return f&&(v["data-accent-color"]=f),r.createElement("div",t({className:e(u,y,i)},p,v))};a.displayName=n;export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e,{useState as r}from"react";var t=function(){return t=Object.assign||function(e){for(var r,t=1,
|
|
1
|
+
'use client';import e,{useState as r}from"react";var t=function(){return t=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},t.apply(this,arguments)};"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 c=e.length;for(r=0;r<c;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="",c=arguments.length;t<c;t++)(e=arguments[t])&&(r=n(e))&&(o&&(o+=" "),o+=r);return o}var c="Switch",a=function(n){n.children;var a=n.customRootClass,l=void 0===a?"":a;n.className;var i=n.color,u=void 0===i?"":i,f=n.defaultChecked,s=n.checked,p=n.onChange,d=function(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}(n,["children","customRootClass","className","color","defaultChecked","checked","onChange"]),h=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)}(l,c),y=r(s||f),v=y[0],m=y[1],b={};return u&&(b["data-accent-color"]=u),e.createElement(e.Fragment,null,e.createElement("input",t({type:"checkbox",className:o(h)},d,{checked:v,onChange:function(e){return m(e.target.checked)}})),e.createElement("button",t({type:"button",onClick:function(){var e=!v;m(e),p(e)},role:"switch"},b)))};a.displayName=c;export{a as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e,{useState as r}from"react";var t=function(){return t=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++)for(var
|
|
1
|
+
'use client';import e,{useState as r}from"react";var t=function(){return t=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},t.apply(this,arguments)};function n(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 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 a(){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}"function"==typeof SuppressedError&&SuppressedError;var s=["div","span","button","input"].reduce((function(r,o){return r[o]=function(r){var o=e.forwardRef((function(o,a){var s=o.asChild,i=void 0!==s&&s,l=o.children,d=n(o,["asChild","children"]);return i&&e.isValidElement(l)?e.cloneElement(l,t(t({},d),{ref:a})):e.createElement(r,t(t({},d),{ref:a}),l)}));return o.displayName="Primitive.".concat(r),o}(o),r}),{}),i=function(o){var a=o.children,i=o.label,l=void 0===i?"":i,d=o.defaultPressed,c=void 0!==d&&d,f=o.pressed,u=o.onPressedChange,p=void 0===u?function(){}:u,v=o.disabled,b=n(o,["children","label","defaultPressed","pressed","onPressedChange","disabled"]),y=r(c),h=y[0],m=y[1],g=void 0!==f,O=g?f:h,P=function(){if(!v){var e=!O;g||m(e),p(e)}},C=l?{"aria-label":l}:{};return C["aria-pressed"]=O?"true":"false",C["aria-disabled"]=v?"true":"false",e.createElement(s.button,t({onClick:P,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),P())},"data-state":O?"on":"off",disabled:v},C,b),a)},l="Toggle",d=function(o){o.defaultPressed;var s=o.customRootClass,d=void 0===s?"":s,c=o.children,f=o.className,u=void 0===f?"":f,p=o.color,v=void 0===p?"":p,b=o.pressed,y=void 0!==b&&b,h=o.onChange,m=n(o,["defaultPressed","customRootClass","children","className","color","pressed","onChange"]);if("boolean"!=typeof y)throw new Error("Toggle: pressed prop must be a boolean");var g=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)}(d,l),O=r(y),P=O[0],C=O[1],E={};return v&&(E["data-accent-color"]=v),e.createElement(i,t({className:a(g,u),pressed:P,onPressedChange:function(){var e=!P;C(e),h(e)},"data-state":P?"on":"off","data-disabled":m.disabled?"":void 0},m,E),c)};d.displayName=l;export{d as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e,{createContext as t,useRef as r,useState as n,useContext as o}from"react";function i(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=
|
|
1
|
+
'use client';import e,{createContext as t,useRef as r,useState as n,useContext as o}from"react";var i=function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},i.apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function l(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function u(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=u(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function c(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=u(e))&&(n&&(n+=" "),n+=t);return n}"function"==typeof SuppressedError&&SuppressedError;var f=function(e){return e.querySelectorAll("[data-rad-ui-batch-element]")},s=function(e){var t=null;return e.forEach((function(e){e.hasAttribute("data-rad-ui-focus-element")&&(t=e)})),t},d=t({type:"single",activeToggles:[],setActiveToggles:function(){},nextItem:function(){},previousItem:function(){}}),v=function(t){var o=t.type,a=void 0===o?"multiple":o,l=t.className,u=void 0===l?"":l,v=t.loop,p=void 0===v||v,m=t.customRootClass,y=void 0===m?"":m,g=t.componentName,h=void 0===g?"":g,b=t.value,E=void 0===b?null:b,A=t.color,O=void 0===A?"":A,w=t.children,P=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var r=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(r)}(y,h),C=r(null),I=n(E||[]),j={nextItem:function(){var e=C.current;if(e){var t=function(e,t){void 0===t&&(t=!1);var r=s(e),n=null==r?void 0:r.nextElementSibling;return n||(t?e[0]:e[e.length-1])}(f(e),p);t&&(null==t||t.focus())}},previousItem:function(){var e=null==C?void 0:C.current;if(e){var t=function(e,t){void 0===t&&(t=!1);var r=s(e),n=null==r?void 0:r.previousElementSibling;return n||(t?e[e.length-1]:e[0])}(f(e),p);t&&(null==t||t.focus())}},activeToggles:I[0],setActiveToggles:I[1],type:a},k={};return O&&(k["data-accent-color"]=O),e.createElement("div",i({className:c(P,u),role:"group",ref:C},k),e.createElement(d.Provider,{value:j},w))},p=["div","span","button","input"].reduce((function(t,r){return t[r]=function(t){var r=e.forwardRef((function(r,n){var o=r.asChild,l=void 0!==o&&o,u=r.children,c=a(r,["asChild","children"]);return l&&e.isValidElement(u)?e.cloneElement(u,i(i({},c),{ref:n})):e.createElement(t,i(i({},c),{ref:n}),u)}));return r.displayName="Primitive.".concat(t),r}(r),t}),{}),m=function(t){var r=t.children,o=t.label,l=void 0===o?"":o,u=t.defaultPressed,c=void 0!==u&&u,f=t.pressed,s=t.onPressedChange,d=void 0===s?function(){}:s,v=t.disabled,m=a(t,["children","label","defaultPressed","pressed","onPressedChange","disabled"]),y=n(c),g=y[0],h=y[1],b=void 0!==f,E=b?f:g,A=function(){if(!v){var e=!E;b||h(e),d(e)}},O=l?{"aria-label":l}:{};return O["aria-pressed"]=E?"true":"false",O["aria-disabled"]=v?"true":"false",e.createElement(p.button,i({onClick:A,onKeyDown:function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),A())},"data-state":E?"on":"off",disabled:v},O,m),r)},y=function(t){var r=t.children,u=t.value,c=void 0===u?null:u,f=a(t,["children","value"]),s=o(d),v=s.type,p=s.activeToggles,y=s.setActiveToggles,g=s.nextItem,h=s.previousItem,b=null==p?void 0:p.includes(c),E=n(!1),A=E[0],O=E[1],w={},P={};return b?(w["aria-pressed"]="true",P["data-active"]="true"):(w["aria-pressed"]="false",P["data-active"]="false"),e.createElement(m,i({onClick:function(){var e=p||[];if("single"===v)return b?void y([]):void y([c]);"multiple"===v&&(e=b?e.filter((function(e){return e!==c})):l(l([],e,!0),[c],!1)),y(e)},onFocus:function(){O(!0)},onBlur:function(){O(!1)}},w,P,{"data-rad-ui-batch-element":!0,onKeyDown:function(e){"ArrowRight"===e.key&&(e.preventDefault(),g()),"ArrowLeft"===e.key&&(e.preventDefault(),h())}},A?{"data-rad-ui-focus-element":""}:{},f),r)},g="ToggleGroup",h=function(t){var r=t.type,n=void 0===r?"single":r,o=t.items,i=void 0===o?[]:o,a=t.color,l=void 0===a?"":a;return e.createElement(v,{type:n,componentName:g,color:l},i.map((function(t,r){return e.createElement(y,{key:r,value:t.value},t.label)})))};h.displayName=g,h.Root=v,h.Item=y;export{h as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
'use client';import*as e from"react";import t,{
|
|
1
|
+
'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as c,isValidElement as u}from"react";import{jsxs as a,jsx as s}from"react/jsx-runtime";import*as f from"react-dom";var d=function(){return d=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)};function p(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var m=n(null);function v(){return"undefined"!=typeof window}function h(e){return w(e)?(e.nodeName||"").toLowerCase():"#document"}function g(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function y(e){var t;return null==(t=(w(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function w(e){return!!v()&&(e instanceof Node||e instanceof g(e).Node)}function b(e){return!!v()&&(e instanceof Element||e instanceof g(e).Element)}function x(e){return!!v()&&(e instanceof HTMLElement||e instanceof g(e).HTMLElement)}function E(e){return!(!v()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof g(e).ShadowRoot)}function R(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=T(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function C(e){return["table","td","th"].includes(h(e))}function S(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function L(e){const t=O(),n=b(e)?T(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!n[e]&&"none"!==n[e]))||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function O(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function P(e){return["html","body","#document"].includes(h(e))}function T(e){return g(e).getComputedStyle(e)}function A(e){return b(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function k(e){if("html"===h(e))return e;const t=e.assignedSlot||e.parentNode||E(e)&&e.host||y(e);return E(t)?t.host:t}function N(e){const t=k(e);return P(t)?e.ownerDocument?e.ownerDocument.body:e.body:x(t)&&R(t)?t:N(t)}function M(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=N(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=g(o);if(i){const e=D(l);return t.concat(l,l.visualViewport||[],R(o)?o:[],e&&n?M(e):[])}return t.concat(o,M(o,[],n))}function D(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function I(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&E(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function F(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function B(e){return(null==e?void 0:e.ownerDocument)||document}function H(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function W(e){return"composedPath"in e?e.composedPath()[0]:e.target}const j=["top","right","bottom","left"],V=Math.min,_=Math.max,z=Math.round,K=Math.floor,U=e=>({x:e,y:e}),X={left:"right",right:"left",bottom:"top",top:"bottom"},q={start:"end",end:"start"};function Y(e,t,n){return _(e,V(t,n))}function $(e,t){return"function"==typeof e?e(t):e}function Z(e){return e.split("-")[0]}function G(e){return e.split("-")[1]}function Q(e){return"x"===e?"y":"x"}function J(e){return"y"===e?"height":"width"}function ee(e){return["top","bottom"].includes(Z(e))?"y":"x"}function te(e){return Q(ee(e))}function ne(e){return e.replace(/start|end/g,(e=>q[e]))}function re(e){return e.replace(/left|right|bottom|top/g,(e=>X[e]))}function oe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ie(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}
|
|
2
2
|
/*!
|
|
3
3
|
* tabbable 6.2.0
|
|
4
4
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
-
*/var 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};
|
|
5
|
+
*/var le=["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(","),ce="undefined"==typeof Element,ue=ce?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ae=!ce&&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},se=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)},fe=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!se(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{ue.call(l,le)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var a=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),s=!se(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},de=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},pe=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))&&!de(e)?0:e.tabIndex},me=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ve=function(e){return"INPUT"===e.tagName},he=function(e){return function(e){return ve(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ae(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)},ge=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ye=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ue.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ue.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return ge(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=ae(e);if(l&&!l.shadowRoot&&!0===r(l))return ge(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&&ae(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=ae(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},we=function(e,t){return!(t.disabled||se(t)||function(e){return ve(e)&&"hidden"===e.type}(t)||ye(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!!ue.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},be=function(e,t){return!(he(t)||pe(t)<0||!we(e,t))},xe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ee=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=pe(e);return n<0&&t&&!de(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(me).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Re=function(e,t){var n;return n=(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xe}):function(e,t,n){if(se(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(le));return t&&ue.call(e,le)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,be.bind(null,t)),Ee(n)};function Ce(e,t,n){let{reference:r,floating:o}=e;const i=ee(t),l=te(t),c=J(l),u=Z(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(G(t)){case"start":p[l]-=d*(n&&a?-1:1);break;case"end":p[l]+=d*(n&&a?-1:1)}return p}async function Se(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}=$(t,e),m=oe(p),v=c[d?"floating"===f?"reference":"floating":f],h=ie(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=ie(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 Le(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Oe(e){return j.some((t=>e[t]>=0))}function Pe(e){const t=T(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=x(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=z(n)!==i||z(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Te(e){return b(e)?e:e.contextElement}function Ae(e){const t=Te(e);if(!x(t))return U(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pe(t);let l=(i?z(n.width):n.width)/r,c=(i?z(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const ke=U(0);function Ne(e){const t=g(e);return O()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ke}function Me(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Te(e);let l=U(1);t&&(r?b(r)&&(l=Ae(r)):l=Ae(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==g(e))&&t}(i,n,r)?Ne(i):U(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=g(i),t=r&&b(r)?g(r):r;let n=e,o=D(n);for(;o&&r&&t!==n;){const e=Ae(o),t=o.getBoundingClientRect(),r=T(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=g(o),o=D(n)}}return ie({width:s,height:f,x:u,y:a})}function De(e,t){const n=A(e).scrollLeft;return t?t.left+n:Me(y(e)).left+n}function Ie(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:De(e,r)),y:r.top+t.scrollTop}}function Fe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=g(e),r=y(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=O();(!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=y(e),n=A(e),r=e.ownerDocument.body,o=_(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=_(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+De(e);const c=-n.scrollTop;return"rtl"===T(r).direction&&(l+=_(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(y(e));else if(b(t))r=function(e,t){const n=Me(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=x(e)?Ae(e):U(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=Ne(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ie(r)}function Be(e,t){const n=k(e);return!(n===t||!b(n)||P(n))&&("fixed"===T(n).position||Be(n,t))}function He(e,t,n){const r=x(t),o=y(t),i="fixed"===n,l=Me(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=U(0);if(r||!r&&!i)if(("body"!==h(t)||R(o))&&(c=A(t)),r){const e=Me(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=De(o));const a=!o||r||i?U(0):Ie(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 We(e){return"static"===T(e).position}function je(e,t){if(!x(e)||"fixed"===T(e).position)return null;if(t)return t(e);let n=e.offsetParent;return y(e)===n&&(n=n.ownerDocument.body),n}function Ve(e,t){const n=g(e);if(S(e))return n;if(!x(e)){let t=k(e);for(;t&&!P(t);){if(b(t)&&!We(t))return t;t=k(t)}return n}let r=je(e,t);for(;r&&C(r)&&We(r);)r=je(r,t);return r&&P(r)&&We(r)&&!L(r)?n:r||function(e){let t=k(e);for(;x(t)&&!P(t);){if(L(t))return t;if(S(t))return null;t=k(t)}return null}(e)||n}const _e={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=y(r),c=!!t&&S(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=U(1);const s=U(0),f=x(r);if((f||!f&&!i)&&(("body"!==h(r)||R(l))&&(u=A(r)),x(r))){const e=Me(r);a=Ae(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const d=!l||f||i?U(0):Ie(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+d.x,y:n.y*a.y-u.scrollTop*a.y+s.y+d.y}},getDocumentElement:y,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?S(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=M(e,[],!1).filter((e=>b(e)&&"body"!==h(e))),o=null;const i="fixed"===T(e).position;let l=i?k(e):e;for(;b(l)&&!P(l);){const t=T(l),n=L(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||R(l)&&!n&&Be(e,l))?r=r.filter((e=>e!==l)):o=t,l=k(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=Fe(t,n,o);return e.top=_(r.top,e.top),e.right=V(r.right,e.right),e.bottom=V(r.bottom,e.bottom),e.left=_(r.left,e.left),e}),Fe(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Ve,getElementRects:async function(e){const t=this.getOffsetParent||Ve,n=this.getDimensions,r=await n(e.floating);return{reference:He(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Pe(e);return{width:t,height:n}},getScale:Ae,isElement:b,isRTL:function(e){return"rtl"===T(e).direction}};function ze(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ke(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=Te(e),s=o||i?[...a?M(a):[],...M(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=y(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 a=e.getBoundingClientRect(),{left:s,top:f,width:d,height:p}=a;if(c||t(),!d||!p)return;const m={rootMargin:-K(f)+"px "+-K(o.clientWidth-(s+d))+"px "+-K(o.clientHeight-(f+p))+"px "+-K(s)+"px",threshold:_(0,V(1,u))||1};let v=!0;function h(t){const r=t[0].intersectionRatio;if(r!==u){if(!v)return l();r?l(!1,r):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}1!==r||ze(a,e.getBoundingClientRect())||l(),v=!1}try{r=new IntersectionObserver(h,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),i}(a,n):null;let d,p=-1,m=null;l&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=m)||e.observe(t)}))),n()})),a&&!u&&m.observe(a),m.observe(t));let v=u?Me(e):null;return u&&function t(){const r=Me(e);v&&!ze(v,r)&&n();v=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=m)||e.disconnect(),m=null,u&&cancelAnimationFrame(d)}}const Ue=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=Z(n),c=G(n),u="y"===ee(n),a=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=$(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}}}}},Xe=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}=$(e,t),a={x:n,y:r},s=await Se(t,u),f=ee(Z(o)),d=Q(f);let p=a[d],m=a[f];if(i){const e="y"===d?"bottom":"right";p=Y(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";m=Y(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}}}}}},qe=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}=$(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=Z(o),y=ee(c),w=Z(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(a.floating)),x=d||(w||!v?[re(c)]:function(e){const t=re(e);return[ne(e),t,ne(t)]}(c)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=G(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(Z(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ne)))),i}(c,v,m,b));const R=[c,...x],C=await Se(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=G(e),o=te(e),i=J(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=re(l)),[l,re(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=ee(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{}}}},Ye=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=$(e,t);switch(r){case"referenceHidden":{const e=Le(await Se(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Oe(e)}}}case"escaped":{const e=Le(await Se(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Oe(e)}}}default:return{}}}}},$e=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}=$(e,t)||{};if(null==a)return{};const f=oe(s),d={x:n,y:r},p=te(o),m=J(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=V(f[g],S),O=V(f[y],S),P=L,T=R-v[m]-O,A=R/2-v[m]/2+C,k=Y(P,A,T),N=!u.arrow&&null!=G(o)&&A!==k&&i.reference[m]/2-(A<P?L:O)-v[m]/2<0,M=N?A<P?A-P:A-T:0;return{[p]:d[p]+M,data:{[p]:k,centerOffset:A-k-M,...N&&{alignmentOffset:M}},reset:N}}}),Ze=(e,t,n)=>{const r=new Map,o={platform:_e,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,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}=Ce(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}=Ce(a,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Ge="undefined"!=typeof document?r:o;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 Je(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function et(e,t){const n=Je(e);return Math.round(t*n)/n}function tt(t){const n=e.useRef(t);return Ge((()=>{n.current=t})),n}const nt=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?$e({element:n.current,padding:r}).fn(t):{}:n?$e({element:n,padding:r}).fn(t):{};var o}}),rt=(e,t)=>({...Ue(e),options:[e,t]}),ot=(e,t)=>({...Xe(e),options:[e,t]}),it=(e,t)=>({...qe(e),options:[e,t]}),lt=(e,t)=>({...Ye(e),options:[e,t]}),ct={...e},ut=ct.useInsertionEffect||(e=>e());function at(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return ut((()=>{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 st="undefined"!=typeof document?r:o;let ft=!1,dt=0;const pt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dt++;const mt=ct.useId||function(){const[t,n]=e.useState((()=>ft?pt():void 0));return st((()=>{null==t&&n(pt())}),[]),e.useEffect((()=>{ft=!0}),[]),t};let vt;"production"!==process.env.NODE_ENV&&(vt=new Set);const ht=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:u=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:p,stroke:m,d:v,style:{transform:h,...g}={},...y}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=vt)&&e.has(o)||(null==(i=vt)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const w=mt(),[b,x]=e.useState(!1);if(st((()=>{if(!o)return;"rtl"===T(o).direction&&x(!0)}),[o]),!o)return null;const[E,R]=r.split("-"),C="top"===E||"bottom"===E;let S=p;(C&&null!=l&&l.x||!C&&null!=l&&l.y)&&(S=null);const L=2*d,O=L/2,P=c/2*(f/-8+1),A=u/2*f/4,k=!!v,N=S&&"end"===R?"bottom":"top";let M=S&&"end"===R?"right":"left";S&&b&&(M="end"===R?"left":"right");const D=null!=(null==i?void 0:i.x)?S||i.x:"",I=null!=(null==i?void 0:i.y)?S||i.y:"",F=v||"M0,0 H"+c+" L"+(c-P)+","+(u-A)+" Q"+c/2+","+u+" "+P+","+(u-A)+" Z",B={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[E];return a("svg",{...y,"aria-hidden":!0,ref:n,width:k?c:c+L,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[M]:D,[N]:I,[E]:C||k?"100%":"calc(100% - "+L/2+"px)",transform:[B,h].filter((e=>!!e)).join(" "),...g},children:[L>0&&s("path",{clipPath:"url(#"+w+")",fill:"none",stroke:m,strokeWidth:L+(v?0:1),d:F}),s("path",{stroke:L&&!v?y.fill:"none",d:F}),s("clipPath",{id:w,children:s("rect",{x:-O,y:O*(k?-1:1),width:c+L,height:c})})]})}));const gt=e.createContext(null),yt=e.createContext(null),wt=()=>{var t;return(null==(t=e.useContext(gt))?void 0:t.id)||null},bt=()=>e.useContext(yt);function xt(e){return"data-floating-ui-"+e}function Et(e){const t=i(e);return st((()=>{t.current=e})),t}const Rt=xt("safe-polygon");function Ct(e,t,n){return n&&!F(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function St(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const Lt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ot(e,t){const n=Re(e,Lt());"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}(B(e)));return n.slice(r+1)[0]}function Pt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!I(n,r)}function Tt(e){Re(e,Lt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function At(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const kt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Nt(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Mt=e.forwardRef((function(t,n){const[r,o]=e.useState();st((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Nt),()=>{document.removeEventListener("keydown",Nt)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[xt("focus-guard")]:"",style:kt};return s("span",{...t,...i})})),Dt=e.createContext(null),It=xt("portal");function Ft(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=mt(),i=Bt(),[l,c]=e.useState(null),u=e.useRef(null);return st((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),st((()=>{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(It,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),st((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!b(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(It,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[c,u]=e.useState(null),d=e.useRef(null),p=e.useRef(null),m=e.useRef(null),v=e.useRef(null),h=null==c?void 0:c.modal,g=null==c?void 0:c.open,y=!!c&&!c.modal&&c.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!h)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&Pt(e)){("focusin"===e.type?At:Tt)(l)}}}),[l,i,h]),e.useEffect((()=>{l&&(g||At(l))}),[g,l]),a(Dt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:d,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:v,portalNode:l,setFocusManagerState:u})),[i,l]),children:[y&&l&&s(Mt,{"data-type":"outside",ref:d,onFocus:e=>{if(Pt(e,l)){var t;null==(t=m.current)||t.focus()}else{const e=Ot(document.body,"prev")||(null==c?void 0:c.domReference);null==e||e.focus()}}}),y&&l&&s("span",{"aria-owns":l.id,style:kt}),l&&f.createPortal(n,l),y&&l&&s(Mt,{"data-type":"outside",ref:p,onFocus:e=>{if(Pt(e,l)){var t;null==(t=v.current)||t.focus()}else{const t=Ot(document.body,"next")||(null==c?void 0:c.domReference);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Bt=()=>e.useContext(Dt),Ht="data-floating-ui-focusable",Wt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},jt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Vt=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 _t(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=mt(),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!=wt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!b(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=vt)&&e.has(o)||(null==(i=vt)||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=at(((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 zt(t){void 0===t&&(t={});const{nodeId:n}=t,r=_t({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,c]=e.useState(null),[u,a]=e.useState(null),s=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=bt();st((()=>{s&&(d.current=s)}),[s]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:c}={},transform:u=!0,whileElementsMounted:a,open:s}=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=l||h,R=c||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),O=null!=a,P=tt(a),T=tt(i),A=tt(s),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};T.current&&(e.platform=T.current),Ze(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};N.current&&!Qe(L.current,t)&&(L.current=t,f.flushSync((()=>{p(t)})))}))}),[m,n,r,T,A]);Ge((()=>{!1===s&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[s]);const N=e.useRef(!1);Ge((()=>(N.current=!0,()=>{N.current=!1})),[]),Ge((()=>{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 M=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),D=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=et(D.floating,d.x),n=et(D.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...Je(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,D.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:M,elements:D,floatingStyles:I})),[d,k,M,D,I])}({...t,elements:{...i,...u&&{reference:u}}}),v=e.useCallback((e=>{const t=b(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),m.refs.setReference(t)}),[m.refs]),h=e.useCallback((e=>{(b(e)||null===e)&&(d.current=e,c(e)),(b(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!b(e))&&m.refs.setReference(e)}),[m.refs]),g=e.useMemo((()=>({...m.refs,setReference:h,setPositionReference:v,domReference:d})),[m.refs,h,v]),y=e.useMemo((()=>({...m.elements,domReference:s})),[m.elements,s]),w=e.useMemo((()=>({...m,...o,refs:g,elements:y,nodeId:n})),[m,g,y,n,o]);return st((()=>{o.dataRef.current.floatingContext=w;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=w)})),e.useMemo((()=>({...m,context:w,refs:g,elements:y})),[m,g,y,w])}const Kt="active",Ut="selected";function Xt(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[Kt]:t,[Ut]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Ht]:""},...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&&[Kt,Ut].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const qt=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Yt(n){var r=n.children,o=n.popperName,c=void 0===o?"":o,u=n.customRootClass,a=void 0===u?"":u,s=n.placement,f=void 0===s?"top":s,d=n.open,v=void 0!==d&&d;p(n,["children","popperName","customRootClass","placement","open"]);var h,g,y=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)}(a,c),w=i(null),E=l(v),R=E[0],C=E[1],S=zt({placement:f,whileElementsMounted:Ke,open:R,middleware:[(h={element:w,padding:4},{...nt(h),options:[h,g]}),rt(9),it({mainAxis:!0,fallbackStrategy:"initialPlacement"}),ot({crossAxis:!1}),lt({strategy:"referenceHidden"})],onOpenChange:C}),L=S.context,A=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=qt.get(c))?r:c,a=mt(),s=null!=wt(),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])}(L),N=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,h=bt(),g=at("function"==typeof a?a:()=>!1),y="function"==typeof a?g:a,w=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:C}=Vt(m),{escapeKey:S,outsidePress:L}=Vt(v),A=e.useRef(!1),N=at((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(A.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=h?St(h.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),D=at((e=>{var t;const n=()=>{var t;N(e),null==(t=W(e))||t.removeEventListener("keydown",n)};null==(t=W(e))||t.addEventListener("keydown",n)})),F=at((e=>{var t;const n=w.current;w.current=!1;const r=E.current;if(E.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof y&&!y(e))return;const c=W(e),u="["+xt("inert")+"]",a=B(i.floating).querySelectorAll(u);let f=b(c)?c:null;for(;f&&!P(f);){const e=k(f);if(P(e)||!b(e))break;f=e}if(a.length&&b(c)&&!c.matches("html,body")&&!I(c,i.floating)&&Array.from(a).every((e=>!I(f,e))))return;if(x(c)&&_){const t=P(c),n=T(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=h&&St(h.nodesRef.current,d).some((t=>{var n;return H(e,null==(n=t.context)?void 0:n.elements.floating)}));if(H(e,i.floating)||H(e,i.domReference)||p)return;const m=h?St(h.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),j=at((e=>{var t;const n=()=>{var t;F(e),null==(t=W(e))||t.removeEventListener(s,n)};null==(t=W(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=C;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),A.current=!0}function a(){e=window.setTimeout((()=>{A.current=!1}),O()?5:0)}const f=B(i.floating);u&&(f.addEventListener("keydown",S?D:N,S),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",a)),y&&f.addEventListener(s,L?j:F,L);let d=[];return p&&(b(i.domReference)&&(d=M(i.domReference)),b(i.floating)&&(d=d.concat(M(i.floating))),!b(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(M(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",S?D:N,S),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",a)),y&&f.removeEventListener(s,L?j:F,L),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,y,s,r,o,p,c,R,C,N,S,D,F,L,j]),e.useEffect((()=>{w.current=!1}),[y,s]);const V=e.useMemo((()=>({onKeyDown:N,...f&&{[Wt[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[N,o,f,d]),_=e.useMemo((()=>({onKeyDown:N,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[jt[s]]:()=>{w.current=!0}})),[N,s]);return e.useMemo((()=>c?{reference:V,floating:_}:{}),[c,V,_])}(L),D=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=bt(),v=wt(),h=Et(s),g=Et(a),y=Et(r),w=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(!h.current)return;if(!r)return;function e(e){P()&&o(!1,e,"hover")}const t=B(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,h,P]);const T=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Ct(g.current,"close",w.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[g,o]),A=at((()=>{L.current(),E.current=void 0})),k=at((()=>{if(S.current){const e=B(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Rt),S.current=!1}})),N=at((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&b(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&&!F(w.current)||d>0&&!Ct(g.current,"open"))return;const t=Ct(g.current,"open",w.current);t?x.current=window.setTimeout((()=>{y.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(N())return;L.current();const t=B(c.floating);if(clearTimeout(R.current),O.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),A(),N()||T(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==w.current||!I(c.floating,e.relatedTarget))&&T(e)}function l(e){N()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),A(),N()||T(e)}})(e))}}),[c,u,t,f,d,p,T,A,k,o,r,y,m,g,h,i,N]),st((()=>{var e;if(u&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&P()){S.current=!0;const e=c.floating;if(b(c.domReference)&&e){var t;const n=B(c.floating).body;n.setAttribute(Rt,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,v,c,m,h,P]),st((()=>{r||(w.current=void 0,O.current=!1,A(),k())}),[r,A,k]),e.useEffect((()=>()=>{A(),clearTimeout(x.current),clearTimeout(R.current),k()}),[u,c.domReference,A,k]);const M=e.useMemo((()=>{function e(e){w.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||y.current||o(!0,t,"hover")}f&&!F(w.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===w.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,y,d]),D=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){N()||T(e.nativeEvent,!1)}})),[T,N]);return e.useMemo((()=>u?{reference:M,floating:D}:{}),[u,M,D])}(L,{}),j=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=>Xt(e,t,"reference")),n),l=e.useCallback((e=>Xt(e,t,"floating")),r),c=e.useCallback((e=>Xt(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([D,A,N]);return t.createElement(m.Provider,{value:{floatingArrowRef:w,dismiss:N,hover:D,role:A,interactions:j,floating:S,isOpen:R,setIsOpen:C,rootClass:y}},r)}function $t(){var e=c(m);if(null==e)throw new Error("Popper connot be used outside of popper context provider");return e}function Zt(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Zt(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Gt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Zt(e))&&(r&&(r+=" "),r+=t);return r}var Qt=["div","span","button","input"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,c=p(n,["asChild","children"]);return i&&t.isValidElement(l)?t.cloneElement(l,d(d({},c),{ref:r})):t.createElement(e,d(d({},c),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{});function Jt(e){var n=e.showArrow,r=void 0===n||n,o=e.className,i=void 0===o?"":o,l=e.children,c=$t(),a=c.isOpen,s=c.rootClass,f=c.floatingArrowRef,p=c.floating,m=c.interactions.getFloatingProps,v=p.refs.setFloating,h=p.floatingStyles,g=p.context;return a?t.createElement(Ft,{root:document.body},t.createElement(Qt.div,d({asChild:u(l),className:Gt("".concat(s,"-floating-element"),i),ref:v,style:h},m()),r&&t.createElement(ht,{className:Gt("rad-ui-arrow ".concat(s,"-arrow")),ref:f,context:g}),l)):null}function en(e){var n=e.children,r=e.className,o=void 0===r?"":r;p(e,["children","className"]);var i=$t(),l=i.rootClass,c=i.floating,a=i.interactions,s=c.refs.setReference,f=a.getReferenceProps;return t.createElement(Qt.span,d({asChild:u(n),className:Gt("rad-ui-popper","".concat(l,"-reference-element"),o),ref:s},f()),n)}var tn=function(e){var n=e.popperName,r=void 0===n?"":n,o=e.customRootClass,i=void 0===o?"":o,l=e.className,c=void 0===l?"":l,u=e.placement,a=void 0===u?"top":u,s=e.children,f=e.open,d=void 0!==f&&f,m=e.showArrow,v=void 0===m||m,h=e.pop,g=void 0===h?t.createElement(t.Fragment,null):h;return p(e,["popperName","customRootClass","className","placement","children","open","showArrow","pop"]),t.createElement(Yt,{customRootClass:i,popperName:r,placement:a,open:d},t.createElement(en,{className:c},s),t.createElement(Jt,{showArrow:v},g))};tn.displayName="Popper",tn.Root=Yt,tn.Trigger=en,tn.Content=Jt;var nn=function(e){var n=e.children,r=e.label,o=void 0===r?"":r,i=e.placement,l=void 0===i?"top":i,c=p(e,["children","label","placement"]);return t.createElement(tn,d({popperName:"Tooltip",pop:o,placement:l},c),n)};export{nn as default};
|
package/dist/components/Tree.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import e,{createContext as n,useRef as r,useId as t,useState as l,useContext as o}from"react";var a=function(){return a=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var l in n=arguments[r])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},a.apply(this,arguments)};function i(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(r[t[l]]=e[t[l]])}return r}"function"==typeof SuppressedError&&SuppressedError;var c=n({}),u=function(e){return e.querySelectorAll("[data-rad-ui-batch-element]")},d=function(e){var n=null;return e.forEach((function(e){e.hasAttribute("data-rad-ui-focus-element")&&(n=e)})),n},f=function(n){var t=n.children,l=i(n,["children"]),o=r(null);return e.createElement(c.Provider,{value:{treeRef:o,moveUp:function(){var e=u(null==o?void 0:o.current);console.log(e);var n=function(e,n){void 0===n&&(n=!1);var r=d(e),t=null==r?void 0:r.previousElementSibling;return t||(n?e[e.length-1]:e[0])}(e);return n},moveDown:function(){var e=u(null==o?void 0:o.current);console.log(e);var n=function(e,n){void 0===n&&(n=!1);var r=d(e),t=null==r?void 0:r.nextElementSibling;return t||(n?e[0]:e[e.length-1])}(e);return n}}},e.createElement("div",a({},l,{ref:o}),t))},s=["div","span","button"].reduce((function(n,r){return n[r]=function(n){var r=e.forwardRef((function(r,t){var l=r.asChild,o=void 0!==l&&l,c=r.children,u=i(r,["asChild","children"]);return o&&e.isValidElement(c)?e.cloneElement(c,a(a({},u),{ref:t})):e.createElement(n,a(a({},u),{ref:t}),c)}));return r.displayName="Primitive.".concat(n),r}(r),n}),{}),v=function(n){var r=n.role,t=void 0===r?"button":r,l=n.label,o=void 0===l?"":l,c=n.description,u=void 0===c?"":c,d=n.disabled,f=void 0!==d&&d,v=n.children,m=i(n,["role","label","description","disabled","children"]);return o&&(m["aria-label"]=o),u&&(m["aria-description"]=u),f&&(m["aria-disabled"]="true",u||(m["aria-description"]="Disabled Button")),e.createElement(s.button,a({role:t,disabled:f},m),v)};function m(e){var n,r,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(r=m(e[n]))&&(t&&(t+=" "),t+=r)}else for(r in e)e[r]&&(t&&(t+=" "),t+=r);return t}function p(){for(var e,n,r=0,t="",l=arguments.length;r<l;r++)(e=arguments[r])&&(n=m(e))&&(t&&(t+=" "),t+=n);return t}var b=function(n){var u=n.children,d=n.item,f=n.level,s=void 0===f?0:f,m=n.className,y=void 0===m?"":m,g=i(n,["children","item","level","className"]),h=t(),E=r(null),w=l(!1),O=w[0],k=w[1],D=l(!1),j=D[0],x=D[1],S=o(c),A=S.moveUp,P=S.moveDown,N=function(e){if("down"===e){var n=P();console.log(n),n&&n.focus()}else if("up"===e){var r=A();console.log(r),r&&r.focus()}};return e.createElement(e.Fragment,null,e.createElement(v,a({className:p(y),ref:E,onClick:function(){console.log("clicked",h),k(!O)},"data-rad-ui-batch-element":!0,id:"tree-data-item-".concat(h),onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),console.log("trapped")),"ArrowDown"===e.key&&(e.preventDefault(),N("down")),"ArrowUp"===e.key&&(e.preventDefault(),N("up"))},onFocus:function(){x(!0)},onBlur:function(){x(!1)},style:{display:"block",alignItems:"center",gap:"0.5rem"}},j&&{"data-rad-ui-focus-element":!0},g),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"}},e.createElement("div",null,O?"v":">"),e.createElement("div",null,u))),O&&d.items&&e.createElement(e.Fragment,null,d.items.map((function(n){var r=s+1;return e.createElement(b,{level:r,key:n.label,item:n},n.label)}))))},y=function(n){n.children;var r=n.items,t=void 0===r?[]:r,l=i(n,["children","items"]);return e.createElement(f,a({},l),t.map((function(n){return e.createElement(e.Fragment,null,e.createElement(b,{key:n.label,expanded:n.expanded,item:n,level:0},n.label))})))};y.displayName="Tree";export{y as default};
|
|
1
|
+
'use client';import e,{createContext as n,useRef as r,useId as t,useState as l,useContext as o}from"react";var a=function(){return a=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var l in n=arguments[r])Object.prototype.hasOwnProperty.call(n,l)&&(e[l]=n[l]);return e},a.apply(this,arguments)};function i(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var l=0;for(t=Object.getOwnPropertySymbols(e);l<t.length;l++)n.indexOf(t[l])<0&&Object.prototype.propertyIsEnumerable.call(e,t[l])&&(r[t[l]]=e[t[l]])}return r}"function"==typeof SuppressedError&&SuppressedError;var c=n({}),u=function(e){return e.querySelectorAll("[data-rad-ui-batch-element]")},d=function(e){var n=null;return e.forEach((function(e){e.hasAttribute("data-rad-ui-focus-element")&&(n=e)})),n},f=function(n){var t=n.children,l=i(n,["children"]),o=r(null);return e.createElement(c.Provider,{value:{treeRef:o,moveUp:function(){var e=u(null==o?void 0:o.current);console.log(e);var n=function(e,n){void 0===n&&(n=!1);var r=d(e),t=null==r?void 0:r.previousElementSibling;return t||(n?e[e.length-1]:e[0])}(e);return n},moveDown:function(){var e=u(null==o?void 0:o.current);console.log(e);var n=function(e,n){void 0===n&&(n=!1);var r=d(e),t=null==r?void 0:r.nextElementSibling;return t||(n?e[0]:e[e.length-1])}(e);return n}}},e.createElement("div",a({},l,{ref:o}),t))},s=["div","span","button","input"].reduce((function(n,r){return n[r]=function(n){var r=e.forwardRef((function(r,t){var l=r.asChild,o=void 0!==l&&l,c=r.children,u=i(r,["asChild","children"]);return o&&e.isValidElement(c)?e.cloneElement(c,a(a({},u),{ref:t})):e.createElement(n,a(a({},u),{ref:t}),c)}));return r.displayName="Primitive.".concat(n),r}(r),n}),{}),v=function(n){var r=n.role,t=void 0===r?"button":r,l=n.label,o=void 0===l?"":l,c=n.description,u=void 0===c?"":c,d=n.disabled,f=void 0!==d&&d,v=n.children,m=i(n,["role","label","description","disabled","children"]);return o&&(m["aria-label"]=o),u&&(m["aria-description"]=u),f&&(m["aria-disabled"]="true",u||(m["aria-description"]="Disabled Button")),e.createElement(s.button,a({role:t,disabled:f},m),v)};function m(e){var n,r,t="";if("string"==typeof e||"number"==typeof e)t+=e;else if("object"==typeof e)if(Array.isArray(e)){var l=e.length;for(n=0;n<l;n++)e[n]&&(r=m(e[n]))&&(t&&(t+=" "),t+=r)}else for(r in e)e[r]&&(t&&(t+=" "),t+=r);return t}function p(){for(var e,n,r=0,t="",l=arguments.length;r<l;r++)(e=arguments[r])&&(n=m(e))&&(t&&(t+=" "),t+=n);return t}var b=function(n){var u=n.children,d=n.item,f=n.level,s=void 0===f?0:f,m=n.className,y=void 0===m?"":m,g=i(n,["children","item","level","className"]),h=t(),E=r(null),w=l(!1),O=w[0],k=w[1],D=l(!1),j=D[0],x=D[1],S=o(c),A=S.moveUp,P=S.moveDown,N=function(e){if("down"===e){var n=P();console.log(n),n&&n.focus()}else if("up"===e){var r=A();console.log(r),r&&r.focus()}};return e.createElement(e.Fragment,null,e.createElement(v,a({className:p(y),ref:E,onClick:function(){console.log("clicked",h),k(!O)},"data-rad-ui-batch-element":!0,id:"tree-data-item-".concat(h),onKeyDown:function(e){"Tab"===e.key&&(e.preventDefault(),console.log("trapped")),"ArrowDown"===e.key&&(e.preventDefault(),N("down")),"ArrowUp"===e.key&&(e.preventDefault(),N("up"))},onFocus:function(){x(!0)},onBlur:function(){x(!1)},style:{display:"block",alignItems:"center",gap:"0.5rem"}},j&&{"data-rad-ui-focus-element":!0},g),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem"}},e.createElement("div",null,O?"v":">"),e.createElement("div",null,u))),O&&d.items&&e.createElement(e.Fragment,null,d.items.map((function(n){var r=s+1;return e.createElement(b,{level:r,key:n.label,item:n},n.label)}))))},y=function(n){n.children;var r=n.items,t=void 0===r?[]:r,l=i(n,["children","items"]);return e.createElement(f,a({},l),t.map((function(n){return e.createElement(e.Fragment,null,e.createElement(b,{key:n.label,expanded:n.expanded,item:n,level:0},n.label))})))};y.displayName="Tree";export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},e.apply(this,arguments)};function t(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var n=["div","span","button"].reduce((function(n,o){return n[o]=function(n){var o=r.forwardRef((function(o,a){var i=o.asChild,c=void 0!==i&&i,l=o.children,f=t(o,["asChild","children"]);return c&&r.isValidElement(l)?r.cloneElement(l,e(e({},f),{ref:a})):r.createElement(n,e(e({},f),{ref:a}),l)}));return o.displayName="Primitive.".concat(n),o}(o),n}),{});function o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=o(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function a(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}var i="VisuallyHidden",c=function(o){var c=o.children,l=o.customRootClass,f=o.className,s=t(o,["children","customRootClass","className"]),u=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(l,i);return r.createElement(n.div,e({className:a(u,f)},s),c)};c.displayName=i;export{c as default};
|
|
1
|
+
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o]);return r},e.apply(this,arguments)};function t(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(r);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(r,n[o])&&(t[n[o]]=r[n[o]])}return t}"function"==typeof SuppressedError&&SuppressedError;var n=["div","span","button","input"].reduce((function(n,o){return n[o]=function(n){var o=r.forwardRef((function(o,a){var i=o.asChild,c=void 0!==i&&i,l=o.children,f=t(o,["asChild","children"]);return c&&r.isValidElement(l)?r.cloneElement(l,e(e({},f),{ref:a})):r.createElement(n,e(e({},f),{ref:a}),l)}));return o.displayName="Primitive.".concat(n),o}(o),n}),{});function o(r){var e,t,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(t=o(r[e]))&&(n&&(n+=" "),n+=t)}else for(t in r)r[t]&&(n&&(n+=" "),n+=t);return n}function a(){for(var r,e,t=0,n="",a=arguments.length;t<a;t++)(r=arguments[t])&&(e=o(r))&&(n&&(n+=" "),n+=e);return n}var i="VisuallyHidden",c=function(o){var c=o.children,l=o.customRootClass,f=o.className,s=t(o,["children","customRootClass","className"]),u=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(l,i);return r.createElement(n.div,e({className:a(u,f)},s),c)};c.displayName=i;export{c as default};
|