@radui/ui 0.0.25 → 0.0.27
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/README.md +1 -1
- package/dist/components/Accordion.js +1 -1
- package/dist/components/AlertDialog.js +2 -2
- package/dist/components/AspectRatio.js +1 -0
- 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/Callout.js +1 -1
- package/dist/components/Card.js +1 -1
- package/dist/components/Code.js +1 -1
- package/dist/components/Collapsible.js +1 -1
- package/dist/components/Dropdown.js +5 -1
- package/dist/components/Em.js +1 -1
- package/dist/components/Heading.js +1 -1
- package/dist/components/HoverCard.js +5 -0
- package/dist/components/Kbd.js +1 -1
- package/dist/components/Link.js +1 -1
- package/dist/components/Modal.js +2 -2
- package/dist/components/Progress.js +1 -1
- package/dist/components/Quote.js +1 -1
- package/dist/components/RadioGroup.js +1 -1
- package/dist/components/Separator.js +1 -1
- package/dist/components/Skeleton.js +1 -1
- package/dist/components/Strong.js +1 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/Table.js +1 -1
- package/dist/components/Tabs.js +1 -1
- package/dist/components/Text.js +1 -1
- package/dist/components/TextArea.js +1 -1
- package/dist/components/Toggle.js +1 -1
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/Tooltip.js +5 -1
- package/dist/components/Tree.js +1 -1
- package/dist/components/VisuallyHidden.js +1 -0
- package/dist/themes/default.css +1 -1
- package/package.json +24 -11
|
@@ -1 +1,5 @@
|
|
|
1
|
-
'use client';import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o,useState as i}from"react";import*as l from"react-dom";var c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function s(){return"undefined"!=typeof window}function u(e){return d(e)?(e.nodeName||"").toLowerCase():"#document"}function a(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function f(e){var t;return null==(t=(d(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function d(e){return!!s()&&(e instanceof Node||e instanceof a(e).Node)}function m(e){return!!s()&&(e instanceof Element||e instanceof a(e).Element)}function p(e){return!!s()&&(e instanceof HTMLElement||e instanceof a(e).HTMLElement)}function g(e){return!(!s()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof a(e).ShadowRoot)}function v(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=E(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function h(e){return["table","td","th"].includes(u(e))}function y(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function w(e){const t=x(),n=m(e)?E(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function b(e){return["html","body","#document"].includes(u(e))}function E(e){return a(e).getComputedStyle(e)}function R(e){return m(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function C(e){if("html"===u(e))return e;const t=e.assignedSlot||e.parentNode||g(e)&&e.host||f(e);return g(t)?t.host:t}function L(e){const t=C(e);return b(t)?e.ownerDocument?e.ownerDocument.body:e.body:p(t)&&v(t)?t:L(t)}function P(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=L(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=a(o);if(i){const e=O(l);return t.concat(l,l.visualViewport||[],v(o)?o:[],e&&n?P(e):[])}return t.concat(o,P(o,[],n))}function O(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function T(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function k(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function M(e){return(null==e?void 0:e.ownerDocument)||document}function S(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 A(e){return"composedPath"in e?e.composedPath()[0]:e.target}const D=["top","right","bottom","left"],N=Math.min,F=Math.max,H=Math.round,W=Math.floor,j=e=>({x:e,y:e}),B={left:"right",right:"left",bottom:"top",top:"bottom"},I={start:"end",end:"start"};function _(e,t,n){return F(e,N(t,n))}function V(e,t){return"function"==typeof e?e(t):e}function K(e){return e.split("-")[0]}function z(e){return e.split("-")[1]}function X(e){return"x"===e?"y":"x"}function Y(e){return"y"===e?"height":"width"}function $(e){return["top","bottom"].includes(K(e))?"y":"x"}function q(e){return X($(e))}function U(e){return e.replace(/start|end/g,(e=>I[e]))}function Z(e){return e.replace(/left|right|bottom|top/g,(e=>B[e]))}function Q(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 G(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function J(e,t,n){let{reference:r,floating:o}=e;const i=$(t),l=q(t),c=Y(l),s=K(t),u="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let m;switch(s){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(z(t)){case"start":m[l]-=d*(n&&u?-1:1);break;case"end":m[l]+=d*(n&&u?-1:1)}return m}async function ee(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:s}=e,{boundary:u="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=V(t,e),p=Q(m),g=c[d?"floating"===f?"reference":"floating":f],v=G(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(g)))||n?g:g.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:u,rootBoundary:a,strategy:s})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=G(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:h,offsetParent:y,strategy:s}):h);return{top:(v.top-x.top+p.top)/w.y,bottom:(x.bottom-v.bottom+p.bottom)/w.y,left:(v.left-x.left+p.left)/w.x,right:(x.right-v.right+p.right)/w.x}}function te(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ne(e){return D.some((t=>e[t]>=0))}function re(e){const t=E(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=p(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=H(n)!==i||H(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function oe(e){return m(e)?e:e.contextElement}function ie(e){const t=oe(e);if(!p(t))return j(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=re(t);let l=(i?H(n.width):n.width)/r,c=(i?H(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const le=j(0);function ce(e){const t=a(e);return x()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:le}function se(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=oe(e);let l=j(1);t&&(r?m(r)&&(l=ie(r)):l=ie(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==a(e))&&t}(i,n,r)?ce(i):j(0);let s=(o.left+c.x)/l.x,u=(o.top+c.y)/l.y,f=o.width/l.x,d=o.height/l.y;if(i){const e=a(i),t=r&&m(r)?a(r):r;let n=e,o=O(n);for(;o&&r&&t!==n;){const e=ie(o),t=o.getBoundingClientRect(),r=E(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,u*=e.y,f*=e.x,d*=e.y,s+=i,u+=l,n=a(o),o=O(n)}}return G({width:f,height:d,x:s,y:u})}function ue(e,t){const n=R(e).scrollLeft;return t?t.left+n:se(f(e)).left+n}function ae(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:ue(e,r)),y:r.top+t.scrollTop}}function fe(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=a(e),r=f(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,s=0;if(o){i=o.width,l=o.height;const e=x();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=f(e),n=R(e),r=e.ownerDocument.body,o=F(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=F(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+ue(e);const c=-n.scrollTop;return"rtl"===E(r).direction&&(l+=F(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(f(e));else if(m(t))r=function(e,t){const n=se(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=p(e)?ie(e):j(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=ce(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return G(r)}function de(e,t){const n=C(e);return!(n===t||!m(n)||b(n))&&("fixed"===E(n).position||de(n,t))}function me(e,t,n){const r=p(t),o=f(t),i="fixed"===n,l=se(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=j(0);if(r||!r&&!i)if(("body"!==u(t)||v(o))&&(c=R(t)),r){const e=se(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=ue(o));const a=!o||r||i?j(0):ae(o,c);return{x:l.left+c.scrollLeft-s.x-a.x,y:l.top+c.scrollTop-s.y-a.y,width:l.width,height:l.height}}function pe(e){return"static"===E(e).position}function ge(e,t){if(!p(e)||"fixed"===E(e).position)return null;if(t)return t(e);let n=e.offsetParent;return f(e)===n&&(n=n.ownerDocument.body),n}function ve(e,t){const n=a(e);if(y(e))return n;if(!p(e)){let t=C(e);for(;t&&!b(t);){if(m(t)&&!pe(t))return t;t=C(t)}return n}let r=ge(e,t);for(;r&&h(r)&&pe(r);)r=ge(r,t);return r&&b(r)&&pe(r)&&!w(r)?n:r||function(e){let t=C(e);for(;p(t)&&!b(t);){if(w(t))return t;if(y(t))return null;t=C(t)}return null}(e)||n}const he={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=f(r),c=!!t&&y(t.floating);if(r===l||c&&i)return n;let s={scrollLeft:0,scrollTop:0},a=j(1);const d=j(0),m=p(r);if((m||!m&&!i)&&(("body"!==u(r)||v(l))&&(s=R(r)),p(r))){const e=se(r);a=ie(r),d.x=e.x+r.clientLeft,d.y=e.y+r.clientTop}const g=!l||m||i?j(0):ae(l,s,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+d.x+g.x,y:n.y*a.y-s.scrollTop*a.y+d.y+g.y}},getDocumentElement:f,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?y(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>m(e)&&"body"!==u(e))),o=null;const i="fixed"===E(e).position;let l=i?C(e):e;for(;m(l)&&!b(l);){const t=E(l),n=w(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||v(l)&&!n&&de(e,l))?r=r.filter((e=>e!==l)):o=t,l=C(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=fe(t,n,o);return e.top=F(r.top,e.top),e.right=N(r.right,e.right),e.bottom=N(r.bottom,e.bottom),e.left=F(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:me(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=re(e);return{width:t,height:n}},getScale:ie,isElement:m,isRTL:function(e){return"rtl"===E(e).direction}};function ye(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,u=oe(e),a=o||i?[...u?P(u):[],...P(t)]:[];a.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=u&&c?function(e,t){let n,r=null;const o=f(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const{left:u,top:a,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const m={rootMargin:-W(a)+"px "+-W(o.clientWidth-(u+f))+"px "+-W(o.clientHeight-(a+d))+"px "+-W(u)+"px",threshold:F(0,N(1,s))||1};let p=!0;function g(e){const t=e[0].intersectionRatio;if(t!==s){if(!p)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}p=!1}try{r=new IntersectionObserver(g,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,m)}r.observe(e)}(!0),i}(u,n):null;let m,p=-1,g=null;l&&(g=new ResizeObserver((e=>{let[r]=e;r&&r.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=g)||e.observe(t)}))),n()})),u&&!s&&g.observe(u),g.observe(t));let v=s?se(e):null;return s&&function t(){const r=se(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;a.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=g)||e.disconnect(),g=null,s&&cancelAnimationFrame(m)}}const 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,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=K(n),c=z(n),s="y"===$(n),u=["left","top"].includes(l)?-1:1,a=i&&s?-1:1,f=V(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof p&&(m="end"===c?-1*p:p),s?{x:m*a,y:d*u}:{x:d*u,y:m*a}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},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}}},...s}=V(e,t),u={x:n,y:r},a=await ee(t,s),f=$(K(o)),d=X(f);let m=u[d],p=u[f];if(i){const e="y"===d?"bottom":"right";m=_(m+a["y"===d?"top":"left"],m,m-a[e])}if(l){const e="y"===f?"bottom":"right";p=_(p+a["y"===f?"top":"left"],p,p-a[e])}const g=c.fn({...t,[d]:m,[f]:p});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[d]:i,[f]:l}}}}}},be=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:s,elements:u}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...v}=V(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=K(o),y=$(c),w=K(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(u.floating)),b=d||(w||!g?[Z(c)]:function(e){const t=Z(e);return[U(e),t,U(t)]}(c)),E="none"!==p;!d&&E&&b.push(...function(e,t,n,r){const o=z(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[]}}(K(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(U)))),i}(c,g,p,x));const R=[c,...b],C=await ee(t,v),L=[];let P=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&L.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=z(e),o=q(e),i=Y(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Z(l)),[l,Z(l)]}(o,l,x);L.push(C[e[0]],C[e[1]])}if(P=[...P,{placement:o,overflows:L}],!L.every((e=>e<=0))){var O,T;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(T=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(m){case"bestFit":{var k;const e=null==(k=P.filter((e=>{if(E){const t=$(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:k[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},Ee=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=V(e,t);switch(r){case"referenceHidden":{const e=te(await ee(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ne(e)}}}case"escaped":{const e=te(await ee(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ne(e)}}}default:return{}}}}},Re=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:s}=t,{element:u,padding:a=0}=V(e,t)||{};if(null==u)return{};const f=Q(a),d={x:n,y:r},m=q(o),p=Y(m),g=await l.getDimensions(u),v="y"===m,h=v?"top":"left",y=v?"bottom":"right",w=v?"clientHeight":"clientWidth",x=i.reference[p]+i.reference[m]-d[m]-i.floating[p],b=d[m]-i.reference[m],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[p]);const C=x/2-b/2,L=R/2-g[p]/2-1,P=N(f[h],L),O=N(f[y],L),T=P,k=R-g[p]-O,M=R/2-g[p]/2+C,S=_(T,M,k),A=!s.arrow&&null!=z(o)&&M!==S&&i.reference[p]/2-(M<T?P:O)-g[p]/2<0,D=A?M<T?M-T:M-k:0;return{[m]:d[m]+D,data:{[m]:S,centerOffset:M-S-D,...A&&{alignmentOffset:D}},reset:A}}}),Ce=(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),s=await(null==l.isRTL?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=J(u,r,s),d=r,m={},p=0;for(let n=0;n<c.length;n++){const{name:i,fn:g}=c[n],{x:v,y:h,data:y,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:u,platform:l,elements:{reference:e,floating:t}});a=null!=v?v:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(u=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=J(u,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var Le="undefined"!=typeof document?n:r;function Pe(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(!Pe(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)&&!Pe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Oe(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Te(e,t){const n=Oe(e);return Math.round(t*n)/n}function ke(t){const n=e.useRef(t);return Le((()=>{n.current=t})),n}const Me=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?Re({element:n.current,padding:r}).fn(t):{}:n?Re({element:n,padding:r}).fn(t):{};var o}}),Se=(e,t)=>({...we(e),options:[e,t]}),Ae=(e,t)=>({...xe(e),options:[e,t]}),De=(e,t)=>({...be(e),options:[e,t]}),Ne=(e,t)=>({...Ee(e),options:[e,t]}),Fe={...e},He=Fe.useInsertionEffect||(e=>e());function We(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return He((()=>{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 je="undefined"!=typeof document?n:r;function Be(){return Be=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},Be.apply(this,arguments)}let Ie=!1,_e=0;const Ve=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_e++;const Ke=Fe.useId||function(){const[t,n]=e.useState((()=>Ie?Ve():void 0));return je((()=>{null==t&&n(Ve())}),[]),e.useEffect((()=>{Ie=!0}),[]),t};let ze;"production"!==process.env.NODE_ENV&&(ze=new Set);const Xe=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:s=7,tipRadius:u=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:m,style:{transform:p,...g}={},...v}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ze)&&e.has(o)||(null==(i=ze)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const h=Ke(),[y,w]=e.useState(!1);if(je((()=>{if(!o)return;"rtl"===E(o).direction&&w(!0)}),[o]),!o)return null;const[x,b]=r.split("-"),R="top"===x||"bottom"===x;let C=f;(R&&null!=l&&l.x||!R&&null!=l&&l.y)&&(C=null);const L=2*a,P=L/2,O=c/2*(u/-8+1),T=s/2*u/4,k=!!m,M=C&&"end"===b?"bottom":"top";let S=C&&"end"===b?"right":"left";C&&y&&(S="end"===b?"left":"right");const A=null!=(null==i?void 0:i.x)?C||i.x:"",D=null!=(null==i?void 0:i.y)?C||i.y:"",N=m||"M0,0 H"+c+" L"+(c-O)+","+(s-T)+" Q"+c/2+","+s+" "+O+","+(s-T)+" Z",F={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[x];return e.createElement("svg",Be({},v,{"aria-hidden":!0,ref:n,width:k?c:c+L,height:c,viewBox:"0 0 "+c+" "+(s>c?s:c),style:{position:"absolute",pointerEvents:"none",[S]:A,[M]:D,[x]:R||k?"100%":"calc(100% - "+L/2+"px)",transform:[F,p].filter((e=>!!e)).join(" "),...g}}),L>0&&e.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:L+(m?0:1),d:N}),e.createElement("path",{stroke:L&&!m?v.fill:"none",d:N}),e.createElement("clipPath",{id:h},e.createElement("rect",{x:-P,y:P*(k?-1:1),width:c+L,height:c})))}));const Ye=e.createContext(null),$e=e.createContext(null),qe=()=>{var t;return(null==(t=e.useContext(Ye))?void 0:t.id)||null},Ue=()=>e.useContext($e);function Ze(e){return"data-floating-ui-"+e}function Qe(e){const t=o(e);return je((()=>{t.current=e})),t}const Ge=Ze("safe-polygon");function Je(e,t,n){return n&&!k(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function et(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 tt="data-floating-ui-focusable",nt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rt={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ot=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 it(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=Ke(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),s=null!=qe();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!m(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=ze)&&e.has(o)||(null==(i=ze)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[u,a]=e.useState(o.reference),f=We(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:s}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:u||o.reference||null,floating:o.floating||null,domReference:o.reference})),[u,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}function lt(t){void 0===t&&(t={});const{nodeId:n}=t,r=it({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,s]=e.useState(null),[u,a]=e.useState(null),f=(null==i?void 0:i.domReference)||c,d=e.useRef(null),p=Ue();je((()=>{f&&(d.current=f)}),[f]);const g=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:s}={},transform:u=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,g]=e.useState(o);Pe(p,o)||g(o);const[v,h]=e.useState(null),[y,w]=e.useState(null),x=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),b=e.useCallback((e=>{e!==L.current&&(L.current=e,w(e))}),[]),E=c||v,R=s||y,C=e.useRef(null),L=e.useRef(null),P=e.useRef(d),O=null!=a,T=ke(a),k=ke(i),M=ke(f),S=e.useCallback((()=>{if(!C.current||!L.current)return;const e={placement:n,strategy:r,middleware:p};k.current&&(e.platform=k.current),Ce(C.current,L.current,e).then((e=>{const t={...e,isPositioned:!1!==M.current};A.current&&!Pe(P.current,t)&&(P.current=t,l.flushSync((()=>{m(t)})))}))}),[p,n,r,k,M]);Le((()=>{!1===f&&P.current.isPositioned&&(P.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const A=e.useRef(!1);Le((()=>(A.current=!0,()=>{A.current=!1})),[]),Le((()=>{if(E&&(C.current=E),R&&(L.current=R),E&&R){if(T.current)return T.current(E,R,S);S()}}),[E,R,S,T,O]);const D=e.useMemo((()=>({reference:C,floating:L,setReference:x,setFloating:b})),[x,b]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=Te(N.floating,d.x),n=Te(N.floating,d.y);return u?{...e,transform:"translate("+t+"px, "+n+"px)",...Oe(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,u,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:S,refs:D,elements:N,floatingStyles:F})),[d,S,D,N,F])}({...t,elements:{...i,...u&&{reference:u}}}),v=e.useCallback((e=>{const t=m(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),g.refs.setReference(t)}),[g.refs]),h=e.useCallback((e=>{(m(e)||null===e)&&(d.current=e,s(e)),(m(g.refs.reference.current)||null===g.refs.reference.current||null!==e&&!m(e))&&g.refs.setReference(e)}),[g.refs]),y=e.useMemo((()=>({...g.refs,setReference:h,setPositionReference:v,domReference:d})),[g.refs,h,v]),w=e.useMemo((()=>({...g.elements,domReference:f})),[g.elements,f]),x=e.useMemo((()=>({...g,...o,refs:y,elements:w,nodeId:n})),[g,y,w,n,o]);return je((()=>{o.dataRef.current.floatingContext=x;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=x)})),e.useMemo((()=>({...g,context:x,refs:y,elements:w})),[g,y,w,x])}const ct="active",st="selected";function ut(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[ct]:t,[st]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[tt]:""},...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&&[ct,st].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 at=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var ft=function(n){var r=n.popperName,l=void 0===r?"":r,s=n.customRootClass,u=void 0===s?"":s;n.activationStrategy;var a=n.className,f=void 0===a?"":a,d=n.placement,g=void 0===d?"top":d,v=n.children,h=n.open,y=void 0!==h&&h;n.hoverDelay;var w=n.showArrow,R=void 0===w||w,L=n.pop,O=void 0===L?t.createElement(t.Fragment,null):L;!function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}}(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var D,N,F=function(e,t){void 0===e&&(e=""),void 0===t&&(t="");var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return e||(t?"".concat("rad-ui","-").concat(n):"")}(u,l),H=o(null),W=i(y),j=W[0],B=W[1],I=lt({placement:g,whileElementsMounted:ye,open:j,middleware:[(D={element:H},{...Me(D),options:[D,N]}),Se(9),De({mainAxis:!0,fallbackStrategy:"initialPlacement"}),Ae({crossAxis:!1}),Ne({strategy:"referenceHidden"})],onOpenChange:B}),_=I.refs,V=I.floatingStyles,K=I.context,z=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,s=null!=(r=at.get(c))?r:c,u=Ke(),a=null!=qe(),f=e.useMemo((()=>"tooltip"===s||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===s?"dialog":s,"aria-controls":o?i:void 0,..."listbox"===s&&{role:"combobox"},..."menu"===s&&{id:u},..."menu"===s&&a&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[s,i,a,o,u,c]),d=e.useMemo((()=>{const e={id:i,...s&&{role:s}};return"tooltip"===s||"label"===c?e:{...e,..."menu"===s&&{"aria-labelledby":u}}}),[s,i,u,c]),m=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:m}:{}),[l,f,d,m])}(K),X=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:s=!0,outsidePress:u=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:g=!1,bubbles:v,capture:h}=n,y=Ue(),w=We("function"==typeof u?u:()=>!1),R="function"==typeof u?w:u,L=e.useRef(!1),O=e.useRef(!1),{escapeKey:k,outsidePress:D}=ot(v),{escapeKey:N,outsidePress:F}=ot(h),H=e.useRef(!1),W=We((e=>{var t;if(!r||!c||!s||"Escape"!==e.key)return;if(H.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?et(y.nodesRef.current,n):[];if(!k&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),j=We((e=>{var t;const n=()=>{var t;W(e),null==(t=A(e))||t.removeEventListener("keydown",n)};null==(t=A(e))||t.addEventListener("keydown",n)})),B=We((e=>{var t;const n=L.current;L.current=!1;const r=O.current;if(O.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof R&&!R(e))return;const c=A(e),s="["+Ze("inert")+"]",u=M(i.floating).querySelectorAll(s);let f=m(c)?c:null;for(;f&&!b(f);){const e=C(f);if(b(e)||!m(e))break;f=e}if(u.length&&m(c)&&!c.matches("html,body")&&!T(c,i.floating)&&Array.from(u).every((e=>!T(f,e))))return;if(p(c)&&V){const t=c.clientWidth>0&&c.scrollWidth>c.clientWidth,n=c.clientHeight>0&&c.scrollHeight>c.clientHeight;let r=n&&e.offsetX>c.clientWidth;if(n&&"rtl"===E(c).direction&&(r=e.offsetX<=c.offsetWidth-c.clientWidth),r||t&&e.offsetY>c.clientHeight)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,g=y&&et(y.nodesRef.current,d).some((t=>{var n;return S(e,null==(n=t.context)?void 0:n.elements.floating)}));if(S(e,i.floating)||S(e,i.domReference)||g)return;const v=y?et(y.nodesRef.current,d):[];if(v.length>0){let e=!0;if(v.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),I=We((e=>{var t;const n=()=>{var t;B(e),null==(t=A(e))||t.removeEventListener(a,n)};null==(t=A(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=k,l.current.__outsidePressBubbles=D;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),H.current=!0}function u(){e=window.setTimeout((()=>{H.current=!1}),x()?5:0)}const f=M(i.floating);s&&(f.addEventListener("keydown",N?j:W,N),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",u)),R&&f.addEventListener(a,F?I:B,F);let d=[];return g&&(m(i.domReference)&&(d=P(i.domReference)),m(i.floating)&&(d=d.concat(P(i.floating))),!m(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})})),()=>{s&&(f.removeEventListener("keydown",N?j:W,N),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",u)),R&&f.removeEventListener(a,F?I:B,F),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,s,R,a,r,o,g,c,k,D,W,N,j,B,F,I]),e.useEffect((()=>{L.current=!1}),[R,a]);const _=e.useMemo((()=>({onKeyDown:W,[nt[d]]:e=>{f&&o(!1,e.nativeEvent,"reference-press")}})),[W,o,f,d]),V=e.useMemo((()=>({onKeyDown:W,onMouseDown(){O.current=!0},onMouseUp(){O.current=!0},[rt[a]]:()=>{L.current=!0}})),[W,a]);return e.useMemo((()=>c?{reference:_,floating:V}:{}),[c,_,V])}(K),Y=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:s=!0,delay:u=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,g=Ue(),v=qe(),h=Qe(a),y=Qe(u),w=Qe(r),x=e.useRef(),b=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),L=e.useRef(!1),P=e.useRef((()=>{})),O=e.useRef(!1),S=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(s)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(b.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[s,l]),e.useEffect((()=>{if(!s)return;if(!h.current)return;if(!r)return;function e(e){S()&&o(!1,e,"hover")}const t=M(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,s,h,S]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Je(y.current,"close",x.current);r&&!E.current?(clearTimeout(b.current),b.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(b.current),o(!1,e,n))}),[y,o]),D=We((()=>{P.current(),E.current=void 0})),N=We((()=>{if(L.current){const e=M(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Ge),L.current=!1}}));e.useEffect((()=>{if(s&&m(c.domReference)){var e;const t=c.domReference;return r&&t.addEventListener("mouseleave",u),null==(e=c.floating)||e.addEventListener("mouseleave",u),p&&t.addEventListener("mousemove",n,{once:!0}),t.addEventListener("mouseenter",n),t.addEventListener("mouseleave",l),()=>{var e;r&&t.removeEventListener("mouseleave",u),null==(e=c.floating)||e.removeEventListener("mouseleave",u),p&&t.removeEventListener("mousemove",n),t.removeEventListener("mouseenter",n),t.removeEventListener("mouseleave",l)}}function t(){return!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)}function n(e){if(clearTimeout(b.current),C.current=!1,f&&!k(x.current)||d>0&&!Je(y.current,"open"))return;const t=Je(y.current,"open",x.current);t?b.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):o(!0,e,"hover")}function l(e){if(t())return;P.current();const n=M(c.floating);if(clearTimeout(R.current),O.current=!1,h.current&&i.current.floatingContext){r||clearTimeout(b.current),E.current=h.current({...i.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),D(),A(e,!0,"safe-polygon")}});const t=E.current;return n.addEventListener("mousemove",t),void(P.current=()=>{n.removeEventListener("mousemove",t)})}("touch"!==x.current||!T(c.floating,e.relatedTarget))&&A(e)}function u(e){t()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:g,x:e.clientX,y:e.clientY,onClose(){N(),D(),A(e)}})(e))}}),[c,s,t,f,d,p,A,D,N,o,r,w,g,y,h,i]),je((()=>{var e;if(s&&r&&null!=(e=h.current)&&e.__options.blockPointerEvents&&S()){L.current=!0;const e=c.floating;if(m(c.domReference)&&e){var t;const n=M(c.floating).body;n.setAttribute(Ge,"");const r=c.domReference,o=null==g||null==(t=g.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[s,r,v,c,g,h,S]),je((()=>{r||(x.current=void 0,O.current=!1,D(),N())}),[r,D,N]),e.useEffect((()=>()=>{D(),clearTimeout(b.current),clearTimeout(R.current),N()}),[s,c.domReference,D,N]);const F=e.useMemo((()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!k(x.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===x.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),H=e.useMemo((()=>({onMouseEnter(){clearTimeout(b.current)},onMouseLeave(e){A(e.nativeEvent,!1)}})),[A]);return e.useMemo((()=>s?{reference:F,floating:H}:{}),[s,F,H])}(K,{}),$=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=>ut(e,t,"reference")),n),l=e.useCallback((e=>ut(e,t,"floating")),r),c=e.useCallback((e=>ut(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([Y,z,X]),q=$.getReferenceProps,U=$.getFloatingProps;return t.createElement("span",null,t.createElement("span",c({className:"rad-ui-popper ".concat(F,"-reference-element ").concat(f),ref:_.setReference},q({onClick:function(){console.log("click")}})),v),j&&t.createElement("div",c({className:"".concat(F,"-floating-element"),ref:_.setFloating,style:V},U()),R&&t.createElement(Xe,{className:"rad-ui-arrow ".concat(F,"-arrow"),ref:H,context:K}),O))},dt=function(e){var n=e.list,r=void 0===n?[]:n;e.selected;return t.createElement("div",{className:"relative"},t.createElement(ft,{open:!1,placement:"bottom-start",popperName:"dropdown",pop:t.createElement((function(){return t.createElement("ul",{className:"bg-white px-2 py-2 shadow-lg rounded-md"},r.map((function(e,n){return t.createElement("li",{key:n},e.value)})))}),null)},t.createElement("span",null,"Dropdown")))};export{dt as default};
|
|
1
|
+
'use client';import*as e from"react";import t,{useLayoutEffect as n,useEffect as r,useRef as o,useState as i}from"react";import*as l from"react-dom";var c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},c.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function u(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=u(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function a(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=u(e))&&(r&&(r+=" "),r+=t);return r}function s(){return"undefined"!=typeof window}function f(e){return m(e)?(e.nodeName||"").toLowerCase():"#document"}function d(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function p(e){var t;return null==(t=(m(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function m(e){return!!s()&&(e instanceof Node||e instanceof d(e).Node)}function v(e){return!!s()&&(e instanceof Element||e instanceof d(e).Element)}function h(e){return!!s()&&(e instanceof HTMLElement||e instanceof d(e).HTMLElement)}function g(e){return!(!s()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof d(e).ShadowRoot)}function y(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=C(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function w(e){return["table","td","th"].includes(f(e))}function b(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function x(e){const t=E(),n=v(e)?C(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function E(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function R(e){return["html","body","#document"].includes(f(e))}function C(e){return d(e).getComputedStyle(e)}function S(e){return v(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function L(e){if("html"===f(e))return e;const t=e.assignedSlot||e.parentNode||g(e)&&e.host||p(e);return g(t)?t.host:t}function O(e){const t=L(e);return R(t)?e.ownerDocument?e.ownerDocument.body:e.body:h(t)&&y(t)?t:O(t)}function P(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=O(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=d(o);if(i){const e=T(l);return t.concat(l,l.visualViewport||[],y(o)?o:[],e&&n?P(e):[])}return t.concat(o,P(o,[],n))}function T(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function A(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function k(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function M(e){return(null==e?void 0:e.ownerDocument)||document}function D(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 N(e){return"composedPath"in e?e.composedPath()[0]:e.target}const I=["top","right","bottom","left"],F=Math.min,B=Math.max,H=Math.round,j=Math.floor,W=e=>({x:e,y:e}),V={left:"right",right:"left",bottom:"top",top:"bottom"},_={start:"end",end:"start"};function z(e,t,n){return B(e,F(t,n))}function K(e,t){return"function"==typeof e?e(t):e}function U(e){return e.split("-")[0]}function X(e){return e.split("-")[1]}function q(e){return"x"===e?"y":"x"}function Y(e){return"y"===e?"height":"width"}function $(e){return["top","bottom"].includes(U(e))?"y":"x"}function Z(e){return q($(e))}function G(e){return e.replace(/start|end/g,(e=>_[e]))}function Q(e){return e.replace(/left|right|bottom|top/g,(e=>V[e]))}function J(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 ee(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
|
+
/*!
|
|
3
|
+
* tabbable 6.2.0
|
|
4
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
+
*/var te=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ne="undefined"==typeof Element,re=ne?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oe=!ne&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ie=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},le=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!ie(l,!1))if("SLOT"===l.tagName){var c=l.assignedElements(),u=e(c.length?c:l.children,!0,r);r.flatten?o.push.apply(o,u):o.push({scopeParent:l,candidates:u})}else{re.call(l,te)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var a=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),s=!ie(a,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(a&&s){var f=e(!0===a?l.children:a.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},ce=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ue=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ce(e)?0:e.tabIndex},ae=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},se=function(e){return"INPUT"===e.tagName},fe=function(e){return function(e){return se(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||oe(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},de=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},pe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=re.call(e,"details>summary:first-of-type")?e.parentElement:e;if(re.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return de(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,c=oe(e);if(l&&!l.shadowRoot&&!0===r(l))return de(e);e=e.assignedSlot?e.assignedSlot:l||c===e.ownerDocument?l:c.host}e=i}if(function(e){var t,n,r,o,i=e&&oe(e),l=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&l;){var u,a,s;c=!(null===(a=l=null===(u=i=oe(l))||void 0===u?void 0:u.host)||void 0===a||null===(s=a.ownerDocument)||void 0===s||!s.contains(l))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},me=function(e,t){return!(t.disabled||ie(t)||function(e){return se(e)&&"hidden"===e.type}(t)||pe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!re.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ve=function(e,t){return!(fe(t)||ue(t)<0||!me(e,t))},he=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ge=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,c=function(e,t){var n=ue(e);return n<0&&t&&!ce(e)?0:n}(l,i),u=i?e(t.candidates):l;0===c?i?n.push.apply(n,u):n.push(l):r.push({documentOrder:o,tabIndex:c,item:t,isScope:i,content:u})})),r.sort(ae).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},ye=function(e,t){var n;return n=(t=t||{}).getShadowRoot?le([e],t.includeContainer,{filter:ve.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:he}):function(e,t,n){if(ie(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(te));return t&&re.call(e,te)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,ve.bind(null,t)),ge(n)};function we(e,t,n){let{reference:r,floating:o}=e;const i=$(t),l=Z(t),c=Y(l),u=U(t),a="y"===i,s=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(u){case"top":p={x:s,y:r.y-o.height};break;case"bottom":p={x:s,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(X(t)){case"start":p[l]-=d*(n&&a?-1:1);break;case"end":p[l]+=d*(n&&a?-1:1)}return p}async function be(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:c,strategy:u}=e,{boundary:a="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=K(t,e),m=J(p),v=c[d?"floating"===f?"reference":"floating":f],h=ee(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:a,rootBoundary:s,strategy:u})),g="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=ee(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function xe(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ee(e){return I.some((t=>e[t]>=0))}function Re(e){const t=C(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=h(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,c=H(n)!==i||H(r)!==l;return c&&(n=i,r=l),{width:n,height:r,$:c}}function Ce(e){return v(e)?e:e.contextElement}function Se(e){const t=Ce(e);if(!h(t))return W(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Re(t);let l=(i?H(n.width):n.width)/r,c=(i?H(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),c&&Number.isFinite(c)||(c=1),{x:l,y:c}}const Le=W(0);function Oe(e){const t=d(e);return E()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Le}function Pe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ce(e);let l=W(1);t&&(r?v(r)&&(l=Se(r)):l=Se(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==d(e))&&t}(i,n,r)?Oe(i):W(0);let u=(o.left+c.x)/l.x,a=(o.top+c.y)/l.y,s=o.width/l.x,f=o.height/l.y;if(i){const e=d(i),t=r&&v(r)?d(r):r;let n=e,o=T(n);for(;o&&r&&t!==n;){const e=Se(o),t=o.getBoundingClientRect(),r=C(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;u*=e.x,a*=e.y,s*=e.x,f*=e.y,u+=i,a+=l,n=d(o),o=T(n)}}return ee({width:s,height:f,x:u,y:a})}function Te(e,t){const n=S(e).scrollLeft;return t?t.left+n:Pe(p(e)).left+n}function Ae(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:Te(e,r)),y:r.top+t.scrollTop}}function ke(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=d(e),r=p(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,c=0,u=0;if(o){i=o.width,l=o.height;const e=E();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,u=o.offsetTop)}return{width:i,height:l,x:c,y:u}}(e,n);else if("document"===t)r=function(e){const t=p(e),n=S(e),r=e.ownerDocument.body,o=B(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=B(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Te(e);const c=-n.scrollTop;return"rtl"===C(r).direction&&(l+=B(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:c}}(p(e));else if(v(t))r=function(e,t){const n=Pe(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=h(e)?Se(e):W(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Oe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ee(r)}function Me(e,t){const n=L(e);return!(n===t||!v(n)||R(n))&&("fixed"===C(n).position||Me(n,t))}function De(e,t,n){const r=h(t),o=p(t),i="fixed"===n,l=Pe(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=W(0);if(r||!r&&!i)if(("body"!==f(t)||y(o))&&(c=S(t)),r){const e=Pe(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else o&&(u.x=Te(o));const a=!o||r||i?W(0):Ae(o,c);return{x:l.left+c.scrollLeft-u.x-a.x,y:l.top+c.scrollTop-u.y-a.y,width:l.width,height:l.height}}function Ne(e){return"static"===C(e).position}function Ie(e,t){if(!h(e)||"fixed"===C(e).position)return null;if(t)return t(e);let n=e.offsetParent;return p(e)===n&&(n=n.ownerDocument.body),n}function Fe(e,t){const n=d(e);if(b(e))return n;if(!h(e)){let t=L(e);for(;t&&!R(t);){if(v(t)&&!Ne(t))return t;t=L(t)}return n}let r=Ie(e,t);for(;r&&w(r)&&Ne(r);)r=Ie(r,t);return r&&R(r)&&Ne(r)&&!x(r)?n:r||function(e){let t=L(e);for(;h(t)&&!R(t);){if(x(t))return t;if(b(t))return null;t=L(t)}return null}(e)||n}const Be={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=p(r),c=!!t&&b(t.floating);if(r===l||c&&i)return n;let u={scrollLeft:0,scrollTop:0},a=W(1);const s=W(0),d=h(r);if((d||!d&&!i)&&(("body"!==f(r)||y(l))&&(u=S(r)),h(r))){const e=Pe(r);a=Se(r),s.x=e.x+r.clientLeft,s.y=e.y+r.clientTop}const m=!l||d||i?W(0):Ae(l,u,!0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-u.scrollLeft*a.x+s.x+m.x,y:n.y*a.y-u.scrollTop*a.y+s.y+m.y}},getDocumentElement:p,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?b(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>v(e)&&"body"!==f(e))),o=null;const i="fixed"===C(e).position;let l=i?L(e):e;for(;v(l)&&!R(l);){const t=C(l),n=x(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||y(l)&&!n&&Me(e,l))?r=r.filter((e=>e!==l)):o=t,l=L(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],c=i.reduce(((e,n)=>{const r=ke(t,n,o);return e.top=B(r.top,e.top),e.right=F(r.right,e.right),e.bottom=F(r.bottom,e.bottom),e.left=B(r.left,e.left),e}),ke(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Fe,getElementRects:async function(e){const t=this.getOffsetParent||Fe,n=this.getDimensions,r=await n(e.floating);return{reference:De(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Re(e);return{width:t,height:n}},getScale:Se,isElement:v,isRTL:function(e){return"rtl"===C(e).direction}};function He(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:u=!1}=r,a=Ce(e),s=o||i?[...a?P(a):[],...P(t)]:[];s.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=a&&c?function(e,t){let n,r=null;const o=p(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function l(c,u){void 0===c&&(c=!1),void 0===u&&(u=1),i();const{left:a,top:s,width:f,height:d}=e.getBoundingClientRect();if(c||t(),!f||!d)return;const p={rootMargin:-j(s)+"px "+-j(o.clientWidth-(a+f))+"px "+-j(o.clientHeight-(s+d))+"px "+-j(a)+"px",threshold:B(0,F(1,u))||1};let m=!0;function v(e){const t=e[0].intersectionRatio;if(t!==u){if(!m)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}m=!1}try{r=new IntersectionObserver(v,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),i}(a,n):null;let d,m=-1,v=null;l&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!u&&v.observe(a),v.observe(t));let h=u?Pe(e):null;return u&&function t(){const r=Pe(e);!h||r.x===h.x&&r.y===h.y&&r.width===h.width&&r.height===h.height||n();h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;s.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=v)||e.disconnect(),v=null,u&&cancelAnimationFrame(d)}}const je=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:c}=t,u=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=U(n),c=X(n),u="y"===$(n),a=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=K(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),u?{x:p*s,y:d*a}:{x:d*a,y:p*s}}(t,e);return l===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:l}}}}},We=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=K(e,t),a={x:n,y:r},s=await be(t,u),f=$(U(o)),d=q(f);let p=a[d],m=a[f];if(i){const e="y"===d?"bottom":"right";p=z(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";m=z(m+s["y"===f?"top":"left"],m,m-s[e])}const v=c.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},Ve=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:c,platform:u,elements:a}=t,{mainAxis:s=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=K(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=U(o),y=$(c),w=U(c)===c,b=await(null==u.isRTL?void 0:u.isRTL(a.floating)),x=d||(w||!v?[Q(c)]:function(e){const t=Q(e);return[G(e),t,G(t)]}(c)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=X(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(U(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(G)))),i}(c,v,m,b));const R=[c,...x],C=await be(t,h),S=[];let L=(null==(r=i.flip)?void 0:r.overflows)||[];if(s&&S.push(C[g]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=X(e),o=Z(e),i=Y(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Q(l)),[l,Q(l)]}(o,l,b);S.push(C[e[0]],C[e[1]])}if(L=[...L,{placement:o,overflows:S}],!S.every((e=>e<=0))){var O,P;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:L},reset:{placement:t}};let n=null==(P=L.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:P.placement;if(!n)switch(p){case"bestFit":{var T;const e=null==(T=L.filter((e=>{if(E){const t=$(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:T[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},_e=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=K(e,t);switch(r){case"referenceHidden":{const e=xe(await be(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ee(e)}}}case"escaped":{const e=xe(await be(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ee(e)}}}default:return{}}}}},ze=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:c,middlewareData:u}=t,{element:a,padding:s=0}=K(e,t)||{};if(null==a)return{};const f=J(s),d={x:n,y:r},p=Z(o),m=Y(p),v=await l.getDimensions(a),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",w=h?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(a));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=c.floating[w]||i.floating[m]);const C=b/2-x/2,S=R/2-v[m]/2-1,L=F(f[g],S),O=F(f[y],S),P=L,T=R-v[m]-O,A=R/2-v[m]/2+C,k=z(P,A,T),M=!u.arrow&&null!=X(o)&&A!==k&&i.reference[m]/2-(A<P?L:O)-v[m]/2<0,D=M?A<P?A-P:A-T:0;return{[p]:d[p]+D,data:{[p]:k,centerOffset:A-k-D,...M&&{alignmentOffset:D}},reset:M}}}),Ke=(e,t,n)=>{const r=new Map,o={platform:Be,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,c=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let a=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:s,y:f}=we(a,r,u),d=r,p={},m=0;for(let n=0;n<c.length;n++){const{name:i,fn:v}=c[n],{x:h,y:g,data:y,reset:w}=await v({x:s,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:a,platform:l,elements:{reference:e,floating:t}});s=null!=h?h:s,f=null!=g?g:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(a=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:s,y:f}=we(a,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Ue="undefined"!=typeof document?n:r;function Xe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Xe(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Xe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function qe(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ye(e,t){const n=qe(e);return Math.round(t*n)/n}function $e(t){const n=e.useRef(t);return Ue((()=>{n.current=t})),n}const Ze=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?ze({element:n.current,padding:r}).fn(t):{}:n?ze({element:n,padding:r}).fn(t):{};var o}}),Ge=(e,t)=>({...je(e),options:[e,t]}),Qe=(e,t)=>({...We(e),options:[e,t]}),Je=(e,t)=>({...Ve(e),options:[e,t]}),et=(e,t)=>({..._e(e),options:[e,t]}),tt={...e},nt=tt.useInsertionEffect||(e=>e());function rt(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return nt((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var ot="undefined"!=typeof document?n:r;function it(){return it=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},it.apply(this,arguments)}let lt=!1,ct=0;const ut=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ct++;const at=tt.useId||function(){const[t,n]=e.useState((()=>lt?ut():void 0));return ot((()=>{null==t&&n(ut())}),[]),e.useEffect((()=>{lt=!0}),[]),t};let st;"production"!==process.env.NODE_ENV&&(st=new Set);const ft=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:c=14,height:u=7,tipRadius:a=0,strokeWidth:s=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...h}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=st)&&e.has(o)||(null==(i=st)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const g=at(),[y,w]=e.useState(!1);if(ot((()=>{if(!o)return;"rtl"===C(o).direction&&w(!0)}),[o]),!o)return null;const[b,x]=r.split("-"),E="top"===b||"bottom"===b;let R=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(R=null);const S=2*s,L=S/2,O=c/2*(a/-8+1),P=u/2*a/4,T=!!p,A=R&&"end"===x?"bottom":"top";let k=R&&"end"===x?"right":"left";R&&y&&(k="end"===x?"left":"right");const M=null!=(null==i?void 0:i.x)?R||i.x:"",D=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+c+" L"+(c-O)+","+(u-P)+" Q"+c/2+","+u+" "+O+","+(u-P)+" Z",I={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",it({},h,{"aria-hidden":!0,ref:n,width:T?c:c+S,height:c,viewBox:"0 0 "+c+" "+(u>c?u:c),style:{position:"absolute",pointerEvents:"none",[k]:M,[A]:D,[b]:E||T?"100%":"calc(100% - "+S/2+"px)",transform:[I,m].filter((e=>!!e)).join(" "),...v}}),S>0&&e.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:d,strokeWidth:S+(p?0:1),d:N}),e.createElement("path",{stroke:S&&!p?h.fill:"none",d:N}),e.createElement("clipPath",{id:g},e.createElement("rect",{x:-L,y:L*(T?-1:1),width:c+S,height:c})))}));const dt=e.createContext(null),pt=e.createContext(null),mt=()=>{var t;return(null==(t=e.useContext(dt))?void 0:t.id)||null},vt=()=>e.useContext(pt);function ht(e){return"data-floating-ui-"+e}function gt(e){const t=o(e);return ot((()=>{t.current=e})),t}const yt=ht("safe-polygon");function wt(e,t,n){return n&&!k(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function bt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const xt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Et(e,t){const n=ye(e,xt());"prev"===t&&n.reverse();const r=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}(M(e)));return n.slice(r+1)[0]}function Rt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function Ct(e){ye(e,xt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function St(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Lt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ot(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const Pt=e.forwardRef((function(t,n){const[r,o]=e.useState();ot((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",Ot),()=>{document.removeEventListener("keydown",Ot)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[ht("focus-guard")]:"",style:Lt};return e.createElement("span",it({},t,i))})),Tt=e.createContext(null),At=ht("portal");function kt(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,c=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=at(),i=Mt(),[l,c]=e.useState(null),u=e.useRef(null);return ot((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{u.current=null}))}),[l]),ot((()=>{if(!o)return;if(u.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(At,""),e.appendChild(t),u.current=t,c(t)}),[n,o]),ot((()=>{if(null===r)return;if(!o)return;if(u.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!v(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(At,""),e=t||e,e.appendChild(l),u.current=l,c(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,a]=e.useState(null),s=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==u?void 0:u.modal,h=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!(!o&&!c);return e.useEffect((()=>{if(c&&i&&!m)return c.addEventListener("focusin",e,!0),c.addEventListener("focusout",e,!0),()=>{c.removeEventListener("focusin",e,!0),c.removeEventListener("focusout",e,!0)};function e(e){if(c&&Rt(e)){("focusin"===e.type?St:Ct)(c)}}}),[c,i,m]),e.useEffect((()=>{c&&(h||St(c))}),[h,c]),e.createElement(Tt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:s,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:c,setFocusManagerState:a})),[i,c])},g&&c&&e.createElement(Pt,{"data-type":"outside",ref:s,onFocus:e=>{if(Rt(e,c)){var t;null==(t=d.current)||t.focus()}else{const e=Et(document.body,"prev")||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),g&&c&&e.createElement("span",{"aria-owns":c.id,style:Lt}),c&&l.createPortal(n,c),g&&c&&e.createElement(Pt,{"data-type":"outside",ref:f,onFocus:e=>{if(Rt(e,c)){var t;null==(t=p.current)||t.focus()}else{const t=Et(document.body,"next")||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Mt=()=>e.useContext(Tt),Dt="data-floating-ui-focusable",Nt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},It={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Ft=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Bt(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=at(),l=e.useRef({}),[c]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),u=null!=mt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!v(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=st)&&e.has(o)||(null==(i=st)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,s]=e.useState(o.reference),f=rt(((e,t,n)=>{l.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:n,nested:u}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:s})),[]),p=e.useMemo((()=>({reference:a||o.reference||null,floating:o.floating||null,domReference:o.reference})),[a,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:c,floatingId:i,refs:d})),[n,f,p,c,i,d])}function Ht(t){void 0===t&&(t={});const{nodeId:n}=t,r=Bt({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[c,u]=e.useState(null),[a,s]=e.useState(null),f=(null==i?void 0:i.domReference)||c,d=e.useRef(null),p=vt();ot((()=>{f&&(d.current=f)}),[f]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:u}={},transform:a=!0,whileElementsMounted:s,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);Xe(m,o)||v(o);const[h,g]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,g(e))}),[]),x=e.useCallback((e=>{e!==S.current&&(S.current=e,w(e))}),[]),E=c||h,R=u||y,C=e.useRef(null),S=e.useRef(null),L=e.useRef(d),O=null!=s,P=$e(s),T=$e(i),A=$e(f),k=e.useCallback((()=>{if(!C.current||!S.current)return;const e={placement:n,strategy:r,middleware:m};T.current&&(e.platform=T.current),Ke(C.current,S.current,e).then((e=>{const t={...e,isPositioned:!1!==A.current};M.current&&!Xe(L.current,t)&&(L.current=t,l.flushSync((()=>{p(t)})))}))}),[m,n,r,T,A]);Ue((()=>{!1===f&&L.current.isPositioned&&(L.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const M=e.useRef(!1);Ue((()=>(M.current=!0,()=>{M.current=!1})),[]),Ue((()=>{if(E&&(C.current=E),R&&(S.current=R),E&&R){if(P.current)return P.current(E,R,k);k()}}),[E,R,k,P,O]);const D=e.useMemo((()=>({reference:C,floating:S,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),I=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=Ye(N.floating,d.x),n=Ye(N.floating,d.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...qe(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,a,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:D,elements:N,floatingStyles:I})),[d,k,D,N,I])}({...t,elements:{...i,...a&&{reference:a}}}),h=e.useCallback((e=>{const t=v(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;s(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(v(e)||null===e)&&(d.current=e,u(e)),(v(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!v(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:h,domReference:d})),[m.refs,g,h]),w=e.useMemo((()=>({...m.elements,domReference:f})),[m.elements,f]),b=e.useMemo((()=>({...m,...o,refs:y,elements:w,nodeId:n})),[m,y,w,n,o]);return ot((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...m,context:b,refs:y,elements:w})),[m,y,w,b])}const jt="active",Wt="selected";function Vt(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[jt]:t,[Wt]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Dt]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[jt,Wt].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const _t=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var zt=function(n){var r=n.popperName,l=void 0===r?"":r,u=n.customRootClass,s=void 0===u?"":u;n.activationStrategy;var f=n.className,d=void 0===f?"":f,p=n.placement,m=void 0===p?"top":p,g=n.children,y=n.open,w=void 0!==y&&y;n.hoverDelay;var b=n.showArrow,x=void 0===b||b,S=n.pop,O=void 0===S?t.createElement(t.Fragment,null):S;!function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}}(n,["popperName","customRootClass","activationStrategy","className","placement","children","open","hoverDelay","showArrow","pop"]);var T,I,F=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)}(s,l),B=o(null),H=i(w),j=H[0],W=H[1],V=Ht({placement:m,whileElementsMounted:He,open:j,middleware:[(T={element:B,padding:4},{...Ze(T),options:[T,I]}),Ge(9),Je({mainAxis:!0,fallbackStrategy:"initialPlacement"}),Qe({crossAxis:!1}),et({strategy:"referenceHidden"})],onOpenChange:W}),_=V.refs,z=V.floatingStyles,K=V.context,U=function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:c="dialog"}=n,u=null!=(r=_t.get(c))?r:c,a=at(),s=null!=mt(),f=e.useMemo((()=>"tooltip"===u||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===u?"dialog":u,"aria-controls":o?i:void 0,..."listbox"===u&&{role:"combobox"},..."menu"===u&&{id:a},..."menu"===u&&s&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}}),[u,i,s,o,a,c]),d=e.useMemo((()=>{const e={id:i,...u&&{role:u}};return"tooltip"===u||"label"===c?e:{...e,..."menu"===u&&{"aria-labelledby":a}}}),[u,i,a,c]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(c){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,c]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])}(K),X=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:c=!0,escapeKey:u=!0,outsidePress:a=!0,outsidePressEvent:s="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:g}=n,y=vt(),w=rt("function"==typeof a?a:()=>!1),b="function"==typeof a?w:a,x=e.useRef(!1),S=e.useRef(!1),{escapeKey:O,outsidePress:T}=Ft(m),{escapeKey:k,outsidePress:I}=Ft(g),F=e.useRef(!1),B=rt((e=>{var t;if(!r||!c||!u||"Escape"!==e.key)return;if(F.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=y?bt(y.nodesRef.current,n):[];if(!O&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),H=rt((e=>{var t;const n=()=>{var t;B(e),null==(t=N(e))||t.removeEventListener("keydown",n)};null==(t=N(e))||t.addEventListener("keydown",n)})),j=rt((e=>{var t;const n=x.current;x.current=!1;const r=S.current;if(S.current=!1,"click"===s&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const c=N(e),u="["+ht("inert")+"]",a=M(i.floating).querySelectorAll(u);let f=v(c)?c:null;for(;f&&!R(f);){const e=L(f);if(R(e)||!v(e))break;f=e}if(a.length&&v(c)&&!c.matches("html,body")&&!A(c,i.floating)&&Array.from(a).every((e=>!A(f,e))))return;if(h(c)&&_){const t=R(c),n=C(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,u=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,a="rtl"===n.direction,s=u&&(a?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=l&&e.offsetY>c.clientHeight;if(s||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=y&&bt(y.nodesRef.current,d).some((t=>{var n;return D(e,null==(n=t.context)?void 0:n.elements.floating)}));if(D(e,i.floating)||D(e,i.domReference)||p)return;const m=y?bt(y.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=rt((e=>{var t;const n=()=>{var t;j(e),null==(t=N(e))||t.removeEventListener(s,n)};null==(t=N(e))||t.addEventListener(s,n)}));e.useEffect((()=>{if(!r||!c)return;l.current.__escapeKeyBubbles=O,l.current.__outsidePressBubbles=T;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),F.current=!0}function a(){e=window.setTimeout((()=>{F.current=!1}),E()?5:0)}const f=M(i.floating);u&&(f.addEventListener("keydown",k?H:B,k),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",a)),b&&f.addEventListener(s,I?W:j,I);let d=[];return p&&(v(i.domReference)&&(d=P(i.domReference)),v(i.floating)&&(d=d.concat(P(i.floating))),!v(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(P(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{u&&(f.removeEventListener("keydown",k?H:B,k),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",a)),b&&f.removeEventListener(s,I?W:j,I),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,u,b,s,r,o,p,c,O,T,B,k,H,j,I,W]),e.useEffect((()=>{x.current=!1}),[b,s]);const V=e.useMemo((()=>({onKeyDown:B,...f&&{[Nt[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[B,o,f,d]),_=e.useMemo((()=>({onKeyDown:B,onMouseDown(){S.current=!0},onMouseUp(){S.current=!0},[It[s]]:()=>{x.current=!0}})),[B,s]);return e.useMemo((()=>c?{reference:V,floating:_}:{}),[c,V,_])}(K),q=function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:c}=t,{enabled:u=!0,delay:a=0,handleClose:s=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=vt(),h=mt(),g=gt(s),y=gt(a),w=gt(r),b=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),S=e.useRef(!1),L=e.useRef((()=>{})),O=e.useRef(!1),P=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(u)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,O.current=!1)}}),[u,l]),e.useEffect((()=>{if(!u)return;if(!g.current)return;if(!r)return;function e(e){P()&&o(!1,e,"hover")}const t=M(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[c.floating,r,o,u,g,P]);const T=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=wt(y.current,"close",b.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[y,o]),D=rt((()=>{L.current(),E.current=void 0})),N=rt((()=>{if(S.current){const e=M(c.floating).body;e.style.pointerEvents="",e.removeAttribute(yt),S.current=!1}})),I=rt((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(u&&v(c.domReference)){var e;const o=c.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=c.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=c.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!k(b.current)||d>0&&!wt(y.current,"open"))return;const t=wt(y.current,"open",b.current);t?x.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(I())return;L.current();const t=M(c.floating);if(clearTimeout(R.current),O.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),D(),I()||T(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(L.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!A(c.floating,e.relatedTarget))&&T(e)}function l(e){I()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),D(),I()||T(e)}})(e))}}),[c,u,t,f,d,p,T,D,N,o,r,w,m,y,g,i,I]),ot((()=>{var e;if(u&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&P()){S.current=!0;const e=c.floating;if(v(c.domReference)&&e){var t;const n=M(c.floating).body;n.setAttribute(yt,"");const r=c.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===h)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[u,r,h,c,m,g,P]),ot((()=>{r||(b.current=void 0,O.current=!1,D(),N())}),[r,D,N]),e.useEffect((()=>()=>{D(),clearTimeout(x.current),clearTimeout(R.current),N()}),[u,c.domReference,D,N]);const F=e.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!k(b.current)||r||0===d||O.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===b.current?n():(O.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),B=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){I()||T(e.nativeEvent,!1)}})),[T,I]);return e.useMemo((()=>u?{reference:F,floating:B}:{}),[u,F,B])}(K,{}),Y=function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>Vt(e,t,"reference")),n),l=e.useCallback((e=>Vt(e,t,"floating")),r),c=e.useCallback((e=>Vt(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:c})),[i,l,c])}([q,U,X]),$=Y.getReferenceProps,Z=Y.getFloatingProps;return t.createElement("span",null,t.createElement("span",c({className:a("rad-ui-popper","".concat(F,"-reference-element"),d),ref:_.setReference},$({onClick:function(){console.log("click")}})),g),j&&t.createElement(kt,null," ",t.createElement("div",c({className:a("".concat(F,"-floating-element")),ref:_.setFloating,style:z},Z()),x&&t.createElement(ft,{className:a("rad-ui-arrow ".concat(F,"-arrow")),ref:B,context:K}),O)))},Kt=function(e){var n=e.list,r=void 0===n?[]:n;e.selected;return t.createElement("div",{className:"relative"},t.createElement(zt,{open:!1,placement:"bottom-start",popperName:"dropdown",pop:t.createElement((function(){return t.createElement("ul",{className:"bg-white px-2 py-2 shadow-lg rounded-md"},r.map((function(e,n){return t.createElement("li",{key:n},e.value)})))}),null)},t.createElement("span",null,"Dropdown")))};export{Kt as default};
|
package/dist/components/Em.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var
|
|
1
|
+
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function t(r){var e,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(o=t(r[e]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}function o(){for(var r,e,o=0,n="",a=arguments.length;o<a;o++)(r=arguments[o])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}var n=function(t){var n=t.children,a=t.customRootClass,c=t.className,s=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}(t,["children","customRootClass","className"]),f=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(a,"Em");return r.createElement("em",e({className:o(f,c)},s),n)};n.displayName="Em";export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import
|
|
1
|
+
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,a=arguments.length;t<a;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r){var e,a,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var o=r.length;for(e=0;e<o;e++)r[e]&&(a=t(r[e]))&&(n&&(n+=" "),n+=a)}else for(a in r)r[a]&&(n&&(n+=" "),n+=a);return n}function a(){for(var r,e,a=0,n="",o=arguments.length;a<o;a++)(r=arguments[a])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var n=[{label:"H1",tag:"h1"},{label:"H2",tag:"h2"},{label:"H3",tag:"h3"},{label:"H4",tag:"h4"},{label:"H5",tag:"h5"},{label:"H6",tag:"h6"}],o=function(t){var o=t.children,l=t.as,i=void 0===l?void 0:l,c=t.customRootClass,f=void 0===c?"":c,s=t.className,u=void 0===s?"":s,p=function(r,e){var t={};for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&e.indexOf(a)<0&&(t[a]=r[a]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(a=Object.getOwnPropertySymbols(r);n<a.length;n++)e.indexOf(a[n])<0&&Object.prototype.propertyIsEnumerable.call(r,a[n])&&(t[a[n]]=r[a[n]])}return t}(t,["children","as","customRootClass","className"]),v=function(r,e){if(void 0===r&&(r=""),void 0===e&&(e=""),r)return r;if(!e)return"";var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(f,i||"h1");if(void 0!==i&&n.find((function(r){return r.tag===i}))){var d=n.find((function(r){return r.tag===i})).tag;return r.createElement(d,e({className:a(v,u)},p),o)}return r.createElement("h1",e({className:a(v,u)},p),o)};o.displayName="Heading";export{o as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use client';import*as e from"react";import t,{createContext as n,useLayoutEffect as r,useEffect as o,useRef as i,useState as l,useContext as u}from"react";import*as c from"react-dom";var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)};function a(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var f=n({});function d(){return"undefined"!=typeof window}function p(e){return g(e)?(e.nodeName||"").toLowerCase():"#document"}function m(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function v(e){var t;return null==(t=(g(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function g(e){return!!d()&&(e instanceof Node||e instanceof m(e).Node)}function h(e){return!!d()&&(e instanceof Element||e instanceof m(e).Element)}function y(e){return!!d()&&(e instanceof HTMLElement||e instanceof m(e).HTMLElement)}function w(e){return!(!d()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof m(e).ShadowRoot)}function b(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=S(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function x(e){return["table","td","th"].includes(p(e))}function E(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function R(e){const t=C(),n=h(e)?S(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function C(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function O(e){return["html","body","#document"].includes(p(e))}function S(e){return m(e).getComputedStyle(e)}function L(e){return h(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function T(e){if("html"===p(e))return e;const t=e.assignedSlot||e.parentNode||w(e)&&e.host||v(e);return w(t)?t.host:t}function A(e){const t=T(e);return O(t)?e.ownerDocument?e.ownerDocument.body:e.body:y(t)&&b(t)?t:A(t)}function P(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=A(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),l=m(o);if(i){const e=k(l);return t.concat(l,l.visualViewport||[],b(o)?o:[],e&&n?P(e):[])}return t.concat(o,P(o,[],n))}function k(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function D(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function M(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&w(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function N(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function F(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function I(e){return!F().includes("jsdom/")&&(!W()&&0===e.width&&0===e.height||W()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function W(){const e=/android/i;return e.test(N())||e.test(F())}function j(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function H(e){return(null==e?void 0:e.ownerDocument)||document}function B(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function V(e){return"composedPath"in e?e.composedPath()[0]:e.target}function _(e){e.preventDefault(),e.stopPropagation()}function q(e){return!!e&&("combobox"===e.getAttribute("role")&&function(e){return y(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}(e))}const K=["top","right","bottom","left"],X=Math.min,U=Math.max,Y=Math.round,$=e=>({x:e,y:e}),z={left:"right",right:"left",bottom:"top",top:"bottom"},Z={start:"end",end:"start"};function G(e,t,n){return U(e,X(t,n))}function Q(e,t){return"function"==typeof e?e(t):e}function J(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function te(e){return"x"===e?"y":"x"}function ne(e){return"y"===e?"height":"width"}function re(e){return["top","bottom"].includes(J(e))?"y":"x"}function oe(e){return te(re(e))}function ie(e){return e.replace(/start|end/g,(e=>Z[e]))}function le(e){return e.replace(/left|right|bottom|top/g,(e=>z[e]))}function ue(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ce(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}
|
|
2
|
+
/*!
|
|
3
|
+
* tabbable 6.2.0
|
|
4
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
5
|
+
*/var se=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ae="undefined"==typeof Element,fe=ae?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,de=!ae&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},pe=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},me=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!pe(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),c=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:l,candidates:c})}else{fe.call(l,se)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),a=!pe(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&a){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},ve=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ge=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!ve(e)?0:e.tabIndex},he=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ye=function(e){return"INPUT"===e.tagName},we=function(e){return function(e){return ye(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||de(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},be=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},xe=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=fe.call(e,"details>summary:first-of-type")?e.parentElement:e;if(fe.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return be(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=de(e);if(l&&!l.shadowRoot&&!0===r(l))return be(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(function(e){var t,n,r,o,i=e&&de(e),l=null===(t=i)||void 0===t?void 0:t.host,u=!1;if(i&&i!==e)for(u=!!(null!==(n=l)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(l)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!u&&l;){var c,s,a;u=!(null===(s=l=null===(c=i=de(l))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(l))}return u}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},Ee=function(e,t){return!(t.disabled||pe(t)||function(e){return ye(e)&&"hidden"===e.type}(t)||xe(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!fe.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Re=function(e,t){return!(we(t)||ge(t)<0||!Ee(e,t))},Ce=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Oe=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=function(e,t){var n=ge(e);return n<0&&t&&!ve(e)?0:n}(l,i),c=i?e(t.candidates):l;0===u?i?n.push.apply(n,c):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:c})})),r.sort(he).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Se=function(e,t){var n;return n=(t=t||{}).getShadowRoot?me([e],t.includeContainer,{filter:Re.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Ce}):function(e,t,n){if(pe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(se));return t&&fe.call(e,se)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,Re.bind(null,t)),Oe(n)};function Le(e,t,n){let{reference:r,floating:o}=e;const i=re(t),l=oe(t),u=ne(l),c=J(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[u]/2-o[u]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ee(t)){case"start":p[l]-=d*(n&&s?-1:1);break;case"end":p[l]+=d*(n&&s?-1:1)}return p}async function Te(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Q(t,e),m=ue(p),v=u[d?"floating"===f?"reference":"floating":f],g=ce(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(u.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(u.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=ce(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+m.top)/w.y,bottom:(b.bottom-g.bottom+m.bottom)/w.y,left:(g.left-b.left+m.left)/w.x,right:(b.right-g.right+m.right)/w.x}}function Ae(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Pe(e){return K.some((t=>e[t]>=0))}function ke(e){const t=S(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=y(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Y(n)!==i||Y(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function De(e){return h(e)?e:e.contextElement}function Me(e){const t=De(e);if(!y(t))return $(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ke(t);let l=(i?Y(n.width):n.width)/r,u=(i?Y(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),u&&Number.isFinite(u)||(u=1),{x:l,y:u}}const Ne=$(0);function Fe(e){const t=m(e);return C()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ne}function Ie(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=De(e);let l=$(1);t&&(r?h(r)&&(l=Me(r)):l=Me(e));const u=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==m(e))&&t}(i,n,r)?Fe(i):$(0);let c=(o.left+u.x)/l.x,s=(o.top+u.y)/l.y,a=o.width/l.x,f=o.height/l.y;if(i){const e=m(i),t=r&&h(r)?m(r):r;let n=e,o=k(n);for(;o&&r&&t!==n;){const e=Me(o),t=o.getBoundingClientRect(),r=S(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,s*=e.y,a*=e.x,f*=e.y,c+=i,s+=l,n=m(o),o=k(n)}}return ce({width:a,height:f,x:c,y:s})}function We(e,t){const n=L(e).scrollLeft;return t?t.left+n:Ie(v(e)).left+n}function je(e,t,n){void 0===n&&(n=!1);const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-(n?0:We(e,r)),y:r.top+t.scrollTop}}function He(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=m(e),r=v(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,c=0;if(o){i=o.width,l=o.height;const e=C();(!e||e&&"fixed"===t)&&(u=o.offsetLeft,c=o.offsetTop)}return{width:i,height:l,x:u,y:c}}(e,n);else if("document"===t)r=function(e){const t=v(e),n=L(e),r=e.ownerDocument.body,o=U(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=U(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+We(e);const u=-n.scrollTop;return"rtl"===S(r).direction&&(l+=U(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}(v(e));else if(h(t))r=function(e,t){const n=Ie(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=y(e)?Me(e):$(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Fe(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ce(r)}function Be(e,t){const n=T(e);return!(n===t||!h(n)||O(n))&&("fixed"===S(n).position||Be(n,t))}function Ve(e,t,n){const r=y(t),o=v(t),i="fixed"===n,l=Ie(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const c=$(0);if(r||!r&&!i)if(("body"!==p(t)||b(o))&&(u=L(t)),r){const e=Ie(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else o&&(c.x=We(o));const s=!o||r||i?$(0):je(o,u);return{x:l.left+u.scrollLeft-c.x-s.x,y:l.top+u.scrollTop-c.y-s.y,width:l.width,height:l.height}}function _e(e){return"static"===S(e).position}function qe(e,t){if(!y(e)||"fixed"===S(e).position)return null;if(t)return t(e);let n=e.offsetParent;return v(e)===n&&(n=n.ownerDocument.body),n}function Ke(e,t){const n=m(e);if(E(e))return n;if(!y(e)){let t=T(e);for(;t&&!O(t);){if(h(t)&&!_e(t))return t;t=T(t)}return n}let r=qe(e,t);for(;r&&x(r)&&_e(r);)r=qe(r,t);return r&&O(r)&&_e(r)&&!R(r)?n:r||function(e){let t=T(e);for(;y(t)&&!O(t);){if(R(t))return t;if(E(t))return null;t=T(t)}return null}(e)||n}const Xe={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,l=v(r),u=!!t&&E(t.floating);if(r===l||u&&i)return n;let c={scrollLeft:0,scrollTop:0},s=$(1);const a=$(0),f=y(r);if((f||!f&&!i)&&(("body"!==p(r)||b(l))&&(c=L(r)),y(r))){const e=Ie(r);s=Me(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!l||f||i?$(0):je(l,c,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-c.scrollLeft*s.x+a.x+d.x,y:n.y*s.y-c.scrollTop*s.y+a.y+d.y}},getDocumentElement:v,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?E(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=P(e,[],!1).filter((e=>h(e)&&"body"!==p(e))),o=null;const i="fixed"===S(e).position;let l=i?T(e):e;for(;h(l)&&!O(l);){const t=S(l),n=R(l);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||b(l)&&!n&&Be(e,l))?r=r.filter((e=>e!==l)):o=t,l=T(l)}return t.set(e,r),r}(t,this._c):[].concat(n),r],l=i[0],u=i.reduce(((e,n)=>{const r=He(t,n,o);return e.top=U(r.top,e.top),e.right=X(r.right,e.right),e.bottom=X(r.bottom,e.bottom),e.left=U(r.left,e.left),e}),He(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}},getOffsetParent:Ke,getElementRects:async function(e){const t=this.getOffsetParent||Ke,n=this.getDimensions,r=await n(e.floating);return{reference:Ve(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=ke(e);return{width:t,height:n}},getScale:Me,isElement:h,isRTL:function(e){return"rtl"===S(e).direction}},Ue=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=J(n),u=ee(n),c="y"===re(n),s=["left","top"].includes(l)?-1:1,a=i&&c?-1:1,f=Q(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return u&&"number"==typeof m&&(p="end"===u?-1*m:m),c?{x:p*a,y:d*s}:{x:d*s,y:p*a}}(t,e);return l===(null==(n=u.offset)?void 0:n.placement)&&null!=(r=u.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:l}}}}},Ye=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Q(e,t),s={x:n,y:r},a=await Te(t,c),f=re(J(o)),d=te(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=G(p+a["y"===d?"top":"left"],p,p-a[e])}if(l){const e="y"===f?"bottom":"right";m=G(m+a["y"===f?"top":"left"],m,m-a[e])}const v=u.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:l}}}}}},$e=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=Q(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=J(o),y=re(u),w=J(u)===u,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[le(u)]:function(e){const t=le(e);return[ie(e),t,ie(t)]}(u)),E="none"!==m;!d&&E&&x.push(...function(e,t,n,r){const o=ee(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}(J(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(ie)))),i}(u,v,m,b));const R=[u,...x],C=await Te(t,g),O=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&O.push(C[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=ee(e),o=oe(e),i=ne(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=le(l)),[l,le(l)]}(o,l,b);O.push(C[e[0]],C[e[1]])}if(S=[...S,{placement:o,overflows:O}],!O.every((e=>e<=0))){var L,T;const e=((null==(L=i.flip)?void 0:L.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(T=S.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=S.filter((e=>{if(E){const t=re(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:A[0];e&&(n=e);break}case"initialPlacement":n=u}if(o!==n)return{reset:{placement:n}}}return{}}}},ze=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Q(e,t);switch(r){case"referenceHidden":{const e=Ae(await Te(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Pe(e)}}}case"escaped":{const e=Ae(await Te(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Pe(e)}}}default:return{}}}}},Ze=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:c}=t,{element:s,padding:a=0}=Q(e,t)||{};if(null==s)return{};const f=ue(a),d={x:n,y:r},p=oe(o),m=ne(p),v=await l.getDimensions(s),g="y"===p,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[m]+i.reference[p]-d[p]-i.floating[m],x=d[p]-i.reference[p],E=await(null==l.getOffsetParent?void 0:l.getOffsetParent(s));let R=E?E[w]:0;R&&await(null==l.isElement?void 0:l.isElement(E))||(R=u.floating[w]||i.floating[m]);const C=b/2-x/2,O=R/2-v[m]/2-1,S=X(f[h],O),L=X(f[y],O),T=S,A=R-v[m]-L,P=R/2-v[m]/2+C,k=G(T,P,A),D=!c.arrow&&null!=ee(o)&&P!==k&&i.reference[m]/2-(P<T?S:L)-v[m]/2<0,M=D?P<T?P-T:P-A:0;return{[p]:d[p]+M,data:{[p]:k,centerOffset:P-k-M,...D&&{alignmentOffset:M}},reset:D}}}),Ge=(e,t,n)=>{const r=new Map,o={platform:Xe,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),c=await(null==l.isRTL?void 0:l.isRTL(t));let s=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Le(s,r,c),d=r,p={},m=0;for(let n=0;n<u.length;n++){const{name:i,fn:v}=u[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:s,platform:l,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,p={...p,[i]:{...p[i],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await l.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Le(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Qe="undefined"!=typeof document?r:o;function Je(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Je(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Je(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function et(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tt(e,t){const n=et(e);return Math.round(t*n)/n}function nt(t){const n=e.useRef(t);return Qe((()=>{n.current=t})),n}const rt=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Ze({element:n.current,padding:r}).fn(t):{}:n?Ze({element:n,padding:r}).fn(t):{};var o}});function ot(t){return e.useMemo((()=>t.every((e=>null==e))?null:e=>{t.forEach((t=>{"function"==typeof t?t(e):null!=t&&(t.current=e)}))}),t)}const it={...e},lt=it.useInsertionEffect||(e=>e());function ut(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return lt((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}var ct="undefined"!=typeof document?r:o;function st(){return st=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},st.apply(this,arguments)}let at=!1,ft=0;const dt=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ft++;const pt=it.useId||function(){const[t,n]=e.useState((()=>at?dt():void 0));return ct((()=>{null==t&&n(dt())}),[]),e.useEffect((()=>{at=!0}),[]),t};let mt;"production"!==process.env.NODE_ENV&&(mt=new Set);const vt=e.forwardRef((function(t,n){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:i,shift:l}},width:u=14,height:c=7,tipRadius:s=0,strokeWidth:a=0,staticOffset:f,stroke:d,d:p,style:{transform:m,...v}={},...g}=t;"production"!==process.env.NODE_ENV&&(n||function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=mt)&&e.has(o)||(null==(i=mt)||i.add(o),console.warn(o))}("The `ref` prop is required for `FloatingArrow`."));const h=pt(),[y,w]=e.useState(!1);if(ct((()=>{if(!o)return;"rtl"===S(o).direction&&w(!0)}),[o]),!o)return null;const[b,x]=r.split("-"),E="top"===b||"bottom"===b;let R=f;(E&&null!=l&&l.x||!E&&null!=l&&l.y)&&(R=null);const C=2*a,O=C/2,L=u/2*(s/-8+1),T=c/2*s/4,A=!!p,P=R&&"end"===x?"bottom":"top";let k=R&&"end"===x?"right":"left";R&&y&&(k="end"===x?"left":"right");const D=null!=(null==i?void 0:i.x)?R||i.x:"",M=null!=(null==i?void 0:i.y)?R||i.y:"",N=p||"M0,0 H"+u+" L"+(u-L)+","+(c-T)+" Q"+u/2+","+c+" "+L+","+(c-T)+" Z",F={top:A?"rotate(180deg)":"",left:A?"rotate(90deg)":"rotate(-90deg)",bottom:A?"":"rotate(180deg)",right:A?"rotate(-90deg)":"rotate(90deg)"}[b];return e.createElement("svg",st({},g,{"aria-hidden":!0,ref:n,width:A?u:u+C,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[k]:D,[P]:M,[b]:E||A?"100%":"calc(100% - "+C/2+"px)",transform:[F,m].filter((e=>!!e)).join(" "),...v}}),C>0&&e.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:d,strokeWidth:C+(p?0:1),d:N}),e.createElement("path",{stroke:C&&!p?g.fill:"none",d:N}),e.createElement("clipPath",{id:h},e.createElement("rect",{x:-O,y:O*(A?-1:1),width:u+C,height:u})))}));const gt=e.createContext(null),ht=e.createContext(null),yt=()=>{var t;return(null==(t=e.useContext(gt))?void 0:t.id)||null},wt=()=>e.useContext(ht);function bt(e){return"data-floating-ui-"+e}function xt(e){const t=i(e);return ct((()=>{t.current=e})),t}const Et=bt("safe-polygon");function Rt(e,t,n){return n&&!j(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Ct=0;function Ot(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Ct);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Ct=requestAnimationFrame(i)}function St(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}let Lt=new WeakMap,Tt=new WeakSet,At={},Pt=0;const kt=e=>e&&(e.host||kt(e.parentNode));function Dt(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=(u=t,e.map((e=>{if(u.contains(e))return e;const t=kt(e);return u.contains(t)?t:null})).filter((e=>null!=e)));var u;const c=new Set,s=new Set(l),a=[];At[o]||(At[o]=new WeakMap);const f=At[o];return l.forEach((function e(t){if(!t||c.has(t))return;c.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||s.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==p(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=(Lt.get(t)||0)+1,l=(f.get(t)||0)+1;Lt.set(t,r),f.set(t,l),a.push(t),1===r&&n&&Tt.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"true")}}))}(t),c.clear(),Pt++,()=>{a.forEach((e=>{const t=(Lt.get(e)||0)-1,n=(f.get(e)||0)-1;Lt.set(e,t),f.set(e,n),t||(!Tt.has(e)&&i&&e.removeAttribute(i),Tt.delete(e)),n||e.removeAttribute(o)})),Pt--,Pt||(Lt=new WeakMap,Lt=new WeakMap,Tt=new WeakSet,At={})}}function Mt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=H(e[0]).body;return Dt(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Nt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Ft(e,t){const n=Se(e,Nt());"prev"===t&&n.reverse();const r=n.indexOf(D(H(e)));return n.slice(r+1)[0]}function It(){return Ft(document.body,"next")}function Wt(){return Ft(document.body,"prev")}function jt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!M(n,r)}function Ht(e){Se(e,Nt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Bt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const Vt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function _t(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const qt=e.forwardRef((function(t,n){const[r,o]=e.useState();ct((()=>(/apple/i.test(navigator.vendor)&&o("button"),document.addEventListener("keydown",_t),()=>{document.removeEventListener("keydown",_t)})),[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":!r||void 0,[bt("focus-guard")]:"",style:Vt};return e.createElement("span",st({},t,i))})),Kt=e.createContext(null),Xt=bt("portal");const Ut=()=>e.useContext(Kt),Yt="data-floating-ui-focusable";let $t=[];function zt(e){$t=$t.filter((e=>e.isConnected)),e&&"body"!==p(e)&&($t.push(e),$t.length>20&&($t=$t.slice(-20)))}function Zt(){return $t.slice().reverse().find((e=>e.isConnected))}function Gt(e){const t=Nt();return function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==fe.call(e,se)&&Re(t,e)}(e,t)?e:Se(e,t)[0]}const Qt=e.forwardRef((function(t,n){return e.createElement("button",st({},t,{type:"button",ref:n,tabIndex:-1,style:Vt}))}));let Jt=0;let en=()=>{};const tn=e.forwardRef((function(t,n){const{lockScroll:r=!1,...o}=t;return ct((()=>{if(r)return Jt++,1===Jt&&(en=function(){const e=/iP(hone|ad|od)|iOS/.test(N()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,o=t.left?parseFloat(t.left):window.scrollX,i=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var l,u;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,n=(null==(u=window.visualViewport)?void 0:u.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(i-Math.floor(n))+"px",left:-(o-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(o,i))}}()),()=>{Jt--,0===Jt&&en()}}),[r]),e.createElement("div",st({ref:n},o,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}}))})),nn={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},rn={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},on=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function ln(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=pt(),l=e.useRef({}),[u]=e.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}())),c=null!=yt();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!h(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=mt)&&e.has(o)||(null==(i=mt)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),f=ut(((e,t,n)=>{l.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),d=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:l,open:n,onOpenChange:f,elements:p,events:u,floatingId:i,refs:d})),[n,f,p,u,i,d])}const un="active",cn="selected";function sn(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[un]:t,[cn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[Yt]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var l;o&&[un,cn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(l=r.get(n))||l.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}const an=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);var fn={Portal:function(t){const{children:n,id:r,root:o,preserveTabOrder:i=!0}=t,l=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=pt(),i=Ut(),[l,u]=e.useState(null),c=e.useRef(null);return ct((()=>()=>{null==l||l.remove(),queueMicrotask((()=>{c.current=null}))}),[l]),ct((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(Xt,""),e.appendChild(t),c.current=t,u(t)}),[n,o]),ct((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!h(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const l=document.createElement("div");l.id=o,l.setAttribute(Xt,""),e=t||e,e.appendChild(l),c.current=l,u(l)}),[n,r,o,i]),l}({id:r,root:o}),[u,s]=e.useState(null),a=e.useRef(null),f=e.useRef(null),d=e.useRef(null),p=e.useRef(null),m=null==u?void 0:u.modal,v=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!(!o&&!l);return e.useEffect((()=>{if(l&&i&&!m)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){if(l&&jt(e)){("focusin"===e.type?Bt:Ht)(l)}}}),[l,i,m]),e.useEffect((()=>{l&&(v||Bt(l))}),[v,l]),e.createElement(Kt.Provider,{value:e.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:l,setFocusManagerState:s})),[i,l])},g&&l&&e.createElement(qt,{"data-type":"outside",ref:a,onFocus:e=>{if(jt(e,l)){var t;null==(t=d.current)||t.focus()}else{const e=Wt()||(null==u?void 0:u.refs.domReference.current);null==e||e.focus()}}}),g&&l&&e.createElement("span",{"aria-owns":l.id,style:Vt}),l&&c.createPortal(n,l),g&&l&&e.createElement(qt,{"data-type":"outside",ref:f,onFocus:e=>{if(jt(e,l)){var t;null==(t=p.current)||t.focus()}else{const t=It()||(null==u?void 0:u.refs.domReference.current);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))},Overlay:tn,FocusManager:function(t){const{context:n,children:r,disabled:o=!1,order:i=["content"],guards:l=!0,initialFocus:u=0,returnFocus:c=!0,restoreFocus:s=!1,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:d=!0,outsideElementsInert:p=!1}=t,{open:m,refs:v,nodeId:g,onOpenChange:h,events:w,dataRef:b,elements:{domReference:x,floating:E}}=n,R="number"==typeof u&&u<0,C=q(x)&&R,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,S=!O||l,L=!S||O&&p,T=xt(i),A=xt(u),P=xt(c),k=wt(),N=Ut(),F=e.useRef(null),j=e.useRef(null),B=e.useRef(!1),K=e.useRef(!1),X=e.useRef(-1),U=null!=N,Y=($=E)?$.hasAttribute(Yt)?$:$.querySelector("["+Yt+"]")||$:null;var $;const z=ut((function(e){return void 0===e&&(e=Y),e?Se(e,Nt()):[]})),Z=ut((e=>{const t=z(e);return T.current.map((e=>x&&"reference"===e?x:Y&&"floating"===e?Y:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(o)return;if(!a)return;function e(e){if("Tab"===e.key){M(Y,D(H(Y)))&&0===z().length&&!C&&_(e);const t=Z(),n=V(e);"reference"===T.current[0]&&n===x&&(_(e),e.shiftKey?Ot(t[t.length-1]):Ot(t[1])),"floating"===T.current[1]&&n===Y&&e.shiftKey&&(_(e),Ot(t[0]))}}const t=H(Y);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[o,x,Y,a,T,C,z,Z]),e.useEffect((()=>{if(!o&&E)return E.addEventListener("focusin",e),()=>{E.removeEventListener("focusin",e)};function e(e){const t=V(e),n=z().indexOf(t);-1!==n&&(X.current=n)}}),[o,E,z]),e.useEffect((()=>{if(!o&&d)return E&&y(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),E.addEventListener("focusout",t),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),E.removeEventListener("focusout",t)}):void 0;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget;queueMicrotask((()=>{const n=!(M(x,t)||M(E,t)||M(t,E)||M(null==N?void 0:N.portalNode,t)||null!=t&&t.hasAttribute(bt("focus-guard"))||k&&(St(k.nodesRef.current,g).find((e=>{var n,r;return M(null==(n=e.context)?void 0:n.elements.floating,t)||M(null==(r=e.context)?void 0:r.elements.domReference,t)}))||function(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(k.nodesRef.current,g).find((e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t}))));if(s&&n&&D(H(Y))===H(Y).body){y(Y)&&Y.focus();const e=X.current,t=z(),n=t[e]||t[t.length-1]||Y;y(n)&&n.focus()}!C&&a||!t||!n||K.current||t===Zt()||(B.current=!0,h(!1,e,"focus-out"))}))}}),[o,x,E,Y,a,g,k,N,h,d,s,z,C]);const G=e.useRef(null),Q=e.useRef(null),J=ot([G,null==N?void 0:N.beforeInsideRef]),ee=ot([Q,null==N?void 0:N.afterInsideRef]);function te(t){return!o&&f&&a?e.createElement(Qt,{ref:"start"===t?F:j,onClick:e=>h(!1,e.nativeEvent)},"string"==typeof f?f:"Dismiss"):null}e.useEffect((()=>{var e;if(o)return;const t=Array.from((null==N||null==(e=N.portalNode)?void 0:e.querySelectorAll("["+bt("portal")+"]"))||[]);if(E){const e=[E,...t,F.current,j.current,G.current,Q.current,null==N?void 0:N.beforeOutsideRef.current,null==N?void 0:N.afterOutsideRef.current,T.current.includes("reference")||C?x:null].filter((e=>null!=e)),n=a||C?Mt(e,!L,L):Mt(e);return()=>{n()}}}),[o,x,E,a,T,N,C,S,L]),ct((()=>{if(o||!y(Y))return;const e=D(H(Y));queueMicrotask((()=>{const t=Z(Y),n=A.current,r=("number"==typeof n?t[n]:n.current)||Y,o=M(Y,e);R||o||!m||Ot(r,{preventScroll:r===Y})}))}),[o,m,Y,R,Z,A]),ct((()=>{if(o||!Y)return;let e=!1;const t=H(Y),n=D(t);let r=b.current.openEvent;function i(t){let{open:n,reason:o,event:i,nested:l}=t;n&&(r=i),"escape-key"===o&&v.domReference.current&&zt(v.domReference.current),["hover","safe-polygon"].includes(o)&&"mouseleave"===i.type&&(B.current=!0),"outside-press"===o&&(l?(B.current=!1,e=!0):B.current=!(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(W()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(i)||I(i)))}zt(n),w.on("openchange",i);const l=t.createElement("span");return l.setAttribute("tabindex","-1"),l.setAttribute("aria-hidden","true"),Object.assign(l.style,Vt),U&&x&&x.insertAdjacentElement("afterend",l),()=>{w.off("openchange",i);const n=D(t),o=M(E,n)||k&&St(k.nodesRef.current,g).some((e=>{var t;return M(null==(t=e.context)?void 0:t.elements.floating,n)}));(o||r&&["click","mousedown"].includes(r.type))&&v.domReference.current&&zt(v.domReference.current);const u="boolean"==typeof P.current?Zt()||l:P.current.current||l;queueMicrotask((()=>{const r=Gt(u);P.current&&!B.current&&y(r)&&(r===n||n===t.body||o)&&r.focus({preventScroll:e}),l.remove()}))}}),[o,E,Y,P,b,v,w,k,g,U,x]),e.useEffect((()=>{queueMicrotask((()=>{B.current=!1}))}),[o]),ct((()=>{if(!o&&N)return N.setFocusManagerState({modal:a,closeOnFocusOut:d,open:m,onOpenChange:h,refs:v}),()=>{N.setFocusManagerState(null)}}),[o,N,a,m,h,v,d]),ct((()=>{if(o)return;if(!Y)return;if("function"!=typeof MutationObserver)return;if(R)return;const e=()=>{const e=Y.getAttribute("tabindex"),t=z(),n=D(H(E)),r=t.indexOf(n);-1!==r&&(X.current=r),T.current.includes("floating")||n!==v.domReference.current&&0===t.length?"0"!==e&&Y.setAttribute("tabindex","0"):"-1"!==e&&Y.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(Y,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}}),[o,E,Y,v,T,z,R]);const ne=!o&&S&&(!a||!C)&&(U||a);return e.createElement(e.Fragment,null,ne&&e.createElement(qt,{"data-type":"inside",ref:J,onFocus:e=>{if(a){const e=Z();Ot("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(B.current=!1,jt(e,N.portalNode)){const e=It()||x;null==e||e.focus()}else{var t;null==(t=N.beforeOutsideRef.current)||t.focus()}}}),!C&&te("start"),r,te("end"),ne&&e.createElement(qt,{"data-type":"inside",ref:ee,onFocus:e=>{if(a)Ot(Z()[0]);else if(null!=N&&N.preserveTabOrder&&N.portalNode)if(d&&(B.current=!0),jt(e,N.portalNode)){const e=Wt()||x;null==e||e.focus()}else{var t;null==(t=N.afterOutsideRef.current)||t.focus()}}}))},useFloating:function(t){void 0===t&&(t={});const{nodeId:n}=t,r=ln({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,i=o.elements,[l,u]=e.useState(null),[s,a]=e.useState(null),f=(null==i?void 0:i.domReference)||l,d=e.useRef(null),p=wt();ct((()=>{f&&(d.current=f)}),[f]);const m=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:l,floating:u}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,p]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[m,v]=e.useState(o);Je(m,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==C.current&&(C.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==O.current&&(O.current=e,w(e))}),[]),E=l||g,R=u||y,C=e.useRef(null),O=e.useRef(null),S=e.useRef(d),L=null!=a,T=nt(a),A=nt(i),P=nt(f),k=e.useCallback((()=>{if(!C.current||!O.current)return;const e={placement:n,strategy:r,middleware:m};A.current&&(e.platform=A.current),Ge(C.current,O.current,e).then((e=>{const t={...e,isPositioned:!1!==P.current};D.current&&!Je(S.current,t)&&(S.current=t,c.flushSync((()=>{p(t)})))}))}),[m,n,r,A,P]);Qe((()=>{!1===f&&S.current.isPositioned&&(S.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const D=e.useRef(!1);Qe((()=>(D.current=!0,()=>{D.current=!1})),[]),Qe((()=>{if(E&&(C.current=E),R&&(O.current=R),E&&R){if(T.current)return T.current(E,R,k);k()}}),[E,R,k,T,L]);const M=e.useMemo((()=>({reference:C,floating:O,setReference:b,setFloating:x})),[b,x]),N=e.useMemo((()=>({reference:E,floating:R})),[E,R]),F=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!N.floating)return e;const t=tt(N.floating,d.x),n=tt(N.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...et(N.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,N.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:k,refs:M,elements:N,floatingStyles:F})),[d,k,M,N,F])}({...t,elements:{...i,...s&&{reference:s}}}),v=e.useCallback((e=>{const t=h(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;a(t),m.refs.setReference(t)}),[m.refs]),g=e.useCallback((e=>{(h(e)||null===e)&&(d.current=e,u(e)),(h(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!h(e))&&m.refs.setReference(e)}),[m.refs]),y=e.useMemo((()=>({...m.refs,setReference:g,setPositionReference:v,domReference:d})),[m.refs,g,v]),w=e.useMemo((()=>({...m.elements,domReference:f})),[m.elements,f]),b=e.useMemo((()=>({...m,...o,refs:y,elements:w,nodeId:n})),[m,y,w,n,o]);return ct((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...m,context:b,refs:y,elements:w})),[m,y,w,b])},Arrow:vt,arrow:(e,t)=>({...rt(e),options:[e,t]}),useRole:function(t,n){var r;void 0===n&&(n={});const{open:o,floatingId:i}=t,{enabled:l=!0,role:u="dialog"}=n,c=null!=(r=an.get(u))?r:u,s=pt(),a=null!=yt(),f=e.useMemo((()=>"tooltip"===c||"label"===u?{["aria-"+("label"===u?"labelledby":"describedby")]:o?i:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===c?"dialog":c,"aria-controls":o?i:void 0,..."listbox"===c&&{role:"combobox"},..."menu"===c&&{id:s},..."menu"===c&&a&&{role:"menuitem"},..."select"===u&&{"aria-autocomplete":"none"},..."combobox"===u&&{"aria-autocomplete":"list"}}),[c,i,a,o,s,u]),d=e.useMemo((()=>{const e={id:i,...c&&{role:c}};return"tooltip"===c||"label"===u?e:{...e,..."menu"===c&&{"aria-labelledby":s}}}),[c,i,s,u]),p=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:i+"-option"}};switch(u){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}}),[i,u]);return e.useMemo((()=>l?{reference:f,floating:d,item:p}:{}),[l,f,d,p])},useInteractions:function(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>sn(e,t,"reference")),n),l=e.useCallback((e=>sn(e,t,"floating")),r),u=e.useCallback((e=>sn(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:l,getItemProps:u})),[i,l,u])},useDismiss:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:l}=t,{enabled:u=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:v}=n,g=wt(),w=ut("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,x=e.useRef(!1),E=e.useRef(!1),{escapeKey:R,outsidePress:L}=on(m),{escapeKey:A,outsidePress:k}=on(v),D=e.useRef(!1),N=ut((e=>{var t;if(!r||!u||!c||"Escape"!==e.key)return;if(D.current)return;const n=null==(t=l.current.floatingContext)?void 0:t.nodeId,i=g?St(g.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),F=ut((e=>{var t;const n=()=>{var t;N(e),null==(t=V(e))||t.removeEventListener("keydown",n)};null==(t=V(e))||t.addEventListener("keydown",n)})),I=ut((e=>{var t;const n=x.current;x.current=!1;const r=E.current;if(E.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const u=V(e),c="["+bt("inert")+"]",s=H(i.floating).querySelectorAll(c);let f=h(u)?u:null;for(;f&&!O(f);){const e=T(f);if(O(e)||!h(e))break;f=e}if(s.length&&h(u)&&!u.matches("html,body")&&!M(u,i.floating)&&Array.from(s).every((e=>!M(f,e))))return;if(y(u)&&_){const t=O(u),n=S(u),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),l=o&&u.clientWidth>0&&u.scrollWidth>u.clientWidth,c=i&&u.clientHeight>0&&u.scrollHeight>u.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=u.offsetWidth-u.clientWidth:e.offsetX>u.clientWidth),f=l&&e.offsetY>u.clientHeight;if(a||f)return}const d=null==(t=l.current.floatingContext)?void 0:t.nodeId,p=g&&St(g.nodesRef.current,d).some((t=>{var n;return B(e,null==(n=t.context)?void 0:n.elements.floating)}));if(B(e,i.floating)||B(e,i.domReference)||p)return;const m=g?St(g.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),W=ut((e=>{var t;const n=()=>{var t;I(e),null==(t=V(e))||t.removeEventListener(a,n)};null==(t=V(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!u)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=L;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),D.current=!0}function s(){e=window.setTimeout((()=>{D.current=!1}),C()?5:0)}const f=H(i.floating);c&&(f.addEventListener("keydown",A?F:N,A),f.addEventListener("compositionstart",n),f.addEventListener("compositionend",s)),b&&f.addEventListener(a,k?W:I,k);let d=[];return p&&(h(i.domReference)&&(d=P(i.domReference)),h(i.floating)&&(d=d.concat(P(i.floating))),!h(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(P(i.reference.contextElement)))),d=d.filter((e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)})),d.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(f.removeEventListener("keydown",A?F:N,A),f.removeEventListener("compositionstart",n),f.removeEventListener("compositionend",s)),b&&f.removeEventListener(a,k?W:I,k),d.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[l,i,c,b,a,r,o,p,u,R,L,N,A,F,I,k,W]),e.useEffect((()=>{x.current=!1}),[b,a]);const j=e.useMemo((()=>({onKeyDown:N,...f&&{[nn[d]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[N,o,f,d]),_=e.useMemo((()=>({onKeyDown:N,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[rn[a]]:()=>{x.current=!0}})),[N,a]);return e.useMemo((()=>u?{reference:j,floating:_}:{}),[u,j,_])},useHover:function(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:l,elements:u}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=n,m=wt(),v=yt(),g=xt(a),y=xt(s),w=xt(r),b=e.useRef(),x=e.useRef(-1),E=e.useRef(),R=e.useRef(-1),C=e.useRef(!0),O=e.useRef(!1),S=e.useRef((()=>{})),L=e.useRef(!1),T=e.useCallback((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}),[i]);e.useEffect((()=>{if(c)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(x.current),clearTimeout(R.current),C.current=!0,L.current=!1)}}),[c,l]),e.useEffect((()=>{if(!c)return;if(!g.current)return;if(!r)return;function e(e){T()&&o(!1,e,"hover")}const t=H(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[u.floating,r,o,c,g,T]);const A=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=Rt(y.current,"close",b.current);r&&!E.current?(clearTimeout(x.current),x.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(clearTimeout(x.current),o(!1,e,n))}),[y,o]),P=ut((()=>{S.current(),E.current=void 0})),k=ut((()=>{if(O.current){const e=H(u.floating).body;e.style.pointerEvents="",e.removeAttribute(Et),O.current=!1}})),D=ut((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&h(u.domReference)){var e;const o=u.domReference;return r&&o.addEventListener("mouseleave",l),null==(e=u.floating)||e.addEventListener("mouseleave",l),p&&o.addEventListener("mousemove",t,{once:!0}),o.addEventListener("mouseenter",t),o.addEventListener("mouseleave",n),()=>{var e;r&&o.removeEventListener("mouseleave",l),null==(e=u.floating)||e.removeEventListener("mouseleave",l),p&&o.removeEventListener("mousemove",t),o.removeEventListener("mouseenter",t),o.removeEventListener("mouseleave",n)}}function t(e){if(clearTimeout(x.current),C.current=!1,f&&!j(b.current)||d>0&&!Rt(y.current,"open"))return;const t=Rt(y.current,"open",b.current);t?x.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function n(e){if(D())return;S.current();const t=H(u.floating);if(clearTimeout(R.current),L.current=!1,g.current&&i.current.floatingContext){r||clearTimeout(x.current),E.current=g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),D()||A(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==b.current||!M(u.floating,e.relatedTarget))&&A(e)}function l(e){D()||i.current.floatingContext&&(null==g.current||g.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){k(),P(),D()||A(e)}})(e))}}),[u,c,t,f,d,p,A,P,k,o,r,w,m,y,g,i,D]),ct((()=>{var e;if(c&&r&&null!=(e=g.current)&&e.__options.blockPointerEvents&&T()){O.current=!0;const e=u.floating;if(h(u.domReference)&&e){var t;const n=H(u.floating).body;n.setAttribute(Et,"");const r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find((e=>e.id===v)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,v,u,m,g,T]),ct((()=>{r||(b.current=void 0,L.current=!1,P(),k())}),[r,P,k]),e.useEffect((()=>()=>{P(),clearTimeout(x.current),clearTimeout(R.current),k()}),[c,u.domReference,P,k]);const N=e.useMemo((()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||w.current||o(!0,t,"hover")}f&&!j(b.current)||r||0===d||L.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(R.current),"touch"===b.current?n():(L.current=!0,R.current=window.setTimeout(n,d)))}}}),[f,o,r,w,d]),F=e.useMemo((()=>({onMouseEnter(){clearTimeout(x.current)},onMouseLeave(e){D()||A(e.nativeEvent,!1)}})),[A,D]);return e.useMemo((()=>c?{reference:N,floating:F}:{}),[c,N,F])},flip:(e,t)=>({...$e(e),options:[e,t]}),shift:(e,t)=>({...Ye(e),options:[e,t]}),hide:(e,t)=>({...ze(e),options:[e,t]}),offset:(e,t)=>({...Ue(e),options:[e,t]})},dn=function(e,t){if(void 0===e&&(e=""),void 0===t&&(t=""),e)return e;if(!t)return"";var n=t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(n)};function pn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=pn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function mn(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=pn(e))&&(r&&(r+=" "),r+=t);return r}var vn="HoverCard",gn=function(e){var n=e.children,r=e.open,o=void 0===r?void 0:r,u=e.onOpenChange,c=e.customRootClass,d=void 0===c?"":c,p=e.openDelay,m=void 0===p?100:p,v=e.closeDelay,g=void 0===v?200:v,h=a(e,["children","open","onOpenChange","customRootClass","openDelay","closeDelay"]),y=dn(d,vn),w=dn(d,"".concat(vn,"-trigger")),b=i(null),x=fn.useFloating({placement:"bottom",strategy:"fixed",middleware:[fn.arrow({element:b}),fn.offset(10),fn.flip({mainAxis:!0})]}),E=x.refs,R=x.floatingStyles,C=x.context,O=l(!1),S=O[0],L=O[1],T=l(!1);T[0];var A=T[1],P=void 0!==o,k=P?o:S,D=function(e){P||L(e),null==u||u(e)},M=fn.useRole(C),N=fn.useDismiss(C),F=fn.useHover(C,{delay:100}),I=fn.useInteractions([F,M,N]),W=I.getReferenceProps,j=I.getFloatingProps,H={isOpen:k,handleOpenChange:D,floatingRefs:E,floatingStyles:R,floatingContext:C,arrowRef:b,getReferenceProps:W,getFloatingProps:j,rootClass:y,rootTriggerClass:w,closeWithDelay:function(){A(!0),setTimeout((function(){A((function(e){return e&&D(!1),e}))}),g)},closeWithoutDelay:function(){D(!1)},openWithDelay:function(){A(!1),setTimeout((function(){D(!0)}),m)}};return t.createElement(f.Provider,{value:H},t.createElement("div",s({className:mn(y)},h),n))},hn=["div","span","button"].reduce((function(e,n){return e[n]=function(e){var n=t.forwardRef((function(n,r){var o=n.asChild,i=void 0!==o&&o,l=n.children,u=a(n,["asChild","children"]);return i&&t.isValidElement(l)?t.cloneElement(l,s(s({},u),{ref:r})):t.createElement(e,s(s({},u),{ref:r}),l)}));return n.displayName="Primitive.".concat(e),n}(n),e}),{}),yn=function(e){var n=e.children,r=e.className,o=void 0===r?"":r,i=a(e,["children","className"]),l=u(f),c=l.floatingRefs,d=l.closeWithDelay,p=l.openWithDelay,m=l.rootTriggerClass;return t.createElement(t.Fragment,null,t.createElement(hn.span,s({className:mn(m,o),onClick:function(){},onMouseEnter:p,onMouseLeave:d,ref:c.setReference},i),n))},wn=function(e){var n=e.children,r=e.rootElement,o=void 0===r?void 0:r,i=a(e,["children","rootElement"]),l=u(f).rootTriggerClass,c=o||document.getElementsByClassName(l)[0];return t.createElement(fn.Portal,s({root:c},i),n)},bn=function(e){var n=e.children,r=a(e,["children"]),i=u(f),l=i.isOpen,c=i.floatingRefs,d=i.floatingStyles,p=i.getFloatingProps,m=i.rootClass,v=i.closeWithDelay,g=i.closeWithoutDelay,h=i.openWithDelay;return o((function(){var e=function(){return g()};return window.addEventListener("scroll",e),function(){window.removeEventListener("scroll",e)}}),[g]),l?t.createElement("div",s({onPointerEnter:h,onPointerLeave:v,className:mn(m)},r,{ref:c.setFloating,style:d},p()),n):null},xn=function(e){var n=a(e,[]),r=u(f),o=r.floatingContext,i=r.arrowRef,l=r.rootClass;return t.createElement(fn.Arrow,s({className:mn("".concat(l,"-arrow"))},n,{context:o,ref:i}))},En=function(e){var n=e.children,r=e.onOpenChange,o=void 0===r?function(){}:r,i=e.content,l=void 0===i?void 0:i,u=e.customRootClass,c=void 0===u?"":u,f=e.openDelay,d=void 0===f?100:f,p=e.closeDelay,m=void 0===p?200:p,v=a(e,["children","onOpenChange","content","customRootClass","openDelay","closeDelay"]);return t.createElement(gn,s({open:void 0,onOpenChange:o,openDelay:d,closeDelay:m,customRootClass:c},v),t.createElement(yn,null,n),t.createElement(wn,null,t.createElement(bn,null,l,t.createElement(xn,null))))};export{En as default};
|
package/dist/components/Kbd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var
|
|
1
|
+
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;function t(r){var e,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(o=t(r[e]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}function o(){for(var r,e,o=0,n="",a=arguments.length;o<a;o++)(r=arguments[o])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}var n=function(t){var n=t.children,a=t.customRootClass,c=t.className,f=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}(t,["children","customRootClass","className"]),s=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)}(a,"Kbd");return r.createElement("kbd",e({className:o(s,c)},f),n)};export{n as default};
|
package/dist/components/Link.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var
|
|
1
|
+
'use client';import r from"react";var e=function(){return e=Object.assign||function(r){for(var e,t=1,o=arguments.length;t<o;t++)for(var n in e=arguments[t])Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},e.apply(this,arguments)};function t(r){var e,o,n="";if("string"==typeof r||"number"==typeof r)n+=r;else if("object"==typeof r)if(Array.isArray(r)){var a=r.length;for(e=0;e<a;e++)r[e]&&(o=t(r[e]))&&(n&&(n+=" "),n+=o)}else for(o in r)r[o]&&(n&&(n+=" "),n+=o);return n}function o(){for(var r,e,o=0,n="",a=arguments.length;o<a;o++)(r=arguments[o])&&(e=t(r))&&(n&&(n+=" "),n+=e);return n}"function"==typeof SuppressedError&&SuppressedError;var n="Link",a=function(t){var a=t.children,c=t.href,f=void 0===c?"#":c;t.alt;var i=t.customRootClass,l=t.className,s=function(r,e){var t={};for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&e.indexOf(o)<0&&(t[o]=r[o]);if(null!=r&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(o=Object.getOwnPropertySymbols(r);n<o.length;n++)e.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(r,o[n])&&(t[o[n]]=r[o[n]])}return t}(t,["children","href","alt","customRootClass","className"]),p=function(r,e){if(void 0===r&&(r=""),r)return r;var t=e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return"".concat("rad-ui","-").concat(t)}(i,n);return r.createElement("a",e({href:f,className:o(p,l)},s),a)};a.displayName=n;export{a as default};
|