@react-hive/honey-layout 17.12.0 → 18.0.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/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*! For license information please see index.mjs.LICENSE.txt */
2
- import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,css as r,isCssColorProperty as o,isCssSpacingProperty as i,isThemeColorValue as u,resolveColor as c,resolveSpacing as s,styled as l}from"@react-hive/honey-style";var a={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,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,v="object"==typeof self&&self&&self.Object===Object&&self,h=m||v||Function("return this")(),g=t&&!t.nodeType&&t,y=g&&e&&!e.nodeType&&e,b=y&&y.exports===g,x=b&&m.process,w=function(){try{return y&&y.require&&y.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,A=(f=/[^.]+$/.exec(S&&S.keys&&S.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",k=C.toString,L=_.call(Object),T=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,F=R.splice,W=M?M.toStringTag:void 0,H=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&&H?H(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():F.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]":W&&W in Object(e)?function(e){var t=j.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(e){}var o=k.call(e);return r&&(t?e[W]=n:delete e[W]),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,m,v,h=i?i(s,l,n+"",e,t,u):void 0,g=void 0===h;if(g){var y=me(l),b=!y&&he(l),x=!y&&!b&&we(l);h=l,y||b||x?me(s)?h=s:xe(v=s)&&ve(v)?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?(g=!1,h=function(e){return e.slice()}(l)):x?(g=!1,m=new(p=(f=l).buffer).constructor(p.byteLength),new D(m).set(new D(p)),d=m,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)==L}(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)&&!ge(s)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):g=!1}g&&(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=H?function(e,t){return H(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!!A&&A in e}(e))&&(ge(e)?T: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")},me=Array.isArray;function ve(e){return null!=e&&ye(e.length)&&!ge(e)}var he=z||function(){return!1};function ge(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(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)&&ye(e.length)&&!!a[ne(e)]};function Ee(e){return ve(e)?function(e,t){var n=me(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?ve(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,m=Math.min,v=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(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,y=!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=v();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?m(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=v(),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=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),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(v())},R}(e,t,{leading:o,maxWait:t,trailing:i})}},355(e,t,n){var r=n(649);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},c=Symbol.for("react.portal"),s=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:c,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=s.T,n=u.p;try{if(s.T=null,u.p=2,e)return e()}finally{s.T=t,u.p=n,u.d.f()}}},163(e,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)}}(),e.exports=n(355)},790(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},684(e,t,n){e.exports=n(790)},649(t){t.exports=e}};const f={};function d(e){const t=f[e];if(void 0!==t)return t.exports;const n=f[e]={id:e,loaded:!1,exports:{}};return a[e](n,n.exports,d),n.loaded=!0,n.exports}d.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var r=t[n++],o=t[n++];d.o(e,r)?0===o&&n++:0===o?Object.defineProperty(e,r,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,r,{enumerable:!0,get:o})}else for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);const p=!1;function m(e,t){if(!e)throw new Error(t)}const v=e=>"function"==typeof e,h=(e,...t)=>"function"==typeof e?e(...t):e,g=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,y=(...e)=>t=>{e.forEach(e=>{v(e)?e(t):"object"==typeof e&&(e.current=t)})},b=e=>"$"===e[0],x=e=>({theme:t,...n})=>r`
2
+ import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,css as r,isCssColorProperty as o,isCssSpacingProperty as i,isThemeColorValue as u,resolveColor as c,resolveSpacing as s,styled as l}from"@react-hive/honey-style";var a={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,m="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,v="object"==typeof self&&self&&self.Object===Object&&self,h=m||v||Function("return this")(),g=t&&!t.nodeType&&t,y=g&&e&&!e.nodeType&&e,b=y&&y.exports===g,x=b&&m.process,w=function(){try{return y&&y.require&&y.require("util").types||x&&x.binding&&x.binding("util")}catch(e){}}(),E=w&&w.isTypedArray,R=Array.prototype,O=Function.prototype,C=Object.prototype,_=h["__core-js_shared__"],j=O.toString,S=C.hasOwnProperty,A=(f=/[^.]+$/.exec(_&&_.keys&&_.keys.IE_PROTO||""))?"Symbol(src)_1."+f:"",k=C.toString,L=j.call(Object),T=RegExp("^"+j.call(S).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,F=R.splice,W=M?M.toStringTag:void 0,H=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];S.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&&H?H(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 S.call(t,e)?t[e]:void 0},X.prototype.has=function(e){var t=this.__data__;return V?void 0!==t[e]:S.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():F.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]":W&&W in Object(e)?function(e){var t=S.call(e,W),n=e[W];try{e[W]=void 0;var r=!0}catch(e){}var o=k.call(e);return r&&(t?e[W]=n:delete e[W]),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,m,v,h=i?i(s,l,n+"",e,t,u):void 0,g=void 0===h;if(g){var y=me(l),b=!y&&he(l),x=!y&&!b&&we(l);h=l,y||b||x?me(s)?h=s:xe(v=s)&&ve(v)?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?(g=!1,h=function(e){return e.slice()}(l)):x?(g=!1,m=new(p=(f=l).buffer).constructor(p.byteLength),new D(m).set(new D(p)),d=m,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=S.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&j.call(n)==L}(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)&&!ge(s)||(h=function(e){return"function"!=typeof e.constructor||le(e)?{}:q($(e))}(l))):g=!1}g&&(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=H?function(e,t){return H(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!!A&&A in e}(e))&&(ge(e)?T:s).test(function(e){if(null!=e){try{return j.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)&&S.call(e,"callee")&&!N.call(e,"callee")},me=Array.isArray;function ve(e){return null!=e&&ye(e.length)&&!ge(e)}var he=z||function(){return!1};function ge(e){if(!be(e))return!1;var t=ne(e);return t==u||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}function ye(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)&&ye(e.length)&&!!a[ne(e)]};function Ee(e){return ve(e)?function(e,t){var n=me(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&&!S.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&&S.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?ve(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,m=Math.min,v=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(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,y=!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=v();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?m(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=v(),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=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),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(v())},R}(e,t,{leading:o,maxWait:t,trailing:i})}},355(e,t,n){var r=n(649);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},c=Symbol.for("react.portal"),s=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:c,key:null==r?null:""+r,children:e,containerInfo:t,implementation:n}}(e,t,null,n)},t.flushSync=function(e){var t=s.T,n=u.p;try{if(s.T=null,u.p=2,e)return e()}finally{s.T=t,u.p=n,u.d.f()}}},163(e,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)}}(),e.exports=n(355)},790(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},684(e,t,n){e.exports=n(790)},649(t){t.exports=e}};const f={};function d(e){const t=f[e];if(void 0!==t)return t.exports;const n=f[e]={id:e,loaded:!1,exports:{}};return a[e](n,n.exports,d),n.loaded=!0,n.exports}d.n=e=>{const t=e&&e.__esModule?()=>e.default:()=>e;return d.d(t,{a:t}),t},d.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var r=t[n++],o=t[n++];d.o(e,r)?0===o&&n++:0===o?Object.defineProperty(e,r,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,r,{enumerable:!0,get:o})}else for(var r in t)d.o(t,r)&&!d.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},d.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),d.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),d.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},d.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);const p=!1;function m(e,t){if(!e)throw new Error(t)}const v=e=>"function"==typeof e,h=(e,...t)=>"function"==typeof e?e(...t):e,g=()=>`${Math.floor(1e3*performance.now()).toString(36)}${Math.random().toString(36).slice(2,10)}`,y=(...e)=>t=>{e.forEach(e=>{v(e)?e(t):"object"==typeof e&&(e.current=t)})},b=e=>"$"===e[0],x=e=>({theme:t,...n})=>r`
3
3
  ${((e,t)=>Object.entries(e).filter(([e,n])=>"xs"===t&&b(e)||n&&"object"==typeof n&&t in n))(n,e).map(([t,n])=>{const l=t.slice(1);return r`
4
4
  ${(e=>{const t=e.charAt(0),n=e.slice(1);return t.toLowerCase()+n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)})(l)}: ${((e,t,n)=>{const r="object"!=typeof t||Array.isArray(t)?t:t[n];if(void 0!==r){if(i(e)){if("number"==typeof r||Array.isArray(r))return s(r,"px")}else if(o(e)&&"string"==typeof r&&u(r))return c(r);return r}})(l,n,e)};
5
5
  `})}
@@ -13,7 +13,7 @@ import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,cs
13
13
 
14
14
  ${t.map(R)};
15
15
  `}
