UNPKG

digitinary-ui

Version:

Digitinary UI Library

2 lines 2.04 MB
/*! For license information please see index.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports["digitinary-ui"]=t(require("react"),require("react-dom")):e["digitinary-ui"]=t(e.react,e["react-dom"])}(self,(e,t)=>(()=>{var r,n,o={77422:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Composite:()=>Ar,CompositeItem:()=>Er,FloatingArrow:()=>Br,FloatingDelayGroup:()=>nn,FloatingFocusManager:()=>Pn,FloatingList:()=>vr,FloatingNode:()=>qr,FloatingOverlay:()=>Bn,FloatingPortal:()=>jn,FloatingTree:()=>Zr,NextFloatingDelayGroup:()=>sn,arrow:()=>hr,autoPlacement:()=>ur,autoUpdate:()=>Wt,computePosition:()=>$t,detectOverflow:()=>zt,flip:()=>lr,getOverflowAncestors:()=>O,hide:()=>pr,inline:()=>fr,inner:()=>yo,limitShift:()=>cr,offset:()=>ir,platform:()=>Ht,safePolygon:()=>_o,shift:()=>sr,size:()=>dr,useClick:()=>Wn,useClientPoint:()=>Vn,useDelayGroup:()=>on,useDelayGroupContext:()=>rn,useDismiss:()=>Un,useFloating:()=>Qn,useFloatingNodeId:()=>Gr,useFloatingParentNodeId:()=>zr,useFloatingPortalNode:()=>Cn,useFloatingRootContext:()=>Kn,useFloatingTree:()=>Vr,useFocus:()=>Jn,useHover:()=>$r,useId:()=>Nr,useInnerOffset:()=>vo,useInteractions:()=>eo,useListItem:()=>br,useListNavigation:()=>so,useMergeRefs:()=>mr,useNextDelayGroup:()=>cn,useRole:()=>lo,useTransitionStatus:()=>fo,useTransitionStyles:()=>ho,useTypeahead:()=>mo});var n=r(39155),o=r.t(n,2);function a(){return"undefined"!=typeof window}function i(e){return l(e)?(e.nodeName||"").toLowerCase():"#document"}function s(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function c(e){var t;return null==(t=(l(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function l(e){return!!a()&&(e instanceof Node||e instanceof s(e).Node)}function d(e){return!!a()&&(e instanceof Element||e instanceof s(e).Element)}function u(e){return!!a()&&(e instanceof HTMLElement||e instanceof s(e).HTMLElement)}function p(e){return!(!a()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof s(e).ShadowRoot)}const f=new Set(["inline","contents"]);function h(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!f.has(o)}const m=new Set(["table","td","th"]);function g(e){return m.has(i(e))}const y=[":popover-open",":modal"];function v(e){return y.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const b=["transform","translate","scale","rotate","perspective"],w=["transform","translate","scale","rotate","perspective","filter"],_=["paint","layout","strict","content"];function k(e){const t=x(),r=d(e)?j(e):e;return b.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||w.some(e=>(r.willChange||"").includes(e))||_.some(e=>(r.contain||"").includes(e))}function x(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const M=new Set(["html","body","#document"]);function C(e){return M.has(i(e))}function j(e){return s(e).getComputedStyle(e)}function D(e){return d(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function S(e){if("html"===i(e))return e;const t=e.assignedSlot||e.parentNode||p(e)&&e.host||c(e);return p(t)?t.host:t}function L(e){const t=S(e);return C(t)?e.ownerDocument?e.ownerDocument.body:e.body:u(t)&&h(t)?t:L(t)}function O(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=L(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=s(o);if(a){const e=T(i);return t.concat(i,i.visualViewport||[],h(o)?o:[],e&&r?O(e):[])}return t.concat(o,O(o,[],r))}function T(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const A=["top","right","bottom","left"],E=["start","end"],Y=A.reduce((e,t)=>e.concat(t,t+"-"+E[0],t+"-"+E[1]),[]),P=Math.min,I=Math.max,R=Math.round,N=Math.floor,B=e=>({x:e,y:e}),H={left:"right",right:"left",bottom:"top",top:"bottom"},F={start:"end",end:"start"};function W(e,t,r){return I(e,P(t,r))}function z(e,t){return"function"==typeof e?e(t):e}function V(e){return e.split("-")[0]}function G(e){return e.split("-")[1]}function q(e){return"x"===e?"y":"x"}function Z(e){return"y"===e?"height":"width"}const U=new Set(["top","bottom"]);function K(e){return U.has(V(e))?"y":"x"}function Q(e){return q(K(e))}function X(e,t,r){void 0===r&&(r=!1);const n=G(e),o=Q(e),a=Z(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=ne(i)),[i,ne(i)]}function J(e){return e.replace(/start|end/g,e=>F[e])}const $=["left","right"],ee=["right","left"],te=["top","bottom"],re=["bottom","top"];function ne(e){return e.replace(/left|right|bottom|top/g,e=>H[e])}function oe(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function ae(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}var ie=["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(","),se="undefined"==typeof Element,ce=se?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,le=!se&&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},de=function e(t,r){var n;void 0===r&&(r=!0);var o=null==t||null===(n=t.getAttribute)||void 0===n?void 0:n.call(t,"inert");return""===o||"true"===o||r&&t&&e(t.parentNode)},ue=function(e,t,r){if(de(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(ie));return t&&ce.call(e,ie)&&n.unshift(e),n.filter(r)},pe=function e(t,r,n){for(var o=[],a=Array.from(t);a.length;){var i=a.shift();if(!de(i,!1))if("SLOT"===i.tagName){var s=i.assignedElements(),c=e(s.length?s:i.children,!0,n);n.flatten?o.push.apply(o,c):o.push({scopeParent:i,candidates:c})}else{ce.call(i,ie)&&n.filter(i)&&(r||!t.includes(i))&&o.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),d=!de(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&d){var u=e(!0===l?i.children:l.children,!0,n);n.flatten?o.push.apply(o,u):o.push({scopeParent:i,candidates:u})}else a.unshift.apply(a,i.children)}}return o},fe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},he=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,r=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===r||"true"===r}(e))&&!fe(e)?0:e.tabIndex},me=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ge=function(e){return"INPUT"===e.tagName},ye=function(e){var t=e.getBoundingClientRect(),r=t.width,n=t.height;return 0===r&&0===n},ve=function(e,t){return!(t.disabled||de(t)||function(e){return ge(e)&&"hidden"===e.type}(t)||function(e,t){var r=t.displayCheck,n=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=ce.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ce.call(o,"details:not([open]) *"))return!0;if(r&&"full"!==r&&"legacy-full"!==r){if("non-zero-area"===r)return ye(e)}else{if("function"==typeof n){for(var a=e;e;){var i=e.parentElement,s=le(e);if(i&&!i.shadowRoot&&!0===n(i))return ye(e);e=e.assignedSlot?e.assignedSlot:i||s===e.ownerDocument?i:s.host}e=a}if(function(e){var t,r,n,o,a=e&&le(e),i=null===(t=a)||void 0===t?void 0:t.host,s=!1;if(a&&a!==e)for(s=!!(null!==(r=i)&&void 0!==r&&null!==(n=r.ownerDocument)&&void 0!==n&&n.contains(i)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&i;){var c,l,d;s=!(null===(l=i=null===(c=a=le(i))||void 0===c?void 0:c.host)||void 0===l||null===(d=l.ownerDocument)||void 0===d||!d.contains(i))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==r)return!0}return!1}(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 r=0;r<t.children.length;r++){var n=t.children.item(r);if("LEGEND"===n.tagName)return!!ce.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},be=function(e,t){return!(function(e){return function(e){return ge(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,r=e.form||le(e),n=function(e){return r.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=n(window.CSS.escape(e.name));else try{t=n(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 r=0;r<e.length;r++)if(e[r].checked&&e[r].form===t)return e[r]}(t,e.form);return!o||o===e}(e)}(t)||he(t)<0||!ve(e,t))},we=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},_e=function e(t){var r=[],n=[];return t.forEach(function(t,o){var a=!!t.scopeParent,i=a?t.scopeParent:t,s=function(e,t){var r=he(e);return r<0&&t&&!fe(e)?0:r}(i,a),c=a?e(t.candidates):i;0===s?a?r.push.apply(r,c):r.push(i):n.push({documentOrder:o,tabIndex:s,item:t,isScope:a,content:c})}),n.sort(me).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(r)},ke=function(e,t){var r;return r=(t=t||{}).getShadowRoot?pe([e],t.includeContainer,{filter:be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:we}):ue(e,t.includeContainer,be.bind(null,t)),_e(r)},xe=function(e,t){return(t=t||{}).getShadowRoot?pe([e],t.includeContainer,{filter:ve.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ue(e,t.includeContainer,ve.bind(null,t))},Me=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ce.call(e,ie)&&be(t,e)};function Ce(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function je(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:r}=e;return t+"/"+r}).join(" "):navigator.userAgent}function De(){return/apple/i.test(navigator.vendor)}function Se(){const e=/android/i;return e.test(Ce())||e.test(je())}function Le(){return je().includes("jsdom/")}const Oe="data-floating-ui-focusable",Te="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ae="ArrowLeft",Ee="ArrowRight",Ye="ArrowUp",Pe="ArrowDown";function Ie(e){let t=e.activeElement;for(;null!=(null==(r=t)||null==(r=r.shadowRoot)?void 0:r.activeElement);){var r;t=t.shadowRoot.activeElement}return t}function Re(e,t){if(!e||!t)return!1;const r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&p(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ne(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Be(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return null!=r.target&&t.contains(r.target)}function He(e){return(null==e?void 0:e.ownerDocument)||document}function Fe(e){return u(e)&&e.matches(Te)}function We(e){return!!e&&"combobox"===e.getAttribute("role")&&Fe(e)}function ze(e){return e?e.hasAttribute(Oe)?e:e.querySelector("["+Oe+"]")||e:null}function Ve(e,t,r){return void 0===r&&(r=!0),e.filter(e=>{var n;return e.parentId===t&&(!r||(null==(n=e.context)?void 0:n.open))}).flatMap(t=>[t,...Ve(e,t.id,r)])}function Ge(e,t){var r;let n=[],o=null==(r=e.find(e=>e.id===t))?void 0:r.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(n=n.concat(t))}return n}function qe(e){e.preventDefault(),e.stopPropagation()}function Ze(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Se()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Ue(e){return!Le()&&(!Se()&&0===e.width&&0===e.height||Se()&&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 Ke(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}var Qe="undefined"!=typeof document?n.useLayoutEffect:function(){};function Xe(e){const t=n.useRef(e);return Qe(()=>{t.current=e}),t}const Je={...o}.useInsertionEffect||(e=>e());function $e(e){const t=n.useRef(()=>{});return Je(()=>{t.current=e}),n.useCallback(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return null==t.current?void 0:t.current(...r)},[])}function et(e,t,r){return Math.floor(e/t)!==r}function tt(e,t){return t<0||t>=e.current.length}function rt(e,t){return ot(e,{disabledIndices:t})}function nt(e,t){return ot(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ot(e,t){let{startingIndex:r=-1,decrement:n=!1,disabledIndices:o,amount:a=1}=void 0===t?{}:t,i=r;do{i+=n?-a:a}while(i>=0&&i<=e.current.length-1&&lt(e,i,o));return i}function at(e,t){let{event:r,orientation:n,loop:o,rtl:a,cols:i,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:d,stopEvent:u=!1}=t,p=d;if(r.key===Ye){if(u&&qe(r),-1===d)p=l;else if(p=ot(e,{startingIndex:p,amount:i,decrement:!0,disabledIndices:s}),o&&(d-i<c||p<0)){const e=d%i,t=l%i,r=l-(t-e);p=t===e?l:t>e?r:r-i}tt(e,p)&&(p=d)}if(r.key===Pe&&(u&&qe(r),-1===d?p=c:(p=ot(e,{startingIndex:d,amount:i,disabledIndices:s}),o&&d+i>l&&(p=ot(e,{startingIndex:d%i-i,amount:i,disabledIndices:s}))),tt(e,p)&&(p=d)),"both"===n){const t=N(d/i);r.key===(a?Ae:Ee)&&(u&&qe(r),d%i!==i-1?(p=ot(e,{startingIndex:d,disabledIndices:s}),o&&et(p,i,t)&&(p=ot(e,{startingIndex:d-d%i-1,disabledIndices:s}))):o&&(p=ot(e,{startingIndex:d-d%i-1,disabledIndices:s})),et(p,i,t)&&(p=d)),r.key===(a?Ee:Ae)&&(u&&qe(r),d%i!==0?(p=ot(e,{startingIndex:d,decrement:!0,disabledIndices:s}),o&&et(p,i,t)&&(p=ot(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:s}))):o&&(p=ot(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:s})),et(p,i,t)&&(p=d));const n=N(l/i)===t;tt(e,p)&&(p=o&&n?r.key===(a?Ee:Ae)?l:ot(e,{startingIndex:d-d%i-1,disabledIndices:s}):d)}return p}function it(e,t,r){const n=[];let o=0;return e.forEach((e,a)=>{let{width:i,height:s}=e,c=!1;for(r&&(o=0);!c;){const e=[];for(let r=0;r<i;r++)for(let n=0;n<s;n++)e.push(o+r+n*t);o%t+i<=t&&e.every(e=>null==n[e])?(e.forEach(e=>{n[e]=a}),c=!0):o++}}),[...n]}function st(e,t,r,n,o){if(-1===e)return-1;const a=r.indexOf(e),i=t[e];switch(o){case"tl":return a;case"tr":return i?a+i.width-1:a;case"bl":return i?a+(i.height-1)*n:a;case"br":return r.lastIndexOf(e)}}function ct(e,t){return t.flatMap((t,r)=>e.includes(t)?[r]:[])}function lt(e,t,r){if("function"==typeof r)return r(t);if(r)return r.includes(t);const n=e.current[t];return null==n||n.hasAttribute("disabled")||"true"===n.getAttribute("aria-disabled")}const dt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ut(e,t){const r=ke(e,dt()),n=r.length;if(0===n)return;const o=Ie(He(e)),a=r.indexOf(o);return r[-1===a?1===t?0:n-1:a+t]}function pt(e){return ut(He(e).body,1)||e}function ft(e){return ut(He(e).body,-1)||e}function ht(e,t){const r=t||e.currentTarget,n=e.relatedTarget;return!n||!Re(r,n)}function mt(e){ke(e,dt()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function gt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var yt=r(74848),vt=r(69514);function bt(e,t,r){let{reference:n,floating:o}=e;const a=K(t),i=Q(t),s=Z(i),c=V(t),l="y"===a,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2;let f;switch(c){case"top":f={x:d,y:n.y-o.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-o.width,y:u};break;default:f={x:n.x,y:n.y}}switch(G(t)){case"start":f[i]-=p*(r&&l?-1:1);break;case"end":f[i]+=p*(r&&l?-1:1)}return f}async function wt(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=z(t,e),h=oe(f),m=s[p?"floating"===u?"reference":"floating":u],g=ae(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:d,strategy:c})),y="floating"===u?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},w=ae(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:c}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function _t(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function kt(e){return A.some(t=>e[t]>=0)}function xt(e){const t=P(...e.map(e=>e.left)),r=P(...e.map(e=>e.top));return{x:t,y:r,width:I(...e.map(e=>e.right))-t,height:I(...e.map(e=>e.bottom))-r}}const Mt=new Set(["left","top"]);function Ct(e){const t=j(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=u(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=R(r)!==a||R(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function jt(e){return d(e)?e:e.contextElement}function Dt(e){const t=jt(e);if(!u(t))return B(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Ct(t);let i=(a?R(r.width):r.width)/n,s=(a?R(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const St=B(0);function Lt(e){const t=s(e);return x()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:St}function Ot(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=jt(e);let i=B(1);t&&(n?d(n)&&(i=Dt(n)):i=Dt(e));const c=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==s(e))&&t}(a,r,n)?Lt(a):B(0);let l=(o.left+c.x)/i.x,u=(o.top+c.y)/i.y,p=o.width/i.x,f=o.height/i.y;if(a){const e=s(a),t=n&&d(n)?s(n):n;let r=e,o=T(r);for(;o&&n&&t!==r;){const e=Dt(o),t=o.getBoundingClientRect(),n=j(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,u*=e.y,p*=e.x,f*=e.y,l+=a,u+=i,r=s(o),o=T(r)}}return ae({width:p,height:f,x:l,y:u})}function Tt(e,t){const r=D(e).scrollLeft;return t?t.left+r:Ot(c(e)).left+r}function At(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-Tt(e,r),y:r.top+t.scrollTop}}const Et=new Set(["absolute","fixed"]);function Yt(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=s(e),n=c(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,l=0,d=0;if(o){a=o.width,i=o.height;const e=x();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,d=o.offsetTop)}const u=Tt(n);if(u<=0){const e=n.ownerDocument,t=e.body,r=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(r.marginLeft)+parseFloat(r.marginRight)||0,i=Math.abs(n.clientWidth-t.clientWidth-o);i<=25&&(a-=i)}else u<=25&&(a+=u);return{width:a,height:i,x:l,y:d}}(e,r);else if("document"===t)n=function(e){const t=c(e),r=D(e),n=e.ownerDocument.body,o=I(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=I(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Tt(e);const s=-r.scrollTop;return"rtl"===j(n).direction&&(i+=I(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(c(e));else if(d(t))n=function(e,t){const r=Ot(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=u(e)?Dt(e):B(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=Lt(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ae(n)}function Pt(e,t){const r=S(e);return!(r===t||!d(r)||C(r))&&("fixed"===j(r).position||Pt(r,t))}function It(e,t,r){const n=u(t),o=c(t),a="fixed"===r,s=Ot(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const d=B(0);function p(){d.x=Tt(o)}if(n||!n&&!a)if(("body"!==i(t)||h(o))&&(l=D(t)),n){const e=Ot(t,!0,a,t);d.x=e.x+t.clientLeft,d.y=e.y+t.clientTop}else o&&p();a&&!n&&o&&p();const f=!o||n||a?B(0):At(o,l);return{x:s.left+l.scrollLeft-d.x-f.x,y:s.top+l.scrollTop-d.y-f.y,width:s.width,height:s.height}}function Rt(e){return"static"===j(e).position}function Nt(e,t){if(!u(e)||"fixed"===j(e).position)return null;if(t)return t(e);let r=e.offsetParent;return c(e)===r&&(r=r.ownerDocument.body),r}function Bt(e,t){const r=s(e);if(v(e))return r;if(!u(e)){let t=S(e);for(;t&&!C(t);){if(d(t)&&!Rt(t))return t;t=S(t)}return r}let n=Nt(e,t);for(;n&&g(n)&&Rt(n);)n=Nt(n,t);return n&&C(n)&&Rt(n)&&!k(n)?r:n||function(e){let t=S(e);for(;u(t)&&!C(t);){if(k(t))return t;if(v(t))return null;t=S(t)}return null}(e)||r}const Ht={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,s=c(n),l=!!t&&v(t.floating);if(n===s||l&&a)return r;let d={scrollLeft:0,scrollTop:0},p=B(1);const f=B(0),m=u(n);if((m||!m&&!a)&&(("body"!==i(n)||h(s))&&(d=D(n)),u(n))){const e=Ot(n);p=Dt(n),f.x=e.x+n.clientLeft,f.y=e.y+n.clientTop}const g=!s||m||a?B(0):At(s,d);return{width:r.width*p.x,height:r.height*p.y,x:r.x*p.x-d.scrollLeft*p.x+f.x+g.x,y:r.y*p.y-d.scrollTop*p.y+f.y+g.y}},getDocumentElement:c,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?v(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=O(e,[],!1).filter(e=>d(e)&&"body"!==i(e)),o=null;const a="fixed"===j(e).position;let s=a?S(e):e;for(;d(s)&&!C(s);){const t=j(s),r=k(s);r||"fixed"!==t.position||(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&Et.has(o.position)||h(s)&&!r&&Pt(e,s))?n=n.filter(e=>e!==s):o=t,s=S(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=a[0],c=a.reduce((e,r)=>{const n=Yt(t,r,o);return e.top=I(n.top,e.top),e.right=P(n.right,e.right),e.bottom=P(n.bottom,e.bottom),e.left=I(n.left,e.left),e},Yt(t,s,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Bt,getElementRects:async function(e){const t=this.getOffsetParent||Bt,r=this.getDimensions,n=await r(e.floating);return{reference:It(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=Ct(e);return{width:t,height:r}},getScale:Dt,isElement:d,isRTL:function(e){return"rtl"===j(e).direction}};function Ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Wt(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,d=jt(e),u=o||a?[...d?O(d):[],...O(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const p=d&&s?function(e,t){let r,n=null;const o=c(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),a();const l=e.getBoundingClientRect(),{left:d,top:u,width:p,height:f}=l;if(s||t(),!p||!f)return;const h={rootMargin:-N(u)+"px "+-N(o.clientWidth-(d+p))+"px "+-N(o.clientHeight-(u+f))+"px "+-N(d)+"px",threshold:I(0,P(1,c))||1};let m=!0;function g(t){const n=t[0].intersectionRatio;if(n!==c){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==n||Ft(l,e.getBoundingClientRect())||i(),m=!1}try{n=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),a}(d,r):null;let f,h=-1,m=null;i&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),d&&!l&&m.observe(d),m.observe(t));let g=l?Ot(e):null;return l&&function t(){const n=Ot(e);g&&!Ft(g,n)&&r(),g=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==p||p(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const zt=wt,Vt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,c=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=V(r),s=G(r),c="y"===K(r),l=Mt.has(i)?-1:1,d=a&&c?-1:1,u=z(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof h&&(f="end"===s?-1*h:h),c?{x:f*d,y:p*l}:{x:p*l,y:f*d}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+c.x,y:a+c.y,data:{...c,placement:i}}}}},Gt=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var r,n,o;const{rects:a,middlewareData:i,placement:s,platform:c,elements:l}=t,{crossAxis:d=!1,alignment:u,allowedPlacements:p=Y,autoAlignment:f=!0,...h}=z(e,t),m=void 0!==u||p===Y?function(e,t,r){return(e?[...r.filter(t=>G(t)===e),...r.filter(t=>G(t)!==e)]:r.filter(e=>V(e)===e)).filter(r=>!e||G(r)===e||!!t&&J(r)!==r)}(u||null,f,p):p,g=await wt(t,h),y=(null==(r=i.autoPlacement)?void 0:r.index)||0,v=m[y];if(null==v)return{};const b=X(v,a,await(null==c.isRTL?void 0:c.isRTL(l.floating)));if(s!==v)return{reset:{placement:m[0]}};const w=[g[V(v)],g[b[0]],g[b[1]]],_=[...(null==(n=i.autoPlacement)?void 0:n.overflows)||[],{placement:v,overflows:w}],k=m[y+1];if(k)return{data:{index:y+1,overflows:_},reset:{placement:k}};const x=_.map(e=>{const t=G(e.placement);return[e.placement,t&&d?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),M=(null==(o=x.filter(e=>e[2].slice(0,G(e[0])?2:3).every(e=>e<=0))[0])?void 0:o[0])||x[0][0];return M!==s?{data:{index:y+1,overflows:_},reset:{placement:M}}:{}}}},qt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...c}=z(e,t),l={x:r,y:n},d=await wt(t,c),u=K(V(o)),p=q(u);let f=l[p],h=l[u];if(a){const e="y"===p?"bottom":"right";f=W(f+d["y"===p?"top":"left"],f,f-d[e])}if(i){const e="y"===u?"bottom":"right";h=W(h+d["y"===u?"top":"left"],h,h-d[e])}const m=s.fn({...t,[p]:f,[u]:h});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[u]:i}}}}}},Zt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:d=!0,crossAxis:u=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=z(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=V(o),v=K(s),b=V(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),_=p||(b||!m?[ne(s)]:function(e){const t=ne(e);return[J(e),t,J(t)]}(s)),k="none"!==h;!p&&k&&_.push(...function(e,t,r,n){const o=G(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?ee:$:t?$:ee;case"left":case"right":return t?te:re;default:return[]}}(V(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(J)))),a}(s,m,h,w));const x=[s,..._],M=await wt(t,g),C=[];let j=(null==(n=a.flip)?void 0:n.overflows)||[];if(d&&C.push(M[y]),u){const e=X(o,i,w);C.push(M[e[0]],M[e[1]])}if(j=[...j,{placement:o,overflows:C}],!C.every(e=>e<=0)){var D,S;const e=((null==(D=a.flip)?void 0:D.index)||0)+1,t=x[e];if(t&&("alignment"!==u||v===K(t)||j.every(e=>K(e.placement)!==v||e.overflows[0]>0)))return{data:{index:e,overflows:j},reset:{placement:t}};let r=null==(S=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!r)switch(f){case"bestFit":{var L;const e=null==(L=j.filter(e=>{if(k){const t=K(e.placement);return t===v||"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:L[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Ut=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:c=()=>{},...l}=z(e,t),d=await wt(t,l),u=V(o),p=G(o),f="y"===K(o),{width:h,height:m}=a.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g="end"===p?"top":"bottom");const v=m-d.top-d.bottom,b=h-d.left-d.right,w=P(m-d[g],v),_=P(h-d[y],b),k=!t.middlewareData.shift;let x=w,M=_;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(M=b),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(x=v),k&&!p){const e=I(d.left,0),t=I(d.right,0),r=I(d.top,0),n=I(d.bottom,0);f?M=h-2*(0!==e||0!==t?e+t:I(d.left,d.right)):x=m-2*(0!==r||0!==n?r+n:I(d.top,d.bottom))}await c({...t,availableWidth:M,availableHeight:x});const C=await i.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},Kt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=z(e,t);switch(n){case"referenceHidden":{const e=_t(await wt(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:kt(e)}}}case"escaped":{const e=_t(await wt(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:kt(e)}}}default:return{}}}}},Qt=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:c}=t,{element:l,padding:d=0}=z(e,t)||{};if(null==l)return{};const u=oe(d),p={x:r,y:n},f=Q(o),h=Z(f),m=await i.getDimensions(l),g="y"===f,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[f]-p[f]-a.floating[h],_=p[f]-a.reference[f],k=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l));let x=k?k[b]:0;x&&await(null==i.isElement?void 0:i.isElement(k))||(x=s.floating[b]||a.floating[h]);const M=w/2-_/2,C=x/2-m[h]/2-1,j=P(u[y],C),D=P(u[v],C),S=j,L=x-m[h]-D,O=x/2-m[h]/2+M,T=W(S,O,L),A=!c.arrow&&null!=G(o)&&O!==T&&a.reference[h]/2-(O<S?j:D)-m[h]/2<0,E=A?O<S?O-S:O-L:0;return{[f]:p[f]+E,data:{[f]:T,centerOffset:O-T-E,...A&&{alignmentOffset:E}},reset:A}}}),Xt=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:a,strategy:i}=t,{padding:s=2,x:c,y:l}=z(e,t),d=Array.from(await(null==a.getClientRects?void 0:a.getClientRects(n.reference))||[]),u=function(e){const t=e.slice().sort((e,t)=>e.y-t.y),r=[];let n=null;for(let e=0;e<t.length;e++){const o=t[e];!n||o.y-n.y>n.height/2?r.push([o]):r[r.length-1].push(o),n=o}return r.map(e=>ae(xt(e)))}(d),p=ae(xt(d)),f=oe(s),h=await a.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=c&&null!=l)return u.find(e=>c>e.left-f.left&&c<e.right+f.right&&l>e.top-f.top&&l<e.bottom+f.bottom)||p;if(u.length>=2){if("y"===K(r)){const e=u[0],t=u[u.length-1],n="top"===V(r),o=e.top,a=t.bottom,i=n?e.left:t.left,s=n?e.right:t.right;return{top:o,bottom:a,left:i,right:s,width:s-i,height:a-o,x:i,y:o}}const e="left"===V(r),t=I(...u.map(e=>e.right)),n=P(...u.map(e=>e.left)),o=u.filter(r=>e?r.left===n:r.right===t),a=o[0].top,i=o[o.length-1].bottom;return{top:a,bottom:i,left:n,right:t,width:t-n,height:i-a,x:n,y:a}}return p}},floating:n.floating,strategy:i});return o.reference.x!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Jt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=z(e,t),d={x:r,y:n},u=K(o),p=q(u);let f=d[p],h=d[u];const m=z(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+g.mainAxis,r=a.reference[p]+a.reference[e]-g.mainAxis;f<t?f=t:f>r&&(f=r)}if(l){var y,v;const e="y"===p?"width":"height",t=Mt.has(V(o)),r=a.reference[u]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[u])||0)+(t?0:g.crossAxis),n=a.reference[u]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[u])||0)-(t?g.crossAxis:0);h<r?h=r:h>n&&(h=n)}return{[p]:f,[u]:h}}}},$t=(e,t,r)=>{const n=new Map,o={platform:Ht,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:u}=bt(l,n,c),p=n,f={},h=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:g,y,data:v,reset:b}=await m({x:d,y:u,initialPlacement:n,placement:p,strategy:o,middlewareData:f,rects:l,platform:i,elements:{reference:e,floating:t}});d=null!=g?g:d,u=null!=y?y:u,f={...f,[a]:{...f[a],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(l=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:d,y:u}=bt(l,p,c))),r=-1)}return{x:d,y:u,placement:p,strategy:o,middlewareData:f}})(e,t,{...o,platform:a})};var er="undefined"!=typeof document?n.useLayoutEffect:function(){};function tr(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 r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!tr(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||tr(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function rr(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function nr(e,t){const r=rr(e);return Math.round(t*r)/r}function or(e){const t=n.useRef(e);return er(()=>{t.current=e}),t}const ar=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&(o=r,{}.hasOwnProperty.call(o,"current"))?null!=r.current?Qt({element:r.current,padding:n}).fn(t):{}:r?Qt({element:r,padding:n}).fn(t):{};var o}}),ir=(e,t)=>({...Vt(e),options:[e,t]}),sr=(e,t)=>({...qt(e),options:[e,t]}),cr=(e,t)=>({...Jt(e),options:[e,t]}),lr=(e,t)=>({...Zt(e),options:[e,t]}),dr=(e,t)=>({...Ut(e),options:[e,t]}),ur=(e,t)=>({...Gt(e),options:[e,t]}),pr=(e,t)=>({...Kt(e),options:[e,t]}),fr=(e,t)=>({...Xt(e),options:[e,t]}),hr=(e,t)=>({...ar(e),options:[e,t]});function mr(e){const t=n.useRef(void 0),r=n.useCallback(t=>{const r=e.map(e=>{if(null!=e){if("function"==typeof e){const r=e,n=r(t);return"function"==typeof n?n:()=>{r(null)}}return e.current=t,()=>{e.current=null}}});return()=>{r.forEach(e=>null==e?void 0:e())}},e);return n.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=r(e))},e)}function gr(e,t){const r=e.compareDocumentPosition(t);return r&Node.DOCUMENT_POSITION_FOLLOWING||r&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:r&Node.DOCUMENT_POSITION_PRECEDING||r&Node.DOCUMENT_POSITION_CONTAINS?1:0}const yr=n.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function vr(e){const{children:t,elementsRef:r,labelsRef:o}=e,[a,i]=n.useState(()=>new Set),s=n.useCallback(e=>{i(t=>new Set(t).add(e))},[]),c=n.useCallback(e=>{i(t=>{const r=new Set(t);return r.delete(e),r})},[]),l=n.useMemo(()=>{const e=new Map;return Array.from(a.keys()).sort(gr).forEach((t,r)=>{e.set(t,r)}),e},[a]);return(0,yt.jsx)(yr.Provider,{value:n.useMemo(()=>({register:s,unregister:c,map:l,elementsRef:r,labelsRef:o}),[s,c,l,r,o]),children:t})}function br(e){void 0===e&&(e={});const{label:t}=e,{register:r,unregister:o,map:a,elementsRef:i,labelsRef:s}=n.useContext(yr),[c,l]=n.useState(null),d=n.useRef(null),u=n.useCallback(e=>{if(d.current=e,null!==c&&(i.current[c]=e,s)){var r;const n=void 0!==t;s.current[c]=n?t:null!=(r=null==e?void 0:e.textContent)?r:null}},[c,i,s,t]);return Qe(()=>{const e=d.current;if(e)return r(e),()=>{o(e)}},[r,o]),Qe(()=>{const e=d.current?a.get(d.current):null;null!=e&&l(e)},[a]),n.useMemo(()=>({ref:u,index:null==c?-1:c}),[c,u])}const wr="data-floating-ui-focusable",_r="active",kr="selected",xr="ArrowLeft",Mr="ArrowRight",Cr="ArrowUp",jr="ArrowDown";function Dr(e,t){return"function"==typeof e?e(t):e?n.cloneElement(e,t):(0,yt.jsx)("div",{...t})}const Sr=n.createContext({activeIndex:0,onNavigate:()=>{}}),Lr=[xr,Mr],Or=[Cr,jr],Tr=[...Lr,...Or],Ar=n.forwardRef(function(e,t){const{render:r,orientation:o="both",loop:a=!0,rtl:i=!1,cols:s=1,disabledIndices:c,activeIndex:l,onNavigate:d,itemSizes:u,dense:p=!1,...f}=e,[h,m]=n.useState(0),g=null!=l?l:h,y=$e(null!=d?d:m),v=n.useRef([]),b=r&&"function"!=typeof r?r.props:{},w=n.useMemo(()=>({activeIndex:g,onNavigate:y}),[g,y]),_=s>1,k={...f,...b,ref:t,"aria-orientation":"both"===o?void 0:o,onKeyDown(e){null==f.onKeyDown||f.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!Tr.includes(e.key))return;let t=g;const r=rt(v,c),n=nt(v,c),l=i?xr:Mr,d=i?Mr:xr;if(_){const d=u||Array.from({length:v.current.length},()=>({width:1,height:1})),f=it(d,s,p),h=f.findIndex(e=>null!=e&&!lt(v,e,c)),m=f.reduce((e,t,r)=>null==t||lt(v,t,c)?e:r,-1),y=f[at({current:f.map(e=>e?v.current[e]:null)},{event:e,orientation:o,loop:a,rtl:i,cols:s,disabledIndices:ct([...("function"!=typeof c?c:null)||v.current.map((e,t)=>lt(v,t,c)?t:void 0),void 0],f),minIndex:h,maxIndex:m,prevIndex:st(g>n?r:g,d,f,s,e.key===jr?"bl":e.key===l?"tr":"tl")})];null!=y&&(t=y)}const f={horizontal:[l],vertical:[jr],both:[l,jr]}[o],h={horizontal:[d],vertical:[Cr],both:[d,Cr]}[o],m=_?Tr:{horizontal:Lr,vertical:Or,both:Tr}[o];var b;t===g&&[...f,...h].includes(e.key)&&(t=a&&t===n&&f.includes(e.key)?r:a&&t===r&&h.includes(e.key)?n:ot(v,{startingIndex:t,decrement:h.includes(e.key),disabledIndices:c})),t===g||tt(v,t)||(e.stopPropagation(),m.includes(e.key)&&e.preventDefault(),y(t),null==(b=v.current[t])||b.focus())}(e)}};return(0,yt.jsx)(Sr.Provider,{value:w,children:(0,yt.jsx)(vr,{elementsRef:v,children:Dr(r,k)})})}),Er=n.forwardRef(function(e,t){const{render:r,...o}=e,a=r&&"function"!=typeof r?r.props:{},{activeIndex:i,onNavigate:s}=n.useContext(Sr),{ref:c,index:l}=br(),d=mr([c,t,a.ref]),u=i===l;return Dr(r,{...o,...a,ref:d,tabIndex:u?0:-1,"data-active":u?"":void 0,onFocus(e){null==o.onFocus||o.onFocus(e),null==a.onFocus||a.onFocus(e),s(l)}})}),Yr={...n};let Pr=!1,Ir=0;const Rr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Ir++,Nr=Yr.useId||function(){const[e,t]=n.useState(()=>Pr?Rr():void 0);return Qe(()=>{null==e&&t(Rr())},[]),n.useEffect(()=>{Pr=!0},[]),e},Br=n.forwardRef(function(e,t){const{context:{placement:r,elements:{floating:o},middlewareData:{arrow:a,shift:i}},width:s=14,height:c=7,tipRadius:l=0,strokeWidth:d=0,staticOffset:u,stroke:p,d:f,style:{transform:h,...m}={},...g}=e,y=Nr(),[v,b]=n.useState(!1);if(Qe(()=>{o&&"rtl"===j(o).direction&&b(!0)},[o]),!o)return null;const[w,_]=r.split("-"),k="top"===w||"bottom"===w;let x=u;(k&&null!=i&&i.x||!k&&null!=i&&i.y)&&(x=null);const M=2*d,C=M/2,D=s/2*(l/-8+1),S=c/2*l/4,L=!!f,O=x&&"end"===_?"bottom":"top";let T=x&&"end"===_?"right":"left";x&&v&&(T="end"===_?"left":"right");const A=null!=(null==a?void 0:a.x)?x||a.x:"",E=null!=(null==a?void 0:a.y)?x||a.y:"",Y=f||"M0,0 H"+s+" L"+(s-D)+","+(c-S)+" Q"+s/2+","+c+" "+D+","+(c-S)+" Z",P={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,yt.jsxs)("svg",{...g,"aria-hidden":!0,ref:t,width:L?s:s+M,height:s,viewBox:"0 0 "+s+" "+(c>s?c:s),style:{position:"absolute",pointerEvents:"none",[T]:A,[O]:E,[w]:k||L?"100%":"calc(100% - "+M/2+"px)",transform:[P,h].filter(e=>!!e).join(" "),...m},children:[M>0&&(0,yt.jsx)("path",{clipPath:"url(#"+y+")",fill:"none",stroke:p,strokeWidth:M+(f?0:1),d:Y}),(0,yt.jsx)("path",{stroke:M&&!f?g.fill:"none",d:Y}),(0,yt.jsx)("clipPath",{id:y,children:(0,yt.jsx)("rect",{x:-C,y:C*(L?-1:1),width:s+M,height:s})})]})});function Hr(){const e=new Map;return{emit(t,r){var n;null==(n=e.get(t))||n.forEach(e=>e(r))},on(t,r){e.has(t)||e.set(t,new Set),e.get(t).add(r)},off(t,r){var n;null==(n=e.get(t))||n.delete(r)}}}const Fr=n.createContext(null),Wr=n.createContext(null),zr=()=>{var e;return(null==(e=n.useContext(Fr))?void 0:e.id)||null},Vr=()=>n.useContext(Wr);function Gr(e){const t=Nr(),r=Vr(),n=zr(),o=e||n;return Qe(()=>{if(!t)return;const e={id:t,parentId:o};return null==r||r.addNode(e),()=>{null==r||r.removeNode(e)}},[r,t,o]),t}function qr(e){const{children:t,id:r}=e,o=zr();return(0,yt.jsx)(Fr.Provider,{value:n.useMemo(()=>({id:r,parentId:o}),[r,o]),children:t})}function Zr(e){const{children:t}=e,r=n.useRef([]),o=n.useCallback(e=>{r.current=[...r.current,e]},[]),a=n.useCallback(e=>{r.current=r.current.filter(t=>t!==e)},[]),[i]=n.useState(()=>Hr());return(0,yt.jsx)(Wr.Provider,{value:n.useMemo(()=>({nodesRef:r,addNode:o,removeNode:a,events:i}),[o,a,i]),children:t})}function Ur(e){return"data-floating-ui-"+e}function Kr(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Qr=Ur("safe-polygon");function Xr(e,t,r){if(r&&!Ke(r))return 0;if("number"==typeof e)return e;if("function"==typeof e){const r=e();return"number"==typeof r?r:null==r?void 0:r[t]}return null==e?void 0:e[t]}function Jr(e){return"function"==typeof e?e():e}function $r(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,dataRef:a,events:i,elements:s}=e,{enabled:c=!0,delay:l=0,handleClose:u=null,mouseOnly:p=!1,restMs:f=0,move:h=!0}=t,m=Vr(),g=zr(),y=Xe(u),v=Xe(l),b=Xe(r),w=Xe(f),_=n.useRef(),k=n.useRef(-1),x=n.useRef(),M=n.useRef(-1),C=n.useRef(!0),j=n.useRef(!1),D=n.useRef(()=>{}),S=n.useRef(!1),L=$e(()=>{var e;const t=null==(e=a.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});n.useEffect(()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(Kr(k),Kr(M),C.current=!0,S.current=!1)}},[c,i]),n.useEffect(()=>{if(!c)return;if(!y.current)return;if(!r)return;function e(e){L()&&o(!1,e,"hover")}const t=He(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[s.floating,r,o,c,y,L]);const O=n.useCallback(function(e,t,r){void 0===t&&(t=!0),void 0===r&&(r="hover");const n=Xr(v.current,"close",_.current);n&&!x.current?(Kr(k),k.current=window.setTimeout(()=>o(!1,e,r),n)):t&&(Kr(k),o(!1,e,r))},[v,o]),T=$e(()=>{D.current(),x.current=void 0}),A=$e(()=>{if(j.current){const e=He(s.floating).body;e.style.pointerEvents="",e.removeAttribute(Qr),j.current=!1}}),E=$e(()=>!!a.current.openEvent&&["click","mousedown"].includes(a.current.openEvent.type));n.useEffect(()=>{if(c&&d(s.domReference)){const o=s.domReference,a=s.floating;return r&&o.addEventListener("mouseleave",n),h&&o.addEventListener("mousemove",e,{once:!0}),o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),a&&(a.addEventListener("mouseleave",n),a.addEventListener("mouseenter",i),a.addEventListener("mouseleave",l)),()=>{r&&o.removeEventListener("mouseleave",n),h&&o.removeEventListener("mousemove",e),o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),a&&(a.removeEventListener("mouseleave",n),a.removeEventListener("mouseenter",i),a.removeEventListener("mouseleave",l))}}function e(e){if(Kr(k),C.current=!1,p&&!Ke(_.current)||Jr(w.current)>0&&!Xr(v.current,"open"))return;const t=Xr(v.current,"open",_.current);t?k.current=window.setTimeout(()=>{b.current||o(!0,e,"hover")},t):r||o(!0,e,"hover")}function t(e){if(E())return void A();D.current();const t=He(s.floating);if(Kr(M),S.current=!1,y.current&&a.current.floatingContext){r||Kr(k),x.current=y.current({...a.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),T(),E()||O(e,!0,"safe-polygon")}});const n=x.current;return t.addEventListener("mousemove",n),void(D.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==_.current||!Re(s.floating,e.relatedTarget))&&O(e)}function n(e){E()||a.current.floatingContext&&(null==y.current||y.current({...a.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){A(),T(),E()||O(e)}})(e))}function i(){Kr(k)}function l(e){E()||O(e,!1)}},[s,c,e,p,h,O,T,A,o,r,b,m,v,y,a,E,w]),Qe(()=>{var e;if(c&&r&&null!=(e=y.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&L()){j.current=!0;const e=s.floating;if(d(s.domReference)&&e){var t;const r=He(s.floating).body;r.setAttribute(Qr,"");const n=s.domReference,o=null==m||null==(t=m.nodesRef.current.find(e=>e.id===g))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),r.style.pointerEvents="none",n.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{r.style.pointerEvents="",n.style.pointerEvents="",e.style.pointerEvents=""}}}},[c,r,g,s,m,y,L]),Qe(()=>{r||(_.current=void 0,S.current=!1,T(),A())},[r,T,A]),n.useEffect(()=>()=>{T(),Kr(k),Kr(M),A()},[c,s.domReference,T,A]);const Y=n.useMemo(()=>{function e(e){_.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){C.current||b.current||o(!0,t,"hover")}p&&!Ke(_.current)||r||0===Jr(w.current)||S.current&&e.movementX**2+e.movementY**2<2||(Kr(M),"touch"===_.current?n():(S.current=!0,M.current=window.setTimeout(n,Jr(w.current))))}}},[p,o,r,b,w]);return n.useMemo(()=>c?{reference:Y}:{},[c,Y])}const en=()=>{},tn=n.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:en,setState:en,isInstantPhase:!1}),rn=()=>n.useContext(tn);function nn(e){const{children:t,delay:r,timeoutMs:o=0}=e,[a,i]=n.useReducer((e,t)=>({...e,...t}),{delay:r,timeoutMs:o,initialDelay:r,currentId:null,isInstantPhase:!1}),s=n.useRef(null),c=n.useCallback(e=>{i({currentId:e})},[]);return Qe(()=>{a.currentId?null===s.current?s.current=a.currentId:a.isInstantPhase||i({isInstantPhase:!0}):(a.isInstantPhase&&i({isInstantPhase:!1}),s.current=null)},[a.currentId,a.isInstantPhase]),(0,yt.jsx)(tn.Provider,{value:n.useMemo(()=>({...a,setState:i,setCurrentId:c}),[a,c]),children:t})}function on(e,t){void 0===t&&(t={});const{open:r,onOpenChange:n,floatingId:o}=e,{id:a,enabled:i=!0}=t,s=null!=a?a:o,c=rn(),{currentId:l,setCurrentId:d,initialDelay:u,setState:p,timeoutMs:f}=c;return Qe(()=>{i&&l&&(p({delay:{open:1,close:Xr(u,"close")}}),l!==s&&n(!1))},[i,s,n,p,l,u]),Qe(()=>{function e(){n(!1),p({delay:u,currentId:null})}if(i&&l&&!r&&l===s){if(f){const t=window.setTimeout(e,f);return()=>{clearTimeout(t)}}e()}},[i,r,p,l,s,n,u,f]),Qe(()=>{i&&d!==en&&r&&d(s)},[i,r,d,s]),c}const an=n.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeoutIdRef:{current:-1},currentIdRef:{current:null},currentContextRef:{current:null}});function sn(e){const{children:t,delay:r,timeoutMs:o=0}=e,a=n.useRef(r),i=n.useRef(r),s=n.useRef(null),c=n.useRef(null),l=n.useRef(-1);return(0,yt.jsx)(an.Provider,{value:n.useMemo(()=>({hasProvider:!0,delayRef:a,initialDelayRef:i,currentIdRef:s,timeoutMs:o,currentContextRef:c,timeoutIdRef:l}),[o]),children:t})}function cn(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,floatingId:a}=e,{enabled:i=!0}=t,s=n.useContext(an),{currentIdRef:c,delayRef:l,timeoutMs:d,initialDelayRef:u,currentContextRef:p,hasProvider:f,timeoutIdRef:h}=s,[m,g]=n.useState(!1);return Qe(()=>{function e(){var e;g(!1),null==(e=p.current)||e.setIsInstantPhase(!1),c.current=null,p.current=null,l.current=u.current}if(i&&c.current&&!r&&c.current===a){if(g(!1),d)return h.current=window.setTimeout(e,d),()=>{clearTimeout(h.current)};e()}},[i,r,a,c,l,d,u,p,h]),Qe(()=>{if(!i)return;if(!r)return;const e=p.current,t=c.current;p.current={onOpenChange:o,setIsInstantPhase:g},c.current=a,l.current={open:0,close:Xr(u.current,"close")},null!==t&&t!==a?(Kr(h),g(!0),null==e||e.setIsInstantPhase(!0),null==e||e.onOpenChange(!1)):(g(!1),null==e||e.setIsInstantPhase(!1))},[i,r,a,o,c,l,d,u,p,h]),Qe(()=>()=>{p.current=null},[p]),n.useMemo(()=>({hasProvider:f,delayRef:l,isInstantPhase:m}),[f,l,m])}let ln=0;function dn(e,t){void 0===t&&(t={});const{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(ln);const a=()=>null==e?void 0:e.focus({preventScroll:r});o?a():ln=requestAnimationFrame(a)}function un(e,t){if(!e||!t)return!1;const r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&p(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}const pn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function fn(e){return"inert"===e?pn.inert:"aria-hidden"===e?pn["aria-hidden"]:pn.none}let hn=new WeakSet,mn={},gn=0;const yn=()=>"undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,vn=e=>e&&(e.host||v