@txnlab/use-wallet-ui-react 0.1.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/README.md +234 -0
- package/dist/cjs/assets/use-wallet-ui-react.css +1 -0
- package/dist/cjs/index.cjs +42 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/esm/index.js +6048 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/types/index.d.cts +44 -0
- package/dist/types/index.d.ts +44 -0
- package/package.json +83 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("react"),Ae=require("react-dom"),zt=require("@txnlab/use-wallet-react");var sn=typeof document<"u"?document.currentScript:null;function eo(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const D=eo(R),bt=eo(Ae),Fi=()=>{typeof window>"u"||typeof document>"u"||(typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame(()=>{sr()}):setTimeout(sr,0))},sr=()=>{try{if(document.getElementById("wallet-ui-fonts"))return;const t=document.createElement("style");t.id="wallet-ui-fonts";let n="";try{n=new URL("data:font/woff2;base64,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",typeof document>"u"?require("url").pathToFileURL(__filename).href:sn&&sn.tagName.toUpperCase()==="SCRIPT"&&sn.src||new URL("index.cjs",document.baseURI).href).toString()}catch(r){console.warn("Could not resolve font URL. Using fallback styling.",r)}t.textContent=`
|
|
2
|
+
@font-face {
|
|
3
|
+
font-family: 'Aeonik';
|
|
4
|
+
src: url('${n}') format('woff2');
|
|
5
|
+
font-weight: 700;
|
|
6
|
+
font-style: normal;
|
|
7
|
+
font-display: swap;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.wallet-custom-font {
|
|
11
|
+
font-family: 'Aeonik', system-ui, sans-serif !important;
|
|
12
|
+
}
|
|
13
|
+
`,document.head.appendChild(t),console.log("Wallet UI fonts loaded")}catch(e){console.warn("Failed to load custom fonts, using system fonts instead",e)}},Pi=()=>{typeof window<"u"&&Fi()};var Pt={exports:{}},ft={};/**
|
|
14
|
+
* @license React
|
|
15
|
+
* react-jsx-runtime.production.js
|
|
16
|
+
*
|
|
17
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/var ar;function ki(){if(ar)return ft;ar=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,i){var l=null;if(i!==void 0&&(l=""+i),o.key!==void 0&&(l=""+o.key),"key"in o){i={};for(var s in o)s!=="key"&&(i[s]=o[s])}else i=o;return o=i.ref,{$$typeof:e,type:r,key:l,ref:o!==void 0?o:null,props:i}}return ft.Fragment=t,ft.jsx=n,ft.jsxs=n,ft}var dt={};/**
|
|
22
|
+
* @license React
|
|
23
|
+
* react-jsx-runtime.development.js
|
|
24
|
+
*
|
|
25
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the MIT license found in the
|
|
28
|
+
* LICENSE file in the root directory of this source tree.
|
|
29
|
+
*/var ur;function Ni(){return ur||(ur=1,process.env.NODE_ENV!=="production"&&function(){function e(E){if(E==null)return null;if(typeof E=="function")return E.$$typeof===p?null:E.displayName||E.name||null;if(typeof E=="string")return E;switch(E){case T:return"Fragment";case N:return"Profiler";case k:return"StrictMode";case j:return"Suspense";case W:return"SuspenseList";case c:return"Activity"}if(typeof E=="object")switch(typeof E.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),E.$$typeof){case v:return"Portal";case M:return(E.displayName||"Context")+".Provider";case C:return(E._context.displayName||"Context")+".Consumer";case B:var I=E.render;return E=E.displayName,E||(E=I.displayName||I.name||"",E=E!==""?"ForwardRef("+E+")":"ForwardRef"),E;case G:return I=E.displayName||null,I!==null?I:e(E.type)||"Memo";case u:I=E._payload,E=E._init;try{return e(E(I))}catch{}}return null}function t(E){return""+E}function n(E){try{var I=!1}catch{I=!0}if(I){I=console;var H=I.error,$=typeof Symbol=="function"&&Symbol.toStringTag&&E[Symbol.toStringTag]||E.constructor.name||"Object";return H.call(I,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",$),t(E)}}function r(E){if(E===T)return"<>";if(typeof E=="object"&&E!==null&&E.$$typeof===u)return"<...>";try{var I=e(E);return I?"<"+I+">":"<...>"}catch{return"<...>"}}function o(){var E=b.A;return E===null?null:E.getOwner()}function i(){return Error("react-stack-top-frame")}function l(E){if(w.call(E,"key")){var I=Object.getOwnPropertyDescriptor(E,"key").get;if(I&&I.isReactWarning)return!1}return E.key!==void 0}function s(E,I){function H(){g||(g=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",I))}H.isReactWarning=!0,Object.defineProperty(E,"key",{get:H,configurable:!0})}function a(){var E=e(this.type);return x[E]||(x[E]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),E=this.props.ref,E!==void 0?E:null}function f(E,I,H,$,X,V,q,ee){return H=V.ref,E={$$typeof:m,type:E,key:I,props:V,_owner:X},(H!==void 0?H:null)!==null?Object.defineProperty(E,"ref",{enumerable:!1,get:a}):Object.defineProperty(E,"ref",{enumerable:!1,value:null}),E._store={},Object.defineProperty(E._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(E,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(E,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:q}),Object.defineProperty(E,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ee}),Object.freeze&&(Object.freeze(E.props),Object.freeze(E)),E}function d(E,I,H,$,X,V,q,ee){var te=I.children;if(te!==void 0)if($)if(y(te)){for($=0;$<te.length;$++)h(te[$]);Object.freeze&&Object.freeze(te)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(te);if(w.call(I,"key")){te=e(E);var _=Object.keys(I).filter(function(Y){return Y!=="key"});$=0<_.length?"{key: someKey, "+_.join(": ..., ")+": ...}":"{key: someKey}",P[te+$]||(_=0<_.length?"{"+_.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
30
|
+
let props = %s;
|
|
31
|
+
<%s {...props} />
|
|
32
|
+
React keys must be passed directly to JSX without using spread:
|
|
33
|
+
let props = %s;
|
|
34
|
+
<%s key={someKey} {...props} />`,$,te,_,te),P[te+$]=!0)}if(te=null,H!==void 0&&(n(H),te=""+H),l(I)&&(n(I.key),te=""+I.key),"key"in I){H={};for(var Q in I)Q!=="key"&&(H[Q]=I[Q])}else H=I;return te&&s(H,typeof E=="function"?E.displayName||E.name||"Unknown":E),f(E,te,V,X,o(),H,q,ee)}function h(E){typeof E=="object"&&E!==null&&E.$$typeof===m&&E._store&&(E._store.validated=1)}var A=R,m=Symbol.for("react.transitional.element"),v=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),M=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),u=Symbol.for("react.lazy"),c=Symbol.for("react.activity"),p=Symbol.for("react.client.reference"),b=A.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,w=Object.prototype.hasOwnProperty,y=Array.isArray,F=console.createTask?console.createTask:function(){return null};A={"react-stack-bottom-frame":function(E){return E()}};var g,x={},O=A["react-stack-bottom-frame"].bind(A,i)(),S=F(r(i)),P={};dt.Fragment=T,dt.jsx=function(E,I,H,$,X){var V=1e4>b.recentlyCreatedOwnerStacks++;return d(E,I,H,!1,$,X,V?Error("react-stack-top-frame"):O,V?F(r(E)):S)},dt.jsxs=function(E,I,H,$,X){var V=1e4>b.recentlyCreatedOwnerStacks++;return d(E,I,H,!0,$,X,V?Error("react-stack-top-frame"):O,V?F(r(E)):S)}}()),dt}var cr;function Di(){return cr||(cr=1,process.env.NODE_ENV==="production"?Pt.exports=ki():Pt.exports=Ni()),Pt.exports}var L=Di();const Un=R.forwardRef(({className:e="",children:t,...n},r)=>L.jsx("button",{ref:r,className:`bg-[#2D2DF1] dark:bg-[#BFBFF9] transition-colors hover:bg-[#2929D9] dark:hover:bg-[#D4D4FA] text-white dark:text-[#001324] font-bold py-2.5 px-4 rounded-xl disabled:opacity-50 wallet-custom-font ${e}`.trim(),...n,type:"button",children:t||"Connect Wallet"}));Un.displayName="ConnectWalletButton";function Xt(){return typeof window<"u"}function We(e){return to(e)?(e.nodeName||"").toLowerCase():"#document"}function ge(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Fe(e){var t;return(t=(to(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function to(e){return Xt()?e instanceof Node||e instanceof ge(e).Node:!1}function re(e){return Xt()?e instanceof Element||e instanceof ge(e).Element:!1}function se(e){return Xt()?e instanceof HTMLElement||e instanceof ge(e).HTMLElement:!1}function Cn(e){return!Xt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ge(e).ShadowRoot}function Rt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=xe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Ii(e){return["table","td","th"].includes(We(e))}function Kt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Vn(e){const t=Jt(),n=re(e)?xe(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Mi(e){let t=Le(e);for(;se(t)&&!Ie(t);){if(Vn(t))return t;if(Kt(t))return null;t=Le(t)}return null}function Jt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ie(e){return["html","body","#document"].includes(We(e))}function xe(e){return ge(e).getComputedStyle(e)}function Qt(e){return re(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Le(e){if(We(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Cn(e)&&e.host||Fe(e);return Cn(t)?t.host:t}function no(e){const t=Le(e);return Ie(t)?e.ownerDocument?e.ownerDocument.body:e.body:se(t)&&Rt(t)?t:no(t)}function Be(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=no(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=ge(o);if(i){const s=Tn(l);return t.concat(l,l.visualViewport||[],Rt(o)?o:[],s&&n?Be(s):[])}return t.concat(o,Be(o,[],n))}function Tn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ge(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function pe(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Cn(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function ro(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function oo(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function Li(e){return e.mozInputSource===0&&e.isTrusted?!0:An()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $i(e){return Bi()?!1:!An()&&e.width===0&&e.height===0||An()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function ji(){return/apple/i.test(navigator.vendor)}function An(){const e=/android/i;return e.test(ro())||e.test(oo())}function Bi(){return oo().includes("jsdom/")}function fr(e,t){return["mouse","pen"].includes(e)}function Hi(e){return"nativeEvent"in e}function Wi(e){return e.matches("html,body")}function Ee(e){return(e==null?void 0:e.ownerDocument)||document}function an(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function _e(e){return"composedPath"in e?e.composedPath()[0]:e.target}const Ui="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function io(e){return se(e)&&e.matches(Ui)}function un(e){e.preventDefault(),e.stopPropagation()}function Vi(e){return e?e.getAttribute("role")==="combobox"&&io(e):!1}const Je=Math.min,ce=Math.max,yt=Math.round,kt=Math.floor,Oe=e=>({x:e,y:e}),Gi={left:"right",right:"left",bottom:"top",top:"bottom"},Yi={start:"end",end:"start"};function dr(e,t,n){return ce(e,Je(t,n))}function lt(e,t){return typeof e=="function"?e(t):e}function He(e){return e.split("-")[0]}function St(e){return e.split("-")[1]}function lo(e){return e==="x"?"y":"x"}function so(e){return e==="y"?"height":"width"}function Qe(e){return["top","bottom"].includes(He(e))?"y":"x"}function ao(e){return lo(Qe(e))}function qi(e,t,n){n===void 0&&(n=!1);const r=St(e),o=ao(e),i=so(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=Bt(l)),[l,Bt(l)]}function _i(e){const t=Bt(e);return[On(e),t,On(t)]}function On(e){return e.replace(/start|end/g,t=>Yi[t])}function zi(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}function Xi(e,t,n,r){const o=St(e);let i=zi(He(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(On)))),i}function Bt(e){return e.replace(/left|right|bottom|top/g,t=>Gi[t])}function Ki(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ji(e){return typeof e!="number"?Ki(e):{top:e,right:e,bottom:e,left:e}}function Ht(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}}/*!
|
|
35
|
+
* tabbable 6.2.0
|
|
36
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
37
|
+
*/var Qi=["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])"],Wt=Qi.join(","),uo=typeof Element>"u",ot=uo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ut=!uo&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Vt=function e(t,n){var r;n===void 0&&(n=!0);var o=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),i=o===""||o==="true",l=i||n&&t&&e(t.parentNode);return l},Zi=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},el=function(t,n,r){if(Vt(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(Wt));return n&&ot.call(t,Wt)&&o.unshift(t),o=o.filter(r),o},tl=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var l=i.shift();if(!Vt(l,!1))if(l.tagName==="SLOT"){var s=l.assignedElements(),a=s.length?s:l.children,f=e(a,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:l,candidates:f})}else{var d=ot.call(l,Wt);d&&r.filter(l)&&(n||!t.includes(l))&&o.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),A=!Vt(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&A){var m=e(h===!0?l.children:h.children,!0,r);r.flatten?o.push.apply(o,m):o.push({scopeParent:l,candidates:m})}else i.unshift.apply(i,l.children)}}return o},co=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},fo=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Zi(t))&&!co(t)?0:t.tabIndex},nl=function(t,n){var r=fo(t);return r<0&&n&&!co(t)?0:r},rl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},po=function(t){return t.tagName==="INPUT"},ol=function(t){return po(t)&&t.type==="hidden"},il=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},ll=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},sl=function(t){if(!t.name)return!0;var n=t.form||Ut(t),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(t.name));else try{o=r(t.name)}catch(l){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",l.message),!1}var i=ll(o,t.form);return!i||i===t},al=function(t){return po(t)&&t.type==="radio"},ul=function(t){return al(t)&&!sl(t)},cl=function(t){var n,r=t&&Ut(t),o=(n=r)===null||n===void 0?void 0:n.host,i=!1;if(r&&r!==t){var l,s,a;for(i=!!((l=o)!==null&&l!==void 0&&(s=l.ownerDocument)!==null&&s!==void 0&&s.contains(o)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!i&&o;){var f,d,h;r=Ut(o),o=(f=r)===null||f===void 0?void 0:f.host,i=!!((d=o)!==null&&d!==void 0&&(h=d.ownerDocument)!==null&&h!==void 0&&h.contains(o))}}return i},pr=function(t){var n=t.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},fl=function(t,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var i=ot.call(t,"details>summary:first-of-type"),l=i?t.parentElement:t;if(ot.call(l,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var s=t;t;){var a=t.parentElement,f=Ut(t);if(a&&!a.shadowRoot&&o(a)===!0)return pr(t);t.assignedSlot?t=t.assignedSlot:!a&&f!==t.ownerDocument?t=f.host:t=a}t=s}if(cl(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return pr(t);return!1},dl=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return ot.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},pl=function(t,n){return!(n.disabled||Vt(n)||ol(n)||fl(n,t)||il(n)||dl(n))},Fn=function(t,n){return!(ul(n)||fo(n)<0||!pl(t,n))},ml=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},gl=function e(t){var n=[],r=[];return t.forEach(function(o,i){var l=!!o.scopeParent,s=l?o.scopeParent:o,a=nl(s,l),f=l?e(o.candidates):s;a===0?l?n.push.apply(n,f):n.push(s):r.push({documentOrder:i,tabIndex:a,item:o,isScope:l,content:f})}),r.sort(rl).reduce(function(o,i){return i.isScope?o.push.apply(o,i.content):o.push(i.content),o},[]).concat(n)},Zt=function(t,n){n=n||{};var r;return n.getShadowRoot?r=tl([t],n.includeContainer,{filter:Fn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ml}):r=el(t,n.includeContainer,Fn.bind(null,n)),gl(r)},hl=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ot.call(t,Wt)===!1?!1:Fn(n,t)};function mr(e,t,n){let{reference:r,floating:o}=e;const i=Qe(t),l=ao(t),s=so(l),a=He(t),f=i==="y",d=r.x+r.width/2-o.width/2,h=r.y+r.height/2-o.height/2,A=r[s]/2-o[s]/2;let m;switch(a){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:h};break;case"left":m={x:r.x-o.width,y:h};break;default:m={x:r.x,y:r.y}}switch(St(t)){case"start":m[l]-=A*(n&&f?-1:1);break;case"end":m[l]+=A*(n&&f?-1:1);break}return m}const vl=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,s=i.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:h}=mr(f,r,a),A=r,m={},v=0;for(let T=0;T<s.length;T++){const{name:k,fn:N}=s[T],{x:C,y:M,data:B,reset:j}=await N({x:d,y:h,initialPlacement:r,placement:A,strategy:o,middlewareData:m,rects:f,platform:l,elements:{reference:e,floating:t}});d=C??d,h=M??h,m={...m,[k]:{...m[k],...B}},j&&v<=50&&(v++,typeof j=="object"&&(j.placement&&(A=j.placement),j.rects&&(f=j.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:h}=mr(f,A,a)),T=-1)}return{x:d,y:h,placement:A,strategy:o,middlewareData:m}};async function en(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:l,elements:s,strategy:a}=e,{boundary:f="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:A=!1,padding:m=0}=lt(t,e),v=Ji(m),k=s[A?h==="floating"?"reference":"floating":h],N=Ht(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(k)))==null||n?k:k.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(s.floating)),boundary:f,rootBoundary:d,strategy:a})),C=h==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(s.floating)),B=await(i.isElement==null?void 0:i.isElement(M))?await(i.getScale==null?void 0:i.getScale(M))||{x:1,y:1}:{x:1,y:1},j=Ht(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:C,offsetParent:M,strategy:a}):C);return{top:(N.top-j.top+v.top)/B.y,bottom:(j.bottom-N.bottom+v.bottom)/B.y,left:(N.left-j.left+v.left)/B.x,right:(j.right-N.right+v.right)/B.x}}const bl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:s,platform:a,elements:f}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:A,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:T=!0,...k}=lt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const N=He(o),C=Qe(s),M=He(s)===s,B=await(a.isRTL==null?void 0:a.isRTL(f.floating)),j=A||(M||!T?[Bt(s)]:_i(s)),W=v!=="none";!A&&W&&j.push(...Xi(s,T,v,B));const G=[s,...j],u=await en(t,k),c=[];let p=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&c.push(u[N]),h){const F=qi(o,l,B);c.push(u[F[0]],u[F[1]])}if(p=[...p,{placement:o,overflows:c}],!c.every(F=>F<=0)){var b,w;const F=(((b=i.flip)==null?void 0:b.index)||0)+1,g=G[F];if(g)return{data:{index:F,overflows:p},reset:{placement:g}};let x=(w=p.filter(O=>O.overflows[0]<=0).sort((O,S)=>O.overflows[1]-S.overflows[1])[0])==null?void 0:w.placement;if(!x)switch(m){case"bestFit":{var y;const O=(y=p.filter(S=>{if(W){const P=Qe(S.placement);return P===C||P==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(P=>P>0).reduce((P,E)=>P+E,0)]).sort((S,P)=>S[1]-P[1])[0])==null?void 0:y[0];O&&(x=O);break}case"initialPlacement":x=s;break}if(o!==x)return{reset:{placement:x}}}return{}}}};async function yl(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=He(n),s=St(n),a=Qe(n)==="y",f=["left","top"].includes(l)?-1:1,d=i&&a?-1:1,h=lt(t,e);let{mainAxis:A,crossAxis:m,alignmentAxis:v}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof v=="number"&&(m=s==="end"?v*-1:v),a?{x:m*d,y:A*f}:{x:A*f,y:m*d}}const xl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:s}=t,a=await yl(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+a.x,y:i+a.y,data:{...a,placement:l}}}}},wl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:s={fn:k=>{let{x:N,y:C}=k;return{x:N,y:C}}},...a}=lt(e,t),f={x:n,y:r},d=await en(t,a),h=Qe(He(o)),A=lo(h);let m=f[A],v=f[h];if(i){const k=A==="y"?"top":"left",N=A==="y"?"bottom":"right",C=m+d[k],M=m-d[N];m=dr(C,m,M)}if(l){const k=h==="y"?"top":"left",N=h==="y"?"bottom":"right",C=v+d[k],M=v-d[N];v=dr(C,v,M)}const T=s.fn({...t,[A]:m,[h]:v});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[A]:i,[h]:l}}}}}},El=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:s}=t,{apply:a=()=>{},...f}=lt(e,t),d=await en(t,f),h=He(o),A=St(o),m=Qe(o)==="y",{width:v,height:T}=i.floating;let k,N;h==="top"||h==="bottom"?(k=h,N=A===(await(l.isRTL==null?void 0:l.isRTL(s.floating))?"start":"end")?"left":"right"):(N=h,k=A==="end"?"top":"bottom");const C=T-d.top-d.bottom,M=v-d.left-d.right,B=Je(T-d[k],C),j=Je(v-d[N],M),W=!t.middlewareData.shift;let G=B,u=j;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(u=M),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(G=C),W&&!A){const p=ce(d.left,0),b=ce(d.right,0),w=ce(d.top,0),y=ce(d.bottom,0);m?u=v-2*(p!==0||b!==0?p+b:ce(d.left,d.right)):G=T-2*(w!==0||y!==0?w+y:ce(d.top,d.bottom))}await a({...t,availableWidth:u,availableHeight:G});const c=await l.getDimensions(s.floating);return v!==c.width||T!==c.height?{reset:{rects:!0}}:{}}}};function mo(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,l=o?e.offsetHeight:r,s=yt(n)!==i||yt(r)!==l;return s&&(n=i,r=l),{width:n,height:r,$:s}}function Gn(e){return re(e)?e:e.contextElement}function rt(e){const t=Gn(e);if(!se(t))return Oe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=mo(t);let l=(i?yt(n.width):n.width)/r,s=(i?yt(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Rl=Oe(0);function go(e){const t=ge(e);return!Jt()||!t.visualViewport?Rl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ge(e)?!1:t}function Ze(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Gn(e);let l=Oe(1);t&&(r?re(r)&&(l=rt(r)):l=rt(e));const s=Sl(i,n,r)?go(i):Oe(0);let a=(o.left+s.x)/l.x,f=(o.top+s.y)/l.y,d=o.width/l.x,h=o.height/l.y;if(i){const A=ge(i),m=r&&re(r)?ge(r):r;let v=A,T=Tn(v);for(;T&&r&&m!==v;){const k=rt(T),N=T.getBoundingClientRect(),C=xe(T),M=N.left+(T.clientLeft+parseFloat(C.paddingLeft))*k.x,B=N.top+(T.clientTop+parseFloat(C.paddingTop))*k.y;a*=k.x,f*=k.y,d*=k.x,h*=k.y,a+=M,f+=B,v=ge(T),T=Tn(v)}}return Ht({width:d,height:h,x:a,y:f})}function Yn(e,t){const n=Qt(e).scrollLeft;return t?t.left+n:Ze(Fe(e)).left+n}function ho(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:Yn(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function Cl(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=Fe(r),s=t?Kt(t.floating):!1;if(r===l||s&&i)return n;let a={scrollLeft:0,scrollTop:0},f=Oe(1);const d=Oe(0),h=se(r);if((h||!h&&!i)&&((We(r)!=="body"||Rt(l))&&(a=Qt(r)),se(r))){const m=Ze(r);f=rt(r),d.x=m.x+r.clientLeft,d.y=m.y+r.clientTop}const A=l&&!h&&!i?ho(l,a,!0):Oe(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+d.x+A.x,y:n.y*f.y-a.scrollTop*f.y+d.y+A.y}}function Tl(e){return Array.from(e.getClientRects())}function Al(e){const t=Fe(e),n=Qt(e),r=e.ownerDocument.body,o=ce(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=ce(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+Yn(e);const s=-n.scrollTop;return xe(r).direction==="rtl"&&(l+=ce(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:s}}function Ol(e,t){const n=ge(e),r=Fe(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,s=0,a=0;if(o){i=o.width,l=o.height;const f=Jt();(!f||f&&t==="fixed")&&(s=o.offsetLeft,a=o.offsetTop)}return{width:i,height:l,x:s,y:a}}function Fl(e,t){const n=Ze(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=se(e)?rt(e):Oe(1),l=e.clientWidth*i.x,s=e.clientHeight*i.y,a=o*i.x,f=r*i.y;return{width:l,height:s,x:a,y:f}}function gr(e,t,n){let r;if(t==="viewport")r=Ol(e,n);else if(t==="document")r=Al(Fe(e));else if(re(t))r=Fl(t,n);else{const o=go(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ht(r)}function vo(e,t){const n=Le(e);return n===t||!re(n)||Ie(n)?!1:xe(n).position==="fixed"||vo(n,t)}function Pl(e,t){const n=t.get(e);if(n)return n;let r=Be(e,[],!1).filter(s=>re(s)&&We(s)!=="body"),o=null;const i=xe(e).position==="fixed";let l=i?Le(e):e;for(;re(l)&&!Ie(l);){const s=xe(l),a=Vn(l);!a&&s.position==="fixed"&&(o=null),(i?!a&&!o:!a&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Rt(l)&&!a&&vo(e,l))?r=r.filter(d=>d!==l):o=s,l=Le(l)}return t.set(e,r),r}function kl(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?Kt(t)?[]:Pl(t,this._c):[].concat(n),r],s=l[0],a=l.reduce((f,d)=>{const h=gr(t,d,o);return f.top=ce(h.top,f.top),f.right=Je(h.right,f.right),f.bottom=Je(h.bottom,f.bottom),f.left=ce(h.left,f.left),f},gr(t,s,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Nl(e){const{width:t,height:n}=mo(e);return{width:t,height:n}}function Dl(e,t,n){const r=se(t),o=Fe(t),i=n==="fixed",l=Ze(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const a=Oe(0);if(r||!r&&!i)if((We(t)!=="body"||Rt(o))&&(s=Qt(t)),r){const A=Ze(t,!0,i,t);a.x=A.x+t.clientLeft,a.y=A.y+t.clientTop}else o&&(a.x=Yn(o));const f=o&&!r&&!i?ho(o,s):Oe(0),d=l.left+s.scrollLeft-a.x-f.x,h=l.top+s.scrollTop-a.y-f.y;return{x:d,y:h,width:l.width,height:l.height}}function cn(e){return xe(e).position==="static"}function hr(e,t){if(!se(e)||xe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Fe(e)===n&&(n=n.ownerDocument.body),n}function bo(e,t){const n=ge(e);if(Kt(e))return n;if(!se(e)){let o=Le(e);for(;o&&!Ie(o);){if(re(o)&&!cn(o))return o;o=Le(o)}return n}let r=hr(e,t);for(;r&&Ii(r)&&cn(r);)r=hr(r,t);return r&&Ie(r)&&cn(r)&&!Vn(r)?n:r||Mi(e)||n}const Il=async function(e){const t=this.getOffsetParent||bo,n=this.getDimensions,r=await n(e.floating);return{reference:Dl(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ml(e){return xe(e).direction==="rtl"}const Ll={convertOffsetParentRelativeRectToViewportRelativeRect:Cl,getDocumentElement:Fe,getClippingRect:kl,getOffsetParent:bo,getElementRects:Il,getClientRects:Tl,getDimensions:Nl,getScale:rt,isElement:re,isRTL:Ml};function yo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function $l(e,t){let n=null,r;const o=Fe(e);function i(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),i();const f=e.getBoundingClientRect(),{left:d,top:h,width:A,height:m}=f;if(s||t(),!A||!m)return;const v=kt(h),T=kt(o.clientWidth-(d+A)),k=kt(o.clientHeight-(h+m)),N=kt(d),M={rootMargin:-v+"px "+-T+"px "+-k+"px "+-N+"px",threshold:ce(0,Je(1,a))||1};let B=!0;function j(W){const G=W[0].intersectionRatio;if(G!==a){if(!B)return l();G?l(!1,G):r=setTimeout(()=>{l(!1,1e-7)},1e3)}G===1&&!yo(f,e.getBoundingClientRect())&&l(),B=!1}try{n=new IntersectionObserver(j,{...M,root:o.ownerDocument})}catch{n=new IntersectionObserver(j,M)}n.observe(e)}return l(!0),i}function xo(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=r,f=Gn(e),d=o||i?[...f?Be(f):[],...Be(t)]:[];d.forEach(N=>{o&&N.addEventListener("scroll",n,{passive:!0}),i&&N.addEventListener("resize",n)});const h=f&&s?$l(f,n):null;let A=-1,m=null;l&&(m=new ResizeObserver(N=>{let[C]=N;C&&C.target===f&&m&&(m.unobserve(t),cancelAnimationFrame(A),A=requestAnimationFrame(()=>{var M;(M=m)==null||M.observe(t)})),n()}),f&&!a&&m.observe(f),m.observe(t));let v,T=a?Ze(e):null;a&&k();function k(){const N=Ze(e);T&&!yo(T,N)&&n(),T=N,v=requestAnimationFrame(k)}return n(),()=>{var N;d.forEach(C=>{o&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),h==null||h(),(N=m)==null||N.disconnect(),m=null,a&&cancelAnimationFrame(v)}}const fn=en,jl=xl,Bl=wl,Hl=bl,Wl=El,Ul=(e,t,n)=>{const r=new Map,o={platform:Ll,...n},i={...o.platform,_c:r};return vl(e,t,{...o,platform:i})};var jt=typeof document<"u"?R.useLayoutEffect:R.useEffect;function Gt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Gt(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;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Gt(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function wo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function vr(e,t){const n=wo(e);return Math.round(t*n)/n}function dn(e){const t=D.useRef(e);return jt(()=>{t.current=e}),t}function Eo(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:s=!0,whileElementsMounted:a,open:f}=e,[d,h]=D.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[A,m]=D.useState(r);Gt(A,r)||m(r);const[v,T]=D.useState(null),[k,N]=D.useState(null),C=D.useCallback(S=>{S!==W.current&&(W.current=S,T(S))},[]),M=D.useCallback(S=>{S!==G.current&&(G.current=S,N(S))},[]),B=i||v,j=l||k,W=D.useRef(null),G=D.useRef(null),u=D.useRef(d),c=a!=null,p=dn(a),b=dn(o),w=dn(f),y=D.useCallback(()=>{if(!W.current||!G.current)return;const S={placement:t,strategy:n,middleware:A};b.current&&(S.platform=b.current),Ul(W.current,G.current,S).then(P=>{const E={...P,isPositioned:w.current!==!1};F.current&&!Gt(u.current,E)&&(u.current=E,bt.flushSync(()=>{h(E)}))})},[A,t,n,b,w]);jt(()=>{f===!1&&u.current.isPositioned&&(u.current.isPositioned=!1,h(S=>({...S,isPositioned:!1})))},[f]);const F=D.useRef(!1);jt(()=>(F.current=!0,()=>{F.current=!1}),[]),jt(()=>{if(B&&(W.current=B),j&&(G.current=j),B&&j){if(p.current)return p.current(B,j,y);y()}},[B,j,y,p,c]);const g=D.useMemo(()=>({reference:W,floating:G,setReference:C,setFloating:M}),[C,M]),x=D.useMemo(()=>({reference:B,floating:j}),[B,j]),O=D.useMemo(()=>{const S={position:n,left:0,top:0};if(!x.floating)return S;const P=vr(x.floating,d.x),E=vr(x.floating,d.y);return s?{...S,transform:"translate("+P+"px, "+E+"px)",...wo(x.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:E}},[n,s,x.floating,d.x,d.y]);return D.useMemo(()=>({...d,update:y,refs:g,elements:x,floatingStyles:O}),[d,y,g,x,O])}const qn=(e,t)=>({...jl(e),options:[e,t]}),Ro=(e,t)=>({...Bl(e),options:[e,t]}),So=(e,t)=>({...Hl(e),options:[e,t]}),Vl=(e,t)=>({...Wl(e),options:[e,t]});function Gl(e){const t=D.useRef(void 0),n=D.useCallback(r=>{const o=e.map(i=>{if(i!=null){if(typeof i=="function"){const l=i,s=l(r);return typeof s=="function"?s:()=>{l(null)}}return i.current=r,()=>{i.current=null}}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return D.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Co={...D},Yl=Co.useInsertionEffect,ql=Yl||(e=>e());function De(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ql(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var me=typeof document<"u"?R.useLayoutEffect:R.useEffect;let br=!1,_l=0;const yr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+_l++;function zl(){const[e,t]=D.useState(()=>br?yr():void 0);return me(()=>{e==null&&t(yr())},[]),D.useEffect(()=>{br=!0},[]),e}const Xl=Co.useId,it=Xl||zl;let Pn;process.env.NODE_ENV!=="production"&&(Pn=new Set);function Kl(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=Pn)!=null&&e.has(o))){var i;(i=Pn)==null||i.add(o),console.error(o)}}function Jl(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Ql=D.createContext(null),Zl=D.createContext(null),To=()=>{var e;return((e=D.useContext(Ql))==null?void 0:e.id)||null},_n=()=>D.useContext(Zl);function xt(e){return"data-floating-ui-"+e}function pn(e){const t=R.useRef(e);return me(()=>{t.current=e}),t}let xr=0;function tt(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(xr);const i=()=>e==null?void 0:e.focus({preventScroll:n});o?i():xr=requestAnimationFrame(i)}function wr(e,t){var n;let r=[],o=(n=e.find(i=>i.id===t))==null?void 0:n.parentId;for(;o;){const i=e.find(l=>l.id===o);o=i==null?void 0:i.parentId,i&&(r=r.concat(i))}return r}function mt(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(l=>{var s;return o.parentId===l.id&&((s=o.context)==null?void 0:s.open)})}),n=n.concat(r);return n}let nt=new WeakMap,Nt=new WeakSet,Dt={},mn=0;const es=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Ao=e=>e&&(e.host||Ao(e.parentNode)),ts=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=Ao(n);return e.contains(r)?r:null}).filter(n=>n!=null);function ns(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,l=ts(t,e),s=new Set,a=new Set(l),f=[];Dt[o]||(Dt[o]=new WeakMap);const d=Dt[o];l.forEach(h),A(t),s.clear();function h(m){!m||s.has(m)||(s.add(m),m.parentNode&&h(m.parentNode))}function A(m){!m||a.has(m)||[].forEach.call(m.children,v=>{if(We(v)!=="script")if(s.has(v))A(v);else{const T=i?v.getAttribute(i):null,k=T!==null&&T!=="false",N=nt.get(v)||0,C=i?N+1:N,M=(d.get(v)||0)+1;nt.set(v,C),d.set(v,M),f.push(v),C===1&&k&&Nt.add(v),M===1&&v.setAttribute(o,""),!k&&i&&v.setAttribute(i,"true")}})}return mn++,()=>{f.forEach(m=>{const v=nt.get(m)||0,T=i?v-1:v,k=(d.get(m)||0)-1;nt.set(m,T),d.set(m,k),T||(!Nt.has(m)&&i&&m.removeAttribute(i),Nt.delete(m)),k||m.removeAttribute(o)}),mn--,mn||(nt=new WeakMap,nt=new WeakMap,Nt=new WeakSet,Dt={})}}function Er(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=Ee(e[0]).body;return ns(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const tn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Oo(e,t){const n=Zt(e,tn());t==="prev"&&n.reverse();const r=n.indexOf(Ge(Ee(e)));return n.slice(r+1)[0]}function Fo(){return Oo(document.body,"next")}function Po(){return Oo(document.body,"prev")}function gt(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!pe(n,r)}function rs(e){Zt(e,tn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Rr(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const nn={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},Yt=D.forwardRef(function(t,n){const[r,o]=D.useState();me(()=>{ji()&&o("button")},[]);const i={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[xt("focus-guard")]:"",style:nn};return L.jsx("span",{...t,...i})}),ko=D.createContext(null),Sr=xt("portal");function os(e){e===void 0&&(e={});const{id:t,root:n}=e,r=it(),o=Do(),[i,l]=D.useState(null),s=D.useRef(null);return me(()=>()=>{i==null||i.remove(),queueMicrotask(()=>{s.current=null})},[i]),me(()=>{if(!r||s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const f=document.createElement("div");f.id=r,f.setAttribute(Sr,""),a.appendChild(f),s.current=f,l(f)},[t,r]),me(()=>{if(n===null||!r||s.current)return;let a=n||(o==null?void 0:o.portalNode);a&&!re(a)&&(a=a.current),a=a||document.body;let f=null;t&&(f=document.createElement("div"),f.id=t,a.appendChild(f));const d=document.createElement("div");d.id=r,d.setAttribute(Sr,""),a=f||a,a.appendChild(d),s.current=d,l(d)},[t,n,r,o]),i}function No(e){const{children:t,id:n,root:r,preserveTabOrder:o=!0}=e,i=os({id:n,root:r}),[l,s]=D.useState(null),a=D.useRef(null),f=D.useRef(null),d=D.useRef(null),h=D.useRef(null),A=l==null?void 0:l.modal,m=l==null?void 0:l.open,v=!!l&&!l.modal&&l.open&&o&&!!(r||i);return D.useEffect(()=>{if(!i||!o||A)return;function T(k){i&>(k)&&(k.type==="focusin"?Rr:rs)(i)}return i.addEventListener("focusin",T,!0),i.addEventListener("focusout",T,!0),()=>{i.removeEventListener("focusin",T,!0),i.removeEventListener("focusout",T,!0)}},[i,o,A]),D.useEffect(()=>{i&&(m||Rr(i))},[m,i]),L.jsxs(ko.Provider,{value:D.useMemo(()=>({preserveTabOrder:o,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:d,afterInsideRef:h,portalNode:i,setFocusManagerState:s}),[o,i]),children:[v&&i&&L.jsx(Yt,{"data-type":"outside",ref:a,onFocus:T=>{if(gt(T,i)){var k;(k=d.current)==null||k.focus()}else{const N=Po()||(l==null?void 0:l.domReference);N==null||N.focus()}}}),v&&i&&L.jsx("span",{"aria-owns":i.id,style:nn}),i&&bt.createPortal(t,i),v&&i&&L.jsx(Yt,{"data-type":"outside",ref:f,onFocus:T=>{if(gt(T,i)){var k;(k=h.current)==null||k.focus()}else{const N=Fo()||(l==null?void 0:l.domReference);N==null||N.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,T.nativeEvent,"focus-out"))}}})]})}const Do=()=>D.useContext(ko),kn="data-floating-ui-focusable";function Cr(e){return e?e.hasAttribute(kn)?e:e.querySelector("["+kn+"]")||e:null}function Tr(e){return D.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const is=20;let Ye=[];function ls(e){Ye=Ye.filter(t=>t.isConnected),e&&We(e)!=="body"&&(Ye.push(e),Ye.length>is&&(Ye=Ye.slice(-20)))}function Ar(){return Ye.slice().reverse().find(e=>e.isConnected)}function ss(e){const t=tn();return hl(e,t)?e:Zt(e,t)[0]||e}const as=D.forwardRef(function(t,n){return L.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:nn})});function Io(e){const{context:t,children:n,disabled:r=!1,order:o=["content"],guards:i=!0,initialFocus:l=0,returnFocus:s=!0,restoreFocus:a=!1,modal:f=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:h=!0,outsideElementsInert:A=!1}=e,{open:m,onOpenChange:v,events:T,dataRef:k,elements:{domReference:N,floating:C}}=t,M=De(()=>{var _;return(_=k.current.floatingContext)==null?void 0:_.nodeId}),B=typeof l=="number"&&l<0,j=Vi(N)&&B,W=es(),G=W?i:!0,u=!G||W&&A,c=pn(o),p=pn(l),b=pn(s),w=_n(),y=Do(),F=D.useRef(null),g=D.useRef(null),x=D.useRef(!1),O=D.useRef(!1),S=D.useRef(-1),P=y!=null,E=Cr(C),I=De(function(_){return _===void 0&&(_=E),_?Zt(_,tn()):[]}),H=De(_=>{const Q=I(_);return c.current.map(Y=>N&&Y==="reference"?N:E&&Y==="floating"?E:Q).filter(Boolean).flat()});D.useEffect(()=>{if(r||!f)return;function _(Y){if(Y.key==="Tab"){pe(E,Ge(Ee(E)))&&I().length===0&&!j&&un(Y);const U=H(),z=_e(Y);c.current[0]==="reference"&&z===N&&(un(Y),Y.shiftKey?tt(U[U.length-1]):tt(U[1])),c.current[1]==="floating"&&z===E&&Y.shiftKey&&(un(Y),tt(U[0]))}}const Q=Ee(E);return Q.addEventListener("keydown",_),()=>{Q.removeEventListener("keydown",_)}},[r,N,E,f,c,j,I,H]),D.useEffect(()=>{if(r||!C)return;function _(Q){const Y=_e(Q),z=I().indexOf(Y);z!==-1&&(S.current=z)}return C.addEventListener("focusin",_),()=>{C.removeEventListener("focusin",_)}},[r,C,I]),D.useEffect(()=>{if(r||!h)return;function _(){O.current=!0,setTimeout(()=>{O.current=!1})}function Q(Y){const U=Y.relatedTarget;queueMicrotask(()=>{const z=M(),K=!(pe(N,U)||pe(C,U)||pe(U,C)||pe(y==null?void 0:y.portalNode,U)||U!=null&&U.hasAttribute(xt("focus-guard"))||w&&(mt(w.nodesRef.current,z).find(Z=>{var ue,Ce;return pe((ue=Z.context)==null?void 0:ue.elements.floating,U)||pe((Ce=Z.context)==null?void 0:Ce.elements.domReference,U)})||wr(w.nodesRef.current,z).find(Z=>{var ue,Ce,ke;return[(ue=Z.context)==null?void 0:ue.elements.floating,Cr((Ce=Z.context)==null?void 0:Ce.elements.floating)].includes(U)||((ke=Z.context)==null?void 0:ke.elements.domReference)===U})));if(a&&K&&Ge(Ee(E))===Ee(E).body){se(E)&&E.focus();const Z=S.current,ue=I(),Ce=ue[Z]||ue[ue.length-1]||E;se(Ce)&&Ce.focus()}(j||!f)&&U&&K&&!O.current&&U!==Ar()&&(x.current=!0,v(!1,Y,"focus-out"))})}if(C&&se(N))return N.addEventListener("focusout",Q),N.addEventListener("pointerdown",_),C.addEventListener("focusout",Q),()=>{N.removeEventListener("focusout",Q),N.removeEventListener("pointerdown",_),C.removeEventListener("focusout",Q)}},[r,N,C,E,f,w,y,v,h,a,I,j,M]);const $=D.useRef(null),X=D.useRef(null),V=Tr([$,y==null?void 0:y.beforeInsideRef]),q=Tr([X,y==null?void 0:y.afterInsideRef]);D.useEffect(()=>{var _;if(r||!C)return;const Q=Array.from((y==null||(_=y.portalNode)==null?void 0:_.querySelectorAll("["+xt("portal")+"]"))||[]),Y=w&&!f?wr(w==null?void 0:w.nodesRef.current,M()).map(K=>{var Z;return(Z=K.context)==null?void 0:Z.elements.floating}):[],U=[C,...Q,...Y,F.current,g.current,$.current,X.current,y==null?void 0:y.beforeOutsideRef.current,y==null?void 0:y.afterOutsideRef.current,c.current.includes("reference")||j?N:null].filter(K=>K!=null),z=f||j?Er(U,!u,u):Er(U);return()=>{z()}},[r,N,C,f,c,y,j,G,u,w,M]),me(()=>{if(r||!se(E))return;const _=Ee(E),Q=Ge(_);queueMicrotask(()=>{const Y=H(E),U=p.current,z=(typeof U=="number"?Y[U]:U.current)||E,K=pe(E,Q);!B&&!K&&m&&tt(z,{preventScroll:z===E})})},[r,m,E,B,H,p]),me(()=>{if(r||!E)return;let _=!1,Q=!1;const Y=Ee(E),U=Ge(Y);let K=k.current.openEvent;ls(U);function Z(ke){let{open:Ot,reason:ct,event:Te,nested:Ft}=ke;if(Ot&&(K=Te),ct==="escape-key"&&(Q=!0),["hover","safe-polygon"].includes(ct)&&Te.type==="mouseleave"&&(x.current=!0),ct==="outside-press")if(Ft)x.current=!1,_=!0;else if(Li(Te)||$i(Te))x.current=!1;else{let lr=!1;document.createElement("div").focus({get preventScroll(){return lr=!0,!1}}),lr?(x.current=!1,_=!0):x.current=!0}}T.on("openchange",Z);const ue=Y.createElement("span");ue.setAttribute("tabindex","-1"),ue.setAttribute("aria-hidden","true"),Object.assign(ue.style,nn),P&&N&&N.insertAdjacentElement("afterend",ue);function Ce(){return typeof b.current=="boolean"?Q&&N?N:Ar()||ue:b.current.current||ue}return()=>{T.off("openchange",Z);const ke=Ge(Y),Ot=pe(C,ke)||w&&mt(w.nodesRef.current,M()).some(Te=>{var Ft;return pe((Ft=Te.context)==null?void 0:Ft.elements.floating,ke)});(Ot||K&&["click","mousedown"].includes(K.type))&&(Q=!0);const ct=Ce();queueMicrotask(()=>{const Te=ss(ct);b.current&&!x.current&&se(Te)&&(!(Te!==ke&&ke!==Y.body)||Ot)&&Te.focus({preventScroll:_}),ue.remove()})}},[r,C,E,b,k,T,w,P,N,M]),D.useEffect(()=>{queueMicrotask(()=>{x.current=!1})},[r]),me(()=>{if(!r&&y)return y.setFocusManagerState({modal:f,closeOnFocusOut:h,open:m,onOpenChange:v,domReference:N}),()=>{y.setFocusManagerState(null)}},[r,y,f,m,v,h,N]),me(()=>{if(r||!E||typeof MutationObserver!="function"||B)return;const _=()=>{const Y=E.getAttribute("tabindex"),U=I(),z=Ge(Ee(C)),K=U.indexOf(z);K!==-1&&(S.current=K),c.current.includes("floating")||z!==N&&U.length===0?Y!=="0"&&E.setAttribute("tabindex","0"):Y!=="-1"&&E.setAttribute("tabindex","-1")};_();const Q=new MutationObserver(_);return Q.observe(E,{childList:!0,subtree:!0,attributes:!0}),()=>{Q.disconnect()}},[r,C,E,N,c,I,B]);function ee(_){return r||!d||!f?null:L.jsx(as,{ref:_==="start"?F:g,onClick:Q=>v(!1,Q.nativeEvent),children:typeof d=="string"?d:"Dismiss"})}const te=!r&&G&&(f?!j:!0)&&(P||f);return L.jsxs(L.Fragment,{children:[te&&L.jsx(Yt,{"data-type":"inside",ref:V,onFocus:_=>{if(f){const Y=H();tt(o[0]==="reference"?Y[0]:Y[Y.length-1])}else if(y!=null&&y.preserveTabOrder&&y.portalNode)if(x.current=!1,gt(_,y.portalNode)){const Y=Fo()||N;Y==null||Y.focus()}else{var Q;(Q=y.beforeOutsideRef.current)==null||Q.focus()}}}),!j&&ee("start"),n,ee("end"),te&&L.jsx(Yt,{"data-type":"inside",ref:q,onFocus:_=>{if(f)tt(H()[0]);else if(y!=null&&y.preserveTabOrder&&y.portalNode)if(h&&(x.current=!0),gt(_,y.portalNode)){const Y=Po()||N;Y==null||Y.focus()}else{var Q;(Q=y.afterOutsideRef.current)==null||Q.focus()}}})]})}let It=0;function us(){const e=/iP(hone|ad|od)|iOS/.test(ro()),t=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,i=t.left?parseFloat(t.left):window.scrollX,l=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",o&&(t[r]=o+"px"),e){var s,a;const f=((s=window.visualViewport)==null?void 0:s.offsetLeft)||0,d=((a=window.visualViewport)==null?void 0:a.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(l-Math.floor(d))+"px",left:-(i-Math.floor(f))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[r]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(i,l))}}let Or=()=>{};const cs=D.forwardRef(function(t,n){const{lockScroll:r=!1,...o}=t;return me(()=>{if(r)return It++,It===1&&(Or=us()),()=>{It--,It===0&&Or()}},[r]),L.jsx("div",{ref:n,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})});function Fr(e){return se(e.target)&&e.target.tagName==="BUTTON"}function Pr(e){return io(e)}function Mo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:i}}=e,{enabled:l=!0,event:s="click",toggle:a=!0,ignoreMouse:f=!1,keyboardHandlers:d=!0,stickIfOpen:h=!0}=t,A=D.useRef(),m=D.useRef(!1),v=D.useMemo(()=>({onPointerDown(T){A.current=T.pointerType},onMouseDown(T){const k=A.current;T.button===0&&s!=="click"&&(fr(k)&&f||(n&&a&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="mousedown")?r(!1,T.nativeEvent,"click"):(T.preventDefault(),r(!0,T.nativeEvent,"click"))))},onClick(T){const k=A.current;if(s==="mousedown"&&A.current){A.current=void 0;return}fr(k)&&f||(n&&a&&(!(o.current.openEvent&&h)||o.current.openEvent.type==="click")?r(!1,T.nativeEvent,"click"):r(!0,T.nativeEvent,"click"))},onKeyDown(T){A.current=void 0,!(T.defaultPrevented||!d||Fr(T))&&(T.key===" "&&!Pr(i)&&(T.preventDefault(),m.current=!0),T.key==="Enter"&&r(!(n&&a),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!d||Fr(T)||Pr(i)||T.key===" "&&m.current&&(m.current=!1,r(!(n&&a),T.nativeEvent,"click"))}}),[o,i,s,f,d,r,n,h,a]);return D.useMemo(()=>l?{reference:v}:{},[l,v])}const fs={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ds={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},kr=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function Lo(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:l=!0,escapeKey:s=!0,outsidePress:a=!0,outsidePressEvent:f="pointerdown",referencePress:d=!1,referencePressEvent:h="pointerdown",ancestorScroll:A=!1,bubbles:m,capture:v}=t,T=_n(),k=De(typeof a=="function"?a:()=>!1),N=typeof a=="function"?k:a,C=D.useRef(!1),M=D.useRef(!1),{escapeKey:B,outsidePress:j}=kr(m),{escapeKey:W,outsidePress:G}=kr(v),u=D.useRef(!1),c=De(g=>{var x;if(!n||!l||!s||g.key!=="Escape"||u.current)return;const O=(x=i.current.floatingContext)==null?void 0:x.nodeId,S=T?mt(T.nodesRef.current,O):[];if(!B&&(g.stopPropagation(),S.length>0)){let P=!0;if(S.forEach(E=>{var I;if((I=E.context)!=null&&I.open&&!E.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,Hi(g)?g.nativeEvent:g,"escape-key")}),p=De(g=>{var x;const O=()=>{var S;c(g),(S=_e(g))==null||S.removeEventListener("keydown",O)};(x=_e(g))==null||x.addEventListener("keydown",O)}),b=De(g=>{var x;const O=C.current;C.current=!1;const S=M.current;if(M.current=!1,f==="click"&&S||O||typeof N=="function"&&!N(g))return;const P=_e(g),E="["+xt("inert")+"]",I=Ee(o.floating).querySelectorAll(E);let H=re(P)?P:null;for(;H&&!Ie(H);){const q=Le(H);if(Ie(q)||!re(q))break;H=q}if(I.length&&re(P)&&!Wi(P)&&!pe(P,o.floating)&&Array.from(I).every(q=>!pe(H,q)))return;if(se(P)&&F){const q=Ie(P),ee=xe(P),te=/auto|scroll/,_=q||te.test(ee.overflowX),Q=q||te.test(ee.overflowY),Y=_&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,U=Q&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,z=ee.direction==="rtl",K=U&&(z?g.offsetX<=P.offsetWidth-P.clientWidth:g.offsetX>P.clientWidth),Z=Y&&g.offsetY>P.clientHeight;if(K||Z)return}const $=(x=i.current.floatingContext)==null?void 0:x.nodeId,X=T&&mt(T.nodesRef.current,$).some(q=>{var ee;return an(g,(ee=q.context)==null?void 0:ee.elements.floating)});if(an(g,o.floating)||an(g,o.domReference)||X)return;const V=T?mt(T.nodesRef.current,$):[];if(V.length>0){let q=!0;if(V.forEach(ee=>{var te;if((te=ee.context)!=null&&te.open&&!ee.context.dataRef.current.__outsidePressBubbles){q=!1;return}}),!q)return}r(!1,g,"outside-press")}),w=De(g=>{var x;const O=()=>{var S;b(g),(S=_e(g))==null||S.removeEventListener(f,O)};(x=_e(g))==null||x.addEventListener(f,O)});D.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=B,i.current.__outsidePressBubbles=j;let g=-1;function x(I){r(!1,I,"ancestor-scroll")}function O(){window.clearTimeout(g),u.current=!0}function S(){g=window.setTimeout(()=>{u.current=!1},Jt()?5:0)}const P=Ee(o.floating);s&&(P.addEventListener("keydown",W?p:c,W),P.addEventListener("compositionstart",O),P.addEventListener("compositionend",S)),N&&P.addEventListener(f,G?w:b,G);let E=[];return A&&(re(o.domReference)&&(E=Be(o.domReference)),re(o.floating)&&(E=E.concat(Be(o.floating))),!re(o.reference)&&o.reference&&o.reference.contextElement&&(E=E.concat(Be(o.reference.contextElement)))),E=E.filter(I=>{var H;return I!==((H=P.defaultView)==null?void 0:H.visualViewport)}),E.forEach(I=>{I.addEventListener("scroll",x,{passive:!0})}),()=>{s&&(P.removeEventListener("keydown",W?p:c,W),P.removeEventListener("compositionstart",O),P.removeEventListener("compositionend",S)),N&&P.removeEventListener(f,G?w:b,G),E.forEach(I=>{I.removeEventListener("scroll",x)}),window.clearTimeout(g)}},[i,o,s,N,f,n,r,A,l,B,j,c,W,p,b,G,w]),D.useEffect(()=>{C.current=!1},[N,f]);const y=D.useMemo(()=>({onKeyDown:c,...d&&{[fs[h]]:g=>{r(!1,g.nativeEvent,"reference-press")},...h!=="click"&&{onClick(g){r(!1,g.nativeEvent,"reference-press")}}}}),[c,r,d,h]),F=D.useMemo(()=>({onKeyDown:c,onMouseDown(){M.current=!0},onMouseUp(){M.current=!0},[ds[f]]:()=>{C.current=!0}}),[c,f]);return D.useMemo(()=>l?{reference:y,floating:F}:{},[l,y,F])}function ps(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=it(),i=D.useRef({}),[l]=D.useState(()=>Jl()),s=To()!=null;if(process.env.NODE_ENV!=="production"){const m=r.reference;m&&!re(m)&&Kl("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,f]=D.useState(r.reference),d=De((m,v,T)=>{i.current.openEvent=m?v:void 0,l.emit("openchange",{open:m,event:v,reason:T,nested:s}),n==null||n(m,v,T)}),h=D.useMemo(()=>({setPositionReference:f}),[]),A=D.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return D.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:A,events:l,floatingId:o,refs:h}),[t,d,A,l,o,h])}function $o(e){e===void 0&&(e={});const{nodeId:t}=e,n=ps({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=D.useState(null),[s,a]=D.useState(null),d=(o==null?void 0:o.domReference)||i,h=D.useRef(null),A=_n();me(()=>{d&&(h.current=d)},[d]);const m=Eo({...e,elements:{...o,...s&&{reference:s}}}),v=D.useCallback(M=>{const B=re(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),contextElement:M}:M;a(B),m.refs.setReference(B)},[m.refs]),T=D.useCallback(M=>{(re(M)||M===null)&&(h.current=M,l(M)),(re(m.refs.reference.current)||m.refs.reference.current===null||M!==null&&!re(M))&&m.refs.setReference(M)},[m.refs]),k=D.useMemo(()=>({...m.refs,setReference:T,setPositionReference:v,domReference:h}),[m.refs,T,v]),N=D.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),C=D.useMemo(()=>({...m,...r,refs:k,elements:N,nodeId:t}),[m,k,N,t,r]);return me(()=>{r.dataRef.current.floatingContext=C;const M=A==null?void 0:A.nodesRef.current.find(B=>B.id===t);M&&(M.context=C)}),D.useMemo(()=>({...m,context:C,refs:k,elements:N}),[m,k,N,C])}const Nr="active",Dr="selected";function gn(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Nr]:l,[Dr]:s,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[kn]:""},...i,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[f,d]=a;if(!(o&&[Nr,Dr].includes(f)))if(f.indexOf("on")===0){if(r.has(f)||r.set(f,[]),typeof d=="function"){var h;(h=r.get(f))==null||h.push(d),l[f]=function(){for(var A,m=arguments.length,v=new Array(m),T=0;T<m;T++)v[T]=arguments[T];return(A=r.get(f))==null?void 0:A.map(k=>k(...v)).find(k=>k!==void 0)}}}else l[f]=d}),l),{})}}function jo(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),o=D.useCallback(s=>gn(s,e,"reference"),t),i=D.useCallback(s=>gn(s,e,"floating"),n),l=D.useCallback(s=>gn(s,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const ms=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function gs(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:l="dialog"}=t,s=(n=ms.get(l))!=null?n:l,a=it(),d=To()!=null,h=D.useMemo(()=>s==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":s==="alertdialog"?"dialog":s,"aria-controls":r?o:void 0,...s==="listbox"&&{role:"combobox"},...s==="menu"&&{id:a},...s==="menu"&&d&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[s,o,d,r,a,l]),A=D.useMemo(()=>{const v={id:o,...s&&{role:s}};return s==="tooltip"||l==="label"?v:{...v,...s==="menu"&&{"aria-labelledby":a}}},[s,o,a,l]),m=D.useCallback(v=>{let{active:T,selected:k}=v;const N={role:"option",...T&&{id:o+"-option"}};switch(l){case"select":return{...N,"aria-selected":T&&k};case"combobox":return{...N,...T&&{"aria-selected":!0}}}return{}},[o,l]);return D.useMemo(()=>i?{reference:h,floating:A,item:m}:{},[i,h,A,m])}function Bo({wallets:e,handleWalletClick:t}){return L.jsxs("ul",{className:"space-y-1.5",children:[e.map(n=>L.jsx("li",{children:L.jsxs("button",{onClick:()=>t(n),className:"flex w-full items-center gap-3 py-1.5 px-1.5 text-left text-gray-800 dark:text-[#E9E9FD] transition-colors hover:bg-[#E9E9FD] dark:hover:bg-[#192A39] rounded-xl",children:[L.jsx("div",{className:"flex-shrink-0 h-8 w-8 rounded-md overflow-hidden bg-gray-50 dark:bg-transparent flex items-center justify-center",children:L.jsx("img",{src:n.metadata.icon,alt:`${n.metadata.name} icon`,className:"h-8 w-8 object-contain rounded-md"})}),L.jsx("span",{className:"text-lg font-bold wallet-custom-font",children:n.metadata.name})]})},n.id)),e.length===0&&L.jsx("p",{className:"text-center text-gray-500 dark:text-gray-400",children:"No wallets found."})]})}function Ho({children:e}){const[t,n]=R.useState(!1),[r,o]=R.useState(null),{wallets:i,activeAddress:l}=zt.useWallet(),{refs:s,context:a}=$o({open:t,onOpenChange:W=>{W&&l||(W?(n(!0),o("starting"),requestAnimationFrame(()=>{o("entered")})):(o("exiting"),setTimeout(()=>{n(!1),o(null)},150)))}}),f=Mo(a),d=Lo(a,{outsidePressEvent:"mousedown"}),h=gs(a,{role:"dialog"}),{getReferenceProps:A,getFloatingProps:m}=jo([f,d,h]),v=it(),T=it(),k=async W=>{try{await W.connect(),a.onOpenChange(!1)}catch(G){console.error(`Error connecting to ${W.metadata.name}:`,G),a.onOpenChange(!1)}},N=W=>{l||a.onOpenChange(!0)},C=e||L.jsx(Un,{}),M=Gl([s.setReference,C.ref||null]),B={...A(),ref:M,onClick:N},j=R.cloneElement(C,B);return L.jsxs(L.Fragment,{children:[j,L.jsx(No,{id:"wallet-dialog-portal",children:t&&L.jsx(cs,{className:"grid place-items-center z-50 transition-opacity duration-150 ease-in-out bg-black/30 dark:bg-black/50 data-[state=starting]:opacity-0 data-[state=exiting]:opacity-0 data-[state=entered]:opacity-100","data-state":r,lockScroll:!0,children:L.jsx(Io,{context:a,modal:!0,children:L.jsxs("div",{ref:s.setFloating,...m({"aria-labelledby":v,"aria-describedby":T}),"data-state":r,className:"w-full max-w-sm rounded-3xl bg-white dark:bg-[#001324] shadow-xl transform transition-all duration-150 ease-in-out data-[state=starting]:opacity-0 data-[state=starting]:scale-90 data-[state=exiting]:opacity-0 data-[state=exiting]:scale-90 data-[state=entered]:opacity-100 data-[state=entered]:scale-100",style:{marginTop:"-0.5rem"},children:[L.jsxs("div",{className:"relative flex items-center px-6 pt-5 pb-4",children:[L.jsx("h2",{id:v,className:"text-xl font-bold text-gray-900 dark:text-[#E9E9FD] wallet-custom-font",children:"Connect a Wallet"}),L.jsx("button",{onClick:()=>a.onOpenChange(!1),className:"absolute right-4 rounded-full bg-gray-100 dark:bg-[#192A39]/75 p-2 text-gray-500 dark:text-gray-400 hover:bg-gray-200 dark:hover:bg-[#192A39] hover:text-gray-700 dark:hover:text-[#D4D4FA]","aria-label":"Close dialog",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})]}),L.jsx("div",{className:"px-4 pb-3",children:L.jsx(Bo,{wallets:i,handleWalletClick:k})}),L.jsxs("div",{className:"px-6 py-5 border-t border-gray-200 dark:border-[#192A39] flex items-center justify-between",children:[L.jsx("span",{className:"text-gray-600 dark:text-[#99A1A7] text-sm",children:"Need an Algorand wallet?"}),L.jsx("a",{href:"https://algorand.co/wallets",className:"text-[#2D2DF1]/80 dark:text-[#6C6CF1] font-medium text-sm hover:text-[#2D2DF1] dark:hover:text-[#8080F3]",target:"_blank",rel:"noopener noreferrer",children:"Start here →"})]})]})})})})]})}var hs=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,hn=Math.ceil,ve=Math.floor,fe="[BigNumber Error] ",Ir=fe+"Number primitive has more than 15 significant digits: ",we=1e14,J=14,Mr=9007199254740991,vn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],je=1e7,de=1e9;function Wo(e){var t,n,r,o=C.prototype={constructor:C,toString:null,valueOf:null},i=new C(1),l=20,s=4,a=-7,f=21,d=-1e7,h=1e7,A=!1,m=1,v=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},k="0123456789abcdefghijklmnopqrstuvwxyz",N=!0;function C(u,c){var p,b,w,y,F,g,x,O,S=this;if(!(S instanceof C))return new C(u,c);if(c==null){if(u&&u._isBigNumber===!0){S.s=u.s,!u.c||u.e>h?S.c=S.e=null:u.e<d?S.c=[S.e=0]:(S.e=u.e,S.c=u.c.slice());return}if((g=typeof u=="number")&&u*0==0){if(S.s=1/u<0?(u=-u,-1):1,u===~~u){for(y=0,F=u;F>=10;F/=10,y++);y>h?S.c=S.e=null:(S.e=y,S.c=[u]);return}O=String(u)}else{if(!hs.test(O=String(u)))return r(S,O,g);S.s=O.charCodeAt(0)==45?(O=O.slice(1),-1):1}(y=O.indexOf("."))>-1&&(O=O.replace(".","")),(F=O.search(/e/i))>0?(y<0&&(y=F),y+=+O.slice(F+1),O=O.substring(0,F)):y<0&&(y=O.length)}else{if(oe(c,2,k.length,"Base"),c==10&&N)return S=new C(u),W(S,l+S.e+1,s);if(O=String(u),g=typeof u=="number"){if(u*0!=0)return r(S,O,g,c);if(S.s=1/u<0?(O=O.slice(1),-1):1,C.DEBUG&&O.replace(/^0\.0*|\./,"").length>15)throw Error(Ir+u)}else S.s=O.charCodeAt(0)===45?(O=O.slice(1),-1):1;for(p=k.slice(0,c),y=F=0,x=O.length;F<x;F++)if(p.indexOf(b=O.charAt(F))<0){if(b=="."){if(F>y){y=x;continue}}else if(!w&&(O==O.toUpperCase()&&(O=O.toLowerCase())||O==O.toLowerCase()&&(O=O.toUpperCase()))){w=!0,F=-1,y=0;continue}return r(S,String(u),g,c)}g=!1,O=n(O,c,10,S.s),(y=O.indexOf("."))>-1?O=O.replace(".",""):y=O.length}for(F=0;O.charCodeAt(F)===48;F++);for(x=O.length;O.charCodeAt(--x)===48;);if(O=O.slice(F,++x)){if(x-=F,g&&C.DEBUG&&x>15&&(u>Mr||u!==ve(u)))throw Error(Ir+S.s*u);if((y=y-F-1)>h)S.c=S.e=null;else if(y<d)S.c=[S.e=0];else{if(S.e=y,S.c=[],F=(y+1)%J,y<0&&(F+=J),F<x){for(F&&S.c.push(+O.slice(0,F)),x-=J;F<x;)S.c.push(+O.slice(F,F+=J));F=J-(O=O.slice(F)).length}else F-=x;for(;F--;O+="0");S.c.push(+O)}}else S.c=[S.e=0]}C.clone=Wo,C.ROUND_UP=0,C.ROUND_DOWN=1,C.ROUND_CEIL=2,C.ROUND_FLOOR=3,C.ROUND_HALF_UP=4,C.ROUND_HALF_DOWN=5,C.ROUND_HALF_EVEN=6,C.ROUND_HALF_CEIL=7,C.ROUND_HALF_FLOOR=8,C.EUCLID=9,C.config=C.set=function(u){var c,p;if(u!=null)if(typeof u=="object"){if(u.hasOwnProperty(c="DECIMAL_PLACES")&&(p=u[c],oe(p,0,de,c),l=p),u.hasOwnProperty(c="ROUNDING_MODE")&&(p=u[c],oe(p,0,8,c),s=p),u.hasOwnProperty(c="EXPONENTIAL_AT")&&(p=u[c],p&&p.pop?(oe(p[0],-1e9,0,c),oe(p[1],0,de,c),a=p[0],f=p[1]):(oe(p,-1e9,de,c),a=-(f=p<0?-p:p))),u.hasOwnProperty(c="RANGE"))if(p=u[c],p&&p.pop)oe(p[0],-1e9,-1,c),oe(p[1],1,de,c),d=p[0],h=p[1];else if(oe(p,-1e9,de,c),p)d=-(h=p<0?-p:p);else throw Error(fe+c+" cannot be zero: "+p);if(u.hasOwnProperty(c="CRYPTO"))if(p=u[c],p===!!p)if(p)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))A=p;else throw A=!p,Error(fe+"crypto unavailable");else A=p;else throw Error(fe+c+" not true or false: "+p);if(u.hasOwnProperty(c="MODULO_MODE")&&(p=u[c],oe(p,0,9,c),m=p),u.hasOwnProperty(c="POW_PRECISION")&&(p=u[c],oe(p,0,de,c),v=p),u.hasOwnProperty(c="FORMAT"))if(p=u[c],typeof p=="object")T=p;else throw Error(fe+c+" not an object: "+p);if(u.hasOwnProperty(c="ALPHABET"))if(p=u[c],typeof p=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(p))N=p.slice(0,10)=="0123456789",k=p;else throw Error(fe+c+" invalid: "+p)}else throw Error(fe+"Object expected: "+u);return{DECIMAL_PLACES:l,ROUNDING_MODE:s,EXPONENTIAL_AT:[a,f],RANGE:[d,h],CRYPTO:A,MODULO_MODE:m,POW_PRECISION:v,FORMAT:T,ALPHABET:k}},C.isBigNumber=function(u){if(!u||u._isBigNumber!==!0)return!1;if(!C.DEBUG)return!0;var c,p,b=u.c,w=u.e,y=u.s;e:if({}.toString.call(b)=="[object Array]"){if((y===1||y===-1)&&w>=-1e9&&w<=de&&w===ve(w)){if(b[0]===0){if(w===0&&b.length===1)return!0;break e}if(c=(w+1)%J,c<1&&(c+=J),String(b[0]).length==c){for(c=0;c<b.length;c++)if(p=b[c],p<0||p>=we||p!==ve(p))break e;if(p!==0)return!0}}}else if(b===null&&w===null&&(y===null||y===1||y===-1))return!0;throw Error(fe+"Invalid BigNumber: "+u)},C.maximum=C.max=function(){return B(arguments,-1)},C.minimum=C.min=function(){return B(arguments,1)},C.random=function(){var u=9007199254740992,c=Math.random()*u&2097151?function(){return ve(Math.random()*u)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(p){var b,w,y,F,g,x=0,O=[],S=new C(i);if(p==null?p=l:oe(p,0,de),F=hn(p/J),A)if(crypto.getRandomValues){for(b=crypto.getRandomValues(new Uint32Array(F*=2));x<F;)g=b[x]*131072+(b[x+1]>>>11),g>=9e15?(w=crypto.getRandomValues(new Uint32Array(2)),b[x]=w[0],b[x+1]=w[1]):(O.push(g%1e14),x+=2);x=F/2}else if(crypto.randomBytes){for(b=crypto.randomBytes(F*=7);x<F;)g=(b[x]&31)*281474976710656+b[x+1]*1099511627776+b[x+2]*4294967296+b[x+3]*16777216+(b[x+4]<<16)+(b[x+5]<<8)+b[x+6],g>=9e15?crypto.randomBytes(7).copy(b,x):(O.push(g%1e14),x+=7);x=F/7}else throw A=!1,Error(fe+"crypto unavailable");if(!A)for(;x<F;)g=c(),g<9e15&&(O[x++]=g%1e14);for(F=O[--x],p%=J,F&&p&&(g=vn[J-p],O[x]=ve(F/g)*g);O[x]===0;O.pop(),x--);if(x<0)O=[y=0];else{for(y=-1;O[0]===0;O.splice(0,1),y-=J);for(x=1,g=O[0];g>=10;g/=10,x++);x<J&&(y-=J-x)}return S.e=y,S.c=O,S}}(),C.sum=function(){for(var u=1,c=arguments,p=new C(c[0]);u<c.length;)p=p.plus(c[u++]);return p},n=function(){var u="0123456789";function c(p,b,w,y){for(var F,g=[0],x,O=0,S=p.length;O<S;){for(x=g.length;x--;g[x]*=b);for(g[0]+=y.indexOf(p.charAt(O++)),F=0;F<g.length;F++)g[F]>w-1&&(g[F+1]==null&&(g[F+1]=0),g[F+1]+=g[F]/w|0,g[F]%=w)}return g.reverse()}return function(p,b,w,y,F){var g,x,O,S,P,E,I,H,$=p.indexOf("."),X=l,V=s;for($>=0&&(S=v,v=0,p=p.replace(".",""),H=new C(b),E=H.pow(p.length-$),v=S,H.c=c(Ne(he(E.c),E.e,"0"),10,w,u),H.e=H.c.length),I=c(p,b,w,F?(g=k,u):(g=u,k)),O=S=I.length;I[--S]==0;I.pop());if(!I[0])return g.charAt(0);if($<0?--O:(E.c=I,E.e=O,E.s=y,E=t(E,H,X,V,w),I=E.c,P=E.r,O=E.e),x=O+X+1,$=I[x],S=w/2,P=P||x<0||I[x+1]!=null,P=V<4?($!=null||P)&&(V==0||V==(E.s<0?3:2)):$>S||$==S&&(V==4||P||V==6&&I[x-1]&1||V==(E.s<0?8:7)),x<1||!I[0])p=P?Ne(g.charAt(1),-X,g.charAt(0)):g.charAt(0);else{if(I.length=x,P)for(--w;++I[--x]>w;)I[x]=0,x||(++O,I=[1].concat(I));for(S=I.length;!I[--S];);for($=0,p="";$<=S;p+=g.charAt(I[$++]));p=Ne(p,O,g.charAt(0))}return p}}(),t=function(){function u(b,w,y){var F,g,x,O,S=0,P=b.length,E=w%je,I=w/je|0;for(b=b.slice();P--;)x=b[P]%je,O=b[P]/je|0,F=I*x+O*E,g=E*x+F%je*je+S,S=(g/y|0)+(F/je|0)+I*O,b[P]=g%y;return S&&(b=[S].concat(b)),b}function c(b,w,y,F){var g,x;if(y!=F)x=y>F?1:-1;else for(g=x=0;g<y;g++)if(b[g]!=w[g]){x=b[g]>w[g]?1:-1;break}return x}function p(b,w,y,F){for(var g=0;y--;)b[y]-=g,g=b[y]<w[y]?1:0,b[y]=g*F+b[y]-w[y];for(;!b[0]&&b.length>1;b.splice(0,1));}return function(b,w,y,F,g){var x,O,S,P,E,I,H,$,X,V,q,ee,te,_,Q,Y,U,z=b.s==w.s?1:-1,K=b.c,Z=w.c;if(!K||!K[0]||!Z||!Z[0])return new C(!b.s||!w.s||(K?Z&&K[0]==Z[0]:!Z)?NaN:K&&K[0]==0||!Z?z*0:z/0);for($=new C(z),X=$.c=[],O=b.e-w.e,z=y+O+1,g||(g=we,O=be(b.e/J)-be(w.e/J),z=z/J|0),S=0;Z[S]==(K[S]||0);S++);if(Z[S]>(K[S]||0)&&O--,z<0)X.push(1),P=!0;else{for(_=K.length,Y=Z.length,S=0,z+=2,E=ve(g/(Z[0]+1)),E>1&&(Z=u(Z,E,g),K=u(K,E,g),Y=Z.length,_=K.length),te=Y,V=K.slice(0,Y),q=V.length;q<Y;V[q++]=0);U=Z.slice(),U=[0].concat(U),Q=Z[0],Z[1]>=g/2&&Q++;do{if(E=0,x=c(Z,V,Y,q),x<0){if(ee=V[0],Y!=q&&(ee=ee*g+(V[1]||0)),E=ve(ee/Q),E>1)for(E>=g&&(E=g-1),I=u(Z,E,g),H=I.length,q=V.length;c(I,V,H,q)==1;)E--,p(I,Y<H?U:Z,H,g),H=I.length,x=1;else E==0&&(x=E=1),I=Z.slice(),H=I.length;if(H<q&&(I=[0].concat(I)),p(V,I,q,g),q=V.length,x==-1)for(;c(Z,V,Y,q)<1;)E++,p(V,Y<q?U:Z,q,g),q=V.length}else x===0&&(E++,V=[0]);X[S++]=E,V[0]?V[q++]=K[te]||0:(V=[K[te]],q=1)}while((te++<_||V[0]!=null)&&z--);P=V[0]!=null,X[0]||X.splice(0,1)}if(g==we){for(S=1,z=X[0];z>=10;z/=10,S++);W($,y+($.e=S+O*J-1)+1,F,P)}else $.e=O,$.r=+P;return $}}();function M(u,c,p,b){var w,y,F,g,x;if(p==null?p=s:oe(p,0,8),!u.c)return u.toString();if(w=u.c[0],F=u.e,c==null)x=he(u.c),x=b==1||b==2&&(F<=a||F>=f)?Lt(x,F):Ne(x,F,"0");else if(u=W(new C(u),c,p),y=u.e,x=he(u.c),g=x.length,b==1||b==2&&(c<=y||y<=a)){for(;g<c;x+="0",g++);x=Lt(x,y)}else if(c-=F,x=Ne(x,y,"0"),y+1>g){if(--c>0)for(x+=".";c--;x+="0");}else if(c+=y-g,c>0)for(y+1==g&&(x+=".");c--;x+="0");return u.s<0&&w?"-"+x:x}function B(u,c){for(var p,b,w=1,y=new C(u[0]);w<u.length;w++)b=new C(u[w]),(!b.s||(p=Ve(y,b))===c||p===0&&y.s===c)&&(y=b);return y}function j(u,c,p){for(var b=1,w=c.length;!c[--w];c.pop());for(w=c[0];w>=10;w/=10,b++);return(p=b+p*J-1)>h?u.c=u.e=null:p<d?u.c=[u.e=0]:(u.e=p,u.c=c),u}r=function(){var u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,c=/^([^.]+)\.$/,p=/^\.([^.]+)$/,b=/^-?(Infinity|NaN)$/,w=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(y,F,g,x){var O,S=g?F:F.replace(w,"");if(b.test(S))y.s=isNaN(S)?null:S<0?-1:1;else{if(!g&&(S=S.replace(u,function(P,E,I){return O=(I=I.toLowerCase())=="x"?16:I=="b"?2:8,!x||x==O?E:P}),x&&(O=x,S=S.replace(c,"$1").replace(p,"0.$1")),F!=S))return new C(S,O);if(C.DEBUG)throw Error(fe+"Not a"+(x?" base "+x:"")+" number: "+F);y.s=null}y.c=y.e=null}}();function W(u,c,p,b){var w,y,F,g,x,O,S,P=u.c,E=vn;if(P){e:{for(w=1,g=P[0];g>=10;g/=10,w++);if(y=c-w,y<0)y+=J,F=c,x=P[O=0],S=ve(x/E[w-F-1]%10);else if(O=hn((y+1)/J),O>=P.length)if(b){for(;P.length<=O;P.push(0));x=S=0,w=1,y%=J,F=y-J+1}else break e;else{for(x=g=P[O],w=1;g>=10;g/=10,w++);y%=J,F=y-J+w,S=F<0?0:ve(x/E[w-F-1]%10)}if(b=b||c<0||P[O+1]!=null||(F<0?x:x%E[w-F-1]),b=p<4?(S||b)&&(p==0||p==(u.s<0?3:2)):S>5||S==5&&(p==4||b||p==6&&(y>0?F>0?x/E[w-F]:0:P[O-1])%10&1||p==(u.s<0?8:7)),c<1||!P[0])return P.length=0,b?(c-=u.e+1,P[0]=E[(J-c%J)%J],u.e=-c||0):P[0]=u.e=0,u;if(y==0?(P.length=O,g=1,O--):(P.length=O+1,g=E[J-y],P[O]=F>0?ve(x/E[w-F]%E[F])*g:0),b)for(;;)if(O==0){for(y=1,F=P[0];F>=10;F/=10,y++);for(F=P[0]+=g,g=1;F>=10;F/=10,g++);y!=g&&(u.e++,P[0]==we&&(P[0]=1));break}else{if(P[O]+=g,P[O]!=we)break;P[O--]=0,g=1}for(y=P.length;P[--y]===0;P.pop());}u.e>h?u.c=u.e=null:u.e<d&&(u.c=[u.e=0])}return u}function G(u){var c,p=u.e;return p===null?u.toString():(c=he(u.c),c=p<=a||p>=f?Lt(c,p):Ne(c,p,"0"),u.s<0?"-"+c:c)}return o.absoluteValue=o.abs=function(){var u=new C(this);return u.s<0&&(u.s=1),u},o.comparedTo=function(u,c){return Ve(this,new C(u,c))},o.decimalPlaces=o.dp=function(u,c){var p,b,w,y=this;if(u!=null)return oe(u,0,de),c==null?c=s:oe(c,0,8),W(new C(y),u+y.e+1,c);if(!(p=y.c))return null;if(b=((w=p.length-1)-be(this.e/J))*J,w=p[w])for(;w%10==0;w/=10,b--);return b<0&&(b=0),b},o.dividedBy=o.div=function(u,c){return t(this,new C(u,c),l,s)},o.dividedToIntegerBy=o.idiv=function(u,c){return t(this,new C(u,c),0,1)},o.exponentiatedBy=o.pow=function(u,c){var p,b,w,y,F,g,x,O,S,P=this;if(u=new C(u),u.c&&!u.isInteger())throw Error(fe+"Exponent not an integer: "+G(u));if(c!=null&&(c=new C(c)),g=u.e>14,!P.c||!P.c[0]||P.c[0]==1&&!P.e&&P.c.length==1||!u.c||!u.c[0])return S=new C(Math.pow(+G(P),g?u.s*(2-Mt(u)):+G(u))),c?S.mod(c):S;if(x=u.s<0,c){if(c.c?!c.c[0]:!c.s)return new C(NaN);b=!x&&P.isInteger()&&c.isInteger(),b&&(P=P.mod(c))}else{if(u.e>9&&(P.e>0||P.e<-1||(P.e==0?P.c[0]>1||g&&P.c[1]>=24e7:P.c[0]<8e13||g&&P.c[0]<=9999975e7)))return y=P.s<0&&Mt(u)?-0:0,P.e>-1&&(y=1/y),new C(x?1/y:y);v&&(y=hn(v/J+2))}for(g?(p=new C(.5),x&&(u.s=1),O=Mt(u)):(w=Math.abs(+G(u)),O=w%2),S=new C(i);;){if(O){if(S=S.times(P),!S.c)break;y?S.c.length>y&&(S.c.length=y):b&&(S=S.mod(c))}if(w){if(w=ve(w/2),w===0)break;O=w%2}else if(u=u.times(p),W(u,u.e+1,1),u.e>14)O=Mt(u);else{if(w=+G(u),w===0)break;O=w%2}P=P.times(P),y?P.c&&P.c.length>y&&(P.c.length=y):b&&(P=P.mod(c))}return b?S:(x&&(S=i.div(S)),c?S.mod(c):y?W(S,v,s,F):S)},o.integerValue=function(u){var c=new C(this);return u==null?u=s:oe(u,0,8),W(c,c.e+1,u)},o.isEqualTo=o.eq=function(u,c){return Ve(this,new C(u,c))===0},o.isFinite=function(){return!!this.c},o.isGreaterThan=o.gt=function(u,c){return Ve(this,new C(u,c))>0},o.isGreaterThanOrEqualTo=o.gte=function(u,c){return(c=Ve(this,new C(u,c)))===1||c===0},o.isInteger=function(){return!!this.c&&be(this.e/J)>this.c.length-2},o.isLessThan=o.lt=function(u,c){return Ve(this,new C(u,c))<0},o.isLessThanOrEqualTo=o.lte=function(u,c){return(c=Ve(this,new C(u,c)))===-1||c===0},o.isNaN=function(){return!this.s},o.isNegative=function(){return this.s<0},o.isPositive=function(){return this.s>0},o.isZero=function(){return!!this.c&&this.c[0]==0},o.minus=function(u,c){var p,b,w,y,F=this,g=F.s;if(u=new C(u,c),c=u.s,!g||!c)return new C(NaN);if(g!=c)return u.s=-c,F.plus(u);var x=F.e/J,O=u.e/J,S=F.c,P=u.c;if(!x||!O){if(!S||!P)return S?(u.s=-c,u):new C(P?F:NaN);if(!S[0]||!P[0])return P[0]?(u.s=-c,u):new C(S[0]?F:s==3?-0:0)}if(x=be(x),O=be(O),S=S.slice(),g=x-O){for((y=g<0)?(g=-g,w=S):(O=x,w=P),w.reverse(),c=g;c--;w.push(0));w.reverse()}else for(b=(y=(g=S.length)<(c=P.length))?g:c,g=c=0;c<b;c++)if(S[c]!=P[c]){y=S[c]<P[c];break}if(y&&(w=S,S=P,P=w,u.s=-u.s),c=(b=P.length)-(p=S.length),c>0)for(;c--;S[p++]=0);for(c=we-1;b>g;){if(S[--b]<P[b]){for(p=b;p&&!S[--p];S[p]=c);--S[p],S[b]+=we}S[b]-=P[b]}for(;S[0]==0;S.splice(0,1),--O);return S[0]?j(u,S,O):(u.s=s==3?-1:1,u.c=[u.e=0],u)},o.modulo=o.mod=function(u,c){var p,b,w=this;return u=new C(u,c),!w.c||!u.s||u.c&&!u.c[0]?new C(NaN):!u.c||w.c&&!w.c[0]?new C(w):(m==9?(b=u.s,u.s=1,p=t(w,u,0,3),u.s=b,p.s*=b):p=t(w,u,0,m),u=w.minus(p.times(u)),!u.c[0]&&m==1&&(u.s=w.s),u)},o.multipliedBy=o.times=function(u,c){var p,b,w,y,F,g,x,O,S,P,E,I,H,$,X,V=this,q=V.c,ee=(u=new C(u,c)).c;if(!q||!ee||!q[0]||!ee[0])return!V.s||!u.s||q&&!q[0]&&!ee||ee&&!ee[0]&&!q?u.c=u.e=u.s=null:(u.s*=V.s,!q||!ee?u.c=u.e=null:(u.c=[0],u.e=0)),u;for(b=be(V.e/J)+be(u.e/J),u.s*=V.s,x=q.length,P=ee.length,x<P&&(H=q,q=ee,ee=H,w=x,x=P,P=w),w=x+P,H=[];w--;H.push(0));for($=we,X=je,w=P;--w>=0;){for(p=0,E=ee[w]%X,I=ee[w]/X|0,F=x,y=w+F;y>w;)O=q[--F]%X,S=q[F]/X|0,g=I*O+S*E,O=E*O+g%X*X+H[y]+p,p=(O/$|0)+(g/X|0)+I*S,H[y--]=O%$;H[y]=p}return p?++b:H.splice(0,1),j(u,H,b)},o.negated=function(){var u=new C(this);return u.s=-u.s||null,u},o.plus=function(u,c){var p,b=this,w=b.s;if(u=new C(u,c),c=u.s,!w||!c)return new C(NaN);if(w!=c)return u.s=-c,b.minus(u);var y=b.e/J,F=u.e/J,g=b.c,x=u.c;if(!y||!F){if(!g||!x)return new C(w/0);if(!g[0]||!x[0])return x[0]?u:new C(g[0]?b:w*0)}if(y=be(y),F=be(F),g=g.slice(),w=y-F){for(w>0?(F=y,p=x):(w=-w,p=g),p.reverse();w--;p.push(0));p.reverse()}for(w=g.length,c=x.length,w-c<0&&(p=x,x=g,g=p,c=w),w=0;c;)w=(g[--c]=g[c]+x[c]+w)/we|0,g[c]=we===g[c]?0:g[c]%we;return w&&(g=[w].concat(g),++F),j(u,g,F)},o.precision=o.sd=function(u,c){var p,b,w,y=this;if(u!=null&&u!==!!u)return oe(u,1,de),c==null?c=s:oe(c,0,8),W(new C(y),u,c);if(!(p=y.c))return null;if(w=p.length-1,b=w*J+1,w=p[w]){for(;w%10==0;w/=10,b--);for(w=p[0];w>=10;w/=10,b++);}return u&&y.e+1>b&&(b=y.e+1),b},o.shiftedBy=function(u){return oe(u,-9007199254740991,Mr),this.times("1e"+u)},o.squareRoot=o.sqrt=function(){var u,c,p,b,w,y=this,F=y.c,g=y.s,x=y.e,O=l+4,S=new C("0.5");if(g!==1||!F||!F[0])return new C(!g||g<0&&(!F||F[0])?NaN:F?y:1/0);if(g=Math.sqrt(+G(y)),g==0||g==1/0?(c=he(F),(c.length+x)%2==0&&(c+="0"),g=Math.sqrt(+c),x=be((x+1)/2)-(x<0||x%2),g==1/0?c="5e"+x:(c=g.toExponential(),c=c.slice(0,c.indexOf("e")+1)+x),p=new C(c)):p=new C(g+""),p.c[0]){for(x=p.e,g=x+O,g<3&&(g=0);;)if(w=p,p=S.times(w.plus(t(y,w,O,1))),he(w.c).slice(0,g)===(c=he(p.c)).slice(0,g))if(p.e<x&&--g,c=c.slice(g-3,g+1),c=="9999"||!b&&c=="4999"){if(!b&&(W(w,w.e+l+2,0),w.times(w).eq(y))){p=w;break}O+=4,g+=4,b=1}else{(!+c||!+c.slice(1)&&c.charAt(0)=="5")&&(W(p,p.e+l+2,1),u=!p.times(p).eq(y));break}}return W(p,p.e+l+1,s,u)},o.toExponential=function(u,c){return u!=null&&(oe(u,0,de),u++),M(this,u,c,1)},o.toFixed=function(u,c){return u!=null&&(oe(u,0,de),u=u+this.e+1),M(this,u,c)},o.toFormat=function(u,c,p){var b,w=this;if(p==null)u!=null&&c&&typeof c=="object"?(p=c,c=null):u&&typeof u=="object"?(p=u,u=c=null):p=T;else if(typeof p!="object")throw Error(fe+"Argument not an object: "+p);if(b=w.toFixed(u,c),w.c){var y,F=b.split("."),g=+p.groupSize,x=+p.secondaryGroupSize,O=p.groupSeparator||"",S=F[0],P=F[1],E=w.s<0,I=E?S.slice(1):S,H=I.length;if(x&&(y=g,g=x,x=y,H-=y),g>0&&H>0){for(y=H%g||g,S=I.substr(0,y);y<H;y+=g)S+=O+I.substr(y,g);x>0&&(S+=O+I.slice(y)),E&&(S="-"+S)}b=P?S+(p.decimalSeparator||"")+((x=+p.fractionGroupSize)?P.replace(new RegExp("\\d{"+x+"}\\B","g"),"$&"+(p.fractionGroupSeparator||"")):P):S}return(p.prefix||"")+b+(p.suffix||"")},o.toFraction=function(u){var c,p,b,w,y,F,g,x,O,S,P,E,I=this,H=I.c;if(u!=null&&(g=new C(u),!g.isInteger()&&(g.c||g.s!==1)||g.lt(i)))throw Error(fe+"Argument "+(g.isInteger()?"out of range: ":"not an integer: ")+G(g));if(!H)return new C(I);for(c=new C(i),O=p=new C(i),b=x=new C(i),E=he(H),y=c.e=E.length-I.e-1,c.c[0]=vn[(F=y%J)<0?J+F:F],u=!u||g.comparedTo(c)>0?y>0?c:O:g,F=h,h=1/0,g=new C(E),x.c[0]=0;S=t(g,c,0,1),w=p.plus(S.times(b)),w.comparedTo(u)!=1;)p=b,b=w,O=x.plus(S.times(w=O)),x=w,c=g.minus(S.times(w=c)),g=w;return w=t(u.minus(p),b,0,1),x=x.plus(w.times(O)),p=p.plus(w.times(b)),x.s=O.s=I.s,y=y*2,P=t(O,b,y,s).minus(I).abs().comparedTo(t(x,p,y,s).minus(I).abs())<1?[O,b]:[x,p],h=F,P},o.toNumber=function(){return+G(this)},o.toPrecision=function(u,c){return u!=null&&oe(u,1,de),M(this,u,c,2)},o.toString=function(u){var c,p=this,b=p.s,w=p.e;return w===null?b?(c="Infinity",b<0&&(c="-"+c)):c="NaN":(u==null?c=w<=a||w>=f?Lt(he(p.c),w):Ne(he(p.c),w,"0"):u===10&&N?(p=W(new C(p),l+w+1,s),c=Ne(he(p.c),p.e,"0")):(oe(u,2,k.length,"Base"),c=n(Ne(he(p.c),w,"0"),10,u,b,!0)),b<0&&p.c[0]&&(c="-"+c)),c},o.valueOf=o.toJSON=function(){return G(this)},o._isBigNumber=!0,o[Symbol.toStringTag]="BigNumber",o[Symbol.for("nodejs.util.inspect.custom")]=o.valueOf,e!=null&&C.set(e),C}function be(e){var t=e|0;return e>0||e===t?t:t-1}function he(e){for(var t,n,r=1,o=e.length,i=e[0]+"";r<o;){for(t=e[r++]+"",n=J-t.length;n--;t="0"+t);i+=t}for(o=i.length;i.charCodeAt(--o)===48;);return i.slice(0,o+1||1)}function Ve(e,t){var n,r,o=e.c,i=t.c,l=e.s,s=t.s,a=e.e,f=t.e;if(!l||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:l;if(l!=s)return l;if(n=l<0,r=a==f,!o||!i)return r?0:!o^n?1:-1;if(!r)return a>f^n?1:-1;for(s=(a=o.length)<(f=i.length)?a:f,l=0;l<s;l++)if(o[l]!=i[l])return o[l]>i[l]^n?1:-1;return a==f?0:a>f^n?1:-1}function oe(e,t,n,r){if(e<t||e>n||e!==ve(e))throw Error(fe+(r||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function Mt(e){var t=e.c.length-1;return be(e.e/J)==t&&e.c[t]%2!=0}function Lt(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function Ne(e,t,n){var r,o;if(t<0){for(o=n+".";++t;o+=n);e=o+e}else if(r=e.length,++t>r){for(o=n,t-=r;--t;o+=n);e+=o}else t<r&&(e=e.slice(0,t)+"."+e.slice(t));return e}Wo();const vs=100000n,bs=(e,t={})=>{const{style:n="decimal",compact:r=!1,fractionDigits:o,adaptiveDecimals:i=!1}=t,l=typeof e=="string"?Number(e):e,s=typeof l=="bigint"?l<0n?-l:l:Math.abs(l),a=r==="auto"?s>=vs:r,f=typeof l=="bigint"?Number(l):l,d=i&&f!==0&&Math.abs(f)<Math.pow(10,-(o??2)),h=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:d?20:o??2,minimumFractionDigits:d?0:o??2});if(!a)return d?h.format(Lr(f)):h.format(l);const A=[{threshold:1e12,suffix:"T",divisor:1e12},{threshold:1e9,suffix:"B",divisor:1e9},{threshold:1e6,suffix:"M",divisor:1e6},{threshold:1e3,suffix:"K",divisor:1e3}].find(m=>s>=m.threshold);if(A){const m=new Intl.NumberFormat("en-US",{style:n,...n==="currency"&&{currency:"USD"},maximumFractionDigits:o??1,minimumFractionDigits:o??1}),v=Number(l)/A.divisor;return m.format(v)+A.suffix}return d?h.format(Lr(f)):h.format(l)};function Lr(e){if(e===0)return 0;const t=e.toExponential().split("e"),n=parseInt(t[1]),r=Math.abs(n);return Number(e.toFixed(r))}const zn=R.forwardRef(({className:e="",showBalance:t=!0,children:n,...r},o)=>{const{activeAddress:i,algodClient:l}=zt.useWallet(),[s,a]=R.useState(null);return R.useEffect(()=>{if(!t)return;(async()=>{if(i&&l)try{const h=await l.accountInformation(i).do(),m=Number(h.amount)/1e6;a(m)}catch(h){console.error("Error fetching account balance:",h),a(null)}else a(null)})()},[i,l,t]),L.jsx("button",{ref:o,className:`flex items-center ${e}`.trim(),disabled:!1,...r,type:"button",children:n||L.jsxs("div",{className:"flex items-center",children:[t&&s!==null&&L.jsxs("div",{className:"flex items-center py-2.5 px-4 bg-gray-100 dark:bg-[#101B29] text-gray-600 dark:text-gray-400 rounded-xl mr-[-22px] font-medium",style:{paddingRight:"32px"},children:[bs(s,{fractionDigits:4})," ","ALGO"]}),L.jsxs("div",{className:"flex items-center py-2.5 px-4 bg-[#2D2DF1] dark:bg-[#BFBFF9] text-white dark:text-[#001324] rounded-xl font-bold",children:[i==null?void 0:i.substring(0,6),"...",i==null?void 0:i.substring((i==null?void 0:i.length)-4)]})]})})});zn.displayName="ConnectedWalletButton";const Uo=typeof document<"u"?R.useLayoutEffect:()=>{};function ys(e){const t=R.useRef(null);return Uo(()=>{t.current=e},[e]),R.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ue=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},ze=e=>e&&"window"in e&&e.window===e?e:Ue(e).defaultView||window;function xs(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function ws(e){return xs(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let Es=!1;function Xn(){return Es}function Vo(e,t){if(!Xn())return t&&e?e.contains(t):!1;if(!e||!t)return!1;let n=t;for(;n!==null;){if(n===e)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:ws(n)?n=n.host:n=n.parentNode}return!1}const Nn=(e=document)=>{var t;if(!Xn())return e.activeElement;let n=e.activeElement;for(;n&&"shadowRoot"in n&&(!((t=n.shadowRoot)===null||t===void 0)&&t.activeElement);)n=n.shadowRoot.activeElement;return n};function Go(e){return Xn()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Rs(e){var t;return typeof window>"u"||window.navigator==null?!1:((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands.some(n=>e.test(n.brand)))||e.test(window.navigator.userAgent)}function Ss(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function Yo(e){let t=null;return()=>(t==null&&(t=e()),t)}const Cs=Yo(function(){return Ss(/^Mac/i)}),Ts=Yo(function(){return Rs(/Android/i)});function qo(){let e=R.useRef(new Map),t=R.useCallback((o,i,l,s)=>{let a=s!=null&&s.once?(...f)=>{e.current.delete(l),l(...f)}:l;e.current.set(l,{type:i,eventTarget:o,fn:a,options:s}),o.addEventListener(i,a,s)},[]),n=R.useCallback((o,i,l,s)=>{var a;let f=((a=e.current.get(l))===null||a===void 0?void 0:a.fn)||l;o.removeEventListener(i,f,s),e.current.delete(l)},[]),r=R.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return R.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function As(e){return e.mozInputSource===0&&e.isTrusted?!0:Ts()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}class _o{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(t,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=t}}function zo(e){let t=R.useRef({isFocused:!1,observer:null});Uo(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=ys(r=>{e==null||e(r)});return R.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){t.current.isFocused=!0;let o=r.target,i=l=>{t.current.isFocused=!1,o.disabled&&n(new _o("blur",l)),t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",i,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var l;(l=t.current.observer)===null||l===void 0||l.disconnect();let s=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Os=!1,Ct=null,Dn=new Set,ht=new Map,et=!1,In=!1;const Fs={Tab:!0,Escape:!0};function Kn(e,t){for(let n of Dn)n(e,t)}function Ps(e){return!(e.metaKey||!Cs()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function qt(e){et=!0,Ps(e)&&(Ct="keyboard",Kn("keyboard",e))}function ye(e){Ct="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(et=!0,Kn("pointer",e))}function Xo(e){As(e)&&(et=!0,Ct="virtual")}function Ko(e){e.target===window||e.target===document||Os||!e.isTrusted||(!et&&!In&&(Ct="virtual",Kn("virtual",e)),et=!1,In=!1)}function Jo(){et=!1,In=!0}function Mn(e){if(typeof window>"u"||ht.get(ze(e)))return;const t=ze(e),n=Ue(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){et=!0,r.apply(this,arguments)},n.addEventListener("keydown",qt,!0),n.addEventListener("keyup",qt,!0),n.addEventListener("click",Xo,!0),t.addEventListener("focus",Ko,!0),t.addEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",ye,!0),n.addEventListener("pointermove",ye,!0),n.addEventListener("pointerup",ye,!0)):(n.addEventListener("mousedown",ye,!0),n.addEventListener("mousemove",ye,!0),n.addEventListener("mouseup",ye,!0)),t.addEventListener("beforeunload",()=>{Qo(e)},{once:!0}),ht.set(t,{focus:r})}const Qo=(e,t)=>{const n=ze(e),r=Ue(e);t&&r.removeEventListener("DOMContentLoaded",t),ht.has(n)&&(n.HTMLElement.prototype.focus=ht.get(n).focus,r.removeEventListener("keydown",qt,!0),r.removeEventListener("keyup",qt,!0),r.removeEventListener("click",Xo,!0),n.removeEventListener("focus",Ko,!0),n.removeEventListener("blur",Jo,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",ye,!0),r.removeEventListener("pointermove",ye,!0),r.removeEventListener("pointerup",ye,!0)):(r.removeEventListener("mousedown",ye,!0),r.removeEventListener("mousemove",ye,!0),r.removeEventListener("mouseup",ye,!0)),ht.delete(n))};function ks(e){const t=Ue(e);let n;return t.readyState!=="loading"?Mn(e):(n=()=>{Mn(e)},t.addEventListener("DOMContentLoaded",n)),()=>Qo(e,n)}typeof document<"u"&&ks();function Zo(){return Ct!=="pointer"}const Ns=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ds(e,t,n){let r=Ue(n==null?void 0:n.target);const o=typeof window<"u"?ze(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,i=typeof window<"u"?ze(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,l=typeof window<"u"?ze(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?ze(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ns.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof l&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof s&&!Fs[n.key])}function Is(e,t,n){Mn(),R.useEffect(()=>{let r=(o,i)=>{Ds(!!(n!=null&&n.isTextInput),o,i)&&e(Zo())};return Dn.add(r),()=>{Dn.delete(r)}},t)}function Ms(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=R.useCallback(a=>{if(a.target===a.currentTarget)return r&&r(a),o&&o(!1),!0},[r,o]),l=zo(i),s=R.useCallback(a=>{const f=Ue(a.target),d=f?Nn(f):Nn();a.target===a.currentTarget&&d===Go(a.nativeEvent)&&(n&&n(a),o&&o(!0),l(a))},[o,n,l]);return{focusProps:{onFocus:!t&&(n||o||r)?s:void 0,onBlur:!t&&(r||o)?i:void 0}}}function Ls(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=R.useRef({isFocusWithin:!1}),{addGlobalListener:l,removeAllGlobalListeners:s}=qo(),a=R.useCallback(h=>{h.currentTarget.contains(h.target)&&i.current.isFocusWithin&&!h.currentTarget.contains(h.relatedTarget)&&(i.current.isFocusWithin=!1,s(),n&&n(h),o&&o(!1))},[n,o,i,s]),f=zo(a),d=R.useCallback(h=>{if(!h.currentTarget.contains(h.target))return;const A=Ue(h.target),m=Nn(A);if(!i.current.isFocusWithin&&m===Go(h.nativeEvent)){r&&r(h),o&&o(!0),i.current.isFocusWithin=!0,f(h);let v=h.currentTarget;l(A,"focus",T=>{if(i.current.isFocusWithin&&!Vo(v,T.target)){let k=new _o("blur",new A.defaultView.FocusEvent("blur",{relatedTarget:T.target}));k.target=v,k.currentTarget=v,a(k)}},{capture:!0})}},[r,o,f,l,a]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:d,onBlur:a}}}let _t=!1,bn=0;function Ln(){_t=!0,setTimeout(()=>{_t=!1},50)}function $r(e){e.pointerType==="touch"&&Ln()}function $s(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",$r):document.addEventListener("touchend",Ln),bn++,()=>{bn--,!(bn>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",$r):document.removeEventListener("touchend",Ln))}}function js(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,l]=R.useState(!1),s=R.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;R.useEffect($s,[]);let{addGlobalListener:a,removeAllGlobalListeners:f}=qo(),{hoverProps:d,triggerHoverEnd:h}=R.useMemo(()=>{let A=(T,k)=>{if(s.pointerType=k,o||k==="touch"||s.isHovered||!T.currentTarget.contains(T.target))return;s.isHovered=!0;let N=T.currentTarget;s.target=N,a(Ue(T.target),"pointerover",C=>{s.isHovered&&s.target&&!Vo(s.target,C.target)&&m(C,C.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:N,pointerType:k}),n&&n(!0),l(!0)},m=(T,k)=>{let N=s.target;s.pointerType="",s.target=null,!(k==="touch"||!s.isHovered||!N)&&(s.isHovered=!1,f(),r&&r({type:"hoverend",target:N,pointerType:k}),n&&n(!1),l(!1))},v={};return typeof PointerEvent<"u"?(v.onPointerEnter=T=>{_t&&T.pointerType==="mouse"||A(T,T.pointerType)},v.onPointerLeave=T=>{!o&&T.currentTarget.contains(T.target)&&m(T,T.pointerType)}):(v.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},v.onMouseEnter=T=>{!s.ignoreEmulatedMouseEvents&&!_t&&A(T,"mouse"),s.ignoreEmulatedMouseEvents=!1},v.onMouseLeave=T=>{!o&&T.currentTarget.contains(T.target)&&m(T,"mouse")}),{hoverProps:v,triggerHoverEnd:m}},[t,n,r,o,s,a,f]);return R.useEffect(()=>{o&&h({currentTarget:s.target},s.pointerType)},[o]),{hoverProps:d,isHovered:i}}function Bs(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=R.useRef({isFocused:!1,isFocusVisible:t||Zo()}),[i,l]=R.useState(!1),[s,a]=R.useState(()=>o.current.isFocused&&o.current.isFocusVisible),f=R.useCallback(()=>a(o.current.isFocused&&o.current.isFocusVisible),[]),d=R.useCallback(m=>{o.current.isFocused=m,l(m),f()},[f]);Is(m=>{o.current.isFocusVisible=m,f()},[],{isTextInput:n});let{focusProps:h}=Ms({isDisabled:r,onFocusChange:d}),{focusWithinProps:A}=Ls({isDisabled:!r,onFocusWithinChange:d});return{isFocused:i,isFocusVisible:s,focusProps:r?A:h}}var Hs=Object.defineProperty,Ws=(e,t,n)=>t in e?Hs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,yn=(e,t,n)=>(Ws(e,typeof t!="symbol"?t+"":t,n),n);let Us=class{constructor(){yn(this,"current",this.detect()),yn(this,"handoffState","pending"),yn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ke=new Us;function Tt(e){return Ke.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function ei(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function $e(){let e=[],t={addEventListener(n,r,o,i){return n.addEventListener(r,o,i),t.add(()=>n.removeEventListener(r,o,i))},requestAnimationFrame(...n){let r=requestAnimationFrame(...n);return t.add(()=>cancelAnimationFrame(r))},nextFrame(...n){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...n))},setTimeout(...n){let r=setTimeout(...n);return t.add(()=>clearTimeout(r))},microTask(...n){let r={current:!0};return ei(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let i=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:i})})},group(n){let r=$e();return n(r),this.add(()=>r.dispose())},add(n){return e.includes(n)||e.push(n),()=>{let r=e.indexOf(n);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let n of e.splice(0))n()}};return t}function st(){let[e]=R.useState($e);return R.useEffect(()=>()=>e.dispose(),[e]),e}let ae=(e,t)=>{Ke.isServer?R.useEffect(e,t):R.useLayoutEffect(e,t)};function at(e){let t=R.useRef(e);return ae(()=>{t.current=e},[e]),t}let ne=function(e){let t=at(e);return R.useCallback((...n)=>t.current(...n),[t])};function Vs(e){let t=e.width/2,n=e.height/2;return{top:e.clientY-n,right:e.clientX+t,bottom:e.clientY+n,left:e.clientX-t}}function Gs(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Ys({disabled:e=!1}={}){let t=R.useRef(null),[n,r]=R.useState(!1),o=st(),i=ne(()=>{t.current=null,r(!1),o.dispose()}),l=ne(s=>{if(o.dispose(),t.current===null){t.current=s.currentTarget,r(!0);{let a=Tt(s.currentTarget);o.addEventListener(a,"pointerup",i,!1),o.addEventListener(a,"pointermove",f=>{if(t.current){let d=Vs(f);r(Gs(d,t.current.getBoundingClientRect()))}},!1),o.addEventListener(a,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:l,onPointerUp:i,onClick:i}}}let qs=R.createContext(void 0);function Jn(){return R.useContext(qs)}function jr(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function Me(e,t,...n){if(e in t){let o=t[e];return typeof o=="function"?o(...n):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Me),r}var $n=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))($n||{}),_s=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(_s||{});function Re(){let e=Xs();return R.useCallback(t=>zs({mergeRefs:e,...t}),[e])}function zs({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??Ks;let a=ti(t,e);if(i)return $t(a,n,r,l,s);let f=o??0;if(f&2){let{static:d=!1,...h}=a;if(d)return $t(h,n,r,l,s)}if(f&1){let{unmount:d=!0,...h}=a;return Me(d?0:1,{0(){return null},1(){return $t({...h,hidden:!0,style:{display:"none"}},n,r,l,s)}})}return $t(a,n,r,l,s)}function $t(e,t={},n,r,o){let{as:i=n,children:l,refName:s="ref",...a}=xn(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},d=typeof l=="function"?l(t):l;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(t)),a["aria-labelledby"]&&a["aria-labelledby"]===a.id&&(a["aria-labelledby"]=void 0);let h={};if(t){let A=!1,m=[];for(let[v,T]of Object.entries(t))typeof T=="boolean"&&(A=!0),T===!0&&m.push(v.replace(/([A-Z])/g,k=>`-${k.toLowerCase()}`));if(A){h["data-headlessui-state"]=m.join(" ");for(let v of m)h[`data-${v}`]=""}}if(i===R.Fragment&&(Object.keys(qe(a)).length>0||Object.keys(qe(h)).length>0))if(!R.isValidElement(d)||Array.isArray(d)&&d.length>1){if(Object.keys(qe(a)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(qe(a)).concat(Object.keys(qe(h))).map(A=>` - ${A}`).join(`
|
|
38
|
+
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(A=>` - ${A}`).join(`
|
|
39
|
+
`)].join(`
|
|
40
|
+
`))}else{let A=d.props,m=A==null?void 0:A.className,v=typeof m=="function"?(...N)=>jr(m(...N),a.className):jr(m,a.className),T=v?{className:v}:{},k=ti(d.props,qe(xn(a,["ref"])));for(let N in h)N in k&&delete h[N];return R.cloneElement(d,Object.assign({},k,h,f,{ref:o(Js(d),f.ref)},T))}return R.createElement(i,Object.assign({},xn(a,["ref"]),i!==R.Fragment&&f,i!==R.Fragment&&h),d)}function Xs(){let e=R.useRef([]),t=R.useCallback(n=>{for(let r of e.current)r!=null&&(typeof r=="function"?r(n):r.current=n)},[]);return(...n)=>{if(!n.every(r=>r==null))return e.current=n,t}}function Ks(...e){return e.every(t=>t==null)?void 0:t=>{for(let n of e)n!=null&&(typeof n=="function"?n(t):n.current=t)}}function ti(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];if(t.disabled||t["aria-disabled"])for(let r in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(r)&&(n[r]=[o=>{var i;return(i=o==null?void 0:o.preventDefault)==null?void 0:i.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...i){let l=n[r];for(let s of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return t}function ni(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},n={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(n[o]!=null||(n[o]=[]),n[o].push(r[o])):t[o]=r[o];for(let r in n)Object.assign(t,{[r](...o){let i=n[r];for(let l of i)l==null||l(...o)}});return t}function Se(e){var t;return Object.assign(R.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function qe(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function xn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Js(e){return R.version.split(".")[0]>="19"?e.props.ref:e.ref}function Qs(e,t,n){let[r,o]=R.useState(n),i=e!==void 0,l=R.useRef(i),s=R.useRef(!1),a=R.useRef(!1);return i&&!l.current&&!s.current?(s.current=!0,l.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&l.current&&!a.current&&(a.current=!0,l.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,ne(f=>(i||o(f),t==null?void 0:t(f)))]}function Zs(e){let[t]=R.useState(e);return t}function ri(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))ii(n,oi(t,r),o);return n}function oi(e,t){return e?e+"["+t+"]":t}function ii(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())ii(e,oi(t,r.toString()),o);else n instanceof Date?e.push([t,n.toISOString()]):typeof n=="boolean"?e.push([t,n?"1":"0"]):typeof n=="string"?e.push([t,n]):typeof n=="number"?e.push([t,`${n}`]):n==null?e.push([t,""]):ri(n,t,e)}function ea(e){var t,n;let r=(t=e==null?void 0:e.form)!=null?t:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(n=r.requestSubmit)==null||n.call(r)}}let ta="span";var Qn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Qn||{});function na(e,t){var n;let{features:r=1,...o}=e,i={ref:t,"aria-hidden":(r&2)===2?!0:(n=o["aria-hidden"])!=null?n:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return Re()({ourProps:i,theirProps:o,slot:{},defaultTag:ta,name:"Hidden"})}let li=Se(na),ra=R.createContext(null);function oa({children:e}){let t=R.useContext(ra);if(!t)return R.createElement(R.Fragment,null,e);let{target:n}=t;return n?Ae.createPortal(R.createElement(R.Fragment,null,e),n):null}function ia({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,l]=R.useState(null),s=st();return R.useEffect(()=>{if(r&&i)return s.addEventListener(i,"reset",r)},[i,t,r]),R.createElement(oa,null,R.createElement(la,{setForm:l,formId:t}),ri(e).map(([a,f])=>R.createElement(li,{features:Qn.Hidden,...qe({key:a,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:a,value:f,...o})})))}function la({setForm:e,formId:t}){return R.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:R.createElement(li,{features:Qn.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let sa=R.createContext(void 0);function si(){return R.useContext(sa)}function aa(e){let t=e.parentElement,n=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&ua(n)?!1:r}function ua(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}let ai=Symbol();function ca(e,t=!0){return Object.assign(e,{[ai]:t})}function Pe(...e){let t=R.useRef(e);R.useEffect(()=>{t.current=e},[e]);let n=ne(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[ai]))?void 0:n}let Zn=R.createContext(null);Zn.displayName="DescriptionContext";function ui(){let e=R.useContext(Zn);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ui),t}return e}function fa(){var e,t;return(t=(e=R.useContext(Zn))==null?void 0:e.value)!=null?t:void 0}let da="p";function pa(e,t){let n=R.useId(),r=Jn(),{id:o=`headlessui-description-${n}`,...i}=e,l=ui(),s=Pe(t);ae(()=>l.register(o),[o,l.register]);let a=r||!1,f=R.useMemo(()=>({...l.slot,disabled:a}),[l.slot,a]),d={ref:s,...l.props,id:o};return Re()({ourProps:d,theirProps:i,slot:f,defaultTag:da,name:l.name||"Description"})}let ma=Se(pa);Object.assign(ma,{});var le=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(le||{});let rn=R.createContext(null);rn.displayName="LabelContext";function ci(){let e=R.useContext(rn);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,ci),t}return e}function fi(e){var t,n,r;let o=(n=(t=R.useContext(rn))==null?void 0:t.value)!=null?n:void 0;return((r=e==null?void 0:e.length)!=null?r:0)>0?[o,...e].filter(Boolean).join(" "):o}function ga({inherit:e=!1}={}){let t=fi(),[n,r]=R.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,R.useMemo(()=>function(i){let l=ne(a=>(r(f=>[...f,a]),()=>r(f=>{let d=f.slice(),h=d.indexOf(a);return h!==-1&&d.splice(h,1),d}))),s=R.useMemo(()=>({register:l,slot:i.slot,name:i.name,props:i.props,value:i.value}),[l,i.slot,i.name,i.props,i.value]);return R.createElement(rn.Provider,{value:s},i.children)},[r])]}let ha="label";function va(e,t){var n;let r=R.useId(),o=ci(),i=si(),l=Jn(),{id:s=`headlessui-label-${r}`,htmlFor:a=i??((n=o.props)==null?void 0:n.htmlFor),passive:f=!1,...d}=e,h=Pe(t);ae(()=>o.register(s),[s,o.register]);let A=ne(k=>{let N=k.currentTarget;if(N instanceof HTMLLabelElement&&k.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(k),N instanceof HTMLLabelElement){let C=document.getElementById(N.htmlFor);if(C){let M=C.getAttribute("disabled");if(M==="true"||M==="")return;let B=C.getAttribute("aria-disabled");if(B==="true"||B==="")return;(C instanceof HTMLInputElement&&(C.type==="radio"||C.type==="checkbox")||C.role==="radio"||C.role==="checkbox"||C.role==="switch")&&C.click(),C.focus({preventScroll:!0})}}}),m=l||!1,v=R.useMemo(()=>({...o.slot,disabled:m}),[o.slot,m]),T={ref:h,...o.props,id:s,htmlFor:a,onClick:A};return f&&("onClick"in T&&(delete T.htmlFor,delete T.onClick),"onClick"in d&&delete d.onClick),Re()({ourProps:T,theirProps:d,slot:v,defaultTag:a?ha:"div",name:o.name||"Label"})}let ba=Se(va),di=Object.assign(ba,{});function ya(e,t){return e!==null&&t!==null&&typeof e=="object"&&typeof t=="object"&&"id"in e&&"id"in t?e.id===t.id:e===t}function xa(e=ya){return R.useCallback((t,n)=>{if(typeof e=="string"){let r=e;return(t==null?void 0:t[r])===(n==null?void 0:n[r])}return e(t,n)},[e])}function wa(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Ea(e,t=!1){let[n,r]=R.useReducer(()=>({}),{}),o=R.useMemo(()=>wa(e),[e,n]);return ae(()=>{if(!e)return;let i=new ResizeObserver(r);return i.observe(e),()=>{i.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Ra=class extends Map{constructor(t){super(),this.factory=t}get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t),this.set(t,n)),n}};function pi(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let l=t[o].call(n,...i);l&&(n=l,r.forEach(s=>s()))}}}function mi(e){return R.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}let Sa=new Ra(()=>pi(()=>[],{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(t===-1)return this;let n=this.slice();return n.splice(t,1),n}}));function er(e,t){let n=Sa.get(t),r=R.useId(),o=mi(n);if(ae(()=>{if(e)return n.dispatch("ADD",r),()=>n.dispatch("REMOVE",r)},[n,e]),!e)return!1;let i=o.indexOf(r),l=o.length;return i===-1&&(i=l,l+=1),i===l-1}let jn=new Map,vt=new Map;function Br(e){var t;let n=(t=vt.get(e))!=null?t:0;return vt.set(e,n+1),n!==0?()=>Hr(e):(jn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Hr(e))}function Hr(e){var t;let n=(t=vt.get(e))!=null?t:1;if(n===1?vt.delete(e):vt.set(e,n-1),n!==1)return;let r=jn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,jn.delete(e))}function Ca(e,{allowed:t,disallowed:n}={}){let r=er(e,"inert-others");ae(()=>{var o,i;if(!r)return;let l=$e();for(let a of(o=n==null?void 0:n())!=null?o:[])a&&l.add(Br(a));let s=(i=t==null?void 0:t())!=null?i:[];for(let a of s){if(!a)continue;let f=Tt(a);if(!f)continue;let d=a.parentElement;for(;d&&d!==f.body;){for(let h of d.children)s.some(A=>h.contains(A))||l.add(Br(h));d=d.parentElement}}return l.dispose},[r,t,n])}function Ta(e,t,n){let r=at(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});R.useEffect(()=>{if(!e)return;let o=t===null?null:t instanceof HTMLElement?t:t.current;if(!o)return;let i=$e();if(typeof ResizeObserver<"u"){let l=new ResizeObserver(()=>r.current(o));l.observe(o),i.add(()=>l.disconnect())}if(typeof IntersectionObserver<"u"){let l=new IntersectionObserver(()=>r.current(o));l.observe(o),i.add(()=>l.disconnect())}return()=>i.dispose()},[t,r,e])}let Bn=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),Aa=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Hn=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(Hn||{}),Oa=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Oa||{}),Fa=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Fa||{});function gi(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Bn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Pa(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Aa)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var tr=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(tr||{});function hi(e,t=0){var n;return e===((n=Tt(e))==null?void 0:n.body)?!1:Me(t,{0(){return e.matches(Bn)},1(){let r=e;for(;r!==null;){if(r.matches(Bn))return!0;r=r.parentElement}return!1}})}var ka=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(ka||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let Na=["textarea","input"].join(",");function Da(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Na))!=null?n:!1}function vi(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),i=t(r);if(o===null||i===null)return 0;let l=o.compareDocumentPosition(i);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ia(e,t){return Ma(gi(),t,{relativeTo:e})}function Ma(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?vi(e):e:t&64?Pa(e):gi(e);o.length>0&&l.length>1&&(l=l.filter(m=>!o.some(v=>v!=null&&"current"in v?(v==null?void 0:v.current)===m:v===m))),r=r??i.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,l.indexOf(r))-1;if(t&4)return Math.max(0,l.indexOf(r))+1;if(t&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=t&32?{preventScroll:!0}:{},d=0,h=l.length,A;do{if(d>=h||d+h<=0)return 0;let m=a+d;if(t&16)m=(m+h)%h;else{if(m<0)return 3;if(m>=h)return 1}A=l[m],A==null||A.focus(f),d+=s}while(A!==i.activeElement);return t&6&&Da(A)&&A.select(),2}function bi(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function La(){return/Android/gi.test(window.navigator.userAgent)}function $a(){return bi()||La()}function pt(e,t,n,r){let o=at(n);R.useEffect(()=>{if(!e)return;function i(l){o.current(l)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function ja(e,t,n,r){let o=at(n);R.useEffect(()=>{if(!e)return;function i(l){o.current(l)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const Wr=30;function Ba(e,t,n){let r=er(e,"outside-click"),o=at(n),i=R.useCallback(function(a,f){if(a.defaultPrevented)return;let d=f(a);if(d===null||!d.getRootNode().contains(d)||!d.isConnected)return;let h=function A(m){return typeof m=="function"?A(m()):Array.isArray(m)||m instanceof Set?m:[m]}(t);for(let A of h)if(A!==null&&(A.contains(d)||a.composed&&a.composedPath().includes(A)))return;return!hi(d,tr.Loose)&&d.tabIndex!==-1&&a.preventDefault(),o.current(a,d)},[o,t]),l=R.useRef(null);pt(r,"pointerdown",a=>{var f,d;l.current=((d=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:d[0])||a.target},!0),pt(r,"mousedown",a=>{var f,d;l.current=((d=(f=a.composedPath)==null?void 0:f.call(a))==null?void 0:d[0])||a.target},!0),pt(r,"click",a=>{$a()||l.current&&(i(a,()=>l.current),l.current=null)},!0);let s=R.useRef({x:0,y:0});pt(r,"touchstart",a=>{s.current.x=a.touches[0].clientX,s.current.y=a.touches[0].clientY},!0),pt(r,"touchend",a=>{let f={x:a.changedTouches[0].clientX,y:a.changedTouches[0].clientY};if(!(Math.abs(f.x-s.current.x)>=Wr||Math.abs(f.y-s.current.y)>=Wr))return i(a,()=>a.target instanceof HTMLElement?a.target:null)},!0),ja(r,"blur",a=>i(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function nr(...e){return R.useMemo(()=>Tt(...e),[...e])}function Ha(e,t){return R.useMemo(()=>{var n;if(e.type)return e.type;let r=(n=e.as)!=null?n:"button";if(typeof r=="string"&&r.toLowerCase()==="button"||(t==null?void 0:t.tagName)==="BUTTON"&&!t.hasAttribute("type"))return"button"},[e.type,e.as,t])}function Wa(){let e;return{before({doc:t}){var n;let r=t.documentElement,o=(n=t.defaultView)!=null?n:window;e=Math.max(0,o.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,o=Math.max(0,r.clientWidth-r.offsetWidth),i=Math.max(0,e-o);n.style(r,"paddingRight",`${i}px`)}}}function Ua(){return bi()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(i=>i()).some(i=>i.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=$e();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let a=s.target.closest("a");if(!a)return;let{hash:f}=new URL(a.href),d=e.querySelector(f);d&&!r(d)&&(l=d)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let a=s.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;t.style(a,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement){if(s.target.tagName==="INPUT")return;if(r(s.target)){let a=s.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()}},{passive:!1}),t.add(()=>{var s;let a=(s=window.scrollY)!=null?s:window.pageYOffset;i!==a&&window.scrollTo(0,i),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Va(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ga(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Xe=pi(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:$e(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:Ga(n)},o=[Ua(),Wa(),Va()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Xe.subscribe(()=>{let e=Xe.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let r=t.get(n.doc)==="hidden",o=n.count!==0;(o&&!r||!o&&r)&&Xe.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Xe.dispatch("TEARDOWN",n)}});function Ya(e,t,n=()=>({containers:[]})){let r=mi(Xe),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ae(()=>{if(!(!t||!e))return Xe.dispatch("PUSH",t,n),()=>Xe.dispatch("POP",t,n)},[e,t]),i}function qa(e,t,n=()=>[document.body]){let r=er(e,"scroll-lock");Ya(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function Ur(e){return[e.screenX,e.screenY]}function _a(){let e=R.useRef([-1,-1]);return{wasMoved(t){let n=Ur(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=Ur(t)}}}function za(e=0){let[t,n]=R.useState(e),r=R.useCallback(a=>n(a),[t]),o=R.useCallback(a=>n(f=>f|a),[t]),i=R.useCallback(a=>(t&a)===a,[t]),l=R.useCallback(a=>n(f=>f&~a),[n]),s=R.useCallback(a=>n(f=>f^a),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:s}}var Vr,Gr;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((Vr=process==null?void 0:process.env)==null?void 0:Vr.NODE_ENV)==="test"&&typeof((Gr=Element==null?void 0:Element.prototype)==null?void 0:Gr.getAnimations)>"u"&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join(`
|
|
41
|
+
`)),[]});var Xa=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Xa||{});function Ka(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Ja(e,t,n,r){let[o,i]=R.useState(n),{hasFlag:l,addFlag:s,removeFlag:a}=za(e&&o?3:0),f=R.useRef(!1),d=R.useRef(!1),h=st();return ae(()=>{var A;if(e){if(n&&i(!0),!t){n&&s(3);return}return(A=void 0)==null||A.call(r,n),Qa(t,{inFlight:f,prepare(){d.current?d.current=!1:d.current=f.current,f.current=!0,!d.current&&(n?(s(3),a(4)):(s(4),a(2)))},run(){d.current?n?(a(3),s(4)):(a(4),s(3)):n?a(1):s(1)},done(){var m;d.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(f.current=!1,a(7),n||i(!1),(m=void 0)==null||m.call(r,n))}})}},[e,n,t,h]),e?[o,{closed:l(1),enter:l(2),leave:l(4),transition:l(2)||l(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function Qa(e,{prepare:t,run:n,done:r,inFlight:o}){let i=$e();return eu(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Za(e,r))})}),i.dispose}function Za(e,t){var n,r;let o=$e();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let l=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(s=>s instanceof CSSTransition))!=null?r:[];return l.length===0?(t(),o.dispose):(Promise.allSettled(l.map(s=>s.finished)).then(()=>{i||t()}),o.dispose)}function eu(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.style.transition=r}function tu(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}const yi={...D},nu=yi.useInsertionEffect,ru=nu||(e=>e());function xi(e){const t=D.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ru(()=>{t.current=e}),D.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Wn=typeof document<"u"?R.useLayoutEffect:R.useEffect;let Yr=!1,ou=0;const qr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ou++;function iu(){const[e,t]=D.useState(()=>Yr?qr():void 0);return Wn(()=>{e==null&&t(qr())},[]),D.useEffect(()=>{Yr=!0},[]),e}const lu=yi.useId,su=lu||iu;let wt;process.env.NODE_ENV!=="production"&&(wt=new Set);function au(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=wt)!=null&&e.has(o))){var i;(i=wt)==null||i.add(o),console.warn(o)}}function uu(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");if(!((e=wt)!=null&&e.has(o))){var i;(i=wt)==null||i.add(o),console.error(o)}}function cu(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const fu=D.createContext(null),du=D.createContext(null),pu=()=>{var e;return((e=D.useContext(fu))==null?void 0:e.id)||null},mu=()=>D.useContext(du),gu="data-floating-ui-focusable";function hu(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=su(),i=D.useRef({}),[l]=D.useState(()=>cu()),s=pu()!=null;if(process.env.NODE_ENV!=="production"){const m=r.reference;m&&!re(m)&&uu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[a,f]=D.useState(r.reference),d=xi((m,v,T)=>{i.current.openEvent=m?v:void 0,l.emit("openchange",{open:m,event:v,reason:T,nested:s}),n==null||n(m,v,T)}),h=D.useMemo(()=>({setPositionReference:f}),[]),A=D.useMemo(()=>({reference:a||r.reference||null,floating:r.floating||null,domReference:r.reference}),[a,r.reference,r.floating]);return D.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:A,events:l,floatingId:o,refs:h}),[t,d,A,l,o,h])}function vu(e){e===void 0&&(e={});const{nodeId:t}=e,n=hu({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=D.useState(null),[s,a]=D.useState(null),d=(o==null?void 0:o.domReference)||i,h=D.useRef(null),A=mu();Wn(()=>{d&&(h.current=d)},[d]);const m=Eo({...e,elements:{...o,...s&&{reference:s}}}),v=D.useCallback(M=>{const B=re(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),contextElement:M}:M;a(B),m.refs.setReference(B)},[m.refs]),T=D.useCallback(M=>{(re(M)||M===null)&&(h.current=M,l(M)),(re(m.refs.reference.current)||m.refs.reference.current===null||M!==null&&!re(M))&&m.refs.setReference(M)},[m.refs]),k=D.useMemo(()=>({...m.refs,setReference:T,setPositionReference:v,domReference:h}),[m.refs,T,v]),N=D.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),C=D.useMemo(()=>({...m,...r,refs:k,elements:N,nodeId:t}),[m,k,N,t,r]);return Wn(()=>{r.dataRef.current.floatingContext=C;const M=A==null?void 0:A.nodesRef.current.find(B=>B.id===t);M&&(M.context=C)}),D.useMemo(()=>({...m,context:C,refs:k,elements:N}),[m,k,N,C])}const _r="active",zr="selected";function wn(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[_r]:l,[zr]:s,...a}=e;i=a}return{...n==="floating"&&{tabIndex:-1,[gu]:""},...i,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[f,d]=a;if(!(o&&[_r,zr].includes(f)))if(f.indexOf("on")===0){if(r.has(f)||r.set(f,[]),typeof d=="function"){var h;(h=r.get(f))==null||h.push(d),l[f]=function(){for(var A,m=arguments.length,v=new Array(m),T=0;T<m;T++)v[T]=arguments[T];return(A=r.get(f))==null?void 0:A.map(k=>k(...v)).find(k=>k!==void 0)}}}else l[f]=d}),l),{})}}function bu(e){e===void 0&&(e=[]);const t=e.map(s=>s==null?void 0:s.reference),n=e.map(s=>s==null?void 0:s.floating),r=e.map(s=>s==null?void 0:s.item),o=D.useCallback(s=>wn(s,e,"reference"),t),i=D.useCallback(s=>wn(s,e,"floating"),n),l=D.useCallback(s=>wn(s,e,"item"),r);return D.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}function Xr(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const yu=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:l=0,minItemsVisible:s=4,referenceOverflowThreshold:a=0,scrollRef:f,...d}=lt(e,t),{rects:h,elements:{floating:A}}=t,m=n.current[l],v=(f==null?void 0:f.current)||A,T=A.clientTop||v.clientTop,k=A.clientTop!==0,N=v.clientTop!==0,C=A===v;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||au('`placement` side must be "bottom" when using the `inner`',"middleware.")),!m)return{};const M={...t,...await qn(-m.offsetTop-A.clientTop-h.reference.height/2-m.offsetHeight/2-i).fn(t)},B=await fn(Xr(M,v.scrollHeight+T+A.clientTop),d),j=await fn(M,{...d,elementContext:"reference"}),W=ce(0,B.top),G=M.y+W,p=(v.scrollHeight>v.clientHeight?b=>b:yt)(ce(0,v.scrollHeight+(k&&C||N?T*2:0)-W-ce(0,B.bottom)));if(v.style.maxHeight=p+"px",v.scrollTop=W,o){const b=v.offsetHeight<m.offsetHeight*Je(s,n.current.length)-1||j.top>=-a||j.bottom>=-a;bt.flushSync(()=>o(b))}return r&&(r.current=await fn(Xr({...M,y:G},v.offsetHeight+T+A.clientTop),d)),{y:G}}});function xu(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:l,onChange:s}=t,a=xi(s),f=D.useRef(!1),d=D.useRef(null),h=D.useRef(null);D.useEffect(()=>{if(!o)return;function m(T){if(T.ctrlKey||!v||i.current==null)return;const k=T.deltaY,N=i.current.top>=-.5,C=i.current.bottom>=-.5,M=v.scrollHeight-v.clientHeight,B=k<0?-1:1,j=k<0?"max":"min";v.scrollHeight<=v.clientHeight||(!N&&k>0||!C&&k<0?(T.preventDefault(),bt.flushSync(()=>{a(W=>W+Math[j](k,M*B))})):/firefox/i.test(tu())&&(v.scrollTop+=k))}const v=(l==null?void 0:l.current)||r.floating;if(n&&v)return v.addEventListener("wheel",m),requestAnimationFrame(()=>{d.current=v.scrollTop,i.current!=null&&(h.current={...i.current})}),()=>{d.current=null,h.current=null,v.removeEventListener("wheel",m)}},[o,n,r.floating,i,l,a]);const A=D.useMemo(()=>({onKeyDown(){f.current=!0},onWheel(){f.current=!1},onPointerMove(){f.current=!1},onScroll(){const m=(l==null?void 0:l.current)||r.floating;if(!(!i.current||!m||!f.current)){if(d.current!==null){const v=m.scrollTop-d.current;(i.current.bottom<-.5&&v<-1||i.current.top<-.5&&v>1)&&bt.flushSync(()=>a(T=>T+v))}requestAnimationFrame(()=>{d.current=m.scrollTop})}}}),[r.floating,a,i,l]);return D.useMemo(()=>o?{floating:A}:{},[o,A])}let ut=R.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});ut.displayName="FloatingContext";let rr=R.createContext(null);rr.displayName="PlacementContext";function wu(e){return R.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Eu(){return R.useContext(ut).setReference}function Ru(){return R.useContext(ut).getReferenceProps}function Su(){let{getFloatingProps:e,slot:t}=R.useContext(ut);return R.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Cu(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=R.useContext(rr),n=R.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var l;return(l=i==null?void 0:i.outerHTML)!=null?l:i})]);ae(()=>{t==null||t(n??null)},[t,n]);let r=R.useContext(ut);return R.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Kr=4;function Tu({children:e,enabled:t=!0}){let[n,r]=R.useState(null),[o,i]=R.useState(0),l=R.useRef(null),[s,a]=R.useState(null);Au(s);let f=t&&n!==null&&s!==null,{to:d="bottom",gap:h=0,offset:A=0,padding:m=0,inner:v}=Ou(n,s),[T,k="center"]=d.split(" ");ae(()=>{f&&i(0)},[f]);let{refs:N,floatingStyles:C,context:M}=vu({open:f,placement:T==="selection"?k==="center"?"bottom":`bottom-${k}`:k==="center"?`${T}`:`${T}-${k}`,strategy:"absolute",transform:!1,middleware:[qn({mainAxis:T==="selection"?0:h,crossAxis:A}),Ro({padding:m}),T!=="selection"&&So({padding:m}),T==="selection"&&v?yu({...v,padding:m,overflowRef:l,offset:o,minItemsVisible:Kr,referenceOverflowThreshold:m,onFallbackChange(b){var w,y;if(!b)return;let F=M.elements.floating;if(!F)return;let g=parseFloat(getComputedStyle(F).scrollPaddingBottom)||0,x=Math.min(Kr,F.childElementCount),O=0,S=0;for(let P of(y=(w=M.elements.floating)==null?void 0:w.childNodes)!=null?y:[])if(P instanceof HTMLElement){let E=P.offsetTop,I=E+P.clientHeight+g,H=F.scrollTop,$=H+F.clientHeight;if(E>=H&&I<=$)x--;else{S=Math.max(0,Math.min(I,$)-Math.max(E,H)),O=P.clientHeight;break}}x>=1&&i(P=>{let E=O*x-S+g;return P>=E?P:E})}}):null,Vl({padding:m,apply({availableWidth:b,availableHeight:w,elements:y}){Object.assign(y.floating.style,{overflow:"auto",maxWidth:`${b}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${w}px)`})}})].filter(Boolean),whileElementsMounted:xo}),[B=T,j=k]=M.placement.split("-");T==="selection"&&(B="selection");let W=R.useMemo(()=>({anchor:[B,j].filter(Boolean).join(" ")}),[B,j]),G=xu(M,{overflowRef:l,onChange:i}),{getReferenceProps:u,getFloatingProps:c}=bu([G]),p=ne(b=>{a(b),N.setFloating(b)});return D.createElement(rr.Provider,{value:r},D.createElement(ut.Provider,{value:{setFloating:p,setReference:N.setReference,styles:C,getReferenceProps:u,getFloatingProps:c,slot:W}},e))}function Au(e){ae(()=>{if(!e)return;let t=new MutationObserver(()=>{let n=window.getComputedStyle(e).maxHeight,r=parseFloat(n);if(isNaN(r))return;let o=parseInt(n);isNaN(o)||r!==o&&(e.style.maxHeight=`${Math.ceil(r)}px`)});return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}},[e])}function Ou(e,t){var n,r,o;let i=En((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),l=En((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),s=En((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:l,padding:s}}function En(e,t,n=void 0){let r=st(),o=ne((a,f)=>{if(a==null)return[n,null];if(typeof a=="number")return[a,null];if(typeof a=="string"){if(!f)return[n,null];let d=Jr(a,f);return[d,h=>{let A=wi(a);{let m=A.map(v=>window.getComputedStyle(f).getPropertyValue(v));r.requestAnimationFrame(function v(){r.nextFrame(v);let T=!1;for(let[N,C]of A.entries()){let M=window.getComputedStyle(f).getPropertyValue(C);if(m[N]!==M){m[N]=M,T=!0;break}}if(!T)return;let k=Jr(a,f);d!==k&&(h(k),d=k)})}return r.dispose}]}return[n,null]}),i=R.useMemo(()=>o(e,t)[0],[e,t]),[l=i,s]=R.useState();return ae(()=>{let[a,f]=o(e,t);if(s(a),!!f)return f(s)},[e,t]),l}function wi(e){let t=/var\((.*)\)/.exec(e);if(t){let n=t[1].indexOf(",");if(n===-1)return[t[1]];let r=t[1].slice(0,n).trim(),o=t[1].slice(n+1).trim();return o?[r,...wi(o)]:[r]}return[]}function Jr(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),r}function Fu(e,t){let[n,r]=R.useState(t);return!e&&n!==t&&r(t),e?n:t}let or=R.createContext(null);or.displayName="OpenClosedContext";var Et=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Et||{});function Pu(){return R.useContext(or)}function ku({value:e,children:t}){return R.createElement(or.Provider,{value:e},t)}function Nu(e){throw new Error("Unexpected object: "+e)}var ie=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ie||{});function Rn(e,t){let n=t.resolveItems();if(n.length<=0)return null;let r=t.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 1:{o===-1&&(o=n.length);for(let i=o-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 2:{for(let i=o+1;i<n.length;++i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 3:{for(let i=n.length-1;i>=0;--i)if(!t.resolveDisabled(n[i],i,n))return i;return r}case 4:{for(let i=0;i<n.length;++i)if(t.resolveId(n[i],i,n)===e.id)return i;return r}case 5:return null;default:Nu(e)}}function Du(e){let t=ne(e),n=R.useRef(!1);R.useEffect(()=>(n.current=!1,()=>{n.current=!0,ei(()=>{n.current&&t()})}),[t])}function Iu(){let e=typeof document>"u";return"useSyncExternalStore"in D?(t=>t.useSyncExternalStore)(D)(()=>()=>{},()=>!1,()=>!e):!1}function Mu(){let e=Iu(),[t,n]=D.useState(Ke.isHandoffComplete);return t&&Ke.isHandoffComplete===!1&&n(!1),D.useEffect(()=>{t!==!0&&n(!0)},[t]),D.useEffect(()=>Ke.handoff(),[]),e?!1:t}let Lu=R.createContext(!1);function $u(){return R.useContext(Lu)}function ju(e){let t=$u(),n=R.useContext(Ri),r=nr(e),[o,i]=R.useState(()=>{var l;if(!t&&n!==null)return(l=n.current)!=null?l:null;if(Ke.isServer)return null;let s=r==null?void 0:r.getElementById("headlessui-portal-root");if(s)return s;if(r===null)return null;let a=r.createElement("div");return a.setAttribute("id","headlessui-portal-root"),r.body.appendChild(a)});return R.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),R.useEffect(()=>{t||n!==null&&i(n.current)},[n,i,t]),o}let Ei=R.Fragment,Bu=Se(function(e,t){let n=e,r=R.useRef(null),o=Pe(ca(h=>{r.current=h}),t),i=nr(r),l=ju(r),[s]=R.useState(()=>{var h;return Ke.isServer?null:(h=i==null?void 0:i.createElement("div"))!=null?h:null}),a=R.useContext(Vu),f=Mu();ae(()=>{!l||!s||l.contains(s)||(s.setAttribute("data-headlessui-portal",""),l.appendChild(s))},[l,s]),ae(()=>{if(s&&a)return a.register(s)},[a,s]),Du(()=>{var h;!l||!s||(s instanceof Node&&l.contains(s)&&l.removeChild(s),l.childNodes.length<=0&&((h=l.parentElement)==null||h.removeChild(l)))});let d=Re();return f?!l||!s?null:Ae.createPortal(d({ourProps:{ref:o},theirProps:n,slot:{},defaultTag:Ei,name:"Portal"}),s):null});function Hu(e,t){let n=Pe(t),{enabled:r=!0,...o}=e,i=Re();return r?R.createElement(Bu,{...o,ref:n}):i({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:Ei,name:"Portal"})}let Wu=R.Fragment,Ri=R.createContext(null);function Uu(e,t){let{target:n,...r}=e,o={ref:Pe(t)},i=Re();return R.createElement(Ri.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:Wu,name:"Popover.Group"}))}let Vu=R.createContext(null),Gu=Se(Hu),Yu=Se(Uu),qu=Object.assign(Gu,{Group:Yu});function _u(e,t){let n=R.useRef({left:0,top:0});if(ae(()=>{if(!t)return;let o=t.getBoundingClientRect();o&&(n.current=o)},[e,t]),t==null||!e||t===document.activeElement)return!1;let r=t.getBoundingClientRect();return r.top!==n.current.top||r.left!==n.current.left}let Qr=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Zr(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let i=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),i=!0;let l=i?(n=o.innerText)!=null?n:"":r;return Qr.test(l)&&(l=l.replace(Qr,"")),l}function zu(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let r=n.split(" ").map(o=>{let i=document.getElementById(o);if(i){let l=i.getAttribute("aria-label");return typeof l=="string"?l.trim():Zr(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Zr(e).trim()}function Xu(e){let t=R.useRef(""),n=R.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=zu(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Ku=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ku||{}),Ju=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Ju||{}),Qu=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Qu||{}),Zu=(e=>(e[e.OpenListbox=0]="OpenListbox",e[e.CloseListbox=1]="CloseListbox",e[e.GoToOption=2]="GoToOption",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterOption=5]="RegisterOption",e[e.UnregisterOption=6]="UnregisterOption",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e))(Zu||{});function Sn(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=vi(t(e.options.slice()),i=>i.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let ec={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1,__demoMode:!1}},0(e){if(e.dataRef.current.disabled||e.listboxState===0)return e;let t=e.activeOptionIndex,{isSelected:n}=e.dataRef.current,r=e.options.findIndex(o=>n(o.dataRef.current.value));return r!==-1&&(t=r),{...e,listboxState:0,activeOptionIndex:t,__demoMode:!1}},2(e,t){var n,r,o,i,l;if(e.dataRef.current.disabled||e.listboxState===1)return e;let s={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ie.Nothing)return{...s,activeOptionIndex:null};if(t.focus===ie.Specific)return{...s,activeOptionIndex:e.options.findIndex(d=>d.id===t.id)};if(t.focus===ie.Previous){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,A=Rn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:m=>m.id,resolveDisabled:m=>m.dataRef.current.disabled});if(A!==null){let m=e.options[A].dataRef.current.domRef;if(((r=h.current)==null?void 0:r.previousElementSibling)===m.current||((o=m.current)==null?void 0:o.previousElementSibling)===null)return{...s,activeOptionIndex:A}}}}else if(t.focus===ie.Next){let d=e.activeOptionIndex;if(d!==null){let h=e.options[d].dataRef.current.domRef,A=Rn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:m=>m.id,resolveDisabled:m=>m.dataRef.current.disabled});if(A!==null){let m=e.options[A].dataRef.current.domRef;if(((i=h.current)==null?void 0:i.nextElementSibling)===m.current||((l=m.current)==null?void 0:l.nextElementSibling)===null)return{...s,activeOptionIndex:A}}}}let a=Sn(e),f=Rn(t,{resolveItems:()=>a.options,resolveActiveIndex:()=>a.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled});return{...s,...a,activeOptionIndex:f}},3:(e,t)=>{if(e.dataRef.current.disabled||e.listboxState===1)return e;let n=e.searchQuery!==""?0:1,r=e.searchQuery+t.value.toLowerCase(),o=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+n).concat(e.options.slice(0,e.activeOptionIndex+n)):e.options).find(l=>{var s;return!l.dataRef.current.disabled&&((s=l.dataRef.current.textValue)==null?void 0:s.startsWith(r))}),i=o?e.options.indexOf(o):-1;return i===-1||i===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:i,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n={id:t.id,dataRef:t.dataRef},r=Sn(e,o=>[...o,n]);return e.activeOptionIndex===null&&e.dataRef.current.isSelected(t.dataRef.current.value)&&(r.activeOptionIndex=r.options.indexOf(n)),{...e,...r}},6:(e,t)=>{let n=Sn(e,r=>{let o=r.findIndex(i=>i.id===t.id);return o!==-1&&r.splice(o,1),r});return{...e,...n,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.optionsElement===t.element?e:{...e,optionsElement:t.element}},ir=R.createContext(null);ir.displayName="ListboxActionsContext";function on(e){let t=R.useContext(ir);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,on),n}return t}let ln=R.createContext(null);ln.displayName="ListboxDataContext";function At(e){let t=R.useContext(ln);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,At),n}return t}function tc(e,t){return Me(t.type,ec,e,t)}let nc=R.Fragment;function rc(e,t){var n;let r=Jn(),{value:o,defaultValue:i,form:l,name:s,onChange:a,by:f,invalid:d=!1,disabled:h=r||!1,horizontal:A=!1,multiple:m=!1,__demoMode:v=!1,...T}=e;const k=A?"horizontal":"vertical";let N=Pe(t),C=Zs(i),[M=m?[]:void 0,B]=Qs(o,a,C),[j,W]=R.useReducer(tc,{dataRef:R.createRef(),listboxState:v?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,optionsVisible:!1,buttonElement:null,optionsElement:null,__demoMode:v}),G=R.useRef({static:!1,hold:!1}),u=R.useRef(new Map),c=xa(f),p=R.useCallback(U=>Me(b.mode,{1:()=>M.some(z=>c(z,U)),0:()=>c(M,U)}),[M]),b=R.useMemo(()=>({...j,value:M,disabled:h,invalid:d,mode:m?1:0,orientation:k,compare:c,isSelected:p,optionsPropsRef:G,listRef:u}),[M,h,d,m,j,u]);ae(()=>{j.dataRef.current=b},[b]);let w=b.listboxState===0;Ba(w,[b.buttonElement,b.optionsElement],(U,z)=>{var K;W({type:1}),hi(z,tr.Loose)||(U.preventDefault(),(K=b.buttonElement)==null||K.focus())});let y=R.useMemo(()=>({open:b.listboxState===0,disabled:h,invalid:d,value:M}),[b,h,M,d]),F=ne(U=>{let z=b.options.find(K=>K.id===U);z&&I(z.dataRef.current.value)}),g=ne(()=>{if(b.activeOptionIndex!==null){let{dataRef:U,id:z}=b.options[b.activeOptionIndex];I(U.current.value),W({type:2,focus:ie.Specific,id:z})}}),x=ne(()=>W({type:0})),O=ne(()=>W({type:1})),S=st(),P=ne((U,z,K)=>{S.dispose(),S.microTask(()=>U===ie.Specific?W({type:2,focus:ie.Specific,id:z,trigger:K}):W({type:2,focus:U,trigger:K}))}),E=ne((U,z)=>(W({type:5,id:U,dataRef:z}),()=>W({type:6,id:U}))),I=ne(U=>Me(b.mode,{0(){return B==null?void 0:B(U)},1(){let z=b.value.slice(),K=z.findIndex(Z=>c(Z,U));return K===-1?z.push(U):z.splice(K,1),B==null?void 0:B(z)}})),H=ne(U=>W({type:3,value:U})),$=ne(()=>W({type:4})),X=ne(U=>{W({type:7,element:U})}),V=ne(U=>{W({type:8,element:U})}),q=R.useMemo(()=>({onChange:I,registerOption:E,goToOption:P,closeListbox:O,openListbox:x,selectActiveOption:g,selectOption:F,search:H,clearSearch:$,setButtonElement:X,setOptionsElement:V}),[]),[ee,te]=ga({inherit:!0}),_={ref:N},Q=R.useCallback(()=>{if(C!==void 0)return B==null?void 0:B(C)},[B,C]),Y=Re();return R.createElement(te,{value:ee,props:{htmlFor:(n=b.buttonElement)==null?void 0:n.id},slot:{open:b.listboxState===0,disabled:h}},R.createElement(Tu,null,R.createElement(ir.Provider,{value:q},R.createElement(ln.Provider,{value:b},R.createElement(ku,{value:Me(b.listboxState,{0:Et.Open,1:Et.Closed})},s!=null&&M!=null&&R.createElement(ia,{disabled:h,data:{[s]:M},form:l,onReset:Q}),Y({ourProps:_,theirProps:T,slot:y,defaultTag:nc,name:"Listbox"}))))))}let oc="button";function ic(e,t){var n;let r=At("Listbox.Button"),o=on("Listbox.Button"),i=R.useId(),l=si(),{id:s=l||`headlessui-listbox-button-${i}`,disabled:a=r.disabled||!1,autoFocus:f=!1,...d}=e,h=Pe(t,Eu(),o.setButtonElement),A=Ru(),m=ne(b=>{switch(b.key){case le.Enter:ea(b.currentTarget);break;case le.Space:case le.ArrowDown:b.preventDefault(),Ae.flushSync(()=>o.openListbox()),r.value||o.goToOption(ie.First);break;case le.ArrowUp:b.preventDefault(),Ae.flushSync(()=>o.openListbox()),r.value||o.goToOption(ie.Last);break}}),v=ne(b=>{switch(b.key){case le.Space:b.preventDefault();break}}),T=ne(b=>{var w;if(aa(b.currentTarget))return b.preventDefault();r.listboxState===0?(Ae.flushSync(()=>o.closeListbox()),(w=r.buttonElement)==null||w.focus({preventScroll:!0})):(b.preventDefault(),o.openListbox())}),k=ne(b=>b.preventDefault()),N=fi([s]),C=fa(),{isFocusVisible:M,focusProps:B}=Bs({autoFocus:f}),{isHovered:j,hoverProps:W}=js({isDisabled:a}),{pressed:G,pressProps:u}=Ys({disabled:a}),c=R.useMemo(()=>({open:r.listboxState===0,active:G||r.listboxState===0,disabled:a,invalid:r.invalid,value:r.value,hover:j,focus:M,autofocus:f}),[r.listboxState,r.value,a,j,M,G,r.invalid,f]),p=ni(A(),{ref:h,id:s,type:Ha(e,r.buttonElement),"aria-haspopup":"listbox","aria-controls":(n=r.optionsElement)==null?void 0:n.id,"aria-expanded":r.listboxState===0,"aria-labelledby":N,"aria-describedby":C,disabled:a||void 0,autoFocus:f,onKeyDown:m,onKeyUp:v,onKeyPress:k,onClick:T},B,W,u);return Re()({ourProps:p,theirProps:d,slot:c,defaultTag:oc,name:"Listbox.Button"})}let Si=R.createContext(!1),lc="div",sc=$n.RenderStrategy|$n.Static;function ac(e,t){var n,r;let o=R.useId(),{id:i=`headlessui-listbox-options-${o}`,anchor:l,portal:s=!1,modal:a=!0,transition:f=!1,...d}=e,h=wu(l),[A,m]=R.useState(null);h&&(s=!0);let v=At("Listbox.Options"),T=on("Listbox.Options"),k=nr(v.optionsElement),N=Pu(),[C,M]=Ja(f,A,N!==null?(N&Et.Open)===Et.Open:v.listboxState===0);Ta(C,v.buttonElement,T.closeListbox);let B=v.__demoMode?!1:a&&v.listboxState===0;qa(B,k);let j=v.__demoMode?!1:a&&v.listboxState===0;Ca(j,{allowed:R.useCallback(()=>[v.buttonElement,v.optionsElement],[v.buttonElement,v.optionsElement])});let W=v.listboxState!==0,G=_u(W,v.buttonElement)?!1:C,u=C&&v.listboxState===1,c=Fu(u,v.value),p=ne($=>v.compare(c,$)),b=R.useMemo(()=>{var $;if(h==null||!(($=h==null?void 0:h.to)!=null&&$.includes("selection")))return null;let X=v.options.findIndex(V=>p(V.dataRef.current.value));return X===-1&&(X=0),X},[h,v.options]),w=(()=>{if(h==null)return;if(b===null)return{...h,inner:void 0};let $=Array.from(v.listRef.current.values());return{...h,inner:{listRef:{current:$},index:b}}})(),[y,F]=Cu(w),g=Su(),x=Pe(t,h?y:null,T.setOptionsElement,m),O=st();R.useEffect(()=>{var $;let X=v.optionsElement;X&&v.listboxState===0&&X!==(($=Tt(X))==null?void 0:$.activeElement)&&(X==null||X.focus({preventScroll:!0}))},[v.listboxState,v.optionsElement]);let S=ne($=>{var X,V;switch(O.dispose(),$.key){case le.Space:if(v.searchQuery!=="")return $.preventDefault(),$.stopPropagation(),T.search($.key);case le.Enter:if($.preventDefault(),$.stopPropagation(),v.activeOptionIndex!==null){let{dataRef:q}=v.options[v.activeOptionIndex];T.onChange(q.current.value)}v.mode===0&&(Ae.flushSync(()=>T.closeListbox()),(X=v.buttonElement)==null||X.focus({preventScroll:!0}));break;case Me(v.orientation,{vertical:le.ArrowDown,horizontal:le.ArrowRight}):return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.Next);case Me(v.orientation,{vertical:le.ArrowUp,horizontal:le.ArrowLeft}):return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.Previous);case le.Home:case le.PageUp:return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.First);case le.End:case le.PageDown:return $.preventDefault(),$.stopPropagation(),T.goToOption(ie.Last);case le.Escape:$.preventDefault(),$.stopPropagation(),Ae.flushSync(()=>T.closeListbox()),(V=v.buttonElement)==null||V.focus({preventScroll:!0});return;case le.Tab:$.preventDefault(),$.stopPropagation(),Ae.flushSync(()=>T.closeListbox()),Ia(v.buttonElement,$.shiftKey?Hn.Previous:Hn.Next);break;default:$.key.length===1&&(T.search($.key),O.setTimeout(()=>T.clearSearch(),350));break}}),P=(n=v.buttonElement)==null?void 0:n.id,E=R.useMemo(()=>({open:v.listboxState===0}),[v.listboxState]),I=ni(h?g():{},{id:i,ref:x,"aria-activedescendant":v.activeOptionIndex===null||(r=v.options[v.activeOptionIndex])==null?void 0:r.id,"aria-multiselectable":v.mode===1?!0:void 0,"aria-labelledby":P,"aria-orientation":v.orientation,onKeyDown:S,role:"listbox",tabIndex:v.listboxState===0?0:void 0,style:{...d.style,...F,"--button-width":Ea(v.buttonElement,!0).width},...Ka(M)}),H=Re();return R.createElement(qu,{enabled:s?e.static||C:!1},R.createElement(ln.Provider,{value:v.mode===1?v:{...v,isSelected:p}},H({ourProps:I,theirProps:d,slot:E,defaultTag:lc,features:sc,visible:G,name:"Listbox.Options"})))}let uc="div";function cc(e,t){let n=R.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...l}=e,s=R.useContext(Si)===!0,a=At("Listbox.Option"),f=on("Listbox.Option"),d=a.activeOptionIndex!==null?a.options[a.activeOptionIndex].id===r:!1,h=a.isSelected(i),A=R.useRef(null),m=Xu(A),v=at({disabled:o,value:i,domRef:A,get textValue(){return m()}}),T=Pe(t,A,c=>{c?a.listRef.current.set(r,c):a.listRef.current.delete(r)});ae(()=>{if(!a.__demoMode&&a.listboxState===0&&d&&a.activationTrigger!==0)return $e().requestAnimationFrame(()=>{var c,p;(p=(c=A.current)==null?void 0:c.scrollIntoView)==null||p.call(c,{block:"nearest"})})},[A,d,a.__demoMode,a.listboxState,a.activationTrigger,a.activeOptionIndex]),ae(()=>{if(!s)return f.registerOption(r,v)},[v,r,s]);let k=ne(c=>{var p;if(o)return c.preventDefault();f.onChange(i),a.mode===0&&(Ae.flushSync(()=>f.closeListbox()),(p=a.buttonElement)==null||p.focus({preventScroll:!0}))}),N=ne(()=>{if(o)return f.goToOption(ie.Nothing);f.goToOption(ie.Specific,r)}),C=_a(),M=ne(c=>{C.update(c),!o&&(d||f.goToOption(ie.Specific,r,0))}),B=ne(c=>{C.wasMoved(c)&&(o||d||f.goToOption(ie.Specific,r,0))}),j=ne(c=>{C.wasMoved(c)&&(o||d&&f.goToOption(ie.Nothing))}),W=R.useMemo(()=>({active:d,focus:d,selected:h,disabled:o,selectedOption:h&&s}),[d,h,o,s]),G=s?{}:{id:r,ref:T,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":h,disabled:void 0,onClick:k,onFocus:N,onPointerEnter:M,onMouseEnter:M,onPointerMove:B,onMouseMove:B,onPointerLeave:j,onMouseLeave:j},u=Re();return!h&&s?null:u({ourProps:G,theirProps:l,slot:W,defaultTag:uc,name:"Listbox.Option"})}let fc=R.Fragment;function dc(e,t){let{options:n,placeholder:r,...o}=e,i={ref:Pe(t)},l=At("ListboxSelectedOption"),s=R.useMemo(()=>({}),[]),a=l.value===void 0||l.value===null||l.mode===1&&Array.isArray(l.value)&&l.value.length===0,f=Re();return R.createElement(Si.Provider,{value:!0},f({ourProps:i,theirProps:{...o,children:R.createElement(R.Fragment,null,r&&a?r:n)},slot:s,defaultTag:fc,name:"ListboxSelectedOption"}))}let pc=Se(rc),Ci=Se(ic),mc=di,Ti=Se(ac),Ai=Se(cc),gc=Se(dc),hc=Object.assign(pc,{Button:Ci,Label:mc,Options:Ti,Option:Ai,SelectedOption:gc});function Oi({children:e}){const{activeAddress:t,activeWallet:n}=zt.useWallet(),[r,o]=R.useState(!1),[i,l]=R.useState(!1),{refs:s,floatingStyles:a,context:f}=$o({open:r,onOpenChange:o,placement:"bottom-end",middleware:[qn(8),So(),Ro()],whileElementsMounted:xo}),d=Mo(f),h=Lo(f,{outsidePressEvent:"mousedown"}),{getReferenceProps:A,getFloatingProps:m}=jo([d,h]),v=it(),T=()=>{t&&(navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),2e3))},k=async()=>{if(n)try{await n.disconnect(),o(!1)}catch(j){console.error("Error disconnecting wallet:",j)}},N=j=>{n&&n.setActiveAccount&&n.setActiveAccount(j)},C=j=>`${j.substring(0,6)}...${j.substring(j.length-4)}`,M=e||L.jsx(zn,{}),B=R.cloneElement(M,A({ref:s.setReference}));return L.jsxs(L.Fragment,{children:[B,r&&L.jsx(No,{children:L.jsx(Io,{context:f,modal:!1,children:L.jsx("div",{ref:s.setFloating,style:a,...m(),"aria-labelledby":v,className:"z-50 w-72 rounded-xl bg-white dark:bg-[#001324] shadow-xl border border-gray-200 dark:border-[#192A39]",children:L.jsxs("div",{className:"p-4",children:[L.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[L.jsx("div",{className:"h-12 w-12 rounded-full bg-gray-200 dark:bg-[#192A39] flex items-center justify-center overflow-hidden",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-8 w-8 text-gray-400 dark:text-gray-500",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z",clipRule:"evenodd"})})}),L.jsxs("div",{children:[L.jsx("h3",{id:v,className:"text-lg font-bold text-gray-900 dark:text-[#E9E9FD] wallet-custom-font",children:t?C(t):"My Wallet"}),n&&L.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:n.metadata.name})]})]}),n&&n.accounts&&n.accounts.length>1&&L.jsx("div",{className:"mb-4",children:L.jsxs(hc,{value:t||"",onChange:N,children:[L.jsx(di,{className:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1",children:"Select Account"}),L.jsxs("div",{className:"relative mt-1",children:[L.jsxs(Ci,{className:"grid w-full cursor-default grid-cols-1 rounded-lg border border-gray-300 dark:border-[#192A39] bg-white dark:bg-[#101B29] py-2 px-3 text-left text-gray-800 dark:text-gray-300 shadow-sm focus:outline-none focus:ring-2 focus:ring-[#2D2DF1] dark:focus:ring-[#BFBFF9] focus:border-transparent text-sm",children:[L.jsx("span",{className:"col-start-1 row-start-1 truncate pr-8",children:t?C(t):"Select account"}),L.jsx("span",{className:"col-start-1 row-start-1 self-center justify-self-end",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"text-gray-500 dark:text-gray-400","aria-hidden":"true",children:L.jsx("path",{d:"M4 6L8 10L12 6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),L.jsx(Ti,{transition:!0,className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white dark:bg-[#101B29] py-1 shadow-lg ring-1 ring-black/5 dark:ring-[#192A39]/50 focus:outline-none text-sm data-[closed]:data-[leave]:opacity-0 data-[leave]:transition data-[leave]:duration-100 data-[leave]:ease-in",children:n.accounts.map(j=>L.jsxs(Ai,{value:j.address,className:"group relative cursor-default select-none py-2 pl-3 pr-9 text-gray-900 dark:text-gray-300 data-[focus]:bg-[#E9E9FD] dark:data-[focus]:bg-[#192A39] data-[focus]:text-gray-900 dark:data-[focus]:text-[#E9E9FD] data-[focus]:outline-none",children:[L.jsx("span",{className:"block truncate font-normal group-data-[selected]:font-medium",children:C(j.address)}),L.jsx("span",{className:"absolute inset-y-0 right-0 flex items-center pr-3 text-[#2D2DF1] dark:text-[#BFBFF9] group-[&:not([data-selected])]:hidden",children:L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"h-5 w-5","aria-hidden":"true",children:L.jsx("path",{d:"M13.3334 4L6.00008 11.3333L2.66675 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})]},j.address))})]})]})}),L.jsxs("div",{className:"flex gap-2",children:[L.jsx("button",{onClick:T,className:"flex-1 py-2 px-4 bg-gray-100 dark:bg-[#192A39] text-gray-700 dark:text-gray-300 font-medium rounded-xl hover:bg-gray-200 dark:hover:bg-[#263A4A] transition-colors text-sm flex items-center justify-center",title:"Copy address",children:i?L.jsxs(L.Fragment,{children:[L.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 text-green-500 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:L.jsx("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})}),"Copied"]}):L.jsxs(L.Fragment,{children:[L.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 mr-1.5",viewBox:"0 0 20 20",fill:"currentColor",children:[L.jsx("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),L.jsx("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"})]}),"Copy"]})}),L.jsx("button",{onClick:k,className:"flex-1 py-2 px-4 bg-red-100 dark:bg-red-900/40 text-red-700 dark:text-red-300 font-medium rounded-xl hover:bg-red-200 dark:hover:bg-red-800/60 transition-colors text-sm",children:"Disconnect"})]})]})})})})]})}function vc(){const{activeAddress:e}=zt.useWallet();return e?L.jsx(Oi,{}):L.jsx(Ho,{})}Pi();exports.ConnectWalletButton=Un;exports.ConnectWalletMenu=Ho;exports.ConnectedWalletButton=zn;exports.ConnectedWalletMenu=Oi;exports.WalletButton=vc;exports.WalletList=Bo;
|
|
42
|
+
//# sourceMappingURL=index.cjs.map
|