16
- `,C=new Set,S=(e,t)=>{C.has(e)||(C.add(e),console.warn(t))},_=l(O,({inline:e=!1,row:t=!1,center:n=!1,centerX:r=!1,centerY:o=!1,$display:i,$flexDirection:u,$alignItems:c,$justifyContent:s,...l})=>{const a=u??(t?"row":"column"),f="row"===a||"row-reverse"===a,d="column"===a||"column-reverse"===a;return{$display:e?"inline-flex":i??"flex",$flexDirection:a,$alignItems:c??(n||(f?o:!!d&&r)?"center":void 0),$justifyContent:s??(n||(f?r:!!d&&o)?"center":void 0),"data-testid":l["data-testid"]??"honey-flex"}})``;var j=d(684),A=d(649),k={};d.r(k),d.d(k,{Fragment:()=>A.Fragment,createContext:()=>A.createContext,forwardRef:()=>A.forwardRef,useCallback:()=>A.useCallback,useContext:()=>A.useContext,useEffect:()=>A.useEffect,useLayoutEffect:()=>A.useLayoutEffect,useMemo:()=>A.useMemo,useRef:()=>A.useRef,useState:()=>A.useState});const L=(0,A.createContext)(void 0),T=l(_)`
16
+ `,C=new Set,_=(e,t)=>{C.has(e)||(C.add(e),console.warn(t))},j=l(O,({inline:e=!1,row:t=!1,center:n=!1,centerX:r=!1,centerY:o=!1,$display:i,$flexDirection:u,$alignItems:c,$justifyContent:s,...l})=>{const a=u??(t?"row":"column"),f="row"===a||"row-reverse"===a,d="column"===a||"column-reverse"===a;return{$display:e?"inline-flex":i??"flex",$flexDirection:a,$alignItems:c??(n||(f?o:!!d&&r)?"center":void 0),$justifyContent:s??(n||(f?r:!!d&&o)?"center":void 0),"data-testid":l["data-testid"]??"honey-flex"}})``;var S=d(684),A=d(649),k={};d.r(k),d.d(k,{Fragment:()=>A.Fragment,createContext:()=>A.createContext,forwardRef:()=>A.forwardRef,useCallback:()=>A.useCallback,useContext:()=>A.useContext,useEffect:()=>A.useEffect,useLayoutEffect:()=>A.useLayoutEffect,useMemo:()=>A.useMemo,useRef:()=>A.useRef,useState:()=>A.useState});const L=(0,A.createContext)(void 0),T=l(j)`
17
17
  ${({columns:e,takeColumns:t=1,spacing:n=0,applyMaxWidth:o,applyBasis:i=!0,theme:u})=>{let c=null;return i&&(c=`calc(${t*(100/e)}% - ${s(n,null)({theme:u})/e*(e-t)}px)`),r`
18
18
  flex-basis: ${c};
19
19
 
@@ -33,9 +33,9 @@ import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,cs
33
33
  min-height: ${t};
34
34
  }
35
35
  `}
36
- `,M=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:o=!0,applyColumnMaxWidth:i=!1,...u})=>{const c=(0,A.useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}),[n,r,o,i]);return(0,j.jsx)(L,{value:c,children:(0,j.jsx)(P,{ref:e,spacing:r,"data-testid":"honey-grid",...u,children:t})})},D=()=>{const e=(0,A.useContext)(L);if(!e)throw new Error("The `useHoneyGridContext()` hook can only be used inside <HoneyGrid/> component!");return e},$=({children:e,...t})=>{const{columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}=D();return(0,j.jsx)(T,{columns:n,spacing:r,applyMaxWidth:i,$flexGrow:o?1:0,"data-testid":"honey-grid-column",...t,children:e})},I=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,N=({children:e,loading:t=!1,loadingOverContent:n=!1,error:r=!1,empty:o=!1,loadingContent:i=null,errorContent:u=null,emptyContent:c=null})=>r?u:!n&&t?i:(0,j.jsxs)(j.Fragment,{children:[n&&t&&i,o?c:e]}),F=l(_,({$overflow:e="hidden auto"})=>({$overflow:e}))``,W=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s=!1,emptyContent:l,...a})=>(0,j.jsx)(F,{role:"list","aria-busy":r,"data-testid":"honey-list",...a,children:(0,j.jsx)(N,{loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s||0===t?.length,emptyContent:l,children:t?.map((t,r,o)=>(0,j.jsx)(A.Fragment,{children:e(t,r,o)},String(I(t,n,r))))})}),H=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,u]=(0,A.useState)(r||t),c=(0,A.useRef)(void 0);return(0,A.useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(c.current),u(!0),()=>{o||(c.current=setTimeout(()=>u(!1),n))}},[t,r,n]),i?e:null};var z={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,m=Math.min,v=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(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,y=!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=v();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?m(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=v(),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=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),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(v())},R}(e,t,{leading:o,maxWait:t,trailing:i})}}},B={};function U(e){var t=B[e];if(void 0!==t)return t.exports;var n=B[e]={exports:{}};return z[e](n,n.exports,U),n.exports}U.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return U.d(t,{a:t}),t},U.d=(e,t)=>{for(var n in t)U.o(t,n)&&!U.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},U.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),U.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const K=e=>{const t=(0,A.useRef)(e);return t.current=e,t};var V=U(551);U.n(V);var q=d(551),X=d.n(q);const Y=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,A.useState)(()=>({...E(e.breakpoints),...n}));return(0,A.useEffect)(()=>{const r=X()(()=>{o({...E(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},G=(0,A.createContext)(void 0),Z=()=>{const e=(0,A.useContext)(G);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},Q=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=Z(),o=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},J=(e,{enabled:t=!0,onKeyUp:n}={})=>{const{overlays:r}=Z(),o=(0,A.useMemo)(()=>t?r.find(t=>t.id===e)??null:null,[t,r,e]);return(0,A.useEffect)(()=>{if(o&&n)return o.addListener("keyup",n),()=>{o.removeListener("keyup",n)}},[o,n]),o},ee=({ref:e,children:t,active:n,overlayId:r,onDeactivate:o,onKeyUp:i,...u})=>{const c=K(i),s=K(o),l=(0,A.useCallback)((e,...t)=>{c.current?c.current(e,...t):"Escape"===e&&s.current()},[]),a=Q(n,{id:r,onKeyUp:l}),f=y(a?.setContainerRef,e);return(0,j.jsx)(_,{ref:f,inert:!n,...u,children:h(t,{overlay:a,isActive:n,deactivateOverlay:s.current})})},te=(0,A.createContext)(void 0);function ne(){return"undefined"!=typeof window}function re(e){return ue(e)?(e.nodeName||"").toLowerCase():"#document"}function oe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ie(e){var t;return null==(t=(ue(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ue(e){return!!ne()&&(e instanceof Node||e instanceof oe(e).Node)}function ce(e){return!!ne()&&(e instanceof Element||e instanceof oe(e).Element)}function se(e){return!!ne()&&(e instanceof HTMLElement||e instanceof oe(e).HTMLElement)}function le(e){return!(!ne()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof oe(e).ShadowRoot)}function ae(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function fe(e){return/^(table|td|th)$/.test(re(e))}function de(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const pe=/transform|translate|scale|rotate|perspective|filter/,me=/paint|layout|strict|content/,ve=e=>!!e&&"none"!==e;let he;function ge(e){const t=ce(e)?xe(e):e;return ve(t.transform)||ve(t.translate)||ve(t.scale)||ve(t.rotate)||ve(t.perspective)||!ye()&&(ve(t.backdropFilter)||ve(t.filter))||pe.test(t.willChange||"")||me.test(t.contain||"")}function ye(){return null==he&&(he="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),he}function be(e){return/^(html|body|#document)$/.test(re(e))}function xe(e){return oe(e).getComputedStyle(e)}function we(e){return ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if("html"===re(e))return e;const t=e.assignedSlot||e.parentNode||le(e)&&e.host||ie(e);return le(t)?t.host:t}function Re(e){const t=Ee(e);return be(t)?e.ownerDocument?e.ownerDocument.body:e.body:se(t)&&ae(t)?t:Re(t)}function Oe(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Re(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=oe(o);if(i){const e=Ce(u);return t.concat(u,u.visualViewport||[],ae(o)?o:[],e&&n?Oe(e):[])}return t.concat(o,Oe(o,[],n))}function Ce(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Se=["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(","),_e="undefined"==typeof Element,je=_e?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ae=!_e&&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},ke=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]"):ke(e.parentNode))},Le=function(e,t,n){if(ke(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Se));return t&&je.call(e,Se)&&r.unshift(e),r.filter(n)},Te=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!ke(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,s=Te(c,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{je.call(i,Se)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!ke(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=Te(!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},Pe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Me=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))&&!Pe(e)?0:e.tabIndex},De=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},$e=function(e){return"INPUT"===e.tagName},Ie=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ne=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=je.call(e,"details>summary:first-of-type")?e.parentElement:e;if(je.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ie(e)}else{if("function"==typeof r){for(var u=e;e;){var c=e.parentElement,s=Ae(e);if(c&&!c.shadowRoot&&!0===r(c))return Ie(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&&Ae(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=Ae(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!!je.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Fe=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||Ae(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)||Me(t)<0||!Ne(e,t))},We=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},He=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=Me(e);return n<0&&t&&!Pe(e)?0:n}(i,o),c=o?He(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(De).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ze=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Te([e],t.includeContainer,{filter:Fe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:We}):Le(e,t.includeContainer,Fe.bind(null,t)),He(n)},Be=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==je.call(e,Se)&&Fe(t,e)};function Ue(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Ke(){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 Ve(){return/apple/i.test(navigator.vendor)}function qe(){const e=/android/i;return e.test(Ue())||e.test(Ke())}function Xe(){return Ke().includes("jsdom/")}const Ye="data-floating-ui-focusable";function Ge(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&&le(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Je(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 et(e){return(null==e?void 0:e.ownerDocument)||document}function tt(e){return se(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function nt(e){return!!e&&"combobox"===e.getAttribute("role")&&tt(e)}function rt(e){return e?e.hasAttribute(Ye)?e:e.querySelector("["+Ye+"]")||e:null}function ot(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,...ot(e,t.id,n)])}function it(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 ut(e){e.preventDefault(),e.stopPropagation()}function ct(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var st="undefined"!=typeof document?A.useLayoutEffect:function(){};function lt(e){const t=A.useRef(e);return st(()=>{t.current=e}),t}const at={...k}.useInsertionEffect||(e=>e());function ft(e){const t=A.useRef(()=>{});return at(()=>{t.current=e}),A.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 dt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pt(e,t){const n=ze(e,dt()),r=n.length;if(0===r)return;const o=Ge(et(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function mt(e){return pt(et(e).body,1)||e}function vt(e){return pt(et(e).body,-1)||e}function ht(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ze(n,r)}function gt(e){ze(e,dt()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function yt(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 bt=d(163);const xt=["start","end"],wt=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+xt[0],t+"-"+xt[1]),[]),Et=Math.min,Rt=Math.max,Ot=Math.round,Ct=Math.floor,St=e=>({x:e,y:e}),_t={left:"right",right:"left",bottom:"top",top:"bottom"};function jt(e,t,n){return Rt(e,Et(t,n))}function At(e,t){return"function"==typeof e?e(t):e}function kt(e){return e.split("-")[0]}function Lt(e){return e.split("-")[1]}function Tt(e){return"x"===e?"y":"x"}function Pt(e){return"y"===e?"height":"width"}function Mt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Dt(e){return Tt(Mt(e))}function $t(e,t,n){void 0===n&&(n=!1);const r=Lt(e),o=Dt(e),i=Pt(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=zt(u)),[u,zt(u)]}function It(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Nt=["left","right"],Ft=["right","left"],Wt=["top","bottom"],Ht=["bottom","top"];function zt(e){const t=kt(e);return _t[t]+e.slice(t.length)}function Bt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ut(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 Kt(e,t,n){let{reference:r,floating:o}=e;const i=Mt(t),u=Dt(t),c=Pt(u),s=kt(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}}switch(Lt(t)){case"start":p[u]-=d*(n&&l?-1:1);break;case"end":p[u]+=d*(n&&l?-1:1)}return p}async function Vt(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}=At(t,e),m=Bt(p),v=c[d?"floating"===f?"reference":"floating":f],h=Ut(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:a,strategy:s})),g="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=Ut(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:s}):g);return{top:(h.top-x.top+m.top)/b.y,bottom:(x.bottom-h.bottom+m.bottom)/b.y,left:(h.left-x.left+m.left)/b.x,right:(x.right-h.right+m.right)/b.x}}const qt=new Set(["left","top"]);function Xt(e){const t=xe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=se(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=Ot(n)!==i||Ot(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function Yt(e){return ce(e)?e:e.contextElement}function Gt(e){const t=Yt(e);if(!se(t))return St(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xt(t);let u=(i?Ot(n.width):n.width)/r,c=(i?Ot(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Zt=St(0);function Qt(e){const t=oe(e);return ye()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Zt}function Jt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Yt(e);let u=St(1);t&&(r?ce(r)&&(u=Gt(r)):u=Gt(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==oe(e))&&t}(i,n,r)?Qt(i):St(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){const e=oe(i),t=r&&ce(r)?oe(r):r;let n=e,o=Ce(n);for(;o&&r&&t!==n;){const e=Gt(o),t=o.getBoundingClientRect(),r=xe(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=oe(o),o=Ce(n)}}return Ut({width:a,height:f,x:s,y:l})}function en(e,t){const n=we(e).scrollLeft;return t?t.left+n:Jt(ie(e)).left+n}function tn(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-en(e,n),y:n.top+t.scrollTop}}function nn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=oe(e),r=ie(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,c=0,s=0;if(o){i=o.width,u=o.height;const e=ye();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}const l=en(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,u=Math.abs(r.clientWidth-t.clientWidth-o);u<=25&&(i-=u)}else l<=25&&(i+=l);return{width:i,height:u,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=ie(e),n=we(e),r=e.ownerDocument.body,o=Rt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Rt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+en(e);const c=-n.scrollTop;return"rtl"===xe(r).direction&&(u+=Rt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}(ie(e));else if(ce(t))r=function(e,t){const n=Jt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=se(e)?Gt(e):St(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Qt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ut(r)}function rn(e,t){const n=Ee(e);return!(n===t||!ce(n)||be(n))&&("fixed"===xe(n).position||rn(n,t))}function on(e,t,n){const r=se(t),o=ie(t),i="fixed"===n,u=Jt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=St(0);function l(){s.x=en(o)}if(r||!r&&!i)if(("body"!==re(t)||ae(o))&&(c=we(t)),r){const e=Jt(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const a=!o||r||i?St(0):tn(o,c);return{x:u.left+c.scrollLeft-s.x-a.x,y:u.top+c.scrollTop-s.y-a.y,width:u.width,height:u.height}}function un(e){return"static"===xe(e).position}function cn(e,t){if(!se(e)||"fixed"===xe(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ie(e)===n&&(n=n.ownerDocument.body),n}function sn(e,t){const n=oe(e);if(de(e))return n;if(!se(e)){let t=Ee(e);for(;t&&!be(t);){if(ce(t)&&!un(t))return t;t=Ee(t)}return n}let r=cn(e,t);for(;r&&fe(r)&&un(r);)r=cn(r,t);return r&&be(r)&&un(r)&&!ge(r)?n:r||function(e){let t=Ee(e);for(;se(t)&&!be(t);){if(ge(t))return t;if(de(t))return null;t=Ee(t)}return null}(e)||n}const ln={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=ie(r),c=!!t&&de(t.floating);if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=St(1);const a=St(0),f=se(r);if((f||!f&&!i)&&(("body"!==re(r)||ae(u))&&(s=we(r)),f)){const e=Jt(r);l=Gt(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?St(0):tn(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:ie,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?de(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Oe(e,[],!1).filter(e=>ce(e)&&"body"!==re(e)),o=null;const i="fixed"===xe(e).position;let u=i?Ee(e):e;for(;ce(u)&&!be(u);){const t=xe(u),n=ge(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||ae(u)&&!n&&rn(e,u))?r=r.filter(e=>e!==u):o=t,u=Ee(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=nn(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=nn(t,i[e],o);c=Rt(n.top,c),s=Et(n.right,s),l=Et(n.bottom,l),a=Rt(n.left,a)}return{width:s-a,height:l-c,x:a,y:c}},getOffsetParent:sn,getElementRects:async function(e){const t=this.getOffsetParent||sn,n=this.getDimensions,r=await n(e.floating);return{reference:on(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Xt(e);return{width:t,height:n}},getScale:Gt,isElement:ce,isRTL:function(e){return"rtl"===xe(e).direction}};function an(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const fn=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:m="none",flipAlignment:v=!0,...h}=At(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=kt(o),y=Mt(c),b=kt(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(l.floating)),w=d||(b||!v?[zt(c)]:function(e){const t=zt(e);return[It(e),t,It(t)]}(c)),E="none"!==m;!d&&E&&w.push(...function(e,t,n,r){const o=Lt(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Ft:Nt:t?Nt:Ft;case"left":case"right":return t?Wt:Ht;default:return[]}}(kt(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(It)))),i}(c,v,m,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[g]),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||y===Mt(t)||S.every(e=>Mt(e.placement)!==y||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 A;const e=null==(A=S.filter(e=>{if(E){const t=Mt(e.placement);return t===y||"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:A[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},dn=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}=At(e,t)||{};if(null==l)return{};const f=Bt(a),d={x:n,y:r},p=Dt(o),m=Pt(p),v=await u.getDimensions(l),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[m]+i.reference[p]-d[p]-i.floating[m],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[m]);const O=x/2-w/2,C=R/2-v[m]/2-1,S=Et(f[g],C),_=Et(f[y],C),j=S,A=R-v[m]-_,k=R/2-v[m]/2+O,L=jt(j,k,A),T=!s.arrow&&null!=Lt(o)&&k!==L&&i.reference[m]/2-(k<j?S:_)-v[m]/2<0,P=T?k<j?k-j:k-A:0;return{[p]:d[p]+P,data:{[p]:L,centerOffset:k-L-P,...T&&{alignmentOffset:P}},reset:T}}}),pn=(e,t,n)=>{const r=new Map,o={platform:ln,...n},i={...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:Vt},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}=Kt(l,r,s),d=r,p=0;const m={};for(let n=0;n<i.length;n++){const v=i[n];if(!v)continue;const{name:h,fn:g}=v,{x:y,y:b,data:x,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:l,platform:c,elements:{reference:e,floating:t}});a=null!=y?y:a,f=null!=b?b:f,m[h]={...m[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}=Kt(l,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var mn="undefined"!=typeof document?A.useLayoutEffect:function(){};function vn(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(!vn(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||vn(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function hn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gn(e,t){const n=hn(e);return Math.round(t*n)/n}function yn(e){const t=A.useRef(e);return mn(()=>{t.current=e}),t}const bn="data-floating-ui-focusable",xn="active",wn="selected",En={...k};let Rn=!1,On=0;const Cn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+On++,Sn=En.useId||function(){const[e,t]=A.useState(()=>Rn?Cn():void 0);return st(()=>{null==e&&t(Cn())},[]),A.useEffect(()=>{Rn=!0},[]),e},_n=A.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:u=14,height:c=7,tipRadius:s=0,strokeWidth:l=0,staticOffset:a,stroke:f,d,style:{transform:p,...m}={},...v}=e,h=Sn(),[g,y]=A.useState(!1);if(st(()=>{r&&"rtl"===xe(r).direction&&y(!0)},[r]),!r)return null;const[b,x]=n.split("-"),w="top"===b||"bottom"===b;let E=a;(w&&null!=i&&i.x||!w&&null!=i&&i.y)&&(E=null);const R=2*l,O=R/2,C=u/2*(s/-8+1),S=c/2*s/4,_=!!d,k=E&&"end"===x?"bottom":"top";let L=E&&"end"===x?"right":"left";E&&g&&(L="end"===x?"left":"right");const T=null!=(null==o?void 0:o.x)?E||o.x:"",P=null!=(null==o?void 0:o.y)?E||o.y:"",M=d||"M0,0 H"+u+" L"+(u-C)+","+(c-S)+" Q"+u/2+","+c+" "+C+","+(c-S)+" Z",D={top:_?"rotate(180deg)":"",left:_?"rotate(90deg)":"rotate(-90deg)",bottom:_?"":"rotate(180deg)",right:_?"rotate(-90deg)":"rotate(90deg)"}[b];return(0,j.jsxs)("svg",{...v,"aria-hidden":!0,ref:t,width:_?u:u+R,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[L]:T,[k]:P,[b]:w||_?"100%":"calc(100% - "+R/2+"px)",transform:[D,p].filter(e=>!!e).join(" "),...m},children:[R>0&&(0,j.jsx)("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:R+(d?0:1),d:M}),(0,j.jsx)("path",{stroke:R&&!d?v.fill:"none",d:M}),(0,j.jsx)("clipPath",{id:h,children:(0,j.jsx)("rect",{x:-O,y:O*(_?-1:1),width:u+R,height:u})})]})});function jn(){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 An=A.createContext(null),kn=A.createContext(null),Ln=()=>{var e;return(null==(e=A.useContext(An))?void 0:e.id)||null},Tn=()=>A.useContext(kn);function Pn(e){const{children:t,id:n}=e,r=Ln();return(0,j.jsx)(An.Provider,{value:A.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Mn(e){const{children:t}=e,n=A.useRef([]),r=A.useCallback(e=>{n.current=[...n.current,e]},[]),o=A.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[i]=A.useState(()=>jn());return(0,j.jsx)(kn.Provider,{value:A.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i]),children:t})}function Dn(e){return"data-floating-ui-"+e}function $n(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const In=Dn("safe-polygon");function Nn(e,t,n){if(n&&!ct(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 Fn(e){return"function"==typeof e?e():e}let Wn=0;function Hn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Wn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Wn=requestAnimationFrame(i)}function zn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&le(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Bn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Un(e){return"inert"===e?Bn.inert:"aria-hidden"===e?Bn["aria-hidden"]:Bn.none}let Kn=new WeakSet,Vn={},qn=0;function Xn(e){return e?le(e)?e.host:Xn(e.parentNode):null}const Yn=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Xn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function Gn(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=Yn(t,e),c=new Set,s=new Set(u),l=[];Vn[o]||(Vn[o]=new WeakMap);const a=Vn[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"!==re(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Un(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&&Kn.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),c.clear(),qn++,()=>{l.forEach(e=>{const t=Un(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!Kn.has(e)&&i&&e.removeAttribute(i),Kn.delete(e)),r||e.removeAttribute(o)}),qn--,qn||(Bn.inert=new WeakMap,Bn["aria-hidden"]=new WeakMap,Bn.none=new WeakMap,Kn=new WeakSet,Vn={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Zn={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},Qn=A.forwardRef(function(e,t){const[n,r]=A.useState();st(()=>{Ve()&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Dn("focus-guard")]:"",style:Zn};return(0,j.jsx)("span",{...e,...o})}),Jn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},er=A.createContext(null),tr=Dn("portal");function nr(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=Sn(),o=rr(),[i,u]=A.useState(null),c=A.useRef(null);return st(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{c.current=null})},[i]),st(()=>{if(!r)return;if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(tr,""),e.appendChild(n),c.current=n,u(n)},[t,r]),st(()=>{if(null===n)return;if(!r)return;if(c.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!ue(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const s=document.createElement("div");s.id=r,s.setAttribute(tr,""),e=i||e,e.appendChild(s),c.current=s,u(s)},[t,n,r,o]),i}({id:n,root:r}),[u,c]=A.useState(null),s=A.useRef(null),l=A.useRef(null),a=A.useRef(null),f=A.useRef(null),d=null==u?void 0:u.modal,p=null==u?void 0:u.open,m=!!u&&!u.modal&&u.open&&o&&!(!r&&!i);return A.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&&ht(e)&&("focusin"===e.type?yt:gt)(i)}},[i,o,d]),A.useEffect(()=>{i&&(p||yt(i))},[p,i]),(0,j.jsxs)(er.Provider,{value:A.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:l,beforeInsideRef:a,afterInsideRef:f,portalNode:i,setFocusManagerState:c}),[o,i]),children:[m&&i&&(0,j.jsx)(Qn,{"data-type":"outside",ref:s,onFocus:e=>{if(ht(e,i)){var t;null==(t=a.current)||t.focus()}else{const e=vt(u?u.domReference:null);null==e||e.focus()}}}),m&&i&&(0,j.jsx)("span",{"aria-owns":i.id,style:Jn}),i&&bt.createPortal(t,i),m&&i&&(0,j.jsx)(Qn,{"data-type":"outside",ref:l,onFocus:e=>{if(ht(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=mt(u?u.domReference:null);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const rr=()=>A.useContext(er);function or(e){return A.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let ir=[];function ur(){ir=ir.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function cr(){ur();const e=ir[ir.length-1];return null==e?void 0:e.deref()}function sr(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=dt(),o=function(e,t){return(t=t||{}).getShadowRoot?Te([e],t.includeContainer,{filter:Ne.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Le(e,t.includeContainer,Ne.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Be(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 lr=A.forwardRef(function(e,t){return(0,j.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Zn})});function ar(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:u=0,returnFocus:c=!0,restoreFocus:s=!1,modal:l=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:v,events:h,dataRef:g,elements:{domReference:y,floating:b}}=t,x=ft(()=>{var e;return null==(e=g.current.floatingContext)?void 0:e.nodeId}),w=ft(p),E="number"==typeof u&&u<0,R=nt(y)&&E,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,C=!O||i,S=!C||O&&d,_=lt(o),k=lt(u),L=lt(c),T=Tn(),P=rr(),M=A.useRef(null),D=A.useRef(null),$=A.useRef(!1),I=A.useRef(!1),N=A.useRef(-1),F=A.useRef(-1),W=null!=P,H=rt(b),z=ft(function(e){return void 0===e&&(e=H),e?ze(e,dt()):[]}),B=ft(e=>{const t=z(e);return _.current.map(e=>y&&"reference"===e?y:H&&"floating"===e?H:t).filter(Boolean).flat()});A.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){Ze(H,Ge(et(H)))&&0===z().length&&!R&&ut(e);const t=B(),n=Qe(e);"reference"===_.current[0]&&n===y&&(ut(e),e.shiftKey?Hn(t[t.length-1]):Hn(t[1])),"floating"===_.current[1]&&n===H&&e.shiftKey&&(ut(e),Hn(t[0]))}}const t=et(H);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,y,H,l,_,R,z,B]),A.useEffect(()=>{if(!r&&b)return b.addEventListener("focusin",e),()=>{b.removeEventListener("focusin",e)};function e(e){const t=Qe(e),n=z().indexOf(t);-1!==n&&(N.current=n)}},[r,b,z]),A.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=Qe(e);queueMicrotask(()=>{const o=x(),i=!(Ze(y,t)||Ze(b,t)||Ze(t,b)||Ze(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Dn("focus-guard"))||T&&(ot(T.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)})||it(T.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,rt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===y&&H&&sr(H,_),s&&n!==y&&(null==r||!r.isConnected)&&Ge(et(H))===et(H).body){se(H)&&H.focus();const e=N.current,t=z(),n=t[e]||t[t.length-1]||H;se(n)&&n.focus()}g.current.insideReactTree?g.current.insideReactTree=!1:!R&&l||!t||!i||I.current||t===cr()||($.current=!0,v(!1,e,"focus-out"))})}const n=Boolean(!T&&P);function o(){$n(F),g.current.insideReactTree=!0,F.current=window.setTimeout(()=>{g.current.insideReactTree=!1})}return b&&se(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),b.addEventListener("focusout",t),n&&b.addEventListener("focusout",o,!0),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),b.removeEventListener("focusout",t),n&&b.removeEventListener("focusout",o,!0)}):void 0},[r,y,b,H,l,T,P,v,f,s,z,R,x,_,g]);const U=A.useRef(null),K=A.useRef(null),V=or([U,null==P?void 0:P.beforeInsideRef]),q=or([K,null==P?void 0:P.afterInsideRef]);function X(e){return!r&&a&&l?(0,j.jsx)(lr,{ref:"start"===e?M:D,onClick:e=>v(!1,e.nativeEvent),children:"string"==typeof a?a:"Dismiss"}):null}A.useEffect(()=>{var e,t;if(r)return;if(!b)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Dn("portal")+"]"))||[]),o=null==(t=(T?it(T.nodesRef.current,x()):[]).find(e=>{var t;return nt((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[b,o,...n,...w(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,_.current.includes("reference")||R?y:null].filter(e=>null!=e),u=l||R?Gn(i,!S,S):Gn(i);return()=>{u()}},[r,y,b,l,_,P,R,C,S,T,x,w]),st(()=>{if(r||!se(H))return;const e=Ge(et(H));queueMicrotask(()=>{const t=B(H),n=k.current,r=("number"==typeof n?t[n]:n.current)||H,o=Ze(H,e);E||o||!m||Hn(r,{preventScroll:r===H})})},[r,m,H,E,B,k]),st(()=>{if(r||!H)return;const e=et(H);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)||(qe()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!Xe()&&(!qe()&&0===e.width&&0===e.height||qe()&&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=Ge(e),ur(),t&&"body"!==re(t)&&(ir.push(new WeakRef(t)),ir.length>20&&(ir=ir.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,Zn),W&&y&&y.insertAdjacentElement("afterend",o),()=>{h.off("openchange",n);const t=Ge(e),r=Ze(b,t)||T&&ot(T.nodesRef.current,x(),!1).some(e=>{var n;return Ze(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof L.current){const e=y||cr();return e&&e.isConnected?e:o}return L.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=dt();return Be(e,t)?e:ze(e,t)[0]||e}(i);L.current&&!$.current&&se(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,b,H,L,g,h,T,W,y,x]),A.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(ur)}),[r]),st(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:m,onOpenChange:v,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,l,m,v,f,y]),st(()=>{r||H&&sr(H,_)},[r,H,_]);const Y=!r&&C&&(!l||!R)&&(W||l);return(0,j.jsxs)(j.Fragment,{children:[Y&&(0,j.jsx)(Qn,{"data-type":"inside",ref:V,onFocus:e=>{if(l){const e=B();Hn("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,ht(e,P.portalNode)){const e=mt(y);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!R&&X("start"),n,X("end"),Y&&(0,j.jsx)(Qn,{"data-type":"inside",ref:q,onFocus:e=>{if(l)Hn(B()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&($.current=!0),ht(e,P.portalNode)){const e=vt(y);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function fr(e){return se(e.target)&&"BUTTON"===e.target.tagName}function dr(e){return tt(e)}function pr(e){return null!=e&&null!=e.clientX}const mr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},vr={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hr=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 gr(){return Ue().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Ve()}function yr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[xn]:t,[wn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[bn]:""},...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&&[xn,wn].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 br=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),xr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function wr(e,t){return"function"==typeof e?e(t):e}function Er(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,...Er(e,t.id,n)])}function Rr(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 Or(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:m}=e;return function(e){function v(){$n(o),d()}if($n(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:g}=e,y=[h,g],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=zn(f.floating,b),E=zn(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}(y,R),A=O.width>R.width,k=O.height>R.height,L=(A?R:O).left,T=(A?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&&ce(e.relatedTarget)&&zn(f.floating,e.relatedTarget))return;if(m&&Er(m.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 v();let D=[];switch(C){case"top":D=[[L,R.top+1],[L,O.bottom-1],[T,O.bottom-1],[T,R.top+1]];break;case"bottom":D=[[L,O.top+1],[L,R.bottom-1],[T,R.bottom-1],[T,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(!Rr([h,g],D)){if(i&&!j)return v();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 v()}Rr([h,g],function(e){let[n,r]=e;switch(C){case"top":return[[A?n+t/2:S?n+4*t:n-4*t,r+t+1],[A?n-t/2:S?n+4*t:n-4*t,r+t+1],[O.left,S||A?O.bottom-t:O.top],[O.right,S?A?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[A?n+t/2:S?n+4*t:n-4*t,r-t],[A?n-t/2:S?n+4*t:n-4*t,r-t],[O.left,S||A?O.top+t:O.bottom],[O.right,S?A?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(v,40)):v()}}};return l.__options={blockPointerEvents:n},l}const Cr=({children:e,enabled:t=!0,...n})=>{const r=Ln();return!t||r?e:(0,j.jsx)(Mn,{...n,children:e})},Sr=l(_,({$width:e="max-content"})=>({$width:e}))``,_r=({children:e,enabled:t=!0,...n})=>t?(0,j.jsx)(nr,{...n,children:e}):e,jr=(e,{enabled:t=!0,event:n="click",dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:u,clientPointsOptions:c,roleOptions:s,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:c=!0,outsidePress:s=!0,outsidePressEvent:l="pointerdown",referencePress:a=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:m}=t,v=Tn(),h=ft("function"==typeof s?s:()=>!1),g="function"==typeof s?h:s,y=A.useRef(!1),{escapeKey:b,outsidePress:x}=hr(p),{escapeKey:w,outsidePress:E}=hr(m),R=A.useRef(!1),O=ft(e=>{var t;if(!n||!u||!c||"Escape"!==e.key)return;if(R.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,s=v?ot(v.nodesRef.current,o):[];if(!b&&(e.stopPropagation(),s.length>0)){let e=!0;if(s.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")}),C=ft(e=>{var t;const n=()=>{var t;O(e),null==(t=Qe(e))||t.removeEventListener("keydown",n)};null==(t=Qe(e))||t.addEventListener("keydown",n)}),S=ft(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=y.current;if(y.current=!1,"click"===l&&u)return;if(n)return;if("function"==typeof g&&!g(e))return;const c=Qe(e),s="["+Dn("inert")+"]",a=et(o.floating).querySelectorAll(s);let f=ce(c)?c:null;for(;f&&!be(f);){const e=Ee(f);if(be(e)||!ce(e))break;f=e}if(a.length&&ce(c)&&!c.matches("html,body")&&!Ze(c,o.floating)&&Array.from(a).every(e=>!Ze(f,e)))return;if(se(c)&&k){const t=be(c),n=xe(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=v&&ot(v.nodesRef.current,d).some(t=>{var n;return Je(e,null==(n=t.context)?void 0:n.elements.floating)});if(Je(e,o.floating)||Je(e,o.domReference)||p)return;const m=v?ot(v.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),_=ft(e=>{var t;const n=()=>{var t;S(e),null==(t=Qe(e))||t.removeEventListener(l,n)};null==(t=Qe(e))||t.addEventListener(l,n)});A.useEffect(()=>{if(!n||!u)return;i.current.__escapeKeyBubbles=b,i.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function s(){window.clearTimeout(e),R.current=!0}function a(){e=window.setTimeout(()=>{R.current=!1},ye()?5:0)}const f=et(o.floating);c&&(f.addEventListener("keydown",w?C:O,w),f.addEventListener("compositionstart",s),f.addEventListener("compositionend",a)),g&&f.addEventListener(l,E?_:S,E);let p=[];return d&&(ce(o.domReference)&&(p=Oe(o.domReference)),ce(o.floating)&&(p=p.concat(Oe(o.floating))),!ce(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(Oe(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,{passive:!0})}),()=>{c&&(f.removeEventListener("keydown",w?C:O,w),f.removeEventListener("compositionstart",s),f.removeEventListener("compositionend",a)),g&&f.removeEventListener(l,E?_:S,E),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,c,g,l,n,r,d,u,b,x,O,w,C,S,E,_]),A.useEffect(()=>{i.current.insideReactTree=!1},[i,g,l]);const j=A.useMemo(()=>({onKeyDown:O,...a&&{[mr[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[O,r,a,f]),k=A.useMemo(()=>{function e(e){0===e.button&&(y.current=!0)}return{onKeyDown:O,onMouseDown:e,onMouseUp:e,[vr[l]]:()=>{i.current.insideReactTree=!0}}},[O,l,i]);return A.useMemo(()=>u?{reference:j,floating:k}:{},[u,j,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:c="click",toggle:s=!0,ignoreMouse:l=!1,keyboardHandlers:a=!0,stickIfOpen:f=!0}=t,d=A.useRef(),p=A.useRef(!1),m=A.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==c&&(ct(t,!0)&&l||(!n||!s||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"===c&&d.current?d.current=void 0:ct(t,!0)&&l||(!n||!s||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||fr(e)||(" "!==e.key||dr(i)||(e.preventDefault(),p.current=!0),function(e){return se(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!a||fr(e)||dr(i)||" "===e.key&&p.current&&(p.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[o,i,c,l,a,r,n,f,s]);return A.useMemo(()=>u?{reference:m}:{},[u,m])}(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:c=!0,delay:s=0,handleClose:l=null,mouseOnly:a=!1,restMs:f=0,move:d=!0}=t,p=Tn(),m=Ln(),v=lt(l),h=lt(s),g=lt(n),y=lt(f),b=A.useRef(),x=A.useRef(-1),w=A.useRef(),E=A.useRef(-1),R=A.useRef(!0),O=A.useRef(!1),C=A.useRef(()=>{}),S=A.useRef(!1),_=ft(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});A.useEffect(()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||($n(x),$n(E),R.current=!0,S.current=!1)}},[c,i]),A.useEffect(()=>{if(!c)return;if(!v.current)return;if(!n)return;function e(e){_()&&r(!1,e,"hover")}const t=et(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,r,c,v,_]);const j=A.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Nn(h.current,"close",b.current);o&&!w.current?($n(x),x.current=window.setTimeout(()=>r(!1,e,n),o)):t&&($n(x),r(!1,e,n))},[h,r]),k=ft(()=>{C.current(),w.current=void 0}),L=ft(()=>{if(O.current){const e=et(u.floating).body;e.style.pointerEvents="",e.removeAttribute(In),O.current=!1}}),T=ft(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));A.useEffect(()=>{if(c&&ce(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",s),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",s),o.removeEventListener("mouseleave",l))}}function e(e){if($n(x),R.current=!1,a&&!ct(b.current)||Fn(y.current)>0&&!Nn(h.current,"open"))return;const t=Nn(h.current,"open",b.current);t?x.current=window.setTimeout(()=>{g.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(T())return void L();C.current();const t=et(u.floating);if($n(E),S.current=!1,v.current&&o.current.floatingContext){n||$n(x),w.current=v.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||j(e,!0,"safe-polygon")}});const r=w.current;return t.addEventListener("mousemove",r),void(C.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!Ze(u.floating,e.relatedTarget))&&j(e)}function i(e){T()||o.current.floatingContext&&(null==v.current||v.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||j(e)}})(e))}function s(){$n(x)}function l(e){T()||j(e,!1)}},[u,c,e,a,d,j,k,L,r,n,g,p,h,v,o,T,y]),st(()=>{var e;if(c&&n&&null!=(e=v.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&_()){O.current=!0;const e=u.floating;if(ce(u.domReference)&&e){var t;const n=et(u.floating).body;n.setAttribute(In,"");const r=u.domReference,o=null==p||null==(t=p.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=""}}}},[c,n,m,u,p,v,_]),st(()=>{n||(b.current=void 0,S.current=!1,k(),L())},[n,k,L]),A.useEffect(()=>()=>{k(),$n(x),$n(E),L()},[c,u.domReference,k,L]);const P=A.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){R.current||g.current||r(!0,t,"hover")}a&&!ct(b.current)||n||0===Fn(y.current)||S.current&&e.movementX**2+e.movementY**2<2||($n(E),"touch"===b.current?o():(S.current=!0,E.current=window.setTimeout(o,Fn(y.current))))}}},[a,r,n,g,y]);return A.useMemo(()=>c?{reference:P}:{},[c,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:Or(),...i}),p=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:u}=e,{enabled:c=!0,visibleOnly:s=!0}=t,l=A.useRef(!1),a=A.useRef(-1),f=A.useRef(!0);A.useEffect(()=>{if(!c)return;const e=oe(u.domReference);function t(){!n&&se(u.domReference)&&u.domReference===Ge(et(u.domReference))&&(l.current=!0)}function r(){f.current=!0}function o(){f.current=!1}return e.addEventListener("blur",t),gr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),gr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[u.domReference,n,c]),A.useEffect(()=>{if(c)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,c]),A.useEffect(()=>()=>{$n(a)},[]);const d=A.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;const t=Qe(e.nativeEvent);if(s&&ce(t))if(gr()&&!e.relatedTarget){if(!f.current&&!tt(t))return}else if(!function(e){if(!e||Xe())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=ce(t)&&t.hasAttribute(Dn("focus-guard"))&&"outside"===t.getAttribute("data-type");a.current=window.setTimeout(()=>{var e;const c=Ge(u.domReference?u.domReference.ownerDocument:document);(t||c!==u.domReference)&&(Ze(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,c)||Ze(u.domReference,c)||o||r(!1,n,"focus"))})}}),[i,u.domReference,r,s]);return A.useMemo(()=>c?{reference:d}:{},[c,d])}(e,{enabled:t&&"focus"===n,...u}),m=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:u}=e,{enabled:c=!0,axis:s="both",x:l=null,y:a=null}=t,f=A.useRef(!1),d=A.useRef(null),[p,m]=A.useState(),[v,h]=A.useState([]),g=ft((e,t)=>{f.current||r.current.openEvent&&!pr(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},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:s,dataRef:r,pointerType:p}))}),y=ft(e=>{null==l&&null==a&&(n?d.current||h([]):g(e.clientX,e.clientY))}),b=ct(p)?o:n,x=A.useCallback(()=>{if(!b||!c||null!=l||null!=a)return;const e=oe(o);function t(n){const r=Qe(n);Ze(o,r)?(e.removeEventListener("mousemove",t),d.current=null):g(n.clientX,n.clientY)}if(!r.current.openEvent||pr(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}u.setPositionReference(i)},[b,c,l,a,o,r,u,i,g]);A.useEffect(()=>x(),[x,v]),A.useEffect(()=>{c&&!o&&(f.current=!1)},[c,o]),A.useEffect(()=>{!c&&n&&(f.current=!0)},[c,n]),st(()=>{!c||null==l&&null==a||(f.current=!1,g(l,a))},[c,l,a,g]);const w=A.useMemo(()=>{function e(e){let{pointerType:t}=e;m(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return A.useMemo(()=>c?{reference:w}:{},[c,w])}(e,{enabled:t&&"point"===n,...c}),v=function(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:u}=e,{enabled:c=!0,role:s="dialog"}=t,l=Sn(),a=(null==(n=i.domReference)?void 0:n.id)||l,f=A.useMemo(()=>{var e;return(null==(e=rt(i.floating))?void 0:e.id)||u},[i.floating,u]),d=null!=(r=br.get(s))?r:s,p=null!=Ln(),m=A.useMemo(()=>"tooltip"===d||"label"===s?{["aria-"+("label"===s?"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"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[d,f,p,o,a,s]),v=A.useMemo(()=>{const e={id:f,...d&&{role:d}};return"tooltip"===d||"label"===s?e:{...e,..."menu"===d&&{"aria-labelledby":a}}},[d,f,a,s]),h=A.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:f+"-fui-option"}};switch(s){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[f,s]);return A.useMemo(()=>c?{reference:m,floating:v,item:h}:{},[c,m,v,h])}(e,s);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=A.useCallback(t=>yr(t,e,"reference"),t),i=A.useCallback(t=>yr(t,e,"floating"),n),u=A.useCallback(t=>yr(t,e,"item"),r);return A.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}([a,f,d,p,m,v,...l])},Ar=({enabled:e=!0,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s,open:l,floatingOptions:a,useOffset:f=!0,offsetOptions:d,useFlip:p=!0,flipOptions:m,useShift:h=!0,shiftOptions:g,useArrow:y=!1,arrowOptions:b,transitionOptions:x,useAutoPlacement:w=!1,autoPlacementOptions:E,useAutoUpdate:R=!1,autoUpdateOptions:O,useAutoSize:C=!1,sizeOptions:S,minAcceptableWidth:_=null,minAcceptableHeight:j=null,maxAcceptableWidth:k,maxAcceptableHeight:L,onOpen:T,onClose:P})=>{const{theme:M}=Z(),D=function(){const e=Sn(),t=Tn(),n=Ln();return st(()=>{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,A.useState)(!1),N=(0,A.useRef)(null),F=e&&(l??$);(0,A.useEffect)(()=>{F&&T?.()},[F]),((e,t)=>{const n=(0,A.useRef)(e);(0,A.useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(e,e=>{e||I(!1)});const W=[];f&&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=kt(n),c=Lt(n),s="y"===Mt(n),l=qt.has(u)?-1:1,a=i&&s?-1:1,f=At(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),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]}})(d??M.spacings.base));let H=null;if(w?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=wt,autoAlignment:p=!0,...m}=At(e,t),v=void 0!==f||d===wt?function(e,t,n){return(e?[...n.filter(t=>Lt(t)===e),...n.filter(t=>Lt(t)!==e)]:n.filter(e=>kt(e)===e)).filter(n=>!e||Lt(n)===e||!!t&&It(n)!==n)}(f||null,p,d):d,h=await s.detectOverflow(t,m),g=(null==(n=u.autoPlacement)?void 0:n.index)||0,y=v[g];if(null==y)return{};const b=$t(y,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));if(c!==y)return{reset:{placement:v[0]}};const x=[h[kt(y)],h[b[0]],h[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:y,overflows:x}],E=v[g+1];if(E)return{data:{index:g+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=Lt(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,Lt(e[0])?2:3).every(e=>e<=0)),C=(null==(o=O[0])?void 0:o[0])||R[0][0];return C!==c?{data:{index:g+1,overflows:w},reset:{placement:C}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(E)):p&&(H=(e=>{const t=fn(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...m})),C){const e=(e=>{const t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:u,elements:c}=t,{apply:s=()=>{},...l}=At(e,t),a=await u.detectOverflow(t,l),f=kt(o),d=Lt(o),p="y"===Mt(o),{width:m,height:v}=i.floating;let h,g;"top"===f||"bottom"===f?(h=f,g=d===(await(null==u.isRTL?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(g=f,h="end"===d?"top":"bottom");const y=v-a.top-a.bottom,b=m-a.left-a.right,x=Et(v-a[h],y),w=Et(m-a[g],b),E=!t.middlewareData.shift;let R=x,O=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(O=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(R=y),E&&!d){const e=Rt(a.left,0),t=Rt(a.right,0),n=Rt(a.top,0),r=Rt(a.bottom,0);p?O=m-2*(0!==e||0!==t?e+t:Rt(a.left,a.right)):R=v-2*(0!==n||0!==r?n+r:Rt(a.top,a.bottom))}await s({...t,availableWidth:O,availableHeight:R});const C=await u.getDimensions(c.floating);return m!==C.width||v!==C.height?{reset:{rects:!0}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({...S,apply({elements:e,rects:t,availableWidth:n,availableHeight:r}){const o=v(_)?_(t.reference):_??t.reference.width,i=v(k)?k(t.reference):Math.min(n,k??1/0),u=v(j)?j(t.reference):j??0,c=v(L)?L(t.reference):Math.min(r,L??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`})}});H?"initialPlacement"===m?.fallbackStrategy?W.push(e,H):W.push(H,e):W.push(e)}else H&&W.push(H);h&&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}=At(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=Mt(kt(o)),p=Tt(d);let m=a[p],v=a[d];if(u){const e="y"===p?"bottom":"right";m=jt(m+f["y"===p?"top":"left"],m,m-f[e])}if(c){const e="y"===d?"bottom":"right";v=jt(v+f["y"===d?"top":"left"],v,v-f[e])}const h=s.fn({...t,[p]:m,[d]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:u,[d]:c}}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({padding:M.spacings.base,...g})),y&&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?dn({element:n.current,padding:r}).fn(t):{}:n?dn({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,...b}));const z=function(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Sn(),i=A.useRef({}),[u]=A.useState(()=>jn()),c=null!=Ln(),[s,l]=A.useState(r.reference),a=ft((e,t,r)=>{i.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:r,nested:c}),null==n||n(e,t,r)}),f=A.useMemo(()=>({setPositionReference:l}),[]),d=A.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return A.useMemo(()=>({dataRef:i,open:t,onOpenChange:a,elements:d,events:u,floatingId:o,refs:f}),[t,a,d,u,o,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,u]=A.useState(null),[c,s]=A.useState(null),l=(null==o?void 0:o.domReference)||i,a=A.useRef(null),f=Tn();st(()=>{l&&(a.current=l)},[l]);const d=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:u}={},transform:c=!0,whileElementsMounted:s,open:l}=e,[a,f]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=A.useState(r);vn(d,r)||p(r);const[m,v]=A.useState(null),[h,g]=A.useState(null),y=A.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),b=A.useCallback(e=>{e!==R.current&&(R.current=e,g(e))},[]),x=i||m,w=u||h,E=A.useRef(null),R=A.useRef(null),O=A.useRef(a),C=null!=s,S=yn(s),_=yn(o),j=yn(l),k=A.useCallback(()=>{if(!E.current||!R.current)return;const e={placement:t,strategy:n,middleware:d};_.current&&(e.platform=_.current),pn(E.current,R.current,e).then(e=>{const t={...e,isPositioned:!1!==j.current};L.current&&!vn(O.current,t)&&(O.current=t,bt.flushSync(()=>{f(t)}))})},[d,t,n,_,j]);mn(()=>{!1===l&&O.current.isPositioned&&(O.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);const L=A.useRef(!1);mn(()=>(L.current=!0,()=>{L.current=!1}),[]),mn(()=>{if(x&&(E.current=x),w&&(R.current=w),x&&w){if(S.current)return S.current(x,w,k);k()}},[x,w,k,S,C]);const T=A.useMemo(()=>({reference:E,floating:R,setReference:y,setFloating:b}),[y,b]),P=A.useMemo(()=>({reference:x,floating:w}),[x,w]),M=A.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=gn(P.floating,a.x),r=gn(P.floating,a.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...hn(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,P.floating,a.x,a.y]);return A.useMemo(()=>({...a,update:k,refs:T,elements:P,floatingStyles:M}),[a,k,T,P,M])}({...e,elements:{...o,...c&&{reference:c}}}),p=A.useCallback(e=>{const t=ce(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),d.refs.setReference(t)},[d.refs]),m=A.useCallback(e=>{(ce(e)||null===e)&&(a.current=e,u(e)),(ce(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!ce(e))&&d.refs.setReference(e)},[d.refs]),v=A.useMemo(()=>({...d.refs,setReference:m,setPositionReference:p,domReference:a}),[d.refs,m,p]),h=A.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),g=A.useMemo(()=>({...d,...r,refs:v,elements:h,nodeId:t}),[d,v,h,t,r]);return st(()=>{r.dataRef.current.floatingContext=g;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=g)}),A.useMemo(()=>({...d,context:g,refs:v,elements:h}),[d,v,h,g])}({nodeId:D,open:F,middleware:W,onOpenChange:(e,t,n)=>{I(e),e||P?.(n,t)},...R&&{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=Yt(e),a=o||i?[...l?Oe(l):[],...t?Oe(t):[]]:[];a.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const f=l&&c?function(e,t){let n,r=null;const o=ie(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function u(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const l=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=l;if(c||t(),!d||!p)return;const m={rootMargin:-Ct(f)+"px "+-Ct(o.clientWidth-(a+d))+"px "+-Ct(o.clientHeight-(f+p))+"px "+-Ct(a)+"px",threshold:Rt(0,Et(1,s))||1};let v=!0;function h(t){const r=t[0].intersectionRatio;if(r!==s){if(!v)return u();r?u(!1,r):n=setTimeout(()=>{u(!1,1e-7)},1e3)}1!==r||an(l,e.getBoundingClientRect())||u(),v=!1}try{r=new IntersectionObserver(h,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),i}(l,n):null;let d,p=-1,m=null;u&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),l&&!s&&m.observe(l),t&&m.observe(t));let v=s?Jt(e):null;return s&&function t(){const r=Jt(e);v&&!an(v,r)&&n(),v=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=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(d)}}(e,t,n,O)},...a}),B=jr(z.context,{enabled:e,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s}),U=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:u=250}=t,c=e.placement,s=c.split("-")[0],l=A.useMemo(()=>({side:s,placement:c}),[s,c]),a="number"==typeof u,f=(a?u:u.open)||0,d=(a?u:u.close)||0,[p,m]=A.useState(()=>({...wr(i,l),...wr(n,l)})),{isMounted:v,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,c]=A.useState("unmounted"),s=function(e,t){const[n,r]=A.useState(e);return e&&!n&&r(!0),A.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,i);return s||"close"!==u||c("unmounted"),st(()=>{if(r){if(n){c("initial");const e=requestAnimationFrame(()=>{bt.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(e)}}c("close")}},[n,r]),{isMounted:s,status:u}}(e,{duration:u}),g=lt(n),y=lt(r),b=lt(o),x=lt(i);return st(()=>{const e=wr(g.current,l),t=wr(b.current,l),n=wr(x.current,l),r=wr(y.current,l)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===h&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===h&&m({transitionProperty:Object.keys(r).map(xr).join(","),transitionDuration:f+"ms",...n,...r}),"close"===h){const r=t||e;m({transitionProperty:Object.keys(r).map(xr).join(","),transitionDuration:d+"ms",...n,...r})}},[d,b,g,y,x,f,h,l]),{isMounted:v,styles:p}}(z.context,{duration:250,...x});return{nodeId:D,isOpen:F,floating:z,arrowRef:N,interactions:B,transition:U}},kr=()=>{const e=(0,A.useContext)(te);return m(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},Lr=({children:e,referenceProps:t,content:n,contentProps:r,focusManagerProps:o,arrowProps:i,portalProps:u,adjustStyles:c,context:s,...l})=>{const{useArrow:a,onClose:f}=l,{nodeId:d,floating:p,isOpen:m,arrowRef:v,interactions:g,transition:y}=Ar(l),b=(0,A.useCallback)(()=>{f?.("escape-key")},[f]),x=(0,A.useMemo)(()=>({context:s,floatingContext:p.context}),[s,p.context]);return(0,j.jsx)(Sr,{ref:p.refs.setReference,...g.getReferenceProps({onClick:e=>e.stopPropagation()}),...t,"data-testid":"honey-popup",children:(0,j.jsxs)(te,{value:x,children:[h(e,x),(0,j.jsx)(Pn,{id:d,children:y.isMounted&&(0,j.jsx)(_r,{...u,children:(0,j.jsx)(ar,{context:p.context,disabled:!m,...o,children:(0,j.jsxs)(ee,{ref:p.refs.setFloating,active:m,style:c?.({...p.floatingStyles,...y.styles},{middlewareData:p.middlewareData})??{...p.floatingStyles,...y.styles},onDeactivate:b,...g.getFloatingProps(),...r,"data-testid":"honey-popup-floating-content",children:[a&&(0,j.jsx)(_n,{ref:v,context:p.context,fill:"white",...i}),h(n,x)]})})})})]})})},Tr=({useTree:e=!1,...t})=>(0,j.jsx)(Cr,{enabled:e,children:(0,j.jsx)(Lr,{...t})}),Pr=l(_,{row:!0,centerY:!0})`
36
+ `,M=({ref:e,children:t,columns:n,spacing:r,columnsGrowing:o=!0,applyColumnMaxWidth:i=!1,...u})=>{const c=(0,A.useMemo)(()=>({columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}),[n,r,o,i]);return(0,S.jsx)(L,{value:c,children:(0,S.jsx)(P,{ref:e,spacing:r,"data-testid":"honey-grid",...u,children:t})})},D=()=>{const e=(0,A.useContext)(L);if(!e)throw new Error("The `useHoneyGridContext()` hook can only be used inside <HoneyGrid/> component!");return e},$=({children:e,...t})=>{const{columns:n,spacing:r,isColumnsGrowing:o,applyColumnMaxWidth:i}=D();return(0,S.jsx)(T,{columns:n,spacing:r,applyMaxWidth:i,$flexGrow:o?1:0,"data-testid":"honey-grid-column",...t,children:e})},I=(e,t,n)=>"function"==typeof t?t(e):"string"==typeof e||"number"==typeof e?e:t?e[t]:n,N=({children:e,loading:t=!1,loadingOverContent:n=!1,error:r=!1,empty:o=!1,loadingContent:i=null,errorContent:u=null,emptyContent:c=null})=>r?u:!n&&t?i:(0,S.jsxs)(S.Fragment,{children:[n&&t&&i,o?c:e]}),F=l(j,({$overflow:e="hidden auto"})=>({$overflow:e}))``,W=({children:e,items:t,itemKey:n,loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s=!1,emptyContent:l,...a})=>(0,S.jsx)(F,{role:"list","aria-busy":r,"data-testid":"honey-list",...a,children:(0,S.jsx)(N,{loading:r,loadingOverContent:o,loadingContent:i,error:u,errorContent:c,empty:s||0===t?.length,emptyContent:l,children:t?.map((t,r,o)=>(0,S.jsx)(A.Fragment,{children:e(t,r,o)},String(I(t,n,r))))})}),H=({children:e,mount:t,unmountDelay:n,alwaysMounted:r=!1,keepAfterMount:o=!1})=>{const[i,u]=(0,A.useState)(r||t),c=(0,A.useRef)(void 0);return(0,A.useLayoutEffect)(()=>{if(t&&!r)return clearTimeout(c.current),u(!0),()=>{o||(c.current=setTimeout(()=>u(!1),n))}},[t,r,n]),i?e:null};var z={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,m=Math.min,v=function(){return f.Date.now()};function h(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(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,y=!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=v();if(x(e))return E(e);s=setTimeout(w,function(e){var n=t-(e-l);return d?m(n,u-(e-a)):n}(e))}function E(e){return s=void 0,y&&o?b(e):(o=i=void 0,c)}function R(){var e=v(),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=g(t)||0,h(n)&&(f=!!n.leading,u=(d="maxWait"in n)?p(g(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),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(v())},R}(e,t,{leading:o,maxWait:t,trailing:i})}}},B={};function U(e){var t=B[e];if(void 0!==t)return t.exports;var n=B[e]={exports:{}};return z[e](n,n.exports,U),n.exports}U.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return U.d(t,{a:t}),t},U.d=(e,t)=>{for(var n in t)U.o(t,n)&&!U.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},U.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),U.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);const K=e=>{const t=(0,A.useRef)(e);return t.current=e,t};var V=U(551);U.n(V);var q=d(551),X=d.n(q);const Y=(e,{resizeThrottle:t=0,overrideScreenState:n}={})=>{const[r,o]=(0,A.useState)(()=>({...E(e.breakpoints),...n}));return(0,A.useEffect)(()=>{const r=X()(()=>{o({...E(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},G=(0,A.createContext)(void 0),Z=()=>{const e=(0,A.useContext)(G);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayout()` hook must be used inside <HoneyLayoutProvider/> component."),e},Q=(e,t)=>{const{registerOverlay:n,unregisterOverlay:r}=Z(),o=(0,A.useRef)(null);return(0,A.useEffect)(()=>{if(!e)return;const i=n(t);return o.current=i,()=>{o.current=null,r(i.id)}},[e,t.onKeyUp]),o.current},J=(e,{enabled:t=!0,onKeyUp:n}={})=>{const{overlays:r}=Z(),o=(0,A.useMemo)(()=>t?r.find(t=>t.id===e)??null:null,[t,r,e]);return(0,A.useEffect)(()=>{if(o&&n)return o.addListener("keyup",n),()=>{o.removeListener("keyup",n)}},[o,n]),o},ee=({ref:e,children:t,active:n,overlayId:r,onDeactivate:o,onKeyUp:i,...u})=>{const c=K(i),s=K(o),l=(0,A.useCallback)((e,...t)=>{c.current?c.current(e,...t):"Escape"===e&&s.current()},[]),a=Q(n,{id:r,onKeyUp:l}),f=y(a?.setContainerRef,e);return(0,S.jsx)(j,{ref:f,inert:!n,...u,children:h(t,{overlay:a,isActive:n,deactivateOverlay:s.current})})},te=(0,A.createContext)(void 0);function ne(){return"undefined"!=typeof window}function re(e){return ue(e)?(e.nodeName||"").toLowerCase():"#document"}function oe(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ie(e){var t;return null==(t=(ue(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ue(e){return!!ne()&&(e instanceof Node||e instanceof oe(e).Node)}function ce(e){return!!ne()&&(e instanceof Element||e instanceof oe(e).Element)}function se(e){return!!ne()&&(e instanceof HTMLElement||e instanceof oe(e).HTMLElement)}function le(e){return!(!ne()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof oe(e).ShadowRoot)}function ae(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==o&&"contents"!==o}function fe(e){return/^(table|td|th)$/.test(re(e))}function de(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const pe=/transform|translate|scale|rotate|perspective|filter/,me=/paint|layout|strict|content/,ve=e=>!!e&&"none"!==e;let he;function ge(e){const t=ce(e)?xe(e):e;return ve(t.transform)||ve(t.translate)||ve(t.scale)||ve(t.rotate)||ve(t.perspective)||!ye()&&(ve(t.backdropFilter)||ve(t.filter))||pe.test(t.willChange||"")||me.test(t.contain||"")}function ye(){return null==he&&(he="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),he}function be(e){return/^(html|body|#document)$/.test(re(e))}function xe(e){return oe(e).getComputedStyle(e)}function we(e){return ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ee(e){if("html"===re(e))return e;const t=e.assignedSlot||e.parentNode||le(e)&&e.host||ie(e);return le(t)?t.host:t}function Re(e){const t=Ee(e);return be(t)?e.ownerDocument?e.ownerDocument.body:e.body:se(t)&&ae(t)?t:Re(t)}function Oe(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Re(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),u=oe(o);if(i){const e=Ce(u);return t.concat(u,u.visualViewport||[],ae(o)?o:[],e&&n?Oe(e):[])}return t.concat(o,Oe(o,[],n))}function Ce(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var _e=["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(","),je="undefined"==typeof Element,Se=je?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ae=!je&&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},ke=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]"):ke(e.parentNode))},Le=function(e,t,n){if(ke(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(_e));return t&&Se.call(e,_e)&&r.unshift(e),r.filter(n)},Te=function(e,t,n){for(var r=[],o=Array.from(e);o.length;){var i=o.shift();if(!ke(i,!1))if("SLOT"===i.tagName){var u=i.assignedElements(),c=u.length?u:i.children,s=Te(c,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:i,candidates:s})}else{Se.call(i,_e)&&n.filter(i)&&(t||!e.includes(i))&&r.push(i);var l=i.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(i),a=!ke(l,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(i));if(l&&a){var f=Te(!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},Pe=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Me=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))&&!Pe(e)?0:e.tabIndex},De=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},$e=function(e){return"INPUT"===e.tagName},Ie=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},Ne=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=Se.call(e,"details>summary:first-of-type")?e.parentElement:e;if(Se.call(i,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return Ie(e)}else{if("function"==typeof r){for(var u=e;e;){var c=e.parentElement,s=Ae(e);if(c&&!c.shadowRoot&&!0===r(c))return Ie(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&&Ae(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=Ae(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!!Se.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},Fe=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||Ae(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)||Me(t)<0||!Ne(e,t))},We=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},He=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=Me(e);return n<0&&t&&!Pe(e)?0:n}(i,o),c=o?He(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(De).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},ze=function(e,t){var n;return n=(t=t||{}).getShadowRoot?Te([e],t.includeContainer,{filter:Fe.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:We}):Le(e,t.includeContainer,Fe.bind(null,t)),He(n)},Be=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==Se.call(e,_e)&&Fe(t,e)};function Ue(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Ke(){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 Ve(){return/apple/i.test(navigator.vendor)}function qe(){const e=/android/i;return e.test(Ue())||e.test(Ke())}function Xe(){return Ke().includes("jsdom/")}const Ye="data-floating-ui-focusable";function Ge(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&&le(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Qe(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Je(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 et(e){return(null==e?void 0:e.ownerDocument)||document}function tt(e){return se(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function nt(e){return!!e&&"combobox"===e.getAttribute("role")&&tt(e)}function rt(e){return e?e.hasAttribute(Ye)?e:e.querySelector("["+Ye+"]")||e:null}function ot(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,...ot(e,t.id,n)])}function it(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 ut(e){e.preventDefault(),e.stopPropagation()}function ct(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var st="undefined"!=typeof document?A.useLayoutEffect:function(){};function lt(e){const t=A.useRef(e);return st(()=>{t.current=e}),t}const at={...k}.useInsertionEffect||(e=>e());function ft(e){const t=A.useRef(()=>{});return at(()=>{t.current=e}),A.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 dt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function pt(e,t){const n=ze(e,dt()),r=n.length;if(0===r)return;const o=Ge(et(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function mt(e){return pt(et(e).body,1)||e}function vt(e){return pt(et(e).body,-1)||e}function ht(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Ze(n,r)}function gt(e){ze(e,dt()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function yt(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 bt=d(163);const xt=["start","end"],wt=["top","right","bottom","left"].reduce((e,t)=>e.concat(t,t+"-"+xt[0],t+"-"+xt[1]),[]),Et=Math.min,Rt=Math.max,Ot=Math.round,Ct=Math.floor,_t=e=>({x:e,y:e}),jt={left:"right",right:"left",bottom:"top",top:"bottom"};function St(e,t,n){return Rt(e,Et(t,n))}function At(e,t){return"function"==typeof e?e(t):e}function kt(e){return e.split("-")[0]}function Lt(e){return e.split("-")[1]}function Tt(e){return"x"===e?"y":"x"}function Pt(e){return"y"===e?"height":"width"}function Mt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Dt(e){return Tt(Mt(e))}function $t(e,t,n){void 0===n&&(n=!1);const r=Lt(e),o=Dt(e),i=Pt(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=zt(u)),[u,zt(u)]}function It(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Nt=["left","right"],Ft=["right","left"],Wt=["top","bottom"],Ht=["bottom","top"];function zt(e){const t=kt(e);return jt[t]+e.slice(t.length)}function Bt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ut(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 Kt(e,t,n){let{reference:r,floating:o}=e;const i=Mt(t),u=Dt(t),c=Pt(u),s=kt(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}}switch(Lt(t)){case"start":p[u]-=d*(n&&l?-1:1);break;case"end":p[u]+=d*(n&&l?-1:1)}return p}async function Vt(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}=At(t,e),m=Bt(p),v=c[d?"floating"===f?"reference":"floating":f],h=Ut(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:a,strategy:s})),g="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),b=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},x=Ut(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:y,strategy:s}):g);return{top:(h.top-x.top+m.top)/b.y,bottom:(x.bottom-h.bottom+m.bottom)/b.y,left:(h.left-x.left+m.left)/b.x,right:(x.right-h.right+m.right)/b.x}}const qt=new Set(["left","top"]);function Xt(e){const t=xe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=se(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=Ot(n)!==i||Ot(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function Yt(e){return ce(e)?e:e.contextElement}function Gt(e){const t=Yt(e);if(!se(t))return _t(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Xt(t);let u=(i?Ot(n.width):n.width)/r,c=(i?Ot(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),c&&Number.isFinite(c)||(c=1),{x:u,y:c}}const Zt=_t(0);function Qt(e){const t=oe(e);return ye()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Zt}function Jt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=Yt(e);let u=_t(1);t&&(r?ce(r)&&(u=Gt(r)):u=Gt(e));const c=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==oe(e))&&t}(i,n,r)?Qt(i):_t(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){const e=oe(i),t=r&&ce(r)?oe(r):r;let n=e,o=Ce(n);for(;o&&r&&t!==n;){const e=Gt(o),t=o.getBoundingClientRect(),r=xe(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=oe(o),o=Ce(n)}}return Ut({width:a,height:f,x:s,y:l})}function en(e,t){const n=we(e).scrollLeft;return t?t.left+n:Jt(ie(e)).left+n}function tn(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-en(e,n),y:n.top+t.scrollTop}}function nn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=oe(e),r=ie(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,c=0,s=0;if(o){i=o.width,u=o.height;const e=ye();(!e||e&&"fixed"===t)&&(c=o.offsetLeft,s=o.offsetTop)}const l=en(r);if(l<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,u=Math.abs(r.clientWidth-t.clientWidth-o);u<=25&&(i-=u)}else l<=25&&(i+=l);return{width:i,height:u,x:c,y:s}}(e,n);else if("document"===t)r=function(e){const t=ie(e),n=we(e),r=e.ownerDocument.body,o=Rt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Rt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+en(e);const c=-n.scrollTop;return"rtl"===xe(r).direction&&(u+=Rt(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}(ie(e));else if(ce(t))r=function(e,t){const n=Jt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=se(e)?Gt(e):_t(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Qt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ut(r)}function rn(e,t){const n=Ee(e);return!(n===t||!ce(n)||be(n))&&("fixed"===xe(n).position||rn(n,t))}function on(e,t,n){const r=se(t),o=ie(t),i="fixed"===n,u=Jt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=_t(0);function l(){s.x=en(o)}if(r||!r&&!i)if(("body"!==re(t)||ae(o))&&(c=we(t)),r){const e=Jt(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&l();i&&!r&&o&&l();const a=!o||r||i?_t(0):tn(o,c);return{x:u.left+c.scrollLeft-s.x-a.x,y:u.top+c.scrollTop-s.y-a.y,width:u.width,height:u.height}}function un(e){return"static"===xe(e).position}function cn(e,t){if(!se(e)||"fixed"===xe(e).position)return null;if(t)return t(e);let n=e.offsetParent;return ie(e)===n&&(n=n.ownerDocument.body),n}function sn(e,t){const n=oe(e);if(de(e))return n;if(!se(e)){let t=Ee(e);for(;t&&!be(t);){if(ce(t)&&!un(t))return t;t=Ee(t)}return n}let r=cn(e,t);for(;r&&fe(r)&&un(r);)r=cn(r,t);return r&&be(r)&&un(r)&&!ge(r)?n:r||function(e){let t=Ee(e);for(;se(t)&&!be(t);){if(ge(t))return t;if(de(t))return null;t=Ee(t)}return null}(e)||n}const ln={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=ie(r),c=!!t&&de(t.floating);if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=_t(1);const a=_t(0),f=se(r);if((f||!f&&!i)&&(("body"!==re(r)||ae(u))&&(s=we(r)),f)){const e=Jt(r);l=Gt(r),a.x=e.x+r.clientLeft,a.y=e.y+r.clientTop}const d=!u||f||i?_t(0):tn(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:ie,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?de(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=Oe(e,[],!1).filter(e=>ce(e)&&"body"!==re(e)),o=null;const i="fixed"===xe(e).position;let u=i?Ee(e):e;for(;ce(u)&&!be(u);){const t=xe(u),n=ge(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&("absolute"===o.position||"fixed"===o.position)||ae(u)&&!n&&rn(e,u))?r=r.filter(e=>e!==u):o=t,u=Ee(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=nn(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=nn(t,i[e],o);c=Rt(n.top,c),s=Et(n.right,s),l=Et(n.bottom,l),a=Rt(n.left,a)}return{width:s-a,height:l-c,x:a,y:c}},getOffsetParent:sn,getElementRects:async function(e){const t=this.getOffsetParent||sn,n=this.getDimensions,r=await n(e.floating);return{reference:on(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Xt(e);return{width:t,height:n}},getScale:Gt,isElement:ce,isRTL:function(e){return"rtl"===xe(e).direction}};function an(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}const fn=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:m="none",flipAlignment:v=!0,...h}=At(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=kt(o),y=Mt(c),b=kt(c)===c,x=await(null==s.isRTL?void 0:s.isRTL(l.floating)),w=d||(b||!v?[zt(c)]:function(e){const t=zt(e);return[It(e),t,It(t)]}(c)),E="none"!==m;!d&&E&&w.push(...function(e,t,n,r){const o=Lt(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Ft:Nt:t?Nt:Ft;case"left":case"right":return t?Wt:Ht;default:return[]}}(kt(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(It)))),i}(c,v,m,x));const R=[c,...w],O=await s.detectOverflow(t,h),C=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&C.push(O[g]),f){const e=$t(o,u,x);C.push(O[e[0]],O[e[1]])}if(_=[..._,{placement:o,overflows:C}],!C.every(e=>e<=0)){var j,S;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=R[e];if(t&&("alignment"!==f||y===Mt(t)||_.every(e=>Mt(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(S=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:S.placement;if(!n)switch(p){case"bestFit":{var A;const e=null==(A=_.filter(e=>{if(E){const t=Mt(e.placement);return t===y||"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:A[0];e&&(n=e);break}case"initialPlacement":n=c}if(o!==n)return{reset:{placement:n}}}return{}}}},dn=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}=At(e,t)||{};if(null==l)return{};const f=Bt(a),d={x:n,y:r},p=Dt(o),m=Pt(p),v=await u.getDimensions(l),h="y"===p,g=h?"top":"left",y=h?"bottom":"right",b=h?"clientHeight":"clientWidth",x=i.reference[m]+i.reference[p]-d[p]-i.floating[m],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[m]);const O=x/2-w/2,C=R/2-v[m]/2-1,_=Et(f[g],C),j=Et(f[y],C),S=_,A=R-v[m]-j,k=R/2-v[m]/2+O,L=St(S,k,A),T=!s.arrow&&null!=Lt(o)&&k!==L&&i.reference[m]/2-(k<S?_:j)-v[m]/2<0,P=T?k<S?k-S:k-A:0;return{[p]:d[p]+P,data:{[p]:L,centerOffset:k-L-P,...T&&{alignmentOffset:P}},reset:T}}}),pn=(e,t,n)=>{const r=new Map,o={platform:ln,...n},i={...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:Vt},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}=Kt(l,r,s),d=r,p=0;const m={};for(let n=0;n<i.length;n++){const v=i[n];if(!v)continue;const{name:h,fn:g}=v,{x:y,y:b,data:x,reset:w}=await g({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:l,platform:c,elements:{reference:e,floating:t}});a=null!=y?y:a,f=null!=b?b:f,m[h]={...m[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}=Kt(l,d,s))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var mn="undefined"!=typeof document?A.useLayoutEffect:function(){};function vn(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(!vn(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||vn(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function hn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gn(e,t){const n=hn(e);return Math.round(t*n)/n}function yn(e){const t=A.useRef(e);return mn(()=>{t.current=e}),t}const bn="data-floating-ui-focusable",xn="active",wn="selected",En={...k};let Rn=!1,On=0;const Cn=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+On++,_n=En.useId||function(){const[e,t]=A.useState(()=>Rn?Cn():void 0);return st(()=>{null==e&&t(Cn())},[]),A.useEffect(()=>{Rn=!0},[]),e},jn=A.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:o,shift:i}},width:u=14,height:c=7,tipRadius:s=0,strokeWidth:l=0,staticOffset:a,stroke:f,d,style:{transform:p,...m}={},...v}=e,h=_n(),[g,y]=A.useState(!1);if(st(()=>{r&&"rtl"===xe(r).direction&&y(!0)},[r]),!r)return null;const[b,x]=n.split("-"),w="top"===b||"bottom"===b;let E=a;(w&&null!=i&&i.x||!w&&null!=i&&i.y)&&(E=null);const R=2*l,O=R/2,C=u/2*(s/-8+1),_=c/2*s/4,j=!!d,k=E&&"end"===x?"bottom":"top";let L=E&&"end"===x?"right":"left";E&&g&&(L="end"===x?"left":"right");const T=null!=(null==o?void 0:o.x)?E||o.x:"",P=null!=(null==o?void 0:o.y)?E||o.y:"",M=d||"M0,0 H"+u+" L"+(u-C)+","+(c-_)+" Q"+u/2+","+c+" "+C+","+(c-_)+" Z",D={top:j?"rotate(180deg)":"",left:j?"rotate(90deg)":"rotate(-90deg)",bottom:j?"":"rotate(180deg)",right:j?"rotate(-90deg)":"rotate(90deg)"}[b];return(0,S.jsxs)("svg",{...v,"aria-hidden":!0,ref:t,width:j?u:u+R,height:u,viewBox:"0 0 "+u+" "+(c>u?c:u),style:{position:"absolute",pointerEvents:"none",[L]:T,[k]:P,[b]:w||j?"100%":"calc(100% - "+R/2+"px)",transform:[D,p].filter(e=>!!e).join(" "),...m},children:[R>0&&(0,S.jsx)("path",{clipPath:"url(#"+h+")",fill:"none",stroke:f,strokeWidth:R+(d?0:1),d:M}),(0,S.jsx)("path",{stroke:R&&!d?v.fill:"none",d:M}),(0,S.jsx)("clipPath",{id:h,children:(0,S.jsx)("rect",{x:-O,y:O*(j?-1:1),width:u+R,height:u})})]})});function Sn(){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 An=A.createContext(null),kn=A.createContext(null),Ln=()=>{var e;return(null==(e=A.useContext(An))?void 0:e.id)||null},Tn=()=>A.useContext(kn);function Pn(e){const{children:t,id:n}=e,r=Ln();return(0,S.jsx)(An.Provider,{value:A.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Mn(e){const{children:t}=e,n=A.useRef([]),r=A.useCallback(e=>{n.current=[...n.current,e]},[]),o=A.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[i]=A.useState(()=>Sn());return(0,S.jsx)(kn.Provider,{value:A.useMemo(()=>({nodesRef:n,addNode:r,removeNode:o,events:i}),[r,o,i]),children:t})}function Dn(e){return"data-floating-ui-"+e}function $n(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const In=Dn("safe-polygon");function Nn(e,t,n){if(n&&!ct(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 Fn(e){return"function"==typeof e?e():e}let Wn=0;function Hn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Wn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Wn=requestAnimationFrame(i)}function zn(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&le(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Bn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Un(e){return"inert"===e?Bn.inert:"aria-hidden"===e?Bn["aria-hidden"]:Bn.none}let Kn=new WeakSet,Vn={},qn=0;function Xn(e){return e?le(e)?e.host:Xn(e.parentNode):null}const Yn=(e,t)=>t.map(t=>{if(e.contains(t))return t;const n=Xn(t);return e.contains(n)?n:null}).filter(e=>null!=e);function Gn(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=Yn(t,e),c=new Set,s=new Set(u),l=[];Vn[o]||(Vn[o]=new WeakMap);const a=Vn[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"!==re(t))if(c.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Un(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&&Kn.add(t),1===c&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),c.clear(),qn++,()=>{l.forEach(e=>{const t=Un(i),n=(t.get(e)||0)-1,r=(a.get(e)||0)-1;t.set(e,n),a.set(e,r),n||(!Kn.has(e)&&i&&e.removeAttribute(i),Kn.delete(e)),r||e.removeAttribute(o)}),qn--,qn||(Bn.inert=new WeakMap,Bn["aria-hidden"]=new WeakMap,Bn.none=new WeakMap,Kn=new WeakSet,Vn={})}}(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const Zn={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},Qn=A.forwardRef(function(e,t){const[n,r]=A.useState();st(()=>{Ve()&&r("button")},[]);const o={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Dn("focus-guard")]:"",style:Zn};return(0,S.jsx)("span",{...e,...o})}),Jn={clipPath:"inset(50%)",position:"fixed",top:0,left:0},er=A.createContext(null),tr=Dn("portal");function nr(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=_n(),o=rr(),[i,u]=A.useState(null),c=A.useRef(null);return st(()=>()=>{null==i||i.remove(),queueMicrotask(()=>{c.current=null})},[i]),st(()=>{if(!r)return;if(c.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(tr,""),e.appendChild(n),c.current=n,u(n)},[t,r]),st(()=>{if(null===n)return;if(!r)return;if(c.current)return;let e=n||(null==o?void 0:o.portalNode);e&&!ue(e)&&(e=e.current),e=e||document.body;let i=null;t&&(i=document.createElement("div"),i.id=t,e.appendChild(i));const s=document.createElement("div");s.id=r,s.setAttribute(tr,""),e=i||e,e.appendChild(s),c.current=s,u(s)},[t,n,r,o]),i}({id:n,root:r}),[u,c]=A.useState(null),s=A.useRef(null),l=A.useRef(null),a=A.useRef(null),f=A.useRef(null),d=null==u?void 0:u.modal,p=null==u?void 0:u.open,m=!!u&&!u.modal&&u.open&&o&&!(!r&&!i);return A.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&&ht(e)&&("focusin"===e.type?yt:gt)(i)}},[i,o,d]),A.useEffect(()=>{i&&(p||yt(i))},[p,i]),(0,S.jsxs)(er.Provider,{value:A.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:s,afterOutsideRef:l,beforeInsideRef:a,afterInsideRef:f,portalNode:i,setFocusManagerState:c}),[o,i]),children:[m&&i&&(0,S.jsx)(Qn,{"data-type":"outside",ref:s,onFocus:e=>{if(ht(e,i)){var t;null==(t=a.current)||t.focus()}else{const e=vt(u?u.domReference:null);null==e||e.focus()}}}),m&&i&&(0,S.jsx)("span",{"aria-owns":i.id,style:Jn}),i&&bt.createPortal(t,i),m&&i&&(0,S.jsx)(Qn,{"data-type":"outside",ref:l,onFocus:e=>{if(ht(e,i)){var t;null==(t=f.current)||t.focus()}else{const t=mt(u?u.domReference:null);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const rr=()=>A.useContext(er);function or(e){return A.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let ir=[];function ur(){ir=ir.filter(e=>{var t;return null==(t=e.deref())?void 0:t.isConnected})}function cr(){ur();const e=ir[ir.length-1];return null==e?void 0:e.deref()}function sr(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=dt(),o=function(e,t){return(t=t||{}).getShadowRoot?Te([e],t.includeContainer,{filter:Ne.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Le(e,t.includeContainer,Ne.bind(null,t))}(e,r),i=o.filter(e=>{const t=e.getAttribute("data-tabindex")||"";return Be(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 lr=A.forwardRef(function(e,t){return(0,S.jsx)("button",{...e,type:"button",ref:t,tabIndex:-1,style:Zn})});function ar(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:u=0,returnFocus:c=!0,restoreFocus:s=!1,modal:l=!0,visuallyHiddenDismiss:a=!1,closeOnFocusOut:f=!0,outsideElementsInert:d=!1,getInsideElements:p=()=>[]}=e,{open:m,onOpenChange:v,events:h,dataRef:g,elements:{domReference:y,floating:b}}=t,x=ft(()=>{var e;return null==(e=g.current.floatingContext)?void 0:e.nodeId}),w=ft(p),E="number"==typeof u&&u<0,R=nt(y)&&E,O="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,C=!O||i,_=!C||O&&d,j=lt(o),k=lt(u),L=lt(c),T=Tn(),P=rr(),M=A.useRef(null),D=A.useRef(null),$=A.useRef(!1),I=A.useRef(!1),N=A.useRef(-1),F=A.useRef(-1),W=null!=P,H=rt(b),z=ft(function(e){return void 0===e&&(e=H),e?ze(e,dt()):[]}),B=ft(e=>{const t=z(e);return j.current.map(e=>y&&"reference"===e?y:H&&"floating"===e?H:t).filter(Boolean).flat()});A.useEffect(()=>{if(r)return;if(!l)return;function e(e){if("Tab"===e.key){Ze(H,Ge(et(H)))&&0===z().length&&!R&&ut(e);const t=B(),n=Qe(e);"reference"===j.current[0]&&n===y&&(ut(e),e.shiftKey?Hn(t[t.length-1]):Hn(t[1])),"floating"===j.current[1]&&n===H&&e.shiftKey&&(ut(e),Hn(t[0]))}}const t=et(H);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,y,H,l,j,R,z,B]),A.useEffect(()=>{if(!r&&b)return b.addEventListener("focusin",e),()=>{b.removeEventListener("focusin",e)};function e(e){const t=Qe(e),n=z().indexOf(t);-1!==n&&(N.current=n)}},[r,b,z]),A.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=Qe(e);queueMicrotask(()=>{const o=x(),i=!(Ze(y,t)||Ze(b,t)||Ze(t,b)||Ze(null==P?void 0:P.portalNode,t)||null!=t&&t.hasAttribute(Dn("focus-guard"))||T&&(ot(T.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)})||it(T.nodesRef.current,o).find(e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,rt(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t})));if(n===y&&H&&sr(H,j),s&&n!==y&&(null==r||!r.isConnected)&&Ge(et(H))===et(H).body){se(H)&&H.focus();const e=N.current,t=z(),n=t[e]||t[t.length-1]||H;se(n)&&n.focus()}g.current.insideReactTree?g.current.insideReactTree=!1:!R&&l||!t||!i||I.current||t===cr()||($.current=!0,v(!1,e,"focus-out"))})}const n=Boolean(!T&&P);function o(){$n(F),g.current.insideReactTree=!0,F.current=window.setTimeout(()=>{g.current.insideReactTree=!1})}return b&&se(y)?(y.addEventListener("focusout",t),y.addEventListener("pointerdown",e),b.addEventListener("focusout",t),n&&b.addEventListener("focusout",o,!0),()=>{y.removeEventListener("focusout",t),y.removeEventListener("pointerdown",e),b.removeEventListener("focusout",t),n&&b.removeEventListener("focusout",o,!0)}):void 0},[r,y,b,H,l,T,P,v,f,s,z,R,x,j,g]);const U=A.useRef(null),K=A.useRef(null),V=or([U,null==P?void 0:P.beforeInsideRef]),q=or([K,null==P?void 0:P.afterInsideRef]);function X(e){return!r&&a&&l?(0,S.jsx)(lr,{ref:"start"===e?M:D,onClick:e=>v(!1,e.nativeEvent),children:"string"==typeof a?a:"Dismiss"}):null}A.useEffect(()=>{var e,t;if(r)return;if(!b)return;const n=Array.from((null==P||null==(e=P.portalNode)?void 0:e.querySelectorAll("["+Dn("portal")+"]"))||[]),o=null==(t=(T?it(T.nodesRef.current,x()):[]).find(e=>{var t;return nt((null==(t=e.context)?void 0:t.elements.domReference)||null)}))||null==(t=t.context)?void 0:t.elements.domReference,i=[b,o,...n,...w(),M.current,D.current,U.current,K.current,null==P?void 0:P.beforeOutsideRef.current,null==P?void 0:P.afterOutsideRef.current,j.current.includes("reference")||R?y:null].filter(e=>null!=e),u=l||R?Gn(i,!_,_):Gn(i);return()=>{u()}},[r,y,b,l,j,P,R,C,_,T,x,w]),st(()=>{if(r||!se(H))return;const e=Ge(et(H));queueMicrotask(()=>{const t=B(H),n=k.current,r=("number"==typeof n?t[n]:n.current)||H,o=Ze(H,e);E||o||!m||Hn(r,{preventScroll:r===H})})},[r,m,H,E,B,k]),st(()=>{if(r||!H)return;const e=et(H);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)||(qe()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}(n)||function(e){return!Xe()&&(!qe()&&0===e.width&&0===e.height||qe()&&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=Ge(e),ur(),t&&"body"!==re(t)&&(ir.push(new WeakRef(t)),ir.length>20&&(ir=ir.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,Zn),W&&y&&y.insertAdjacentElement("afterend",o),()=>{h.off("openchange",n);const t=Ge(e),r=Ze(b,t)||T&&ot(T.nodesRef.current,x(),!1).some(e=>{var n;return Ze(null==(n=e.context)?void 0:n.elements.floating,t)}),i=function(){if("boolean"==typeof L.current){const e=y||cr();return e&&e.isConnected?e:o}return L.current.current||o}();queueMicrotask(()=>{const n=function(e){const t=dt();return Be(e,t)?e:ze(e,t)[0]||e}(i);L.current&&!$.current&&se(n)&&(n===t||t===e.body||r)&&n.focus({preventScroll:!0}),o.remove()})}},[r,b,H,L,g,h,T,W,y,x]),A.useEffect(()=>(queueMicrotask(()=>{$.current=!1}),()=>{queueMicrotask(ur)}),[r]),st(()=>{if(!r&&P)return P.setFocusManagerState({modal:l,closeOnFocusOut:f,open:m,onOpenChange:v,domReference:y}),()=>{P.setFocusManagerState(null)}},[r,P,l,m,v,f,y]),st(()=>{r||H&&sr(H,j)},[r,H,j]);const Y=!r&&C&&(!l||!R)&&(W||l);return(0,S.jsxs)(S.Fragment,{children:[Y&&(0,S.jsx)(Qn,{"data-type":"inside",ref:V,onFocus:e=>{if(l){const e=B();Hn("reference"===o[0]?e[0]:e[e.length-1])}else if(null!=P&&P.preserveTabOrder&&P.portalNode)if($.current=!1,ht(e,P.portalNode)){const e=mt(y);null==e||e.focus()}else{var t;null==(t=P.beforeOutsideRef.current)||t.focus()}}}),!R&&X("start"),n,X("end"),Y&&(0,S.jsx)(Qn,{"data-type":"inside",ref:q,onFocus:e=>{if(l)Hn(B()[0]);else if(null!=P&&P.preserveTabOrder&&P.portalNode)if(f&&($.current=!0),ht(e,P.portalNode)){const e=vt(y);null==e||e.focus()}else{var t;null==(t=P.afterOutsideRef.current)||t.focus()}}})]})}function fr(e){return se(e.target)&&"BUTTON"===e.target.tagName}function dr(e){return tt(e)}function pr(e){return null!=e&&null!=e.clientX}const mr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},vr={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hr=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 gr(){return Ue().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Ve()}function yr(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[xn]:t,[wn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[bn]:""},...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&&[xn,wn].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 br=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]),xr=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function wr(e,t){return"function"==typeof e?e(t):e}function Er(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,...Er(e,t.id,n)])}function Rr(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 Or(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:m}=e;return function(e){function v(){$n(o),d()}if($n(o),!f.domReference||!f.floating||null==a||null==n||null==l)return;const{clientX:h,clientY:g}=e,y=[h,g],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,w=zn(f.floating,b),E=zn(f.domReference,b),R=f.domReference.getBoundingClientRect(),O=f.floating.getBoundingClientRect(),C=a.split("-")[0],_=n>O.right-O.width/2,j=l>O.bottom-O.height/2,S=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,R),A=O.width>R.width,k=O.height>R.height,L=(A?R:O).left,T=(A?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&&ce(e.relatedTarget)&&zn(f.floating,e.relatedTarget))return;if(m&&Er(m.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 v();let D=[];switch(C){case"top":D=[[L,R.top+1],[L,O.bottom-1],[T,O.bottom-1],[T,R.top+1]];break;case"bottom":D=[[L,O.top+1],[L,R.bottom-1],[T,R.bottom-1],[T,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(!Rr([h,g],D)){if(i&&!S)return v();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 v()}Rr([h,g],function(e){let[n,r]=e;switch(C){case"top":return[[A?n+t/2:_?n+4*t:n-4*t,r+t+1],[A?n-t/2:_?n+4*t:n-4*t,r+t+1],[O.left,_||A?O.bottom-t:O.top],[O.right,_?A?O.bottom-t:O.top:O.bottom-t]];case"bottom":return[[A?n+t/2:_?n+4*t:n-4*t,r-t],[A?n-t/2:_?n+4*t:n-4*t,r-t],[O.left,_||A?O.top+t:O.bottom],[O.right,_?A?O.top+t:O.bottom:O.top+t]];case"left":{const e=[n+t+1,k?r+t/2:j?r+4*t:r-4*t],o=[n+t+1,k?r-t/2:j?r+4*t:r-4*t];return[[j||k?O.right-t:O.left,O.top],[j?k?O.right-t:O.left:O.right-t,O.bottom],e,o]}case"right":return[[n-t,k?r+t/2:j?r+4*t:r-4*t],[n-t,k?r-t/2:j?r+4*t:r-4*t],[j||k?O.left+t:O.right,O.top],[j?k?O.left+t:O.right:O.left+t,O.bottom]]}}([n,l]))?!i&&r&&(o.current=window.setTimeout(v,40)):v()}}};return l.__options={blockPointerEvents:n},l}const Cr=({children:e,enabled:t=!0,...n})=>{const r=Ln();return!t||r?e:(0,S.jsx)(Mn,{...n,children:e})},_r=l(j,({$width:e="max-content"})=>({$width:e}))``,jr=({children:e,enabled:t=!0,...n})=>t?(0,S.jsx)(nr,{...n,children:e}):e,Sr=(e,{enabled:t=!0,event:n="click",dismissOptions:r,clickOptions:o,hoverOptions:i,focusOptions:u,clientPointsOptions:c,roleOptions:s,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:c=!0,outsidePress:s=!0,outsidePressEvent:l="pointerdown",referencePress:a=!1,referencePressEvent:f="pointerdown",ancestorScroll:d=!1,bubbles:p,capture:m}=t,v=Tn(),h=ft("function"==typeof s?s:()=>!1),g="function"==typeof s?h:s,y=A.useRef(!1),{escapeKey:b,outsidePress:x}=hr(p),{escapeKey:w,outsidePress:E}=hr(m),R=A.useRef(!1),O=ft(e=>{var t;if(!n||!u||!c||"Escape"!==e.key)return;if(R.current)return;const o=null==(t=i.current.floatingContext)?void 0:t.nodeId,s=v?ot(v.nodesRef.current,o):[];if(!b&&(e.stopPropagation(),s.length>0)){let e=!0;if(s.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")}),C=ft(e=>{var t;const n=()=>{var t;O(e),null==(t=Qe(e))||t.removeEventListener("keydown",n)};null==(t=Qe(e))||t.addEventListener("keydown",n)}),_=ft(e=>{var t;const n=i.current.insideReactTree;i.current.insideReactTree=!1;const u=y.current;if(y.current=!1,"click"===l&&u)return;if(n)return;if("function"==typeof g&&!g(e))return;const c=Qe(e),s="["+Dn("inert")+"]",a=et(o.floating).querySelectorAll(s);let f=ce(c)?c:null;for(;f&&!be(f);){const e=Ee(f);if(be(e)||!ce(e))break;f=e}if(a.length&&ce(c)&&!c.matches("html,body")&&!Ze(c,o.floating)&&Array.from(a).every(e=>!Ze(f,e)))return;if(se(c)&&k){const t=be(c),n=xe(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=v&&ot(v.nodesRef.current,d).some(t=>{var n;return Je(e,null==(n=t.context)?void 0:n.elements.floating)});if(Je(e,o.floating)||Je(e,o.domReference)||p)return;const m=v?ot(v.nodesRef.current,d):[];if(m.length>0){let e=!0;if(m.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=ft(e=>{var t;const n=()=>{var t;_(e),null==(t=Qe(e))||t.removeEventListener(l,n)};null==(t=Qe(e))||t.addEventListener(l,n)});A.useEffect(()=>{if(!n||!u)return;i.current.__escapeKeyBubbles=b,i.current.__outsidePressBubbles=x;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function s(){window.clearTimeout(e),R.current=!0}function a(){e=window.setTimeout(()=>{R.current=!1},ye()?5:0)}const f=et(o.floating);c&&(f.addEventListener("keydown",w?C:O,w),f.addEventListener("compositionstart",s),f.addEventListener("compositionend",a)),g&&f.addEventListener(l,E?j:_,E);let p=[];return d&&(ce(o.domReference)&&(p=Oe(o.domReference)),ce(o.floating)&&(p=p.concat(Oe(o.floating))),!ce(o.reference)&&o.reference&&o.reference.contextElement&&(p=p.concat(Oe(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,{passive:!0})}),()=>{c&&(f.removeEventListener("keydown",w?C:O,w),f.removeEventListener("compositionstart",s),f.removeEventListener("compositionend",a)),g&&f.removeEventListener(l,E?j:_,E),p.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[i,o,c,g,l,n,r,d,u,b,x,O,w,C,_,E,j]),A.useEffect(()=>{i.current.insideReactTree=!1},[i,g,l]);const S=A.useMemo(()=>({onKeyDown:O,...a&&{[mr[f]]:e=>{r(!1,e.nativeEvent,"reference-press")},..."click"!==f&&{onClick(e){r(!1,e.nativeEvent,"reference-press")}}}}),[O,r,a,f]),k=A.useMemo(()=>{function e(e){0===e.button&&(y.current=!0)}return{onKeyDown:O,onMouseDown:e,onMouseUp:e,[vr[l]]:()=>{i.current.insideReactTree=!0}}},[O,l,i]);return A.useMemo(()=>u?{reference:S,floating:k}:{},[u,S,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:c="click",toggle:s=!0,ignoreMouse:l=!1,keyboardHandlers:a=!0,stickIfOpen:f=!0}=t,d=A.useRef(),p=A.useRef(!1),m=A.useMemo(()=>({onPointerDown(e){d.current=e.pointerType},onMouseDown(e){const t=d.current;0===e.button&&"click"!==c&&(ct(t,!0)&&l||(!n||!s||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"===c&&d.current?d.current=void 0:ct(t,!0)&&l||(!n||!s||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||fr(e)||(" "!==e.key||dr(i)||(e.preventDefault(),p.current=!0),function(e){return se(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&r(!n||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!a||fr(e)||dr(i)||" "===e.key&&p.current&&(p.current=!1,r(!n||!s,e.nativeEvent,"click"))}}),[o,i,c,l,a,r,n,f,s]);return A.useMemo(()=>u?{reference:m}:{},[u,m])}(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:c=!0,delay:s=0,handleClose:l=null,mouseOnly:a=!1,restMs:f=0,move:d=!0}=t,p=Tn(),m=Ln(),v=lt(l),h=lt(s),g=lt(n),y=lt(f),b=A.useRef(),x=A.useRef(-1),w=A.useRef(),E=A.useRef(-1),R=A.useRef(!0),O=A.useRef(!1),C=A.useRef(()=>{}),_=A.useRef(!1),j=ft(()=>{var e;const t=null==(e=o.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});A.useEffect(()=>{if(c)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{open:t}=e;t||($n(x),$n(E),R.current=!0,_.current=!1)}},[c,i]),A.useEffect(()=>{if(!c)return;if(!v.current)return;if(!n)return;function e(e){j()&&r(!1,e,"hover")}const t=et(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,r,c,v,j]);const S=A.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const o=Nn(h.current,"close",b.current);o&&!w.current?($n(x),x.current=window.setTimeout(()=>r(!1,e,n),o)):t&&($n(x),r(!1,e,n))},[h,r]),k=ft(()=>{C.current(),w.current=void 0}),L=ft(()=>{if(O.current){const e=et(u.floating).body;e.style.pointerEvents="",e.removeAttribute(In),O.current=!1}}),T=ft(()=>!!o.current.openEvent&&["click","mousedown"].includes(o.current.openEvent.type));A.useEffect(()=>{if(c&&ce(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",s),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",s),o.removeEventListener("mouseleave",l))}}function e(e){if($n(x),R.current=!1,a&&!ct(b.current)||Fn(y.current)>0&&!Nn(h.current,"open"))return;const t=Nn(h.current,"open",b.current);t?x.current=window.setTimeout(()=>{g.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function t(e){if(T())return void L();C.current();const t=et(u.floating);if($n(E),_.current=!1,v.current&&o.current.floatingContext){n||$n(x),w.current=v.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||S(e,!0,"safe-polygon")}});const r=w.current;return t.addEventListener("mousemove",r),void(C.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!Ze(u.floating,e.relatedTarget))&&S(e)}function i(e){T()||o.current.floatingContext&&(null==v.current||v.current({...o.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){L(),k(),T()||S(e)}})(e))}function s(){$n(x)}function l(e){T()||S(e,!1)}},[u,c,e,a,d,S,k,L,r,n,g,p,h,v,o,T,y]),st(()=>{var e;if(c&&n&&null!=(e=v.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&j()){O.current=!0;const e=u.floating;if(ce(u.domReference)&&e){var t;const n=et(u.floating).body;n.setAttribute(In,"");const r=u.domReference,o=null==p||null==(t=p.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=""}}}},[c,n,m,u,p,v,j]),st(()=>{n||(b.current=void 0,_.current=!1,k(),L())},[n,k,L]),A.useEffect(()=>()=>{k(),$n(x),$n(E),L()},[c,u.domReference,k,L]);const P=A.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function o(){R.current||g.current||r(!0,t,"hover")}a&&!ct(b.current)||n||0===Fn(y.current)||_.current&&e.movementX**2+e.movementY**2<2||($n(E),"touch"===b.current?o():(_.current=!0,E.current=window.setTimeout(o,Fn(y.current))))}}},[a,r,n,g,y]);return A.useMemo(()=>c?{reference:P}:{},[c,P])}(e,{restMs:150,enabled:t&&"hover"===n,handleClose:Or(),...i}),p=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:u}=e,{enabled:c=!0,visibleOnly:s=!0}=t,l=A.useRef(!1),a=A.useRef(-1),f=A.useRef(!0);A.useEffect(()=>{if(!c)return;const e=oe(u.domReference);function t(){!n&&se(u.domReference)&&u.domReference===Ge(et(u.domReference))&&(l.current=!0)}function r(){f.current=!0}function o(){f.current=!1}return e.addEventListener("blur",t),gr()&&(e.addEventListener("keydown",r,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),gr()&&(e.removeEventListener("keydown",r,!0),e.removeEventListener("pointerdown",o,!0))}},[u.domReference,n,c]),A.useEffect(()=>{if(c)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,c]),A.useEffect(()=>()=>{$n(a)},[]);const d=A.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;const t=Qe(e.nativeEvent);if(s&&ce(t))if(gr()&&!e.relatedTarget){if(!f.current&&!tt(t))return}else if(!function(e){if(!e||Xe())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=ce(t)&&t.hasAttribute(Dn("focus-guard"))&&"outside"===t.getAttribute("data-type");a.current=window.setTimeout(()=>{var e;const c=Ge(u.domReference?u.domReference.ownerDocument:document);(t||c!==u.domReference)&&(Ze(null==(e=i.current.floatingContext)?void 0:e.refs.floating.current,c)||Ze(u.domReference,c)||o||r(!1,n,"focus"))})}}),[i,u.domReference,r,s]);return A.useMemo(()=>c?{reference:d}:{},[c,d])}(e,{enabled:t&&"focus"===n,...u}),m=function(e,t){void 0===t&&(t={});const{open:n,dataRef:r,elements:{floating:o,domReference:i},refs:u}=e,{enabled:c=!0,axis:s="both",x:l=null,y:a=null}=t,f=A.useRef(!1),d=A.useRef(null),[p,m]=A.useState(),[v,h]=A.useState([]),g=ft((e,t)=>{f.current||r.current.openEvent&&!pr(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},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:s,dataRef:r,pointerType:p}))}),y=ft(e=>{null==l&&null==a&&(n?d.current||h([]):g(e.clientX,e.clientY))}),b=ct(p)?o:n,x=A.useCallback(()=>{if(!b||!c||null!=l||null!=a)return;const e=oe(o);function t(n){const r=Qe(n);Ze(o,r)?(e.removeEventListener("mousemove",t),d.current=null):g(n.clientX,n.clientY)}if(!r.current.openEvent||pr(r.current.openEvent)){e.addEventListener("mousemove",t);const n=()=>{e.removeEventListener("mousemove",t),d.current=null};return d.current=n,n}u.setPositionReference(i)},[b,c,l,a,o,r,u,i,g]);A.useEffect(()=>x(),[x,v]),A.useEffect(()=>{c&&!o&&(f.current=!1)},[c,o]),A.useEffect(()=>{!c&&n&&(f.current=!0)},[c,n]),st(()=>{!c||null==l&&null==a||(f.current=!1,g(l,a))},[c,l,a,g]);const w=A.useMemo(()=>{function e(e){let{pointerType:t}=e;m(t)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:y,onMouseEnter:y}},[y]);return A.useMemo(()=>c?{reference:w}:{},[c,w])}(e,{enabled:t&&"point"===n,...c}),v=function(e,t){var n,r;void 0===t&&(t={});const{open:o,elements:i,floatingId:u}=e,{enabled:c=!0,role:s="dialog"}=t,l=_n(),a=(null==(n=i.domReference)?void 0:n.id)||l,f=A.useMemo(()=>{var e;return(null==(e=rt(i.floating))?void 0:e.id)||u},[i.floating,u]),d=null!=(r=br.get(s))?r:s,p=null!=Ln(),m=A.useMemo(()=>"tooltip"===d||"label"===s?{["aria-"+("label"===s?"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"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[d,f,p,o,a,s]),v=A.useMemo(()=>{const e={id:f,...d&&{role:d}};return"tooltip"===d||"label"===s?e:{...e,..."menu"===d&&{"aria-labelledby":a}}},[d,f,a,s]),h=A.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:f+"-fui-option"}};switch(s){case"select":case"combobox":return{...r,"aria-selected":n}}return{}},[f,s]);return A.useMemo(()=>c?{reference:m,floating:v,item:h}:{},[c,m,v,h])}(e,s);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=A.useCallback(t=>yr(t,e,"reference"),t),i=A.useCallback(t=>yr(t,e,"floating"),n),u=A.useCallback(t=>yr(t,e,"item"),r);return A.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}([a,f,d,p,m,v,...l])},Ar=({enabled:e=!0,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s,open:l,floatingOptions:a,useOffset:f=!0,offsetOptions:d,useFlip:p=!0,flipOptions:m,useShift:h=!0,shiftOptions:g,useArrow:y=!1,arrowOptions:b,transitionOptions:x,useAutoPlacement:w=!1,autoPlacementOptions:E,useAutoUpdate:R=!1,autoUpdateOptions:O,useAutoSize:C=!1,sizeOptions:_,minAcceptableWidth:j=null,minAcceptableHeight:S=null,maxAcceptableWidth:k,maxAcceptableHeight:L,onOpen:T,onClose:P})=>{const{theme:M}=Z(),D=function(){const e=_n(),t=Tn(),n=Ln();return st(()=>{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,A.useState)(!1),N=(0,A.useRef)(null),F=e&&(l??$);(0,A.useEffect)(()=>{F&&T?.()},[F]),((e,t)=>{const n=(0,A.useRef)(e);(0,A.useEffect)(()=>{if(n.current!==e)return n.current=e,t(e)},[e])})(e,e=>{e||I(!1)});const W=[];f&&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=kt(n),c=Lt(n),s="y"===Mt(n),l=qt.has(u)?-1:1,a=i&&s?-1:1,f=At(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return c&&"number"==typeof m&&(p="end"===c?-1*m:m),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]}})(d??M.spacings.base));let H=null;if(w?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=wt,autoAlignment:p=!0,...m}=At(e,t),v=void 0!==f||d===wt?function(e,t,n){return(e?[...n.filter(t=>Lt(t)===e),...n.filter(t=>Lt(t)!==e)]:n.filter(e=>kt(e)===e)).filter(n=>!e||Lt(n)===e||!!t&&It(n)!==n)}(f||null,p,d):d,h=await s.detectOverflow(t,m),g=(null==(n=u.autoPlacement)?void 0:n.index)||0,y=v[g];if(null==y)return{};const b=$t(y,i,await(null==s.isRTL?void 0:s.isRTL(l.floating)));if(c!==y)return{reset:{placement:v[0]}};const x=[h[kt(y)],h[b[0]],h[b[1]]],w=[...(null==(r=u.autoPlacement)?void 0:r.overflows)||[],{placement:y,overflows:x}],E=v[g+1];if(E)return{data:{index:g+1,overflows:w},reset:{placement:E}};const R=w.map(e=>{const t=Lt(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,Lt(e[0])?2:3).every(e=>e<=0)),C=(null==(o=O[0])?void 0:o[0])||R[0][0];return C!==c?{data:{index:g+1,overflows:w},reset:{placement:C}}:{}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})(E)):p&&(H=(e=>{const t=fn(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({crossAxis:!1,fallbackStrategy:"bestFit",...m})),C){const e=(e=>{const t=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:u,elements:c}=t,{apply:s=()=>{},...l}=At(e,t),a=await u.detectOverflow(t,l),f=kt(o),d=Lt(o),p="y"===Mt(o),{width:m,height:v}=i.floating;let h,g;"top"===f||"bottom"===f?(h=f,g=d===(await(null==u.isRTL?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(g=f,h="end"===d?"top":"bottom");const y=v-a.top-a.bottom,b=m-a.left-a.right,x=Et(v-a[h],y),w=Et(m-a[g],b),E=!t.middlewareData.shift;let R=x,O=w;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(O=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(R=y),E&&!d){const e=Rt(a.left,0),t=Rt(a.right,0),n=Rt(a.top,0),r=Rt(a.bottom,0);p?O=m-2*(0!==e||0!==t?e+t:Rt(a.left,a.right)):R=v-2*(0!==n||0!==r?n+r:Rt(a.top,a.bottom))}await s({...t,availableWidth:O,availableHeight:R});const C=await u.getDimensions(c.floating);return m!==C.width||v!==C.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=v(j)?j(t.reference):j??t.reference.width,i=v(k)?k(t.reference):Math.min(n,k??1/0),u=v(S)?S(t.reference):S??0,c=v(L)?L(t.reference):Math.min(r,L??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`})}});H?"initialPlacement"===m?.fallbackStrategy?W.push(e,H):W.push(H,e):W.push(e)}else H&&W.push(H);h&&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}=At(e,t),a={x:n,y:r},f=await i.detectOverflow(t,l),d=Mt(kt(o)),p=Tt(d);let m=a[p],v=a[d];if(u){const e="y"===p?"bottom":"right";m=St(m+f["y"===p?"top":"left"],m,m-f[e])}if(c){const e="y"===d?"bottom":"right";v=St(v+f["y"===d?"top":"left"],v,v-f[e])}const h=s.fn({...t,[p]:m,[d]:v});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[p]:u,[d]:c}}}}}}(e);return{name:t.name,fn:t.fn,options:[e,void 0]}})({padding:M.spacings.base,...g})),y&&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?dn({element:n.current,padding:r}).fn(t):{}:n?dn({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,...b}));const z=function(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=_n(),i=A.useRef({}),[u]=A.useState(()=>Sn()),c=null!=Ln(),[s,l]=A.useState(r.reference),a=ft((e,t,r)=>{i.current.openEvent=e?t:void 0,u.emit("openchange",{open:e,event:t,reason:r,nested:c}),null==n||n(e,t,r)}),f=A.useMemo(()=>({setPositionReference:l}),[]),d=A.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return A.useMemo(()=>({dataRef:i,open:t,onOpenChange:a,elements:d,events:u,floatingId:o,refs:f}),[t,a,d,u,o,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,u]=A.useState(null),[c,s]=A.useState(null),l=(null==o?void 0:o.domReference)||i,a=A.useRef(null),f=Tn();st(()=>{l&&(a.current=l)},[l]);const d=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:u}={},transform:c=!0,whileElementsMounted:s,open:l}=e,[a,f]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=A.useState(r);vn(d,r)||p(r);const[m,v]=A.useState(null),[h,g]=A.useState(null),y=A.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),b=A.useCallback(e=>{e!==R.current&&(R.current=e,g(e))},[]),x=i||m,w=u||h,E=A.useRef(null),R=A.useRef(null),O=A.useRef(a),C=null!=s,_=yn(s),j=yn(o),S=yn(l),k=A.useCallback(()=>{if(!E.current||!R.current)return;const e={placement:t,strategy:n,middleware:d};j.current&&(e.platform=j.current),pn(E.current,R.current,e).then(e=>{const t={...e,isPositioned:!1!==S.current};L.current&&!vn(O.current,t)&&(O.current=t,bt.flushSync(()=>{f(t)}))})},[d,t,n,j,S]);mn(()=>{!1===l&&O.current.isPositioned&&(O.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[l]);const L=A.useRef(!1);mn(()=>(L.current=!0,()=>{L.current=!1}),[]),mn(()=>{if(x&&(E.current=x),w&&(R.current=w),x&&w){if(_.current)return _.current(x,w,k);k()}},[x,w,k,_,C]);const T=A.useMemo(()=>({reference:E,floating:R,setReference:y,setFloating:b}),[y,b]),P=A.useMemo(()=>({reference:x,floating:w}),[x,w]),M=A.useMemo(()=>{const e={position:n,left:0,top:0};if(!P.floating)return e;const t=gn(P.floating,a.x),r=gn(P.floating,a.y);return c?{...e,transform:"translate("+t+"px, "+r+"px)",...hn(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,c,P.floating,a.x,a.y]);return A.useMemo(()=>({...a,update:k,refs:T,elements:P,floatingStyles:M}),[a,k,T,P,M])}({...e,elements:{...o,...c&&{reference:c}}}),p=A.useCallback(e=>{const t=ce(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),d.refs.setReference(t)},[d.refs]),m=A.useCallback(e=>{(ce(e)||null===e)&&(a.current=e,u(e)),(ce(d.refs.reference.current)||null===d.refs.reference.current||null!==e&&!ce(e))&&d.refs.setReference(e)},[d.refs]),v=A.useMemo(()=>({...d.refs,setReference:m,setPositionReference:p,domReference:a}),[d.refs,m,p]),h=A.useMemo(()=>({...d.elements,domReference:l}),[d.elements,l]),g=A.useMemo(()=>({...d,...r,refs:v,elements:h,nodeId:t}),[d,v,h,t,r]);return st(()=>{r.dataRef.current.floatingContext=g;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=g)}),A.useMemo(()=>({...d,context:g,refs:v,elements:h}),[d,v,h,g])}({nodeId:D,open:F,middleware:W,onOpenChange:(e,t,n)=>{I(e),e||P?.(n,t)},...R&&{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=Yt(e),a=o||i?[...l?Oe(l):[],...t?Oe(t):[]]:[];a.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const f=l&&c?function(e,t){let n,r=null;const o=ie(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function u(c,s){void 0===c&&(c=!1),void 0===s&&(s=1),i();const l=e.getBoundingClientRect(),{left:a,top:f,width:d,height:p}=l;if(c||t(),!d||!p)return;const m={rootMargin:-Ct(f)+"px "+-Ct(o.clientWidth-(a+d))+"px "+-Ct(o.clientHeight-(f+p))+"px "+-Ct(a)+"px",threshold:Rt(0,Et(1,s))||1};let v=!0;function h(t){const r=t[0].intersectionRatio;if(r!==s){if(!v)return u();r?u(!1,r):n=setTimeout(()=>{u(!1,1e-7)},1e3)}1!==r||an(l,e.getBoundingClientRect())||u(),v=!1}try{r=new IntersectionObserver(h,{...m,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(h,m)}r.observe(e)}(!0),i}(l,n):null;let d,p=-1,m=null;u&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),n()}),l&&!s&&m.observe(l),t&&m.observe(t));let v=s?Jt(e):null;return s&&function t(){const r=Jt(e);v&&!an(v,r)&&n(),v=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=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(d)}}(e,t,n,O)},...a}),B=Sr(z.context,{enabled:e,event:t,dismissOptions:n,clickOptions:r,hoverOptions:o,focusOptions:i,clientPointsOptions:u,roleOptions:c,extraInteractions:s}),U=function(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:o,common:i,duration:u=250}=t,c=e.placement,s=c.split("-")[0],l=A.useMemo(()=>({side:s,placement:c}),[s,c]),a="number"==typeof u,f=(a?u:u.open)||0,d=(a?u:u.close)||0,[p,m]=A.useState(()=>({...wr(i,l),...wr(n,l)})),{isMounted:v,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,c]=A.useState("unmounted"),s=function(e,t){const[n,r]=A.useState(e);return e&&!n&&r(!0),A.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,i);return s||"close"!==u||c("unmounted"),st(()=>{if(r){if(n){c("initial");const e=requestAnimationFrame(()=>{bt.flushSync(()=>{c("open")})});return()=>{cancelAnimationFrame(e)}}c("close")}},[n,r]),{isMounted:s,status:u}}(e,{duration:u}),g=lt(n),y=lt(r),b=lt(o),x=lt(i);return st(()=>{const e=wr(g.current,l),t=wr(b.current,l),n=wr(x.current,l),r=wr(y.current,l)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===h&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===h&&m({transitionProperty:Object.keys(r).map(xr).join(","),transitionDuration:f+"ms",...n,...r}),"close"===h){const r=t||e;m({transitionProperty:Object.keys(r).map(xr).join(","),transitionDuration:d+"ms",...n,...r})}},[d,b,g,y,x,f,h,l]),{isMounted:v,styles:p}}(z.context,{duration:250,...x});return{nodeId:D,isOpen:F,floating:z,arrowRef:N,interactions:B,transition:U}},kr=()=>{const e=(0,A.useContext)(te);return m(e,"[@react-hive/honey-layout]: The `useHoneyPopupContext()` hook can only be used inside <HoneyPopup/> component."),e},Lr=({children:e,referenceProps:t,content:n,contentProps:r,focusManagerProps:o,arrowProps:i,portalProps:u,adjustStyles:c,context:s,...l})=>{const{useArrow:a,onClose:f}=l,d=K(f),{nodeId:p,floating:m,isOpen:v,arrowRef:g,interactions:y,transition:b}=Ar(l),x=(0,A.useCallback)(()=>{d.current?.("escape-key")},[]),w=(0,A.useMemo)(()=>({context:s,floatingContext:m.context}),[s,m.context]);return(0,S.jsx)(_r,{ref:m.refs.setReference,...y.getReferenceProps({onClick:e=>e.stopPropagation()}),...t,"data-testid":"honey-popup",children:(0,S.jsxs)(te,{value:w,children:[h(e,w),(0,S.jsx)(Pn,{id:p,children:b.isMounted&&(0,S.jsx)(jr,{...u,children:(0,S.jsx)(ar,{context:m.context,disabled:!v,...o,children:(0,S.jsxs)(ee,{ref:m.refs.setFloating,active:v,style:c?.({...m.floatingStyles,...b.styles},{middlewareData:m.middlewareData})??{...m.floatingStyles,...b.styles},onDeactivate:x,...y.getFloatingProps(),...r,"data-testid":"honey-popup-floating-content",children:[a&&(0,S.jsx)(jn,{ref:g,context:m.context,fill:"white",...i}),h(n,w)]})})})})]})})},Tr=({useTree:e=!1,...t})=>(0,S.jsx)(Cr,{enabled:e,children:(0,S.jsx)(Lr,{...t})}),Pr=l(j,{row:!0,centerY:!0})`
37
37
  cursor: pointer;
38
- `,Mr=({option:e,renderOption:t,...n})=>{const{context:r,floatingContext:o}=kr(),i=v(e.disabled)?e.disabled({context:r,floatingContext:o}):!0===e.disabled;return(0,j.jsx)(Pr,{onClick:()=>{i||e.onClick?.({context:r,floatingContext:o})},role:"menuitem","aria-disabled":i,"data-testid":"honey-context-menu-option",...n,children:t?.(e)??e.label})},Dr=({options:e,renderOption:t,optionProps:n,popupProps:r,...o})=>{const{floatingOptions:i}=r??{},{context:u,floatingContext:c}=kr(),s=(0,A.useMemo)(()=>e?.filter(e=>v(e.visible)?e.visible({context:u,floatingContext:c}):!1!==e.visible),[e]);return(0,j.jsx)(W,{items:s,itemKey:"id","data-testid":"honey-context-menu-options",...o,children:e=>e.options?.length?(0,j.jsx)(Tr,{context:u,content:(0,j.jsx)(Dr,{options:e.options,renderOption:t,optionProps:n,popupProps:r,...o}),event:"hover",referenceProps:{$width:"100%"},floatingOptions:{placement:"right-start",...i},useArrow:!0,"data-testid":"honey-sub-context-menu",...r,children:(0,j.jsx)(Mr,{option:e,renderOption:t,...n})}):(0,j.jsx)(Mr,{option:e,renderOption:t,...n})})},$r=({options:e,renderOption:t,optionProps:n,roleOptions:r,optionsProps:o,context:i,...u})=>(0,j.jsx)(Tr,{context:i,content:(0,j.jsx)(Dr,{options:e,renderOption:t,optionProps:n,popupProps:u,...o}),roleOptions:{role:"menu",...r},useArrow:!0,"data-testid":"honey-context-menu",...u}),Ir=(0,A.createContext)(void 0),Nr=()=>{const e=(0,A.useContext)(Ir);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component."),e},Fr=({children:e})=>{const t=(0,A.useContext)(Ir),[n,r]=(0,A.useState)([]),o=(0,A.useMemo)(()=>({layers:n,registerLayer:e=>{const t=g();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,j.jsx)(Ir,{value:o,children:e})},Wr=({children:e,theme:t,mediaQueryOptions:r,...o})=>{const i=Y(t,r),{overlays:u,registerOverlay:c,unregisterOverlay:s}=(()=>{const[e,t]=(0,A.useState)([]);(0,A.useEffect)(()=>{const t=t=>{e.length&&e[e.length-1].notifyListeners("keyup",t.code,t)};return document.addEventListener("keyup",t),()=>{document.removeEventListener("keyup",t)}},[e]);const n=(0,A.useCallback)(e=>{const n=e.id??g(),r=[["keyup",e.onKeyUp]],o={current:null},i={containerRef:o,id:n,setContainerRef:e=>{o.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:(t,n,o)=>{const u=e.listenKeys??[];u.length&&!u.includes(n)||(o.preventDefault(),r.forEach(([e,r])=>{e===t&&r(n,i,o)}))}};return t(e=>[...e,i]),i},[]),r=(0,A.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]);return{overlays:e,registerOverlay:n,unregisterOverlay:r}})(),l=(0,A.useMemo)(()=>({theme:t,screenState:i,overlays:u,registerOverlay:c,unregisterOverlay:s}),[t,i,u]);return(0,j.jsx)(n,{theme:t,...o,children:(0,j.jsx)(G,{value:l,children:e})})};var Hr=d(117),zr=d.n(Hr);const Br=({theme:e,...t})=>{const r=(0,A.useContext)(G),o=(0,A.useMemo)(()=>zr()(r?.theme,e),[r?.theme,e]);return(0,j.jsx)(n,{theme:o,...t})},Ur=({durationMs:e,timingFunction:t="ease-in-out",extraProperties:n=[],activeClassName:o})=>({active:i=!1})=>r`
38
+ `,Mr=({option:e,renderOption:t,...n})=>{const{context:r,floatingContext:o}=kr(),i=v(e.disabled)?e.disabled({context:r,floatingContext:o}):!0===e.disabled;return(0,S.jsx)(Pr,{onClick:()=>{i||e.onClick?.({context:r,floatingContext:o})},role:"menuitem","aria-disabled":i,"data-testid":"honey-context-menu-option",...n,children:t?.({option:e,context:r,isDisabled:i})??e.label})},Dr=({options:e,renderOption:t,optionProps:n,popupProps:r,...o})=>{const{floatingOptions:i}=r??{},{context:u,floatingContext:c}=kr(),s=(0,A.useMemo)(()=>e?.filter(e=>v(e.visible)?e.visible({context:u,floatingContext:c}):!1!==e.visible),[e]);return(0,S.jsx)(W,{items:s,itemKey:"id","data-testid":"honey-context-menu-options",...o,children:e=>e.options?.length?(0,S.jsx)(Tr,{context:u,content:(0,S.jsx)(Dr,{options:e.options,renderOption:t,optionProps:n,popupProps:r,...o}),event:"hover",referenceProps:{$width:"100%"},floatingOptions:{placement:"right-start",...i},useArrow:!0,"data-testid":"honey-sub-context-menu",...r,children:(0,S.jsx)(Mr,{option:e,renderOption:t,...n})}):(0,S.jsx)(Mr,{option:e,renderOption:t,...n})})},$r=({options:e,renderOption:t,optionProps:n,roleOptions:r,optionsProps:o,context:i,...u})=>(0,S.jsx)(Tr,{context:i,content:(0,S.jsx)(Dr,{options:e,renderOption:t,optionProps:n,popupProps:u,...o}),roleOptions:{role:"menu",...r},useArrow:!0,"data-testid":"honey-context-menu",...u}),Ir=(0,A.createContext)(void 0),Nr=()=>{const e=(0,A.useContext)(Ir);return m(e,"[@react-hive/honey-layout]: The `useHoneyLayerRegistryContext()` hook can only be used inside <HoneyLayerRegistry/> component."),e},Fr=({children:e})=>{const t=(0,A.useContext)(Ir),[n,r]=(0,A.useState)([]),o=(0,A.useMemo)(()=>({layers:n,registerLayer:e=>{const t=g();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,S.jsx)(Ir,{value:o,children:e})},Wr=({children:e,theme:t,mediaQueryOptions:r,...o})=>{const i=Y(t,r),{overlays:u,registerOverlay:c,unregisterOverlay:s}=(()=>{const e=(0,A.useRef)([]);(0,A.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 t=(0,A.useCallback)(t=>{const n=t.id??g(),r=[["keyup",t.onKeyUp]],o={current:null},i={containerRef:o,id:n,setContainerRef:e=>{o.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 u=t.listenKeys??[];u.length&&!u.includes(n)||(o.preventDefault(),r.forEach(([t,r])=>{t===e&&r(n,i,o)}))}};return e.current=[...e.current,i],i},[]),n=(0,A.useCallback)(t=>{e.current=e.current.filter(e=>e.id!==t)},[]);return{overlays:e.current,registerOverlay:t,unregisterOverlay:n}})(),l=(0,A.useMemo)(()=>({theme:t,screenState:i,overlays:u,registerOverlay:c,unregisterOverlay:s}),[t,i,u]);return(0,S.jsx)(n,{theme:t,...o,children:(0,S.jsx)(G,{value:l,children:e})})};var Hr=d(117),zr=d.n(Hr);const Br=({theme:e,...t})=>{const r=(0,A.useContext)(G),o=(0,A.useMemo)(()=>zr()(r?.theme,e),[r?.theme,e]);return(0,S.jsx)(n,{theme:o,...t})},Ur=({durationMs:e,timingFunction:t="ease-in-out",extraProperties:n=[],activeClassName:o})=>({active:i=!1})=>r`
39
39
  opacity: ${i?1:0};
40
40
  visibility: ${i?"visible":"hidden"};
41
41
 
@@ -49,5 +49,5 @@ import*as e from"react";import{HONEY_BREAKPOINTS as t,HoneyStyleProvider as n,cs
49
49
  visibility: visible;
50
50
  }
51
51
  `}
52
- `,Kr=s,Vr="$";export{Vr as HONEY_LAYOUT_CSS_PROPERTY_PREFIX,O as HoneyBox,$r as HoneyContextMenu,Pr as HoneyContextMenuContentOptionStyled,_ as HoneyFlex,M as HoneyGrid,$ as HoneyGridColumn,T as HoneyGridColumnStyled,Fr as HoneyLayerRegistry,Wr as HoneyLayoutProvider,Br as HoneyLayoutThemeOverride,H as HoneyLazyContent,W as HoneyList,ee as HoneyOverlay,Tr as HoneyPopup,te as HoneyPopupContext,N as HoneyStatusContent,p as __DEV__,w as applyBreakpointStyles,x as createStyles,I as getHoneyListItemId,Ur as honeyVisibilityTransitionEffect,y as mergeRefs,E as resolveScreenState,Kr as resolveSpacing,D as useHoneyGridContext,Nr as useHoneyLayerRegistryContext,Z as useHoneyLayout,Y as useHoneyMediaQuery,J as useHoneyOverlay,Ar as useHoneyPopup,kr as useHoneyPopupContext,Q as useRegisterHoneyOverlay,S as warnOnce};
52
+ `,Kr=s,Vr="$";export{Vr as HONEY_LAYOUT_CSS_PROPERTY_PREFIX,O as HoneyBox,$r as HoneyContextMenu,Pr as HoneyContextMenuContentOptionStyled,j as HoneyFlex,M as HoneyGrid,$ as HoneyGridColumn,T as HoneyGridColumnStyled,Fr as HoneyLayerRegistry,Wr as HoneyLayoutProvider,Br as HoneyLayoutThemeOverride,H as HoneyLazyContent,W as HoneyList,ee as HoneyOverlay,Tr as HoneyPopup,te as HoneyPopupContext,N as HoneyStatusContent,p as __DEV__,w as applyBreakpointStyles,x as createStyles,I as getHoneyListItemId,Ur as honeyVisibilityTransitionEffect,y as mergeRefs,E as resolveScreenState,Kr as resolveSpacing,D as useHoneyGridContext,Nr as useHoneyLayerRegistryContext,Z as useHoneyLayout,Y as useHoneyMediaQuery,J as useHoneyOverlay,Ar as useHoneyPopup,kr as useHoneyPopupContext,Q as useRegisterHoneyOverlay,_ as warnOnce};
53
53
  //# sourceMappingURL=index.mjs.map