@meltdownjs/droppy
Version:
@meltdownjs/droppy is a react library which provides hooks for creating virtualized Select-, MultiSelect-, ComboBox- & MultiComboBox-Components easily.
30 lines (28 loc) • 889 kB
JavaScript
"use strict";var fr=e=>{throw TypeError(e)};var vn=(e,t,n)=>t.has(e)||fr("Cannot "+n);var y=(e,t,n)=>(vn(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?fr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),W=(e,t,n,r)=>(vn(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),se=(e,t,n)=>(vn(e,t,"access private method"),n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("react"),Zr=require("react-dom");function ei(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const b=ei(B),$i=ei(Zr);function on(){return typeof window<"u"}function Ot(e){return ti(e)?(e.nodeName||"").toLowerCase():"#document"}function we(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fe(e){var t;return(t=(ti(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ti(e){return on()?e instanceof Node||e instanceof we(e).Node:!1}function ne(e){return on()?e instanceof Element||e instanceof we(e).Element:!1}function be(e){return on()?e instanceof HTMLElement||e instanceof we(e).HTMLElement:!1}function Tn(e){return!on()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof we(e).ShadowRoot}function $t(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Se(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function Bi(e){return["table","td","th"].includes(Ot(e))}function cn(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Hn(e){const t=an(),n=ne(e)?Se(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Ui(e){let t=Ve(e);for(;be(t)&&!ze(t);){if(Hn(t))return t;if(cn(t))return null;t=Ve(t)}return null}function an(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ze(e){return["html","body","#document"].includes(Ot(e))}function Se(e){return we(e).getComputedStyle(e)}function ln(e){return ne(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ve(e){if(Ot(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tn(e)&&e.host||Fe(e);return Tn(t)?t.host:t}function ni(e){const t=Ve(e);return ze(t)?e.ownerDocument?e.ownerDocument.body:e.body:be(t)&&$t(t)?t:ni(t)}function Ye(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=ni(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),s=we(i);if(o){const c=Pn(s);return t.concat(s,s.visualViewport||[],$t(i)?i:[],c&&n?Ye(c):[])}return t.concat(i,Ye(i,[],n))}function Pn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function dr(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function _n(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Tn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function Ki(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function ri(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function qi(e){return e.mozInputSource===0&&e.isTrusted?!0:Mn()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Hi(e){return Qi()?!1:!Mn()&&e.width===0&&e.height===0||Mn()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Mn(){const e=/android/i;return e.test(Ki())||e.test(ri())}function Qi(){return ri().includes("jsdom/")}function hr(e,t){return["mouse","pen"].includes(e)}function Yi(e){return"nativeEvent"in e}function Ji(e){return e.matches("html,body")}function Dn(e){return(e==null?void 0:e.ownerDocument)||document}function bn(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Pt(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Gi="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ii(e){return be(e)&&e.matches(Gi)}function xe(e){e.preventDefault(),e.stopPropagation()}function Xi(e){return e?e.getAttribute("role")==="combobox"&&ii(e):!1}const Lt=Math.min,Oe=Math.max,en=Math.round,gt=Math.floor,ke=e=>({x:e,y:e}),Zi={left:"right",right:"left",bottom:"top",top:"bottom"},es={start:"end",end:"start"};function Qn(e,t){return typeof e=="function"?e(t):e}function xt(e){return e.split("-")[0]}function un(e){return e.split("-")[1]}function ts(e){return e==="x"?"y":"x"}function si(e){return e==="y"?"height":"width"}function jt(e){return["top","bottom"].includes(xt(e))?"y":"x"}function oi(e){return ts(jt(e))}function ns(e,t,n){n===void 0&&(n=!1);const r=un(e),i=oi(e),o=si(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=tn(s)),[s,tn(s)]}function rs(e){const t=tn(e);return[kn(e),t,kn(t)]}function kn(e){return e.replace(/start|end/g,t=>es[t])}function is(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}function ss(e,t,n,r){const i=un(e);let o=is(xt(e),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(kn)))),o}function tn(e){return e.replace(/left|right|bottom|top/g,t=>Zi[t])}function os(e){return{top:0,right:0,bottom:0,left:0,...e}}function cs(e){return typeof e!="number"?os(e):{top:e,right:e,bottom:e,left:e}}function nn(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}var Qt={exports:{}},_t={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var gr;function as(){if(gr)return _t;gr=1;var e=B,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(c,l,f){var u,d={},h=null,g=null;f!==void 0&&(h=""+f),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=l.ref);for(u in l)r.call(l,u)&&!o.hasOwnProperty(u)&&(d[u]=l[u]);if(c&&c.defaultProps)for(u in l=c.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:c,key:h,ref:g,props:d,_owner:i.current}}return _t.Fragment=n,_t.jsx=s,_t.jsxs=s,_t}var Mt={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var pr;function ls(){return pr||(pr=1,process.env.NODE_ENV!=="production"&&function(){var e=B,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,p="@@iterator";function w(a){if(a===null||typeof a!="object")return null;var v=m&&a[m]||a[p];return typeof v=="function"?v:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function x(a){{for(var v=arguments.length,O=new Array(v>1?v-1:0),F=1;F<v;F++)O[F-1]=arguments[F];R("error",a,O)}}function R(a,v,O){{var F=E.ReactDebugCurrentFrame,Y=F.getStackAddendum();Y!==""&&(v+="%s",O=O.concat([Y]));var ee=O.map(function(U){return String(U)});ee.unshift("Warning: "+v),Function.prototype.apply.call(console[a],console,ee)}}var I=!1,D=!1,C=!1,_=!1,q=!1,A;A=Symbol.for("react.module.reference");function G(a){return!!(typeof a=="string"||typeof a=="function"||a===r||a===o||q||a===i||a===f||a===u||_||a===g||I||D||C||typeof a=="object"&&a!==null&&(a.$$typeof===h||a.$$typeof===d||a.$$typeof===s||a.$$typeof===c||a.$$typeof===l||a.$$typeof===A||a.getModuleId!==void 0))}function Q(a,v,O){var F=a.displayName;if(F)return F;var Y=v.displayName||v.name||"";return Y!==""?O+"("+Y+")":O}function z(a){return a.displayName||"Context"}function N(a){if(a==null)return null;if(typeof a.tag=="number"&&x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case u:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case c:var v=a;return z(v)+".Consumer";case s:var O=a;return z(O._context)+".Provider";case l:return Q(a,a.render,"ForwardRef");case d:var F=a.displayName||null;return F!==null?F:N(a.type)||"Memo";case h:{var Y=a,ee=Y._payload,U=Y._init;try{return N(U(ee))}catch{return null}}}return null}var Z=Object.assign,P=0,S,K,k,T,H,oe,ce;function Te(){}Te.__reactDisabledLog=!0;function Ae(){{if(P===0){S=console.log,K=console.info,k=console.warn,T=console.error,H=console.group,oe=console.groupCollapsed,ce=console.groupEnd;var a={configurable:!0,enumerable:!0,value:Te,writable:!0};Object.defineProperties(console,{info:a,log:a,warn:a,error:a,group:a,groupCollapsed:a,groupEnd:a})}P++}}function ct(){{if(P--,P===0){var a={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Z({},a,{value:S}),info:Z({},a,{value:K}),warn:Z({},a,{value:k}),error:Z({},a,{value:T}),group:Z({},a,{value:H}),groupCollapsed:Z({},a,{value:oe}),groupEnd:Z({},a,{value:ce})})}P<0&&x("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ae=E.ReactCurrentDispatcher,ue;function he(a,v,O){{if(ue===void 0)try{throw Error()}catch(Y){var F=Y.stack.trim().match(/\n( *(at )?)/);ue=F&&F[1]||""}return`
`+ue+a}}var Xe=!1,Le;{var at=typeof WeakMap=="function"?WeakMap:Map;Le=new at}function We(a,v){if(!a||Xe)return"";{var O=Le.get(a);if(O!==void 0)return O}var F;Xe=!0;var Y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ee;ee=ae.current,ae.current=null,Ae();try{if(v){var U=function(){throw Error()};if(Object.defineProperty(U.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(U,[])}catch(me){F=me}Reflect.construct(a,[],U)}else{try{U.call()}catch(me){F=me}a.call(U.prototype)}}else{try{throw Error()}catch(me){F=me}a()}}catch(me){if(me&&F&&typeof me.stack=="string"){for(var V=me.stack.split(`
`),ge=F.stack.split(`
`),re=V.length-1,ie=ge.length-1;re>=1&&ie>=0&&V[re]!==ge[ie];)ie--;for(;re>=1&&ie>=0;re--,ie--)if(V[re]!==ge[ie]){if(re!==1||ie!==1)do if(re--,ie--,ie<0||V[re]!==ge[ie]){var Ee=`
`+V[re].replace(" at new "," at ");return a.displayName&&Ee.includes("<anonymous>")&&(Ee=Ee.replace("<anonymous>",a.displayName)),typeof a=="function"&&Le.set(a,Ee),Ee}while(re>=1&&ie>=0);break}}}finally{Xe=!1,ae.current=ee,ct(),Error.prepareStackTrace=Y}var dt=a?a.displayName||a.name:"",tt=dt?he(dt):"";return typeof a=="function"&&Le.set(a,tt),tt}function lt(a,v,O){return We(a,!1)}function Ze(a){var v=a.prototype;return!!(v&&v.isReactComponent)}function Re(a,v,O){if(a==null)return"";if(typeof a=="function")return We(a,Ze(a));if(typeof a=="string")return he(a);switch(a){case f:return he("Suspense");case u:return he("SuspenseList")}if(typeof a=="object")switch(a.$$typeof){case l:return lt(a.render);case d:return Re(a.type,v,O);case h:{var F=a,Y=F._payload,ee=F._init;try{return Re(ee(Y),v,O)}catch{}}}return""}var Pe=Object.prototype.hasOwnProperty,St={},It=E.ReactDebugCurrentFrame;function L(a){if(a){var v=a._owner,O=Re(a.type,a._source,v?v.type:null);It.setExtraStackFrame(O)}else It.setExtraStackFrame(null)}function X(a,v,O,F,Y){{var ee=Function.call.bind(Pe);for(var U in a)if(ee(a,U)){var V=void 0;try{if(typeof a[U]!="function"){var ge=Error((F||"React class")+": "+O+" type `"+U+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof a[U]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ge.name="Invariant Violation",ge}V=a[U](v,U,F,O,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(re){V=re}V&&!(V instanceof Error)&&(L(Y),x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",F||"React class",O,U,typeof V),L(null)),V instanceof Error&&!(V.message in St)&&(St[V.message]=!0,L(Y),x("Failed %s type: %s",O,V.message),L(null))}}}var M=Array.isArray;function j(a){return M(a)}function fe(a){{var v=typeof Symbol=="function"&&Symbol.toStringTag,O=v&&a[Symbol.toStringTag]||a.constructor.name||"Object";return O}}function le(a){try{return ut(a),!1}catch{return!0}}function ut(a){return""+a}function et(a){if(le(a))return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",fe(a)),ut(a)}var $e=E.ReactCurrentOwner,ye={key:!0,ref:!0,__self:!0,__source:!0},Ie,Be;function hn(a){if(Pe.call(a,"ref")){var v=Object.getOwnPropertyDescriptor(a,"ref").get;if(v&&v.isReactWarning)return!1}return a.ref!==void 0}function Kt(a){if(Pe.call(a,"key")){var v=Object.getOwnPropertyDescriptor(a,"key").get;if(v&&v.isReactWarning)return!1}return a.key!==void 0}function qt(a,v){typeof a.ref=="string"&&$e.current}function Ht(a,v){{var O=function(){Ie||(Ie=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};O.isReactWarning=!0,Object.defineProperty(a,"key",{get:O,configurable:!0})}}function Ue(a,v){{var O=function(){Be||(Be=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",v))};O.isReactWarning=!0,Object.defineProperty(a,"ref",{get:O,configurable:!0})}}var _e=function(a,v,O,F,Y,ee,U){var V={$$typeof:t,type:a,key:v,ref:O,props:U,_owner:ee};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:F}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:Y}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function ft(a,v,O,F,Y){{var ee,U={},V=null,ge=null;O!==void 0&&(et(O),V=""+O),Kt(v)&&(et(v.key),V=""+v.key),hn(v)&&(ge=v.ref,qt(v,Y));for(ee in v)Pe.call(v,ee)&&!ye.hasOwnProperty(ee)&&(U[ee]=v[ee]);if(a&&a.defaultProps){var re=a.defaultProps;for(ee in re)U[ee]===void 0&&(U[ee]=re[ee])}if(V||ge){var ie=typeof a=="function"?a.displayName||a.name||"Unknown":a;V&&Ht(U,ie),ge&&Ue(U,ie)}return _e(a,V,ge,Y,F,$e.current,U)}}var Ct=E.ReactCurrentOwner,Tt=E.ReactDebugCurrentFrame;function je(a){if(a){var v=a._owner,O=Re(a.type,a._source,v?v.type:null);Tt.setExtraStackFrame(O)}else Tt.setExtraStackFrame(null)}var gn;gn=!1;function pn(a){return typeof a=="object"&&a!==null&&a.$$typeof===t}function sr(){{if(Ct.current){var a=N(Ct.current.type);if(a)return`
Check the render method of \``+a+"`."}return""}}function Di(a){return""}var or={};function ki(a){{var v=sr();if(!v){var O=typeof a=="string"?a:a.displayName||a.name;O&&(v=`
Check the top-level render call using <`+O+">.")}return v}}function cr(a,v){{if(!a._store||a._store.validated||a.key!=null)return;a._store.validated=!0;var O=ki(v);if(or[O])return;or[O]=!0;var F="";a&&a._owner&&a._owner!==Ct.current&&(F=" It was passed a child from "+N(a._owner.type)+"."),je(a),x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',O,F),je(null)}}function ar(a,v){{if(typeof a!="object")return;if(j(a))for(var O=0;O<a.length;O++){var F=a[O];pn(F)&&cr(F,v)}else if(pn(a))a._store&&(a._store.validated=!0);else if(a){var Y=w(a);if(typeof Y=="function"&&Y!==a.entries)for(var ee=Y.call(a),U;!(U=ee.next()).done;)pn(U.value)&&cr(U.value,v)}}}function Fi(a){{var v=a.type;if(v==null||typeof v=="string")return;var O;if(typeof v=="function")O=v.propTypes;else if(typeof v=="object"&&(v.$$typeof===l||v.$$typeof===d))O=v.propTypes;else return;if(O){var F=N(v);X(O,a.props,"prop",F,a)}else if(v.PropTypes!==void 0&&!gn){gn=!0;var Y=N(v);x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",Y||"Unknown")}typeof v.getDefaultProps=="function"&&!v.getDefaultProps.isReactClassApproved&&x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ai(a){{for(var v=Object.keys(a.props),O=0;O<v.length;O++){var F=v[O];if(F!=="children"&&F!=="key"){je(a),x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",F),je(null);break}}a.ref!==null&&(je(a),x("Invalid attribute `ref` supplied to `React.Fragment`."),je(null))}}var lr={};function ur(a,v,O,F,Y,ee){{var U=G(a);if(!U){var V="";(a===void 0||typeof a=="object"&&a!==null&&Object.keys(a).length===0)&&(V+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ge=Di();ge?V+=ge:V+=sr();var re;a===null?re="null":j(a)?re="array":a!==void 0&&a.$$typeof===t?(re="<"+(N(a.type)||"Unknown")+" />",V=" Did you accidentally export a JSX literal instead of a component?"):re=typeof a,x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",re,V)}var ie=ft(a,v,O,Y,ee);if(ie==null)return ie;if(U){var Ee=v.children;if(Ee!==void 0)if(F)if(j(Ee)){for(var dt=0;dt<Ee.length;dt++)ar(Ee[dt],a);Object.freeze&&Object.freeze(Ee)}else x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ar(Ee,a)}if(Pe.call(v,"key")){var tt=N(a),me=Object.keys(v).filter(function(Wi){return Wi!=="key"}),mn=me.length>0?"{key: someKey, "+me.join(": ..., ")+": ...}":"{key: someKey}";if(!lr[tt+mn]){var Vi=me.length>0?"{"+me.join(": ..., ")+": ...}":"{}";x(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,mn,tt,Vi,tt),lr[tt+mn]=!0}}return a===r?Ai(ie):Fi(ie),ie}}function Li(a,v,O){return ur(a,v,O,!0)}function ji(a,v,O){return ur(a,v,O,!1)}var Ni=ji,zi=Li;Mt.Fragment=r,Mt.jsx=Ni,Mt.jsxs=zi}()),Mt}var mr;function us(){return mr||(mr=1,process.env.NODE_ENV==="production"?Qt.exports=as():Qt.exports=ls()),Qt.exports}var fs=us();function vr(e,t,n){let{reference:r,floating:i}=e;const o=jt(t),s=oi(t),c=si(s),l=xt(t),f=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[c]/2-i[c]/2;let g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-i.width,y:d};break;default:g={x:r.x,y:r.y}}switch(un(t)){case"start":g[s]-=h*(n&&f?-1:1);break;case"end":g[s]+=h*(n&&f?-1:1);break}return g}const ds=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,c=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let f=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=vr(f,r,l),h=r,g={},m=0;for(let p=0;p<c.length;p++){const{name:w,fn:E}=c[p],{x,y:R,data:I,reset:D}=await E({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:g,rects:f,platform:s,elements:{reference:e,floating:t}});u=x??u,d=R??d,g={...g,[w]:{...g[w],...I}},D&&m<=50&&(m++,typeof D=="object"&&(D.placement&&(h=D.placement),D.rects&&(f=D.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):D.rects),{x:u,y:d}=vr(f,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:g}};async function ci(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:o,rects:s,elements:c,strategy:l}=e,{boundary:f="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=Qn(t,e),m=cs(g),w=c[h?d==="floating"?"reference":"floating":d],E=nn(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:f,rootBoundary:u,strategy:l})),x=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),I=await(o.isElement==null?void 0:o.isElement(R))?await(o.getScale==null?void 0:o.getScale(R))||{x:1,y:1}:{x:1,y:1},D=nn(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:R,strategy:l}):x);return{top:(E.top-D.top+m.top)/I.y,bottom:(D.bottom-E.bottom+m.bottom)/I.y,left:(E.left-D.left+m.left)/I.x,right:(D.right-E.right+m.right)/I.x}}const hs=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:c,platform:l,elements:f}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0,...w}=Qn(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=xt(i),x=jt(c),R=xt(c)===c,I=await(l.isRTL==null?void 0:l.isRTL(f.floating)),D=h||(R||!p?[tn(c)]:rs(c)),C=m!=="none";!h&&C&&D.push(...ss(c,p,m,I));const _=[c,...D],q=await ci(t,w),A=[];let G=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&A.push(q[E]),d){const Z=ns(i,s,I);A.push(q[Z[0]],q[Z[1]])}if(G=[...G,{placement:i,overflows:A}],!A.every(Z=>Z<=0)){var Q,z;const Z=(((Q=o.flip)==null?void 0:Q.index)||0)+1,P=_[Z];if(P)return{data:{index:Z,overflows:G},reset:{placement:P}};let S=(z=G.filter(K=>K.overflows[0]<=0).sort((K,k)=>K.overflows[1]-k.overflows[1])[0])==null?void 0:z.placement;if(!S)switch(g){case"bestFit":{var N;const K=(N=G.filter(k=>{if(C){const T=jt(k.placement);return T===x||T==="y"}return!0}).map(k=>[k.placement,k.overflows.filter(T=>T>0).reduce((T,H)=>T+H,0)]).sort((k,T)=>k[1]-T[1])[0])==null?void 0:N[0];K&&(S=K);break}case"initialPlacement":S=c;break}if(i!==S)return{reset:{placement:S}}}return{}}}},gs=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:o,platform:s,elements:c}=t,{apply:l=()=>{},...f}=Qn(e,t),u=await ci(t,f),d=xt(i),h=un(i),g=jt(i)==="y",{width:m,height:p}=o.floating;let w,E;d==="top"||d==="bottom"?(w=d,E=h===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(E=d,w=h==="end"?"top":"bottom");const x=p-u.top-u.bottom,R=m-u.left-u.right,I=Lt(p-u[w],x),D=Lt(m-u[E],R),C=!t.middlewareData.shift;let _=I,q=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(q=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(_=x),C&&!h){const G=Oe(u.left,0),Q=Oe(u.right,0),z=Oe(u.top,0),N=Oe(u.bottom,0);g?q=m-2*(G!==0||Q!==0?G+Q:Oe(u.left,u.right)):_=p-2*(z!==0||N!==0?z+N:Oe(u.top,u.bottom))}await l({...t,availableWidth:q,availableHeight:_});const A=await s.getDimensions(c.floating);return m!==A.width||p!==A.height?{reset:{rects:!0}}:{}}}};function ai(e){const t=Se(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=be(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,c=en(n)!==o||en(r)!==s;return c&&(n=o,r=s),{width:n,height:r,$:c}}function Yn(e){return ne(e)?e:e.contextElement}function pt(e){const t=Yn(e);if(!be(t))return ke(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=ai(t);let s=(o?en(n.width):n.width)/r,c=(o?en(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const ps=ke(0);function li(e){const t=we(e);return!an()||!t.visualViewport?ps:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ms(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==we(e)?!1:t}function ot(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),o=Yn(e);let s=ke(1);t&&(r?ne(r)&&(s=pt(r)):s=pt(e));const c=ms(o,n,r)?li(o):ke(0);let l=(i.left+c.x)/s.x,f=(i.top+c.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const h=we(o),g=r&&ne(r)?we(r):r;let m=h,p=Pn(m);for(;p&&r&&g!==m;){const w=pt(p),E=p.getBoundingClientRect(),x=Se(p),R=E.left+(p.clientLeft+parseFloat(x.paddingLeft))*w.x,I=E.top+(p.clientTop+parseFloat(x.paddingTop))*w.y;l*=w.x,f*=w.y,u*=w.x,d*=w.y,l+=R,f+=I,m=we(p),p=Pn(m)}}return nn({width:u,height:d,x:l,y:f})}function Jn(e,t){const n=ln(e).scrollLeft;return t?t.left+n:ot(Fe(e)).left+n}function ui(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Jn(e,r)),o=r.top+t.scrollTop;return{x:i,y:o}}function vs(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const o=i==="fixed",s=Fe(r),c=t?cn(t.floating):!1;if(r===s||c&&o)return n;let l={scrollLeft:0,scrollTop:0},f=ke(1);const u=ke(0),d=be(r);if((d||!d&&!o)&&((Ot(r)!=="body"||$t(s))&&(l=ln(r)),be(r))){const g=ot(r);f=pt(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!o?ui(s,l,!0):ke(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-l.scrollLeft*f.x+u.x+h.x,y:n.y*f.y-l.scrollTop*f.y+u.y+h.y}}function bs(e){return Array.from(e.getClientRects())}function ys(e){const t=Fe(e),n=ln(e),r=e.ownerDocument.body,i=Oe(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Oe(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Jn(e);const c=-n.scrollTop;return Se(r).direction==="rtl"&&(s+=Oe(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:c}}function ws(e,t){const n=we(e),r=Fe(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,c=0,l=0;if(i){o=i.width,s=i.height;const f=an();(!f||f&&t==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:c,y:l}}function Rs(e,t){const n=ot(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=be(e)?pt(e):ke(1),s=e.clientWidth*o.x,c=e.clientHeight*o.y,l=i*o.x,f=r*o.y;return{width:s,height:c,x:l,y:f}}function br(e,t,n){let r;if(t==="viewport")r=ws(e,n);else if(t==="document")r=ys(Fe(e));else if(ne(t))r=Rs(t,n);else{const i=li(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return nn(r)}function fi(e,t){const n=Ve(e);return n===t||!ne(n)||ze(n)?!1:Se(n).position==="fixed"||fi(n,t)}function Es(e,t){const n=t.get(e);if(n)return n;let r=Ye(e,[],!1).filter(c=>ne(c)&&Ot(c)!=="body"),i=null;const o=Se(e).position==="fixed";let s=o?Ve(e):e;for(;ne(s)&&!ze(s);){const c=Se(s),l=Hn(s);!l&&c.position==="fixed"&&(i=null),(o?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||$t(s)&&!l&&fi(e,s))?r=r.filter(u=>u!==s):i=c,s=Ve(s)}return t.set(e,r),r}function xs(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const s=[...n==="clippingAncestors"?cn(t)?[]:Es(t,this._c):[].concat(n),r],c=s[0],l=s.reduce((f,u)=>{const d=br(t,u,i);return f.top=Oe(d.top,f.top),f.right=Lt(d.right,f.right),f.bottom=Lt(d.bottom,f.bottom),f.left=Oe(d.left,f.left),f},br(t,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Os(e){const{width:t,height:n}=ai(e);return{width:t,height:n}}function Ss(e,t,n){const r=be(t),i=Fe(t),o=n==="fixed",s=ot(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const l=ke(0);if(r||!r&&!o)if((Ot(t)!=="body"||$t(i))&&(c=ln(t)),r){const h=ot(t,!0,o,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&(l.x=Jn(i));const f=i&&!r&&!o?ui(i,c):ke(0),u=s.left+c.scrollLeft-l.x-f.x,d=s.top+c.scrollTop-l.y-f.y;return{x:u,y:d,width:s.width,height:s.height}}function yn(e){return Se(e).position==="static"}function yr(e,t){if(!be(e)||Se(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function di(e,t){const n=we(e);if(cn(e))return n;if(!be(e)){let i=Ve(e);for(;i&&!ze(i);){if(ne(i)&&!yn(i))return i;i=Ve(i)}return n}let r=yr(e,t);for(;r&&Bi(r)&&yn(r);)r=yr(r,t);return r&&ze(r)&&yn(r)&&!Hn(r)?n:r||Ui(e)||n}const Is=async function(e){const t=this.getOffsetParent||di,n=this.getDimensions,r=await n(e.floating);return{reference:Ss(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cs(e){return Se(e).direction==="rtl"}const Ts={convertOffsetParentRelativeRectToViewportRelativeRect:vs,getDocumentElement:Fe,getClippingRect:xs,getOffsetParent:di,getElementRects:Is,getClientRects:bs,getDimensions:Os,getScale:pt,isElement:ne,isRTL:Cs};function hi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ps(e,t){let n=null,r;const i=Fe(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),o();const f=e.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=f;if(c||t(),!h||!g)return;const m=gt(d),p=gt(i.clientWidth-(u+h)),w=gt(i.clientHeight-(d+g)),E=gt(u),R={rootMargin:-m+"px "+-p+"px "+-w+"px "+-E+"px",threshold:Oe(0,Lt(1,l))||1};let I=!0;function D(C){const _=C[0].intersectionRatio;if(_!==l){if(!I)return s();_?s(!1,_):r=setTimeout(()=>{s(!1,1e-7)},1e3)}_===1&&!hi(f,e.getBoundingClientRect())&&s(),I=!1}try{n=new IntersectionObserver(D,{...R,root:i.ownerDocument})}catch{n=new IntersectionObserver(D,R)}n.observe(e)}return s(!0),o}function _s(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,f=Yn(e),u=i||o?[...f?Ye(f):[],...Ye(t)]:[];u.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const d=f&&c?Ps(f,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(E=>{let[x]=E;x&&x.target===f&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var R;(R=g)==null||R.observe(t)})),n()}),f&&!l&&g.observe(f),g.observe(t));let m,p=l?ot(e):null;l&&w();function w(){const E=ot(e);p&&!hi(p,E)&&n(),p=E,m=requestAnimationFrame(w)}return n(),()=>{var E;u.forEach(x=>{i&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),d==null||d(),(E=g)==null||E.disconnect(),g=null,l&&cancelAnimationFrame(m)}}const Ms=hs,Ds=gs,ks=(e,t,n)=>{const r=new Map,i={platform:Ts,...n},o={...i.platform,_c:r};return ds(e,t,{...i,platform:o})};var Jt=typeof document<"u"?B.useLayoutEffect:B.useEffect;function rn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!rn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const o=i[r];if(!(o==="_owner"&&e.$$typeof)&&!rn(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function gi(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wr(e,t){const n=gi(e);return Math.round(t*n)/n}function wn(e){const t=b.useRef(e);return Jt(()=>{t.current=e}),t}function Fs(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:f}=e,[u,d]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,g]=b.useState(r);rn(h,r)||g(r);const[m,p]=b.useState(null),[w,E]=b.useState(null),x=b.useCallback(k=>{k!==C.current&&(C.current=k,p(k))},[]),R=b.useCallback(k=>{k!==_.current&&(_.current=k,E(k))},[]),I=o||m,D=s||w,C=b.useRef(null),_=b.useRef(null),q=b.useRef(u),A=l!=null,G=wn(l),Q=wn(i),z=wn(f),N=b.useCallback(()=>{if(!C.current||!_.current)return;const k={placement:t,strategy:n,middleware:h};Q.current&&(k.platform=Q.current),ks(C.current,_.current,k).then(T=>{const H={...T,isPositioned:z.current!==!1};Z.current&&!rn(q.current,H)&&(q.current=H,$i.flushSync(()=>{d(H)}))})},[h,t,n,Q,z]);Jt(()=>{f===!1&&q.current.isPositioned&&(q.current.isPositioned=!1,d(k=>({...k,isPositioned:!1})))},[f]);const Z=b.useRef(!1);Jt(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Jt(()=>{if(I&&(C.current=I),D&&(_.current=D),I&&D){if(G.current)return G.current(I,D,N);N()}},[I,D,N,G,A]);const P=b.useMemo(()=>({reference:C,floating:_,setReference:x,setFloating:R}),[x,R]),S=b.useMemo(()=>({reference:I,floating:D}),[I,D]),K=b.useMemo(()=>{const k={position:n,left:0,top:0};if(!S.floating)return k;const T=wr(S.floating,u.x),H=wr(S.floating,u.y);return c?{...k,transform:"translate("+T+"px, "+H+"px)",...gi(S.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:H}},[n,c,S.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:N,refs:P,elements:S,floatingStyles:K}),[u,N,P,S,K])}const As=(e,t)=>({...Ms(e),options:[e,t]}),Ls=(e,t)=>({...Ds(e),options:[e,t]}),pi={...b},js=pi.useInsertionEffect,Ns=js||(e=>e());function Ne(e){const t=b.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ns(()=>{t.current=e}),b.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}const Gn="ArrowUp",Bt="ArrowDown",Je="ArrowLeft",Ge="ArrowRight";function Yt(e,t,n){return Math.floor(e/t)!==n}function At(e,t){return t<0||t>=e.current.length}function Rn(e,t){return de(e,{disabledIndices:t})}function Rr(e,t){return de(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function de(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:i,amount:o=1}=t===void 0?{}:t;const s=e.current;let c=n;do c+=r?-o:o;while(c>=0&&c<=s.length-1&&Gt(s,c,i));return c}function zs(e,t){let{event:n,orientation:r,loop:i,rtl:o,cols:s,disabledIndices:c,minIndex:l,maxIndex:f,prevIndex:u,stopEvent:d=!1}=t,h=u;if(n.key===Gn){if(d&&xe(n),u===-1)h=f;else if(h=de(e,{startingIndex:h,amount:s,decrement:!0,disabledIndices:c}),i&&(u-s<l||h<0)){const g=u%s,m=f%s,p=f-(m-g);m===g?h=f:h=m>g?p:p-s}At(e,h)&&(h=u)}if(n.key===Bt&&(d&&xe(n),u===-1?h=l:(h=de(e,{startingIndex:u,amount:s,disabledIndices:c}),i&&u+s>f&&(h=de(e,{startingIndex:u%s-s,amount:s,disabledIndices:c}))),At(e,h)&&(h=u)),r==="both"){const g=gt(u/s);n.key===(o?Je:Ge)&&(d&&xe(n),u%s!==s-1?(h=de(e,{startingIndex:u,disabledIndices:c}),i&&Yt(h,s,g)&&(h=de(e,{startingIndex:u-u%s-1,disabledIndices:c}))):i&&(h=de(e,{startingIndex:u-u%s-1,disabledIndices:c})),Yt(h,s,g)&&(h=u)),n.key===(o?Ge:Je)&&(d&&xe(n),u%s!==0?(h=de(e,{startingIndex:u,decrement:!0,disabledIndices:c}),i&&Yt(h,s,g)&&(h=de(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:c}))):i&&(h=de(e,{startingIndex:u+(s-u%s),decrement:!0,disabledIndices:c})),Yt(h,s,g)&&(h=u));const m=gt(f/s)===g;At(e,h)&&(i&&m?h=n.key===(o?Ge:Je)?f:de(e,{startingIndex:u-u%s-1,disabledIndices:c}):h=u)}return h}function Vs(e,t,n){const r=[];let i=0;return e.forEach((o,s)=>{let{width:c,height:l}=o;if(c>t&&process.env.NODE_ENV!=="production")throw new Error("[Floating UI]: Invalid grid - item width at index "+s+" is greater than grid columns");let f=!1;for(n&&(i=0);!f;){const u=[];for(let d=0;d<c;d++)for(let h=0;h<l;h++)u.push(i+d+h*t);i%t+c<=t&&u.every(d=>r[d]==null)?(u.forEach(d=>{r[d]=s}),f=!0):i++}}),[...r]}function Ws(e,t,n,r,i){if(e===-1)return-1;const o=n.indexOf(e),s=t[e];switch(i){case"tl":return o;case"tr":return s?o+s.width-1:o;case"bl":return s?o+(s.height-1)*r:o;case"br":return n.lastIndexOf(e)}}function $s(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function Gt(e,t,n){if(n)return n.includes(t);const r=e[t];return r==null||r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true"}var Ce=typeof document<"u"?B.useLayoutEffect:B.useEffect;let Er=!1,Bs=0;const xr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Bs++;function Us(){const[e,t]=b.useState(()=>Er?xr():void 0);return Ce(()=>{e==null&&t(xr())},[]),b.useEffect(()=>{Er=!0},[]),e}const Ks=pi.useId,mi=Ks||Us;let Nt;process.env.NODE_ENV!=="production"&&(Nt=new Set);function En(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Nt)!=null&&e.has(i))){var o;(o=Nt)==null||o.add(i),console.warn(i)}}function qs(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const i="Floating UI: "+n.join(" ");if(!((e=Nt)!=null&&e.has(i))){var o;(o=Nt)==null||o.add(i),console.error(i)}}function Hs(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const Qs=b.createContext(null),Ys=b.createContext(null),Xn=()=>{var e;return((e=b.useContext(Qs))==null?void 0:e.id)||null},Zn=()=>b.useContext(Ys);function Js(e){return"data-floating-ui-"+e}function Dt(e){const t=B.useRef(e);return Ce(()=>{t.current=e}),t}let Or=0;function Gs(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Or);const o=()=>e==null?void 0:e.focus({preventScroll:n});i?o():Or=requestAnimationFrame(o)}function Xt(e,t){let n=e.filter(i=>{var o;return i.parentId===t&&((o=i.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(i=>{var o;return(o=r)==null?void 0:o.some(s=>{var c;return i.parentId===s.id&&((c=i.context)==null?void 0:c.open)})}),n=n.concat(r);return n}function Xs(e,t){let n,r=-1;function i(o,s){s>r&&(n=o,r=s),Xt(e,o).forEach(l=>{i(l.id,s+1)})}return i(t,0),e.find(o=>o.id===n)}const Fn="data-floating-ui-focusable";function Zs(e){return e?e.hasAttribute(Fn)?e:e.querySelector("["+Fn+"]")||e:null}function Sr(e){return be(e.target)&&e.target.tagName==="BUTTON"}function Ir(e){return ii(e)}function eo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,elements:{domReference:o}}=e,{enabled:s=!0,event:c="click",toggle:l=!0,ignoreMouse:f=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,h=b.useRef(),g=b.useRef(!1),m=b.useMemo(()=>({onPointerDown(p){h.current=p.pointerType},onMouseDown(p){const w=h.current;p.button===0&&c!=="click"&&(hr(w)&&f||(n&&l&&(!(i.current.openEvent&&d)||i.current.openEvent.type==="mousedown")?r(!1,p.nativeEvent,"click"):(p.preventDefault(),r(!0,p.nativeEvent,"click"))))},onClick(p){const w=h.current;if(c==="mousedown"&&h.current){h.current=void 0;return}hr(w)&&f||(n&&l&&(!(i.current.openEvent&&d)||i.current.openEvent.type==="click")?r(!1,p.nativeEvent,"click"):r(!0,p.nativeEvent,"click"))},onKeyDown(p){h.current=void 0,!(p.defaultPrevented||!u||Sr(p))&&(p.key===" "&&!Ir(o)&&(p.preventDefault(),g.current=!0),p.key==="Enter"&&r(!(n&&l),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!u||Sr(p)||Ir(o)||p.key===" "&&g.current&&(g.current=!1,r(!(n&&l),p.nativeEvent,"click"))}}),[i,o,c,f,u,r,n,d,l]);return b.useMemo(()=>s?{reference:m}:{},[s,m])}const to={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},no={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Cr=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function ro(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:o}=e,{enabled:s=!0,escapeKey:c=!0,outsidePress:l=!0,outsidePressEvent:f="pointerdown",referencePress:u=!1,referencePressEvent:d="pointerdown",ancestorScroll:h=!1,bubbles:g,capture:m}=t,p=Zn(),w=Ne(typeof l=="function"?l:()=>!1),E=typeof l=="function"?w:l,x=b.useRef(!1),R=b.useRef(!1),{escapeKey:I,outsidePress:D}=Cr(g),{escapeKey:C,outsidePress:_}=Cr(m),q=b.useRef(!1),A=Ne(P=>{var S;if(!n||!s||!c||P.key!=="Escape"||q.current)return;const K=(S=o.current.floatingContext)==null?void 0:S.nodeId,k=p?Xt(p.nodesRef.current,K):[];if(!I&&(P.stopPropagation(),k.length>0)){let T=!0;if(k.forEach(H=>{var oe;if((oe=H.context)!=null&&oe.open&&!H.context.dataRef.current.__escapeKeyBubbles){T=!1;return}}),!T)return}r(!1,Yi(P)?P.nativeEvent:P,"escape-key")}),G=Ne(P=>{var S;const K=()=>{var k;A(P),(k=Pt(P))==null||k.removeEventListener("keydown",K)};(S=Pt(P))==null||S.addEventListener("keydown",K)}),Q=Ne(P=>{var S;const K=x.current;x.current=!1;const k=R.current;if(R.current=!1,f==="click"&&k||K||typeof E=="function"&&!E(P))return;const T=Pt(P),H="["+Js("inert")+"]",oe=Dn(i.floating).querySelectorAll(H);let ce=ne(T)?T:null;for(;ce&&!ze(ce);){const ae=Ve(ce);if(ze(ae)||!ne(ae))break;ce=ae}if(oe.length&&ne(T)&&!Ji(T)&&!_n(T,i.floating)&&Array.from(oe).every(ae=>!_n(ce,ae)))return;if(be(T)&&Z){const ae=ze(T),ue=Se(T),he=/auto|scroll/,Xe=ae||he.test(ue.overflowX),Le=ae||he.test(ue.overflowY),at=Xe&&T.clientWidth>0&&T.scrollWidth>T.clientWidth,We=Le&&T.clientHeight>0&&T.scrollHeight>T.clientHeight,lt=ue.direction==="rtl",Ze=We&&(lt?P.offsetX<=T.offsetWidth-T.clientWidth:P.offsetX>T.clientWidth),Re=at&&P.offsetY>T.clientHeight;if(Ze||Re)return}const Te=(S=o.current.floatingContext)==null?void 0:S.nodeId,Ae=p&&Xt(p.nodesRef.current,Te).some(ae=>{var ue;return bn(P,(ue=ae.context)==null?void 0:ue.elements.floating)});if(bn(P,i.floating)||bn(P,i.domReference)||Ae)return;const ct=p?Xt(p.nodesRef.current,Te):[];if(ct.length>0){let ae=!0;if(ct.forEach(ue=>{var he;if((he=ue.context)!=null&&he.open&&!ue.context.dataRef.current.__outsidePressBubbles){ae=!1;return}}),!ae)return}r(!1,P,"outside-press")}),z=Ne(P=>{var S;const K=()=>{var k;Q(P),(k=Pt(P))==null||k.removeEventListener(f,K)};(S=Pt(P))==null||S.addEventListener(f,K)});b.useEffect(()=>{if(!n||!s)return;o.current.__escapeKeyBubbles=I,o.current.__outsidePressBubbles=D;let P=-1;function S(oe){r(!1,oe,"ancestor-scroll")}function K(){window.clearTimeout(P),q.current=!0}function k(){P=window.setTimeout(()=>{q.current=!1},an()?5:0)}const T=Dn(i.floating);c&&(T.addEventListener("keydown",C?G:A,C),T.addEventListener("compositionstart",K),T.addEventListener("compositionend",k)),E&&T.addEventListener(f,_?z:Q,_);let H=[];return h&&(ne(i.domReference)&&(H=Ye(i.domReference)),ne(i.floating)&&(H=H.concat(Ye(i.floating))),!ne(i.reference)&&i.reference&&i.reference.contextElement&&(H=H.concat(Ye(i.reference.contextElement)))),H=H.filter(oe=>{var ce;return oe!==((ce=T.defaultView)==null?void 0:ce.visualViewport)}),H.forEach(oe=>{oe.addEventListener("scroll",S,{passive:!0})}),()=>{c&&(T.removeEventListener("keydown",C?G:A,C),T.removeEventListener("compositionstart",K),T.removeEventListener("compositionend",k)),E&&T.removeEventListener(f,_?z:Q,_),H.forEach(oe=>{oe.removeEventListener("scroll",S)}),window.clearTimeout(P)}},[o,i,c,E,f,n,r,h,s,I,D,A,C,G,Q,_,z]),b.useEffect(()=>{x.current=!1},[E,f]);const N=b.useMemo(()=>({onKeyDown:A,...u&&{[to[d]]:P=>{r(!1,P.nativeEvent,"reference-press")},...d!=="click"&&{onClick(P){r(!1,P.nativeEvent,"reference-press")}}}}),[A,r,u,d]),Z=b.useMemo(()=>({onKeyDown:A,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[no[f]]:()=>{x.current=!0}}),[A,f]);return b.useMemo(()=>s?{reference:N,floating:Z}:{},[s,N,Z])}function io(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=mi(),o=b.useRef({}),[s]=b.useState(()=>Hs()),c=Xn()!=null;if(process.env.NODE_ENV!=="production"){const g=r.reference;g&&!ne(g)&&qs("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[l,f]=b.useState(r.reference),u=Ne((g,m,p)=>{o.current.openEvent=g?m:void 0,s.emit("openchange",{open:g,event:m,reason:p,nested:c}),n==null||n(g,m,p)}),d=b.useMemo(()=>({setPositionReference:f}),[]),h=b.useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return b.useMemo(()=>({dataRef:o,open:t,onOpenChange:u,elements:h,events:s,floatingId:i,refs:d}),[t,u,h,s,i,d])}function so(e){e===void 0&&(e={});const{nodeId:t}=e,n=io({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[o,s]=b.useState(null),[c,l]=b.useState(null),u=(i==null?void 0:i.domReference)||o,d=b.useRef(null),h=Zn();Ce(()=>{u&&(d.current=u)},[u]);const g=Fs({...e,elements:{...i,...c&&{reference:c}}}),m=b.useCallback(R=>{const I=ne(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),contextElement:R}:R;l(I),g.refs.setReference(I)},[g.refs]),p=b.useCallback(R=>{(ne(R)||R===null)&&(d.current=R,s(R)),(ne(g.refs.reference.current)||g.refs.reference.current===null||R!==null&&!ne(R))&&g.refs.setReference(R)},[g.refs]),w=b.useMemo(()=>({...g.refs,setReference:p,setPositionReference:m,domReference:d}),[g.refs,p,m]),E=b.useMemo(()=>({...g.elements,domReference:u}),[g.elements,u]),x=b.useMemo(()=>({...g,...r,refs:w,elements:E,nodeId:t}),[g,w,E,t,r]);return Ce(()=>{r.dataRef.current.floatingContext=x;const R=h==null?void 0:h.nodesRef.current.find(I=>I.id===t);R&&(R.context=x)}),b.useMemo(()=>({...g,context:x,refs:w,elements:E}),[g,w,E,x])}const Tr="active",Pr="selected";function xn(e,t,n){const r=new Map,i=n==="item";let o=e;if(i&&e){const{[Tr]:s,[Pr]:c,...l}=e;o=l}return{...n==="floating"&&{tabIndex:-1,[Fn]:""},...o,...t.map(s=>{const c=s?s[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((s,c)=>(c&&Object.entries(c).forEach(l=>{let[f,u]=l;if(!(i&&[Tr,Pr].includes(f)))if(f.indexOf("on")===0){if(r.has(f)||r.set(f,[]),typeof u=="function"){var d;(d=r.get(f))==null||d.push(u),s[f]=function(){for(var h,g=arguments.length,m=new Array(g),p=0;p<g;p++)m[p]=arguments[p];return(h=r.get(f))==null?void 0:h.map(w=>w(...m)).find(w=>w!==void 0)}}}else s[f]=u}),s),{})}}function oo(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),i=b.useCallback(c=>xn(c,e,"reference"),t),o=b.useCallback(c=>xn(c,e,"floating"),n),s=b.useCallback(c=>xn(c,e,"item"),r);return b.useMemo(()=>({getReferenceProps:i,getFloatingProps:o,getItemProps:s}),[i,o,s])}const co="Escape";function fn(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function On(e,t){return fn(t,e===Gn||e===Bt,e===Je||e===Ge)}function Sn(e,t,n){return fn(t,e===Bt,n?e===Je:e===Ge)||e==="Enter"||e===" "||e===""}function _r(e,t,n){return fn(t,n?e===Je:e===Ge,e===Bt)}function Mr(e,t,n,r){const i=n?e===Ge:e===Je,o=e===Gn;return t==="both"||t==="horizontal"&&r&&r>1?e===co:fn(t,i,o)}function ao(e,t){const{open:n,onOpenChange:r,elements:i}=e,{listRef:o,activeIndex:s,onNavigate:c=()=>{},enabled:l=!0,selectedIndex:f=null,allowEscape:u=!1,loop:d=!1,nested:h=!1,rtl:g=!1,virtual:m=!1,focusItemOnOpen:p="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:E=!0,disabledIndices:x=void 0,orientation:R="vertical",cols:I=1,scrollItemIntoView:D=!0,virtualItemRef:C,itemSizes:_,dense:q=!1}=t;process.env.NODE_ENV!=="production"&&(u&&(d||En("`useListNavigation` looping must be enabled to allow escaping."),m||En("`useListNavigation` must be virtual to allow escaping.")),R==="vertical"&&I>1&&En("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const A=Zs(i.floating),G=Dt(A),Q=Xn(),z=Zn();Ce(()=>{e.dataRef.current.orientation=R},[e,R]);const N=Ne(()=>{c(S.current===-1?null:S.current)}),Z=Xi(i.domReference),P=b.useRef(p),S=b.useRef(f??-1),K=b.useRef(null),k=b.useRef(!0),T=b.useRef(N),H=b.useRef(!!i.floating),oe=b.useRef(n),ce=b.useRef(!1),Te=b.useRef(!1),Ae=Dt(x),ct=Dt(n),ae=Dt(D),ue=Dt(f),[he,Xe]=b.useState(),[Le,at]=b.useState(),We=Ne(()=>{function L(j){m?(Xe(j.id),z==null||z.events.emit("virtualfocus",j),C&&(C.current=j)):Gs(j,{sync:ce.current,preventScroll:!0})}const X=o.current[S.current];X&&L(X),(ce.current?j=>j():requestAnimationFrame)(()=>{const j=o.current[S.current]||X;if(!j)return;X||L(j);const fe=ae.current;fe&&Ze&&(Te.current||!k.current)&&(j.scrollIntoView==null||j.scrollIntoView(typeof fe=="boolean"?{block:"nearest",inline:"nearest"}:fe))})});Ce(()=>{l&&(n&&i.floating?P.current&&f!=null&&(Te.current=!0,S.current=f,N()):H.current&&(S.current=-1,T.current()))},[l,n,i.floating,f,N]),Ce(()=>{if(l&&n&&i.floating)if(s==null){if(ce.current=!1,ue.current!=null)return;if(H.current&&(S.current=-1,We()),(!oe.current||!H.current)&&P.current&&(K.current!=null||P.current===!0&&K.current==null)){let L=0;const X=()=>{o.current[0]==null?(L<2&&(L?requestAnimationFrame:queueMicrotask)(X),L++):(S.current=K.current==null||Sn(K.current,R,g)||h?Rn(o,Ae.current):Rr(o,Ae.current),K.current=null,N())};X()}}else At(o,s)||(S.current=s,We(),Te.current=!1)},[l,n,i.floating,s,ue,h,o,R,g,N,We,Ae]),Ce(()=>{var L;if(!l||i.floating||!z||m||!H.current)return;const X=z.nodesRef.current,M=(L=X.find(le=>le.id===Q))==null||(L=L.con