@edgex-web/components 0.1.0-beta.4 β†’ 0.1.0-beta.6

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.
Files changed (30) hide show
  1. package/dist/components/Deposit/index.d.ts +0 -2
  2. package/dist/components/Deposit/index.d.ts.map +1 -1
  3. package/dist/components/Deposit/src/DepositManager.d.ts.map +1 -1
  4. package/dist/components/Deposit/src/evm/WalletView.d.ts +1 -0
  5. package/dist/components/Deposit/src/evm/WalletView.d.ts.map +1 -1
  6. package/dist/components/Deposit/src/evm/index.d.ts +9 -2
  7. package/dist/components/Deposit/src/evm/index.d.ts.map +1 -1
  8. package/dist/components/Deposit/src/index.d.ts.map +1 -1
  9. package/dist/components/Deposit/src/mpc/WalletView.d.ts.map +1 -1
  10. package/dist/components/Deposit/src/mpc/index.d.ts +6 -2
  11. package/dist/components/Deposit/src/mpc/index.d.ts.map +1 -1
  12. package/dist/components/Deposit/src/selector/Asset.d.ts +1 -0
  13. package/dist/components/Deposit/src/selector/Asset.d.ts.map +1 -1
  14. package/dist/components/Deposit/src/selector/Chain.d.ts +6 -10
  15. package/dist/components/Deposit/src/selector/Chain.d.ts.map +1 -1
  16. package/dist/components/Deposit/src/selector/index.d.ts +1 -0
  17. package/dist/components/Deposit/src/selector/index.d.ts.map +1 -1
  18. package/dist/components/Deposit/src/utils.d.ts +56 -1
  19. package/dist/components/Deposit/src/utils.d.ts.map +1 -1
  20. package/dist/components/Deposit/types/index.d.ts +18 -5
  21. package/dist/components/Deposit/types/index.d.ts.map +1 -1
  22. package/dist/index.esm.js +3422 -3857
  23. package/dist/index.esm.js.map +1 -1
  24. package/dist/index.umd.js +31 -50
  25. package/dist/index.umd.js.map +1 -1
  26. package/package.json +5 -2
  27. package/dist/components/Deposit/src/Deposit.d.ts +0 -15
  28. package/dist/components/Deposit/src/Deposit.d.ts.map +0 -1
  29. package/dist/components/Deposit/src/components.d.ts +0 -89
  30. package/dist/components/Deposit/src/components.d.ts.map +0 -1
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(fe,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],h):(fe=typeof globalThis<"u"?globalThis:fe||self,h(fe.EdgeXComponents={},fe.React,fe.ReactDOM))})(this,function(fe,h,we){"use strict";var td=Object.defineProperty;var nd=(fe,h,we)=>h in fe?td(fe,h,{enumerable:!0,configurable:!0,writable:!0,value:we}):fe[h]=we;var Ye=(fe,h,we)=>nd(fe,typeof h!="symbol"?h+"":h,we);function Er(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 L=Er(h),It=Er(we);function vs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fn={exports:{}},Et={};/**
1
+ (function(ne,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],d):(ne=typeof globalThis<"u"?globalThis:ne||self,d(ne.EdgeXComponents={},ne.React,ne.ReactDOM))})(this,function(ne,d,de){"use strict";var Af=Object.defineProperty;var Mf=(ne,d,de)=>d in ne?Af(ne,d,{enumerable:!0,configurable:!0,writable:!0,value:de}):ne[d]=de;var _e=(ne,d,de)=>Mf(ne,typeof d!="symbol"?d+"":d,de);function sr(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 A=sr(d),At=sr(de);var on={exports:{}},mt={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var wr;function bs(){if(wr)return Et;wr=1;var e=h,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function u(c,s,l){var a,d={},f=null,p=null;l!==void 0&&(f=""+l),s.key!==void 0&&(f=""+s.key),s.ref!==void 0&&(p=s.ref);for(a in s)r.call(s,a)&&!i.hasOwnProperty(a)&&(d[a]=s[a]);if(c&&c.defaultProps)for(a in s=c.defaultProps,s)d[a]===void 0&&(d[a]=s[a]);return{$$typeof:t,type:c,key:f,ref:p,props:d,_owner:o.current}}return Et.Fragment=n,Et.jsx=u,Et.jsxs=u,Et}var wt={};/**
9
+ */var lr;function Xi(){if(lr)return mt;lr=1;var e=d,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function c(u,i,l){var a,p={},m=null,f=null;l!==void 0&&(m=""+l),i.key!==void 0&&(m=""+i.key),i.ref!==void 0&&(f=i.ref);for(a in i)r.call(i,a)&&!s.hasOwnProperty(a)&&(p[a]=i[a]);if(u&&u.defaultProps)for(a in i=u.defaultProps,i)p[a]===void 0&&(p[a]=i[a]);return{$$typeof:t,type:u,key:m,ref:f,props:p,_owner:o.current}}return mt.Fragment=n,mt.jsx=c,mt.jsxs=c,mt}var ht={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,48 +14,48 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var xr;function ys(){return xr||(xr=1,process.env.NODE_ENV!=="production"&&function(){var e=h,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.provider"),c=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),m=Symbol.iterator,v="@@iterator";function b(g){if(g===null||typeof g!="object")return null;var T=m&&g[m]||g[v];return typeof T=="function"?T:null}var x=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(g){{for(var T=arguments.length,_=new Array(T>1?T-1:0),z=1;z<T;z++)_[z-1]=arguments[z];y("error",g,_)}}function y(g,T,_){{var z=x.ReactDebugCurrentFrame,le=z.getStackAddendum();le!==""&&(T+="%s",_=_.concat([le]));var ae=_.map(function(re){return String(re)});ae.unshift("Warning: "+T),Function.prototype.apply.call(console[g],console,ae)}}var S=!1,E=!1,F=!1,j=!1,K=!1,ee;ee=Symbol.for("react.module.reference");function D(g){return!!(typeof g=="string"||typeof g=="function"||g===r||g===i||K||g===o||g===l||g===a||j||g===p||S||E||F||typeof g=="object"&&g!==null&&(g.$$typeof===f||g.$$typeof===d||g.$$typeof===u||g.$$typeof===c||g.$$typeof===s||g.$$typeof===ee||g.getModuleId!==void 0))}function N(g,T,_){var z=g.displayName;if(z)return z;var le=T.displayName||T.name||"";return le!==""?_+"("+le+")":_}function oe(g){return g.displayName||"Context"}function H(g){if(g==null)return null;if(typeof g.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case a:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case c:var T=g;return oe(T)+".Consumer";case u:var _=g;return oe(_._context)+".Provider";case s:return N(g,g.render,"ForwardRef");case d:var z=g.displayName||null;return z!==null?z:H(g.type)||"Memo";case f:{var le=g,ae=le._payload,re=le._init;try{return H(re(ae))}catch{return null}}}return null}var W=Object.assign,X=0,G,J,P,U,C,A,k;function I(){}I.__reactDisabledLog=!0;function B(){{if(X===0){G=console.log,J=console.info,P=console.warn,U=console.error,C=console.group,A=console.groupCollapsed,k=console.groupEnd;var g={configurable:!0,enumerable:!0,value:I,writable:!0};Object.defineProperties(console,{info:g,log:g,warn:g,error:g,group:g,groupCollapsed:g,groupEnd:g})}X++}}function q(){{if(X--,X===0){var g={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},g,{value:G}),info:W({},g,{value:J}),warn:W({},g,{value:P}),error:W({},g,{value:U}),group:W({},g,{value:C}),groupCollapsed:W({},g,{value:A}),groupEnd:W({},g,{value:k})})}X<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Y=x.ReactCurrentDispatcher,$;function R(g,T,_){{if($===void 0)try{throw Error()}catch(le){var z=le.stack.trim().match(/\n( *(at )?)/);$=z&&z[1]||""}return`
18
- `+$+g}}var V=!1,Q;{var ye=typeof WeakMap=="function"?WeakMap:Map;Q=new ye}function M(g,T){if(!g||V)return"";{var _=Q.get(g);if(_!==void 0)return _}var z;V=!0;var le=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ae;ae=Y.current,Y.current=null,B();try{if(T){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Ce){z=Ce}Reflect.construct(g,[],re)}else{try{re.call()}catch(Ce){z=Ce}g.call(re.prototype)}}else{try{throw Error()}catch(Ce){z=Ce}g()}}catch(Ce){if(Ce&&z&&typeof Ce.stack=="string"){for(var te=Ce.stack.split(`
19
- `),Ee=z.stack.split(`
20
- `),pe=te.length-1,he=Ee.length-1;pe>=1&&he>=0&&te[pe]!==Ee[he];)he--;for(;pe>=1&&he>=0;pe--,he--)if(te[pe]!==Ee[he]){if(pe!==1||he!==1)do if(pe--,he--,he<0||te[pe]!==Ee[he]){var De=`
21
- `+te[pe].replace(" at new "," at ");return g.displayName&&De.includes("<anonymous>")&&(De=De.replace("<anonymous>",g.displayName)),typeof g=="function"&&Q.set(g,De),De}while(pe>=1&&he>=0);break}}}finally{V=!1,Y.current=ae,q(),Error.prepareStackTrace=le}var yt=g?g.displayName||g.name:"",lt=yt?R(yt):"";return typeof g=="function"&&Q.set(g,lt),lt}function _e(g,T,_){return M(g,!1)}function vt(g){var T=g.prototype;return!!(T&&T.isReactComponent)}function st(g,T,_){if(g==null)return"";if(typeof g=="function")return M(g,vt(g));if(typeof g=="string")return R(g);switch(g){case l:return R("Suspense");case a:return R("SuspenseList")}if(typeof g=="object")switch(g.$$typeof){case s:return _e(g.render);case d:return st(g.type,T,_);case f:{var z=g,le=z._payload,ae=z._init;try{return st(ae(le),T,_)}catch{}}}return""}var Ft=Object.prototype.hasOwnProperty,ns={},rs=x.ReactDebugCurrentFrame;function cn(g){if(g){var T=g._owner,_=st(g.type,g._source,T?T.type:null);rs.setExtraStackFrame(_)}else rs.setExtraStackFrame(null)}function Lf(g,T,_,z,le){{var ae=Function.call.bind(Ft);for(var re in g)if(ae(g,re)){var te=void 0;try{if(typeof g[re]!="function"){var Ee=Error((z||"React class")+": "+_+" type `"+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof g[re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Ee.name="Invariant Violation",Ee}te=g[re](T,re,z,_,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(pe){te=pe}te&&!(te instanceof Error)&&(cn(le),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",z||"React class",_,re,typeof te),cn(null)),te instanceof Error&&!(te.message in ns)&&(ns[te.message]=!0,cn(le),w("Failed %s type: %s",_,te.message),cn(null))}}}var Ff=Array.isArray;function mr(g){return Ff(g)}function If(g){{var T=typeof Symbol=="function"&&Symbol.toStringTag,_=T&&g[Symbol.toStringTag]||g.constructor.name||"Object";return _}}function kf(g){try{return os(g),!1}catch{return!0}}function os(g){return""+g}function is(g){if(kf(g))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",If(g)),os(g)}var ss=x.ReactCurrentOwner,Nf={key:!0,ref:!0,__self:!0,__source:!0},ls,as;function jf(g){if(Ft.call(g,"ref")){var T=Object.getOwnPropertyDescriptor(g,"ref").get;if(T&&T.isReactWarning)return!1}return g.ref!==void 0}function Rf(g){if(Ft.call(g,"key")){var T=Object.getOwnPropertyDescriptor(g,"key").get;if(T&&T.isReactWarning)return!1}return g.key!==void 0}function Wf(g,T){typeof g.ref=="string"&&ss.current}function Bf(g,T){{var _=function(){ls||(ls=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};_.isReactWarning=!0,Object.defineProperty(g,"key",{get:_,configurable:!0})}}function Hf(g,T){{var _=function(){as||(as=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};_.isReactWarning=!0,Object.defineProperty(g,"ref",{get:_,configurable:!0})}}var Uf=function(g,T,_,z,le,ae,re){var te={$$typeof:t,type:g,key:T,ref:_,props:re,_owner:ae};return te._store={},Object.defineProperty(te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:z}),Object.defineProperty(te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:le}),Object.freeze&&(Object.freeze(te.props),Object.freeze(te)),te};function Vf(g,T,_,z,le){{var ae,re={},te=null,Ee=null;_!==void 0&&(is(_),te=""+_),Rf(T)&&(is(T.key),te=""+T.key),jf(T)&&(Ee=T.ref,Wf(T,le));for(ae in T)Ft.call(T,ae)&&!Nf.hasOwnProperty(ae)&&(re[ae]=T[ae]);if(g&&g.defaultProps){var pe=g.defaultProps;for(ae in pe)re[ae]===void 0&&(re[ae]=pe[ae])}if(te||Ee){var he=typeof g=="function"?g.displayName||g.name||"Unknown":g;te&&Bf(re,he),Ee&&Hf(re,he)}return Uf(g,te,Ee,le,z,ss.current,re)}}var gr=x.ReactCurrentOwner,us=x.ReactDebugCurrentFrame;function bt(g){if(g){var T=g._owner,_=st(g.type,g._source,T?T.type:null);us.setExtraStackFrame(_)}else us.setExtraStackFrame(null)}var vr;vr=!1;function br(g){return typeof g=="object"&&g!==null&&g.$$typeof===t}function cs(){{if(gr.current){var g=H(gr.current.type);if(g)return`
17
+ */var ar;function qi(){return ar||(ar=1,process.env.NODE_ENV!=="production"&&function(){var e=d,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),i=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),a=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.offscreen"),h=Symbol.iterator,v="@@iterator";function b(g){if(g===null||typeof g!="object")return null;var $=h&&g[h]||g[v];return typeof $=="function"?$:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(g){{for(var $=arguments.length,P=new Array($>1?$-1:0),I=1;I<$;I++)P[I-1]=arguments[I];y("error",g,P)}}function y(g,$,P){{var I=E.ReactDebugCurrentFrame,K=I.getStackAddendum();K!==""&&($+="%s",P=P.concat([K]));var X=P.map(function(G){return String(G)});X.unshift("Warning: "+$),Function.prototype.apply.call(console[g],console,X)}}var S=!1,C=!1,O=!1,N=!1,_=!1,W;W=Symbol.for("react.module.reference");function M(g){return!!(typeof g=="string"||typeof g=="function"||g===r||g===s||_||g===o||g===l||g===a||N||g===f||S||C||O||typeof g=="object"&&g!==null&&(g.$$typeof===m||g.$$typeof===p||g.$$typeof===c||g.$$typeof===u||g.$$typeof===i||g.$$typeof===W||g.getModuleId!==void 0))}function F(g,$,P){var I=g.displayName;if(I)return I;var K=$.displayName||$.name||"";return K!==""?P+"("+K+")":P}function j(g){return g.displayName||"Context"}function D(g){if(g==null)return null;if(typeof g.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof g=="function")return g.displayName||g.name||null;if(typeof g=="string")return g;switch(g){case r:return"Fragment";case n:return"Portal";case s:return"Profiler";case o:return"StrictMode";case l:return"Suspense";case a:return"SuspenseList"}if(typeof g=="object")switch(g.$$typeof){case u:var $=g;return j($)+".Consumer";case c:var P=g;return j(P._context)+".Provider";case i:return F(g,g.render,"ForwardRef");case p:var I=g.displayName||null;return I!==null?I:D(g.type)||"Memo";case m:{var K=g,X=K._payload,G=K._init;try{return D(G(X))}catch{return null}}}return null}var L=Object.assign,B=0,z,Y,T,R,Q,me,Z;function q(){}q.__reactDisabledLog=!0;function et(){{if(B===0){z=console.log,Y=console.info,T=console.warn,R=console.error,Q=console.group,me=console.groupCollapsed,Z=console.groupEnd;var g={configurable:!0,enumerable:!0,value:q,writable:!0};Object.defineProperties(console,{info:g,log:g,warn:g,error:g,group:g,groupCollapsed:g,groupEnd:g})}B++}}function ke(){{if(B--,B===0){var g={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:L({},g,{value:z}),info:L({},g,{value:Y}),warn:L({},g,{value:T}),error:L({},g,{value:R}),group:L({},g,{value:Q}),groupCollapsed:L({},g,{value:me}),groupEnd:L({},g,{value:Z})})}B<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var tt=E.ReactCurrentDispatcher,k;function ee(g,$,P){{if(k===void 0)try{throw Error()}catch(K){var I=K.stack.trim().match(/\n( *(at )?)/);k=I&&I[1]||""}return`
18
+ `+k+g}}var ce=!1,ze;{var rf=typeof WeakMap=="function"?WeakMap:Map;ze=new rf}function Di(g,$){if(!g||ce)return"";{var P=ze.get(g);if(P!==void 0)return P}var I;ce=!0;var K=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var X;X=tt.current,tt.current=null,et();try{if($){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(he){I=he}Reflect.construct(g,[],G)}else{try{G.call()}catch(he){I=he}g.call(G.prototype)}}else{try{throw Error()}catch(he){I=he}g()}}catch(he){if(he&&I&&typeof he.stack=="string"){for(var V=he.stack.split(`
19
+ `),fe=I.stack.split(`
20
+ `),oe=V.length-1,ie=fe.length-1;oe>=1&&ie>=0&&V[oe]!==fe[ie];)ie--;for(;oe>=1&&ie>=0;oe--,ie--)if(V[oe]!==fe[ie]){if(oe!==1||ie!==1)do if(oe--,ie--,ie<0||V[oe]!==fe[ie]){var Ce=`
21
+ `+V[oe].replace(" at new "," at ");return g.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",g.displayName)),typeof g=="function"&&ze.set(g,Ce),Ce}while(oe>=1&&ie>=0);break}}}finally{ce=!1,tt.current=X,ke(),Error.prepareStackTrace=K}var pt=g?g.displayName||g.name:"",nt=pt?ee(pt):"";return typeof g=="function"&&ze.set(g,nt),nt}function of(g,$,P){return Di(g,!1)}function sf(g){var $=g.prototype;return!!($&&$.isReactComponent)}function nn(g,$,P){if(g==null)return"";if(typeof g=="function")return Di(g,sf(g));if(typeof g=="string")return ee(g);switch(g){case l:return ee("Suspense");case a:return ee("SuspenseList")}if(typeof g=="object")switch(g.$$typeof){case i:return of(g.render);case p:return nn(g.type,$,P);case m:{var I=g,K=I._payload,X=I._init;try{return nn(X(K),$,P)}catch{}}}return""}var Pt=Object.prototype.hasOwnProperty,Ii={},ji=E.ReactDebugCurrentFrame;function rn(g){if(g){var $=g._owner,P=nn(g.type,g._source,$?$.type:null);ji.setExtraStackFrame(P)}else ji.setExtraStackFrame(null)}function lf(g,$,P,I,K){{var X=Function.call.bind(Pt);for(var G in g)if(X(g,G)){var V=void 0;try{if(typeof g[G]!="function"){var fe=Error((I||"React class")+": "+P+" type `"+G+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof g[G]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw fe.name="Invariant Violation",fe}V=g[G]($,G,I,P,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(oe){V=oe}V&&!(V instanceof Error)&&(rn(K),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",I||"React class",P,G,typeof V),rn(null)),V instanceof Error&&!(V.message in Ii)&&(Ii[V.message]=!0,rn(K),w("Failed %s type: %s",P,V.message),rn(null))}}}var af=Array.isArray;function tr(g){return af(g)}function uf(g){{var $=typeof Symbol=="function"&&Symbol.toStringTag,P=$&&g[Symbol.toStringTag]||g.constructor.name||"Object";return P}}function cf(g){try{return ki(g),!1}catch{return!0}}function ki(g){return""+g}function _i(g){if(cf(g))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",uf(g)),ki(g)}var Ri=E.ReactCurrentOwner,ff={key:!0,ref:!0,__self:!0,__source:!0},Bi,Hi;function df(g){if(Pt.call(g,"ref")){var $=Object.getOwnPropertyDescriptor(g,"ref").get;if($&&$.isReactWarning)return!1}return g.ref!==void 0}function pf(g){if(Pt.call(g,"key")){var $=Object.getOwnPropertyDescriptor(g,"key").get;if($&&$.isReactWarning)return!1}return g.key!==void 0}function mf(g,$){typeof g.ref=="string"&&Ri.current}function hf(g,$){{var P=function(){Bi||(Bi=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",$))};P.isReactWarning=!0,Object.defineProperty(g,"key",{get:P,configurable:!0})}}function gf(g,$){{var P=function(){Hi||(Hi=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",$))};P.isReactWarning=!0,Object.defineProperty(g,"ref",{get:P,configurable:!0})}}var vf=function(g,$,P,I,K,X,G){var V={$$typeof:t,type:g,key:$,ref:P,props:G,_owner:X};return V._store={},Object.defineProperty(V._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(V,"_self",{configurable:!1,enumerable:!1,writable:!1,value:I}),Object.defineProperty(V,"_source",{configurable:!1,enumerable:!1,writable:!1,value:K}),Object.freeze&&(Object.freeze(V.props),Object.freeze(V)),V};function bf(g,$,P,I,K){{var X,G={},V=null,fe=null;P!==void 0&&(_i(P),V=""+P),pf($)&&(_i($.key),V=""+$.key),df($)&&(fe=$.ref,mf($,K));for(X in $)Pt.call($,X)&&!ff.hasOwnProperty(X)&&(G[X]=$[X]);if(g&&g.defaultProps){var oe=g.defaultProps;for(X in oe)G[X]===void 0&&(G[X]=oe[X])}if(V||fe){var ie=typeof g=="function"?g.displayName||g.name||"Unknown":g;V&&hf(G,ie),fe&&gf(G,ie)}return vf(g,V,fe,K,I,Ri.current,G)}}var nr=E.ReactCurrentOwner,Wi=E.ReactDebugCurrentFrame;function dt(g){if(g){var $=g._owner,P=nn(g.type,g._source,$?$.type:null);Wi.setExtraStackFrame(P)}else Wi.setExtraStackFrame(null)}var rr;rr=!1;function or(g){return typeof g=="object"&&g!==null&&g.$$typeof===t}function Vi(){{if(nr.current){var g=D(nr.current.type);if(g)return`
22
22
 
23
- Check the render method of \``+g+"`."}return""}}function zf(g){return""}var fs={};function Yf(g){{var T=cs();if(!T){var _=typeof g=="string"?g:g.displayName||g.name;_&&(T=`
23
+ Check the render method of \``+g+"`."}return""}}function yf(g){return""}var Ui={};function xf(g){{var $=Vi();if(!$){var P=typeof g=="string"?g:g.displayName||g.name;P&&($=`
24
24
 
25
- Check the top-level render call using <`+_+">.")}return T}}function ds(g,T){{if(!g._store||g._store.validated||g.key!=null)return;g._store.validated=!0;var _=Yf(T);if(fs[_])return;fs[_]=!0;var z="";g&&g._owner&&g._owner!==gr.current&&(z=" It was passed a child from "+H(g._owner.type)+"."),bt(g),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',_,z),bt(null)}}function ps(g,T){{if(typeof g!="object")return;if(mr(g))for(var _=0;_<g.length;_++){var z=g[_];br(z)&&ds(z,T)}else if(br(g))g._store&&(g._store.validated=!0);else if(g){var le=b(g);if(typeof le=="function"&&le!==g.entries)for(var ae=le.call(g),re;!(re=ae.next()).done;)br(re.value)&&ds(re.value,T)}}}function Gf(g){{var T=g.type;if(T==null||typeof T=="string")return;var _;if(typeof T=="function")_=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===s||T.$$typeof===d))_=T.propTypes;else return;if(_){var z=H(T);Lf(_,g.props,"prop",z,g)}else if(T.PropTypes!==void 0&&!vr){vr=!0;var le=H(T);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",le||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function qf(g){{for(var T=Object.keys(g.props),_=0;_<T.length;_++){var z=T[_];if(z!=="children"&&z!=="key"){bt(g),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",z),bt(null);break}}g.ref!==null&&(bt(g),w("Invalid attribute `ref` supplied to `React.Fragment`."),bt(null))}}var hs={};function ms(g,T,_,z,le,ae){{var re=D(g);if(!re){var te="";(g===void 0||typeof g=="object"&&g!==null&&Object.keys(g).length===0)&&(te+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Ee=zf();Ee?te+=Ee:te+=cs();var pe;g===null?pe="null":mr(g)?pe="array":g!==void 0&&g.$$typeof===t?(pe="<"+(H(g.type)||"Unknown")+" />",te=" Did you accidentally export a JSX literal instead of a component?"):pe=typeof g,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",pe,te)}var he=Vf(g,T,_,le,ae);if(he==null)return he;if(re){var De=T.children;if(De!==void 0)if(z)if(mr(De)){for(var yt=0;yt<De.length;yt++)ps(De[yt],g);Object.freeze&&Object.freeze(De)}else w("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 ps(De,g)}if(Ft.call(T,"key")){var lt=H(g),Ce=Object.keys(T).filter(function(ed){return ed!=="key"}),yr=Ce.length>0?"{key: someKey, "+Ce.join(": ..., ")+": ...}":"{key: someKey}";if(!hs[lt+yr]){var Zf=Ce.length>0?"{"+Ce.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+P+">.")}return $}}function zi(g,$){{if(!g._store||g._store.validated||g.key!=null)return;g._store.validated=!0;var P=xf($);if(Ui[P])return;Ui[P]=!0;var I="";g&&g._owner&&g._owner!==nr.current&&(I=" It was passed a child from "+D(g._owner.type)+"."),dt(g),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',P,I),dt(null)}}function Gi(g,$){{if(typeof g!="object")return;if(tr(g))for(var P=0;P<g.length;P++){var I=g[P];or(I)&&zi(I,$)}else if(or(g))g._store&&(g._store.validated=!0);else if(g){var K=b(g);if(typeof K=="function"&&K!==g.entries)for(var X=K.call(g),G;!(G=X.next()).done;)or(G.value)&&zi(G.value,$)}}}function wf(g){{var $=g.type;if($==null||typeof $=="string")return;var P;if(typeof $=="function")P=$.propTypes;else if(typeof $=="object"&&($.$$typeof===i||$.$$typeof===p))P=$.propTypes;else return;if(P){var I=D($);lf(P,g.props,"prop",I,g)}else if($.PropTypes!==void 0&&!rr){rr=!0;var K=D($);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",K||"Unknown")}typeof $.getDefaultProps=="function"&&!$.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ef(g){{for(var $=Object.keys(g.props),P=0;P<$.length;P++){var I=$[P];if(I!=="children"&&I!=="key"){dt(g),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",I),dt(null);break}}g.ref!==null&&(dt(g),w("Invalid attribute `ref` supplied to `React.Fragment`."),dt(null))}}var Yi={};function Ki(g,$,P,I,K,X){{var G=M(g);if(!G){var V="";(g===void 0||typeof g=="object"&&g!==null&&Object.keys(g).length===0)&&(V+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var fe=yf();fe?V+=fe:V+=Vi();var oe;g===null?oe="null":tr(g)?oe="array":g!==void 0&&g.$$typeof===t?(oe="<"+(D(g.type)||"Unknown")+" />",V=" Did you accidentally export a JSX literal instead of a component?"):oe=typeof g,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",oe,V)}var ie=bf(g,$,P,K,X);if(ie==null)return ie;if(G){var Ce=$.children;if(Ce!==void 0)if(I)if(tr(Ce)){for(var pt=0;pt<Ce.length;pt++)Gi(Ce[pt],g);Object.freeze&&Object.freeze(Ce)}else w("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 Gi(Ce,g)}if(Pt.call($,"key")){var nt=D(g),he=Object.keys($).filter(function(Pf){return Pf!=="key"}),ir=he.length>0?"{key: someKey, "+he.join(": ..., ")+": ...}":"{key: someKey}";if(!Yi[nt+ir]){var Tf=he.length>0?"{"+he.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,yr,lt,Zf,lt),hs[lt+yr]=!0}}return g===r?qf(he):Gf(he),he}}function Kf(g,T,_){return ms(g,T,_,!0)}function Qf(g,T,_){return ms(g,T,_,!1)}var Xf=Qf,Jf=Kf;wt.Fragment=r,wt.jsx=Xf,wt.jsxs=Jf}()),wt}process.env.NODE_ENV==="production"?fn.exports=bs():fn.exports=ys();var O=fn.exports;const Es=h.createContext(null),ws=({config:e,children:t})=>O.jsx(Es.Provider,{value:e,children:t}),Cr={emit:(e,t)=>{console.log("Event emitted:",e,t)}},xs=()=>({openDeposit:h.useCallback(t=>{Cr.emit("deposit:open",t)},[])}),Cs=()=>({openWithdraw:h.useCallback(t=>{Cr.emit("withdraw:open",t)},[])});/**
30
+ <%s key={someKey} {...props} />`,ir,nt,Tf,nt),Yi[nt+ir]=!0}}return g===r?Ef(ie):wf(ie),ie}}function Cf(g,$,P){return Ki(g,$,P,!0)}function Sf(g,$,P){return Ki(g,$,P,!1)}var $f=Sf,Of=Cf;ht.Fragment=r,ht.jsx=$f,ht.jsxs=Of}()),ht}process.env.NODE_ENV==="production"?on.exports=Xi():on.exports=qi();var x=on.exports;const Ji=d.createContext(null),Zi=({config:e,children:t})=>x.jsx(Ji.Provider,{value:e,children:t}),ur={emit:(e,t)=>{console.log("Event emitted:",e,t)}},es=()=>({openDeposit:d.useCallback(t=>{ur.emit("deposit:open",t)},[])}),ts=()=>({openWithdraw:d.useCallback(t=>{ur.emit("withdraw:open",t)},[])});/**
31
31
  * @license lucide-react v0.540.0 - ISC
32
32
  *
33
33
  * This source code is licensed under the ISC license.
34
34
  * See the LICENSE file in the root directory of this source tree.
35
- */const Ss=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Os=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),Sr=e=>{const t=Os(e);return t.charAt(0).toUpperCase()+t.slice(1)},Or=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Ts=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
35
+ */const ns=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),rs=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),cr=e=>{const t=rs(e);return t.charAt(0).toUpperCase()+t.slice(1)},fr=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),os=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
36
36
  * @license lucide-react v0.540.0 - ISC
37
37
  *
38
38
  * This source code is licensed under the ISC license.
39
39
  * See the LICENSE file in the root directory of this source tree.
40
- */var $s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
40
+ */var is={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
41
41
  * @license lucide-react v0.540.0 - ISC
42
42
  *
43
43
  * This source code is licensed under the ISC license.
44
44
  * See the LICENSE file in the root directory of this source tree.
45
- */const Ps=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:u,...c},s)=>h.createElement("svg",{ref:s,...$s,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Or("lucide",o),...!i&&!Ts(c)&&{"aria-hidden":"true"},...c},[...u.map(([l,a])=>h.createElement(l,a)),...Array.isArray(i)?i:[i]]));/**
45
+ */const ss=d.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:s,iconNode:c,...u},i)=>d.createElement("svg",{ref:i,...is,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:fr("lucide",o),...!s&&!os(u)&&{"aria-hidden":"true"},...u},[...c.map(([l,a])=>d.createElement(l,a)),...Array.isArray(s)?s:[s]]));/**
46
46
  * @license lucide-react v0.540.0 - ISC
47
47
  *
48
48
  * This source code is licensed under the ISC license.
49
49
  * See the LICENSE file in the root directory of this source tree.
50
- */const As=(e,t)=>{const n=h.forwardRef(({className:r,...o},i)=>h.createElement(Ps,{ref:i,iconNode:t,className:Or(`lucide-${Ss(Sr(e))}`,`lucide-${e}`,r),...o}));return n.displayName=Sr(e),n};/**
50
+ */const ls=(e,t)=>{const n=d.forwardRef(({className:r,...o},s)=>d.createElement(ss,{ref:s,iconNode:t,className:fr(`lucide-${ns(cr(e))}`,`lucide-${e}`,r),...o}));return n.displayName=cr(e),n};/**
51
51
  * @license lucide-react v0.540.0 - ISC
52
52
  *
53
53
  * This source code is licensed under the ISC license.
54
54
  * See the LICENSE file in the root directory of this source tree.
55
- */const Ms=As("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class Tr{constructor(){Ye(this,"state");this.state={isLoading:!1,isApproving:!1,isDepositing:!1,error:null,txHash:null}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t}}}class _s extends Tr{constructor(n,r){super();Ye(this,"smartWallet");Ye(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}isApprovalRequired(){return!1}getApprovalStatus(){return!0}async connect(){this.setState({isLoading:!0,error:null});try{console.log("Connecting MPC wallet..."),this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){console.log("Disconnecting MPC wallet...")}async switchChain(n){console.log(`MPC wallet switching to chain ${n}`)}async getBalance(n){return console.log(`Getting MPC wallet balance for token ${n}`),"0"}async approve(n,r){return console.log(`MPC wallet approve not needed for ${n}`),""}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{console.log(`MPC deposit ${n} of ${r} to ${this.getDisplayAddress()}`);const o=`mpc_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return console.log(`MPC signing message: ${n}`),`mpc_signature_${Date.now()}`}getAAWalletAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}}class Ds extends Tr{constructor(n,r,o,i="0",u="0"){super();Ye(this,"currentActiveAccount");Ye(this,"approved");Ye(this,"chainId");Ye(this,"balance");Ye(this,"allowance");this.currentActiveAccount=n,this.approved=r,this.chainId=o,this.balance=i,this.allowance=u}getWalletType(){return"evm"}getDisplayAddress(){var n;return((n=this.currentActiveAccount)==null?void 0:n.ethAddress)||""}isApprovalRequired(){return!0}getApprovalStatus(){return this.approved}async connect(){this.setState({isLoading:!0,error:null});try{console.log("Connecting EVM wallet..."),this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){console.log("Disconnecting EVM wallet...")}async switchChain(n){this.setState({isLoading:!0,error:null});try{console.log(`Switching EVM wallet to chain ${n}`),this.chainId=n,this.setState({isLoading:!1})}catch(r){throw this.setState({isLoading:!1,error:r instanceof Error?r.message:"Chain switch failed"}),r}}async getBalance(n){return console.log(`Getting EVM wallet balance for token ${n}`),this.balance}async approve(n,r){this.setState({isApproving:!0,error:null});try{console.log(`Approving ${r} of ${n}`);const o=`evm_approve_${Date.now()}`;return this.approved=!0,this.setState({isApproving:!1,txHash:o}),o}catch(o){throw this.setState({isApproving:!1,error:o instanceof Error?o.message:"Approval failed"}),o}}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{if(!this.approved)throw new Error("Token approval required");console.log(`EVM deposit ${n} of ${r}`);const o=`evm_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return console.log(`EVM signing message: ${n}`),`evm_signature_${Date.now()}`}updateApprovalStatus(n){this.approved=n}updateBalance(n){this.balance=n}updateAllowance(n){this.allowance=n}}function Ls(e,t,n,r,o,i){switch(e==null?void 0:e.wallet){case"mpc":return new _s(t,e);default:return new Ds(e,!1,r||1,o,i)}}const $r=typeof document<"u"?h.useLayoutEffect:()=>{};var dn;const Fs=(dn=h.useInsertionEffect)!==null&&dn!==void 0?dn:$r;function Is(e){const t=h.useRef(null);return Fs(()=>{t.current=e},[e]),h.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Ge=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:Ge(e).defaultView||window;function ks(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function Ns(e){return ks(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let js=!1;function pn(){return js}function Pr(e,t){if(!pn())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:Ns(n)?n=n.host:n=n.parentNode}return!1}const hn=(e=document)=>{var t;if(!pn())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 Ar(e){return pn()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function kt(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function mn(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 Ue(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const gn=Ue(function(){return mn(/^Mac/i)}),Rs=Ue(function(){return mn(/^iPhone/i)}),Ws=Ue(function(){return mn(/^iPad/i)||gn()&&navigator.maxTouchPoints>1}),Bs=Ue(function(){return Rs()||Ws()});Ue(function(){return gn()||Bs()}),Ue(function(){return kt(/AppleWebKit/i)&&!Hs()});const Hs=Ue(function(){return kt(/Chrome/i)}),Us=Ue(function(){return kt(/Android/i)});Ue(function(){return kt(/Firefox/i)});function Mr(){let e=h.useRef(new Map),t=h.useCallback((o,i,u,c)=>{let s=c!=null&&c.once?(...l)=>{e.current.delete(u),u(...l)}:u;e.current.set(u,{type:i,eventTarget:o,fn:s,options:c}),o.addEventListener(i,s,c)},[]),n=h.useCallback((o,i,u,c)=>{var s;let l=((s=e.current.get(u))===null||s===void 0?void 0:s.fn)||u;o.removeEventListener(i,l,c),e.current.delete(u)},[]),r=h.useCallback(()=>{e.current.forEach((o,i)=>{n(o.eventTarget,o.type,i,o.options)})},[n]);return h.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Vs(e){return e.mozInputSource===0&&e.isTrusted?!0:Us()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function _r(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function zs(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function Dr(e){let t=h.useRef({isFocused:!1,observer:null});$r(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=Is(r=>{e==null||e(r)});return h.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=u=>{if(t.current.isFocused=!1,o.disabled){let c=_r(u);n(c)}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 u;(u=t.current.observer)===null||u===void 0||u.disconnect();let c=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:c})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:c}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Ys=!1,xt=null,vn=new Set,Ct=new Map,et=!1,bn=!1;const Gs={Tab:!0,Escape:!0};function yn(e,t){for(let n of vn)n(e,t)}function qs(e){return!(e.metaKey||!gn()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Nt(e){et=!0,qs(e)&&(xt="keyboard",yn("keyboard",e))}function Te(e){xt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(et=!0,yn("pointer",e))}function Lr(e){Vs(e)&&(et=!0,xt="virtual")}function Fr(e){e.target===window||e.target===document||Ys||!e.isTrusted||(!et&&!bn&&(xt="virtual",yn("virtual",e)),et=!1,bn=!1)}function Ir(){et=!1,bn=!0}function En(e){if(typeof window>"u"||typeof document>"u"||Ct.get(Ze(e)))return;const t=Ze(e),n=Ge(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){et=!0,r.apply(this,arguments)},n.addEventListener("keydown",Nt,!0),n.addEventListener("keyup",Nt,!0),n.addEventListener("click",Lr,!0),t.addEventListener("focus",Fr,!0),t.addEventListener("blur",Ir,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Te,!0),n.addEventListener("pointermove",Te,!0),n.addEventListener("pointerup",Te,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",Te,!0),n.addEventListener("mousemove",Te,!0),n.addEventListener("mouseup",Te,!0)),t.addEventListener("beforeunload",()=>{kr(e)},{once:!0}),Ct.set(t,{focus:r})}const kr=(e,t)=>{const n=Ze(e),r=Ge(e);t&&r.removeEventListener("DOMContentLoaded",t),Ct.has(n)&&(n.HTMLElement.prototype.focus=Ct.get(n).focus,r.removeEventListener("keydown",Nt,!0),r.removeEventListener("keyup",Nt,!0),r.removeEventListener("click",Lr,!0),n.removeEventListener("focus",Fr,!0),n.removeEventListener("blur",Ir,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Te,!0),r.removeEventListener("pointermove",Te,!0),r.removeEventListener("pointerup",Te,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",Te,!0),r.removeEventListener("mousemove",Te,!0),r.removeEventListener("mouseup",Te,!0)),Ct.delete(n))};function Ks(e){const t=Ge(e);let n;return t.readyState!=="loading"?En(e):(n=()=>{En(e)},t.addEventListener("DOMContentLoaded",n)),()=>kr(e,n)}typeof document<"u"&&Ks();function Nr(){return xt!=="pointer"}const Qs=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Xs(e,t,n){let r=Ge(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,u=typeof window<"u"?Ze(n==null?void 0:n.target).HTMLElement:HTMLElement,c=typeof window<"u"?Ze(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Qs.has(r.activeElement.type)||r.activeElement instanceof i||r.activeElement instanceof u&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof c&&!Gs[n.key])}function Js(e,t,n){En(),h.useEffect(()=>{let r=(o,i)=>{Xs(!!(n!=null&&n.isTextInput),o,i)&&e(Nr())};return vn.add(r),()=>{vn.delete(r)}},t)}function Zs(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const i=h.useCallback(s=>{if(s.target===s.currentTarget)return r&&r(s),o&&o(!1),!0},[r,o]),u=Dr(i),c=h.useCallback(s=>{const l=Ge(s.target),a=l?hn(l):hn();s.target===s.currentTarget&&a===Ar(s.nativeEvent)&&(n&&n(s),o&&o(!0),u(s))},[o,n,u]);return{focusProps:{onFocus:!t&&(n||o||r)?c:void 0,onBlur:!t&&(r||o)?i:void 0}}}function el(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,i=h.useRef({isFocusWithin:!1}),{addGlobalListener:u,removeAllGlobalListeners:c}=Mr(),s=h.useCallback(d=>{d.currentTarget.contains(d.target)&&i.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(i.current.isFocusWithin=!1,c(),n&&n(d),o&&o(!1))},[n,o,i,c]),l=Dr(s),a=h.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const f=Ge(d.target),p=hn(f);if(!i.current.isFocusWithin&&p===Ar(d.nativeEvent)){r&&r(d),o&&o(!0),i.current.isFocusWithin=!0,l(d);let m=d.currentTarget;u(f,"focus",v=>{if(i.current.isFocusWithin&&!Pr(m,v.target)){let b=new f.defaultView.FocusEvent("blur",{relatedTarget:v.target});zs(b,m);let x=_r(b);s(x)}},{capture:!0})}},[r,o,l,u,s]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:a,onBlur:s}}}let jt=!1,Rt=0;function wn(){jt=!0,setTimeout(()=>{jt=!1},50)}function jr(e){e.pointerType==="touch"&&wn()}function tl(){if(!(typeof document>"u"))return Rt===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",jr):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",wn)),Rt++,()=>{Rt--,!(Rt>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",jr):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",wn))}}function nl(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[i,u]=h.useState(!1),c=h.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;h.useEffect(tl,[]);let{addGlobalListener:s,removeAllGlobalListeners:l}=Mr(),{hoverProps:a,triggerHoverEnd:d}=h.useMemo(()=>{let f=(v,b)=>{if(c.pointerType=b,o||b==="touch"||c.isHovered||!v.currentTarget.contains(v.target))return;c.isHovered=!0;let x=v.currentTarget;c.target=x,s(Ge(v.target),"pointerover",w=>{c.isHovered&&c.target&&!Pr(c.target,w.target)&&p(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:x,pointerType:b}),n&&n(!0),u(!0)},p=(v,b)=>{let x=c.target;c.pointerType="",c.target=null,!(b==="touch"||!c.isHovered||!x)&&(c.isHovered=!1,l(),r&&r({type:"hoverend",target:x,pointerType:b}),n&&n(!1),u(!1))},m={};return typeof PointerEvent<"u"?(m.onPointerEnter=v=>{jt&&v.pointerType==="mouse"||f(v,v.pointerType)},m.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(m.onTouchStart=()=>{c.ignoreEmulatedMouseEvents=!0},m.onMouseEnter=v=>{!c.ignoreEmulatedMouseEvents&&!jt&&f(v,"mouse"),c.ignoreEmulatedMouseEvents=!1},m.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&p(v,"mouse")}),{hoverProps:m,triggerHoverEnd:p}},[t,n,r,o,c,s,l]);return h.useEffect(()=>{o&&d({currentTarget:c.target},c.pointerType)},[o]),{hoverProps:a,isHovered:i}}function rl(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=h.useRef({isFocused:!1,isFocusVisible:t||Nr()}),[i,u]=h.useState(!1),[c,s]=h.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=h.useCallback(()=>s(o.current.isFocused&&o.current.isFocusVisible),[]),a=h.useCallback(p=>{o.current.isFocused=p,u(p),l()},[l]);Js(p=>{o.current.isFocusVisible=p,l()},[],{isTextInput:n});let{focusProps:d}=Zs({isDisabled:r,onFocusChange:a}),{focusWithinProps:f}=el({isDisabled:!r,onFocusWithinChange:a});return{isFocused:i,isFocusVisible:c,focusProps:r?f:d}}var ol=Object.defineProperty,il=(e,t,n)=>t in e?ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,xn=(e,t,n)=>(il(e,typeof t!="symbol"?t+"":t,n),n);let sl=class{constructor(){xn(this,"current",this.detect()),xn(this,"handoffState","pending"),xn(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 sl;function St(e){var t,n;return ke.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function Rr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Le(){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 Rr(()=>{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=Le();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 at(){let[e]=h.useState(Le);return h.useEffect(()=>()=>e.dispose(),[e]),e}let ue=(e,t)=>{ke.isServer?h.useEffect(e,t):h.useLayoutEffect(e,t)};function tt(e){let t=h.useRef(e);return ue(()=>{t.current=e},[e]),t}let ne=function(e){let t=tt(e);return h.useCallback((...n)=>t.current(...n),[t])};function ll(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 al(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function ul({disabled:e=!1}={}){let t=h.useRef(null),[n,r]=h.useState(!1),o=at(),i=ne(()=>{t.current=null,r(!1),o.dispose()}),u=ne(c=>{if(o.dispose(),t.current===null){t.current=c.currentTarget,r(!0);{let s=St(c.currentTarget);o.addEventListener(s,"pointerup",i,!1),o.addEventListener(s,"pointermove",l=>{if(t.current){let a=ll(l);r(al(a,t.current.getBoundingClientRect()))}},!1),o.addEventListener(s,"pointercancel",i,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:u,onPointerUp:i,onClick:i}}}let cl=h.createContext(void 0);function Cn(){return h.useContext(cl)}function Sn(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function $e(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,$e),r}var Wt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Wt||{}),qe=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(qe||{});function Se(){let e=dl();return h.useCallback(t=>fl({mergeRefs:e,...t}),[e])}function fl({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:i=!0,name:u,mergeRefs:c}){c=c??pl;let s=Wr(t,e);if(i)return Bt(s,n,r,u,c);let l=o??0;if(l&2){let{static:a=!1,...d}=s;if(a)return Bt(d,n,r,u,c)}if(l&1){let{unmount:a=!0,...d}=s;return $e(a?0:1,{0(){return null},1(){return Bt({...d,hidden:!0,style:{display:"none"}},n,r,u,c)}})}return Bt(s,n,r,u,c)}function Bt(e,t={},n,r,o){let{as:i=n,children:u,refName:c="ref",...s}=On(e,["unmount","static"]),l=e.ref!==void 0?{[c]:e.ref}:{},a=typeof u=="function"?u(t):u;"className"in s&&s.className&&typeof s.className=="function"&&(s.className=s.className(t)),s["aria-labelledby"]&&s["aria-labelledby"]===s.id&&(s["aria-labelledby"]=void 0);let d={};if(t){let f=!1,p=[];for(let[m,v]of Object.entries(t))typeof v=="boolean"&&(f=!0),v===!0&&p.push(m.replace(/([A-Z])/g,b=>`-${b.toLowerCase()}`));if(f){d["data-headlessui-state"]=p.join(" ");for(let m of p)d[`data-${m}`]=""}}if(i===h.Fragment&&(Object.keys(Ke(s)).length>0||Object.keys(Ke(d)).length>0))if(!h.isValidElement(a)||Array.isArray(a)&&a.length>1){if(Object.keys(Ke(s)).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(Ke(s)).concat(Object.keys(Ke(d))).map(f=>` - ${f}`).join(`
56
- `),"","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(f=>` - ${f}`).join(`
55
+ */const as=ls("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);class dr{constructor(){_e(this,"state");this.state={isLoading:!1,isApproving:!1,isDepositing:!1,error:null,txHash:null}}getState(){return{...this.state}}setState(t){this.state={...this.state,...t}}}class us extends dr{constructor(n,r){super();_e(this,"smartWallet");_e(this,"currentActiveAccount");this.smartWallet=n,this.currentActiveAccount=r}getWalletType(){return"mpc"}getDisplayAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}isApprovalRequired(){return!1}getApprovalStatus(){return!0}async connect(){this.setState({isLoading:!0,error:null});try{console.log("Connecting MPC wallet..."),this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){console.log("Disconnecting MPC wallet...")}async switchChain(n){console.log(`MPC wallet switching to chain ${n}`)}async getBalance(n){return console.log(`Getting MPC wallet balance for token ${n}`),"0"}async approve(n,r){return console.log(`MPC wallet approve not needed for ${n}`),""}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{console.log(`MPC deposit ${n} of ${r} to ${this.getDisplayAddress()}`);const o=`mpc_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return console.log(`MPC signing message: ${n}`),`mpc_signature_${Date.now()}`}getAAWalletAddress(){var n,r;return((n=this.smartWallet)==null?void 0:n.address)||((r=this.currentActiveAccount)==null?void 0:r.ethAddress)||""}}class cs extends dr{constructor(n,r,o,s="0",c="0"){super();_e(this,"currentActiveAccount");_e(this,"approved");_e(this,"chainId");_e(this,"balance");_e(this,"allowance");this.currentActiveAccount=n,this.approved=r,this.chainId=o,this.balance=s,this.allowance=c}getWalletType(){return"evm"}getDisplayAddress(){var n;return((n=this.currentActiveAccount)==null?void 0:n.ethAddress)||""}isApprovalRequired(){return!0}getApprovalStatus(){return this.approved}async connect(){this.setState({isLoading:!0,error:null});try{console.log("Connecting EVM wallet..."),this.setState({isLoading:!1})}catch(n){throw this.setState({isLoading:!1,error:n instanceof Error?n.message:"Connection failed"}),n}}async disconnect(){console.log("Disconnecting EVM wallet...")}async switchChain(n){this.setState({isLoading:!0,error:null});try{console.log(`Switching EVM wallet to chain ${n}`),this.chainId=n,this.setState({isLoading:!1})}catch(r){throw this.setState({isLoading:!1,error:r instanceof Error?r.message:"Chain switch failed"}),r}}async getBalance(n){return console.log(`Getting EVM wallet balance for token ${n}`),this.balance}async approve(n,r){this.setState({isApproving:!0,error:null});try{console.log(`Approving ${r} of ${n}`);const o=`evm_approve_${Date.now()}`;return this.approved=!0,this.setState({isApproving:!1,txHash:o}),o}catch(o){throw this.setState({isApproving:!1,error:o instanceof Error?o.message:"Approval failed"}),o}}async deposit(n,r){this.setState({isDepositing:!0,error:null});try{if(!this.approved)throw new Error("Token approval required");console.log(`EVM deposit ${n} of ${r}`);const o=`evm_deposit_${Date.now()}`;return this.setState({isDepositing:!1,txHash:o}),o}catch(o){throw this.setState({isDepositing:!1,error:o instanceof Error?o.message:"Deposit failed"}),o}}async signMessage(n){return console.log(`EVM signing message: ${n}`),`evm_signature_${Date.now()}`}updateApprovalStatus(n){this.approved=n}updateBalance(n){this.balance=n}updateAllowance(n){this.allowance=n}}function fs(e,t,n,r,o,s){switch(e==null?void 0:e.wallet){case"mpc":return new us(t,e);default:return new cs(e,!1,r||1,o,s)}}const pr=typeof document<"u"?d.useLayoutEffect:()=>{};var sn;const ds=(sn=d.useInsertionEffect)!==null&&sn!==void 0?sn:pr;function ps(e){const t=d.useRef(null);return ds(()=>{t.current=e},[e]),d.useCallback((...n)=>{const r=t.current;return r==null?void 0:r(...n)},[])}const Re=e=>{var t;return(t=e==null?void 0:e.ownerDocument)!==null&&t!==void 0?t:document},Ge=e=>e&&"window"in e&&e.window===e?e:Re(e).defaultView||window;function ms(e){return e!==null&&typeof e=="object"&&"nodeType"in e&&typeof e.nodeType=="number"}function hs(e){return ms(e)&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in e}let gs=!1;function ln(){return gs}function mr(e,t){if(!ln())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:hs(n)?n=n.host:n=n.parentNode}return!1}const an=(e=document)=>{var t;if(!ln())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 hr(e){return ln()&&e.target.shadowRoot&&e.composedPath?e.composedPath()[0]:e.target}function Mt(e){var t;if(typeof window>"u"||window.navigator==null)return!1;let n=(t=window.navigator.userAgentData)===null||t===void 0?void 0:t.brands;return Array.isArray(n)&&n.some(r=>e.test(r.brand))||e.test(window.navigator.userAgent)}function un(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 De(e){if(process.env.NODE_ENV==="test")return e;let t=null;return()=>(t==null&&(t=e()),t)}const cn=De(function(){return un(/^Mac/i)}),vs=De(function(){return un(/^iPhone/i)}),bs=De(function(){return un(/^iPad/i)||cn()&&navigator.maxTouchPoints>1}),ys=De(function(){return vs()||bs()});De(function(){return cn()||ys()}),De(function(){return Mt(/AppleWebKit/i)&&!xs()});const xs=De(function(){return Mt(/Chrome/i)}),ws=De(function(){return Mt(/Android/i)});De(function(){return Mt(/Firefox/i)});function gr(){let e=d.useRef(new Map),t=d.useCallback((o,s,c,u)=>{let i=u!=null&&u.once?(...l)=>{e.current.delete(c),c(...l)}:c;e.current.set(c,{type:s,eventTarget:o,fn:i,options:u}),o.addEventListener(s,i,u)},[]),n=d.useCallback((o,s,c,u)=>{var i;let l=((i=e.current.get(c))===null||i===void 0?void 0:i.fn)||c;o.removeEventListener(s,l,u),e.current.delete(c)},[]),r=d.useCallback(()=>{e.current.forEach((o,s)=>{n(o.eventTarget,o.type,s,o.options)})},[n]);return d.useEffect(()=>r,[r]),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Es(e){return e.mozInputSource===0&&e.isTrusted?!0:ws()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function vr(e){let t=e;return t.nativeEvent=e,t.isDefaultPrevented=()=>t.defaultPrevented,t.isPropagationStopped=()=>t.cancelBubble,t.persist=()=>{},t}function Cs(e,t){Object.defineProperty(e,"target",{value:t}),Object.defineProperty(e,"currentTarget",{value:t})}function br(e){let t=d.useRef({isFocused:!1,observer:null});pr(()=>{const r=t.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=ps(r=>{e==null||e(r)});return d.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,s=c=>{if(t.current.isFocused=!1,o.disabled){let u=vr(c);n(u)}t.current.observer&&(t.current.observer.disconnect(),t.current.observer=null)};o.addEventListener("focusout",s,{once:!0}),t.current.observer=new MutationObserver(()=>{if(t.current.isFocused&&o.disabled){var c;(c=t.current.observer)===null||c===void 0||c.disconnect();let u=o===document.activeElement?null:document.activeElement;o.dispatchEvent(new FocusEvent("blur",{relatedTarget:u})),o.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:u}))}}),t.current.observer.observe(o,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let Ss=!1,gt=null,fn=new Set,vt=new Map,Ye=!1,dn=!1;const $s={Tab:!0,Escape:!0};function pn(e,t){for(let n of fn)n(e,t)}function Os(e){return!(e.metaKey||!cn()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}function Nt(e){Ye=!0,Os(e)&&(gt="keyboard",pn("keyboard",e))}function be(e){gt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&(Ye=!0,pn("pointer",e))}function yr(e){Es(e)&&(Ye=!0,gt="virtual")}function xr(e){e.target===window||e.target===document||Ss||!e.isTrusted||(!Ye&&!dn&&(gt="virtual",pn("virtual",e)),Ye=!1,dn=!1)}function wr(){Ye=!1,dn=!0}function mn(e){if(typeof window>"u"||typeof document>"u"||vt.get(Ge(e)))return;const t=Ge(e),n=Re(e);let r=t.HTMLElement.prototype.focus;t.HTMLElement.prototype.focus=function(){Ye=!0,r.apply(this,arguments)},n.addEventListener("keydown",Nt,!0),n.addEventListener("keyup",Nt,!0),n.addEventListener("click",yr,!0),t.addEventListener("focus",xr,!0),t.addEventListener("blur",wr,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",be,!0),n.addEventListener("pointermove",be,!0),n.addEventListener("pointerup",be,!0)):process.env.NODE_ENV==="test"&&(n.addEventListener("mousedown",be,!0),n.addEventListener("mousemove",be,!0),n.addEventListener("mouseup",be,!0)),t.addEventListener("beforeunload",()=>{Er(e)},{once:!0}),vt.set(t,{focus:r})}const Er=(e,t)=>{const n=Ge(e),r=Re(e);t&&r.removeEventListener("DOMContentLoaded",t),vt.has(n)&&(n.HTMLElement.prototype.focus=vt.get(n).focus,r.removeEventListener("keydown",Nt,!0),r.removeEventListener("keyup",Nt,!0),r.removeEventListener("click",yr,!0),n.removeEventListener("focus",xr,!0),n.removeEventListener("blur",wr,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",be,!0),r.removeEventListener("pointermove",be,!0),r.removeEventListener("pointerup",be,!0)):process.env.NODE_ENV==="test"&&(r.removeEventListener("mousedown",be,!0),r.removeEventListener("mousemove",be,!0),r.removeEventListener("mouseup",be,!0)),vt.delete(n))};function Ts(e){const t=Re(e);let n;return t.readyState!=="loading"?mn(e):(n=()=>{mn(e)},t.addEventListener("DOMContentLoaded",n)),()=>Er(e,n)}typeof document<"u"&&Ts();function Cr(){return gt!=="pointer"}const Ps=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function As(e,t,n){let r=Re(n==null?void 0:n.target);const o=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,c=typeof window<"u"?Ge(n==null?void 0:n.target).HTMLElement:HTMLElement,u=typeof window<"u"?Ge(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return e=e||r.activeElement instanceof o&&!Ps.has(r.activeElement.type)||r.activeElement instanceof s||r.activeElement instanceof c&&r.activeElement.isContentEditable,!(e&&t==="keyboard"&&n instanceof u&&!$s[n.key])}function Ms(e,t,n){mn(),d.useEffect(()=>{let r=(o,s)=>{As(!!(n!=null&&n.isTextInput),o,s)&&e(Cr())};return fn.add(r),()=>{fn.delete(r)}},t)}function Ns(e){let{isDisabled:t,onFocus:n,onBlur:r,onFocusChange:o}=e;const s=d.useCallback(i=>{if(i.target===i.currentTarget)return r&&r(i),o&&o(!1),!0},[r,o]),c=br(s),u=d.useCallback(i=>{const l=Re(i.target),a=l?an(l):an();i.target===i.currentTarget&&a===hr(i.nativeEvent)&&(n&&n(i),o&&o(!0),c(i))},[o,n,c]);return{focusProps:{onFocus:!t&&(n||o||r)?u:void 0,onBlur:!t&&(r||o)?s:void 0}}}function Fs(e){let{isDisabled:t,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:o}=e,s=d.useRef({isFocusWithin:!1}),{addGlobalListener:c,removeAllGlobalListeners:u}=gr(),i=d.useCallback(p=>{p.currentTarget.contains(p.target)&&s.current.isFocusWithin&&!p.currentTarget.contains(p.relatedTarget)&&(s.current.isFocusWithin=!1,u(),n&&n(p),o&&o(!1))},[n,o,s,u]),l=br(i),a=d.useCallback(p=>{if(!p.currentTarget.contains(p.target))return;const m=Re(p.target),f=an(m);if(!s.current.isFocusWithin&&f===hr(p.nativeEvent)){r&&r(p),o&&o(!0),s.current.isFocusWithin=!0,l(p);let h=p.currentTarget;c(m,"focus",v=>{if(s.current.isFocusWithin&&!mr(h,v.target)){let b=new m.defaultView.FocusEvent("blur",{relatedTarget:v.target});Cs(b,h);let E=vr(b);i(E)}},{capture:!0})}},[r,o,l,c,i]);return t?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:a,onBlur:i}}}let Ft=!1,Lt=0;function hn(){Ft=!0,setTimeout(()=>{Ft=!1},50)}function Sr(e){e.pointerType==="touch"&&hn()}function Ls(){if(!(typeof document>"u"))return Lt===0&&(typeof PointerEvent<"u"?document.addEventListener("pointerup",Sr):process.env.NODE_ENV==="test"&&document.addEventListener("touchend",hn)),Lt++,()=>{Lt--,!(Lt>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",Sr):process.env.NODE_ENV==="test"&&document.removeEventListener("touchend",hn))}}function Ds(e){let{onHoverStart:t,onHoverChange:n,onHoverEnd:r,isDisabled:o}=e,[s,c]=d.useState(!1),u=d.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d.useEffect(Ls,[]);let{addGlobalListener:i,removeAllGlobalListeners:l}=gr(),{hoverProps:a,triggerHoverEnd:p}=d.useMemo(()=>{let m=(v,b)=>{if(u.pointerType=b,o||b==="touch"||u.isHovered||!v.currentTarget.contains(v.target))return;u.isHovered=!0;let E=v.currentTarget;u.target=E,i(Re(v.target),"pointerover",w=>{u.isHovered&&u.target&&!mr(u.target,w.target)&&f(w,w.pointerType)},{capture:!0}),t&&t({type:"hoverstart",target:E,pointerType:b}),n&&n(!0),c(!0)},f=(v,b)=>{let E=u.target;u.pointerType="",u.target=null,!(b==="touch"||!u.isHovered||!E)&&(u.isHovered=!1,l(),r&&r({type:"hoverend",target:E,pointerType:b}),n&&n(!1),c(!1))},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=v=>{Ft&&v.pointerType==="mouse"||m(v,v.pointerType)},h.onPointerLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,v.pointerType)}):process.env.NODE_ENV==="test"&&(h.onTouchStart=()=>{u.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=v=>{!u.ignoreEmulatedMouseEvents&&!Ft&&m(v,"mouse"),u.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=v=>{!o&&v.currentTarget.contains(v.target)&&f(v,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[t,n,r,o,u,i,l]);return d.useEffect(()=>{o&&p({currentTarget:u.target},u.pointerType)},[o]),{hoverProps:a,isHovered:s}}function Is(e={}){let{autoFocus:t=!1,isTextInput:n,within:r}=e,o=d.useRef({isFocused:!1,isFocusVisible:t||Cr()}),[s,c]=d.useState(!1),[u,i]=d.useState(()=>o.current.isFocused&&o.current.isFocusVisible),l=d.useCallback(()=>i(o.current.isFocused&&o.current.isFocusVisible),[]),a=d.useCallback(f=>{o.current.isFocused=f,c(f),l()},[l]);Ms(f=>{o.current.isFocusVisible=f,l()},[],{isTextInput:n});let{focusProps:p}=Ns({isDisabled:r,onFocusChange:a}),{focusWithinProps:m}=Fs({isDisabled:!r,onFocusWithinChange:a});return{isFocused:s,isFocusVisible:u,focusProps:r?m:p}}var js=Object.defineProperty,ks=(e,t,n)=>t in e?js(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gn=(e,t,n)=>(ks(e,typeof t!="symbol"?t+"":t,n),n);let _s=class{constructor(){gn(this,"current",this.detect()),gn(this,"handoffState","pending"),gn(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"}},Te=new _s;function bt(e){var t,n;return Te.isServer?null:e?"ownerDocument"in e?e.ownerDocument:"current"in e?(n=(t=e.current)==null?void 0:t.ownerDocument)!=null?n:document:null:document}function $r(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function Se(){let e=[],t={addEventListener(n,r,o,s){return n.addEventListener(r,o,s),t.add(()=>n.removeEventListener(r,o,s))},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 $r(()=>{r.current&&n[0]()}),t.add(()=>{r.current=!1})},style(n,r,o){let s=n.style.getPropertyValue(r);return Object.assign(n.style,{[r]:o}),this.add(()=>{Object.assign(n.style,{[r]:s})})},group(n){let r=Se();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 rt(){let[e]=d.useState(Se);return d.useEffect(()=>()=>e.dispose(),[e]),e}let J=(e,t)=>{Te.isServer?d.useEffect(e,t):d.useLayoutEffect(e,t)};function Ke(e){let t=d.useRef(e);return J(()=>{t.current=e},[e]),t}let U=function(e){let t=Ke(e);return d.useCallback((...n)=>t.current(...n),[t])};function Rs(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 Bs(e,t){return!(!e||!t||e.right<t.left||e.left>t.right||e.bottom<t.top||e.top>t.bottom)}function Hs({disabled:e=!1}={}){let t=d.useRef(null),[n,r]=d.useState(!1),o=rt(),s=U(()=>{t.current=null,r(!1),o.dispose()}),c=U(u=>{if(o.dispose(),t.current===null){t.current=u.currentTarget,r(!0);{let i=bt(u.currentTarget);o.addEventListener(i,"pointerup",s,!1),o.addEventListener(i,"pointermove",l=>{if(t.current){let a=Rs(l);r(Bs(a,t.current.getBoundingClientRect()))}},!1),o.addEventListener(i,"pointercancel",s,!1)}}});return{pressed:n,pressProps:e?{}:{onPointerDown:c,onPointerUp:s,onClick:s}}}let Ws=d.createContext(void 0);function vn(){return d.useContext(Ws)}function bn(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}function ye(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,ye),r}var Dt=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Dt||{}),Be=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Be||{});function ge(){let e=Us();return d.useCallback(t=>Vs({mergeRefs:e,...t}),[e])}function Vs({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:o,visible:s=!0,name:c,mergeRefs:u}){u=u??zs;let i=Or(t,e);if(s)return It(i,n,r,c,u);let l=o??0;if(l&2){let{static:a=!1,...p}=i;if(a)return It(p,n,r,c,u)}if(l&1){let{unmount:a=!0,...p}=i;return ye(a?0:1,{0(){return null},1(){return It({...p,hidden:!0,style:{display:"none"}},n,r,c,u)}})}return It(i,n,r,c,u)}function It(e,t={},n,r,o){let{as:s=n,children:c,refName:u="ref",...i}=yn(e,["unmount","static"]),l=e.ref!==void 0?{[u]:e.ref}:{},a=typeof c=="function"?c(t):c;"className"in i&&i.className&&typeof i.className=="function"&&(i.className=i.className(t)),i["aria-labelledby"]&&i["aria-labelledby"]===i.id&&(i["aria-labelledby"]=void 0);let p={};if(t){let m=!1,f=[];for(let[h,v]of Object.entries(t))typeof v=="boolean"&&(m=!0),v===!0&&f.push(h.replace(/([A-Z])/g,b=>`-${b.toLowerCase()}`));if(m){p["data-headlessui-state"]=f.join(" ");for(let h of f)p[`data-${h}`]=""}}if(s===d.Fragment&&(Object.keys(He(i)).length>0||Object.keys(He(p)).length>0))if(!d.isValidElement(a)||Array.isArray(a)&&a.length>1){if(Object.keys(He(i)).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(He(i)).concat(Object.keys(He(p))).map(m=>` - ${m}`).join(`
56
+ `),"","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(m=>` - ${m}`).join(`
57
57
  `)].join(`
58
- `))}else{let f=a.props,p=f==null?void 0:f.className,m=typeof p=="function"?(...x)=>Sn(p(...x),s.className):Sn(p,s.className),v=m?{className:m}:{},b=Wr(a.props,Ke(On(s,["ref"])));for(let x in d)x in b&&delete d[x];return h.cloneElement(a,Object.assign({},b,d,l,{ref:o(hl(a),l.ref)},v))}return h.createElement(i,Object.assign({},On(s,["ref"]),i!==h.Fragment&&l,i!==h.Fragment&&d),a)}function dl(){let e=h.useRef([]),t=h.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 pl(...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 Wr(...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 u=n[r];for(let c of u){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;c(o,...i)}}});return t}function Br(...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 u of i)u==null||u(...o)}});return t}function xe(e){var t;return Object.assign(h.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ke(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function On(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function hl(e){return h.version.split(".")[0]>="19"?e.props.ref:e.ref}function ml(e,t,n){let[r,o]=h.useState(n),i=e!==void 0,u=h.useRef(i),c=h.useRef(!1),s=h.useRef(!1);return i&&!u.current&&!c.current?(c.current=!0,u.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&&u.current&&!s.current&&(s.current=!0,u.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(l=>(i||o(l),t==null?void 0:t(l)))]}function gl(e){let[t]=h.useState(e);return t}function Hr(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))Vr(n,Ur(t,r),o);return n}function Ur(e,t){return e?e+"["+t+"]":t}function Vr(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())Vr(e,Ur(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,""]):Hr(n,t,e)}function vl(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 bl="span";var Tn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Tn||{});function yl(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 Se()({ourProps:i,theirProps:o,slot:{},defaultTag:bl,name:"Hidden"})}let zr=xe(yl),El=h.createContext(null);function wl({children:e}){let t=h.useContext(El);if(!t)return h.createElement(h.Fragment,null,e);let{target:n}=t;return n?we.createPortal(h.createElement(h.Fragment,null,e),n):null}function xl({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[i,u]=h.useState(null),c=at();return h.useEffect(()=>{if(r&&i)return c.addEventListener(i,"reset",r)},[i,t,r]),h.createElement(wl,null,h.createElement(Cl,{setForm:u,formId:t}),Hr(e).map(([s,l])=>h.createElement(zr,{features:Tn.Hidden,...Ke({key:s,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:s,value:l,...o})})))}function Cl({setForm:e,formId:t}){return h.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:h.createElement(zr,{features:Tn.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let Sl=h.createContext(void 0);function Yr(){return h.useContext(Sl)}function $n(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function Ht(e){return $n(e)&&"tagName"in e}function Ve(e){return Ht(e)&&"accessKey"in e}function ut(e){return Ht(e)&&"tabIndex"in e}function Ol(e){return Ht(e)&&"style"in e}function Tl(e){return Ve(e)&&e.nodeName==="IFRAME"}function Gr(e){return Ve(e)&&e.nodeName==="INPUT"}function qr(e){return Ve(e)&&e.nodeName==="LABEL"}function $l(e){return Ve(e)&&e.nodeName==="FIELDSET"}function Kr(e){return Ve(e)&&e.nodeName==="LEGEND"}function Pl(e){return Ht(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function Al(e){let t=e.parentElement,n=null;for(;t&&!$l(t);)Kr(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&Ml(n)?!1:r}function Ml(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Kr(t))return!1;t=t.previousElementSibling}return!0}let Qr=Symbol();function _l(e,t=!0){return Object.assign(e,{[Qr]:t})}function Pe(...e){let t=h.useRef(e);h.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[Qr]))?void 0:n}let Pn=h.createContext(null);Pn.displayName="DescriptionContext";function Xr(){let e=h.useContext(Pn);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,Xr),t}return e}function Dl(){var e,t;return(t=(e=h.useContext(Pn))==null?void 0:e.value)!=null?t:void 0}let Ll="p";function Fl(e,t){let n=h.useId(),r=Cn(),{id:o=`headlessui-description-${n}`,...i}=e,u=Xr(),c=Pe(t);ue(()=>u.register(o),[o,u.register]);let s=r||!1,l=h.useMemo(()=>({...u.slot,disabled:s}),[u.slot,s]),a={ref:c,...u.props,id:o};return Se()({ourProps:a,theirProps:i,slot:l,defaultTag:Ll,name:u.name||"Description"})}let Il=xe(Fl);Object.assign(Il,{});var me=(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))(me||{});let Ut=h.createContext(null);Ut.displayName="LabelContext";function Jr(){let e=h.useContext(Ut);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,Jr),t}return e}function Zr(e){var t,n,r;let o=(n=(t=h.useContext(Ut))==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 kl({inherit:e=!1}={}){let t=Zr(),[n,r]=h.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,h.useMemo(()=>function(i){let u=ne(s=>(r(l=>[...l,s]),()=>r(l=>{let a=l.slice(),d=a.indexOf(s);return d!==-1&&a.splice(d,1),a}))),c=h.useMemo(()=>({register:u,slot:i.slot,name:i.name,props:i.props,value:i.value}),[u,i.slot,i.name,i.props,i.value]);return h.createElement(Ut.Provider,{value:c},i.children)},[r])]}let Nl="label";function jl(e,t){var n;let r=h.useId(),o=Jr(),i=Yr(),u=Cn(),{id:c=`headlessui-label-${r}`,htmlFor:s=i??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...a}=e,d=Pe(t);ue(()=>o.register(c),[c,o.register]);let f=ne(b=>{let x=b.currentTarget;if(!(b.target!==b.currentTarget&&Pl(b.target))&&(qr(x)&&b.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(b),qr(x))){let w=document.getElementById(x.htmlFor);if(w){let y=w.getAttribute("disabled");if(y==="true"||y==="")return;let S=w.getAttribute("aria-disabled");if(S==="true"||S==="")return;(Gr(w)&&(w.type==="file"||w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),p=u||!1,m=h.useMemo(()=>({...o.slot,disabled:p}),[o.slot,p]),v={ref:d,...o.props,id:c,htmlFor:s,onClick:f};return l&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in a&&delete a.onClick),Se()({ourProps:v,theirProps:a,slot:m,defaultTag:s?Nl:"div",name:o.name||"Label"})}let Rl=xe(jl),Wl=Object.assign(Rl,{});function Bl(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 Hl(e=Bl){return h.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 Ul(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function Vl(e,t=!1){let[n,r]=h.useReducer(()=>({}),{}),o=h.useMemo(()=>Ul(e),[e,n]);return ue(()=>{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 eo=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}};var zl=Object.defineProperty,Yl=(e,t,n)=>t in e?zl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gl=(e,t,n)=>(Yl(e,t+"",n),n),to=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ae=(e,t,n)=>(to(e,t,"read from private field"),n?n.call(e):t.get(e)),An=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},no=(e,t,n,r)=>(to(e,t,"write to private field"),t.set(e,n),n),Ne,Ot,Tt;let ro=class{constructor(t){An(this,Ne,{}),An(this,Ot,new eo(()=>new Set)),An(this,Tt,new Set),Gl(this,"disposables",Le()),no(this,Ne,t),ke.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return Ae(this,Ne)}subscribe(t,n){if(ke.isServer)return()=>{};let r={selector:t,callback:n,current:t(Ae(this,Ne))};return Ae(this,Tt).add(r),this.disposables.add(()=>{Ae(this,Tt).delete(r)})}on(t,n){return ke.isServer?()=>{}:(Ae(this,Ot).get(t).add(n),this.disposables.add(()=>{Ae(this,Ot).get(t).delete(n)}))}send(t){let n=this.reduce(Ae(this,Ne),t);if(n!==Ae(this,Ne)){no(this,Ne,n);for(let r of Ae(this,Tt)){let o=r.selector(Ae(this,Ne));oo(r.current,o)||(r.current=o,r.callback(o))}for(let r of Ae(this,Ot).get(t.type))r(Ae(this,Ne),t)}}};Ne=new WeakMap,Ot=new WeakMap,Tt=new WeakMap;function oo(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Mn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Mn(e.entries(),t.entries()):io(e)&&io(t)?Mn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Mn(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function io(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function _n(e){let[t,n]=e(),r=Le();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var ql=Object.defineProperty,Kl=(e,t,n)=>t in e?ql(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,so=(e,t,n)=>(Kl(e,typeof t!="symbol"?t+"":t,n),n),lo=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(lo||{});let Ql={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let i=e.stack.slice();return i.splice(o,1),i.push(n),r=i,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Xl=class gs extends ro{constructor(){super(...arguments),so(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),so(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new gs({stack:[]})}reduce(t,n){return $e(n.type,Ql,t,n)}};const Dn=new eo(()=>Xl.new());var Ln={exports:{}},Fn={};/**
58
+ `))}else{let m=a.props,f=m==null?void 0:m.className,h=typeof f=="function"?(...E)=>bn(f(...E),i.className):bn(f,i.className),v=h?{className:h}:{},b=Or(a.props,He(yn(i,["ref"])));for(let E in p)E in b&&delete p[E];return d.cloneElement(a,Object.assign({},b,p,l,{ref:o(Gs(a),l.ref)},v))}return d.createElement(s,Object.assign({},yn(i,["ref"]),s!==d.Fragment&&l,s!==d.Fragment&&p),a)}function Us(){let e=d.useRef([]),t=d.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 zs(...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 Or(...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 s;return(s=o==null?void 0:o.preventDefault)==null?void 0:s.call(o)}]);for(let r in n)Object.assign(t,{[r](o,...s){let c=n[r];for(let u of c){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;u(o,...s)}}});return t}function Tr(...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 s=n[r];for(let c of s)c==null||c(...o)}});return t}function pe(e){var t;return Object.assign(d.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function He(e){let t=Object.assign({},e);for(let n in t)t[n]===void 0&&delete t[n];return t}function yn(e,t=[]){let n=Object.assign({},e);for(let r of t)r in n&&delete n[r];return n}function Gs(e){return d.version.split(".")[0]>="19"?e.props.ref:e.ref}function Ys(e,t,n){let[r,o]=d.useState(n),s=e!==void 0,c=d.useRef(s),u=d.useRef(!1),i=d.useRef(!1);return s&&!c.current&&!u.current?(u.current=!0,c.current=s,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.")):!s&&c.current&&!i.current&&(i.current=!0,c.current=s,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.")),[s?e:r,U(l=>(s||o(l),t==null?void 0:t(l)))]}function Ks(e){let[t]=d.useState(e);return t}function Pr(e={},t=null,n=[]){for(let[r,o]of Object.entries(e))Mr(n,Ar(t,r),o);return n}function Ar(e,t){return e?e+"["+t+"]":t}function Mr(e,t,n){if(Array.isArray(n))for(let[r,o]of n.entries())Mr(e,Ar(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,""]):Pr(n,t,e)}function Qs(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 Xs="span";var xn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(xn||{});function qs(e,t){var n;let{features:r=1,...o}=e,s={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 ge()({ourProps:s,theirProps:o,slot:{},defaultTag:Xs,name:"Hidden"})}let Nr=pe(qs),Js=d.createContext(null);function Zs({children:e}){let t=d.useContext(Js);if(!t)return d.createElement(d.Fragment,null,e);let{target:n}=t;return n?de.createPortal(d.createElement(d.Fragment,null,e),n):null}function el({data:e,form:t,disabled:n,onReset:r,overrides:o}){let[s,c]=d.useState(null),u=rt();return d.useEffect(()=>{if(r&&s)return u.addEventListener(s,"reset",r)},[s,t,r]),d.createElement(Zs,null,d.createElement(tl,{setForm:c,formId:t}),Pr(e).map(([i,l])=>d.createElement(Nr,{features:xn.Hidden,...He({key:i,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:t,disabled:n,name:i,value:l,...o})})))}function tl({setForm:e,formId:t}){return d.useEffect(()=>{if(t){let n=document.getElementById(t);n&&e(n)}},[e,t]),t?null:d.createElement(Nr,{features:xn.Hidden,as:"input",type:"hidden",hidden:!0,readOnly:!0,ref:n=>{if(!n)return;let r=n.closest("form");r&&e(r)}})}let nl=d.createContext(void 0);function Fr(){return d.useContext(nl)}function wn(e){return typeof e!="object"||e===null?!1:"nodeType"in e}function jt(e){return wn(e)&&"tagName"in e}function Ie(e){return jt(e)&&"accessKey"in e}function ot(e){return jt(e)&&"tabIndex"in e}function rl(e){return jt(e)&&"style"in e}function ol(e){return Ie(e)&&e.nodeName==="IFRAME"}function Lr(e){return Ie(e)&&e.nodeName==="INPUT"}function Dr(e){return Ie(e)&&e.nodeName==="LABEL"}function il(e){return Ie(e)&&e.nodeName==="FIELDSET"}function Ir(e){return Ie(e)&&e.nodeName==="LEGEND"}function sl(e){return jt(e)?e.matches('a[href],audio[controls],button,details,embed,iframe,img[usemap],input:not([type="hidden"]),label,select,textarea,video[controls]'):!1}function ll(e){let t=e.parentElement,n=null;for(;t&&!il(t);)Ir(t)&&(n=t),t=t.parentElement;let r=(t==null?void 0:t.getAttribute("disabled"))==="";return r&&al(n)?!1:r}function al(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(Ir(t))return!1;t=t.previousElementSibling}return!0}let jr=Symbol();function ul(e,t=!0){return Object.assign(e,{[jr]:t})}function xe(...e){let t=d.useRef(e);d.useEffect(()=>{t.current=e},[e]);let n=U(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[jr]))?void 0:n}let En=d.createContext(null);En.displayName="DescriptionContext";function kr(){let e=d.useContext(En);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,kr),t}return e}function cl(){var e,t;return(t=(e=d.useContext(En))==null?void 0:e.value)!=null?t:void 0}let fl="p";function dl(e,t){let n=d.useId(),r=vn(),{id:o=`headlessui-description-${n}`,...s}=e,c=kr(),u=xe(t);J(()=>c.register(o),[o,c.register]);let i=r||!1,l=d.useMemo(()=>({...c.slot,disabled:i}),[c.slot,i]),a={ref:u,...c.props,id:o};return ge()({ourProps:a,theirProps:s,slot:l,defaultTag:fl,name:c.name||"Description"})}let pl=pe(dl);Object.assign(pl,{});var se=(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))(se||{});let kt=d.createContext(null);kt.displayName="LabelContext";function _r(){let e=d.useContext(kt);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,_r),t}return e}function Rr(e){var t,n,r;let o=(n=(t=d.useContext(kt))==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 ml({inherit:e=!1}={}){let t=Rr(),[n,r]=d.useState([]),o=e?[t,...n].filter(Boolean):n;return[o.length>0?o.join(" "):void 0,d.useMemo(()=>function(s){let c=U(i=>(r(l=>[...l,i]),()=>r(l=>{let a=l.slice(),p=a.indexOf(i);return p!==-1&&a.splice(p,1),a}))),u=d.useMemo(()=>({register:c,slot:s.slot,name:s.name,props:s.props,value:s.value}),[c,s.slot,s.name,s.props,s.value]);return d.createElement(kt.Provider,{value:u},s.children)},[r])]}let hl="label";function gl(e,t){var n;let r=d.useId(),o=_r(),s=Fr(),c=vn(),{id:u=`headlessui-label-${r}`,htmlFor:i=s??((n=o.props)==null?void 0:n.htmlFor),passive:l=!1,...a}=e,p=xe(t);J(()=>o.register(u),[u,o.register]);let m=U(b=>{let E=b.currentTarget;if(!(b.target!==b.currentTarget&&sl(b.target))&&(Dr(E)&&b.preventDefault(),o.props&&"onClick"in o.props&&typeof o.props.onClick=="function"&&o.props.onClick(b),Dr(E))){let w=document.getElementById(E.htmlFor);if(w){let y=w.getAttribute("disabled");if(y==="true"||y==="")return;let S=w.getAttribute("aria-disabled");if(S==="true"||S==="")return;(Lr(w)&&(w.type==="file"||w.type==="radio"||w.type==="checkbox")||w.role==="radio"||w.role==="checkbox"||w.role==="switch")&&w.click(),w.focus({preventScroll:!0})}}}),f=c||!1,h=d.useMemo(()=>({...o.slot,disabled:f}),[o.slot,f]),v={ref:p,...o.props,id:u,htmlFor:i,onClick:m};return l&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in a&&delete a.onClick),ge()({ourProps:v,theirProps:a,slot:h,defaultTag:i?hl:"div",name:o.name||"Label"})}let vl=pe(gl),bl=Object.assign(vl,{});function yl(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 xl(e=yl){return d.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 wl(e){if(e===null)return{width:0,height:0};let{width:t,height:n}=e.getBoundingClientRect();return{width:t,height:n}}function El(e,t=!1){let[n,r]=d.useReducer(()=>({}),{}),o=d.useMemo(()=>wl(e),[e,n]);return J(()=>{if(!e)return;let s=new ResizeObserver(r);return s.observe(e),()=>{s.disconnect()}},[e]),t?{width:`${o.width}px`,height:`${o.height}px`}:o}let Br=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}};var Cl=Object.defineProperty,Sl=(e,t,n)=>t in e?Cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$l=(e,t,n)=>(Sl(e,t+"",n),n),Hr=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},we=(e,t,n)=>(Hr(e,t,"read from private field"),n?n.call(e):t.get(e)),Cn=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Wr=(e,t,n,r)=>(Hr(e,t,"write to private field"),t.set(e,n),n),Pe,yt,xt;let Vr=class{constructor(t){Cn(this,Pe,{}),Cn(this,yt,new Br(()=>new Set)),Cn(this,xt,new Set),$l(this,"disposables",Se()),Wr(this,Pe,t),Te.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return we(this,Pe)}subscribe(t,n){if(Te.isServer)return()=>{};let r={selector:t,callback:n,current:t(we(this,Pe))};return we(this,xt).add(r),this.disposables.add(()=>{we(this,xt).delete(r)})}on(t,n){return Te.isServer?()=>{}:(we(this,yt).get(t).add(n),this.disposables.add(()=>{we(this,yt).get(t).delete(n)}))}send(t){let n=this.reduce(we(this,Pe),t);if(n!==we(this,Pe)){Wr(this,Pe,n);for(let r of we(this,xt)){let o=r.selector(we(this,Pe));Ur(r.current,o)||(r.current=o,r.callback(o))}for(let r of we(this,yt).get(t.type))r(we(this,Pe),t)}}};Pe=new WeakMap,yt=new WeakMap,xt=new WeakMap;function Ur(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:Array.isArray(e)&&Array.isArray(t)?e.length!==t.length?!1:Sn(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size!==t.size?!1:Sn(e.entries(),t.entries()):zr(e)&&zr(t)?Sn(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()):!1}function Sn(e,t){do{let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}while(!0)}function zr(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;let t=Object.getPrototypeOf(e);return t===null||Object.getPrototypeOf(t)===null}function $n(e){let[t,n]=e(),r=Se();return(...o)=>{t(...o),r.dispose(),r.microTask(n)}}var Ol=Object.defineProperty,Tl=(e,t,n)=>t in e?Ol(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gr=(e,t,n)=>(Tl(e,typeof t!="symbol"?t+"":t,n),n),Yr=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(Yr||{});let Pl={0(e,t){let n=t.id,r=e.stack,o=e.stack.indexOf(n);if(o!==-1){let s=e.stack.slice();return s.splice(o,1),s.push(n),r=s,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(r===-1)return e;let o=e.stack.slice();return o.splice(r,1),{...e,stack:o}}},Al=class Qi extends Vr{constructor(){super(...arguments),Gr(this,"actions",{push:t=>this.send({type:0,id:t}),pop:t=>this.send({type:1,id:t})}),Gr(this,"selectors",{isTop:(t,n)=>t.stack[t.stack.length-1]===n,inStack:(t,n)=>t.stack.includes(n)})}static new(){return new Qi({stack:[]})}reduce(t,n){return ye(n.type,Pl,t,n)}};const On=new Br(()=>Al.new());var Tn={exports:{}},Pn={};/**
59
59
  * @license React
60
60
  * use-sync-external-store-with-selector.production.js
61
61
  *
@@ -63,7 +63,7 @@ React keys must be passed directly to JSX without using spread:
63
63
  *
64
64
  * This source code is licensed under the MIT license found in the
65
65
  * LICENSE file in the root directory of this source tree.
66
- */var ao;function Jl(){if(ao)return Fn;ao=1;var e=h;function t(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,i=e.useEffect,u=e.useMemo,c=e.useDebugValue;return Fn.useSyncExternalStoreWithSelector=function(s,l,a,d,f){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=u(function(){function b(E){if(!x){if(x=!0,w=E,E=d(E),f!==void 0&&m.hasValue){var F=m.value;if(f(F,E))return y=F}return y=E}if(F=y,n(w,E))return F;var j=d(E);return f!==void 0&&f(F,j)?(w=E,F):(w=E,y=j)}var x=!1,w,y,S=a===void 0?null:a;return[function(){return b(l())},S===null?void 0:function(){return b(S())}]},[l,a,d,f]);var v=r(s,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},Fn}var In={};/**
66
+ */var Kr;function Ml(){if(Kr)return Pn;Kr=1;var e=d;function t(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var n=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=e.useRef,s=e.useEffect,c=e.useMemo,u=e.useDebugValue;return Pn.useSyncExternalStoreWithSelector=function(i,l,a,p,m){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=c(function(){function b(C){if(!E){if(E=!0,w=C,C=p(C),m!==void 0&&h.hasValue){var O=h.value;if(m(O,C))return y=O}return y=C}if(O=y,n(w,C))return O;var N=p(C);return m!==void 0&&m(O,N)?(w=C,O):(w=C,y=N)}var E=!1,w,y,S=a===void 0?null:a;return[function(){return b(l())},S===null?void 0:function(){return b(S())}]},[l,a,p,m]);var v=r(i,f[0],f[1]);return s(function(){h.hasValue=!0,h.value=v},[v]),u(v),v},Pn}var An={};/**
67
67
  * @license React
68
68
  * use-sync-external-store-with-selector.development.js
69
69
  *
@@ -71,53 +71,34 @@ React keys must be passed directly to JSX without using spread:
71
71
  *
72
72
  * This source code is licensed under the MIT license found in the
73
73
  * LICENSE file in the root directory of this source tree.
74
- */var uo;function Zl(){return uo||(uo=1,process.env.NODE_ENV!=="production"&&function(){function e(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=h,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,i=t.useEffect,u=t.useMemo,c=t.useDebugValue;In.useSyncExternalStoreWithSelector=function(s,l,a,d,f){var p=o(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=u(function(){function b(E){if(!x){if(x=!0,w=E,E=d(E),f!==void 0&&m.hasValue){var F=m.value;if(f(F,E))return y=F}return y=E}if(F=y,n(w,E))return F;var j=d(E);return f!==void 0&&f(F,j)?(w=E,F):(w=E,y=j)}var x=!1,w,y,S=a===void 0?null:a;return[function(){return b(l())},S===null?void 0:function(){return b(S())}]},[l,a,d,f]);var v=r(s,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=v},[v]),c(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),In}process.env.NODE_ENV==="production"?Ln.exports=Jl():Ln.exports=Zl();var ea=Ln.exports;function Me(e,t,n=oo){return ea.useSyncExternalStoreWithSelector(ne(r=>e.subscribe(ta,r)),ne(()=>e.state),ne(()=>e.state),ne(t),n)}function ta(e){return e}function co(e,t){let n=h.useId(),r=Dn.get(t),[o,i]=Me(r,h.useCallback(u=>[r.selectors.isTop(u,n),r.selectors.inStack(u,n)],[r,n]));return ue(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?i?o:!0:!1}let kn=new Map,$t=new Map;function fo(e){var t;let n=(t=$t.get(e))!=null?t:0;return $t.set(e,n+1),n!==0?()=>po(e):(kn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>po(e))}function po(e){var t;let n=(t=$t.get(e))!=null?t:1;if(n===1?$t.delete(e):$t.set(e,n-1),n!==1)return;let r=kn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,kn.delete(e))}function na(e,{allowed:t,disallowed:n}={}){let r=co(e,"inert-others");ue(()=>{var o,i;if(!r)return;let u=Le();for(let s of(o=n==null?void 0:n())!=null?o:[])s&&u.add(fo(s));let c=(i=t==null?void 0:t())!=null?i:[];for(let s of c){if(!s)continue;let l=St(s);if(!l)continue;let a=s.parentElement;for(;a&&a!==l.body;){for(let d of a.children)c.some(f=>d.contains(f))||u.add(fo(d));a=a.parentElement}}return u.dispose},[r,t,n])}function ra(e,t,n){let r=tt(o=>{let i=o.getBoundingClientRect();i.x===0&&i.y===0&&i.width===0&&i.height===0&&n()});h.useEffect(()=>{if(!e)return;let o=t===null?null:Ve(t)?t:t.current;if(!o)return;let i=Le();if(typeof ResizeObserver<"u"){let u=new ResizeObserver(()=>r.current(o));u.observe(o),i.add(()=>u.disconnect())}if(typeof IntersectionObserver<"u"){let u=new IntersectionObserver(()=>r.current(o));u.observe(o),i.add(()=>u.disconnect())}return()=>i.dispose()},[t,r,e])}let Nn=["[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(","),oa=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var jn=(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))(jn||{}),ia=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(ia||{}),sa=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(sa||{});function ho(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Nn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function la(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(oa)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Rn=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Rn||{});function mo(e,t=0){var n;return e===((n=St(e))==null?void 0:n.body)?!1:$e(t,{0(){return e.matches(Nn)},1(){let r=e;for(;r!==null;){if(r.matches(Nn))return!0;r=r.parentElement}return!1}})}var aa=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(aa||{});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 ua=["textarea","input"].join(",");function ca(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,ua))!=null?n:!1}function go(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 u=o.compareDocumentPosition(i);return u&Node.DOCUMENT_POSITION_FOLLOWING?-1:u&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function fa(e,t){return da(ho(),t,{relativeTo:e})}function da(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,u=Array.isArray(e)?n?go(e):e:t&64?la(e):ho(e);o.length>0&&u.length>1&&(u=u.filter(p=>!o.some(m=>m!=null&&"current"in m?(m==null?void 0:m.current)===p:m===p))),r=r??i.activeElement;let c=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),s=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,u.indexOf(r))-1;if(t&4)return Math.max(0,u.indexOf(r))+1;if(t&8)return u.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},a=0,d=u.length,f;do{if(a>=d||a+d<=0)return 0;let p=s+a;if(t&16)p=(p+d)%d;else{if(p<0)return 3;if(p>=d)return 1}f=u[p],f==null||f.focus(l),a+=c}while(f!==i.activeElement);return t&6&&ca(f)&&f.select(),2}function vo(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function pa(){return/Android/gi.test(window.navigator.userAgent)}function bo(){return vo()||pa()}function ct(e,t,n,r){let o=tt(n);h.useEffect(()=>{if(!e)return;function i(u){o.current(u)}return document.addEventListener(t,i,r),()=>document.removeEventListener(t,i,r)},[e,t,r])}function ha(e,t,n,r){let o=tt(n);h.useEffect(()=>{if(!e)return;function i(u){o.current(u)}return window.addEventListener(t,i,r),()=>window.removeEventListener(t,i,r)},[e,t,r])}const yo=30;function ma(e,t,n){let r=tt(n),o=h.useCallback(function(c,s){if(c.defaultPrevented)return;let l=s(c);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let a=function d(f){return typeof f=="function"?d(f()):Array.isArray(f)||f instanceof Set?f:[f]}(t);for(let d of a)if(d!==null&&(d.contains(l)||c.composed&&c.composedPath().includes(d)))return;return!mo(l,Rn.Loose)&&l.tabIndex!==-1&&c.preventDefault(),r.current(c,l)},[r,t]),i=h.useRef(null);ct(e,"pointerdown",c=>{var s,l;bo()||(i.current=((l=(s=c.composedPath)==null?void 0:s.call(c))==null?void 0:l[0])||c.target)},!0),ct(e,"pointerup",c=>{if(bo()||!i.current)return;let s=i.current;return i.current=null,o(c,()=>s)},!0);let u=h.useRef({x:0,y:0});ct(e,"touchstart",c=>{u.current.x=c.touches[0].clientX,u.current.y=c.touches[0].clientY},!0),ct(e,"touchend",c=>{let s={x:c.changedTouches[0].clientX,y:c.changedTouches[0].clientY};if(!(Math.abs(s.x-u.current.x)>=yo||Math.abs(s.y-u.current.y)>=yo))return o(c,()=>ut(c.target)?c.target:null)},!0),ha(e,"blur",c=>o(c,()=>Tl(window.document.activeElement)?window.document.activeElement:null),!0)}function Wn(...e){return h.useMemo(()=>St(...e),[...e])}var ga=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(ga||{});const Vt={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},va=200,Eo=5;function ba(e,{trigger:t,action:n,close:r,select:o}){let i=h.useRef(null),u=h.useRef(null),c=h.useRef(null);ct(e&&t!==null,"pointerdown",s=>{$n(s==null?void 0:s.target)&&t!=null&&t.contains(s.target)&&(u.current=s.x,c.current=s.y,i.current=s.timeStamp)}),ct(e&&t!==null,"pointerup",s=>{var l,a;let d=i.current;if(d===null||(i.current=null,!ut(s.target))||Math.abs(s.x-((l=u.current)!=null?l:s.x))<Eo&&Math.abs(s.y-((a=c.current)!=null?a:s.y))<Eo)return;let f=n(s);switch(f.kind){case 0:return;case 1:{s.timeStamp-d>va&&(o(f.target),r());break}case 2:{r();break}}},{capture:!0})}function ya(e,t){return h.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 Ea(e){return h.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function wa(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 u=t[o].call(n,...i);u&&(n=u,r.forEach(c=>c()))}}}function xa(){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 Ca(){return vo()?{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 c=Le();c.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>c.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,u=null;t.addEventListener(e,"click",c=>{if(ut(c.target))try{let s=c.target.closest("a");if(!s)return;let{hash:l}=new URL(s.href),a=e.querySelector(l);ut(a)&&!r(a)&&(u=a)}catch{}},!0),t.addEventListener(e,"touchstart",c=>{if(ut(c.target)&&Ol(c.target))if(r(c.target)){let s=c.target;for(;s.parentElement&&r(s.parentElement);)s=s.parentElement;t.style(s,"overscrollBehavior","contain")}else t.style(c.target,"touchAction","none")}),t.addEventListener(e,"touchmove",c=>{if(ut(c.target)){if(Gr(c.target))return;if(r(c.target)){let s=c.target;for(;s.parentElement&&s.dataset.headlessuiPortal!==""&&!(s.scrollHeight>s.clientHeight||s.scrollWidth>s.clientWidth);)s=s.parentElement;s.dataset.headlessuiPortal===""&&c.preventDefault()}else c.preventDefault()}},{passive:!1}),t.add(()=>{var c;let s=(c=window.scrollY)!=null?c:window.pageYOffset;i!==s&&window.scrollTo(0,i),u&&u.isConnected&&(u.scrollIntoView({block:"nearest"}),u=null)})})}}:{}}function Sa(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Oa(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let nt=wa(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Le(),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:Oa(n)},o=[Ca(),xa(),Sa()];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)}});nt.subscribe(()=>{let e=nt.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)&&nt.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&nt.dispatch("TEARDOWN",n)}});function Ta(e,t,n=()=>({containers:[]})){let r=Ea(nt),o=t?r.get(t):void 0,i=o?o.count>0:!1;return ue(()=>{if(!(!t||!e))return nt.dispatch("PUSH",t,n),()=>nt.dispatch("POP",t,n)},[e,t]),i}function $a(e,t,n=()=>[document.body]){let r=co(e,"scroll-lock");Ta(r,t,o=>{var i;return{containers:[...(i=o.containers)!=null?i:[],n]}})}function wo(e){return[e.screenX,e.screenY]}function Pa(){let e=h.useRef([-1,-1]);return{wasMoved(t){let n=wo(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=wo(t)}}}function Aa(e=0){let[t,n]=h.useState(e),r=h.useCallback(s=>n(s),[t]),o=h.useCallback(s=>n(l=>l|s),[t]),i=h.useCallback(s=>(t&s)===s,[t]),u=h.useCallback(s=>n(l=>l&~s),[n]),c=h.useCallback(s=>n(l=>l^s),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:i,removeFlag:u,toggleFlag:c}}var xo,Co;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((xo=process==null?void 0:process.env)==null?void 0:xo.NODE_ENV)==="test"&&typeof((Co=Element==null?void 0:Element.prototype)==null?void 0:Co.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(`
75
- `)),[]});var Ma=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(Ma||{});function So(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function Oo(e,t,n,r){let[o,i]=h.useState(n),{hasFlag:u,addFlag:c,removeFlag:s}=Aa(e&&o?3:0),l=h.useRef(!1),a=h.useRef(!1),d=at();return ue(()=>{var f;if(e){if(n&&i(!0),!t){n&&c(3);return}return(f=r==null?void 0:r.start)==null||f.call(r,n),_a(t,{inFlight:l,prepare(){a.current?a.current=!1:a.current=l.current,l.current=!0,!a.current&&(n?(c(3),s(4)):(c(4),s(2)))},run(){a.current?n?(s(3),c(4)):(s(4),c(3)):n?s(1):c(1)},done(){var p;a.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(l.current=!1,s(7),n||i(!1),(p=r==null?void 0:r.end)==null||p.call(r,n))}})}},[e,n,t,d]),e?[o,{closed:u(1),enter:u(2),leave:u(4),transition:u(2)||u(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function _a(e,{prepare:t,run:n,done:r,inFlight:o}){let i=Le();return La(e,{prepare:t,inFlight:o}),i.nextFrame(()=>{n(),i.requestAnimationFrame(()=>{i.add(Da(e,r))})}),i.dispose}function Da(e,t){var n,r;let o=Le();if(!e)return o.dispose;let i=!1;o.add(()=>{i=!0});let u=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(c=>c instanceof CSSTransition))!=null?r:[];return u.length===0?(t(),o.dispose):(Promise.allSettled(u.map(c=>c.finished)).then(()=>{i||t()}),o.dispose)}function La(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function zt(){return typeof window<"u"}function ft(e){return To(e)?(e.nodeName||"").toLowerCase():"#document"}function Oe(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function je(e){var t;return(t=(To(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function To(e){return zt()?e instanceof Node||e instanceof Oe(e).Node:!1}function ve(e){return zt()?e instanceof Element||e instanceof Oe(e).Element:!1}function Re(e){return zt()?e instanceof HTMLElement||e instanceof Oe(e).HTMLElement:!1}function $o(e){return!zt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Oe(e).ShadowRoot}const Fa=new Set(["inline","contents"]);function Pt(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Fa.has(o)}const Ia=new Set(["table","td","th"]);function ka(e){return Ia.has(ft(e))}const Na=[":popover-open",":modal"];function Yt(e){return Na.some(t=>{try{return e.matches(t)}catch{return!1}})}const ja=["transform","translate","scale","rotate","perspective"],Ra=["transform","translate","scale","rotate","perspective","filter"],Wa=["paint","layout","strict","content"];function Bn(e){const t=Hn(),n=ve(e)?Fe(e):e;return ja.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)||Ra.some(r=>(n.willChange||"").includes(r))||Wa.some(r=>(n.contain||"").includes(r))}function Ba(e){let t=Qe(e);for(;Re(t)&&!dt(t);){if(Bn(t))return t;if(Yt(t))return null;t=Qe(t)}return null}function Hn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ha=new Set(["html","body","#document"]);function dt(e){return Ha.has(ft(e))}function Fe(e){return Oe(e).getComputedStyle(e)}function Gt(e){return ve(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Qe(e){if(ft(e)==="html")return e;const t=e.assignedSlot||e.parentNode||$o(e)&&e.host||je(e);return $o(t)?t.host:t}function Po(e){const t=Qe(e);return dt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Re(t)&&Pt(t)?t:Po(t)}function At(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Po(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),u=Oe(o);if(i){const c=Un(u);return t.concat(u,u.visualViewport||[],Pt(o)?o:[],c&&n?At(c):[])}return t.concat(o,At(o,[],n))}function Un(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ua(){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 rt=Math.min,be=Math.max,Mt=Math.round,qt=Math.floor,We=e=>({x:e,y:e}),Va={left:"right",right:"left",bottom:"top",top:"bottom"},za={start:"end",end:"start"};function Ao(e,t,n){return be(e,rt(t,n))}function pt(e,t){return typeof e=="function"?e(t):e}function Xe(e){return e.split("-")[0]}function _t(e){return e.split("-")[1]}function Mo(e){return e==="x"?"y":"x"}function _o(e){return e==="y"?"height":"width"}const Ya=new Set(["top","bottom"]);function ze(e){return Ya.has(Xe(e))?"y":"x"}function Do(e){return Mo(ze(e))}function Ga(e,t,n){n===void 0&&(n=!1);const r=_t(e),o=Do(e),i=_o(o);let u=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=Kt(u)),[u,Kt(u)]}function qa(e){const t=Kt(e);return[Vn(e),t,Vn(t)]}function Vn(e){return e.replace(/start|end/g,t=>za[t])}const Lo=["left","right"],Fo=["right","left"],Ka=["top","bottom"],Qa=["bottom","top"];function Xa(e,t,n){switch(e){case"top":case"bottom":return n?t?Fo:Lo:t?Lo:Fo;case"left":case"right":return t?Ka:Qa;default:return[]}}function Ja(e,t,n,r){const o=_t(e);let i=Xa(Xe(e),n==="start",r);return o&&(i=i.map(u=>u+"-"+o),t&&(i=i.concat(i.map(Vn)))),i}function Kt(e){return e.replace(/left|right|bottom|top/g,t=>Va[t])}function Za(e){return{top:0,right:0,bottom:0,left:0,...e}}function eu(e){return typeof e!="number"?Za(e):{top:e,right:e,bottom:e,left:e}}function Qt(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Io(e,t,n){let{reference:r,floating:o}=e;const i=ze(t),u=Do(t),c=_o(u),s=Xe(t),l=i==="y",a=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[c]/2-o[c]/2;let p;switch(s){case"top":p={x:a,y:r.y-o.height};break;case"bottom":p={x:a,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(_t(t)){case"start":p[u]-=f*(n&&l?-1:1);break;case"end":p[u]+=f*(n&&l?-1:1);break}return p}const tu=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,c=i.filter(Boolean),s=await(u.isRTL==null?void 0:u.isRTL(t));let l=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:d}=Io(l,r,s),f=r,p={},m=0;for(let v=0;v<c.length;v++){const{name:b,fn:x}=c[v],{x:w,y,data:S,reset:E}=await x({x:a,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:l,platform:u,elements:{reference:e,floating:t}});a=w??a,d=y??d,p={...p,[b]:{...p[b],...S}},E&&m<=50&&(m++,typeof E=="object"&&(E.placement&&(f=E.placement),E.rects&&(l=E.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):E.rects),{x:a,y:d}=Io(l,f,s)),v=-1)}return{x:a,y:d,placement:f,strategy:o,middlewareData:p}};async function Xt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:u,elements:c,strategy:s}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=pt(t,e),m=eu(p),b=c[f?d==="floating"?"reference":"floating":d],x=Qt(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:a,strategy:s})),w=d==="floating"?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),S=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},E=Qt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:y,strategy:s}):w);return{top:(x.top-E.top+m.top)/S.y,bottom:(E.bottom-x.bottom+m.bottom)/S.y,left:(x.left-E.left+m.left)/S.x,right:(E.right-x.right+m.right)/S.x}}const nu=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:c,platform:s,elements:l}=t,{mainAxis:a=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...b}=pt(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const x=Xe(o),w=ze(c),y=Xe(c)===c,S=await(s.isRTL==null?void 0:s.isRTL(l.floating)),E=f||(y||!v?[Kt(c)]:qa(c)),F=m!=="none";!f&&F&&E.push(...Ja(c,v,m,S));const j=[c,...E],K=await Xt(t,b),ee=[];let D=((r=i.flip)==null?void 0:r.overflows)||[];if(a&&ee.push(K[x]),d){const W=Ga(o,u,S);ee.push(K[W[0]],K[W[1]])}if(D=[...D,{placement:o,overflows:ee}],!ee.every(W=>W<=0)){var N,oe;const W=(((N=i.flip)==null?void 0:N.index)||0)+1,X=j[W];if(X&&(!(d==="alignment"?w!==ze(X):!1)||D.every(P=>ze(P.placement)===w?P.overflows[0]>0:!0)))return{data:{index:W,overflows:D},reset:{placement:X}};let G=(oe=D.filter(J=>J.overflows[0]<=0).sort((J,P)=>J.overflows[1]-P.overflows[1])[0])==null?void 0:oe.placement;if(!G)switch(p){case"bestFit":{var H;const J=(H=D.filter(P=>{if(F){const U=ze(P.placement);return U===w||U==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(U=>U>0).reduce((U,C)=>U+C,0)]).sort((P,U)=>P[1]-U[1])[0])==null?void 0:H[0];J&&(G=J);break}case"initialPlacement":G=c;break}if(o!==G)return{reset:{placement:G}}}return{}}}},ru=new Set(["left","top"]);async function ou(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),u=Xe(n),c=_t(n),s=ze(n)==="y",l=ru.has(u)?-1:1,a=i&&s?-1:1,d=pt(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),s?{x:p*a,y:f*l}:{x:f*l,y:p*a}}const iu=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:c}=t,s=await ou(t,e);return u===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:u}}}}},su=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:u=!1,limiter:c={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...s}=pt(e,t),l={x:n,y:r},a=await Xt(t,s),d=ze(Xe(o)),f=Mo(d);let p=l[f],m=l[d];if(i){const b=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=p+a[b],y=p-a[x];p=Ao(w,p,y)}if(u){const b=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=m+a[b],y=m-a[x];m=Ao(w,m,y)}const v=c.fn({...t,[f]:p,[d]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[d]:u}}}}}},lu=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:u,elements:c}=t,{apply:s=()=>{},...l}=pt(e,t),a=await Xt(t,l),d=Xe(o),f=_t(o),p=ze(o)==="y",{width:m,height:v}=i.floating;let b,x;d==="top"||d==="bottom"?(b=d,x=f===(await(u.isRTL==null?void 0:u.isRTL(c.floating))?"start":"end")?"left":"right"):(x=d,b=f==="end"?"top":"bottom");const w=v-a.top-a.bottom,y=m-a.left-a.right,S=rt(v-a[b],w),E=rt(m-a[x],y),F=!t.middlewareData.shift;let j=S,K=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(K=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(j=w),F&&!f){const D=be(a.left,0),N=be(a.right,0),oe=be(a.top,0),H=be(a.bottom,0);p?K=m-2*(D!==0||N!==0?D+N:be(a.left,a.right)):j=v-2*(oe!==0||H!==0?oe+H:be(a.top,a.bottom))}await s({...t,availableWidth:K,availableHeight:j});const ee=await u.getDimensions(c.floating);return m!==ee.width||v!==ee.height?{reset:{rects:!0}}:{}}}};function ko(e){const t=Fe(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Re(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,c=Mt(n)!==i||Mt(r)!==u;return c&&(n=i,r=u),{width:n,height:r,$:c}}function zn(e){return ve(e)?e:e.contextElement}function ht(e){const t=zn(e);if(!Re(t))return We(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ko(t);let u=(i?Mt(n.width):n.width)/r,c=(i?Mt(n.height):n.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!c||!Number.isFinite(c))&&(c=1),{x:u,y:c}}const au=We(0);function No(e){const t=Oe(e);return!Hn()||!t.visualViewport?au:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function uu(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Oe(e)?!1:t}function ot(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=zn(e);let u=We(1);t&&(r?ve(r)&&(u=ht(r)):u=ht(e));const c=uu(i,n,r)?No(i):We(0);let s=(o.left+c.x)/u.x,l=(o.top+c.y)/u.y,a=o.width/u.x,d=o.height/u.y;if(i){const f=Oe(i),p=r&&ve(r)?Oe(r):r;let m=f,v=Un(m);for(;v&&r&&p!==m;){const b=ht(v),x=v.getBoundingClientRect(),w=Fe(v),y=x.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,S=x.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;s*=b.x,l*=b.y,a*=b.x,d*=b.y,s+=y,l+=S,m=Oe(v),v=Un(m)}}return Qt({width:a,height:d,x:s,y:l})}function Jt(e,t){const n=Gt(e).scrollLeft;return t?t.left+n:ot(je(e)).left+n}function jo(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Jt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function cu(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",u=je(r),c=t?Yt(t.floating):!1;if(r===u||c&&i)return n;let s={scrollLeft:0,scrollTop:0},l=We(1);const a=We(0),d=Re(r);if((d||!d&&!i)&&((ft(r)!=="body"||Pt(u))&&(s=Gt(r)),Re(r))){const p=ot(r);l=ht(r),a.x=p.x+r.clientLeft,a.y=p.y+r.clientTop}const f=u&&!d&&!i?jo(u,s):We(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-s.scrollLeft*l.x+a.x+f.x,y:n.y*l.y-s.scrollTop*l.y+a.y+f.y}}function fu(e){return Array.from(e.getClientRects())}function du(e){const t=je(e),n=Gt(e),r=e.ownerDocument.body,o=be(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=be(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+Jt(e);const c=-n.scrollTop;return Fe(r).direction==="rtl"&&(u+=be(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:c}}const Ro=25;function pu(e,t){const n=Oe(e),r=je(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,c=0,s=0;if(o){i=o.width,u=o.height;const a=Hn();(!a||a&&t==="fixed")&&(c=o.offsetLeft,s=o.offsetTop)}const l=Jt(r);if(l<=0){const a=r.ownerDocument,d=a.body,f=getComputedStyle(d),p=a.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(r.clientWidth-d.clientWidth-p);m<=Ro&&(i-=m)}else l<=Ro&&(i+=l);return{width:i,height:u,x:c,y:s}}const hu=new Set(["absolute","fixed"]);function mu(e,t){const n=ot(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Re(e)?ht(e):We(1),u=e.clientWidth*i.x,c=e.clientHeight*i.y,s=o*i.x,l=r*i.y;return{width:u,height:c,x:s,y:l}}function Wo(e,t,n){let r;if(t==="viewport")r=pu(e,n);else if(t==="document")r=du(je(e));else if(ve(t))r=mu(t,n);else{const o=No(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Qt(r)}function Bo(e,t){const n=Qe(e);return n===t||!ve(n)||dt(n)?!1:Fe(n).position==="fixed"||Bo(n,t)}function gu(e,t){const n=t.get(e);if(n)return n;let r=At(e,[],!1).filter(c=>ve(c)&&ft(c)!=="body"),o=null;const i=Fe(e).position==="fixed";let u=i?Qe(e):e;for(;ve(u)&&!dt(u);){const c=Fe(u),s=Bn(u);!s&&c.position==="fixed"&&(o=null),(i?!s&&!o:!s&&c.position==="static"&&!!o&&hu.has(o.position)||Pt(u)&&!s&&Bo(e,u))?r=r.filter(a=>a!==u):o=c,u=Qe(u)}return t.set(e,r),r}function vu(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const u=[...n==="clippingAncestors"?Yt(t)?[]:gu(t,this._c):[].concat(n),r],c=u[0],s=u.reduce((l,a)=>{const d=Wo(t,a,o);return l.top=be(d.top,l.top),l.right=rt(d.right,l.right),l.bottom=rt(d.bottom,l.bottom),l.left=be(d.left,l.left),l},Wo(t,c,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}}function bu(e){const{width:t,height:n}=ko(e);return{width:t,height:n}}function yu(e,t,n){const r=Re(t),o=je(t),i=n==="fixed",u=ot(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const s=We(0);function l(){s.x=Jt(o)}if(r||!r&&!i)if((ft(t)!=="body"||Pt(o))&&(c=Gt(t)),r){const p=ot(t,!0,i,t);s.x=p.x+t.clientLeft,s.y=p.y+t.clientTop}else o&&l();i&&!r&&o&&l();const a=o&&!r&&!i?jo(o,c):We(0),d=u.left+c.scrollLeft-s.x-a.x,f=u.top+c.scrollTop-s.y-a.y;return{x:d,y:f,width:u.width,height:u.height}}function Yn(e){return Fe(e).position==="static"}function Ho(e,t){if(!Re(e)||Fe(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return je(e)===n&&(n=n.ownerDocument.body),n}function Uo(e,t){const n=Oe(e);if(Yt(e))return n;if(!Re(e)){let o=Qe(e);for(;o&&!dt(o);){if(ve(o)&&!Yn(o))return o;o=Qe(o)}return n}let r=Ho(e,t);for(;r&&ka(r)&&Yn(r);)r=Ho(r,t);return r&&dt(r)&&Yn(r)&&!Bn(r)?n:r||Ba(e)||n}const Eu=async function(e){const t=this.getOffsetParent||Uo,n=this.getDimensions,r=await n(e.floating);return{reference:yu(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function wu(e){return Fe(e).direction==="rtl"}const xu={convertOffsetParentRelativeRectToViewportRelativeRect:cu,getDocumentElement:je,getClippingRect:vu,getOffsetParent:Uo,getElementRects:Eu,getClientRects:fu,getDimensions:bu,getScale:ht,isElement:ve,isRTL:wu};function Vo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Cu(e,t){let n=null,r;const o=je(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function u(c,s){c===void 0&&(c=!1),s===void 0&&(s=1),i();const l=e.getBoundingClientRect(),{left:a,top:d,width:f,height:p}=l;if(c||t(),!f||!p)return;const m=qt(d),v=qt(o.clientWidth-(a+f)),b=qt(o.clientHeight-(d+p)),x=qt(a),y={rootMargin:-m+"px "+-v+"px "+-b+"px "+-x+"px",threshold:be(0,rt(1,s))||1};let S=!0;function E(F){const j=F[0].intersectionRatio;if(j!==s){if(!S)return u();j?u(!1,j):r=setTimeout(()=>{u(!1,1e-7)},1e3)}j===1&&!Vo(l,e.getBoundingClientRect())&&u(),S=!1}try{n=new IntersectionObserver(E,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(E,y)}n.observe(e)}return u(!0),i}function Su(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:s=!1}=r,l=zn(e),a=o||i?[...l?At(l):[],...At(t)]:[];a.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const d=l&&c?Cu(l,n):null;let f=-1,p=null;u&&(p=new ResizeObserver(x=>{let[w]=x;w&&w.target===l&&p&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var y;(y=p)==null||y.observe(t)})),n()}),l&&!s&&p.observe(l),p.observe(t));let m,v=s?ot(e):null;s&&b();function b(){const x=ot(e);v&&!Vo(v,x)&&n(),v=x,m=requestAnimationFrame(b)}return n(),()=>{var x;a.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),d==null||d(),(x=p)==null||x.disconnect(),p=null,s&&cancelAnimationFrame(m)}}const Gn=Xt,Ou=iu,Tu=su,$u=nu,Pu=lu,Au=(e,t,n)=>{const r=new Map,o={platform:xu,...n},i={...o.platform,_c:r};return tu(e,t,{...o,platform:i})};var Mu=typeof document<"u",_u=function(){},Zt=Mu?h.useLayoutEffect:_u;function en(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(!en(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)&&!en(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function zo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yo(e,t){const n=zo(e);return Math.round(t*n)/n}function qn(e){const t=L.useRef(e);return Zt(()=>{t.current=e}),t}function Du(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:u}={},transform:c=!0,whileElementsMounted:s,open:l}=e,[a,d]=L.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=L.useState(r);en(f,r)||p(r);const[m,v]=L.useState(null),[b,x]=L.useState(null),w=L.useCallback(P=>{P!==F.current&&(F.current=P,v(P))},[]),y=L.useCallback(P=>{P!==j.current&&(j.current=P,x(P))},[]),S=i||m,E=u||b,F=L.useRef(null),j=L.useRef(null),K=L.useRef(a),ee=s!=null,D=qn(s),N=qn(o),oe=qn(l),H=L.useCallback(()=>{if(!F.current||!j.current)return;const P={placement:t,strategy:n,middleware:f};N.current&&(P.platform=N.current),Au(F.current,j.current,P).then(U=>{const C={...U,isPositioned:oe.current!==!1};W.current&&!en(K.current,C)&&(K.current=C,It.flushSync(()=>{d(C)}))})},[f,t,n,N,oe]);Zt(()=>{l===!1&&K.current.isPositioned&&(K.current.isPositioned=!1,d(P=>({...P,isPositioned:!1})))},[l]);const W=L.useRef(!1);Zt(()=>(W.current=!0,()=>{W.current=!1}),[]),Zt(()=>{if(S&&(F.current=S),E&&(j.current=E),S&&E){if(D.current)return D.current(S,E,H);H()}},[S,E,H,D,ee]);const X=L.useMemo(()=>({reference:F,floating:j,setReference:w,setFloating:y}),[w,y]),G=L.useMemo(()=>({reference:S,floating:E}),[S,E]),J=L.useMemo(()=>{const P={position:n,left:0,top:0};if(!G.floating)return P;const U=Yo(G.floating,a.x),C=Yo(G.floating,a.y);return c?{...P,transform:"translate("+U+"px, "+C+"px)",...zo(G.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:U,top:C}},[n,c,G.floating,a.x,a.y]);return L.useMemo(()=>({...a,update:H,refs:X,elements:G,floatingStyles:J}),[a,H,X,G,J])}const Go=(e,t)=>({...Ou(e),options:[e,t]}),Lu=(e,t)=>({...Tu(e),options:[e,t]}),Fu=(e,t)=>({...$u(e),options:[e,t]}),Iu=(e,t)=>({...Pu(e),options:[e,t]}),qo={...L},ku=qo.useInsertionEffect||(e=>e());function Ko(e){const t=L.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return ku(()=>{t.current=e}),L.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 Kn=typeof document<"u"?h.useLayoutEffect:h.useEffect;let Qo=!1,Nu=0;const Xo=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Nu++;function ju(){const[e,t]=L.useState(()=>Qo?Xo():void 0);return Kn(()=>{e==null&&t(Xo())},[]),L.useEffect(()=>{Qo=!0},[]),e}const Ru=qo.useId||ju;let Dt;process.env.NODE_ENV!=="production"&&(Dt=new Set);function Wu(){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=Dt)!=null&&e.has(o))){var i;(i=Dt)==null||i.add(o),console.warn(o)}}function Bu(){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=Dt)!=null&&e.has(o))){var i;(i=Dt)==null||i.add(o),console.error(o)}}function Hu(){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 Uu=L.createContext(null),Vu=L.createContext(null),zu=()=>{var e;return((e=L.useContext(Uu))==null?void 0:e.id)||null},Yu=()=>L.useContext(Vu),Gu="data-floating-ui-focusable";function qu(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=Ru(),i=L.useRef({}),[u]=L.useState(()=>Hu()),c=zu()!=null;if(process.env.NODE_ENV!=="production"){const p=r.reference;p&&!ve(p)&&Bu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,l]=L.useState(r.reference),a=Ko((p,m,v)=>{i.current.openEvent=p?m:void 0,u.emit("openchange",{open:p,event:m,reason:v,nested:c}),n==null||n(p,m,v)}),d=L.useMemo(()=>({setPositionReference:l}),[]),f=L.useMemo(()=>({reference:s||r.reference||null,floating:r.floating||null,domReference:r.reference}),[s,r.reference,r.floating]);return L.useMemo(()=>({dataRef:i,open:t,onOpenChange:a,elements:f,events:u,floatingId:o,refs:d}),[t,a,f,u,o,d])}function Ku(e){e===void 0&&(e={});const{nodeId:t}=e,n=qu({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,u]=L.useState(null),[c,s]=L.useState(null),a=(o==null?void 0:o.domReference)||i,d=L.useRef(null),f=Yu();Kn(()=>{a&&(d.current=a)},[a]);const p=Du({...e,elements:{...o,...c&&{reference:c}}}),m=L.useCallback(y=>{const S=ve(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;s(S),p.refs.setReference(S)},[p.refs]),v=L.useCallback(y=>{(ve(y)||y===null)&&(d.current=y,u(y)),(ve(p.refs.reference.current)||p.refs.reference.current===null||y!==null&&!ve(y))&&p.refs.setReference(y)},[p.refs]),b=L.useMemo(()=>({...p.refs,setReference:v,setPositionReference:m,domReference:d}),[p.refs,v,m]),x=L.useMemo(()=>({...p.elements,domReference:a}),[p.elements,a]),w=L.useMemo(()=>({...p,...r,refs:b,elements:x,nodeId:t}),[p,b,x,t,r]);return Kn(()=>{r.dataRef.current.floatingContext=w;const y=f==null?void 0:f.nodesRef.current.find(S=>S.id===t);y&&(y.context=w)}),L.useMemo(()=>({...p,context:w,refs:b,elements:x}),[p,b,x,w])}const Jo="active",Zo="selected";function Qn(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Jo]:u,[Zo]:c,...s}=e;i=s}return{...n==="floating"&&{tabIndex:-1,[Gu]:""},...i,...t.map(u=>{const c=u?u[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((u,c)=>(c&&Object.entries(c).forEach(s=>{let[l,a]=s;if(!(o&&[Jo,Zo].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof a=="function"){var d;(d=r.get(l))==null||d.push(a),u[l]=function(){for(var f,p=arguments.length,m=new Array(p),v=0;v<p;v++)m[v]=arguments[v];return(f=r.get(l))==null?void 0:f.map(b=>b(...m)).find(b=>b!==void 0)}}}else u[l]=a}),u),{})}}function Qu(e){e===void 0&&(e=[]);const t=e.map(c=>c==null?void 0:c.reference),n=e.map(c=>c==null?void 0:c.floating),r=e.map(c=>c==null?void 0:c.item),o=L.useCallback(c=>Qn(c,e,"reference"),t),i=L.useCallback(c=>Qn(c,e,"floating"),n),u=L.useCallback(c=>Qn(c,e,"item"),r);return L.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:u}),[o,i,u])}function ei(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Xu=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:i=0,index:u=0,minItemsVisible:c=4,referenceOverflowThreshold:s=0,scrollRef:l,...a}=pt(e,t),{rects:d,elements:{floating:f}}=t,p=n.current[u],m=(l==null?void 0:l.current)||f,v=f.clientTop||m.clientTop,b=f.clientTop!==0,x=m.clientTop!==0,w=f===m;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||Wu('`placement` side must be "bottom" when using the `inner`',"middleware.")),!p)return{};const y={...t,...await Go(-p.offsetTop-f.clientTop-d.reference.height/2-p.offsetHeight/2-i).fn(t)},S=await Gn(ei(y,m.scrollHeight+v+f.clientTop),a),E=await Gn(y,{...a,elementContext:"reference"}),F=be(0,S.top),j=y.y+F,D=(m.scrollHeight>m.clientHeight?N=>N:Mt)(be(0,m.scrollHeight+(b&&w||x?v*2:0)-F-be(0,S.bottom)));if(m.style.maxHeight=D+"px",m.scrollTop=F,o){const N=m.offsetHeight<p.offsetHeight*rt(c,n.current.length)-1||E.top>=-s||E.bottom>=-s;It.flushSync(()=>o(N))}return r&&(r.current=await Gn(ei({...y,y:j},m.offsetHeight+v+f.clientTop),a)),{y:j}}});function Ju(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:i,scrollRef:u,onChange:c}=t,s=Ko(c),l=L.useRef(!1),a=L.useRef(null),d=L.useRef(null);L.useEffect(()=>{if(!o)return;function p(v){if(v.ctrlKey||!m||i.current==null)return;const b=v.deltaY,x=i.current.top>=-.5,w=i.current.bottom>=-.5,y=m.scrollHeight-m.clientHeight,S=b<0?-1:1,E=b<0?"max":"min";m.scrollHeight<=m.clientHeight||(!x&&b>0||!w&&b<0?(v.preventDefault(),It.flushSync(()=>{s(F=>F+Math[E](b,y*S))})):/firefox/i.test(Ua())&&(m.scrollTop+=b))}const m=(u==null?void 0:u.current)||r.floating;if(n&&m)return m.addEventListener("wheel",p),requestAnimationFrame(()=>{a.current=m.scrollTop,i.current!=null&&(d.current={...i.current})}),()=>{a.current=null,d.current=null,m.removeEventListener("wheel",p)}},[o,n,r.floating,i,u,s]);const f=L.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const p=(u==null?void 0:u.current)||r.floating;if(!(!i.current||!p||!l.current)){if(a.current!==null){const m=p.scrollTop-a.current;(i.current.bottom<-.5&&m<-1||i.current.top<-.5&&m>1)&&It.flushSync(()=>s(v=>v+m))}requestAnimationFrame(()=>{a.current=p.scrollTop})}}}),[r.floating,s,i,u]);return L.useMemo(()=>o?{floating:f}:{},[o,f])}let mt=h.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});mt.displayName="FloatingContext";let Xn=h.createContext(null);Xn.displayName="PlacementContext";function Zu(e){return h.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function ec(){return h.useContext(mt).setReference}function tc(){return h.useContext(mt).getReferenceProps}function nc(){let{getFloatingProps:e,slot:t}=h.useContext(mt);return h.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function rc(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=h.useContext(Xn),n=h.useMemo(()=>e,[JSON.stringify(e,(o,i)=>{var u;return(u=i==null?void 0:i.outerHTML)!=null?u:i})]);ue(()=>{t==null||t(n??null)},[t,n]);let r=h.useContext(mt);return h.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let ti=4;function oc({children:e,enabled:t=!0}){let[n,r]=h.useState(null),[o,i]=h.useState(0),u=h.useRef(null),[c,s]=h.useState(null);ic(c);let l=t&&n!==null&&c!==null,{to:a="bottom",gap:d=0,offset:f=0,padding:p=0,inner:m}=sc(n,c),[v,b="center"]=a.split(" ");ue(()=>{l&&i(0)},[l]);let{refs:x,floatingStyles:w,context:y}=Ku({open:l,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[Go({mainAxis:v==="selection"?0:d,crossAxis:f}),Lu({padding:p}),v!=="selection"&&Fu({padding:p}),v==="selection"&&m?Xu({...m,padding:p,overflowRef:u,offset:o,minItemsVisible:ti,referenceOverflowThreshold:p,onFallbackChange(N){var oe,H;if(!N)return;let W=y.elements.floating;if(!W)return;let X=parseFloat(getComputedStyle(W).scrollPaddingBottom)||0,G=Math.min(ti,W.childElementCount),J=0,P=0;for(let U of(H=(oe=y.elements.floating)==null?void 0:oe.childNodes)!=null?H:[])if(Ve(U)){let C=U.offsetTop,A=C+U.clientHeight+X,k=W.scrollTop,I=k+W.clientHeight;if(C>=k&&A<=I)G--;else{P=Math.max(0,Math.min(A,I)-Math.max(C,k)),J=U.clientHeight;break}}G>=1&&i(U=>{let C=J*G-P+X;return U>=C?U:C})}}):null,Iu({padding:p,apply({availableWidth:N,availableHeight:oe,elements:H}){Object.assign(H.floating.style,{overflow:"auto",maxWidth:`${N}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${oe}px)`})}})].filter(Boolean),whileElementsMounted:Su}),[S=v,E=b]=y.placement.split("-");v==="selection"&&(S="selection");let F=h.useMemo(()=>({anchor:[S,E].filter(Boolean).join(" ")}),[S,E]),j=Ju(y,{overflowRef:u,onChange:i}),{getReferenceProps:K,getFloatingProps:ee}=Qu([j]),D=ne(N=>{s(N),x.setFloating(N)});return L.createElement(Xn.Provider,{value:r},L.createElement(mt.Provider,{value:{setFloating:D,setReference:x.setReference,styles:w,getReferenceProps:K,getFloatingProps:ee,slot:F}},e))}function ic(e){ue(()=>{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 sc(e,t){var n,r,o;let i=Jn((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),u=Jn((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),c=Jn((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:u,padding:c}}function Jn(e,t,n=void 0){let r=at(),o=ne((s,l)=>{if(s==null)return[n,null];if(typeof s=="number")return[s,null];if(typeof s=="string"){if(!l)return[n,null];let a=ri(s,l);return[a,d=>{let f=ni(s);{let p=f.map(m=>window.getComputedStyle(l).getPropertyValue(m));r.requestAnimationFrame(function m(){r.nextFrame(m);let v=!1;for(let[x,w]of f.entries()){let y=window.getComputedStyle(l).getPropertyValue(w);if(p[x]!==y){p[x]=y,v=!0;break}}if(!v)return;let b=ri(s,l);a!==b&&(d(b),a=b)})}return r.dispose}]}return[n,null]}),i=h.useMemo(()=>o(e,t)[0],[e,t]),[u=i,c]=h.useState();return ue(()=>{let[s,l]=o(e,t);if(c(s),!!l)return l(c)},[e,t]),u}function ni(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,...ni(o)]:[r]}return[]}function ri(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 lc(e,t){let[n,r]=h.useState(t);return!e&&n!==t&&r(t),e?n:t}let Zn=h.createContext(null);Zn.displayName="OpenClosedContext";var Ie=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ie||{});function er(){return h.useContext(Zn)}function oi({value:e,children:t}){return h.createElement(Zn.Provider,{value:e},t)}function ac(e){throw new Error("Unexpected object: "+e)}var ce=(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))(ce||{});function tn(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:ac(e)}}var ii=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(ii||{});function si(e){let t=ne(e),n=h.useRef(!1);h.useEffect(()=>(n.current=!1,()=>{n.current=!0,Rr(()=>{n.current&&t()})}),[t])}function uc(){let e=typeof document>"u";return"useSyncExternalStore"in L?(t=>t.useSyncExternalStore)(L)(()=>()=>{},()=>!1,()=>!e):!1}function tr(){let e=uc(),[t,n]=L.useState(ke.isHandoffComplete);return t&&ke.isHandoffComplete===!1&&n(!1),L.useEffect(()=>{t!==!0&&n(!0)},[t]),L.useEffect(()=>ke.handoff(),[]),e?!1:t}let cc=h.createContext(!1);function fc(){return h.useContext(cc)}function dc(e){let t=fc(),n=h.useContext(ai),[r,o]=h.useState(()=>{var i;if(!t&&n!==null)return(i=n.current)!=null?i:null;if(ke.isServer)return null;let u=e==null?void 0:e.getElementById("headlessui-portal-root");if(u)return u;if(e===null)return null;let c=e.createElement("div");return c.setAttribute("id","headlessui-portal-root"),e.body.appendChild(c)});return h.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),h.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let li=h.Fragment,pc=xe(function(e,t){let{ownerDocument:n=null,...r}=e,o=h.useRef(null),i=Pe(_l(p=>{o.current=p}),t),u=Wn(o),c=n??u,s=dc(c),[l]=h.useState(()=>{var p;return ke.isServer?null:(p=c==null?void 0:c.createElement("div"))!=null?p:null}),a=h.useContext(vc),d=tr();ue(()=>{!s||!l||s.contains(l)||(l.setAttribute("data-headlessui-portal",""),s.appendChild(l))},[s,l]),ue(()=>{if(l&&a)return a.register(l)},[a,l]),si(()=>{var p;!s||!l||($n(l)&&s.contains(l)&&s.removeChild(l),s.childNodes.length<=0&&((p=s.parentElement)==null||p.removeChild(s)))});let f=Se();return d?!s||!l?null:we.createPortal(f({ourProps:{ref:i},theirProps:r,slot:{},defaultTag:li,name:"Portal"}),l):null});function hc(e,t){let n=Pe(t),{enabled:r=!0,ownerDocument:o,...i}=e,u=Se();return r?h.createElement(pc,{...i,ownerDocument:o,ref:n}):u({ourProps:{ref:n},theirProps:i,slot:{},defaultTag:li,name:"Portal"})}let mc=h.Fragment,ai=h.createContext(null);function gc(e,t){let{target:n,...r}=e,o={ref:Pe(t)},i=Se();return h.createElement(ai.Provider,{value:n},i({ourProps:o,theirProps:r,defaultTag:mc,name:"Popover.Group"}))}let vc=h.createContext(null),bc=xe(hc),yc=xe(gc),Ec=Object.assign(bc,{Group:yc});function wc(){let e=h.useRef(!1);return ue(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function ui(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:fi)!==h.Fragment||h.Children.count(e.children)===1}let nn=h.createContext(null);nn.displayName="TransitionContext";var xc=(e=>(e.Visible="visible",e.Hidden="hidden",e))(xc||{});function Cc(){let e=h.useContext(nn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Sc(){let e=h.useContext(rn);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let rn=h.createContext(null);rn.displayName="NestingContext";function on(e){return"children"in e?on(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function ci(e,t){let n=tt(e),r=h.useRef([]),o=wc(),i=at(),u=ne((p,m=qe.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===p);v!==-1&&($e(m,{[qe.Unmount](){r.current.splice(v,1)},[qe.Hidden](){r.current[v].state="hidden"}}),i.microTask(()=>{var b;!on(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),c=ne(p=>{let m=r.current.find(({el:v})=>v===p);return m?m.state!=="visible"&&(m.state="visible"):r.current.push({el:p,state:"visible"}),()=>u(p,qe.Unmount)}),s=h.useRef([]),l=h.useRef(Promise.resolve()),a=h.useRef({enter:[],leave:[]}),d=ne((p,m,v)=>{s.current.splice(0),t&&(t.chains.current[m]=t.chains.current[m].filter(([b])=>b!==p)),t==null||t.chains.current[m].push([p,new Promise(b=>{s.current.push(b)})]),t==null||t.chains.current[m].push([p,new Promise(b=>{Promise.all(a.current[m].map(([x,w])=>w)).then(()=>b())})]),m==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(m)):v(m)}),f=ne((p,m,v)=>{Promise.all(a.current[m].splice(0).map(([b,x])=>x)).then(()=>{var b;(b=s.current.shift())==null||b()}).then(()=>v(m))});return h.useMemo(()=>({children:r,register:c,unregister:u,onStart:d,onStop:f,wait:l,chains:a}),[c,u,r,d,f,a,l])}let fi=h.Fragment,di=Wt.RenderStrategy;function Oc(e,t){var n,r;let{transition:o=!0,beforeEnter:i,afterEnter:u,beforeLeave:c,afterLeave:s,enter:l,enterFrom:a,enterTo:d,entered:f,leave:p,leaveFrom:m,leaveTo:v,...b}=e,[x,w]=h.useState(null),y=h.useRef(null),S=ui(e),E=Pe(...S?[y,t,w]:t===null?[]:[t]),F=(n=b.unmount)==null||n?qe.Unmount:qe.Hidden,{show:j,appear:K,initial:ee}=Cc(),[D,N]=h.useState(j?"visible":"hidden"),oe=Sc(),{register:H,unregister:W}=oe;ue(()=>H(y),[H,y]),ue(()=>{if(F===qe.Hidden&&y.current){if(j&&D!=="visible"){N("visible");return}return $e(D,{hidden:()=>W(y),visible:()=>H(y)})}},[D,y,H,W,j,F]);let X=tr();ue(()=>{if(S&&X&&D==="visible"&&y.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,D,X,S]);let G=ee&&!K,J=K&&j&&ee,P=h.useRef(!1),U=ci(()=>{P.current||(N("hidden"),W(y))},oe),C=ne($=>{P.current=!0;let R=$?"enter":"leave";U.onStart(y,R,V=>{V==="enter"?i==null||i():V==="leave"&&(c==null||c())})}),A=ne($=>{let R=$?"enter":"leave";P.current=!1,U.onStop(y,R,V=>{V==="enter"?u==null||u():V==="leave"&&(s==null||s())}),R==="leave"&&!on(U)&&(N("hidden"),W(y))});h.useEffect(()=>{S&&o||(C(j),A(j))},[j,S,o]);let k=!(!o||!S||!X||G),[,I]=Oo(k,x,j,{start:C,end:A}),B=Ke({ref:E,className:((r=Sn(b.className,J&&l,J&&a,I.enter&&l,I.enter&&I.closed&&a,I.enter&&!I.closed&&d,I.leave&&p,I.leave&&!I.closed&&m,I.leave&&I.closed&&v,!I.transition&&j&&f))==null?void 0:r.trim())||void 0,...So(I)}),q=0;D==="visible"&&(q|=Ie.Open),D==="hidden"&&(q|=Ie.Closed),j&&D==="hidden"&&(q|=Ie.Opening),!j&&D==="visible"&&(q|=Ie.Closing);let Y=Se();return h.createElement(rn.Provider,{value:U},h.createElement(oi,{value:q},Y({ourProps:B,theirProps:b,defaultTag:fi,features:di,visible:D==="visible",name:"Transition.Child"})))}function Tc(e,t){let{show:n,appear:r=!1,unmount:o=!0,...i}=e,u=h.useRef(null),c=ui(e),s=Pe(...c?[u,t]:t===null?[]:[t]);tr();let l=er();if(n===void 0&&l!==null&&(n=(l&Ie.Open)===Ie.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[a,d]=h.useState(n?"visible":"hidden"),f=ci(()=>{n||d("hidden")}),[p,m]=h.useState(!0),v=h.useRef([n]);ue(()=>{p!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),m(!1))},[v,n]);let b=h.useMemo(()=>({show:n,appear:r,initial:p}),[n,r,p]);ue(()=>{n?d("visible"):!on(f)&&u.current!==null&&d("hidden")},[n,f]);let x={unmount:o},w=ne(()=>{var E;p&&m(!1),(E=e.beforeEnter)==null||E.call(e)}),y=ne(()=>{var E;p&&m(!1),(E=e.beforeLeave)==null||E.call(e)}),S=Se();return h.createElement(rn.Provider,{value:f},h.createElement(nn.Provider,{value:b},S({ourProps:{...x,as:h.Fragment,children:h.createElement(pi,{ref:s,...x,...i,beforeEnter:w,beforeLeave:y})},theirProps:{},defaultTag:h.Fragment,features:di,visible:a==="visible",name:"Transition"})))}function $c(e,t){let n=h.useContext(nn)!==null,r=er()!==null;return h.createElement(h.Fragment,null,!n&&r?h.createElement(nr,{ref:t,...e}):h.createElement(pi,{ref:t,...e}))}let nr=xe(Tc),pi=xe(Oc),Pc=xe($c),hi=Object.assign(nr,{Child:Pc,Root:nr});function Ac(e,t){let n=h.useRef({left:0,top:0});if(ue(()=>{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 mi=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function gi(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!Ve(o))return r;let i=!1;for(let c of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))c.remove(),i=!0;let u=i?(n=o.innerText)!=null?n:"":r;return mi.test(u)&&(u=u.replace(mi,"")),u}function Mc(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 u=i.getAttribute("aria-label");return typeof u=="string"?u.trim():gi(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return gi(e).trim()}function _c(e){let t=h.useRef(""),n=h.useRef("");return ne(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let i=Mc(r).trim().toLowerCase();return t.current=o,n.current=i,i})}var Dc=Object.defineProperty,Lc=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,vi=(e,t,n)=>(Lc(e,typeof t!="symbol"?t+"":t,n),n),ge=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ge||{}),Be=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Be||{}),sn=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(sn||{}),bi=(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.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(bi||{});function yi(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=go(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 Fc={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:ce.Nothing},listboxState:1,__demoMode:!1}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(i=>r(i.dataRef.current.value));return o!==-1&&(n=o),{...e,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1}},2(e,t){var n,r,o,i,u;if(e.dataRef.current.disabled||e.listboxState===1)return e;let c={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===ce.Nothing)return{...c,activeOptionIndex:null};if(t.focus===ce.Specific)return{...c,activeOptionIndex:e.options.findIndex(a=>a.id===t.id)};if(t.focus===ce.Previous){let a=e.activeOptionIndex;if(a!==null){let d=e.options[a].dataRef.current.domRef,f=tn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(f!==null){let p=e.options[f].dataRef.current.domRef;if(((r=d.current)==null?void 0:r.previousElementSibling)===p.current||((o=p.current)==null?void 0:o.previousElementSibling)===null)return{...c,activeOptionIndex:f}}}}else if(t.focus===ce.Next){let a=e.activeOptionIndex;if(a!==null){let d=e.options[a].dataRef.current.domRef,f=tn(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:p=>p.id,resolveDisabled:p=>p.dataRef.current.disabled});if(f!==null){let p=e.options[f].dataRef.current.domRef;if(((i=d.current)==null?void 0:i.nextElementSibling)===p.current||((u=p.current)==null?void 0:u.nextElementSibling)===null)return{...c,activeOptionIndex:f}}}}let s=yi(e),l=tn(t,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...c,...s,activeOptionIndex:l}},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(u=>{var c;return!u.dataRef.current.disabled&&((c=u.dataRef.current.textValue)==null?void 0:c.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=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==ce.Nothing&&(r=tn(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let i=n.findIndex(u=>o==null?void 0:o(u.dataRef.current.value));i!==-1&&(r=i)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:ce.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[i,u]of n.entries())if(o.has(u.id)&&(r.push(i),o.delete(u.id),o.size===0))break;if(r.length>0){n=n.slice();for(let i of r.reverse())n.splice(i,1)}return{...e,options: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},9:e=>e.pendingShouldSort?{...e,...yi(e),pendingShouldSort:!1}:e};class rr extends ro{constructor(t){super(t),vi(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:i,value:u}=this.state.dataRef.current;return $e(i,{0:()=>r==null?void 0:r(n),1:()=>{let c=u.slice(),s=c.findIndex(l=>o(l,n));return s===-1?c.push(n):c.splice(s,1),r==null?void 0:r(c)}})},registerOption:_n(()=>{let n=[],r=new Set;return[(o,i)=>{r.has(i)||(r.add(i),n.push({id:o,dataRef:i}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:_n(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:_n(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:n,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(n.current.value),this.send({type:2,focus:ce.Specific,id:r})}},selectOption:n=>{let r=this.state.options.find(o=>o.id===n);r&&this.actions.onChange(r.dataRef.current.value)},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:7,element:n})},setOptionsElement:n=>{this.send({type:8,element:n})}}),vi(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,i=n.options;return o===null||(r=i[o])==null?void 0:r.id},isActive(n,r){var o;let i=n.activeOptionIndex,u=n.options;return i!==null?((o=u[i])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=Dn.get(null);this.disposables.add(r.on(lo.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:t,__demoMode:n=!1}){return new rr({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:ce.Nothing},__demoMode:n})}reduce(t,n){return $e(n.type,Fc,t,n)}}const Ei=h.createContext(null);function or(e){let t=h.useContext(Ei);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,wi),n}return t}function wi({id:e,__demoMode:t=!1}){let n=h.useMemo(()=>rr.new({id:e,__demoMode:t}),[]);return si(()=>n.dispose()),n}let ln=h.createContext(null);ln.displayName="ListboxDataContext";function Lt(e){let t=h.useContext(ln);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Lt),n}return t}let Ic=h.Fragment;function kc(e,t){let n=h.useId(),r=Cn(),{value:o,defaultValue:i,form:u,name:c,onChange:s,by:l,invalid:a=!1,disabled:d=r||!1,horizontal:f=!1,multiple:p=!1,__demoMode:m=!1,...v}=e;const b=f?"horizontal":"vertical";let x=Pe(t),w=gl(i),[y=p?[]:void 0,S]=ml(o,s,w),E=wi({id:n,__demoMode:m}),F=h.useRef({static:!1,hold:!1}),j=h.useRef(new Map),K=Hl(l),ee=h.useCallback(k=>$e(D.mode,{[Be.Multi]:()=>y.some(I=>K(I,k)),[Be.Single]:()=>K(y,k)}),[y]),D=h.useMemo(()=>({value:y,disabled:d,invalid:a,mode:p?Be.Multi:Be.Single,orientation:b,onChange:S,compare:K,isSelected:ee,optionsPropsRef:F,listRef:j}),[y,d,a,p,b,S,K,ee,F,j]);ue(()=>{E.state.dataRef.current=D},[D]);let N=Me(E,k=>k.listboxState),oe=Dn.get(null),H=Me(oe,h.useCallback(k=>oe.selectors.isTop(k,n),[oe,n])),[W,X]=Me(E,k=>[k.buttonElement,k.optionsElement]);ma(H,[W,X],(k,I)=>{E.send({type:bi.CloseListbox}),mo(I,Rn.Loose)||(k.preventDefault(),W==null||W.focus())});let G=h.useMemo(()=>({open:N===ge.Open,disabled:d,invalid:a,value:y}),[N,d,a,y]),[J,P]=kl({inherit:!0}),U={ref:x},C=h.useCallback(()=>{if(w!==void 0)return S==null?void 0:S(w)},[S,w]),A=Se();return h.createElement(P,{value:J,props:{htmlFor:W==null?void 0:W.id},slot:{open:N===ge.Open,disabled:d}},h.createElement(oc,null,h.createElement(Ei.Provider,{value:E},h.createElement(ln.Provider,{value:D},h.createElement(oi,{value:$e(N,{[ge.Open]:Ie.Open,[ge.Closed]:Ie.Closed})},c!=null&&y!=null&&h.createElement(xl,{disabled:d,data:{[c]:y},form:u,onReset:C}),A({ourProps:U,theirProps:v,slot:G,defaultTag:Ic,name:"Listbox"}))))))}let Nc="button";function jc(e,t){let n=h.useId(),r=Yr(),o=Lt("Listbox.Button"),i=or("Listbox.Button"),{id:u=r||`headlessui-listbox-button-${n}`,disabled:c=o.disabled||!1,autoFocus:s=!1,...l}=e,a=Pe(t,ec(),i.actions.setButtonElement),d=tc(),[f,p,m]=Me(i,P=>[P.listboxState,P.buttonElement,P.optionsElement]),v=f===ge.Open;ba(v,{trigger:p,action:h.useCallback(P=>{if(p!=null&&p.contains(P.target))return Vt.Ignore;let U=P.target.closest('[role="option"]:not([data-disabled])');return Ve(U)?Vt.Select(U):m!=null&&m.contains(P.target)?Vt.Ignore:Vt.Close},[p,m]),close:i.actions.closeListbox,select:i.actions.selectActiveOption});let b=ne(P=>{switch(P.key){case me.Enter:vl(P.currentTarget);break;case me.Space:case me.ArrowDown:P.preventDefault(),i.actions.openListbox({focus:o.value?ce.Nothing:ce.First});break;case me.ArrowUp:P.preventDefault(),i.actions.openListbox({focus:o.value?ce.Nothing:ce.Last});break}}),x=ne(P=>{switch(P.key){case me.Space:P.preventDefault();break}}),w=ne(P=>{var U;if(P.button===ii.Left){if(Al(P.currentTarget))return P.preventDefault();i.state.listboxState===ge.Open?(we.flushSync(()=>i.actions.closeListbox()),(U=i.state.buttonElement)==null||U.focus({preventScroll:!0})):(P.preventDefault(),i.actions.openListbox({focus:ce.Nothing}))}}),y=h.useRef(null),S=ne(P=>{y.current=P.pointerType,P.pointerType==="mouse"&&w(P)}),E=ne(P=>{y.current!=="mouse"&&w(P)}),F=ne(P=>P.preventDefault()),j=Zr([u]),K=Dl(),{isFocusVisible:ee,focusProps:D}=rl({autoFocus:s}),{isHovered:N,hoverProps:oe}=nl({isDisabled:c}),{pressed:H,pressProps:W}=ul({disabled:c}),X=h.useMemo(()=>({open:f===ge.Open,active:H||f===ge.Open,disabled:c,invalid:o.invalid,value:o.value,hover:N,focus:ee,autofocus:s}),[f,o.value,c,N,ee,H,o.invalid,s]),G=Me(i,P=>P.listboxState===ge.Open),J=Br(d(),{ref:a,id:u,type:ya(e,p),"aria-haspopup":"listbox","aria-controls":m==null?void 0:m.id,"aria-expanded":G,"aria-labelledby":j,"aria-describedby":K,disabled:c||void 0,autoFocus:s,onKeyDown:b,onKeyUp:x,onKeyPress:F,onPointerDown:S,onClick:E},D,oe,W);return Se()({ourProps:J,theirProps:l,slot:X,defaultTag:Nc,name:"Listbox.Button"})}let xi=h.createContext(!1),Rc="div",Wc=Wt.RenderStrategy|Wt.Static;function Bc(e,t){let n=h.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:i=!1,modal:u=!0,transition:c=!1,...s}=e,l=Zu(o),[a,d]=h.useState(null);l&&(i=!0);let f=Lt("Listbox.Options"),p=or("Listbox.Options"),[m,v,b,x]=Me(p,$=>[$.listboxState,$.buttonElement,$.optionsElement,$.__demoMode]),w=Wn(v),y=Wn(b),S=er(),[E,F]=Oo(c,a,S!==null?(S&Ie.Open)===Ie.Open:m===ge.Open);ra(E,v,p.actions.closeListbox);let j=x?!1:u&&m===ge.Open;$a(j,y);let K=x?!1:u&&m===ge.Open;na(K,{allowed:h.useCallback(()=>[v,b],[v,b])});let ee=m!==ge.Open,D=Ac(ee,v)?!1:E,N=E&&m===ge.Closed,oe=lc(N,f.value),H=ne($=>f.compare(oe,$)),W=Me(p,$=>{var R;if(l==null||!((R=l==null?void 0:l.to)!=null&&R.includes("selection")))return null;let V=$.options.findIndex(Q=>H(Q.dataRef.current.value));return V===-1&&(V=0),V}),X=(()=>{if(l==null)return;if(W===null)return{...l,inner:void 0};let $=Array.from(f.listRef.current.values());return{...l,inner:{listRef:{current:$},index:W}}})(),[G,J]=rc(X),P=nc(),U=Pe(t,l?G:null,p.actions.setOptionsElement,d),C=at();h.useEffect(()=>{var $;let R=b;R&&m===ge.Open&&R!==(($=St(R))==null?void 0:$.activeElement)&&(R==null||R.focus({preventScroll:!0}))},[m,b]);let A=ne($=>{var R,V;switch(C.dispose(),$.key){case me.Space:if(p.state.searchQuery!=="")return $.preventDefault(),$.stopPropagation(),p.actions.search($.key);case me.Enter:if($.preventDefault(),$.stopPropagation(),p.state.activeOptionIndex!==null){let{dataRef:Q}=p.state.options[p.state.activeOptionIndex];p.actions.onChange(Q.current.value)}f.mode===Be.Single&&(we.flushSync(()=>p.actions.closeListbox()),(R=p.state.buttonElement)==null||R.focus({preventScroll:!0}));break;case $e(f.orientation,{vertical:me.ArrowDown,horizontal:me.ArrowRight}):return $.preventDefault(),$.stopPropagation(),p.actions.goToOption({focus:ce.Next});case $e(f.orientation,{vertical:me.ArrowUp,horizontal:me.ArrowLeft}):return $.preventDefault(),$.stopPropagation(),p.actions.goToOption({focus:ce.Previous});case me.Home:case me.PageUp:return $.preventDefault(),$.stopPropagation(),p.actions.goToOption({focus:ce.First});case me.End:case me.PageDown:return $.preventDefault(),$.stopPropagation(),p.actions.goToOption({focus:ce.Last});case me.Escape:$.preventDefault(),$.stopPropagation(),we.flushSync(()=>p.actions.closeListbox()),(V=p.state.buttonElement)==null||V.focus({preventScroll:!0});return;case me.Tab:$.preventDefault(),$.stopPropagation(),we.flushSync(()=>p.actions.closeListbox()),fa(p.state.buttonElement,$.shiftKey?jn.Previous:jn.Next);break;default:$.key.length===1&&(p.actions.search($.key),C.setTimeout(()=>p.actions.clearSearch(),350));break}}),k=Me(p,$=>{var R;return(R=$.buttonElement)==null?void 0:R.id}),I=h.useMemo(()=>({open:m===ge.Open}),[m]),B=Br(l?P():{},{id:r,ref:U,"aria-activedescendant":Me(p,p.selectors.activeDescendantId),"aria-multiselectable":f.mode===Be.Multi?!0:void 0,"aria-labelledby":k,"aria-orientation":f.orientation,onKeyDown:A,role:"listbox",tabIndex:m===ge.Open?0:void 0,style:{...s.style,...J,"--button-width":Vl(v,!0).width},...So(F)}),q=Se(),Y=h.useMemo(()=>f.mode===Be.Multi?f:{...f,isSelected:H},[f,H]);return h.createElement(Ec,{enabled:i?e.static||E:!1,ownerDocument:w},h.createElement(ln.Provider,{value:Y},q({ourProps:B,theirProps:s,slot:I,defaultTag:Rc,features:Wc,visible:D,name:"Listbox.Options"})))}let Hc="div";function Uc(e,t){let n=h.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:i,...u}=e,c=h.useContext(xi)===!0,s=Lt("Listbox.Option"),l=or("Listbox.Option"),a=Me(l,D=>l.selectors.isActive(D,r)),d=s.isSelected(i),f=h.useRef(null),p=_c(f),m=tt({disabled:o,value:i,domRef:f,get textValue(){return p()}}),v=Pe(t,f,D=>{D?s.listRef.current.set(r,D):s.listRef.current.delete(r)}),b=Me(l,D=>l.selectors.shouldScrollIntoView(D,r));ue(()=>{if(b)return Le().requestAnimationFrame(()=>{var D,N;(N=(D=f.current)==null?void 0:D.scrollIntoView)==null||N.call(D,{block:"nearest"})})},[b,f]),ue(()=>{if(!c)return l.actions.registerOption(r,m),()=>l.actions.unregisterOption(r)},[m,r,c]);let x=ne(D=>{var N;if(o)return D.preventDefault();l.actions.onChange(i),s.mode===Be.Single&&(we.flushSync(()=>l.actions.closeListbox()),(N=l.state.buttonElement)==null||N.focus({preventScroll:!0}))}),w=ne(()=>{if(o)return l.actions.goToOption({focus:ce.Nothing});l.actions.goToOption({focus:ce.Specific,id:r})}),y=Pa(),S=ne(D=>y.update(D)),E=ne(D=>{y.wasMoved(D)&&(o||a&&l.state.activationTrigger===sn.Pointer||l.actions.goToOption({focus:ce.Specific,id:r},sn.Pointer))}),F=ne(D=>{y.wasMoved(D)&&(o||a&&l.state.activationTrigger===sn.Pointer&&l.actions.goToOption({focus:ce.Nothing}))}),j=h.useMemo(()=>({active:a,focus:a,selected:d,disabled:o,selectedOption:d&&c}),[a,d,o,c]),K=c?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":d,disabled:void 0,onClick:x,onFocus:w,onPointerEnter:S,onMouseEnter:S,onPointerMove:E,onMouseMove:E,onPointerLeave:F,onMouseLeave:F},ee=Se();return!d&&c?null:ee({ourProps:K,theirProps:u,slot:j,defaultTag:Hc,name:"Listbox.Option"})}let Vc=h.Fragment;function zc(e,t){let{options:n,placeholder:r,...o}=e,i={ref:Pe(t)},u=Lt("ListboxSelectedOption"),c=h.useMemo(()=>({}),[]),s=u.value===void 0||u.value===null||u.mode===Be.Multi&&Array.isArray(u.value)&&u.value.length===0,l=Se();return h.createElement(xi.Provider,{value:!0},l({ourProps:i,theirProps:{...o,children:h.createElement(h.Fragment,null,r&&s?r:n)},slot:c,defaultTag:Vc,name:"ListboxSelectedOption"}))}let Yc=xe(kc),Gc=xe(jc),qc=Wl,Kc=xe(Bc),Qc=xe(Uc),Xc=xe(zc),Je=Object.assign(Yc,{Button:Gc,Label:qc,Options:Kc,Option:Qc,SelectedOption:Xc});function Jc({title:e,titleId:t,...n},r){return L.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?L.createElement("title",{id:t},e):null,L.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const Ci=L.forwardRef(Jc);function Zc({title:e,titleId:t,...n},r){return L.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?L.createElement("title",{id:t},e):null,L.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Si=L.forwardRef(Zc),ef=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o=""})=>O.jsx("div",{className:`relative ${o}`,children:O.jsx(Je,{value:t,onChange:n,disabled:r,children:({open:i})=>O.jsxs(O.Fragment,{children:[O.jsxs(Je.Button,{className:`
74
+ */var Qr;function Nl(){return Qr||(Qr=1,process.env.NODE_ENV!=="production"&&function(){function e(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=d,n=typeof Object.is=="function"?Object.is:e,r=t.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,u=t.useDebugValue;An.useSyncExternalStoreWithSelector=function(i,l,a,p,m){var f=o(null);if(f.current===null){var h={hasValue:!1,value:null};f.current=h}else h=f.current;f=c(function(){function b(C){if(!E){if(E=!0,w=C,C=p(C),m!==void 0&&h.hasValue){var O=h.value;if(m(O,C))return y=O}return y=C}if(O=y,n(w,C))return O;var N=p(C);return m!==void 0&&m(O,N)?(w=C,O):(w=C,y=N)}var E=!1,w,y,S=a===void 0?null:a;return[function(){return b(l())},S===null?void 0:function(){return b(S())}]},[l,a,p,m]);var v=r(i,f[0],f[1]);return s(function(){h.hasValue=!0,h.value=v},[v]),u(v),v},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),An}process.env.NODE_ENV==="production"?Tn.exports=Ml():Tn.exports=Nl();var Fl=Tn.exports;function Ee(e,t,n=Ur){return Fl.useSyncExternalStoreWithSelector(U(r=>e.subscribe(Ll,r)),U(()=>e.state),U(()=>e.state),U(t),n)}function Ll(e){return e}function Xr(e,t){let n=d.useId(),r=On.get(t),[o,s]=Ee(r,d.useCallback(c=>[r.selectors.isTop(c,n),r.selectors.inStack(c,n)],[r,n]));return J(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),e?s?o:!0:!1}let Mn=new Map,wt=new Map;function qr(e){var t;let n=(t=wt.get(e))!=null?t:0;return wt.set(e,n+1),n!==0?()=>Jr(e):(Mn.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0,()=>Jr(e))}function Jr(e){var t;let n=(t=wt.get(e))!=null?t:1;if(n===1?wt.delete(e):wt.set(e,n-1),n!==1)return;let r=Mn.get(e);r&&(r["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,Mn.delete(e))}function Dl(e,{allowed:t,disallowed:n}={}){let r=Xr(e,"inert-others");J(()=>{var o,s;if(!r)return;let c=Se();for(let i of(o=n==null?void 0:n())!=null?o:[])i&&c.add(qr(i));let u=(s=t==null?void 0:t())!=null?s:[];for(let i of u){if(!i)continue;let l=bt(i);if(!l)continue;let a=i.parentElement;for(;a&&a!==l.body;){for(let p of a.children)u.some(m=>p.contains(m))||c.add(qr(p));a=a.parentElement}}return c.dispose},[r,t,n])}function Il(e,t,n){let r=Ke(o=>{let s=o.getBoundingClientRect();s.x===0&&s.y===0&&s.width===0&&s.height===0&&n()});d.useEffect(()=>{if(!e)return;let o=t===null?null:Ie(t)?t:t.current;if(!o)return;let s=Se();if(typeof ResizeObserver<"u"){let c=new ResizeObserver(()=>r.current(o));c.observe(o),s.add(()=>c.disconnect())}if(typeof IntersectionObserver<"u"){let c=new IntersectionObserver(()=>r.current(o));c.observe(o),s.add(()=>c.disconnect())}return()=>s.dispose()},[t,r,e])}let Nn=["[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(","),jl=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Fn=(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))(Fn||{}),kl=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(kl||{}),_l=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(_l||{});function Zr(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Nn)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}function Rl(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(jl)).sort((t,n)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(n.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ln=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ln||{});function eo(e,t=0){var n;return e===((n=bt(e))==null?void 0:n.body)?!1:ye(t,{0(){return e.matches(Nn)},1(){let r=e;for(;r!==null;){if(r.matches(Nn))return!0;r=r.parentElement}return!1}})}var Bl=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Bl||{});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 Hl=["textarea","input"].join(",");function Wl(e){var t,n;return(n=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Hl))!=null?n:!1}function to(e,t=n=>n){return e.slice().sort((n,r)=>{let o=t(n),s=t(r);if(o===null||s===null)return 0;let c=o.compareDocumentPosition(s);return c&Node.DOCUMENT_POSITION_FOLLOWING?-1:c&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Vl(e,t){return Ul(Zr(),t,{relativeTo:e})}function Ul(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let s=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,c=Array.isArray(e)?n?to(e):e:t&64?Rl(e):Zr(e);o.length>0&&c.length>1&&(c=c.filter(f=>!o.some(h=>h!=null&&"current"in h?(h==null?void 0:h.current)===f:h===f))),r=r??s.activeElement;let u=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,c.indexOf(r))-1;if(t&4)return Math.max(0,c.indexOf(r))+1;if(t&8)return c.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),l=t&32?{preventScroll:!0}:{},a=0,p=c.length,m;do{if(a>=p||a+p<=0)return 0;let f=i+a;if(t&16)f=(f+p)%p;else{if(f<0)return 3;if(f>=p)return 1}m=c[f],m==null||m.focus(l),a+=u}while(m!==s.activeElement);return t&6&&Wl(m)&&m.select(),2}function no(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function zl(){return/Android/gi.test(window.navigator.userAgent)}function ro(){return no()||zl()}function it(e,t,n,r){let o=Ke(n);d.useEffect(()=>{if(!e)return;function s(c){o.current(c)}return document.addEventListener(t,s,r),()=>document.removeEventListener(t,s,r)},[e,t,r])}function Gl(e,t,n,r){let o=Ke(n);d.useEffect(()=>{if(!e)return;function s(c){o.current(c)}return window.addEventListener(t,s,r),()=>window.removeEventListener(t,s,r)},[e,t,r])}const oo=30;function Yl(e,t,n){let r=Ke(n),o=d.useCallback(function(u,i){if(u.defaultPrevented)return;let l=i(u);if(l===null||!l.getRootNode().contains(l)||!l.isConnected)return;let a=function p(m){return typeof m=="function"?p(m()):Array.isArray(m)||m instanceof Set?m:[m]}(t);for(let p of a)if(p!==null&&(p.contains(l)||u.composed&&u.composedPath().includes(p)))return;return!eo(l,Ln.Loose)&&l.tabIndex!==-1&&u.preventDefault(),r.current(u,l)},[r,t]),s=d.useRef(null);it(e,"pointerdown",u=>{var i,l;ro()||(s.current=((l=(i=u.composedPath)==null?void 0:i.call(u))==null?void 0:l[0])||u.target)},!0),it(e,"pointerup",u=>{if(ro()||!s.current)return;let i=s.current;return s.current=null,o(u,()=>i)},!0);let c=d.useRef({x:0,y:0});it(e,"touchstart",u=>{c.current.x=u.touches[0].clientX,c.current.y=u.touches[0].clientY},!0),it(e,"touchend",u=>{let i={x:u.changedTouches[0].clientX,y:u.changedTouches[0].clientY};if(!(Math.abs(i.x-c.current.x)>=oo||Math.abs(i.y-c.current.y)>=oo))return o(u,()=>ot(u.target)?u.target:null)},!0),Gl(e,"blur",u=>o(u,()=>ol(window.document.activeElement)?window.document.activeElement:null),!0)}function Dn(...e){return d.useMemo(()=>bt(...e),[...e])}var Kl=(e=>(e[e.Ignore=0]="Ignore",e[e.Select=1]="Select",e[e.Close=2]="Close",e))(Kl||{});const _t={Ignore:{kind:0},Select:e=>({kind:1,target:e}),Close:{kind:2}},Ql=200,io=5;function Xl(e,{trigger:t,action:n,close:r,select:o}){let s=d.useRef(null),c=d.useRef(null),u=d.useRef(null);it(e&&t!==null,"pointerdown",i=>{wn(i==null?void 0:i.target)&&t!=null&&t.contains(i.target)&&(c.current=i.x,u.current=i.y,s.current=i.timeStamp)}),it(e&&t!==null,"pointerup",i=>{var l,a;let p=s.current;if(p===null||(s.current=null,!ot(i.target))||Math.abs(i.x-((l=c.current)!=null?l:i.x))<io&&Math.abs(i.y-((a=u.current)!=null?a:i.y))<io)return;let m=n(i);switch(m.kind){case 0:return;case 1:{i.timeStamp-p>Ql&&(o(m.target),r());break}case 2:{r();break}}},{capture:!0})}function ql(e,t){return d.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 Jl(e){return d.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function Zl(e,t){let n=e(),r=new Set;return{getSnapshot(){return n},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...s){let c=t[o].call(n,...s);c&&(n=c,r.forEach(u=>u()))}}}function ea(){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),s=Math.max(0,e-o);n.style(r,"paddingRight",`${s}px`)}}}function ta(){return no()?{before({doc:e,d:t,meta:n}){function r(o){return n.containers.flatMap(s=>s()).some(s=>s.contains(o))}t.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let u=Se();u.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>u.dispose()))}let s=(o=window.scrollY)!=null?o:window.pageYOffset,c=null;t.addEventListener(e,"click",u=>{if(ot(u.target))try{let i=u.target.closest("a");if(!i)return;let{hash:l}=new URL(i.href),a=e.querySelector(l);ot(a)&&!r(a)&&(c=a)}catch{}},!0),t.addEventListener(e,"touchstart",u=>{if(ot(u.target)&&rl(u.target))if(r(u.target)){let i=u.target;for(;i.parentElement&&r(i.parentElement);)i=i.parentElement;t.style(i,"overscrollBehavior","contain")}else t.style(u.target,"touchAction","none")}),t.addEventListener(e,"touchmove",u=>{if(ot(u.target)){if(Lr(u.target))return;if(r(u.target)){let i=u.target;for(;i.parentElement&&i.dataset.headlessuiPortal!==""&&!(i.scrollHeight>i.clientHeight||i.scrollWidth>i.clientWidth);)i=i.parentElement;i.dataset.headlessuiPortal===""&&u.preventDefault()}else u.preventDefault()}},{passive:!1}),t.add(()=>{var u;let i=(u=window.scrollY)!=null?u:window.pageYOffset;s!==i&&window.scrollTo(0,s),c&&c.isConnected&&(c.scrollIntoView({block:"nearest"}),c=null)})})}}:{}}function na(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function ra(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let Qe=Zl(()=>new Map,{PUSH(e,t){var n;let r=(n=this.get(e))!=null?n:{doc:e,count:0,d:Se(),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:ra(n)},o=[ta(),ea(),na()];o.forEach(({before:s})=>s==null?void 0:s(r)),o.forEach(({after:s})=>s==null?void 0:s(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Qe.subscribe(()=>{let e=Qe.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)&&Qe.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),n.count===0&&Qe.dispatch("TEARDOWN",n)}});function oa(e,t,n=()=>({containers:[]})){let r=Jl(Qe),o=t?r.get(t):void 0,s=o?o.count>0:!1;return J(()=>{if(!(!t||!e))return Qe.dispatch("PUSH",t,n),()=>Qe.dispatch("POP",t,n)},[e,t]),s}function ia(e,t,n=()=>[document.body]){let r=Xr(e,"scroll-lock");oa(r,t,o=>{var s;return{containers:[...(s=o.containers)!=null?s:[],n]}})}function so(e){return[e.screenX,e.screenY]}function sa(){let e=d.useRef([-1,-1]);return{wasMoved(t){let n=so(t);return e.current[0]===n[0]&&e.current[1]===n[1]?!1:(e.current=n,!0)},update(t){e.current=so(t)}}}function la(e=0){let[t,n]=d.useState(e),r=d.useCallback(i=>n(i),[t]),o=d.useCallback(i=>n(l=>l|i),[t]),s=d.useCallback(i=>(t&i)===i,[t]),c=d.useCallback(i=>n(l=>l&~i),[n]),u=d.useCallback(i=>n(l=>l^i),[n]);return{flags:t,setFlag:r,addFlag:o,hasFlag:s,removeFlag:c,toggleFlag:u}}var lo,ao;typeof process<"u"&&typeof globalThis<"u"&&typeof Element<"u"&&((lo=process==null?void 0:process.env)==null?void 0:lo.NODE_ENV)==="test"&&typeof((ao=Element==null?void 0:Element.prototype)==null?void 0:ao.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(`
75
+ `)),[]});var aa=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(aa||{});function uo(e){let t={};for(let n in e)e[n]===!0&&(t[`data-${n}`]="");return t}function co(e,t,n,r){let[o,s]=d.useState(n),{hasFlag:c,addFlag:u,removeFlag:i}=la(e&&o?3:0),l=d.useRef(!1),a=d.useRef(!1),p=rt();return J(()=>{var m;if(e){if(n&&s(!0),!t){n&&u(3);return}return(m=r==null?void 0:r.start)==null||m.call(r,n),ua(t,{inFlight:l,prepare(){a.current?a.current=!1:a.current=l.current,l.current=!0,!a.current&&(n?(u(3),i(4)):(u(4),i(2)))},run(){a.current?n?(i(3),u(4)):(i(4),u(3)):n?i(1):u(1)},done(){var f;a.current&&typeof t.getAnimations=="function"&&t.getAnimations().length>0||(l.current=!1,i(7),n||s(!1),(f=r==null?void 0:r.end)==null||f.call(r,n))}})}},[e,n,t,p]),e?[o,{closed:c(1),enter:c(2),leave:c(4),transition:c(2)||c(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}function ua(e,{prepare:t,run:n,done:r,inFlight:o}){let s=Se();return fa(e,{prepare:t,inFlight:o}),s.nextFrame(()=>{n(),s.requestAnimationFrame(()=>{s.add(ca(e,r))})}),s.dispose}function ca(e,t){var n,r;let o=Se();if(!e)return o.dispose;let s=!1;o.add(()=>{s=!0});let c=(r=(n=e.getAnimations)==null?void 0:n.call(e).filter(u=>u instanceof CSSTransition))!=null?r:[];return c.length===0?(t(),o.dispose):(Promise.allSettled(c.map(u=>u.finished)).then(()=>{s||t()}),o.dispose)}function fa(e,{inFlight:t,prepare:n}){if(t!=null&&t.current){n();return}let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}function Rt(){return typeof window<"u"}function st(e){return fo(e)?(e.nodeName||"").toLowerCase():"#document"}function ve(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ae(e){var t;return(t=(fo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function fo(e){return Rt()?e instanceof Node||e instanceof ve(e).Node:!1}function ae(e){return Rt()?e instanceof Element||e instanceof ve(e).Element:!1}function Me(e){return Rt()?e instanceof HTMLElement||e instanceof ve(e).HTMLElement:!1}function po(e){return!Rt()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ve(e).ShadowRoot}const da=new Set(["inline","contents"]);function Et(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=$e(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!da.has(o)}const pa=new Set(["table","td","th"]);function ma(e){return pa.has(st(e))}const ha=[":popover-open",":modal"];function Bt(e){return ha.some(t=>{try{return e.matches(t)}catch{return!1}})}const ga=["transform","translate","scale","rotate","perspective"],va=["transform","translate","scale","rotate","perspective","filter"],ba=["paint","layout","strict","content"];function In(e){const t=jn(),n=ae(e)?$e(e):e;return ga.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)||va.some(r=>(n.willChange||"").includes(r))||ba.some(r=>(n.contain||"").includes(r))}function ya(e){let t=We(e);for(;Me(t)&&!lt(t);){if(In(t))return t;if(Bt(t))return null;t=We(t)}return null}function jn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xa=new Set(["html","body","#document"]);function lt(e){return xa.has(st(e))}function $e(e){return ve(e).getComputedStyle(e)}function Ht(e){return ae(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function We(e){if(st(e)==="html")return e;const t=e.assignedSlot||e.parentNode||po(e)&&e.host||Ae(e);return po(t)?t.host:t}function mo(e){const t=We(e);return lt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Me(t)&&Et(t)?t:mo(t)}function Ct(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=mo(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),c=ve(o);if(s){const u=kn(c);return t.concat(c,c.visualViewport||[],Et(o)?o:[],u&&n?Ct(u):[])}return t.concat(o,Ct(o,[],n))}function kn(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wa(){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 Xe=Math.min,ue=Math.max,St=Math.round,Wt=Math.floor,Ne=e=>({x:e,y:e}),Ea={left:"right",right:"left",bottom:"top",top:"bottom"},Ca={start:"end",end:"start"};function ho(e,t,n){return ue(e,Xe(t,n))}function at(e,t){return typeof e=="function"?e(t):e}function Ve(e){return e.split("-")[0]}function $t(e){return e.split("-")[1]}function go(e){return e==="x"?"y":"x"}function vo(e){return e==="y"?"height":"width"}const Sa=new Set(["top","bottom"]);function je(e){return Sa.has(Ve(e))?"y":"x"}function bo(e){return go(je(e))}function $a(e,t,n){n===void 0&&(n=!1);const r=$t(e),o=bo(e),s=vo(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Vt(c)),[c,Vt(c)]}function Oa(e){const t=Vt(e);return[_n(e),t,_n(t)]}function _n(e){return e.replace(/start|end/g,t=>Ca[t])}const yo=["left","right"],xo=["right","left"],Ta=["top","bottom"],Pa=["bottom","top"];function Aa(e,t,n){switch(e){case"top":case"bottom":return n?t?xo:yo:t?yo:xo;case"left":case"right":return t?Ta:Pa;default:return[]}}function Ma(e,t,n,r){const o=$t(e);let s=Aa(Ve(e),n==="start",r);return o&&(s=s.map(c=>c+"-"+o),t&&(s=s.concat(s.map(_n)))),s}function Vt(e){return e.replace(/left|right|bottom|top/g,t=>Ea[t])}function Na(e){return{top:0,right:0,bottom:0,left:0,...e}}function Fa(e){return typeof e!="number"?Na(e):{top:e,right:e,bottom:e,left:e}}function Ut(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function wo(e,t,n){let{reference:r,floating:o}=e;const s=je(t),c=bo(t),u=vo(c),i=Ve(t),l=s==="y",a=r.x+r.width/2-o.width/2,p=r.y+r.height/2-o.height/2,m=r[u]/2-o[u]/2;let f;switch(i){case"top":f={x:a,y:r.y-o.height};break;case"bottom":f={x:a,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:p};break;case"left":f={x:r.x-o.width,y:p};break;default:f={x:r.x,y:r.y}}switch($t(t)){case"start":f[c]-=m*(n&&l?-1:1);break;case"end":f[c]+=m*(n&&l?-1:1);break}return f}const La=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:c}=n,u=s.filter(Boolean),i=await(c.isRTL==null?void 0:c.isRTL(t));let l=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:p}=wo(l,r,i),m=r,f={},h=0;for(let v=0;v<u.length;v++){const{name:b,fn:E}=u[v],{x:w,y,data:S,reset:C}=await E({x:a,y:p,initialPlacement:r,placement:m,strategy:o,middlewareData:f,rects:l,platform:c,elements:{reference:e,floating:t}});a=w??a,p=y??p,f={...f,[b]:{...f[b],...S}},C&&h<=50&&(h++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(l=C.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:a,y:p}=wo(l,m,i)),v=-1)}return{x:a,y:p,placement:m,strategy:o,middlewareData:f}};async function zt(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:c,elements:u,strategy:i}=e,{boundary:l="clippingAncestors",rootBoundary:a="viewport",elementContext:p="floating",altBoundary:m=!1,padding:f=0}=at(t,e),h=Fa(f),b=u[m?p==="floating"?"reference":"floating":p],E=Ut(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(b)))==null||n?b:b.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:l,rootBoundary:a,strategy:i})),w=p==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),S=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},C=Ut(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:y,strategy:i}):w);return{top:(E.top-C.top+h.top)/S.y,bottom:(C.bottom-E.bottom+h.bottom)/S.y,left:(E.left-C.left+h.left)/S.x,right:(C.right-E.right+h.right)/S.x}}const Da=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:c,initialPlacement:u,platform:i,elements:l}=t,{mainAxis:a=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:v=!0,...b}=at(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=Ve(o),w=je(u),y=Ve(u)===u,S=await(i.isRTL==null?void 0:i.isRTL(l.floating)),C=m||(y||!v?[Vt(u)]:Oa(u)),O=h!=="none";!m&&O&&C.push(...Ma(u,v,h,S));const N=[u,...C],_=await zt(t,b),W=[];let M=((r=s.flip)==null?void 0:r.overflows)||[];if(a&&W.push(_[E]),p){const L=$a(o,c,S);W.push(_[L[0]],_[L[1]])}if(M=[...M,{placement:o,overflows:W}],!W.every(L=>L<=0)){var F,j;const L=(((F=s.flip)==null?void 0:F.index)||0)+1,B=N[L];if(B&&(!(p==="alignment"?w!==je(B):!1)||M.every(T=>je(T.placement)===w?T.overflows[0]>0:!0)))return{data:{index:L,overflows:M},reset:{placement:B}};let z=(j=M.filter(Y=>Y.overflows[0]<=0).sort((Y,T)=>Y.overflows[1]-T.overflows[1])[0])==null?void 0:j.placement;if(!z)switch(f){case"bestFit":{var D;const Y=(D=M.filter(T=>{if(O){const R=je(T.placement);return R===w||R==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(R=>R>0).reduce((R,Q)=>R+Q,0)]).sort((T,R)=>T[1]-R[1])[0])==null?void 0:D[0];Y&&(z=Y);break}case"initialPlacement":z=u;break}if(o!==z)return{reset:{placement:z}}}return{}}}},Ia=new Set(["left","top"]);async function ja(e,t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Ve(n),u=$t(n),i=je(n)==="y",l=Ia.has(c)?-1:1,a=s&&i?-1:1,p=at(t,e);let{mainAxis:m,crossAxis:f,alignmentAxis:h}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof h=="number"&&(f=u==="end"?h*-1:h),i?{x:f*a,y:m*l}:{x:m*l,y:f*a}}const ka=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:c,middlewareData:u}=t,i=await ja(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+i.x,y:s+i.y,data:{...i,placement:c}}}}},_a=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:b=>{let{x:E,y:w}=b;return{x:E,y:w}}},...i}=at(e,t),l={x:n,y:r},a=await zt(t,i),p=je(Ve(o)),m=go(p);let f=l[m],h=l[p];if(s){const b=m==="y"?"top":"left",E=m==="y"?"bottom":"right",w=f+a[b],y=f-a[E];f=ho(w,f,y)}if(c){const b=p==="y"?"top":"left",E=p==="y"?"bottom":"right",w=h+a[b],y=h-a[E];h=ho(w,h,y)}const v=u.fn({...t,[m]:f,[p]:h});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[m]:s,[p]:c}}}}}},Ra=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:s,platform:c,elements:u}=t,{apply:i=()=>{},...l}=at(e,t),a=await zt(t,l),p=Ve(o),m=$t(o),f=je(o)==="y",{width:h,height:v}=s.floating;let b,E;p==="top"||p==="bottom"?(b=p,E=m===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(E=p,b=m==="end"?"top":"bottom");const w=v-a.top-a.bottom,y=h-a.left-a.right,S=Xe(v-a[b],w),C=Xe(h-a[E],y),O=!t.middlewareData.shift;let N=S,_=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(_=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=w),O&&!m){const M=ue(a.left,0),F=ue(a.right,0),j=ue(a.top,0),D=ue(a.bottom,0);f?_=h-2*(M!==0||F!==0?M+F:ue(a.left,a.right)):N=v-2*(j!==0||D!==0?j+D:ue(a.top,a.bottom))}await i({...t,availableWidth:_,availableHeight:N});const W=await c.getDimensions(u.floating);return h!==W.width||v!==W.height?{reset:{rects:!0}}:{}}}};function Eo(e){const t=$e(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Me(e),s=o?e.offsetWidth:n,c=o?e.offsetHeight:r,u=St(n)!==s||St(r)!==c;return u&&(n=s,r=c),{width:n,height:r,$:u}}function Rn(e){return ae(e)?e:e.contextElement}function ut(e){const t=Rn(e);if(!Me(t))return Ne(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=Eo(t);let c=(s?St(n.width):n.width)/r,u=(s?St(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const Ba=Ne(0);function Co(e){const t=ve(e);return!jn()||!t.visualViewport?Ba:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ha(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==ve(e)?!1:t}function qe(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Rn(e);let c=Ne(1);t&&(r?ae(r)&&(c=ut(r)):c=ut(e));const u=Ha(s,n,r)?Co(s):Ne(0);let i=(o.left+u.x)/c.x,l=(o.top+u.y)/c.y,a=o.width/c.x,p=o.height/c.y;if(s){const m=ve(s),f=r&&ae(r)?ve(r):r;let h=m,v=kn(h);for(;v&&r&&f!==h;){const b=ut(v),E=v.getBoundingClientRect(),w=$e(v),y=E.left+(v.clientLeft+parseFloat(w.paddingLeft))*b.x,S=E.top+(v.clientTop+parseFloat(w.paddingTop))*b.y;i*=b.x,l*=b.y,a*=b.x,p*=b.y,i+=y,l+=S,h=ve(v),v=kn(h)}}return Ut({width:a,height:p,x:i,y:l})}function Gt(e,t){const n=Ht(e).scrollLeft;return t?t.left+n:qe(Ae(e)).left+n}function So(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Gt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Wa(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",c=Ae(r),u=t?Bt(t.floating):!1;if(r===c||u&&s)return n;let i={scrollLeft:0,scrollTop:0},l=Ne(1);const a=Ne(0),p=Me(r);if((p||!p&&!s)&&((st(r)!=="body"||Et(c))&&(i=Ht(r)),Me(r))){const f=qe(r);l=ut(r),a.x=f.x+r.clientLeft,a.y=f.y+r.clientTop}const m=c&&!p&&!s?So(c,i):Ne(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-i.scrollLeft*l.x+a.x+m.x,y:n.y*l.y-i.scrollTop*l.y+a.y+m.y}}function Va(e){return Array.from(e.getClientRects())}function Ua(e){const t=Ae(e),n=Ht(e),r=e.ownerDocument.body,o=ue(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=ue(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Gt(e);const u=-n.scrollTop;return $e(r).direction==="rtl"&&(c+=ue(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:c,y:u}}const $o=25;function za(e,t){const n=ve(e),r=Ae(e),o=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,u=0,i=0;if(o){s=o.width,c=o.height;const a=jn();(!a||a&&t==="fixed")&&(u=o.offsetLeft,i=o.offsetTop)}const l=Gt(r);if(l<=0){const a=r.ownerDocument,p=a.body,m=getComputedStyle(p),f=a.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,h=Math.abs(r.clientWidth-p.clientWidth-f);h<=$o&&(s-=h)}else l<=$o&&(s+=l);return{width:s,height:c,x:u,y:i}}const Ga=new Set(["absolute","fixed"]);function Ya(e,t){const n=qe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=Me(e)?ut(e):Ne(1),c=e.clientWidth*s.x,u=e.clientHeight*s.y,i=o*s.x,l=r*s.y;return{width:c,height:u,x:i,y:l}}function Oo(e,t,n){let r;if(t==="viewport")r=za(e,n);else if(t==="document")r=Ua(Ae(e));else if(ae(t))r=Ya(t,n);else{const o=Co(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Ut(r)}function To(e,t){const n=We(e);return n===t||!ae(n)||lt(n)?!1:$e(n).position==="fixed"||To(n,t)}function Ka(e,t){const n=t.get(e);if(n)return n;let r=Ct(e,[],!1).filter(u=>ae(u)&&st(u)!=="body"),o=null;const s=$e(e).position==="fixed";let c=s?We(e):e;for(;ae(c)&&!lt(c);){const u=$e(c),i=In(c);!i&&u.position==="fixed"&&(o=null),(s?!i&&!o:!i&&u.position==="static"&&!!o&&Ga.has(o.position)||Et(c)&&!i&&To(e,c))?r=r.filter(a=>a!==c):o=u,c=We(c)}return t.set(e,r),r}function Qa(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?Bt(t)?[]:Ka(t,this._c):[].concat(n),r],u=c[0],i=c.reduce((l,a)=>{const p=Oo(t,a,o);return l.top=ue(p.top,l.top),l.right=Xe(p.right,l.right),l.bottom=Xe(p.bottom,l.bottom),l.left=ue(p.left,l.left),l},Oo(t,u,o));return{width:i.right-i.left,height:i.bottom-i.top,x:i.left,y:i.top}}function Xa(e){const{width:t,height:n}=Eo(e);return{width:t,height:n}}function qa(e,t,n){const r=Me(t),o=Ae(t),s=n==="fixed",c=qe(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const i=Ne(0);function l(){i.x=Gt(o)}if(r||!r&&!s)if((st(t)!=="body"||Et(o))&&(u=Ht(t)),r){const f=qe(t,!0,s,t);i.x=f.x+t.clientLeft,i.y=f.y+t.clientTop}else o&&l();s&&!r&&o&&l();const a=o&&!r&&!s?So(o,u):Ne(0),p=c.left+u.scrollLeft-i.x-a.x,m=c.top+u.scrollTop-i.y-a.y;return{x:p,y:m,width:c.width,height:c.height}}function Bn(e){return $e(e).position==="static"}function Po(e,t){if(!Me(e)||$e(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ae(e)===n&&(n=n.ownerDocument.body),n}function Ao(e,t){const n=ve(e);if(Bt(e))return n;if(!Me(e)){let o=We(e);for(;o&&!lt(o);){if(ae(o)&&!Bn(o))return o;o=We(o)}return n}let r=Po(e,t);for(;r&&ma(r)&&Bn(r);)r=Po(r,t);return r&&lt(r)&&Bn(r)&&!In(r)?n:r||ya(e)||n}const Ja=async function(e){const t=this.getOffsetParent||Ao,n=this.getDimensions,r=await n(e.floating);return{reference:qa(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Za(e){return $e(e).direction==="rtl"}const eu={convertOffsetParentRelativeRectToViewportRelativeRect:Wa,getDocumentElement:Ae,getClippingRect:Qa,getOffsetParent:Ao,getElementRects:Ja,getClientRects:Va,getDimensions:Xa,getScale:ut,isElement:ae,isRTL:Za};function Mo(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tu(e,t){let n=null,r;const o=Ae(e);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,i){u===void 0&&(u=!1),i===void 0&&(i=1),s();const l=e.getBoundingClientRect(),{left:a,top:p,width:m,height:f}=l;if(u||t(),!m||!f)return;const h=Wt(p),v=Wt(o.clientWidth-(a+m)),b=Wt(o.clientHeight-(p+f)),E=Wt(a),y={rootMargin:-h+"px "+-v+"px "+-b+"px "+-E+"px",threshold:ue(0,Xe(1,i))||1};let S=!0;function C(O){const N=O[0].intersectionRatio;if(N!==i){if(!S)return c();N?c(!1,N):r=setTimeout(()=>{c(!1,1e-7)},1e3)}N===1&&!Mo(l,e.getBoundingClientRect())&&c(),S=!1}try{n=new IntersectionObserver(C,{...y,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,y)}n.observe(e)}return c(!0),s}function nu(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:i=!1}=r,l=Rn(e),a=o||s?[...l?Ct(l):[],...Ct(t)]:[];a.forEach(E=>{o&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const p=l&&u?tu(l,n):null;let m=-1,f=null;c&&(f=new ResizeObserver(E=>{let[w]=E;w&&w.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var y;(y=f)==null||y.observe(t)})),n()}),l&&!i&&f.observe(l),f.observe(t));let h,v=i?qe(e):null;i&&b();function b(){const E=qe(e);v&&!Mo(v,E)&&n(),v=E,h=requestAnimationFrame(b)}return n(),()=>{var E;a.forEach(w=>{o&&w.removeEventListener("scroll",n),s&&w.removeEventListener("resize",n)}),p==null||p(),(E=f)==null||E.disconnect(),f=null,i&&cancelAnimationFrame(h)}}const Hn=zt,ru=ka,ou=_a,iu=Da,su=Ra,lu=(e,t,n)=>{const r=new Map,o={platform:eu,...n},s={...o.platform,_c:r};return La(e,t,{...o,platform:s})};var au=typeof document<"u",uu=function(){},Yt=au?d.useLayoutEffect:uu;function Kt(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(!Kt(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 s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Kt(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function No(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Fo(e,t){const n=No(e);return Math.round(t*n)/n}function Wn(e){const t=A.useRef(e);return Yt(()=>{t.current=e}),t}function cu(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:c}={},transform:u=!0,whileElementsMounted:i,open:l}=e,[a,p]=A.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,f]=A.useState(r);Kt(m,r)||f(r);const[h,v]=A.useState(null),[b,E]=A.useState(null),w=A.useCallback(T=>{T!==O.current&&(O.current=T,v(T))},[]),y=A.useCallback(T=>{T!==N.current&&(N.current=T,E(T))},[]),S=s||h,C=c||b,O=A.useRef(null),N=A.useRef(null),_=A.useRef(a),W=i!=null,M=Wn(i),F=Wn(o),j=Wn(l),D=A.useCallback(()=>{if(!O.current||!N.current)return;const T={placement:t,strategy:n,middleware:m};F.current&&(T.platform=F.current),lu(O.current,N.current,T).then(R=>{const Q={...R,isPositioned:j.current!==!1};L.current&&!Kt(_.current,Q)&&(_.current=Q,At.flushSync(()=>{p(Q)}))})},[m,t,n,F,j]);Yt(()=>{l===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,p(T=>({...T,isPositioned:!1})))},[l]);const L=A.useRef(!1);Yt(()=>(L.current=!0,()=>{L.current=!1}),[]),Yt(()=>{if(S&&(O.current=S),C&&(N.current=C),S&&C){if(M.current)return M.current(S,C,D);D()}},[S,C,D,M,W]);const B=A.useMemo(()=>({reference:O,floating:N,setReference:w,setFloating:y}),[w,y]),z=A.useMemo(()=>({reference:S,floating:C}),[S,C]),Y=A.useMemo(()=>{const T={position:n,left:0,top:0};if(!z.floating)return T;const R=Fo(z.floating,a.x),Q=Fo(z.floating,a.y);return u?{...T,transform:"translate("+R+"px, "+Q+"px)",...No(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:Q}},[n,u,z.floating,a.x,a.y]);return A.useMemo(()=>({...a,update:D,refs:B,elements:z,floatingStyles:Y}),[a,D,B,z,Y])}const Lo=(e,t)=>({...ru(e),options:[e,t]}),fu=(e,t)=>({...ou(e),options:[e,t]}),du=(e,t)=>({...iu(e),options:[e,t]}),pu=(e,t)=>({...su(e),options:[e,t]}),Do={...A},mu=Do.useInsertionEffect||(e=>e());function Io(e){const t=A.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return mu(()=>{t.current=e}),A.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 Vn=typeof document<"u"?d.useLayoutEffect:d.useEffect;let jo=!1,hu=0;const ko=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+hu++;function gu(){const[e,t]=A.useState(()=>jo?ko():void 0);return Vn(()=>{e==null&&t(ko())},[]),A.useEffect(()=>{jo=!0},[]),e}const vu=Do.useId||gu;let Ot;process.env.NODE_ENV!=="production"&&(Ot=new Set);function bu(){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=Ot)!=null&&e.has(o))){var s;(s=Ot)==null||s.add(o),console.warn(o)}}function yu(){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=Ot)!=null&&e.has(o))){var s;(s=Ot)==null||s.add(o),console.error(o)}}function xu(){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 wu=A.createContext(null),Eu=A.createContext(null),Cu=()=>{var e;return((e=A.useContext(wu))==null?void 0:e.id)||null},Su=()=>A.useContext(Eu),$u="data-floating-ui-focusable";function Ou(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=vu(),s=A.useRef({}),[c]=A.useState(()=>xu()),u=Cu()!=null;if(process.env.NODE_ENV!=="production"){const f=r.reference;f&&!ae(f)&&yu("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[i,l]=A.useState(r.reference),a=Io((f,h,v)=>{s.current.openEvent=f?h:void 0,c.emit("openchange",{open:f,event:h,reason:v,nested:u}),n==null||n(f,h,v)}),p=A.useMemo(()=>({setPositionReference:l}),[]),m=A.useMemo(()=>({reference:i||r.reference||null,floating:r.floating||null,domReference:r.reference}),[i,r.reference,r.floating]);return A.useMemo(()=>({dataRef:s,open:t,onOpenChange:a,elements:m,events:c,floatingId:o,refs:p}),[t,a,m,c,o,p])}function Tu(e){e===void 0&&(e={});const{nodeId:t}=e,n=Ou({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[s,c]=A.useState(null),[u,i]=A.useState(null),a=(o==null?void 0:o.domReference)||s,p=A.useRef(null),m=Su();Vn(()=>{a&&(p.current=a)},[a]);const f=cu({...e,elements:{...o,...u&&{reference:u}}}),h=A.useCallback(y=>{const S=ae(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;i(S),f.refs.setReference(S)},[f.refs]),v=A.useCallback(y=>{(ae(y)||y===null)&&(p.current=y,c(y)),(ae(f.refs.reference.current)||f.refs.reference.current===null||y!==null&&!ae(y))&&f.refs.setReference(y)},[f.refs]),b=A.useMemo(()=>({...f.refs,setReference:v,setPositionReference:h,domReference:p}),[f.refs,v,h]),E=A.useMemo(()=>({...f.elements,domReference:a}),[f.elements,a]),w=A.useMemo(()=>({...f,...r,refs:b,elements:E,nodeId:t}),[f,b,E,t,r]);return Vn(()=>{r.dataRef.current.floatingContext=w;const y=m==null?void 0:m.nodesRef.current.find(S=>S.id===t);y&&(y.context=w)}),A.useMemo(()=>({...f,context:w,refs:b,elements:E}),[f,b,E,w])}const _o="active",Ro="selected";function Un(e,t,n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[_o]:c,[Ro]:u,...i}=e;s=i}return{...n==="floating"&&{tabIndex:-1,[$u]:""},...s,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(i=>{let[l,a]=i;if(!(o&&[_o,Ro].includes(l)))if(l.indexOf("on")===0){if(r.has(l)||r.set(l,[]),typeof a=="function"){var p;(p=r.get(l))==null||p.push(a),c[l]=function(){for(var m,f=arguments.length,h=new Array(f),v=0;v<f;v++)h[v]=arguments[v];return(m=r.get(l))==null?void 0:m.map(b=>b(...h)).find(b=>b!==void 0)}}}else c[l]=a}),c),{})}}function Pu(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),o=A.useCallback(u=>Un(u,e,"reference"),t),s=A.useCallback(u=>Un(u,e,"floating"),n),c=A.useCallback(u=>Un(u,e,"item"),r);return A.useMemo(()=>({getReferenceProps:o,getFloatingProps:s,getItemProps:c}),[o,s,c])}function Bo(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}const Au=e=>({name:"inner",options:e,async fn(t){const{listRef:n,overflowRef:r,onFallbackChange:o,offset:s=0,index:c=0,minItemsVisible:u=4,referenceOverflowThreshold:i=0,scrollRef:l,...a}=at(e,t),{rects:p,elements:{floating:m}}=t,f=n.current[c],h=(l==null?void 0:l.current)||m,v=m.clientTop||h.clientTop,b=m.clientTop!==0,E=h.clientTop!==0,w=m===h;if(process.env.NODE_ENV!=="production"&&(t.placement.startsWith("bottom")||bu('`placement` side must be "bottom" when using the `inner`',"middleware.")),!f)return{};const y={...t,...await Lo(-f.offsetTop-m.clientTop-p.reference.height/2-f.offsetHeight/2-s).fn(t)},S=await Hn(Bo(y,h.scrollHeight+v+m.clientTop),a),C=await Hn(y,{...a,elementContext:"reference"}),O=ue(0,S.top),N=y.y+O,M=(h.scrollHeight>h.clientHeight?F=>F:St)(ue(0,h.scrollHeight+(b&&w||E?v*2:0)-O-ue(0,S.bottom)));if(h.style.maxHeight=M+"px",h.scrollTop=O,o){const F=h.offsetHeight<f.offsetHeight*Xe(u,n.current.length)-1||C.top>=-i||C.bottom>=-i;At.flushSync(()=>o(F))}return r&&(r.current=await Hn(Bo({...y,y:N},h.offsetHeight+v+m.clientTop),a)),{y:N}}});function Mu(e,t){const{open:n,elements:r}=e,{enabled:o=!0,overflowRef:s,scrollRef:c,onChange:u}=t,i=Io(u),l=A.useRef(!1),a=A.useRef(null),p=A.useRef(null);A.useEffect(()=>{if(!o)return;function f(v){if(v.ctrlKey||!h||s.current==null)return;const b=v.deltaY,E=s.current.top>=-.5,w=s.current.bottom>=-.5,y=h.scrollHeight-h.clientHeight,S=b<0?-1:1,C=b<0?"max":"min";h.scrollHeight<=h.clientHeight||(!E&&b>0||!w&&b<0?(v.preventDefault(),At.flushSync(()=>{i(O=>O+Math[C](b,y*S))})):/firefox/i.test(wa())&&(h.scrollTop+=b))}const h=(c==null?void 0:c.current)||r.floating;if(n&&h)return h.addEventListener("wheel",f),requestAnimationFrame(()=>{a.current=h.scrollTop,s.current!=null&&(p.current={...s.current})}),()=>{a.current=null,p.current=null,h.removeEventListener("wheel",f)}},[o,n,r.floating,s,c,i]);const m=A.useMemo(()=>({onKeyDown(){l.current=!0},onWheel(){l.current=!1},onPointerMove(){l.current=!1},onScroll(){const f=(c==null?void 0:c.current)||r.floating;if(!(!s.current||!f||!l.current)){if(a.current!==null){const h=f.scrollTop-a.current;(s.current.bottom<-.5&&h<-1||s.current.top<-.5&&h>1)&&At.flushSync(()=>i(v=>v+h))}requestAnimationFrame(()=>{a.current=f.scrollTop})}}}),[r.floating,i,s,c]);return A.useMemo(()=>o?{floating:m}:{},[o,m])}let ct=d.createContext({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});ct.displayName="FloatingContext";let zn=d.createContext(null);zn.displayName="PlacementContext";function Nu(e){return d.useMemo(()=>e?typeof e=="string"?{to:e}:e:null,[e])}function Fu(){return d.useContext(ct).setReference}function Lu(){return d.useContext(ct).getReferenceProps}function Du(){let{getFloatingProps:e,slot:t}=d.useContext(ct);return d.useCallback((...n)=>Object.assign({},e(...n),{"data-anchor":t.anchor}),[e,t])}function Iu(e=null){e===!1&&(e=null),typeof e=="string"&&(e={to:e});let t=d.useContext(zn),n=d.useMemo(()=>e,[JSON.stringify(e,(o,s)=>{var c;return(c=s==null?void 0:s.outerHTML)!=null?c:s})]);J(()=>{t==null||t(n??null)},[t,n]);let r=d.useContext(ct);return d.useMemo(()=>[r.setFloating,e?r.styles:{}],[r.setFloating,e,r.styles])}let Ho=4;function ju({children:e,enabled:t=!0}){let[n,r]=d.useState(null),[o,s]=d.useState(0),c=d.useRef(null),[u,i]=d.useState(null);ku(u);let l=t&&n!==null&&u!==null,{to:a="bottom",gap:p=0,offset:m=0,padding:f=0,inner:h}=_u(n,u),[v,b="center"]=a.split(" ");J(()=>{l&&s(0)},[l]);let{refs:E,floatingStyles:w,context:y}=Tu({open:l,placement:v==="selection"?b==="center"?"bottom":`bottom-${b}`:b==="center"?`${v}`:`${v}-${b}`,strategy:"absolute",transform:!1,middleware:[Lo({mainAxis:v==="selection"?0:p,crossAxis:m}),fu({padding:f}),v!=="selection"&&du({padding:f}),v==="selection"&&h?Au({...h,padding:f,overflowRef:c,offset:o,minItemsVisible:Ho,referenceOverflowThreshold:f,onFallbackChange(F){var j,D;if(!F)return;let L=y.elements.floating;if(!L)return;let B=parseFloat(getComputedStyle(L).scrollPaddingBottom)||0,z=Math.min(Ho,L.childElementCount),Y=0,T=0;for(let R of(D=(j=y.elements.floating)==null?void 0:j.childNodes)!=null?D:[])if(Ie(R)){let Q=R.offsetTop,me=Q+R.clientHeight+B,Z=L.scrollTop,q=Z+L.clientHeight;if(Q>=Z&&me<=q)z--;else{T=Math.max(0,Math.min(me,q)-Math.max(Q,Z)),Y=R.clientHeight;break}}z>=1&&s(R=>{let Q=Y*z-T+B;return R>=Q?R:Q})}}):null,pu({padding:f,apply({availableWidth:F,availableHeight:j,elements:D}){Object.assign(D.floating.style,{overflow:"auto",maxWidth:`${F}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${j}px)`})}})].filter(Boolean),whileElementsMounted:nu}),[S=v,C=b]=y.placement.split("-");v==="selection"&&(S="selection");let O=d.useMemo(()=>({anchor:[S,C].filter(Boolean).join(" ")}),[S,C]),N=Mu(y,{overflowRef:c,onChange:s}),{getReferenceProps:_,getFloatingProps:W}=Pu([N]),M=U(F=>{i(F),E.setFloating(F)});return A.createElement(zn.Provider,{value:r},A.createElement(ct.Provider,{value:{setFloating:M,setReference:E.setReference,styles:w,getReferenceProps:_,getFloatingProps:W,slot:O}},e))}function ku(e){J(()=>{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 _u(e,t){var n,r,o;let s=Gn((n=e==null?void 0:e.gap)!=null?n:"var(--anchor-gap, 0)",t),c=Gn((r=e==null?void 0:e.offset)!=null?r:"var(--anchor-offset, 0)",t),u=Gn((o=e==null?void 0:e.padding)!=null?o:"var(--anchor-padding, 0)",t);return{...e,gap:s,offset:c,padding:u}}function Gn(e,t,n=void 0){let r=rt(),o=U((i,l)=>{if(i==null)return[n,null];if(typeof i=="number")return[i,null];if(typeof i=="string"){if(!l)return[n,null];let a=Vo(i,l);return[a,p=>{let m=Wo(i);{let f=m.map(h=>window.getComputedStyle(l).getPropertyValue(h));r.requestAnimationFrame(function h(){r.nextFrame(h);let v=!1;for(let[E,w]of m.entries()){let y=window.getComputedStyle(l).getPropertyValue(w);if(f[E]!==y){f[E]=y,v=!0;break}}if(!v)return;let b=Vo(i,l);a!==b&&(p(b),a=b)})}return r.dispose}]}return[n,null]}),s=d.useMemo(()=>o(e,t)[0],[e,t]),[c=s,u]=d.useState();return J(()=>{let[i,l]=o(e,t);if(u(i),!!l)return l(u)},[e,t]),c}function Wo(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,...Wo(o)]:[r]}return[]}function Vo(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 Ru(e,t){let[n,r]=d.useState(t);return!e&&n!==t&&r(t),e?n:t}let Yn=d.createContext(null);Yn.displayName="OpenClosedContext";var Oe=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Oe||{});function Kn(){return d.useContext(Yn)}function Uo({value:e,children:t}){return d.createElement(Yn.Provider,{value:e},t)}function Bu(e){throw new Error("Unexpected object: "+e)}var te=(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))(te||{});function Qt(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 s=0;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 1:{o===-1&&(o=n.length);for(let s=o-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 2:{for(let s=o+1;s<n.length;++s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 3:{for(let s=n.length-1;s>=0;--s)if(!t.resolveDisabled(n[s],s,n))return s;return r}case 4:{for(let s=0;s<n.length;++s)if(t.resolveId(n[s],s,n)===e.id)return s;return r}case 5:return null;default:Bu(e)}}var zo=(e=>(e[e.Left=0]="Left",e[e.Right=2]="Right",e))(zo||{});function Go(e){let t=U(e),n=d.useRef(!1);d.useEffect(()=>(n.current=!1,()=>{n.current=!0,$r(()=>{n.current&&t()})}),[t])}function Hu(){let e=typeof document>"u";return"useSyncExternalStore"in A?(t=>t.useSyncExternalStore)(A)(()=>()=>{},()=>!1,()=>!e):!1}function Qn(){let e=Hu(),[t,n]=A.useState(Te.isHandoffComplete);return t&&Te.isHandoffComplete===!1&&n(!1),A.useEffect(()=>{t!==!0&&n(!0)},[t]),A.useEffect(()=>Te.handoff(),[]),e?!1:t}let Wu=d.createContext(!1);function Vu(){return d.useContext(Wu)}function Uu(e){let t=Vu(),n=d.useContext(Ko),[r,o]=d.useState(()=>{var s;if(!t&&n!==null)return(s=n.current)!=null?s:null;if(Te.isServer)return null;let c=e==null?void 0:e.getElementById("headlessui-portal-root");if(c)return c;if(e===null)return null;let u=e.createElement("div");return u.setAttribute("id","headlessui-portal-root"),e.body.appendChild(u)});return d.useEffect(()=>{r!==null&&(e!=null&&e.body.contains(r)||e==null||e.body.appendChild(r))},[r,e]),d.useEffect(()=>{t||n!==null&&o(n.current)},[n,o,t]),r}let Yo=d.Fragment,zu=pe(function(e,t){let{ownerDocument:n=null,...r}=e,o=d.useRef(null),s=xe(ul(f=>{o.current=f}),t),c=Dn(o),u=n??c,i=Uu(u),[l]=d.useState(()=>{var f;return Te.isServer?null:(f=u==null?void 0:u.createElement("div"))!=null?f:null}),a=d.useContext(Qu),p=Qn();J(()=>{!i||!l||i.contains(l)||(l.setAttribute("data-headlessui-portal",""),i.appendChild(l))},[i,l]),J(()=>{if(l&&a)return a.register(l)},[a,l]),Go(()=>{var f;!i||!l||(wn(l)&&i.contains(l)&&i.removeChild(l),i.childNodes.length<=0&&((f=i.parentElement)==null||f.removeChild(i)))});let m=ge();return p?!i||!l?null:de.createPortal(m({ourProps:{ref:s},theirProps:r,slot:{},defaultTag:Yo,name:"Portal"}),l):null});function Gu(e,t){let n=xe(t),{enabled:r=!0,ownerDocument:o,...s}=e,c=ge();return r?d.createElement(zu,{...s,ownerDocument:o,ref:n}):c({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:Yo,name:"Portal"})}let Yu=d.Fragment,Ko=d.createContext(null);function Ku(e,t){let{target:n,...r}=e,o={ref:xe(t)},s=ge();return d.createElement(Ko.Provider,{value:n},s({ourProps:o,theirProps:r,defaultTag:Yu,name:"Popover.Group"}))}let Qu=d.createContext(null),Xu=pe(Gu),qu=pe(Ku),Ju=Object.assign(Xu,{Group:qu});function Zu(){let e=d.useRef(!1);return J(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Qo(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||((t=e.as)!=null?t:qo)!==d.Fragment||d.Children.count(e.children)===1}let Xt=d.createContext(null);Xt.displayName="TransitionContext";var ec=(e=>(e.Visible="visible",e.Hidden="hidden",e))(ec||{});function tc(){let e=d.useContext(Xt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function nc(){let e=d.useContext(qt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let qt=d.createContext(null);qt.displayName="NestingContext";function Jt(e){return"children"in e?Jt(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function Xo(e,t){let n=Ke(e),r=d.useRef([]),o=Zu(),s=rt(),c=U((f,h=Be.Hidden)=>{let v=r.current.findIndex(({el:b})=>b===f);v!==-1&&(ye(h,{[Be.Unmount](){r.current.splice(v,1)},[Be.Hidden](){r.current[v].state="hidden"}}),s.microTask(()=>{var b;!Jt(r)&&o.current&&((b=n.current)==null||b.call(n))}))}),u=U(f=>{let h=r.current.find(({el:v})=>v===f);return h?h.state!=="visible"&&(h.state="visible"):r.current.push({el:f,state:"visible"}),()=>c(f,Be.Unmount)}),i=d.useRef([]),l=d.useRef(Promise.resolve()),a=d.useRef({enter:[],leave:[]}),p=U((f,h,v)=>{i.current.splice(0),t&&(t.chains.current[h]=t.chains.current[h].filter(([b])=>b!==f)),t==null||t.chains.current[h].push([f,new Promise(b=>{i.current.push(b)})]),t==null||t.chains.current[h].push([f,new Promise(b=>{Promise.all(a.current[h].map(([E,w])=>w)).then(()=>b())})]),h==="enter"?l.current=l.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(h)):v(h)}),m=U((f,h,v)=>{Promise.all(a.current[h].splice(0).map(([b,E])=>E)).then(()=>{var b;(b=i.current.shift())==null||b()}).then(()=>v(h))});return d.useMemo(()=>({children:r,register:u,unregister:c,onStart:p,onStop:m,wait:l,chains:a}),[u,c,r,p,m,a,l])}let qo=d.Fragment,Jo=Dt.RenderStrategy;function rc(e,t){var n,r;let{transition:o=!0,beforeEnter:s,afterEnter:c,beforeLeave:u,afterLeave:i,enter:l,enterFrom:a,enterTo:p,entered:m,leave:f,leaveFrom:h,leaveTo:v,...b}=e,[E,w]=d.useState(null),y=d.useRef(null),S=Qo(e),C=xe(...S?[y,t,w]:t===null?[]:[t]),O=(n=b.unmount)==null||n?Be.Unmount:Be.Hidden,{show:N,appear:_,initial:W}=tc(),[M,F]=d.useState(N?"visible":"hidden"),j=nc(),{register:D,unregister:L}=j;J(()=>D(y),[D,y]),J(()=>{if(O===Be.Hidden&&y.current){if(N&&M!=="visible"){F("visible");return}return ye(M,{hidden:()=>L(y),visible:()=>D(y)})}},[M,y,D,L,N,O]);let B=Qn();J(()=>{if(S&&B&&M==="visible"&&y.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[y,M,B,S]);let z=W&&!_,Y=_&&N&&W,T=d.useRef(!1),R=Xo(()=>{T.current||(F("hidden"),L(y))},j),Q=U(k=>{T.current=!0;let ee=k?"enter":"leave";R.onStart(y,ee,ce=>{ce==="enter"?s==null||s():ce==="leave"&&(u==null||u())})}),me=U(k=>{let ee=k?"enter":"leave";T.current=!1,R.onStop(y,ee,ce=>{ce==="enter"?c==null||c():ce==="leave"&&(i==null||i())}),ee==="leave"&&!Jt(R)&&(F("hidden"),L(y))});d.useEffect(()=>{S&&o||(Q(N),me(N))},[N,S,o]);let Z=!(!o||!S||!B||z),[,q]=co(Z,E,N,{start:Q,end:me}),et=He({ref:C,className:((r=bn(b.className,Y&&l,Y&&a,q.enter&&l,q.enter&&q.closed&&a,q.enter&&!q.closed&&p,q.leave&&f,q.leave&&!q.closed&&h,q.leave&&q.closed&&v,!q.transition&&N&&m))==null?void 0:r.trim())||void 0,...uo(q)}),ke=0;M==="visible"&&(ke|=Oe.Open),M==="hidden"&&(ke|=Oe.Closed),N&&M==="hidden"&&(ke|=Oe.Opening),!N&&M==="visible"&&(ke|=Oe.Closing);let tt=ge();return d.createElement(qt.Provider,{value:R},d.createElement(Uo,{value:ke},tt({ourProps:et,theirProps:b,defaultTag:qo,features:Jo,visible:M==="visible",name:"Transition.Child"})))}function oc(e,t){let{show:n,appear:r=!1,unmount:o=!0,...s}=e,c=d.useRef(null),u=Qo(e),i=xe(...u?[c,t]:t===null?[]:[t]);Qn();let l=Kn();if(n===void 0&&l!==null&&(n=(l&Oe.Open)===Oe.Open),n===void 0)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[a,p]=d.useState(n?"visible":"hidden"),m=Xo(()=>{n||p("hidden")}),[f,h]=d.useState(!0),v=d.useRef([n]);J(()=>{f!==!1&&v.current[v.current.length-1]!==n&&(v.current.push(n),h(!1))},[v,n]);let b=d.useMemo(()=>({show:n,appear:r,initial:f}),[n,r,f]);J(()=>{n?p("visible"):!Jt(m)&&c.current!==null&&p("hidden")},[n,m]);let E={unmount:o},w=U(()=>{var C;f&&h(!1),(C=e.beforeEnter)==null||C.call(e)}),y=U(()=>{var C;f&&h(!1),(C=e.beforeLeave)==null||C.call(e)}),S=ge();return d.createElement(qt.Provider,{value:m},d.createElement(Xt.Provider,{value:b},S({ourProps:{...E,as:d.Fragment,children:d.createElement(Zo,{ref:i,...E,...s,beforeEnter:w,beforeLeave:y})},theirProps:{},defaultTag:d.Fragment,features:Jo,visible:a==="visible",name:"Transition"})))}function ic(e,t){let n=d.useContext(Xt)!==null,r=Kn()!==null;return d.createElement(d.Fragment,null,!n&&r?d.createElement(Xn,{ref:t,...e}):d.createElement(Zo,{ref:t,...e}))}let Xn=pe(oc),Zo=pe(rc),sc=pe(ic),ei=Object.assign(Xn,{Child:sc,Root:Xn});function lc(e,t){let n=d.useRef({left:0,top:0});if(J(()=>{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 ti=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function ni(e){var t,n;let r=(t=e.innerText)!=null?t:"",o=e.cloneNode(!0);if(!Ie(o))return r;let s=!1;for(let u of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))u.remove(),s=!0;let c=s?(n=o.innerText)!=null?n:"":r;return ti.test(c)&&(c=c.replace(ti,"")),c}function ac(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 s=document.getElementById(o);if(s){let c=s.getAttribute("aria-label");return typeof c=="string"?c.trim():ni(s).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return ni(e).trim()}function uc(e){let t=d.useRef(""),n=d.useRef("");return U(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(t.current===o)return n.current;let s=ac(r).trim().toLowerCase();return t.current=o,n.current=s,s})}var cc=Object.defineProperty,fc=(e,t,n)=>t in e?cc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ri=(e,t,n)=>(fc(e,typeof t!="symbol"?t+"":t,n),n),le=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(le||{}),Fe=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Fe||{}),Zt=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Zt||{}),oi=(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.RegisterOptions=5]="RegisterOptions",e[e.UnregisterOptions=6]="UnregisterOptions",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetOptionsElement=8]="SetOptionsElement",e[e.SortOptions=9]="SortOptions",e))(oi||{});function ii(e,t=n=>n){let n=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=to(t(e.options.slice()),s=>s.dataRef.current.domRef.current),o=n?r.indexOf(n):null;return o===-1&&(o=null),{options:r,activeOptionIndex:o}}let dc={1(e){return e.dataRef.current.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,pendingFocus:{focus:te.Nothing},listboxState:1,__demoMode:!1}},0(e,t){if(e.dataRef.current.disabled||e.listboxState===0)return e;let n=e.activeOptionIndex,{isSelected:r}=e.dataRef.current,o=e.options.findIndex(s=>r(s.dataRef.current.value));return o!==-1&&(n=o),{...e,pendingFocus:t.focus,listboxState:0,activeOptionIndex:n,__demoMode:!1}},2(e,t){var n,r,o,s,c;if(e.dataRef.current.disabled||e.listboxState===1)return e;let u={...e,searchQuery:"",activationTrigger:(n=t.trigger)!=null?n:1,__demoMode:!1};if(t.focus===te.Nothing)return{...u,activeOptionIndex:null};if(t.focus===te.Specific)return{...u,activeOptionIndex:e.options.findIndex(a=>a.id===t.id)};if(t.focus===te.Previous){let a=e.activeOptionIndex;if(a!==null){let p=e.options[a].dataRef.current.domRef,m=Qt(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=e.options[m].dataRef.current.domRef;if(((r=p.current)==null?void 0:r.previousElementSibling)===f.current||((o=f.current)==null?void 0:o.previousElementSibling)===null)return{...u,activeOptionIndex:m}}}}else if(t.focus===te.Next){let a=e.activeOptionIndex;if(a!==null){let p=e.options[a].dataRef.current.domRef,m=Qt(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});if(m!==null){let f=e.options[m].dataRef.current.domRef;if(((s=p.current)==null?void 0:s.nextElementSibling)===f.current||((c=f.current)==null?void 0:c.nextElementSibling)===null)return{...u,activeOptionIndex:m}}}}let i=ii(e),l=Qt(t,{resolveItems:()=>i.options,resolveActiveIndex:()=>i.activeOptionIndex,resolveId:a=>a.id,resolveDisabled:a=>a.dataRef.current.disabled});return{...u,...i,activeOptionIndex:l}},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(c=>{var u;return!c.dataRef.current.disabled&&((u=c.dataRef.current.textValue)==null?void 0:u.startsWith(r))}),s=o?e.options.indexOf(o):-1;return s===-1||s===e.activeOptionIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeOptionIndex:s,activationTrigger:1}},4(e){return e.dataRef.current.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},5:(e,t)=>{let n=e.options.concat(t.options),r=e.activeOptionIndex;if(e.pendingFocus.focus!==te.Nothing&&(r=Qt(e.pendingFocus,{resolveItems:()=>n,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled})),e.activeOptionIndex===null){let{isSelected:o}=e.dataRef.current;if(o){let s=n.findIndex(c=>o==null?void 0:o(c.dataRef.current.value));s!==-1&&(r=s)}}return{...e,options:n,activeOptionIndex:r,pendingFocus:{focus:te.Nothing},pendingShouldSort:!0}},6:(e,t)=>{let n=e.options,r=[],o=new Set(t.options);for(let[s,c]of n.entries())if(o.has(c.id)&&(r.push(s),o.delete(c.id),o.size===0))break;if(r.length>0){n=n.slice();for(let s of r.reverse())n.splice(s,1)}return{...e,options: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},9:e=>e.pendingShouldSort?{...e,...ii(e),pendingShouldSort:!1}:e};class qn extends Vr{constructor(t){super(t),ri(this,"actions",{onChange:n=>{let{onChange:r,compare:o,mode:s,value:c}=this.state.dataRef.current;return ye(s,{0:()=>r==null?void 0:r(n),1:()=>{let u=c.slice(),i=u.findIndex(l=>o(l,n));return i===-1?u.push(n):u.splice(i,1),r==null?void 0:r(u)}})},registerOption:$n(()=>{let n=[],r=new Set;return[(o,s)=>{r.has(s)||(r.add(s),n.push({id:o,dataRef:s}))},()=>(r.clear(),this.send({type:5,options:n.splice(0)}))]}),unregisterOption:$n(()=>{let n=[];return[r=>n.push(r),()=>{this.send({type:6,options:n.splice(0)})}]}),goToOption:$n(()=>{let n=null;return[(r,o)=>{n={type:2,...r,trigger:o}},()=>n&&this.send(n)]}),closeListbox:()=>{this.send({type:1})},openListbox:n=>{this.send({type:0,focus:n})},selectActiveOption:()=>{if(this.state.activeOptionIndex!==null){let{dataRef:n,id:r}=this.state.options[this.state.activeOptionIndex];this.actions.onChange(n.current.value),this.send({type:2,focus:te.Specific,id:r})}},selectOption:n=>{let r=this.state.options.find(o=>o.id===n);r&&this.actions.onChange(r.dataRef.current.value)},search:n=>{this.send({type:3,value:n})},clearSearch:()=>{this.send({type:4})},setButtonElement:n=>{this.send({type:7,element:n})},setOptionsElement:n=>{this.send({type:8,element:n})}}),ri(this,"selectors",{activeDescendantId(n){var r;let o=n.activeOptionIndex,s=n.options;return o===null||(r=s[o])==null?void 0:r.id},isActive(n,r){var o;let s=n.activeOptionIndex,c=n.options;return s!==null?((o=c[s])==null?void 0:o.id)===r:!1},shouldScrollIntoView(n,r){return n.__demoMode||n.listboxState!==0||n.activationTrigger===0?!1:this.isActive(n,r)}}),this.on(5,()=>{requestAnimationFrame(()=>{this.send({type:9})})});{let n=this.state.id,r=On.get(null);this.disposables.add(r.on(Yr.Push,o=>{!r.selectors.isTop(o,n)&&this.state.listboxState===0&&this.actions.closeListbox()})),this.on(0,()=>r.actions.push(n)),this.on(1,()=>r.actions.pop(n))}}static new({id:t,__demoMode:n=!1}){return new qn({id:t,dataRef:{current:{}},listboxState:n?0:1,options:[],searchQuery:"",activeOptionIndex:null,activationTrigger:1,buttonElement:null,optionsElement:null,pendingShouldSort:!1,pendingFocus:{focus:te.Nothing},__demoMode:n})}reduce(t,n){return ye(n.type,dc,t,n)}}const si=d.createContext(null);function Jn(e){let t=d.useContext(si);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,li),n}return t}function li({id:e,__demoMode:t=!1}){let n=d.useMemo(()=>qn.new({id:e,__demoMode:t}),[]);return Go(()=>n.dispose()),n}let en=d.createContext(null);en.displayName="ListboxDataContext";function Tt(e){let t=d.useContext(en);if(t===null){let n=new Error(`<${e} /> is missing a parent <Listbox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Tt),n}return t}let pc=d.Fragment;function mc(e,t){let n=d.useId(),r=vn(),{value:o,defaultValue:s,form:c,name:u,onChange:i,by:l,invalid:a=!1,disabled:p=r||!1,horizontal:m=!1,multiple:f=!1,__demoMode:h=!1,...v}=e;const b=m?"horizontal":"vertical";let E=xe(t),w=Ks(s),[y=f?[]:void 0,S]=Ys(o,i,w),C=li({id:n,__demoMode:h}),O=d.useRef({static:!1,hold:!1}),N=d.useRef(new Map),_=xl(l),W=d.useCallback(Z=>ye(M.mode,{[Fe.Multi]:()=>y.some(q=>_(q,Z)),[Fe.Single]:()=>_(y,Z)}),[y]),M=d.useMemo(()=>({value:y,disabled:p,invalid:a,mode:f?Fe.Multi:Fe.Single,orientation:b,onChange:S,compare:_,isSelected:W,optionsPropsRef:O,listRef:N}),[y,p,a,f,b,S,_,W,O,N]);J(()=>{C.state.dataRef.current=M},[M]);let F=Ee(C,Z=>Z.listboxState),j=On.get(null),D=Ee(j,d.useCallback(Z=>j.selectors.isTop(Z,n),[j,n])),[L,B]=Ee(C,Z=>[Z.buttonElement,Z.optionsElement]);Yl(D,[L,B],(Z,q)=>{C.send({type:oi.CloseListbox}),eo(q,Ln.Loose)||(Z.preventDefault(),L==null||L.focus())});let z=d.useMemo(()=>({open:F===le.Open,disabled:p,invalid:a,value:y}),[F,p,a,y]),[Y,T]=ml({inherit:!0}),R={ref:E},Q=d.useCallback(()=>{if(w!==void 0)return S==null?void 0:S(w)},[S,w]),me=ge();return d.createElement(T,{value:Y,props:{htmlFor:L==null?void 0:L.id},slot:{open:F===le.Open,disabled:p}},d.createElement(ju,null,d.createElement(si.Provider,{value:C},d.createElement(en.Provider,{value:M},d.createElement(Uo,{value:ye(F,{[le.Open]:Oe.Open,[le.Closed]:Oe.Closed})},u!=null&&y!=null&&d.createElement(el,{disabled:p,data:{[u]:y},form:c,onReset:Q}),me({ourProps:R,theirProps:v,slot:z,defaultTag:pc,name:"Listbox"}))))))}let hc="button";function gc(e,t){let n=d.useId(),r=Fr(),o=Tt("Listbox.Button"),s=Jn("Listbox.Button"),{id:c=r||`headlessui-listbox-button-${n}`,disabled:u=o.disabled||!1,autoFocus:i=!1,...l}=e,a=xe(t,Fu(),s.actions.setButtonElement),p=Lu(),[m,f,h]=Ee(s,T=>[T.listboxState,T.buttonElement,T.optionsElement]),v=m===le.Open;Xl(v,{trigger:f,action:d.useCallback(T=>{if(f!=null&&f.contains(T.target))return _t.Ignore;let R=T.target.closest('[role="option"]:not([data-disabled])');return Ie(R)?_t.Select(R):h!=null&&h.contains(T.target)?_t.Ignore:_t.Close},[f,h]),close:s.actions.closeListbox,select:s.actions.selectActiveOption});let b=U(T=>{switch(T.key){case se.Enter:Qs(T.currentTarget);break;case se.Space:case se.ArrowDown:T.preventDefault(),s.actions.openListbox({focus:o.value?te.Nothing:te.First});break;case se.ArrowUp:T.preventDefault(),s.actions.openListbox({focus:o.value?te.Nothing:te.Last});break}}),E=U(T=>{switch(T.key){case se.Space:T.preventDefault();break}}),w=U(T=>{var R;if(T.button===zo.Left){if(ll(T.currentTarget))return T.preventDefault();s.state.listboxState===le.Open?(de.flushSync(()=>s.actions.closeListbox()),(R=s.state.buttonElement)==null||R.focus({preventScroll:!0})):(T.preventDefault(),s.actions.openListbox({focus:te.Nothing}))}}),y=d.useRef(null),S=U(T=>{y.current=T.pointerType,T.pointerType==="mouse"&&w(T)}),C=U(T=>{y.current!=="mouse"&&w(T)}),O=U(T=>T.preventDefault()),N=Rr([c]),_=cl(),{isFocusVisible:W,focusProps:M}=Is({autoFocus:i}),{isHovered:F,hoverProps:j}=Ds({isDisabled:u}),{pressed:D,pressProps:L}=Hs({disabled:u}),B=d.useMemo(()=>({open:m===le.Open,active:D||m===le.Open,disabled:u,invalid:o.invalid,value:o.value,hover:F,focus:W,autofocus:i}),[m,o.value,u,F,W,D,o.invalid,i]),z=Ee(s,T=>T.listboxState===le.Open),Y=Tr(p(),{ref:a,id:c,type:ql(e,f),"aria-haspopup":"listbox","aria-controls":h==null?void 0:h.id,"aria-expanded":z,"aria-labelledby":N,"aria-describedby":_,disabled:u||void 0,autoFocus:i,onKeyDown:b,onKeyUp:E,onKeyPress:O,onPointerDown:S,onClick:C},M,j,L);return ge()({ourProps:Y,theirProps:l,slot:B,defaultTag:hc,name:"Listbox.Button"})}let ai=d.createContext(!1),vc="div",bc=Dt.RenderStrategy|Dt.Static;function yc(e,t){let n=d.useId(),{id:r=`headlessui-listbox-options-${n}`,anchor:o,portal:s=!1,modal:c=!0,transition:u=!1,...i}=e,l=Nu(o),[a,p]=d.useState(null);l&&(s=!0);let m=Tt("Listbox.Options"),f=Jn("Listbox.Options"),[h,v,b,E]=Ee(f,k=>[k.listboxState,k.buttonElement,k.optionsElement,k.__demoMode]),w=Dn(v),y=Dn(b),S=Kn(),[C,O]=co(u,a,S!==null?(S&Oe.Open)===Oe.Open:h===le.Open);Il(C,v,f.actions.closeListbox);let N=E?!1:c&&h===le.Open;ia(N,y);let _=E?!1:c&&h===le.Open;Dl(_,{allowed:d.useCallback(()=>[v,b],[v,b])});let W=h!==le.Open,M=lc(W,v)?!1:C,F=C&&h===le.Closed,j=Ru(F,m.value),D=U(k=>m.compare(j,k)),L=Ee(f,k=>{var ee;if(l==null||!((ee=l==null?void 0:l.to)!=null&&ee.includes("selection")))return null;let ce=k.options.findIndex(ze=>D(ze.dataRef.current.value));return ce===-1&&(ce=0),ce}),B=(()=>{if(l==null)return;if(L===null)return{...l,inner:void 0};let k=Array.from(m.listRef.current.values());return{...l,inner:{listRef:{current:k},index:L}}})(),[z,Y]=Iu(B),T=Du(),R=xe(t,l?z:null,f.actions.setOptionsElement,p),Q=rt();d.useEffect(()=>{var k;let ee=b;ee&&h===le.Open&&ee!==((k=bt(ee))==null?void 0:k.activeElement)&&(ee==null||ee.focus({preventScroll:!0}))},[h,b]);let me=U(k=>{var ee,ce;switch(Q.dispose(),k.key){case se.Space:if(f.state.searchQuery!=="")return k.preventDefault(),k.stopPropagation(),f.actions.search(k.key);case se.Enter:if(k.preventDefault(),k.stopPropagation(),f.state.activeOptionIndex!==null){let{dataRef:ze}=f.state.options[f.state.activeOptionIndex];f.actions.onChange(ze.current.value)}m.mode===Fe.Single&&(de.flushSync(()=>f.actions.closeListbox()),(ee=f.state.buttonElement)==null||ee.focus({preventScroll:!0}));break;case ye(m.orientation,{vertical:se.ArrowDown,horizontal:se.ArrowRight}):return k.preventDefault(),k.stopPropagation(),f.actions.goToOption({focus:te.Next});case ye(m.orientation,{vertical:se.ArrowUp,horizontal:se.ArrowLeft}):return k.preventDefault(),k.stopPropagation(),f.actions.goToOption({focus:te.Previous});case se.Home:case se.PageUp:return k.preventDefault(),k.stopPropagation(),f.actions.goToOption({focus:te.First});case se.End:case se.PageDown:return k.preventDefault(),k.stopPropagation(),f.actions.goToOption({focus:te.Last});case se.Escape:k.preventDefault(),k.stopPropagation(),de.flushSync(()=>f.actions.closeListbox()),(ce=f.state.buttonElement)==null||ce.focus({preventScroll:!0});return;case se.Tab:k.preventDefault(),k.stopPropagation(),de.flushSync(()=>f.actions.closeListbox()),Vl(f.state.buttonElement,k.shiftKey?Fn.Previous:Fn.Next);break;default:k.key.length===1&&(f.actions.search(k.key),Q.setTimeout(()=>f.actions.clearSearch(),350));break}}),Z=Ee(f,k=>{var ee;return(ee=k.buttonElement)==null?void 0:ee.id}),q=d.useMemo(()=>({open:h===le.Open}),[h]),et=Tr(l?T():{},{id:r,ref:R,"aria-activedescendant":Ee(f,f.selectors.activeDescendantId),"aria-multiselectable":m.mode===Fe.Multi?!0:void 0,"aria-labelledby":Z,"aria-orientation":m.orientation,onKeyDown:me,role:"listbox",tabIndex:h===le.Open?0:void 0,style:{...i.style,...Y,"--button-width":El(v,!0).width},...uo(O)}),ke=ge(),tt=d.useMemo(()=>m.mode===Fe.Multi?m:{...m,isSelected:D},[m,D]);return d.createElement(Ju,{enabled:s?e.static||C:!1,ownerDocument:w},d.createElement(en.Provider,{value:tt},ke({ourProps:et,theirProps:i,slot:q,defaultTag:vc,features:bc,visible:M,name:"Listbox.Options"})))}let xc="div";function wc(e,t){let n=d.useId(),{id:r=`headlessui-listbox-option-${n}`,disabled:o=!1,value:s,...c}=e,u=d.useContext(ai)===!0,i=Tt("Listbox.Option"),l=Jn("Listbox.Option"),a=Ee(l,M=>l.selectors.isActive(M,r)),p=i.isSelected(s),m=d.useRef(null),f=uc(m),h=Ke({disabled:o,value:s,domRef:m,get textValue(){return f()}}),v=xe(t,m,M=>{M?i.listRef.current.set(r,M):i.listRef.current.delete(r)}),b=Ee(l,M=>l.selectors.shouldScrollIntoView(M,r));J(()=>{if(b)return Se().requestAnimationFrame(()=>{var M,F;(F=(M=m.current)==null?void 0:M.scrollIntoView)==null||F.call(M,{block:"nearest"})})},[b,m]),J(()=>{if(!u)return l.actions.registerOption(r,h),()=>l.actions.unregisterOption(r)},[h,r,u]);let E=U(M=>{var F;if(o)return M.preventDefault();l.actions.onChange(s),i.mode===Fe.Single&&(de.flushSync(()=>l.actions.closeListbox()),(F=l.state.buttonElement)==null||F.focus({preventScroll:!0}))}),w=U(()=>{if(o)return l.actions.goToOption({focus:te.Nothing});l.actions.goToOption({focus:te.Specific,id:r})}),y=sa(),S=U(M=>y.update(M)),C=U(M=>{y.wasMoved(M)&&(o||a&&l.state.activationTrigger===Zt.Pointer||l.actions.goToOption({focus:te.Specific,id:r},Zt.Pointer))}),O=U(M=>{y.wasMoved(M)&&(o||a&&l.state.activationTrigger===Zt.Pointer&&l.actions.goToOption({focus:te.Nothing}))}),N=d.useMemo(()=>({active:a,focus:a,selected:p,disabled:o,selectedOption:p&&u}),[a,p,o,u]),_=u?{}:{id:r,ref:v,role:"option",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,"aria-selected":p,disabled:void 0,onClick:E,onFocus:w,onPointerEnter:S,onMouseEnter:S,onPointerMove:C,onMouseMove:C,onPointerLeave:O,onMouseLeave:O},W=ge();return!p&&u?null:W({ourProps:_,theirProps:c,slot:N,defaultTag:xc,name:"Listbox.Option"})}let Ec=d.Fragment;function Cc(e,t){let{options:n,placeholder:r,...o}=e,s={ref:xe(t)},c=Tt("ListboxSelectedOption"),u=d.useMemo(()=>({}),[]),i=c.value===void 0||c.value===null||c.mode===Fe.Multi&&Array.isArray(c.value)&&c.value.length===0,l=ge();return d.createElement(ai.Provider,{value:!0},l({ourProps:s,theirProps:{...o,children:d.createElement(d.Fragment,null,r&&i?r:n)},slot:u,defaultTag:Ec,name:"ListboxSelectedOption"}))}let Sc=pe(mc),$c=pe(gc),Oc=bl,Tc=pe(yc),Pc=pe(wc),Ac=pe(Cc),Ue=Object.assign(Sc,{Button:$c,Label:Oc,Options:Tc,Option:Pc,SelectedOption:Ac});function Mc({title:e,titleId:t,...n},r){return A.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?A.createElement("title",{id:t},e):null,A.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const ui=A.forwardRef(Mc);function Nc({title:e,titleId:t,...n},r){return A.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?A.createElement("title",{id:t},e):null,A.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const ci=A.forwardRef(Nc),Fc=({tokens:e,selectedToken:t,onTokenChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>x.jsx("div",{className:`relative ${o}`,children:x.jsx(Ue,{value:t,onChange:n,disabled:r,children:({open:c})=>x.jsxs(x.Fragment,{children:[x.jsxs(Ue.Button,{className:`
76
76
  relative w-full h-9 text-text-primary bg-fill-input-primary
77
77
  items-center justify-between flex px-3 rounded-lg
78
78
  focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1
79
- ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-gray-600"}
80
- ${i?"ring-2 ring-blue-500":""}
81
- `,children:[O.jsx("span",{className:"text-sm leading-[18px] font-medium",children:"Asset"}),O.jsxs("div",{className:"flex items-center space-x-2",children:[t.iconUrl?O.jsx("img",{src:t.iconUrl,alt:t.token,className:"w-4 h-4 rounded-full"}):O.jsx("div",{className:"w-4 h-4 rounded-full bg-green-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:t.token.charAt(0)})}),O.jsx("span",{className:"text-sm text-white",children:t.symbol||t.token}),O.jsx(Si,{className:`w-4 h-4 text-gray-400 transition-transform duration-200 ${i?"rotate-180":""}`})]})]}),O.jsx(hi,{as:h.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:O.jsx(Je.Options,{className:`
79
+ ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
80
+ ${c?"ring-2 ring-blue-500":""}
81
+ `,children:[x.jsx("span",{className:"text-sm leading-[18px] font-medium",children:"Asset"}),x.jsxs("div",{className:"flex items-center",children:[t.iconUrl?x.jsx("img",{src:t.iconUrl,alt:t.token,className:"w-4 h-4 rounded-full"}):x.jsx("div",{className:"w-4 h-4 rounded-full bg-green-500 flex items-center justify-center",children:x.jsx("span",{className:"text-xs text-white font-bold",children:t.token.charAt(0)})}),x.jsx("span",{className:"text-sm text-white ml-1",children:t.symbol||t.token}),x.jsx(ci,{className:`w-4 h-4 ml-2 text-gray-400 transition-transform duration-200 ${c?"rotate-180":""}`})]})]}),x.jsx(ei,{as:d.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:x.jsx(Ue.Options,{className:`
82
82
  absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
83
- bg-gray-800 border border-gray-600 shadow-lg
83
+ bg-fill-input-primary border border-line-divider-secondary shadow-lg
84
84
  focus:outline-none
85
- `,children:e.map(u=>O.jsx(Je.Option,{value:u,className:({active:c,selected:s})=>`relative cursor-pointer select-none py-3 px-3 ${c?"bg-gray-700":""} ${s?"bg-gray-700":""}`,children:({selected:c})=>O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center space-x-3",children:[u.iconUrl?O.jsx("img",{src:u.iconUrl,alt:u.token,className:"w-5 h-5 rounded-full"}):O.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:u.token.charAt(0)})}),O.jsxs("div",{className:"flex flex-col",children:[O.jsx("span",{className:`text-sm font-medium ${c?"text-white":"text-gray-200"}`,children:u.symbol||u.token}),O.jsxs("span",{className:"text-xs text-gray-400",children:[u.decimals," decimals"]})]})]}),c&&O.jsx(Ci,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})}),tf=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o=""})=>(h.useEffect(()=>{console.log("πŸ”— ChainSelector: selectedChain updated",t)},[t]),O.jsx("div",{className:`relative ${o}`,children:O.jsx(Je,{value:t,onChange:n,disabled:r,children:({open:i})=>O.jsxs(O.Fragment,{children:[O.jsxs(Je.Button,{className:`
85
+ `,children:e.map(u=>x.jsx(Ue.Option,{value:u,className:({active:i,selected:l})=>`relative cursor-pointer select-none py-3 px-3 ${l?"bg-fill-btn-secondary":i?"bg-fill-input-secondary":""}`,children:({selected:i,active:l})=>x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex items-center space-x-3",children:[u.iconUrl?x.jsx("img",{src:u.iconUrl,alt:u.token,className:"w-5 h-5 rounded-full"}):x.jsx("div",{className:"w-5 h-5 rounded-full bg-green-500 flex items-center justify-center",children:x.jsx("span",{className:"text-xs text-white font-bold",children:u.token.charAt(0)})}),x.jsx("div",{className:"flex flex-col",children:x.jsx("span",{className:`text-sm font-medium ${i||l?"text-text-primary":"text-text-tertiary"}`,children:u.symbol||u.token})})]}),i&&x.jsx(ui,{className:"w-4 h-4 text-blue-400"})]})},u.tokenAddress))})})]})})}),Lc=({chains:e,selectedChain:t,onChainChange:n,disabled:r=!1,className:o="",walletType:s="mpc"})=>x.jsx("div",{className:`relative ${o}`,children:x.jsx(Ue,{value:t,onChange:n,disabled:r,children:({open:c})=>x.jsxs(x.Fragment,{children:[x.jsxs(Ue.Button,{className:`
86
86
  relative w-full h-9 text-text-primary bg-fill-input-primary
87
87
  items-center justify-between flex px-3 rounded-lg
88
88
  focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-1
89
- ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-gray-600"}
90
- ${i?"ring-2 ring-blue-500":""}
91
- `,children:[O.jsx("span",{className:"text-sm leading-[18px] font-medium",children:"Chain"}),O.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?O.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):O.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),O.jsx("span",{className:"text-sm text-white",children:t.chain}),O.jsx(Si,{className:`w-4 h-4 text-gray-400 transition-transform duration-200 ${i?"rotate-180":""}`})]})]}),O.jsx(hi,{as:h.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:O.jsx(Je.Options,{className:`
89
+ ${r?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-fill-btn-secondary-hover"}
90
+ ${c?"ring-2 ring-blue-500":""}
91
+ `,children:[x.jsx("span",{className:"text-sm leading-[18px] font-medium",children:"Chain"}),x.jsxs("div",{className:"flex items-center space-x-2",children:[t.chainIconUrl?x.jsx("img",{src:t.chainIconUrl,alt:t.chain,className:"w-4 h-4 rounded-full"}):x.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-500 flex items-center justify-center",children:x.jsx("span",{className:"text-xs text-white font-bold",children:t.chain.charAt(0)})}),x.jsx("span",{className:"text-sm text-white ml-1",children:t.chain}),x.jsx(ci,{className:`w-4 h-4 ml-2 text-gray-400 transition-transform duration-200 ${c?"rotate-180":""}`})]})]}),x.jsx(ei,{as:d.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:x.jsx(Ue.Options,{className:`
92
92
  absolute z-50 mt-1 w-full max-h-60 overflow-auto rounded-lg
93
93
  bg-fill-input-primary border border-line-divider-secondary shadow-lg
94
94
  focus:outline-none
95
- `,children:e.map(u=>O.jsx(Je.Option,{value:u,disabled:!u.allowDeposit,className:({active:c,selected:s,disabled:l})=>`relative cursor-pointer select-none py-3 px-3 ${l?"opacity-50 cursor-not-allowed":c?"bg-gray-700":""} ${s?"bg-gray-700":""}`,children:({selected:c,active:s})=>O.jsxs("div",{className:"flex items-center justify-between",children:[O.jsxs("div",{className:"flex items-center space-x-3",children:[u.chainIconUrl?O.jsx("img",{src:u.chainIconUrl,alt:u.chain,className:"w-5 h-5 rounded-full"}):O.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:O.jsx("span",{className:"text-xs text-white font-bold",children:u.chain.charAt(0)})}),O.jsxs("div",{className:"flex flex-col",children:[O.jsx("span",{className:`text-sm font-medium ${c?"text-white":"text-gray-200"}`,children:u.chain}),u.blockTime&&O.jsxs("span",{className:"text-xs text-gray-400",children:["~",u.blockTime,"s block time"]})]})]}),c&&O.jsx(Ci,{className:"w-4 h-4 text-blue-400"})]})},u.chainId))})})]})})})),nf=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o})=>{h.useEffect(()=>{var f;console.log("πŸ” MPCChainTokenSelector: Props updated",{curSelectToken:r,currentActiveChain:e==null?void 0:e.chain,availableTokens:((f=e==null?void 0:e.tokenList)==null?void 0:f.length)||0})},[r,e]);const i=h.useMemo(()=>(e==null?void 0:e.tokenList)||[],[e]),u=h.useMemo(()=>i.find(p=>p.token===r||p.symbol===r)||i[0],[i,r]),c=f=>{var p;if(console.log("πŸ”— MPCChainTokenSelector: Chain change triggered",{chain:f.chain,availableTokens:((p=f.tokenList)==null?void 0:p.length)||0}),n(f.chainId),f.tokenList&&f.tokenList.length>0&&!f.tokenList.some(v=>v.token===r||v.symbol===r)){const v=f.tokenList[0];console.log("πŸ”„ MPCChainTokenSelector: Auto-selecting first token",v.token),o(v.symbol||v.token)}},s=f=>{console.log("πŸ”„ MPCChainTokenSelector: Token change triggered",f.token),o(f.symbol||f.token)},l=h.useMemo(()=>t.map(f=>({chainId:f.chainId,chain:f.chain,chainIconUrl:f.chainIconUrl,allowDeposit:f.allowDeposit,blockTime:f.blockTime,txConfirm:f.txConfirm})),[t]),a=h.useMemo(()=>({chainId:e.chainId,chain:e.chain,chainIconUrl:e.chainIconUrl,allowDeposit:e.allowDeposit,blockTime:e.blockTime,txConfirm:e.txConfirm}),[e]),d=h.useMemo(()=>i.map(f=>({token:f.token,symbol:f.symbol,iconUrl:f.iconUrl,decimals:f.decimals,tokenAddress:f.tokenAddress})),[i]);return O.jsxs("div",{className:"space-y-4",children:[O.jsx(tf,{chains:l,selectedChain:a,onChainChange:f=>{const p=t.find(m=>m.chainId===f.chainId);p&&c(p)},className:"w-full"}),O.jsx(ef,{tokens:d,selectedToken:u?{token:u.token,symbol:u.symbol,iconUrl:u.iconUrl,decimals:u.decimals,tokenAddress:u.tokenAddress}:d[0],onTokenChange:s,className:"w-full"})]})};var rf=Object.defineProperty,an=Object.getOwnPropertySymbols,Oi=Object.prototype.hasOwnProperty,Ti=Object.prototype.propertyIsEnumerable,$i=(e,t,n)=>t in e?rf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ir=(e,t)=>{for(var n in t||(t={}))Oi.call(t,n)&&$i(e,n,t[n]);if(an)for(var n of an(t))Ti.call(t,n)&&$i(e,n,t[n]);return e},sr=(e,t)=>{var n={};for(var r in e)Oi.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&an)for(var r of an(e))t.indexOf(r)<0&&Ti.call(e,r)&&(n[r]=e[r]);return n};/**
95
+ `,children:e.filter(u=>u[s==="mpc"?"allowAaDeposit":"allowDeposit"]!==!1).map(u=>x.jsx(Ue.Option,{value:u,className:({active:i,selected:l})=>`relative cursor-pointer select-none py-3 px-3 ${l?"bg-fill-btn-secondary":i?"bg-fill-input-secondary":""}`,children:({selected:i,active:l})=>x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsxs("div",{className:"flex items-center space-x-3",children:[u.chainIconUrl?x.jsx("img",{src:u.chainIconUrl,alt:u.chain,className:"w-5 h-5 rounded-full"}):x.jsx("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center",children:x.jsx("span",{className:"text-xs text-white font-bold",children:u.chain.charAt(0)})}),x.jsx("div",{className:"flex flex-col",children:x.jsx("span",{className:`text-sm font-medium ${i||l?"text-text-primary":"text-text-tertiary"}`,children:u.chain})})]}),i&&x.jsx(ui,{className:"w-4 h-4 text-blue-400"})]})},u.chainId))})})]})})}),fi=({currentActiveChain:e,chainList:t,onChainChange:n,curSelectToken:r,onTokenChange:o,walletType:s="mpc"})=>{const c=d.useMemo(()=>(e==null?void 0:e.tokenList)||[],[e]),u=f=>{if(n(f.chainId),f.tokenList&&f.tokenList.length>0&&!f.tokenList.some(v=>v.token===r||v.symbol===r)){const v=f.tokenList[0];o(v.symbol||v.token)}},i=f=>{o(f.symbol||f.token)},l=d.useMemo(()=>t.map(f=>f),[t]),a=d.useMemo(()=>l.find(f=>f.chainId===e.chainId)||l[0],[l,e.chainId]),p=d.useMemo(()=>c.map(f=>({token:f.token,symbol:f.symbol,iconUrl:f.iconUrl,decimals:f.decimals,tokenAddress:f.tokenAddress})),[c]),m=d.useMemo(()=>{if(p.length!==0)return p.find(f=>f.token===r||f.symbol===r)||p[0]},[p,r]);return x.jsxs("div",{className:"space-y-4",children:[x.jsx(Lc,{chains:l,selectedChain:a,onChainChange:f=>{const h=t.find(v=>v.chainId===f.chainId);h&&u(h)},walletType:s,className:"w-full"}),p.length>0?m&&x.jsx(Fc,{tokens:p,selectedToken:m,onTokenChange:i,walletType:s,className:"w-full"}):x.jsx("div",{className:"w-full h-9 bg-fill-input-primary rounded-lg flex items-center justify-center",children:x.jsx("span",{className:"text-sm text-gray-400",children:"No tokens available"})})]})};var Dc=Object.defineProperty,tn=Object.getOwnPropertySymbols,di=Object.prototype.hasOwnProperty,pi=Object.prototype.propertyIsEnumerable,mi=(e,t,n)=>t in e?Dc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Zn=(e,t)=>{for(var n in t||(t={}))di.call(t,n)&&mi(e,n,t[n]);if(tn)for(var n of tn(t))pi.call(t,n)&&mi(e,n,t[n]);return e},er=(e,t)=>{var n={};for(var r in e)di.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tn)for(var r of tn(e))t.indexOf(r)<0&&pi.call(e,r)&&(n[r]=e[r]);return n};/**
96
96
  * @license QR Code generator library (TypeScript)
97
97
  * Copyright (c) Project Nayuki.
98
98
  * SPDX-License-Identifier: MIT
99
- */var it;(e=>{const t=class Z{constructor(s,l,a,d){if(this.version=s,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],s<Z.MIN_VERSION||s>Z.MAX_VERSION)throw new RangeError("Version value out of range");if(d<-1||d>7)throw new RangeError("Mask value out of range");this.size=s*4+17;let f=[];for(let m=0;m<this.size;m++)f.push(!1);for(let m=0;m<this.size;m++)this.modules.push(f.slice()),this.isFunction.push(f.slice());this.drawFunctionPatterns();const p=this.addEccAndInterleave(a);if(this.drawCodewords(p),d==-1){let m=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const b=this.getPenaltyScore();b<m&&(d=v,m=b),this.applyMask(v)}}o(0<=d&&d<=7),this.mask=d,this.applyMask(d),this.drawFormatBits(d),this.isFunction=[]}static encodeText(s,l){const a=e.QrSegment.makeSegments(s);return Z.encodeSegments(a,l)}static encodeBinary(s,l){const a=e.QrSegment.makeBytes(s);return Z.encodeSegments([a],l)}static encodeSegments(s,l,a=1,d=40,f=-1,p=!0){if(!(Z.MIN_VERSION<=a&&a<=d&&d<=Z.MAX_VERSION)||f<-1||f>7)throw new RangeError("Invalid value");let m,v;for(m=a;;m++){const y=Z.getNumDataCodewords(m,l)*8,S=u.getTotalBits(s,m);if(S<=y){v=S;break}if(m>=d)throw new RangeError("Data too long")}for(const y of[Z.Ecc.MEDIUM,Z.Ecc.QUARTILE,Z.Ecc.HIGH])p&&v<=Z.getNumDataCodewords(m,y)*8&&(l=y);let b=[];for(const y of s){n(y.mode.modeBits,4,b),n(y.numChars,y.mode.numCharCountBits(m),b);for(const S of y.getData())b.push(S)}o(b.length==v);const x=Z.getNumDataCodewords(m,l)*8;o(b.length<=x),n(0,Math.min(4,x-b.length),b),n(0,(8-b.length%8)%8,b),o(b.length%8==0);for(let y=236;b.length<x;y^=253)n(y,8,b);let w=[];for(;w.length*8<b.length;)w.push(0);return b.forEach((y,S)=>w[S>>>3]|=y<<7-(S&7)),new Z(m,l,w,f)}getModule(s,l){return 0<=s&&s<this.size&&0<=l&&l<this.size&&this.modules[l][s]}getModules(){return this.modules}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2==0),this.setFunctionModule(a,6,a%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const s=this.getAlignmentPatternPositions(),l=s.length;for(let a=0;a<l;a++)for(let d=0;d<l;d++)a==0&&d==0||a==0&&d==l-1||a==l-1&&d==0||this.drawAlignmentPattern(s[a],s[d]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(s){const l=this.errorCorrectionLevel.formatBits<<3|s;let a=l;for(let f=0;f<10;f++)a=a<<1^(a>>>9)*1335;const d=(l<<10|a)^21522;o(d>>>15==0);for(let f=0;f<=5;f++)this.setFunctionModule(8,f,r(d,f));this.setFunctionModule(8,7,r(d,6)),this.setFunctionModule(8,8,r(d,7)),this.setFunctionModule(7,8,r(d,8));for(let f=9;f<15;f++)this.setFunctionModule(14-f,8,r(d,f));for(let f=0;f<8;f++)this.setFunctionModule(this.size-1-f,8,r(d,f));for(let f=8;f<15;f++)this.setFunctionModule(8,this.size-15+f,r(d,f));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let s=this.version;for(let a=0;a<12;a++)s=s<<1^(s>>>11)*7973;const l=this.version<<12|s;o(l>>>18==0);for(let a=0;a<18;a++){const d=r(l,a),f=this.size-11+a%3,p=Math.floor(a/3);this.setFunctionModule(f,p,d),this.setFunctionModule(p,f,d)}}drawFinderPattern(s,l){for(let a=-4;a<=4;a++)for(let d=-4;d<=4;d++){const f=Math.max(Math.abs(d),Math.abs(a)),p=s+d,m=l+a;0<=p&&p<this.size&&0<=m&&m<this.size&&this.setFunctionModule(p,m,f!=2&&f!=4)}}drawAlignmentPattern(s,l){for(let a=-2;a<=2;a++)for(let d=-2;d<=2;d++)this.setFunctionModule(s+d,l+a,Math.max(Math.abs(d),Math.abs(a))!=1)}setFunctionModule(s,l,a){this.modules[l][s]=a,this.isFunction[l][s]=!0}addEccAndInterleave(s){const l=this.version,a=this.errorCorrectionLevel;if(s.length!=Z.getNumDataCodewords(l,a))throw new RangeError("Invalid argument");const d=Z.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][l],f=Z.ECC_CODEWORDS_PER_BLOCK[a.ordinal][l],p=Math.floor(Z.getNumRawDataModules(l)/8),m=d-p%d,v=Math.floor(p/d);let b=[];const x=Z.reedSolomonComputeDivisor(f);for(let y=0,S=0;y<d;y++){let E=s.slice(S,S+v-f+(y<m?0:1));S+=E.length;const F=Z.reedSolomonComputeRemainder(E,x);y<m&&E.push(0),b.push(E.concat(F))}let w=[];for(let y=0;y<b[0].length;y++)b.forEach((S,E)=>{(y!=v-f||E>=m)&&w.push(S[y])});return o(w.length==p),w}drawCodewords(s){if(s.length!=Math.floor(Z.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let a=this.size-1;a>=1;a-=2){a==6&&(a=5);for(let d=0;d<this.size;d++)for(let f=0;f<2;f++){const p=a-f,v=(a+1&2)==0?this.size-1-d:d;!this.isFunction[v][p]&&l<s.length*8&&(this.modules[v][p]=r(s[l>>>3],7-(l&7)),l++)}}o(l==s.length*8)}applyMask(s){if(s<0||s>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let a=0;a<this.size;a++){let d;switch(s){case 0:d=(a+l)%2==0;break;case 1:d=l%2==0;break;case 2:d=a%3==0;break;case 3:d=(a+l)%3==0;break;case 4:d=(Math.floor(a/3)+Math.floor(l/2))%2==0;break;case 5:d=a*l%2+a*l%3==0;break;case 6:d=(a*l%2+a*l%3)%2==0;break;case 7:d=((a+l)%2+a*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][a]&&d&&(this.modules[l][a]=!this.modules[l][a])}}getPenaltyScore(){let s=0;for(let f=0;f<this.size;f++){let p=!1,m=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[f][b]==p?(m++,m==5?s+=Z.PENALTY_N1:m>5&&s++):(this.finderPenaltyAddHistory(m,v),p||(s+=this.finderPenaltyCountPatterns(v)*Z.PENALTY_N3),p=this.modules[f][b],m=1);s+=this.finderPenaltyTerminateAndCount(p,m,v)*Z.PENALTY_N3}for(let f=0;f<this.size;f++){let p=!1,m=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[b][f]==p?(m++,m==5?s+=Z.PENALTY_N1:m>5&&s++):(this.finderPenaltyAddHistory(m,v),p||(s+=this.finderPenaltyCountPatterns(v)*Z.PENALTY_N3),p=this.modules[b][f],m=1);s+=this.finderPenaltyTerminateAndCount(p,m,v)*Z.PENALTY_N3}for(let f=0;f<this.size-1;f++)for(let p=0;p<this.size-1;p++){const m=this.modules[f][p];m==this.modules[f][p+1]&&m==this.modules[f+1][p]&&m==this.modules[f+1][p+1]&&(s+=Z.PENALTY_N2)}let l=0;for(const f of this.modules)l=f.reduce((p,m)=>p+(m?1:0),l);const a=this.size*this.size,d=Math.ceil(Math.abs(l*20-a*10)/a)-1;return o(0<=d&&d<=9),s+=d*Z.PENALTY_N4,o(0<=s&&s<=2568888),s}getAlignmentPatternPositions(){if(this.version==1)return[];{const s=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(s*2-2))*2;let a=[6];for(let d=this.size-7;a.length<s;d-=l)a.splice(1,0,d);return a}}static getNumRawDataModules(s){if(s<Z.MIN_VERSION||s>Z.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*s+128)*s+64;if(s>=2){const a=Math.floor(s/7)+2;l-=(25*a-10)*a-55,s>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(s,l){return Math.floor(Z.getNumRawDataModules(s)/8)-Z.ECC_CODEWORDS_PER_BLOCK[l.ordinal][s]*Z.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][s]}static reedSolomonComputeDivisor(s){if(s<1||s>255)throw new RangeError("Degree out of range");let l=[];for(let d=0;d<s-1;d++)l.push(0);l.push(1);let a=1;for(let d=0;d<s;d++){for(let f=0;f<l.length;f++)l[f]=Z.reedSolomonMultiply(l[f],a),f+1<l.length&&(l[f]^=l[f+1]);a=Z.reedSolomonMultiply(a,2)}return l}static reedSolomonComputeRemainder(s,l){let a=l.map(d=>0);for(const d of s){const f=d^a.shift();a.push(0),l.forEach((p,m)=>a[m]^=Z.reedSolomonMultiply(p,f))}return a}static reedSolomonMultiply(s,l){if(s>>>8||l>>>8)throw new RangeError("Byte out of range");let a=0;for(let d=7;d>=0;d--)a=a<<1^(a>>>7)*285,a^=(l>>>d&1)*s;return o(a>>>8==0),a}finderPenaltyCountPatterns(s){const l=s[1];o(l<=this.size*3);const a=l>0&&s[2]==l&&s[3]==l*3&&s[4]==l&&s[5]==l;return(a&&s[0]>=l*4&&s[6]>=l?1:0)+(a&&s[6]>=l*4&&s[0]>=l?1:0)}finderPenaltyTerminateAndCount(s,l,a){return s&&(this.finderPenaltyAddHistory(l,a),l=0),l+=this.size,this.finderPenaltyAddHistory(l,a),this.finderPenaltyCountPatterns(a)}finderPenaltyAddHistory(s,l){l[0]==0&&(s+=this.size),l.pop(),l.unshift(s)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(c,s,l){if(s<0||s>31||c>>>s)throw new RangeError("Value out of range");for(let a=s-1;a>=0;a--)l.push(c>>>a&1)}function r(c,s){return(c>>>s&1)!=0}function o(c){if(!c)throw new Error("Assertion error")}const i=class de{constructor(s,l,a){if(this.mode=s,this.numChars=l,this.bitData=a,l<0)throw new RangeError("Invalid argument");this.bitData=a.slice()}static makeBytes(s){let l=[];for(const a of s)n(a,8,l);return new de(de.Mode.BYTE,s.length,l)}static makeNumeric(s){if(!de.isNumeric(s))throw new RangeError("String contains non-numeric characters");let l=[];for(let a=0;a<s.length;){const d=Math.min(s.length-a,3);n(parseInt(s.substring(a,a+d),10),d*3+1,l),a+=d}return new de(de.Mode.NUMERIC,s.length,l)}static makeAlphanumeric(s){if(!de.isAlphanumeric(s))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],a;for(a=0;a+2<=s.length;a+=2){let d=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(a))*45;d+=de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(a+1)),n(d,11,l)}return a<s.length&&n(de.ALPHANUMERIC_CHARSET.indexOf(s.charAt(a)),6,l),new de(de.Mode.ALPHANUMERIC,s.length,l)}static makeSegments(s){return s==""?[]:de.isNumeric(s)?[de.makeNumeric(s)]:de.isAlphanumeric(s)?[de.makeAlphanumeric(s)]:[de.makeBytes(de.toUtf8ByteArray(s))]}static makeEci(s){let l=[];if(s<0)throw new RangeError("ECI assignment value out of range");if(s<128)n(s,8,l);else if(s<16384)n(2,2,l),n(s,14,l);else if(s<1e6)n(6,3,l),n(s,21,l);else throw new RangeError("ECI assignment value out of range");return new de(de.Mode.ECI,0,l)}static isNumeric(s){return de.NUMERIC_REGEX.test(s)}static isAlphanumeric(s){return de.ALPHANUMERIC_REGEX.test(s)}getData(){return this.bitData.slice()}static getTotalBits(s,l){let a=0;for(const d of s){const f=d.mode.numCharCountBits(l);if(d.numChars>=1<<f)return 1/0;a+=4+f+d.bitData.length}return a}static toUtf8ByteArray(s){s=encodeURI(s);let l=[];for(let a=0;a<s.length;a++)s.charAt(a)!="%"?l.push(s.charCodeAt(a)):(l.push(parseInt(s.substring(a+1,a+3),16)),a+=2);return l}};i.NUMERIC_REGEX=/^[0-9]*$/,i.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,i.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let u=i;e.QrSegment=i})(it||(it={})),(e=>{(t=>{const n=class{constructor(o,i){this.ordinal=o,this.formatBits=i}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(it||(it={})),(e=>{(t=>{const n=class{constructor(o,i){this.modeBits=o,this.numBitsCharCount=i}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(it||(it={}));var gt=it;/**
99
+ */var Je;(e=>{const t=class H{constructor(i,l,a,p){if(this.version=i,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],i<H.MIN_VERSION||i>H.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=i*4+17;let m=[];for(let h=0;h<this.size;h++)m.push(!1);for(let h=0;h<this.size;h++)this.modules.push(m.slice()),this.isFunction.push(m.slice());this.drawFunctionPatterns();const f=this.addEccAndInterleave(a);if(this.drawCodewords(f),p==-1){let h=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const b=this.getPenaltyScore();b<h&&(p=v,h=b),this.applyMask(v)}}o(0<=p&&p<=7),this.mask=p,this.applyMask(p),this.drawFormatBits(p),this.isFunction=[]}static encodeText(i,l){const a=e.QrSegment.makeSegments(i);return H.encodeSegments(a,l)}static encodeBinary(i,l){const a=e.QrSegment.makeBytes(i);return H.encodeSegments([a],l)}static encodeSegments(i,l,a=1,p=40,m=-1,f=!0){if(!(H.MIN_VERSION<=a&&a<=p&&p<=H.MAX_VERSION)||m<-1||m>7)throw new RangeError("Invalid value");let h,v;for(h=a;;h++){const y=H.getNumDataCodewords(h,l)*8,S=c.getTotalBits(i,h);if(S<=y){v=S;break}if(h>=p)throw new RangeError("Data too long")}for(const y of[H.Ecc.MEDIUM,H.Ecc.QUARTILE,H.Ecc.HIGH])f&&v<=H.getNumDataCodewords(h,y)*8&&(l=y);let b=[];for(const y of i){n(y.mode.modeBits,4,b),n(y.numChars,y.mode.numCharCountBits(h),b);for(const S of y.getData())b.push(S)}o(b.length==v);const E=H.getNumDataCodewords(h,l)*8;o(b.length<=E),n(0,Math.min(4,E-b.length),b),n(0,(8-b.length%8)%8,b),o(b.length%8==0);for(let y=236;b.length<E;y^=253)n(y,8,b);let w=[];for(;w.length*8<b.length;)w.push(0);return b.forEach((y,S)=>w[S>>>3]|=y<<7-(S&7)),new H(h,l,w,m)}getModule(i,l){return 0<=i&&i<this.size&&0<=l&&l<this.size&&this.modules[l][i]}getModules(){return this.modules}drawFunctionPatterns(){for(let a=0;a<this.size;a++)this.setFunctionModule(6,a,a%2==0),this.setFunctionModule(a,6,a%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const i=this.getAlignmentPatternPositions(),l=i.length;for(let a=0;a<l;a++)for(let p=0;p<l;p++)a==0&&p==0||a==0&&p==l-1||a==l-1&&p==0||this.drawAlignmentPattern(i[a],i[p]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(i){const l=this.errorCorrectionLevel.formatBits<<3|i;let a=l;for(let m=0;m<10;m++)a=a<<1^(a>>>9)*1335;const p=(l<<10|a)^21522;o(p>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,r(p,m));this.setFunctionModule(8,7,r(p,6)),this.setFunctionModule(8,8,r(p,7)),this.setFunctionModule(7,8,r(p,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,r(p,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,r(p,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,r(p,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let i=this.version;for(let a=0;a<12;a++)i=i<<1^(i>>>11)*7973;const l=this.version<<12|i;o(l>>>18==0);for(let a=0;a<18;a++){const p=r(l,a),m=this.size-11+a%3,f=Math.floor(a/3);this.setFunctionModule(m,f,p),this.setFunctionModule(f,m,p)}}drawFinderPattern(i,l){for(let a=-4;a<=4;a++)for(let p=-4;p<=4;p++){const m=Math.max(Math.abs(p),Math.abs(a)),f=i+p,h=l+a;0<=f&&f<this.size&&0<=h&&h<this.size&&this.setFunctionModule(f,h,m!=2&&m!=4)}}drawAlignmentPattern(i,l){for(let a=-2;a<=2;a++)for(let p=-2;p<=2;p++)this.setFunctionModule(i+p,l+a,Math.max(Math.abs(p),Math.abs(a))!=1)}setFunctionModule(i,l,a){this.modules[l][i]=a,this.isFunction[l][i]=!0}addEccAndInterleave(i){const l=this.version,a=this.errorCorrectionLevel;if(i.length!=H.getNumDataCodewords(l,a))throw new RangeError("Invalid argument");const p=H.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][l],m=H.ECC_CODEWORDS_PER_BLOCK[a.ordinal][l],f=Math.floor(H.getNumRawDataModules(l)/8),h=p-f%p,v=Math.floor(f/p);let b=[];const E=H.reedSolomonComputeDivisor(m);for(let y=0,S=0;y<p;y++){let C=i.slice(S,S+v-m+(y<h?0:1));S+=C.length;const O=H.reedSolomonComputeRemainder(C,E);y<h&&C.push(0),b.push(C.concat(O))}let w=[];for(let y=0;y<b[0].length;y++)b.forEach((S,C)=>{(y!=v-m||C>=h)&&w.push(S[y])});return o(w.length==f),w}drawCodewords(i){if(i.length!=Math.floor(H.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let a=this.size-1;a>=1;a-=2){a==6&&(a=5);for(let p=0;p<this.size;p++)for(let m=0;m<2;m++){const f=a-m,v=(a+1&2)==0?this.size-1-p:p;!this.isFunction[v][f]&&l<i.length*8&&(this.modules[v][f]=r(i[l>>>3],7-(l&7)),l++)}}o(l==i.length*8)}applyMask(i){if(i<0||i>7)throw new RangeError("Mask value out of range");for(let l=0;l<this.size;l++)for(let a=0;a<this.size;a++){let p;switch(i){case 0:p=(a+l)%2==0;break;case 1:p=l%2==0;break;case 2:p=a%3==0;break;case 3:p=(a+l)%3==0;break;case 4:p=(Math.floor(a/3)+Math.floor(l/2))%2==0;break;case 5:p=a*l%2+a*l%3==0;break;case 6:p=(a*l%2+a*l%3)%2==0;break;case 7:p=((a+l)%2+a*l%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[l][a]&&p&&(this.modules[l][a]=!this.modules[l][a])}}getPenaltyScore(){let i=0;for(let m=0;m<this.size;m++){let f=!1,h=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[m][b]==f?(h++,h==5?i+=H.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,v),f||(i+=this.finderPenaltyCountPatterns(v)*H.PENALTY_N3),f=this.modules[m][b],h=1);i+=this.finderPenaltyTerminateAndCount(f,h,v)*H.PENALTY_N3}for(let m=0;m<this.size;m++){let f=!1,h=0,v=[0,0,0,0,0,0,0];for(let b=0;b<this.size;b++)this.modules[b][m]==f?(h++,h==5?i+=H.PENALTY_N1:h>5&&i++):(this.finderPenaltyAddHistory(h,v),f||(i+=this.finderPenaltyCountPatterns(v)*H.PENALTY_N3),f=this.modules[b][m],h=1);i+=this.finderPenaltyTerminateAndCount(f,h,v)*H.PENALTY_N3}for(let m=0;m<this.size-1;m++)for(let f=0;f<this.size-1;f++){const h=this.modules[m][f];h==this.modules[m][f+1]&&h==this.modules[m+1][f]&&h==this.modules[m+1][f+1]&&(i+=H.PENALTY_N2)}let l=0;for(const m of this.modules)l=m.reduce((f,h)=>f+(h?1:0),l);const a=this.size*this.size,p=Math.ceil(Math.abs(l*20-a*10)/a)-1;return o(0<=p&&p<=9),i+=p*H.PENALTY_N4,o(0<=i&&i<=2568888),i}getAlignmentPatternPositions(){if(this.version==1)return[];{const i=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(i*2-2))*2;let a=[6];for(let p=this.size-7;a.length<i;p-=l)a.splice(1,0,p);return a}}static getNumRawDataModules(i){if(i<H.MIN_VERSION||i>H.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*i+128)*i+64;if(i>=2){const a=Math.floor(i/7)+2;l-=(25*a-10)*a-55,i>=7&&(l-=36)}return o(208<=l&&l<=29648),l}static getNumDataCodewords(i,l){return Math.floor(H.getNumRawDataModules(i)/8)-H.ECC_CODEWORDS_PER_BLOCK[l.ordinal][i]*H.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][i]}static reedSolomonComputeDivisor(i){if(i<1||i>255)throw new RangeError("Degree out of range");let l=[];for(let p=0;p<i-1;p++)l.push(0);l.push(1);let a=1;for(let p=0;p<i;p++){for(let m=0;m<l.length;m++)l[m]=H.reedSolomonMultiply(l[m],a),m+1<l.length&&(l[m]^=l[m+1]);a=H.reedSolomonMultiply(a,2)}return l}static reedSolomonComputeRemainder(i,l){let a=l.map(p=>0);for(const p of i){const m=p^a.shift();a.push(0),l.forEach((f,h)=>a[h]^=H.reedSolomonMultiply(f,m))}return a}static reedSolomonMultiply(i,l){if(i>>>8||l>>>8)throw new RangeError("Byte out of range");let a=0;for(let p=7;p>=0;p--)a=a<<1^(a>>>7)*285,a^=(l>>>p&1)*i;return o(a>>>8==0),a}finderPenaltyCountPatterns(i){const l=i[1];o(l<=this.size*3);const a=l>0&&i[2]==l&&i[3]==l*3&&i[4]==l&&i[5]==l;return(a&&i[0]>=l*4&&i[6]>=l?1:0)+(a&&i[6]>=l*4&&i[0]>=l?1:0)}finderPenaltyTerminateAndCount(i,l,a){return i&&(this.finderPenaltyAddHistory(l,a),l=0),l+=this.size,this.finderPenaltyAddHistory(l,a),this.finderPenaltyCountPatterns(a)}finderPenaltyAddHistory(i,l){l[0]==0&&(i+=this.size),l.pop(),l.unshift(i)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(u,i,l){if(i<0||i>31||u>>>i)throw new RangeError("Value out of range");for(let a=i-1;a>=0;a--)l.push(u>>>a&1)}function r(u,i){return(u>>>i&1)!=0}function o(u){if(!u)throw new Error("Assertion error")}const s=class re{constructor(i,l,a){if(this.mode=i,this.numChars=l,this.bitData=a,l<0)throw new RangeError("Invalid argument");this.bitData=a.slice()}static makeBytes(i){let l=[];for(const a of i)n(a,8,l);return new re(re.Mode.BYTE,i.length,l)}static makeNumeric(i){if(!re.isNumeric(i))throw new RangeError("String contains non-numeric characters");let l=[];for(let a=0;a<i.length;){const p=Math.min(i.length-a,3);n(parseInt(i.substring(a,a+p),10),p*3+1,l),a+=p}return new re(re.Mode.NUMERIC,i.length,l)}static makeAlphanumeric(i){if(!re.isAlphanumeric(i))throw new RangeError("String contains unencodable characters in alphanumeric mode");let l=[],a;for(a=0;a+2<=i.length;a+=2){let p=re.ALPHANUMERIC_CHARSET.indexOf(i.charAt(a))*45;p+=re.ALPHANUMERIC_CHARSET.indexOf(i.charAt(a+1)),n(p,11,l)}return a<i.length&&n(re.ALPHANUMERIC_CHARSET.indexOf(i.charAt(a)),6,l),new re(re.Mode.ALPHANUMERIC,i.length,l)}static makeSegments(i){return i==""?[]:re.isNumeric(i)?[re.makeNumeric(i)]:re.isAlphanumeric(i)?[re.makeAlphanumeric(i)]:[re.makeBytes(re.toUtf8ByteArray(i))]}static makeEci(i){let l=[];if(i<0)throw new RangeError("ECI assignment value out of range");if(i<128)n(i,8,l);else if(i<16384)n(2,2,l),n(i,14,l);else if(i<1e6)n(6,3,l),n(i,21,l);else throw new RangeError("ECI assignment value out of range");return new re(re.Mode.ECI,0,l)}static isNumeric(i){return re.NUMERIC_REGEX.test(i)}static isAlphanumeric(i){return re.ALPHANUMERIC_REGEX.test(i)}getData(){return this.bitData.slice()}static getTotalBits(i,l){let a=0;for(const p of i){const m=p.mode.numCharCountBits(l);if(p.numChars>=1<<m)return 1/0;a+=4+m+p.bitData.length}return a}static toUtf8ByteArray(i){i=encodeURI(i);let l=[];for(let a=0;a<i.length;a++)i.charAt(a)!="%"?l.push(i.charCodeAt(a)):(l.push(parseInt(i.substring(a+1,a+3),16)),a+=2);return l}};s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let c=s;e.QrSegment=s})(Je||(Je={})),(e=>{(t=>{const n=class{constructor(o,s){this.ordinal=o,this.formatBits=s}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(Je||(Je={})),(e=>{(t=>{const n=class{constructor(o,s){this.modeBits=o,this.numBitsCharCount=s}numCharCountBits(o){return this.numBitsCharCount[Math.floor((o+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(Je||(Je={}));var ft=Je;/**
100
100
  * @license qrcode.react
101
101
  * Copyright (c) Paul O'Shannessy
102
102
  * SPDX-License-Identifier: ISC
103
- */var of={L:gt.QrCode.Ecc.LOW,M:gt.QrCode.Ecc.MEDIUM,Q:gt.QrCode.Ecc.QUARTILE,H:gt.QrCode.Ecc.HIGH},Pi=128,Ai="L",Mi="#FFFFFF",_i="#000000",Di=!1,Li=1,sf=4,lf=0,af=.1;function Fi(e,t=0){const n=[];return e.forEach(function(r,o){let i=null;r.forEach(function(u,c){if(!u&&i!==null){n.push(`M${i+t} ${o+t}h${c-i}v1H${i+t}z`),i=null;return}if(c===r.length-1){if(!u)return;i===null?n.push(`M${c+t},${o+t} h1v1H${c+t}z`):n.push(`M${i+t},${o+t} h${c+1-i}v1H${i+t}z`);return}u&&i===null&&(i=c)})}),n.join("")}function Ii(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,i)=>i<t.x||i>=t.x+t.w?o:!1))}function uf(e,t,n,r){if(r==null)return null;const o=e.length+n*2,i=Math.floor(t*af),u=o/t,c=(r.width||i)*u,s=(r.height||i)*u,l=r.x==null?e.length/2-c/2:r.x*u,a=r.y==null?e.length/2-s/2:r.y*u,d=r.opacity==null?1:r.opacity;let f=null;if(r.excavate){let m=Math.floor(l),v=Math.floor(a),b=Math.ceil(c+l-m),x=Math.ceil(s+a-v);f={x:m,y:v,w:b,h:x}}const p=r.crossOrigin;return{x:l,y:a,h:s,w:c,excavation:f,opacity:d,crossOrigin:p}}function cf(e,t){return t!=null?Math.max(Math.floor(t),0):e?sf:lf}function ki({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:i,size:u,boostLevel:c}){let s=h.useMemo(()=>{const m=(Array.isArray(e)?e:[e]).reduce((v,b)=>(v.push(...gt.QrSegment.makeSegments(b)),v),[]);return gt.QrCode.encodeSegments(m,of[t],n,void 0,void 0,c)},[e,t,n,c]);const{cells:l,margin:a,numCells:d,calculatedImageSettings:f}=h.useMemo(()=>{let p=s.getModules();const m=cf(r,o),v=p.length+m*2,b=uf(p,u,m,i);return{cells:p,margin:m,numCells:v,calculatedImageSettings:b}},[s,u,i,r,o]);return{qrcode:s,margin:a,cells:l,numCells:d,calculatedImageSettings:f}}var ff=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),df=h.forwardRef(function(t,n){const r=t,{value:o,size:i=Pi,level:u=Ai,bgColor:c=Mi,fgColor:s=_i,includeMargin:l=Di,minVersion:a=Li,boostLevel:d,marginSize:f,imageSettings:p}=r,v=sr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:b}=v,x=sr(v,["style"]),w=p==null?void 0:p.src,y=h.useRef(null),S=h.useRef(null),E=h.useCallback(W=>{y.current=W,typeof n=="function"?n(W):n&&(n.current=W)},[n]),[F,j]=h.useState(!1),{margin:K,cells:ee,numCells:D,calculatedImageSettings:N}=ki({value:o,level:u,minVersion:a,boostLevel:d,includeMargin:l,marginSize:f,imageSettings:p,size:i});h.useEffect(()=>{if(y.current!=null){const W=y.current,X=W.getContext("2d");if(!X)return;let G=ee;const J=S.current,P=N!=null&&J!==null&&J.complete&&J.naturalHeight!==0&&J.naturalWidth!==0;P&&N.excavation!=null&&(G=Ii(ee,N.excavation));const U=window.devicePixelRatio||1;W.height=W.width=i*U;const C=i/D*U;X.scale(C,C),X.fillStyle=c,X.fillRect(0,0,D,D),X.fillStyle=s,ff?X.fill(new Path2D(Fi(G,K))):ee.forEach(function(A,k){A.forEach(function(I,B){I&&X.fillRect(B+K,k+K,1,1)})}),N&&(X.globalAlpha=N.opacity),P&&X.drawImage(J,N.x+K,N.y+K,N.w,N.h)}}),h.useEffect(()=>{j(!1)},[w]);const oe=ir({height:i,width:i},b);let H=null;return w!=null&&(H=h.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{j(!0)},ref:S,crossOrigin:N==null?void 0:N.crossOrigin})),h.createElement(h.Fragment,null,h.createElement("canvas",ir({style:oe,height:i,width:i,ref:E,role:"img"},x)),H)});df.displayName="QRCodeCanvas";var Ni=h.forwardRef(function(t,n){const r=t,{value:o,size:i=Pi,level:u=Ai,bgColor:c=Mi,fgColor:s=_i,includeMargin:l=Di,minVersion:a=Li,boostLevel:d,title:f,marginSize:p,imageSettings:m}=r,v=sr(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:b,cells:x,numCells:w,calculatedImageSettings:y}=ki({value:o,level:u,minVersion:a,boostLevel:d,includeMargin:l,marginSize:p,imageSettings:m,size:i});let S=x,E=null;m!=null&&y!=null&&(y.excavation!=null&&(S=Ii(x,y.excavation)),E=h.createElement("image",{href:m.src,height:y.h,width:y.w,x:y.x+b,y:y.y+b,preserveAspectRatio:"none",opacity:y.opacity,crossOrigin:y.crossOrigin}));const F=Fi(S,b);return h.createElement("svg",ir({height:i,width:i,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},v),!!f&&h.createElement("title",null,f),h.createElement("path",{fill:c,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),h.createElement("path",{fill:s,d:F,shapeRendering:"crispEdges"}),E)});Ni.displayName="QRCodeSVG";const pf=({value:e,size:t,level:n,bgColor:r,fgColor:o,includeMargin:i=!0})=>O.jsx(Ni,{value:e,size:t,level:n,bgColor:r,fgColor:o,marginSize:i?4:0}),hf=({text:e,onCopy:t,children:n})=>O.jsx("div",{onClick:()=>{navigator.clipboard.writeText(e).then(t)},style:{cursor:"pointer"},children:n}),mf=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r})=>{var o;return O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"flex justify-center mt-4 mb-3",children:O.jsx("div",{className:"bg-white rounded-lg",children:O.jsx(pf,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",includeMargin:!1})})}),O.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[O.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),O.jsx(hf,{text:(e==null?void 0:e.getDisplayAddress())||"",onCopy:()=>console.log("Copied!"),children:O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[O.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),O.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})})]}),O.jsxs("div",{className:"flex items-start",children:[O.jsx("div",{className:"w-5",children:O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:O.jsx("path",{d:"M8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8C14.6668 4.31809 11.6821 1.33333 8.00016 1.33333C4.31826 1.33333 1.3335 4.31809 1.3335 8C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z",fill:"#FF8F34",stroke:"#FF8F34",strokeWidth:"1.33333",strokeLinejoin:"round"})})}),O.jsxs("div",{className:"flex-1",children:[O.jsxs("p",{className:"text-xs text-functional-orange-1",children:["Only ",t," (",n==null?void 0:n.chain,") is supported for deposits to this address."]}),O.jsx("div",{className:"pt-2 h-[1px] border-b border-dashed border-line-divider-secondary"})]})]}),O.jsx("div",{className:"flex items-start pl-5 pt-2 text-functional-orange-1 text-xs",children:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."}),O.jsx("div",{className:"pt-4 h-[1px] border-b border-dashed border-line-divider-secondary"}),O.jsxs("div",{className:"text-sm",children:[O.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[O.jsx("span",{className:"text-text-tertiary",children:"Arrival Time"}),O.jsxs("span",{className:"text-text-primary font-medium text-right underline decoration-dotted underline-offset-1",children:["β‰ˆ"," ",Math.ceil(((n==null?void 0:n.blockTime)||12)*((n==null?void 0:n.txConfirm)||12)/60)," ","minutes"]})]}),O.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[O.jsx("span",{className:"text-text-tertiary",children:"Minimum Deposit Amount"}),O.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((o=r==null?void 0:r.multiChain)==null?void 0:o.minDeposit)||10," ",t]})]}),O.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[O.jsx("span",{className:"text-text-tertiary",children:"Maximum Deposit Amount"}),O.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},gf=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onClose:i})=>{const[u,c]=h.useState(()=>{var d;return!e||e.length===0?1:t||((d=e[0])==null?void 0:d.chainId)||1}),[s,l]=h.useState(()=>{var m;if(!e||e.length===0)return"";const d=t||((m=e[0])==null?void 0:m.chainId),f=e.find(v=>v.chainId===d);if(!f||!f.tokenList||f.tokenList.length===0)return"";const p=f.tokenList.find(v=>v.tokenAddress===n)||f.tokenList[0];return(p==null?void 0:p.token)||""}),a=e&&e.length>0?e.find(d=>d.chainId===u)||e[0]:null;return!e||e.length===0?O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"No chains available"})}):a?O.jsxs(O.Fragment,{children:[O.jsx(nf,{currentActiveChain:a,chainList:e,onChainChange:c,curSelectToken:s,onTokenChange:l}),O.jsx(mf,{walletAdapter:r,curSelectToken:s,currentActiveChain:a,metadata:o}),O.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{i()},children:"Deposit"})]}):O.jsx("div",{className:"text-center py-8",children:O.jsx("p",{className:"text-gray-400",children:"Loading..."})})},vf=[{chainId:1,chain:"Ethereum",chainIconUrl:"https://static.edgex.exchange/icons/logo/ethereum.svg",allowDeposit:!0,blockTime:12,txConfirm:12},{chainId:42161,chain:"Arbitrum",chainIconUrl:"https://static.edgex.exchange/icons/logo/arbitrum.svg",allowDeposit:!0,blockTime:1,txConfirm:1}],ji={wallet:"mpc",ethAddress:"0x1234567890123456789012345678901234567890",accountId:"123",l2Key:"0x123"},Ri={address:"0x1234567890123456789012345678901234567890"},Wi={multiChain:{minDeposit:10}},Bi=({isOpen:e,onClose:t,config:n,isWalletConnected:r=!0,currentActiveAccount:o=ji,smartWallet:i=Ri,chains:u,defaultChainId:c,defaultTokenAddress:s,defaultAmount:l="",metadata:a=Wi,currentEquity:d=5e3,onDepositComplete:f})=>{const p=h.useMemo(()=>{var m;return o?Ls(o,i,!1,(m=u[0])==null?void 0:m.chainId,"0","0"):null},[o,i,u]);return e?we.createPortal(O.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[999] w-screen h-screen",style:{zIndex:999},children:[O.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0",style:{backgroundColor:"#000",opacity:.6},onClick:t,"aria-hidden":"true"}),O.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-center",children:O.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",children:[O.jsxs("div",{className:"flex items-center justify-between mb-4",children:[O.jsx("h2",{className:"text-lg font-semibold text-white",children:"Deposit"}),O.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:O.jsx(Ms,{className:"h-4 w-4"})})]}),O.jsx(gf,{chains:u,defaultChainId:c,defaultTokenAddress:s,defaultAmount:l,walletAdapter:p,metadata:a,currentEquity:d,onDepositComplete:f,onClose:t})]})})]}),document.body):null};var lr={exports:{}},un={exports:{}},ie={};/** @license React v16.13.1
104
- * react-is.production.min.js
105
- *
106
- * Copyright (c) Facebook, Inc. and its affiliates.
107
- *
108
- * This source code is licensed under the MIT license found in the
109
- * LICENSE file in the root directory of this source tree.
110
- */var Hi;function bf(){if(Hi)return ie;Hi=1;var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,a=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function y(E){if(typeof E=="object"&&E!==null){var F=E.$$typeof;switch(F){case t:switch(E=E.type,E){case s:case l:case r:case i:case o:case d:return E;default:switch(E=E&&E.$$typeof,E){case c:case a:case m:case p:case u:return E;default:return F}}case n:return F}}}function S(E){return y(E)===l}return ie.AsyncMode=s,ie.ConcurrentMode=l,ie.ContextConsumer=c,ie.ContextProvider=u,ie.Element=t,ie.ForwardRef=a,ie.Fragment=r,ie.Lazy=m,ie.Memo=p,ie.Portal=n,ie.Profiler=i,ie.StrictMode=o,ie.Suspense=d,ie.isAsyncMode=function(E){return S(E)||y(E)===s},ie.isConcurrentMode=S,ie.isContextConsumer=function(E){return y(E)===c},ie.isContextProvider=function(E){return y(E)===u},ie.isElement=function(E){return typeof E=="object"&&E!==null&&E.$$typeof===t},ie.isForwardRef=function(E){return y(E)===a},ie.isFragment=function(E){return y(E)===r},ie.isLazy=function(E){return y(E)===m},ie.isMemo=function(E){return y(E)===p},ie.isPortal=function(E){return y(E)===n},ie.isProfiler=function(E){return y(E)===i},ie.isStrictMode=function(E){return y(E)===o},ie.isSuspense=function(E){return y(E)===d},ie.isValidElementType=function(E){return typeof E=="string"||typeof E=="function"||E===r||E===l||E===i||E===o||E===d||E===f||typeof E=="object"&&E!==null&&(E.$$typeof===m||E.$$typeof===p||E.$$typeof===u||E.$$typeof===c||E.$$typeof===a||E.$$typeof===b||E.$$typeof===x||E.$$typeof===w||E.$$typeof===v)},ie.typeOf=y,ie}var se={};/** @license React v16.13.1
111
- * react-is.development.js
112
- *
113
- * Copyright (c) Facebook, Inc. and its affiliates.
114
- *
115
- * This source code is licensed under the MIT license found in the
116
- * LICENSE file in the root directory of this source tree.
117
- */var Ui;function yf(){return Ui||(Ui=1,process.env.NODE_ENV!=="production"&&function(){var e=typeof Symbol=="function"&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,c=e?Symbol.for("react.context"):60110,s=e?Symbol.for("react.async_mode"):60111,l=e?Symbol.for("react.concurrent_mode"):60111,a=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,m=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,b=e?Symbol.for("react.fundamental"):60117,x=e?Symbol.for("react.responder"):60118,w=e?Symbol.for("react.scope"):60119;function y(M){return typeof M=="string"||typeof M=="function"||M===r||M===l||M===i||M===o||M===d||M===f||typeof M=="object"&&M!==null&&(M.$$typeof===m||M.$$typeof===p||M.$$typeof===u||M.$$typeof===c||M.$$typeof===a||M.$$typeof===b||M.$$typeof===x||M.$$typeof===w||M.$$typeof===v)}function S(M){if(typeof M=="object"&&M!==null){var _e=M.$$typeof;switch(_e){case t:var vt=M.type;switch(vt){case s:case l:case r:case i:case o:case d:return vt;default:var st=vt&&vt.$$typeof;switch(st){case c:case a:case m:case p:case u:return st;default:return _e}}case n:return _e}}}var E=s,F=l,j=c,K=u,ee=t,D=a,N=r,oe=m,H=p,W=n,X=i,G=o,J=d,P=!1;function U(M){return P||(P=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),C(M)||S(M)===s}function C(M){return S(M)===l}function A(M){return S(M)===c}function k(M){return S(M)===u}function I(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function B(M){return S(M)===a}function q(M){return S(M)===r}function Y(M){return S(M)===m}function $(M){return S(M)===p}function R(M){return S(M)===n}function V(M){return S(M)===i}function Q(M){return S(M)===o}function ye(M){return S(M)===d}se.AsyncMode=E,se.ConcurrentMode=F,se.ContextConsumer=j,se.ContextProvider=K,se.Element=ee,se.ForwardRef=D,se.Fragment=N,se.Lazy=oe,se.Memo=H,se.Portal=W,se.Profiler=X,se.StrictMode=G,se.Suspense=J,se.isAsyncMode=U,se.isConcurrentMode=C,se.isContextConsumer=A,se.isContextProvider=k,se.isElement=I,se.isForwardRef=B,se.isFragment=q,se.isLazy=Y,se.isMemo=$,se.isPortal=R,se.isProfiler=V,se.isStrictMode=Q,se.isSuspense=ye,se.isValidElementType=y,se.typeOf=S}()),se}var Vi;function zi(){return Vi||(Vi=1,process.env.NODE_ENV==="production"?un.exports=bf():un.exports=yf()),un.exports}/*
118
- object-assign
119
- (c) Sindre Sorhus
120
- @license MIT
121
- */var ar,Yi;function Ef(){if(Yi)return ar;Yi=1;var e=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function o(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var u={},c=0;c<10;c++)u["_"+String.fromCharCode(c)]=c;var s=Object.getOwnPropertyNames(u).map(function(a){return u[a]});if(s.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(a){l[a]=a}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return ar=o()?Object.assign:function(i,u){for(var c,s=r(i),l,a=1;a<arguments.length;a++){c=Object(arguments[a]);for(var d in c)t.call(c,d)&&(s[d]=c[d]);if(e){l=e(c);for(var f=0;f<l.length;f++)n.call(c,l[f])&&(s[l[f]]=c[l[f]])}}return s},ar}var ur,Gi;function cr(){if(Gi)return ur;Gi=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ur=e,ur}var fr,qi;function Ki(){return qi||(qi=1,fr=Function.call.bind(Object.prototype.hasOwnProperty)),fr}var dr,Qi;function wf(){if(Qi)return dr;Qi=1;var e=function(){};if(process.env.NODE_ENV!=="production"){var t=cr(),n={},r=Ki();e=function(i){var u="Warning: "+i;typeof console<"u"&&console.error(u);try{throw new Error(u)}catch{}}}function o(i,u,c,s,l){if(process.env.NODE_ENV!=="production"){for(var a in i)if(r(i,a)){var d;try{if(typeof i[a]!="function"){var f=Error((s||"React class")+": "+c+" type `"+a+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[a]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw f.name="Invariant Violation",f}d=i[a](u,a,s,c,null,t)}catch(m){d=m}if(d&&!(d instanceof Error)&&e((s||"React class")+": type specification of "+c+" `"+a+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var p=l?l():"";e("Failed "+c+" type: "+d.message+(p??""))}}}}return o.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},dr=o,dr}var pr,Xi;function xf(){if(Xi)return pr;Xi=1;var e=zi(),t=Ef(),n=cr(),r=Ki(),o=wf(),i=function(){};process.env.NODE_ENV!=="production"&&(i=function(c){var s="Warning: "+c;typeof console<"u"&&console.error(s);try{throw new Error(s)}catch{}});function u(){return null}return pr=function(c,s){var l=typeof Symbol=="function"&&Symbol.iterator,a="@@iterator";function d(C){var A=C&&(l&&C[l]||C[a]);if(typeof A=="function")return A}var f="<<anonymous>>",p={array:x("array"),bigint:x("bigint"),bool:x("boolean"),func:x("function"),number:x("number"),object:x("object"),string:x("string"),symbol:x("symbol"),any:w(),arrayOf:y,element:S(),elementType:E(),instanceOf:F,node:D(),objectOf:K,oneOf:j,oneOfType:ee,shape:oe,exact:H};function m(C,A){return C===A?C!==0||1/C===1/A:C!==C&&A!==A}function v(C,A){this.message=C,this.data=A&&typeof A=="object"?A:{},this.stack=""}v.prototype=Error.prototype;function b(C){if(process.env.NODE_ENV!=="production")var A={},k=0;function I(q,Y,$,R,V,Q,ye){if(R=R||f,Q=Q||$,ye!==n){if(s){var M=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw M.name="Invariant Violation",M}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var _e=R+":"+$;!A[_e]&&k<3&&(i("You are manually calling a React.PropTypes validation function for the `"+Q+"` prop on `"+R+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),A[_e]=!0,k++)}}return Y[$]==null?q?Y[$]===null?new v("The "+V+" `"+Q+"` is marked as required "+("in `"+R+"`, but its value is `null`.")):new v("The "+V+" `"+Q+"` is marked as required in "+("`"+R+"`, but its value is `undefined`.")):null:C(Y,$,R,V,Q)}var B=I.bind(null,!1);return B.isRequired=I.bind(null,!0),B}function x(C){function A(k,I,B,q,Y,$){var R=k[I],V=G(R);if(V!==C){var Q=J(R);return new v("Invalid "+q+" `"+Y+"` of type "+("`"+Q+"` supplied to `"+B+"`, expected ")+("`"+C+"`."),{expectedType:C})}return null}return b(A)}function w(){return b(u)}function y(C){function A(k,I,B,q,Y){if(typeof C!="function")return new v("Property `"+Y+"` of component `"+B+"` has invalid PropType notation inside arrayOf.");var $=k[I];if(!Array.isArray($)){var R=G($);return new v("Invalid "+q+" `"+Y+"` of type "+("`"+R+"` supplied to `"+B+"`, expected an array."))}for(var V=0;V<$.length;V++){var Q=C($,V,B,q,Y+"["+V+"]",n);if(Q instanceof Error)return Q}return null}return b(A)}function S(){function C(A,k,I,B,q){var Y=A[k];if(!c(Y)){var $=G(Y);return new v("Invalid "+B+" `"+q+"` of type "+("`"+$+"` supplied to `"+I+"`, expected a single ReactElement."))}return null}return b(C)}function E(){function C(A,k,I,B,q){var Y=A[k];if(!e.isValidElementType(Y)){var $=G(Y);return new v("Invalid "+B+" `"+q+"` of type "+("`"+$+"` supplied to `"+I+"`, expected a single ReactElement type."))}return null}return b(C)}function F(C){function A(k,I,B,q,Y){if(!(k[I]instanceof C)){var $=C.name||f,R=U(k[I]);return new v("Invalid "+q+" `"+Y+"` of type "+("`"+R+"` supplied to `"+B+"`, expected ")+("instance of `"+$+"`."))}return null}return b(A)}function j(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&(arguments.length>1?i("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):i("Invalid argument supplied to oneOf, expected an array.")),u;function A(k,I,B,q,Y){for(var $=k[I],R=0;R<C.length;R++)if(m($,C[R]))return null;var V=JSON.stringify(C,function(ye,M){var _e=J(M);return _e==="symbol"?String(M):M});return new v("Invalid "+q+" `"+Y+"` of value `"+String($)+"` "+("supplied to `"+B+"`, expected one of "+V+"."))}return b(A)}function K(C){function A(k,I,B,q,Y){if(typeof C!="function")return new v("Property `"+Y+"` of component `"+B+"` has invalid PropType notation inside objectOf.");var $=k[I],R=G($);if(R!=="object")return new v("Invalid "+q+" `"+Y+"` of type "+("`"+R+"` supplied to `"+B+"`, expected an object."));for(var V in $)if(r($,V)){var Q=C($,V,B,q,Y+"."+V,n);if(Q instanceof Error)return Q}return null}return b(A)}function ee(C){if(!Array.isArray(C))return process.env.NODE_ENV!=="production"&&i("Invalid argument supplied to oneOfType, expected an instance of array."),u;for(var A=0;A<C.length;A++){var k=C[A];if(typeof k!="function")return i("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+P(k)+" at index "+A+"."),u}function I(B,q,Y,$,R){for(var V=[],Q=0;Q<C.length;Q++){var ye=C[Q],M=ye(B,q,Y,$,R,n);if(M==null)return null;M.data&&r(M.data,"expectedType")&&V.push(M.data.expectedType)}var _e=V.length>0?", expected one of type ["+V.join(", ")+"]":"";return new v("Invalid "+$+" `"+R+"` supplied to "+("`"+Y+"`"+_e+"."))}return b(I)}function D(){function C(A,k,I,B,q){return W(A[k])?null:new v("Invalid "+B+" `"+q+"` supplied to "+("`"+I+"`, expected a ReactNode."))}return b(C)}function N(C,A,k,I,B){return new v((C||"React class")+": "+A+" type `"+k+"."+I+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+B+"`.")}function oe(C){function A(k,I,B,q,Y){var $=k[I],R=G($);if(R!=="object")return new v("Invalid "+q+" `"+Y+"` of type `"+R+"` "+("supplied to `"+B+"`, expected `object`."));for(var V in C){var Q=C[V];if(typeof Q!="function")return N(B,q,Y,V,J(Q));var ye=Q($,V,B,q,Y+"."+V,n);if(ye)return ye}return null}return b(A)}function H(C){function A(k,I,B,q,Y){var $=k[I],R=G($);if(R!=="object")return new v("Invalid "+q+" `"+Y+"` of type `"+R+"` "+("supplied to `"+B+"`, expected `object`."));var V=t({},k[I],C);for(var Q in V){var ye=C[Q];if(r(C,Q)&&typeof ye!="function")return N(B,q,Y,Q,J(ye));if(!ye)return new v("Invalid "+q+" `"+Y+"` key `"+Q+"` supplied to `"+B+"`.\nBad object: "+JSON.stringify(k[I],null," ")+`
122
- Valid keys: `+JSON.stringify(Object.keys(C),null," "));var M=ye($,Q,B,q,Y+"."+Q,n);if(M)return M}return null}return b(A)}function W(C){switch(typeof C){case"number":case"string":case"undefined":return!0;case"boolean":return!C;case"object":if(Array.isArray(C))return C.every(W);if(C===null||c(C))return!0;var A=d(C);if(A){var k=A.call(C),I;if(A!==C.entries){for(;!(I=k.next()).done;)if(!W(I.value))return!1}else for(;!(I=k.next()).done;){var B=I.value;if(B&&!W(B[1]))return!1}}else return!1;return!0;default:return!1}}function X(C,A){return C==="symbol"?!0:A?A["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&A instanceof Symbol:!1}function G(C){var A=typeof C;return Array.isArray(C)?"array":C instanceof RegExp?"object":X(A,C)?"symbol":A}function J(C){if(typeof C>"u"||C===null)return""+C;var A=G(C);if(A==="object"){if(C instanceof Date)return"date";if(C instanceof RegExp)return"regexp"}return A}function P(C){var A=J(C);switch(A){case"array":case"object":return"an "+A;case"boolean":case"date":case"regexp":return"a "+A;default:return A}}function U(C){return!C.constructor||!C.constructor.name?f:C.constructor.name}return p.checkPropTypes=o,p.resetWarningCache=o.resetWarningCache,p.PropTypes=p,p},pr}var hr,Ji;function Cf(){if(Ji)return hr;Ji=1;var e=cr();function t(){}function n(){}return n.resetWarningCache=t,hr=function(){function r(u,c,s,l,a,d){if(d!==e){var f=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw f.name="Invariant Violation",f}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},hr}if(process.env.NODE_ENV!=="production"){var Sf=zi(),Of=!0;lr.exports=xf()(Sf.isElement,Of)}else lr.exports=Cf()();var Tf=lr.exports;const $f=vs(Tf);let He=null;const Pf={symbol:"USDT"},Zi=h.forwardRef((e,t)=>{const[n,r]=h.useState(!1),[o,i]=h.useState({chains:[]}),u=h.useCallback(a=>{i(a),r(!0)},[]),c=h.useCallback(a=>{console.log("πŸ”„ DepositManager: Updating options",a),i(d=>{const f={...d,...a};return console.log("πŸ”„ DepositManager: New options state",f),f})},[]),s=h.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=h.useCallback(()=>n,[n]);return h.useImperativeHandle(t,()=>({openDeposit:u,closeDeposit:s,updateDepositOptions:c,isOpen:l}),[u,s,c,l]),h.useEffect(()=>(He={openDeposit:u,closeDeposit:s,updateDepositOptions:c,isOpen:l},()=>{He=null}),[u,s,c,l]),h.useCallback(a=>{console.log("πŸ”„ DepositManager: Token change triggered",a),i(d=>{const f={...d,curSelectToken:a};return console.log("πŸ”„ DepositManager: Updated internal state",f),f}),o.onTokenChange&&o.onTokenChange(a)},[o.onTokenChange]),h.useCallback(a=>{console.log("πŸ”„ DepositManager: Chain change triggered",a),o.onChainChange&&(console.log("πŸ”„ DepositManager: Calling parent onChainChange",a),o.onChainChange(a))},[o.onChainChange]),h.useCallback(a=>{console.log("πŸ”„ DepositManager: Amount change triggered",a),i(d=>{const f={...d,depositAmount:a};return console.log("πŸ”„ DepositManager: Updated internal state",f),f}),o.onDepositAmountChange&&o.onDepositAmountChange(a)},[o.onDepositAmountChange]),h.useEffect(()=>{console.log("πŸ” DepositManager: Current options",{curSelectToken:o.curSelectToken,currentActiveChain:o.currentActiveChain,depositAmount:o.depositAmount})},[o.curSelectToken,o.currentActiveChain,o.depositAmount]),O.jsx(Bi,{isOpen:n,onClose:s,config:o.config||Pf,isWalletConnected:o.isWalletConnected??!0,currentActiveAccount:o.currentActiveAccount||ji,smartWallet:o.smartWallet||Ri,chains:o.chains||vf,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||Wi,currentEquity:o.currentEquity??5e3,onDepositComplete:o.onDepositComplete})});Zi.displayName="DepositManager";const es=e=>{if(!He){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}He.openDeposit(e||{chains:[]})},ts=()=>{if(!He){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}He.closeDeposit()},Af=e=>{if(console.log("🌍 Global updateDepositOptions called with:",e),!He){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}console.log("🌍 Global updateDepositOptions: calling instance method"),He.updateDepositOptions(e)},Mf=()=>He?He.isOpen():!1,_f=()=>({openDeposit:es,closeDeposit:ts,updateDepositOptions:Af,isOpen:Mf});$f.node,h.createContext(null);const Df=({isOpen:e,onClose:t,config:n})=>e?O.jsx("div",{className:"withdraw-modal",children:O.jsx("div",{className:"modal-overlay",onClick:t,children:O.jsxs("div",{className:"modal-content",onClick:r=>r.stopPropagation(),children:[O.jsxs("h2",{children:["Withdraw ",n.symbol]}),O.jsxs("p",{children:["Symbol: ",n.symbol]}),O.jsx("button",{onClick:t,children:"Close"})]})})}):null;fe.ComponentProvider=ws,fe.Deposit=Bi,fe.DepositManager=Zi,fe.Withdraw=Df,fe.closeDeposit=ts,fe.openDeposit=es,fe.useDeposit=xs,fe.useDepositManager=_f,fe.useWithdraw=Cs,Object.defineProperty(fe,Symbol.toStringTag,{value:"Module"})});
103
+ */var Ic={L:ft.QrCode.Ecc.LOW,M:ft.QrCode.Ecc.MEDIUM,Q:ft.QrCode.Ecc.QUARTILE,H:ft.QrCode.Ecc.HIGH},hi=128,gi="L",vi="#FFFFFF",bi="#000000",yi=!1,xi=1,jc=4,kc=0,_c=.1;function wi(e,t=0){const n=[];return e.forEach(function(r,o){let s=null;r.forEach(function(c,u){if(!c&&s!==null){n.push(`M${s+t} ${o+t}h${u-s}v1H${s+t}z`),s=null;return}if(u===r.length-1){if(!c)return;s===null?n.push(`M${u+t},${o+t} h1v1H${u+t}z`):n.push(`M${s+t},${o+t} h${u+1-s}v1H${s+t}z`);return}c&&s===null&&(s=u)})}),n.join("")}function Ei(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((o,s)=>s<t.x||s>=t.x+t.w?o:!1))}function Rc(e,t,n,r){if(r==null)return null;const o=e.length+n*2,s=Math.floor(t*_c),c=o/t,u=(r.width||s)*c,i=(r.height||s)*c,l=r.x==null?e.length/2-u/2:r.x*c,a=r.y==null?e.length/2-i/2:r.y*c,p=r.opacity==null?1:r.opacity;let m=null;if(r.excavate){let h=Math.floor(l),v=Math.floor(a),b=Math.ceil(u+l-h),E=Math.ceil(i+a-v);m={x:h,y:v,w:b,h:E}}const f=r.crossOrigin;return{x:l,y:a,h:i,w:u,excavation:m,opacity:p,crossOrigin:f}}function Bc(e,t){return t!=null?Math.max(Math.floor(t),0):e?jc:kc}function Ci({value:e,level:t,minVersion:n,includeMargin:r,marginSize:o,imageSettings:s,size:c,boostLevel:u}){let i=d.useMemo(()=>{const h=(Array.isArray(e)?e:[e]).reduce((v,b)=>(v.push(...ft.QrSegment.makeSegments(b)),v),[]);return ft.QrCode.encodeSegments(h,Ic[t],n,void 0,void 0,u)},[e,t,n,u]);const{cells:l,margin:a,numCells:p,calculatedImageSettings:m}=d.useMemo(()=>{let f=i.getModules();const h=Bc(r,o),v=f.length+h*2,b=Rc(f,c,h,s);return{cells:f,margin:h,numCells:v,calculatedImageSettings:b}},[i,c,s,r,o]);return{qrcode:i,margin:a,cells:l,numCells:p,calculatedImageSettings:m}}var Hc=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),Wc=d.forwardRef(function(t,n){const r=t,{value:o,size:s=hi,level:c=gi,bgColor:u=vi,fgColor:i=bi,includeMargin:l=yi,minVersion:a=xi,boostLevel:p,marginSize:m,imageSettings:f}=r,v=er(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:b}=v,E=er(v,["style"]),w=f==null?void 0:f.src,y=d.useRef(null),S=d.useRef(null),C=d.useCallback(L=>{y.current=L,typeof n=="function"?n(L):n&&(n.current=L)},[n]),[O,N]=d.useState(!1),{margin:_,cells:W,numCells:M,calculatedImageSettings:F}=Ci({value:o,level:c,minVersion:a,boostLevel:p,includeMargin:l,marginSize:m,imageSettings:f,size:s});d.useEffect(()=>{if(y.current!=null){const L=y.current,B=L.getContext("2d");if(!B)return;let z=W;const Y=S.current,T=F!=null&&Y!==null&&Y.complete&&Y.naturalHeight!==0&&Y.naturalWidth!==0;T&&F.excavation!=null&&(z=Ei(W,F.excavation));const R=window.devicePixelRatio||1;L.height=L.width=s*R;const Q=s/M*R;B.scale(Q,Q),B.fillStyle=u,B.fillRect(0,0,M,M),B.fillStyle=i,Hc?B.fill(new Path2D(wi(z,_))):W.forEach(function(me,Z){me.forEach(function(q,et){q&&B.fillRect(et+_,Z+_,1,1)})}),F&&(B.globalAlpha=F.opacity),T&&B.drawImage(Y,F.x+_,F.y+_,F.w,F.h)}}),d.useEffect(()=>{N(!1)},[w]);const j=Zn({height:s,width:s},b);let D=null;return w!=null&&(D=d.createElement("img",{src:w,key:w,style:{display:"none"},onLoad:()=>{N(!0)},ref:S,crossOrigin:F==null?void 0:F.crossOrigin})),d.createElement(d.Fragment,null,d.createElement("canvas",Zn({style:j,height:s,width:s,ref:C,role:"img"},E)),D)});Wc.displayName="QRCodeCanvas";var Si=d.forwardRef(function(t,n){const r=t,{value:o,size:s=hi,level:c=gi,bgColor:u=vi,fgColor:i=bi,includeMargin:l=yi,minVersion:a=xi,boostLevel:p,title:m,marginSize:f,imageSettings:h}=r,v=er(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:b,cells:E,numCells:w,calculatedImageSettings:y}=Ci({value:o,level:c,minVersion:a,boostLevel:p,includeMargin:l,marginSize:f,imageSettings:h,size:s});let S=E,C=null;h!=null&&y!=null&&(y.excavation!=null&&(S=Ei(E,y.excavation)),C=d.createElement("image",{href:h.src,height:y.h,width:y.w,x:y.x+b,y:y.y+b,preserveAspectRatio:"none",opacity:y.opacity,crossOrigin:y.crossOrigin}));const O=wi(S,b);return d.createElement("svg",Zn({height:s,width:s,viewBox:`0 0 ${w} ${w}`,ref:n,role:"img"},v),!!m&&d.createElement("title",null,m),d.createElement("path",{fill:u,d:`M0,0 h${w}v${w}H0z`,shapeRendering:"crispEdges"}),d.createElement("path",{fill:i,d:O,shapeRendering:"crispEdges"}),C)});Si.displayName="QRCodeSVG";const Vc=(e,t)=>Number(e)>Number(t),Ze=e=>{if(!e||e===""||isNaN(Number(e)))return"0.00";const t=Number(e);if(t===0)return"0.00";let n=t.toString();n.includes("e")&&(n=t.toFixed(20));const r=n.split("."),o=r[0];let s=r[1]||"";return s.length>6&&(s=s.substring(0,6)),s=s.replace(/0+$/,""),s?(s.length===1&&(s+="0"),o+"."+s):o+".00"},$i=(e,t="0")=>{if(/[^0-9.]/.test(e))return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(e===".")return{isValid:!0,formattedValue:"0."};if((e.match(/\./g)||[]).length>1)return{isValid:!1,formattedValue:"",errorType:"invalid_char"};if(!e||e==="")return{isValid:!0,formattedValue:""};const o=e.split(".");if(o.length===2&&o[1].length>6){const i=o[0]+"."+o[1].substring(0,6);return $i(i,t)}const s=parseFloat(e),c=parseFloat(t);if(!isNaN(s)&&!isNaN(c)&&s>c)return{isValid:!0,formattedValue:Ze(t),errorType:"auto_adjusted_to_max"};let u=e;return!isNaN(s)&&!e.endsWith(".")&&e.includes(".")&&(u=e.replace(/\.?0+$/,""),u.includes(".")||(u=u)),{isValid:!0,formattedValue:u}},Uc=(e,t,n)=>{if(!e||e===""||e==="0"||e==="0.00")return!1;const r=parseFloat(e),o=parseFloat(t);return!(isNaN(r)||isNaN(o)||r>o||!n)},Oi={ETHEREUM:1,SEPOLIA:11155111},zc=[Oi.ETHEREUM,Oi.SEPOLIA],Gc=e=>{if(e.chainId!==void 0){const t=typeof e.chainId=="string"?parseInt(e.chainId,10):e.chainId;return!zc.includes(t)}return!0},Yc=[{chainId:1,chain:"Ethereum",chainIconUrl:"https://static.edgex.exchange/icons/logo/ethereum.svg",allowDeposit:!0,blockTime:12,txConfirm:12},{chainId:42161,chain:"Arbitrum",chainIconUrl:"https://static.edgex.exchange/icons/logo/arbitrum.svg",allowDeposit:!0,blockTime:1,txConfirm:1}],Ti={wallet:"mpc",ethAddress:"0x1234567890123456789012345678901234567890",accountId:"123",l2Key:"0x123"},Pi={address:"0x1234567890123456789012345678901234567890"},Ai={multiChain:{minDeposit:10}},Kc=({walletAdapter:e,curSelectToken:t,currentActiveChain:n,metadata:r})=>{var s;const o=d.useMemo(()=>Gc(n||{}),[n]);return x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"flex justify-center mt-4 mb-3",children:x.jsx("div",{className:"bg-white rounded-lg",children:x.jsx(Si,{value:(e==null?void 0:e.getDisplayAddress())||"",size:120,level:"L",bgColor:"#ffffff",fgColor:"#000000",marginSize:0})})}),x.jsxs("div",{className:"flex items-center justify-between bg-fill-input-primary rounded-lg py-2 px-3 mb-3",children:[x.jsx("span",{className:"flex-1 text-text-primary text-sm font-medium break-all mr-3",children:e==null?void 0:e.getDisplayAddress()}),x.jsx("div",{onClick:()=>{navigator.clipboard.writeText((e==null?void 0:e.getDisplayAddress())||"")},style:{cursor:"pointer"},children:x.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[x.jsx("rect",{x:"2.08496",y:"4.02295",width:"9.89893",height:"9.89893",rx:"2",stroke:"#F9F9F9"}),x.jsx("path",{d:"M5.85547 2.07861H11.415C12.7957 2.07861 13.915 3.1979 13.915 4.57861V10.0786",stroke:"#F9F9F9",strokeLinecap:"round"})]})})]}),x.jsxs("div",{className:"flex items-start",children:[x.jsx("div",{className:"w-5",children:x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:x.jsx("path",{d:"M8.00016 14.6667C11.6821 14.6667 14.6668 11.6819 14.6668 8C14.6668 4.31809 11.6821 1.33333 8.00016 1.33333C4.31826 1.33333 1.3335 4.31809 1.3335 8C1.3335 11.6819 4.31826 14.6667 8.00016 14.6667Z",fill:"#FF8F34",stroke:"#FF8F34",strokeWidth:"1.33333",strokeLinejoin:"round"})})}),x.jsxs("div",{className:"flex-1",children:[x.jsxs("p",{className:"text-xs text-functional-orange-1",children:["Only ",t," (",n==null?void 0:n.chain,") is supported for deposits to this address."]}),x.jsx("div",{className:"pt-2 h-[1px] border-b border-dashed border-line-divider-secondary"})]})]}),o&&x.jsxs(x.Fragment,{children:[x.jsx("div",{className:"flex items-start pl-5 pt-2 text-functional-orange-1 text-xs",children:"When the deposit amount exceeds 250,000, there may be a delay in arrival. It is recommended to use the Ethereum network for deposits."}),x.jsx("div",{className:"pt-4 h-[1px] border-b border-dashed border-line-divider-secondary"})]}),x.jsxs("div",{className:"text-sm",children:[x.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-4",children:[x.jsx("span",{className:"text-text-tertiary",children:"Arrival Time"}),x.jsxs("span",{className:"text-text-primary font-medium text-right underline decoration-dotted underline-offset-1",children:["β‰ˆ"," ",Math.ceil(((n==null?void 0:n.blockTime)||12)*((n==null?void 0:n.txConfirm)||12)/60)," ","minutes"]})]}),x.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[x.jsx("span",{className:"text-text-tertiary",children:"Minimum Deposit Amount"}),x.jsxs("span",{className:"text-text-primary font-medium text-right",children:[((s=r==null?void 0:r.multiChain)==null?void 0:s.minDeposit)||10," ",t]})]}),x.jsxs("div",{className:"flex justify-between items-center h-[18px] mt-2",children:[x.jsx("span",{className:"text-text-tertiary",children:"Maximum Deposit Amount"}),x.jsxs("span",{className:"text-text-primary font-medium text-right",children:["250,000 ",t]})]})]})]})},Qc=({chains:e,defaultChainId:t,defaultTokenAddress:n,walletAdapter:r,metadata:o,onDeposit:s,onClose:c})=>{var v;const[u,i]=d.useState(()=>{var b;return!e||e.length===0?1:t||((b=e[0])==null?void 0:b.chainId)||1}),[l,a]=d.useState(()=>{var y;if(!e||e.length===0)return"";const b=t||((y=e[0])==null?void 0:y.chainId),E=e.find(S=>S.chainId===b);if(!E||!E.tokenList||E.tokenList.length===0)return"";const w=E.tokenList.find(S=>S.tokenAddress===n)||E.tokenList[0];return(w==null?void 0:w.token)||""}),[p,m]=d.useState(""),f=e&&e.length>0?e.find(b=>b.chainId===u)||e[0]:null,h=(v=f==null?void 0:f.tokenList)==null?void 0:v.find(b=>b.token===l);return!e||e.length===0?x.jsx("div",{className:"text-center py-8",children:x.jsx("p",{className:"text-gray-400",children:"No chains available"})}):f?x.jsxs(x.Fragment,{children:[x.jsx(fi,{currentActiveChain:f,chainList:e,onChainChange:i,curSelectToken:l,onTokenChange:a,walletType:"mpc"}),x.jsx(Kc,{walletAdapter:r,curSelectToken:l,currentActiveChain:f,metadata:o}),x.jsx("button",{className:"w-full h-[38px] bg-fill-btn-primary rounded-xl text-sm font-medium text-text-on-sec-btn mt-4",onClick:()=>{s&&s({amount:p,chainId:u,tokenAddress:(h==null?void 0:h.tokenAddress)||"",tokenSymbol:l}),c()},children:"Deposit"})]}):x.jsx("div",{className:"text-center py-8",children:x.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Xc=({depositAmount:e,curSelectToken:t,curSelectTokenData:n,approved:r,currentActiveChain:o,currentEquity:s,amount:c,decimals:u,tokenBalance:i,onDepositAmountChange:l,onApprove:a})=>{const p=f=>{const h=f.target.value,b=$i(h,i||"0");if(b.isValid)l(b.formattedValue),b.errorType;else return b.errorType==="exceed_balance",void 0},m=()=>{const f=parseFloat(i||"0"),h=parseFloat(e||"0");if(h>0){const v=f-h,b=Ze(Math.max(0,v).toString());return`${Ze(i||"0")} β†’ ${b} ${t}`}return`${Ze(i||"0")} ${t}`};return x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"bg-fill-input-primary rounded-lg px-3 py-[10px] my-4",children:[x.jsxs("div",{className:"flex justify-between items-center h-[18px] mb-3",children:[x.jsx("input",{type:"text",placeholder:"Amount",value:e,onChange:p,className:"flex-1 bg-transparent text-text-primary text-sm font-medium placeholder-text-tertiary placeholder:font-normal focus:outline-none border-none p-0 h-full"}),x.jsx("button",{onClick:()=>{l(i||"0")},className:"text-theme-normal text-xs font-medium cursor-pointer hover:opacity-80 transition-opacity h-full flex items-center",children:"MAX"})]}),x.jsx("div",{className:"h-[1px] bg-line-divider-secondary mb-2"}),x.jsxs("div",{className:"flex justify-between items-center",children:[x.jsx("span",{className:"text-text-tertiary text-xs leading-[14px]",children:"Available"}),x.jsx("span",{className:"text-text-primary text-xs leading-[14px]",children:m()})]})]}),!r&&Vc(e||"0",0)&&x.jsxs("div",{className:"flex justify-center flex-col items-center",children:[x.jsxs("h3",{className:"text-text-primary text-sm leading-4 font-medium",children:["Enable ",t," on ",o==null?void 0:o.chain]}),x.jsxs("p",{className:"text-text-secondary text-xs leading-3 mt-4",children:["You must enable ",t," first before you can deposit on"," ",o==null?void 0:o.chain,"."]}),x.jsxs("button",{className:"w-[180px] h-8 bg-fill-btn-primary hover:bg-fill-btn-primary-hover text-text-on-sec-btn rounded-xl text-sm font-medium transition-colors my-4",onClick:a,children:["Enable ",t]})]}),x.jsx("div",{className:"border-t border-line-divider-secondary border-dashed py-4",children:x.jsxs("div",{className:"flex justify-between items-center",children:[x.jsx("span",{className:"text-sm leading-[18px] text-text-tertiary",children:"ζ€»θ΅„δΊ§"}),x.jsx("span",{className:"text-sm leading-[18px] text-text-primary font-medium",children:e?`${Ze("0")} β†’ ${Ze(e)} ${t}`:`${Ze("0")} ${t}`})]})})]})},qc=({chains:e,defaultChainId:t,defaultTokenAddress:n,defaultAmount:r="",walletAdapter:o,metadata:s,currentEquity:c,getTokenBalance:u,approved:i,onApproved:l,onDeposit:a,onClose:p})=>{var F;const[m,f]=d.useState(()=>{var j;return!e||e.length===0?1:t||((j=e[0])==null?void 0:j.chainId)||1}),[h,v]=d.useState(()=>{var B;if(!e||e.length===0)return"";const j=t||((B=e[0])==null?void 0:B.chainId),D=e.find(z=>z.chainId===j);if(!D||!D.tokenList||D.tokenList.length===0)return"";const L=D.tokenList.find(z=>z.tokenAddress===n)||D.tokenList[0];return(L==null?void 0:L.token)||""}),[b,E]=d.useState(r),w=d.useRef(!0),y=d.useRef(h),S=d.useRef(m);d.useEffect(()=>{if(w.current){w.current=!1,y.current=h,S.current=m;return}(y.current!==h||S.current!==m)&&(E(""),y.current=h,S.current=m)},[h,m]);const C=e&&e.length>0?e.find(j=>j.chainId===m)||e[0]:null,O=(F=C==null?void 0:C.tokenList)==null?void 0:F.find(j=>j.token===h),N=d.useMemo(()=>{if(!(!O||!C||!u))return u(O.tokenAddress,C.chainId)},[O,C,u]),_=d.useMemo(()=>{var D;if(i!==void 0)return i;const j=(D=O==null?void 0:O.allowance)==null?void 0:D.formatted;return!j||!b?!1:parseFloat(j)>=parseFloat(b)},[i,O==null?void 0:O.allowance,b]),W=d.useMemo(()=>{const j=parseFloat(b||"0"),D=10,L=N||"0",B=Uc(b,L,_);return!b||j===0?{text:"Confirm Deposit",disabled:!0}:_?j>parseFloat(L)?{text:"Insufficient Balance",disabled:!0}:j<D?{text:`Min Deposit ${D} ${h}`,disabled:!0}:{text:"Confirm Deposit",disabled:!B}:{text:"Confirm Deposit",disabled:!0}},[b,h,N,_]),M=d.useCallback(async()=>{a&&a({amount:b,chainId:m,tokenAddress:(O==null?void 0:O.tokenAddress)||"",tokenSymbol:h}),p()},[a,p,b,m,O==null?void 0:O.tokenAddress,h]);return!e||e.length===0?x.jsx("div",{className:"text-center py-8",children:x.jsx("p",{className:"text-gray-400",children:"No chains available"})}):C?x.jsxs(x.Fragment,{children:[x.jsx(fi,{currentActiveChain:C,chainList:e,onChainChange:f,curSelectToken:h,onTokenChange:v,walletType:"evm"}),x.jsx(Xc,{depositAmount:b,curSelectToken:h,curSelectTokenData:{balance:O==null?void 0:O.balance,allowance:O==null?void 0:O.allowance},approved:_,currentActiveChain:C,currentEquity:c||0,amount:b,decimals:(O==null?void 0:O.decimals)||6,tokenBalance:N,onDepositAmountChange:E,onApprove:async()=>{l&&await l()}}),x.jsx("button",{className:`w-full h-[38px] text-sm rounded-xl font-medium transition-colors ${W.disabled?"bg-text-disabled text-text-secondary cursor-not-allowed":"bg-fill-btn-primary text-text-on-sec-btn"}`,onClick:M,disabled:W.disabled,children:W.text})]}):x.jsx("div",{className:"text-center py-8",children:x.jsx("p",{className:"text-gray-400",children:"Loading..."})})},Mi=({isOpen:e,onClose:t,config:n,currentActiveAccount:r=Ti,smartWallet:o=Pi,chains:s,defaultChainId:c,defaultTokenAddress:u,defaultAmount:i="",metadata:l=Ai,currentEquity:a=5e3,getTokenBalance:p,approved:m,onApproved:f,onDeposit:h})=>{const v=d.useMemo(()=>{var E;return r?fs(r,o,!1,(E=s[0])==null?void 0:E.chainId,"0","0"):null},[r,o,s]),b=(v==null?void 0:v.getWalletType())==="mpc";return e?de.createPortal(x.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-[999] w-screen h-screen",style:{zIndex:999},children:x.jsx("div",{className:"fixed top-0 left-0 right-0 bottom-0 z-50 flex items-center justify-center",style:{background:"rgba(0, 0, 0, 0.6)"},onClick:()=>{t()},"aria-hidden":"true",children:x.jsxs("div",{className:"relative w-[420px] max-h-[85vh] bg-fill-page-secondary overflow-auto rounded-lg p-6 shadow-xl",onClick:E=>{E.stopPropagation()},children:[x.jsxs("div",{className:"flex items-center justify-between mb-4",children:[x.jsx("h2",{className:"text-lg font-semibold text-white",children:"Deposit"}),x.jsx("button",{className:"text-gray-400 hover:text-gray-200 transition-colors",onClick:t,"aria-label":"Close",children:x.jsx(as,{className:"h-4 w-4"})})]}),b?x.jsx(Qc,{chains:s,defaultChainId:c,defaultTokenAddress:u,defaultAmount:i,walletAdapter:v,metadata:l,currentEquity:a,onDeposit:h,onClose:t}):x.jsx(qc,{chains:s,defaultChainId:c,defaultTokenAddress:u,defaultAmount:i,walletAdapter:v,metadata:l,currentEquity:a,getTokenBalance:p,approved:m,onApproved:f,onDeposit:h,onClose:t})]})})}),document.body):null};let Le=null;const Jc={symbol:"USDT"},Ni=d.forwardRef((e,t)=>{const[n,r]=d.useState(!1),[o,s]=d.useState({chains:[]}),c=d.useCallback(a=>{s(a),r(!0)},[]),u=d.useCallback(a=>{s(p=>({...p,...a}))},[]),i=d.useCallback(()=>{r(!1),o.onClose&&o.onClose()},[o.onClose]),l=d.useCallback(()=>n,[n]);return d.useImperativeHandle(t,()=>({openDeposit:c,closeDeposit:i,updateDepositOptions:u,isOpen:l}),[c,i,u,l]),d.useEffect(()=>(Le={openDeposit:c,closeDeposit:i,updateDepositOptions:u,isOpen:l},()=>{Le=null}),[c,i,u,l]),x.jsx(Mi,{isOpen:n,onClose:i,config:o.config||Jc,currentActiveAccount:o.currentActiveAccount||Ti,smartWallet:o.smartWallet||Pi,chains:o.chains||Yc,defaultChainId:o.defaultChainId,defaultTokenAddress:o.defaultTokenAddress,defaultAmount:o.defaultAmount,metadata:o.metadata||Ai,currentEquity:o.currentEquity??5e3,getTokenBalance:o.getTokenBalance,approved:o.approved,onApproved:o.onApproved,onDeposit:o.onDeposit})});Ni.displayName="DepositManager";const Fi=e=>{if(!Le){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Le.openDeposit(e||{chains:[]})},Li=()=>{if(!Le){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Le.closeDeposit()},Zc=e=>{if(!Le){console.error("DepositManager not initialized. Make sure to render <DepositManager /> in your app.");return}Le.updateDepositOptions(e)},ef=()=>Le?Le.isOpen():!1,tf=()=>({openDeposit:Fi,closeDeposit:Li,updateDepositOptions:Zc,isOpen:ef});d.createContext(null);const nf=({isOpen:e,onClose:t,config:n})=>e?x.jsx("div",{className:"withdraw-modal",children:x.jsx("div",{className:"modal-overlay",onClick:t,children:x.jsxs("div",{className:"modal-content",onClick:r=>r.stopPropagation(),children:[x.jsxs("h2",{children:["Withdraw ",n.symbol]}),x.jsxs("p",{children:["Symbol: ",n.symbol]}),x.jsx("button",{onClick:t,children:"Close"})]})})}):null;ne.ComponentProvider=Zi,ne.Deposit=Mi,ne.DepositManager=Ni,ne.Withdraw=nf,ne.closeDeposit=Li,ne.openDeposit=Fi,ne.useDeposit=es,ne.useDepositManager=tf,ne.useWithdraw=ts,Object.defineProperty(ne,Symbol.toStringTag,{value:"Module"})});
123
104
  //# sourceMappingURL=index.umd.js.map