@react-hive/honey-layout 18.4.0 → 18.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/use-honey-media-query.d.ts +4 -0
- package/dist/index.cjs +32 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.dev.cjs +249 -233
- package/dist/index.dev.cjs.map +1 -1
- package/dist/index.mjs +23 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +32 -19
package/dist/index.cjs
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
/*! For license information please see index.cjs.LICENSE.txt */
|
|
2
|
-
(()=>{var e={117(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Function]",s="[object Object]",c=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a[i]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a[u]=a["[object Map]"]=a["[object Number]"]=a[s]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var f,d,p,v="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,h=v||m||Function("return this")(),y=t&&!t.nodeType&&t,g=y&&e&&!e.nodeType&&e,b=g&&g.exports===y,x=b&&v.process,w=function(){try{return g&&g.require&&g.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),E=w&&w.isTypedArray,R=Array.prototype,O=Function.prototype,C=Object.prototype,S=h["__core-js_shared__"],_=O.toString,j=C.hasOwnProperty,L=(f=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",k=C.toString,T=_.call(Object),A=RegExp("^"+_.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=b?h.Buffer:void 0,M=h.Symbol,D=h.Uint8Array,$=(P&&P.allocUnsafe,d=Object.getPrototypeOf,p=Object,function(e){return d(p(e))}),I=Object.create,N=C.propertyIsEnumerable,H=R.splice,F=M?M.toStringTag:void 0,W=function(){try{var e=se(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=P?P.isBuffer:void 0,B=Math.max,U=Date.now,K=se(h,"Map"),V=se(Object,"create"),q=function(){function e(){}return function(t){if(!be(t))return{};if(I)return I(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=this.__data__=new Y(e);this.size=t.size}function Q(e,t,n){(void 0!==n&&!de(e[t],n)||void 0===n&&!(t in e))&&te(e,t,n)}function J(e,t,n){var r=e[t];j.call(e,t)&&de(r,n)&&(void 0!==n||t in e)||te(e,t,n)}function ee(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}function te(e,t,n){"__proto__"==t&&W?W(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}X.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(V){var n=t[e];return n===r?void 0:n}return j.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:j.call(t,e)},X.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=ee(t,e);return!(n<0||(n==t.length-1?t.pop():H.call(t,n,1),--this.size,0))},Y.prototype.get=function(e){var t=this.__data__,n=ee(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return ee(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(K||Y),string:new X}},G.prototype.delete=function(e){var t=ue(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return ue(this,e).get(e)},G.prototype.has=function(e){return ue(this,e).has(e)},G.prototype.set=function(e,t){var n=ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new Y,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!K||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(e,t),this.size=n.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=j.call(e,F),n=e[F];try{e[F]=void 0;var r=!0}catch(e){}var o=k.call(e);return r&&(t?e[F]=n:delete e[F]),o}(e):function(e){return k.call(e)}(e)}function re(e){return xe(e)&&ne(e)==i}function oe(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),i=n(e),u=i.length;u--;){var s=i[++r];if(!1===t(o[s],s,o))break}}(t,function(i,u){if(o||(o=new Z),be(i))!function(e,t,n,r,o,i,u){var c=ae(e,n),l=ae(t,n),a=u.get(l);if(a)Q(e,n,a);else{var f,d,p,v,m,h=i?i(c,l,n+"",e,t,u):void 0,y=void 0===h;if(y){var g=ve(l),b=!g&&he(l),x=!g&&!b&&we(l);h=l,g||b||x?ve(c)?h=c:xe(m=c)&&me(m)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(c):b?(y=!1,h=function(e){return e.slice()}(l)):x?(y=!1,v=new(p=(f=l).buffer).constructor(p.byteLength),new D(v).set(new D(p)),d=v,h=new f.constructor(d,f.byteOffset,f.length)):h=[]:function(e){if(!xe(e)||ne(e)!=s)return!1;var t=$(e);if(null===t)return!0;var n=j.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==T}(l)||pe(l)?(h=c,pe(c)?h=function(e){return function(e,t,n){var r=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var u=t[o],s=void 0;void 0===s&&(s=e[u]),r?te(n,u,s):J(n,u,s)}return n}(e,Ee(e))}(c):be(c)&&!ye(c)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):y=!1}y&&(u.set(l,h),o(h,l,r,i,u),u.delete(l)),Q(e,n,h)}}(e,t,u,n,oe,r,o);else{var c=r?r(ae(e,u),i,u+"",e,t,o):void 0;void 0===c&&(c=i),Q(e,u,c)}},Ee)}var ie=W?function(e,t){return W(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ce;function ue(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function se(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!be(e)||function(e){return!!L&&L in e}(e))&&(ye(e)?A:c).test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function ce(e,t){var n=typeof e;return!!(t=t??o)&&("number"==n||"symbol"!=n&&l.test(e))&&e>-1&&e%1==0&&e<t}function le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function ae(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fe=function(e){var t=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ie);function de(e,t){return e===t||e!=e&&t!=t}var pe=re(function(){return arguments}())?re:function(e){return xe(e)&&j.call(e,"callee")&&!N.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&ge(e.length)&&!ye(e)}var he=z||function(){return!1};function ye(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ge(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function be(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=E?function(e){return function(t){return e(t)}}(E):function(e){return xe(e)&&ge(e.length)&&!!a[ne(e)]};function Ee(e){return me(e)?function(e,t){var n=ve(e),r=!n&&pe(e),o=!n&&!r&&he(e),i=!n&&!r&&!o&&we(e),u=n||r||o||i,s=u?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=s.length;for(var l in e)!t&&!j.call(e,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||ce(l,c))||s.push(l);return s}(e,!0):function(e){if(!be(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=le(e),n=[];for(var r in e)("constructor"!=r||!t&&j.call(e,r))&&n.push(r);return n}(e)}var Re,Oe=(Re=function(e,t,n){oe(e,t,n)},function(e,t){return fe(function(e,t,n){return t=B(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=B(r.length-t,0),u=Array(i);++o<i;)u[o]=r[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=r[o];return s[t]=n(u),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,Ce),e+"")}(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Re.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!be(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&ce(t,n.length):"string"==r&&t in n)&&de(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var u=t[n];u&&Re(e,u,n)}return e}));function Ce(e){return e}e.exports=Oe},551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,s,c,l,a=0,f=!1,d=!1,g=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,s=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);c=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return c=void 0,g&&o?b(e):(o=i=void 0,s)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===c)return function(e){return a=e,c=setTimeout(w,t),f?b(e):s}(l);if(d)return c=setTimeout(w,t),b(l)}return void 0===c&&(c=setTimeout(w,t)),s}return t=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),R.cancel=function(){void 0!==c&&clearTimeout(c),a=0,o=l=i=c=void 0},R.flush=function(){return void 0===c?s:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}},797(e,t,n){"use strict";var r=n(953);function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(o(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal"),c=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(o(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:s,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=u.p;try{if(c.T=null,u.p=2,e)return e()}finally{c.T=t,u.p=n,u.d.f()}}},481(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(797)},791(e,t){"use strict";var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o},987(e,t,n){"use strict";e.exports=n(791)},953(e){"use strict";e.exports=require("react")}};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},(()=>{const e=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const u={};t=t||[null,e({}),e([]),e(e)];for(var s=2&o&&r;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(e=>u[e]=()=>r[e]);return u.default=()=>r,n.d(i,u),i}})(),n.d=(e,t)=>{if(Array.isArray(t))for(var r=0;r<t.length;){var o=t[r++],i=t[r++];n.o(e,o)?0===i&&r++:0===i?Object.defineProperty(e,o,{enumerable:!0,value:t[r++]}):Object.defineProperty(e,o,{enumerable:!0,get:i})}else for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);let r={};(()=>{"use strict";n.r(r),n.d(r,{HONEY_LAYOUT_CSS_PROPERTY_PREFIX:()=>"$",HoneyBox:()=>v,HoneyContextMenu:()=>Sr,HoneyContextMenuContentOptionStyled:()=>Rr,HoneyFlex:()=>y,HoneyGrid:()=>O,HoneyGridColumn:()=>S,HoneyGridColumnStyled:()=>E,HoneyLayerRegistry:()=>Lr,HoneyLayoutProvider:()=>kr,HoneyLayoutThemeOverride:()=>Pr,HoneyLazyContent:()=>T,HoneyList:()=>k,HoneyOverlay:()=>K,HoneyPopup:()=>Er,HoneyPopupContext:()=>V,HoneyStatusContent:()=>j,__DEV__:()=>t,applyBreakpointStyles:()=>f,createStyles:()=>a,getHoneyListItemId:()=>_,honeyVisibilityTransitionEffect:()=>Mr,mergeRefs:()=>c,resolveScreenState:()=>d,resolveSpacing:()=>Dr,useHoneyGridContext:()=>C,useHoneyLayerRegistryContext:()=>jr,useHoneyLayout:()=>W,useHoneyMediaQuery:()=>H,useHoneyOverlay:()=>U,useHoneyPopup:()=>br,useHoneyPopupContext:()=>xr,useRegisterHoneyOverlay:()=>z,warnOnce:()=>h});const e=require("@react-hive/honey-style"),t=!1;function o(e,t){if(!e)throw new Error(t)}t&&"undefined"!=typeof window&&!process.env.VITEST_WORKER_ID&&console.info("[@react-hive/honey-layout]: You are running in development mode. This build is not optimized for production and may include extra checks or logs.");const i=e=>"function"==typeof e,u=(e,...t)=>"function"==typeof e?e(...t):e,s=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,c=(...e)=>t=>{e.forEach(e=>{i(e)?e(t):"object"==typeof e&&(e.current=t)})},l=e=>"$"===e[0],a=t=>({theme:n,...r})=>e.css`
|
|
3
|
-
${((e,t)=>Object.entries(e).filter(([e,n])=>"xs"===t&&
|
|
4
|
-
${(e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)})(
|
|
2
|
+
(()=>{var e={117(e,t,n){e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",u="[object Function]",c="[object Object]",s=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a[i]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a[u]=a["[object Map]"]=a["[object Number]"]=a[c]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1;var f,d,p,v="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,m="object"==typeof self&&self&&self.Object===Object&&self,h=v||m||Function("return this")(),y=t&&!t.nodeType&&t,g=y&&e&&!e.nodeType&&e,b=g&&g.exports===y,x=b&&v.process,w=function(){try{return g&&g.require&&g.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),E=w&&w.isTypedArray,R=Array.prototype,O=Function.prototype,C=Object.prototype,S=h["__core-js_shared__"],_=O.toString,j=C.hasOwnProperty,L=(f=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",k=C.toString,T=_.call(Object),A=RegExp("^"+_.call(j).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),P=b?h.Buffer:void 0,M=h.Symbol,D=h.Uint8Array,$=(P&&P.allocUnsafe,d=Object.getPrototypeOf,p=Object,function(e){return d(p(e))}),I=Object.create,N=C.propertyIsEnumerable,H=R.splice,F=M?M.toStringTag:void 0,W=function(){try{var e=ce(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),z=P?P.isBuffer:void 0,B=Math.max,U=Date.now,K=ce(h,"Map"),V=ce(Object,"create"),q=function(){function e(){}return function(t){if(!be(t))return{};if(I)return I(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function X(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Y(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function G(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Z(e){var t=this.__data__=new Y(e);this.size=t.size}function Q(e,t,n){(void 0!==n&&!de(e[t],n)||void 0===n&&!(t in e))&&te(e,t,n)}function J(e,t,n){var r=e[t];j.call(e,t)&&de(r,n)&&(void 0!==n||t in e)||te(e,t,n)}function ee(e,t){for(var n=e.length;n--;)if(de(e[n][0],t))return n;return-1}function te(e,t,n){"__proto__"==t&&W?W(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}X.prototype.clear=function(){this.__data__=V?V(null):{},this.size=0},X.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},X.prototype.get=function(e){var t=this.__data__;if(V){var n=t[e];return n===r?void 0:n}return j.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:j.call(t,e)},X.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=V&&void 0===t?r:t,this},Y.prototype.clear=function(){this.__data__=[],this.size=0},Y.prototype.delete=function(e){var t=this.__data__,n=ee(t,e);return!(n<0||(n==t.length-1?t.pop():H.call(t,n,1),--this.size,0))},Y.prototype.get=function(e){var t=this.__data__,n=ee(t,e);return n<0?void 0:t[n][1]},Y.prototype.has=function(e){return ee(this.__data__,e)>-1},Y.prototype.set=function(e,t){var n=this.__data__,r=ee(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},G.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(K||Y),string:new X}},G.prototype.delete=function(e){var t=ue(this,e).delete(e);return this.size-=t?1:0,t},G.prototype.get=function(e){return ue(this,e).get(e)},G.prototype.has=function(e){return ue(this,e).has(e)},G.prototype.set=function(e,t){var n=ue(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Z.prototype.clear=function(){this.__data__=new Y,this.size=0},Z.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Z.prototype.get=function(e){return this.__data__.get(e)},Z.prototype.has=function(e){return this.__data__.has(e)},Z.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Y){var r=n.__data__;if(!K||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new G(r)}return n.set(e,t),this.size=n.size,this};function ne(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":F&&F in Object(e)?function(e){var t=j.call(e,F),n=e[F];try{e[F]=void 0;var r=!0}catch(e){}var o=k.call(e);return r&&(t?e[F]=n:delete e[F]),o}(e):function(e){return k.call(e)}(e)}function re(e){return xe(e)&&ne(e)==i}function oe(e,t,n,r,o){e!==t&&function(e,t,n){for(var r=-1,o=Object(e),i=n(e),u=i.length;u--;){var c=i[++r];if(!1===t(o[c],c,o))break}}(t,function(i,u){if(o||(o=new Z),be(i))!function(e,t,n,r,o,i,u){var s=ae(e,n),l=ae(t,n),a=u.get(l);if(a)Q(e,n,a);else{var f,d,p,v,m,h=i?i(s,l,n+"",e,t,u):void 0,y=void 0===h;if(y){var g=ve(l),b=!g&&he(l),x=!g&&!b&&we(l);h=l,g||b||x?ve(s)?h=s:xe(m=s)&&me(m)?h=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(s):b?(y=!1,h=function(e){return e.slice()}(l)):x?(y=!1,v=new(p=(f=l).buffer).constructor(p.byteLength),new D(v).set(new D(p)),d=v,h=new f.constructor(d,f.byteOffset,f.length)):h=[]:function(e){if(!xe(e)||ne(e)!=c)return!1;var t=$(e);if(null===t)return!0;var n=j.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&_.call(n)==T}(l)||pe(l)?(h=s,pe(s)?h=function(e){return function(e,t,n){var r=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var u=t[o],c=void 0;void 0===c&&(c=e[u]),r?te(n,u,c):J(n,u,c)}return n}(e,Ee(e))}(s):be(s)&&!ye(s)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):y=!1}y&&(u.set(l,h),o(h,l,r,i,u),u.delete(l)),Q(e,n,h)}}(e,t,u,n,oe,r,o);else{var s=r?r(ae(e,u),i,u+"",e,t,o):void 0;void 0===s&&(s=i),Q(e,u,s)}},Ee)}var ie=W?function(e,t){return W(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:Ce;function ue(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function ce(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!be(e)||function(e){return!!L&&L in e}(e))&&(ye(e)?A:s).test(function(e){if(null!=e){try{return _.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function se(e,t){var n=typeof e;return!!(t=t??o)&&("number"==n||"symbol"!=n&&l.test(e))&&e>-1&&e%1==0&&e<t}function le(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||C)}function ae(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var fe=function(e){var t=0,n=0;return function(){var r=U(),o=16-(r-n);if(n=r,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(ie);function de(e,t){return e===t||e!=e&&t!=t}var pe=re(function(){return arguments}())?re:function(e){return xe(e)&&j.call(e,"callee")&&!N.call(e,"callee")},ve=Array.isArray;function me(e){return null!=e&&ge(e.length)&&!ye(e)}var he=z||function(){return!1};function ye(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ge(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}function be(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function xe(e){return null!=e&&"object"==typeof e}var we=E?function(e){return function(t){return e(t)}}(E):function(e){return xe(e)&&ge(e.length)&&!!a[ne(e)]};function Ee(e){return me(e)?function(e,t){var n=ve(e),r=!n&&pe(e),o=!n&&!r&&he(e),i=!n&&!r&&!o&&we(e),u=n||r||o||i,c=u?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],s=c.length;for(var l in e)!t&&!j.call(e,l)||u&&("length"==l||o&&("offset"==l||"parent"==l)||i&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||se(l,s))||c.push(l);return c}(e,!0):function(e){if(!be(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=le(e),n=[];for(var r in e)("constructor"!=r||!t&&j.call(e,r))&&n.push(r);return n}(e)}var Re,Oe=(Re=function(e,t,n){oe(e,t,n)},function(e,t){return fe(function(e,t,n){return t=B(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=B(r.length-t,0),u=Array(i);++o<i;)u[o]=r[t+o];o=-1;for(var c=Array(t+1);++o<t;)c[o]=r[o];return c[t]=n(u),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,c)}}(e,t,Ce),e+"")}(function(e,t){var n=-1,r=t.length,o=r>1?t[r-1]:void 0,i=r>2?t[2]:void 0;for(o=Re.length>3&&"function"==typeof o?(r--,o):void 0,i&&function(e,t,n){if(!be(n))return!1;var r=typeof t;return!!("number"==r?me(n)&&se(t,n.length):"string"==r&&t in n)&&de(n[t],e)}(t[0],t[1],i)&&(o=r<3?void 0:o,r=1),e=Object(e);++n<r;){var u=t[n];u&&Re(e,u,n)}return e}));function Ce(e){return e}e.exports=Oe},551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,c,s,l,a=0,f=!1,d=!1,g=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,c=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return s=void 0,g&&o?b(e):(o=i=void 0,c)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===s)return function(e){return a=e,s=setTimeout(w,t),f?b(e):c}(l);if(d)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),c}return t=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),R.cancel=function(){void 0!==s&&clearTimeout(s),a=0,o=l=i=s=void 0},R.flush=function(){return void 0===s?c:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}}};const t={};function n(r){const o=t[r];if(void 0!==o)return o.exports;const i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.cw=e=>{var t;return()=>{if(e){var n=e;e=0,t={exports:{}},n.call(t.exports,t,t.exports)}return t.exports}},(()=>{const e=Object.getPrototypeOf;let t;n.t=function(r,o){if(1&o&&(r=this(r)),8&o)return r;if("object"==typeof r&&r){if(4&o&&r.__esModule)return r;if(16&o&&"function"==typeof r.then)return r}const i=Object.create(null);n.r(i);const u={};t=t||[null,e({}),e([]),e(e)];for(var c=2&o&&r;("object"==typeof c||"function"==typeof c)&&!~t.indexOf(c);c=e(c))Object.getOwnPropertyNames(c).forEach(e=>u[e]=()=>r[e]);return u.default=()=>r,n.d(i,u),i}})(),n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);let r={};(()=>{"use strict";n.r(r),n.d(r,{HONEY_LAYOUT_CSS_PROPERTY_PREFIX:()=>"$",HoneyBox:()=>b,HoneyContextMenu:()=>jr,HoneyContextMenuContentOptionStyled:()=>Cr,HoneyFlex:()=>E,HoneyGrid:()=>_,HoneyGridColumn:()=>L,HoneyGridColumnStyled:()=>C,HoneyLayerRegistry:()=>Tr,HoneyLayoutProvider:()=>Ar,HoneyLayoutThemeOverride:()=>Dr,HoneyLazyContent:()=>M,HoneyList:()=>P,HoneyOverlay:()=>X,HoneyPopup:()=>Or,HoneyPopupContext:()=>Y,HoneyStatusContent:()=>T,__DEV__:()=>s,applyBreakpointStyles:()=>h,createStyles:()=>m,getHoneyListItemId:()=>k,honeyVisibilityTransitionEffect:()=>$r,mergeRefs:()=>p,resolveScreenState:()=>y,resolveSpacing:()=>Ir,useHoneyGridContext:()=>j,useHoneyLayerRegistryContext:()=>kr,useHoneyLayout:()=>U,useHoneyMediaQuery:()=>z,useHoneyOverlay:()=>q,useHoneyPopup:()=>wr,useHoneyPopupContext:()=>Er,useRegisterHoneyOverlay:()=>K,warnOnce:()=>w});var e=n.cw(function(e,t){var n=u();function r(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var i={d:{f:o,r:function(){throw Error(r(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},c=Symbol.for("react.portal"),s=(Symbol.for("react.recoverable"),Symbol.for("react.optimistic_key")),l=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;t.createPortal=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!t||1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType)throw Error(r(299));return function(e,t,n){var r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:c,key:null==r?null:r===s?s:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=l.T,n=i.p;try{if(l.T=null,i.p=2,e)return e()}finally{l.T=t,i.p=n,i.d.f()}}}),t=n.cw(function(t,n){!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),t.exports=e()}),o=n.cw(function(e,t){var n=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function o(e,t,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==t.key&&(o=""+t.key),"key"in t)for(var i in r={},t)"key"!==i&&(r[i]=t[i]);else r=t;return t=r.ref,{$$typeof:n,type:e,key:o,ref:void 0!==t?t:null,props:r}}t.Fragment=r,t.jsx=o,t.jsxs=o}),i=n.cw(function(e,t){e.exports=o()}),u=n.cw(function(e,t){e.exports=require("react")});const c=require("@react-hive/honey-style"),s=!1;function l(e,t){if(!e)throw new Error(t)}s&&"undefined"!=typeof window&&!process.env.VITEST_WORKER_ID&&console.info("[@react-hive/honey-layout]: You are running in development mode. This build is not optimized for production and may include extra checks or logs.");const a=e=>"function"==typeof e,f=(e,...t)=>"function"==typeof e?e(...t):e,d=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,p=(...e)=>t=>{e.forEach(e=>{a(e)?e(t):"object"==typeof e&&(e.current=t)})},v=e=>"$"===e[0],m=e=>({theme:t,...n})=>c.css`
|
|
3
|
+
${((e,t)=>Object.entries(e).filter(([e,n])=>"xs"===t&&v(e)||n&&"object"==typeof n&&t in n))(n,e).map(([t,n])=>{const r=t.slice(1);return c.css`
|
|
4
|
+
${(e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)})(r)}: ${((e,t,n)=>{const r="object"!=typeof t||Array.isArray(t)?t:t[n];if(void 0!==r){if((0,c.isCssSpacingProperty)(e)){if("number"==typeof r||Array.isArray(r))return(0,c.resolveSpacing)(r,"px")}else if((0,c.isCssColorProperty)(e)&&"string"==typeof r&&(0,c.isThemeColorValue)(r))return(0,c.resolveColor)(r);return r}})(r,n,e)};
|
|
5
5
|
`})}
|
|
6
|
-
`,
|
|
7
|
-
@honey-media (${
|
|
8
|
-
${
|
|
6
|
+
`,h=e=>({theme:t,...n})=>(l(t.breakpoints[e],`[@react-hive/honey-layout]: Missing breakpoint configuration for "${e}". Expected theme.breakpoints.${e} to be defined.`),((e,t)=>Object.entries(t).some(([t,n])=>v(t)&&"object"==typeof n&&e in n))(e,n)?c.css`
|
|
7
|
+
@honey-media (${e}:up) {
|
|
8
|
+
${m(e)};
|
|
9
9
|
}
|
|
10
|
-
`:null),
|
|
11
|
-
${({effects:
|
|
12
|
-
${
|
|
10
|
+
`:null),y=e=>{const t=window.screen.orientation.type,n="portrait-primary"===t||"portrait-secondary"===t,r=!n;if(!e)return{isPortrait:n,isLandscape:r,isXs:!1,isSm:!1,isMd:!1,isLg:!1,isXl:!1};const o=Object.entries(e).sort(([,e],[,t])=>e-t).map(([e])=>e),i=o.find(t=>{const n=e[t];return!!n&&window.innerWidth<n})??o.pop();return{isPortrait:n,isLandscape:r,isXs:"xs"===i,isSm:"sm"===i,isMd:"md"===i,isLg:"lg"===i,isXl:"xl"===i}},g=e=>"xs"===e?m(e):h(e),b=(0,c.styled)("div",e=>({"data-testid":e["data-testid"]??"honey-box"}))`
|
|
11
|
+
${({effects:e})=>c.css`
|
|
12
|
+
${e};
|
|
13
13
|
|
|
14
|
-
${
|
|
14
|
+
${c.HONEY_BREAKPOINTS.map(g)};
|
|
15
15
|
`}
|
|
16
|
-
`,
|
|
17
|
-
${({columns:
|
|
18
|
-
flex-basis: ${
|
|
16
|
+
`,x=new Set,w=(e,t)=>{x.has(e)||(x.add(e),console.warn(t))},E=(0,c.styled)(b,({inline:e=!1,row:t=!1,center:n=!1,centerX:r=!1,centerY:o=!1,$display:i,$flexDirection:u,$alignItems:c,$justifyContent:l,...a})=>{const f=e?"inline-flex":i??"flex",d=u??(t?"row":"column"),p="row"===d||"row-reverse"===d,v="column"===d||"column-reverse"===d,m=n||(p?o:!!v&&r),h=n||(p?r:!!v&&o),y=c??(m?"center":void 0),g=l??(h?"center":void 0);if(s){const e=m&&void 0!==c,t=h&&void 0!==l;(e||t)&&w(`HoneyFlex:${e}:${t}`,["[@react-hive/honey-layout]: HoneyFlex.","Semantic centering props conflict with explicit flex alignment styles:",e&&" - align-items is controlled by both semantics and $alignItems",t&&" - justify-content is controlled by both semantics and $justifyContent","Explicit styles always win. Remove one side to silence this warning."].filter(Boolean).join("\n"))}return{$display:f,$flexDirection:d,$alignItems:y,$justifyContent:g,"data-testid":a["data-testid"]??"honey-flex"}})``;function R(){return R.c||(R.c=n.t(u(),2))}i(),u();const O=(0,u().createContext)(void 0),C=(0,c.styled)(E)`
|
|
17
|
+
${({columns:e,takeColumns:t=1,spacing:n=0,applyMaxWidth:r,applyBasis:o=!0,theme:i})=>{let u=null;return o&&(u=`calc(${t*(100/e)}% - ${(0,c.resolveSpacing)(n,null)({theme:i})/e*(e-t)}px)`),c.css`
|
|
18
|
+
flex-basis: ${u};
|
|
19
19
|
|
|
20
|
-
${
|
|
21
|
-
@honey-media (${
|
|
22
|
-
max-width: ${
|
|
20
|
+
${r&&c.css`
|
|
21
|
+
@honey-media (${r}:up) {
|
|
22
|
+
max-width: ${u};
|
|
23
23
|
}
|
|
24
24
|
`}
|
|
25
25
|
`}}
|
|
26
|
-
`,
|
|
27
|
-
${({columnHeight:
|
|
26
|
+
`,S=(0,c.styled)(b,({$flexWrap:e="wrap"})=>({$flexWrap:e}))`
|
|
27
|
+
${({columnHeight:e,minColumnHeight:t,spacing:n=0})=>c.css`
|
|
28
28
|
display: flex;
|
|
29
|
-
gap: ${(0,
|
|
29
|
+
gap: ${(0,c.resolveSpacing)(n)};
|
|
30
30
|
|
|
31
|
-
> ${
|
|
32
|
-
height: ${
|
|
33
|
-
min-height: ${
|
|
31
|
+
> ${C} {
|
|
32
|
+
height: ${e};
|
|
33
|
+
min-height: ${t};
|
|
34
34
|
}
|
|
35
35
|
`}
|
|
36
|
-
`,O=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:o=!0,applyColumnMaxWidth:i=!1,...u})=>{const s=(0,b.useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}),[n,r,o,i]);return(0,g.jsx)(w,{value:s,children:(0,g.jsx)(R,{ref:e,spacing:r,"data-testid":"honey-grid",...u,children:t})})},C=()=>{const e=(0,b.useContext)(w);if(!e)throw new Error("The `useHoneyGridContext()` hook can only be used inside <HoneyGrid/> component!");return e},S=({children:e,...t})=>{const{columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}=C();return(0,g.jsx)(E,{columns:n,spacing:r,applyMaxWidth:i,$flexGrow:o?1:0,"data-testid":"honey-grid-column",...t,children:e})},_=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,j=({children:e,loading:t=!1,loadingOverContent:n=!1,error:r=!1,empty:o=!1,loadingContent:i=null,errorContent:u=null,emptyContent:s=null})=>r?u:!n&&t?i:(0,g.jsxs)(g.Fragment,{children:[n&&t&&i,o?s:e]}),L=(0,e.styled)(y,({$overflow:e="hidden auto"})=>({$overflow:e}))``,k=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:s,empty:c=!1,emptyContent:l,...a})=>(0,g.jsx)(L,{role:"list","aria-busy":r,"data-testid":"honey-list",...a,children:(0,g.jsx)(j,{loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:s,empty:c||0===t?.length,emptyContent:l,children:t?.map((t,r,o)=>(0,g.jsx)(b.Fragment,{children:e(t,r,o)},String(_(t,n,r))))})}),T=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,u]=(0,b.useState)(r||t),s=(0,b.useRef)(void 0);return(0,b.useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(s.current),u(!0),()=>{o||(s.current=setTimeout(()=>u(!1),n))}},[t,r,n]),i?e:null};var A={551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,s=/^0o[0-7]+$/i,c=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||s.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,s,c,l,a=0,f=!1,d=!1,g=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,s=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);c=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return c=void 0,g&&o?b(e):(o=i=void 0,s)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===c)return function(e){return a=e,c=setTimeout(w,t),f?b(e):s}(l);if(d)return c=setTimeout(w,t),b(l)}return void 0===c&&(c=setTimeout(w,t)),s}return t=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),R.cancel=function(){void 0!==c&&clearTimeout(c),a=0,o=l=i=c=void 0},R.flush=function(){return void 0===c?s:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}}},P={};function M(e){var t=P[e];if(void 0!==t)return t.exports;var n=P[e]={exports:{}};return A[e](n,n.exports,M),n.exports}M.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return M.d(t,{a:t}),t},M.d=(e,t)=>{for(var n in t)M.o(t,n)&&!M.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},M.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),M.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const D=e=>{const t=(0,b.useRef)(e);return t.current=e,t};var $=M(551);M.n($);var I=n(551),N=n.n(I);const H=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,b.useState)(()=>({...d(e.breakpoints),...n}));return(0,b.useEffect)(()=>{const r=N()(()=>{o({...d(e.breakpoints),...n})},t);return r(),window.addEventListener("resize",r),window.screen.orientation.addEventListener("change",r),()=>{r.cancel(),window.removeEventListener("resize",r),window.screen.orientation.removeEventListener("change",r)}},[]),r},F=(0,b.createContext)(void 0),W=()=>{const e=(0,b.useContext)(F);return o(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},z=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=W(),o=(0,b.useRef)(null);return(0,b.useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},B=()=>()=>{},U=(e,{enabled:t=!0,onKeyUp:n}={})=>{const{getOverlaysSnapshot:r,subscribeOverlays:o}=W(),i=(0,b.useCallback)(()=>t?r().find(t=>t.id===e)??null:null,[t,e]),u=(0,b.useSyncExternalStore)(t?o:B,i,i);return(0,b.useEffect)(()=>{if(u&&n)return u.addListener("keyup",n),()=>{u.removeListener("keyup",n)}},[u,n]),u},K=({ref:e,children:t,active:n,overlayId:r,onDeactivate:o,onKeyUp:i,...s})=>{const l=D(i),a=D(o),f=(0,b.useCallback)((e,...t)=>{l.current?l.current(e,...t):"Escape"===e&&a.current()},[]),d=z(n,{id:r,onKeyUp:f}),p=c(d?.setContainerRef,e);return(0,g.jsx)(y,{ref:p,inert:!n,...s,children:u(t,{overlay:d,isActive:n,deactivateOverlay:a.current})})},V=(0,b.createContext)(void 0);function q(){return"undefined"!=typeof window}function X(e){return Z(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function G(e){var t;return null==(t=(Z(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Z(e){return!!q()&&(e instanceof Node||e instanceof Y(e).Node)}function Q(e){return!!q()&&(e instanceof Element||e instanceof Y(e).Element)}function J(e){return!!q()&&(e instanceof HTMLElement||e instanceof Y(e).HTMLElement)}function ee(e){return!(!q()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot)}function te(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function ne(e){return/^(table|td|th)$/.test(X(e))}function re(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const oe=/transform|translate|scale|rotate|perspective|filter/,ie=/paint|layout|strict|content/,ue=e=>!!e&&"none"!==e;let se;function ce(e){const t=Q(e)?fe(e):e;return ue(t.transform)||ue(t.translate)||ue(t.scale)||ue(t.rotate)||ue(t.perspective)||!le()&&(ue(t.backdropFilter)||ue(t.filter))||oe.test(t.willChange||"")||ie.test(t.contain||"")}function le(){return null==se&&(se="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),se}function ae(e){return/^(html|body|#document)$/.test(X(e))}function fe(e){return Y(e).getComputedStyle(e)}function de(e){return Q(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pe(e){if("html"===X(e))return e;const t=e.assignedSlot||e.parentNode||ee(e)&&e.host||G(e);return ee(t)?t.host:t}function ve(e){const t=pe(e);return ae(t)?(e.ownerDocument||e).body:J(t)&&te(t)?t:ve(t)}function me(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ve(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=Y(o);if(i){const e=he(u);return t.concat(u,u.visualViewport||[],te(o)?o:[],e&&n?me(e):[])}return t.concat(o,me(o,[],n))}function he(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var ye=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),ge="undefined"==typeof Element,be=ge?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,xe=!ge&&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},we=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):we(e.parentNode))},Ee=function(e,t,n){if(we(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ye));return t&&be.call(e,ye)&&r.unshift(e),r.filter(n)},Re=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!we(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),s=u.length?u:i.children,c=Re(s,!0,n);n.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{be.call(i,ye)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!we(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=Re(!0===l?i.children:l.children,!0,n);n.flatten?r.push.apply(r,f):r.push({scopeParent:i,candidates:f})}else o.unshift.apply(o,i.children)}}return r},Oe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Ce=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!Oe(e)?0:e.tabIndex},Se=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},_e=function(e){return"INPUT"===e.tagName},je=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Le=function(e,t){return!(t.disabled||function(e){return _e(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var o=getComputedStyle(e).visibility;if("hidden"===o||"collapse"===o)return!0;var i=be.call(e,"details>summary:first-of-type")?e.parentElement:e;if(be.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return je(e)}else{if("function"==typeof r){for(var u=e;e;){var s=e.parentElement,c=xe(e);if(s&&!s.shadowRoot&&!0===r(s))return je(e);e=e.assignedSlot?e.assignedSlot:s||c===e.ownerDocument?s:c.host}e=u}if(function(e){var t,n,r,o,i=e&&xe(e),u=null===(t=i)||void 0===t?void 0:t.host,s=!1;if(i&&i!==e)for(s=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!s&&u;){var c,l,a;s=!(null===(l=u=null===(c=i=xe(u))||void 0===c?void 0:c.host)||void 0===l||null===(a=l.ownerDocument)||void 0===a||!a.contains(u))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!be.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},ke=function(e,t){return!(function(e){return function(e){return _e(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||xe(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||Ce(t)<0||!Le(e,t))},Te=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Ae=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,u=function(e,t){var n=Ce(e);return n<0&&t&&!Oe(e)?0:n}(i,o),s=o?Ae(e.candidates):i;0===u?o?t.push.apply(t,s):t.push(i):n.push({documentOrder:r,tabIndex:u,item:e,isScope:o,content:s})}),n.sort(Se).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Pe=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Re([e],t.includeContainer,{filter:ke.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Te}):Ee(e,t.includeContainer,ke.bind(null,t)),Ae(n)},Me=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==be.call(e,ye)&&ke(t,e)};function De(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function $e(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function Ie(){return/apple/i.test(navigator.vendor)}function Ne(){const e=/android/i;return e.test(De())||e.test($e())}function He(){return $e().includes("jsdom/")}const Fe="data-floating-ui-focusable";function We(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function ze(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Be(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ue(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Ke(e){return(null==e?void 0:e.ownerDocument)||document}function Ve(e){return J(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function qe(e){return!!e&&"combobox"===e.getAttribute("role")&&Ve(e)}function Xe(e){return e?e.hasAttribute(Fe)?e:e.querySelector("["+Fe+"]")||e:null}function Ye(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...Ye(e,t.id,n)])}function Ge(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function Ze(e){e.preventDefault(),e.stopPropagation()}function Qe(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Je="undefined"!=typeof document?b.useLayoutEffect:function(){};function et(e){const t=b.useRef(e);return Je(()=>{t.current=e}),t}const tt={...x}.useInsertionEffect||(e=>e());function nt(e){const t=b.useRef(()=>{});return tt(()=>{t.current=e}),b.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 rt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ot(e,t){const n=Pe(e,rt()),r=n.length;if(0===r)return;const o=We(Ke(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function it(e){return ot(Ke(e).body,1)||e}function ut(e){return ot(Ke(e).body,-1)||e}function st(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!ze(n,r)}function ct(e){Pe(e,rt()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function lt(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var at=n(481);const ft=["start","end"],dt=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+ft[0],t+"-"+ft[1]),[]),pt=Math.min,vt=Math.max,mt=Math.round,ht=Math.floor,yt=e=>({x:e,y:e}),gt={left:"right",right:"left",bottom:"top",top:"bottom"};function bt(e,t,n){return vt(e,pt(t,n))}function xt(e,t){return"function"==typeof e?e(t):e}function wt(e){return e.split("-")[0]}function Et(e){return e.split("-")[1]}function Rt(e){return"x"===e?"y":"x"}function Ot(e){return"y"===e?"height":"width"}function Ct(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function St(e){return Rt(Ct(e))}function _t(e,t,n){void 0===n&&(n=!1);const r=Et(e),o=St(e),i=Ot(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=Pt(u)),[u,Pt(u)]}function jt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Lt=["left","right"],kt=["right","left"],Tt=["top","bottom"],At=["bottom","top"];function Pt(e){const t=wt(e);return gt[t]+e.slice(t.length)}function Mt(e){return"number"!=typeof e?function(e){var t,n,r,o;return{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}}(e):{top:e,right:e,bottom:e,left:e}}function Dt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function $t(e,t,n){let{reference:r,floating:o}=e;const i=Ct(t),u=St(t),s=Ot(u),c=wt(t),l="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[s]/2-o[s]/2;let p;switch(c){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}const v=Et(t);return v&&(p[u]+=d*("end"===v?1:-1)*(n&&l?-1:1)),p}async function It(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:u,elements:s,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=xt(t,e),v=Mt(p),m=s[d?"floating"===f?"reference":"floating":f],h=Dt(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:l,rootBoundary:a,strategy:c})),y="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},x=Dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:c}):y);return{top:(h.top-x.top+v.top)/b.y,bottom:(x.bottom-h.bottom+v.bottom)/b.y,left:(h.left-x.left+v.left)/b.x,right:(x.right-h.right+v.right)/b.x}}const Nt=new Set(["left","top"]);function Ht(e){const t=fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=J(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,s=mt(n)!==i||mt(r)!==u;return s&&(n=i,r=u),{width:n,height:r,$:s}}function Ft(e){return Q(e)?e:e.contextElement}function Wt(e){const t=Ft(e);if(!J(t))return yt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ht(t);let u=(i?mt(n.width):n.width)/r,s=(i?mt(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),s&&Number.isFinite(s)||(s=1),{x:u,y:s}}const zt=yt(0);function Bt(e){const t=Y(e);return le()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:zt}function Ut(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Ft(e);let u=yt(1);t&&(r?Q(r)&&(u=Wt(r)):u=Wt(e));const s=function(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===Y(e)}(i,n,r)?Bt(i):yt(0);let c=(o.left+s.x)/u.x,l=(o.top+s.y)/u.y,a=o.width/u.x,f=o.height/u.y;if(i&&r){const e=Y(i),t=Q(r)?Y(r):r;let n=e,o=he(n);for(;o&&t!==n;){const e=Wt(o),t=o.getBoundingClientRect(),r=fe(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,a*=e.x,f*=e.y,c+=i,l+=u,n=Y(o),o=he(n)}}return Dt({width:a,height:f,x:c,y:l})}function Kt(e,t){const n=de(e).scrollLeft;return t?t.left+n:Ut(G(e)).left+n}function Vt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Kt(e,n),y:n.top+t.scrollTop}}function qt(e,t,n){let r;if("viewport"===t||"layoutViewport"===t)r=function(e,t,n){void 0===n&&(n="viewport");const r="layoutViewport"===n,o=Y(e),i=G(e),u=o.visualViewport;let s=i.clientWidth,c=i.clientHeight,l=0,a=0;if(u){const e=!le()||"fixed"===t;r?e||(l=-u.offsetLeft,a=-u.offsetTop):(s=u.width,c=u.height,e&&(l=u.offsetLeft,a=u.offsetTop))}if(Kt(i)<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(i.clientWidth-t.clientWidth-r),u="stable both-edges"===getComputedStyle(i).scrollbarGutter?o/2:o;u<=25&&(s-=u)}return{width:s,height:c,x:l,y:a}}(e,n,t);else if("document"===t)r=function(e){const t=de(e),n=e.ownerDocument.body,r=vt(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=vt(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Kt(e);const u=-t.scrollTop;return"rtl"===fe(n).direction&&(i+=vt(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:u}}(G(e));else if(Q(t))r=function(e,t){const n=Ut(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Wt(e);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Bt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Dt(r)}function Xt(e,t,n){const r=J(t),o=G(t),i="fixed"===n,u=Ut(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const c=yt(0);if((r||!i)&&(("body"!==X(t)||te(o))&&(s=de(t)),r)){const e=Ut(t,!0,i,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&o&&(c.x=Kt(o));const l=!o||r||i?yt(0):Vt(o,s);return{x:u.left+s.scrollLeft-c.x-l.x,y:u.top+s.scrollTop-c.y-l.y,width:u.width,height:u.height}}function Yt(e){return"static"===fe(e).position}function Gt(e,t){if(!J(e)||"fixed"===fe(e).position)return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function Zt(e,t){const n=Y(e);if(re(e))return n;if(!J(e)){let t=pe(e);for(;t&&!ae(t);){if(Q(t)&&!Yt(t))return t;t=pe(t)}return n}let r=Gt(e,t);for(;r&&ne(r)&&Yt(r);)r=Gt(r,t);return r&&ae(r)&&Yt(r)&&!ce(r)?n:r||function(e){let t=pe(e);for(;J(t)&&!ae(t);){if(ce(t))return t;if(re(t))return null;t=pe(t)}return null}(e)||n}const Qt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=G(r),s=!!t&&re(t.floating);if(r===u||s&&i)return n;let c={scrollLeft:0,scrollTop:0},l=yt(1);const a=yt(0),f=J(r);if((f||!i)&&(("body"!==X(r)||te(u))&&(c=de(r)),f)){const e=Ut(r);l=Wt(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?yt(0):Vt(u,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+a.x+d.x,y:n.y*l.y-c.scrollTop*l.y+a.y+d.y}},getDocumentElement:G,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?re(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=me(e,[],!1).filter(e=>Q(e)&&"body"!==X(e)),o=null;const i="fixed"===fe(e).position;let u=i?pe(e):e;for(;Q(u)&&!ae(u);){const e=fe(u),t=ce(u),n=o?o.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==u),u=pe(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=qt(t,i[0],o);let s=u.top,c=u.right,l=u.bottom,a=u.left;for(let e=1;e<i.length;e++){const n=qt(t,i[e],o);s=vt(n.top,s),c=pt(n.right,c),l=pt(n.bottom,l),a=vt(n.left,a)}return{width:c-a,height:l-s,x:a,y:s}},getOffsetParent:Zt,getElementRects:async function(e){const t=this.getOffsetParent||Zt,n=this.getDimensions,r=await n(e.floating);return{reference:Xt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){const{width:t,height:n}=Ht(e);return{width:t,height:n}},getScale:Wt,isElement:Q,isRTL:function(e){return"rtl"===fe(e).direction}};function Jt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const en=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:s,platform:c,elements:l}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...h}=xt(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=wt(o),g=Ct(s),b=wt(s)===s,x=await(null==c.isRTL?void 0:c.isRTL(l.floating)),w=d||(b||!m?[Pt(s)]:function(e){const t=Pt(e);return[jt(e),t,jt(t)]}(s)),E="none"!==v;!d&&E&&w.push(...function(e,t,n,r){const o=Et(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?kt:Lt:t?Lt:kt;case"left":case"right":return t?Tt:At;default:return[]}}(wt(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(jt)))),i}(s,m,v,x));const R=[s,...w],O=await c.detectOverflow(t,h),C=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&C.push(O[y]),f){const e=_t(o,u,x);C.push(O[e[0]],O[e[1]])}if(S=[...S,{placement:o,overflows:C}],!C.every(e=>e<=0)){var _,j;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=R[e];if(t&&("alignment"!==f||g===Ct(t)||S.every(e=>Ct(e.placement)!==g||e.overflows[0]>0)))return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(j=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!n)switch(p){case"bestFit":{var L;const e=null==(L=S.filter(e=>{if(E){const t=Ct(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},tn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:u,elements:s,middlewareData:c}=t,{element:l,padding:a=0}=xt(e,t)||{};if(null==l)return{};const f=Mt(a),d={x:n,y:r},p=St(o),v=Ot(p),m=await u.getDimensions(l),h="y"===p,y=h?"top":"left",g=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[v]+i.reference[p]-d[p]-i.floating[v],w=d[p]-i.reference[p],E=await(null==u.getOffsetParent?void 0:u.getOffsetParent(l));let R=E?E[b]:0;R&&await(null==u.isElement?void 0:u.isElement(E))||(R=s.floating[b]||i.floating[v]);const O=x/2-w/2,C=R/2-m[v]/2-1,S=pt(f[y],C),_=pt(f[g],C),j=R-m[v]-_,L=R/2-m[v]/2+O,k=bt(S,L,j),T=!c.arrow&&null!=Et(o)&&L!==k&&i.reference[v]/2-(L<S?S:_)-m[v]/2<0,A=T?L<S?L-S:L-j:0;return{[p]:d[p]+A,data:{[p]:k,centerOffset:L-k-A,...T&&{alignmentOffset:A}},reset:T}}}),nn=(e,t,n)=>{const r=new Map,o=null!=n?n:{},i={...Qt,...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,s=u.detectOverflow?u:{...u,detectOverflow:It},c=await(null==u.isRTL?void 0:u.isRTL(t));let l=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=$t(l,r,c),d=r,p=0;const v={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:h,fn:y}=m,{x:g,y:b,data:x,reset:w}=await y({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:l,platform:s,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=b?b:f,v[h]={...v[h],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(l=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=$t(l,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:v}})(e,t,{...o,platform:i})};var rn="undefined"!=typeof document?b.useLayoutEffect:function(){};function on(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!on(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||on(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function un(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sn(e,t){const n=un(e);return Math.round(t*n)/n}function cn(e){const t=b.useRef(e);return rn(()=>{t.current=e}),t}const ln="data-floating-ui-focusable",an="active",fn="selected",dn={...x};let pn=!1,vn=0;const mn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+vn++,hn=dn.useId||function(){const[e,t]=b.useState(()=>pn?mn():void 0);return Je(()=>{null==e&&t(mn())},[]),b.useEffect(()=>{pn=!0},[]),e},yn=b.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:u=14,height:s=7,tipRadius:c=0,strokeWidth:l=0,staticOffset:a,stroke:f,d,style:{transform:p,...v}={},...m}=e,h=hn(),[y,x]=b.useState(!1);if(Je(()=>{r&&"rtl"===fe(r).direction&&x(!0)},[r]),!r)return null;const[w,E]=n.split("-"),R="top"===w||"bottom"===w;let O=a;(R&&null!=i&&i.x||!R&&null!=i&&i.y)&&(O=null);const C=2*l,S=C/2,_=u/2*(c/-8+1),j=s/2*c/4,L=!!d,k=O&&"end"===E?"bottom":"top";let T=O&&"end"===E?"right":"left";O&&y&&(T="end"===E?"left":"right");const A=null!=(null==o?void 0:o.x)?O||o.x:"",P=null!=(null==o?void 0:o.y)?O||o.y:"",M=d||"M0,0 H"+u+" L"+(u-_)+","+(s-j)+" Q"+u/2+","+s+" "+_+","+(s-j)+" Z",D={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,g.jsxs)("svg",{...m,"aria-hidden":!0,ref:t,width:L?u:u+C,height:u,viewBox:"0 0 "+u+" "+(s>u?s:u),style:{position:"absolute",pointerEvents:"none",[T]:A,[k]:P,[w]:R||L?"100%":"calc(100% - "+C/2+"px)",transform:[D,p].filter(e=>!!e).join(" "),...v},children:[C>0&&(0,g.jsx)("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:C+(d?0:1),d:M}),(0,g.jsx)("path",{stroke:C&&!d?m.fill:"none",d:M}),(0,g.jsx)("clipPath",{id:h,children:(0,g.jsx)("rect",{x:-S,y:S*(L?-1:1),width:u+C,height:u})})]})});function gn(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const bn=b.createContext(null),xn=b.createContext(null),wn=()=>{var e;return(null==(e=b.useContext(bn))?void 0:e.id)||null},En=()=>b.useContext(xn);function Rn(e){const{children:t,id:n}=e,r=wn();return(0,g.jsx)(bn.Provider,{value:b.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function On(e){const{children:t}=e,n=b.useRef([]),r=b.useCallback(e=>{n.current=[...n.current,e]},[]),o=b.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[i]=b.useState(()=>gn());return(0,g.jsx)(xn.Provider,{value:b.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i]),children:t})}function Cn(e){return"data-floating-ui-"+e}function Sn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const _n=Cn("safe-polygon");function jn(e,t,n){if(n&&!Qe(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function Ln(e){return"function"==typeof e?e():e}let kn=0;function Tn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(kn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():kn=requestAnimationFrame(i)}function An(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Pn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Mn(e){return"inert"===e?Pn.inert:"aria-hidden"===e?Pn["aria-hidden"]:Pn.none}let Dn=new WeakSet,$n={},In=0;function Nn(e){return e?ee(e)?e.host:Nn(e.parentNode):null}const Hn=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Nn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function Fn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=(o=e[0],(null==o?void 0:o.ownerDocument)||document).body;var o;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=Hn(t,e),s=new Set,c=new Set(u),l=[];$n[o]||($n[o]=new WeakMap);const a=$n[o];return u.forEach(function e(t){t&&!s.has(t)&&(s.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,t=>{if("script"!==X(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Mn(i),u=(r.get(t)||0)+1,s=(a.get(t)||0)+1;r.set(t,u),a.set(t,s),l.push(t),1===u&&n&&Dn.add(t),1===s&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),s.clear(),In++,()=>{l.forEach(e=>{const t=Mn(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!Dn.has(e)&&i&&e.removeAttribute(i),Dn.delete(e)),r||e.removeAttribute(o)}),In--,In||(Pn.inert=new WeakMap,Pn["aria-hidden"]=new WeakMap,Pn.none=new WeakMap,Dn=new WeakSet,$n={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Wn={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},zn=b.forwardRef(function(e,t){const[n,r]=b.useState();Je(()=>{Ie()&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Cn("focus-guard")]:"",style:Wn};return(0,g.jsx)("span",{...e,...o})}),Bn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Un=b.createContext(null),Kn=Cn("portal");function Vn(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=hn(),o=qn(),[i,u]=b.useState(null),s=b.useRef(null);return Je(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{s.current=null})},[i]),Je(()=>{if(!r)return;if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(Kn,""),e.appendChild(n),s.current=n,u(n)},[t,r]),Je(()=>{if(null===n)return;if(!r)return;if(s.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!Z(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const c=document.createElement("div");c.id=r,c.setAttribute(Kn,""),e=i||e,e.appendChild(c),s.current=c,u(c)},[t,n,r,o]),i}({id:n,root:r}),[u,s]=b.useState(null),c=b.useRef(null),l=b.useRef(null),a=b.useRef(null),f=b.useRef(null),d=null==u?void 0:u.modal,p=null==u?void 0:u.open,v=!!u&&!u.modal&&u.open&&o&&!(!r&&!i);return b.useEffect(()=>{if(i&&o&&!d)return i.addEventListener("focusin",e,!0),i.addEventListener("focusout",e,!0),()=>{i.removeEventListener("focusin",e,!0),i.removeEventListener("focusout",e,!0)};function e(e){i&&st(e)&&("focusin"===e.type?lt:ct)(i)}},[i,o,d]),b.useEffect(()=>{i&&(p||lt(i))},[p,i]),(0,g.jsxs)(Un.Provider,{value:b.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:a,afterInsideRef:f,portalNode:i,setFocusManagerState:s}),[o,i]),children:[v&&i&&(0,g.jsx)(zn,{"data-type":"outside",ref:c,onFocus:e=>{if(st(e,i)){var t;null==(t=a.current)||t.focus()}else{const e=ut(u?u.domReference:null);null==e||e.focus()}}}),v&&i&&(0,g.jsx)("span",{"aria-owns":i.id,style:Bn}),i&&at.createPortal(t,i),v&&i&&(0,g.jsx)(zn,{"data-type":"outside",ref:l,onFocus:e=>{if(st(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=it(u?u.domReference:null);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const qn=()=>b.useContext(Un);function Xn(e){return b.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let Yn=[];function Gn(){Yn=Yn.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function Zn(){Gn();const e=Yn[Yn.length-1];return null==e?void 0:e.deref()}function Qn(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=rt(),o=function(e,t){return(t=t||{}).getShadowRoot?Re([e],t.includeContainer,{filter:Le.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ee(e,t.includeContainer,Le.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Me(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==u&&e.setAttribute("tabindex","0"):("-1"!==u||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Jn=b.forwardRef(function(e,t){return(0,g.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Wn})});function er(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:u=0,returnFocus:s=!0,restoreFocus:c=!1,modal:l=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:v,onOpenChange:m,events:h,dataRef:y,elements:{domReference:x,floating:w}}=t,E=nt(()=>{var e;return null==(e=y.current.floatingContext)?void 0:e.nodeId}),R=nt(p),O="number"==typeof u&&u<0,C=qe(x)&&O,S="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,_=!S||i,j=!_||S&&d,L=et(o),k=et(u),T=et(s),A=En(),P=qn(),M=b.useRef(null),D=b.useRef(null),$=b.useRef(!1),I=b.useRef(!1),N=b.useRef(-1),H=b.useRef(-1),F=null!=P,W=Xe(w),z=nt(function(e){return void 0===e&&(e=W),e?Pe(e,rt()):[]}),B=nt(e=>{const t=z(e);return L.current.map(e=>x&&"reference"===e?x:W&&"floating"===e?W:t).filter(Boolean).flat()});b.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){ze(W,We(Ke(W)))&&0===z().length&&!C&&Ze(e);const t=B(),n=Be(e);"reference"===L.current[0]&&n===x&&(Ze(e),e.shiftKey?Tn(t[t.length-1]):Tn(t[1])),"floating"===L.current[1]&&n===W&&e.shiftKey&&(Ze(e),Tn(t[0]))}}const t=Ke(W);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,x,W,l,L,C,z,B]),b.useEffect(()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Be(e),n=z().indexOf(t);-1!==n&&(N.current=n)}},[r,w,z]),b.useEffect(()=>{if(r)return;if(!f)return;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=Be(e);queueMicrotask(()=>{const o=E(),i=!(ze(x,t)||ze(w,t)||ze(t,w)||ze(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Cn("focus-guard"))||A&&(Ye(A.nodesRef.current,o).find(e=>{var n,r;return ze(null==(n=e.context)?void 0:n.elements.floating,t)||ze(null==(r=e.context)?void 0:r.elements.domReference,t)})||Ge(A.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Xe(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===x&&W&&Qn(W,L),c&&n!==x&&(null==r||!r.isConnected)&&We(Ke(W))===Ke(W).body){J(W)&&W.focus();const e=N.current,t=z(),n=t[e]||t[t.length-1]||W;J(n)&&n.focus()}y.current.insideReactTree?y.current.insideReactTree=!1:!C&&l||!t||!i||I.current||t===Zn()||($.current=!0,m(!1,e,"focus-out"))})}const n=Boolean(!A&&P);function o(){Sn(H),y.current.insideReactTree=!0,H.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}return w&&J(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),n&&w.addEventListener("focusout",o,!0),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t),n&&w.removeEventListener("focusout",o,!0)}):void 0},[r,x,w,W,l,A,P,m,f,c,z,C,E,L,y]);const U=b.useRef(null),K=b.useRef(null),V=Xn([U,null==P?void 0:P.beforeInsideRef]),q=Xn([K,null==P?void 0:P.afterInsideRef]);function Y(e){return!r&&a&&l?(0,g.jsx)(Jn,{ref:"start"===e?M:D,onClick:e=>m(!1,e.nativeEvent),children:"string"==typeof a?a:"Dismiss"}):null}b.useEffect(()=>{var e,t;if(r)return;if(!w)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Cn("portal")+"]"))||[]),o=null==(t=(A?Ge(A.nodesRef.current,E()):[]).find(e=>{var t;return qe((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[w,o,...n,...R(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,L.current.includes("reference")||C?x:null].filter(e=>null!=e),u=l||C?Fn(i,!j,j):Fn(i);return()=>{u()}},[r,x,w,l,L,P,C,_,j,A,E,R]),Je(()=>{if(r||!J(W))return;const e=We(Ke(W));queueMicrotask(()=>{const t=B(W),n=k.current,r=("number"==typeof n?t[n]:n.current)||W,o=ze(W,e);O||o||!v||Tn(r,{preventScroll:r===W})})},[r,v,W,O,B,k]),Je(()=>{if(r||!W)return;const e=Ke(W);var t;function n(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&($.current=!0),"outside-press"===t)if(r)$.current=!1;else if(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Ne()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!He()&&(!Ne()&&0===e.width&&0===e.height||Ne()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}(n))$.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),$.current=!e}}t=We(e),Gn(),t&&"body"!==X(t)&&(Yn.push(new WeakRef(t)),Yn.length>20&&(Yn=Yn.slice(-20))),h.on("openchange",n);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,Wn),F&&x&&x.insertAdjacentElement("afterend",o),()=>{h.off("openchange",n);const t=We(e),r=ze(w,t)||A&&Ye(A.nodesRef.current,E(),!1).some(e=>{var n;return ze(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof T.current){const e=x||Zn();return e&&e.isConnected?e:o}return T.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=rt();return Me(e,t)?e:Pe(e,t)[0]||e}(i);T.current&&!$.current&&J(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,w,W,T,y,h,A,F,x,E]),b.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(Gn)}),[r]),Je(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:v,onOpenChange:m,domReference:x}),()=>{P.setFocusManagerState(null)}},[r,P,l,v,m,f,x]),Je(()=>{r||W&&Qn(W,L)},[r,W,L]);const G=!r&&_&&(!l||!C)&&(F||l);return(0,g.jsxs)(g.Fragment,{children:[G&&(0,g.jsx)(zn,{"data-type":"inside",ref:V,onFocus:e=>{if(l){const e=B();Tn("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,st(e,P.portalNode)){const e=it(x);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!C&&Y("start"),n,Y("end"),G&&(0,g.jsx)(zn,{"data-type":"inside",ref:q,onFocus:e=>{if(l)Tn(B()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&($.current=!0),st(e,P.portalNode)){const e=ut(x);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function tr(e){return J(e.target)&&"BUTTON"===e.target.tagName}function nr(e){return Ve(e)}function rr(e){return null!=e&&null!=e.clientX}const or={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ir={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ur=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function sr(){return De().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Ie()}function cr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[an]:t,[fn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[ln]:""},...i,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var u;o&&[an,fn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}const lr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),ar=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function fr(e,t){return"function"==typeof e?e(t):e}function dr(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...dr(e,t.id,n)])}function pr(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,u=i-1;e<i;u=e++){const[i,s]=t[e]||[0,0],[c,l]=t[u]||[0,0];s>=r!=l>=r&&n<=(c-i)*(r-s)/(l-s)+i&&(o=!o)}return o}function vr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,u=null,s=null,c="undefined"!=typeof performance?performance.now():0;const l=e=>{let{x:n,y:l,placement:a,elements:f,onClose:d,nodeId:p,tree:v}=e;return function(e){function m(){Sn(o),d()}if(Sn(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:y}=e,g=[h,y],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=An(f.floating,b),E=An(f.domReference,b),R=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],S=n>O.right-O.width/2,_=l>O.bottom-O.height/2,j=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(g,R),L=O.width>R.width,k=O.height>R.height,T=(L?R:O).left,A=(L?R:O).right,P=(k?R:O).top,M=(k?R:O).bottom;if(w&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&Q(e.relatedTarget)&&An(f.floating,e.relatedTarget))return;if(v&&dr(v.nodesRef.current,p).length)return;if("top"===C&&l>=R.bottom-1||"bottom"===C&&l<=R.top+1||"left"===C&&n>=R.right-1||"right"===C&&n<=R.left+1)return m();let D=[];switch(C){case"top":D=[[T,R.top+1],[T,O.bottom-1],[A,O.bottom-1],[A,R.top+1]];break;case"bottom":D=[[T,O.top+1],[T,R.bottom-1],[A,R.bottom-1],[A,O.top+1]];break;case"left":D=[[O.right-1,M],[O.right-1,P],[R.left+1,P],[R.left+1,M]];break;case"right":D=[[R.right-1,M],[R.right-1,P],[O.left+1,P],[O.left+1,M]]}if(!pr([h,y],D)){if(i&&!j)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-c;if(null===u||null===s||0===r)return u=e,s=t,c=n,null;const o=e-u,i=t-s,l=Math.sqrt(o*o+i*i);return u=e,s=t,c=n,l/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}pr([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:S?n+4*t:n-4*t,r+t+1],[L?n-t/2:S?n+4*t:n-4*t,r+t+1],[O.left,S||L?O.bottom-t:O.top],[O.right,S?L?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[L?n+t/2:S?n+4*t:n-4*t,r-t],[L?n-t/2:S?n+4*t:n-4*t,r-t],[O.left,S||L?O.top+t:O.bottom],[O.right,S?L?O.top+t:O.bottom:O.top+t]];case"left":{const e=[n+t+1,k?r+t/2:_?r+4*t:r-4*t],o=[n+t+1,k?r-t/2:_?r+4*t:r-4*t];return[[_||k?O.right-t:O.left,O.top],[_?k?O.right-t:O.left:O.right-t,O.bottom],e,o]}case"right":return[[n-t,k?r+t/2:_?r+4*t:r-4*t],[n-t,k?r-t/2:_?r+4*t:r-4*t],[_||k?O.left+t:O.right,O.top],[_?k?O.left+t:O.right:O.left+t,O.bottom]]}}([n,l]))?!i&&r&&(o.current=window.setTimeout(m,40)):m()}}};return l.__options={blockPointerEvents:n},l}const mr=({children:e,enabled:t=!0,...n})=>{const r=wn();return!t||r?e:(0,g.jsx)(On,{...n,children:e})},hr=(0,e.styled)(y,({$width:e="max-content"})=>({$width:e}))``,yr=({children:e,enabled:t=!0,...n})=>t?(0,g.jsx)(Vn,{...n,children:e}):e,gr=(e,{enabled:t=!0,event:n="click",dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:u,clientPointsOptions:s,roleOptions:c,extraInteractions:l=[]})=>{const a=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:u=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l="pointerdown",referencePress:a=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:v}=t,m=En(),h=nt("function"==typeof c?c:()=>!1),y="function"==typeof c?h:c,g=b.useRef(!1),{escapeKey:x,outsidePress:w}=ur(p),{escapeKey:E,outsidePress:R}=ur(v),O=b.useRef(!1),C=nt(e=>{var t;if(!n||!u||!s||"Escape"!==e.key)return;if(O.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,c=m?Ye(m.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),c.length>0)){let e=!0;if(c.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),S=nt(e=>{var t;const n=()=>{var t;C(e),null==(t=Be(e))||t.removeEventListener("keydown",n)};null==(t=Be(e))||t.addEventListener("keydown",n)}),_=nt(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=g.current;if(g.current=!1,"click"===l&&u)return;if(n)return;if("function"==typeof y&&!y(e))return;const s=Be(e),c="["+Cn("inert")+"]",a=Ke(o.floating).querySelectorAll(c);let f=Q(s)?s:null;for(;f&&!ae(f);){const e=pe(f);if(ae(e)||!Q(e))break;f=e}if(a.length&&Q(s)&&!s.matches("html,body")&&!ze(s,o.floating)&&Array.from(a).every(e=>!ze(f,e)))return;if(J(s)&&k){const t=ae(s),n=fe(s),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),u=o&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,c=i&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,l="rtl"===n.direction,a=c&&(l?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),f=u&&e.offsetY>s.clientHeight;if(a||f)return}const d=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=m&&Ye(m.nodesRef.current,d).some(t=>{var n;return Ue(e,null==(n=t.context)?void 0:n.elements.floating)});if(Ue(e,o.floating)||Ue(e,o.domReference)||p)return;const v=m?Ye(m.nodesRef.current,d):[];if(v.length>0){let e=!0;if(v.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),j=nt(e=>{var t;const n=()=>{var t;_(e),null==(t=Be(e))||t.removeEventListener(l,n)};null==(t=Be(e))||t.addEventListener(l,n)});b.useEffect(()=>{if(!n||!u)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function c(){window.clearTimeout(e),O.current=!0}function a(){e=window.setTimeout(()=>{O.current=!1},le()?5:0)}const f=Ke(o.floating);s&&(f.addEventListener("keydown",E?S:C,E),f.addEventListener("compositionstart",c),f.addEventListener("compositionend",a)),y&&f.addEventListener(l,R?j:_,R);let p=[];return d&&(Q(o.domReference)&&(p=me(o.domReference)),Q(o.floating)&&(p=p.concat(me(o.floating))),!Q(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(me(o.reference.contextElement)))),p=p.filter(e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)}),p.forEach(e=>{e.addEventListener("scroll",t)}),()=>{s&&(f.removeEventListener("keydown",E?S:C,E),f.removeEventListener("compositionstart",c),f.removeEventListener("compositionend",a)),y&&f.removeEventListener(l,R?j:_,R),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,s,y,l,n,r,d,u,x,w,C,E,S,_,R,j]),b.useEffect(()=>{i.current.insideReactTree=!1},[i,y,l]);const L=b.useMemo(()=>({onKeyDown:C,...a&&{[or[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[C,r,a,f]),k=b.useMemo(()=>{function e(e){0===e.button&&(g.current=!0)}return{onKeyDown:C,onMouseDown:e,onMouseUp:e,[ir[l]]:()=>{i.current.insideReactTree=!0}}},[C,l,i]);return b.useMemo(()=>u?{reference:L,floating:k}:{},[u,L,k])}(e,{escapeKey:!1,...r}),f=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:u=!0,event:s="click",toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:a=!0,stickIfOpen:f=!0}=t,d=b.useRef(),p=b.useRef(!1),v=b.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==s&&(Qe(t,!0)&&l||(!n||!c||o.current.openEvent&&f&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=d.current;"mousedown"===s&&d.current?d.current=void 0:Qe(t,!0)&&l||(!n||!c||o.current.openEvent&&f&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){d.current=void 0,e.defaultPrevented||!a||tr(e)||(" "!==e.key||nr(i)||(e.preventDefault(),p.current=!0),function(e){return J(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!a||tr(e)||nr(i)||" "===e.key&&p.current&&(p.current=!1,r(!n||!c,e.nativeEvent,"click"))}}),[o,i,s,l,a,r,n,f,c]);return b.useMemo(()=>u?{reference:v}:{},[u,v])}(e,{enabled:t&&"click"===n,...o}),d=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:u}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:a=!1,restMs:f=0,move:d=!0}=t,p=En(),v=wn(),m=et(l),h=et(c),y=et(n),g=et(f),x=b.useRef(),w=b.useRef(-1),E=b.useRef(),R=b.useRef(-1),O=b.useRef(!0),C=b.useRef(!1),S=b.useRef(()=>{}),_=b.useRef(!1),j=nt(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});b.useEffect(()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(Sn(w),Sn(R),O.current=!0,_.current=!1)}},[s,i]),b.useEffect(()=>{if(!s)return;if(!m.current)return;if(!n)return;function e(e){j()&&r(!1,e,"hover")}const t=Ke(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,r,s,m,j]);const L=b.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=jn(h.current,"close",x.current);o&&!E.current?(Sn(w),w.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(Sn(w),r(!1,e,n))},[h,r]),k=nt(()=>{S.current(),E.current=void 0}),T=nt(()=>{if(C.current){const e=Ke(u.floating).body;e.style.pointerEvents="",e.removeAttribute(_n),C.current=!1}}),A=nt(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));b.useEffect(()=>{if(s&&Q(u.domReference)){const r=u.domReference,o=u.floating;return n&&r.addEventListener("mouseleave",i),d&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),o&&(o.addEventListener("mouseleave",i),o.addEventListener("mouseenter",c),o.addEventListener("mouseleave",l)),()=>{n&&r.removeEventListener("mouseleave",i),d&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),o&&(o.removeEventListener("mouseleave",i),o.removeEventListener("mouseenter",c),o.removeEventListener("mouseleave",l))}}function e(e){if(Sn(w),O.current=!1,a&&!Qe(x.current)||Ln(g.current)>0&&!jn(h.current,"open"))return;const t=jn(h.current,"open",x.current);t?w.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(A())return void T();S.current();const t=Ke(u.floating);if(Sn(R),_.current=!1,m.current&&o.current.floatingContext){n||Sn(w),E.current=m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){T(),k(),A()||L(e,!0,"safe-polygon")}});const r=E.current;return t.addEventListener("mousemove",r),void(S.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==x.current||!ze(u.floating,e.relatedTarget))&&L(e)}function i(e){A()||o.current.floatingContext&&(null==m.current||m.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){T(),k(),A()||L(e)}})(e))}function c(){Sn(w)}function l(e){A()||L(e,!1)}},[u,s,e,a,d,L,k,T,r,n,y,p,h,m,o,A,g]),Je(()=>{var e;if(s&&n&&null!=(e=m.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&j()){C.current=!0;const e=u.floating;if(Q(u.domReference)&&e){var t;const n=Ke(u.floating).body;n.setAttribute(_n,"");const r=u.domReference,o=null==p||null==(t=p.nodesRef.current.find(e=>e.id===v))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[s,n,v,u,p,m,j]),Je(()=>{n||(x.current=void 0,_.current=!1,k(),T())},[n,k,T]),b.useEffect(()=>()=>{k(),Sn(w),Sn(R),T()},[s,u.domReference,k,T]);const P=b.useMemo(()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){O.current||y.current||r(!0,t,"hover")}a&&!Qe(x.current)||n||0===Ln(g.current)||_.current&&e.movementX**2+e.movementY**2<2||(Sn(R),"touch"===x.current?o():(_.current=!0,R.current=window.setTimeout(o,Ln(g.current))))}}},[a,r,n,y,g]);return b.useMemo(()=>s?{reference:P}:{},[s,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:vr(),...i}),p=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:u}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=b.useRef(!1),a=b.useRef(-1),f=b.useRef(!0);b.useEffect(()=>{if(!s)return;const e=Y(u.domReference);function t(){!n&&J(u.domReference)&&u.domReference===We(Ke(u.domReference))&&(l.current=!0)}function r(){f.current=!0}function o(){f.current=!1}return e.addEventListener("blur",t),sr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),sr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[u.domReference,n,s]),b.useEffect(()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(l.current=!0)}},[o,s]),b.useEffect(()=>()=>{Sn(a)},[]);const d=b.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;const t=Be(e.nativeEvent);if(c&&Q(t))if(sr()&&!e.relatedTarget){if(!f.current&&!Ve(t))return}else if(!function(e){if(!e||He())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;r(!0,e.nativeEvent,"focus")},onBlur(e){l.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=Q(t)&&t.hasAttribute(Cn("focus-guard"))&&"outside"===t.getAttribute("data-type");a.current=window.setTimeout(()=>{var e;const s=We(u.domReference?u.domReference.ownerDocument:document);(t||s!==u.domReference)&&(ze(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,s)||ze(u.domReference,s)||o||r(!1,n,"focus"))})}}),[i,u.domReference,r,c]);return b.useMemo(()=>s?{reference:d}:{},[s,d])}(e,{enabled:t&&"focus"===n,...u}),v=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:u}=e,{enabled:s=!0,axis:c="both",x:l=null,y:a=null}=t,f=b.useRef(!1),d=b.useRef(null),[p,v]=b.useState(),[m,h]=b.useState([]),y=nt((e,t)=>{f.current||r.current.openEvent&&!rr(r.current.openEvent)||u.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const u=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},s="x"===t.axis||"both"===t.axis,c="y"===t.axis||"both"===t.axis,l=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let a=u.width,f=u.height,d=u.x,p=u.y;return null==n&&t.x&&s&&(n=u.x-t.x),null==r&&t.y&&c&&(r=u.y-t.y),d-=n||0,p-=r||0,a=0,f=0,!o||l?(a="y"===t.axis?u.width:0,f="x"===t.axis?u.height:0,d=s&&null!=t.x?t.x:d,p=c&&null!=t.y?t.y:p):o&&!l&&(f="x"===t.axis?u.height:f,a="y"===t.axis?u.width:a),o=!0,{width:a,height:f,x:d,y:p,top:p,right:d+a,bottom:p+f,left:d}}}}(i,{x:e,y:t,axis:c,dataRef:r,pointerType:p}))}),g=nt(e=>{null==l&&null==a&&(n?d.current||h([]):y(e.clientX,e.clientY))}),x=Qe(p)?o:n,w=b.useCallback(()=>{if(!x||!s||null!=l||null!=a)return;const e=Y(o);function t(n){const r=Be(n);ze(o,r)?(e.removeEventListener("mousemove",t),d.current=null):y(n.clientX,n.clientY)}if(!r.current.openEvent||rr(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}u.setPositionReference(i)},[x,s,l,a,o,r,u,i,y]);b.useEffect(()=>w(),[w,m]),b.useEffect(()=>{s&&!o&&(f.current=!1)},[s,o]),b.useEffect(()=>{!s&&n&&(f.current=!0)},[s,n]),Je(()=>{!s||null==l&&null==a||(f.current=!1,y(l,a))},[s,l,a,y]);const E=b.useMemo(()=>{function e(e){let{pointerType:t}=e;v(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return b.useMemo(()=>s?{reference:E}:{},[s,E])}(e,{enabled:t&&"point"===n,...s}),m=function(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:u}=e,{enabled:s=!0,role:c="dialog"}=t,l=hn(),a=(null==(n=i.domReference)?void 0:n.id)||l,f=b.useMemo(()=>{var e;return(null==(e=Xe(i.floating))?void 0:e.id)||u},[i.floating,u]),d=null!=(r=lr.get(c))?r:c,p=null!=wn(),v=b.useMemo(()=>"tooltip"===d||"label"===c?{["aria-"+("label"===c?"labelledby":"describedby")]:o?f:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===d?"dialog":d,"aria-controls":o?f:void 0,..."listbox"===d&&{role:"combobox"},..."menu"===d&&{id:a},..."menu"===d&&p&&{role:"menuitem"},..."select"===c&&{"aria-autocomplete":"none"},..."combobox"===c&&{"aria-autocomplete":"list"}},[d,f,p,o,a,c]),m=b.useMemo(()=>{const e={id:f,...d&&{role:d}};return"tooltip"===d||"label"===c?e:{...e,..."menu"===d&&{"aria-labelledby":a}}},[d,f,a,c]),h=b.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:f+"-fui-option"}};switch(c){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[f,c]);return b.useMemo(()=>s?{reference:v,floating:m,item:h}:{},[s,v,m,h])}(e,c);return function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=b.useCallback(t=>cr(t,e,"reference"),t),i=b.useCallback(t=>cr(t,e,"floating"),n),u=b.useCallback(t=>cr(t,e,"item"),r);return b.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}([a,f,d,p,v,m,...l])},br=({enabled:e=!0,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:u,clientPointsOptions:s,roleOptions:c,extraInteractions:l,open:a,floatingOptions:f,useOffset:d=!0,offsetOptions:p,useFlip:v=!0,flipOptions:m,useShift:h=!0,shiftOptions:y,useArrow:g=!1,arrowOptions:x,transitionOptions:w,useAutoPlacement:E=!1,autoPlacementOptions:R,useAutoUpdate:O=!1,autoUpdateOptions:C,useAutoSize:S=!1,sizeOptions:_,minAcceptableWidth:j=null,minAcceptableHeight:L=null,maxAcceptableWidth:k,maxAcceptableHeight:T,onOpen:A,onClose:P})=>{const{theme:M}=W(),D=function(){const e=hn(),t=En(),n=wn();return Je(()=>{if(!e)return;const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}},[t,e,n]),e}(),[$,I]=(0,b.useState)(!1),N=(0,b.useRef)(null),H=e&&(a??$);(0,b.useEffect)(()=>{H&&A?.()},[H]),((e,t)=>{const n=(0,b.useRef)(e);(0,b.useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(e,e=>{e||I(!1)});const F=[];d&&F.push((e=>{const t=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:s}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=wt(n),s=Et(n),c="y"===Ct(n),l=Nt.has(u)?-1:1,a=i&&c?-1:1,f=xt(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return s&&"number"==typeof v&&(p="end"===s?-1*v:v),c?{x:p*a,y:d*l}:{x:d*l,y:p*a}}(t,e);return u===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:u}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(p??M.spacings.base));let z=null;if(E?F.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:u,placement:s,platform:c,elements:l}=t,{crossAxis:a=!1,alignment:f,allowedPlacements:d=dt,autoAlignment:p=!0,...v}=xt(e,t),m=void 0!==f||d===dt?function(e,t,n){return(e?[...n.filter(t=>Et(t)===e),...n.filter(t=>Et(t)!==e)]:n.filter(e=>wt(e)===e)).filter(n=>!e||Et(n)===e||!!t&&jt(n)!==n)}(f||null,p,d):d,h=(null==(n=u.autoPlacement)?void 0:n.index)||0,y=m[h];if(null==y)return{};if(s!==y)return{reset:{placement:m[0]}};const g=await c.detectOverflow(t,v),b=_t(y,i,await(null==c.isRTL?void 0:c.isRTL(l.floating))),x=[g[wt(y)],g[b[0]],g[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:y,overflows:x}],E=m[h+1];if(E)return{data:{index:h+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=Et(e.placement);return[e.placement,t&&a?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),O=R.filter(e=>e[2].slice(0,Et(e[0])?2:3).every(e=>e<=0)),C=(null==(o=O[0])?void 0:o[0])||R[0][0];return C!==s?{data:{index:h+1,overflows:w},reset:{placement:C}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(R)):v&&(z=(e=>{const t=en(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...m})),S){const e=(e=>{const t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:u=()=>{},...s}=xt(e,t),c=await o.detectOverflow(t,s),l=wt(n),a=Et(n),f="y"===Ct(n),{width:d,height:p}=r.floating;let v,m;"top"===l||"bottom"===l?(v=l,m=a===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=l,v="end"===a?"top":"bottom");const h=p-c.top-c.bottom,y=d-c.left-c.right,g=pt(p-c[v],h),b=pt(d-c[m],y),x=t.middlewareData.shift,w=!x;let E=g,R=b;null!=x&&x.enabled.x&&(R=y),null!=x&&x.enabled.y&&(E=h),w&&!a&&(f?R=d-2*vt(c.left,c.right):E=p-2*vt(c.top,c.bottom)),await u({...t,availableWidth:R,availableHeight:E});const O=await o.getDimensions(i.floating);return d!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({..._,apply({elements:e,rects:t,availableWidth:n,availableHeight:r}){const o=i(j)?j(t.reference):j??t.reference.width,u=i(k)?k(t.reference):Math.min(n,k??1/0),s=i(L)?L(t.reference):L??0,c=i(T)?T(t.reference):Math.min(r,T??1/0);Object.assign(e.floating.style,{minWidth:`${Math.min(o,u)}px`,maxWidth:`${u}px`,minHeight:`${Math.min(s,c)}px`,maxHeight:`${c}px`})}});z?"initialPlacement"===m?.fallbackStrategy?F.push(e,z):F.push(z,e):F.push(e)}else z&&F.push(z);h&&F.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:u=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=xt(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=Ct(o),p=Rt(d);let v=a[p],m=a[d];const h=(e,t)=>bt(t+f["y"===e?"top":"left"],t,t-f["y"===e?"bottom":"right"]);u&&(v=h(p,v)),s&&(m=h(d,m));const y=c.fn({...t,[p]:v,[d]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:u,[d]:s}}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({padding:M.spacings.base,...y})),g&&F.push(((e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?tn({element:n.current,padding:r}).fn(t):{}:n?tn({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}})({element:N,padding:M.spacings.base,...x}));const B=function(e){var t,n;let{elements:r,...o}=void 0===e?{}:e;const{nodeId:i}=o,u=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=hn(),i=b.useRef({}),[u]=b.useState(()=>gn()),s=null!=wn(),[c,l]=b.useState(r.reference),a=nt((e,t,r)=>{i.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)}),f=b.useMemo(()=>({setPositionReference:l}),[]),d=b.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return b.useMemo(()=>({dataRef:i,open:t,onOpenChange:a,elements:d,events:u,floatingId:o,refs:f}),[t,a,d,u,o,f])}({...o,elements:{reference:null!=(t=null==r?void 0:r.reference)?t:null,floating:null!=(n=null==r?void 0:r.floating)?n:null}}),s=o.rootContext||u,c=s.elements,[l,a]=b.useState(null),[f,d]=b.useState(null),p=(null==c?void 0:c.domReference)||l,v=b.useRef(null),m=En();Je(()=>{p&&(v.current=p)},[p]);const h=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:u}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[a,f]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=b.useState(r);on(d,r)||p(r);const[v,m]=b.useState(null),[h,y]=b.useState(null),g=b.useCallback(e=>{e!==R.current&&(R.current=e,m(e))},[]),x=b.useCallback(e=>{e!==O.current&&(O.current=e,y(e))},[]),w=i||v,E=u||h,R=b.useRef(null),O=b.useRef(null),C=b.useRef(a),S=null!=c,_=cn(c),j=cn(o),L=cn(l),k=b.useCallback(()=>{if(!R.current||!O.current)return;const e={placement:t,strategy:n,middleware:d};j.current&&(e.platform=j.current),nn(R.current,O.current,e).then(e=>{const t={...e,isPositioned:!1!==L.current};T.current&&!on(C.current,t)&&(C.current=t,at.flushSync(()=>{f(t)}))})},[d,t,n,j,L]);rn(()=>{!1===l&&C.current.isPositioned&&(C.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);const T=b.useRef(!1);rn(()=>(T.current=!0,()=>{T.current=!1}),[]),rn(()=>{if(w&&(R.current=w),E&&(O.current=E),w&&E){if(_.current)return _.current(w,E,k);k()}},[w,E,k,_,S]);const A=b.useMemo(()=>({reference:R,floating:O,setReference:g,setFloating:x}),[g,x]),P=b.useMemo(()=>({reference:w,floating:E}),[w,E]),M=b.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=sn(P.floating,a.x),r=sn(P.floating,a.y);return s?{...e,transform:"translate("+t+"px, "+r+"px)",...un(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,s,P.floating,a.x,a.y]);return b.useMemo(()=>({...a,update:k,refs:A,elements:P,floatingStyles:M}),[a,k,A,P,M])}({...o,elements:{...c,...f&&{reference:f}}}),y=b.useCallback(e=>{const t=Q(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),h.refs.setReference(t)},[h.refs]),g=b.useCallback(e=>{(Q(e)||null===e)&&(v.current=e,a(e)),(Q(h.refs.reference.current)||null===h.refs.reference.current||null!==e&&!Q(e))&&h.refs.setReference(e)},[h.refs]),x=b.useMemo(()=>({...h.refs,setReference:g,setPositionReference:y,domReference:v}),[h.refs,g,y]),w=b.useMemo(()=>({...h.elements,domReference:p}),[h.elements,p]),E=b.useMemo(()=>({...h,...s,refs:x,elements:w,nodeId:i}),[h,x,w,i,s]);return Je(()=>{s.dataRef.current.floatingContext=E;const e=null==m?void 0:m.nodesRef.current.find(e=>e.id===i);e&&(e.context=E)}),b.useMemo(()=>({...h,context:E,refs:x,elements:w}),[h,x,w,E])}({nodeId:D,open:H,middleware:F,onOpenChange:(e,t,n)=>{I(e),e||P?.(n,t)},...O&&{whileElementsMounted:(e,t,n)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,l=Ft(e),a=o||i?[...l?me(l):[],...t?me(t):[]]:[];a.forEach(e=>{o&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});const f=l&&s?function(e,t,n){let r,o=null;const i=G(e);function u(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function s(n,c){void 0===n&&(n=!1),void 0===c&&(c=1),u();const l=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=l;if(n||t(),!d||!p)return;const v={rootMargin:-ht(f)+"px "+-ht(i.clientWidth-(a+d))+"px "+-ht(i.clientHeight-(f+p))+"px "+-ht(a)+"px",threshold:vt(0,pt(1,c))||1};let m=!0;function h(t){const n=t[0].intersectionRatio;if(!Jt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!m)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}m=!1}try{o=new IntersectionObserver(h,{...v,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(h,v)}o.observe(e)}const c=Y(e),l=()=>s(n);return c.addEventListener("resize",l),s(!0),()=>{c.removeEventListener("resize",l),u()}}(l,n,i):null;let d,p=-1,v=null;u&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),l&&!c&&v.observe(l),t&&v.observe(t));let m=c?Ut(e):null;return c&&function t(){const r=Ut(e);m&&!Jt(m,r)&&n(),m=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;a.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=v)||e.disconnect(),v=null,c&&cancelAnimationFrame(d)}}(e,t,n,C)},...f}),U=gr(B.context,{enabled:e,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:u,clientPointsOptions:s,roleOptions:c,extraInteractions:l}),K=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:u=250}=t,s=e.placement,c=s.split("-")[0],l=b.useMemo(()=>({side:c,placement:s}),[c,s]),a="number"==typeof u,f=(a?u:u.open)||0,d=(a?u:u.close)||0,[p,v]=b.useState(()=>({...fr(i,l),...fr(n,l)})),{isMounted:m,status:h}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:o=250}=t,i=("number"==typeof o?o:o.close)||0,[u,s]=b.useState("unmounted"),c=function(e,t){const[n,r]=b.useState(e);return e&&!n&&r(!0),b.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,i);return c||"close"!==u||s("unmounted"),Je(()=>{if(r){if(n){s("initial");const e=requestAnimationFrame(()=>{at.flushSync(()=>{s("open")})});return()=>{cancelAnimationFrame(e)}}s("close")}},[n,r]),{isMounted:c,status:u}}(e,{duration:u}),y=et(n),g=et(r),x=et(o),w=et(i);return Je(()=>{const e=fr(y.current,l),t=fr(x.current,l),n=fr(w.current,l),r=fr(g.current,l)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===h&&v(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===h&&v({transitionProperty:Object.keys(r).map(ar).join(","),transitionDuration:f+"ms",...n,...r}),"close"===h){const r=t||e;v({transitionProperty:Object.keys(r).map(ar).join(","),transitionDuration:d+"ms",...n,...r})}},[d,x,y,g,w,f,h,l]),{isMounted:m,styles:p}}(B.context,{duration:250,...w});return{nodeId:D,isOpen:H,floating:B,arrowRef:N,interactions:U,transition:K}},xr=()=>{const e=(0,b.useContext)(V);return o(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},wr=({children:e,referenceUserProps:t,referenceProps:n,content:r,contentProps:o,focusManagerProps:i,arrowProps:s,portalProps:c,adjustStyles:l,context:a,...f})=>{const{useArrow:d,onClose:p}=f,v=D(p),{nodeId:m,floating:h,isOpen:y,arrowRef:x,interactions:w,transition:E}=br(f),R=(0,b.useCallback)(()=>{v.current?.("escape-key")},[]),O=(0,b.useMemo)(()=>({context:a,floatingContext:h.context}),[a,h.context]);return(0,g.jsx)(hr,{ref:h.refs.setReference,...w.getReferenceProps(t),...n,"data-testid":"honey-popup",children:(0,g.jsxs)(V,{value:O,children:[u(e,O),(0,g.jsx)(Rn,{id:m,children:E.isMounted&&(0,g.jsx)(yr,{...c,children:(0,g.jsx)(er,{context:h.context,disabled:!y,...i,children:(0,g.jsxs)(K,{ref:h.refs.setFloating,active:y,style:l?.({...h.floatingStyles,...E.styles},{middlewareData:h.middlewareData})??{...h.floatingStyles,...E.styles},onDeactivate:R,...w.getFloatingProps(),...o,"data-testid":"honey-popup-floating-content",children:[d&&(0,g.jsx)(yn,{ref:x,context:h.context,fill:"white",...s}),u(r,O)]})})})})]})})},Er=({useTree:e=!1,...t})=>(0,g.jsx)(mr,{enabled:e,children:(0,g.jsx)(wr,{...t})}),Rr=(0,e.styled)(y,{row:!0,centerY:!0})`
|
|
36
|
+
`,_=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:i=!0,applyColumnMaxWidth:c=!1,...s})=>{const l=(0,u().useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:i,applyColumnMaxWidth:c}),[n,r,i,c]);return(0,o().jsx)(O,{value:l,children:(0,o().jsx)(S,{ref:e,spacing:r,"data-testid":"honey-grid",...s,children:t})})},j=()=>{const e=(0,u().useContext)(O);if(!e)throw new Error("The `useHoneyGridContext()` hook can only be used inside <HoneyGrid/> component!");return e},L=({children:e,...t})=>{const{columns:n,spacing:r,isColumnsGrowing:i,applyColumnMaxWidth:u}=j();return(0,o().jsx)(C,{columns:n,spacing:r,applyMaxWidth:u,$flexGrow:i?1:0,"data-testid":"honey-grid-column",...t,children:e})},k=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,T=({children:e,loading:t=!1,loadingOverContent:n=!1,error:r=!1,empty:i=!1,loadingContent:u=null,errorContent:c=null,emptyContent:s=null})=>r?c:!n&&t?u:(0,o().jsxs)(o().Fragment,{children:[n&&t&&u,i?s:e]}),A=(0,c.styled)(E,({$overflow:e="hidden auto"})=>({$overflow:e}))``,P=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:i,loadingContent:c,error:s,errorContent:l,empty:a=!1,emptyContent:f,...d})=>(0,o().jsx)(A,{role:"list","aria-busy":r,"data-testid":"honey-list",...d,children:(0,o().jsx)(T,{loading:r,loadingOverContent:i,loadingContent:c,error:s,errorContent:l,empty:a||0===t?.length,emptyContent:f,children:t?.map((t,r,i)=>(0,o().jsx)(u().Fragment,{children:e(t,r,i)},String(k(t,n,r))))})}),M=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,c]=(0,u().useState)(r||t),s=(0,u().useRef)(void 0);return(0,u().useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(s.current),c(!0),()=>{o||(s.current=setTimeout(()=>c(!1),n))}},[t,r,n]),i?e:null};var D={551(e,t,n){var r="Expected a function",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,u=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,a="object"==typeof self&&self&&self.Object===Object&&self,f=l||a||Function("return this")(),d=Object.prototype.toString,p=Math.max,v=Math.min,m=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function y(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==d.call(e)}(e))return NaN;if(h(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=h(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var n=u.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):i.test(e)?NaN:+e}e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(r);return h(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),function(e,t,n){var o,i,u,c,s,l,a=0,f=!1,d=!1,g=!0;if("function"!=typeof e)throw new TypeError(r);function b(t){var n=o,r=i;return o=i=void 0,a=t,c=e.apply(r,n)}function x(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-a>=u}function w(){var e=m();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?v(n,u-(e-a)):n}(e))}function E(e){return s=void 0,g&&o?b(e):(o=i=void 0,c)}function R(){var e=m(),n=x(e);if(o=arguments,i=this,l=e,n){if(void 0===s)return function(e){return a=e,s=setTimeout(w,t),f?b(e):c}(l);if(d)return s=setTimeout(w,t),b(l)}return void 0===s&&(s=setTimeout(w,t)),c}return t=y(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(y(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),R.cancel=function(){void 0!==s&&clearTimeout(s),a=0,o=l=i=s=void 0},R.flush=function(){return void 0===s?c:E(m())},R}(e,t,{leading:o,maxWait:t,trailing:i})}}},$={};function I(e){var t=$[e];if(void 0!==t)return t.exports;var n=$[e]={exports:{}};return D[e](n,n.exports,I),n.exports}I.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return I.d(t,{a:t}),t},I.d=(e,t)=>{for(var n in t)I.o(t,n)&&!I.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},I.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),I.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const N=e=>{const t=(0,u().useRef)(e);return t.current=e,t};var H=I(551);I.n(H);var F=n(551),W=n.n(F);const z=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,u().useState)(()=>({...y(e.breakpoints),...n}));return(0,u().useEffect)(()=>{const r=W()(()=>{const t={...y(e.breakpoints),...n};o(e=>{return n=e,r=t,Object.keys(r).every(e=>n[e]===r[e])?e:t;var n,r})},t);return r(),window.addEventListener("resize",r),window.screen.orientation.addEventListener("change",r),()=>{r.cancel(),window.removeEventListener("resize",r),window.screen.orientation.removeEventListener("change",r)}},[]),r},B=(0,u().createContext)(void 0),U=()=>{const e=(0,u().useContext)(B);return l(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},K=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=U(),o=(0,u().useRef)(null);return(0,u().useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},V=()=>()=>{},q=(e,{enabled:t=!0,onKeyUp:n}={})=>{const{getOverlaysSnapshot:r,subscribeOverlays:o}=U(),i=(0,u().useCallback)(()=>t?r().find(t=>t.id===e)??null:null,[t,e]),c=(0,u().useSyncExternalStore)(t?o:V,i,i);return(0,u().useEffect)(()=>{if(c&&n)return c.addListener("keyup",n),()=>{c.removeListener("keyup",n)}},[c,n]),c},X=({ref:e,children:t,active:n,overlayId:r,onDeactivate:i,onKeyUp:c,...s})=>{const l=N(c),a=N(i),d=(0,u().useCallback)((e,...t)=>{l.current?l.current(e,...t):"Escape"===e&&a.current()},[]),v=K(n,{id:r,onKeyUp:d}),m=p(v?.setContainerRef,e);return(0,o().jsx)(E,{ref:m,inert:!n,...s,children:f(t,{overlay:v,isActive:n,deactivateOverlay:a.current})})},Y=(0,u().createContext)(void 0);function G(){return"undefined"!=typeof window}function Z(e){return ee(e)?(e.nodeName||"").toLowerCase():"#document"}function Q(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function J(e){var t;return null==(t=(ee(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ee(e){return!!G()&&(e instanceof Node||e instanceof Q(e).Node)}function te(e){return!!G()&&(e instanceof Element||e instanceof Q(e).Element)}function ne(e){return!!G()&&(e instanceof HTMLElement||e instanceof Q(e).HTMLElement)}function re(e){return!(!G()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Q(e).ShadowRoot)}function oe(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ve(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function ie(e){return/^(table|td|th)$/.test(Z(e))}function ue(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const ce=/transform|translate|scale|rotate|perspective|filter/,se=/paint|layout|strict|content/,le=e=>!!e&&"none"!==e;let ae;function fe(e){const t=te(e)?ve(e):e;return le(t.transform)||le(t.translate)||le(t.scale)||le(t.rotate)||le(t.perspective)||!de()&&(le(t.backdropFilter)||le(t.filter))||ce.test(t.willChange||"")||se.test(t.contain||"")}function de(){return null==ae&&(ae="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ae}function pe(e){return/^(html|body|#document)$/.test(Z(e))}function ve(e){return Q(e).getComputedStyle(e)}function me(e){return te(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function he(e){if("html"===Z(e))return e;const t=e.assignedSlot||e.parentNode||re(e)&&e.host||J(e);return re(t)?t.host:t}function ye(e){const t=he(e);return pe(t)?(e.ownerDocument||e).body:ne(t)&&oe(t)?t:ye(t)}function ge(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ye(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=Q(o);if(i){const e=be(u);return t.concat(u,u.visualViewport||[],oe(o)?o:[],e&&n?ge(e):[])}return t.concat(o,ge(o,[],n))}function be(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var xe=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),we="undefined"==typeof Element,Ee=we?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Re=!we&&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},Oe=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):Oe(e.parentNode))},Ce=function(e,t,n){if(Oe(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(xe));return t&&Ee.call(e,xe)&&r.unshift(e),r.filter(n)},Se=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!Oe(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,s=Se(c,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{Ee.call(i,xe)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!Oe(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=Se(!0===l?i.children:l.children,!0,n);n.flatten?r.push.apply(r,f):r.push({scopeParent:i,candidates:f})}else o.unshift.apply(o,i.children)}}return r},_e=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},je=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!_e(e)?0:e.tabIndex},Le=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ke=function(e){return"INPUT"===e.tagName},Te=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ae=function(e,t){return!(t.disabled||function(e){return ke(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var o=getComputedStyle(e).visibility;if("hidden"===o||"collapse"===o)return!0;var i=Ee.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Ee.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Te(e)}else{if("function"==typeof r){for(var u=e;e;){var c=e.parentElement,s=Re(e);if(c&&!c.shadowRoot&&!0===r(c))return Te(e);e=e.assignedSlot?e.assignedSlot:c||s===e.ownerDocument?c:s.host}e=u}if(function(e){var t,n,r,o,i=e&&Re(e),u=null===(t=i)||void 0===t?void 0:t.host,c=!1;if(i&&i!==e)for(c=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!c&&u;){var s,l,a;c=!(null===(l=u=null===(s=i=Re(u))||void 0===s?void 0:s.host)||void 0===l||null===(a=l.ownerDocument)||void 0===a||!a.contains(u))}return c}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!Ee.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Pe=function(e,t){return!(function(e){return function(e){return ke(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||Re(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)}(t)||je(t)<0||!Ae(e,t))},Me=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},De=function(e){var t=[],n=[];return e.forEach(function(e,r){var o=!!e.scopeParent,i=o?e.scopeParent:e,u=function(e,t){var n=je(e);return n<0&&t&&!_e(e)?0:n}(i,o),c=o?De(e.candidates):i;0===u?o?t.push.apply(t,c):t.push(i):n.push({documentOrder:r,tabIndex:u,item:e,isScope:o,content:c})}),n.sort(Le).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},$e=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Se([e],t.includeContainer,{filter:Pe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Me}):Ce(e,t.includeContainer,Pe.bind(null,t)),De(n)},Ie=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Ee.call(e,xe)&&Pe(t,e)};function Ne(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function He(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function Fe(){return/apple/i.test(navigator.vendor)}function We(){const e=/android/i;return e.test(Ne())||e.test(He())}function ze(){return He().includes("jsdom/")}const Be="data-floating-ui-focusable";function Ue(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Ke(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&re(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ve(e){return"composedPath"in e?e.composedPath()[0]:e.target}function qe(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function Xe(e){return(null==e?void 0:e.ownerDocument)||document}function Ye(e){return ne(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Ge(e){return!!e&&"combobox"===e.getAttribute("role")&&Ye(e)}function Ze(e){return e?e.hasAttribute(Be)?e:e.querySelector("["+Be+"]")||e:null}function Qe(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...Qe(e,t.id,n)])}function Je(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){const t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function et(e){e.preventDefault(),e.stopPropagation()}function tt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var nt="undefined"!=typeof document?u().useLayoutEffect:function(){};function rt(e){const t=u().useRef(e);return nt(()=>{t.current=e}),t}const ot={...R()}.useInsertionEffect||(e=>e());function it(e){const t=u().useRef(()=>{});return ot(()=>{t.current=e}),u().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 ut=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(e,t){const n=$e(e,ut()),r=n.length;if(0===r)return;const o=Ue(Xe(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function st(e){return ct(Xe(e).body,1)||e}function lt(e){return ct(Xe(e).body,-1)||e}function at(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ke(n,r)}function ft(e){$e(e,ut()).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")})}t();const pt=["start","end"],vt=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+pt[0],t+"-"+pt[1]),[]),mt=Math.min,ht=Math.max,yt=Math.round,gt=Math.floor,bt=e=>({x:e,y:e}),xt={left:"right",right:"left",bottom:"top",top:"bottom"};function wt(e,t,n){return ht(e,mt(t,n))}function Et(e,t){return"function"==typeof e?e(t):e}function Rt(e){return e.split("-")[0]}function Ot(e){return e.split("-")[1]}function Ct(e){return"x"===e?"y":"x"}function St(e){return"y"===e?"height":"width"}function _t(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function jt(e){return Ct(_t(e))}function Lt(e,t,n){void 0===n&&(n=!1);const r=Ot(e),o=jt(e),i=St(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=Dt(u)),[u,Dt(u)]}function kt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Tt=["left","right"],At=["right","left"],Pt=["top","bottom"],Mt=["bottom","top"];function Dt(e){const t=Rt(e);return xt[t]+e.slice(t.length)}function $t(e){return"number"!=typeof e?function(e){var t,n,r,o;return{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(r=e.bottom)?r:0,left:null!=(o=e.left)?o:0}}(e):{top:e,right:e,bottom:e,left:e}}function It(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Nt(e,t,n){let{reference:r,floating:o}=e;const i=_t(t),u=jt(t),c=St(u),s=Rt(t),l="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[c]/2-o[c]/2;let p;switch(s){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}const v=Ot(t);return v&&(p[u]+=d*("end"===v?1:-1)*(n&&l?-1:1)),p}async function Ht(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:u,elements:c,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=Et(t,e),v=$t(p),m=c[d?"floating"===f?"reference":"floating":f],h=It(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:a,strategy:s})),y="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},x=It(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:g,strategy:s}):y);return{top:(h.top-x.top+v.top)/b.y,bottom:(x.bottom-h.bottom+v.bottom)/b.y,left:(h.left-x.left+v.left)/b.x,right:(x.right-h.right+v.right)/b.x}}const Ft=new Set(["left","top"]);function Wt(e){const t=ve(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ne(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=yt(n)!==i||yt(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function zt(e){return te(e)?e:e.contextElement}function Bt(e){const t=zt(e);if(!ne(t))return bt(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Wt(t);let u=(i?yt(n.width):n.width)/r,c=(i?yt(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Ut=bt(0);function Kt(e){const t=Q(e);return de()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ut}function Vt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=zt(e);let u=bt(1);t&&(r?te(r)&&(u=Bt(r)):u=Bt(e));const c=function(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===Q(e)}(i,n,r)?Kt(i):bt(0);let s=(o.left+c.x)/u.x,l=(o.top+c.y)/u.y,a=o.width/u.x,f=o.height/u.y;if(i&&r){const e=Q(i),t=te(r)?Q(r):r;let n=e,o=be(n);for(;o&&t!==n;){const e=Bt(o),t=o.getBoundingClientRect(),r=ve(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,l*=e.y,a*=e.x,f*=e.y,s+=i,l+=u,n=Q(o),o=be(n)}}return It({width:a,height:f,x:s,y:l})}function qt(e,t){const n=me(e).scrollLeft;return t?t.left+n:Vt(J(e)).left+n}function Xt(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qt(e,n),y:n.top+t.scrollTop}}function Yt(e,t,n){let r;if("viewport"===t||"layoutViewport"===t)r=function(e,t,n){void 0===n&&(n="viewport");const r="layoutViewport"===n,o=Q(e),i=J(e),u=o.visualViewport;let c=i.clientWidth,s=i.clientHeight,l=0,a=0;if(u){const e=!de()||"fixed"===t;r?e||(l=-u.offsetLeft,a=-u.offsetTop):(c=u.width,s=u.height,e&&(l=u.offsetLeft,a=u.offsetTop))}if(qt(i)<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(i.clientWidth-t.clientWidth-r),u="stable both-edges"===getComputedStyle(i).scrollbarGutter?o/2:o;u<=25&&(c-=u)}return{width:c,height:s,x:l,y:a}}(e,n,t);else if("document"===t)r=function(e){const t=me(e),n=e.ownerDocument.body,r=ht(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=ht(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+qt(e);const u=-t.scrollTop;return"rtl"===ve(n).direction&&(i+=ht(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:u}}(J(e));else if(te(t))r=function(e,t){const n=Vt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Bt(e);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Kt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return It(r)}function Gt(e,t,n){const r=ne(t),o=J(t),i="fixed"===n,u=Vt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=bt(0);if((r||!i)&&(("body"!==Z(t)||oe(o))&&(c=me(t)),r)){const e=Vt(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!r&&o&&(s.x=qt(o));const l=!o||r||i?bt(0):Xt(o,c);return{x:u.left+c.scrollLeft-s.x-l.x,y:u.top+c.scrollTop-s.y-l.y,width:u.width,height:u.height}}function Zt(e){return"static"===ve(e).position}function Qt(e,t){if(!ne(e)||"fixed"===ve(e).position)return null;if(t)return t(e);let n=e.offsetParent;return J(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){const n=Q(e);if(ue(e))return n;if(!ne(e)){let t=he(e);for(;t&&!pe(t);){if(te(t)&&!Zt(t))return t;t=he(t)}return n}let r=Qt(e,t);for(;r&&ie(r)&&Zt(r);)r=Qt(r,t);return r&&pe(r)&&Zt(r)&&!fe(r)?n:r||function(e){let t=he(e);for(;ne(t)&&!pe(t);){if(fe(t))return t;if(ue(t))return null;t=he(t)}return null}(e)||n}const en={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=J(r),c=!!t&&ue(t.floating);if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=bt(1);const a=bt(0),f=ne(r);if((f||!i)&&(("body"!==Z(r)||oe(u))&&(s=me(r)),f)){const e=Vt(r);l=Bt(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?bt(0):Xt(u,s);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+a.x+d.x,y:n.y*l.y-s.scrollTop*l.y+a.y+d.y}},getDocumentElement:J,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?ue(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=ge(e,[],!1).filter(e=>te(e)&&"body"!==Z(e)),o=null;const i="fixed"===ve(e).position;let u=i?he(e):e;for(;te(u)&&!pe(u);){const e=ve(u),t=fe(u),n=o?o.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?o=e:r=r.filter(e=>e!==u),u=he(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=Yt(t,i[0],o);let c=u.top,s=u.right,l=u.bottom,a=u.left;for(let e=1;e<i.length;e++){const n=Yt(t,i[e],o);c=ht(n.top,c),s=mt(n.right,s),l=mt(n.bottom,l),a=ht(n.left,a)}return{width:s-a,height:l-c,x:a,y:c}},getOffsetParent:Jt,getElementRects:async function(e){const t=this.getOffsetParent||Jt,n=this.getDimensions,r=await n(e.floating);return{reference:Gt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){const{width:t,height:n}=Wt(e);return{width:t,height:n}},getScale:Bt,isElement:te,isRTL:function(e){return"rtl"===ve(e).direction}};function tn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const nn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:c,platform:s,elements:l}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:m=!0,...h}=Et(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=Rt(o),g=_t(c),b=Rt(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(l.floating)),w=d||(b||!m?[Dt(c)]:function(e){const t=Dt(e);return[kt(e),t,kt(t)]}(c)),E="none"!==v;!d&&E&&w.push(...function(e,t,n,r){const o=Ot(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?At:Tt:t?Tt:At;case"left":case"right":return t?Pt:Mt;default:return[]}}(Rt(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(kt)))),i}(c,m,v,x));const R=[c,...w],O=await s.detectOverflow(t,h),C=[];let S=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&C.push(O[y]),f){const e=Lt(o,u,x);C.push(O[e[0]],O[e[1]])}if(S=[...S,{placement:o,overflows:C}],!C.every(e=>e<=0)){var _,j;const e=((null==(_=i.flip)?void 0:_.index)||0)+1,t=R[e];if(t&&("alignment"!==f||g===_t(t)||S.every(e=>_t(e.placement)!==g||e.overflows[0]>0)))return{data:{index:e,overflows:S},reset:{placement:t}};let n=null==(j=S.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:j.placement;if(!n)switch(p){case"bestFit":{var L;const e=null==(L=S.filter(e=>{if(E){const t=_t(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},rn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:u,elements:c,middlewareData:s}=t,{element:l,padding:a=0}=Et(e,t)||{};if(null==l)return{};const f=$t(a),d={x:n,y:r},p=jt(o),v=St(p),m=await u.getDimensions(l),h="y"===p,y=h?"top":"left",g=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[v]+i.reference[p]-d[p]-i.floating[v],w=d[p]-i.reference[p],E=await(null==u.getOffsetParent?void 0:u.getOffsetParent(l));let R=E?E[b]:0;R&&await(null==u.isElement?void 0:u.isElement(E))||(R=c.floating[b]||i.floating[v]);const O=x/2-w/2,C=R/2-m[v]/2-1,S=mt(f[y],C),_=mt(f[g],C),j=R-m[v]-_,L=R/2-m[v]/2+O,k=wt(S,L,j),T=!s.arrow&&null!=Ot(o)&&L!==k&&i.reference[v]/2-(L<S?S:_)-m[v]/2<0,A=T?L<S?L-S:L-j:0;return{[p]:d[p]+A,data:{[p]:k,centerOffset:L-k-A,...T&&{alignmentOffset:A}},reset:T}}}),on=(e,t,n)=>{const r=new Map,o=null!=n?n:{},i={...en,...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,c=u.detectOverflow?u:{...u,detectOverflow:Ht},s=await(null==u.isRTL?void 0:u.isRTL(t));let l=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=Nt(l,r,s),d=r,p=0;const v={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:h,fn:y}=m,{x:g,y:b,data:x,reset:w}=await y({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:v,rects:l,platform:c,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=b?b:f,v[h]={...v[h],...x},w&&p<50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(l=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=Nt(l,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:v}})(e,t,{...o,platform:i})};var un="undefined"!=typeof document?u().useLayoutEffect:function(){};function cn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!cn(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(!("_owner"===n&&e.$$typeof||cn(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function sn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ln(e,t){const n=sn(e);return Math.round(t*n)/n}function an(e){const t=u().useRef(e);return un(()=>{t.current=e}),t}const fn="data-floating-ui-focusable",dn="active",pn="selected",vn={...R()};let mn=!1,hn=0;const yn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+hn++,gn=vn.useId||function(){const[e,t]=u().useState(()=>mn?yn():void 0);return nt(()=>{null==e&&t(yn())},[]),u().useEffect(()=>{mn=!0},[]),e},bn=u().forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:i,shift:c}},width:s=14,height:l=7,tipRadius:a=0,strokeWidth:f=0,staticOffset:d,stroke:p,d:v,style:{transform:m,...h}={},...y}=e,g=gn(),[b,x]=u().useState(!1);if(nt(()=>{r&&"rtl"===ve(r).direction&&x(!0)},[r]),!r)return null;const[w,E]=n.split("-"),R="top"===w||"bottom"===w;let O=d;(R&&null!=c&&c.x||!R&&null!=c&&c.y)&&(O=null);const C=2*f,S=C/2,_=s/2*(a/-8+1),j=l/2*a/4,L=!!v,k=O&&"end"===E?"bottom":"top";let T=O&&"end"===E?"right":"left";O&&b&&(T="end"===E?"left":"right");const A=null!=(null==i?void 0:i.x)?O||i.x:"",P=null!=(null==i?void 0:i.y)?O||i.y:"",M=v||"M0,0 H"+s+" L"+(s-_)+","+(l-j)+" Q"+s/2+","+l+" "+_+","+(l-j)+" Z",D={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[w];return(0,o().jsxs)("svg",{...y,"aria-hidden":!0,ref:t,width:L?s:s+C,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[T]:A,[k]:P,[w]:R||L?"100%":"calc(100% - "+C/2+"px)",transform:[D,m].filter(e=>!!e).join(" "),...h},children:[C>0&&(0,o().jsx)("path",{clipPath:"url(#"+g+")",fill:"none",stroke:p,strokeWidth:C+(v?0:1),d:M}),(0,o().jsx)("path",{stroke:C&&!v?y.fill:"none",d:M}),(0,o().jsx)("clipPath",{id:g,children:(0,o().jsx)("rect",{x:-S,y:S*(L?-1:1),width:s+C,height:s})})]})});function xn(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const wn=u().createContext(null),En=u().createContext(null),Rn=()=>{var e;return(null==(e=u().useContext(wn))?void 0:e.id)||null},On=()=>u().useContext(En);function Cn(e){const{children:t,id:n}=e,r=Rn();return(0,o().jsx)(wn.Provider,{value:u().useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Sn(e){const{children:t}=e,n=u().useRef([]),r=u().useCallback(e=>{n.current=[...n.current,e]},[]),i=u().useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[c]=u().useState(()=>xn());return(0,o().jsx)(En.Provider,{value:u().useMemo(()=>({nodesRef:n,addNode:r,removeNode:i,events:c}),[r,i,c]),children:t})}function _n(e){return"data-floating-ui-"+e}function jn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const Ln=_n("safe-polygon");function kn(e,t,n){if(n&&!tt(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function Tn(e){return"function"==typeof e?e():e}let An=0;function Pn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(An);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():An=requestAnimationFrame(i)}function Mn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&re(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Dn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function $n(e){return"inert"===e?Dn.inert:"aria-hidden"===e?Dn["aria-hidden"]:Dn.none}let In=new WeakSet,Nn={},Hn=0;function Fn(e){return e?re(e)?e.host:Fn(e.parentNode):null}const Wn=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Fn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function zn(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=(o=e[0],(null==o?void 0:o.ownerDocument)||document).body;var o;return function(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=Wn(t,e),c=new Set,s=new Set(u),l=[];Nn[o]||(Nn[o]=new WeakMap);const a=Nn[o];return u.forEach(function e(t){t&&!c.has(t)&&(c.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!s.has(t)&&[].forEach.call(t.children,t=>{if("script"!==Z(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=$n(i),u=(r.get(t)||0)+1,c=(a.get(t)||0)+1;r.set(t,u),a.set(t,c),l.push(t),1===u&&n&&In.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),c.clear(),Hn++,()=>{l.forEach(e=>{const t=$n(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!In.has(e)&&i&&e.removeAttribute(i),In.delete(e)),r||e.removeAttribute(o)}),Hn--,Hn||(Dn.inert=new WeakMap,Dn["aria-hidden"]=new WeakMap,Dn.none=new WeakMap,In=new WeakSet,Nn={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Bn={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},Un=u().forwardRef(function(e,t){const[n,r]=u().useState();nt(()=>{Fe()&&r("button")},[]);const i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[_n("focus-guard")]:"",style:Bn};return(0,o().jsx)("span",{...e,...i})}),Kn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},Vn=u().createContext(null),qn=_n("portal");function Xn(t){const{children:n,id:r,root:i,preserveTabOrder:c=!0}=t,s=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=gn(),o=Yn(),[i,c]=u().useState(null),s=u().useRef(null);return nt(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{s.current=null})},[i]),nt(()=>{if(!r)return;if(s.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(qn,""),e.appendChild(n),s.current=n,c(n)},[t,r]),nt(()=>{if(null===n)return;if(!r)return;if(s.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!ee(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const u=document.createElement("div");u.id=r,u.setAttribute(qn,""),e=i||e,e.appendChild(u),s.current=u,c(u)},[t,n,r,o]),i}({id:r,root:i}),[l,a]=u().useState(null),f=u().useRef(null),d=u().useRef(null),p=u().useRef(null),v=u().useRef(null),m=null==l?void 0:l.modal,h=null==l?void 0:l.open,y=!!l&&!l.modal&&l.open&&c&&!(!i&&!s);return u().useEffect(()=>{if(s&&c&&!m)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){s&&at(e)&&("focusin"===e.type?dt:ft)(s)}},[s,c,m]),u().useEffect(()=>{s&&(h||dt(s))},[h,s]),(0,o().jsxs)(Vn.Provider,{value:u().useMemo(()=>({preserveTabOrder:c,beforeOutsideRef:f,afterOutsideRef:d,beforeInsideRef:p,afterInsideRef:v,portalNode:s,setFocusManagerState:a}),[c,s]),children:[y&&s&&(0,o().jsx)(Un,{"data-type":"outside",ref:f,onFocus:e=>{if(at(e,s)){var t;null==(t=p.current)||t.focus()}else{const e=lt(l?l.domReference:null);null==e||e.focus()}}}),y&&s&&(0,o().jsx)("span",{"aria-owns":s.id,style:Kn}),s&&e().createPortal(n,s),y&&s&&(0,o().jsx)(Un,{"data-type":"outside",ref:d,onFocus:e=>{if(at(e,s)){var t;null==(t=v.current)||t.focus()}else{const t=st(l?l.domReference:null);null==t||t.focus(),(null==l?void 0:l.closeOnFocusOut)&&(null==l||l.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const Yn=()=>u().useContext(Vn);function Gn(e){return u().useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let Zn=[];function Qn(){Zn=Zn.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function Jn(){Qn();const e=Zn[Zn.length-1];return null==e?void 0:e.deref()}function er(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=ut(),o=function(e,t){return(t=t||{}).getShadowRoot?Se([e],t.includeContainer,{filter:Ae.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Ce(e,t.includeContainer,Ae.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Ie(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),u=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==u&&e.setAttribute("tabindex","0"):("-1"!==u||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const tr=u().forwardRef(function(e,t){return(0,o().jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Bn})});function nr(e){const{context:t,children:n,disabled:r=!1,order:i=["content"],guards:c=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:a=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:p=!0,outsideElementsInert:v=!1,getInsideElements:m=()=>[]}=e,{open:h,onOpenChange:y,events:g,dataRef:b,elements:{domReference:x,floating:w}}=t,E=it(()=>{var e;return null==(e=b.current.floatingContext)?void 0:e.nodeId}),R=it(m),O="number"==typeof s&&s<0,C=Ge(x)&&O,S="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,_=!S||c,j=!_||S&&v,L=rt(i),k=rt(s),T=rt(l),A=On(),P=Yn(),M=u().useRef(null),D=u().useRef(null),$=u().useRef(!1),I=u().useRef(!1),N=u().useRef(-1),H=u().useRef(-1),F=null!=P,W=Ze(w),z=it(function(e){return void 0===e&&(e=W),e?$e(e,ut()):[]}),B=it(e=>{const t=z(e);return L.current.map(e=>x&&"reference"===e?x:W&&"floating"===e?W:t).filter(Boolean).flat()});u().useEffect(()=>{if(r)return;if(!f)return;function e(e){if("Tab"===e.key){Ke(W,Ue(Xe(W)))&&0===z().length&&!C&&et(e);const t=B(),n=Ve(e);"reference"===L.current[0]&&n===x&&(et(e),e.shiftKey?Pn(t[t.length-1]):Pn(t[1])),"floating"===L.current[1]&&n===W&&e.shiftKey&&(et(e),Pn(t[0]))}}const t=Xe(W);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,x,W,f,L,C,z,B]),u().useEffect(()=>{if(!r&&w)return w.addEventListener("focusin",e),()=>{w.removeEventListener("focusin",e)};function e(e){const t=Ve(e),n=z().indexOf(t);-1!==n&&(N.current=n)}},[r,w,z]),u().useEffect(()=>{if(r)return;if(!p)return;function e(){I.current=!0,setTimeout(()=>{I.current=!1})}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=Ve(e);queueMicrotask(()=>{const o=E(),i=!(Ke(x,t)||Ke(w,t)||Ke(t,w)||Ke(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(_n("focus-guard"))||A&&(Qe(A.nodesRef.current,o).find(e=>{var n,r;return Ke(null==(n=e.context)?void 0:n.elements.floating,t)||Ke(null==(r=e.context)?void 0:r.elements.domReference,t)})||Je(A.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,Ze(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===x&&W&&er(W,L),a&&n!==x&&(null==r||!r.isConnected)&&Ue(Xe(W))===Xe(W).body){ne(W)&&W.focus();const e=N.current,t=z(),n=t[e]||t[t.length-1]||W;ne(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:!C&&f||!t||!i||I.current||t===Jn()||($.current=!0,y(!1,e,"focus-out"))})}const n=Boolean(!A&&P);function o(){jn(H),b.current.insideReactTree=!0,H.current=window.setTimeout(()=>{b.current.insideReactTree=!1})}return w&&ne(x)?(x.addEventListener("focusout",t),x.addEventListener("pointerdown",e),w.addEventListener("focusout",t),n&&w.addEventListener("focusout",o,!0),()=>{x.removeEventListener("focusout",t),x.removeEventListener("pointerdown",e),w.removeEventListener("focusout",t),n&&w.removeEventListener("focusout",o,!0)}):void 0},[r,x,w,W,f,A,P,y,p,a,z,C,E,L,b]);const U=u().useRef(null),K=u().useRef(null),V=Gn([U,null==P?void 0:P.beforeInsideRef]),q=Gn([K,null==P?void 0:P.afterInsideRef]);function X(e){return!r&&d&&f?(0,o().jsx)(tr,{ref:"start"===e?M:D,onClick:e=>y(!1,e.nativeEvent),children:"string"==typeof d?d:"Dismiss"}):null}u().useEffect(()=>{var e,t;if(r)return;if(!w)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+_n("portal")+"]"))||[]),o=null==(t=(A?Je(A.nodesRef.current,E()):[]).find(e=>{var t;return Ge((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[w,o,...n,...R(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,L.current.includes("reference")||C?x:null].filter(e=>null!=e),u=f||C?zn(i,!j,j):zn(i);return()=>{u()}},[r,x,w,f,L,P,C,_,j,A,E,R]),nt(()=>{if(r||!ne(W))return;const e=Ue(Xe(W));queueMicrotask(()=>{const t=B(W),n=k.current,r=("number"==typeof n?t[n]:n.current)||W,o=Ke(W,e);O||o||!h||Pn(r,{preventScroll:r===W})})},[r,h,W,O,B,k]),nt(()=>{if(r||!W)return;const e=Xe(W);var t;function n(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&($.current=!0),"outside-press"===t)if(r)$.current=!1;else if(function(e){return!(0!==e.mozInputSource||!e.isTrusted)||(We()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!ze()&&(!We()&&0===e.width&&0===e.height||We()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}(n))$.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),$.current=!e}}t=Ue(e),Qn(),t&&"body"!==Z(t)&&(Zn.push(new WeakRef(t)),Zn.length>20&&(Zn=Zn.slice(-20))),g.on("openchange",n);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,Bn),F&&x&&x.insertAdjacentElement("afterend",o),()=>{g.off("openchange",n);const t=Ue(e),r=Ke(w,t)||A&&Qe(A.nodesRef.current,E(),!1).some(e=>{var n;return Ke(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof T.current){const e=x||Jn();return e&&e.isConnected?e:o}return T.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=ut();return Ie(e,t)?e:$e(e,t)[0]||e}(i);T.current&&!$.current&&ne(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,w,W,T,b,g,A,F,x,E]),u().useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(Qn)}),[r]),nt(()=>{if(!r&&P)return P.setFocusManagerState({modal:f,closeOnFocusOut:p,open:h,onOpenChange:y,domReference:x}),()=>{P.setFocusManagerState(null)}},[r,P,f,h,y,p,x]),nt(()=>{r||W&&er(W,L)},[r,W,L]);const Y=!r&&_&&(!f||!C)&&(F||f);return(0,o().jsxs)(o().Fragment,{children:[Y&&(0,o().jsx)(Un,{"data-type":"inside",ref:V,onFocus:e=>{if(f){const e=B();Pn("reference"===i[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,at(e,P.portalNode)){const e=st(x);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!C&&X("start"),n,X("end"),Y&&(0,o().jsx)(Un,{"data-type":"inside",ref:q,onFocus:e=>{if(f)Pn(B()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(p&&($.current=!0),at(e,P.portalNode)){const e=lt(x);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function rr(e){return ne(e.target)&&"BUTTON"===e.target.tagName}function or(e){return Ye(e)}function ir(e){return null!=e&&null!=e.clientX}const ur={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cr={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},sr=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function lr(){return Ne().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Fe()}function ar(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[dn]:t,[pn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[fn]:""},...i,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,i]=t;var u;o&&[dn,pn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map(e=>e(...o)).find(e=>void 0!==e)})):e[n]=i)}),e):e,{})}}const fr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),dr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function pr(e,t){return"function"==typeof e?e(t):e}function vr(e,t,n){return void 0===n&&(n=!0),e.filter(e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))}).flatMap(t=>[t,...vr(e,t.id,n)])}function mr(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,u=i-1;e<i;u=e++){const[i,c]=t[e]||[0,0],[s,l]=t[u]||[0,0];c>=r!=l>=r&&n<=(s-i)*(r-c)/(l-c)+i&&(o=!o)}return o}function hr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,u=null,c=null,s="undefined"!=typeof performance?performance.now():0;const l=e=>{let{x:n,y:l,placement:a,elements:f,onClose:d,nodeId:p,tree:v}=e;return function(e){function m(){jn(o),d()}if(jn(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:y}=e,g=[h,y],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=Mn(f.floating,b),E=Mn(f.domReference,b),R=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],S=n>O.right-O.width/2,_=l>O.bottom-O.height/2,j=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(g,R),L=O.width>R.width,k=O.height>R.height,T=(L?R:O).left,A=(L?R:O).right,P=(k?R:O).top,M=(k?R:O).bottom;if(w&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&te(e.relatedTarget)&&Mn(f.floating,e.relatedTarget))return;if(v&&vr(v.nodesRef.current,p).length)return;if("top"===C&&l>=R.bottom-1||"bottom"===C&&l<=R.top+1||"left"===C&&n>=R.right-1||"right"===C&&n<=R.left+1)return m();let D=[];switch(C){case"top":D=[[T,R.top+1],[T,O.bottom-1],[A,O.bottom-1],[A,R.top+1]];break;case"bottom":D=[[T,O.top+1],[T,R.bottom-1],[A,R.bottom-1],[A,O.top+1]];break;case"left":D=[[O.right-1,M],[O.right-1,P],[R.left+1,P],[R.left+1,M]];break;case"right":D=[[R.right-1,M],[R.right-1,P],[O.left+1,P],[O.left+1,M]]}if(!mr([h,y],D)){if(i&&!j)return m();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-s;if(null===u||null===c||0===r)return u=e,c=t,s=n,null;const o=e-u,i=t-c,l=Math.sqrt(o*o+i*i);return u=e,c=t,s=n,l/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return m()}mr([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[L?n+t/2:S?n+4*t:n-4*t,r+t+1],[L?n-t/2:S?n+4*t:n-4*t,r+t+1],[O.left,S||L?O.bottom-t:O.top],[O.right,S?L?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[L?n+t/2:S?n+4*t:n-4*t,r-t],[L?n-t/2:S?n+4*t:n-4*t,r-t],[O.left,S||L?O.top+t:O.bottom],[O.right,S?L?O.top+t:O.bottom:O.top+t]];case"left":{const e=[n+t+1,k?r+t/2:_?r+4*t:r-4*t],o=[n+t+1,k?r-t/2:_?r+4*t:r-4*t];return[[_||k?O.right-t:O.left,O.top],[_?k?O.right-t:O.left:O.right-t,O.bottom],e,o]}case"right":return[[n-t,k?r+t/2:_?r+4*t:r-4*t],[n-t,k?r-t/2:_?r+4*t:r-4*t],[_||k?O.left+t:O.right,O.top],[_?k?O.left+t:O.right:O.left+t,O.bottom]]}}([n,l]))?!i&&r&&(o.current=window.setTimeout(m,40)):m()}}};return l.__options={blockPointerEvents:n},l}const yr=({children:e,enabled:t=!0,...n})=>{const r=Rn();return!t||r?e:(0,o().jsx)(Sn,{...n,children:e})},gr=(0,c.styled)(E,({$width:e="max-content"})=>({$width:e}))``,br=({children:e,enabled:t=!0,...n})=>t?(0,o().jsx)(Xn,{...n,children:e}):e,xr=(e,{enabled:t=!0,event:n="click",dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:c,clientPointsOptions:s,roleOptions:l,extraInteractions:a=[]})=>{const f=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:c=!0,escapeKey:s=!0,outsidePress:l=!0,outsidePressEvent:a="pointerdown",referencePress:f=!1,referencePressEvent:d="pointerdown",ancestorScroll:p=!1,bubbles:v,capture:m}=t,h=On(),y=it("function"==typeof l?l:()=>!1),g="function"==typeof l?y:l,b=u().useRef(!1),{escapeKey:x,outsidePress:w}=sr(v),{escapeKey:E,outsidePress:R}=sr(m),O=u().useRef(!1),C=it(e=>{var t;if(!n||!c||!s||"Escape"!==e.key)return;if(O.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,u=h?Qe(h.nodesRef.current,o):[];if(!x&&(e.stopPropagation(),u.length>0)){let e=!0;if(u.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),S=it(e=>{var t;const n=()=>{var t;C(e),null==(t=Ve(e))||t.removeEventListener("keydown",n)};null==(t=Ve(e))||t.addEventListener("keydown",n)}),_=it(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=b.current;if(b.current=!1,"click"===a&&u)return;if(n)return;if("function"==typeof g&&!g(e))return;const c=Ve(e),s="["+_n("inert")+"]",l=Xe(o.floating).querySelectorAll(s);let f=te(c)?c:null;for(;f&&!pe(f);){const e=he(f);if(pe(e)||!te(e))break;f=e}if(l.length&&te(c)&&!c.matches("html,body")&&!Ke(c,o.floating)&&Array.from(l).every(e=>!Ke(f,e)))return;if(ne(c)&&k){const t=pe(c),n=ve(c),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),u=o&&c.clientWidth>0&&c.scrollWidth>c.clientWidth,s=i&&c.clientHeight>0&&c.scrollHeight>c.clientHeight,l="rtl"===n.direction,a=s&&(l?e.offsetX<=c.offsetWidth-c.clientWidth:e.offsetX>c.clientWidth),f=u&&e.offsetY>c.clientHeight;if(a||f)return}const d=null==(t=i.current.floatingContext)?void 0:t.nodeId,p=h&&Qe(h.nodesRef.current,d).some(t=>{var n;return qe(e,null==(n=t.context)?void 0:n.elements.floating)});if(qe(e,o.floating)||qe(e,o.domReference)||p)return;const v=h?Qe(h.nodesRef.current,d):[];if(v.length>0){let e=!0;if(v.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),j=it(e=>{var t;const n=()=>{var t;_(e),null==(t=Ve(e))||t.removeEventListener(a,n)};null==(t=Ve(e))||t.addEventListener(a,n)});u().useEffect(()=>{if(!n||!c)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function u(){window.clearTimeout(e),O.current=!0}function l(){e=window.setTimeout(()=>{O.current=!1},de()?5:0)}const f=Xe(o.floating);s&&(f.addEventListener("keydown",E?S:C,E),f.addEventListener("compositionstart",u),f.addEventListener("compositionend",l)),g&&f.addEventListener(a,R?j:_,R);let d=[];return p&&(te(o.domReference)&&(d=ge(o.domReference)),te(o.floating)&&(d=d.concat(ge(o.floating))),!te(o.reference)&&o.reference&&o.reference.contextElement&&(d=d.concat(ge(o.reference.contextElement)))),d=d.filter(e=>{var t;return e!==(null==(t=f.defaultView)?void 0:t.visualViewport)}),d.forEach(e=>{e.addEventListener("scroll",t)}),()=>{s&&(f.removeEventListener("keydown",E?S:C,E),f.removeEventListener("compositionstart",u),f.removeEventListener("compositionend",l)),g&&f.removeEventListener(a,R?j:_,R),d.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,s,g,a,n,r,p,c,x,w,C,E,S,_,R,j]),u().useEffect(()=>{i.current.insideReactTree=!1},[i,g,a]);const L=u().useMemo(()=>({onKeyDown:C,...f&&{[ur[d]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==d&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[C,r,f,d]),k=u().useMemo(()=>{function e(e){0===e.button&&(b.current=!0)}return{onKeyDown:C,onMouseDown:e,onMouseUp:e,[cr[a]]:()=>{i.current.insideReactTree=!0}}},[C,a,i]);return u().useMemo(()=>c?{reference:L,floating:k}:{},[c,L,k])}(e,{escapeKey:!1,...r}),d=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:c=!0,event:s="click",toggle:l=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0,stickIfOpen:d=!0}=t,p=u().useRef(),v=u().useRef(!1),m=u().useMemo(()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){const t=p.current;0===e.button&&"click"!==s&&(tt(t,!0)&&a||(!n||!l||o.current.openEvent&&d&&"mousedown"!==o.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=p.current;"mousedown"===s&&p.current?p.current=void 0:tt(t,!0)&&a||(!n||!l||o.current.openEvent&&d&&"click"!==o.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){p.current=void 0,e.defaultPrevented||!f||rr(e)||(" "!==e.key||or(i)||(e.preventDefault(),v.current=!0),function(e){return ne(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!l,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||rr(e)||or(i)||" "===e.key&&v.current&&(v.current=!1,r(!n||!l,e.nativeEvent,"click"))}}),[o,i,s,a,f,r,n,d,l]);return u().useMemo(()=>c?{reference:m}:{},[c,m])}(e,{enabled:t&&"click"===n,...o}),p=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:c}=e,{enabled:s=!0,delay:l=0,handleClose:a=null,mouseOnly:f=!1,restMs:d=0,move:p=!0}=t,v=On(),m=Rn(),h=rt(a),y=rt(l),g=rt(n),b=rt(d),x=u().useRef(),w=u().useRef(-1),E=u().useRef(),R=u().useRef(-1),O=u().useRef(!0),C=u().useRef(!1),S=u().useRef(()=>{}),_=u().useRef(!1),j=it(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});u().useEffect(()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||(jn(w),jn(R),O.current=!0,_.current=!1)}},[s,i]),u().useEffect(()=>{if(!s)return;if(!h.current)return;if(!n)return;function e(e){j()&&r(!1,e,"hover")}const t=Xe(c.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[c.floating,n,r,s,h,j]);const L=u().useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=kn(y.current,"close",x.current);o&&!E.current?(jn(w),w.current=window.setTimeout(()=>r(!1,e,n),o)):t&&(jn(w),r(!1,e,n))},[y,r]),k=it(()=>{S.current(),E.current=void 0}),T=it(()=>{if(C.current){const e=Xe(c.floating).body;e.style.pointerEvents="",e.removeAttribute(Ln),C.current=!1}}),A=it(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));u().useEffect(()=>{if(s&&te(c.domReference)){const r=c.domReference,o=c.floating;return n&&r.addEventListener("mouseleave",i),p&&r.addEventListener("mousemove",e,{once:!0}),r.addEventListener("mouseenter",e),r.addEventListener("mouseleave",t),o&&(o.addEventListener("mouseleave",i),o.addEventListener("mouseenter",u),o.addEventListener("mouseleave",l)),()=>{n&&r.removeEventListener("mouseleave",i),p&&r.removeEventListener("mousemove",e),r.removeEventListener("mouseenter",e),r.removeEventListener("mouseleave",t),o&&(o.removeEventListener("mouseleave",i),o.removeEventListener("mouseenter",u),o.removeEventListener("mouseleave",l))}}function e(e){if(jn(w),O.current=!1,f&&!tt(x.current)||Tn(b.current)>0&&!kn(y.current,"open"))return;const t=kn(y.current,"open",x.current);t?w.current=window.setTimeout(()=>{g.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(A())return void T();S.current();const t=Xe(c.floating);if(jn(R),_.current=!1,h.current&&o.current.floatingContext){n||jn(w),E.current=h.current({...o.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){T(),k(),A()||L(e,!0,"safe-polygon")}});const r=E.current;return t.addEventListener("mousemove",r),void(S.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==x.current||!Ke(c.floating,e.relatedTarget))&&L(e)}function i(e){A()||o.current.floatingContext&&(null==h.current||h.current({...o.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){T(),k(),A()||L(e)}})(e))}function u(){jn(w)}function l(e){A()||L(e,!1)}},[c,s,e,f,p,L,k,T,r,n,g,v,y,h,o,A,b]),nt(()=>{var e;if(s&&n&&null!=(e=h.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&j()){C.current=!0;const e=c.floating;if(te(c.domReference)&&e){var t;const n=Xe(c.floating).body;n.setAttribute(Ln,"");const r=c.domReference,o=null==v||null==(t=v.nodesRef.current.find(e=>e.id===m))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[s,n,m,c,v,h,j]),nt(()=>{n||(x.current=void 0,_.current=!1,k(),T())},[n,k,T]),u().useEffect(()=>()=>{k(),jn(w),jn(R),T()},[s,c.domReference,k,T]);const P=u().useMemo(()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){O.current||g.current||r(!0,t,"hover")}f&&!tt(x.current)||n||0===Tn(b.current)||_.current&&e.movementX**2+e.movementY**2<2||(jn(R),"touch"===x.current?o():(_.current=!0,R.current=window.setTimeout(o,Tn(b.current))))}}},[f,r,n,g,b]);return u().useMemo(()=>s?{reference:P}:{},[s,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:hr(),...i}),v=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:c}=e,{enabled:s=!0,visibleOnly:l=!0}=t,a=u().useRef(!1),f=u().useRef(-1),d=u().useRef(!0);u().useEffect(()=>{if(!s)return;const e=Q(c.domReference);function t(){!n&&ne(c.domReference)&&c.domReference===Ue(Xe(c.domReference))&&(a.current=!0)}function r(){d.current=!0}function o(){d.current=!1}return e.addEventListener("blur",t),lr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),lr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[c.domReference,n,s]),u().useEffect(()=>{if(s)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(a.current=!0)}},[o,s]),u().useEffect(()=>()=>{jn(f)},[]);const p=u().useMemo(()=>({onMouseLeave(){a.current=!1},onFocus(e){if(a.current)return;const t=Ve(e.nativeEvent);if(l&&te(t))if(lr()&&!e.relatedTarget){if(!d.current&&!Ye(t))return}else if(!function(e){if(!e||ze())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;r(!0,e.nativeEvent,"focus")},onBlur(e){a.current=!1;const t=e.relatedTarget,n=e.nativeEvent,o=te(t)&&t.hasAttribute(_n("focus-guard"))&&"outside"===t.getAttribute("data-type");f.current=window.setTimeout(()=>{var e;const u=Ue(c.domReference?c.domReference.ownerDocument:document);(t||u!==c.domReference)&&(Ke(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,u)||Ke(c.domReference,u)||o||r(!1,n,"focus"))})}}),[i,c.domReference,r,l]);return u().useMemo(()=>s?{reference:p}:{},[s,p])}(e,{enabled:t&&"focus"===n,...c}),m=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:c}=e,{enabled:s=!0,axis:l="both",x:a=null,y:f=null}=t,d=u().useRef(!1),p=u().useRef(null),[v,m]=u().useState(),[h,y]=u().useState([]),g=it((e,t)=>{d.current||r.current.openEvent&&!ir(r.current.openEvent)||c.setPositionReference(function(e,t){let n=null,r=null,o=!1;return{contextElement:e||void 0,getBoundingClientRect(){var i;const u=(null==e?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c="x"===t.axis||"both"===t.axis,s="y"===t.axis||"both"===t.axis,l=["mouseenter","mousemove"].includes((null==(i=t.dataRef.current.openEvent)?void 0:i.type)||"")&&"touch"!==t.pointerType;let a=u.width,f=u.height,d=u.x,p=u.y;return null==n&&t.x&&c&&(n=u.x-t.x),null==r&&t.y&&s&&(r=u.y-t.y),d-=n||0,p-=r||0,a=0,f=0,!o||l?(a="y"===t.axis?u.width:0,f="x"===t.axis?u.height:0,d=c&&null!=t.x?t.x:d,p=s&&null!=t.y?t.y:p):o&&!l&&(f="x"===t.axis?u.height:f,a="y"===t.axis?u.width:a),o=!0,{width:a,height:f,x:d,y:p,top:p,right:d+a,bottom:p+f,left:d}}}}(i,{x:e,y:t,axis:l,dataRef:r,pointerType:v}))}),b=it(e=>{null==a&&null==f&&(n?p.current||y([]):g(e.clientX,e.clientY))}),x=tt(v)?o:n,w=u().useCallback(()=>{if(!x||!s||null!=a||null!=f)return;const e=Q(o);function t(n){const r=Ve(n);Ke(o,r)?(e.removeEventListener("mousemove",t),p.current=null):g(n.clientX,n.clientY)}if(!r.current.openEvent||ir(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),p.current=null};return p.current=n,n}c.setPositionReference(i)},[x,s,a,f,o,r,c,i,g]);u().useEffect(()=>w(),[w,h]),u().useEffect(()=>{s&&!o&&(d.current=!1)},[s,o]),u().useEffect(()=>{!s&&n&&(d.current=!0)},[s,n]),nt(()=>{!s||null==a&&null==f||(d.current=!1,g(a,f))},[s,a,f,g]);const E=u().useMemo(()=>{function e(e){let{pointerType:t}=e;m(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:b,onMouseEnter:b}},[b]);return u().useMemo(()=>s?{reference:E}:{},[s,E])}(e,{enabled:t&&"point"===n,...s}),h=function(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:c}=e,{enabled:s=!0,role:l="dialog"}=t,a=gn(),f=(null==(n=i.domReference)?void 0:n.id)||a,d=u().useMemo(()=>{var e;return(null==(e=Ze(i.floating))?void 0:e.id)||c},[i.floating,c]),p=null!=(r=fr.get(l))?r:l,v=null!=Rn(),m=u().useMemo(()=>"tooltip"===p||"label"===l?{["aria-"+("label"===l?"labelledby":"describedby")]:o?d:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":"alertdialog"===p?"dialog":p,"aria-controls":o?d:void 0,..."listbox"===p&&{role:"combobox"},..."menu"===p&&{id:f},..."menu"===p&&v&&{role:"menuitem"},..."select"===l&&{"aria-autocomplete":"none"},..."combobox"===l&&{"aria-autocomplete":"list"}},[p,d,v,o,f,l]),h=u().useMemo(()=>{const e={id:d,...p&&{role:p}};return"tooltip"===p||"label"===l?e:{...e,..."menu"===p&&{"aria-labelledby":f}}},[p,d,f,l]),y=u().useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:d+"-fui-option"}};switch(l){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[d,l]);return u().useMemo(()=>s?{reference:m,floating:h,item:y}:{},[s,m,h,y])}(e,l);return function(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),o=u().useCallback(t=>ar(t,e,"reference"),t),i=u().useCallback(t=>ar(t,e,"floating"),n),c=u().useCallback(t=>ar(t,e,"item"),r);return u().useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:c}),[o,i,c])}([f,d,p,v,m,h,...a])},wr=({enabled:t=!0,event:n,dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:c,clientPointsOptions:s,roleOptions:l,extraInteractions:f,open:d,floatingOptions:p,useOffset:v=!0,offsetOptions:m,useFlip:h=!0,flipOptions:y,useShift:g=!0,shiftOptions:b,useArrow:x=!1,arrowOptions:w,transitionOptions:E,useAutoPlacement:R=!1,autoPlacementOptions:O,useAutoUpdate:C=!1,autoUpdateOptions:S,useAutoSize:_=!1,sizeOptions:j,minAcceptableWidth:L=null,minAcceptableHeight:k=null,maxAcceptableWidth:T,maxAcceptableHeight:A,onOpen:P,onClose:M})=>{const{theme:D}=U(),$=function(){const e=gn(),t=On(),n=Rn();return nt(()=>{if(!e)return;const r={id:e,parentId:n};return null==t||t.addNode(r),()=>{null==t||t.removeNode(r)}},[t,e,n]),e}(),[I,N]=(0,u().useState)(!1),H=(0,u().useRef)(null),F=t&&(d??I);(0,u().useEffect)(()=>{F&&P?.()},[F]),((e,t)=>{const n=(0,u().useRef)(e);(0,u().useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(t,e=>{e||N(!1)});const W=[];v&&W.push((e=>{const t=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:c}=t,s=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=Rt(n),c=Ot(n),s="y"===_t(n),l=Ft.has(u)?-1:1,a=i&&s?-1:1,f=Et(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof v&&(p="end"===c?-1*v:v),s?{x:p*a,y:d*l}:{x:d*l,y:p*a}}(t,e);return u===(null==(n=c.offset)?void 0:n.placement)&&null!=(r=c.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:u}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(m??D.spacings.base));let z=null;if(R?W.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,r,o;const{rects:i,middlewareData:u,placement:c,platform:s,elements:l}=t,{crossAxis:a=!1,alignment:f,allowedPlacements:d=vt,autoAlignment:p=!0,...v}=Et(e,t),m=void 0!==f||d===vt?function(e,t,n){return(e?[...n.filter(t=>Ot(t)===e),...n.filter(t=>Ot(t)!==e)]:n.filter(e=>Rt(e)===e)).filter(n=>!e||Ot(n)===e||!!t&&kt(n)!==n)}(f||null,p,d):d,h=(null==(n=u.autoPlacement)?void 0:n.index)||0,y=m[h];if(null==y)return{};if(c!==y)return{reset:{placement:m[0]}};const g=await s.detectOverflow(t,v),b=Lt(y,i,await(null==s.isRTL?void 0:s.isRTL(l.floating))),x=[g[Rt(y)],g[b[0]],g[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:y,overflows:x}],E=m[h+1];if(E)return{data:{index:h+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=Ot(e.placement);return[e.placement,t&&a?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),O=(null==(o=R.filter(e=>e[2].slice(0,Ot(e[0])?2:3).every(e=>e<=0))[0])?void 0:o[0])||R[0][0];return O!==c?{data:{index:h+1,overflows:w},reset:{placement:O}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(O)):h&&(z=(e=>{const t=nn(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...y})),_){const e=(e=>{const t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:u=()=>{},...c}=Et(e,t),s=await o.detectOverflow(t,c),l=Rt(n),a=Ot(n),f="y"===_t(n),{width:d,height:p}=r.floating;let v,m;"top"===l||"bottom"===l?(v=l,m=a===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=l,v="end"===a?"top":"bottom");const h=p-s.top-s.bottom,y=d-s.left-s.right,g=mt(p-s[v],h),b=mt(d-s[m],y),x=t.middlewareData.shift,w=!x;let E=g,R=b;null!=x&&x.enabled.x&&(R=y),null!=x&&x.enabled.y&&(E=h),w&&!a&&(f?R=d-2*ht(s.left,s.right):E=p-2*ht(s.top,s.bottom)),await u({...t,availableWidth:R,availableHeight:E});const O=await o.getDimensions(i.floating);return d!==O.width||p!==O.height?{reset:{rects:!0}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({...j,apply({elements:e,rects:t,availableWidth:n,availableHeight:r}){const o=a(L)?L(t.reference):L??t.reference.width,i=a(T)?T(t.reference):Math.min(n,T??1/0),u=a(k)?k(t.reference):k??0,c=a(A)?A(t.reference):Math.min(r,A??1/0);Object.assign(e.floating.style,{minWidth:`${Math.min(o,i)}px`,maxWidth:`${i}px`,minHeight:`${Math.min(u,c)}px`,maxHeight:`${c}px`})}});z?"initialPlacement"===y?.fallbackStrategy?W.push(e,z):W.push(z,e):W.push(e)}else z&&W.push(z);g&&W.push((e=>{const t=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:u=!0,crossAxis:c=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Et(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=_t(o),p=Ct(d);let v=a[p],m=a[d];const h=(e,t)=>wt(t+f["y"===e?"top":"left"],t,t-f["y"===e?"bottom":"right"]);u&&(v=h(p,v)),c&&(m=h(d,m));const y=s.fn({...t,[p]:v,[d]:m});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[p]:u,[d]:c}}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({padding:D.spacings.base,...b})),x&&W.push(((e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?rn({element:n.current,padding:r}).fn(t):{}:n?rn({element:n,padding:r}).fn(t):{};var o}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}})({element:H,padding:D.spacings.base,...w}));const B=function(t){var n,r;let{elements:o,...i}=void 0===t?{}:t;const{nodeId:c}=i,s=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=gn(),i=u().useRef({}),[c]=u().useState(()=>xn()),s=null!=Rn(),[l,a]=u().useState(r.reference),f=it((e,t,r)=>{i.current.openEvent=e?t:void 0,c.emit("openchange",{open:e,event:t,reason:r,nested:s}),null==n||n(e,t,r)}),d=u().useMemo(()=>({setPositionReference:a}),[]),p=u().useMemo(()=>({reference:l||r.reference||null,floating:r.floating||null,domReference:r.reference}),[l,r.reference,r.floating]);return u().useMemo(()=>({dataRef:i,open:t,onOpenChange:f,elements:p,events:c,floatingId:o,refs:d}),[t,f,p,c,o,d])}({...i,elements:{reference:null!=(n=null==o?void 0:o.reference)?n:null,floating:null!=(r=null==o?void 0:o.floating)?r:null}}),l=i.rootContext||s,a=l.elements,[f,d]=u().useState(null),[p,v]=u().useState(null),m=(null==a?void 0:a.domReference)||f,h=u().useRef(null),y=On();nt(()=>{m&&(h.current=m)},[m]);const g=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:c,floating:s}={},transform:l=!0,whileElementsMounted:a,open:f}=t,[d,p]=u().useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[v,m]=u().useState(o);cn(v,o)||m(o);const[h,y]=u().useState(null),[g,b]=u().useState(null),x=u().useCallback(e=>{e!==O.current&&(O.current=e,y(e))},[]),w=u().useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),E=c||h,R=s||g,O=u().useRef(null),C=u().useRef(null),S=u().useRef(d),_=null!=a,j=an(a),L=an(i),k=an(f),T=u().useCallback(()=>{if(!O.current||!C.current)return;const t={placement:n,strategy:r,middleware:v};L.current&&(t.platform=L.current),on(O.current,C.current,t).then(t=>{const n={...t,isPositioned:!1!==k.current};A.current&&!cn(S.current,n)&&(S.current=n,e().flushSync(()=>{p(n)}))})},[v,n,r,L,k]);un(()=>{!1===f&&S.current.isPositioned&&(S.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[f]);const A=u().useRef(!1);un(()=>(A.current=!0,()=>{A.current=!1}),[]),un(()=>{if(E&&(O.current=E),R&&(C.current=R),E&&R){if(j.current)return j.current(E,R,T);T()}},[E,R,T,j,_]);const P=u().useMemo(()=>({reference:O,floating:C,setReference:x,setFloating:w}),[x,w]),M=u().useMemo(()=>({reference:E,floating:R}),[E,R]),D=u().useMemo(()=>{const e={position:r,left:0,top:0};if(!M.floating)return e;const t=ln(M.floating,d.x),n=ln(M.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...sn(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,M.floating,d.x,d.y]);return u().useMemo(()=>({...d,update:T,refs:P,elements:M,floatingStyles:D}),[d,T,P,M,D])}({...i,elements:{...a,...p&&{reference:p}}}),b=u().useCallback(e=>{const t=te(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;v(t),g.refs.setReference(t)},[g.refs]),x=u().useCallback(e=>{(te(e)||null===e)&&(h.current=e,d(e)),(te(g.refs.reference.current)||null===g.refs.reference.current||null!==e&&!te(e))&&g.refs.setReference(e)},[g.refs]),w=u().useMemo(()=>({...g.refs,setReference:x,setPositionReference:b,domReference:h}),[g.refs,x,b]),E=u().useMemo(()=>({...g.elements,domReference:m}),[g.elements,m]),R=u().useMemo(()=>({...g,...l,refs:w,elements:E,nodeId:c}),[g,w,E,c,l]);return nt(()=>{l.dataRef.current.floatingContext=R;const e=null==y?void 0:y.nodesRef.current.find(e=>e.id===c);e&&(e.context=R)}),u().useMemo(()=>({...g,context:R,refs:w,elements:E}),[g,w,E,R])}({nodeId:$,open:F,middleware:W,onOpenChange:(e,t,n)=>{N(e),e||M?.(n,t)},...C&&{whileElementsMounted:(e,t,n)=>function(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:c="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,l=zt(e),a=o||i?[...l?ge(l):[],...t?ge(t):[]]:[];a.forEach(e=>{o&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});const f=l&&c?function(e,t,n){let r,o=null;const i=J(e);function u(){var e;clearTimeout(r),null==(e=o)||e.disconnect(),o=null}function c(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),u();const l=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=l;if(n||t(),!d||!p)return;const v={rootMargin:-gt(f)+"px "+-gt(i.clientWidth-(a+d))+"px "+-gt(i.clientHeight-(f+p))+"px "+-gt(a)+"px",threshold:ht(0,mt(1,s))||1};let m=!0;function h(t){const n=t[0].intersectionRatio;if(!tn(l,e.getBoundingClientRect()))return c();if(n!==s){if(!m)return c();n?c(!1,n):r=setTimeout(()=>{c(!1,1e-7)},1e3)}m=!1}try{o=new IntersectionObserver(h,{...v,root:i.ownerDocument})}catch(e){o=new IntersectionObserver(h,v)}o.observe(e)}const s=Q(e),l=()=>c(n);return s.addEventListener("resize",l),c(!0),()=>{s.removeEventListener("resize",l),u()}}(l,n,i):null;let d,p=-1,v=null;u&&(v=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&v&&t&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=v)||e.observe(t)})),n()}),l&&!s&&v.observe(l),t&&v.observe(t));let m=s?Vt(e):null;return s&&function t(){const r=Vt(e);m&&!tn(m,r)&&n(),m=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;a.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=v)||e.disconnect(),v=null,s&&cancelAnimationFrame(d)}}(e,t,n,S)},...p}),K=xr(B.context,{enabled:t,event:n,dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:c,clientPointsOptions:s,roleOptions:l,extraInteractions:f}),V=function(t,n){void 0===n&&(n={});const{initial:r={opacity:0},open:o,close:i,common:c,duration:s=250}=n,l=t.placement,a=l.split("-")[0],f=u().useMemo(()=>({side:a,placement:l}),[a,l]),d="number"==typeof s,p=(d?s:s.open)||0,v=(d?s:s.close)||0,[m,h]=u().useState(()=>({...pr(c,f),...pr(r,f)})),{isMounted:y,status:g}=function(t,n){void 0===n&&(n={});const{open:r,elements:{floating:o}}=t,{duration:i=250}=n,c=("number"==typeof i?i:i.close)||0,[s,l]=u().useState("unmounted"),a=function(e,t){const[n,r]=u().useState(e);return e&&!n&&r(!0),u().useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(r,c);return a||"close"!==s||l("unmounted"),nt(()=>{if(o){if(r){l("initial");const t=requestAnimationFrame(()=>{e().flushSync(()=>{l("open")})});return()=>{cancelAnimationFrame(t)}}l("close")}},[r,o]),{isMounted:a,status:s}}(t,{duration:s}),b=rt(r),x=rt(o),w=rt(i),E=rt(c);return nt(()=>{const e=pr(b.current,f),t=pr(w.current,f),n=pr(E.current,f),r=pr(x.current,f)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===g&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===g&&h({transitionProperty:Object.keys(r).map(dr).join(","),transitionDuration:p+"ms",...n,...r}),"close"===g){const r=t||e;h({transitionProperty:Object.keys(r).map(dr).join(","),transitionDuration:v+"ms",...n,...r})}},[v,w,b,x,E,p,g,f]),{isMounted:y,styles:m}}(B.context,{duration:250,...E});return{nodeId:$,isOpen:F,floating:B,arrowRef:H,interactions:K,transition:V}},Er=()=>{const e=(0,u().useContext)(Y);return l(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},Rr=({children:e,referenceUserProps:t,referenceProps:n,content:r,contentProps:i,focusManagerProps:c,arrowProps:s,portalProps:l,adjustStyles:a,context:d,...p})=>{const{useArrow:v,onClose:m}=p,h=N(m),{nodeId:y,floating:g,isOpen:b,arrowRef:x,interactions:w,transition:E}=wr(p),R=(0,u().useCallback)(()=>{h.current?.("escape-key")},[]),O=(0,u().useMemo)(()=>({context:d,floatingContext:g.context}),[d,g.context]);return(0,o().jsx)(gr,{ref:g.refs.setReference,...w.getReferenceProps(t),...n,"data-testid":"honey-popup",children:(0,o().jsxs)(Y,{value:O,children:[f(e,O),(0,o().jsx)(Cn,{id:y,children:E.isMounted&&(0,o().jsx)(br,{...l,children:(0,o().jsx)(nr,{context:g.context,disabled:!b,...c,children:(0,o().jsxs)(X,{ref:g.refs.setFloating,active:b,style:a?.({...g.floatingStyles,...E.styles},{middlewareData:g.middlewareData})??{...g.floatingStyles,...E.styles},onDeactivate:R,...w.getFloatingProps(),...i,"data-testid":"honey-popup-floating-content",children:[v&&(0,o().jsx)(bn,{ref:x,context:g.context,fill:"white",...s}),f(r,O)]})})})})]})})},Or=({useTree:e=!1,...t})=>(0,o().jsx)(yr,{enabled:e,children:(0,o().jsx)(Rr,{...t})}),Cr=(0,c.styled)(E,{row:!0,centerY:!0})`
|
|
37
37
|
cursor: pointer;
|
|
38
|
-
`,
|
|
39
|
-
opacity: ${
|
|
40
|
-
visibility: ${
|
|
38
|
+
`,Sr=({option:e,renderOption:t,...n})=>{const{context:r,floatingContext:i}=Er(),u=a(e.disabled)?e.disabled({context:r,floatingContext:i}):!0===e.disabled;return(0,o().jsx)(Cr,{onClick:()=>{u||e.onClick?.({context:r,floatingContext:i})},role:"menuitem","aria-disabled":u,"data-testid":"honey-context-menu-option",...n,children:t?.({option:e,context:r,isDisabled:u})??e.label})},_r=({options:e,renderOption:t,optionProps:n,popupProps:r,...i})=>{const{floatingOptions:c}=r??{},{context:s,floatingContext:l}=Er(),f=(0,u().useMemo)(()=>e?.filter(e=>a(e.visible)?e.visible({context:s,floatingContext:l}):!1!==e.visible),[e]);return(0,o().jsx)(P,{items:f,itemKey:"id","data-testid":"honey-context-menu-options",...i,children:e=>e.options?.length?(0,o().jsx)(Or,{context:s,content:(0,o().jsx)(_r,{options:e.options,renderOption:t,optionProps:n,popupProps:r,...i}),event:"hover",referenceProps:{$width:"100%"},floatingOptions:{placement:"right-start",...c},useArrow:!0,"data-testid":"honey-sub-context-menu",...r,children:(0,o().jsx)(Sr,{option:e,renderOption:t,...n})}):(0,o().jsx)(Sr,{option:e,renderOption:t,...n})})},jr=({options:e,renderOption:t,optionProps:n,referenceUserProps:r,roleOptions:i,optionsProps:u,context:c,...s})=>(0,o().jsx)(Or,{context:c,referenceUserProps:{onClick:e=>e.stopPropagation(),...r},content:(0,o().jsx)(_r,{options:e,renderOption:t,optionProps:n,popupProps:s,...u}),roleOptions:{role:"menu",...i},useArrow:!0,"data-testid":"honey-context-menu",...s}),Lr=(0,u().createContext)(void 0),kr=()=>{const e=(0,u().useContext)(Lr);return l(e,"[@react-hive/honey-layout]: The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component."),e},Tr=({children:e})=>{const t=(0,u().useContext)(Lr),[n,r]=(0,u().useState)([]),i=(0,u().useMemo)(()=>({layers:n,registerLayer:e=>{const t=d();return r(n=>[...n,{id:t,payload:e}]),t},unregisterLayer:e=>{r(t=>t.filter(t=>t.id!==e))},getLayerIndex:e=>n.findIndex(t=>t.id===e)}),[n]);return t?e:(0,o().jsx)(Lr,{value:i,children:e})},Ar=({children:e,theme:t,mediaQueryOptions:n,...r})=>{const i=z(t,n),{getOverlaysSnapshot:s,registerOverlay:l,subscribeOverlays:a,unregisterOverlay:f}=(()=>{const e=(0,u().useRef)([]),t=(0,u().useRef)(new Set),n=(0,u().useCallback)(()=>e.current,[]),r=(0,u().useCallback)(e=>(t.current.add(e),()=>{t.current.delete(e)}),[]),o=(0,u().useCallback)(()=>{t.current.forEach(e=>e())},[]);(0,u().useEffect)(()=>{const t=t=>{e.current.length&&e.current[e.current.length-1].notifyListeners("keyup",t.code,t)};return document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}},[]);const i=(0,u().useCallback)(t=>{const n=t.id??d(),r=[["keyup",t.onKeyUp]],i={current:null},u={containerRef:i,id:n,setContainerRef:e=>{i.current=e},addListener:(e,t)=>{r.push([e,t])},removeListener:(e,t)=>{const n=r.findIndex(([n,r])=>n===e&&r===t);-1!==n&&r.splice(n,1)},notifyListeners:(e,n,o)=>{const i=t.listenKeys??[];i.length&&!i.includes(n)||(o.preventDefault(),r.forEach(([t,r])=>{t===e&&r(n,u,o)}))}};return e.current=[...e.current,u],o(),u},[]),c=(0,u().useCallback)(t=>{const n=e.current.filter(e=>e.id!==t);n.length!==e.current.length&&(e.current=n,o())},[]);return(0,u().useMemo)(()=>({getOverlaysSnapshot:n,registerOverlay:i,subscribeOverlays:r,unregisterOverlay:c}),[])})(),p=(0,u().useMemo)(()=>({theme:t,screenState:i,getOverlaysSnapshot:s,registerOverlay:l,subscribeOverlays:a,unregisterOverlay:f}),[t,i]);return(0,o().jsx)(c.HoneyStyleProvider,{theme:t,...r,children:(0,o().jsx)(B,{value:p,children:e})})};var Pr=n(117),Mr=n.n(Pr);const Dr=({theme:e,...t})=>{const n=(0,u().useContext)(B),r=(0,u().useMemo)(()=>Mr()(n?.theme,e),[n?.theme,e]);return(0,o().jsx)(c.HoneyStyleProvider,{theme:r,...t})},$r=({durationMs:e,timingFunction:t="ease-in-out",extraProperties:n=[],activeClassName:r})=>({active:o=!1})=>c.css`
|
|
39
|
+
opacity: ${o?1:0};
|
|
40
|
+
visibility: ${o?"visible":"hidden"};
|
|
41
41
|
|
|
42
|
-
transition-property: ${["opacity","visibility",...
|
|
43
|
-
transition-duration: ${
|
|
44
|
-
transition-timing-function: ${Array.isArray(
|
|
42
|
+
transition-property: ${["opacity","visibility",...n].join(", ")};
|
|
43
|
+
transition-duration: ${e}ms;
|
|
44
|
+
transition-timing-function: ${Array.isArray(t)?t.join(", "):t};
|
|
45
45
|
|
|
46
|
-
${
|
|
47
|
-
&.${
|
|
46
|
+
${r&&c.css`
|
|
47
|
+
&.${r} {
|
|
48
48
|
opacity: 1;
|
|
49
49
|
visibility: visible;
|
|
50
50
|
}
|
|
51
51
|
`}
|
|
52
|
-
`,
|
|
52
|
+
`,Ir=c.resolveSpacing})(),module.exports=r})();
|
|
53
53
|
//# sourceMappingURL=index.cjs.map
|