UNPKG

@ubidots/vulcanui

Version:

React UI components library from Ubidots

6 lines 199 kB
"use strict";var e=require("react");require("./assets/src/theme/theme.css.ts.vanilla-3c9fb37f.css"),require("./assets/src/components/button/button-icon.css.ts.vanilla-df588799.css"),require("./assets/src/theme/utils.css.ts.vanilla-35542657.css"),require("./assets/src/components/button/button.css.ts.vanilla-112af444.css");var t=require("react-dom");function n(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}require("./assets/src/components/dropdown/dropdown-trigger.css.ts.vanilla-35d3d94a.css"),require("./assets/src/components/menu/menu.css.ts.vanilla-b1e74b6f.css"),require("./assets/src/components/menu/menu-item.css.ts.vanilla-f02ea847.css"),require("./assets/src/components/text/text.css.ts.vanilla-200f644b.css"),require("./assets/src/components/menu/menu-checkbox-item.css.ts.vanilla-889978cd.css"),require("./assets/src/theme/flex.css.ts.vanilla-0929dd67.css"),require("./assets/src/components/input-combo/input-combo.css.ts.vanilla-935fbcd2.css"),require("./assets/src/components/input/input.css.ts.vanilla-19622ae9.css"),require("./assets/src/components/switch/switch.css.ts.vanilla-8eee2662.css");var r=n(e),a=n(t);function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}function i(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function s(e,t,n,r,a){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!a)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?a.call(e,n):a?a.value=n:t.set(e,n),n}"function"==typeof SuppressedError&&SuppressedError;function c(...e){return(...t)=>{for(const n of e)null==n||n(...t)}}const l="development"===process.env.NODE_ENV,u="production"===process.env.NODE_ENV;function f(e){return"function"==typeof e&&"object"!=typeof e}function d(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=d(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}const p=function(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=d(e))&&(r&&(r+=" "),r+=t);return r};function m(...e){const t=Object.assign({},e[0]);for(let n=1;n<e.length;n++){const r=e[n];for(const e in r){const n=t[e],a=r[e];f(n)&&f(a)&&e.startsWith("on")?t[e]=c(n,a):t[e]="style"===e?m(n,a):"className"===e||"UNSAFE_className"===e?p(n,a):null!=a?a:n}}return t}var v,g;class y{constructor(){v.set(this,void 0),s(this,v,new Map,"f")}subscribe(e){const t=Symbol("id");i(this,v,"f").set(t,e);return()=>{i(this,v,"f").delete(t)}}notify(e){i(this,v,"f").forEach((t=>t(e)))}}v=new WeakMap;class b extends Set{constructor(e){super(),g.set(this,void 0),s(this,g,new y,"f"),e&&Array.from(e).forEach((e=>super.add(e)))}add(e){return super.add(e),i(this,g,"f").notify(this),this}addMany(e){return Array.from(e).forEach((e=>super.add(e))),i(this,g,"f").notify(this),this}delete(e){const t=super.delete(e);return i(this,g,"f").notify(this),t}deleteMany(e){return Array.from(e).forEach((e=>super.delete(e))),i(this,g,"f").notify(this),this}clear(){super.clear(),i(this,g,"f").notify(this)}toArray(){return Array.from(this)}subscribe(e){return i(this,g,"f").subscribe(e)}}g=new WeakMap;const h=new Set;function w(e,t){const n=`[VulcanUI]${t?`[${t}]`:" "} ${e}`;h.has(n)&&u||(h.add(n),l?console.error(n):console.warn(n))}function x(e,t){const n=`[VulcanUI]${t?`[${t}]`:" "} ${e}`;if(!h.has(n)||!u){if(h.add(n),l)throw new Error(n);console.error(n)}}function k(e){return!!e||void 0}const E="vulcanui-button-icon";function P({children:t}){return e.createElement("span",{className:p(E,"m4vpgs0")},t)}function S(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}function O(e,t,n){return(t=S(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function T(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?C(Object(n),!0).forEach((function(t){O(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):C(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function N(e,t){var n={};for(var r in e)n[r]=t(e[r],r);return n}P.displayName="ButtonIcon",P.toString=()=>`.${E}`;var A=(e,t,n)=>{for(var r of Object.keys(e)){var a;if(e[r]!==(null!==(a=t[r])&&void 0!==a?a:n[r]))return!1}return!0},M=e=>{var t=t=>{var n=e.defaultClassName,r=T(T({},e.defaultVariants),t);for(var a in r){var o,i=null!==(o=r[a])&&void 0!==o?o:e.defaultVariants[a];if(null!=i){var s=i;"boolean"==typeof s&&(s=!0===s?"true":"false");var c=e.variantClassNames[a][s];c&&(n+=" "+c)}}for(var[l,u]of e.compoundVariants)A(l,r,e.defaultVariants)&&(n+=" "+u);return n};return t.variants=()=>Object.keys(e.variantClassNames),t.classNames={get base(){return e.defaultClassName.split(" ")[0]},get variants(){return N(e.variantClassNames,(e=>N(e,(e=>e.split(" ")[0]))))}},t},j=M({defaultClassName:"a52phsi a52phse",variantClassNames:{color:{default:"a52phs8",primary:"a52phs9",secondary:"a52phsa",danger:"a52phsb",success:"a52phsc",warning:"a52phsd"},variant:{solid:"a52phs5",ghost:"a52phs4",outlined:"a52phs7 a52phs4"},rounded:{true:"a52phsf"},auto:{true:"a52phsg"},shadow:{true:"a52phsu"},disabled:{true:"a52phsh",false:"a52phsw"},fullWidth:{true:"a52phsx"},pressed:{true:"a52phsy"},hovered:{true:"a52phsz"}},defaultVariants:{color:"default",variant:"solid",rounded:!1,auto:!1,shadow:!1,disabled:!1,pressed:!1,hovered:!1},compoundVariants:[[{disabled:!1,pressed:!0},"a52phs10"],[{shadow:!0,disabled:!1},"a0zvie4"],[{disabled:!0,variant:"solid"},"a52phs11"],[{disabled:!1,variant:"solid",hovered:!0},"a52phs12"],[{disabled:!1,variant:"solid",pressed:!0},"a52phs13"],[{disabled:!0,variant:"ghost"},"a52phs14"],[{disabled:!1,variant:"ghost",hovered:!0},"a52phs15"],[{disabled:!1,variant:"ghost",pressed:!0},"a52phs16"],[{disabled:!0,variant:"outlined"},"a52phs17"],[{disabled:!1,variant:"outlined",hovered:!0},"a52phs18"],[{disabled:!1,variant:"outlined",pressed:!0},"a52phs19"]]});function R(e){return I(e)?(e.nodeName||"").toLowerCase():"#document"}function L(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function I(e){return e instanceof Node||e instanceof L(e).Node}function D(e){return e instanceof Element||e instanceof L(e).Element}function z(e){return e instanceof HTMLElement||e instanceof L(e).HTMLElement}function F(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof L(e).ShadowRoot)}function _(e){if("html"===R(e))return e;const t=e.assignedSlot||e.parentNode||F(e)&&e.host||function(e){var t;return null==(t=(I(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}(e);return F(t)?t.host:t}function V(e,t){if(!e||!t)return!1;const n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&F(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function H(e){if(0===e.mozInputSource&&e.isTrusted)return!0;const t=/Android/i;return(t.test(function(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}())||t.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}()))&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType}function $(e){return 0===e.width&&0===e.height||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}function q(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function W(e){return(null==e?void 0:e.ownerDocument)||document}function Y(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}const B="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";const K=Math.min,U=Math.max,X=Math.round,G=Math.floor,J=e=>({x:e,y:e}),Z={left:"right",right:"left",bottom:"top",top:"bottom"},Q={start:"end",end:"start"};function ee(e,t,n){return U(e,K(t,n))}function te(e,t){return"function"==typeof e?e(t):e}function ne(e){return e.split("-")[0]}function re(e){return e.split("-")[1]}function ae(e){return"x"===e?"y":"x"}function oe(e){return"y"===e?"height":"width"}function ie(e){return["top","bottom"].includes(ne(e))?"y":"x"}function se(e){return ae(ie(e))}function ce(e){return e.replace(/start|end/g,(e=>Q[e]))}function le(e){return e.replace(/left|right|bottom|top/g,(e=>Z[e]))}function ue(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function fe(e,t,n){let{reference:r,floating:a}=e;const o=ie(t),i=se(t),s=oe(i),c=ne(t),l="y"===o,u=r.x+r.width/2-a.width/2,f=r.y+r.height/2-a.height/2,d=r[s]/2-a[s]/2;let p;switch(c){case"top":p={x:u,y:r.y-a.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-a.width,y:f};break;default:p={x:r.x,y:r.y}}switch(re(t)){case"start":p[i]-=d*(n&&l?-1:1);break;case"end":p[i]+=d*(n&&l?-1:1)}return p}async function de(e,t){var n;void 0===t&&(t={});const{x:r,y:a,platform:o,rects:i,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=te(t,e),m=function(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}}(p),v=s[d?"floating"===f?"reference":"floating":f],g=ue(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(v)))||n?v:v.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),y="floating"===f?{...i.floating,x:r,y:a}:i.reference,b=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),h=await(null==o.isElement?void 0:o.isElement(b))&&await(null==o.getScale?void 0:o.getScale(b))||{x:1,y:1},w=ue(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:b,strategy:c}):y);return{top:(g.top-w.top+m.top)/h.y,bottom:(w.bottom-g.bottom+m.bottom)/h.y,left:(g.left-w.left+m.left)/h.x,right:(w.right-g.right+m.right)/h.x}}const pe=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...g}=te(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const y=ne(a),b=ne(s)===s,h=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=d||(b||!v?[le(s)]:function(e){const t=le(e);return[ce(e),t,ce(t)]}(s));d||"none"===m||w.push(...function(e,t,n,r){const a=re(e);let o=function(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:i;default:return[]}}(ne(e),"start"===n,r);return a&&(o=o.map((e=>e+"-"+a)),t&&(o=o.concat(o.map(ce)))),o}(s,v,m,h));const x=[s,...w],k=await de(t,g),E=[];let P=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&E.push(k[y]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=re(e),a=se(e),o=oe(a);let i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=le(i)),[i,le(i)]}(a,i,h);E.push(k[e[0]],k[e[1]])}if(P=[...P,{placement:a,overflows:E}],!E.every((e=>e<=0))){var S,O;const e=((null==(S=o.flip)?void 0:S.index)||0)+1,t=x[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(O=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:O.placement;if(!n)switch(p){case"bestFit":{var C;const e=null==(C=P.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:C[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}};const me=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:r}=t,a=await async function(e,t){const{placement:n,platform:r,elements:a}=e,o=await(null==r.isRTL?void 0:r.isRTL(a.floating)),i=ne(n),s=re(n),c="y"===ie(n),l=["left","top"].includes(i)?-1:1,u=o&&c?-1:1,f=te(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&"number"==typeof m&&(p="end"===s?-1*m:m),c?{x:p*u,y:d*l}:{x:d*l,y:p*u}}(t,e);return{x:n+a.x,y:r+a.y,data:a}}}},ve=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=te(e,t),l={x:n,y:r},u=await de(t,c),f=ie(ne(a)),d=ae(f);let p=l[d],m=l[f];if(o){const e="y"===d?"bottom":"right";p=ee(p+u["y"===d?"top":"left"],p,p-u[e])}if(i){const e="y"===f?"bottom":"right";m=ee(m+u["y"===f?"top":"left"],m,m-u[e])}const v=s.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-r}}}}};function ge(e){return he(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function be(e){var t;return null==(t=(he(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function he(e){return e instanceof Node||e instanceof ye(e).Node}function we(e){return e instanceof Element||e instanceof ye(e).Element}function xe(e){return e instanceof HTMLElement||e instanceof ye(e).HTMLElement}function ke(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot)}function Ee(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Te(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function Pe(e){return["table","td","th"].includes(ge(e))}function Se(e){const t=Oe(),n=Te(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Oe(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function Ce(e){return["html","body","#document"].includes(ge(e))}function Te(e){return ye(e).getComputedStyle(e)}function Ne(e){return we(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ae(e){if("html"===ge(e))return e;const t=e.assignedSlot||e.parentNode||ke(e)&&e.host||be(e);return ke(t)?t.host:t}function Me(e){const t=Ae(e);return Ce(t)?e.ownerDocument?e.ownerDocument.body:e.body:xe(t)&&Ee(t)?t:Me(t)}function je(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=Me(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=ye(a);return o?t.concat(i,i.visualViewport||[],Ee(a)?a:[],i.frameElement&&n?je(i.frameElement):[]):t.concat(a,je(a,[],n))}function Re(e){const t=Te(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=xe(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=X(n)!==o||X(r)!==i;return s&&(n=o,r=i),{width:n,height:r,$:s}}function Le(e){return we(e)?e:e.contextElement}function Ie(e){const t=Le(e);if(!xe(t))return J(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=Re(t);let i=(o?X(n.width):n.width)/r,s=(o?X(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const De=J(0);function ze(e){const t=ye(e);return Oe()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:De}function Fe(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=Le(e);let i=J(1);t&&(r?we(r)&&(i=Ie(r)):i=Ie(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ye(e))&&t}(o,n,r)?ze(o):J(0);let c=(a.left+s.x)/i.x,l=(a.top+s.y)/i.y,u=a.width/i.x,f=a.height/i.y;if(o){const e=ye(o),t=r&&we(r)?ye(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=Ie(n),t=n.getBoundingClientRect(),r=Te(n),a=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,f*=e.y,c+=a,l+=o,n=ye(n).frameElement}}return ue({width:u,height:f,x:c,y:l})}function _e(e){return Fe(be(e)).left+Ne(e).scrollLeft}function Ve(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=ye(e),r=be(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,s=0,c=0;if(a){o=a.width,i=a.height;const e=Oe();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,c=a.offsetTop)}return{width:o,height:i,x:s,y:c}}(e,n);else if("document"===t)r=function(e){const t=be(e),n=Ne(e),r=e.ownerDocument.body,a=U(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=U(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_e(e);const s=-n.scrollTop;return"rtl"===Te(r).direction&&(i+=U(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:s}}(be(e));else if(we(t))r=function(e,t){const n=Fe(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=xe(e)?Ie(e):J(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}(t,n);else{const n=ze(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return ue(r)}function He(e,t){const n=Ae(e);return!(n===t||!we(n)||Ce(n))&&("fixed"===Te(n).position||He(n,t))}function $e(e,t,n){const r=xe(t),a=be(t),o="fixed"===n,i=Fe(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const c=J(0);if(r||!r&&!o)if(("body"!==ge(t)||Ee(a))&&(s=Ne(t)),r){const e=Fe(t,!0,o,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&(c.x=_e(a));return{x:i.left+s.scrollLeft-c.x,y:i.top+s.scrollTop-c.y,width:i.width,height:i.height}}function qe(e,t){return xe(e)&&"fixed"!==Te(e).position?t?t(e):e.offsetParent:null}function We(e,t){const n=ye(e);if(!xe(e))return n;let r=qe(e,t);for(;r&&Pe(r)&&"static"===Te(r).position;)r=qe(r,t);return r&&("html"===ge(r)||"body"===ge(r)&&"static"===Te(r).position&&!Se(r))?n:r||function(e){let t=Ae(e);for(;xe(t)&&!Ce(t);){if(Se(t))return t;t=Ae(t)}return null}(e)||n}const Ye={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const a=xe(n),o=be(n);if(n===o)return t;let i={scrollLeft:0,scrollTop:0},s=J(1);const c=J(0);if((a||!a&&"fixed"!==r)&&(("body"!==ge(n)||Ee(o))&&(i=Ne(n)),xe(n))){const e=Fe(n);s=Ie(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-i.scrollLeft*s.x+c.x,y:t.y*s.y-i.scrollTop*s.y+c.y}},getDocumentElement:be,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=je(e,[],!1).filter((e=>we(e)&&"body"!==ge(e))),a=null;const o="fixed"===Te(e).position;let i=o?Ae(e):e;for(;we(i)&&!Ce(i);){const t=Te(i),n=Se(i);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&["absolute","fixed"].includes(a.position)||Ee(i)&&!n&&He(e,i))?r=r.filter((e=>e!==i)):a=t,i=Ae(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=o[0],s=o.reduce(((e,n)=>{const r=Ve(t,n,a);return e.top=U(r.top,e.top),e.right=K(r.right,e.right),e.bottom=K(r.bottom,e.bottom),e.left=U(r.left,e.left),e}),Ve(t,i,a));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:We,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const a=this.getOffsetParent||We,o=this.getDimensions;return{reference:$e(t,await a(n),r),floating:{x:0,y:0,...await o(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return Re(e)},getScale:Ie,isElement:we,isRTL:function(e){return"rtl"===Te(e).direction}};function Be(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=Le(e),u=a||o?[...l?je(l):[],...je(t)]:[];u.forEach((e=>{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)}));const f=l&&s?function(e,t){let n,r=null;const a=be(e);function o(){clearTimeout(n),r&&r.disconnect(),r=null}return function i(s,c){void 0===s&&(s=!1),void 0===c&&(c=1),o();const{left:l,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p={rootMargin:-G(u)+"px "+-G(a.clientWidth-(l+f))+"px "+-G(a.clientHeight-(u+d))+"px "+-G(l)+"px",threshold:U(0,K(1,c))||1};let m=!0;function v(e){const t=e[0].intersectionRatio;if(t!==c){if(!m)return i();t?i(!1,t):n=setTimeout((()=>{i(!1,1e-7)}),100)}m=!1}try{r=new IntersectionObserver(v,{...p,root:a.ownerDocument})}catch(e){r=new IntersectionObserver(v,p)}r.observe(e)}(!0),o}(l,n):null;let d,p=-1,m=null;i&&(m=new ResizeObserver((e=>{let[r]=e;r&&r.target===l&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{m&&m.observe(t)}))),n()})),l&&!c&&m.observe(l),m.observe(t));let v=c?Fe(e):null;return c&&function t(){const r=Fe(e);!v||r.x===v.x&&r.y===v.y&&r.width===v.width&&r.height===v.height||n();v=r,d=requestAnimationFrame(t)}(),n(),()=>{u.forEach((e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)})),f&&f(),m&&m.disconnect(),m=null,c&&cancelAnimationFrame(d)}}const Ke=(e,t,n)=>{const r=new Map,a={platform:Ye,...n},o={...a.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=o.filter(Boolean),c=await(null==i.isRTL?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:f}=fe(l,r,c),d=r,p={},m=0;for(let n=0;n<s.length;n++){const{name:o,fn:v}=s[n],{x:g,y:y,data:b,reset:h}=await v({x:u,y:f,initialPlacement:r,placement:d,strategy:a,middlewareData:p,rects:l,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,f=null!=y?y:f,p={...p,[o]:{...p[o],...b}},h&&m<=50&&(m++,"object"==typeof h&&(h.placement&&(d=h.placement),h.rects&&(l=!0===h.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):h.rects),({x:u,y:f}=fe(l,d,c))),n=-1)}return{x:u,y:f,placement:d,strategy:a,middlewareData:p}})(e,t,{...a,platform:o})};var Ue="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function Xe(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;0!=r--;)if(!Xe(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!=r--;){const n=a[r];if(("_owner"!==n||!e.$$typeof)&&!Xe(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Ge(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Je(e,t){const n=Ge(e);return Math.round(t*n)/n}function Ze(e){const t=r.useRef(e);return Ue((()=>{t.current=e})),t} /*! * tabbable 6.1.2 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */ var Qe=["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(","),et="undefined"==typeof Element,tt=et?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,nt=!et&&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},rt=function e(t,n){var r;void 0===n&&(n=!0);var a=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===a||"true"===a||n&&t&&e(t.parentNode)},at=function e(t,n,r){for(var a=[],o=Array.from(t);o.length;){var i=o.shift();if(!rt(i,!1))if("SLOT"===i.tagName){var s=i.assignedElements(),c=e(s.length?s:i.children,!0,r);r.flatten?a.push.apply(a,c):a.push({scopeParent:i,candidates:c})}else{tt.call(i,Qe)&&r.filter(i)&&(n||!t.includes(i))&&a.push(i);var l=i.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(i),u=!rt(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(i));if(l&&u){var f=e(!0===l?i.children:l.children,!0,r);r.flatten?a.push.apply(a,f):a.push({scopeParent:i,candidates:f})}else o.unshift.apply(o,i.children)}}return a},ot=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},it=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},st=function(e){return"INPUT"===e.tagName},ct=function(e){return function(e){return st(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||nt(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!a||a===e}(e)},lt=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ut=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var a=tt.call(e,"details>summary:first-of-type")?e.parentElement:e;if(tt.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return lt(e)}else{if("function"==typeof r){for(var o=e;e;){var i=e.parentElement,s=nt(e);if(i&&!i.shadowRoot&&!0===r(i))return lt(e);e=e.assignedSlot?e.assignedSlot:i||s===e.ownerDocument?i:s.host}e=o}if(function(e){var t,n,r,a,o=e&&nt(e),i=null===(t=o)||void 0===t?void 0:t.host,s=!1;if(o&&o!==e)for(s=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!s&&i;){var c,l,u;s=!(null===(l=i=null===(c=o=nt(i))||void 0===c?void 0:c.host)||void 0===l||null===(u=l.ownerDocument)||void 0===u||!u.contains(i))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},ft=function(e,t){return!(t.disabled||rt(t)||function(e){return st(e)&&"hidden"===e.type}(t)||ut(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!tt.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},dt=function(e,t){return!(ct(t)||ot(t)<0||!ft(e,t))},pt=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},mt=function e(t){var n=[],r=[];return t.forEach((function(t,a){var o=!!t.scopeParent,i=o?t.scopeParent:t,s=ot(i,o),c=o?e(t.candidates):i;0===s?o?n.push.apply(n,c):n.push(i):r.push({documentOrder:a,tabIndex:s,item:t,isScope:o,content:c})})),r.sort(it).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},vt=function(e,t){var n;return n=(t=t||{}).getShadowRoot?at([e],t.includeContainer,{filter:dt.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:pt}):function(e,t,n){if(rt(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Qe));return t&&tt.call(e,Qe)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,dt.bind(null,t)),mt(n)};function gt(e){return r.useMemo((()=>e.every((e=>null==e))?null:t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}),e)}var yt="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function bt(){return bt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bt.apply(this,arguments)}let ht=!1,wt=0;const xt=()=>"floating-ui-"+wt++;const kt=r["useId".toString()]||function(){const[e,t]=r.useState((()=>ht?xt():void 0));return yt((()=>{null==e&&t(xt())}),[]),r.useEffect((()=>{ht||(ht=!0)}),[]),e};const Et=r.createContext(null),Pt=r.createContext(null),St=()=>{var e;return(null==(e=r.useContext(Et))?void 0:e.id)||null},Ot=()=>r.useContext(Pt);function Ct(e){return"data-floating-ui-"+e}function Tt(t){const n=e.useRef(t);return yt((()=>{n.current=t})),n}const Nt=Ct("safe-polygon");function At(e,t,n){return n&&!q(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}function Mt(e,t){let n=e.filter((e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)})),r=n;for(;r.length;)r=e.filter((e=>{var t;return null==(t=r)?void 0:t.some((t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)}))})),n=n.concat(r);return n}const jt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Rt(e,t){const n=vt(e,jt());"prev"===t&&n.reverse();const r=n.indexOf(function(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(r=n.shadowRoot)?void 0:r.activeElement);){var n,r;t=t.shadowRoot.activeElement}return t}(W(e)));return n.slice(r+1)[0]}function Lt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!V(n,r)}function It(e){vt(e,jt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function Dt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}const zt={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Ft(e){"Tab"===e.key&&(e.target,clearTimeout(undefined))}const _t=r.forwardRef((function(e,t){const[n,a]=r.useState();yt((()=>(/apple/i.test(navigator.vendor)&&a("button"),document.addEventListener("keydown",Ft),()=>{document.removeEventListener("keydown",Ft)})),[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Ct("focus-guard")]:"",style:zt};return r.createElement("span",bt({},e,o))})),Vt=r.createContext(null);function Ht(e){let{children:n,id:a,root:o=null,preserveTabOrder:i=!0}=e;const s=function(e){let{id:t,root:n}=void 0===e?{}:e;const[a,o]=r.useState(null),i=kt(),s=$t(),c=r.useMemo((()=>({id:t,root:n,portalContext:s,uniqueId:i})),[t,n,s,i]),l=r.useRef();return yt((()=>()=>{null==a||a.remove()}),[a,c]),yt((()=>{if(l.current===c)return;l.current=c;const{id:e,root:t,portalContext:n,uniqueId:r}=c,a=e?document.getElementById(e):null,i=Ct("portal");if(a){const e=document.createElement("div");e.id=r,e.setAttribute(i,""),a.appendChild(e),o(e)}else{let a=t||(null==n?void 0:n.portalNode);a&&!D(a)&&(a=a.current),a=a||document.body;let s=null;e&&(s=document.createElement("div"),s.id=e,a.appendChild(s));const c=document.createElement("div");c.id=r,c.setAttribute(i,""),a=s||a,a.appendChild(c),o(c)}}),[c]),a}({id:a,root:o}),[c,l]=r.useState(null),u=r.useRef(null),f=r.useRef(null),d=r.useRef(null),p=r.useRef(null),m=!!c&&!c.modal&&c.open&&i&&!(!o&&!s);return r.useEffect((()=>{if(s&&i&&(null==c||!c.modal))return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&Lt(e)){("focusin"===e.type?Dt:It)(s)}}}),[s,i,null==c?void 0:c.modal]),r.createElement(Vt.Provider,{value:r.useMemo((()=>({preserveTabOrder:i,beforeOutsideRef:u,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:p,portalNode:s,setFocusManagerState:l})),[i,s])},m&&s&&r.createElement(_t,{"data-type":"outside",ref:u,onFocus:e=>{if(Lt(e,s)){var t;null==(t=d.current)||t.focus()}else{const e=Rt(document.body,"prev")||(null==c?void 0:c.refs.domReference.current);null==e||e.focus()}}}),m&&s&&r.createElement("span",{"aria-owns":s.id,style:zt}),s&&t.createPortal(n,s),m&&s&&r.createElement(_t,{"data-type":"outside",ref:f,onFocus:e=>{if(Lt(e,s)){var t;null==(t=p.current)||t.focus()}else{const t=Rt(document.body,"next")||(null==c?void 0:c.refs.domReference.current);null==t||t.focus(),(null==c?void 0:c.closeOnFocusOut)&&(null==c||c.onOpenChange(!1,e.nativeEvent))}}}))}const $t=()=>r.useContext(Vt);function qt(e){return z(e.target)&&"BUTTON"===e.target.tagName}function Wt(e){return function(e){return z(e)&&e.matches(B)}(e)}const Yt=r["useInsertionEffect".toString()]||(e=>e());function Bt(e){const t=r.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return Yt((()=>{t.current=e})),r.useCallback((function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)}),[])}const Kt={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ut={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Xt=e=>{var t,n;return{escapeKeyBubbles:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePressBubbles:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Gt(e,t){void 0===t&&(t={});const{open:n,onOpenChange:a,events:o,nodeId:i,elements:{reference:s,domReference:c,floating:l},dataRef:u}=e,{enabled:f=!0,escapeKey:d=!0,outsidePress:p=!0,outsidePressEvent:m="pointerdown",referencePress:v=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:b}=t,h=Ot(),w=null!=St(),x=Bt("function"==typeof p?p:()=>!1),k="function"==typeof p?x:p,E=r.useRef(!1),{escapeKeyBubbles:P,outsidePressBubbles:S}=Xt(b),O=Bt((e=>{if(!n||!f||!d||"Escape"!==e.key)return;const t=h?Mt(h.nodesRef.current,i):[];if(!P&&(e.stopPropagation(),t.length>0)){let e=!0;if(t.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),a(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e)})),C=Bt((e=>{const t=E.current;if(E.current=!1,t)return;if("function"==typeof k&&!k(e))return;const n=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),r="["+Ct("inert")+"]",s=W(l).querySelectorAll(r);let u=D(n)?n:null;for(;u&&!["html","body","#document"].includes(R(u));){const e=_(u);if(e===W(l).body||!D(e))break;u=e}if(s.length&&D(n)&&!n.matches("html,body")&&!V(n,l)&&Array.from(s).every((e=>!V(u,e))))return;if(z(n)&&l){const t=n.clientWidth>0&&n.scrollWidth>n.clientWidth,r=n.clientHeight>0&&n.scrollHeight>n.clientHeight;let a=r&&e.offsetX>n.clientWidth;if(r){const t="rtl"===function(e){return L(e).getComputedStyle(e)}(n).direction;t&&(a=e.offsetX<=n.offsetWidth-n.clientWidth)}if(a||t&&e.offsetY>n.clientHeight)return}const f=h&&Mt(h.nodesRef.current,i).some((t=>{var n;return Y(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Y(e,l)||Y(e,c)||f)return;const d=h?Mt(h.nodesRef.current,i):[];if(d.length>0){let e=!0;if(d.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:H(e)||$(e)}}),a(!1,e)}));return r.useEffect((()=>{if(!n||!f)return;function e(e){a(!1,e)}u.current.__escapeKeyBubbles=P,u.current.__outsidePressBubbles=S;const t=W(l);d&&t.addEventListener("keydown",O),k&&t.addEventListener(m,C);let r=[];return y&&(D(c)&&(r=je(c)),D(l)&&(r=r.concat(je(l))),!D(s)&&s&&s.contextElement&&(r=r.concat(je(s.contextElement)))),r=r.filter((e=>{var n;return e!==(null==(n=t.defaultView)?void 0:n.visualViewport)})),r.forEach((t=>{t.addEventListener("scroll",e,{passive:!0})})),()=>{d&&t.removeEventListener("keydown",O),k&&t.removeEventListener(m,C),r.forEach((t=>{t.removeEventListener("scroll",e)}))}}),[u,l,c,s,d,k,m,n,a,y,f,P,S,O,C]),r.useEffect((()=>{E.current=!1}),[k,m]),r.useMemo((()=>f?{reference:{onKeyDown:O,[Kt[g]]:e=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),a(!1,e.nativeEvent))}},floating:{onKeyDown:O,[Ut[m]]:()=>{E.current=!0}}}:{}),[f,o,v,m,g,a,O])}let Jt;function Zt(e){var t;void 0===e&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e;if("production"!==process.env.NODE_ENV){var s;const t="Floating UI: Cannot pass a virtual element to the `elements.reference` option, as it must be a real DOM element. Use `refs.setPositionReference` instead.";var c,l;if(null!=(s=e.elements)&&s.reference&&!D(e.elements.reference))if(null==(c=Jt)||!c.has(t))null==(l=Jt)||l.add(t),console.error(t)}const[u,f]=r.useState(null),d=(null==(t=e.elements)?void 0:t.reference)||u,p=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:s,floating:c}={},transform:l=!0,whileElementsMounted:u,open:f}=e,[d,p]=r.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,v]=r.useState(o);Xe(m,o)||v(o);const[g,y]=r.useState(null),[b,h]=r.useState(null),w=r.useCallback((e=>{e!=P.current&&(P.current=e,y(e))}),[y]),x=r.useCallback((e=>{e!==S.current&&(S.current=e,h(e))}),[h]),k=s||g,E=c||b,P=r.useRef(null),S=r.useRef(null),O=r.useRef(d),C=Ze(u),T=Ze(i),N=r.useCallback((()=>{if(!P.current||!S.current)return;const e={placement:t,strategy:n,middleware:m};T.current&&(e.platform=T.current),Ke(P.current,S.current,e).then((e=>{const t={...e,isPositioned:!0};A.current&&!Xe(O.current,t)&&(O.current=t,a.flushSync((()=>{p(t)})))}))}),[m,t,n,T]);Ue((()=>{!1===f&&O.current.isPositioned&&(O.current.isPositioned=!1,p((e=>({...e,isPositioned:!1}))))}),[f]);const A=r.useRef(!1);Ue((()=>(A.current=!0,()=>{A.current=!1})),[]),Ue((()=>{if(k&&(P.current=k),E&&(S.current=E),k&&E){if(C.current)return C.current(k,E,N);N()}}),[k,E,N,C]);const M=r.useMemo((()=>({reference:P,floating:S,setReference:w,setFloating:x})),[w,x]),j=r.useMemo((()=>({reference:k,floating:E})),[k,E]),R=r.useMemo((()=>{const e={position:n,left:0,top:0};if(!j.floating)return e;const t=Je(j.floating,d.x),r=Je(j.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...Ge(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}}),[n,l,j.floating,d.x,d.y]);return r.useMemo((()=>({...d,update:N,refs:M,elements:j,floatingStyles:R})),[d,N,M,j,R])}(e),m=Ot(),v=Bt(((e,t)=>{e&&(y.current.openEvent=t),null==o||o(e,t)})),g=r.useRef(null),y=r.useRef({}),b=r.useState((()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==n)))||[])}}}()))[0],h=kt(),w=r.useCallback((e=>{const t=D(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;p.refs.setReference(t)}),[p.refs]),x=r.useCallback((e=>{(D(e)||null===e)&&(g.current=e,f(e)),(D(p.refs.reference.current)||null===p.refs.reference.current||null!==e&&!D(e))&&p.refs.setReference(e)}),[p.refs]),k=r.useMemo((()=>({...p.refs,setReference:x,setPositionReference:w,domReference:g})),[p.refs,x,w]),E=r.useMemo((()=>({...p.elements,domReference:d})),[p.elements,d]),P=r.useMemo((()=>({...p,refs:k,elements:E,dataRef:y,nodeId:i,floatingId:h,events:b,open:n,onOpenChange:v})),[p,i,h,b,n,v,k,E]);return yt((()=>{const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===i));e&&(e.context=P)})),r.useMemo((()=>({...p,context:P,refs:k,elements:E})),[p,k,E,P])}function Qt(e,t,n){const r=new Map;return{..."floating"===n&&{tabIndex:-1},...e,...t.map((e=>e?e[n]:null)).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,a]=t;var o;0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof a&&(null==(o=r.get(n))||o.push(a),e[n]=function(){for(var e,t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return null==(e=r.get(n))?void 0:e.map((e=>e(...a))).find((e=>void 0!==e))})):e[n]=a})),e):e),{})}}"production"!==process.env.NODE_ENV&&(Jt=new Set);const en=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((e,t)=>(t?"-":"")+e.toLowerCase()));function tn(e,t){return"function"==typeof e?e(t):e}function nn(e,t){void 0===t&&(t={});const{open:n,elements:{floating:a}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[s,c]=r.useState(!1),[l,u]=r.useState("unmounted"),f=function(e,t){const[n,a]=r.useState(e);return e&&!n&&a(!0),r.useEffect((()=>{if(!e){const e=setTimeout((()=>a(!1)),t);return()=>clearTimeout(e)}}),[e,t]),n}(n,i);return yt((()=>{s&&!f&&u("unmounted")}),[s,f]),yt((()=>{if(a){if(n){u("initial");const e=requestAnimationFrame((()=>{u("open")}));return()=>{cancelAnimationFrame(e)}}c(!0),u("close")}}),[n,a]),{isMounted:f,status:l}}function rn(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=rn(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function an(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=rn(e))&&(r&&(r+=" "),r+=t);return r}const on="undefined"!=typeof document?e.useLayoutEffect:()=>{};function sn(t){const n=e.useRef(null);return on((()=>{n.current=t}),[t]),e.useCallback(((...e)=>(0,n.current)(...e)),[])}let cn=new Map;function ln(e,t){if(e===t)return e;let n=cn.get(e);if(n)return n(t),t;let r=cn.get(t);return r?(r(e),e):t}function un(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}function fn(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let r=e[n];for(let e in r){let n=t[e],a=r[e];"function"==typeof n&&"function"==typeof a&&"o"===e[0]&&"n"===e[1]&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90?t[e]=un(n,a):"className"!==e&&"UNSAFE_className"!==e||"string"!=typeof n||"string"!=typeof a?"id"===e&&n&&a?t.id=ln(n,a):t[e]=void 0!==a?a:n:t[e]=an(n,a)}}return t}const dn=new Set(["id"]),pn=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),mn=/^(data-.*)$/;function vn(e){if(function(){if(null==gn){gn=!1;try{document.createElement("div").focus({get preventScroll(){return gn=!0,!0}})}catch(e){}}return gn}())e.focus({preventScroll:!0});else{let t=function(e){var t=e.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(let{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}let gn=null;let yn=new Map,bn=new Set;function hn(){if("undefined"==typeof window)return;let e=t=>{let n=yn.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),yn.delete(t.target)),0===yn.size)){for(let e of bn)e();bn.clear()}};document.body.addEventListener("transitionrun",(t=>{let n=yn.get(t.target);n||(n=new Set,yn.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function wn(e){requestAnimationFrame((()=>{0===yn.size?e():bn.add(e)}))}function xn(e,t){on((()=>{if(e&&e.ref&&t)return e.ref.current=t.current,()=>{e.ref.current=null}}),[e,t])}function kn(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function En(){return kn(/^Mac/i)}function Pn(){return kn(/^iPhone/i)||kn(/^iPad/i)||En()&&navigator.maxTouchPoints>1}function Sn(){return e=/Android/i,"undefined"!=typeof window&&null!=window.navigator&&((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.brands.some((t=>e.test(t.brand))))||e.test(window.navigator.userAgent));var e,t}function On(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Sn()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function Cn(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function Tn(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function Nn(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,Cn(e,t,"set"),n),n}"undefined"!=typeof document&&("loading"!==document.readyState?hn():document.addEventListener("DOMContentLoaded",hn));let An="default",Mn="",jn=new WeakMap;function Rn(e){Pn()?("default"===An&&(Mn=document.documentElement.style.webkitUserSelect,document.documentElement.style.webkitUserSelect="none"),An="disabled"):(e instanceof HTMLElement||e instanceof SVGElement)&&(jn.set(e,e.style.userSelect),e.style.userSelect="none")}function Ln(e){if(Pn()){if("disabled"!==An)return;An="restoring",setTimeout((()=>{wn((()=>{"restoring"===An&&("none"===document.documentElement.style.webkitUserSelect&&(document.documentElement.style.webkitUserSelect=Mn||""),Mn="",An="default")}))}),300)}else if((e instanceof HTMLElement||e instanceof SVGElement)&&e&&jn.has(e)){let t=jn.get(e);"none"===e.style.userSelect&&(e.style.userSelect=t),""===e.getAttribute("style")&&e.removeAttribute("style"),jn.delete(e)}}const In=e.createContext(null);In.displayName="PressResponderContext";var Dn=new WeakMap;class zn{continuePropagation(){Nn(this,Dn,!1)}get shouldStopPropagation(){return function(e,t){return t.get?t.get.call(e):t.value}(e=this,Cn(e,Dn,"get"));var e}constructor(e,t,n){Tn(this,Dn,{writable:!0,value:void 0}),Nn(this,Dn,!0),this.type=e,this.pointerType=t,this.target=n.currentTarget,this.shiftKey=n.shiftKey,this.metaKey=n.metaKey,this.ctrlKey=n.ctrlKey,this.altKey=n.altKey}}function Fn(t){let{onPress:n,onPressChange:r,onPressStart:a,onPressEnd:o,onPressUp:i,isDisabled:s,isPressed:c,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:f,ref:d,...p}=function(t){let n=e.useContext(In);if(n){let{register:e,...r}=n;t=fn(r,t),e()}return xn(n,t.ref),t}(t),[m,v]=e.useState(!1),g=e.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:y,removeAllGlobalListeners:b}=function(){let t=e.useRef(new Map),n=e.useCallback(((e,n,r,a)=>{let o=(null==a?void 0:a.once)?(...e)=>{t.current.delete(r),r(...e)}:r;t.current.set(r,{type:n,eventTarget:e,fn:o,options:a}),e.addEventListener(n,r,a)}),[]),r=e.useCallback(((e,n,r,a)=>{var o;let i=(null===(o=t.current.get(r))||void 0===o?void 0:o.fn)||r;e.removeEventListener(n,i,a),t.current.delete(r)}),[]),a=e.useCallback((()=>{t.current.forEach(((e,t)=>{r(e.eventTarget,e.type,t,e.options)}))}),[r]);return e.useEffect((()=>a),[a]),{addGlobalListener:n,removeGlobalListener:r,removeAllGlobalListeners:a}}(),h=sn(((e,t)=>{let n=g.current;if(s||n.didFirePressStart)return;let o=!0;if(a){let n=new zn("pressstart",t,e);a(n),o=n.shouldStopPropagation}return r&&r(!0),n.didFirePressStart=!0,v(!0),o})),w=sn(((e,t,a=!0)=>{let i=g.current;if(!i.didFirePressStart)return;i.ignoreClickAfterPress=!0,i.didFirePressStart=!1;let c=!0;if(o){let n=new zn("pressend",t,e);o(n),c=n.shouldStopPropagation}if(r&&r(!1),v(!1),n&&a&&!s){let r=new zn("press",t,e);n(r),c&&(c=r.shouldStopPropagation)}return c})),x=sn(((e,t)=>{if(!s){if(i){let n=new zn("pressup",t,e);return i(n),n.shouldStopPropagation}return!0}})),k=sn((e=>{let t=g.current;t.isPressed&&(t.isOverTarget&&w($n(t.target,e),t.pointerType,!1),t.isPressed=!1,t.isOverTarget=!1,t.activePointerId=null,t.pointerType=null,b(),f||Ln(t.target))})),E=sn((e=>{u&&k(e)})),P=e.useMemo((()=>{let e=g.current,t={onKeyDown(t){if(Vn(t.nativeEvent,t.currentTarget)&&t.currentTarget.contains(t.target)){Yn(t.target,t.key)&&t.preventDefault();let r=!0;e.isPressed||t.repeat||(e.target=t.currentTarget,e.isPressed=!0,r=h(t,"keyboard"),y(document,"keyup",n,!1)),r&&t.stopPropagation()}else"Enter"===t.key&&_n(t.currentTarget)&&t.stopPropagation()},onKeyUp(t){Vn(t.nativeEve