UNPKG

@clerk/clerk-js

Version:
1 lines 113 kB
(globalThis.webpackChunk_clerk_clerk_js=globalThis.webpackChunk_clerk_clerk_js||[]).push([["200"],{5582:function(e,t,n){"use strict";n.d(t,{F4:()=>i,iv:()=>o}),n(9144),n(4191);var r=n(7021);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.O)(t)}n(1025),n(3772);var i=function(){var e=o.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},1720:function(e,t,n){"use strict";function r(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,r,o="";if("string"==typeof t||"number"==typeof t)o+=t;else if("object"==typeof t)if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=e(t[n]))&&(o&&(o+=" "),o+=r);else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}(e))&&(r&&(r+=" "),r+=t);return r}n.d(t,{W:()=>r})},472:function(e,t,n){"use strict";var r=n(5683),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,i,l,u,a,s,c,f,d=!1;t||(t={}),l=t.debug||!1;try{if(a=r(),s=document.createRange(),c=document.getSelection(),(f=document.createElement("span")).textContent=e,f.ariaHidden="true",f.style.all="unset",f.style.position="fixed",f.style.top=0,f.style.clip="rect(0, 0, 0, 0)",f.style.whiteSpace="pre",f.style.webkitUserSelect="text",f.style.MozUserSelect="text",f.style.msUserSelect="text",f.style.userSelect="text",f.addEventListener("copy",function(n){if(n.stopPropagation(),t.format)if(n.preventDefault(),void 0===n.clipboardData){l&&console.warn("unable to use e.clipboardData"),l&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var r=o[t.format]||o.default;window.clipboardData.setData(r,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e);t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(f),s.selectNodeContents(f),c.addRange(s),!document.execCommand("copy"))throw Error("copy command was unsuccessful");d=!0}catch(r){l&&console.error("unable to copy using execCommand: ",r),l&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),d=!0}catch(r){l&&console.error("unable to copy using clipboardData: ",r),l&&console.error("falling back to prompt"),n="message"in t?t.message:"Copy to clipboard: #{key}, Enter",i=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C",u=n.replace(/#{\s*key\s*}/g,i),window.prompt(u,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(s):c.removeAllRanges()),f&&document.body.removeChild(f),a()}return d}},7383:function(e,t,n){var r;e.exports=r||function(e,t){if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n.g&&n.g.crypto&&(r=n.g.crypto),!r)try{r=n(9532)}catch(e){}var r,o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),l={},u=l.lib={},a=u.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=u.WordArray=a.extend({init:function(e,n){e=this.words=e||[],t!=n?this.sigBytes=n:this.sigBytes=4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var l=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=l<<24-(r+i)%4*8}else for(var u=0;u<o;u+=4)t[r+u>>>2]=n[u>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=0xffffffff<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(o());return new s.init(t,e)}}),c=l.enc={},f=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new s.init(n,t/2)}},d=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new s.init(n,t)}},h=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=u.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=h.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,l=this.blockSize,u=i/(4*l),a=(u=t?e.ceil(u):e.max((0|u)-this._minBufferSize,0))*l,c=e.min(4*a,i);if(a){for(var f=0;f<a;f+=l)this._doProcessBlock(o,f);n=o.splice(0,a),r.sigBytes-=c}return new s.init(n,c)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});u.Hasher=p.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new m.HMAC.init(e,n).finalize(t)}}});var m=l.algo={};return l}(Math)},7202:function(e,t,n){var r,o;o=(r=n(7383)).lib.WordArray,r.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var o=[],i=0;i<n;i+=3)for(var l=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,u=0;u<4&&i+.75*u<n;u++)o.push(r.charAt(l>>>6*(3-u)&63));var a=r.charAt(64);if(a)for(;o.length%4;)o.push(a);return o.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var i=0;i<n.length;i++)r[n.charCodeAt(i)]=i}var l=n.charAt(64);if(l){var u=e.indexOf(l);-1!==u&&(t=u)}for(var a=e,s=t,c=r,f=[],d=0,h=0;h<s;h++)if(h%4){var p=c[a.charCodeAt(h-1)]<<h%4*2|c[a.charCodeAt(h)]>>>6-h%4*2;f[d>>>2]|=p<<24-d%4*8,d++}return o.create(f,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.exports=r.enc.Base64},394:function(e,t,n){var r,o,i,l,u,a,s;i=(o=(r=n(7383)).lib).WordArray,l=o.Hasher,u=r.algo,a=[],s=u.SHA1=l.extend({_doReset:function(){this._hash=new i.init([0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],l=n[3],u=n[4],s=0;s<80;s++){if(s<16)a[s]=0|e[t+s];else{var c=a[s-3]^a[s-8]^a[s-14]^a[s-16];a[s]=c<<1|c>>>31}var f=(r<<5|r>>>27)+u+a[s];s<20?f+=(o&i|~o&l)+0x5a827999:s<40?f+=(o^i^l)+0x6ed9eba1:s<60?f+=(o&i|o&l|i&l)-0x70e44324:f+=(o^i^l)-0x359d3e2a,u=l,l=i,i=o<<30|o>>>2,o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+l|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[(r+64>>>9<<4)+14]=Math.floor(n/0x100000000),t[(r+64>>>9<<4)+15]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=l.clone.call(this);return e._hash=this._hash.clone(),e}}),r.SHA1=l._createHelper(s),r.HmacSHA1=l._createHmacHelper(s),e.exports=r.SHA1},5683:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach(function(t){e.addRange(t)}),t&&t.focus()}}},6307:function(e,t,n){"use strict";var r=n(9144),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=r.useState,l=r.useEffect,u=r.useLayoutEffect,a=r.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,c=r[1];return u(function(){o.value=n,o.getSnapshot=t,s(o)&&c({inst:o})},[e,n,t]),l(function(){return s(o)&&c({inst:o}),e(function(){s(o)&&c({inst:o})})},[e]),a(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},455:function(e,t,n){"use strict";e.exports=n(6307)},2390:function(e,t,n){"use strict";n.d(t,{RR:()=>u,cv:()=>s,dp:()=>f,oo:()=>i,uY:()=>c});var r=n(1601);function o(e,t,n){let o,{reference:i,floating:l}=e,u=(0,r.Qq)(t),a=(0,r.Wh)(t),s=(0,r.I4)(a),c=(0,r.k3)(t),f="y"===u,d=i.x+i.width/2-l.width/2,h=i.y+i.height/2-l.height/2,p=i[s]/2-l[s]/2;switch(c){case"top":o={x:d,y:i.y-l.height};break;case"bottom":o={x:d,y:i.y+i.height};break;case"right":o={x:i.x+i.width,y:h};break;case"left":o={x:i.x-l.width,y:h};break;default:o={x:i.x,y:i.y}}switch((0,r.hp)(t)){case"start":o[a]-=p*(n&&f?-1:1);break;case"end":o[a]+=p*(n&&f?-1:1)}return o}let i=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:l=[],platform:u}=n,a=l.filter(Boolean),s=await (null==u.isRTL?void 0:u.isRTL(t)),c=await u.getElementRects({reference:e,floating:t,strategy:i}),{x:f,y:d}=o(c,r,s),h=r,p={},m=0;for(let n=0;n<a.length;n++){let{name:l,fn:g}=a[n],{x:v,y:y,data:w,reset:b}=await g({x:f,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:p,rects:c,platform:u,elements:{reference:e,floating:t}});if(f=null!=v?v:f,d=null!=y?y:d,p={...p,[l]:{...p[l],...w}},b&&m<=50){m++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await u.getElementRects({reference:e,floating:t,strategy:i}):b.rects),{x:f,y:d}=o(c,h,s)),n=-1;continue}}return{x:f,y:d,placement:h,strategy:i,middlewareData:p}};async function l(e,t){var n;void 0===t&&(t={});let{x:o,y:i,platform:l,rects:u,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=(0,r.ku)(t,e),m=(0,r.yd)(p),g=a[h?"floating"===d?"reference":"floating":d],v=(0,r.JB)(await l.getClippingRect({element:null==(n=await (null==l.isElement?void 0:l.isElement(g)))||n?g:g.contextElement||await (null==l.getDocumentElement?void 0:l.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:s})),y="floating"===d?{...u.floating,x:o,y:i}:u.reference,w=await (null==l.getOffsetParent?void 0:l.getOffsetParent(a.floating)),b=await (null==l.isElement?void 0:l.isElement(w))&&await (null==l.getScale?void 0:l.getScale(w))||{x:1,y:1},E=(0,r.JB)(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:w,strategy:s}):y);return{top:(v.top-E.top+m.top)/b.y,bottom:(E.bottom-v.bottom+m.bottom)/b.y,left:(v.left-E.left+m.left)/b.x,right:(E.right-v.right+m.right)/b.x}}let u=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o,i,u;let{placement:a,middlewareData:s,rects:c,initialPlacement:f,platform:d,elements:h}=t,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:g,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:w=!0,...b}=(0,r.ku)(e,t),E=(0,r.k3)(a),R=(0,r.k3)(f)===f,x=await (null==d.isRTL?void 0:d.isRTL(h.floating)),C=g||(R||!w?[(0,r.pw)(f)]:(0,r.gy)(f));g||"none"===y||C.push(...(0,r.KX)(f,w,y,x));let S=[f,...C],M=await l(t,b),k=[],A=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&k.push(M[E]),m){let e=(0,r.i8)(a,c,x);k.push(M[e[0]],M[e[1]])}if(A=[...A,{placement:a,overflows:k}],!k.every(e=>e<=0)){let e=((null==(o=s.flip)?void 0:o.index)||0)+1,t=S[e];if(t)return{data:{index:e,overflows:A},reset:{placement:t}};let n=null==(i=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!n)switch(v){case"bestFit":{let e=null==(u=A.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:u[0];e&&(n=e);break}case"initialPlacement":n=f}if(a!==n)return{reset:{placement:n}}}return{}}}};async function a(e,t){let{placement:n,platform:o,elements:i}=e,l=await (null==o.isRTL?void 0:o.isRTL(i.floating)),u=(0,r.k3)(n),a=(0,r.hp)(n),s="y"===(0,r.Qq)(n),c=["left","top"].includes(u)?-1:1,f=l&&s?-1:1,d=(0,r.ku)(t,e),{mainAxis:h,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*f,y:h*c}:{x:h*c,y:p*f}}let s=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){let{x:n,y:r}=t,o=await a(t,e);return{x:n+o.x,y:r+o.y,data:o}}}},c=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:i}=t,{mainAxis:u=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=(0,r.ku)(e,t),f={x:n,y:o},d=await l(t,c),h=(0,r.Qq)((0,r.k3)(i)),p=(0,r.Rn)(h),m=f[p],g=f[h];if(u){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",n=m+d[e],o=m-d[t];m=(0,r.uZ)(n,m,o)}if(a){let e="y"===h?"top":"left",t="y"===h?"bottom":"right",n=g+d[e],o=g-d[t];g=(0,r.uZ)(n,g,o)}let v=s.fn({...t,[p]:m,[h]:g});return{...v,data:{x:v.x-n,y:v.y-o}}}}},f=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){let n,o,{placement:i,rects:u,platform:a,elements:s}=t,{apply:c=()=>{},...f}=(0,r.ku)(e,t),d=await l(t,f),h=(0,r.k3)(i),p=(0,r.hp)(i),m="y"===(0,r.Qq)(i),{width:g,height:v}=u.floating;"top"===h||"bottom"===h?(n=h,o=p===(await (null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(o=h,n="end"===p?"top":"bottom");let y=v-d[n],w=g-d[o],b=!t.middlewareData.shift,E=y,R=w;if(m){let e=g-d.left-d.right;R=p||b?(0,r.VV)(w,e):e}else{let e=v-d.top-d.bottom;E=p||b?(0,r.VV)(y,e):e}if(b&&!p){let e=(0,r.Fp)(d.left,0),t=(0,r.Fp)(d.right,0),n=(0,r.Fp)(d.top,0),o=(0,r.Fp)(d.bottom,0);m?R=g-2*(0!==e||0!==t?e+t:(0,r.Fp)(d.left,d.right)):E=v-2*(0!==n||0!==o?n+o:(0,r.Fp)(d.top,d.bottom))}await c({...t,availableWidth:R,availableHeight:E});let x=await a.getDimensions(s.floating);return g!==x.width||v!==x.height?{reset:{rects:!0}}:{}}}}},6089:function(e,t,n){"use strict";n.d(t,{Me:()=>y,oo:()=>w});var r=n(1601),o=n(2390),i=n(6164);function l(e){let t=(0,i.Dx)(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,l=(0,i.Re)(e),u=l?e.offsetWidth:n,a=l?e.offsetHeight:o,s=(0,r.NM)(n)!==u||(0,r.NM)(o)!==a;return s&&(n=u,o=a),{width:n,height:o,$:s}}function u(e){return(0,i.kK)(e)?e:e.contextElement}function a(e){let t=u(e);if(!(0,i.Re)(t))return(0,r.ze)(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:s}=l(t),c=(s?(0,r.NM)(n.width):n.width)/o,f=(s?(0,r.NM)(n.height):n.height)/a;return c&&Number.isFinite(c)||(c=1),f&&Number.isFinite(f)||(f=1),{x:c,y:f}}let s=(0,r.ze)(0);function c(e){let t=(0,i.Jj)(e);return(0,i.Pf)()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:s}function f(e,t,n,o){var l;void 0===t&&(t=!1),void 0===n&&(n=!1);let s=e.getBoundingClientRect(),f=u(e),d=(0,r.ze)(1);t&&(o?(0,i.kK)(o)&&(d=a(o)):d=a(e));let h=(void 0===(l=n)&&(l=!1),o&&(!l||o===(0,i.Jj)(f))&&l)?c(f):(0,r.ze)(0),p=(s.left+h.x)/d.x,m=(s.top+h.y)/d.y,g=s.width/d.x,v=s.height/d.y;if(f){let e=(0,i.Jj)(f),t=o&&(0,i.kK)(o)?(0,i.Jj)(o):o,n=e.frameElement;for(;n&&o&&t!==e;){let e=a(n),t=n.getBoundingClientRect(),r=(0,i.Dx)(n),o=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,l=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;p*=e.x,m*=e.y,g*=e.x,v*=e.y,p+=o,m+=l,n=(0,i.Jj)(n).frameElement}}return(0,r.JB)({width:g,height:v,x:p,y:m})}function d(e){return f((0,i.tF)(e)).left+(0,i.Lw)(e).scrollLeft}function h(e,t,n){let o;if("viewport"===t)o=function(e,t){let n=(0,i.Jj)(e),r=(0,i.tF)(e),o=n.visualViewport,l=r.clientWidth,u=r.clientHeight,a=0,s=0;if(o){l=o.width,u=o.height;let e=(0,i.Pf)();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:l,height:u,x:a,y:s}}(e,n);else if("document"===t)o=function(e){let t=(0,i.tF)(e),n=(0,i.Lw)(e),o=e.ownerDocument.body,l=(0,r.Fp)(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),u=(0,r.Fp)(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+d(e),s=-n.scrollTop;return"rtl"===(0,i.Dx)(o).direction&&(a+=(0,r.Fp)(t.clientWidth,o.clientWidth)-l),{width:l,height:u,x:a,y:s}}((0,i.tF)(e));else if((0,i.kK)(t))o=function(e,t){let n=f(e,!0,"fixed"===t),o=n.top+e.clientTop,l=n.left+e.clientLeft,u=(0,i.Re)(e)?a(e):(0,r.ze)(1),s=e.clientWidth*u.x,c=e.clientHeight*u.y;return{width:s,height:c,x:l*u.x,y:o*u.y}}(t,n);else{let n=c(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return(0,r.JB)(o)}function p(e,t){return(0,i.Re)(e)&&"fixed"!==(0,i.Dx)(e).position?t?t(e):e.offsetParent:null}function m(e,t){let n=(0,i.Jj)(e);if(!(0,i.Re)(e))return n;let r=p(e,t);for(;r&&(0,i.Ze)(r)&&"static"===(0,i.Dx)(r).position;)r=p(r,t);return r&&("html"===(0,i.wk)(r)||"body"===(0,i.wk)(r)&&"static"===(0,i.Dx)(r).position&&!(0,i.hT)(r))?n:r||(0,i.gQ)(e)||n}let g=async function(e){let{reference:t,floating:n,strategy:o}=e,l=this.getOffsetParent||m,u=this.getDimensions;return{reference:function(e,t,n){let o=(0,i.Re)(t),l=(0,i.tF)(t),u="fixed"===n,a=f(e,!0,u,t),s={scrollLeft:0,scrollTop:0},c=(0,r.ze)(0);if(o||!o&&!u)if(("body"!==(0,i.wk)(t)||(0,i.ao)(l))&&(s=(0,i.Lw)(t)),o){let e=f(t,!0,u,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else l&&(c.x=d(l));return{x:a.left+s.scrollLeft-c.x,y:a.top+s.scrollTop-c.y,width:a.width,height:a.height}}(t,await l(n),o),floating:{x:0,y:0,...await u(n)}}},v={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:o}=e,l=(0,i.Re)(n),u=(0,i.tF)(n);if(n===u)return t;let s={scrollLeft:0,scrollTop:0},c=(0,r.ze)(1),d=(0,r.ze)(0);if((l||!l&&"fixed"!==o)&&(("body"!==(0,i.wk)(n)||(0,i.ao)(u))&&(s=(0,i.Lw)(n)),(0,i.Re)(n))){let e=f(n);c=a(n),d.x=e.x+n.clientLeft,d.y=e.y+n.clientTop}return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-s.scrollLeft*c.x+d.x,y:t.y*c.y-s.scrollTop*c.y+d.y}},getDocumentElement:i.tF,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e,u=[..."clippingAncestors"===n?function(e,t){let n=t.get(e);if(n)return n;let r=(0,i.Kx)(e).filter(e=>(0,i.kK)(e)&&"body"!==(0,i.wk)(e)),o=null,l="fixed"===(0,i.Dx)(e).position,u=l?(0,i.Ow)(e):e;for(;(0,i.kK)(u)&&!(0,i.Py)(u);){let t=(0,i.Dx)(u),n=(0,i.hT)(u);n||"fixed"!==t.position||(o=null),(l?!n&&!o:!n&&"static"===t.position&&!!o&&["absolute","fixed"].includes(o.position)||(0,i.ao)(u)&&!n&&function e(t,n){let r=(0,i.Ow)(t);return!(r===n||!(0,i.kK)(r)||(0,i.Py)(r))&&("fixed"===(0,i.Dx)(r).position||e(r,n))}(e,u))?r=r.filter(e=>e!==u):o=t,u=(0,i.Ow)(u)}return t.set(e,r),r}(t,this._c):[].concat(n),o],a=u[0],s=u.reduce((e,n)=>{let o=h(t,n,l);return e.top=(0,r.Fp)(o.top,e.top),e.right=(0,r.VV)(o.right,e.right),e.bottom=(0,r.VV)(o.bottom,e.bottom),e.left=(0,r.Fp)(o.left,e.left),e},h(t,a,l));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:m,getElementRects:g,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return l(e)},getScale:a,isElement:i.kK,isRTL:function(e){return"rtl"===(0,i.Dx)(e).direction}};function y(e,t,n,o){let l;void 0===o&&(o={});let{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:c="function"==typeof ResizeObserver,layoutShift:d="function"==typeof IntersectionObserver,animationFrame:h=!1}=o,p=u(e),m=a||s?[...p?(0,i.Kx)(p):[],...(0,i.Kx)(t)]:[];m.forEach(e=>{a&&e.addEventListener("scroll",n,{passive:!0}),s&&e.addEventListener("resize",n)});let g=p&&d?function(e,t){let n,o=null,l=(0,i.tF)(e);function u(){clearTimeout(n),o&&o.disconnect(),o=null}return!function i(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),u();let{left:c,top:f,width:d,height:h}=e.getBoundingClientRect();if(a||t(),!d||!h)return;let p=(0,r.GW)(f),m=(0,r.GW)(l.clientWidth-(c+d)),g={rootMargin:-p+"px "+-m+"px "+-(0,r.GW)(l.clientHeight-(f+h))+"px "+-(0,r.GW)(c)+"px",threshold:(0,r.Fp)(0,(0,r.VV)(1,s))||1},v=!0;function y(e){let t=e[0].intersectionRatio;if(t!==s){if(!v)return i();t?i(!1,t):n=setTimeout(()=>{i(!1,1e-7)},100)}v=!1}try{o=new IntersectionObserver(y,{...g,root:l.ownerDocument})}catch(e){o=new IntersectionObserver(y,g)}o.observe(e)}(!0),u}(p,n):null,v=-1,y=null;c&&(y=new ResizeObserver(e=>{let[r]=e;r&&r.target===p&&y&&(y.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),p&&!h&&y.observe(p),y.observe(t));let w=h?f(e):null;return h&&function t(){let r=f(e);w&&(r.x!==w.x||r.y!==w.y||r.width!==w.width||r.height!==w.height)&&n(),w=r,l=requestAnimationFrame(t)}(),n(),()=>{m.forEach(e=>{a&&e.removeEventListener("scroll",n),s&&e.removeEventListener("resize",n)}),g&&g(),y&&y.disconnect(),y=null,h&&cancelAnimationFrame(l)}}let w=(e,t,n)=>{let r=new Map,i={platform:v,...n},l={...i.platform,_c:r};return(0,o.oo)(e,t,{...i,platform:l})}},3986:function(e,t,n){"use strict";n.d(t,{RR:()=>m,YF:()=>d,cv:()=>h,dp:()=>g,uY:()=>p});var r=n(6089),o=n(2390),i=n(9144),l=n(8315),u="undefined"!=typeof document?i.useLayoutEffect:function(){};function a(e,t){let n,r,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((n=e.length)!==t.length)return!1;for(r=n;0!=r--;)if(!a(e[r],t[r]))return!1;return!0}if((n=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!({}).hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){let n=o[r];if(("_owner"!==n||!e.$$typeof)&&!a(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function s(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function c(e,t){let n=s(e);return Math.round(t*n)/n}function f(e){let t=i.useRef(e);return u(()=>{t.current=e}),t}function d(e){void 0===e&&(e={});let{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:d,elements:{reference:h,floating:p}={},transform:m=!0,whileElementsMounted:g,open:v}=e,[y,w]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,E]=i.useState(o);a(b,o)||E(o);let[R,x]=i.useState(null),[C,S]=i.useState(null),M=i.useCallback(e=>{e!==O.current&&(O.current=e,x(e))},[]),k=i.useCallback(e=>{e!==T.current&&(T.current=e,S(e))},[]),A=h||R,L=p||C,O=i.useRef(null),T=i.useRef(null),N=i.useRef(y),_=null!=g,I=f(g),P=f(d),D=f(v),F=i.useCallback(()=>{if(!O.current||!T.current)return;let e={placement:t,strategy:n,middleware:b};P.current&&(e.platform=P.current),(0,r.oo)(O.current,T.current,e).then(e=>{let t={...e,isPositioned:!1!==D.current};B.current&&!a(N.current,t)&&(N.current=t,l.flushSync(()=>{w(t)}))})},[b,t,n,P,D]);u(()=>{!1===v&&N.current.isPositioned&&(N.current.isPositioned=!1,w(e=>({...e,isPositioned:!1})))},[v]);let B=i.useRef(!1);u(()=>(B.current=!0,()=>{B.current=!1}),[]),u(()=>{if(A&&(O.current=A),L&&(T.current=L),A&&L){if(I.current)return I.current(A,L,F);F()}},[A,L,F,I,_]);let z=i.useMemo(()=>({reference:O,floating:T,setReference:M,setFloating:k}),[M,k]),j=i.useMemo(()=>({reference:A,floating:L}),[A,L]),U=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=c(j.floating,y.x),r=c(j.floating,y.y);return m?{...e,transform:"translate("+t+"px, "+r+"px)",...s(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,m,j.floating,y.x,y.y]);return i.useMemo(()=>({...y,update:F,refs:z,elements:j,floatingStyles:U}),[y,F,z,j,U])}let h=(e,t)=>({...(0,o.cv)(e),options:[e,t]}),p=(e,t)=>({...(0,o.uY)(e),options:[e,t]}),m=(e,t)=>({...(0,o.RR)(e),options:[e,t]}),g=(e,t)=>({...(0,o.dp)(e),options:[e,t]})},7126:function(e,t,n){"use strict";n.d(t,{qq:()=>eS,RB:()=>e0,Y_:()=>t_,YF:()=>tC,XI:()=>e6,KK:()=>tM,bQ:()=>tx,A8:()=>eU,NI:()=>tA,bU:()=>ej,jV:()=>eG,Zm:()=>eX,ll:()=>tc,qs:()=>tO,wD:()=>tv,eS:()=>tw,mN:()=>eZ});var r=n(9144),o=n.t(r,2);function i(){return"undefined"!=typeof window}function l(e){return a(e)?(e.nodeName||"").toLowerCase():"#document"}function u(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function a(e){return!!i()&&(e instanceof Node||e instanceof u(e).Node)}function s(e){return!!i()&&(e instanceof Element||e instanceof u(e).Element)}function c(e){return!!i()&&(e instanceof HTMLElement||e instanceof u(e).HTMLElement)}function f(e){return!!i()&&"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof u(e).ShadowRoot)}function d(e){return["html","body","#document"].includes(l(e))}let h=Math.floor;var p='input:not([inert]),select:not([inert]),textarea:not([inert]),a[href]:not([inert]),button:not([inert]),[tabindex]:not(slot):not([inert]),audio[controls]:not([inert]),video[controls]:not([inert]),[contenteditable]:not([contenteditable="false"]):not([inert]),details>summary:first-of-type:not([inert]),details:not([inert])',m="undefined"==typeof Element,g=m?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,v=!m&&Element.prototype.getRootNode?function(e){var t;return null==e||null==(t=e.getRootNode)?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},y=function e(t,n){void 0===n&&(n=!0);var r,o=null==t||null==(r=t.getAttribute)?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},w=function(e){var t,n=null==e||null==(t=e.getAttribute)?void 0:t.call(e,"contenteditable");return""===n||"true"===n},b=function(e,t,n){if(y(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(p));return t&&g.call(e,p)&&r.unshift(e),r=r.filter(n)},E=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!y(l,!1))if("SLOT"===l.tagName){var u=l.assignedElements(),a=e(u.length?u:l.children,!0,r);r.flatten?o.push.apply(o,a):o.push({scopeParent:l,candidates:a})}else{g.call(l,p)&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var s=l.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(l),c=!y(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(s&&c){var f=e(!0===s?l.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else i.unshift.apply(i,l.children)}}return o},R=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},x=function(e){if(!e)throw Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||w(e))&&!R(e)?0:e.tabIndex},C=function(e,t){var n=x(e);return n<0&&t&&!R(e)?0:n},S=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},M=function(e){return"INPUT"===e.tagName},k=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},A=function(e){if(!e.name)return!0;var t,n=e.form||v(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=k(t,e.form);return!o||o===e},L=function(e){return M(e)&&"radio"===e.type&&!A(e)},O=function(e){var t,n,r,o,i,l,u,a=e&&v(e),s=null==(t=a)?void 0:t.host,c=!1;if(a&&a!==e)for(c=!!(null!=(n=s)&&null!=(r=n.ownerDocument)&&r.contains(s)||null!=e&&null!=(o=e.ownerDocument)&&o.contains(e));!c&&s;)c=!!(null!=(l=s=null==(i=a=v(s))?void 0:i.host)&&null!=(u=l.ownerDocument)&&u.contains(s));return c},T=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},N=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=g.call(e,"details>summary:first-of-type")?e.parentElement:e;if(g.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return T(e)}else{if("function"==typeof r){for(var i=e;e;){var l=e.parentElement,u=v(e);if(l&&!l.shadowRoot&&!0===r(l))return T(e);e=e.assignedSlot?e.assignedSlot:l||u===e.ownerDocument?l:u.host}e=i}if(O(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},_=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!!g.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1},I=function(e,t){return!(t.disabled||y(t)||M(t)&&"hidden"===t.type||N(t,e)||"DETAILS"===t.tagName&&Array.prototype.slice.apply(t.children).some(function(e){return"SUMMARY"===e.tagName})||_(t))},P=function(e,t){return!(L(t)||0>x(t))&&!!I(e,t)},D=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!isNaN(t)||!!(t>=0)},F=function e(t){var n=[],r=[];return t.forEach(function(t,o){var i=!!t.scopeParent,l=i?t.scopeParent:t,u=C(l,i),a=i?e(t.candidates):l;0===u?i?n.push.apply(n,a):n.push(l):r.push({documentOrder:o,tabIndex:u,item:t,isScope:i,content:a})}),r.sort(S).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},B=function(e,t){return F((t=t||{}).getShadowRoot?E([e],t.includeContainer,{filter:P.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:D}):b(e,t.includeContainer,P.bind(null,t)))},z=function(e,t){return(t=t||{}).getShadowRoot?E([e],t.includeContainer,{filter:I.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):b(e,t.includeContainer,I.bind(null,t))},j=function(e,t){if(t=t||{},!e)throw Error("No node provided");return!1!==g.call(e,p)&&P(t,e)};function U(){let e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function W(){let 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 H(){return/apple/i.test(navigator.vendor)}function V(){let e=/android/i;return e.test(U())||e.test(W())}function K(){return W().includes("jsdom/")}let $="data-floating-ui-focusable",Y="ArrowLeft",Q="ArrowRight";function q(e){let t=e.activeElement;for(;(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function X(e,t){if(!e||!t)return!1;let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&f(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function J(e){return"composedPath"in e?e.composedPath()[0]:e.target}function G(e,t){return null!=t&&("composedPath"in e?e.composedPath().includes(t):null!=e.target&&t.contains(e.target))}function Z(e){return(null==e?void 0:e.ownerDocument)||document}function ee(e){return c(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function et(e){return!!e&&"combobox"===e.getAttribute("role")&&ee(e)}function en(e){return e?e.hasAttribute($)?e:e.querySelector("["+$+"]")||e:null}function er(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}function eo(e,t){var n;let r=[],o=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;o;){let t=e.find(e=>e.id===o);o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function ei(e){e.preventDefault(),e.stopPropagation()}function el(e,t){let n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var eu="undefined"!=typeof document?r.useLayoutEffect:function(){};function ea(e){let t=r.useRef(e);return eu(()=>{t.current=e}),t}let es={...o}.useInsertionEffect||(e=>e());function ec(e){let t=r.useRef(()=>{});return es(()=>{t.current=e}),r.useCallback(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function ef(e,t,n){return Math.floor(e/t)!==n}function ed(e,t){return t<0||t>=e.current.length}function eh(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t,l=n;do l+=r?-i:i;while(l>=0&&l<=e.current.length-1&&ep(e,l,o));return l}function ep(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);let r=e.current[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}let em=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function eg(e,t){let n=B(e,em()),r=n.length;if(0===r)return;let o=q(Z(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function ev(e){return eg(Z(e).body,1)||e}function ey(e){return eg(Z(e).body,-1)||e}function ew(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!X(n,r)}function eb(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}var eE=n(836),eR=n(8315),ex=n(6164),eC=n(3986);function eS(e){let t=r.useRef(void 0),n=r.useCallback(t=>{let n=e.map(e=>{if(null!=e){if("function"==typeof e){let n=e(t);return"function"==typeof n?n:()=>{e(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>null==e?void 0:e())}},e);return r.useMemo(()=>e.every(e=>null==e)?null:e=>{t.current&&(t.current(),t.current=void 0),null!=e&&(t.current=n(e))},e)}function eM(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}let ek=r.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function eA(e){let{children:t,elementsRef:n,labelsRef:o}=e,[i,l]=r.useState(()=>new Set),u=r.useCallback(e=>{l(t=>new Set(t).add(e))},[]),a=r.useCallback(e=>{l(t=>{let n=new Set(t);return n.delete(e),n})},[]),s=r.useMemo(()=>{let e=new Map;return Array.from(i.keys()).sort(eM).forEach((t,n)=>{e.set(t,n)}),e},[i]);return(0,eE.jsx)(ek.Provider,{value:r.useMemo(()=>({register:u,unregister:a,map:s,elementsRef:n,labelsRef:o}),[u,a,s,n,o]),children:t})}let eL="active",eO="selected",eT="ArrowLeft",eN="ArrowRight",e_="ArrowUp",eI="ArrowDown";function eP(e,t){return"function"==typeof e?e(t):e?r.cloneElement(e,t):(0,eE.jsx)("div",{...t})}let eD=r.createContext({activeIndex:0,onNavigate:()=>{}}),eF=[eT,eN],eB=[e_,eI],ez=[...eF,...eB],ej=r.forwardRef(function(e,t){let{render:n,orientation:o="both",loop:i=!0,rtl:l=!1,cols:u=1,disabledIndices:a,activeIndex:s,onNavigate:c,itemSizes:f,dense:d=!1,...p}=e,[m,g]=r.useState(0),v=null!=s?s:m,y=ec(null!=c?c:g),w=r.useRef([]),b=n&&"function"!=typeof n?n.props:{},E=r.useMemo(()=>({activeIndex:v,onNavigate:y}),[v,y]),R=u>1,x={...p,...b,ref:t,"aria-orientation":"both"===o?void 0:o,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){var t,n;if(!ez.includes(e.key))return;let r=v,s=eh(w,{disabledIndices:a}),c=eh(w,{decrement:!0,startingIndex:w.current.length,disabledIndices:a}),p=l?eT:eN,m=l?eN:eT;if(R){let n=f||Array.from({length:w.current.length},()=>({width:1,height:1})),m=function(e,t,n){let r=[],o=0;return e.forEach((e,i)=>{let{width:l,height:u}=e,a=!1;for(n&&(o=0);!a;){let e=[];for(let n=0;n<l;n++)for(let r=0;r<u;r++)e.push(o+n+r*t);o%t+l<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=i}),a=!0):o++}}),[...r]}(n,u,d),g=m.findIndex(e=>null!=e&&!ep(w,e,a)),y=m.reduce((e,t,n)=>null==t||ep(w,t,a)?e:n,-1),b=m[function(e,t){let{event:n,orientation:r,loop:o,rtl:i,cols:l,disabledIndices:u,minIndex:a,maxIndex:s,prevIndex:c,stopEvent:f=!1}=t,d=c;if("ArrowUp"===n.key){if(f&&ei(n),-1===c)d=s;else if(d=eh(e,{startingIndex:d,amount:l,decrement:!0,disabledIndices:u}),o&&(c-l<a||d<0)){let e=c%l,t=s%l,n=s-(t-e);d=t===e?s:t>e?n:n-l}ed(e,d)&&(d=c)}if("ArrowDown"===n.key&&(f&&ei(n),-1===c?d=a:(d=eh(e,{startingIndex:c,amount:l,disabledIndices:u}),o&&c+l>s&&(d=eh(e,{startingIndex:c%l-l,amount:l,disabledIndices:u}))),ed(e,d)&&(d=c)),"both"===r){let t=h(c/l);n.key===(i?Y:Q)&&(f&&ei(n),c%l!=l-1?(d=eh(e,{startingIndex:c,disabledIndices:u}),o&&ef(d,l,t)&&(d=eh(e,{startingIndex:c-c%l-1,disabledIndices:u}))):o&&(d=eh(e,{startingIndex:c-c%l-1,disabledIndices:u})),ef(d,l,t)&&(d=c)),n.key===(i?Q:Y)&&(f&&ei(n),c%l!=0?(d=eh(e,{startingIndex:c,decrement:!0,disabledIndices:u}),o&&ef(d,l,t)&&(d=eh(e,{startingIndex:c+(l-c%l),decrement:!0,disabledIndices:u}))):o&&(d=eh(e,{startingIndex:c+(l-c%l),decrement:!0,disabledIndices:u})),ef(d,l,t)&&(d=c));let r=h(s/l)===t;ed(e,d)&&(d=o&&r?n.key===(i?Q:Y)?s:eh(e,{startingIndex:c-c%l-1,disabledIndices:u}):c)}return d}({current:m.map(e=>e?w.current[e]:null)},{event:e,orientation:o,loop:i,rtl:l,cols:u,disabledIndices:(t=[...("function"!=typeof a?a:null)||w.current.map((e,t)=>ep(w,t,a)?t:void 0),void 0],m.flatMap((e,n)=>t.includes(e)?[n]:[])),minIndex:g,maxIndex:y,prevIndex:function(e,t,n,r,o){if(-1===e)return -1;let i=n.indexOf(e),l=t[e];switch(o){case"tl":return i;case"tr":if(!l)return i;return i+l.width-1;case"bl":if(!l)return i;return i+(l.height-1)*r;case"br":return n.lastIndexOf(e)}}(v>c?s:v,n,m,u,e.key===eI?"bl":e.key===p?"tr":"tl")})];null!=b&&(r=b)}let g={horizontal:[p],vertical:[eI],both:[p,eI]}[o],b={horizontal:[m],vertical:[e_],both:[m,e_]}[o],E=R?ez:({horizontal:eF,vertical:eB,both:ez})[o];r===v&&[...g,...b].includes(e.key)&&(r=i&&r===c&&g.includes(e.key)?s:i&&r===s&&b.includes(e.key)?c:eh(w,{startingIndex:r,decrement:b.includes(e.key),disabledIndices:a})),r===v||ed(w,r)||(e.stopPropagation(),E.includes(e.key)&&e.preventDefault(),y(r),null==(n=w.current[r])||n.focus())}(e)}};return(0,eE.jsx)(eD.Provider,{value:E,children:(0,eE.jsx)(eA,{elementsRef:w,children:eP(n,x)})})}),eU=r.forwardRef(function(e,t){let{render:n,...o}=e,i=n&&"function"!=typeof n?n.props:{},{activeIndex:l,onNavigate:u}=r.useContext(eD),{ref:a,index:s}=function(e){void 0===e&&(e={});let{label:t}=e,{register:n,unregister:o,map:i,elementsRef:l,labelsRef:u}=r.useContext(ek),[a,s]=r.useState(null),c=r.useRef(null),f=r.useCallback(e=>{if(c.current=e,null!==a&&(l.current[a]=e,u)){var n;let r=void 0!==t;u.current[a]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}},[a,l,u,t]);return eu(()=>{let e=c.current;if(e)return n(e),()=>{o(e)}},[n,o]),eu(()=>{let e=c.current?i.get(c.current):null;null!=e&&s(e)},[i]),r.useMemo(()=>({ref:f,index:null==a?-1:a}),[a,f])}(),c=eS([a,t,i.ref]),f=l===s;return eP(n,{...o,...i,ref:c,tabIndex:f?0:-1,"data-active":f?"":void 0,onFocus(e){null==o.onFocus||o.onFocus(e),null==i.onFocus||i.onFocus(e),u(s)}})}),eW={...o},eH=!1,eV=0,eK=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+eV++,e$=eW.useId||function(){let[e,t]=r.useState(()=>eH?eK():void 0);return eu(()=>{null==e&&t(eK())},[]),r.useEffect(()=>{eH=!0},[]),e};function eY(){let 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)}}}let eQ=r.createContext(null),eq=r.createContext(null),eX=()=>{var e;return(null==(e=r.useContext(eQ))?void 0:e.id)||null},eJ=()=>r.useContext(eq);function eG(e){let t=e$(),n=eJ(),r=eX(),o=e||r;return eu(()=>{if(!t)return;let e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}},[n,t,o]),t}function eZ(e){let{children:t,id:n}=e,o=eX();return(0,eE.jsx)(eQ.Provider,{value:r.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function e0(e){let{children:t}=e,n=r.useRef([]),o=r.useCallback(e=>{n.current=[...n.current,e]},[]),i=r.useCallback(e=>{n.current=n.current.filter(t=>t!==e)},[]),[l]=r.useState(()=>eY());return(0,eE.jsx)(eq.Provider,{value:r.useMemo(()=>({nodesRef:n,addNode:o,removeNode:i,events:l}),[o,i,l]),children:t})}function e1(e){return"data-floating-ui-"+e}function e2(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}let e3=e1("safe-polygon");function e4(e,t,n){if(n&&!el(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){let n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function e8(e){return"function"==typeof e?e():e}function e6(e,t){void 0===t&&(t={});let{open:n,onOpenChange:o,dataRef:i,events:l,elements:u}=e,{enabled:a=!0,delay:c=0,handleClose:f=null,mouseOnly:d=!1,restMs:h=0,move:p=!0}=t,m=eJ(),g=eX(),v=ea(f),y=ea(c),w=ea(n),b=ea(h),E=r.useRef(),R=r.useRef(-1),x=r.useRef(),C=r.useRef(-1),S=r.useRef(!0),M=r.useRef(!1),k=r.useRef(()=>{}),A=r.useRef(!1),L=ec(()=>{var e;let t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t});r.useEffect(()=>{if(a)return l.on("openchange",e),()=>{l.off("openchange",e)};function e(e){let{open:t}=e;t||(e2(R),e2(C),S.current=!0,A.current=!1)}},[a,l]),r.useEffect(()=>{if(!a||!v.current||!n)return;function e(e){L()&&o(!1,e,"hover")}let t=Z(u.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[u.floating,n,o,a,v,L]);let O=r.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");let r=e4(y.current,"close",E.current);r&&!x.current?(e2(R),R.current=window.setTimeout(()=>o(!1,e,n),r)):t&&(e2(R),o(!1,e,n))},[y,o]),T=ec(()=>{k.current(),x.current=void 0}),N=ec(()=>{if(M.current){let e=Z(u.floating).body;e.style.pointerEvents="",e.removeAttribute(e3),M.current=!1}}),_=ec(()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type));r.useEffect(()=>{if(a&&s(u.domReference)){let o=u.domReference,i=u.floating;return n&&o.addEventListener("mouseleave",r),p&&o.addEventListener("mousemove",e,{once:!0}),o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",r),i.addEventListener("mouseenter",l),i.addEventListener("mouseleave",c)),()=>{n&&o.removeEventListener("mouseleave",r),p&&o.removeEventListener("mousemove",e),o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",r),i.removeEventListener("mouseenter",l),i.removeEventListener("mouseleave",c))}}function e(e){if(e2(R),S.current=!1,d&&!el(E.current)||e8(b.current)>0&&!e4(y.current,"open"))return;let t=e4(y.current,"open",E.current);t?R.current=window.setTimeout(()=>{w.current||o(!0,e,"hover")},t):n||o(!0,e,"hover")}function t(e){if(_())return void N();k.current();let t=Z(u.floating);if(e2(C),A.current=!1,v.current&&i.current.floatingContext){n||e2(R),x.current=v.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),T(),_()||O(e,!0,"safe-polygon")}});let r=x.current;t.addEventListener("mousemove",r),k.current=()=>{t.removeEventListener("mousemove",r)};return}"touch"===E.current&&X(u.floating,e.relatedTarget)||O(e)}function r(e){!_()&&i.current.floatingContext&&(null==v.current||v.current({...i.current.floatingContext,tree:m,x:e.clientX,y:e.clientY,onClose(){N(),T(),_()||O(e)}})(e))}function l(){e2(R)}function c(e){_()||O(e,!1)}},[u,a,e,d,p,O,T,N,o,n,w,m,y,v,i,_,b]),eu(()=>{var e,t;if(a&&n&&null!=(e=v.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&L()){M.current=!0;let e=u.floating;if(s(u.domReference)&&e){let n=Z(u.floating).body;n.setAttribute(e3,"");let r=u.domReference,o=null==m||null==(t=m.nodesRef.current.find(e=>e.id===g))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[a,n,g,u,m,v,L]),eu(()=>{n||(E.current=void 0,A.current=!1,T(),N())},[n,T,N]),r.useEffect(()=>()=>{T(),e2(R),e2(C),N()},[a,u.domReference,T,N]);let I=r.useMemo(()=>{function e(e){E.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function r(){S.current||w.current||o(!0,t,"hover")}(!d||el(E.current))&&!n&&0!==e8(b.current)&&(A.current&&e.movementX**2+e.movementY**2<2||(e2(C),"touch"===E.current?r():(A.current=!0,C.current=window.setTimeout(r,e8(b.current)))))}}},[d,o,n,w,b]);return r.useMemo(()=>a?{reference:I}:{},[a,I])}let e5=0;function e7(e,t){void 0===t&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(e5);let i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():e5=requestAnimationFrame(i)}let e9={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function te(e){return"inert"===e?e9.inert:"aria-hidden"===e?e9["aria-hidden"]:e9.none}let tt=new WeakSet,tn={},tr=0,to=e=>e&&(e.host||to(e.parentNode));function ti(e,t,n){var r;void 0===t&&(t=!1),void 0===n&&(n=!1);let o=((null==(r=e[0])?void 0:r.ownerDocument)||document).body;return function(e,t,n,r){let o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=e.map(e=>{if(t.contains(e))return e;let n=to(e);return t.contains(n)?n:null}).filter(e=>null!=e),a=new Set,s=new Set(u),c=[];tn[o]||(tn[o]=new WeakMap);let f=tn[o];return u.forEach(function e(t){!(!t||a.has(t))&&(a.add(t),t.parentNode&&e(t.parentNode))}),function e(t){!t||s.has(t)||[].forEach.call(t.children,t=>{if("script"!==l(t))if(a.has(t))e(t);else{let e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=te(i),l=(r.get(t)||0)+1,u=(f.get(t)||0)+1;r.set(t,l),f.set(t,u),c.push(t),1===l&&n&&tt.add(t),1===u&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}})}(t),a.clear(),tr++,()=>{c.forEach(e=>{let t=te(i),n=(t.get(e)||0)-1,r=(f.get(e)||0)-1;t.set(e,n),f.set(e,r),n||(!tt.has(e)&&i&&e.removeAttribute(i),tt.delete(e)),r||e.removeAttribute(o)}),--tr||(e9.inert=new WeakMap,e9["aria-hidden"]=new WeakMap,e9.none=new WeakMap,tt=new WeakSet,tn={})}}(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}let tl={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},tu=r.forwardRef(function(e,t){let[n,o]=r.useState();eu(()=>{H()&&o("button")},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[e1("focus-guard")]:"",style:tl};return(0,eE.jsx)("span",{...e,...i})}),ta=r.createContext(null),ts=e1("portal");function tc(e){let{children:t,id:n,root:o,preserveTabOrder:i=!0}=e,l=function(e){void 0===e&&(e={});let{id:t,root:n}=e,o=e$(),i=tf(),[l,u]=r.useState(null),a=r.useRef(null);return eu(()=>()=>{null==l||l.remove(),queueMicrotask(()=>{a.current=null})},[l]),eu(()=>{if(!o||a.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement("div");n.id=o,n.setAttribute(ts,""),e.appendChild(n),a.current=n,u(n)},[t,o]),eu(()=>{if(null===n||!o||a.current)return;let e=n||(null==i?void 0:i.portalNode);e&&!s(e)&&(e=e.current),e=e||document.body;let r=null;t&&((r=document.createElement("div")).id=t,e.appendChild(r));let l=document.createElement("div");l.id=o,l.setAttribute(ts,""),(e=r||e).appendChild(l),a.current=l,u(l)},[t,n,o,i]),l}({id:n,root:o}),[u,a]=r.useState(null),c=r.useRef(null),f=r.useRef(null),d=r.useRef(null),h=r.useRef(null),p=null==u?void 0:u.modal,m=null==u?void 0:u.open,g=!!u&&!u.modal&&u.open&&i&&!!(o||l);return r.useEffect(()=>{if(l&&i&&!p)return l.addEventListener("focusin",e,!0),l.addEventListener("focusout",e,!0),()=>{l.removeEventListener("focusin",e,!0),l.removeEventListener("focusout",e,!0)};function e(e){l&&ew(e)&&("focusin"===e.type?eb:function(e){B(e,em()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})})(l)}},[l,i,p]),r.useEffect(()=>{l&&(m||eb(l))},[m,l]),(0,eE.jsxs)(ta.Provider,{value:r.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:h,portalNode:l,setFocusManagerState:a}),[i,l]),children:[g&&l&&(0,eE.jsx)(tu,{"data-type":"outside",ref:c,onFocus:e=>{if(ew(e,l)){var t;null==(t=d.current)||t.focus()}else{let e=ey(u?u.domReference:null);null==e||e.focus()}}}),g&&l&&(0,eE.jsx)("span",{"aria-owns":l.id,style:tl}),l&&eR.createPortal(t,l),g&&l&&(0,eE.jsx)(tu,{"data-type":"outside",ref:f,onFocus:e=>{if(ew(e,l)){var t;null==(t=h.current)||t.focus()}else{let t=ev(u?u.domReference:null);null==t||t.focus(),(null==u?void 0:u.closeOnFocusOut)&&(null==u||u.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}let tf=()=>r.useContext(ta);function td(e){return r.useMemo(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}let th=[];function tp(){return th.slice().reverse().find(e=>e.isConnected)}function tm(e,t){var n;if(!t.current.includes("floating")&&!(null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;let r=em(),o=z(e,r).filter(e=>{let t=e.getAttribute("data-tabindex")||"";return j(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||0===o.length?"0"!==i&&e.setAttribute("tabindex","0"):("-1"!==i||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1")