UNPKG

digitinary-ui

Version:

Digitinary UI Library

2 lines 2.15 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:()=>mr,CompositeItem:()=>gr,FloatingArrow:()=>kr,FloatingDelayGroup:()=>Br,FloatingFocusManager:()=>yn,FloatingList:()=>tr,FloatingNode:()=>Lr,FloatingOverlay:()=>_n,FloatingPortal:()=>ln,FloatingTree:()=>Or,NextFloatingDelayGroup:()=>Wr,arrow:()=>Jt,autoPlacement:()=>Zt,autoUpdate:()=>Pt,computePosition:()=>$t,detectOverflow:()=>Et,flip:()=>Gt,getOverflowAncestors:()=>D,hide:()=>qt,inline:()=>Kt,inner:()=>Jn,limitShift:()=>Vt,offset:()=>Wt,platform:()=>Ot,safePolygon:()=>to,shift:()=>zt,size:()=>Ut,useClick:()=>Mn,useClientPoint:()=>jn,useDelayGroup:()=>Hr,useDelayGroupContext:()=>Rr,useDismiss:()=>On,useFloating:()=>Pn,useFloatingNodeId:()=>Sr,useFloatingParentNodeId:()=>jr,useFloatingPortalNode:()=>cn,useFloatingRootContext:()=>Tn,useFloatingTree:()=>Dr,useFocus:()=>An,useHover:()=>Yr,useId:()=>_r,useInnerOffset:()=>Xn,useInteractions:()=>Yn,useListItem:()=>rr,useListNavigation:()=>Fn,useMergeRefs:()=>Xt,useNextDelayGroup:()=>zr,useRole:()=>zn,useTransitionStatus:()=>Un,useTransitionStyles:()=>Zn,useTypeahead:()=>qn});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 f(e){return!(!a()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof s(e).ShadowRoot)}function p(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=x(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&"inline"!==o&&"contents"!==o}function h(e){return/^(table|td|th)$/.test(i(e))}function m(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const g=/transform|translate|scale|rotate|perspective|filter/,y=/paint|layout|strict|content/,v=e=>!!e&&"none"!==e;let b;function w(e){const t=d(e)?x(e):e;return v(t.transform)||v(t.translate)||v(t.scale)||v(t.rotate)||v(t.perspective)||!_()&&(v(t.backdropFilter)||v(t.filter))||g.test(t.willChange||"")||y.test(t.contain||"")}function _(){return null==b&&(b="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),b}function k(e){return/^(html|body|#document)$/.test(i(e))}function x(e){return s(e).getComputedStyle(e)}function M(e){return d(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function C(e){if("html"===i(e))return e;const t=e.assignedSlot||e.parentNode||f(e)&&e.host||c(e);return f(t)?t.host:t}function j(e){const t=C(e);return k(t)?e.ownerDocument?e.ownerDocument.body:e.body:u(t)&&p(t)?t:j(t)}function D(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=j(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=s(o);if(a){const e=S(i);return t.concat(i,i.visualViewport||[],p(o)?o:[],e&&r?D(e):[])}return t.concat(o,D(o,[],r))}function S(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const L=["top","right","bottom","left"],O=["start","end"],T=L.reduce((e,t)=>e.concat(t,t+"-"+O[0],t+"-"+O[1]),[]),P=Math.min,E=Math.max,A=Math.round,I=Math.floor,Y=e=>({x:e,y:e}),$={left:"right",right:"left",bottom:"top",top:"bottom"};function N(e,t,r){return E(e,P(t,r))}function R(e,t){return"function"==typeof e?e(t):e}function B(e){return e.split("-")[0]}function H(e){return e.split("-")[1]}function F(e){return"x"===e?"y":"x"}function W(e){return"y"===e?"height":"width"}function z(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function V(e){return F(z(e))}function G(e,t,r){void 0===r&&(r=!1);const n=H(e),o=V(e),a=W(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=X(i)),[i,X(i)]}function U(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Z=["left","right"],q=["right","left"],K=["top","bottom"],J=["bottom","top"];function X(e){const t=B(e);return $[t]+e.slice(t.length)}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 ee(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 te=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),re="undefined"==typeof Element,ne=re?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,oe=!re&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},ae=function(e,t){var r;void 0===t&&(t=!0);var n=null==e||null===(r=e.getAttribute)||void 0===r?void 0:r.call(e,"inert");return""===n||"true"===n||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):ae(e.parentNode))},ie=function(e,t,r){if(ae(e))return[];var n=Array.prototype.slice.apply(e.querySelectorAll(te));return t&&ne.call(e,te)&&n.unshift(e),n.filter(r)},se=function(e,t,r){for(var n=[],o=Array.from(e);o.length;){var a=o.shift();if(!ae(a,!1))if("SLOT"===a.tagName){var i=a.assignedElements(),s=i.length?i:a.children,c=se(s,!0,r);r.flatten?n.push.apply(n,c):n.push({scopeParent:a,candidates:c})}else{ne.call(a,te)&&r.filter(a)&&(t||!e.includes(a))&&n.push(a);var l=a.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(a),d=!ae(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(a));if(l&&d){var u=se(!0===l?a.children:l.children,!0,r);r.flatten?n.push.apply(n,u):n.push({scopeParent:a,candidates:u})}else o.unshift.apply(o,a.children)}}return n},ce=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},le=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))&&!ce(e)?0:e.tabIndex},de=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ue=function(e){return"INPUT"===e.tagName},fe=function(e){var t=e.getBoundingClientRect(),r=t.width,n=t.height;return 0===r&&0===n},pe=function(e,t){return!(t.disabled||function(e){return ue(e)&&"hidden"===e.type}(t)||function(e,t){var r=t.displayCheck,n=t.getShadowRoot;if("full-native"===r&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var o=ne.call(e,"details>summary:first-of-type")?e.parentElement:e;if(ne.call(o,"details:not([open]) *"))return!0;if(r&&"full"!==r&&"full-native"!==r&&"legacy-full"!==r){if("non-zero-area"===r)return fe(e)}else{if("function"==typeof n){for(var a=e;e;){var i=e.parentElement,s=oe(e);if(i&&!i.shadowRoot&&!0===n(i))return fe(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&&oe(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=oe(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!!ne.call(t,"fieldset[disabled] *")||!n.contains(e)}return!0}t=t.parentElement}return!1}(t))},he=function(e,t){return!(function(e){return function(e){return ue(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,r=e.form||oe(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)||le(t)<0||!pe(e,t))},me=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},ge=function(e){var t=[],r=[];return e.forEach(function(e,n){var o=!!e.scopeParent,a=o?e.scopeParent:e,i=function(e,t){var r=le(e);return r<0&&t&&!ce(e)?0:r}(a,o),s=o?ge(e.candidates):a;0===i?o?t.push.apply(t,s):t.push(a):r.push({documentOrder:n,tabIndex:i,item:e,isScope:o,content:s})}),r.sort(de).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ye=function(e,t){var r;return r=(t=t||{}).getShadowRoot?se([e],t.includeContainer,{filter:he.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:me}):ie(e,t.includeContainer,he.bind(null,t)),ge(r)},ve=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==ne.call(e,te)&&he(t,e)};function be(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function we(){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 _e(){return/apple/i.test(navigator.vendor)}function ke(){const e=/android/i;return e.test(be())||e.test(we())}function xe(){return we().includes("jsdom/")}const Me="data-floating-ui-focusable",Ce="ArrowLeft",je="ArrowRight";function De(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 Se(e,t){if(!e||!t)return!1;const r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&f(r)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Le(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Oe(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 Te(e){return(null==e?void 0:e.ownerDocument)||document}function Pe(e){return u(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ee(e){return!!e&&"combobox"===e.getAttribute("role")&&Pe(e)}function Ae(e){return e?e.hasAttribute(Me)?e:e.querySelector("["+Me+"]")||e:null}function Ie(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,...Ie(e,t.id,r)])}function Ye(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 $e(e){e.preventDefault(),e.stopPropagation()}function Ne(e){return!(0!==e.mozInputSource||!e.isTrusted)||(ke()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Re(e){return!xe()&&(!ke()&&0===e.width&&0===e.height||ke()&&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 Be(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}var He="undefined"!=typeof document?n.useLayoutEffect:function(){};function Fe(e){const t=n.useRef(e);return He(()=>{t.current=e}),t}const We={...o}.useInsertionEffect||(e=>e());function ze(e){const t=n.useRef(()=>{});return We(()=>{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 Ve(e,t,r){return Math.floor(e/t)!==r}function Ge(e,t){return t<0||t>=e.current.length}function Ue(e,t){return qe(e,{disabledIndices:t})}function Ze(e,t){return qe(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function qe(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&&et(e,i,o));return i}function Ke(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,f=d;if("ArrowUp"===r.key){if(u&&$e(r),-1===d)f=l;else if(f=qe(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:s}),o&&(d-i<c||f<0)){const e=d%i,t=l%i,r=l-(t-e);f=t===e?l:t>e?r:r-i}Ge(e,f)&&(f=d)}if("ArrowDown"===r.key&&(u&&$e(r),-1===d?f=c:(f=qe(e,{startingIndex:d,amount:i,disabledIndices:s}),o&&d+i>l&&(f=qe(e,{startingIndex:d%i-i,amount:i,disabledIndices:s}))),Ge(e,f)&&(f=d)),"both"===n){const t=I(d/i);r.key===(a?Ce:je)&&(u&&$e(r),d%i!==i-1?(f=qe(e,{startingIndex:d,disabledIndices:s}),o&&Ve(f,i,t)&&(f=qe(e,{startingIndex:d-d%i-1,disabledIndices:s}))):o&&(f=qe(e,{startingIndex:d-d%i-1,disabledIndices:s})),Ve(f,i,t)&&(f=d)),r.key===(a?je:Ce)&&(u&&$e(r),d%i!==0?(f=qe(e,{startingIndex:d,decrement:!0,disabledIndices:s}),o&&Ve(f,i,t)&&(f=qe(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:s}))):o&&(f=qe(e,{startingIndex:d+(i-d%i),decrement:!0,disabledIndices:s})),Ve(f,i,t)&&(f=d));const n=I(l/i)===t;Ge(e,f)&&(f=o&&n?r.key===(a?je:Ce)?l:qe(e,{startingIndex:d-d%i-1,disabledIndices:s}):d)}return f}function Je(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 Xe(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 Qe(e,t){return t.flatMap((t,r)=>e.includes(t)?[r]:[])}function et(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 tt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function rt(e,t){const r=ye(e,tt()),n=r.length;if(0===n)return;const o=De(Te(e)),a=r.indexOf(o);return r[-1===a?1===t?0:n-1:a+t]}function nt(e){return rt(Te(e).body,1)||e}function ot(e){return rt(Te(e).body,-1)||e}function at(e,t){const r=t||e.currentTarget,n=e.relatedTarget;return!n||!Se(r,n)}function it(e){ye(e,tt()).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")})}var ct=r(74848),lt=r(69514);function dt(e,t,r){let{reference:n,floating:o}=e;const a=z(t),i=V(t),s=W(i),c=B(t),l="y"===a,d=n.x+n.width/2-o.width/2,u=n.y+n.height/2-o.height/2,f=n[s]/2-o[s]/2;let p;switch(c){case"top":p={x:d,y:n.y-o.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:u};break;case"left":p={x:n.x-o.width,y:u};break;default:p={x:n.x,y:n.y}}switch(H(t)){case"start":p[i]-=f*(r&&l?-1:1);break;case"end":p[i]+=f*(r&&l?-1:1)}return p}async function ut(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:f=!1,padding:p=0}=R(t,e),h=Q(p),m=s[f?"floating"===u?"reference":"floating":u],g=ee(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=ee(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 ft(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function pt(e){return L.some(t=>e[t]>=0)}function ht(e){const t=P(...e.map(e=>e.left)),r=P(...e.map(e=>e.top));return{x:t,y:r,width:E(...e.map(e=>e.right))-t,height:E(...e.map(e=>e.bottom))-r}}const mt=new Set(["left","top"]);function gt(e){const t=x(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=A(r)!==a||A(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function yt(e){return d(e)?e:e.contextElement}function vt(e){const t=yt(e);if(!u(t))return Y(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=gt(t);let i=(a?A(r.width):r.width)/n,s=(a?A(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const bt=Y(0);function wt(e){const t=s(e);return _()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:bt}function _t(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=yt(e);let i=Y(1);t&&(n?d(n)&&(i=vt(n)):i=vt(e));const c=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==s(e))&&t}(a,r,n)?wt(a):Y(0);let l=(o.left+c.x)/i.x,u=(o.top+c.y)/i.y,f=o.width/i.x,p=o.height/i.y;if(a){const e=s(a),t=n&&d(n)?s(n):n;let r=e,o=S(r);for(;o&&n&&t!==r;){const e=vt(o),t=o.getBoundingClientRect(),n=x(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,f*=e.x,p*=e.y,l+=a,u+=i,r=s(o),o=S(r)}}return ee({width:f,height:p,x:l,y:u})}function kt(e,t){const r=M(e).scrollLeft;return t?t.left+r:_t(c(e)).left+r}function xt(e,t){const r=e.getBoundingClientRect();return{x:r.left+t.scrollLeft-kt(e,r),y:r.top+t.scrollTop}}function Mt(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=_();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,d=o.offsetTop)}const u=kt(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=M(e),n=e.ownerDocument.body,o=E(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=E(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+kt(e);const s=-r.scrollTop;return"rtl"===x(n).direction&&(i+=E(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=_t(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=u(e)?vt(e):Y(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=wt(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return ee(n)}function Ct(e,t){const r=C(e);return!(r===t||!d(r)||k(r))&&("fixed"===x(r).position||Ct(r,t))}function jt(e,t,r){const n=u(t),o=c(t),a="fixed"===r,s=_t(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const d=Y(0);function f(){d.x=kt(o)}if(n||!n&&!a)if(("body"!==i(t)||p(o))&&(l=M(t)),n){const e=_t(t,!0,a,t);d.x=e.x+t.clientLeft,d.y=e.y+t.clientTop}else o&&f();a&&!n&&o&&f();const h=!o||n||a?Y(0):xt(o,l);return{x:s.left+l.scrollLeft-d.x-h.x,y:s.top+l.scrollTop-d.y-h.y,width:s.width,height:s.height}}function Dt(e){return"static"===x(e).position}function St(e,t){if(!u(e)||"fixed"===x(e).position)return null;if(t)return t(e);let r=e.offsetParent;return c(e)===r&&(r=r.ownerDocument.body),r}function Lt(e,t){const r=s(e);if(m(e))return r;if(!u(e)){let t=C(e);for(;t&&!k(t);){if(d(t)&&!Dt(t))return t;t=C(t)}return r}let n=St(e,t);for(;n&&h(n)&&Dt(n);)n=St(n,t);return n&&k(n)&&Dt(n)&&!w(n)?r:n||function(e){let t=C(e);for(;u(t)&&!k(t);){if(w(t))return t;if(m(t))return null;t=C(t)}return null}(e)||r}const Ot={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,s=c(n),l=!!t&&m(t.floating);if(n===s||l&&a)return r;let d={scrollLeft:0,scrollTop:0},f=Y(1);const h=Y(0),g=u(n);if((g||!g&&!a)&&(("body"!==i(n)||p(s))&&(d=M(n)),g)){const e=_t(n);f=vt(n),h.x=e.x+n.clientLeft,h.y=e.y+n.clientTop}const y=!s||g||a?Y(0):xt(s,d);return{width:r.width*f.x,height:r.height*f.y,x:r.x*f.x-d.scrollLeft*f.x+h.x+y.x,y:r.y*f.y-d.scrollTop*f.y+h.y+y.y}},getDocumentElement:c,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?m(t)?[]:function(e,t){const r=t.get(e);if(r)return r;let n=D(e,[],!1).filter(e=>d(e)&&"body"!==i(e)),o=null;const a="fixed"===x(e).position;let s=a?C(e):e;for(;d(s)&&!k(s);){const t=x(s),r=w(s);r||"fixed"!==t.position||(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||p(s)&&!r&&Ct(e,s))?n=n.filter(e=>e!==s):o=t,s=C(s)}return t.set(e,n),n}(t,this._c):[].concat(r),n],s=Mt(t,a[0],o);let c=s.top,l=s.right,u=s.bottom,f=s.left;for(let e=1;e<a.length;e++){const r=Mt(t,a[e],o);c=E(r.top,c),l=P(r.right,l),u=P(r.bottom,u),f=E(r.left,f)}return{width:l-f,height:u-c,x:f,y:c}},getOffsetParent:Lt,getElementRects:async function(e){const t=this.getOffsetParent||Lt,r=this.getDimensions,n=await r(e.floating);return{reference:jt(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}=gt(e);return{width:t,height:r}},getScale:vt,isElement:d,isRTL:function(e){return"rtl"===x(e).direction}};function Tt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Pt(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=yt(e),u=o||a?[...d?D(d):[],...t?D(t):[]]:[];u.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const f=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:f,height:p}=l;if(s||t(),!f||!p)return;const h={rootMargin:-I(u)+"px "+-I(o.clientWidth-(d+f))+"px "+-I(o.clientHeight-(u+p))+"px "+-I(d)+"px",threshold:E(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||Tt(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 p,h=-1,m=null;i&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===d&&m&&t&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),d&&!l&&m.observe(d),t&&m.observe(t));let g=l?_t(e):null;return l&&function t(){const n=_t(e);g&&!Tt(g,n)&&r(),g=n,p=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,l&&cancelAnimationFrame(p)}}const Et=ut,At=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:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=R(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=B(o),v=z(s),b=B(s)===s,w=await(null==c.isRTL?void 0:c.isRTL(l.floating)),_=f||(b||!m?[X(s)]:function(e){const t=X(e);return[U(e),t,U(t)]}(s)),k="none"!==h;!f&&k&&_.push(...function(e,t,r,n){const o=H(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?q:Z:t?Z:q;case"left":case"right":return t?K:J;default:return[]}}(B(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(U)))),a}(s,m,h,w));const x=[s,..._],M=await c.detectOverflow(t,g),C=[];let j=(null==(n=a.flip)?void 0:n.overflows)||[];if(d&&C.push(M[y]),u){const e=G(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===z(t)||j.every(e=>z(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(p){case"bestFit":{var L;const e=null==(L=j.filter(e=>{if(k){const t=z(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{}}}},It=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}=R(e,t)||{};if(null==l)return{};const u=Q(d),f={x:r,y:n},p=V(o),h=W(p),m=await i.getDimensions(l),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],_=f[p]-a.reference[p],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=N(S,O,L),E=!c.arrow&&null!=H(o)&&O!==T&&a.reference[h]/2-(O<S?j:D)-m[h]/2<0,A=E?O<S?O-S:O-L:0;return{[p]:f[p]+A,data:{[p]:T,centerOffset:O-T-A,...E&&{alignmentOffset:A}},reset:E}}}),Yt=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}=R(e,t),d={x:r,y:n},u=z(o),f=F(u);let p=d[f],h=d[u];const m=R(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(c){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,r=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>r&&(p=r)}if(l){var y,v;const e="y"===f?"width":"height",t=mt.has(B(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{[f]:p,[u]:h}}}},$t=(e,t,r)=>{const n=new Map,o={platform:Ot,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=i.detectOverflow?i:{...i,detectOverflow:ut},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}=dt(l,n,c),f=n,p=0;const h={};for(let r=0;r<a.length;r++){const m=a[r];if(!m)continue;const{name:g,fn:y}=m,{x:v,y:b,data:w,reset:_}=await y({x:d,y:u,initialPlacement:n,placement:f,strategy:o,middlewareData:h,rects:l,platform:s,elements:{reference:e,floating:t}});d=null!=v?v:d,u=null!=b?b:u,h[g]={...h[g],...w},_&&p<50&&(p++,"object"==typeof _&&(_.placement&&(f=_.placement),_.rects&&(l=!0===_.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):_.rects),({x:d,y:u}=dt(l,f,c))),r=-1)}return{x:d,y:u,placement:f,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var Nt="undefined"!=typeof document?n.useLayoutEffect:function(){};function Rt(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(!Rt(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||Rt(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function Bt(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ht(e,t){const r=Bt(e);return Math.round(t*r)/r}function Ft(e){const t=n.useRef(e);return Nt(()=>{t.current=e}),t}const Wt=(e,t)=>{const r=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=B(r),s=H(r),c="y"===z(r),l=mt.has(i)?-1:1,d=a&&c?-1:1,u=R(t,e);let{mainAxis:f,crossAxis:p,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&&(p="end"===s?-1*h:h),c?{x:p*d,y:f*l}:{x:f*l,y:p*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}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}},zt=(e,t)=>{const r=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o,platform:a}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=R(e,t),d={x:r,y:n},u=await a.detectOverflow(t,l),f=z(B(o)),p=F(f);let h=d[p],m=d[f];if(i){const e="y"===p?"bottom":"right";h=N(h+u["y"===p?"top":"left"],h,h-u[e])}if(s){const e="y"===f?"bottom":"right";m=N(m+u["y"===f?"top":"left"],m,m-u[e])}const g=c.fn({...t,[p]:h,[f]:m});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:i,[f]:s}}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}},Vt=(e,t)=>({fn:Yt(e).fn,options:[e,t]}),Gt=(e,t)=>{const r=At(e);return{name:r.name,fn:r.fn,options:[e,t]}},Ut=(e,t)=>{const r=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}=R(e,t),d=await i.detectOverflow(t,l),u=B(o),f=H(o),p="y"===z(o),{width:h,height:m}=a.floating;let g,y;"top"===u||"bottom"===u?(g=u,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=u,g="end"===f?"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&&!f){const e=E(d.left,0),t=E(d.right,0),r=E(d.top,0),n=E(d.bottom,0);p?M=h-2*(0!==e||0!==t?e+t:E(d.left,d.right)):x=m-2*(0!==r||0!==n?r+n:E(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}}:{}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}},Zt=(e,t)=>{const r=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:f=T,autoAlignment:p=!0,...h}=R(e,t),m=void 0!==u||f===T?function(e,t,r){return(e?[...r.filter(t=>H(t)===e),...r.filter(t=>H(t)!==e)]:r.filter(e=>B(e)===e)).filter(r=>!e||H(r)===e||!!t&&U(r)!==r)}(u||null,p,f):f,g=await c.detectOverflow(t,h),y=(null==(r=i.autoPlacement)?void 0:r.index)||0,v=m[y];if(null==v)return{};const b=G(v,a,await(null==c.isRTL?void 0:c.isRTL(l.floating)));if(s!==v)return{reset:{placement:m[0]}};const w=[g[B(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=H(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,H(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}}:{}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}},qt=(e,t)=>{const r=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:o="referenceHidden",...a}=R(e,t);switch(o){case"referenceHidden":{const e=ft(await n.detectOverflow(t,{...a,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:pt(e)}}}case"escaped":{const e=ft(await n.detectOverflow(t,{...a,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:pt(e)}}}default:return{}}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}},Kt=(e,t)=>{const r=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}=R(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=>ee(ht(e)))}(d),f=ee(ht(d)),p=Q(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-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(u.length>=2){if("y"===z(r)){const e=u[0],t=u[u.length-1],n="top"===B(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"===B(r),t=E(...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 f}},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}}:{}}}}(e);return{name:r.name,fn:r.fn,options:[e,t]}},Jt=(e,t)=>{const r=(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?It({element:r.current,padding:n}).fn(t):{}:r?It({element:r,padding:n}).fn(t):{};var o}}))(e);return{name:r.name,fn:r.fn,options:[e,t]}};function Xt(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 Qt(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 er=n.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function tr(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(Qt).forEach((t,r)=>{e.set(t,r)}),e},[a]);return(0,ct.jsx)(er.Provider,{value:n.useMemo(()=>({register:s,unregister:c,map:l,elementsRef:r,labelsRef:o}),[s,c,l,r,o]),children:t})}function rr(e){void 0===e&&(e={});const{label:t}=e,{register:r,unregister:o,map:a,elementsRef:i,labelsRef:s}=n.useContext(er),[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 He(()=>{const e=d.current;if(e)return r(e),()=>{o(e)}},[r,o]),He(()=>{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 nr="data-floating-ui-focusable",or="active",ar="selected",ir="ArrowLeft",sr="ArrowRight",cr="ArrowUp",lr="ArrowDown";function dr(e,t){return"function"==typeof e?e(t):e?n.cloneElement(e,t):(0,ct.jsx)("div",{...t})}const ur=n.createContext({activeIndex:0,onNavigate:()=>{}}),fr=[ir,sr],pr=[cr,lr],hr=[...fr,...pr],mr=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:f=!1,...p}=e,[h,m]=n.useState(0),g=null!=l?l:h,y=ze(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={...p,...b,ref:t,"aria-orientation":"both"===o?void 0:o,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!hr.includes(e.key))return;let t=g;const r=Ue(v,c),n=Ze(v,c),l=i?ir:sr,d=i?sr:ir;if(_){const d=u||Array.from({length:v.current.length},()=>({width:1,height:1})),p=Je(d,s,f),h=p.findIndex(e=>null!=e&&!et(v,e,c)),m=p.reduce((e,t,r)=>null==t||et(v,t,c)?e:r,-1),y=p[Ke({current:p.map(e=>e?v.current[e]:null)},{event:e,orientation:o,loop:a,rtl:i,cols:s,disabledIndices:Qe([...("function"!=typeof c?c:null)||v.current.map((e,t)=>et(v,t,c)?t:void 0),void 0],p),minIndex:h,maxIndex:m,prevIndex:Xe(g>n?r:g,d,p,s,e.key===lr?"bl":e.key===l?"tr":"tl")})];null!=y&&(t=y)}const p={horizontal:[l],vertical:[lr],both:[l,lr]}[o],h={horizontal:[d],vertical:[cr],both:[d,cr]}[o],m=_?hr:{horizontal:fr,vertical:pr,both:hr}[o];var b;t===g&&[...p,...h].includes(e.key)&&(t=a&&t===n&&p.includes(e.key)?r:a&&t===r&&h.includes(e.key)?n:qe(v,{startingIndex:t,decrement:h.includes(e.key),disabledIndices:c})),t===g||Ge(v,t)||(e.stopPropagation(),m.includes(e.key)&&e.preventDefault(),y(t),null==(b=v.current[t])||b.focus())}(e)}};return(0,ct.jsx)(ur.Provider,{value:w,children:(0,ct.jsx)(tr,{elementsRef:v,children:dr(r,k)})})}),gr=n.forwardRef(function(e,t){const{render:r,...o}=e,a=r&&"function"!=typeof r?r.props:{},{activeIndex:i,onNavigate:s}=n.useContext(ur),{ref:c,index:l}=rr(),d=Xt([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 vr=!1,br=0;const wr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+br++,_r=yr.useId||function(){const[e,t]=n.useState(()=>vr?wr():void 0);return He(()=>{null==e&&t(wr())},[]),n.useEffect(()=>{vr=!0},[]),e},kr=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:f,d:p,style:{transform:h,...m}={},...g}=e,y=_r(),[v,b]=n.useState(!1);if(He(()=>{o&&"rtl"===x(o).direction&&b(!0)},[o]),!o)return null;const[w,_]=r.split("-"),k="top"===w||"bottom"===w;let M=u;(k&&null!=i&&i.x||!k&&null!=i&&i.y)&&(M=null);const C=2*d,j=C/2,D=s/2*(l/-8+1),S=c/2*l/4,L=!!p,O=M&&"end"===_?"bottom":"top";let T=M&&"end"===_?"right":"left";M&&v&&(T="end"===_?"left":"right");const P=null!=(null==a?void 0:a.x)?M||a.x:"",E=null!=(null==a?void 0:a.y)?M||a.y:"",A=p||"M0,0 H"+s+" L"+(s-D)+","+(c-S)+" Q"+s/2+","+c+" "+D+","+(c-S)+" Z",I={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,ct.jsxs)("svg",{...g,"aria-hidden":!0,ref:t,width:L?s:s+C,height:s,viewBox:"0 0 "+s+" "+(c>s?c:s),style:{position:"absolute",pointerEvents:"none",[T]:P,[O]:E,[w]:k||L?"100%":"calc(100% - "+C/2+"px)",transform:[I,h].filter(e=>!!e).join(" "),...m},children:[C>0&&(0,ct.jsx)("path",{clipPath:"url(#"+y+")",fill:"none",stroke:f,strokeWidth:C+(p?0:1),d:A}),(0,ct.jsx)("path",{stroke:C&&!p?g.fill:"none",d:A}),(0,ct.jsx)("clipPath",{id:y,children:(0,ct.jsx)("rect",{x:-j,y:j*(L?-1:1),width:s+C,height:s})})]})});function xr(){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 Mr=n.createContext(null),Cr=n.createContext(null),jr=()=>{var e;return(null==(e=n.useContext(Mr))?void 0:e.id)||null},Dr=()=>n.useContext(Cr);function Sr(e){const t=_r(),r=Dr(),n=jr(),o=e||n;return He(()=>{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 Lr(e){const{children:t,id:r}=e,o=jr();return(0,ct.jsx)(Mr.Provider,{value:n.useMemo(()=>({id:r,parentId:o}),[r,o]),children:t})}function Or(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(()=>xr());return(0,ct.jsx)(Cr.Provider,{value:n.useMemo(()=>({nodesRef:r,addNode:o,removeNode:a,events:i}),[o,a,i]),children:t})}function Tr(e){return"data-floating-ui-"+e}function Pr(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Er=Tr("safe-polygon");function Ar(e,t,r){if(r&&!Be(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 Ir(e){return"function"==typeof e?e():e}function Yr(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:f=!1,restMs:p=0,move:h=!0}=t,m=Dr(),g=jr(),y=Fe(u),v=Fe(l),b=Fe(r),w=Fe(p),_=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=ze(()=>{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||(Pr(k),Pr(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=Te(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=Ar(v.current,"close",_.current);n&&!x.current?(Pr(k),k.current=window.setTimeout(()=>o(!1,e,r),n)):t&&(Pr(k),o(!1,e,r))},[v,o]),T=ze(()=>{D.current(),x.current=void 0}),P=ze(()=>{if(j.current){const e=Te(s.floating).body;e.style.pointerEvents="",e.removeAttribute(Er),j.current=!1}}),E=ze(()=>!!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(Pr(k),C.current=!1,f&&!Be(_.current)||Ir(w.current)>0&&!Ar(v.current,"open"))return;const t=Ar(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 P();D.current();const t=Te(s.floating);if(Pr(M),S.current=!1,y.current&&a.current.floatingContext){r||Pr(k),x.current=y.current({...a.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){P(),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||!Se(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(){P(),T(),E()||O(e)}})(e))}function i(){Pr(k)}function l(e){E()||O(e,!1)}},[s,c,e,f,h,O,T,P,o,r,b,m,v,y,a,E,w]),He(()=>{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=Te(s.floating).body;r.setAttribute(Er,"");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]),He(()=>{r||(_.current=void 0,S.current=!1,T(),P())},[r,T,P]),n.useEffect(()=>()=>{T(),Pr(k),Pr(M),P()},[c,s.domReference,T,P]);const A=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")}f&&!Be(_.current)||r||0===Ir(w.current)||S.current&&e.movementX**2+e.movementY**2<2||(Pr(M),"touch"===_.current?n():(S.current=!0,M.current=window.setTimeout(n,Ir(w.current))))}}},[f,o,r,b,w]);return n.useMemo(()=>c?{reference:A}:{},[c,A])}const $r=()=>{},Nr=n.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:$r,setState:$r,isInstantPhase:!1}),Rr=()=>n.useContext(Nr);function Br(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 He(()=>{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,ct.jsx)(Nr.Provider,{value:n.useMemo(()=>({...a,setState:i,setCurrentId:c}),[a,c]),children:t})}function Hr(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=Rr(),{currentId:l,setCurrentId:d,initialDelay:u,setState:f,timeoutMs:p}=c;return He(()=>{i&&l&&(f({delay:{open:1,close:Ar(u,"close")}}),l!==s&&n(!1))},[i,s,n,f,l,u]),He(()=>{function e(){n(!1),f({delay:u,currentId:null})}if(i&&l&&!r&&l===s){if(p){const t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[i,r,f,l,s,n,u,p]),He(()=>{i&&d!==$r&&r&&d(s)},[i,r,d,s]),c}const Fr=n.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeoutIdRef:{current:-1},currentIdRef:{current:null},currentContextRef:{current:null}});function Wr(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,ct.jsx)(Fr.Provider,{value:n.useMemo(()=>({hasProvider:!0,delayRef:a,initialDelayRef:i,currentIdRef:s,timeoutMs:o,currentContextRef:c,timeoutIdRef:l}),[o]),children:t})}function zr(e,t){void 0===t&&(t={});const{open:r,onOpenChange:o,floatingId:a}=e,{enabled:i=!0}=t,s=n.useContext(Fr),{currentIdRef:c,delayRef:l,timeoutMs:d,initialDelayRef:u,currentContextRef:f,hasProvider:p,timeoutIdRef:h}=s,[m,g]=n.useState(!1);return He(()=>{function e(){var e;g(!1),null==(e=f.current)||e.setIsInstantPhase(!1),c.current=null,f.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,f,h]),He(()=>{if(!i)return;if(!r)return;const e=f.current,t=c.current;f.current={onOpenChange:o,setIsInstantPhase:g},c.current=a,l.current={open:0,close:Ar(u.current,"close")},null!==t&&t!==a?(Pr(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,f,h]),He(()=>()=>{f.current=null},[f]),n.useMemo(()=>({hasProvider:p,delayRef:l,isInstantPhase:m}),[p,l,m])}let Vr=0;function Gr(e,t){void 0===t&&(t={});const{preventScroll:r=!1,cancelPrevious:n=!0,sync:o=!1}=t;n&&cancelAnimationFrame(Vr);const a=()=>null==e?void 0:e.focus({preventScroll:r});o?a():Vr=requestAnimationFrame(a)}function Ur(e,t){if(!e||!t)return!1;const r=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(r&&f(r)){let r=t;for(;r;){if(e===r)return!0;r