@dcl/auth-site 0.1.3-7422460847.commit-7c39fc4 → 0.1.3-7423579639.commit-0c1b974

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.
@@ -118,7 +118,7 @@ Instead of \``+$+"`, did you mean:",k.map(function(M){return`
118
118
  border-radius: 0;
119
119
  z-index: 2147483647;
120
120
  }
121
- `}])),pN}var P4e=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),T4e=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),R4e=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&P4e(e,t,r);return T4e(e,t),e};Object.defineProperty(HS,"__esModule",{value:!0});HS.FortmaticConnector=void 0;const C4e=iae,N4e=Ml,D4e=qs;class $4e extends C4e.AbstractConnector{constructor(e){const r=D4e.getConfiguration()[N4e.ProviderType.FORTMATIC],n=Object.keys(r.apiKeys).map(i=>Number(i));if(!n.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:n}),this.apiKey=r.apiKeys[e],this.chainId=e,this.rpcUrl=r.urls[e]}async activate(){if(!this.fortmatic){const{default:r}=await Promise.resolve().then(()=>R4e(I4e()));this.fortmatic=new r(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(r=>r[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}HS.FortmaticConnector=$4e;var XS={};function Q4(){return Q4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Q4.apply(this,arguments)}function Ek(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function J4(t){return J4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},J4(t)}function LA(t,e){return LA=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},LA(t,e)}function M4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ex(t,e,r){return M4e()?Ex=Reflect.construct:Ex=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&LA(u,o.prototype),u},Ex.apply(null,arguments)}function k4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function UA(t){var e=typeof Map=="function"?new Map:void 0;return UA=function(n){if(n===null||!k4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Ex(n,arguments,J4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),LA(i,n)},UA(t)}function pE(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function p0(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function Vc(t){return t.hasOwnProperty("result")?t.result:t}var xx=function(t){Ek(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="No Ethereum provider was found on window.ethereum.",r}return e}(UA(Error)),qae=function(t){Ek(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="The user rejected the request.",r}return e}(UA(Error)),L4e=function(t){Ek(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(pE(i)),i.handleChainChanged=i.handleChainChanged.bind(pE(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(pE(i)),i.handleClose=i.handleClose.bind(pE(i)),i}var r=e.prototype;return r.handleChainChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.handleAccountsChanged=function(i){i.length===0?this.emitDeactivate():this.emitUpdate({account:i[0]})},r.handleClose=function(i,a){this.emitDeactivate()},r.handleNetworkChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.activate=function(){try{var i=function(f){if(a)return f;function d(){return Q4({provider:window.ethereum},s?{account:s}:{})}var g=function(){if(!s)return Promise.resolve(window.ethereum.enable().then(function(m){return m&&Vc(m)[0]})).then(function(m){s=m})}();return g&&g.then?g.then(d):d(g)},a=!1,o=this;if(!window.ethereum)throw new xx;window.ethereum.on&&(window.ethereum.on("chainChanged",o.handleChainChanged),window.ethereum.on("accountsChanged",o.handleAccountsChanged),window.ethereum.on("close",o.handleClose),window.ethereum.on("networkChanged",o.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var s,c=p0(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return Vc(u)[0]})).then(function(u){s=u})},function(u){if(u.code===4001)throw new qae});return Promise.resolve(c&&c.then?c.then(i):i(c))}catch(u){return Promise.reject(u)}},r.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(i){return Promise.reject(i)}},r.getChainId=function(){try{var i=function(){function c(){if(!a)try{a=Vc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=Vc(window.ethereum.cachedResults.net_version):a=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.send("net_version").then(Vc)).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new xx;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(Vc)).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.getAccount=function(){try{var i=function(){function c(){return a||(a=Vc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.enable().then(function(d){return Vc(d)[0]})).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new xx;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(s){return Vc(s)[0]})).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},r.isAuthorized=function(){try{return window.ethereum?Promise.resolve(p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return Vc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(qS);const U4e=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:L4e,NoEthereumProviderError:xx,UserRejectedRequestError:qae},Symbol.toStringTag,{value:"Module"})),B4e=uo(U4e);Object.defineProperty(XS,"__esModule",{value:!0});XS.InjectedConnector=void 0;const F4e=B4e;class j4e extends F4e.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}XS.InjectedConnector=j4e;var ZS={},q4e="Invariant failed";function PW(t,e){if(!t)throw new Error(q4e)}function Hae(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,S1(t,e)}function X4(t){return X4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},X4(t)}function S1(t,e){return S1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},S1(t,e)}function H4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ax(t,e,r){return H4e()?Ax=Reflect.construct:Ax=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&S1(u,o.prototype),u},Ax.apply(null,arguments)}function z4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Z4(t){var e=typeof Map=="function"?new Map:void 0;return Z4=function(n){if(n===null||!z4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Ax(n,arguments,X4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),S1(i,n)},Z4(t)}var Sx=function(t){Hae(e,t);function e(r,n,i){var a;return a=t.call(this)||this,a.code=n,a.data=i,a.name=a.constructor.name,a.message=r,a}return e}(Z4(Error)),V4e=function(e,r){var n=this,i=this;this.isMetaMask=!1,this.sendAsync=function(o,s){console.log("sendAsync",o.method,o.params),i.request(o.method,o.params).then(function(c){return s(null,{jsonrpc:"2.0",id:o.id,result:c})}).catch(function(c){return s(c,null)})},this.request=function(o,s){try{return typeof o!="string"&&(s=o.params,o=o.method),Promise.resolve(fetch(n.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:o,params:s}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new Sx(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,d,g;throw new Sx(u==null||(f=u.error)==null?void 0:f.message,u==null||(d=u.error)==null?void 0:d.code,u==null||(g=u.error)==null?void 0:g.data)}else{if("result"in u)return u.result;throw new Sx("Received unexpected JSON-RPC response to "+o+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=e,this.url=r;var a=new URL(r);this.host=a.host,this.path=a.pathname},G4e=function(t){Hae(e,t);function e(n){var i,a=n.urls,o=n.defaultChainId;return o||Object.keys(a).length===1||PW(!1),i=t.call(this,{supportedChainIds:Object.keys(a).map(function(s){return Number(s)})})||this,i.currentChainId=o||Number(Object.keys(a)[0]),i.providers=Object.keys(a).reduce(function(s,c){return s[Number(c)]=new V4e(Number(c),a[Number(c)]),s},{}),i}var r=e.prototype;return r.activate=function(){try{var i=this;return Promise.resolve({provider:i.providers[i.currentChainId],chainId:i.currentChainId,account:null})}catch(a){return Promise.reject(a)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.providers[i.currentChainId])}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.currentChainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){return Promise.resolve(null)},r.deactivate=function(){},r.changeChainId=function(i){Object.keys(this.providers).includes(i.toString())||PW(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(qS);const W4e=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:G4e,RequestError:Sx},Symbol.toStringTag,{value:"Module"})),K4e=uo(W4e);Object.defineProperty(ZS,"__esModule",{value:!0});ZS.NetworkConnector=void 0;const Y4e=Sc,Q4e=K4e,J4e=qs;class X4e extends Q4e.NetworkConnector{constructor(e){super({urls:J4e.getConfiguration()[Y4e.ProviderType.NETWORK].urls,defaultChainId:e})}}ZS.NetworkConnector=X4e;var eO={};const Z4e="modulepreload",e5e=function(t){return"https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/"+t},TW={},Ry=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=e5e(a),a in TW)return;TW[a]=!0;const o=a.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const d=i[f];if(d.href===a&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Z4e,o||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})};function e5(){return e5=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},e5.apply(this,arguments)}function t5e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t5(t,e)}function t5(t,e){return t5=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},t5(t,e)}function RW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var r5e=1,n5e=function(t){t5e(e,t);function e(n){var i,a=n.url,o=n.appName,s=n.appLogoUrl,c=n.darkMode,u=n.supportedChainIds;return i=t.call(this,{supportedChainIds:u})||this,i.url=a,i.appName=o,i.appLogoUrl=s,i.darkMode=c||!1,i.handleChainChanged=i.handleChainChanged.bind(RW(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(RW(i)),i}var r=e.prototype;return r.activate=function(){try{var i=this,a=function(){return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return i.provider.on("chainChanged",i.handleChainChanged),i.provider.on("accountsChanged",i.handleAccountsChanged),{provider:i.provider,account:u}})},o=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)i.provider=window.ethereum;else{var s=function(){if(!i.walletLink)return Promise.resolve(Ry(()=>import("./index-71db5ecb.js").then(c=>c.i),[]).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){i.walletLink=new c(e5({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,r5e)})}();if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(a):a(o))}catch(s){return Promise.reject(s)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.provider)}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.provider.chainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){try{var i=this;return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(a){return a[0]})}catch(a){return Promise.reject(a)}},r.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},r.close=function(){try{var i=this;return i.provider.close(),i.emitDeactivate(),Promise.resolve()}catch(a){return Promise.reject(a)}},r.handleChainChanged=function(i){this.emitUpdate({chainId:i})},r.handleAccountsChanged=function(i){this.emitUpdate({account:i[0]})},e}(qS);const i5e=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:n5e},Symbol.toStringTag,{value:"Module"})),a5e=uo(i5e);Object.defineProperty(eO,"__esModule",{value:!0});eO.WalletLinkConnector=void 0;const o5e=Ml,s5e=a5e,c5e=qs;class u5e extends s5e.WalletLinkConnector{constructor(e){const r=c5e.getConfiguration()[o5e.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}eO.WalletLinkConnector=u5e;var tO={};const l5e=Symbol(),CW=Object.getPrototypeOf,r5=new WeakMap,f5e=t=>t&&(r5.has(t)?r5.get(t):CW(t)===Object.prototype||CW(t)===Array.prototype),d5e=t=>f5e(t)&&t[l5e]||null,NW=(t,e=!0)=>{r5.set(t,e)},gN=t=>typeof t=="object"&&t!==null,wf=new WeakMap,gE=new WeakSet,h5e=(t=Object.is,e=(u,f)=>new Proxy(u,f),r=u=>gN(u)&&!gE.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),n=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,a=(u,f,d=n)=>{const g=i.get(u);if((g==null?void 0:g[0])===f)return g[1];const m=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return NW(m,!0),i.set(u,[f,m]),Reflect.ownKeys(u).forEach(w=>{if(Object.getOwnPropertyDescriptor(m,w))return;const v=Reflect.get(u,w),y={value:v,enumerable:!0,configurable:!0};if(gE.has(v))NW(v,!1);else if(v instanceof Promise)delete y.value,y.get=()=>d(v);else if(wf.has(v)){const[_,b]=wf.get(v);y.value=a(_,b(),d)}Object.defineProperty(m,w,y)}),Object.preventExtensions(m)},o=new WeakMap,s=[1,1],c=u=>{if(!gN(u))throw new Error("object required");const f=o.get(u);if(f)return f;let d=s[0];const g=new Set,m=(C,L=++s[0])=>{d!==L&&(d=L,g.forEach(q=>q(C,L)))};let w=s[1];const v=(C=++s[1])=>(w!==C&&!g.size&&(w=C,_.forEach(([L])=>{const q=L[1](C);q>d&&(d=q)})),d),y=C=>(L,q)=>{const le=[...L];le[1]=[C,...le[1]],m(le,q)},_=new Map,b=(C,L)=>{if(g.size){const q=L[3](y(C));_.set(C,[L,q])}else _.set(C,[L])},A=C=>{var L;const q=_.get(C);q&&(_.delete(C),(L=q[1])==null||L.call(q))},x=C=>(g.add(C),g.size===1&&_.forEach(([q,le],pe)=>{const B=q[3](y(pe));_.set(pe,[q,B])}),()=>{g.delete(C),g.size===0&&_.forEach(([q,le],pe)=>{le&&(le(),_.set(pe,[q]))})}),O=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),p=e(O,{deleteProperty(C,L){const q=Reflect.get(C,L);A(L);const le=Reflect.deleteProperty(C,L);return le&&m(["delete",[L],q]),le},set(C,L,q,le){const pe=Reflect.has(C,L),B=Reflect.get(C,L,le);if(pe&&(t(B,q)||o.has(q)&&t(B,o.get(q))))return!0;A(L),gN(q)&&(q=d5e(q)||q);let U=q;if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,m(["resolve",[L],K])}).catch(K=>{q.status="rejected",q.reason=K,m(["reject",[L],K])});else{!wf.has(q)&&r(q)&&(U=c(q));const K=!gE.has(U)&&wf.get(U);K&&b(L,K)}return Reflect.set(C,L,U,le),m(["set",[L],q,B]),!0}});o.set(u,p);const I=[O,v,a,x];return wf.set(p,I),Reflect.ownKeys(u).forEach(C=>{const L=Object.getOwnPropertyDescriptor(u,C);"value"in L&&(p[C]=u[C],delete L.value,delete L.writable),Object.defineProperty(O,C,L)}),p})=>[c,wf,gE,t,e,r,n,i,a,o,s],[p5e]=h5e();function xd(t={}){return p5e(t)}function Ip(t,e,r){const n=wf.get(t);let i;const a=[],o=n[3];let s=!1;const u=o(f=>{if(a.push(f),r){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,s&&e(a.splice(0))}))});return s=!0,()=>{s=!1,u()}}function g5e(t,e){const r=wf.get(t),[n,i,a]=r;return a(n,i(),e)}const Wi=xd({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),zae={state:Wi,subscribe(t){return Ip(Wi,()=>t(Wi))},push(t,e){t!==Wi.view&&(Wi.view=t,e&&(Wi.data=e),Wi.history.push(t))},reset(t){Wi.view=t,Wi.history=[t]},replace(t){Wi.history.length>1&&(Wi.history[Wi.history.length-1]=t,Wi.view=t)},goBack(){if(Wi.history.length>1){Wi.history.pop();const[t]=Wi.history.slice(-1);Wi.view=t}},setData(t){Wi.data=t}},Ma={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Ma.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ma.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Ma.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Ma.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Ma.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=zae.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},y5e=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Oa=xd({enabled:y5e,userSessionId:"",events:[],connectedWalletId:void 0}),m5e={state:Oa,subscribe(t){return Ip(Oa.events,()=>t(g5e(Oa.events[Oa.events.length-1])))},initialize(){Oa.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Oa.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Oa.connectedWalletId=t},click(t){if(Oa.enabled){const e={type:"CLICK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},track(t){if(Oa.enabled){const e={type:"TRACK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},view(t){if(Oa.enabled){const e={type:"VIEW",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}}},Gc=xd({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Ic={state:Gc,subscribe(t){return Ip(Gc,()=>t(Gc))},setChains(t){Gc.chains=t},setWalletConnectUri(t){Gc.walletConnectUri=t},setIsCustomDesktop(t){Gc.isCustomDesktop=t},setIsCustomMobile(t){Gc.isCustomMobile=t},setIsDataLoaded(t){Gc.isDataLoaded=t},setIsUiLoaded(t){Gc.isUiLoaded=t},setIsAuth(t){Gc.isAuth=t}},yE=xd({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Cy={state:yE,subscribe(t){return Ip(yE,()=>t(yE))},setConfig(t){var e,r;m5e.initialize(),Ic.setChains(t.chains),Ic.setIsAuth(!!t.enableAuthMode),Ic.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),Ic.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Ma.setModalVersionInStorage(),Object.assign(yE,t)}};var v5e=Object.defineProperty,DW=Object.getOwnPropertySymbols,b5e=Object.prototype.hasOwnProperty,w5e=Object.prototype.propertyIsEnumerable,$W=(t,e,r)=>e in t?v5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_5e=(t,e)=>{for(var r in e||(e={}))b5e.call(e,r)&&$W(t,r,e[r]);if(DW)for(var r of DW(e))w5e.call(e,r)&&$W(t,r,e[r]);return t};const n5="https://explorer-api.walletconnect.com",i5="wcm",a5="js-2.6.2";async function mE(t,e){const r=_5e({sdkType:i5,sdkVersion:a5},e),n=new URL(t,n5);return n.searchParams.append("projectId",Cy.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Jd={async getDesktopListings(t){return mE("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return mE("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return mE("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return mE("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${n5}/w3m/v1/getWalletImage/${t}?projectId=${Cy.state.projectId}&sdkType=${i5}&sdkVersion=${a5}`},getAssetImageUrl(t){return`${n5}/w3m/v1/getAssetImage/${t}?projectId=${Cy.state.projectId}&sdkType=${i5}&sdkVersion=${a5}`}};var E5e=Object.defineProperty,MW=Object.getOwnPropertySymbols,x5e=Object.prototype.hasOwnProperty,A5e=Object.prototype.propertyIsEnumerable,kW=(t,e,r)=>e in t?E5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S5e=(t,e)=>{for(var r in e||(e={}))x5e.call(e,r)&&kW(t,r,e[r]);if(MW)for(var r of MW(e))A5e.call(e,r)&&kW(t,r,e[r]);return t};const LW=Ma.isMobile(),Wc=xd({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),PWe={state:Wc,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Cy.state;if(t==="NONE"||e==="ALL"&&!t)return Wc.recomendedWallets;if(Ma.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await Jd.getAllListings(r),i=Object.values(n);i.sort((a,o)=>{const s=t.indexOf(a.id),c=t.indexOf(o.id);return s-c}),Wc.recomendedWallets=i}else{const{chains:r,isAuth:n}=Ic.state,i=r==null?void 0:r.join(","),a=Ma.isArray(e),o={page:1,sdks:n?"auth_v1":void 0,entries:Ma.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:s}=LW?await Jd.getMobileListings(o):await Jd.getDesktopListings(o);Wc.recomendedWallets=Object.values(s)}return Wc.recomendedWallets},async getWallets(t){const e=S5e({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=Cy.state,{recomendedWallets:i}=Wc;if(n==="ALL")return Wc.wallets;i.length?e.excludedIds=i.map(d=>d.id).join(","):Ma.isArray(r)&&(e.excludedIds=r.join(",")),Ma.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Ic.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:o}=t,{listings:s,total:c}=LW?await Jd.getMobileListings(e):await Jd.getDesktopListings(e),u=Object.values(s),f=o?"search":"wallets";return Wc[f]={listings:[...Wc[f].listings,...u],total:c,page:a??1},{listings:u,total:c}},getWalletImageUrl(t){return Jd.getWalletImageUrl(t)},getAssetImageUrl(t){return Jd.getAssetImageUrl(t)},resetSearch(){Wc.search={listings:[],total:0,page:1}}},g0=xd({open:!1}),yN={state:g0,subscribe(t){return Ip(g0,()=>t(g0))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Ic.state;if(Ma.removeWalletConnectDeepLink(),Ic.setWalletConnectUri(t==null?void 0:t.uri),Ic.setChains(t==null?void 0:t.chains),zae.reset("ConnectWallet"),r&&n)g0.open=!0,e();else{const i=setInterval(()=>{const a=Ic.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),g0.open=!0,e())},200)}})},close(){g0.open=!1}};var O5e=Object.defineProperty,UW=Object.getOwnPropertySymbols,I5e=Object.prototype.hasOwnProperty,P5e=Object.prototype.propertyIsEnumerable,BW=(t,e,r)=>e in t?O5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,T5e=(t,e)=>{for(var r in e||(e={}))I5e.call(e,r)&&BW(t,r,e[r]);if(UW)for(var r of UW(e))P5e.call(e,r)&&BW(t,r,e[r]);return t};function R5e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Av=xd({themeMode:R5e()?"dark":"light"}),FW={state:Av,subscribe(t){return Ip(Av,()=>t(Av))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Av.themeMode=e),r&&(Av.themeVariables=T5e({},r))}},Xd=xd({open:!1,message:"",variant:"success"}),TWe={state:Xd,subscribe(t){return Ip(Xd,()=>t(Xd))},openToast(t,e){Xd.open=!0,Xd.message=t,Xd.variant=e},closeToast(){Xd.open=!1}};let C5e=class{constructor(e){this.openModal=yN.open,this.closeModal=yN.close,this.subscribeModal=yN.subscribe,this.setTheme=FW.setThemeConfig,FW.setThemeConfig(e),Cy.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Ry(()=>import("./index-6d98ae69.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Ic.setIsUiLoaded(!0)}}};const N5e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:C5e},Symbol.toStringTag,{value:"Module"})),D5e=uo(N5e);var xk={},rO={},Lr={},Vae={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,c){var u=s>>>16&65535,f=s&65535,d=c>>>16&65535,g=c&65535;return f*g+(u*g+f*d<<16>>>0)|0}t.mul=Math.imul||e;function r(s,c){return s+c|0}t.add=r;function n(s,c){return s-c|0}t.sub=n;function i(s,c){return s<<c|s>>>32-c}t.rotl=i;function a(s,c){return s<<32-c|s>>>c}t.rotr=a;function o(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(s){return t.isInteger(s)&&s>=-t.MAX_SAFE_INTEGER&&s<=t.MAX_SAFE_INTEGER}})(Vae);Object.defineProperty(Lr,"__esModule",{value:!0});var Gae=Vae;function $5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Lr.readInt16BE=$5e;function M5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Lr.readUint16BE=M5e;function k5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Lr.readInt16LE=k5e;function L5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Lr.readUint16LE=L5e;function Wae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}Lr.writeUint16BE=Wae;Lr.writeInt16BE=Wae;function Kae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}Lr.writeUint16LE=Kae;Lr.writeInt16LE=Kae;function o5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Lr.readInt32BE=o5;function s5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Lr.readUint32BE=s5;function c5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Lr.readInt32LE=c5;function u5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Lr.readUint32LE=u5;function BA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}Lr.writeUint32BE=BA;Lr.writeInt32BE=BA;function FA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}Lr.writeUint32LE=FA;Lr.writeInt32LE=FA;function U5e(t,e){e===void 0&&(e=0);var r=o5(t,e),n=o5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Lr.readInt64BE=U5e;function B5e(t,e){e===void 0&&(e=0);var r=s5(t,e),n=s5(t,e+4);return r*4294967296+n}Lr.readUint64BE=B5e;function F5e(t,e){e===void 0&&(e=0);var r=c5(t,e),n=c5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Lr.readInt64LE=F5e;function j5e(t,e){e===void 0&&(e=0);var r=u5(t,e),n=u5(t,e+4);return n*4294967296+r}Lr.readUint64LE=j5e;function Yae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),BA(t/4294967296>>>0,e,r),BA(t>>>0,e,r+4),e}Lr.writeUint64BE=Yae;Lr.writeInt64BE=Yae;function Qae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),FA(t>>>0,e,r),FA(t/4294967296>>>0,e,r+4),e}Lr.writeUint64LE=Qae;Lr.writeInt64LE=Qae;function q5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}Lr.readUintBE=q5e;function H5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}Lr.readUintLE=H5e;function z5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Gae.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}Lr.writeUintBE=z5e;function V5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Gae.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}Lr.writeUintLE=V5e;function G5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Lr.readFloat32BE=G5e;function W5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Lr.readFloat32LE=W5e;function K5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Lr.readFloat64BE=K5e;function Y5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Lr.readFloat64LE=Y5e;function Q5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}Lr.writeFloat32BE=Q5e;function J5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}Lr.writeFloat32LE=J5e;function X5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}Lr.writeFloat64BE=X5e;function Z5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}Lr.writeFloat64LE=Z5e;var is={};Object.defineProperty(is,"__esModule",{value:!0});function eDe(t){for(var e=0;e<t.length;e++)t[e]=0;return t}is.wipe=eDe;Object.defineProperty(rO,"__esModule",{value:!0});var Ia=Lr,l5=is,tDe=20;function rDe(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,o=1797285236,s=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],d=r[19]<<24|r[18]<<16|r[17]<<8|r[16],g=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],w=r[31]<<24|r[30]<<16|r[29]<<8|r[28],v=e[3]<<24|e[2]<<16|e[1]<<8|e[0],y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],_=e[11]<<24|e[10]<<16|e[9]<<8|e[8],b=e[15]<<24|e[14]<<16|e[13]<<8|e[12],A=n,x=i,O=a,E=o,p=s,I=c,C=u,L=f,q=d,le=g,pe=m,B=w,U=v,K=y,ne=_,F=b,j=0;j<tDe;j+=2)A=A+p|0,U^=A,U=U>>>32-16|U<<16,q=q+U|0,p^=q,p=p>>>32-12|p<<12,x=x+I|0,K^=x,K=K>>>32-16|K<<16,le=le+K|0,I^=le,I=I>>>32-12|I<<12,O=O+C|0,ne^=O,ne=ne>>>32-16|ne<<16,pe=pe+ne|0,C^=pe,C=C>>>32-12|C<<12,E=E+L|0,F^=E,F=F>>>32-16|F<<16,B=B+F|0,L^=B,L=L>>>32-12|L<<12,O=O+C|0,ne^=O,ne=ne>>>32-8|ne<<8,pe=pe+ne|0,C^=pe,C=C>>>32-7|C<<7,E=E+L|0,F^=E,F=F>>>32-8|F<<8,B=B+F|0,L^=B,L=L>>>32-7|L<<7,x=x+I|0,K^=x,K=K>>>32-8|K<<8,le=le+K|0,I^=le,I=I>>>32-7|I<<7,A=A+p|0,U^=A,U=U>>>32-8|U<<8,q=q+U|0,p^=q,p=p>>>32-7|p<<7,A=A+I|0,F^=A,F=F>>>32-16|F<<16,pe=pe+F|0,I^=pe,I=I>>>32-12|I<<12,x=x+C|0,U^=x,U=U>>>32-16|U<<16,B=B+U|0,C^=B,C=C>>>32-12|C<<12,O=O+L|0,K^=O,K=K>>>32-16|K<<16,q=q+K|0,L^=q,L=L>>>32-12|L<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,le=le+ne|0,p^=le,p=p>>>32-12|p<<12,O=O+L|0,K^=O,K=K>>>32-8|K<<8,q=q+K|0,L^=q,L=L>>>32-7|L<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,le=le+ne|0,p^=le,p=p>>>32-7|p<<7,x=x+C|0,U^=x,U=U>>>32-8|U<<8,B=B+U|0,C^=B,C=C>>>32-7|C<<7,A=A+I|0,F^=A,F=F>>>32-8|F<<8,pe=pe+F|0,I^=pe,I=I>>>32-7|I<<7;Ia.writeUint32LE(A+n|0,t,0),Ia.writeUint32LE(x+i|0,t,4),Ia.writeUint32LE(O+a|0,t,8),Ia.writeUint32LE(E+o|0,t,12),Ia.writeUint32LE(p+s|0,t,16),Ia.writeUint32LE(I+c|0,t,20),Ia.writeUint32LE(C+u|0,t,24),Ia.writeUint32LE(L+f|0,t,28),Ia.writeUint32LE(q+d|0,t,32),Ia.writeUint32LE(le+g|0,t,36),Ia.writeUint32LE(pe+m|0,t,40),Ia.writeUint32LE(B+w|0,t,44),Ia.writeUint32LE(U+v|0,t,48),Ia.writeUint32LE(K+y|0,t,52),Ia.writeUint32LE(ne+_|0,t,56),Ia.writeUint32LE(F+b|0,t,60)}function Jae(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,o;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),o=a.length-e.length,a.set(e,o)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,o=i}for(var s=new Uint8Array(64),c=0;c<r.length;c+=64){rDe(s,a,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^s[u-c];iDe(a,0,o)}return l5.wipe(s),i===0&&l5.wipe(a),n}rO.streamXOR=Jae;function nDe(t,e,r,n){return n===void 0&&(n=0),l5.wipe(r),Jae(t,e,r,r,n)}rO.stream=nDe;function iDe(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Xae={},Ad={};Object.defineProperty(Ad,"__esModule",{value:!0});function aDe(t,e,r){return~(t-1)&e|t-1&r}Ad.select=aDe;function oDe(t,e){return(t|0)-(e|0)-1>>>31&1}Ad.lessOrEqual=oDe;function Zae(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}Ad.compare=Zae;function sDe(t,e){return t.length===0||e.length===0?!1:Zae(t,e)!==0}Ad.equal=sDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ad,r=is;t.DIGEST_LENGTH=16;var n=function(){function o(s){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=s[0]|s[1]<<8;this._r[0]=c&8191;var u=s[2]|s[3]<<8;this._r[1]=(c>>>13|u<<3)&8191;var f=s[4]|s[5]<<8;this._r[2]=(u>>>10|f<<6)&7939;var d=s[6]|s[7]<<8;this._r[3]=(f>>>7|d<<9)&8191;var g=s[8]|s[9]<<8;this._r[4]=(d>>>4|g<<12)&255,this._r[5]=g>>>1&8190;var m=s[10]|s[11]<<8;this._r[6]=(g>>>14|m<<2)&8191;var w=s[12]|s[13]<<8;this._r[7]=(m>>>11|w<<5)&8065;var v=s[14]|s[15]<<8;this._r[8]=(w>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=s[16]|s[17]<<8,this._pad[1]=s[18]|s[19]<<8,this._pad[2]=s[20]|s[21]<<8,this._pad[3]=s[22]|s[23]<<8,this._pad[4]=s[24]|s[25]<<8,this._pad[5]=s[26]|s[27]<<8,this._pad[6]=s[28]|s[29]<<8,this._pad[7]=s[30]|s[31]<<8}return o.prototype._blocks=function(s,c,u){for(var f=this._fin?0:2048,d=this._h[0],g=this._h[1],m=this._h[2],w=this._h[3],v=this._h[4],y=this._h[5],_=this._h[6],b=this._h[7],A=this._h[8],x=this._h[9],O=this._r[0],E=this._r[1],p=this._r[2],I=this._r[3],C=this._r[4],L=this._r[5],q=this._r[6],le=this._r[7],pe=this._r[8],B=this._r[9];u>=16;){var U=s[c+0]|s[c+1]<<8;d+=U&8191;var K=s[c+2]|s[c+3]<<8;g+=(U>>>13|K<<3)&8191;var ne=s[c+4]|s[c+5]<<8;m+=(K>>>10|ne<<6)&8191;var F=s[c+6]|s[c+7]<<8;w+=(ne>>>7|F<<9)&8191;var j=s[c+8]|s[c+9]<<8;v+=(F>>>4|j<<12)&8191,y+=j>>>1&8191;var z=s[c+10]|s[c+11]<<8;_+=(j>>>14|z<<2)&8191;var $=s[c+12]|s[c+13]<<8;b+=(z>>>11|$<<5)&8191;var H=s[c+14]|s[c+15]<<8;A+=($>>>8|H<<8)&8191,x+=H>>>5|f;var k=0,M=k;M+=d*O,M+=g*(5*B),M+=m*(5*pe),M+=w*(5*le),M+=v*(5*q),k=M>>>13,M&=8191,M+=y*(5*L),M+=_*(5*C),M+=b*(5*I),M+=A*(5*p),M+=x*(5*E),k+=M>>>13,M&=8191;var G=k;G+=d*E,G+=g*O,G+=m*(5*B),G+=w*(5*pe),G+=v*(5*le),k=G>>>13,G&=8191,G+=y*(5*q),G+=_*(5*L),G+=b*(5*C),G+=A*(5*I),G+=x*(5*p),k+=G>>>13,G&=8191;var ge=k;ge+=d*p,ge+=g*E,ge+=m*O,ge+=w*(5*B),ge+=v*(5*pe),k=ge>>>13,ge&=8191,ge+=y*(5*le),ge+=_*(5*q),ge+=b*(5*L),ge+=A*(5*C),ge+=x*(5*I),k+=ge>>>13,ge&=8191;var Q=k;Q+=d*I,Q+=g*p,Q+=m*E,Q+=w*O,Q+=v*(5*B),k=Q>>>13,Q&=8191,Q+=y*(5*pe),Q+=_*(5*le),Q+=b*(5*q),Q+=A*(5*L),Q+=x*(5*C),k+=Q>>>13,Q&=8191;var te=k;te+=d*C,te+=g*I,te+=m*p,te+=w*E,te+=v*O,k=te>>>13,te&=8191,te+=y*(5*B),te+=_*(5*pe),te+=b*(5*le),te+=A*(5*q),te+=x*(5*L),k+=te>>>13,te&=8191;var ce=k;ce+=d*L,ce+=g*C,ce+=m*I,ce+=w*p,ce+=v*E,k=ce>>>13,ce&=8191,ce+=y*O,ce+=_*(5*B),ce+=b*(5*pe),ce+=A*(5*le),ce+=x*(5*q),k+=ce>>>13,ce&=8191;var T=k;T+=d*q,T+=g*L,T+=m*C,T+=w*I,T+=v*p,k=T>>>13,T&=8191,T+=y*E,T+=_*O,T+=b*(5*B),T+=A*(5*pe),T+=x*(5*le),k+=T>>>13,T&=8191;var fe=k;fe+=d*le,fe+=g*q,fe+=m*L,fe+=w*C,fe+=v*I,k=fe>>>13,fe&=8191,fe+=y*p,fe+=_*E,fe+=b*O,fe+=A*(5*B),fe+=x*(5*pe),k+=fe>>>13,fe&=8191;var Ve=k;Ve+=d*pe,Ve+=g*le,Ve+=m*q,Ve+=w*L,Ve+=v*C,k=Ve>>>13,Ve&=8191,Ve+=y*I,Ve+=_*p,Ve+=b*E,Ve+=A*O,Ve+=x*(5*B),k+=Ve>>>13,Ve&=8191;var tt=k;tt+=d*B,tt+=g*pe,tt+=m*le,tt+=w*q,tt+=v*L,k=tt>>>13,tt&=8191,tt+=y*C,tt+=_*I,tt+=b*p,tt+=A*E,tt+=x*O,k+=tt>>>13,tt&=8191,k=(k<<2)+k|0,k=k+M|0,M=k&8191,k=k>>>13,G+=k,d=M,g=G,m=ge,w=Q,v=te,y=ce,_=T,b=fe,A=Ve,x=tt,c+=16,u-=16}this._h[0]=d,this._h[1]=g,this._h[2]=m,this._h[3]=w,this._h[4]=v,this._h[5]=y,this._h[6]=_,this._h[7]=b,this._h[8]=A,this._h[9]=x},o.prototype.finish=function(s,c){c===void 0&&(c=0);var u=new Uint16Array(10),f,d,g,m;if(this._leftover){for(m=this._leftover,this._buffer[m++]=1;m<16;m++)this._buffer[m]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,m=2;m<10;m++)this._h[m]+=f,f=this._h[m]>>>13,this._h[m]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,u[0]=this._h[0]+5,f=u[0]>>>13,u[0]&=8191,m=1;m<10;m++)u[m]=this._h[m]+f,f=u[m]>>>13,u[m]&=8191;for(u[9]-=8192,d=(f^1)-1,m=0;m<10;m++)u[m]&=d;for(d=~d,m=0;m<10;m++)this._h[m]=this._h[m]&d|u[m];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,g=this._h[0]+this._pad[0],this._h[0]=g&65535,m=1;m<8;m++)g=(this._h[m]+this._pad[m]|0)+(g>>>16)|0,this._h[m]=g&65535;return s[c+0]=this._h[0]>>>0,s[c+1]=this._h[0]>>>8,s[c+2]=this._h[1]>>>0,s[c+3]=this._h[1]>>>8,s[c+4]=this._h[2]>>>0,s[c+5]=this._h[2]>>>8,s[c+6]=this._h[3]>>>0,s[c+7]=this._h[3]>>>8,s[c+8]=this._h[4]>>>0,s[c+9]=this._h[4]>>>8,s[c+10]=this._h[5]>>>0,s[c+11]=this._h[5]>>>8,s[c+12]=this._h[6]>>>0,s[c+13]=this._h[6]>>>8,s[c+14]=this._h[7]>>>0,s[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(s){var c=0,u=s.length,f;if(this._leftover){f=16-this._leftover,f>u&&(f=u);for(var d=0;d<f;d++)this._buffer[this._leftover+d]=s[c+d];if(u-=f,c+=f,this._leftover+=f,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(f=u-u%16,this._blocks(s,c,f),c+=f,u-=f),u){for(var d=0;d<u;d++)this._buffer[this._leftover+d]=s[c+d];this._leftover+=u}return this},o.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var s=new Uint8Array(16);return this.finish(s),s},o.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},o}();t.Poly1305=n;function i(o,s){var c=new n(o);c.update(s);var u=c.digest();return c.clean(),u}t.oneTimeAuth=i;function a(o,s){return o.length!==t.DIGEST_LENGTH||s.length!==t.DIGEST_LENGTH?!1:e.equal(o,s)}t.equal=a})(Xae);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=rO,r=Xae,n=is,i=Lr,a=Ad;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var o=new Uint8Array(16),s=function(){function c(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return c.prototype.seal=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=f.length+this.tagLength,y;if(g){if(g.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");y=g}else y=new Uint8Array(v);return e.streamXOR(this._key,m,f,y,4),this._authenticate(y.subarray(y.length-this.tagLength,y.length),w,y.subarray(0,y.length-this.tagLength),d),n.wipe(m),y},c.prototype.open=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length<this.tagLength)return null;var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=new Uint8Array(this.tagLength);if(this._authenticate(v,w,f.subarray(0,f.length-this.tagLength),d),!a.equal(v,f.subarray(f.length-this.tagLength,f.length)))return null;var y=f.length-this.tagLength,_;if(g){if(g.length!==y)throw new Error("ChaCha20Poly1305: incorrect destination length");_=g}else _=new Uint8Array(y);return e.streamXOR(this._key,m,f.subarray(0,f.length-this.tagLength),_,4),n.wipe(m),_},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(u,f,d,g){var m=new r.Poly1305(f);g&&(m.update(g),g.length%16>0&&m.update(o.subarray(g.length%16))),m.update(d),d.length%16>0&&m.update(o.subarray(d.length%16));var w=new Uint8Array(8);g&&i.writeUint64LE(g.length,w),m.update(w),i.writeUint64LE(d.length,w),m.update(w);for(var v=m.digest(),y=0;y<v.length;y++)u[y]=v[y];m.clean(),n.wipe(v),n.wipe(w)},c}();t.ChaCha20Poly1305=s})(xk);var eoe={},Tw={},Ak={};Object.defineProperty(Ak,"__esModule",{value:!0});function cDe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}Ak.isSerializableHash=cDe;Object.defineProperty(Tw,"__esModule",{value:!0});var Kc=Ak,uDe=Ad,lDe=is,toe=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Kc.isSerializableHash(this._inner)&&Kc.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),lDe.wipe(n)}return t.prototype.reset=function(){if(!Kc.isSerializableHash(this._inner)||!Kc.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Kc.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Kc.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Kc.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Kc.isSerializableHash(this._inner)||!Kc.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Kc.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Tw.HMAC=toe;function fDe(t,e,r){var n=new toe(t,e);n.update(r);var i=n.digest();return n.clean(),i}Tw.hmac=fDe;Tw.equal=uDe.equal;Object.defineProperty(eoe,"__esModule",{value:!0});var jW=Tw,qW=is,dDe=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=jW.hmac(this._hash,n,r);this._hmac=new jW.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),qW.wipe(this._buffer),qW.wipe(this._counter),this._bufpos=0},t}(),hDe=eoe.HKDF=dDe,am={},nO={},iO={};Object.defineProperty(iO,"__esModule",{value:!0});iO.BrowserRandomSource=void 0;const HW=65536;class pDe{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=HW)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,HW)));return r}}iO.BrowserRandomSource=pDe;function f5(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var aO={};Object.defineProperty(aO,"__esModule",{value:!0});aO.NodeRandomSource=void 0;const gDe=is;class yDe{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof f5<"u"){const e=nM;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,gDe.wipe)(r),n}}aO.NodeRandomSource=yDe;Object.defineProperty(nO,"__esModule",{value:!0});nO.SystemRandomSource=void 0;const mDe=iO,vDe=aO;class bDe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new mDe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new vDe.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}nO.SystemRandomSource=bDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=nO,r=Lr,n=is;t.defaultRandomSource=new e.SystemRandomSource;function i(u,f=t.defaultRandomSource){return f.randomBytes(u)}t.randomBytes=i;function a(u=t.defaultRandomSource){const f=i(4,u),d=(0,r.readUint32LE)(f);return(0,n.wipe)(f),d}t.randomUint32=a;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function s(u,f=o,d=t.defaultRandomSource){if(f.length<2)throw new Error("randomString charset is too short");if(f.length>256)throw new Error("randomString charset is too long");let g="";const m=f.length,w=256-256%m;for(;u>0;){const v=i(Math.ceil(u*256/w),d);for(let y=0;y<v.length&&u>0;y++){const _=v[y];_<w&&(g+=f.charAt(_%m),u--)}(0,n.wipe)(v)}return g}t.randomString=s;function c(u,f=o,d=t.defaultRandomSource){const g=Math.ceil(u/(Math.log(f.length)/Math.LN2));return s(g,f,d)}t.randomStringForEntropy=c})(am);var oO={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Lr,r=is;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function s(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return s.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},s.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},s.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},s.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=a(this._temp,this._state,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},s.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,d=u/536870912|0,g=u<<3,m=u%64<56?64:128;this._buffer[f]=128;for(var w=f+1;w<m-8;w++)this._buffer[w]=0;e.writeUint32BE(d,this._buffer,m-8),e.writeUint32BE(g,this._buffer,m-4),a(this._temp,this._state,this._buffer,0,m),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)e.writeUint32BE(this._state[w],c,w*4);return this},s.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},s.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},s.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},s.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},s}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(s,c,u,f,d){for(;d>=64;){for(var g=c[0],m=c[1],w=c[2],v=c[3],y=c[4],_=c[5],b=c[6],A=c[7],x=0;x<16;x++){var O=f+x*4;s[x]=e.readUint32BE(u,O)}for(var x=16;x<64;x++){var E=s[x-2],p=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=s[x-15];var I=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;s[x]=(p+s[x-7]|0)+(I+s[x-16]|0)}for(var x=0;x<64;x++){var p=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&_^~y&b)|0)+(A+(i[x]+s[x]|0)|0)|0,I=((g>>>2|g<<32-2)^(g>>>13|g<<32-13)^(g>>>22|g<<32-22))+(g&m^g&w^m&w)|0;A=b,b=_,_=y,y=v+p|0,v=w,w=m,m=g,g=p+I|0}c[0]+=g,c[1]+=m,c[2]+=w,c[3]+=v,c[4]+=y,c[5]+=_,c[6]+=b,c[7]+=A,f+=64,d-=64}return f}function o(s){var c=new n;c.update(s);var u=c.digest();return c.clean(),u}t.hash=o})(oO);var Sk={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=am,r=is;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(x){const O=new Float64Array(16);if(x)for(let E=0;E<x.length;E++)O[E]=x[E];return O}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function o(x){let O=1;for(let E=0;E<16;E++){let p=x[E]+O+65535;O=Math.floor(p/65536),x[E]=p-O*65536}x[0]+=O-1+37*(O-1)}function s(x,O,E){const p=~(E-1);for(let I=0;I<16;I++){const C=p&(x[I]^O[I]);x[I]^=C,O[I]^=C}}function c(x,O){const E=n(),p=n();for(let I=0;I<16;I++)p[I]=O[I];o(p),o(p),o(p);for(let I=0;I<2;I++){E[0]=p[0]-65517;for(let L=1;L<15;L++)E[L]=p[L]-65535-(E[L-1]>>16&1),E[L-1]&=65535;E[15]=p[15]-32767-(E[14]>>16&1);const C=E[15]>>16&1;E[14]&=65535,s(p,E,1-C)}for(let I=0;I<16;I++)x[2*I]=p[I]&255,x[2*I+1]=p[I]>>8}function u(x,O){for(let E=0;E<16;E++)x[E]=O[2*E]+(O[2*E+1]<<8);x[15]&=32767}function f(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]+E[p]}function d(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]-E[p]}function g(x,O,E){let p,I,C=0,L=0,q=0,le=0,pe=0,B=0,U=0,K=0,ne=0,F=0,j=0,z=0,$=0,H=0,k=0,M=0,G=0,ge=0,Q=0,te=0,ce=0,T=0,fe=0,Ve=0,tt=0,mt=0,vt=0,gt=0,Lt=0,Yt=0,wr=0,Rt=E[0],Pt=E[1],kt=E[2],Nt=E[3],Kt=E[4],Ut=E[5],zt=E[6],$t=E[7],Dt=E[8],qt=E[9],Mt=E[10],cr=E[11],tr=E[12],ir=E[13],nr=E[14],mr=E[15];p=O[0],C+=p*Rt,L+=p*Pt,q+=p*kt,le+=p*Nt,pe+=p*Kt,B+=p*Ut,U+=p*zt,K+=p*$t,ne+=p*Dt,F+=p*qt,j+=p*Mt,z+=p*cr,$+=p*tr,H+=p*ir,k+=p*nr,M+=p*mr,p=O[1],L+=p*Rt,q+=p*Pt,le+=p*kt,pe+=p*Nt,B+=p*Kt,U+=p*Ut,K+=p*zt,ne+=p*$t,F+=p*Dt,j+=p*qt,z+=p*Mt,$+=p*cr,H+=p*tr,k+=p*ir,M+=p*nr,G+=p*mr,p=O[2],q+=p*Rt,le+=p*Pt,pe+=p*kt,B+=p*Nt,U+=p*Kt,K+=p*Ut,ne+=p*zt,F+=p*$t,j+=p*Dt,z+=p*qt,$+=p*Mt,H+=p*cr,k+=p*tr,M+=p*ir,G+=p*nr,ge+=p*mr,p=O[3],le+=p*Rt,pe+=p*Pt,B+=p*kt,U+=p*Nt,K+=p*Kt,ne+=p*Ut,F+=p*zt,j+=p*$t,z+=p*Dt,$+=p*qt,H+=p*Mt,k+=p*cr,M+=p*tr,G+=p*ir,ge+=p*nr,Q+=p*mr,p=O[4],pe+=p*Rt,B+=p*Pt,U+=p*kt,K+=p*Nt,ne+=p*Kt,F+=p*Ut,j+=p*zt,z+=p*$t,$+=p*Dt,H+=p*qt,k+=p*Mt,M+=p*cr,G+=p*tr,ge+=p*ir,Q+=p*nr,te+=p*mr,p=O[5],B+=p*Rt,U+=p*Pt,K+=p*kt,ne+=p*Nt,F+=p*Kt,j+=p*Ut,z+=p*zt,$+=p*$t,H+=p*Dt,k+=p*qt,M+=p*Mt,G+=p*cr,ge+=p*tr,Q+=p*ir,te+=p*nr,ce+=p*mr,p=O[6],U+=p*Rt,K+=p*Pt,ne+=p*kt,F+=p*Nt,j+=p*Kt,z+=p*Ut,$+=p*zt,H+=p*$t,k+=p*Dt,M+=p*qt,G+=p*Mt,ge+=p*cr,Q+=p*tr,te+=p*ir,ce+=p*nr,T+=p*mr,p=O[7],K+=p*Rt,ne+=p*Pt,F+=p*kt,j+=p*Nt,z+=p*Kt,$+=p*Ut,H+=p*zt,k+=p*$t,M+=p*Dt,G+=p*qt,ge+=p*Mt,Q+=p*cr,te+=p*tr,ce+=p*ir,T+=p*nr,fe+=p*mr,p=O[8],ne+=p*Rt,F+=p*Pt,j+=p*kt,z+=p*Nt,$+=p*Kt,H+=p*Ut,k+=p*zt,M+=p*$t,G+=p*Dt,ge+=p*qt,Q+=p*Mt,te+=p*cr,ce+=p*tr,T+=p*ir,fe+=p*nr,Ve+=p*mr,p=O[9],F+=p*Rt,j+=p*Pt,z+=p*kt,$+=p*Nt,H+=p*Kt,k+=p*Ut,M+=p*zt,G+=p*$t,ge+=p*Dt,Q+=p*qt,te+=p*Mt,ce+=p*cr,T+=p*tr,fe+=p*ir,Ve+=p*nr,tt+=p*mr,p=O[10],j+=p*Rt,z+=p*Pt,$+=p*kt,H+=p*Nt,k+=p*Kt,M+=p*Ut,G+=p*zt,ge+=p*$t,Q+=p*Dt,te+=p*qt,ce+=p*Mt,T+=p*cr,fe+=p*tr,Ve+=p*ir,tt+=p*nr,mt+=p*mr,p=O[11],z+=p*Rt,$+=p*Pt,H+=p*kt,k+=p*Nt,M+=p*Kt,G+=p*Ut,ge+=p*zt,Q+=p*$t,te+=p*Dt,ce+=p*qt,T+=p*Mt,fe+=p*cr,Ve+=p*tr,tt+=p*ir,mt+=p*nr,vt+=p*mr,p=O[12],$+=p*Rt,H+=p*Pt,k+=p*kt,M+=p*Nt,G+=p*Kt,ge+=p*Ut,Q+=p*zt,te+=p*$t,ce+=p*Dt,T+=p*qt,fe+=p*Mt,Ve+=p*cr,tt+=p*tr,mt+=p*ir,vt+=p*nr,gt+=p*mr,p=O[13],H+=p*Rt,k+=p*Pt,M+=p*kt,G+=p*Nt,ge+=p*Kt,Q+=p*Ut,te+=p*zt,ce+=p*$t,T+=p*Dt,fe+=p*qt,Ve+=p*Mt,tt+=p*cr,mt+=p*tr,vt+=p*ir,gt+=p*nr,Lt+=p*mr,p=O[14],k+=p*Rt,M+=p*Pt,G+=p*kt,ge+=p*Nt,Q+=p*Kt,te+=p*Ut,ce+=p*zt,T+=p*$t,fe+=p*Dt,Ve+=p*qt,tt+=p*Mt,mt+=p*cr,vt+=p*tr,gt+=p*ir,Lt+=p*nr,Yt+=p*mr,p=O[15],M+=p*Rt,G+=p*Pt,ge+=p*kt,Q+=p*Nt,te+=p*Kt,ce+=p*Ut,T+=p*zt,fe+=p*$t,Ve+=p*Dt,tt+=p*qt,mt+=p*Mt,vt+=p*cr,gt+=p*tr,Lt+=p*ir,Yt+=p*nr,wr+=p*mr,C+=38*G,L+=38*ge,q+=38*Q,le+=38*te,pe+=38*ce,B+=38*T,U+=38*fe,K+=38*Ve,ne+=38*tt,F+=38*mt,j+=38*vt,z+=38*gt,$+=38*Lt,H+=38*Yt,k+=38*wr,I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),x[0]=C,x[1]=L,x[2]=q,x[3]=le,x[4]=pe,x[5]=B,x[6]=U,x[7]=K,x[8]=ne,x[9]=F,x[10]=j,x[11]=z,x[12]=$,x[13]=H,x[14]=k,x[15]=M}function m(x,O){g(x,O,O)}function w(x,O){const E=n();for(let p=0;p<16;p++)E[p]=O[p];for(let p=253;p>=0;p--)m(E,E),p!==2&&p!==4&&g(E,E,O);for(let p=0;p<16;p++)x[p]=E[p]}function v(x,O){const E=new Uint8Array(32),p=new Float64Array(80),I=n(),C=n(),L=n(),q=n(),le=n(),pe=n();for(let ne=0;ne<31;ne++)E[ne]=x[ne];E[31]=x[31]&127|64,E[0]&=248,u(p,O);for(let ne=0;ne<16;ne++)C[ne]=p[ne];I[0]=q[0]=1;for(let ne=254;ne>=0;--ne){const F=E[ne>>>3]>>>(ne&7)&1;s(I,C,F),s(L,q,F),f(le,I,L),d(I,I,L),f(L,C,q),d(C,C,q),m(q,le),m(pe,I),g(I,L,I),g(L,C,le),f(le,I,L),d(I,I,L),m(C,I),d(L,q,pe),g(I,L,a),f(I,I,q),g(L,L,I),g(I,q,pe),g(q,C,p),m(C,le),s(I,C,F),s(L,q,F)}for(let ne=0;ne<16;ne++)p[ne+16]=I[ne],p[ne+32]=L[ne],p[ne+48]=C[ne],p[ne+64]=q[ne];const B=p.subarray(32),U=p.subarray(16);w(B,B),g(U,U,B);const K=new Uint8Array(32);return c(K,U),K}t.scalarMult=v;function y(x){return v(x,i)}t.scalarMultBase=y;function _(x){if(x.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const O=new Uint8Array(x);return{publicKey:y(O),secretKey:O}}t.generateKeyPairFromSeed=_;function b(x){const O=(0,e.randomBytes)(32,x),E=_(O);return(0,r.wipe)(O),E}t.generateKeyPair=b;function A(x,O,E=!1){if(x.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(O.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(x,O);if(E){let I=0;for(let C=0;C<p.length;C++)I|=p[C];if(I===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=A})(Sk);function Ok(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function roe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ok(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function d5(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=roe(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return Ok(r)}function wDe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=t.length,c=t.charAt(0),u=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function d(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,y=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var A=(b-_)*f+1>>>0,x=new Uint8Array(A);_!==b;){for(var O=w[_],E=0,p=A-1;(O!==0||E<y)&&p!==-1;p--,E++)O+=256*x[p]>>>0,x[p]=O%s>>>0,O=O/s>>>0;if(O!==0)throw new Error("Non-zero carry");y=E,_++}for(var I=A-y;I!==A&&x[I]===0;)I++;for(var C=c.repeat(v);I<A;++I)C+=t.charAt(x[I]);return C}function g(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var y=0,_=0;w[v]===c;)y++,v++;for(var b=(w.length-v)*u+1>>>0,A=new Uint8Array(b);w[v];){var x=r[w.charCodeAt(v)];if(x===255)return;for(var O=0,E=b-1;(x!==0||O<_)&&E!==-1;E--,O++)x+=s*A[E]>>>0,A[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");_=O,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&A[p]===0;)p++;for(var I=new Uint8Array(y+(b-p)),C=y;p!==b;)I[C++]=A[p++];return I}}}function m(w){var v=g(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:g,decode:m}}var _De=wDe,EDe=_De;const xDe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},ADe=t=>new TextEncoder().encode(t),SDe=t=>new TextDecoder().decode(t);class ODe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class IDe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return noe(this,e)}}class PDe{constructor(e){this.decoders=e}or(e){return noe(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const noe=(t,e)=>new PDe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class TDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ODe(e,r,n),this.decoder=new IDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const sO=({name:t,prefix:e,encode:r,decode:n})=>new TDe(t,e,r,n),Rw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=EDe(r,e);return sO({prefix:t,name:e,encode:n,decode:a=>xDe(i(a))})},RDe=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let a=t.length;for(;t[a-1]==="=";)--a;const o=new Uint8Array(a*r/8|0);let s=0,c=0,u=0;for(let f=0;f<a;++f){const d=i[t[f]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,s+=r,s>=8&&(s-=8,o[u++]=255&c>>s)}if(s>=r||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o},CDe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let a="",o=0,s=0;for(let c=0;c<t.length;++c)for(s=s<<8|t[c],o+=8;o>r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},ba=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>sO({prefix:e,name:t,encode(i){return CDe(i,n,r)},decode(i){return RDe(i,n,r,t)}}),NDe=sO({prefix:"\0",name:"identity",encode:t=>SDe(t),decode:t=>ADe(t)}),DDe=Object.freeze(Object.defineProperty({__proto__:null,identity:NDe},Symbol.toStringTag,{value:"Module"})),$De=ba({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),MDe=Object.freeze(Object.defineProperty({__proto__:null,base2:$De},Symbol.toStringTag,{value:"Module"})),kDe=ba({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),LDe=Object.freeze(Object.defineProperty({__proto__:null,base8:kDe},Symbol.toStringTag,{value:"Module"})),UDe=Rw({prefix:"9",name:"base10",alphabet:"0123456789"}),BDe=Object.freeze(Object.defineProperty({__proto__:null,base10:UDe},Symbol.toStringTag,{value:"Module"})),FDe=ba({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),jDe=ba({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),qDe=Object.freeze(Object.defineProperty({__proto__:null,base16:FDe,base16upper:jDe},Symbol.toStringTag,{value:"Module"})),HDe=ba({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zDe=ba({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),VDe=ba({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),GDe=ba({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),WDe=ba({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),KDe=ba({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),YDe=ba({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),QDe=ba({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),JDe=ba({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),XDe=Object.freeze(Object.defineProperty({__proto__:null,base32:HDe,base32hex:WDe,base32hexpad:YDe,base32hexpadupper:QDe,base32hexupper:KDe,base32pad:VDe,base32padupper:GDe,base32upper:zDe,base32z:JDe},Symbol.toStringTag,{value:"Module"})),ZDe=Rw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),e$e=Rw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),t$e=Object.freeze(Object.defineProperty({__proto__:null,base36:ZDe,base36upper:e$e},Symbol.toStringTag,{value:"Module"})),r$e=Rw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),n$e=Rw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),i$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:r$e,base58flickr:n$e},Symbol.toStringTag,{value:"Module"})),a$e=ba({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),o$e=ba({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),s$e=ba({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),c$e=ba({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),u$e=Object.freeze(Object.defineProperty({__proto__:null,base64:a$e,base64pad:o$e,base64url:s$e,base64urlpad:c$e},Symbol.toStringTag,{value:"Module"})),ioe=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),l$e=ioe.reduce((t,e,r)=>(t[r]=e,t),[]),f$e=ioe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function d$e(t){return t.reduce((e,r)=>(e+=l$e[r],e),"")}function h$e(t){const e=[];for(const r of t){const n=f$e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const p$e=sO({prefix:"🚀",name:"base256emoji",encode:d$e,decode:h$e}),g$e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:p$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const zW={...DDe,...MDe,...LDe,...BDe,...qDe,...XDe,...t$e,...i$e,...u$e,...g$e};function aoe(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const VW=aoe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),mN=aoe("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=roe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),ooe={utf8:VW,"utf-8":VW,hex:zW.base16,latin1:mN,ascii:mN,binary:mN,...zW};function Co(t,e="utf8"){const r=ooe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ok(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function co(t,e="utf8"){const r=ooe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var GW=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},y$e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),m$e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=za.platform}return t}(),v$e=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),b$e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),w$e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),_$e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,E$e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,WW=3,x$e=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",_$e]],KW=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function A$e(t){return t?YW(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new w$e:typeof navigator<"u"?YW(navigator.userAgent):I$e()}function S$e(t){return t!==""&&x$e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function YW(t){var e=S$e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new b$e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<WW&&(i=GW(GW([],i,!0),P$e(WW-i.length),!0)):i=[];var a=i.join("."),o=O$e(t),s=E$e.exec(t);return s&&s[1]?new v$e(r,a,o,s[1]):new y$e(r,a,o)}function O$e(t){for(var e=0,r=KW.length;e<r;e++){var n=KW[e],i=n[0],a=n[1],o=a.exec(t);if(o)return i}return null}function I$e(){var t=typeof za<"u"&&za.version;return t?new m$e(za.version.slice(1)):null}function P$e(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Xt={};/*! *****************************************************************************
121
+ `}])),pN}var P4e=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),T4e=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),R4e=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&P4e(e,t,r);return T4e(e,t),e};Object.defineProperty(HS,"__esModule",{value:!0});HS.FortmaticConnector=void 0;const C4e=iae,N4e=Ml,D4e=qs;class $4e extends C4e.AbstractConnector{constructor(e){const r=D4e.getConfiguration()[N4e.ProviderType.FORTMATIC],n=Object.keys(r.apiKeys).map(i=>Number(i));if(!n.includes(e))throw new Error(`Invariant error: Unsupported chainId ${e}`);super({supportedChainIds:n}),this.apiKey=r.apiKeys[e],this.chainId=e,this.rpcUrl=r.urls[e]}async activate(){if(!this.fortmatic){const{default:r}=await Promise.resolve().then(()=>R4e(I4e()));this.fortmatic=new r(this.apiKey,{rpcUrl:this.rpcUrl,chainId:this.chainId})}const e=await this.fortmatic.getProvider().enable().then(r=>r[0]);return{provider:this.fortmatic.getProvider(),chainId:this.chainId,account:e}}getApiKey(){return this.apiKey}async getProvider(){return this.fortmatic.getProvider()}async getChainId(){return this.chainId}async getAccount(){return this.fortmatic.getProvider().send("eth_accounts").then(e=>e[0])}deactivate(){}async close(){await this.fortmatic.user.logout(),this.emitDeactivate()}}HS.FortmaticConnector=$4e;var XS={};function Q4(){return Q4=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Q4.apply(this,arguments)}function Ek(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function J4(t){return J4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},J4(t)}function LA(t,e){return LA=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},LA(t,e)}function M4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ex(t,e,r){return M4e()?Ex=Reflect.construct:Ex=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&LA(u,o.prototype),u},Ex.apply(null,arguments)}function k4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function UA(t){var e=typeof Map=="function"?new Map:void 0;return UA=function(n){if(n===null||!k4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Ex(n,arguments,J4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),LA(i,n)},UA(t)}function pE(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}typeof Symbol<"u"&&(Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")));typeof Symbol<"u"&&(Symbol.asyncIterator||(Symbol.asyncIterator=Symbol("Symbol.asyncIterator")));function p0(t,e){try{var r=t()}catch(n){return e(n)}return r&&r.then?r.then(void 0,e):r}function Vc(t){return t.hasOwnProperty("result")?t.result:t}var xx=function(t){Ek(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="No Ethereum provider was found on window.ethereum.",r}return e}(UA(Error)),qae=function(t){Ek(e,t);function e(){var r;return r=t.call(this)||this,r.name=r.constructor.name,r.message="The user rejected the request.",r}return e}(UA(Error)),L4e=function(t){Ek(e,t);function e(n){var i;return i=t.call(this,n)||this,i.handleNetworkChanged=i.handleNetworkChanged.bind(pE(i)),i.handleChainChanged=i.handleChainChanged.bind(pE(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(pE(i)),i.handleClose=i.handleClose.bind(pE(i)),i}var r=e.prototype;return r.handleChainChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.handleAccountsChanged=function(i){i.length===0?this.emitDeactivate():this.emitUpdate({account:i[0]})},r.handleClose=function(i,a){this.emitDeactivate()},r.handleNetworkChanged=function(i){this.emitUpdate({chainId:i,provider:window.ethereum})},r.activate=function(){try{var i=function(f){if(a)return f;function d(){return Q4({provider:window.ethereum},s?{account:s}:{})}var g=function(){if(!s)return Promise.resolve(window.ethereum.enable().then(function(m){return m&&Vc(m)[0]})).then(function(m){s=m})}();return g&&g.then?g.then(d):d(g)},a=!1,o=this;if(!window.ethereum)throw new xx;window.ethereum.on&&(window.ethereum.on("chainChanged",o.handleChainChanged),window.ethereum.on("accountsChanged",o.handleAccountsChanged),window.ethereum.on("close",o.handleClose),window.ethereum.on("networkChanged",o.handleNetworkChanged)),window.ethereum.isMetaMask&&(window.ethereum.autoRefreshOnNetworkChange=!1);var s,c=p0(function(){return Promise.resolve(window.ethereum.send("eth_requestAccounts").then(function(u){return Vc(u)[0]})).then(function(u){s=u})},function(u){if(u.code===4001)throw new qae});return Promise.resolve(c&&c.then?c.then(i):i(c))}catch(u){return Promise.reject(u)}},r.getProvider=function(){try{return Promise.resolve(window.ethereum)}catch(i){return Promise.reject(i)}},r.getChainId=function(){try{var i=function(){function c(){if(!a)try{a=Vc(window.ethereum.send({method:"net_version"}))}catch{}return a||(window.ethereum.isDapper?a=Vc(window.ethereum.cachedResults.net_version):a=window.ethereum.chainId||window.ethereum.netVersion||window.ethereum.networkVersion||window.ethereum._chainId),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.send("net_version").then(Vc)).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new xx;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_chainId").then(Vc)).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.getAccount=function(){try{var i=function(){function c(){return a||(a=Vc(window.ethereum.send({method:"eth_accounts"}))[0]),a}var u=function(){if(!a){var f=p0(function(){return Promise.resolve(window.ethereum.enable().then(function(d){return Vc(d)[0]})).then(function(d){a=d})},function(){});if(f&&f.then)return f.then(function(){})}}();return u&&u.then?u.then(c):c(u)};if(!window.ethereum)throw new xx;var a,o=p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(s){return Vc(s)[0]})).then(function(s){a=s})},function(){});return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(s){return Promise.reject(s)}},r.deactivate=function(){window.ethereum&&window.ethereum.removeListener&&(window.ethereum.removeListener("chainChanged",this.handleChainChanged),window.ethereum.removeListener("accountsChanged",this.handleAccountsChanged),window.ethereum.removeListener("close",this.handleClose),window.ethereum.removeListener("networkChanged",this.handleNetworkChanged))},r.isAuthorized=function(){try{return window.ethereum?Promise.resolve(p0(function(){return Promise.resolve(window.ethereum.send("eth_accounts").then(function(i){return Vc(i).length>0}))},function(){return!1})):Promise.resolve(!1)}catch(i){return Promise.reject(i)}},e}(qS);const U4e=Object.freeze(Object.defineProperty({__proto__:null,InjectedConnector:L4e,NoEthereumProviderError:xx,UserRejectedRequestError:qae},Symbol.toStringTag,{value:"Module"})),B4e=uo(U4e);Object.defineProperty(XS,"__esModule",{value:!0});XS.InjectedConnector=void 0;const F4e=B4e;class j4e extends F4e.InjectedConnector{constructor(e){super({supportedChainIds:[e]})}}XS.InjectedConnector=j4e;var ZS={},q4e="Invariant failed";function PW(t,e){if(!t)throw new Error(q4e)}function Hae(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,S1(t,e)}function X4(t){return X4=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},X4(t)}function S1(t,e){return S1=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},S1(t,e)}function H4e(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Ax(t,e,r){return H4e()?Ax=Reflect.construct:Ax=function(i,a,o){var s=[null];s.push.apply(s,a);var c=Function.bind.apply(i,s),u=new c;return o&&S1(u,o.prototype),u},Ax.apply(null,arguments)}function z4e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function Z4(t){var e=typeof Map=="function"?new Map:void 0;return Z4=function(n){if(n===null||!z4e(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return Ax(n,arguments,X4(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),S1(i,n)},Z4(t)}var Sx=function(t){Hae(e,t);function e(r,n,i){var a;return a=t.call(this)||this,a.code=n,a.data=i,a.name=a.constructor.name,a.message=r,a}return e}(Z4(Error)),V4e=function(e,r){var n=this,i=this;this.isMetaMask=!1,this.sendAsync=function(o,s){console.log("sendAsync",o.method,o.params),i.request(o.method,o.params).then(function(c){return s(null,{jsonrpc:"2.0",id:o.id,result:c})}).catch(function(c){return s(c,null)})},this.request=function(o,s){try{return typeof o!="string"&&(s=o.params,o=o.method),Promise.resolve(fetch(n.url,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:1,method:o,params:s}),headers:{"Content-Type":"application/json"}})).then(function(c){if(!c.ok)throw new Sx(c.status+": "+c.statusText,-32e3);return Promise.resolve(c.json()).then(function(u){if("error"in u){var f,d,g;throw new Sx(u==null||(f=u.error)==null?void 0:f.message,u==null||(d=u.error)==null?void 0:d.code,u==null||(g=u.error)==null?void 0:g.data)}else{if("result"in u)return u.result;throw new Sx("Received unexpected JSON-RPC response to "+o+" request.",-32e3,u)}})})}catch(c){return Promise.reject(c)}},this.chainId=e,this.url=r;var a=new URL(r);this.host=a.host,this.path=a.pathname},G4e=function(t){Hae(e,t);function e(n){var i,a=n.urls,o=n.defaultChainId;return o||Object.keys(a).length===1||PW(!1),i=t.call(this,{supportedChainIds:Object.keys(a).map(function(s){return Number(s)})})||this,i.currentChainId=o||Number(Object.keys(a)[0]),i.providers=Object.keys(a).reduce(function(s,c){return s[Number(c)]=new V4e(Number(c),a[Number(c)]),s},{}),i}var r=e.prototype;return r.activate=function(){try{var i=this;return Promise.resolve({provider:i.providers[i.currentChainId],chainId:i.currentChainId,account:null})}catch(a){return Promise.reject(a)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.providers[i.currentChainId])}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.currentChainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){return Promise.resolve(null)},r.deactivate=function(){},r.changeChainId=function(i){Object.keys(this.providers).includes(i.toString())||PW(!1),this.currentChainId=i,this.emitUpdate({provider:this.providers[this.currentChainId],chainId:i})},e}(qS);const W4e=Object.freeze(Object.defineProperty({__proto__:null,NetworkConnector:G4e,RequestError:Sx},Symbol.toStringTag,{value:"Module"})),K4e=uo(W4e);Object.defineProperty(ZS,"__esModule",{value:!0});ZS.NetworkConnector=void 0;const Y4e=Sc,Q4e=K4e,J4e=qs;class X4e extends Q4e.NetworkConnector{constructor(e){super({urls:J4e.getConfiguration()[Y4e.ProviderType.NETWORK].urls,defaultChainId:e})}}ZS.NetworkConnector=X4e;var eO={};const Z4e="modulepreload",e5e=function(t){return"https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/"+t},TW={},Ry=function(e,r,n){if(!r||r.length===0)return e();const i=document.getElementsByTagName("link");return Promise.all(r.map(a=>{if(a=e5e(a),a in TW)return;TW[a]=!0;const o=a.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(!!n)for(let f=i.length-1;f>=0;f--){const d=i[f];if(d.href===a&&(!o||d.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${a}"]${s}`))return;const u=document.createElement("link");if(u.rel=o?"stylesheet":Z4e,o||(u.as="script",u.crossOrigin=""),u.href=a,document.head.appendChild(u),o)return new Promise((f,d)=>{u.addEventListener("load",f),u.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})})).then(()=>e()).catch(a=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=a,window.dispatchEvent(o),!o.defaultPrevented)throw a})};function e5(){return e5=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},e5.apply(this,arguments)}function t5e(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t5(t,e)}function t5(t,e){return t5=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},t5(t,e)}function RW(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var r5e=1,n5e=function(t){t5e(e,t);function e(n){var i,a=n.url,o=n.appName,s=n.appLogoUrl,c=n.darkMode,u=n.supportedChainIds;return i=t.call(this,{supportedChainIds:u})||this,i.url=a,i.appName=o,i.appLogoUrl=s,i.darkMode=c||!1,i.handleChainChanged=i.handleChainChanged.bind(RW(i)),i.handleAccountsChanged=i.handleAccountsChanged.bind(RW(i)),i}var r=e.prototype;return r.activate=function(){try{var i=this,a=function(){return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(c){var u=c[0];return i.provider.on("chainChanged",i.handleChainChanged),i.provider.on("accountsChanged",i.handleAccountsChanged),{provider:i.provider,account:u}})},o=function(){if(window.ethereum&&window.ethereum.isCoinbaseWallet===!0)i.provider=window.ethereum;else{var s=function(){if(!i.walletLink)return Promise.resolve(Ry(()=>import("./index-41910f0e.js").then(c=>c.i),[]).then(function(c){var u;return(u=c==null?void 0:c.default)!=null?u:c})).then(function(c){i.walletLink=new c(e5({appName:i.appName,darkMode:i.darkMode},i.appLogoUrl?{appLogoUrl:i.appLogoUrl}:{})),i.provider=i.walletLink.makeWeb3Provider(i.url,r5e)})}();if(s&&s.then)return s.then(function(){})}}();return Promise.resolve(o&&o.then?o.then(a):a(o))}catch(s){return Promise.reject(s)}},r.getProvider=function(){try{var i=this;return Promise.resolve(i.provider)}catch(a){return Promise.reject(a)}},r.getChainId=function(){try{var i=this;return Promise.resolve(i.provider.chainId)}catch(a){return Promise.reject(a)}},r.getAccount=function(){try{var i=this;return Promise.resolve(i.provider.request({method:"eth_requestAccounts"})).then(function(a){return a[0]})}catch(a){return Promise.reject(a)}},r.deactivate=function(){this.provider.removeListener("chainChanged",this.handleChainChanged),this.provider.removeListener("accountsChanged",this.handleAccountsChanged)},r.close=function(){try{var i=this;return i.provider.close(),i.emitDeactivate(),Promise.resolve()}catch(a){return Promise.reject(a)}},r.handleChainChanged=function(i){this.emitUpdate({chainId:i})},r.handleAccountsChanged=function(i){this.emitUpdate({account:i[0]})},e}(qS);const i5e=Object.freeze(Object.defineProperty({__proto__:null,WalletLinkConnector:n5e},Symbol.toStringTag,{value:"Module"})),a5e=uo(i5e);Object.defineProperty(eO,"__esModule",{value:!0});eO.WalletLinkConnector=void 0;const o5e=Ml,s5e=a5e,c5e=qs;class u5e extends s5e.WalletLinkConnector{constructor(e){const r=c5e.getConfiguration()[o5e.ProviderType.WALLET_LINK];super({url:r.urls[e],appName:r.appName,supportedChainIds:[e]})}}eO.WalletLinkConnector=u5e;var tO={};const l5e=Symbol(),CW=Object.getPrototypeOf,r5=new WeakMap,f5e=t=>t&&(r5.has(t)?r5.get(t):CW(t)===Object.prototype||CW(t)===Array.prototype),d5e=t=>f5e(t)&&t[l5e]||null,NW=(t,e=!0)=>{r5.set(t,e)},gN=t=>typeof t=="object"&&t!==null,wf=new WeakMap,gE=new WeakSet,h5e=(t=Object.is,e=(u,f)=>new Proxy(u,f),r=u=>gN(u)&&!gE.has(u)&&(Array.isArray(u)||!(Symbol.iterator in u))&&!(u instanceof WeakMap)&&!(u instanceof WeakSet)&&!(u instanceof Error)&&!(u instanceof Number)&&!(u instanceof Date)&&!(u instanceof String)&&!(u instanceof RegExp)&&!(u instanceof ArrayBuffer),n=u=>{switch(u.status){case"fulfilled":return u.value;case"rejected":throw u.reason;default:throw u}},i=new WeakMap,a=(u,f,d=n)=>{const g=i.get(u);if((g==null?void 0:g[0])===f)return g[1];const m=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return NW(m,!0),i.set(u,[f,m]),Reflect.ownKeys(u).forEach(w=>{if(Object.getOwnPropertyDescriptor(m,w))return;const v=Reflect.get(u,w),y={value:v,enumerable:!0,configurable:!0};if(gE.has(v))NW(v,!1);else if(v instanceof Promise)delete y.value,y.get=()=>d(v);else if(wf.has(v)){const[_,b]=wf.get(v);y.value=a(_,b(),d)}Object.defineProperty(m,w,y)}),Object.preventExtensions(m)},o=new WeakMap,s=[1,1],c=u=>{if(!gN(u))throw new Error("object required");const f=o.get(u);if(f)return f;let d=s[0];const g=new Set,m=(C,L=++s[0])=>{d!==L&&(d=L,g.forEach(q=>q(C,L)))};let w=s[1];const v=(C=++s[1])=>(w!==C&&!g.size&&(w=C,_.forEach(([L])=>{const q=L[1](C);q>d&&(d=q)})),d),y=C=>(L,q)=>{const le=[...L];le[1]=[C,...le[1]],m(le,q)},_=new Map,b=(C,L)=>{if(g.size){const q=L[3](y(C));_.set(C,[L,q])}else _.set(C,[L])},A=C=>{var L;const q=_.get(C);q&&(_.delete(C),(L=q[1])==null||L.call(q))},x=C=>(g.add(C),g.size===1&&_.forEach(([q,le],pe)=>{const B=q[3](y(pe));_.set(pe,[q,B])}),()=>{g.delete(C),g.size===0&&_.forEach(([q,le],pe)=>{le&&(le(),_.set(pe,[q]))})}),O=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),p=e(O,{deleteProperty(C,L){const q=Reflect.get(C,L);A(L);const le=Reflect.deleteProperty(C,L);return le&&m(["delete",[L],q]),le},set(C,L,q,le){const pe=Reflect.has(C,L),B=Reflect.get(C,L,le);if(pe&&(t(B,q)||o.has(q)&&t(B,o.get(q))))return!0;A(L),gN(q)&&(q=d5e(q)||q);let U=q;if(q instanceof Promise)q.then(K=>{q.status="fulfilled",q.value=K,m(["resolve",[L],K])}).catch(K=>{q.status="rejected",q.reason=K,m(["reject",[L],K])});else{!wf.has(q)&&r(q)&&(U=c(q));const K=!gE.has(U)&&wf.get(U);K&&b(L,K)}return Reflect.set(C,L,U,le),m(["set",[L],q,B]),!0}});o.set(u,p);const I=[O,v,a,x];return wf.set(p,I),Reflect.ownKeys(u).forEach(C=>{const L=Object.getOwnPropertyDescriptor(u,C);"value"in L&&(p[C]=u[C],delete L.value,delete L.writable),Object.defineProperty(O,C,L)}),p})=>[c,wf,gE,t,e,r,n,i,a,o,s],[p5e]=h5e();function xd(t={}){return p5e(t)}function Ip(t,e,r){const n=wf.get(t);let i;const a=[],o=n[3];let s=!1;const u=o(f=>{if(a.push(f),r){e(a.splice(0));return}i||(i=Promise.resolve().then(()=>{i=void 0,s&&e(a.splice(0))}))});return s=!0,()=>{s=!1,u()}}function g5e(t,e){const r=wf.get(t),[n,i,a]=r;return a(n,i(),e)}const Wi=xd({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),zae={state:Wi,subscribe(t){return Ip(Wi,()=>t(Wi))},push(t,e){t!==Wi.view&&(Wi.view=t,e&&(Wi.data=e),Wi.history.push(t))},reset(t){Wi.view=t,Wi.history=[t]},replace(t){Wi.history.length>1&&(Wi.history[Wi.history.length-1]=t,Wi.view=t)},goBack(){if(Wi.history.length>1){Wi.history.pop();const[t]=Wi.history.slice(-1);Wi.view=t}},setData(t){Wi.data=t}},Ma={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Ma.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Ma.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Ma.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let n=t;n.includes("://")||(n=t.replaceAll("/","").replaceAll(":",""),n=`${n}://`),n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},formatUniversalUrl(t,e,r){if(!Ma.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let n=t;n.endsWith("/")||(n=`${n}/`),this.setWalletConnectDeepLink(n,r);const i=encodeURIComponent(e);return`${n}wc?uri=${i}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Ma.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Ma.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=zae.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},y5e=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Oa=xd({enabled:y5e,userSessionId:"",events:[],connectedWalletId:void 0}),m5e={state:Oa,subscribe(t){return Ip(Oa.events,()=>t(g5e(Oa.events[Oa.events.length-1])))},initialize(){Oa.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Oa.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Oa.connectedWalletId=t},click(t){if(Oa.enabled){const e={type:"CLICK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},track(t){if(Oa.enabled){const e={type:"TRACK",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}},view(t){if(Oa.enabled){const e={type:"VIEW",name:t.name,userSessionId:Oa.userSessionId,timestamp:Date.now(),data:t};Oa.events.push(e)}}},Gc=xd({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),Ic={state:Gc,subscribe(t){return Ip(Gc,()=>t(Gc))},setChains(t){Gc.chains=t},setWalletConnectUri(t){Gc.walletConnectUri=t},setIsCustomDesktop(t){Gc.isCustomDesktop=t},setIsCustomMobile(t){Gc.isCustomMobile=t},setIsDataLoaded(t){Gc.isDataLoaded=t},setIsUiLoaded(t){Gc.isUiLoaded=t},setIsAuth(t){Gc.isAuth=t}},yE=xd({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Cy={state:yE,subscribe(t){return Ip(yE,()=>t(yE))},setConfig(t){var e,r;m5e.initialize(),Ic.setChains(t.chains),Ic.setIsAuth(!!t.enableAuthMode),Ic.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),Ic.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Ma.setModalVersionInStorage(),Object.assign(yE,t)}};var v5e=Object.defineProperty,DW=Object.getOwnPropertySymbols,b5e=Object.prototype.hasOwnProperty,w5e=Object.prototype.propertyIsEnumerable,$W=(t,e,r)=>e in t?v5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,_5e=(t,e)=>{for(var r in e||(e={}))b5e.call(e,r)&&$W(t,r,e[r]);if(DW)for(var r of DW(e))w5e.call(e,r)&&$W(t,r,e[r]);return t};const n5="https://explorer-api.walletconnect.com",i5="wcm",a5="js-2.6.2";async function mE(t,e){const r=_5e({sdkType:i5,sdkVersion:a5},e),n=new URL(t,n5);return n.searchParams.append("projectId",Cy.state.projectId),Object.entries(r).forEach(([i,a])=>{a&&n.searchParams.append(i,String(a))}),(await fetch(n)).json()}const Jd={async getDesktopListings(t){return mE("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return mE("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return mE("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return mE("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${n5}/w3m/v1/getWalletImage/${t}?projectId=${Cy.state.projectId}&sdkType=${i5}&sdkVersion=${a5}`},getAssetImageUrl(t){return`${n5}/w3m/v1/getAssetImage/${t}?projectId=${Cy.state.projectId}&sdkType=${i5}&sdkVersion=${a5}`}};var E5e=Object.defineProperty,MW=Object.getOwnPropertySymbols,x5e=Object.prototype.hasOwnProperty,A5e=Object.prototype.propertyIsEnumerable,kW=(t,e,r)=>e in t?E5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,S5e=(t,e)=>{for(var r in e||(e={}))x5e.call(e,r)&&kW(t,r,e[r]);if(MW)for(var r of MW(e))A5e.call(e,r)&&kW(t,r,e[r]);return t};const LW=Ma.isMobile(),Wc=xd({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),PWe={state:Wc,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Cy.state;if(t==="NONE"||e==="ALL"&&!t)return Wc.recomendedWallets;if(Ma.isArray(t)){const r={recommendedIds:t.join(",")},{listings:n}=await Jd.getAllListings(r),i=Object.values(n);i.sort((a,o)=>{const s=t.indexOf(a.id),c=t.indexOf(o.id);return s-c}),Wc.recomendedWallets=i}else{const{chains:r,isAuth:n}=Ic.state,i=r==null?void 0:r.join(","),a=Ma.isArray(e),o={page:1,sdks:n?"auth_v1":void 0,entries:Ma.RECOMMENDED_WALLET_AMOUNT,chains:i,version:2,excludedIds:a?e.join(","):void 0},{listings:s}=LW?await Jd.getMobileListings(o):await Jd.getDesktopListings(o);Wc.recomendedWallets=Object.values(s)}return Wc.recomendedWallets},async getWallets(t){const e=S5e({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:n}=Cy.state,{recomendedWallets:i}=Wc;if(n==="ALL")return Wc.wallets;i.length?e.excludedIds=i.map(d=>d.id).join(","):Ma.isArray(r)&&(e.excludedIds=r.join(",")),Ma.isArray(n)&&(e.excludedIds=[e.excludedIds,n].filter(Boolean).join(",")),Ic.state.isAuth&&(e.sdks="auth_v1");const{page:a,search:o}=t,{listings:s,total:c}=LW?await Jd.getMobileListings(e):await Jd.getDesktopListings(e),u=Object.values(s),f=o?"search":"wallets";return Wc[f]={listings:[...Wc[f].listings,...u],total:c,page:a??1},{listings:u,total:c}},getWalletImageUrl(t){return Jd.getWalletImageUrl(t)},getAssetImageUrl(t){return Jd.getAssetImageUrl(t)},resetSearch(){Wc.search={listings:[],total:0,page:1}}},g0=xd({open:!1}),yN={state:g0,subscribe(t){return Ip(g0,()=>t(g0))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:n}=Ic.state;if(Ma.removeWalletConnectDeepLink(),Ic.setWalletConnectUri(t==null?void 0:t.uri),Ic.setChains(t==null?void 0:t.chains),zae.reset("ConnectWallet"),r&&n)g0.open=!0,e();else{const i=setInterval(()=>{const a=Ic.state;a.isUiLoaded&&a.isDataLoaded&&(clearInterval(i),g0.open=!0,e())},200)}})},close(){g0.open=!1}};var O5e=Object.defineProperty,UW=Object.getOwnPropertySymbols,I5e=Object.prototype.hasOwnProperty,P5e=Object.prototype.propertyIsEnumerable,BW=(t,e,r)=>e in t?O5e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,T5e=(t,e)=>{for(var r in e||(e={}))I5e.call(e,r)&&BW(t,r,e[r]);if(UW)for(var r of UW(e))P5e.call(e,r)&&BW(t,r,e[r]);return t};function R5e(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Av=xd({themeMode:R5e()?"dark":"light"}),FW={state:Av,subscribe(t){return Ip(Av,()=>t(Av))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Av.themeMode=e),r&&(Av.themeVariables=T5e({},r))}},Xd=xd({open:!1,message:"",variant:"success"}),TWe={state:Xd,subscribe(t){return Ip(Xd,()=>t(Xd))},openToast(t,e){Xd.open=!0,Xd.message=t,Xd.variant=e},closeToast(){Xd.open=!1}};let C5e=class{constructor(e){this.openModal=yN.open,this.closeModal=yN.close,this.subscribeModal=yN.subscribe,this.setTheme=FW.setThemeConfig,FW.setThemeConfig(e),Cy.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Ry(()=>import("./index-d0606f3d.js"),[]);const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),Ic.setIsUiLoaded(!0)}}};const N5e=Object.freeze(Object.defineProperty({__proto__:null,WalletConnectModal:C5e},Symbol.toStringTag,{value:"Module"})),D5e=uo(N5e);var xk={},rO={},Lr={},Vae={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(s,c){var u=s>>>16&65535,f=s&65535,d=c>>>16&65535,g=c&65535;return f*g+(u*g+f*d<<16>>>0)|0}t.mul=Math.imul||e;function r(s,c){return s+c|0}t.add=r;function n(s,c){return s-c|0}t.sub=n;function i(s,c){return s<<c|s>>>32-c}t.rotl=i;function a(s,c){return s<<32-c|s>>>c}t.rotr=a;function o(s){return typeof s=="number"&&isFinite(s)&&Math.floor(s)===s}t.isInteger=Number.isInteger||o,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(s){return t.isInteger(s)&&s>=-t.MAX_SAFE_INTEGER&&s<=t.MAX_SAFE_INTEGER}})(Vae);Object.defineProperty(Lr,"__esModule",{value:!0});var Gae=Vae;function $5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}Lr.readInt16BE=$5e;function M5e(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}Lr.readUint16BE=M5e;function k5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}Lr.readInt16LE=k5e;function L5e(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}Lr.readUint16LE=L5e;function Wae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}Lr.writeUint16BE=Wae;Lr.writeInt16BE=Wae;function Kae(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}Lr.writeUint16LE=Kae;Lr.writeInt16LE=Kae;function o5(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}Lr.readInt32BE=o5;function s5(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}Lr.readUint32BE=s5;function c5(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}Lr.readInt32LE=c5;function u5(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}Lr.readUint32LE=u5;function BA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}Lr.writeUint32BE=BA;Lr.writeInt32BE=BA;function FA(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}Lr.writeUint32LE=FA;Lr.writeInt32LE=FA;function U5e(t,e){e===void 0&&(e=0);var r=o5(t,e),n=o5(t,e+4);return r*4294967296+n-(n>>31)*4294967296}Lr.readInt64BE=U5e;function B5e(t,e){e===void 0&&(e=0);var r=s5(t,e),n=s5(t,e+4);return r*4294967296+n}Lr.readUint64BE=B5e;function F5e(t,e){e===void 0&&(e=0);var r=c5(t,e),n=c5(t,e+4);return n*4294967296+r-(r>>31)*4294967296}Lr.readInt64LE=F5e;function j5e(t,e){e===void 0&&(e=0);var r=u5(t,e),n=u5(t,e+4);return n*4294967296+r}Lr.readUint64LE=j5e;function Yae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),BA(t/4294967296>>>0,e,r),BA(t>>>0,e,r+4),e}Lr.writeUint64BE=Yae;Lr.writeInt64BE=Yae;function Qae(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),FA(t>>>0,e,r),FA(t/4294967296>>>0,e,r+4),e}Lr.writeUint64LE=Qae;Lr.writeInt64LE=Qae;function q5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,a=t/8+r-1;a>=r;a--)n+=e[a]*i,i*=256;return n}Lr.readUintBE=q5e;function H5e(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,a=r;a<r+t/8;a++)n+=e[a]*i,i*=256;return n}Lr.readUintLE=H5e;function z5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!Gae.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var i=1,a=t/8+n-1;a>=n;a--)r[a]=e/i&255,i*=256;return r}Lr.writeUintBE=z5e;function V5e(t,e,r,n){if(r===void 0&&(r=new Uint8Array(t/8)),n===void 0&&(n=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!Gae.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a<n+t/8;a++)r[a]=e/i&255,i*=256;return r}Lr.writeUintLE=V5e;function G5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}Lr.readFloat32BE=G5e;function W5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}Lr.readFloat32LE=W5e;function K5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}Lr.readFloat64BE=K5e;function Y5e(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}Lr.readFloat64LE=Y5e;function Q5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t),e}Lr.writeFloat32BE=Q5e;function J5e(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat32(r,t,!0),e}Lr.writeFloat32LE=J5e;function X5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t),e}Lr.writeFloat64BE=X5e;function Z5e(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.setFloat64(r,t,!0),e}Lr.writeFloat64LE=Z5e;var is={};Object.defineProperty(is,"__esModule",{value:!0});function eDe(t){for(var e=0;e<t.length;e++)t[e]=0;return t}is.wipe=eDe;Object.defineProperty(rO,"__esModule",{value:!0});var Ia=Lr,l5=is,tDe=20;function rDe(t,e,r){for(var n=1634760805,i=857760878,a=2036477234,o=1797285236,s=r[3]<<24|r[2]<<16|r[1]<<8|r[0],c=r[7]<<24|r[6]<<16|r[5]<<8|r[4],u=r[11]<<24|r[10]<<16|r[9]<<8|r[8],f=r[15]<<24|r[14]<<16|r[13]<<8|r[12],d=r[19]<<24|r[18]<<16|r[17]<<8|r[16],g=r[23]<<24|r[22]<<16|r[21]<<8|r[20],m=r[27]<<24|r[26]<<16|r[25]<<8|r[24],w=r[31]<<24|r[30]<<16|r[29]<<8|r[28],v=e[3]<<24|e[2]<<16|e[1]<<8|e[0],y=e[7]<<24|e[6]<<16|e[5]<<8|e[4],_=e[11]<<24|e[10]<<16|e[9]<<8|e[8],b=e[15]<<24|e[14]<<16|e[13]<<8|e[12],A=n,x=i,O=a,E=o,p=s,I=c,C=u,L=f,q=d,le=g,pe=m,B=w,U=v,K=y,ne=_,F=b,j=0;j<tDe;j+=2)A=A+p|0,U^=A,U=U>>>32-16|U<<16,q=q+U|0,p^=q,p=p>>>32-12|p<<12,x=x+I|0,K^=x,K=K>>>32-16|K<<16,le=le+K|0,I^=le,I=I>>>32-12|I<<12,O=O+C|0,ne^=O,ne=ne>>>32-16|ne<<16,pe=pe+ne|0,C^=pe,C=C>>>32-12|C<<12,E=E+L|0,F^=E,F=F>>>32-16|F<<16,B=B+F|0,L^=B,L=L>>>32-12|L<<12,O=O+C|0,ne^=O,ne=ne>>>32-8|ne<<8,pe=pe+ne|0,C^=pe,C=C>>>32-7|C<<7,E=E+L|0,F^=E,F=F>>>32-8|F<<8,B=B+F|0,L^=B,L=L>>>32-7|L<<7,x=x+I|0,K^=x,K=K>>>32-8|K<<8,le=le+K|0,I^=le,I=I>>>32-7|I<<7,A=A+p|0,U^=A,U=U>>>32-8|U<<8,q=q+U|0,p^=q,p=p>>>32-7|p<<7,A=A+I|0,F^=A,F=F>>>32-16|F<<16,pe=pe+F|0,I^=pe,I=I>>>32-12|I<<12,x=x+C|0,U^=x,U=U>>>32-16|U<<16,B=B+U|0,C^=B,C=C>>>32-12|C<<12,O=O+L|0,K^=O,K=K>>>32-16|K<<16,q=q+K|0,L^=q,L=L>>>32-12|L<<12,E=E+p|0,ne^=E,ne=ne>>>32-16|ne<<16,le=le+ne|0,p^=le,p=p>>>32-12|p<<12,O=O+L|0,K^=O,K=K>>>32-8|K<<8,q=q+K|0,L^=q,L=L>>>32-7|L<<7,E=E+p|0,ne^=E,ne=ne>>>32-8|ne<<8,le=le+ne|0,p^=le,p=p>>>32-7|p<<7,x=x+C|0,U^=x,U=U>>>32-8|U<<8,B=B+U|0,C^=B,C=C>>>32-7|C<<7,A=A+I|0,F^=A,F=F>>>32-8|F<<8,pe=pe+F|0,I^=pe,I=I>>>32-7|I<<7;Ia.writeUint32LE(A+n|0,t,0),Ia.writeUint32LE(x+i|0,t,4),Ia.writeUint32LE(O+a|0,t,8),Ia.writeUint32LE(E+o|0,t,12),Ia.writeUint32LE(p+s|0,t,16),Ia.writeUint32LE(I+c|0,t,20),Ia.writeUint32LE(C+u|0,t,24),Ia.writeUint32LE(L+f|0,t,28),Ia.writeUint32LE(q+d|0,t,32),Ia.writeUint32LE(le+g|0,t,36),Ia.writeUint32LE(pe+m|0,t,40),Ia.writeUint32LE(B+w|0,t,44),Ia.writeUint32LE(U+v|0,t,48),Ia.writeUint32LE(K+y|0,t,52),Ia.writeUint32LE(ne+_|0,t,56),Ia.writeUint32LE(F+b|0,t,60)}function Jae(t,e,r,n,i){if(i===void 0&&(i=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(n.length<r.length)throw new Error("ChaCha: destination is shorter than source");var a,o;if(i===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");a=new Uint8Array(16),o=a.length-e.length,a.set(e,o)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");a=e,o=i}for(var s=new Uint8Array(64),c=0;c<r.length;c+=64){rDe(s,a,t);for(var u=c;u<c+64&&u<r.length;u++)n[u]=r[u]^s[u-c];iDe(a,0,o)}return l5.wipe(s),i===0&&l5.wipe(a),n}rO.streamXOR=Jae;function nDe(t,e,r,n){return n===void 0&&(n=0),l5.wipe(r),Jae(t,e,r,r,n)}rO.stream=nDe;function iDe(t,e,r){for(var n=1;r--;)n=n+(t[e]&255)|0,t[e]=n&255,n>>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Xae={},Ad={};Object.defineProperty(Ad,"__esModule",{value:!0});function aDe(t,e,r){return~(t-1)&e|t-1&r}Ad.select=aDe;function oDe(t,e){return(t|0)-(e|0)-1>>>31&1}Ad.lessOrEqual=oDe;function Zae(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n<t.length;n++)r|=t[n]^e[n];return 1&r-1>>>8}Ad.compare=Zae;function sDe(t,e){return t.length===0||e.length===0?!1:Zae(t,e)!==0}Ad.equal=sDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ad,r=is;t.DIGEST_LENGTH=16;var n=function(){function o(s){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var c=s[0]|s[1]<<8;this._r[0]=c&8191;var u=s[2]|s[3]<<8;this._r[1]=(c>>>13|u<<3)&8191;var f=s[4]|s[5]<<8;this._r[2]=(u>>>10|f<<6)&7939;var d=s[6]|s[7]<<8;this._r[3]=(f>>>7|d<<9)&8191;var g=s[8]|s[9]<<8;this._r[4]=(d>>>4|g<<12)&255,this._r[5]=g>>>1&8190;var m=s[10]|s[11]<<8;this._r[6]=(g>>>14|m<<2)&8191;var w=s[12]|s[13]<<8;this._r[7]=(m>>>11|w<<5)&8065;var v=s[14]|s[15]<<8;this._r[8]=(w>>>8|v<<8)&8191,this._r[9]=v>>>5&127,this._pad[0]=s[16]|s[17]<<8,this._pad[1]=s[18]|s[19]<<8,this._pad[2]=s[20]|s[21]<<8,this._pad[3]=s[22]|s[23]<<8,this._pad[4]=s[24]|s[25]<<8,this._pad[5]=s[26]|s[27]<<8,this._pad[6]=s[28]|s[29]<<8,this._pad[7]=s[30]|s[31]<<8}return o.prototype._blocks=function(s,c,u){for(var f=this._fin?0:2048,d=this._h[0],g=this._h[1],m=this._h[2],w=this._h[3],v=this._h[4],y=this._h[5],_=this._h[6],b=this._h[7],A=this._h[8],x=this._h[9],O=this._r[0],E=this._r[1],p=this._r[2],I=this._r[3],C=this._r[4],L=this._r[5],q=this._r[6],le=this._r[7],pe=this._r[8],B=this._r[9];u>=16;){var U=s[c+0]|s[c+1]<<8;d+=U&8191;var K=s[c+2]|s[c+3]<<8;g+=(U>>>13|K<<3)&8191;var ne=s[c+4]|s[c+5]<<8;m+=(K>>>10|ne<<6)&8191;var F=s[c+6]|s[c+7]<<8;w+=(ne>>>7|F<<9)&8191;var j=s[c+8]|s[c+9]<<8;v+=(F>>>4|j<<12)&8191,y+=j>>>1&8191;var z=s[c+10]|s[c+11]<<8;_+=(j>>>14|z<<2)&8191;var $=s[c+12]|s[c+13]<<8;b+=(z>>>11|$<<5)&8191;var H=s[c+14]|s[c+15]<<8;A+=($>>>8|H<<8)&8191,x+=H>>>5|f;var k=0,M=k;M+=d*O,M+=g*(5*B),M+=m*(5*pe),M+=w*(5*le),M+=v*(5*q),k=M>>>13,M&=8191,M+=y*(5*L),M+=_*(5*C),M+=b*(5*I),M+=A*(5*p),M+=x*(5*E),k+=M>>>13,M&=8191;var G=k;G+=d*E,G+=g*O,G+=m*(5*B),G+=w*(5*pe),G+=v*(5*le),k=G>>>13,G&=8191,G+=y*(5*q),G+=_*(5*L),G+=b*(5*C),G+=A*(5*I),G+=x*(5*p),k+=G>>>13,G&=8191;var ge=k;ge+=d*p,ge+=g*E,ge+=m*O,ge+=w*(5*B),ge+=v*(5*pe),k=ge>>>13,ge&=8191,ge+=y*(5*le),ge+=_*(5*q),ge+=b*(5*L),ge+=A*(5*C),ge+=x*(5*I),k+=ge>>>13,ge&=8191;var Q=k;Q+=d*I,Q+=g*p,Q+=m*E,Q+=w*O,Q+=v*(5*B),k=Q>>>13,Q&=8191,Q+=y*(5*pe),Q+=_*(5*le),Q+=b*(5*q),Q+=A*(5*L),Q+=x*(5*C),k+=Q>>>13,Q&=8191;var te=k;te+=d*C,te+=g*I,te+=m*p,te+=w*E,te+=v*O,k=te>>>13,te&=8191,te+=y*(5*B),te+=_*(5*pe),te+=b*(5*le),te+=A*(5*q),te+=x*(5*L),k+=te>>>13,te&=8191;var ce=k;ce+=d*L,ce+=g*C,ce+=m*I,ce+=w*p,ce+=v*E,k=ce>>>13,ce&=8191,ce+=y*O,ce+=_*(5*B),ce+=b*(5*pe),ce+=A*(5*le),ce+=x*(5*q),k+=ce>>>13,ce&=8191;var T=k;T+=d*q,T+=g*L,T+=m*C,T+=w*I,T+=v*p,k=T>>>13,T&=8191,T+=y*E,T+=_*O,T+=b*(5*B),T+=A*(5*pe),T+=x*(5*le),k+=T>>>13,T&=8191;var fe=k;fe+=d*le,fe+=g*q,fe+=m*L,fe+=w*C,fe+=v*I,k=fe>>>13,fe&=8191,fe+=y*p,fe+=_*E,fe+=b*O,fe+=A*(5*B),fe+=x*(5*pe),k+=fe>>>13,fe&=8191;var Ve=k;Ve+=d*pe,Ve+=g*le,Ve+=m*q,Ve+=w*L,Ve+=v*C,k=Ve>>>13,Ve&=8191,Ve+=y*I,Ve+=_*p,Ve+=b*E,Ve+=A*O,Ve+=x*(5*B),k+=Ve>>>13,Ve&=8191;var tt=k;tt+=d*B,tt+=g*pe,tt+=m*le,tt+=w*q,tt+=v*L,k=tt>>>13,tt&=8191,tt+=y*C,tt+=_*I,tt+=b*p,tt+=A*E,tt+=x*O,k+=tt>>>13,tt&=8191,k=(k<<2)+k|0,k=k+M|0,M=k&8191,k=k>>>13,G+=k,d=M,g=G,m=ge,w=Q,v=te,y=ce,_=T,b=fe,A=Ve,x=tt,c+=16,u-=16}this._h[0]=d,this._h[1]=g,this._h[2]=m,this._h[3]=w,this._h[4]=v,this._h[5]=y,this._h[6]=_,this._h[7]=b,this._h[8]=A,this._h[9]=x},o.prototype.finish=function(s,c){c===void 0&&(c=0);var u=new Uint16Array(10),f,d,g,m;if(this._leftover){for(m=this._leftover,this._buffer[m++]=1;m<16;m++)this._buffer[m]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(f=this._h[1]>>>13,this._h[1]&=8191,m=2;m<10;m++)this._h[m]+=f,f=this._h[m]>>>13,this._h[m]&=8191;for(this._h[0]+=f*5,f=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=f,f=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=f,u[0]=this._h[0]+5,f=u[0]>>>13,u[0]&=8191,m=1;m<10;m++)u[m]=this._h[m]+f,f=u[m]>>>13,u[m]&=8191;for(u[9]-=8192,d=(f^1)-1,m=0;m<10;m++)u[m]&=d;for(d=~d,m=0;m<10;m++)this._h[m]=this._h[m]&d|u[m];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,g=this._h[0]+this._pad[0],this._h[0]=g&65535,m=1;m<8;m++)g=(this._h[m]+this._pad[m]|0)+(g>>>16)|0,this._h[m]=g&65535;return s[c+0]=this._h[0]>>>0,s[c+1]=this._h[0]>>>8,s[c+2]=this._h[1]>>>0,s[c+3]=this._h[1]>>>8,s[c+4]=this._h[2]>>>0,s[c+5]=this._h[2]>>>8,s[c+6]=this._h[3]>>>0,s[c+7]=this._h[3]>>>8,s[c+8]=this._h[4]>>>0,s[c+9]=this._h[4]>>>8,s[c+10]=this._h[5]>>>0,s[c+11]=this._h[5]>>>8,s[c+12]=this._h[6]>>>0,s[c+13]=this._h[6]>>>8,s[c+14]=this._h[7]>>>0,s[c+15]=this._h[7]>>>8,this._finished=!0,this},o.prototype.update=function(s){var c=0,u=s.length,f;if(this._leftover){f=16-this._leftover,f>u&&(f=u);for(var d=0;d<f;d++)this._buffer[this._leftover+d]=s[c+d];if(u-=f,c+=f,this._leftover+=f,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(u>=16&&(f=u-u%16,this._blocks(s,c,f),c+=f,u-=f),u){for(var d=0;d<u;d++)this._buffer[this._leftover+d]=s[c+d];this._leftover+=u}return this},o.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var s=new Uint8Array(16);return this.finish(s),s},o.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},o}();t.Poly1305=n;function i(o,s){var c=new n(o);c.update(s);var u=c.digest();return c.clean(),u}t.oneTimeAuth=i;function a(o,s){return o.length!==t.DIGEST_LENGTH||s.length!==t.DIGEST_LENGTH?!1:e.equal(o,s)}t.equal=a})(Xae);(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=rO,r=Xae,n=is,i=Lr,a=Ad;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var o=new Uint8Array(16),s=function(){function c(u){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,u.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(u)}return c.prototype.seal=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=f.length+this.tagLength,y;if(g){if(g.length!==v)throw new Error("ChaCha20Poly1305: incorrect destination length");y=g}else y=new Uint8Array(v);return e.streamXOR(this._key,m,f,y,4),this._authenticate(y.subarray(y.length-this.tagLength,y.length),w,y.subarray(0,y.length-this.tagLength),d),n.wipe(m),y},c.prototype.open=function(u,f,d,g){if(u.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(f.length<this.tagLength)return null;var m=new Uint8Array(16);m.set(u,m.length-u.length);var w=new Uint8Array(32);e.stream(this._key,m,w,4);var v=new Uint8Array(this.tagLength);if(this._authenticate(v,w,f.subarray(0,f.length-this.tagLength),d),!a.equal(v,f.subarray(f.length-this.tagLength,f.length)))return null;var y=f.length-this.tagLength,_;if(g){if(g.length!==y)throw new Error("ChaCha20Poly1305: incorrect destination length");_=g}else _=new Uint8Array(y);return e.streamXOR(this._key,m,f.subarray(0,f.length-this.tagLength),_,4),n.wipe(m),_},c.prototype.clean=function(){return n.wipe(this._key),this},c.prototype._authenticate=function(u,f,d,g){var m=new r.Poly1305(f);g&&(m.update(g),g.length%16>0&&m.update(o.subarray(g.length%16))),m.update(d),d.length%16>0&&m.update(o.subarray(d.length%16));var w=new Uint8Array(8);g&&i.writeUint64LE(g.length,w),m.update(w),i.writeUint64LE(d.length,w),m.update(w);for(var v=m.digest(),y=0;y<v.length;y++)u[y]=v[y];m.clean(),n.wipe(v),n.wipe(w)},c}();t.ChaCha20Poly1305=s})(xk);var eoe={},Tw={},Ak={};Object.defineProperty(Ak,"__esModule",{value:!0});function cDe(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}Ak.isSerializableHash=cDe;Object.defineProperty(Tw,"__esModule",{value:!0});var Kc=Ak,uDe=Ad,lDe=is,toe=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var n=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i<n.length;i++)n[i]^=54;this._inner.update(n);for(var i=0;i<n.length;i++)n[i]^=106;this._outer.update(n),Kc.isSerializableHash(this._inner)&&Kc.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),lDe.wipe(n)}return t.prototype.reset=function(){if(!Kc.isSerializableHash(this._inner)||!Kc.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Kc.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Kc.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Kc.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Kc.isSerializableHash(this._inner)||!Kc.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Kc.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Tw.HMAC=toe;function fDe(t,e,r){var n=new toe(t,e);n.update(r);var i=n.digest();return n.clean(),i}Tw.hmac=fDe;Tw.equal=uDe.equal;Object.defineProperty(eoe,"__esModule",{value:!0});var jW=Tw,qW=is,dDe=function(){function t(e,r,n,i){n===void 0&&(n=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var a=jW.hmac(this._hash,n,r);this._hmac=new jW.HMAC(e,a),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),n=0;n<r.length;n++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[n]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),qW.wipe(this._buffer),qW.wipe(this._counter),this._bufpos=0},t}(),hDe=eoe.HKDF=dDe,am={},nO={},iO={};Object.defineProperty(iO,"__esModule",{value:!0});iO.BrowserRandomSource=void 0;const HW=65536;class pDe{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let n=0;n<r.length;n+=HW)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,HW)));return r}}iO.BrowserRandomSource=pDe;function f5(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var aO={};Object.defineProperty(aO,"__esModule",{value:!0});aO.NodeRandomSource=void 0;const gDe=is;class yDe{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof f5<"u"){const e=nM;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=r[i];return(0,gDe.wipe)(r),n}}aO.NodeRandomSource=yDe;Object.defineProperty(nO,"__esModule",{value:!0});nO.SystemRandomSource=void 0;const mDe=iO,vDe=aO;class bDe{constructor(){if(this.isAvailable=!1,this.name="",this._source=new mDe.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new vDe.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}nO.SystemRandomSource=bDe;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=nO,r=Lr,n=is;t.defaultRandomSource=new e.SystemRandomSource;function i(u,f=t.defaultRandomSource){return f.randomBytes(u)}t.randomBytes=i;function a(u=t.defaultRandomSource){const f=i(4,u),d=(0,r.readUint32LE)(f);return(0,n.wipe)(f),d}t.randomUint32=a;const o="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function s(u,f=o,d=t.defaultRandomSource){if(f.length<2)throw new Error("randomString charset is too short");if(f.length>256)throw new Error("randomString charset is too long");let g="";const m=f.length,w=256-256%m;for(;u>0;){const v=i(Math.ceil(u*256/w),d);for(let y=0;y<v.length&&u>0;y++){const _=v[y];_<w&&(g+=f.charAt(_%m),u--)}(0,n.wipe)(v)}return g}t.randomString=s;function c(u,f=o,d=t.defaultRandomSource){const g=Math.ceil(u/(Math.log(f.length)/Math.LN2));return s(g,f,d)}t.randomStringForEntropy=c})(am);var oO={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Lr,r=is;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var n=function(){function s(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return s.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},s.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},s.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},s.prototype.update=function(c,u){if(u===void 0&&(u=c.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this._bytesHashed+=u,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&u>0;)this._buffer[this._bufferLength++]=c[f++],u--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(u>=this.blockSize&&(f=a(this._temp,this._state,c,f,u),u%=this.blockSize);u>0;)this._buffer[this._bufferLength++]=c[f++],u--;return this},s.prototype.finish=function(c){if(!this._finished){var u=this._bytesHashed,f=this._bufferLength,d=u/536870912|0,g=u<<3,m=u%64<56?64:128;this._buffer[f]=128;for(var w=f+1;w<m-8;w++)this._buffer[w]=0;e.writeUint32BE(d,this._buffer,m-8),e.writeUint32BE(g,this._buffer,m-4),a(this._temp,this._state,this._buffer,0,m),this._finished=!0}for(var w=0;w<this.digestLength/4;w++)e.writeUint32BE(this._state[w],c,w*4);return this},s.prototype.digest=function(){var c=new Uint8Array(this.digestLength);return this.finish(c),c},s.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},s.prototype.restoreState=function(c){return this._state.set(c.state),this._bufferLength=c.bufferLength,c.buffer&&this._buffer.set(c.buffer),this._bytesHashed=c.bytesHashed,this._finished=!1,this},s.prototype.cleanSavedState=function(c){r.wipe(c.state),c.buffer&&r.wipe(c.buffer),c.bufferLength=0,c.bytesHashed=0},s}();t.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(s,c,u,f,d){for(;d>=64;){for(var g=c[0],m=c[1],w=c[2],v=c[3],y=c[4],_=c[5],b=c[6],A=c[7],x=0;x<16;x++){var O=f+x*4;s[x]=e.readUint32BE(u,O)}for(var x=16;x<64;x++){var E=s[x-2],p=(E>>>17|E<<32-17)^(E>>>19|E<<32-19)^E>>>10;E=s[x-15];var I=(E>>>7|E<<32-7)^(E>>>18|E<<32-18)^E>>>3;s[x]=(p+s[x-7]|0)+(I+s[x-16]|0)}for(var x=0;x<64;x++){var p=(((y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7))+(y&_^~y&b)|0)+(A+(i[x]+s[x]|0)|0)|0,I=((g>>>2|g<<32-2)^(g>>>13|g<<32-13)^(g>>>22|g<<32-22))+(g&m^g&w^m&w)|0;A=b,b=_,_=y,y=v+p|0,v=w,w=m,m=g,g=p+I|0}c[0]+=g,c[1]+=m,c[2]+=w,c[3]+=v,c[4]+=y,c[5]+=_,c[6]+=b,c[7]+=A,f+=64,d-=64}return f}function o(s){var c=new n;c.update(s);var u=c.digest();return c.clean(),u}t.hash=o})(oO);var Sk={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=am,r=is;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(x){const O=new Float64Array(16);if(x)for(let E=0;E<x.length;E++)O[E]=x[E];return O}const i=new Uint8Array(32);i[0]=9;const a=n([56129,1]);function o(x){let O=1;for(let E=0;E<16;E++){let p=x[E]+O+65535;O=Math.floor(p/65536),x[E]=p-O*65536}x[0]+=O-1+37*(O-1)}function s(x,O,E){const p=~(E-1);for(let I=0;I<16;I++){const C=p&(x[I]^O[I]);x[I]^=C,O[I]^=C}}function c(x,O){const E=n(),p=n();for(let I=0;I<16;I++)p[I]=O[I];o(p),o(p),o(p);for(let I=0;I<2;I++){E[0]=p[0]-65517;for(let L=1;L<15;L++)E[L]=p[L]-65535-(E[L-1]>>16&1),E[L-1]&=65535;E[15]=p[15]-32767-(E[14]>>16&1);const C=E[15]>>16&1;E[14]&=65535,s(p,E,1-C)}for(let I=0;I<16;I++)x[2*I]=p[I]&255,x[2*I+1]=p[I]>>8}function u(x,O){for(let E=0;E<16;E++)x[E]=O[2*E]+(O[2*E+1]<<8);x[15]&=32767}function f(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]+E[p]}function d(x,O,E){for(let p=0;p<16;p++)x[p]=O[p]-E[p]}function g(x,O,E){let p,I,C=0,L=0,q=0,le=0,pe=0,B=0,U=0,K=0,ne=0,F=0,j=0,z=0,$=0,H=0,k=0,M=0,G=0,ge=0,Q=0,te=0,ce=0,T=0,fe=0,Ve=0,tt=0,mt=0,vt=0,gt=0,Lt=0,Yt=0,wr=0,Rt=E[0],Pt=E[1],kt=E[2],Nt=E[3],Kt=E[4],Ut=E[5],zt=E[6],$t=E[7],Dt=E[8],qt=E[9],Mt=E[10],cr=E[11],tr=E[12],ir=E[13],nr=E[14],mr=E[15];p=O[0],C+=p*Rt,L+=p*Pt,q+=p*kt,le+=p*Nt,pe+=p*Kt,B+=p*Ut,U+=p*zt,K+=p*$t,ne+=p*Dt,F+=p*qt,j+=p*Mt,z+=p*cr,$+=p*tr,H+=p*ir,k+=p*nr,M+=p*mr,p=O[1],L+=p*Rt,q+=p*Pt,le+=p*kt,pe+=p*Nt,B+=p*Kt,U+=p*Ut,K+=p*zt,ne+=p*$t,F+=p*Dt,j+=p*qt,z+=p*Mt,$+=p*cr,H+=p*tr,k+=p*ir,M+=p*nr,G+=p*mr,p=O[2],q+=p*Rt,le+=p*Pt,pe+=p*kt,B+=p*Nt,U+=p*Kt,K+=p*Ut,ne+=p*zt,F+=p*$t,j+=p*Dt,z+=p*qt,$+=p*Mt,H+=p*cr,k+=p*tr,M+=p*ir,G+=p*nr,ge+=p*mr,p=O[3],le+=p*Rt,pe+=p*Pt,B+=p*kt,U+=p*Nt,K+=p*Kt,ne+=p*Ut,F+=p*zt,j+=p*$t,z+=p*Dt,$+=p*qt,H+=p*Mt,k+=p*cr,M+=p*tr,G+=p*ir,ge+=p*nr,Q+=p*mr,p=O[4],pe+=p*Rt,B+=p*Pt,U+=p*kt,K+=p*Nt,ne+=p*Kt,F+=p*Ut,j+=p*zt,z+=p*$t,$+=p*Dt,H+=p*qt,k+=p*Mt,M+=p*cr,G+=p*tr,ge+=p*ir,Q+=p*nr,te+=p*mr,p=O[5],B+=p*Rt,U+=p*Pt,K+=p*kt,ne+=p*Nt,F+=p*Kt,j+=p*Ut,z+=p*zt,$+=p*$t,H+=p*Dt,k+=p*qt,M+=p*Mt,G+=p*cr,ge+=p*tr,Q+=p*ir,te+=p*nr,ce+=p*mr,p=O[6],U+=p*Rt,K+=p*Pt,ne+=p*kt,F+=p*Nt,j+=p*Kt,z+=p*Ut,$+=p*zt,H+=p*$t,k+=p*Dt,M+=p*qt,G+=p*Mt,ge+=p*cr,Q+=p*tr,te+=p*ir,ce+=p*nr,T+=p*mr,p=O[7],K+=p*Rt,ne+=p*Pt,F+=p*kt,j+=p*Nt,z+=p*Kt,$+=p*Ut,H+=p*zt,k+=p*$t,M+=p*Dt,G+=p*qt,ge+=p*Mt,Q+=p*cr,te+=p*tr,ce+=p*ir,T+=p*nr,fe+=p*mr,p=O[8],ne+=p*Rt,F+=p*Pt,j+=p*kt,z+=p*Nt,$+=p*Kt,H+=p*Ut,k+=p*zt,M+=p*$t,G+=p*Dt,ge+=p*qt,Q+=p*Mt,te+=p*cr,ce+=p*tr,T+=p*ir,fe+=p*nr,Ve+=p*mr,p=O[9],F+=p*Rt,j+=p*Pt,z+=p*kt,$+=p*Nt,H+=p*Kt,k+=p*Ut,M+=p*zt,G+=p*$t,ge+=p*Dt,Q+=p*qt,te+=p*Mt,ce+=p*cr,T+=p*tr,fe+=p*ir,Ve+=p*nr,tt+=p*mr,p=O[10],j+=p*Rt,z+=p*Pt,$+=p*kt,H+=p*Nt,k+=p*Kt,M+=p*Ut,G+=p*zt,ge+=p*$t,Q+=p*Dt,te+=p*qt,ce+=p*Mt,T+=p*cr,fe+=p*tr,Ve+=p*ir,tt+=p*nr,mt+=p*mr,p=O[11],z+=p*Rt,$+=p*Pt,H+=p*kt,k+=p*Nt,M+=p*Kt,G+=p*Ut,ge+=p*zt,Q+=p*$t,te+=p*Dt,ce+=p*qt,T+=p*Mt,fe+=p*cr,Ve+=p*tr,tt+=p*ir,mt+=p*nr,vt+=p*mr,p=O[12],$+=p*Rt,H+=p*Pt,k+=p*kt,M+=p*Nt,G+=p*Kt,ge+=p*Ut,Q+=p*zt,te+=p*$t,ce+=p*Dt,T+=p*qt,fe+=p*Mt,Ve+=p*cr,tt+=p*tr,mt+=p*ir,vt+=p*nr,gt+=p*mr,p=O[13],H+=p*Rt,k+=p*Pt,M+=p*kt,G+=p*Nt,ge+=p*Kt,Q+=p*Ut,te+=p*zt,ce+=p*$t,T+=p*Dt,fe+=p*qt,Ve+=p*Mt,tt+=p*cr,mt+=p*tr,vt+=p*ir,gt+=p*nr,Lt+=p*mr,p=O[14],k+=p*Rt,M+=p*Pt,G+=p*kt,ge+=p*Nt,Q+=p*Kt,te+=p*Ut,ce+=p*zt,T+=p*$t,fe+=p*Dt,Ve+=p*qt,tt+=p*Mt,mt+=p*cr,vt+=p*tr,gt+=p*ir,Lt+=p*nr,Yt+=p*mr,p=O[15],M+=p*Rt,G+=p*Pt,ge+=p*kt,Q+=p*Nt,te+=p*Kt,ce+=p*Ut,T+=p*zt,fe+=p*$t,Ve+=p*Dt,tt+=p*qt,mt+=p*Mt,vt+=p*cr,gt+=p*tr,Lt+=p*ir,Yt+=p*nr,wr+=p*mr,C+=38*G,L+=38*ge,q+=38*Q,le+=38*te,pe+=38*ce,B+=38*T,U+=38*fe,K+=38*Ve,ne+=38*tt,F+=38*mt,j+=38*vt,z+=38*gt,$+=38*Lt,H+=38*Yt,k+=38*wr,I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),I=1,p=C+I+65535,I=Math.floor(p/65536),C=p-I*65536,p=L+I+65535,I=Math.floor(p/65536),L=p-I*65536,p=q+I+65535,I=Math.floor(p/65536),q=p-I*65536,p=le+I+65535,I=Math.floor(p/65536),le=p-I*65536,p=pe+I+65535,I=Math.floor(p/65536),pe=p-I*65536,p=B+I+65535,I=Math.floor(p/65536),B=p-I*65536,p=U+I+65535,I=Math.floor(p/65536),U=p-I*65536,p=K+I+65535,I=Math.floor(p/65536),K=p-I*65536,p=ne+I+65535,I=Math.floor(p/65536),ne=p-I*65536,p=F+I+65535,I=Math.floor(p/65536),F=p-I*65536,p=j+I+65535,I=Math.floor(p/65536),j=p-I*65536,p=z+I+65535,I=Math.floor(p/65536),z=p-I*65536,p=$+I+65535,I=Math.floor(p/65536),$=p-I*65536,p=H+I+65535,I=Math.floor(p/65536),H=p-I*65536,p=k+I+65535,I=Math.floor(p/65536),k=p-I*65536,p=M+I+65535,I=Math.floor(p/65536),M=p-I*65536,C+=I-1+37*(I-1),x[0]=C,x[1]=L,x[2]=q,x[3]=le,x[4]=pe,x[5]=B,x[6]=U,x[7]=K,x[8]=ne,x[9]=F,x[10]=j,x[11]=z,x[12]=$,x[13]=H,x[14]=k,x[15]=M}function m(x,O){g(x,O,O)}function w(x,O){const E=n();for(let p=0;p<16;p++)E[p]=O[p];for(let p=253;p>=0;p--)m(E,E),p!==2&&p!==4&&g(E,E,O);for(let p=0;p<16;p++)x[p]=E[p]}function v(x,O){const E=new Uint8Array(32),p=new Float64Array(80),I=n(),C=n(),L=n(),q=n(),le=n(),pe=n();for(let ne=0;ne<31;ne++)E[ne]=x[ne];E[31]=x[31]&127|64,E[0]&=248,u(p,O);for(let ne=0;ne<16;ne++)C[ne]=p[ne];I[0]=q[0]=1;for(let ne=254;ne>=0;--ne){const F=E[ne>>>3]>>>(ne&7)&1;s(I,C,F),s(L,q,F),f(le,I,L),d(I,I,L),f(L,C,q),d(C,C,q),m(q,le),m(pe,I),g(I,L,I),g(L,C,le),f(le,I,L),d(I,I,L),m(C,I),d(L,q,pe),g(I,L,a),f(I,I,q),g(L,L,I),g(I,q,pe),g(q,C,p),m(C,le),s(I,C,F),s(L,q,F)}for(let ne=0;ne<16;ne++)p[ne+16]=I[ne],p[ne+32]=L[ne],p[ne+48]=C[ne],p[ne+64]=q[ne];const B=p.subarray(32),U=p.subarray(16);w(B,B),g(U,U,B);const K=new Uint8Array(32);return c(K,U),K}t.scalarMult=v;function y(x){return v(x,i)}t.scalarMultBase=y;function _(x){if(x.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const O=new Uint8Array(x);return{publicKey:y(O),secretKey:O}}t.generateKeyPairFromSeed=_;function b(x){const O=(0,e.randomBytes)(32,x),E=_(O);return(0,r.wipe)(O),E}t.generateKeyPair=b;function A(x,O,E=!1){if(x.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(O.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const p=v(x,O);if(E){let I=0;for(let C=0;C<p.length;C++)I|=p[C];if(I===0)throw new Error("X25519: invalid shared key")}return p}t.sharedKey=A})(Sk);function Ok(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function roe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Ok(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function d5(t,e){e||(e=t.reduce((i,a)=>i+a.length,0));const r=roe(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return Ok(r)}function wDe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<t.length;i++){var a=t.charAt(i),o=a.charCodeAt(0);if(r[o]!==255)throw new TypeError(a+" is ambiguous");r[o]=i}var s=t.length,c=t.charAt(0),u=Math.log(s)/Math.log(256),f=Math.log(256)/Math.log(s);function d(w){if(w instanceof Uint8Array||(ArrayBuffer.isView(w)?w=new Uint8Array(w.buffer,w.byteOffset,w.byteLength):Array.isArray(w)&&(w=Uint8Array.from(w))),!(w instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(w.length===0)return"";for(var v=0,y=0,_=0,b=w.length;_!==b&&w[_]===0;)_++,v++;for(var A=(b-_)*f+1>>>0,x=new Uint8Array(A);_!==b;){for(var O=w[_],E=0,p=A-1;(O!==0||E<y)&&p!==-1;p--,E++)O+=256*x[p]>>>0,x[p]=O%s>>>0,O=O/s>>>0;if(O!==0)throw new Error("Non-zero carry");y=E,_++}for(var I=A-y;I!==A&&x[I]===0;)I++;for(var C=c.repeat(v);I<A;++I)C+=t.charAt(x[I]);return C}function g(w){if(typeof w!="string")throw new TypeError("Expected String");if(w.length===0)return new Uint8Array;var v=0;if(w[v]!==" "){for(var y=0,_=0;w[v]===c;)y++,v++;for(var b=(w.length-v)*u+1>>>0,A=new Uint8Array(b);w[v];){var x=r[w.charCodeAt(v)];if(x===255)return;for(var O=0,E=b-1;(x!==0||O<_)&&E!==-1;E--,O++)x+=s*A[E]>>>0,A[E]=x%256>>>0,x=x/256>>>0;if(x!==0)throw new Error("Non-zero carry");_=O,v++}if(w[v]!==" "){for(var p=b-_;p!==b&&A[p]===0;)p++;for(var I=new Uint8Array(y+(b-p)),C=y;p!==b;)I[C++]=A[p++];return I}}}function m(w){var v=g(w);if(v)return v;throw new Error(`Non-${e} character`)}return{encode:d,decodeUnsafe:g,decode:m}}var _De=wDe,EDe=_De;const xDe=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},ADe=t=>new TextEncoder().encode(t),SDe=t=>new TextDecoder().decode(t);class ODe{constructor(e,r,n){this.name=e,this.prefix=r,this.baseEncode=n}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class IDe{constructor(e,r,n){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return noe(this,e)}}class PDe{constructor(e){this.decoders=e}or(e){return noe(this,e)}decode(e){const r=e[0],n=this.decoders[r];if(n)return n.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const noe=(t,e)=>new PDe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class TDe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new ODe(e,r,n),this.decoder=new IDe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const sO=({name:t,prefix:e,encode:r,decode:n})=>new TDe(t,e,r,n),Rw=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=EDe(r,e);return sO({prefix:t,name:e,encode:n,decode:a=>xDe(i(a))})},RDe=(t,e,r,n)=>{const i={};for(let f=0;f<e.length;++f)i[e[f]]=f;let a=t.length;for(;t[a-1]==="=";)--a;const o=new Uint8Array(a*r/8|0);let s=0,c=0,u=0;for(let f=0;f<a;++f){const d=i[t[f]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);c=c<<r|d,s+=r,s>=8&&(s-=8,o[u++]=255&c>>s)}if(s>=r||255&c<<8-s)throw new SyntaxError("Unexpected end of data");return o},CDe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<<r)-1;let a="",o=0,s=0;for(let c=0;c<t.length;++c)for(s=s<<8|t[c],o+=8;o>r;)o-=r,a+=e[i&s>>o];if(o&&(a+=e[i&s<<r-o]),n)for(;a.length*r&7;)a+="=";return a},ba=({name:t,prefix:e,bitsPerChar:r,alphabet:n})=>sO({prefix:e,name:t,encode(i){return CDe(i,n,r)},decode(i){return RDe(i,n,r,t)}}),NDe=sO({prefix:"\0",name:"identity",encode:t=>SDe(t),decode:t=>ADe(t)}),DDe=Object.freeze(Object.defineProperty({__proto__:null,identity:NDe},Symbol.toStringTag,{value:"Module"})),$De=ba({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),MDe=Object.freeze(Object.defineProperty({__proto__:null,base2:$De},Symbol.toStringTag,{value:"Module"})),kDe=ba({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),LDe=Object.freeze(Object.defineProperty({__proto__:null,base8:kDe},Symbol.toStringTag,{value:"Module"})),UDe=Rw({prefix:"9",name:"base10",alphabet:"0123456789"}),BDe=Object.freeze(Object.defineProperty({__proto__:null,base10:UDe},Symbol.toStringTag,{value:"Module"})),FDe=ba({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),jDe=ba({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),qDe=Object.freeze(Object.defineProperty({__proto__:null,base16:FDe,base16upper:jDe},Symbol.toStringTag,{value:"Module"})),HDe=ba({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zDe=ba({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),VDe=ba({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),GDe=ba({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),WDe=ba({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),KDe=ba({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),YDe=ba({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),QDe=ba({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),JDe=ba({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),XDe=Object.freeze(Object.defineProperty({__proto__:null,base32:HDe,base32hex:WDe,base32hexpad:YDe,base32hexpadupper:QDe,base32hexupper:KDe,base32pad:VDe,base32padupper:GDe,base32upper:zDe,base32z:JDe},Symbol.toStringTag,{value:"Module"})),ZDe=Rw({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),e$e=Rw({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),t$e=Object.freeze(Object.defineProperty({__proto__:null,base36:ZDe,base36upper:e$e},Symbol.toStringTag,{value:"Module"})),r$e=Rw({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),n$e=Rw({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),i$e=Object.freeze(Object.defineProperty({__proto__:null,base58btc:r$e,base58flickr:n$e},Symbol.toStringTag,{value:"Module"})),a$e=ba({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),o$e=ba({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),s$e=ba({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),c$e=ba({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),u$e=Object.freeze(Object.defineProperty({__proto__:null,base64:a$e,base64pad:o$e,base64url:s$e,base64urlpad:c$e},Symbol.toStringTag,{value:"Module"})),ioe=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),l$e=ioe.reduce((t,e,r)=>(t[r]=e,t),[]),f$e=ioe.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function d$e(t){return t.reduce((e,r)=>(e+=l$e[r],e),"")}function h$e(t){const e=[];for(const r of t){const n=f$e[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const p$e=sO({prefix:"🚀",name:"base256emoji",encode:d$e,decode:h$e}),g$e=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:p$e},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const zW={...DDe,...MDe,...LDe,...BDe,...qDe,...XDe,...t$e,...i$e,...u$e,...g$e};function aoe(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const VW=aoe("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),mN=aoe("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=roe(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),ooe={utf8:VW,"utf-8":VW,hex:zW.base16,latin1:mN,ascii:mN,binary:mN,...zW};function Co(t,e="utf8"){const r=ooe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Ok(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}function co(t,e="utf8"){const r=ooe[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var GW=globalThis&&globalThis.__spreadArray||function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n<i;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return t.concat(a||Array.prototype.slice.call(e))},y$e=function(){function t(e,r,n){this.name=e,this.version=r,this.os=n,this.type="browser"}return t}(),m$e=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=za.platform}return t}(),v$e=function(){function t(e,r,n,i){this.name=e,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return t}(),b$e=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),w$e=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),_$e=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,E$e=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,WW=3,x$e=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",_$e]],KW=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function A$e(t){return t?YW(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new w$e:typeof navigator<"u"?YW(navigator.userAgent):I$e()}function S$e(t){return t!==""&&x$e.reduce(function(e,r){var n=r[0],i=r[1];if(e)return e;var a=i.exec(t);return!!a&&[n,a]},!1)}function YW(t){var e=S$e(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new b$e;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<WW&&(i=GW(GW([],i,!0),P$e(WW-i.length),!0)):i=[];var a=i.join("."),o=O$e(t),s=E$e.exec(t);return s&&s[1]?new v$e(r,a,o,s[1]):new y$e(r,a,o)}function O$e(t){for(var e=0,r=KW.length;e<r;e++){var n=KW[e],i=n[0],a=n[1],o=a.exec(t);if(o)return i}return null}function I$e(){var t=typeof za<"u"&&za.version;return t?new m$e(za.version.slice(1)):null}function P$e(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Xt={};/*! *****************************************************************************
122
122
  Copyright (c) Microsoft Corporation.
123
123
 
124
124
  Permission to use, copy, modify, and/or distribute this software for any
@@ -167,7 +167,7 @@ function print() { __p += __j.call(arguments, '') }
167
167
  - Extension \`${r.name}\` supports version(s) \`${n}\``:n||(e+=`
168
168
  - Extension \`${r.name}\` does not support ${zn.platform} environments.`)}),new Id(Od.IncompatibleExtensions,e)}function WFe(t){let e=r=>{let n=r+1,i=n%10,a=n%100;return i===1&&a!==11?`${n}st`:i===2&&a!==12?`${n}nd`:i===3&&a!==13?`${n}rd`:`${n}th`};return new Id(Od.InvalidArgument,`Invalid ${e(t.argument)} argument given to \`${t.procedure}\`.
169
169
  Expected: \`${t.expected}\`
170
- Received: \`${t.received}\``)}function KFe(){return new Uw(um.DuplicateIframe,"Duplicate iframes found.")}function YFe(){return new Uw(um.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function QFe(){return new Uw(um.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${zn.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function vg(t){let{method:e,removalVersions:r,useInstead:n}=t,i=r[zn.sdkName],a=n?` Use \`${n}\` instead.`:"",o=`\`${e}\` will be removed from \`${zn.sdkName}\` in version \`${i}\`.${a}`;return new Uw(um.DeprecationNotice,o)}function*JFe(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var XFe=JFe();function Ase(){return XFe.next().value}var Sse=Symbol("Payload pre-processed by Magic SDK");function Ose(t){return Object.defineProperty(t,Sse,{value:!0,enumerable:!1}),t}function ZFe(t){return!!t[Sse]}function QA(t){var e,r,n;return ZFe(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=Ase(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],Ose(t)),t}function an(t,e=[]){return Ose({params:e,method:t,jsonrpc:"2.0",id:Ase()})}var Vk=class{constructor(t){t instanceof Vk?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):BFe(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}applyError(t){return this._error=t,this}applyResult(t){return this._result=t,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},eje=WBe(KBe()),tje=class extends eje.default{};function Ise(){let t=new tje;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var Pse=Symbol("isPromiEvent");function Tse(t){return!!t[Pse]}function Gk(t){let e=Rse(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=Ise(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(f,d)=>(...g)=>{let m=d[f].apply(d,g);return c(m)},c=f=>Object.assign(f,{[Pse]:!0,[i]:f[i]||f.then,[a]:f[a]||f.catch,[o]:f[o]||f.finally,then:s(i,f),catch:s(a,f),finally:s(o,f),on:n("on",f),once:n("once",f),addListener:n("addListener",f),off:n("off",f),removeListener:n("removeListener",f),removeAllListeners:n("removeAllListeners",f),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),u=c(e.then(f=>(u.emit("done",f),u.emit("settled"),f),f=>{throw u.emit("error",f),u.emit("settled"),f}));return u}function Rse(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var Np=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(R1.MAGIC_HANDLE_REQUEST,QA(t)),r=Gk((i,a)=>{e.then(o=>{if(n(),o.hasError)a(new N1(o.payload.error));else if(o.hasResult)i(o.payload.result);else throw zFe()}).catch(o=>{n(),a(o)})}),n=this.overlay.on(Ah.MAGIC_HANDLE_EVENT,i=>{var a;let{response:o}=i.data;if(o.id===t.id&&((a=o.result)!=null&&a.event)){let{event:s,params:c=[]}=o.result;r.emit(s,...c)}});return r}createIntermediaryEvent(t,e){return r=>{let n=an(vr.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}};function rje(t,e){let[r]=t.split(".").map(Number);return r>=e}var bg={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},nje=class extends Np{loginWithMagicLink(t){let e=zn.sdkName==="@magic-sdk/react-native"||zn.sdkName==="@magic-sdk/react-native-bare"||zn.sdkName==="@magic-sdk/react-native-expo";if(e&&rje(zn.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");e&&vg({method:"auth.loginWithMagicLink()",removalVersions:bg,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:i,overrides:a}=t,o=an(this.sdk.testMode?vr.LoginWithMagicLinkTestMode:vr.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:i,overrides:a}]);return this.request(o)}loginWithSMS(t){let{phoneNumber:e}=t,r=an(this.sdk.testMode?vr.LoginWithSmsTestMode:vr.LoginWithSms,[{phoneNumber:e,showUI:!0}]);return this.request(r)}loginWithEmailOTP(t){let{email:e,showUI:r,deviceCheckUI:n,overrides:i}=t,a=an(this.sdk.testMode?vr.LoginWithEmailOTPTestMode:vr.LoginWithEmailOTP,[{email:e,showUI:r,deviceCheckUI:n,overrides:i}]),o=this.request(a);return!n&&o&&o.on(KA.Retry,()=>{this.createIntermediaryEvent(KA.Retry,a.id)()}),!r&&o&&(o.on(G0.VerifyEmailOtp,s=>{this.createIntermediaryEvent(G0.VerifyEmailOtp,a.id)(s)}),o.on(G0.Cancel,()=>{this.createIntermediaryEvent(G0.Cancel,a.id)()})),o}loginWithCredential(t){let e=t??"";if(!t&&zn.platform==="web"){e=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=an(this.sdk.testMode?vr.LoginWithCredentialTestMode:vr.LoginWithCredential,[e]);return this.request(r)}setAuthorizationToken(t){let e=an(vr.SetAuthorizationToken,[{jwt:t}]);return this.request(e)}updateEmailWithUI(t){let{email:e,showUI:r=!0}=t,n=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}},Cse={};VBe(Cse,{clear:()=>ije,getItem:()=>$o,iterate:()=>Nse,key:()=>oje,keys:()=>sje,length:()=>aje,removeItem:()=>yO,setItem:()=>Tl});var SE;function Pd(t){return(...e)=>Ci(this,null,function*(){return SE||(SE=yield zn.configureStorage()),yield SE.ready(),SE[t](...e)})}var $o=Pd("getItem"),Tl=Pd("setItem"),yO=Pd("removeItem"),ije=Pd("clear"),aje=Pd("length"),oje=Pd("key"),sje=Pd("keys"),Nse=Pd("iterate");function cje(){let t=window.crypto.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&191|128;let e="";return e+=t[0].toString(16),e+=t[1].toString(16),e+=t[2].toString(16),e+=t[3].toString(16),e+="-",e+=t[4].toString(16),e+=t[5].toString(16),e+="-",e+=t[6].toString(16),e+=t[7].toString(16),e+="-",e+=t[8].toString(16),e+=t[9].toString(16),e+="-",e+=t[10].toString(16),e+=t[11].toString(16),e+=t[12].toString(16),e+=t[13].toString(16),e+=t[14].toString(16),e+=t[15].toString(16),e}var Dse="STORE_KEY_PRIVATE_KEY",I5="STORE_KEY_PUBLIC_JWK",$se="ECDSA",uje="P-256",lje={name:$se,namedCurve:uje};function mO(){let t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function fje(){return Ci(this,null,function*(){let t=yield dje();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield $o(Dse);if(!r||!e){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:cje()},i={typ:"dpop+jwt",alg:"ES256",jwk:t},a={protected:MY(JSON.stringify(i)),claims:MY(JSON.stringify(n))},o=pje(`${a.protected}.${a.claims}`),s={name:$se,hash:{name:"SHA-256"}},c=yje(new Uint8Array(yield e.sign(s,r,o)));return`${a.protected}.${a.claims}.${c}`})}function dje(){return Ci(this,null,function*(){if(!mO()){console.info("webcrypto is not supported");return}return(yield $o(I5))||(yield hje()),$o(I5)})}function hje(){return Ci(this,null,function*(){let{subtle:t}=window.crypto,e=yield t.generateKey(lje,!1,["sign"]),r=yield t.exportKey("jwk",e.publicKey);yield Tl(Dse,e.privateKey),yield Tl(I5,r)})}function MY(t){return Mse(gje(t))}function pje(t){return new TextEncoder().encode(t)}function Mse(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function gje(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function yje(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),Mse(e)}var Wk="ds",Kk="ek",Yk="iv",Qk="AES-GCM",mje=256;function Jk(){return Ci(this,null,function*(){let t=[];yield Nse((e,r,n)=>{r.startsWith(`${Wk}_`)&&t.push(r)});for(let e of t)yield yO(e)})}function kse(t){let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return window.btoa(e)}function Lse(t){let e=window.atob(t),r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}function vje(){return Ci(this,null,function*(){if(!mO()){console.info("webcrypto is not supported");return}let{crypto:t}=window;return(yield $o(Yk))||t.getRandomValues(new Uint8Array(12))})}function bje(){return Ci(this,null,function*(){if(!mO()){console.info("webcrypto is not supported");return}let{subtle:t}=window.crypto;return(yield $o(Kk))||(yield t.generateKey({name:Qk,length:mje},!1,["encrypt","decrypt"]))})}function wje(t,e){return Ci(this,null,function*(){let r=yield vje(),n=yield bje();if(!r||!n||!t)return;let i=Lse(t),{subtle:a}=window.crypto,o=yield a.encrypt({name:Qk,iv:r},n,i),s=kse(o);yield Tl(`${Wk}_${e}`,s),yield Tl(Kk,n),yield Tl(Yk,r)})}function _je(t){return Ci(this,null,function*(){let e=yield $o(`${Wk}_${t}`),r=yield $o(Yk),n=yield $o(Kk);if(!r||!e||!n||!mO())return;let{subtle:i}=window.crypto,a=yield i.decrypt({name:Qk,iv:r},n,Lse(e));return kse(a)})}var Eje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(e){let r=an(this.sdk.testMode?vr.GetIdTokenTestMode:vr.GetIdToken,[e]);return this.request(r)}generateIdToken(e){let r=an(this.sdk.testMode?vr.GenerateIdTokenTestMode:vr.GenerateIdToken,[e]);return this.request(r)}getInfo(){return Ci(this,null,function*(){let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}isLoggedIn(){let e=an(this.sdk.testMode?vr.IsLoggedInTestMode:vr.IsLoggedIn);return this.request(e)}logout(){yO(this.localForageKey),Jk();let e=an(this.sdk.testMode?vr.LogoutTestMode:vr.Logout);return this.request(e)}requestInfoWithUI(e){let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}showSettings(e){let r=an(this.sdk.testMode?vr.UserSettingsTestMode:vr.UserSettings,[e]);return this.request(r)}recoverAccount(e){let r=an(this.sdk.testMode?vr.RecoverAccountTestMode:vr.RecoverAccount,[e]);return this.request(r)}getMetadata(){vg({method:"user.getMetadata()",removalVersions:bg,useInstead:"user.getInfo()"}).log();let e=an(this.sdk.testMode?vr.GetMetadataTestMode:vr.GetMetadata);return this.request(e)}updateEmail(e){vg({method:"user.updateEmail()",removalVersions:bg,useInstead:"auth.updateEmailWithUI()"}).log();let{email:r,showUI:n=!0}=e,i=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:r,showUI:n}]);return this.request(i)}};function JA(t,e){return e?new URL(t,e):new URL(t)}var xje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Gk((r,n)=>Ci(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(_s.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(_s.MetaMask);r(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(_s.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(_s.CoinbaseWallet);r(c);return}let i=this.getUserEnv(),a=an(vr.Login,[i]),o=this.request(a);o.on(Vb.WalletSelected,c=>this.handleWalletSelected(bse(qk({},c),{payloadId:a.id}))),o.on("id-token-created",c=>{e.emit("id-token-created",c)});let s=yield o;s.error&&n(s),r(s)}catch(i){n(i)}}));return e}showUI(){return this.request(an(vr.ShowUI))}showAddress(){return this.request(an(vr.ShowAddress))}showSendTokensUI(){return this.request(an(vr.ShowSendTokensUI))}showOnRamp(){return this.request(an(vr.ShowOnRamp))}showNFTs(){return this.request(an(vr.ShowNFTs))}showBalances(){return this.request(an(vr.ShowBalances))}sendGaslessTransaction(e,r){return this.request(an(vr.SendGaslessTransaction,[e,r]))}getInfo(){return Ci(this,null,function*(){vg({method:"wallet.getInfo()",removalVersions:bg,useInstead:"user.getInfo()"}).log();let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}disconnect(){vg({method:"wallet.disconnect()",removalVersions:bg,useInstead:"user.logout()"}).log(),yO(this.localForageKey),Jk();let e=an(vr.Disconnect);return this.request(e)}requestUserInfoWithUI(e){vg({method:"wallet.requestUserInfoWithUI()",removalVersions:bg,useInstead:"user.requestUserInfoWithUI()"}).log();let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}getProvider(){return Ci(this,null,function*(){switch(yield $o(this.localForageKey)){case _s.MetaMask:return this.getMetaMaskProvider();case _s.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case _s.MetaMask:return this.connectToMetaMask();case _s.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let r=an("mc_is_wallet_enabled",[{wallet:e}]);return this.request(r)}handleWalletSelected(e){return Ci(this,null,function*(){try{let r=yield this.connectToThirdPartyWallet(e.wallet);yield Tl(this.localForageKey,e.wallet),this.createIntermediaryEvent(Vb.WalletConnected,e.payloadId)(r)}catch(r){console.error(r),this.createIntermediaryEvent(Vb.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return Ci(this,null,function*(){let r;e===_s.MetaMask&&(r=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===_s.CoinbaseWallet&&(r=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield Tl(this.localForageKey,e);let n=an(vr.AutoConnect,[{wallet:e,address:r}]);return this.request(n)})}},{createBoundEmitterMethod:OE,createChainingEmitterMethod:m0}=Ise(),Aje=class extends Np{constructor(){super(...arguments),this.isMagic=!0,this.on=m0("on",this),this.once=m0("once",this),this.addListener=m0("addListener",this),this.off=m0("off",this),this.removeListener=m0("removeListener",this),this.removeAllListeners=m0("removeAllListeners",this),this.emit=OE("emit"),this.eventNames=OE("eventNames"),this.listeners=OE("listeners"),this.listenerCount=OE("listenerCount")}sendAsync(t,e){if(!e)throw WFe({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(R1.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=QA(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>bse(qk({},n.payload),{error:n.hasError?new N1(n.payload.error):null})))});else{let r=QA(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(R1.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new N1(n.payload.error):null,n.payload)})}}send(t,e){if(typeof t=="string"){let n=an(t,Array.isArray(e)?e:[]);return this.request(n)}if(Array.isArray(t)||e){this.sendAsync(t,e);return}let r=YFe();return r.log(),new Vk(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=an(vr.Login);return this.request(t)}request(t){return this.prefixPayloadMethodForTestMode(t),super.request(t)}prefixPayloadMethodForTestMode(t){let e="testMode/eth/";this.sdk.testMode&&(t.method=`${e}${t.method}`)}},kY=["request","overlay","sdk"];function Sje(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==Np.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var Use=class extends Np{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Gk,isPromiEvent:Tse,encodeJSON:_se,decodeJSON:LFe,createJsonRpcRequestPayload:an,standardizeJsonRpcRequestPayload:QA,storage:Cse};let t=[this,...Sje(this)];kY.forEach(e=>{let r=t.map(o=>Object.getOwnPropertyDescriptor(o,e)),n=r.findIndex(o=>!!o),i=n>0,a=r[n];a&&(this.__sdk_access_field_descriptors__.set(e,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,e,{configurable:!0,get:()=>{throw VFe(e)}}))})}init(t){this.__is_initialized__||(kY.forEach(e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,r)}}),this.sdk=t,this.__is_initialized__=!0)}createDeprecationWarning(t){let{method:e,removalVersion:r,useInstead:n}=t,i=n?` Use \`${n}\` instead.`:"",a=`\`${e}\` will be removed from this Extension in version \`${r}\`.${i}`;return new O5(this,"DEPRECATION_NOTICE",a)}createWarning(t,e){return new O5(this,t,e)}createError(t,e,r){return new zk(this,t,e,r)}},Oje=class extends Use{},Xh=class extends Use{};Xh.Internal=Oje,Xh.Anonymous="anonymous extension";var Ije=class extends Np{purchase(t){let e=an(vr.NFTPurchase,[t]);return this.request(e)}checkout(t){let e=an(vr.NFTCheckout,[t]);return this.request(e)}transfer(t){let e=an(vr.NFTTransfer,[t]);return this.request(e)}};function LY(t){return t.compat&&t.compat[zn.sdkName]!=null?typeof t.compat[zn.sdkName]=="string"?PFe(NFe(zn.version),t.compat[zn.sdkName]):!!t.compat[zn.sdkName]:!0}function Pje(t,e,r){return!e&&!r?`${t}_eth_mainnet`:r?`${t}_${JSON.stringify(r)}`:e?typeof e=="string"?`${t}_eth_${e}`:`${t}_${e.rpcUrl}_${e.chainId}_${e.chainType}`:`${t}_unknown`}function Tje(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(a=>{LY(a)?(a.init(this),(a.name||a.name!==Xh.Anonymous)&&(this[a.name]=a),a instanceof Xh.Internal&&(YA(a.config)||(n[a.name]=a.config))):i.push(a)}):Object.keys(r).forEach(a=>{if(LY(r[a])){r[a].init(this);let o=r[a];this[a]=o,o instanceof Xh.Internal&&(YA(o.config)||(n[r[a].name]=o.config))}else i.push(r[a])}),i.length)throw GFe(i);return n}var Px=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw HFe();zn.platform==="react-native"&&(e!=null&&e.endpoint)&&QFe().log();let{defaultEndpoint:n,version:i}=zn;this.testMode=!!(e!=null&&e.testMode),this.endpoint=JA((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.auth=new nje(this),this.user=new Eje(this),this.wallet=new xje(this),this.nft=new Ije(this),this.rpcProvider=new Aje(this);let a=Tje.call(this,e);this.parameters=_se(qk({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:JA(this.endpoint).host,sdk:qFe[zn.sdkName],version:i,ext:YA(a)?void 0:a,locale:(e==null?void 0:e.locale)||"en_US"},zn.bundleId?{bundleId:zn.bundleId}:{})),this.networkHash=Pje(this.apiKey,e==null?void 0:e.network,YA(a)?void 0:a),e!=null&&e.deferPreload||this.preload()}get overlay(){if(!Px.__overlays__.has(this.parameters)){let t=new zn.ViewController(this.endpoint,this.parameters,this.networkHash);t.init(),Px.__overlays__.set(this.parameters,t)}return Px.__overlays__.get(this.parameters)}preload(){return Ci(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Bse=Px;Bse.__overlays__=new Map;function Rje(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function Cje(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=Rje(t,n);if(n&&i){let a=new Vk(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:a}}return{}}function Nje(t,e,r){return Ci(this,null,function*(){var n;let i=yield $o("rt"),a;if(zn.platform==="web")try{a=(n=yield $o("jwt"))!=null?n:yield fje()}catch(c){console.error("webcrypto error",c)}let o={msgType:t,payload:e};a&&(o.jwt=a),a&&i&&(o.rt=i);let s=yield _je(r);return s&&(o.deviceShare=s),o})}function Dje(t){return Ci(this,null,function*(){!t.data.rt||(yield Tl("rt",t.data.rt))})}var $je=class{constructor(t,e,r){this.endpoint=t,this.parameters=e,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(t,e){return Ci(this,null,function*(){return Rse((r,n)=>Ci(this,null,function*(){if(!this.isConnectedToInternet){let u=xse();n(u)}this.isReadyForRequest||(yield this.waitForReady());let i=[],a=Array.isArray(e)?e.map(u=>u.id):[],o=yield Nje(`${t}-${this.parameters}`,e,this.networkHash);yield this._post(o);let s=u=>f=>{var d;let{id:g,response:m}=Cje(e,f);if(Dje(f),((d=m==null?void 0:m.payload.error)==null?void 0:d.message)==="User denied account access.")Jk();else if(f.data.deviceShare){let{deviceShare:w}=f.data;wje(w,this.networkHash)}g&&m&&Array.isArray(e)&&a.includes(g)?(i.push(m),i.length===e.length&&(u(),r(i))):g&&m&&!Array.isArray(e)&&g===e.id&&(u(),r(m))},c=this.on(Ah.MAGIC_HANDLE_RESPONSE,s(()=>c()))}))})}on(t,e){let r=e.bind(window),n=i=>{i.data.msgType===`${t}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(t=>{let e=this.on(Ah.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,t(),e()})})}listen(){this.on(Ah.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Ah.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Mje=Object.create,Fse=Object.defineProperty,kje=Object.getOwnPropertyDescriptor,Lje=Object.getOwnPropertyNames,Uje=Object.getPrototypeOf,Bje=Object.prototype.hasOwnProperty,IE=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),jse=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Fje=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lje(e))!Bje.call(t,i)&&i!==r&&Fse(t,i,{get:()=>e[i],enumerable:!(n=kje(e,i))||n.enumerable});return t},qse=(t,e,r)=>(r=t!=null?Mje(Uje(t)):{},Fje(e||!t||!t.__esModule?Fse(r,"default",{value:t,enumerable:!0}):r,t)),Tx=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),jje=jse((t,e)=>{(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){return function r(n,i,a){function o(u,f){if(!i[u]){if(!n[u]){var d=typeof IE=="function"&&IE;if(!f&&d)return d(u,!0);if(s)return s(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var m=i[u]={exports:{}};n[u][0].call(m.exports,function(w){var v=n[u][1][w];return o(v||w)},m,m.exports,r,n,i,a)}return i[u].exports}for(var s=typeof IE=="function"&&IE,c=0;c<a.length;c++)o(a[c]);return o}({1:[function(r,n,i){(function(a){var o=a.MutationObserver||a.WebKitMutationObserver,s;if(o){var c=0,u=new o(w),f=a.document.createTextNode("");u.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var d=new a.MessageChannel;d.port1.onmessage=w,s=function(){d.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?s=function(){var y=a.document.createElement("script");y.onreadystatechange=function(){w(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},a.document.documentElement.appendChild(y)}:s=function(){setTimeout(w,0)};var g,m=[];function w(){g=!0;for(var y,_,b=m.length;b;){for(_=m,m=[],y=-1;++y<b;)_[y]();b=m.length}g=!1}n.exports=v;function v(y){m.push(y)===1&&!g&&s()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var a=r(1);function o(){}var s={},c=["REJECTED"],u=["FULFILLED"],f=["PENDING"];n.exports=d;function d(O){if(typeof O!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,O!==o&&v(this,O)}d.prototype.catch=function(O){return this.then(null,O)},d.prototype.then=function(O,E){if(typeof O!="function"&&this.state===u||typeof E!="function"&&this.state===c)return this;var p=new this.constructor(o);if(this.state!==f){var I=this.state===u?O:E;m(p,I,this.outcome)}else this.queue.push(new g(p,O,E));return p};function g(O,E,p){this.promise=O,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof p=="function"&&(this.onRejected=p,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(O){s.resolve(this.promise,O)},g.prototype.otherCallFulfilled=function(O){m(this.promise,this.onFulfilled,O)},g.prototype.callRejected=function(O){s.reject(this.promise,O)},g.prototype.otherCallRejected=function(O){m(this.promise,this.onRejected,O)};function m(O,E,p){a(function(){var I;try{I=E(p)}catch(C){return s.reject(O,C)}I===O?s.reject(O,new TypeError("Cannot resolve promise with itself")):s.resolve(O,I)})}s.resolve=function(O,E){var p=y(w,E);if(p.status==="error")return s.reject(O,p.value);var I=p.value;if(I)v(O,I);else{O.state=u,O.outcome=E;for(var C=-1,L=O.queue.length;++C<L;)O.queue[C].callFulfilled(E)}return O},s.reject=function(O,E){O.state=c,O.outcome=E;for(var p=-1,I=O.queue.length;++p<I;)O.queue[p].callRejected(E);return O};function w(O){var E=O&&O.then;if(O&&(typeof O=="object"||typeof O=="function")&&typeof E=="function")return function(){E.apply(O,arguments)}}function v(O,E){var p=!1;function I(le){p||(p=!0,s.reject(O,le))}function C(le){p||(p=!0,s.resolve(O,le))}function L(){E(C,I)}var q=y(L);q.status==="error"&&I(q.value)}function y(O,E){var p={};try{p.value=O(E),p.status="success"}catch(I){p.status="error",p.value=I}return p}d.resolve=_;function _(O){return O instanceof this?O:s.resolve(new this(o),O)}d.reject=b;function b(O){var E=new this(o);return s.reject(E,O)}d.all=A;function A(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=new Array(p),L=0,q=-1,le=new this(o);++q<p;)pe(O[q],q);return le;function pe(B,U){E.resolve(B).then(K,function(ne){I||(I=!0,s.reject(le,ne))});function K(ne){C[U]=ne,++L===p&&!I&&(I=!0,s.resolve(le,C))}}}d.race=x;function x(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=-1,L=new this(o);++C<p;)q(O[C]);return L;function q(le){E.resolve(le).then(function(pe){I||(I=!0,s.resolve(L,pe))},function(pe){I||(I=!0,s.reject(L,pe))})}}},{1:1}],3:[function(r,n,i){(function(a){typeof a.Promise!="function"&&(a.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X};function o(X,me){if(!(X instanceof me))throw new TypeError("Cannot call a class as a function")}function s(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=s();function u(){try{if(!c||!c.open)return!1;var X=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),me=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!X||me)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(X,me){X=X||[],me=me||{};try{return new Blob(X,me)}catch(Oe){if(Oe.name!=="TypeError")throw Oe;for(var re=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,Ee=new re,be=0;be<X.length;be+=1)Ee.append(X[be]);return Ee.getBlob(me.type)}}typeof Promise>"u"&&r(3);var d=Promise;function g(X,me){me&&X.then(function(re){me(null,re)},function(re){me(re)})}function m(X,me,re){typeof me=="function"&&X.then(me),typeof re=="function"&&X.catch(re)}function w(X){return typeof X!="string"&&(console.warn(X+" used as a key, but it is not a string."),X=String(X)),X}function v(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var y="local-forage-detect-blob-support",_=void 0,b={},A=Object.prototype.toString,x="readonly",O="readwrite";function E(X){for(var me=X.length,re=new ArrayBuffer(me),Ee=new Uint8Array(re),be=0;be<me;be++)Ee[be]=X.charCodeAt(be);return re}function p(X){return new d(function(me){var re=X.transaction(y,O),Ee=f([""]);re.objectStore(y).put(Ee,"key"),re.onabort=function(be){be.preventDefault(),be.stopPropagation(),me(!1)},re.oncomplete=function(){var be=navigator.userAgent.match(/Chrome\/(\d+)/),Oe=navigator.userAgent.match(/Edge\//);me(Oe||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function I(X){return typeof _=="boolean"?d.resolve(_):p(X).then(function(me){return _=me,_})}function C(X){var me=b[X.name],re={};re.promise=new d(function(Ee,be){re.resolve=Ee,re.reject=be}),me.deferredOperations.push(re),me.dbReady?me.dbReady=me.dbReady.then(function(){return re.promise}):me.dbReady=re.promise}function L(X){var me=b[X.name],re=me.deferredOperations.pop();if(re)return re.resolve(),re.promise}function q(X,me){var re=b[X.name],Ee=re.deferredOperations.pop();if(Ee)return Ee.reject(me),Ee.promise}function le(X,me){return new d(function(re,Ee){if(b[X.name]=b[X.name]||H(),X.db)if(me)C(X),X.db.close();else return re(X.db);var be=[X.name];me&&be.push(X.version);var Oe=c.open.apply(c,be);me&&(Oe.onupgradeneeded=function(Je){var ft=Oe.result;try{ft.createObjectStore(X.storeName),Je.oldVersion<=1&&ft.createObjectStore(y)}catch(Qe){if(Qe.name==="ConstraintError")console.warn('The database "'+X.name+'" has been upgraded from version '+Je.oldVersion+" to version "+Je.newVersion+', but the storage "'+X.storeName+'" already exists.');else throw Qe}}),Oe.onerror=function(Je){Je.preventDefault(),Ee(Oe.error)},Oe.onsuccess=function(){var Je=Oe.result;Je.onversionchange=function(ft){ft.target.close()},re(Je),L(X)}})}function pe(X){return le(X,!1)}function B(X){return le(X,!0)}function U(X,me){if(!X.db)return!0;var re=!X.db.objectStoreNames.contains(X.storeName),Ee=X.version<X.db.version,be=X.version>X.db.version;if(Ee&&(X.version!==me&&console.warn('The database "'+X.name+`" can't be downgraded from version `+X.db.version+" to version "+X.version+"."),X.version=X.db.version),be||re){if(re){var Oe=X.db.version+1;Oe>X.version&&(X.version=Oe)}return!0}return!1}function K(X){return new d(function(me,re){var Ee=new FileReader;Ee.onerror=re,Ee.onloadend=function(be){var Oe=btoa(be.target.result||"");me({__local_forage_encoded_blob:!0,data:Oe,type:X.type})},Ee.readAsBinaryString(X)})}function ne(X){var me=E(atob(X.data));return f([me],{type:X.type})}function F(X){return X&&X.__local_forage_encoded_blob}function j(X){var me=this,re=me._initReady().then(function(){var Ee=b[me._dbInfo.name];if(Ee&&Ee.dbReady)return Ee.dbReady});return m(re,X,X),re}function z(X){C(X);for(var me=b[X.name],re=me.forages,Ee=0;Ee<re.length;Ee++){var be=re[Ee];be._dbInfo.db&&(be._dbInfo.db.close(),be._dbInfo.db=null)}return X.db=null,pe(X).then(function(Oe){return X.db=Oe,U(X)?B(X):Oe}).then(function(Oe){X.db=me.db=Oe;for(var Je=0;Je<re.length;Je++)re[Je]._dbInfo.db=Oe}).catch(function(Oe){throw q(X,Oe),Oe})}function $(X,me,re,Ee){Ee===void 0&&(Ee=1);try{var be=X.db.transaction(X.storeName,me);re(null,be)}catch(Oe){if(Ee>0&&(!X.db||Oe.name==="InvalidStateError"||Oe.name==="NotFoundError"))return d.resolve().then(function(){if(!X.db||Oe.name==="NotFoundError"&&!X.db.objectStoreNames.contains(X.storeName)&&X.version<=X.db.version)return X.db&&(X.version=X.db.version+1),B(X)}).then(function(){return z(X).then(function(){$(X,me,re,Ee-1)})}).catch(re);re(Oe)}}function H(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function k(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=X[Ee];var be=b[re.name];be||(be=H(),b[re.name]=be),be.forages.push(me),me._initReady||(me._initReady=me.ready,me.ready=j);var Oe=[];function Je(){return d.resolve()}for(var ft=0;ft<be.forages.length;ft++){var Qe=be.forages[ft];Qe!==me&&Oe.push(Qe._initReady().catch(Je))}var Ge=be.forages.slice(0);return d.all(Oe).then(function(){return re.db=be.db,pe(re)}).then(function(ht){return re.db=ht,U(re,me._defaultConfig.version)?B(re):ht}).then(function(ht){re.db=be.db=ht,me._dbInfo=re;for(var Vt=0;Vt<Ge.length;Vt++){var Tr=Ge[Vt];Tr!==me&&(Tr._dbInfo.db=re.db,Tr._dbInfo.version=re.version)}})}function M(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=Qe.get(X);Ge.onsuccess=function(){var ht=Ge.result;ht===void 0&&(ht=null),F(ht)&&(ht=ne(ht)),be(ht)},Ge.onerror=function(){Oe(Ge.error)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function G(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=Qe.openCursor(),ht=1;Ge.onsuccess=function(){var Vt=Ge.result;if(Vt){var Tr=Vt.value;F(Tr)&&(Tr=ne(Tr));var Wr=X(Tr,Vt.key,ht++);Wr!==void 0?be(Wr):Vt.continue()}else be()},Ge.onerror=function(){Oe(Ge.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function ge(X,me,re){var Ee=this;X=w(X);var be=new d(function(Oe,Je){var ft;Ee.ready().then(function(){return ft=Ee._dbInfo,A.call(me)==="[object Blob]"?I(ft.db).then(function(Qe){return Qe?me:K(me)}):me}).then(function(Qe){$(Ee._dbInfo,O,function(Ge,ht){if(Ge)return Je(Ge);try{var Vt=ht.objectStore(Ee._dbInfo.storeName);Qe===null&&(Qe=void 0);var Tr=Vt.put(Qe,X);ht.oncomplete=function(){Qe===void 0&&(Qe=null),Oe(Qe)},ht.onabort=ht.onerror=function(){var Wr=Tr.error?Tr.error:Tr.transaction.error;Je(Wr)}}catch(Wr){Je(Wr)}})}).catch(Je)});return g(be,re),be}function Q(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,O,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=Qe.delete(X);ft.oncomplete=function(){be()},ft.onerror=function(){Oe(Ge.error)},ft.onabort=function(){var ht=Ge.error?Ge.error:Ge.transaction.error;Oe(ht)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function te(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,O,function(Oe,Je){if(Oe)return be(Oe);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.clear();Je.oncomplete=function(){Ee()},Je.onabort=Je.onerror=function(){var Ge=Qe.error?Qe.error:Qe.transaction.error;be(Ge)}}catch(Ge){be(Ge)}})}).catch(be)});return g(re,X),re}function ce(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Je){if(Oe)return be(Oe);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.count();Qe.onsuccess=function(){Ee(Qe.result)},Qe.onerror=function(){be(Qe.error)}}catch(Ge){be(Ge)}})}).catch(be)});return g(re,X),re}function T(X,me){var re=this,Ee=new d(function(be,Oe){if(X<0){be(null);return}re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=!1,ht=Qe.openKeyCursor();ht.onsuccess=function(){var Vt=ht.result;if(!Vt){be(null);return}X===0||Ge?be(Vt.key):(Ge=!0,Vt.advance(X))},ht.onerror=function(){Oe(ht.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function fe(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Je){if(Oe)return be(Oe);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.openKeyCursor(),Ge=[];Qe.onsuccess=function(){var ht=Qe.result;if(!ht){Ee(Ge);return}Ge.push(ht.key),ht.continue()},Qe.onerror=function(){be(Qe.error)}}catch(ht){be(ht)}})}).catch(be)});return g(re,X),re}function Ve(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;if(!X.name)be=d.reject("Invalid arguments");else{var Oe=X.name===re.name&&Ee._dbInfo.db,Je=Oe?d.resolve(Ee._dbInfo.db):pe(X).then(function(ft){var Qe=b[X.name],Ge=Qe.forages;Qe.db=ft;for(var ht=0;ht<Ge.length;ht++)Ge[ht]._dbInfo.db=ft;return ft});X.storeName?be=Je.then(function(ft){if(ft.objectStoreNames.contains(X.storeName)){var Qe=ft.version+1;C(X);var Ge=b[X.name],ht=Ge.forages;ft.close();for(var Vt=0;Vt<ht.length;Vt++){var Tr=ht[Vt];Tr._dbInfo.db=null,Tr._dbInfo.version=Qe}var Wr=new d(function(jr,_n){var qr=c.open(X.name,Qe);qr.onerror=function(P){var D=qr.result;D.close(),_n(P)},qr.onupgradeneeded=function(){var P=qr.result;P.deleteObjectStore(X.storeName)},qr.onsuccess=function(){var P=qr.result;P.close(),jr(P)}});return Wr.then(function(jr){Ge.db=jr;for(var _n=0;_n<ht.length;_n++){var qr=ht[_n];qr._dbInfo.db=jr,L(qr._dbInfo)}}).catch(function(jr){throw(q(X,jr)||d.resolve()).catch(function(){}),jr})}}):be=Je.then(function(ft){C(X);var Qe=b[X.name],Ge=Qe.forages;ft.close();for(var ht=0;ht<Ge.length;ht++){var Vt=Ge[ht];Vt._dbInfo.db=null}var Tr=new d(function(Wr,jr){var _n=c.deleteDatabase(X.name);_n.onerror=function(){var qr=_n.result;qr&&qr.close(),jr(_n.error)},_n.onblocked=function(){console.warn('dropInstance blocked for database "'+X.name+'" until all open connections are closed')},_n.onsuccess=function(){var qr=_n.result;qr&&qr.close(),Wr(qr)}});return Tr.then(function(Wr){Qe.db=Wr;for(var jr=0;jr<Ge.length;jr++){var _n=Ge[jr];L(_n._dbInfo)}}).catch(function(Wr){throw(q(X,Wr)||d.resolve()).catch(function(){}),Wr})})}return g(be,me),be}var tt={_driver:"asyncStorage",_initStorage:k,_support:u(),iterate:G,getItem:M,setItem:ge,removeItem:Q,clear:te,length:ce,key:T,keys:fe,dropInstance:Ve};function mt(){return typeof openDatabase=="function"}var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="~~local_forage_type~",Lt=/^~~local_forage_type~([^~]+)~/,Yt="__lfsc__:",wr=Yt.length,Rt="arbf",Pt="blob",kt="si08",Nt="ui08",Kt="uic8",Ut="si16",zt="si32",$t="ur16",Dt="ui32",qt="fl32",Mt="fl64",cr=wr+Rt.length,tr=Object.prototype.toString;function ir(X){var me=X.length*.75,re=X.length,Ee,be=0,Oe,Je,ft,Qe;X[X.length-1]==="="&&(me--,X[X.length-2]==="="&&me--);var Ge=new ArrayBuffer(me),ht=new Uint8Array(Ge);for(Ee=0;Ee<re;Ee+=4)Oe=vt.indexOf(X[Ee]),Je=vt.indexOf(X[Ee+1]),ft=vt.indexOf(X[Ee+2]),Qe=vt.indexOf(X[Ee+3]),ht[be++]=Oe<<2|Je>>4,ht[be++]=(Je&15)<<4|ft>>2,ht[be++]=(ft&3)<<6|Qe&63;return Ge}function nr(X){var me=new Uint8Array(X),re="",Ee;for(Ee=0;Ee<me.length;Ee+=3)re+=vt[me[Ee]>>2],re+=vt[(me[Ee]&3)<<4|me[Ee+1]>>4],re+=vt[(me[Ee+1]&15)<<2|me[Ee+2]>>6],re+=vt[me[Ee+2]&63];return me.length%3===2?re=re.substring(0,re.length-1)+"=":me.length%3===1&&(re=re.substring(0,re.length-2)+"=="),re}function mr(X,me){var re="";if(X&&(re=tr.call(X)),X&&(re==="[object ArrayBuffer]"||X.buffer&&tr.call(X.buffer)==="[object ArrayBuffer]")){var Ee,be=Yt;X instanceof ArrayBuffer?(Ee=X,be+=Rt):(Ee=X.buffer,re==="[object Int8Array]"?be+=kt:re==="[object Uint8Array]"?be+=Nt:re==="[object Uint8ClampedArray]"?be+=Kt:re==="[object Int16Array]"?be+=Ut:re==="[object Uint16Array]"?be+=$t:re==="[object Int32Array]"?be+=zt:re==="[object Uint32Array]"?be+=Dt:re==="[object Float32Array]"?be+=qt:re==="[object Float64Array]"?be+=Mt:me(new Error("Failed to get type for BinaryArray"))),me(be+nr(Ee))}else if(re==="[object Blob]"){var Oe=new FileReader;Oe.onload=function(){var Je=gt+X.type+"~"+nr(this.result);me(Yt+Pt+Je)},Oe.readAsArrayBuffer(X)}else try{me(JSON.stringify(X))}catch(Je){console.error("Couldn't convert value into a JSON string: ",X),me(null,Je)}}function wn(X){if(X.substring(0,wr)!==Yt)return JSON.parse(X);var me=X.substring(cr),re=X.substring(wr,cr),Ee;if(re===Pt&&Lt.test(me)){var be=me.match(Lt);Ee=be[1],me=me.substring(be[0].length)}var Oe=ir(me);switch(re){case Rt:return Oe;case Pt:return f([Oe],{type:Ee});case kt:return new Int8Array(Oe);case Nt:return new Uint8Array(Oe);case Kt:return new Uint8ClampedArray(Oe);case Ut:return new Int16Array(Oe);case $t:return new Uint16Array(Oe);case zt:return new Int32Array(Oe);case Dt:return new Uint32Array(Oe);case qt:return new Float32Array(Oe);case Mt:return new Float64Array(Oe);default:throw new Error("Unkown type: "+re)}}var Yr={serialize:mr,deserialize:wn,stringToBuffer:ir,bufferToString:nr};function ai(X,me,re,Ee){X.executeSql("CREATE TABLE IF NOT EXISTS "+me.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],re,Ee)}function Dn(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=typeof X[Ee]!="string"?X[Ee].toString():X[Ee];var be=new d(function(Oe,Je){try{re.db=openDatabase(re.name,String(re.version),re.description,re.size)}catch(ft){return Je(ft)}re.db.transaction(function(ft){ai(ft,re,function(){me._dbInfo=re,Oe()},function(Qe,Ge){Je(Ge)})},Je)});return re.serializer=Yr,be}function $n(X,me,re,Ee,be,Oe){X.executeSql(re,Ee,be,function(Je,ft){ft.code===ft.SYNTAX_ERR?Je.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(Qe,Ge){Ge.rows.length?Oe(Qe,ft):ai(Qe,me,function(){Qe.executeSql(re,Ee,be,Oe)},Oe)},Oe):Oe(Je,ft)},Oe)}function Kn(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName+" WHERE key = ? LIMIT 1",[X],function(Qe,Ge){var ht=Ge.rows.length?Ge.rows.item(0).value:null;ht&&(ht=Je.serializer.deserialize(ht)),be(ht)},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function xr(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName,[],function(Qe,Ge){for(var ht=Ge.rows,Vt=ht.length,Tr=0;Tr<Vt;Tr++){var Wr=ht.item(Tr),jr=Wr.value;if(jr&&(jr=Je.serializer.deserialize(jr)),jr=X(jr,Wr.key,Tr+1),jr!==void 0){be(jr);return}}be()},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function $r(X,me,re,Ee){var be=this;X=w(X);var Oe=new d(function(Je,ft){be.ready().then(function(){me===void 0&&(me=null);var Qe=me,Ge=be._dbInfo;Ge.serializer.serialize(me,function(ht,Vt){Vt?ft(Vt):Ge.db.transaction(function(Tr){$n(Tr,Ge,"INSERT OR REPLACE INTO "+Ge.storeName+" (key, value) VALUES (?, ?)",[X,ht],function(){Je(Qe)},function(Wr,jr){ft(jr)})},function(Tr){if(Tr.code===Tr.QUOTA_ERR){if(Ee>0){Je($r.apply(be,[X,Qe,re,Ee-1]));return}ft(Tr)}})})}).catch(ft)});return g(Oe,re),Oe}function _r(X,me,re){return $r.apply(this,[X,me,re,1])}function _e(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"DELETE FROM "+Je.storeName+" WHERE key = ?",[X],function(){be()},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function ee(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Je){$n(Je,Oe,"DELETE FROM "+Oe.storeName,[],function(){Ee()},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Je){$n(Je,Oe,"SELECT COUNT(key) as c FROM "+Oe.storeName,[],function(ft,Qe){var Ge=Qe.rows.item(0).c;Ee(Ge)},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function Re(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT key FROM "+Je.storeName+" WHERE id = ? LIMIT 1",[X+1],function(Qe,Ge){var ht=Ge.rows.length?Ge.rows.item(0).key:null;be(ht)},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function He(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Je){$n(Je,Oe,"SELECT key FROM "+Oe.storeName,[],function(ft,Qe){for(var Ge=[],ht=0;ht<Qe.rows.length;ht++)Ge.push(Qe.rows.item(ht).key);Ee(Ge)},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function Xe(X){return new d(function(me,re){X.transaction(function(Ee){Ee.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(be,Oe){for(var Je=[],ft=0;ft<Oe.rows.length;ft++)Je.push(Oe.rows.item(ft).name);me({db:X,storeNames:Je})},function(be,Oe){re(Oe)})},function(Ee){re(Ee)})})}function st(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;return X.name?be=new d(function(Oe){var Je;X.name===re.name?Je=Ee._dbInfo.db:Je=openDatabase(X.name,"","",0),X.storeName?Oe({db:Je,storeNames:[X.storeName]}):Oe(Xe(Je))}).then(function(Oe){return new d(function(Je,ft){Oe.db.transaction(function(Qe){function Ge(Wr){return new d(function(jr,_n){Qe.executeSql("DROP TABLE IF EXISTS "+Wr,[],function(){jr()},function(qr,P){_n(P)})})}for(var ht=[],Vt=0,Tr=Oe.storeNames.length;Vt<Tr;Vt++)ht.push(Ge(Oe.storeNames[Vt]));d.all(ht).then(function(){Je()}).catch(function(Wr){ft(Wr)})},function(Qe){ft(Qe)})})}):be=d.reject("Invalid arguments"),g(be,me),be}var lt={_driver:"webSQLStorage",_initStorage:Dn,_support:mt(),iterate:xr,getItem:Kn,setItem:_r,removeItem:_e,clear:ee,length:ve,key:Re,keys:He,dropInstance:st};function _t(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ue(X,me){var re=X.name+"/";return X.storeName!==me.storeName&&(re+=X.storeName+"/"),re}function Z(){var X="_localforage_support_test";try{return localStorage.setItem(X,!0),localStorage.removeItem(X),!1}catch{return!0}}function ye(){return!Z()||localStorage.length>0}function Me(X){var me=this,re={};if(X)for(var Ee in X)re[Ee]=X[Ee];return re.keyPrefix=ue(X,me._defaultConfig),ye()?(me._dbInfo=re,re.serializer=Yr,d.resolve()):d.reject()}function Le(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo.keyPrefix,be=localStorage.length-1;be>=0;be--){var Oe=localStorage.key(be);Oe.indexOf(Ee)===0&&localStorage.removeItem(Oe)}});return g(re,X),re}function wt(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo,Oe=localStorage.getItem(be.keyPrefix+X);return Oe&&(Oe=be.serializer.deserialize(Oe)),Oe});return g(Ee,me),Ee}function Ot(X,me){var re=this,Ee=re.ready().then(function(){for(var be=re._dbInfo,Oe=be.keyPrefix,Je=Oe.length,ft=localStorage.length,Qe=1,Ge=0;Ge<ft;Ge++){var ht=localStorage.key(Ge);if(ht.indexOf(Oe)===0){var Vt=localStorage.getItem(ht);if(Vt&&(Vt=be.serializer.deserialize(Vt)),Vt=X(Vt,ht.substring(Je),Qe++),Vt!==void 0)return Vt}}});return g(Ee,me),Ee}function pr(X,me){var re=this,Ee=re.ready().then(function(){var be=re._dbInfo,Oe;try{Oe=localStorage.key(X)}catch{Oe=null}return Oe&&(Oe=Oe.substring(be.keyPrefix.length)),Oe});return g(Ee,me),Ee}function lr(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo,be=localStorage.length,Oe=[],Je=0;Je<be;Je++){var ft=localStorage.key(Je);ft.indexOf(Ee.keyPrefix)===0&&Oe.push(ft.substring(Ee.keyPrefix.length))}return Oe});return g(re,X),re}function en(X){var me=this,re=me.keys().then(function(Ee){return Ee.length});return g(re,X),re}function gr(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo;localStorage.removeItem(be.keyPrefix+X)});return g(Ee,me),Ee}function Er(X,me,re){var Ee=this;X=w(X);var be=Ee.ready().then(function(){me===void 0&&(me=null);var Oe=me;return new d(function(Je,ft){var Qe=Ee._dbInfo;Qe.serializer.serialize(me,function(Ge,ht){if(ht)ft(ht);else try{localStorage.setItem(Qe.keyPrefix+X,Ge),Je(Oe)}catch(Vt){(Vt.name==="QuotaExceededError"||Vt.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ft(Vt),ft(Vt)}})})});return g(be,re),be}function on(X,me){if(me=v.apply(this,arguments),X=typeof X!="function"&&X||{},!X.name){var re=this.config();X.name=X.name||re.name,X.storeName=X.storeName||re.storeName}var Ee=this,be;return X.name?be=new d(function(Oe){X.storeName?Oe(ue(X,Ee._defaultConfig)):Oe(X.name+"/")}).then(function(Oe){for(var Je=localStorage.length-1;Je>=0;Je--){var ft=localStorage.key(Je);ft.indexOf(Oe)===0&&localStorage.removeItem(ft)}}):be=d.reject("Invalid arguments"),g(be,me),be}var sr={_driver:"localStorageWrapper",_initStorage:Me,_support:_t(),iterate:Ot,getItem:wt,setItem:Er,removeItem:gr,clear:Le,length:en,key:pr,keys:lr,dropInstance:on},Ur=function(X,me){return X===me||typeof X=="number"&&typeof me=="number"&&isNaN(X)&&isNaN(me)},gn=function(X,me){for(var re=X.length,Ee=0;Ee<re;){if(Ur(X[Ee],me))return!0;Ee++}return!1},Br=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"},Zn={},Si={},ei={INDEXEDDB:tt,WEBSQL:lt,LOCALSTORAGE:sr},Oi=[ei.INDEXEDDB._driver,ei.WEBSQL._driver,ei.LOCALSTORAGE._driver],Ii=["dropInstance"],oi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ii),Fn={description:"",driver:Oi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ra(X,me){X[me]=function(){var re=arguments;return X.ready().then(function(){return X[me].apply(X,re)})}}function $i(){for(var X=1;X<arguments.length;X++){var me=arguments[X];if(me)for(var re in me)me.hasOwnProperty(re)&&(Br(me[re])?arguments[0][re]=me[re].slice():arguments[0][re]=me[re])}return arguments[0]}var _a=function(){function X(me){o(this,X);for(var re in ei)if(ei.hasOwnProperty(re)){var Ee=ei[re],be=Ee._driver;this[re]=be,Zn[be]||this.defineDriver(Ee)}this._defaultConfig=$i({},Fn),this._config=$i({},this._defaultConfig,me),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return X.prototype.config=function(me){if((typeof me>"u"?"undefined":a(me))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var re in me){if(re==="storeName"&&(me[re]=me[re].replace(/\W/g,"_")),re==="version"&&typeof me[re]!="number")return new Error("Database version must be a number.");this._config[re]=me[re]}return"driver"in me&&me.driver?this.setDriver(this._config.driver):!0}else return typeof me=="string"?this._config[me]:this._config},X.prototype.defineDriver=function(me,re,Ee){var be=new d(function(Oe,Je){try{var ft=me._driver,Qe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver){Je(Qe);return}for(var Ge=oi.concat("_initStorage"),ht=0,Vt=Ge.length;ht<Vt;ht++){var Tr=Ge[ht],Wr=!gn(Ii,Tr);if((Wr||me[Tr])&&typeof me[Tr]!="function"){Je(Qe);return}}var jr=function(){for(var qr=function(he){return function(){var Se=new Error("Method "+he+" is not implemented by the current driver"),Ce=d.reject(Se);return g(Ce,arguments[arguments.length-1]),Ce}},P=0,D=Ii.length;P<D;P++){var W=Ii[P];me[W]||(me[W]=qr(W))}};jr();var _n=function(qr){Zn[ft]&&console.info("Redefining LocalForage driver: "+ft),Zn[ft]=me,Si[ft]=qr,Oe()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(_n,Je):_n(!!me._support):_n(!0)}catch(qr){Je(qr)}});return m(be,re,Ee),be},X.prototype.driver=function(){return this._driver||null},X.prototype.getDriver=function(me,re,Ee){var be=Zn[me]?d.resolve(Zn[me]):d.reject(new Error("Driver not found."));return m(be,re,Ee),be},X.prototype.getSerializer=function(me){var re=d.resolve(Yr);return m(re,me),re},X.prototype.ready=function(me){var re=this,Ee=re._driverSet.then(function(){return re._ready===null&&(re._ready=re._initDriver()),re._ready});return m(Ee,me,me),Ee},X.prototype.setDriver=function(me,re,Ee){var be=this;Br(me)||(me=[me]);var Oe=this._getSupportedDrivers(me);function Je(){be._config.driver=be.driver()}function ft(ht){return be._extend(ht),Je(),be._ready=be._initStorage(be._config),be._ready}function Qe(ht){return function(){var Vt=0;function Tr(){for(;Vt<ht.length;){var Wr=ht[Vt];return Vt++,be._dbInfo=null,be._ready=null,be.getDriver(Wr).then(ft).catch(Tr)}Je();var jr=new Error("No available storage method found.");return be._driverSet=d.reject(jr),be._driverSet}return Tr()}}var Ge=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=Ge.then(function(){var ht=Oe[0];return be._dbInfo=null,be._ready=null,be.getDriver(ht).then(function(Vt){be._driver=Vt._driver,Je(),be._wrapLibraryMethodsWithReady(),be._initDriver=Qe(Oe)})}).catch(function(){Je();var ht=new Error("No available storage method found.");return be._driverSet=d.reject(ht),be._driverSet}),m(this._driverSet,re,Ee),this._driverSet},X.prototype.supports=function(me){return!!Si[me]},X.prototype._extend=function(me){$i(this,me)},X.prototype._getSupportedDrivers=function(me){for(var re=[],Ee=0,be=me.length;Ee<be;Ee++){var Oe=me[Ee];this.supports(Oe)&&re.push(Oe)}return re},X.prototype._wrapLibraryMethodsWithReady=function(){for(var me=0,re=oi.length;me<re;me++)ra(this,oi[me])},X.prototype.createInstance=function(me){return new X(me)},X}(),as=new _a;n.exports=as},{3:3}]},{},[4])(4)})}),qje=jse((t,e)=>{(function(r,n){typeof t=="object"&&typeof e<"u"?n(t):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],n):n(r.LocalforageDriverMemory={})})(typeof self<"u"?self:t,function(r){var n="localforage-driver-memory";function i(F){var j=typeof Symbol=="function"&&F[Symbol.iterator],z=0;return j?j.call(F):{next:function(){return F&&z>=F.length&&(F=void 0),{value:F&&F[z++],done:!F}}}}function a(F,j){F=F||[],j=j||{};try{return new Blob(F,j)}catch(k){if(k.name!=="TypeError")throw k;for(var z=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,$=new z,H=0;H<F.length;H+=1)$.append(F[H]);return $.getBlob(j.type)}}var o=/^~~local_forage_type~([^~]+)~/,s=9,c=s+4,u=Object.prototype.toString;function f(F){var j=F.length*.75,z=F.length;F[F.length-1]==="="&&(j--,F[F.length-2]==="="&&j--);for(var $=new ArrayBuffer(j),H=new Uint8Array($),k=0,M=0;k<z;k+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k]),ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+1]),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+2]),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+3]);H[M++]=G<<2|ge>>4,H[M++]=(ge&15)<<4|Q>>2,H[M++]=(Q&3)<<6|te&63}return $}function d(F){for(var j=new Uint8Array(F),z="",$=0;$<j.length;$+=3)z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$]>>2],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$]&3)<<4|j[$+1]>>4],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$+1]&15)<<2|j[$+2]>>6],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$+2]&63];return j.length%3===2?z=z.substring(0,z.length-1)+"=":j.length%3===1&&(z=z.substring(0,z.length-2)+"=="),z}function g(F,j){var z="";if(F&&(z=u.call(F)),F&&(z==="[object ArrayBuffer]"||F.buffer&&u.call(F.buffer)==="[object ArrayBuffer]")){var $=void 0,H="__lfsc__:";F instanceof ArrayBuffer?($=F,H+="arbf"):($=F.buffer,z==="[object Int8Array]"?H+="si08":z==="[object Uint8Array]"?H+="ui08":z==="[object Uint8ClampedArray]"?H+="uic8":z==="[object Int16Array]"?H+="si16":z==="[object Uint16Array]"?H+="ur16":z==="[object Int32Array]"?H+="si32":z==="[object Uint32Array]"?H+="ui32":z==="[object Float32Array]"?H+="fl32":z==="[object Float64Array]"?H+="fl64":j(new Error("Failed to get type for BinaryArray"))),j(H+d($))}else if(z==="[object Blob]"){var k=new FileReader;k.onload=function(){var M="~~local_forage_type~"+F.type+"~"+d(this.result);j("__lfsc__:blob"+M)},k.readAsArrayBuffer(F)}else try{j(JSON.stringify(F))}catch(M){console.error("Couldn't convert value into a JSON string: ",F),j(null,M)}}function m(F){if(F.substring(0,s)!=="__lfsc__:")return JSON.parse(F);var j=F.substring(c),z=F.substring(s,c),$;if(z==="blob"&&o.test(j)){var H=j.match(o);$=H[1],j=j.substring(H[0].length)}var k=f(j);switch(z){case"arbf":return k;case"blob":return a([k],{type:$});case"si08":return new Int8Array(k);case"ui08":return new Uint8Array(k);case"uic8":return new Uint8ClampedArray(k);case"si16":return new Int16Array(k);case"ur16":return new Uint16Array(k);case"si32":return new Int32Array(k);case"ui32":return new Uint32Array(k);case"fl32":return new Float32Array(k);case"fl64":return new Float64Array(k);default:throw new Error("Unkown type: "+z)}}function w(F){var j,z;if(F===null||typeof F!="object"||"isActiveClone"in F)return F;var $=F instanceof Date?new Date(F):F.constructor();try{for(var H=i(Object.keys(F)),k=H.next();!k.done;k=H.next()){var M=k.value;Object.prototype.hasOwnProperty.call(F,M)&&(F.isActiveClone=null,$[M]=w(F[M]),delete F.isActiveClone)}}catch(G){j={error:G}}finally{try{k&&!k.done&&(z=H.return)&&z.call(H)}finally{if(j)throw j.error}}return $}function v(F,j){return(F.name||j.name)+"/"+(F.storeName||j.storeName)+"/"}function y(F,j){j&&F.then(function(z){j(null,z)},function(z){j(z)})}function _(){for(var F=[],j=0;j<arguments.length;j++)F[j]=arguments[j];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function b(F,j){var z=this;if(j=_.apply(this,arguments),F=typeof F!="function"&&F||{},!F.name){var $=this.config();F.name=F.name||$.name,F.storeName=F.storeName||$.storeName}var H;return F.name?H=new Promise(function(k){F.storeName?k(v(F,z._defaultConfig)):k(F.name+"/")}):H=Promise.reject("Invalid arguments"),{promise:H,callback:j}}function A(F){return typeof F!="string"&&(console.warn(F+" used as a key, but it is not a string."),F=String(F)),F}var x={bufferToString:d,deserialize:m,serialize:g,stringToBuffer:f},O={},E=function(){function F(j){this.kp=j,this.data={}}return F.resolve=function(j){return O[j]||(O[j]=new F(j)),O[j]},F.prototype.clear=function(){this.data={}},F.prototype.drop=function(){this.clear(),delete O[this.kp]},F.prototype.get=function(j){return this.data[j]},F.prototype.key=function(j){return this.keys()[j]},F.prototype.keys=function(){return Object.keys(this.data)},F.prototype.rm=function(j){delete this.data[j]},F.prototype.set=function(j,z){this.data[j]=z},F}();function p(F){var j=F?w(F):{},z=v(j,this._defaultConfig),$=E.resolve(z);return this._dbInfo=j,this._dbInfo.serializer=x,this._dbInfo.keyPrefix=z,this._dbInfo.mStore=$,Promise.resolve()}function I(F){var j=this,z=this.ready().then(function(){j._dbInfo.mStore.clear()});return y(z,F),z}function C(F,j){var z=b.apply(this,arguments),$=z.promise,H=z.callback,k=$.then(function(M){E.resolve(M).drop()});return y(k,H),$}function L(F,j){var z=this;F=A(F);var $=this.ready().then(function(){var H=z._dbInfo.mStore.get(F);return H==null?null:z._dbInfo.serializer.deserialize(H)});return y($,j),$}function q(F,j){var z=this,$=this.ready().then(function(){for(var H=z._dbInfo.mStore,k=H.keys(),M=0;M<k.length;M++){var G=H.get(k[M]);if(G&&(G=z._dbInfo.serializer.deserialize(G)),G=F(G,k[M],M+1),G!==void 0)return G}});return y($,j),$}function le(F,j){var z=this,$=this.ready().then(function(){var H;try{H=z._dbInfo.mStore.key(F),H===void 0&&(H=null)}catch{H=null}return H});return y($,j),$}function pe(F){var j=this,z=this.ready().then(function(){return j._dbInfo.mStore.keys()});return y(z,F),z}function B(F){var j=this.keys().then(function(z){return z.length});return y(j,F),j}function U(F,j){var z=this;F=A(F);var $=this.ready().then(function(){z._dbInfo.mStore.rm(F)});return y($,j),$}function K(F,j,z){var $=this;F=A(F);var H=this.ready().then(function(){j===void 0&&(j=null);var k=j;return new Promise(function(M,G){$._dbInfo.serializer.serialize(j,function(ge,Q){if(Q)G(Q);else try{$._dbInfo.mStore.set(F,ge),M(k)}catch(te){G(te)}})})});return y(H,z),H}var ne=!0;r._support=ne,r._driver=n,r._initStorage=p,r.clear=I,r.dropInstance=C,r.getItem=L,r.iterate=q,r.key=le,r.keys=pe,r.length=B,r.removeItem=U,r.setItem=K,Object.defineProperty(r,"__esModule",{value:!0})})}),FN=qse(jje()),UY=qse(qje()),Hje={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function zje(t){for(let[e,r]of Object.entries(Hje))t.style[e]=r}function Vje(t){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(r=>r.src.includes(t))}var Gje=class extends $je{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(t=>{let e=()=>{if(Vje(encodeURIComponent(this.parameters)))KFe().log();else{let r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=JA(this.endpoint).host,r.title="Secure Modal",r.src=JA(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,zje(r),document.body.appendChild(r),t(r)}};["loaded","interactive","complete"].includes(document.readyState)?e():window.addEventListener("load",e,!1)}),window.addEventListener("message",t=>{var e;if(t.origin===this.endpoint&&t.data&&t.data.msgType&&this.messageHandlers.size){t.data.response=(e=t.data.response)!=null?e:{};for(let r of this.messageHandlers.values())r(t)}})}showOverlay(){return Tx(this,null,function*(){let t=yield this.iframe;t.style.display="block",this.activeElement=document.activeElement,t.focus()})}hideOverlay(){return Tx(this,null,function*(){var t;let e=yield this.iframe;e.style.display="none",(t=this.activeElement)!=null&&t.focus&&this.activeElement.focus(),this.activeElement=null})}_post(t){return Tx(this,null,function*(){let e=yield this.iframe;if(e&&e.contentWindow)e.contentWindow.postMessage(t,this.endpoint);else throw xse()})}},Wje=jFe(Bse,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:Gje,configureStorage:()=>Tx(void 0,null,function*(){let t=FN.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(UY),yield t.setDriver([FN.default.INDEXEDDB,FN.default.LOCALSTORAGE,UY._driver]),t})});const Xk=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:fse,DeviceVerificationEventEmit:KA,DeviceVerificationEventOnReceived:gse,EthChainType:yse,Events:Vb,Extension:Xh,ExtensionError:zk,ExtensionWarning:O5,LoginWithEmailOTPEventEmit:G0,LoginWithEmailOTPEventOnReceived:pse,LoginWithMagicLinkEventEmit:dse,LoginWithMagicLinkEventOnReceived:hse,Magic:Wje,MagicIncomingWindowMessage:Ah,MagicOutgoingWindowMessage:R1,MagicPayloadMethod:vr,RPCError:N1,RPCErrorCode:pO,RecoveryMethodType:mse,SDKError:Id,SDKErrorCode:Od,SDKWarning:Uw,SDKWarningCode:um,Wallets:_s,isPromiEvent:Tse},Symbol.toStringTag,{value:"Module"})),Kje=uo(Xk);var Hse={exports:{}},jN={exports:{}},BY;function zse(){return BY||(BY=1,function(t,e){(function(r,n){t.exports=n()})(Ne,function(){var r=r||function(n,i){var a=Object.create||function(){function y(){}return function(_){var b;return y.prototype=_,b=new y,y.prototype=null,b}}(),o={},s=o.lib={},c=s.Base=function(){return{extend:function(y){var _=a(this);return y&&_.mixIn(y),(!_.hasOwnProperty("init")||this.init===_.init)&&(_.init=function(){_.$super.init.apply(this,arguments)}),_.init.prototype=_,_.$super=this,_},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var _ in y)y.hasOwnProperty(_)&&(this[_]=y[_]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=s.WordArray=c.extend({init:function(y,_){y=this.words=y||[],_!=i?this.sigBytes=_:this.sigBytes=y.length*4},toString:function(y){return(y||d).stringify(this)},concat:function(y){var _=this.words,b=y.words,A=this.sigBytes,x=y.sigBytes;if(this.clamp(),A%4)for(var O=0;O<x;O++){var E=b[O>>>2]>>>24-O%4*8&255;_[A+O>>>2]|=E<<24-(A+O)%4*8}else for(var O=0;O<x;O+=4)_[A+O>>>2]=b[O>>>2];return this.sigBytes+=x,this},clamp:function(){var y=this.words,_=this.sigBytes;y[_>>>2]&=4294967295<<32-_%4*8,y.length=n.ceil(_/4)},clone:function(){var y=c.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var _=[],b=function(p){var p=p,I=987654321,C=4294967295;return function(){I=36969*(I&65535)+(I>>16)&C,p=18e3*(p&65535)+(p>>16)&C;var L=(I<<16)+p&C;return L/=4294967296,L+=.5,L*(n.random()>.5?1:-1)}},A=0,x;A<y;A+=4){var O=b((x||n.random())*4294967296);x=O()*987654071,_.push(O()*4294967296|0)}return new u.init(_,y)}}),f=o.enc={},d=f.Hex={stringify:function(y){for(var _=y.words,b=y.sigBytes,A=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;A.push((O>>>4).toString(16)),A.push((O&15).toString(16))}return A.join("")},parse:function(y){for(var _=y.length,b=[],A=0;A<_;A+=2)b[A>>>3]|=parseInt(y.substr(A,2),16)<<24-A%8*4;return new u.init(b,_/2)}},g=f.Latin1={stringify:function(y){for(var _=y.words,b=y.sigBytes,A=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;A.push(String.fromCharCode(O))}return A.join("")},parse:function(y){for(var _=y.length,b=[],A=0;A<_;A++)b[A>>>2]|=(y.charCodeAt(A)&255)<<24-A%4*8;return new u.init(b,_)}},m=f.Utf8={stringify:function(y){try{return decodeURIComponent(escape(g.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return g.parse(unescape(encodeURIComponent(y)))}},w=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var _=this._data,b=_.words,A=_.sigBytes,x=this.blockSize,O=x*4,E=A/O;y?E=n.ceil(E):E=n.max((E|0)-this._minBufferSize,0);var p=E*x,I=n.min(p*4,A);if(p){for(var C=0;C<p;C+=x)this._doProcessBlock(b,C);var L=b.splice(0,p);_.sigBytes-=I}return new u.init(L,I)},clone:function(){var y=c.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});s.Hasher=w.extend({cfg:c.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var _=this._doFinalize();return _},blockSize:16,_createHelper:function(y){return function(_,b){return new y.init(b).finalize(_)}},_createHmacHelper:function(y){return function(_,b){return new v.HMAC.init(y,b).finalize(_)}}});var v=o.algo={};return o}(Math);return r})}(jN)),jN.exports}(function(t,e){(function(r,n){t.exports=n(zse())})(Ne,function(r){return function(n){var i=r,a=i.lib,o=a.WordArray,s=a.Hasher,c=i.algo,u=[],f=[];(function(){function m(_){for(var b=n.sqrt(_),A=2;A<=b;A++)if(!(_%A))return!1;return!0}function w(_){return(_-(_|0))*4294967296|0}for(var v=2,y=0;y<64;)m(v)&&(y<8&&(u[y]=w(n.pow(v,1/2))),f[y]=w(n.pow(v,1/3)),y++),v++})();var d=[],g=c.SHA256=s.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(m,w){for(var v=this._hash.words,y=v[0],_=v[1],b=v[2],A=v[3],x=v[4],O=v[5],E=v[6],p=v[7],I=0;I<64;I++){if(I<16)d[I]=m[w+I]|0;else{var C=d[I-15],L=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,q=d[I-2],le=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;d[I]=L+d[I-7]+le+d[I-16]}var pe=x&O^~x&E,B=y&_^y&b^_&b,U=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),K=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),ne=p+K+pe+f[I]+d[I],F=U+B;p=E,E=O,O=x,x=A+ne|0,A=b,b=_,_=y,y=ne+F|0}v[0]=v[0]+y|0,v[1]=v[1]+_|0,v[2]=v[2]+b|0,v[3]=v[3]+A|0,v[4]=v[4]+x|0,v[5]=v[5]+O|0,v[6]=v[6]+E|0,v[7]=v[7]+p|0},_doFinalize:function(){var m=this._data,w=m.words,v=this._nDataBytes*8,y=m.sigBytes*8;return w[y>>>5]|=128<<24-y%32,w[(y+64>>>9<<4)+14]=n.floor(v/4294967296),w[(y+64>>>9<<4)+15]=v,m.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});i.SHA256=s._createHelper(g),i.HmacSHA256=s._createHmacHelper(g)}(Math),r.SHA256})})(Hse);var Yje=Hse.exports;const Qje=Dc(Yje);var Vse={exports:{}};(function(t,e){(function(r,n){t.exports=n(zse())})(Ne,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,o=n.enc;o.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var g=[],m=0;m<f;m+=3)for(var w=u[m>>>2]>>>24-m%4*8&255,v=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,_=w<<16|v<<8|y,b=0;b<4&&m+b*.75<f;b++)g.push(d.charAt(_>>>6*(3-b)&63));var A=d.charAt(64);if(A)for(;g.length%4;)g.push(A);return g.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var g=0;g<f.length;g++)d[f.charCodeAt(g)]=g}var m=f.charAt(64);if(m){var w=c.indexOf(m);w!==-1&&(u=w)}return s(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(c,u,f){for(var d=[],g=0,m=0;m<u;m++)if(m%4){var w=f[c.charCodeAt(m-1)]<<m%4*2,v=f[c.charCodeAt(m)]>>>6-m%4*2;d[g>>>2]|=(w|v)<<24-g%4*8,g++}return a.create(d,g)}}(),r.enc.Base64})})(Vse);var Jje=Vse.exports;const Xje=Dc(Jje);var Bw=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),Gse=(t=>(t.ParseRedirectResult="magic_oauth_parse_redirect_result",t))(Gse||{}),Wse=(t=>(t.InvalidRequest="invalid_request",t.InvalidClient="invalid_client",t.InvalidScope="invalid_scope",t.InvalidGrant="invalid_grant",t.UnauthorizedClient="unauthorized_client",t.UnsupportedResponseType="unsupported_response_type",t.UnsupportedGrantType="unsupported_grant_type",t.UnsupportedTokenType="unsupported_token_type",t.AccessDenied="access_denied",t.ServerError="server_error",t.TemporarilyUnavailable="temporarily_unavailable",t))(Wse||{}),FY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",Kse=typeof window<"u"&&!!window.crypto,Zje=Kse&&!!window.crypto.subtle;function eqe(t){return Array.from(t).map(e=>FY[e%FY.length]).join("")}function jY(t){let e=r=>r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");if(t instanceof ArrayBuffer){let r=new Uint8Array(t),n=Array.from(r).map(a=>String.fromCharCode(a)).join(""),i=btoa(n);return e(i)}return e(Xje.stringify(t))}function tqe(t){return Bw(this,null,function*(){if(Zje){let e=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",e).then(jY)}return jY(Qje(t))})}function qY(t){let e=new Uint8Array(t);if(Kse)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.floor(Math.random()*Math.floor(255));return eqe(e)}function rqe(){return Bw(this,null,function*(){let t=qY(128),e=qY(128),r=yield tqe(e);return{verifier:e,challenge:r,state:t}})}var nqe=class extends Xh.Internal{constructor(){super(...arguments),this.name="oauth",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1}}loginWithRedirect(t){return this.utils.createPromiEvent(e=>Bw(this,null,function*(){let{provider:r,query:n}=yield iqe.call(this,t);window.location.href=new URL(`/v1/oauth2/${r}/start?${n}`,this.sdk.endpoint).href,e()}))}getRedirectResult(){let t=window.location.search,e=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",e),aqe.call(this,t)}},XA="oauth_redirect_metadata";function iqe(t){return Bw(this,null,function*(){yield this.utils.storage.removeItem(XA);let{provider:e,redirectURI:r,scope:n,loginHint:i}=t,{verifier:a,challenge:o,state:s}=yield rqe(),c=JSON.stringify({verifier:a,state:s});return yield this.utils.storage.setItem(XA,c),{query:[`magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`,`magic_challenge=${encodeURIComponent(o)}`,`state=${encodeURIComponent(s)}`,`platform=${encodeURIComponent("web")}`,n&&`scope=${encodeURIComponent(n.join(" "))}`,r&&`redirect_uri=${encodeURIComponent(r)}`,i&&`login_hint=${encodeURIComponent(i)}`].reduce((u,f)=>f?`${u}&${f}`:u),provider:e,redirectURI:r}})}function aqe(t){return this.utils.createPromiEvent((e,r)=>Bw(this,null,function*(){var n;let i=yield this.utils.storage.getItem(XA),{verifier:a,state:o}=JSON.parse(i);this.utils.storage.removeItem(XA);let s=this.utils.createJsonRpcRequestPayload("magic_oauth_parse_redirect_result",[t,a,o]),c=yield this.request(s),u=c,f=c;f.error&&r(this.createError(f.error,(n=f.error_description)!=null?n:"An error occurred.",{errorURI:f.error_uri,provider:f.provider})),e(u)}))}const Zk=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:Wse,OAuthExtension:nqe,OAuthPayloadMethods:Gse},Symbol.toStringTag,{value:"Module"})),oqe=uo(Zk);var sqe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cqe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),HY=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sqe(e,t,r);return cqe(e,t),e};Object.defineProperty(hO,"__esModule",{value:!0});hO.MagicConnector=void 0;const zY=Ml,VY=qs,uqe=jS;class lqe extends uqe.AbstractConnector{constructor(e){super({supportedChainIds:VY.getConfiguration()[zY.ProviderType.MAGIC].chains}),this.activate=async()=>{var r;if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const i=await this.getProvider(),a=await i.request({method:"eth_accounts"});return this.account=(r=a[0])!==null&&r!==void 0?r:null,{provider:i,chainId:this.chainId,account:this.account}},this.getProvider=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const r=await this.magic.wallet.getProvider();return Object.assign(Object.assign({},r),{request:new Proxy(r.request,{apply:async(n,i,a)=>{var o,s,c;if(((o=a[0])===null||o===void 0?void 0:o.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(s=a[0])===null||s===void 0?void 0:s.params[0])===null||c===void 0?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return n.bind(r)(...a)}})})},this.getChainId=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId},this.getAccount=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account},this.deactivate=()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");this.magic.user.logout(),this.emitDeactivate()},this.buildMagicInstance=async r=>{const{Magic:n}=await Promise.resolve().then(()=>HY(Kje)),{OAuthExtension:i}=await Promise.resolve().then(()=>HY(oqe)),a=VY.getConfiguration()[zY.ProviderType.MAGIC];return new n(a.apiKey,{extensions:[new i],network:{rpcUrl:a.urls[r],chainId:r}})},this.chainId=e,this.account=null}}hO.MagicConnector=lqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(jS,t),r(HS,t),r(XS,t),r(ZS,t),r(eO,t),r(tO,t),r(hO,t)})(ik);var Yse={},Fw={};Object.defineProperty(Fw,"__esModule",{value:!0});Fw.Storage=void 0;class fqe{}Fw.Storage=fqe;var vO={};Object.defineProperty(vO,"__esModule",{value:!0});vO.LocalStorage=void 0;const dqe=Fw;class hqe extends dqe.Storage{get(e){const r=window.localStorage.getItem(e);return r===null?void 0:r}set(e,r){window.localStorage.setItem(e,r)}remove(e){window.localStorage.removeItem(e)}removeRegExp(e){for(let r=localStorage.length-1;r>=0;r--){const n=localStorage.key(r);n&&e.test(n)&&localStorage.removeItem(n)}}}vO.LocalStorage=hqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Fw,t),r(vO,t)})(Yse);var bO={};Object.defineProperty(bO,"__esModule",{value:!0});bO.ProviderAdapter=void 0;class eL{constructor(e){this.provider=e,this.id=0,this.on=(r,n)=>this.provider.on(r,n),this.emit=(r,...n)=>this.provider.emit(r,n),this.removeListener=(r,n)=>this.provider.removeListener(r,n),this.request=async({method:r,params:n})=>this.isModernProvider()?this.provider.request({method:r,params:n}):this.send(r,n),this.sendAsync=async(r,n)=>this.hasSendAsync()?this.provider.sendAsync(r,(i,a)=>{a&&!a.hasOwnProperty("result")?n(i,{id:0,jsonrpc:"2.0",result:a}):n(i,a)}):this.send(r,n)}static adapt(e){const r=new eL(e);return Object.assign(Object.assign({},e),{on:r.on,emit:r.emit,removeListener:r.removeListener,request:r.request,sendAsync:r.sendAsync,send:r.send.bind(r)})}async send(e,r){let n,i,a;const o=typeof r=="function";if(o){const s=e;i=s.params||[],n=s.method,a=r}else n=e,i=r||[],a=(s,c)=>{if(s)throw s;return c};if(this.isModernProvider()){const[s,c]=await this.provider.request({method:n,params:i}).then(f=>[null,f]).catch(f=>[f,void 0]);return a(s,o?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[s,c]=o?await new Promise(u=>this.provider.send(e,(f,d)=>{u([f,d])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:n,params:i},(f,d)=>{u([d&&d.hasOwnProperty("error")?d.error:f,d&&d.hasOwnProperty("result")?d.result:d])}));return a(s,c)}}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}bO.ProviderAdapter=eL;Object.defineProperty(Ty,"__esModule",{value:!0});Ty.connection=Ty.ConnectionManager=void 0;const GY=ns(),Vo=Sc,PE=y4e,ff=ik,pqe=Yse,qN=qs,WY=bO;class Qse{constructor(e){this.storage=e,this.getWalletName=()=>{if(this.connector instanceof ff.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:r}=qN.getConfiguration();this.storage.remove(r),ff.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(PE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(PE.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(e,r=GY.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(e,r),this.connector.on(PE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),e===Vo.ProviderType.MAGIC&&this.connector.on(PE.ConnectorEvent.Update,({chainId:a})=>{a&&this.setConnectionData(e,a)});const{provider:n,account:i}=await this.connector.activate();return this.setConnectionData(e,r),{provider:WY.ProviderAdapter.adapt(n),providerType:e,account:i||"",chainId:r}}async tryPreviousConnection(){const e=this.getConnectionData();if(!e)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const r=await this.connect(e.providerType,e.chainId);if(r.providerType===Vo.ProviderType.INJECTED){const n=await r.provider.request({method:"eth_chainId"}),i=n?parseInt(n,16):null;i&&e.chainId!==i&&this.setConnectionData(e.providerType,i)}return Object.assign(Object.assign({},r),{chainId:this.getConnectionData().chainId})}getAvailableProviders(){const e=[Vo.ProviderType.FORTMATIC,Vo.ProviderType.WALLET_CONNECT,Vo.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?e.unshift(Vo.ProviderType.INJECTED):e.unshift(Vo.ProviderType.METAMASK_MOBILE),e}async disconnect(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async createProvider(e,r=GY.ChainId.ETHEREUM_MAINNET){const i=await this.buildConnector(e,r).getProvider();return WY.ProviderAdapter.adapt(i)}buildConnector(e,r){switch(e){case Vo.ProviderType.INJECTED:return new ff.InjectedConnector(r);case Vo.ProviderType.FORTMATIC:return new ff.FortmaticConnector(r);case Vo.ProviderType.MAGIC:return new ff.MagicConnector(r);case Vo.ProviderType.WALLET_LINK:return new ff.WalletLinkConnector(r);case Vo.ProviderType.NETWORK:return new ff.NetworkConnector(r);case Vo.ProviderType.WALLET_CONNECT_V2:return new ff.WalletConnectV2Connector(r);default:throw new Error(`Invalid provider ${e}`)}}getConnectionData(){const{storageKey:e}=qN.getConfiguration(),r=this.storage.get(e);return r?JSON.parse(r):void 0}setConnectionData(e,r){const{storageKey:n}=qN.getConfiguration(),i=JSON.stringify({providerType:e,chainId:r});this.storage.set(n,i)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}Ty.ConnectionManager=Qse;Ty.connection=new Qse(new pqe.LocalStorage);var Jse={};Object.defineProperty(Jse,"__esModule",{value:!0});(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ty,t),r(ik,t),r(qs,t),r(Jse,t)})(Il);const gqe="https://auth-api.decentraland.zone",yqe={AUTH_SERVER_URL:gqe},mqe="https://auth-api.decentraland.org",vqe={AUTH_SERVER_URL:mqe},bqe="https://auth-api.decentraland.today",wqe={AUTH_SERVER_URL:bqe},_qe=z0.createConfig({[z0.Env.DEVELOPMENT]:yqe,[z0.Env.STAGING]:wqe,[z0.Env.PRODUCTION]:vqe},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});function HN(t){return t!=null&&typeof t=="object"&&"message"in t}const Eqe="_background_1jvtb_1",xqe="_main_1jvtb_9",Aqe="_left_1jvtb_19",Sqe="_right_1jvtb_28",Oqe="_changeAccount_1jvtb_42",Iqe="_errorLogo_1jvtb_48",Pqe="_logo_1jvtb_57",Tqe="_title_1jvtb_63",Rqe="_description_1jvtb_70",Cqe="_code_1jvtb_77",Nqe="_buttons_1jvtb_84",Dqe="_closeWindow_1jvtb_94",$qe="_errorMessage_1jvtb_100",kr={background:Eqe,main:xqe,left:Aqe,right:Sqe,changeAccount:Oqe,errorLogo:Iqe,logo:Pqe,title:Tqe,description:Rqe,code:Cqe,buttons:Nqe,closeWindow:Dqe,errorMessage:$qe},Mqe=()=>{const t=Bye(),e=P2(),[r,n]=ze.useState(2),[i,a]=ze.useState(!1),o=ze.useRef(),[s,c]=ze.useState(),u=ze.useRef(),f=ze.useRef(),d=t.requestId??"",g=ze.useCallback(async()=>new ute(await Il.connection.getProvider()),[]),m=ze.useCallback(()=>{e(`/login?redirectTo=/auth/requests/${d}&fromRequests=true`)},[]);ze.useEffect(()=>((async()=>{try{await Il.connection.tryPreviousConnection()}catch{m();return}try{const x=await zN("recover",{requestId:d});o.current=x;const p=await(await(await g()).getSigner()).getAddress();if(f.current=p,x.sender&&x.sender!==p.toLowerCase()){n(1);return}u.current=setTimeout(()=>{n(0)},new Date(x.expiration).getTime()-Date.now()),x.method==="dcl_personal_sign"?n(4):n(8)}catch(x){c(HN(x)?x.message:"Unknown error"),n(3)}})(),()=>{clearTimeout(u.current)}),[]),ze.useEffect(()=>{r!==4&&r!==8&&clearTimeout(u.current)},[r]);const w=ze.useCallback(()=>{n(5)},[]),v=ze.useCallback(async()=>{a(!0);try{throw new Error("Falopa")}catch(x){c(HN(x)?x.message:"Unknown error"),n(6)}finally{a(!1)}},[g,a]),y=ze.useCallback(()=>{n(9)},[]),_=ze.useCallback(async()=>{a(!0);try{const x=await g(),O=await x.getSigner(),E=await x.send(o.current.method,o.current.params),p=await zN("outcome",{requestId:d,sender:await O.getAddress(),result:E});if(p.error)throw new Error(p.error);n(11)}catch(x){c(HN(x)?x.message:"Unknown error"),n(10)}},[g]),b=ze.useCallback(async()=>{await Il.connection.disconnect(),m()},[]),A=ze.useCallback(x=>Ye.jsxs("div",{children:[Ye.jsx("div",{className:kr.background}),Ye.jsxs("div",{className:kr.main,children:[Ye.jsx("div",{className:kr.left,children:x.children}),Ye.jsx("div",{className:kr.right,children:f.current?Ye.jsxs(Ye.Fragment,{children:[Ye.jsx(rae,{lockBeta:!0,panning:!1,disableBackground:!0,profile:f.current,dev:!1}),x.canChangeAccount?Ye.jsx("div",{className:kr.changeAccount,children:Ye.jsx(xc.Button,{disabled:i,inverted:!0,onClick:b,children:"Change Account"})}):null]}):null})]})]}),[]);return r===0?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Looks like you took too long and the request has expired"}),Ye.jsx("div",{className:kr.description,children:"Please return to Decentraland's Desktop App to try again."}),Ye.jsx(nh,{})]}):r===1?Ye.jsxs(A,{canChangeAccount:!0,children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Looks like you are connected with a different account."}),Ye.jsx("div",{className:kr.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):r===2?Ye.jsx(A,{children:Ye.jsx("div",{className:kr.left,children:Ye.jsx(AS,{active:!0,size:"huge"})})}):r===3?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"There was an error recovering the request..."}),Ye.jsx("div",{className:kr.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),Ye.jsx(nh,{}),Ye.jsx("div",{className:kr.errorMessage,children:s})]}):r===4&&o.current?Ye.jsxs(A,{canChangeAccount:!0,isLoading:i,children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"Verify Sign In"}),Ye.jsx("div",{className:kr.description,children:"Do you see the same verification number on your Desktop App?"}),Ye.jsx("div",{className:kr.code,children:o.current.code}),Ye.jsxs("div",{className:kr.buttons,children:[Ye.jsx(xc.Button,{inverted:!0,disabled:i,onClick:w,children:"No"}),Ye.jsx(xc.Button,{primary:!0,loading:i,disabled:i,onClick:v,children:"Yes, they are the same"})]})]}):r===5?Ye.jsxs(A,{canChangeAccount:!0,children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Did the number not match, or was this action not taken by you?"}),Ye.jsx("div",{className:kr.description,children:"If you're trying to sign in, retry the action. If this action was not initiated by you, dismiss this message."}),Ye.jsx(nh,{})]}):r===7?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"Your account is ready!"}),Ye.jsx("div",{className:kr.description,children:"Return to the Desktop App and enjoy Decentraland."}),Ye.jsx(nh,{})]}):r===8&&o.current?Ye.jsxs(A,{canChangeAccount:!0,isLoading:i,children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"The Desktop App wants to interact with your wallet."}),Ye.jsx("div",{className:kr.description,children:"Review the following data carefully on your wallet before approving it."}),Ye.jsxs("div",{className:kr.buttons,children:[Ye.jsx(xc.Button,{inverted:!0,disabled:i,onClick:y,children:"Deny"}),Ye.jsx(xc.Button,{primary:!0,disabled:i,loading:i,onClick:_,children:"Allow"})]})]}):r===9?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Was this action not initiated by you?"}),Ye.jsx("div",{className:kr.description,children:"If this action was not initiated by you, dismiss this message."}),Ye.jsx(nh,{})]}):r===11?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"Wallet interaction complete"}),Ye.jsx("div",{className:kr.description,children:"The action has been executed successfully."}),Ye.jsx(nh,{})]}):r===6||r===10?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"There was an error while trying to submit the request."}),Ye.jsx("div",{className:kr.description,children:"Return to the Desktop App to try again, or contact support if the error persists."}),Ye.jsx(nh,{}),Ye.jsx("div",{className:kr.errorMessage,children:s})]}):null},nh=()=>Ye.jsx("div",{className:kr.closeWindow,children:"You can close this window."}),zN=async(t,e)=>{const r=_qe.get("AUTH_SERVER_URL"),n=sx(r);await new Promise(a=>{n.on("connect",a)});const i=await n.emitWithAck(t,e);if(n.close(),i.error)throw new Error(i.error);return i},kqe=()=>{const t=P2(),e=lw(),r=ze.useCallback(async()=>{try{const n=await Il.connection.tryPreviousConnection();return!!(n.account&&n.provider)}catch{return!1}},[]);return ze.useEffect(()=>{r().then(n=>{n?window.location.href="/":t({pathname:"/login",search:e.search})})},[r,t]),Ye.jsx(AS,{active:!0,size:"huge"})},Xse=()=>{const t=lw(),r=new URLSearchParams(t.search).get("redirectTo"),n=r?decodeURIComponent(r):null;if(n!==null)try{let i;return n.startsWith("/")?i=new URL(n,window.location.origin):i=new URL(n),i.hostname!==window.location.hostname?void 0:i.href}catch{console.error("Can't parse redirectTo URL");return}};var wO={},_O=br;wO.__esModule=!0;var EO=wO.default=void 0,Lqe=_O(Bn()),Uqe=_O(ii);_O(Ln());var Bqe=_O(ze),N0=Wn();function lp(t){var e=t.children,r=t.className,n=t.content,i=t.image,a=t.scrolling,o=(0,Uqe.default)(r,(0,N0.useKeyOnly)(i,"image"),(0,N0.useKeyOnly)(a,"scrolling"),"content"),s=(0,N0.getUnhandledProps)(lp,t),c=(0,N0.getElementType)(lp,t);return Bqe.default.createElement(c,(0,Lqe.default)({},s,{className:o}),N0.childrenUtils.isNil(e)?n:e)}lp.handledProps=["as","children","className","content","image","scrolling"];lp.propTypes={};lp.create=(0,N0.createShorthandFactory)(lp,function(t){return{content:t}});var Fqe=lp;EO=wO.default=Fqe;var xO={},AO={},VN,KY;function jqe(){if(KY)return VN;KY=1;function t(e,r,n,i){var a=-1,o=e==null?0:e.length;for(i&&o&&(n=e[++a]);++a<o;)n=r(n,e[a],a,e);return n}return VN=t,VN}var GN,YY;function qqe(){if(YY)return GN;YY=1;function t(e,r,n,i,a){return a(e,function(o,s,c){n=i?(i=!1,o):r(n,o,s,c)}),n}return GN=t,GN}var WN,QY;function Zse(){if(QY)return WN;QY=1;var t=jqe(),e=_w(),r=wd(),n=qqe(),i=Di();function a(o,s,c){var u=i(o)?t:n,f=arguments.length<3;return u(o,r(s,4),c,f,e)}return WN=a,WN}var KN,JY;function ece(){return JY||(JY=1,KN=function(e,r,n,i){var a=n?n.call(i,e,r):void 0;if(a!==void 0)return!!a;if(e===r)return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var o=Object.keys(e),s=Object.keys(r);if(o.length!==s.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<o.length;u++){var f=o[u];if(!c(f))return!1;var d=e[f],g=r[f];if(a=n?n.call(i,d,g,f):void 0,a===!1||a===void 0&&d!==g)return!1}return!0}),KN}var TE={},XY;function Hqe(){if(XY)return TE;XY=1;var t=br;TE.__esModule=!0;var e=t(_S());return TE.default=e.default,TE}var Bv={},RE={},ZY;function zqe(){if(ZY)return RE;ZY=1;var t=br;RE.__esModule=!0;var e=t(K$());return RE.default=e.default,RE}var eQ;function Vqe(){if(eQ)return Bv;eQ=1;var t=Ws,e=br;Bv.__esModule=!0,Bv.default=void 0;var r=e(Bn()),n=e(Mc()),i=e(wS()),a=e(Ks()),o=e(ii);e(Ln());var s=t(ze),c=Wn(),u=e(zqe()),f=function(d){(0,n.default)(g,d);function g(){for(var w,v=arguments.length,y=new Array(v),_=0;_<v;_++)y[_]=arguments[_];return w=d.call.apply(d,[this].concat(y))||this,w.handleButtonOverrides=function(b){return{onClick:function(x,O){(0,a.default)(b,"onClick",x,O),(0,a.default)(w.props,"onActionClick",x,O)}}},w}var m=g.prototype;return m.render=function(){var v=this,y=this.props,_=y.actions,b=y.children,A=y.className,x=y.content,O=(0,o.default)("actions",A),E=(0,c.getUnhandledProps)(g,this.props),p=(0,c.getElementType)(g,this.props);return c.childrenUtils.isNil(b)?c.childrenUtils.isNil(x)?s.default.createElement(p,(0,r.default)({},E,{className:O}),(0,i.default)(_,function(I){return u.default.create(I,{overrideProps:v.handleButtonOverrides})})):s.default.createElement(p,(0,r.default)({},E,{className:O}),x):s.default.createElement(p,(0,r.default)({},E,{className:O}),b)},g}(s.Component);return Bv.default=f,f.handledProps=["actions","as","children","className","content","onActionClick"],f.propTypes={},f.create=(0,c.createShorthandFactory)(f,function(d){return{actions:d}}),Bv}var Fv={},tQ;function Gqe(){if(tQ)return Fv;tQ=1;var t=br;Fv.__esModule=!0,Fv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("description",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={};var o=a;return Fv.default=o,Fv}var jv={},rQ;function Wqe(){if(rQ)return jv;rQ=1;var t=br;jv.__esModule=!0,jv.default=void 0;var e=t(Bn()),r=vd,n=t(ii);t(Ln());var i=t(ze),a=Wn();function o(c){var u=c.blurring,f=c.children,d=c.className,g=c.centered,m=c.content,w=c.inverted,v=c.mountNode,y=c.scrolling,_=i.default.useRef(),b=(0,n.default)("ui",(0,a.useKeyOnly)(w,"inverted"),(0,a.useKeyOnly)(!g,"top aligned"),"page modals dimmer transition visible active",d),A=(0,n.default)("dimmable dimmed",(0,a.useKeyOnly)(u,"blurring"),(0,a.useKeyOnly)(y,"scrolling")),x=(0,a.getUnhandledProps)(o,c),O=(0,a.getElementType)(o,c);return(0,a.useClassNamesOnNode)(v,A),i.default.useEffect(function(){_.current&&_.current.style&&_.current.style.setProperty("display","flex","important")},[]),i.default.createElement(r.Ref,{innerRef:_},i.default.createElement(O,(0,e.default)({},x,{className:b}),a.childrenUtils.isNil(f)?m:f))}o.handledProps=["as","blurring","centered","children","className","content","inverted","mountNode","scrolling"],o.propTypes={},o.create=(0,a.createShorthandFactory)(o,function(c){return{content:c}});var s=o;return jv.default=s,jv}var qv={},nQ;function Kqe(){if(nQ)return qv;nQ=1;var t=br;qv.__esModule=!0,qv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("header",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(s){return{content:s}});var o=a;return qv.default=o,qv}var Gu={},iQ;function Yqe(){if(iQ)return Gu;iQ=1,Gu.__esModule=!0,Gu.isLegacy=Gu.getLegacyStyles=Gu.canFit=void 0;var t=0,e=50,r=function(o){var s=o.height+t,c=o.height+t,u=window.innerHeight,f=u/2,d=-(c/2),g=e,m=f+d;return m+s+g<u};Gu.canFit=r;var n=function(o,s,c){var u=s&&o?-(c.height/2):0,f=-(c.width/2);return{marginLeft:f,marginTop:u}};Gu.getLegacyStyles=n;var i=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return Gu.isLegacy=i,Gu}var Qqe=Ws,ta=br;AO.__esModule=!0;AO.default=void 0;var v0=ta(Bn()),Jqe=ta(Mc()),Xqe=ta(bS()),Zqe=ta(H$()),eHe=ta(V$()),tHe=ta(Zse()),rHe=ta(Pre()),df=ta(Ks()),aQ=vd,nHe=ta(ii);ta(Ln());var Wu=Qqe(ze),iHe=ta(ece()),Pa=Wn(),aHe=ta(Hqe()),oQ=ta(W$()),tce=ta(Vqe()),rce=ta(wO),oHe=ta(Gqe()),nce=ta(Wqe()),ice=ta(Kqe()),YN=Yqe(),Iu=function(t){(0,Jqe.default)(e,t);function e(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a))||this,n.legacy=(0,Pa.isBrowser)()&&(0,YN.isLegacy)(),n.ref=(0,Wu.createRef)(),n.dimmerRef=(0,Wu.createRef)(),n.latestDocumentMouseDownEvent=null,n.getMountNode=function(){return(0,Pa.isBrowser)()?n.props.mountNode||document.body:null},n.handleActionsOverrides=function(s){return{onActionClick:function(u,f){(0,df.default)(s,"onActionClick",u,f),(0,df.default)(n.props,"onActionClick",u,n.props),n.handleClose(u)}}},n.handleClose=function(s){n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1}))},n.handleDocumentMouseDown=function(s){n.latestDocumentMouseDownEvent=s},n.handleDocumentClick=function(s){var c=n.props.closeOnDimmerClick,u=n.latestDocumentMouseDownEvent;n.latestDocumentMouseDownEvent=null,!(!c||(0,Pa.doesNodeContainClick)(n.ref.current,u)||(0,Pa.doesNodeContainClick)(n.ref.current,s))&&(n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1})))},n.handleIconOverrides=function(s){return{onClick:function(u){(0,df.default)(s,"onClick",u),n.handleClose(u)}}},n.handleOpen=function(s){(0,df.default)(n.props,"onOpen",s,(0,v0.default)({},n.props,{open:!0})),n.setState({open:!0})},n.handlePortalMount=function(s){var c=n.props.eventPool;n.setState({scrolling:!1}),n.setPositionAndClassNames(),Pa.eventStack.sub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.sub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onMount",s,n.props)},n.handlePortalUnmount=function(s){var c=n.props.eventPool;cancelAnimationFrame(n.animationRequestId),Pa.eventStack.unsub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.unsub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onUnmount",s,n.props)},n.setPositionAndClassNames=function(){var s=n.props.centered,c,u={};if(n.ref.current){var f=n.ref.current.getBoundingClientRect(),d=(0,YN.canFit)(f);c=!d;var g=n.legacy?(0,YN.getLegacyStyles)(d,s,f):{};(0,iHe.default)(n.state.legacyStyles,g)||(u.legacyStyles=g),n.state.scrolling!==c&&(u.scrolling=c)}(0,rHe.default)(u)||n.setState(u),n.animationRequestId=requestAnimationFrame(n.setPositionAndClassNames)},n.renderContent=function(s){var c=n.props,u=c.actions,f=c.basic,d=c.children,g=c.className,m=c.closeIcon,w=c.content,v=c.header,y=c.size,_=c.style,b=n.state,A=b.legacyStyles,x=b.scrolling,O=(0,nHe.default)("ui",y,(0,Pa.useKeyOnly)(f,"basic"),(0,Pa.useKeyOnly)(n.legacy,"legacy"),(0,Pa.useKeyOnly)(x,"scrolling"),"modal transition visible active",g),E=(0,Pa.getElementType)(e,n.props),p=m===!0?"close":m,I=aHe.default.create(p,{overrideProps:n.handleIconOverrides});return Wu.default.createElement(aQ.Ref,{innerRef:n.ref},Wu.default.createElement(E,(0,v0.default)({},s,{className:O,style:(0,v0.default)({},A,_)}),I,Pa.childrenUtils.isNil(d)?Wu.default.createElement(Wu.default.Fragment,null,ice.default.create(v,{autoGenerateKey:!1}),rce.default.create(w,{autoGenerateKey:!1}),tce.default.create(u,{overrideProps:n.handleActionsOverrides})):d))},n}var r=e.prototype;return r.componentWillUnmount=function(){this.handlePortalUnmount()},r.render=function(){var i=this.props,a=i.centered,o=i.closeOnDocumentClick,s=i.dimmer,c=i.eventPool,u=i.trigger,f=this.state,d=f.open,g=f.scrolling,m=this.getMountNode();if(!(0,Pa.isBrowser)())return(0,Wu.isValidElement)(u)?u:null;var w=(0,Pa.getUnhandledProps)(e,this.props),v=oQ.default.handledProps,y=(0,tHe.default)(w,function(b,A,x){return(0,eHe.default)(v,x)||(b[x]=A),b},{}),_=(0,Zqe.default)(w,v);return Wu.default.createElement(oQ.default,(0,v0.default)({closeOnDocumentClick:o},_,{trigger:u,eventPool:c,mountNode:m,open:d,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),Wu.default.createElement(aQ.Ref,{innerRef:this.dimmerRef},nce.default.create((0,Xqe.default)(s)?s:{},{autoGenerateKey:!1,defaultProps:{blurring:s==="blurring",inverted:s==="inverted"},overrideProps:{children:this.renderContent(y),centered:a,mountNode:m,scrolling:g}})))},e}(Pa.ModernAutoControlledComponent);Iu.handledProps=["actions","as","basic","centered","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","content","defaultOpen","dimmer","eventPool","header","mountNode","onActionClick","onClose","onMount","onOpen","onUnmount","open","size","style","trigger"];Iu.propTypes={};Iu.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Iu.autoControlledProps=["open"];Iu.Actions=tce.default;Iu.Content=rce.default;Iu.Description=oHe.default;Iu.Dimmer=nce.default;Iu.Header=ice.default;var sHe=Iu;AO.default=sHe;(function(t){var e=Ne&&Ne.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=void 0;var r=AO;Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return e(r).default}})})(xO);var tL={};var cHe=Ne&&Ne.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),uHe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lHe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fHe=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uHe(e,t,r);return lHe(e,t),e};Object.defineProperty(tL,"__esModule",{value:!0});var SO=tL.ModalNavigation=void 0,ih=fHe(ze),dHe=function(t){cHe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var r=this.props,n=r.title,i=r.subtitle,a=r.onBack,o=r.onClose,s=r.onInfo;return ih.createElement("div",{className:"dcl modal-navigation"},ih.createElement("div",{className:"dcl modal-navigation-title"},n),i&&ih.createElement("div",{className:"dcl modal-navigation-subtitle"},i),a&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:a}),s&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:s}),o&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:o}))},e}(ih.PureComponent);SO=tL.ModalNavigation=dHe;const hHe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/warning-057948e8.svg";var Ri=(t=>(t.CONNECTING_WALLET="CONNECTING_WALLET",t.WAITING_FOR_SIGNATURE="WAITING_FOR_SIGNATURE",t.ERROR="ERROR",t.LOADING_MAGIC="LOADING_MAGIC",t.VALIDATING_SIGN_IN="VALIDATING_SIGN_IN",t))(Ri||{});function pHe(t,e){switch(t){case Ri.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case Ri.CONNECTING_WALLET:case Ri.WAITING_FOR_SIGNATURE:return e===Ml.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case Ri.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case Ri.LOADING_MAGIC:return"Redirecting..."}}const gHe="_main_1qx1l_1",yHe="_content_1qx1l_8",mHe="_errorImage_1qx1l_16",vHe="_message_1qx1l_22",bHe="_loader_1qx1l_29",Hv={main:gHe,content:yHe,errorImage:mHe,message:vHe,loader:bHe},ace=t=>{const{open:e,state:r,providerType:n,onClose:i,onTryAgain:a}=t,o=r===Ri.CONNECTING_WALLET||r===Ri.WAITING_FOR_SIGNATURE||r===Ri.LOADING_MAGIC||r===Ri.VALIDATING_SIGN_IN;return Ye.jsxs(xO.Modal,{size:"tiny",open:e,children:[Ye.jsx(SO,{title:"",onClose:o?void 0:i}),Ye.jsx("div",{className:Hv.main,children:Ye.jsxs("div",{className:Hv.content,children:[r===Ri.ERROR&&Ye.jsx("img",{className:Hv.errorImage,src:hHe}),o&&Ye.jsx(AS,{className:Hv.loader,size:"huge",inline:!0}),Ye.jsx("p",{className:Hv.message,children:pHe(r,n)}),r===Ri.ERROR&&Ye.jsx(xc.Button,{primary:!0,onClick:a,children:"Try again"})]})}),Ye.jsx(EO,{})]})};var oce={},sce={},P5={exports:{}};(function(t,e){(function(r,n){n(e)})(Ne,function(r){function n(P){if(P.jsonrpc="2.0",!P.id||typeof P.id!="number"||Math.floor(P.id)!==P.id)throw new Error(`Invalid RPC message(invalid id) message: ${JSON.stringify(P)}`);if(!P.method||typeof P.method!="string"||P.method.trim().length===0)throw new Error(`Invalid RPC message(invalid method) message: ${JSON.stringify(P)}`);if(!P.params||typeof P.params!="object")throw new Error(`Invalid RPC message(invalid params) message: ${JSON.stringify(P)}`);return P}var i={};function a(){let P,D;const W=new Promise((he,Se)=>{P=Ce=>{he(Ce),W.isPending=!1},D=Ce=>{Se(Ce),W.isPending=!1}}).catch(he=>Promise.reject(he));return W.resolve=P,W.reject=D,"finally"in W||(W.finally=he=>{W.then(he),W.catch(he)}),W.isPending=!0,W}Object.defineProperty(i,"__esModule",{value:!0});var o=i.future=a;i.default=a;var s={exports:{}};/**
170
+ Received: \`${t.received}\``)}function KFe(){return new Uw(um.DuplicateIframe,"Duplicate iframes found.")}function YFe(){return new Uw(um.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.")}function QFe(){return new Uw(um.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${zn.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}function vg(t){let{method:e,removalVersions:r,useInstead:n}=t,i=r[zn.sdkName],a=n?` Use \`${n}\` instead.`:"",o=`\`${e}\` will be removed from \`${zn.sdkName}\` in version \`${i}\`.${a}`;return new Uw(um.DeprecationNotice,o)}function*JFe(){let t=0;for(;;)t<Number.MAX_SAFE_INTEGER?yield++t:t=0}var XFe=JFe();function Ase(){return XFe.next().value}var Sse=Symbol("Payload pre-processed by Magic SDK");function Ose(t){return Object.defineProperty(t,Sse,{value:!0,enumerable:!1}),t}function ZFe(t){return!!t[Sse]}function QA(t){var e,r,n;return ZFe(t)||(t.jsonrpc=(e=t.jsonrpc)!=null?e:"2.0",t.id=Ase(),t.method=(r=t.method)!=null?r:"noop",t.params=(n=t.params)!=null?n:[],Ose(t)),t}function an(t,e=[]){return Ose({params:e,method:t,jsonrpc:"2.0",id:Ase()})}var Vk=class{constructor(t){t instanceof Vk?(this._jsonrpc=t.payload.jsonrpc,this._id=t.payload.id,this._result=t.payload.result,this._error=t.payload.error):BFe(t)?(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=t.result,this._error=t.error):(this._jsonrpc=t.jsonrpc,this._id=t.id,this._result=void 0,this._error=void 0)}applyError(t){return this._error=t,this}applyResult(t){return this._result=t,this}get hasError(){return typeof this._error<"u"&&this._error!==null}get hasResult(){return typeof this._result<"u"}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},eje=WBe(KBe()),tje=class extends eje.default{};function Ise(){let t=new tje;return{emitter:t,createChainingEmitterMethod:(e,r)=>(...n)=>(t[e].apply(t,n),r),createBoundEmitterMethod:e=>(...r)=>t[e].apply(t,r)}}var Pse=Symbol("isPromiEvent");function Tse(t){return!!t[Pse]}function Gk(t){let e=Rse(t),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=Ise(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(f,d)=>(...g)=>{let m=d[f].apply(d,g);return c(m)},c=f=>Object.assign(f,{[Pse]:!0,[i]:f[i]||f.then,[a]:f[a]||f.catch,[o]:f[o]||f.finally,then:s(i,f),catch:s(a,f),finally:s(o,f),on:n("on",f),once:n("once",f),addListener:n("addListener",f),off:n("off",f),removeListener:n("removeListener",f),removeAllListeners:n("removeAllListeners",f),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),u=c(e.then(f=>(u.emit("done",f),u.emit("settled"),f),f=>{throw u.emit("error",f),u.emit("settled"),f}));return u}function Rse(t){return new Promise((e,r)=>{let n=t(e,r);Promise.resolve(n).catch(r)})}var Np=class{constructor(t){this.sdk=t}get overlay(){return this.sdk.overlay}request(t){let e=this.overlay.post(R1.MAGIC_HANDLE_REQUEST,QA(t)),r=Gk((i,a)=>{e.then(o=>{if(n(),o.hasError)a(new N1(o.payload.error));else if(o.hasResult)i(o.payload.result);else throw zFe()}).catch(o=>{n(),a(o)})}),n=this.overlay.on(Ah.MAGIC_HANDLE_EVENT,i=>{var a;let{response:o}=i.data;if(o.id===t.id&&((a=o.result)!=null&&a.event)){let{event:s,params:c=[]}=o.result;r.emit(s,...c)}});return r}createIntermediaryEvent(t,e){return r=>{let n=an(vr.IntermediaryEvent,[{payloadId:e,eventType:t,args:r}]);this.request(n)}}};function rje(t,e){let[r]=t.split(".").map(Number);return r>=e}var bg={"magic-sdk":"v18.0.0","@magic-sdk/react-native":"v14.0.0","@magic-sdk/react-native-bare":"v19.0.0","@magic-sdk/react-native-expo":"v19.0.0"},nje=class extends Np{loginWithMagicLink(t){let e=zn.sdkName==="@magic-sdk/react-native"||zn.sdkName==="@magic-sdk/react-native-bare"||zn.sdkName==="@magic-sdk/react-native-expo";if(e&&rje(zn.version,19))throw new Error("loginWithMagicLink() is deprecated for this package, please utlize a passcode method like loginWithSMS or loginWithEmailOTP instead.");e&&vg({method:"auth.loginWithMagicLink()",removalVersions:bg,useInstead:"auth.loginWithEmailOTP()"}).log();let{email:r,showUI:n=!0,redirectURI:i,overrides:a}=t,o=an(this.sdk.testMode?vr.LoginWithMagicLinkTestMode:vr.LoginWithMagicLink,[{email:r,showUI:n,redirectURI:i,overrides:a}]);return this.request(o)}loginWithSMS(t){let{phoneNumber:e}=t,r=an(this.sdk.testMode?vr.LoginWithSmsTestMode:vr.LoginWithSms,[{phoneNumber:e,showUI:!0}]);return this.request(r)}loginWithEmailOTP(t){let{email:e,showUI:r,deviceCheckUI:n,overrides:i}=t,a=an(this.sdk.testMode?vr.LoginWithEmailOTPTestMode:vr.LoginWithEmailOTP,[{email:e,showUI:r,deviceCheckUI:n,overrides:i}]),o=this.request(a);return!n&&o&&o.on(KA.Retry,()=>{this.createIntermediaryEvent(KA.Retry,a.id)()}),!r&&o&&(o.on(G0.VerifyEmailOtp,s=>{this.createIntermediaryEvent(G0.VerifyEmailOtp,a.id)(s)}),o.on(G0.Cancel,()=>{this.createIntermediaryEvent(G0.Cancel,a.id)()})),o}loginWithCredential(t){let e=t??"";if(!t&&zn.platform==="web"){e=window.location.search;let n=window.location.origin+window.location.pathname;window.history.replaceState(null,"",n)}let r=an(this.sdk.testMode?vr.LoginWithCredentialTestMode:vr.LoginWithCredential,[e]);return this.request(r)}setAuthorizationToken(t){let e=an(vr.SetAuthorizationToken,[{jwt:t}]);return this.request(e)}updateEmailWithUI(t){let{email:e,showUI:r=!0}=t,n=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:e,showUI:r}]);return this.request(n)}},Cse={};VBe(Cse,{clear:()=>ije,getItem:()=>$o,iterate:()=>Nse,key:()=>oje,keys:()=>sje,length:()=>aje,removeItem:()=>yO,setItem:()=>Tl});var SE;function Pd(t){return(...e)=>Ci(this,null,function*(){return SE||(SE=yield zn.configureStorage()),yield SE.ready(),SE[t](...e)})}var $o=Pd("getItem"),Tl=Pd("setItem"),yO=Pd("removeItem"),ije=Pd("clear"),aje=Pd("length"),oje=Pd("key"),sje=Pd("keys"),Nse=Pd("iterate");function cje(){let t=window.crypto.getRandomValues(new Uint8Array(16));t[6]=t[6]&15|64,t[8]=t[8]&191|128;let e="";return e+=t[0].toString(16),e+=t[1].toString(16),e+=t[2].toString(16),e+=t[3].toString(16),e+="-",e+=t[4].toString(16),e+=t[5].toString(16),e+="-",e+=t[6].toString(16),e+=t[7].toString(16),e+="-",e+=t[8].toString(16),e+=t[9].toString(16),e+="-",e+=t[10].toString(16),e+=t[11].toString(16),e+=t[12].toString(16),e+=t[13].toString(16),e+=t[14].toString(16),e+=t[15].toString(16),e}var Dse="STORE_KEY_PRIVATE_KEY",I5="STORE_KEY_PUBLIC_JWK",$se="ECDSA",uje="P-256",lje={name:$se,namedCurve:uje};function mO(){let t=typeof window<"u"&&!!window.crypto,e=t&&!!window.crypto.subtle;return t&&e}function fje(){return Ci(this,null,function*(){let t=yield dje();if(!t){console.info("unable to create public key or webcrypto is unsupported");return}let{subtle:e}=window.crypto,r=yield $o(Dse);if(!r||!e){console.info("unable to find private key or webcrypto unsupported");return}let n={iat:Math.floor(new Date().getTime()/1e3),jti:cje()},i={typ:"dpop+jwt",alg:"ES256",jwk:t},a={protected:MY(JSON.stringify(i)),claims:MY(JSON.stringify(n))},o=pje(`${a.protected}.${a.claims}`),s={name:$se,hash:{name:"SHA-256"}},c=yje(new Uint8Array(yield e.sign(s,r,o)));return`${a.protected}.${a.claims}.${c}`})}function dje(){return Ci(this,null,function*(){if(!mO()){console.info("webcrypto is not supported");return}return(yield $o(I5))||(yield hje()),$o(I5)})}function hje(){return Ci(this,null,function*(){let{subtle:t}=window.crypto,e=yield t.generateKey(lje,!1,["sign"]),r=yield t.exportKey("jwk",e.publicKey);yield Tl(Dse,e.privateKey),yield Tl(I5,r)})}function MY(t){return Mse(gje(t))}function pje(t){return new TextEncoder().encode(t)}function Mse(t){return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}function gje(t){return encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(e,r)=>String.fromCharCode(parseInt(r,16)))}function yje(t){let e="";return t.forEach(r=>{e+=String.fromCharCode(r)}),Mse(e)}var Wk="ds",Kk="ek",Yk="iv",Qk="AES-GCM",mje=256;function Jk(){return Ci(this,null,function*(){let t=[];yield Nse((e,r,n)=>{r.startsWith(`${Wk}_`)&&t.push(r)});for(let e of t)yield yO(e)})}function kse(t){let e="",r=new Uint8Array(t),n=r.byteLength;for(let i=0;i<n;i++)e+=String.fromCharCode(r[i]);return window.btoa(e)}function Lse(t){let e=window.atob(t),r=e.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=e.charCodeAt(i);return n.buffer}function vje(){return Ci(this,null,function*(){if(!mO()){console.info("webcrypto is not supported");return}let{crypto:t}=window;return(yield $o(Yk))||t.getRandomValues(new Uint8Array(12))})}function bje(){return Ci(this,null,function*(){if(!mO()){console.info("webcrypto is not supported");return}let{subtle:t}=window.crypto;return(yield $o(Kk))||(yield t.generateKey({name:Qk,length:mje},!1,["encrypt","decrypt"]))})}function wje(t,e){return Ci(this,null,function*(){let r=yield vje(),n=yield bje();if(!r||!n||!t)return;let i=Lse(t),{subtle:a}=window.crypto,o=yield a.encrypt({name:Qk,iv:r},n,i),s=kse(o);yield Tl(`${Wk}_${e}`,s),yield Tl(Kk,n),yield Tl(Yk,r)})}function _je(t){return Ci(this,null,function*(){let e=yield $o(`${Wk}_${t}`),r=yield $o(Yk),n=yield $o(Kk);if(!r||!e||!n||!mO())return;let{subtle:i}=window.crypto,a=yield i.decrypt({name:Qk,iv:r},n,Lse(e));return kse(a)})}var Eje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}getIdToken(e){let r=an(this.sdk.testMode?vr.GetIdTokenTestMode:vr.GetIdToken,[e]);return this.request(r)}generateIdToken(e){let r=an(this.sdk.testMode?vr.GenerateIdTokenTestMode:vr.GenerateIdToken,[e]);return this.request(r)}getInfo(){return Ci(this,null,function*(){let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}isLoggedIn(){let e=an(this.sdk.testMode?vr.IsLoggedInTestMode:vr.IsLoggedIn);return this.request(e)}logout(){yO(this.localForageKey),Jk();let e=an(this.sdk.testMode?vr.LogoutTestMode:vr.Logout);return this.request(e)}requestInfoWithUI(e){let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}showSettings(e){let r=an(this.sdk.testMode?vr.UserSettingsTestMode:vr.UserSettings,[e]);return this.request(r)}recoverAccount(e){let r=an(this.sdk.testMode?vr.RecoverAccountTestMode:vr.RecoverAccount,[e]);return this.request(r)}getMetadata(){vg({method:"user.getMetadata()",removalVersions:bg,useInstead:"user.getInfo()"}).log();let e=an(this.sdk.testMode?vr.GetMetadataTestMode:vr.GetMetadata);return this.request(e)}updateEmail(e){vg({method:"user.updateEmail()",removalVersions:bg,useInstead:"auth.updateEmailWithUI()"}).log();let{email:r,showUI:n=!0}=e,i=an(this.sdk.testMode?vr.UpdateEmailTestMode:vr.UpdateEmail,[{email:r,showUI:n}]);return this.request(i)}};function JA(t,e){return e?new URL(t,e):new URL(t)}var xje=class extends Np{constructor(){super(...arguments),this.localForageKey="mc_active_wallet"}connectWithUI(){let e=Gk((r,n)=>Ci(this,null,function*(){try{if(this.isMetaMaskBrowser()&&(yield this.isWalletEnabled(_s.MetaMask))){let c=yield this.autoConnectIfWalletBrowser(_s.MetaMask);r(c);return}if(this.isCoinbaseWalletBrowser()&&(yield this.isWalletEnabled(_s.CoinbaseWallet))){let c=yield this.autoConnectIfWalletBrowser(_s.CoinbaseWallet);r(c);return}let i=this.getUserEnv(),a=an(vr.Login,[i]),o=this.request(a);o.on(Vb.WalletSelected,c=>this.handleWalletSelected(bse(qk({},c),{payloadId:a.id}))),o.on("id-token-created",c=>{e.emit("id-token-created",c)});let s=yield o;s.error&&n(s),r(s)}catch(i){n(i)}}));return e}showUI(){return this.request(an(vr.ShowUI))}showAddress(){return this.request(an(vr.ShowAddress))}showSendTokensUI(){return this.request(an(vr.ShowSendTokensUI))}showOnRamp(){return this.request(an(vr.ShowOnRamp))}showNFTs(){return this.request(an(vr.ShowNFTs))}showBalances(){return this.request(an(vr.ShowBalances))}sendGaslessTransaction(e,r){return this.request(an(vr.SendGaslessTransaction,[e,r]))}getInfo(){return Ci(this,null,function*(){vg({method:"wallet.getInfo()",removalVersions:bg,useInstead:"user.getInfo()"}).log();let e=yield $o(this.localForageKey),r=an(vr.GetInfo,[{walletType:e}]);return this.request(r)})}disconnect(){vg({method:"wallet.disconnect()",removalVersions:bg,useInstead:"user.logout()"}).log(),yO(this.localForageKey),Jk();let e=an(vr.Disconnect);return this.request(e)}requestUserInfoWithUI(e){vg({method:"wallet.requestUserInfoWithUI()",removalVersions:bg,useInstead:"user.requestUserInfoWithUI()"}).log();let r=an(vr.RequestUserInfoWithUI,e?[e]:[]);return this.request(r)}getProvider(){return Ci(this,null,function*(){switch(yield $o(this.localForageKey)){case _s.MetaMask:return this.getMetaMaskProvider();case _s.CoinbaseWallet:return this.getCoinbaseProvider();default:return this.sdk.rpcProvider}})}isMetaMaskInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isMetaMask)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isMetaMask))}isMetaMaskBrowser(){return this.isMobile()&&this.isMetaMaskInstalled()}getMetaMaskProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isMetaMask))||window.ethereum}connectToMetaMask(){if(this.isMobile()&&!this.isMetaMaskInstalled()){let e=`https://metamask.app.link/dapp/${window.location.href.replace(/(^\w+:|^)\/\//,"")}`;window.location.href=e}return this.getMetaMaskProvider().request({method:"eth_requestAccounts"})}isCoinbaseWalletInstalled(){var e,r,n;return((e=window.ethereum)==null?void 0:e.isCoinbaseWallet)||!!((n=(r=window.ethereum)==null?void 0:r.providers)!=null&&n.find(i=>i==null?void 0:i.isCoinbaseWallet))}isCoinbaseWalletBrowser(){var e;return!!((e=window.ethereum)!=null&&e.isCoinbaseBrowser)}getCoinbaseProvider(){var e,r;return((r=(e=window.ethereum)==null?void 0:e.providers)==null?void 0:r.find(n=>n==null?void 0:n.isCoinbaseWallet))||window.ethereum}connectToCoinbaseWallet(){if(this.isMobile()&&!this.isCoinbaseWalletBrowser()){let e=`https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(window.location.href)}`;window.location.href=e}return this.getCoinbaseProvider().request({method:"eth_requestAccounts"})}isMobile(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|BB|PlayBook|IEMobile|Windows Phone|Silk|Opera Mini/i.test(navigator.userAgent)}getUserEnv(){return{env:{isMetaMaskInstalled:this.isMetaMaskInstalled(),isCoinbaseWalletInstalled:this.isCoinbaseWalletInstalled()}}}connectToThirdPartyWallet(e){switch(e){case _s.MetaMask:return this.connectToMetaMask();case _s.CoinbaseWallet:return this.connectToCoinbaseWallet();default:throw new Error(`Invalid provider: ${e}. Must be one of "metamask" or "coinbase_wallet".`)}}isWalletEnabled(e){let r=an("mc_is_wallet_enabled",[{wallet:e}]);return this.request(r)}handleWalletSelected(e){return Ci(this,null,function*(){try{let r=yield this.connectToThirdPartyWallet(e.wallet);yield Tl(this.localForageKey,e.wallet),this.createIntermediaryEvent(Vb.WalletConnected,e.payloadId)(r)}catch(r){console.error(r),this.createIntermediaryEvent(Vb.WalletRejected,e.payloadId)()}})}autoConnectIfWalletBrowser(e){return Ci(this,null,function*(){let r;e===_s.MetaMask&&(r=yield this.getMetaMaskProvider().request({method:"eth_requestAccounts"})),e===_s.CoinbaseWallet&&(r=yield this.getCoinbaseProvider().request({method:"eth_requestAccounts"})),yield Tl(this.localForageKey,e);let n=an(vr.AutoConnect,[{wallet:e,address:r}]);return this.request(n)})}},{createBoundEmitterMethod:OE,createChainingEmitterMethod:m0}=Ise(),Aje=class extends Np{constructor(){super(...arguments),this.isMagic=!0,this.on=m0("on",this),this.once=m0("once",this),this.addListener=m0("addListener",this),this.off=m0("off",this),this.removeListener=m0("removeListener",this),this.removeAllListeners=m0("removeAllListeners",this),this.emit=OE("emit"),this.eventNames=OE("eventNames"),this.listeners=OE("listeners"),this.listenerCount=OE("listenerCount")}sendAsync(t,e){if(!e)throw WFe({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:e===null?"null":typeof e});if(Array.isArray(t))this.overlay.post(R1.MAGIC_HANDLE_REQUEST,t.map(r=>{let n=QA(r);return this.prefixPayloadMethodForTestMode(n),n})).then(r=>{e(null,r.map(n=>bse(qk({},n.payload),{error:n.hasError?new N1(n.payload.error):null})))});else{let r=QA(t);this.prefixPayloadMethodForTestMode(r),this.overlay.post(R1.MAGIC_HANDLE_REQUEST,r).then(n=>{e(n.hasError?new N1(n.payload.error):null,n.payload)})}}send(t,e){if(typeof t=="string"){let n=an(t,Array.isArray(e)?e:[]);return this.request(n)}if(Array.isArray(t)||e){this.sendAsync(t,e);return}let r=YFe();return r.log(),new Vk(t).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let t=an(vr.Login);return this.request(t)}request(t){return this.prefixPayloadMethodForTestMode(t),super.request(t)}prefixPayloadMethodForTestMode(t){let e="testMode/eth/";this.sdk.testMode&&(t.method=`${e}${t.method}`)}},kY=["request","overlay","sdk"];function Sje(t){let e=Object.getPrototypeOf(t),r=[e];for(;e!==Np.prototype;)e=Object.getPrototypeOf(e),r.push(e);return r}var Use=class extends Np{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:Gk,isPromiEvent:Tse,encodeJSON:_se,decodeJSON:LFe,createJsonRpcRequestPayload:an,standardizeJsonRpcRequestPayload:QA,storage:Cse};let t=[this,...Sje(this)];kY.forEach(e=>{let r=t.map(o=>Object.getOwnPropertyDescriptor(o,e)),n=r.findIndex(o=>!!o),i=n>0,a=r[n];a&&(this.__sdk_access_field_descriptors__.set(e,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,e,{configurable:!0,get:()=>{throw VFe(e)}}))})}init(t){this.__is_initialized__||(kY.forEach(e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:r,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,r)}}),this.sdk=t,this.__is_initialized__=!0)}createDeprecationWarning(t){let{method:e,removalVersion:r,useInstead:n}=t,i=n?` Use \`${n}\` instead.`:"",a=`\`${e}\` will be removed from this Extension in version \`${r}\`.${i}`;return new O5(this,"DEPRECATION_NOTICE",a)}createWarning(t,e){return new O5(this,t,e)}createError(t,e,r){return new zk(this,t,e,r)}},Oje=class extends Use{},Xh=class extends Use{};Xh.Internal=Oje,Xh.Anonymous="anonymous extension";var Ije=class extends Np{purchase(t){let e=an(vr.NFTPurchase,[t]);return this.request(e)}checkout(t){let e=an(vr.NFTCheckout,[t]);return this.request(e)}transfer(t){let e=an(vr.NFTTransfer,[t]);return this.request(e)}};function LY(t){return t.compat&&t.compat[zn.sdkName]!=null?typeof t.compat[zn.sdkName]=="string"?PFe(NFe(zn.version),t.compat[zn.sdkName]):!!t.compat[zn.sdkName]:!0}function Pje(t,e,r){return!e&&!r?`${t}_eth_mainnet`:r?`${t}_${JSON.stringify(r)}`:e?typeof e=="string"?`${t}_eth_${e}`:`${t}_${e.rpcUrl}_${e.chainId}_${e.chainType}`:`${t}_unknown`}function Tje(t){var e;let r=(e=t==null?void 0:t.extensions)!=null?e:[],n={},i=[];if(Array.isArray(r)?r.forEach(a=>{LY(a)?(a.init(this),(a.name||a.name!==Xh.Anonymous)&&(this[a.name]=a),a instanceof Xh.Internal&&(YA(a.config)||(n[a.name]=a.config))):i.push(a)}):Object.keys(r).forEach(a=>{if(LY(r[a])){r[a].init(this);let o=r[a];this[a]=o,o instanceof Xh.Internal&&(YA(o.config)||(n[r[a].name]=o.config))}else i.push(r[a])}),i.length)throw GFe(i);return n}var Px=class{constructor(t,e){this.apiKey=t;var r;if(!t)throw HFe();zn.platform==="react-native"&&(e!=null&&e.endpoint)&&QFe().log();let{defaultEndpoint:n,version:i}=zn;this.testMode=!!(e!=null&&e.testMode),this.endpoint=JA((r=e==null?void 0:e.endpoint)!=null?r:n).origin,this.auth=new nje(this),this.user=new Eje(this),this.wallet=new xje(this),this.nft=new Ije(this),this.rpcProvider=new Aje(this);let a=Tje.call(this,e);this.parameters=_se(qk({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:e==null?void 0:e.network,host:JA(this.endpoint).host,sdk:qFe[zn.sdkName],version:i,ext:YA(a)?void 0:a,locale:(e==null?void 0:e.locale)||"en_US"},zn.bundleId?{bundleId:zn.bundleId}:{})),this.networkHash=Pje(this.apiKey,e==null?void 0:e.network,YA(a)?void 0:a),e!=null&&e.deferPreload||this.preload()}get overlay(){if(!Px.__overlays__.has(this.parameters)){let t=new zn.ViewController(this.endpoint,this.parameters,this.networkHash);t.init(),Px.__overlays__.set(this.parameters,t)}return Px.__overlays__.get(this.parameters)}preload(){return Ci(this,null,function*(){yield this.overlay.checkIsReadyForRequest})}},Bse=Px;Bse.__overlays__=new Map;function Rje(t,e){return e&&Array.isArray(t)?t.find(r=>r.id===e):t}function Cje(t,e){var r;let n=(r=e.data.response)==null?void 0:r.id,i=Rje(t,n);if(n&&i){let a=new Vk(i).applyResult(e.data.response.result).applyError(e.data.response.error);return{id:n,response:a}}return{}}function Nje(t,e,r){return Ci(this,null,function*(){var n;let i=yield $o("rt"),a;if(zn.platform==="web")try{a=(n=yield $o("jwt"))!=null?n:yield fje()}catch(c){console.error("webcrypto error",c)}let o={msgType:t,payload:e};a&&(o.jwt=a),a&&i&&(o.rt=i);let s=yield _je(r);return s&&(o.deviceShare=s),o})}function Dje(t){return Ci(this,null,function*(){!t.data.rt||(yield Tl("rt",t.data.rt))})}var $je=class{constructor(t,e,r){this.endpoint=t,this.parameters=e,this.networkHash=r,this.messageHandlers=new Set,this.isConnectedToInternet=!0,this.checkIsReadyForRequest=this.waitForReady(),this.isReadyForRequest=!1,this.listen()}post(t,e){return Ci(this,null,function*(){return Rse((r,n)=>Ci(this,null,function*(){if(!this.isConnectedToInternet){let u=xse();n(u)}this.isReadyForRequest||(yield this.waitForReady());let i=[],a=Array.isArray(e)?e.map(u=>u.id):[],o=yield Nje(`${t}-${this.parameters}`,e,this.networkHash);yield this._post(o);let s=u=>f=>{var d;let{id:g,response:m}=Cje(e,f);if(Dje(f),((d=m==null?void 0:m.payload.error)==null?void 0:d.message)==="User denied account access.")Jk();else if(f.data.deviceShare){let{deviceShare:w}=f.data;wje(w,this.networkHash)}g&&m&&Array.isArray(e)&&a.includes(g)?(i.push(m),i.length===e.length&&(u(),r(i))):g&&m&&!Array.isArray(e)&&g===e.id&&(u(),r(m))},c=this.on(Ah.MAGIC_HANDLE_RESPONSE,s(()=>c()))}))})}on(t,e){let r=e.bind(window),n=i=>{i.data.msgType===`${t}-${this.parameters}`&&r(i)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise(t=>{let e=this.on(Ah.MAGIC_OVERLAY_READY,()=>{this.isReadyForRequest=!0,t(),e()})})}listen(){this.on(Ah.MAGIC_HIDE_OVERLAY,()=>{this.hideOverlay()}),this.on(Ah.MAGIC_SHOW_OVERLAY,()=>{this.showOverlay()})}},Mje=Object.create,Fse=Object.defineProperty,kje=Object.getOwnPropertyDescriptor,Lje=Object.getOwnPropertyNames,Uje=Object.getPrototypeOf,Bje=Object.prototype.hasOwnProperty,IE=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+t+'" is not supported')}),jse=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Fje=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Lje(e))!Bje.call(t,i)&&i!==r&&Fse(t,i,{get:()=>e[i],enumerable:!(n=kje(e,i))||n.enumerable});return t},qse=(t,e,r)=>(r=t!=null?Mje(Uje(t)):{},Fje(e||!t||!t.__esModule?Fse(r,"default",{value:t,enumerable:!0}):r,t)),Tx=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),jje=jse((t,e)=>{(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){return function r(n,i,a){function o(u,f){if(!i[u]){if(!n[u]){var d=typeof IE=="function"&&IE;if(!f&&d)return d(u,!0);if(s)return s(u,!0);var g=new Error("Cannot find module '"+u+"'");throw g.code="MODULE_NOT_FOUND",g}var m=i[u]={exports:{}};n[u][0].call(m.exports,function(w){var v=n[u][1][w];return o(v||w)},m,m.exports,r,n,i,a)}return i[u].exports}for(var s=typeof IE=="function"&&IE,c=0;c<a.length;c++)o(a[c]);return o}({1:[function(r,n,i){(function(a){var o=a.MutationObserver||a.WebKitMutationObserver,s;if(o){var c=0,u=new o(w),f=a.document.createTextNode("");u.observe(f,{characterData:!0}),s=function(){f.data=c=++c%2}}else if(!a.setImmediate&&typeof a.MessageChannel<"u"){var d=new a.MessageChannel;d.port1.onmessage=w,s=function(){d.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?s=function(){var y=a.document.createElement("script");y.onreadystatechange=function(){w(),y.onreadystatechange=null,y.parentNode.removeChild(y),y=null},a.document.documentElement.appendChild(y)}:s=function(){setTimeout(w,0)};var g,m=[];function w(){g=!0;for(var y,_,b=m.length;b;){for(_=m,m=[],y=-1;++y<b;)_[y]();b=m.length}g=!1}n.exports=v;function v(y){m.push(y)===1&&!g&&s()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,n,i){var a=r(1);function o(){}var s={},c=["REJECTED"],u=["FULFILLED"],f=["PENDING"];n.exports=d;function d(O){if(typeof O!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,O!==o&&v(this,O)}d.prototype.catch=function(O){return this.then(null,O)},d.prototype.then=function(O,E){if(typeof O!="function"&&this.state===u||typeof E!="function"&&this.state===c)return this;var p=new this.constructor(o);if(this.state!==f){var I=this.state===u?O:E;m(p,I,this.outcome)}else this.queue.push(new g(p,O,E));return p};function g(O,E,p){this.promise=O,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof p=="function"&&(this.onRejected=p,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(O){s.resolve(this.promise,O)},g.prototype.otherCallFulfilled=function(O){m(this.promise,this.onFulfilled,O)},g.prototype.callRejected=function(O){s.reject(this.promise,O)},g.prototype.otherCallRejected=function(O){m(this.promise,this.onRejected,O)};function m(O,E,p){a(function(){var I;try{I=E(p)}catch(C){return s.reject(O,C)}I===O?s.reject(O,new TypeError("Cannot resolve promise with itself")):s.resolve(O,I)})}s.resolve=function(O,E){var p=y(w,E);if(p.status==="error")return s.reject(O,p.value);var I=p.value;if(I)v(O,I);else{O.state=u,O.outcome=E;for(var C=-1,L=O.queue.length;++C<L;)O.queue[C].callFulfilled(E)}return O},s.reject=function(O,E){O.state=c,O.outcome=E;for(var p=-1,I=O.queue.length;++p<I;)O.queue[p].callRejected(E);return O};function w(O){var E=O&&O.then;if(O&&(typeof O=="object"||typeof O=="function")&&typeof E=="function")return function(){E.apply(O,arguments)}}function v(O,E){var p=!1;function I(le){p||(p=!0,s.reject(O,le))}function C(le){p||(p=!0,s.resolve(O,le))}function L(){E(C,I)}var q=y(L);q.status==="error"&&I(q.value)}function y(O,E){var p={};try{p.value=O(E),p.status="success"}catch(I){p.status="error",p.value=I}return p}d.resolve=_;function _(O){return O instanceof this?O:s.resolve(new this(o),O)}d.reject=b;function b(O){var E=new this(o);return s.reject(E,O)}d.all=A;function A(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=new Array(p),L=0,q=-1,le=new this(o);++q<p;)pe(O[q],q);return le;function pe(B,U){E.resolve(B).then(K,function(ne){I||(I=!0,s.reject(le,ne))});function K(ne){C[U]=ne,++L===p&&!I&&(I=!0,s.resolve(le,C))}}}d.race=x;function x(O){var E=this;if(Object.prototype.toString.call(O)!=="[object Array]")return this.reject(new TypeError("must be an array"));var p=O.length,I=!1;if(!p)return this.resolve([]);for(var C=-1,L=new this(o);++C<p;)q(O[C]);return L;function q(le){E.resolve(le).then(function(pe){I||(I=!0,s.resolve(L,pe))},function(pe){I||(I=!0,s.reject(L,pe))})}}},{1:1}],3:[function(r,n,i){(function(a){typeof a.Promise!="function"&&(a.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,n,i){var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(X){return typeof X}:function(X){return X&&typeof Symbol=="function"&&X.constructor===Symbol&&X!==Symbol.prototype?"symbol":typeof X};function o(X,me){if(!(X instanceof me))throw new TypeError("Cannot call a class as a function")}function s(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var c=s();function u(){try{if(!c||!c.open)return!1;var X=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),me=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!X||me)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(X,me){X=X||[],me=me||{};try{return new Blob(X,me)}catch(Oe){if(Oe.name!=="TypeError")throw Oe;for(var re=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,Ee=new re,be=0;be<X.length;be+=1)Ee.append(X[be]);return Ee.getBlob(me.type)}}typeof Promise>"u"&&r(3);var d=Promise;function g(X,me){me&&X.then(function(re){me(null,re)},function(re){me(re)})}function m(X,me,re){typeof me=="function"&&X.then(me),typeof re=="function"&&X.catch(re)}function w(X){return typeof X!="string"&&(console.warn(X+" used as a key, but it is not a string."),X=String(X)),X}function v(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var y="local-forage-detect-blob-support",_=void 0,b={},A=Object.prototype.toString,x="readonly",O="readwrite";function E(X){for(var me=X.length,re=new ArrayBuffer(me),Ee=new Uint8Array(re),be=0;be<me;be++)Ee[be]=X.charCodeAt(be);return re}function p(X){return new d(function(me){var re=X.transaction(y,O),Ee=f([""]);re.objectStore(y).put(Ee,"key"),re.onabort=function(be){be.preventDefault(),be.stopPropagation(),me(!1)},re.oncomplete=function(){var be=navigator.userAgent.match(/Chrome\/(\d+)/),Oe=navigator.userAgent.match(/Edge\//);me(Oe||!be||parseInt(be[1],10)>=43)}}).catch(function(){return!1})}function I(X){return typeof _=="boolean"?d.resolve(_):p(X).then(function(me){return _=me,_})}function C(X){var me=b[X.name],re={};re.promise=new d(function(Ee,be){re.resolve=Ee,re.reject=be}),me.deferredOperations.push(re),me.dbReady?me.dbReady=me.dbReady.then(function(){return re.promise}):me.dbReady=re.promise}function L(X){var me=b[X.name],re=me.deferredOperations.pop();if(re)return re.resolve(),re.promise}function q(X,me){var re=b[X.name],Ee=re.deferredOperations.pop();if(Ee)return Ee.reject(me),Ee.promise}function le(X,me){return new d(function(re,Ee){if(b[X.name]=b[X.name]||H(),X.db)if(me)C(X),X.db.close();else return re(X.db);var be=[X.name];me&&be.push(X.version);var Oe=c.open.apply(c,be);me&&(Oe.onupgradeneeded=function(Je){var ft=Oe.result;try{ft.createObjectStore(X.storeName),Je.oldVersion<=1&&ft.createObjectStore(y)}catch(Qe){if(Qe.name==="ConstraintError")console.warn('The database "'+X.name+'" has been upgraded from version '+Je.oldVersion+" to version "+Je.newVersion+', but the storage "'+X.storeName+'" already exists.');else throw Qe}}),Oe.onerror=function(Je){Je.preventDefault(),Ee(Oe.error)},Oe.onsuccess=function(){var Je=Oe.result;Je.onversionchange=function(ft){ft.target.close()},re(Je),L(X)}})}function pe(X){return le(X,!1)}function B(X){return le(X,!0)}function U(X,me){if(!X.db)return!0;var re=!X.db.objectStoreNames.contains(X.storeName),Ee=X.version<X.db.version,be=X.version>X.db.version;if(Ee&&(X.version!==me&&console.warn('The database "'+X.name+`" can't be downgraded from version `+X.db.version+" to version "+X.version+"."),X.version=X.db.version),be||re){if(re){var Oe=X.db.version+1;Oe>X.version&&(X.version=Oe)}return!0}return!1}function K(X){return new d(function(me,re){var Ee=new FileReader;Ee.onerror=re,Ee.onloadend=function(be){var Oe=btoa(be.target.result||"");me({__local_forage_encoded_blob:!0,data:Oe,type:X.type})},Ee.readAsBinaryString(X)})}function ne(X){var me=E(atob(X.data));return f([me],{type:X.type})}function F(X){return X&&X.__local_forage_encoded_blob}function j(X){var me=this,re=me._initReady().then(function(){var Ee=b[me._dbInfo.name];if(Ee&&Ee.dbReady)return Ee.dbReady});return m(re,X,X),re}function z(X){C(X);for(var me=b[X.name],re=me.forages,Ee=0;Ee<re.length;Ee++){var be=re[Ee];be._dbInfo.db&&(be._dbInfo.db.close(),be._dbInfo.db=null)}return X.db=null,pe(X).then(function(Oe){return X.db=Oe,U(X)?B(X):Oe}).then(function(Oe){X.db=me.db=Oe;for(var Je=0;Je<re.length;Je++)re[Je]._dbInfo.db=Oe}).catch(function(Oe){throw q(X,Oe),Oe})}function $(X,me,re,Ee){Ee===void 0&&(Ee=1);try{var be=X.db.transaction(X.storeName,me);re(null,be)}catch(Oe){if(Ee>0&&(!X.db||Oe.name==="InvalidStateError"||Oe.name==="NotFoundError"))return d.resolve().then(function(){if(!X.db||Oe.name==="NotFoundError"&&!X.db.objectStoreNames.contains(X.storeName)&&X.version<=X.db.version)return X.db&&(X.version=X.db.version+1),B(X)}).then(function(){return z(X).then(function(){$(X,me,re,Ee-1)})}).catch(re);re(Oe)}}function H(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function k(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=X[Ee];var be=b[re.name];be||(be=H(),b[re.name]=be),be.forages.push(me),me._initReady||(me._initReady=me.ready,me.ready=j);var Oe=[];function Je(){return d.resolve()}for(var ft=0;ft<be.forages.length;ft++){var Qe=be.forages[ft];Qe!==me&&Oe.push(Qe._initReady().catch(Je))}var Ge=be.forages.slice(0);return d.all(Oe).then(function(){return re.db=be.db,pe(re)}).then(function(ht){return re.db=ht,U(re,me._defaultConfig.version)?B(re):ht}).then(function(ht){re.db=be.db=ht,me._dbInfo=re;for(var Vt=0;Vt<Ge.length;Vt++){var Tr=Ge[Vt];Tr!==me&&(Tr._dbInfo.db=re.db,Tr._dbInfo.version=re.version)}})}function M(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=Qe.get(X);Ge.onsuccess=function(){var ht=Ge.result;ht===void 0&&(ht=null),F(ht)&&(ht=ne(ht)),be(ht)},Ge.onerror=function(){Oe(Ge.error)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function G(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=Qe.openCursor(),ht=1;Ge.onsuccess=function(){var Vt=Ge.result;if(Vt){var Tr=Vt.value;F(Tr)&&(Tr=ne(Tr));var Wr=X(Tr,Vt.key,ht++);Wr!==void 0?be(Wr):Vt.continue()}else be()},Ge.onerror=function(){Oe(Ge.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function ge(X,me,re){var Ee=this;X=w(X);var be=new d(function(Oe,Je){var ft;Ee.ready().then(function(){return ft=Ee._dbInfo,A.call(me)==="[object Blob]"?I(ft.db).then(function(Qe){return Qe?me:K(me)}):me}).then(function(Qe){$(Ee._dbInfo,O,function(Ge,ht){if(Ge)return Je(Ge);try{var Vt=ht.objectStore(Ee._dbInfo.storeName);Qe===null&&(Qe=void 0);var Tr=Vt.put(Qe,X);ht.oncomplete=function(){Qe===void 0&&(Qe=null),Oe(Qe)},ht.onabort=ht.onerror=function(){var Wr=Tr.error?Tr.error:Tr.transaction.error;Je(Wr)}}catch(Wr){Je(Wr)}})}).catch(Je)});return g(be,re),be}function Q(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){$(re._dbInfo,O,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=Qe.delete(X);ft.oncomplete=function(){be()},ft.onerror=function(){Oe(Ge.error)},ft.onabort=function(){var ht=Ge.error?Ge.error:Ge.transaction.error;Oe(ht)}}catch(ht){Oe(ht)}})}).catch(Oe)});return g(Ee,me),Ee}function te(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,O,function(Oe,Je){if(Oe)return be(Oe);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.clear();Je.oncomplete=function(){Ee()},Je.onabort=Je.onerror=function(){var Ge=Qe.error?Qe.error:Qe.transaction.error;be(Ge)}}catch(Ge){be(Ge)}})}).catch(be)});return g(re,X),re}function ce(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Je){if(Oe)return be(Oe);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.count();Qe.onsuccess=function(){Ee(Qe.result)},Qe.onerror=function(){be(Qe.error)}}catch(Ge){be(Ge)}})}).catch(be)});return g(re,X),re}function T(X,me){var re=this,Ee=new d(function(be,Oe){if(X<0){be(null);return}re.ready().then(function(){$(re._dbInfo,x,function(Je,ft){if(Je)return Oe(Je);try{var Qe=ft.objectStore(re._dbInfo.storeName),Ge=!1,ht=Qe.openKeyCursor();ht.onsuccess=function(){var Vt=ht.result;if(!Vt){be(null);return}X===0||Ge?be(Vt.key):(Ge=!0,Vt.advance(X))},ht.onerror=function(){Oe(ht.error)}}catch(Vt){Oe(Vt)}})}).catch(Oe)});return g(Ee,me),Ee}function fe(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){$(me._dbInfo,x,function(Oe,Je){if(Oe)return be(Oe);try{var ft=Je.objectStore(me._dbInfo.storeName),Qe=ft.openKeyCursor(),Ge=[];Qe.onsuccess=function(){var ht=Qe.result;if(!ht){Ee(Ge);return}Ge.push(ht.key),ht.continue()},Qe.onerror=function(){be(Qe.error)}}catch(ht){be(ht)}})}).catch(be)});return g(re,X),re}function Ve(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;if(!X.name)be=d.reject("Invalid arguments");else{var Oe=X.name===re.name&&Ee._dbInfo.db,Je=Oe?d.resolve(Ee._dbInfo.db):pe(X).then(function(ft){var Qe=b[X.name],Ge=Qe.forages;Qe.db=ft;for(var ht=0;ht<Ge.length;ht++)Ge[ht]._dbInfo.db=ft;return ft});X.storeName?be=Je.then(function(ft){if(ft.objectStoreNames.contains(X.storeName)){var Qe=ft.version+1;C(X);var Ge=b[X.name],ht=Ge.forages;ft.close();for(var Vt=0;Vt<ht.length;Vt++){var Tr=ht[Vt];Tr._dbInfo.db=null,Tr._dbInfo.version=Qe}var Wr=new d(function(jr,_n){var qr=c.open(X.name,Qe);qr.onerror=function(P){var D=qr.result;D.close(),_n(P)},qr.onupgradeneeded=function(){var P=qr.result;P.deleteObjectStore(X.storeName)},qr.onsuccess=function(){var P=qr.result;P.close(),jr(P)}});return Wr.then(function(jr){Ge.db=jr;for(var _n=0;_n<ht.length;_n++){var qr=ht[_n];qr._dbInfo.db=jr,L(qr._dbInfo)}}).catch(function(jr){throw(q(X,jr)||d.resolve()).catch(function(){}),jr})}}):be=Je.then(function(ft){C(X);var Qe=b[X.name],Ge=Qe.forages;ft.close();for(var ht=0;ht<Ge.length;ht++){var Vt=Ge[ht];Vt._dbInfo.db=null}var Tr=new d(function(Wr,jr){var _n=c.deleteDatabase(X.name);_n.onerror=function(){var qr=_n.result;qr&&qr.close(),jr(_n.error)},_n.onblocked=function(){console.warn('dropInstance blocked for database "'+X.name+'" until all open connections are closed')},_n.onsuccess=function(){var qr=_n.result;qr&&qr.close(),Wr(qr)}});return Tr.then(function(Wr){Qe.db=Wr;for(var jr=0;jr<Ge.length;jr++){var _n=Ge[jr];L(_n._dbInfo)}}).catch(function(Wr){throw(q(X,Wr)||d.resolve()).catch(function(){}),Wr})})}return g(be,me),be}var tt={_driver:"asyncStorage",_initStorage:k,_support:u(),iterate:G,getItem:M,setItem:ge,removeItem:Q,clear:te,length:ce,key:T,keys:fe,dropInstance:Ve};function mt(){return typeof openDatabase=="function"}var vt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",gt="~~local_forage_type~",Lt=/^~~local_forage_type~([^~]+)~/,Yt="__lfsc__:",wr=Yt.length,Rt="arbf",Pt="blob",kt="si08",Nt="ui08",Kt="uic8",Ut="si16",zt="si32",$t="ur16",Dt="ui32",qt="fl32",Mt="fl64",cr=wr+Rt.length,tr=Object.prototype.toString;function ir(X){var me=X.length*.75,re=X.length,Ee,be=0,Oe,Je,ft,Qe;X[X.length-1]==="="&&(me--,X[X.length-2]==="="&&me--);var Ge=new ArrayBuffer(me),ht=new Uint8Array(Ge);for(Ee=0;Ee<re;Ee+=4)Oe=vt.indexOf(X[Ee]),Je=vt.indexOf(X[Ee+1]),ft=vt.indexOf(X[Ee+2]),Qe=vt.indexOf(X[Ee+3]),ht[be++]=Oe<<2|Je>>4,ht[be++]=(Je&15)<<4|ft>>2,ht[be++]=(ft&3)<<6|Qe&63;return Ge}function nr(X){var me=new Uint8Array(X),re="",Ee;for(Ee=0;Ee<me.length;Ee+=3)re+=vt[me[Ee]>>2],re+=vt[(me[Ee]&3)<<4|me[Ee+1]>>4],re+=vt[(me[Ee+1]&15)<<2|me[Ee+2]>>6],re+=vt[me[Ee+2]&63];return me.length%3===2?re=re.substring(0,re.length-1)+"=":me.length%3===1&&(re=re.substring(0,re.length-2)+"=="),re}function mr(X,me){var re="";if(X&&(re=tr.call(X)),X&&(re==="[object ArrayBuffer]"||X.buffer&&tr.call(X.buffer)==="[object ArrayBuffer]")){var Ee,be=Yt;X instanceof ArrayBuffer?(Ee=X,be+=Rt):(Ee=X.buffer,re==="[object Int8Array]"?be+=kt:re==="[object Uint8Array]"?be+=Nt:re==="[object Uint8ClampedArray]"?be+=Kt:re==="[object Int16Array]"?be+=Ut:re==="[object Uint16Array]"?be+=$t:re==="[object Int32Array]"?be+=zt:re==="[object Uint32Array]"?be+=Dt:re==="[object Float32Array]"?be+=qt:re==="[object Float64Array]"?be+=Mt:me(new Error("Failed to get type for BinaryArray"))),me(be+nr(Ee))}else if(re==="[object Blob]"){var Oe=new FileReader;Oe.onload=function(){var Je=gt+X.type+"~"+nr(this.result);me(Yt+Pt+Je)},Oe.readAsArrayBuffer(X)}else try{me(JSON.stringify(X))}catch(Je){console.error("Couldn't convert value into a JSON string: ",X),me(null,Je)}}function wn(X){if(X.substring(0,wr)!==Yt)return JSON.parse(X);var me=X.substring(cr),re=X.substring(wr,cr),Ee;if(re===Pt&&Lt.test(me)){var be=me.match(Lt);Ee=be[1],me=me.substring(be[0].length)}var Oe=ir(me);switch(re){case Rt:return Oe;case Pt:return f([Oe],{type:Ee});case kt:return new Int8Array(Oe);case Nt:return new Uint8Array(Oe);case Kt:return new Uint8ClampedArray(Oe);case Ut:return new Int16Array(Oe);case $t:return new Uint16Array(Oe);case zt:return new Int32Array(Oe);case Dt:return new Uint32Array(Oe);case qt:return new Float32Array(Oe);case Mt:return new Float64Array(Oe);default:throw new Error("Unkown type: "+re)}}var Yr={serialize:mr,deserialize:wn,stringToBuffer:ir,bufferToString:nr};function ai(X,me,re,Ee){X.executeSql("CREATE TABLE IF NOT EXISTS "+me.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],re,Ee)}function Dn(X){var me=this,re={db:null};if(X)for(var Ee in X)re[Ee]=typeof X[Ee]!="string"?X[Ee].toString():X[Ee];var be=new d(function(Oe,Je){try{re.db=openDatabase(re.name,String(re.version),re.description,re.size)}catch(ft){return Je(ft)}re.db.transaction(function(ft){ai(ft,re,function(){me._dbInfo=re,Oe()},function(Qe,Ge){Je(Ge)})},Je)});return re.serializer=Yr,be}function $n(X,me,re,Ee,be,Oe){X.executeSql(re,Ee,be,function(Je,ft){ft.code===ft.SYNTAX_ERR?Je.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[me.storeName],function(Qe,Ge){Ge.rows.length?Oe(Qe,ft):ai(Qe,me,function(){Qe.executeSql(re,Ee,be,Oe)},Oe)},Oe):Oe(Je,ft)},Oe)}function Kn(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName+" WHERE key = ? LIMIT 1",[X],function(Qe,Ge){var ht=Ge.rows.length?Ge.rows.item(0).value:null;ht&&(ht=Je.serializer.deserialize(ht)),be(ht)},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function xr(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT * FROM "+Je.storeName,[],function(Qe,Ge){for(var ht=Ge.rows,Vt=ht.length,Tr=0;Tr<Vt;Tr++){var Wr=ht.item(Tr),jr=Wr.value;if(jr&&(jr=Je.serializer.deserialize(jr)),jr=X(jr,Wr.key,Tr+1),jr!==void 0){be(jr);return}}be()},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function $r(X,me,re,Ee){var be=this;X=w(X);var Oe=new d(function(Je,ft){be.ready().then(function(){me===void 0&&(me=null);var Qe=me,Ge=be._dbInfo;Ge.serializer.serialize(me,function(ht,Vt){Vt?ft(Vt):Ge.db.transaction(function(Tr){$n(Tr,Ge,"INSERT OR REPLACE INTO "+Ge.storeName+" (key, value) VALUES (?, ?)",[X,ht],function(){Je(Qe)},function(Wr,jr){ft(jr)})},function(Tr){if(Tr.code===Tr.QUOTA_ERR){if(Ee>0){Je($r.apply(be,[X,Qe,re,Ee-1]));return}ft(Tr)}})})}).catch(ft)});return g(Oe,re),Oe}function _r(X,me,re){return $r.apply(this,[X,me,re,1])}function _e(X,me){var re=this;X=w(X);var Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"DELETE FROM "+Je.storeName+" WHERE key = ?",[X],function(){be()},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function ee(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Je){$n(Je,Oe,"DELETE FROM "+Oe.storeName,[],function(){Ee()},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function ve(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Je){$n(Je,Oe,"SELECT COUNT(key) as c FROM "+Oe.storeName,[],function(ft,Qe){var Ge=Qe.rows.item(0).c;Ee(Ge)},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function Re(X,me){var re=this,Ee=new d(function(be,Oe){re.ready().then(function(){var Je=re._dbInfo;Je.db.transaction(function(ft){$n(ft,Je,"SELECT key FROM "+Je.storeName+" WHERE id = ? LIMIT 1",[X+1],function(Qe,Ge){var ht=Ge.rows.length?Ge.rows.item(0).key:null;be(ht)},function(Qe,Ge){Oe(Ge)})})}).catch(Oe)});return g(Ee,me),Ee}function He(X){var me=this,re=new d(function(Ee,be){me.ready().then(function(){var Oe=me._dbInfo;Oe.db.transaction(function(Je){$n(Je,Oe,"SELECT key FROM "+Oe.storeName,[],function(ft,Qe){for(var Ge=[],ht=0;ht<Qe.rows.length;ht++)Ge.push(Qe.rows.item(ht).key);Ee(Ge)},function(ft,Qe){be(Qe)})})}).catch(be)});return g(re,X),re}function Xe(X){return new d(function(me,re){X.transaction(function(Ee){Ee.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(be,Oe){for(var Je=[],ft=0;ft<Oe.rows.length;ft++)Je.push(Oe.rows.item(ft).name);me({db:X,storeNames:Je})},function(be,Oe){re(Oe)})},function(Ee){re(Ee)})})}function st(X,me){me=v.apply(this,arguments);var re=this.config();X=typeof X!="function"&&X||{},X.name||(X.name=X.name||re.name,X.storeName=X.storeName||re.storeName);var Ee=this,be;return X.name?be=new d(function(Oe){var Je;X.name===re.name?Je=Ee._dbInfo.db:Je=openDatabase(X.name,"","",0),X.storeName?Oe({db:Je,storeNames:[X.storeName]}):Oe(Xe(Je))}).then(function(Oe){return new d(function(Je,ft){Oe.db.transaction(function(Qe){function Ge(Wr){return new d(function(jr,_n){Qe.executeSql("DROP TABLE IF EXISTS "+Wr,[],function(){jr()},function(qr,P){_n(P)})})}for(var ht=[],Vt=0,Tr=Oe.storeNames.length;Vt<Tr;Vt++)ht.push(Ge(Oe.storeNames[Vt]));d.all(ht).then(function(){Je()}).catch(function(Wr){ft(Wr)})},function(Qe){ft(Qe)})})}):be=d.reject("Invalid arguments"),g(be,me),be}var lt={_driver:"webSQLStorage",_initStorage:Dn,_support:mt(),iterate:xr,getItem:Kn,setItem:_r,removeItem:_e,clear:ee,length:ve,key:Re,keys:He,dropInstance:st};function _t(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ue(X,me){var re=X.name+"/";return X.storeName!==me.storeName&&(re+=X.storeName+"/"),re}function Z(){var X="_localforage_support_test";try{return localStorage.setItem(X,!0),localStorage.removeItem(X),!1}catch{return!0}}function ye(){return!Z()||localStorage.length>0}function Me(X){var me=this,re={};if(X)for(var Ee in X)re[Ee]=X[Ee];return re.keyPrefix=ue(X,me._defaultConfig),ye()?(me._dbInfo=re,re.serializer=Yr,d.resolve()):d.reject()}function Le(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo.keyPrefix,be=localStorage.length-1;be>=0;be--){var Oe=localStorage.key(be);Oe.indexOf(Ee)===0&&localStorage.removeItem(Oe)}});return g(re,X),re}function wt(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo,Oe=localStorage.getItem(be.keyPrefix+X);return Oe&&(Oe=be.serializer.deserialize(Oe)),Oe});return g(Ee,me),Ee}function Ot(X,me){var re=this,Ee=re.ready().then(function(){for(var be=re._dbInfo,Oe=be.keyPrefix,Je=Oe.length,ft=localStorage.length,Qe=1,Ge=0;Ge<ft;Ge++){var ht=localStorage.key(Ge);if(ht.indexOf(Oe)===0){var Vt=localStorage.getItem(ht);if(Vt&&(Vt=be.serializer.deserialize(Vt)),Vt=X(Vt,ht.substring(Je),Qe++),Vt!==void 0)return Vt}}});return g(Ee,me),Ee}function pr(X,me){var re=this,Ee=re.ready().then(function(){var be=re._dbInfo,Oe;try{Oe=localStorage.key(X)}catch{Oe=null}return Oe&&(Oe=Oe.substring(be.keyPrefix.length)),Oe});return g(Ee,me),Ee}function lr(X){var me=this,re=me.ready().then(function(){for(var Ee=me._dbInfo,be=localStorage.length,Oe=[],Je=0;Je<be;Je++){var ft=localStorage.key(Je);ft.indexOf(Ee.keyPrefix)===0&&Oe.push(ft.substring(Ee.keyPrefix.length))}return Oe});return g(re,X),re}function en(X){var me=this,re=me.keys().then(function(Ee){return Ee.length});return g(re,X),re}function gr(X,me){var re=this;X=w(X);var Ee=re.ready().then(function(){var be=re._dbInfo;localStorage.removeItem(be.keyPrefix+X)});return g(Ee,me),Ee}function Er(X,me,re){var Ee=this;X=w(X);var be=Ee.ready().then(function(){me===void 0&&(me=null);var Oe=me;return new d(function(Je,ft){var Qe=Ee._dbInfo;Qe.serializer.serialize(me,function(Ge,ht){if(ht)ft(ht);else try{localStorage.setItem(Qe.keyPrefix+X,Ge),Je(Oe)}catch(Vt){(Vt.name==="QuotaExceededError"||Vt.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ft(Vt),ft(Vt)}})})});return g(be,re),be}function on(X,me){if(me=v.apply(this,arguments),X=typeof X!="function"&&X||{},!X.name){var re=this.config();X.name=X.name||re.name,X.storeName=X.storeName||re.storeName}var Ee=this,be;return X.name?be=new d(function(Oe){X.storeName?Oe(ue(X,Ee._defaultConfig)):Oe(X.name+"/")}).then(function(Oe){for(var Je=localStorage.length-1;Je>=0;Je--){var ft=localStorage.key(Je);ft.indexOf(Oe)===0&&localStorage.removeItem(ft)}}):be=d.reject("Invalid arguments"),g(be,me),be}var sr={_driver:"localStorageWrapper",_initStorage:Me,_support:_t(),iterate:Ot,getItem:wt,setItem:Er,removeItem:gr,clear:Le,length:en,key:pr,keys:lr,dropInstance:on},Ur=function(X,me){return X===me||typeof X=="number"&&typeof me=="number"&&isNaN(X)&&isNaN(me)},gn=function(X,me){for(var re=X.length,Ee=0;Ee<re;){if(Ur(X[Ee],me))return!0;Ee++}return!1},Br=Array.isArray||function(X){return Object.prototype.toString.call(X)==="[object Array]"},Zn={},Si={},ei={INDEXEDDB:tt,WEBSQL:lt,LOCALSTORAGE:sr},Oi=[ei.INDEXEDDB._driver,ei.WEBSQL._driver,ei.LOCALSTORAGE._driver],Ii=["dropInstance"],oi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ii),Fn={description:"",driver:Oi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ra(X,me){X[me]=function(){var re=arguments;return X.ready().then(function(){return X[me].apply(X,re)})}}function $i(){for(var X=1;X<arguments.length;X++){var me=arguments[X];if(me)for(var re in me)me.hasOwnProperty(re)&&(Br(me[re])?arguments[0][re]=me[re].slice():arguments[0][re]=me[re])}return arguments[0]}var _a=function(){function X(me){o(this,X);for(var re in ei)if(ei.hasOwnProperty(re)){var Ee=ei[re],be=Ee._driver;this[re]=be,Zn[be]||this.defineDriver(Ee)}this._defaultConfig=$i({},Fn),this._config=$i({},this._defaultConfig,me),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return X.prototype.config=function(me){if((typeof me>"u"?"undefined":a(me))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var re in me){if(re==="storeName"&&(me[re]=me[re].replace(/\W/g,"_")),re==="version"&&typeof me[re]!="number")return new Error("Database version must be a number.");this._config[re]=me[re]}return"driver"in me&&me.driver?this.setDriver(this._config.driver):!0}else return typeof me=="string"?this._config[me]:this._config},X.prototype.defineDriver=function(me,re,Ee){var be=new d(function(Oe,Je){try{var ft=me._driver,Qe=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!me._driver){Je(Qe);return}for(var Ge=oi.concat("_initStorage"),ht=0,Vt=Ge.length;ht<Vt;ht++){var Tr=Ge[ht],Wr=!gn(Ii,Tr);if((Wr||me[Tr])&&typeof me[Tr]!="function"){Je(Qe);return}}var jr=function(){for(var qr=function(he){return function(){var Se=new Error("Method "+he+" is not implemented by the current driver"),Ce=d.reject(Se);return g(Ce,arguments[arguments.length-1]),Ce}},P=0,D=Ii.length;P<D;P++){var W=Ii[P];me[W]||(me[W]=qr(W))}};jr();var _n=function(qr){Zn[ft]&&console.info("Redefining LocalForage driver: "+ft),Zn[ft]=me,Si[ft]=qr,Oe()};"_support"in me?me._support&&typeof me._support=="function"?me._support().then(_n,Je):_n(!!me._support):_n(!0)}catch(qr){Je(qr)}});return m(be,re,Ee),be},X.prototype.driver=function(){return this._driver||null},X.prototype.getDriver=function(me,re,Ee){var be=Zn[me]?d.resolve(Zn[me]):d.reject(new Error("Driver not found."));return m(be,re,Ee),be},X.prototype.getSerializer=function(me){var re=d.resolve(Yr);return m(re,me),re},X.prototype.ready=function(me){var re=this,Ee=re._driverSet.then(function(){return re._ready===null&&(re._ready=re._initDriver()),re._ready});return m(Ee,me,me),Ee},X.prototype.setDriver=function(me,re,Ee){var be=this;Br(me)||(me=[me]);var Oe=this._getSupportedDrivers(me);function Je(){be._config.driver=be.driver()}function ft(ht){return be._extend(ht),Je(),be._ready=be._initStorage(be._config),be._ready}function Qe(ht){return function(){var Vt=0;function Tr(){for(;Vt<ht.length;){var Wr=ht[Vt];return Vt++,be._dbInfo=null,be._ready=null,be.getDriver(Wr).then(ft).catch(Tr)}Je();var jr=new Error("No available storage method found.");return be._driverSet=d.reject(jr),be._driverSet}return Tr()}}var Ge=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=Ge.then(function(){var ht=Oe[0];return be._dbInfo=null,be._ready=null,be.getDriver(ht).then(function(Vt){be._driver=Vt._driver,Je(),be._wrapLibraryMethodsWithReady(),be._initDriver=Qe(Oe)})}).catch(function(){Je();var ht=new Error("No available storage method found.");return be._driverSet=d.reject(ht),be._driverSet}),m(this._driverSet,re,Ee),this._driverSet},X.prototype.supports=function(me){return!!Si[me]},X.prototype._extend=function(me){$i(this,me)},X.prototype._getSupportedDrivers=function(me){for(var re=[],Ee=0,be=me.length;Ee<be;Ee++){var Oe=me[Ee];this.supports(Oe)&&re.push(Oe)}return re},X.prototype._wrapLibraryMethodsWithReady=function(){for(var me=0,re=oi.length;me<re;me++)ra(this,oi[me])},X.prototype.createInstance=function(me){return new X(me)},X}(),as=new _a;n.exports=as},{3:3}]},{},[4])(4)})}),qje=jse((t,e)=>{(function(r,n){typeof t=="object"&&typeof e<"u"?n(t):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],n):n(r.LocalforageDriverMemory={})})(typeof self<"u"?self:t,function(r){var n="localforage-driver-memory";function i(F){var j=typeof Symbol=="function"&&F[Symbol.iterator],z=0;return j?j.call(F):{next:function(){return F&&z>=F.length&&(F=void 0),{value:F&&F[z++],done:!F}}}}function a(F,j){F=F||[],j=j||{};try{return new Blob(F,j)}catch(k){if(k.name!=="TypeError")throw k;for(var z=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,$=new z,H=0;H<F.length;H+=1)$.append(F[H]);return $.getBlob(j.type)}}var o=/^~~local_forage_type~([^~]+)~/,s=9,c=s+4,u=Object.prototype.toString;function f(F){var j=F.length*.75,z=F.length;F[F.length-1]==="="&&(j--,F[F.length-2]==="="&&j--);for(var $=new ArrayBuffer(j),H=new Uint8Array($),k=0,M=0;k<z;k+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k]),ge="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+1]),Q="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+2]),te="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(F[k+3]);H[M++]=G<<2|ge>>4,H[M++]=(ge&15)<<4|Q>>2,H[M++]=(Q&3)<<6|te&63}return $}function d(F){for(var j=new Uint8Array(F),z="",$=0;$<j.length;$+=3)z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$]>>2],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$]&3)<<4|j[$+1]>>4],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(j[$+1]&15)<<2|j[$+2]>>6],z+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[j[$+2]&63];return j.length%3===2?z=z.substring(0,z.length-1)+"=":j.length%3===1&&(z=z.substring(0,z.length-2)+"=="),z}function g(F,j){var z="";if(F&&(z=u.call(F)),F&&(z==="[object ArrayBuffer]"||F.buffer&&u.call(F.buffer)==="[object ArrayBuffer]")){var $=void 0,H="__lfsc__:";F instanceof ArrayBuffer?($=F,H+="arbf"):($=F.buffer,z==="[object Int8Array]"?H+="si08":z==="[object Uint8Array]"?H+="ui08":z==="[object Uint8ClampedArray]"?H+="uic8":z==="[object Int16Array]"?H+="si16":z==="[object Uint16Array]"?H+="ur16":z==="[object Int32Array]"?H+="si32":z==="[object Uint32Array]"?H+="ui32":z==="[object Float32Array]"?H+="fl32":z==="[object Float64Array]"?H+="fl64":j(new Error("Failed to get type for BinaryArray"))),j(H+d($))}else if(z==="[object Blob]"){var k=new FileReader;k.onload=function(){var M="~~local_forage_type~"+F.type+"~"+d(this.result);j("__lfsc__:blob"+M)},k.readAsArrayBuffer(F)}else try{j(JSON.stringify(F))}catch(M){console.error("Couldn't convert value into a JSON string: ",F),j(null,M)}}function m(F){if(F.substring(0,s)!=="__lfsc__:")return JSON.parse(F);var j=F.substring(c),z=F.substring(s,c),$;if(z==="blob"&&o.test(j)){var H=j.match(o);$=H[1],j=j.substring(H[0].length)}var k=f(j);switch(z){case"arbf":return k;case"blob":return a([k],{type:$});case"si08":return new Int8Array(k);case"ui08":return new Uint8Array(k);case"uic8":return new Uint8ClampedArray(k);case"si16":return new Int16Array(k);case"ur16":return new Uint16Array(k);case"si32":return new Int32Array(k);case"ui32":return new Uint32Array(k);case"fl32":return new Float32Array(k);case"fl64":return new Float64Array(k);default:throw new Error("Unkown type: "+z)}}function w(F){var j,z;if(F===null||typeof F!="object"||"isActiveClone"in F)return F;var $=F instanceof Date?new Date(F):F.constructor();try{for(var H=i(Object.keys(F)),k=H.next();!k.done;k=H.next()){var M=k.value;Object.prototype.hasOwnProperty.call(F,M)&&(F.isActiveClone=null,$[M]=w(F[M]),delete F.isActiveClone)}}catch(G){j={error:G}}finally{try{k&&!k.done&&(z=H.return)&&z.call(H)}finally{if(j)throw j.error}}return $}function v(F,j){return(F.name||j.name)+"/"+(F.storeName||j.storeName)+"/"}function y(F,j){j&&F.then(function(z){j(null,z)},function(z){j(z)})}function _(){for(var F=[],j=0;j<arguments.length;j++)F[j]=arguments[j];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function b(F,j){var z=this;if(j=_.apply(this,arguments),F=typeof F!="function"&&F||{},!F.name){var $=this.config();F.name=F.name||$.name,F.storeName=F.storeName||$.storeName}var H;return F.name?H=new Promise(function(k){F.storeName?k(v(F,z._defaultConfig)):k(F.name+"/")}):H=Promise.reject("Invalid arguments"),{promise:H,callback:j}}function A(F){return typeof F!="string"&&(console.warn(F+" used as a key, but it is not a string."),F=String(F)),F}var x={bufferToString:d,deserialize:m,serialize:g,stringToBuffer:f},O={},E=function(){function F(j){this.kp=j,this.data={}}return F.resolve=function(j){return O[j]||(O[j]=new F(j)),O[j]},F.prototype.clear=function(){this.data={}},F.prototype.drop=function(){this.clear(),delete O[this.kp]},F.prototype.get=function(j){return this.data[j]},F.prototype.key=function(j){return this.keys()[j]},F.prototype.keys=function(){return Object.keys(this.data)},F.prototype.rm=function(j){delete this.data[j]},F.prototype.set=function(j,z){this.data[j]=z},F}();function p(F){var j=F?w(F):{},z=v(j,this._defaultConfig),$=E.resolve(z);return this._dbInfo=j,this._dbInfo.serializer=x,this._dbInfo.keyPrefix=z,this._dbInfo.mStore=$,Promise.resolve()}function I(F){var j=this,z=this.ready().then(function(){j._dbInfo.mStore.clear()});return y(z,F),z}function C(F,j){var z=b.apply(this,arguments),$=z.promise,H=z.callback,k=$.then(function(M){E.resolve(M).drop()});return y(k,H),$}function L(F,j){var z=this;F=A(F);var $=this.ready().then(function(){var H=z._dbInfo.mStore.get(F);return H==null?null:z._dbInfo.serializer.deserialize(H)});return y($,j),$}function q(F,j){var z=this,$=this.ready().then(function(){for(var H=z._dbInfo.mStore,k=H.keys(),M=0;M<k.length;M++){var G=H.get(k[M]);if(G&&(G=z._dbInfo.serializer.deserialize(G)),G=F(G,k[M],M+1),G!==void 0)return G}});return y($,j),$}function le(F,j){var z=this,$=this.ready().then(function(){var H;try{H=z._dbInfo.mStore.key(F),H===void 0&&(H=null)}catch{H=null}return H});return y($,j),$}function pe(F){var j=this,z=this.ready().then(function(){return j._dbInfo.mStore.keys()});return y(z,F),z}function B(F){var j=this.keys().then(function(z){return z.length});return y(j,F),j}function U(F,j){var z=this;F=A(F);var $=this.ready().then(function(){z._dbInfo.mStore.rm(F)});return y($,j),$}function K(F,j,z){var $=this;F=A(F);var H=this.ready().then(function(){j===void 0&&(j=null);var k=j;return new Promise(function(M,G){$._dbInfo.serializer.serialize(j,function(ge,Q){if(Q)G(Q);else try{$._dbInfo.mStore.set(F,ge),M(k)}catch(te){G(te)}})})});return y(H,z),H}var ne=!0;r._support=ne,r._driver=n,r._initStorage=p,r.clear=I,r.dropInstance=C,r.getItem=L,r.iterate=q,r.key=le,r.keys=pe,r.length=B,r.removeItem=U,r.setItem=K,Object.defineProperty(r,"__esModule",{value:!0})})}),FN=qse(jje()),UY=qse(qje()),Hje={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function zje(t){for(let[e,r]of Object.entries(Hje))t.style[e]=r}function Vje(t){return!![].slice.call(document.querySelectorAll(".magic-iframe")).find(r=>r.src.includes(t))}var Gje=class extends $je{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(t=>{let e=()=>{if(Vje(encodeURIComponent(this.parameters)))KFe().log();else{let r=document.createElement("iframe");r.classList.add("magic-iframe"),r.dataset.magicIframeLabel=JA(this.endpoint).host,r.title="Secure Modal",r.src=JA(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,zje(r),document.body.appendChild(r),t(r)}};["loaded","interactive","complete"].includes(document.readyState)?e():window.addEventListener("load",e,!1)}),window.addEventListener("message",t=>{var e;if(t.origin===this.endpoint&&t.data&&t.data.msgType&&this.messageHandlers.size){t.data.response=(e=t.data.response)!=null?e:{};for(let r of this.messageHandlers.values())r(t)}})}showOverlay(){return Tx(this,null,function*(){let t=yield this.iframe;t.style.display="block",this.activeElement=document.activeElement,t.focus()})}hideOverlay(){return Tx(this,null,function*(){var t;let e=yield this.iframe;e.style.display="none",(t=this.activeElement)!=null&&t.focus&&this.activeElement.focus(),this.activeElement=null})}_post(t){return Tx(this,null,function*(){let e=yield this.iframe;if(e&&e.contentWindow)e.contentWindow.postMessage(t,this.endpoint);else throw xse()})}},Wje=jFe(Bse,{platform:"web",sdkName:"magic-sdk",version:"21.4.1",defaultEndpoint:"https://auth.magic.link/",ViewController:Gje,configureStorage:()=>Tx(void 0,null,function*(){let t=FN.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield t.defineDriver(UY),yield t.setDriver([FN.default.INDEXEDDB,FN.default.LOCALSTORAGE,UY._driver]),t})});const Xk=Object.freeze(Object.defineProperty({__proto__:null,DeepLinkPage:fse,DeviceVerificationEventEmit:KA,DeviceVerificationEventOnReceived:gse,EthChainType:yse,Events:Vb,Extension:Xh,ExtensionError:zk,ExtensionWarning:O5,LoginWithEmailOTPEventEmit:G0,LoginWithEmailOTPEventOnReceived:pse,LoginWithMagicLinkEventEmit:dse,LoginWithMagicLinkEventOnReceived:hse,Magic:Wje,MagicIncomingWindowMessage:Ah,MagicOutgoingWindowMessage:R1,MagicPayloadMethod:vr,RPCError:N1,RPCErrorCode:pO,RecoveryMethodType:mse,SDKError:Id,SDKErrorCode:Od,SDKWarning:Uw,SDKWarningCode:um,Wallets:_s,isPromiEvent:Tse},Symbol.toStringTag,{value:"Module"})),Kje=uo(Xk);var Hse={exports:{}},jN={exports:{}},BY;function zse(){return BY||(BY=1,function(t,e){(function(r,n){t.exports=n()})(Ne,function(){var r=r||function(n,i){var a=Object.create||function(){function y(){}return function(_){var b;return y.prototype=_,b=new y,y.prototype=null,b}}(),o={},s=o.lib={},c=s.Base=function(){return{extend:function(y){var _=a(this);return y&&_.mixIn(y),(!_.hasOwnProperty("init")||this.init===_.init)&&(_.init=function(){_.$super.init.apply(this,arguments)}),_.init.prototype=_,_.$super=this,_},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var _ in y)y.hasOwnProperty(_)&&(this[_]=y[_]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=s.WordArray=c.extend({init:function(y,_){y=this.words=y||[],_!=i?this.sigBytes=_:this.sigBytes=y.length*4},toString:function(y){return(y||d).stringify(this)},concat:function(y){var _=this.words,b=y.words,A=this.sigBytes,x=y.sigBytes;if(this.clamp(),A%4)for(var O=0;O<x;O++){var E=b[O>>>2]>>>24-O%4*8&255;_[A+O>>>2]|=E<<24-(A+O)%4*8}else for(var O=0;O<x;O+=4)_[A+O>>>2]=b[O>>>2];return this.sigBytes+=x,this},clamp:function(){var y=this.words,_=this.sigBytes;y[_>>>2]&=4294967295<<32-_%4*8,y.length=n.ceil(_/4)},clone:function(){var y=c.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var _=[],b=function(p){var p=p,I=987654321,C=4294967295;return function(){I=36969*(I&65535)+(I>>16)&C,p=18e3*(p&65535)+(p>>16)&C;var L=(I<<16)+p&C;return L/=4294967296,L+=.5,L*(n.random()>.5?1:-1)}},A=0,x;A<y;A+=4){var O=b((x||n.random())*4294967296);x=O()*987654071,_.push(O()*4294967296|0)}return new u.init(_,y)}}),f=o.enc={},d=f.Hex={stringify:function(y){for(var _=y.words,b=y.sigBytes,A=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;A.push((O>>>4).toString(16)),A.push((O&15).toString(16))}return A.join("")},parse:function(y){for(var _=y.length,b=[],A=0;A<_;A+=2)b[A>>>3]|=parseInt(y.substr(A,2),16)<<24-A%8*4;return new u.init(b,_/2)}},g=f.Latin1={stringify:function(y){for(var _=y.words,b=y.sigBytes,A=[],x=0;x<b;x++){var O=_[x>>>2]>>>24-x%4*8&255;A.push(String.fromCharCode(O))}return A.join("")},parse:function(y){for(var _=y.length,b=[],A=0;A<_;A++)b[A>>>2]|=(y.charCodeAt(A)&255)<<24-A%4*8;return new u.init(b,_)}},m=f.Utf8={stringify:function(y){try{return decodeURIComponent(escape(g.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return g.parse(unescape(encodeURIComponent(y)))}},w=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=m.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var _=this._data,b=_.words,A=_.sigBytes,x=this.blockSize,O=x*4,E=A/O;y?E=n.ceil(E):E=n.max((E|0)-this._minBufferSize,0);var p=E*x,I=n.min(p*4,A);if(p){for(var C=0;C<p;C+=x)this._doProcessBlock(b,C);var L=b.splice(0,p);_.sigBytes-=I}return new u.init(L,I)},clone:function(){var y=c.clone.call(this);return y._data=this._data.clone(),y},_minBufferSize:0});s.Hasher=w.extend({cfg:c.extend(),init:function(y){this.cfg=this.cfg.extend(y),this.reset()},reset:function(){w.reset.call(this),this._doReset()},update:function(y){return this._append(y),this._process(),this},finalize:function(y){y&&this._append(y);var _=this._doFinalize();return _},blockSize:16,_createHelper:function(y){return function(_,b){return new y.init(b).finalize(_)}},_createHmacHelper:function(y){return function(_,b){return new v.HMAC.init(y,b).finalize(_)}}});var v=o.algo={};return o}(Math);return r})}(jN)),jN.exports}(function(t,e){(function(r,n){t.exports=n(zse())})(Ne,function(r){return function(n){var i=r,a=i.lib,o=a.WordArray,s=a.Hasher,c=i.algo,u=[],f=[];(function(){function m(_){for(var b=n.sqrt(_),A=2;A<=b;A++)if(!(_%A))return!1;return!0}function w(_){return(_-(_|0))*4294967296|0}for(var v=2,y=0;y<64;)m(v)&&(y<8&&(u[y]=w(n.pow(v,1/2))),f[y]=w(n.pow(v,1/3)),y++),v++})();var d=[],g=c.SHA256=s.extend({_doReset:function(){this._hash=new o.init(u.slice(0))},_doProcessBlock:function(m,w){for(var v=this._hash.words,y=v[0],_=v[1],b=v[2],A=v[3],x=v[4],O=v[5],E=v[6],p=v[7],I=0;I<64;I++){if(I<16)d[I]=m[w+I]|0;else{var C=d[I-15],L=(C<<25|C>>>7)^(C<<14|C>>>18)^C>>>3,q=d[I-2],le=(q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10;d[I]=L+d[I-7]+le+d[I-16]}var pe=x&O^~x&E,B=y&_^y&b^_&b,U=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),K=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),ne=p+K+pe+f[I]+d[I],F=U+B;p=E,E=O,O=x,x=A+ne|0,A=b,b=_,_=y,y=ne+F|0}v[0]=v[0]+y|0,v[1]=v[1]+_|0,v[2]=v[2]+b|0,v[3]=v[3]+A|0,v[4]=v[4]+x|0,v[5]=v[5]+O|0,v[6]=v[6]+E|0,v[7]=v[7]+p|0},_doFinalize:function(){var m=this._data,w=m.words,v=this._nDataBytes*8,y=m.sigBytes*8;return w[y>>>5]|=128<<24-y%32,w[(y+64>>>9<<4)+14]=n.floor(v/4294967296),w[(y+64>>>9<<4)+15]=v,m.sigBytes=w.length*4,this._process(),this._hash},clone:function(){var m=s.clone.call(this);return m._hash=this._hash.clone(),m}});i.SHA256=s._createHelper(g),i.HmacSHA256=s._createHmacHelper(g)}(Math),r.SHA256})})(Hse);var Yje=Hse.exports;const Qje=Dc(Yje);var Vse={exports:{}};(function(t,e){(function(r,n){t.exports=n(zse())})(Ne,function(r){return function(){var n=r,i=n.lib,a=i.WordArray,o=n.enc;o.Base64={stringify:function(c){var u=c.words,f=c.sigBytes,d=this._map;c.clamp();for(var g=[],m=0;m<f;m+=3)for(var w=u[m>>>2]>>>24-m%4*8&255,v=u[m+1>>>2]>>>24-(m+1)%4*8&255,y=u[m+2>>>2]>>>24-(m+2)%4*8&255,_=w<<16|v<<8|y,b=0;b<4&&m+b*.75<f;b++)g.push(d.charAt(_>>>6*(3-b)&63));var A=d.charAt(64);if(A)for(;g.length%4;)g.push(A);return g.join("")},parse:function(c){var u=c.length,f=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var g=0;g<f.length;g++)d[f.charCodeAt(g)]=g}var m=f.charAt(64);if(m){var w=c.indexOf(m);w!==-1&&(u=w)}return s(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(c,u,f){for(var d=[],g=0,m=0;m<u;m++)if(m%4){var w=f[c.charCodeAt(m-1)]<<m%4*2,v=f[c.charCodeAt(m)]>>>6-m%4*2;d[g>>>2]|=(w|v)<<24-g%4*8,g++}return a.create(d,g)}}(),r.enc.Base64})})(Vse);var Jje=Vse.exports;const Xje=Dc(Jje);var Bw=(t,e,r)=>new Promise((n,i)=>{var a=c=>{try{s(r.next(c))}catch(u){i(u)}},o=c=>{try{s(r.throw(c))}catch(u){i(u)}},s=c=>c.done?n(c.value):Promise.resolve(c.value).then(a,o);s((r=r.apply(t,e)).next())}),Gse=(t=>(t.ParseRedirectResult="magic_oauth_parse_redirect_result",t))(Gse||{}),Wse=(t=>(t.InvalidRequest="invalid_request",t.InvalidClient="invalid_client",t.InvalidScope="invalid_scope",t.InvalidGrant="invalid_grant",t.UnauthorizedClient="unauthorized_client",t.UnsupportedResponseType="unsupported_response_type",t.UnsupportedGrantType="unsupported_grant_type",t.UnsupportedTokenType="unsupported_token_type",t.AccessDenied="access_denied",t.ServerError="server_error",t.TemporarilyUnavailable="temporarily_unavailable",t))(Wse||{}),FY="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",Kse=typeof window<"u"&&!!window.crypto,Zje=Kse&&!!window.crypto.subtle;function eqe(t){return Array.from(t).map(e=>FY[e%FY.length]).join("")}function jY(t){let e=r=>r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");if(t instanceof ArrayBuffer){let r=new Uint8Array(t),n=Array.from(r).map(a=>String.fromCharCode(a)).join(""),i=btoa(n);return e(i)}return e(Xje.stringify(t))}function tqe(t){return Bw(this,null,function*(){if(Zje){let e=new TextEncoder().encode(t);return crypto.subtle.digest("SHA-256",e).then(jY)}return jY(Qje(t))})}function qY(t){let e=new Uint8Array(t);if(Kse)window.crypto.getRandomValues(e);else for(let r=0;r<t;r+=1)e[r]=Math.floor(Math.random()*Math.floor(255));return eqe(e)}function rqe(){return Bw(this,null,function*(){let t=qY(128),e=qY(128),r=yield tqe(e);return{verifier:e,challenge:r,state:t}})}var nqe=class extends Xh.Internal{constructor(){super(...arguments),this.name="oauth",this.config={},this.compat={"magic-sdk":">=2.4.6","@magic-sdk/react-native":!1,"@magic-sdk/react-native-bare":!1,"@magic-sdk/react-native-expo":!1}}loginWithRedirect(t){return this.utils.createPromiEvent(e=>Bw(this,null,function*(){let{provider:r,query:n}=yield iqe.call(this,t);window.location.href=new URL(`/v1/oauth2/${r}/start?${n}`,this.sdk.endpoint).href,e()}))}getRedirectResult(){let t=window.location.search,e=window.location.origin+window.location.pathname;return window.history.replaceState(null,"",e),aqe.call(this,t)}},XA="oauth_redirect_metadata";function iqe(t){return Bw(this,null,function*(){yield this.utils.storage.removeItem(XA);let{provider:e,redirectURI:r,scope:n,loginHint:i}=t,{verifier:a,challenge:o,state:s}=yield rqe(),c=JSON.stringify({verifier:a,state:s});return yield this.utils.storage.setItem(XA,c),{query:[`magic_api_key=${encodeURIComponent(this.sdk.apiKey)}`,`magic_challenge=${encodeURIComponent(o)}`,`state=${encodeURIComponent(s)}`,`platform=${encodeURIComponent("web")}`,n&&`scope=${encodeURIComponent(n.join(" "))}`,r&&`redirect_uri=${encodeURIComponent(r)}`,i&&`login_hint=${encodeURIComponent(i)}`].reduce((u,f)=>f?`${u}&${f}`:u),provider:e,redirectURI:r}})}function aqe(t){return this.utils.createPromiEvent((e,r)=>Bw(this,null,function*(){var n;let i=yield this.utils.storage.getItem(XA),{verifier:a,state:o}=JSON.parse(i);this.utils.storage.removeItem(XA);let s=this.utils.createJsonRpcRequestPayload("magic_oauth_parse_redirect_result",[t,a,o]),c=yield this.request(s),u=c,f=c;f.error&&r(this.createError(f.error,(n=f.error_description)!=null?n:"An error occurred.",{errorURI:f.error_uri,provider:f.provider})),e(u)}))}const Zk=Object.freeze(Object.defineProperty({__proto__:null,OAuthErrorCode:Wse,OAuthExtension:nqe,OAuthPayloadMethods:Gse},Symbol.toStringTag,{value:"Module"})),oqe=uo(Zk);var sqe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),cqe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),HY=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&sqe(e,t,r);return cqe(e,t),e};Object.defineProperty(hO,"__esModule",{value:!0});hO.MagicConnector=void 0;const zY=Ml,VY=qs,uqe=jS;class lqe extends uqe.AbstractConnector{constructor(e){super({supportedChainIds:VY.getConfiguration()[zY.ProviderType.MAGIC].chains}),this.activate=async()=>{var r;if(this.magic=await this.buildMagicInstance(this.chainId),!await this.magic.user.isLoggedIn())throw new Error("Magic: user isn't logged in");const i=await this.getProvider(),a=await i.request({method:"eth_accounts"});return this.account=(r=a[0])!==null&&r!==void 0?r:null,{provider:i,chainId:this.chainId,account:this.account}},this.getProvider=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");const r=await this.magic.wallet.getProvider();return Object.assign(Object.assign({},r),{request:new Proxy(r.request,{apply:async(n,i,a)=>{var o,s,c;if(((o=a[0])===null||o===void 0?void 0:o.method)==="wallet_switchEthereumChain")try{const u=parseInt((c=(s=a[0])===null||s===void 0?void 0:s.params[0])===null||c===void 0?void 0:c.chainId,16);return this.supportedChainIds&&!this.supportedChainIds.includes(u)?{code:2020202,message:"Unsupported Magic ChainId"}:(this.magic=await this.buildMagicInstance(u),this.emitUpdate({chainId:u}),null)}catch{return{code:2020201,message:"Error changing the Magic ChainId"}}return n.bind(r)(...a)}})})},this.getChainId=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.chainId},this.getAccount=async()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");return this.account},this.deactivate=()=>{if(!this.magic)throw new Error("Magic: instance was not initialized");this.magic.user.logout(),this.emitDeactivate()},this.buildMagicInstance=async r=>{const{Magic:n}=await Promise.resolve().then(()=>HY(Kje)),{OAuthExtension:i}=await Promise.resolve().then(()=>HY(oqe)),a=VY.getConfiguration()[zY.ProviderType.MAGIC];return new n(a.apiKey,{extensions:[new i],network:{rpcUrl:a.urls[r],chainId:r}})},this.chainId=e,this.account=null}}hO.MagicConnector=lqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(jS,t),r(HS,t),r(XS,t),r(ZS,t),r(eO,t),r(tO,t),r(hO,t)})(ik);var Yse={},Fw={};Object.defineProperty(Fw,"__esModule",{value:!0});Fw.Storage=void 0;class fqe{}Fw.Storage=fqe;var vO={};Object.defineProperty(vO,"__esModule",{value:!0});vO.LocalStorage=void 0;const dqe=Fw;class hqe extends dqe.Storage{get(e){const r=window.localStorage.getItem(e);return r===null?void 0:r}set(e,r){window.localStorage.setItem(e,r)}remove(e){window.localStorage.removeItem(e)}removeRegExp(e){for(let r=localStorage.length-1;r>=0;r--){const n=localStorage.key(r);n&&e.test(n)&&localStorage.removeItem(n)}}}vO.LocalStorage=hqe;(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Fw,t),r(vO,t)})(Yse);var bO={};Object.defineProperty(bO,"__esModule",{value:!0});bO.ProviderAdapter=void 0;class eL{constructor(e){this.provider=e,this.id=0,this.on=(r,n)=>this.provider.on(r,n),this.emit=(r,...n)=>this.provider.emit(r,n),this.removeListener=(r,n)=>this.provider.removeListener(r,n),this.request=async({method:r,params:n})=>this.isModernProvider()?this.provider.request({method:r,params:n}):this.send(r,n),this.sendAsync=async(r,n)=>this.hasSendAsync()?this.provider.sendAsync(r,(i,a)=>{a&&!a.hasOwnProperty("result")?n(i,{id:0,jsonrpc:"2.0",result:a}):n(i,a)}):this.send(r,n)}static adapt(e){const r=new eL(e);return Object.assign(Object.assign({},e),{on:r.on,emit:r.emit,removeListener:r.removeListener,request:r.request,sendAsync:r.sendAsync,send:r.send.bind(r)})}async send(e,r){let n,i,a;const o=typeof r=="function";if(o){const s=e;i=s.params||[],n=s.method,a=r}else n=e,i=r||[],a=(s,c)=>{if(s)throw s;return c};if(this.isModernProvider()){const[s,c]=await this.provider.request({method:n,params:i}).then(f=>[null,f]).catch(f=>[f,void 0]);return a(s,o?{id:"",jsonrpc:"2.0",result:c}:c)}else{this.patchOldMobile();const[s,c]=o?await new Promise(u=>this.provider.send(e,(f,d)=>{u([f,d])})):await new Promise(u=>this.provider.send({jsonrpc:"2.0",id:++this.id,method:n,params:i},(f,d)=>{u([d&&d.hasOwnProperty("error")?d.error:f,d&&d.hasOwnProperty("result")?d.result:d])}));return a(s,c)}}isModernProvider(){return typeof this.provider.request=="function"}hasSendAsync(){return typeof this.provider.sendAsync=="function"}patchOldMobile(){this.provider&&!this.provider.isDapper&&!this.provider.isFortmatic&&!this.provider.isMetamask&&this.hasSendAsync()&&this.provider.send!==this.provider.sendAsync&&(this.provider.send=this.provider.sendAsync)}}bO.ProviderAdapter=eL;Object.defineProperty(Ty,"__esModule",{value:!0});Ty.connection=Ty.ConnectionManager=void 0;const GY=ns(),Vo=Sc,PE=y4e,ff=ik,pqe=Yse,qN=qs,WY=bO;class Qse{constructor(e){this.storage=e,this.getWalletName=()=>{if(this.connector instanceof ff.WalletConnectV2Connector)return this.connector.getWalletName()},this.clearConnectionData=()=>{const{storageKey:r}=qN.getConfiguration();this.storage.remove(r),ff.WalletConnectV2Connector.clearStorage(this.storage)},this.handleWeb3ReactDeactivate=()=>{this.connector&&(this.connector.removeListener(PE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),this.connector.removeAllListeners(PE.ConnectorEvent.Update)),this.disconnect().catch(console.error)}}async connect(e,r=GY.ChainId.ETHEREUM_MAINNET){this.connector=this.buildConnector(e,r),this.connector.on(PE.ConnectorEvent.Deactivate,this.handleWeb3ReactDeactivate),e===Vo.ProviderType.MAGIC&&this.connector.on(PE.ConnectorEvent.Update,({chainId:a})=>{a&&this.setConnectionData(e,a)});const{provider:n,account:i}=await this.connector.activate();return this.setConnectionData(e,r),{provider:WY.ProviderAdapter.adapt(n),providerType:e,account:i||"",chainId:r}}async tryPreviousConnection(){const e=this.getConnectionData();if(!e)throw new Error("Could not find a valid provider. Make sure to call the `connect` method first");const r=await this.connect(e.providerType,e.chainId);if(r.providerType===Vo.ProviderType.INJECTED){const n=await r.provider.request({method:"eth_chainId"}),i=n?parseInt(n,16):null;i&&e.chainId!==i&&this.setConnectionData(e.providerType,i)}return Object.assign(Object.assign({},r),{chainId:this.getConnectionData().chainId})}getAvailableProviders(){const e=[Vo.ProviderType.FORTMATIC,Vo.ProviderType.WALLET_CONNECT,Vo.ProviderType.WALLET_LINK];return typeof window<"u"&&window.ethereum!==void 0?e.unshift(Vo.ProviderType.INJECTED):e.unshift(Vo.ProviderType.METAMASK_MOBILE),e}async disconnect(){this.connector&&(this.connector.deactivate(),this.isClosableConnector()&&await this.connector.close()),this.clearConnectionData(),this.connector=void 0}async getProvider(){if(!this.connector)throw new Error("No valid connector found. Please .connect() first");return this.connector.getProvider()}async createProvider(e,r=GY.ChainId.ETHEREUM_MAINNET){const i=await this.buildConnector(e,r).getProvider();return WY.ProviderAdapter.adapt(i)}buildConnector(e,r){switch(e){case Vo.ProviderType.INJECTED:return new ff.InjectedConnector(r);case Vo.ProviderType.FORTMATIC:return new ff.FortmaticConnector(r);case Vo.ProviderType.MAGIC:return new ff.MagicConnector(r);case Vo.ProviderType.WALLET_LINK:return new ff.WalletLinkConnector(r);case Vo.ProviderType.NETWORK:return new ff.NetworkConnector(r);case Vo.ProviderType.WALLET_CONNECT_V2:return new ff.WalletConnectV2Connector(r);default:throw new Error(`Invalid provider ${e}`)}}getConnectionData(){const{storageKey:e}=qN.getConfiguration(),r=this.storage.get(e);return r?JSON.parse(r):void 0}setConnectionData(e,r){const{storageKey:n}=qN.getConfiguration(),i=JSON.stringify({providerType:e,chainId:r});this.storage.set(n,i)}isClosableConnector(){return this.connector&&typeof this.connector.close<"u"}}Ty.ConnectionManager=Qse;Ty.connection=new Qse(new pqe.LocalStorage);var Jse={};Object.defineProperty(Jse,"__esModule",{value:!0});(function(t){var e=Ne&&Ne.__createBinding||(Object.create?function(n,i,a,o){o===void 0&&(o=a),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[a]}})}:function(n,i,a,o){o===void 0&&(o=a),n[o]=i[a]}),r=Ne&&Ne.__exportStar||function(n,i){for(var a in n)a!=="default"&&!Object.prototype.hasOwnProperty.call(i,a)&&e(i,n,a)};Object.defineProperty(t,"__esModule",{value:!0}),r(Ty,t),r(ik,t),r(qs,t),r(Jse,t)})(Il);const gqe="https://auth-api.decentraland.zone",yqe={AUTH_SERVER_URL:gqe},mqe="https://auth-api.decentraland.org",vqe={AUTH_SERVER_URL:mqe},bqe="https://auth-api.decentraland.today",wqe={AUTH_SERVER_URL:bqe},_qe=z0.createConfig({[z0.Env.DEVELOPMENT]:yqe,[z0.Env.STAGING]:wqe,[z0.Env.PRODUCTION]:vqe},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:{}.VITE_REACT_APP_DCL_DEFAULT_ENV??"dev"}});function HN(t){return t!=null&&typeof t=="object"&&"message"in t}const Eqe="_background_1jvtb_1",xqe="_main_1jvtb_9",Aqe="_left_1jvtb_19",Sqe="_right_1jvtb_28",Oqe="_changeAccount_1jvtb_42",Iqe="_errorLogo_1jvtb_48",Pqe="_logo_1jvtb_57",Tqe="_title_1jvtb_63",Rqe="_description_1jvtb_70",Cqe="_code_1jvtb_77",Nqe="_buttons_1jvtb_84",Dqe="_closeWindow_1jvtb_94",$qe="_errorMessage_1jvtb_100",kr={background:Eqe,main:xqe,left:Aqe,right:Sqe,changeAccount:Oqe,errorLogo:Iqe,logo:Pqe,title:Tqe,description:Rqe,code:Cqe,buttons:Nqe,closeWindow:Dqe,errorMessage:$qe},Mqe=()=>{const t=Bye(),e=P2(),[r,n]=ze.useState(2),[i,a]=ze.useState(!1),o=ze.useRef(),[s,c]=ze.useState(),u=ze.useRef(),f=ze.useRef(),d=t.requestId??"",g=ze.useCallback(async()=>new ute(await Il.connection.getProvider()),[]),m=ze.useCallback(()=>{e(`/login?redirectTo=/auth/requests/${d}&fromRequests=true`)},[]);ze.useEffect(()=>((async()=>{try{await Il.connection.tryPreviousConnection()}catch{m();return}try{const x=await zN("recover",{requestId:d});o.current=x;const p=await(await(await g()).getSigner()).getAddress();if(f.current=p,x.sender&&x.sender!==p.toLowerCase()){n(1);return}u.current=setTimeout(()=>{n(0)},new Date(x.expiration).getTime()-Date.now()),x.method==="dcl_personal_sign"?n(4):n(8)}catch(x){c(HN(x)?x.message:"Unknown error"),n(3)}})(),()=>{clearTimeout(u.current)}),[]),ze.useEffect(()=>{r!==4&&r!==8&&clearTimeout(u.current)},[r]);const w=ze.useCallback(()=>{n(5)},[]),v=ze.useCallback(async()=>{a(!0);try{const O=await(await g()).getSigner(),E=await O.signMessage(o.current.params[0]),p=await zN("outcome",{requestId:d,sender:await O.getAddress(),result:E});if(p.error)throw new Error(p.error);n(7)}catch(x){c(HN(x)?x.message:"Unknown error"),n(6)}finally{a(!1)}},[g,a]),y=ze.useCallback(()=>{n(9)},[]),_=ze.useCallback(async()=>{a(!0);try{const x=await g(),O=await x.getSigner(),E=await x.send(o.current.method,o.current.params),p=await zN("outcome",{requestId:d,sender:await O.getAddress(),result:E});if(p.error)throw new Error(p.error);n(11)}catch(x){c(HN(x)?x.message:"Unknown error"),n(10)}},[g]),b=ze.useCallback(async()=>{await Il.connection.disconnect(),m()},[]),A=ze.useCallback(x=>Ye.jsxs("div",{children:[Ye.jsx("div",{className:kr.background}),Ye.jsxs("div",{className:kr.main,children:[Ye.jsx("div",{className:kr.left,children:x.children}),Ye.jsx("div",{className:kr.right,children:f.current?Ye.jsxs(Ye.Fragment,{children:[Ye.jsx(rae,{lockBeta:!0,panning:!1,disableBackground:!0,profile:f.current,dev:!1}),x.canChangeAccount?Ye.jsx("div",{className:kr.changeAccount,children:Ye.jsx(xc.Button,{disabled:i,inverted:!0,onClick:b,children:"Change Account"})}):null]}):null})]})]}),[]);return r===0?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Looks like you took too long and the request has expired"}),Ye.jsx("div",{className:kr.description,children:"Please return to Decentraland's Desktop App to try again."}),Ye.jsx(nh,{})]}):r===1?Ye.jsxs(A,{canChangeAccount:!0,children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Looks like you are connected with a different account."}),Ye.jsx("div",{className:kr.description,children:"Please change your wallet account to the one connected to the Desktop App."})]}):r===2?Ye.jsx(A,{children:Ye.jsx("div",{className:kr.left,children:Ye.jsx(AS,{active:!0,size:"huge"})})}):r===3?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"There was an error recovering the request..."}),Ye.jsx("div",{className:kr.description,children:"The request is not available anymore. Feel free to create a new one and try again."}),Ye.jsx(nh,{}),Ye.jsx("div",{className:kr.errorMessage,children:s})]}):r===4&&o.current?Ye.jsxs(A,{canChangeAccount:!0,isLoading:i,children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"Verify Sign In"}),Ye.jsx("div",{className:kr.description,children:"Do you see the same verification number on your Desktop App?"}),Ye.jsx("div",{className:kr.code,children:o.current.code}),Ye.jsxs("div",{className:kr.buttons,children:[Ye.jsx(xc.Button,{inverted:!0,disabled:i,onClick:w,children:"No"}),Ye.jsx(xc.Button,{primary:!0,loading:i,disabled:i,onClick:v,children:"Yes, they are the same"})]})]}):r===5?Ye.jsxs(A,{canChangeAccount:!0,children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Did the number not match, or was this action not taken by you?"}),Ye.jsx("div",{className:kr.description,children:"If you're trying to sign in, retry the action. If this action was not initiated by you, dismiss this message."}),Ye.jsx(nh,{})]}):r===7?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"Your account is ready!"}),Ye.jsx("div",{className:kr.description,children:"Return to the Desktop App and enjoy Decentraland."}),Ye.jsx(nh,{})]}):r===8&&o.current?Ye.jsxs(A,{canChangeAccount:!0,isLoading:i,children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"The Desktop App wants to interact with your wallet."}),Ye.jsx("div",{className:kr.description,children:"Review the following data carefully on your wallet before approving it."}),Ye.jsxs("div",{className:kr.buttons,children:[Ye.jsx(xc.Button,{inverted:!0,disabled:i,onClick:y,children:"Deny"}),Ye.jsx(xc.Button,{primary:!0,disabled:i,loading:i,onClick:_,children:"Allow"})]})]}):r===9?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"Was this action not initiated by you?"}),Ye.jsx("div",{className:kr.description,children:"If this action was not initiated by you, dismiss this message."}),Ye.jsx(nh,{})]}):r===11?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.logo}),Ye.jsx("div",{className:kr.title,children:"Wallet interaction complete"}),Ye.jsx("div",{className:kr.description,children:"The action has been executed successfully."}),Ye.jsx(nh,{})]}):r===6||r===10?Ye.jsxs(A,{children:[Ye.jsx("div",{className:kr.errorLogo}),Ye.jsx("div",{className:kr.title,children:"There was an error while trying to submit the request."}),Ye.jsx("div",{className:kr.description,children:"Return to the Desktop App to try again, or contact support if the error persists."}),Ye.jsx(nh,{}),Ye.jsx("div",{className:kr.errorMessage,children:s})]}):null},nh=()=>Ye.jsx("div",{className:kr.closeWindow,children:"You can close this window."}),zN=async(t,e)=>{const r=_qe.get("AUTH_SERVER_URL"),n=sx(r);await new Promise(a=>{n.on("connect",a)});const i=await n.emitWithAck(t,e);if(n.close(),i.error)throw new Error(i.error);return i},kqe=()=>{const t=P2(),e=lw(),r=ze.useCallback(async()=>{try{const n=await Il.connection.tryPreviousConnection();return!!(n.account&&n.provider)}catch{return!1}},[]);return ze.useEffect(()=>{r().then(n=>{n?window.location.href="/":t({pathname:"/login",search:e.search})})},[r,t]),Ye.jsx(AS,{active:!0,size:"huge"})},Xse=()=>{const t=lw(),r=new URLSearchParams(t.search).get("redirectTo"),n=r?decodeURIComponent(r):null;if(n!==null)try{let i;return n.startsWith("/")?i=new URL(n,window.location.origin):i=new URL(n),i.hostname!==window.location.hostname?void 0:i.href}catch{console.error("Can't parse redirectTo URL");return}};var wO={},_O=br;wO.__esModule=!0;var EO=wO.default=void 0,Lqe=_O(Bn()),Uqe=_O(ii);_O(Ln());var Bqe=_O(ze),N0=Wn();function lp(t){var e=t.children,r=t.className,n=t.content,i=t.image,a=t.scrolling,o=(0,Uqe.default)(r,(0,N0.useKeyOnly)(i,"image"),(0,N0.useKeyOnly)(a,"scrolling"),"content"),s=(0,N0.getUnhandledProps)(lp,t),c=(0,N0.getElementType)(lp,t);return Bqe.default.createElement(c,(0,Lqe.default)({},s,{className:o}),N0.childrenUtils.isNil(e)?n:e)}lp.handledProps=["as","children","className","content","image","scrolling"];lp.propTypes={};lp.create=(0,N0.createShorthandFactory)(lp,function(t){return{content:t}});var Fqe=lp;EO=wO.default=Fqe;var xO={},AO={},VN,KY;function jqe(){if(KY)return VN;KY=1;function t(e,r,n,i){var a=-1,o=e==null?0:e.length;for(i&&o&&(n=e[++a]);++a<o;)n=r(n,e[a],a,e);return n}return VN=t,VN}var GN,YY;function qqe(){if(YY)return GN;YY=1;function t(e,r,n,i,a){return a(e,function(o,s,c){n=i?(i=!1,o):r(n,o,s,c)}),n}return GN=t,GN}var WN,QY;function Zse(){if(QY)return WN;QY=1;var t=jqe(),e=_w(),r=wd(),n=qqe(),i=Di();function a(o,s,c){var u=i(o)?t:n,f=arguments.length<3;return u(o,r(s,4),c,f,e)}return WN=a,WN}var KN,JY;function ece(){return JY||(JY=1,KN=function(e,r,n,i){var a=n?n.call(i,e,r):void 0;if(a!==void 0)return!!a;if(e===r)return!0;if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var o=Object.keys(e),s=Object.keys(r);if(o.length!==s.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<o.length;u++){var f=o[u];if(!c(f))return!1;var d=e[f],g=r[f];if(a=n?n.call(i,d,g,f):void 0,a===!1||a===void 0&&d!==g)return!1}return!0}),KN}var TE={},XY;function Hqe(){if(XY)return TE;XY=1;var t=br;TE.__esModule=!0;var e=t(_S());return TE.default=e.default,TE}var Bv={},RE={},ZY;function zqe(){if(ZY)return RE;ZY=1;var t=br;RE.__esModule=!0;var e=t(K$());return RE.default=e.default,RE}var eQ;function Vqe(){if(eQ)return Bv;eQ=1;var t=Ws,e=br;Bv.__esModule=!0,Bv.default=void 0;var r=e(Bn()),n=e(Mc()),i=e(wS()),a=e(Ks()),o=e(ii);e(Ln());var s=t(ze),c=Wn(),u=e(zqe()),f=function(d){(0,n.default)(g,d);function g(){for(var w,v=arguments.length,y=new Array(v),_=0;_<v;_++)y[_]=arguments[_];return w=d.call.apply(d,[this].concat(y))||this,w.handleButtonOverrides=function(b){return{onClick:function(x,O){(0,a.default)(b,"onClick",x,O),(0,a.default)(w.props,"onActionClick",x,O)}}},w}var m=g.prototype;return m.render=function(){var v=this,y=this.props,_=y.actions,b=y.children,A=y.className,x=y.content,O=(0,o.default)("actions",A),E=(0,c.getUnhandledProps)(g,this.props),p=(0,c.getElementType)(g,this.props);return c.childrenUtils.isNil(b)?c.childrenUtils.isNil(x)?s.default.createElement(p,(0,r.default)({},E,{className:O}),(0,i.default)(_,function(I){return u.default.create(I,{overrideProps:v.handleButtonOverrides})})):s.default.createElement(p,(0,r.default)({},E,{className:O}),x):s.default.createElement(p,(0,r.default)({},E,{className:O}),b)},g}(s.Component);return Bv.default=f,f.handledProps=["actions","as","children","className","content","onActionClick"],f.propTypes={},f.create=(0,c.createShorthandFactory)(f,function(d){return{actions:d}}),Bv}var Fv={},tQ;function Gqe(){if(tQ)return Fv;tQ=1;var t=br;Fv.__esModule=!0,Fv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("description",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={};var o=a;return Fv.default=o,Fv}var jv={},rQ;function Wqe(){if(rQ)return jv;rQ=1;var t=br;jv.__esModule=!0,jv.default=void 0;var e=t(Bn()),r=vd,n=t(ii);t(Ln());var i=t(ze),a=Wn();function o(c){var u=c.blurring,f=c.children,d=c.className,g=c.centered,m=c.content,w=c.inverted,v=c.mountNode,y=c.scrolling,_=i.default.useRef(),b=(0,n.default)("ui",(0,a.useKeyOnly)(w,"inverted"),(0,a.useKeyOnly)(!g,"top aligned"),"page modals dimmer transition visible active",d),A=(0,n.default)("dimmable dimmed",(0,a.useKeyOnly)(u,"blurring"),(0,a.useKeyOnly)(y,"scrolling")),x=(0,a.getUnhandledProps)(o,c),O=(0,a.getElementType)(o,c);return(0,a.useClassNamesOnNode)(v,A),i.default.useEffect(function(){_.current&&_.current.style&&_.current.style.setProperty("display","flex","important")},[]),i.default.createElement(r.Ref,{innerRef:_},i.default.createElement(O,(0,e.default)({},x,{className:b}),a.childrenUtils.isNil(f)?m:f))}o.handledProps=["as","blurring","centered","children","className","content","inverted","mountNode","scrolling"],o.propTypes={},o.create=(0,a.createShorthandFactory)(o,function(c){return{content:c}});var s=o;return jv.default=s,jv}var qv={},nQ;function Kqe(){if(nQ)return qv;nQ=1;var t=br;qv.__esModule=!0,qv.default=void 0;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(s){var c=s.children,u=s.className,f=s.content,d=(0,r.default)("header",u),g=(0,i.getUnhandledProps)(a,s),m=(0,i.getElementType)(a,s);return n.default.createElement(m,(0,e.default)({},g,{className:d}),i.childrenUtils.isNil(c)?f:c)}a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(s){return{content:s}});var o=a;return qv.default=o,qv}var Gu={},iQ;function Yqe(){if(iQ)return Gu;iQ=1,Gu.__esModule=!0,Gu.isLegacy=Gu.getLegacyStyles=Gu.canFit=void 0;var t=0,e=50,r=function(o){var s=o.height+t,c=o.height+t,u=window.innerHeight,f=u/2,d=-(c/2),g=e,m=f+d;return m+s+g<u};Gu.canFit=r;var n=function(o,s,c){var u=s&&o?-(c.height/2):0,f=-(c.width/2);return{marginLeft:f,marginTop:u}};Gu.getLegacyStyles=n;var i=function(){return!window.ActiveXObject&&"ActiveXObject"in window};return Gu.isLegacy=i,Gu}var Qqe=Ws,ta=br;AO.__esModule=!0;AO.default=void 0;var v0=ta(Bn()),Jqe=ta(Mc()),Xqe=ta(bS()),Zqe=ta(H$()),eHe=ta(V$()),tHe=ta(Zse()),rHe=ta(Pre()),df=ta(Ks()),aQ=vd,nHe=ta(ii);ta(Ln());var Wu=Qqe(ze),iHe=ta(ece()),Pa=Wn(),aHe=ta(Hqe()),oQ=ta(W$()),tce=ta(Vqe()),rce=ta(wO),oHe=ta(Gqe()),nce=ta(Wqe()),ice=ta(Kqe()),YN=Yqe(),Iu=function(t){(0,Jqe.default)(e,t);function e(){for(var n,i=arguments.length,a=new Array(i),o=0;o<i;o++)a[o]=arguments[o];return n=t.call.apply(t,[this].concat(a))||this,n.legacy=(0,Pa.isBrowser)()&&(0,YN.isLegacy)(),n.ref=(0,Wu.createRef)(),n.dimmerRef=(0,Wu.createRef)(),n.latestDocumentMouseDownEvent=null,n.getMountNode=function(){return(0,Pa.isBrowser)()?n.props.mountNode||document.body:null},n.handleActionsOverrides=function(s){return{onActionClick:function(u,f){(0,df.default)(s,"onActionClick",u,f),(0,df.default)(n.props,"onActionClick",u,n.props),n.handleClose(u)}}},n.handleClose=function(s){n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1}))},n.handleDocumentMouseDown=function(s){n.latestDocumentMouseDownEvent=s},n.handleDocumentClick=function(s){var c=n.props.closeOnDimmerClick,u=n.latestDocumentMouseDownEvent;n.latestDocumentMouseDownEvent=null,!(!c||(0,Pa.doesNodeContainClick)(n.ref.current,u)||(0,Pa.doesNodeContainClick)(n.ref.current,s))&&(n.setState({open:!1}),(0,df.default)(n.props,"onClose",s,(0,v0.default)({},n.props,{open:!1})))},n.handleIconOverrides=function(s){return{onClick:function(u){(0,df.default)(s,"onClick",u),n.handleClose(u)}}},n.handleOpen=function(s){(0,df.default)(n.props,"onOpen",s,(0,v0.default)({},n.props,{open:!0})),n.setState({open:!0})},n.handlePortalMount=function(s){var c=n.props.eventPool;n.setState({scrolling:!1}),n.setPositionAndClassNames(),Pa.eventStack.sub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.sub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onMount",s,n.props)},n.handlePortalUnmount=function(s){var c=n.props.eventPool;cancelAnimationFrame(n.animationRequestId),Pa.eventStack.unsub("mousedown",n.handleDocumentMouseDown,{pool:c,target:n.dimmerRef.current}),Pa.eventStack.unsub("click",n.handleDocumentClick,{pool:c,target:n.dimmerRef.current}),(0,df.default)(n.props,"onUnmount",s,n.props)},n.setPositionAndClassNames=function(){var s=n.props.centered,c,u={};if(n.ref.current){var f=n.ref.current.getBoundingClientRect(),d=(0,YN.canFit)(f);c=!d;var g=n.legacy?(0,YN.getLegacyStyles)(d,s,f):{};(0,iHe.default)(n.state.legacyStyles,g)||(u.legacyStyles=g),n.state.scrolling!==c&&(u.scrolling=c)}(0,rHe.default)(u)||n.setState(u),n.animationRequestId=requestAnimationFrame(n.setPositionAndClassNames)},n.renderContent=function(s){var c=n.props,u=c.actions,f=c.basic,d=c.children,g=c.className,m=c.closeIcon,w=c.content,v=c.header,y=c.size,_=c.style,b=n.state,A=b.legacyStyles,x=b.scrolling,O=(0,nHe.default)("ui",y,(0,Pa.useKeyOnly)(f,"basic"),(0,Pa.useKeyOnly)(n.legacy,"legacy"),(0,Pa.useKeyOnly)(x,"scrolling"),"modal transition visible active",g),E=(0,Pa.getElementType)(e,n.props),p=m===!0?"close":m,I=aHe.default.create(p,{overrideProps:n.handleIconOverrides});return Wu.default.createElement(aQ.Ref,{innerRef:n.ref},Wu.default.createElement(E,(0,v0.default)({},s,{className:O,style:(0,v0.default)({},A,_)}),I,Pa.childrenUtils.isNil(d)?Wu.default.createElement(Wu.default.Fragment,null,ice.default.create(v,{autoGenerateKey:!1}),rce.default.create(w,{autoGenerateKey:!1}),tce.default.create(u,{overrideProps:n.handleActionsOverrides})):d))},n}var r=e.prototype;return r.componentWillUnmount=function(){this.handlePortalUnmount()},r.render=function(){var i=this.props,a=i.centered,o=i.closeOnDocumentClick,s=i.dimmer,c=i.eventPool,u=i.trigger,f=this.state,d=f.open,g=f.scrolling,m=this.getMountNode();if(!(0,Pa.isBrowser)())return(0,Wu.isValidElement)(u)?u:null;var w=(0,Pa.getUnhandledProps)(e,this.props),v=oQ.default.handledProps,y=(0,tHe.default)(w,function(b,A,x){return(0,eHe.default)(v,x)||(b[x]=A),b},{}),_=(0,Zqe.default)(w,v);return Wu.default.createElement(oQ.default,(0,v0.default)({closeOnDocumentClick:o},_,{trigger:u,eventPool:c,mountNode:m,open:d,onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount}),Wu.default.createElement(aQ.Ref,{innerRef:this.dimmerRef},nce.default.create((0,Xqe.default)(s)?s:{},{autoGenerateKey:!1,defaultProps:{blurring:s==="blurring",inverted:s==="inverted"},overrideProps:{children:this.renderContent(y),centered:a,mountNode:m,scrolling:g}})))},e}(Pa.ModernAutoControlledComponent);Iu.handledProps=["actions","as","basic","centered","children","className","closeIcon","closeOnDimmerClick","closeOnDocumentClick","content","defaultOpen","dimmer","eventPool","header","mountNode","onActionClick","onClose","onMount","onOpen","onUnmount","open","size","style","trigger"];Iu.propTypes={};Iu.defaultProps={centered:!0,dimmer:!0,closeOnDimmerClick:!0,closeOnDocumentClick:!1,eventPool:"Modal"};Iu.autoControlledProps=["open"];Iu.Actions=tce.default;Iu.Content=rce.default;Iu.Description=oHe.default;Iu.Dimmer=nce.default;Iu.Header=ice.default;var sHe=Iu;AO.default=sHe;(function(t){var e=Ne&&Ne.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.Modal=void 0;var r=AO;Object.defineProperty(t,"Modal",{enumerable:!0,get:function(){return e(r).default}})})(xO);var tL={};var cHe=Ne&&Ne.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(n[a]=i[a])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),uHe=Ne&&Ne.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lHe=Ne&&Ne.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fHe=Ne&&Ne.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&uHe(e,t,r);return lHe(e,t),e};Object.defineProperty(tL,"__esModule",{value:!0});var SO=tL.ModalNavigation=void 0,ih=fHe(ze),dHe=function(t){cHe(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.render=function(){var r=this.props,n=r.title,i=r.subtitle,a=r.onBack,o=r.onClose,s=r.onInfo;return ih.createElement("div",{className:"dcl modal-navigation"},ih.createElement("div",{className:"dcl modal-navigation-title"},n),i&&ih.createElement("div",{className:"dcl modal-navigation-subtitle"},i),a&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-back",onClick:a}),s&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-info",onClick:s}),o&&ih.createElement("div",{className:"dcl modal-navigation-button modal-navigation-close",onClick:o}))},e}(ih.PureComponent);SO=tL.ModalNavigation=dHe;const hHe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/warning-057948e8.svg";var Ri=(t=>(t.CONNECTING_WALLET="CONNECTING_WALLET",t.WAITING_FOR_SIGNATURE="WAITING_FOR_SIGNATURE",t.ERROR="ERROR",t.LOADING_MAGIC="LOADING_MAGIC",t.VALIDATING_SIGN_IN="VALIDATING_SIGN_IN",t))(Ri||{});function pHe(t,e){switch(t){case Ri.ERROR:return"You did not confirm this action in your digital wallet extension. To continue, please try again.";case Ri.CONNECTING_WALLET:case Ri.WAITING_FOR_SIGNATURE:return e===Ml.ProviderType.MAGIC?"Almost done! Confirm your request to login Decentraland":"Confirm in your digital wallet extension to continue.";case Ri.VALIDATING_SIGN_IN:return"Just a moment, we're verifying your login credentials...";case Ri.LOADING_MAGIC:return"Redirecting..."}}const gHe="_main_1qx1l_1",yHe="_content_1qx1l_8",mHe="_errorImage_1qx1l_16",vHe="_message_1qx1l_22",bHe="_loader_1qx1l_29",Hv={main:gHe,content:yHe,errorImage:mHe,message:vHe,loader:bHe},ace=t=>{const{open:e,state:r,providerType:n,onClose:i,onTryAgain:a}=t,o=r===Ri.CONNECTING_WALLET||r===Ri.WAITING_FOR_SIGNATURE||r===Ri.LOADING_MAGIC||r===Ri.VALIDATING_SIGN_IN;return Ye.jsxs(xO.Modal,{size:"tiny",open:e,children:[Ye.jsx(SO,{title:"",onClose:o?void 0:i}),Ye.jsx("div",{className:Hv.main,children:Ye.jsxs("div",{className:Hv.content,children:[r===Ri.ERROR&&Ye.jsx("img",{className:Hv.errorImage,src:hHe}),o&&Ye.jsx(AS,{className:Hv.loader,size:"huge",inline:!0}),Ye.jsx("p",{className:Hv.message,children:pHe(r,n)}),r===Ri.ERROR&&Ye.jsx(xc.Button,{primary:!0,onClick:a,children:"Try again"})]})}),Ye.jsx(EO,{})]})};var oce={},sce={},P5={exports:{}};(function(t,e){(function(r,n){n(e)})(Ne,function(r){function n(P){if(P.jsonrpc="2.0",!P.id||typeof P.id!="number"||Math.floor(P.id)!==P.id)throw new Error(`Invalid RPC message(invalid id) message: ${JSON.stringify(P)}`);if(!P.method||typeof P.method!="string"||P.method.trim().length===0)throw new Error(`Invalid RPC message(invalid method) message: ${JSON.stringify(P)}`);if(!P.params||typeof P.params!="object")throw new Error(`Invalid RPC message(invalid params) message: ${JSON.stringify(P)}`);return P}var i={};function a(){let P,D;const W=new Promise((he,Se)=>{P=Ce=>{he(Ce),W.isPending=!1},D=Ce=>{Se(Ce),W.isPending=!1}}).catch(he=>Promise.reject(he));return W.resolve=P,W.reject=D,"finally"in W||(W.finally=he=>{W.then(he),W.catch(he)}),W.isPending=!0,W}Object.defineProperty(i,"__esModule",{value:!0});var o=i.future=a;i.default=a;var s={exports:{}};/**
171
171
  * [js-sha3]{@link https://github.com/emn178/js-sha3}
172
172
  *
173
173
  * @version 0.8.0
@@ -183,5 +183,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
183
183
  Copyright (c) 2018 Jed Watson.
184
184
  Licensed under the MIT License (MIT), see
185
185
  http://jedwatson.github.io/classnames
186
- */(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var n=[],i=0;i<arguments.length;i++){var a=arguments[i];if(a){var o=typeof a;if(o==="string"||o==="number")n.push(a);else if(Array.isArray(a)){if(a.length){var s=r.apply(null,a);s&&n.push(s)}}else if(o==="object"){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){n.push(a.toString());continue}for(var c in a)e.call(a,c)&&a[c]&&n.push(c)}}}return n.join(" ")}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(Ece);var vze=Ece.exports;const dp=Dc(vze);var bze=_S();const wze=Dc(bze),_ze="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/logo-9a364aec.svg";var Gv={},JN,lQ;function Eze(){if(lQ)return JN;lQ=1;var t=kc(),e=bS();function r(n){return t(n)&&n.nodeType===1&&!e(n)}return JN=r,JN}var xce=ze.createContext(),Ace=ze.createContext();function xze(t){var e=t.children,r=ze.useState(null),n=r[0],i=r[1],a=ze.useRef(!1);ze.useEffect(function(){return function(){a.current=!0}},[]);var o=ze.useCallback(function(s){a.current||i(s)},[]);return ze.createElement(xce.Provider,{value:n},ze.createElement(Ace.Provider,{value:o},e))}var Sce=function(e){return Array.isArray(e)?e[0]:e},Oce=function(e){if(typeof e=="function"){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e.apply(void 0,n)}},L5=function(e,r){if(typeof e=="function")return Oce(e,r);e!=null&&(e.current=r)},fQ=function(e){return e.reduce(function(r,n){var i=n[0],a=n[1];return r[i]=a,r},{})},dQ=typeof window<"u"&&window.document&&window.document.createElement?ze.useLayoutEffect:ze.useEffect,Mo="top",zs="bottom",Vs="right",ko="left",dL="auto",jw=[Mo,zs,Vs,ko],Dy="start",$1="end",Aze="clippingParents",Ice="viewport",Wv="popper",Sze="reference",hQ=jw.reduce(function(t,e){return t.concat([e+"-"+Dy,e+"-"+$1])},[]),Pce=[].concat(jw,[dL]).reduce(function(t,e){return t.concat([e,e+"-"+Dy,e+"-"+$1])},[]),Oze="beforeRead",Ize="read",Pze="afterRead",Tze="beforeMain",Rze="main",Cze="afterMain",Nze="beforeWrite",Dze="write",$ze="afterWrite",Mze=[Oze,Ize,Pze,Tze,Rze,Cze,Nze,Dze,$ze];function Au(t){return t?(t.nodeName||"").toLowerCase():null}function es(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function hp(t){var e=es(t).Element;return t instanceof e||t instanceof Element}function Bs(t){var e=es(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function hL(t){if(typeof ShadowRoot>"u")return!1;var e=es(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kze(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},i=e.attributes[r]||{},a=e.elements[r];!Bs(a)||!Au(a)||(Object.assign(a.style,n),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function Lze(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],a=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),s=o.reduce(function(c,u){return c[u]="",c},{});!Bs(i)||!Au(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const Uze={name:"applyStyles",enabled:!0,phase:"write",fn:kze,effect:Lze,requires:["computeStyles"]};function bu(t){return t.split("-")[0]}var Zh=Math.max,r2=Math.min,$y=Math.round;function U5(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Tce(){return!/^((?!chrome|android).)*safari/i.test(U5())}function My(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Bs(t)&&(i=t.offsetWidth>0&&$y(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&$y(n.height)/t.offsetHeight||1);var o=hp(t)?es(t):window,s=o.visualViewport,c=!Tce()&&r,u=(n.left+(c&&s?s.offsetLeft:0))/i,f=(n.top+(c&&s?s.offsetTop:0))/a,d=n.width/i,g=n.height/a;return{width:d,height:g,top:f,right:u+d,bottom:f+g,left:u,x:u,y:f}}function pL(t){var e=My(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Rce(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&hL(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function kl(t){return es(t).getComputedStyle(t)}function Bze(t){return["table","td","th"].indexOf(Au(t))>=0}function Td(t){return((hp(t)?t.ownerDocument:t.document)||window.document).documentElement}function DO(t){return Au(t)==="html"?t:t.assignedSlot||t.parentNode||(hL(t)?t.host:null)||Td(t)}function pQ(t){return!Bs(t)||kl(t).position==="fixed"?null:t.offsetParent}function Fze(t){var e=/firefox/i.test(U5()),r=/Trident/i.test(U5());if(r&&Bs(t)){var n=kl(t);if(n.position==="fixed")return null}var i=DO(t);for(hL(i)&&(i=i.host);Bs(i)&&["html","body"].indexOf(Au(i))<0;){var a=kl(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function qw(t){for(var e=es(t),r=pQ(t);r&&Bze(r)&&kl(r).position==="static";)r=pQ(r);return r&&(Au(r)==="html"||Au(r)==="body"&&kl(r).position==="static")?e:r||Fze(t)||e}function gL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Gb(t,e,r){return Zh(t,r2(e,r))}function jze(t,e,r){var n=Gb(t,e,r);return n>r?r:n}function Cce(){return{top:0,right:0,bottom:0,left:0}}function Nce(t){return Object.assign({},Cce(),t)}function Dce(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var qze=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Nce(typeof e!="number"?e:Dce(e,jw))};function Hze(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=bu(r.placement),c=gL(s),u=[ko,Vs].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!o)){var d=qze(i.padding,r),g=pL(a),m=c==="y"?Mo:ko,w=c==="y"?zs:Vs,v=r.rects.reference[f]+r.rects.reference[c]-o[c]-r.rects.popper[f],y=o[c]-r.rects.reference[c],_=qw(a),b=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,A=v/2-y/2,x=d[m],O=b-g[f]-d[w],E=b/2-g[f]/2+A,p=Gb(x,E,O),I=c;r.modifiersData[n]=(e={},e[I]=p,e.centerOffset=p-E,e)}}function zze(t){var e=t.state,r=t.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Rce(e.elements.popper,i)&&(e.elements.arrow=i))}const Vze={name:"arrow",enabled:!0,phase:"main",fn:Hze,effect:zze,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ky(t){return t.split("-")[1]}var Gze={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wze(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:$y(r*i)/i||0,y:$y(n*i)/i||0}}function gQ(t){var e,r=t.popper,n=t.popperRect,i=t.placement,a=t.variation,o=t.offsets,s=t.position,c=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,d=t.isFixed,g=o.x,m=g===void 0?0:g,w=o.y,v=w===void 0?0:w,y=typeof f=="function"?f({x:m,y:v}):{x:m,y:v};m=y.x,v=y.y;var _=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),A=ko,x=Mo,O=window;if(u){var E=qw(r),p="clientHeight",I="clientWidth";if(E===es(r)&&(E=Td(r),kl(E).position!=="static"&&s==="absolute"&&(p="scrollHeight",I="scrollWidth")),E=E,i===Mo||(i===ko||i===Vs)&&a===$1){x=zs;var C=d&&E===O&&O.visualViewport?O.visualViewport.height:E[p];v-=C-n.height,v*=c?1:-1}if(i===ko||(i===Mo||i===zs)&&a===$1){A=Vs;var L=d&&E===O&&O.visualViewport?O.visualViewport.width:E[I];m-=L-n.width,m*=c?1:-1}}var q=Object.assign({position:s},u&&Gze),le=f===!0?Wze({x:m,y:v},es(r)):{x:m,y:v};if(m=le.x,v=le.y,c){var pe;return Object.assign({},q,(pe={},pe[x]=b?"0":"",pe[A]=_?"0":"",pe.transform=(O.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",pe))}return Object.assign({},q,(e={},e[x]=b?v+"px":"",e[A]=_?m+"px":"",e.transform="",e))}function Kze(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=n===void 0?!0:n,a=r.adaptive,o=a===void 0?!0:a,s=r.roundOffsets,c=s===void 0?!0:s,u={placement:bu(e.placement),variation:ky(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,gQ(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,gQ(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Yze={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Kze,data:{}};var CE={passive:!0};function Qze(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=i===void 0?!0:i,o=n.resize,s=o===void 0?!0:o,c=es(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",r.update,CE)}),s&&c.addEventListener("resize",r.update,CE),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",r.update,CE)}),s&&c.removeEventListener("resize",r.update,CE)}}const Jze={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Qze,data:{}};var Xze={left:"right",right:"left",bottom:"top",top:"bottom"};function Rx(t){return t.replace(/left|right|bottom|top/g,function(e){return Xze[e]})}var Zze={start:"end",end:"start"};function yQ(t){return t.replace(/start|end/g,function(e){return Zze[e]})}function yL(t){var e=es(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function mL(t){return My(Td(t)).left+yL(t).scrollLeft}function eVe(t,e){var r=es(t),n=Td(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Tce();(u||!u&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+mL(t),y:c}}function tVe(t){var e,r=Td(t),n=yL(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=Zh(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Zh(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+mL(t),c=-n.scrollTop;return kl(i||r).direction==="rtl"&&(s+=Zh(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function vL(t){var e=kl(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function $ce(t){return["html","body","#document"].indexOf(Au(t))>=0?t.ownerDocument.body:Bs(t)&&vL(t)?t:$ce(DO(t))}function Wb(t,e){var r;e===void 0&&(e=[]);var n=$ce(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),a=es(n),o=i?[a].concat(a.visualViewport||[],vL(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(Wb(DO(o)))}function B5(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function rVe(t,e){var r=My(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function mQ(t,e,r){return e===Ice?B5(eVe(t,r)):hp(e)?rVe(e,r):B5(tVe(Td(t)))}function nVe(t){var e=Wb(DO(t)),r=["absolute","fixed"].indexOf(kl(t).position)>=0,n=r&&Bs(t)?qw(t):t;return hp(n)?e.filter(function(i){return hp(i)&&Rce(i,n)&&Au(i)!=="body"}):[]}function iVe(t,e,r,n){var i=e==="clippingParents"?nVe(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(c,u){var f=mQ(t,u,n);return c.top=Zh(f.top,c.top),c.right=r2(f.right,c.right),c.bottom=r2(f.bottom,c.bottom),c.left=Zh(f.left,c.left),c},mQ(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Mce(t){var e=t.reference,r=t.element,n=t.placement,i=n?bu(n):null,a=n?ky(n):null,o=e.x+e.width/2-r.width/2,s=e.y+e.height/2-r.height/2,c;switch(i){case Mo:c={x:o,y:e.y-r.height};break;case zs:c={x:o,y:e.y+e.height};break;case Vs:c={x:e.x+e.width,y:s};break;case ko:c={x:e.x-r.width,y:s};break;default:c={x:e.x,y:e.y}}var u=i?gL(i):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case Dy:c[u]=c[u]-(e[f]/2-r[f]/2);break;case $1:c[u]=c[u]+(e[f]/2-r[f]/2);break}}return c}function M1(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=n===void 0?t.placement:n,a=r.strategy,o=a===void 0?t.strategy:a,s=r.boundary,c=s===void 0?Aze:s,u=r.rootBoundary,f=u===void 0?Ice:u,d=r.elementContext,g=d===void 0?Wv:d,m=r.altBoundary,w=m===void 0?!1:m,v=r.padding,y=v===void 0?0:v,_=Nce(typeof y!="number"?y:Dce(y,jw)),b=g===Wv?Sze:Wv,A=t.rects.popper,x=t.elements[w?b:g],O=iVe(hp(x)?x:x.contextElement||Td(t.elements.popper),c,f,o),E=My(t.elements.reference),p=Mce({reference:E,element:A,strategy:"absolute",placement:i}),I=B5(Object.assign({},A,p)),C=g===Wv?I:E,L={top:O.top-C.top+_.top,bottom:C.bottom-O.bottom+_.bottom,left:O.left-C.left+_.left,right:C.right-O.right+_.right},q=t.modifiersData.offset;if(g===Wv&&q){var le=q[i];Object.keys(L).forEach(function(pe){var B=[Vs,zs].indexOf(pe)>=0?1:-1,U=[Mo,zs].indexOf(pe)>=0?"y":"x";L[pe]+=le[U]*B})}return L}function aVe(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?Pce:c,f=ky(n),d=f?s?hQ:hQ.filter(function(w){return ky(w)===f}):jw,g=d.filter(function(w){return u.indexOf(w)>=0});g.length===0&&(g=d);var m=g.reduce(function(w,v){return w[v]=M1(t,{placement:v,boundary:i,rootBoundary:a,padding:o})[bu(v)],w},{});return Object.keys(m).sort(function(w,v){return m[w]-m[v]})}function oVe(t){if(bu(t)===dL)return[];var e=Rx(t);return[yQ(t),e,yQ(e)]}function sVe(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!0:o,c=r.fallbackPlacements,u=r.padding,f=r.boundary,d=r.rootBoundary,g=r.altBoundary,m=r.flipVariations,w=m===void 0?!0:m,v=r.allowedAutoPlacements,y=e.options.placement,_=bu(y),b=_===y,A=c||(b||!w?[Rx(y)]:oVe(y)),x=[y].concat(A).reduce(function(M,G){return M.concat(bu(G)===dL?aVe(e,{placement:G,boundary:f,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:v}):G)},[]),O=e.rects.reference,E=e.rects.popper,p=new Map,I=!0,C=x[0],L=0;L<x.length;L++){var q=x[L],le=bu(q),pe=ky(q)===Dy,B=[Mo,zs].indexOf(le)>=0,U=B?"width":"height",K=M1(e,{placement:q,boundary:f,rootBoundary:d,altBoundary:g,padding:u}),ne=B?pe?Vs:ko:pe?zs:Mo;O[U]>E[U]&&(ne=Rx(ne));var F=Rx(ne),j=[];if(a&&j.push(K[le]<=0),s&&j.push(K[ne]<=0,K[F]<=0),j.every(function(M){return M})){C=q,I=!1;break}p.set(q,j)}if(I)for(var z=w?3:1,$=function(G){var ge=x.find(function(Q){var te=p.get(Q);if(te)return te.slice(0,G).every(function(ce){return ce})});if(ge)return C=ge,"break"},H=z;H>0;H--){var k=$(H);if(k==="break")break}e.placement!==C&&(e.modifiersData[n]._skip=!0,e.placement=C,e.reset=!0)}}const cVe={name:"flip",enabled:!0,phase:"main",fn:sVe,requiresIfExists:["offset"],data:{_skip:!1}};function vQ(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function bQ(t){return[Mo,Vs,zs,ko].some(function(e){return t[e]>=0})}function uVe(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=M1(e,{elementContext:"reference"}),s=M1(e,{altBoundary:!0}),c=vQ(o,n),u=vQ(s,i,a),f=bQ(c),d=bQ(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}const lVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:uVe};function fVe(t,e,r){var n=bu(t),i=[ko,Mo].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ko,Vs].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function dVe(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=i===void 0?[0,0]:i,o=Pce.reduce(function(f,d){return f[d]=fVe(d,e.rects,a),f},{}),s=o[e.placement],c=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}const hVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:dVe};function pVe(t){var e=t.state,r=t.name;e.modifiersData[r]=Mce({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const gVe={name:"popperOffsets",enabled:!0,phase:"read",fn:pVe,data:{}};function yVe(t){return t==="x"?"y":"x"}function mVe(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!1:o,c=r.boundary,u=r.rootBoundary,f=r.altBoundary,d=r.padding,g=r.tether,m=g===void 0?!0:g,w=r.tetherOffset,v=w===void 0?0:w,y=M1(e,{boundary:c,rootBoundary:u,padding:d,altBoundary:f}),_=bu(e.placement),b=ky(e.placement),A=!b,x=gL(_),O=yVe(x),E=e.modifiersData.popperOffsets,p=e.rects.reference,I=e.rects.popper,C=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,L=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,le={x:0,y:0};if(E){if(a){var pe,B=x==="y"?Mo:ko,U=x==="y"?zs:Vs,K=x==="y"?"height":"width",ne=E[x],F=ne+y[B],j=ne-y[U],z=m?-I[K]/2:0,$=b===Dy?p[K]:I[K],H=b===Dy?-I[K]:-p[K],k=e.elements.arrow,M=m&&k?pL(k):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Cce(),ge=G[B],Q=G[U],te=Gb(0,p[K],M[K]),ce=A?p[K]/2-z-te-ge-L.mainAxis:$-te-ge-L.mainAxis,T=A?-p[K]/2+z+te+Q+L.mainAxis:H+te+Q+L.mainAxis,fe=e.elements.arrow&&qw(e.elements.arrow),Ve=fe?x==="y"?fe.clientTop||0:fe.clientLeft||0:0,tt=(pe=q==null?void 0:q[x])!=null?pe:0,mt=ne+ce-tt-Ve,vt=ne+T-tt,gt=Gb(m?r2(F,mt):F,ne,m?Zh(j,vt):j);E[x]=gt,le[x]=gt-ne}if(s){var Lt,Yt=x==="x"?Mo:ko,wr=x==="x"?zs:Vs,Rt=E[O],Pt=O==="y"?"height":"width",kt=Rt+y[Yt],Nt=Rt-y[wr],Kt=[Mo,ko].indexOf(_)!==-1,Ut=(Lt=q==null?void 0:q[O])!=null?Lt:0,zt=Kt?kt:Rt-p[Pt]-I[Pt]-Ut+L.altAxis,$t=Kt?Rt+p[Pt]+I[Pt]-Ut-L.altAxis:Nt,Dt=m&&Kt?jze(zt,Rt,$t):Gb(m?zt:kt,Rt,m?$t:Nt);E[O]=Dt,le[O]=Dt-Rt}e.modifiersData[n]=le}}const vVe={name:"preventOverflow",enabled:!0,phase:"main",fn:mVe,requiresIfExists:["offset"]};function bVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function wVe(t){return t===es(t)||!Bs(t)?yL(t):bVe(t)}function _Ve(t){var e=t.getBoundingClientRect(),r=$y(e.width)/t.offsetWidth||1,n=$y(e.height)/t.offsetHeight||1;return r!==1||n!==1}function EVe(t,e,r){r===void 0&&(r=!1);var n=Bs(e),i=Bs(e)&&_Ve(e),a=Td(e),o=My(t,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Au(e)!=="body"||vL(a))&&(s=wVe(e)),Bs(e)?(c=My(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=mL(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function xVe(t){var e=new Map,r=new Set,n=[];t.forEach(function(a){e.set(a.name,a)});function i(a){r.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!r.has(s)){var c=e.get(s);c&&i(c)}}),n.push(a)}return t.forEach(function(a){r.has(a.name)||i(a)}),n}function AVe(t){var e=xVe(t);return Mze.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function SVe(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function OVe(t){var e=t.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var wQ={placement:"bottom",modifiers:[],strategy:"absolute"};function _Q(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function IVe(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,a=i===void 0?wQ:i;return function(s,c,u){u===void 0&&(u=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},wQ,a),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},d=[],g=!1,m={state:f,setOptions:function(_){var b=typeof _=="function"?_(f.options):_;v(),f.options=Object.assign({},a,f.options,b),f.scrollParents={reference:hp(s)?Wb(s):s.contextElement?Wb(s.contextElement):[],popper:Wb(c)};var A=AVe(OVe([].concat(n,f.options.modifiers)));return f.orderedModifiers=A.filter(function(x){return x.enabled}),w(),m.update()},forceUpdate:function(){if(!g){var _=f.elements,b=_.reference,A=_.popper;if(_Q(b,A)){f.rects={reference:EVe(b,qw(A),f.options.strategy==="fixed"),popper:pL(A)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(L){return f.modifiersData[L.name]=Object.assign({},L.data)});for(var x=0;x<f.orderedModifiers.length;x++){if(f.reset===!0){f.reset=!1,x=-1;continue}var O=f.orderedModifiers[x],E=O.fn,p=O.options,I=p===void 0?{}:p,C=O.name;typeof E=="function"&&(f=E({state:f,options:I,name:C,instance:m})||f)}}}},update:SVe(function(){return new Promise(function(y){m.forceUpdate(),y(f)})}),destroy:function(){v(),g=!0}};if(!_Q(s,c))return m;m.setOptions(u).then(function(y){!g&&u.onFirstUpdate&&u.onFirstUpdate(y)});function w(){f.orderedModifiers.forEach(function(y){var _=y.name,b=y.options,A=b===void 0?{}:b,x=y.effect;if(typeof x=="function"){var O=x({state:f,name:_,instance:m,options:A}),E=function(){};d.push(O||E)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var PVe=[Jze,gVe,Yze,Uze,hVe,cVe,vVe,Vze,lVe],TVe=IVe({defaultModifiers:PVe}),RVe=typeof Element<"u",CVe=typeof Map=="function",NVe=typeof Set=="function",DVe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Cx(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Cx(t[n],e[n]))return!1;return!0}var a;if(CVe&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;for(a=t.entries();!(n=a.next()).done;)if(!Cx(n.value[1],e.get(n.value[0])))return!1;return!0}if(NVe&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(DVe&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(RVe&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Cx(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var $Ve=function(e,r){try{return Cx(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const MVe=Dc($Ve);var kVe=[],kce=function(e,r,n){n===void 0&&(n={});var i=ze.useRef(null),a={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||kVe},o=ze.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],c=o[1],u=ze.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var w=m.state,v=Object.keys(w.elements);l1.flushSync(function(){c({styles:fQ(v.map(function(y){return[y,w.styles[y]||{}]})),attributes:fQ(v.map(function(y){return[y,w.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=ze.useMemo(function(){var g={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return MVe(i.current,g)?i.current||g:(i.current=g,g)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=ze.useRef();return dQ(function(){d.current&&d.current.setOptions(f)},[f]),dQ(function(){if(!(e==null||r==null)){var g=n.createPopper||TVe,m=g(e,r,f);return d.current=m,function(){m.destroy(),d.current=null}}},[e,r,n.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}},LVe=function(){},UVe=function(){return Promise.resolve(null)},BVe=[];function FVe(t){var e=t.placement,r=e===void 0?"bottom":e,n=t.strategy,i=n===void 0?"absolute":n,a=t.modifiers,o=a===void 0?BVe:a,s=t.referenceElement,c=t.onFirstUpdate,u=t.innerRef,f=t.children,d=ze.useContext(xce),g=ze.useState(null),m=g[0],w=g[1],v=ze.useState(null),y=v[0],_=v[1];ze.useEffect(function(){L5(u,m)},[u,m]);var b=ze.useMemo(function(){return{placement:r,strategy:i,onFirstUpdate:c,modifiers:[].concat(o,[{name:"arrow",enabled:y!=null,options:{element:y}}])}},[r,i,c,o,y]),A=kce(s||d,m,b),x=A.state,O=A.styles,E=A.forceUpdate,p=A.update,I=ze.useMemo(function(){return{ref:w,style:O.popper,placement:x?x.placement:r,hasPopperEscaped:x&&x.modifiersData.hide?x.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:x&&x.modifiersData.hide?x.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:O.arrow,ref:_},forceUpdate:E||LVe,update:p||UVe}},[w,_,r,x,O,p,E]);return Sce(f)(I)}var jVe=function(){},qVe=jVe;const HVe=Dc(qVe);function zVe(t){var e=t.children,r=t.innerRef,n=ze.useContext(Ace),i=ze.useCallback(function(a){L5(r,a),Oce(n,a)},[r,n]);return ze.useEffect(function(){return function(){return L5(r,null)}},[]),ze.useEffect(function(){HVe(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),Sce(e)({ref:i})}const VVe=Object.freeze(Object.defineProperty({__proto__:null,Manager:xze,Popper:FVe,Reference:zVe,usePopper:kce},Symbol.toStringTag,{value:"Module"})),GVe=uo(VVe);var Ku={},XN,EQ;function WVe(){if(EQ)return XN;EQ=1;var t=$$();function e(r,n,i,a){return t(r,function(o,s,c){n(a,i(o),s,c)}),a}return XN=e,XN}var ZN,xQ;function KVe(){if(xQ)return ZN;xQ=1;var t=WVe();function e(r,n){return function(i,a){return t(i,r,n(a),{})}}return ZN=e,ZN}var e6,AQ;function YVe(){if(AQ)return e6;AQ=1;var t=nre(),e=KVe(),r=md(),n=Object.prototype,i=n.toString,a=e(function(o,s,c){s!=null&&typeof s.toString!="function"&&(s=i.call(s)),o[s]=c},t(r));return e6=a,e6}var SQ;function QVe(){if(SQ)return Ku;SQ=1;var t=br;Ku.__esModule=!0,Ku.placementMapping=Ku.positions=Ku.positionsMapping=void 0;var e=t(YVe()),r=t(Hl()),n={"top center":"top","top left":"top-start","top right":"top-end","bottom center":"bottom","bottom left":"bottom-start","bottom right":"bottom-end","right center":"right","left center":"left"};Ku.positionsMapping=n;var i=(0,r.default)(n);Ku.positions=i;var a=(0,e.default)(n);return Ku.placementMapping=a,Ku}var Kv={},t6={exports:{}},r6={exports:{}},n6={exports:{}},OQ;function JVe(){return OQ||(OQ=1,function(t){var e=w$.default;function r(n,i){if(e(n)!=="object"||n===null)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var o=a.call(n,i||"default");if(e(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(n6)),n6.exports}var IQ;function XVe(){return IQ||(IQ=1,function(t){var e=w$.default,r=JVe();function n(i){var a=r(i,"string");return e(a)==="symbol"?a:String(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(r6)),r6.exports}var PQ;function ZVe(){return PQ||(PQ=1,function(t){var e=XVe();function r(i,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,e(s.key),s)}}function n(i,a,o){return a&&r(i.prototype,a),o&&r(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(t6)),t6.exports}var TQ;function eGe(){if(TQ)return Kv;TQ=1;var t=br;Kv.__esModule=!0,Kv.default=void 0;var e=t(ZVe()),r=t(A$()),n=t(Ks()),i=vd,a=function(){function c(f){this.ref=f}var u=c.prototype;return u.getBoundingClientRect=function(){return(0,n.default)(this.ref.current,"getBoundingClientRect")||{}},(0,e.default)(c,[{key:"clientWidth",get:function(){return this.getBoundingClientRect().width}},{key:"clientHeight",get:function(){return this.getBoundingClientRect().height}},{key:"parentNode",get:function(){return this.ref.current?this.ref.current.parentNode:void 0}}]),c}(),o=(0,r.default)(function(c){return new a((0,i.isRefObject)(c)?c:{current:c})}),s=o;return Kv.default=s,Kv}var NE={},RQ;function tGe(){if(RQ)return NE;RQ=1;var t=br;NE.__esModule=!0,NE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("content",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),NE}var DE={},CQ;function rGe(){if(CQ)return DE;CQ=1;var t=br;DE.__esModule=!0,DE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("header",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),DE}var NQ;function nGe(){if(NQ)return Gv;NQ=1;var t=Ws,e=br;Gv.__esModule=!0,Gv.default=void 0;var r=e(Bn()),n=e(Mc());e(G$());var i=e(ql()),a=e(C$()),o=e(Ks()),s=e(Eze()),c=e(Di()),u=e(H$()),f=e(V$()),d=e(Zse()),g=e(z$()),m=e(ii);e(Ln());var w=t(ze),v=GVe,y=e(ece()),_=Wn(),b=e(W$()),A=QVe(),x=e(eGe()),O=e(tGe()),E=e(rGe()),p=function(I){(0,n.default)(C,I);function C(){for(var q,le=arguments.length,pe=new Array(le),B=0;B<le;B++)pe[B]=arguments[B];return q=I.call.apply(I,[this].concat(pe))||this,q.state={},q.open=!1,q.zIndexWasSynced=!1,q.triggerRef=w.default.createRef(),q.elementRef=w.default.createRef(),q.getPortalProps=function(){var U={},K=q.props,ne=K.on,F=K.hoverable,j=(0,c.default)(ne)?ne:[ne];return F&&(U.closeOnPortalMouseLeave=!0,U.mouseLeaveDelay=300),(0,f.default)(j,"hover")&&(U.openOnTriggerClick=!1,U.closeOnTriggerClick=!1,U.openOnTriggerMouseEnter=!0,U.closeOnTriggerMouseLeave=!0,U.mouseLeaveDelay=70,U.mouseEnterDelay=50),(0,f.default)(j,"click")&&(U.openOnTriggerClick=!0,U.closeOnTriggerClick=!0,U.closeOnDocumentClick=!0),(0,f.default)(j,"focus")&&(U.openOnTriggerFocus=!0,U.closeOnTriggerBlur=!0),U},q.hideOnScroll=function(U){(0,s.default)(U.target)&&q.elementRef.current.contains(U.target)||(q.setState({closed:!0}),_.eventStack.unsub("scroll",q.hideOnScroll,{target:window}),q.timeoutId=setTimeout(function(){q.setState({closed:!1})},50),q.handleClose(U))},q.handleClose=function(U){(0,o.default)(q.props,"onClose",U,(0,r.default)({},q.props,{open:!1}))},q.handleOpen=function(U){(0,o.default)(q.props,"onOpen",U,(0,r.default)({},q.props,{open:!0}))},q.handlePortalMount=function(U){(0,o.default)(q.props,"onMount",U,q.props)},q.handlePortalUnmount=function(U){q.positionUpdate=null,(0,o.default)(q.props,"onUnmount",U,q.props)},q.renderContent=function(U){var K=U.placement,ne=U.ref,F=U.update,j=U.style,z=q.props,$=z.basic,H=z.children,k=z.className,M=z.content,G=z.hideOnScroll,ge=z.flowing,Q=z.header,te=z.inverted,ce=z.popper,T=z.size,fe=z.style,Ve=z.wide,tt=q.state.contentRestProps;q.positionUpdate=F;var mt=(0,m.default)("ui",A.placementMapping[K],T,(0,_.useKeyOrValueAndKey)(Ve,"wide"),(0,_.useKeyOnly)($,"basic"),(0,_.useKeyOnly)(ge,"flowing"),(0,_.useKeyOnly)(te,"inverted"),"popup transition visible",k),vt=(0,_.getElementType)(C,q.props),gt=(0,r.default)({left:"auto",right:"auto",position:"initial"},fe),Lt=w.default.createElement(vt,(0,r.default)({},tt,{className:mt,style:gt,ref:q.elementRef}),_.childrenUtils.isNil(H)?w.default.createElement(w.default.Fragment,null,E.default.create(Q,{autoGenerateKey:!1}),O.default.create(M,{autoGenerateKey:!1})):H,G&&w.default.createElement(g.default,{on:q.hideOnScroll,name:"scroll",target:"window"}));return(0,_.createHTMLDivision)(ce||{},{overrideProps:{children:Lt,ref:ne,style:(0,r.default)({display:"flex"},j)}})},q}C.getDerivedStateFromProps=function(le,pe){if(pe.closed||pe.disabled)return{};var B=(0,_.getUnhandledProps)(C,le),U=(0,d.default)(B,function(ne,F,j){return(0,f.default)(b.default.handledProps,j)||(ne[j]=F),ne},{}),K=(0,u.default)(B,b.default.handledProps);return{contentRestProps:U,portalRestProps:K}};var L=C.prototype;return L.componentDidUpdate=function(le){var pe=(0,y.default)(this.props.popperDependencies,le.popperDependencies);pe||this.handleUpdate()},L.componentWillUnmount=function(){clearTimeout(this.timeoutId)},L.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},L.render=function(){var le=this,pe=this.props,B=pe.context,U=pe.disabled,K=pe.eventsEnabled,ne=pe.offset,F=pe.pinned,j=pe.popper,z=pe.popperModifiers,$=pe.position,H=pe.positionFixed,k=pe.trigger,M=this.state,G=M.closed,ge=M.portalRestProps;if(G||U)return k;var Q=[{name:"arrow",enabled:!1},{name:"eventListeners",options:{scroll:!!K,resize:!!K}},{name:"flip",enabled:!F},{name:"preventOverflow",enabled:!!ne},{name:"offset",enabled:!!ne,options:{offset:ne}}].concat(z,[{name:"syncZIndex",enabled:!0,phase:"beforeRead",fn:function(fe){var Ve,tt=fe.state;if(!le.zIndexWasSynced){var mt=j==null||(Ve=j.style)==null?void 0:Ve.zIndex;(0,a.default)(mt)&&(tt.elements.popper.style.zIndex=window.getComputedStyle(tt.elements.popper.firstChild).zIndex),le.zIndexWasSynced=!0}},effect:function(){return function(){le.zIndexWasSynced=!1}}}]),te=(0,x.default)((0,i.default)(B)?this.triggerRef:B),ce=(0,r.default)({},this.getPortalProps(),ge);return w.default.createElement(b.default,(0,r.default)({},ce,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:k,triggerRef:this.triggerRef}),w.default.createElement(v.Popper,{modifiers:Q,placement:A.positionsMapping[$],strategy:H?"fixed":null,referenceElement:te},this.renderContent))},C}(w.Component);return Gv.default=p,p.handledProps=["as","basic","children","className","content","context","disabled","eventsEnabled","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","pinned","popper","popperDependencies","popperModifiers","position","positionFixed","size","style","trigger","wide"],p.propTypes={},p.defaultProps={disabled:!1,eventsEnabled:!0,on:["click","hover"],pinned:!1,popperModifiers:[],position:"top left"},p.Content=O.default,p.Header=E.default,Gv}var iGe=br,aGe=iGe(nGe()),oGe=aGe.default;const sGe=t=>t.charAt(0).toUpperCase()+t.slice(1),cGe="_button_1uvkr_1",uGe="_icon_1uvkr_5",$E={button:cGe,icon:uGe,"icon-metamask-mobile":"_icon-metamask-mobile_1uvkr_13","icon-metamask":"_icon-metamask_1uvkr_13","icon-dapper":"_icon-dapper_1uvkr_18","icon-fortmatic":"_icon-fortmatic_1uvkr_22","icon-wallet-connect":"_icon-wallet-connect_1uvkr_26","icon-samsung-blockchain-wallet":"_icon-samsung-blockchain-wallet_1uvkr_30","icon-coinbase":"_icon-coinbase_1uvkr_34","icon-wallet-link":"_icon-wallet-link_1uvkr_35","icon-google":"_icon-google_1uvkr_39","icon-discord":"_icon-discord_1uvkr_43","icon-apple":"_icon-apple_1uvkr_47","icon-x":"_icon-x_1uvkr_51"},Lce=t=>{const{className:e,children:r,type:n,testId:i,showTooltip:a,tooltipPosition:o,disabled:s,loading:c,onClick:u}=t;return Ye.jsx(oGe,{position:a&&o?o:"top center",disabled:!a,trigger:Ye.jsxs(xc.Button,{primary:!0,size:"small","data-testid":`${i}-${n}-button`,className:dp(e,$E.button),onClick:()=>u(n),disabled:s,loading:c,children:[c?null:Ye.jsx("div",{role:"img","aria-label":n,className:dp($E.icon,$E[`icon-${n}`],$E.primaryImage)}),r]},n),content:sGe(n),on:"hover"})},lGe="social-primary-test-id",fGe="social-secondary-test-id",dGe="web3-primary-test-id",hGe="web3-secondary-test-id",pGe="show-more-button-test-id",gGe="_connection_ge0tp_3",yGe="_dclLogo_ge0tp_9",mGe="_title_ge0tp_15",vGe="_subtitle_ge0tp_20",bGe="_primaryButton_ge0tp_29",wGe="_primaryImage_ge0tp_38",_Ge="_primaryMessage_ge0tp_42",EGe="_primaryMagic_ge0tp_50",xGe="_primaryLearnMore_ge0tp_61",AGe="_primary_ge0tp_29",SGe="_showMore_ge0tp_76",OGe="_showMoreButton_ge0tp_80",IGe="_showMoreSecondaryOptions_ge0tp_89",PGe="_primaryOption_ge0tp_103",TGe="_secondaryOptionButton_ge0tp_107",Da={connection:gGe,dclLogo:yGe,title:mGe,subtitle:vGe,primaryButton:bGe,primaryImage:wGe,primaryMessage:_Ge,primaryMagic:EGe,primaryLearnMore:xGe,primary:AGe,showMore:SGe,showMoreButton:OGe,showMoreSecondaryOptions:IGe,primaryOption:PGe,secondaryOptionButton:TGe},DQ=({message:t,children:e,option:r,testId:n,loadingOption:i,onConnect:a})=>Ye.jsxs("div",{className:Da.primary,"data-testid":n,children:[Ye.jsx("div",{className:Da.primaryMessage,children:t}),Ye.jsx(Lce,{disabled:!!i,loading:i===r,type:r,onClick:a,className:dp(Da.primaryButton,Da.primaryOption),testId:n,children:e})]}),$Q=({options:t,tooltipDirection:e,testId:r,loadingOption:n,onConnect:i})=>Ye.jsx("div",{className:Da.showMoreSecondaryOptions,"data-testid":r,children:t.map(a=>Ye.jsx(Lce,{className:dp(Da.primaryButton,Da.secondaryOptionButton),showTooltip:!0,tooltipPosition:e,type:a,onClick:i,testId:r,loading:n===a,disabled:!!n},a))}),RGe={i18n:{title:"Unlock Your Virtual World.",subtitle:"Access and start exploring.",accessWith:t=>`Access with ${t}`,connectWith:t=>`Connect with ${t}`,moreOptions:"More Options",socialMessage:t=>Ye.jsxs(Ye.Fragment,{children:["Access secured by ",t]}),web3Message:t=>Ye.jsxs(Ye.Fragment,{children:["Curious about wallets? ",t("Learn More")]})}},CGe=t=>{const{i18n:e=RGe.i18n,onConnect:r,onLearnMore:n,socialOptions:i,web3Options:a,className:o,loadingOption:s}=t,[c,u]=ze.useState(!1),f=ze.useCallback(()=>{u(!c)},[c]),d=i&&i.secondary&&i.secondary.length>0,g=a&&a.secondary&&a.secondary.length>0;return Ye.jsxs("div",{className:dp(o,Da.connection),children:[Ye.jsx("img",{className:Da.dclLogo,src:_ze,alt:"Decentraland logo"}),Ye.jsxs("div",{children:[Ye.jsx("h1",{className:Da.title,children:e.title}),Ye.jsx("h2",{className:Da.subtitle,children:e.subtitle}),i?Ye.jsx(DQ,{onConnect:r,testId:lGe,option:i==null?void 0:i.primary,loadingOption:s,message:Ye.jsxs(Ye.Fragment,{children:[e.socialMessage(Ye.jsx("div",{className:Da.primaryMagic,role:"img","aria-label":"Magic"})),Ye.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(i==null?void 0:i.primary),children:"Learn More"})]}),children:Ye.jsx(Ye.Fragment,{children:e.accessWith(i==null?void 0:i.primary)})}):null,a?Ye.jsx(DQ,{onConnect:r,testId:dGe,option:a==null?void 0:a.primary,loadingOption:s,message:e.web3Message(m=>Ye.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(a.primary),children:m})),children:Ye.jsx(Ye.Fragment,{children:e.connectWith(a==null?void 0:a.primary)})}):null]}),Ye.jsxs("div",{className:Da.showMore,children:[(g||d)&&Ye.jsxs(xc.Button,{"data-testid":pGe,basic:!0,size:"medium",fluid:!0,className:Da.showMoreButton,onClick:f,children:[e.moreOptions,Ye.jsx(wze,{name:c?"chevron up":"chevron down"})]}),c&&d&&Ye.jsx($Q,{testId:fGe,options:i.secondary,onConnect:r,tooltipDirection:"top center",loadingOption:s}),c&&g&&Ye.jsx($Q,{testId:hGe,options:a.secondary,onConnect:r,tooltipDirection:"bottom center",loadingOption:s})]})]})};var Hn=(t=>(t.METAMASK="metamask",t.DAPPER="dapper",t.FORTMATIC="fortmatic",t.COINBASE="coinbase",t.SAMSUNG="samsung-blockchain-wallet",t.WALLET_CONNECT="wallet-connect",t.WALLET_LINK="wallet-link",t.METAMASK_MOBILE="metamask-mobile",t.GOOGLE="google",t.APPLE="apple",t.DISCORD="discord",t.X="x",t))(Hn||{});const NGe=60*24*30,DGe=Il.getConfiguration().magic.apiKey;function Uce(t){switch(t){case Hn.DISCORD:case Hn.X:case Hn.GOOGLE:case Hn.APPLE:return Sc.ProviderType.MAGIC;case Hn.WALLET_CONNECT:case Hn.METAMASK_MOBILE:return Sc.ProviderType.WALLET_CONNECT_V2;case Hn.COINBASE:case Hn.WALLET_LINK:return Sc.ProviderType.WALLET_LINK;case Hn.FORTMATIC:return Sc.ProviderType.FORTMATIC;case Hn.METAMASK:case Hn.DAPPER:case Hn.SAMSUNG:return Sc.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function $Ge(t,e){const r=new ute(e),n=R8.createRandom(),i={address:n.address.toString(),publicKey:xt(n.publicKey),privateKey:xt(n.privateKey)},a=await r.getSigner();return oce.Authenticator.initializeAuthChain(t,i,NGe,o=>a.signMessage(o))}async function MQ(t){const e=Uce(t);if(Sc.ProviderType.MAGIC===e){const{Magic:n}=await Ry(()=>Promise.resolve().then(()=>Xk),void 0),{OAuthExtension:i}=await Ry(()=>Promise.resolve().then(()=>Zk),void 0),a=new n(DGe,{extensions:[new i]}),o=new URL(window.location.href);o.pathname="/auth/callback",await a.oauth.loginWithRedirect({provider:t===Hn.X?"twitter":t,redirectURI:o.href})}const r=await Il.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}function kQ(t){return[Hn.APPLE,Hn.GOOGLE,Hn.X,Hn.DISCORD].includes(t)}async function Bce(t,e){let r;const n=C5.localStorageGetIdentity(t);return n?r=n:(r=await $Ge(t,e),C5.localStorageStoreIdentity(t,r)),r}const MGe=Il.getConfiguration().magic.apiKey,kGe=()=>{const t=Xse(),e=P2(),[r,n]=ze.useState(!0),i=ze.useCallback(async()=>{var s;const o=await Il.connection.connect(Ml.ProviderType.MAGIC);await Bce(((s=o.account)==null?void 0:s.toLowerCase())??"",o.provider)},[]),a=ze.useCallback(async()=>{const{Magic:o}=await Ry(()=>Promise.resolve().then(()=>Xk),void 0),{OAuthExtension:s}=await Ry(()=>Promise.resolve().then(()=>Zk),void 0),c=new o(MGe,{extensions:[new s]});try{await(c==null?void 0:c.oauth.getRedirectResult()),n(!1),await i(),t?window.location.href=decodeURIComponent(t):window.location.href="/"}catch(u){console.log(u),e("/login")}},[e]);return ze.useEffect(()=>{a()},[]),Ye.jsx(ace,{open:!0,state:r?Ri.VALIDATING_SIGN_IN:Ri.WAITING_FOR_SIGNATURE,onTryAgain:i,providerType:Ml.ProviderType.MAGIC})},LGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image1-a4aa795b.webp",UGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image10-c7fbcc61.webp",BGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image2-0af6ed59.webp",FGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image3-c864ad86.webp",jGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image4-7964be5f.webp",qGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image5-fcca517e.webp",HGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image6-c770bdf5.webp",zGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image7-341595c4.webp",VGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image8-fea9fe85.webp",GGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7422460847.commit-7c39fc4/assets/image9-714885ef.webp",WGe="_main_a0a53_1",KGe="_title_a0a53_11",YGe="_infoModal_a0a53_15",QGe="_infoContent_a0a53_19",JGe="_info_a0a53_15",XGe="_goBackButton_a0a53_31",b0={main:WGe,title:KGe,infoModal:YGe,infoContent:QGe,info:JGe,goBackButton:XGe},ZGe={i18n:{title:"How does Magic work?",subtitle:"Magic handles digital wallet creation & management behind the scenes so you don't have to. Just log into Decentraland with your favorite social account and let Magic handle the rest.<br /> <br />If you'd rather take a more hands-on approach to your digital asset storage (e.g. Wearables, NAMEs, etc.), get a digital wallet from a provider such as MetaMask and use it to create your Decentraland account.",goBack:"Return to log in page"}},eWe=t=>{const{i18n:e=ZGe.i18n,onClose:r,open:n}=t;return Ye.jsxs(xO.Modal,{size:"tiny",open:n,className:b0.infoModal,onClose:r,children:[Ye.jsx(SO,{title:"",onClose:r}),Ye.jsx(EO,{className:b0.infoContent,children:Ye.jsxs("div",{className:b0.main,children:[Ye.jsx("h1",{className:b0.title,children:e==null?void 0:e.title}),Ye.jsx("span",{className:b0.info,dangerouslySetInnerHTML:{__html:e==null?void 0:e.subtitle}}),Ye.jsx(xc.Button,{className:b0.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},tWe="_main_1c8le_1",rWe="_infoModal_1c8le_11",nWe="_infoContent_1c8le_15",iWe="_info_1c8le_11",aWe="_infoImage_1c8le_26",oWe="_assets_1c8le_34",sWe="_login_1c8le_38",cWe="_goBackButton_1c8le_42",cc={main:tWe,infoModal:rWe,infoContent:nWe,info:iWe,infoImage:aWe,assets:oWe,login:sWe,goBackButton:cWe},uWe={i18n:{title:"What is a wallet?",assets:{title:"A home for your digital assets",text:"Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, just connect your wallet."},goBack:"Return to log in page"}},lWe=t=>{const{i18n:e=uWe.i18n,onClose:r,open:n}=t;return Ye.jsxs(xO.Modal,{size:"tiny",open:n,className:cc.infoModal,onClose:r,children:[Ye.jsx(SO,{title:"",onClose:r}),Ye.jsx(EO,{className:cc.infoContent,children:Ye.jsxs("div",{className:cc.main,children:[Ye.jsx("h1",{className:cc.title,children:e==null?void 0:e.title}),Ye.jsxs("article",{className:cc.info,children:[Ye.jsx("div",{className:dp(cc.infoImage,cc.assets)}),Ye.jsx("h3",{children:e==null?void 0:e.assets.title}),Ye.jsx("p",{children:e==null?void 0:e.assets.text})]}),Ye.jsxs("article",{className:cc.info,children:[Ye.jsx("div",{className:dp(cc.infoImage,cc.login)}),Ye.jsx("h3",{children:e==null?void 0:e.logIn.title}),Ye.jsx("p",{children:e==null?void 0:e.logIn.text})]}),Ye.jsx(xc.Button,{className:cc.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},fWe="_main_ray7b_1",dWe="_background_ray7b_8",hWe="_left_ray7b_32",pWe="_leftInfo_ray7b_42",gWe="_right_ray7b_51",yWe="_footer_ray7b_60",mWe="_guestInfo_ray7b_79",Yv={main:fWe,background:dWe,"move-background":"_move-background_ray7b_1",left:hWe,leftInfo:pWe,right:gWe,footer:yWe,guestInfo:mWe},LQ=[LGe,BGe,FGe,jGe,qGe,HGe,zGe,VGe,GGe,UGe],vWe=()=>{const[t]=nme(),[e,r]=ze.useState(Ri.CONNECTING_WALLET),[n,i]=ze.useState(!1),[a,o]=ze.useState(!1),[s,c]=ze.useState(!1),[u,f]=ze.useState(),d=Xse(),g=d&&new URL(d).pathname.includes("/play"),[m,w]=ze.useState(0),v=ze.useCallback(E=>{E&&kQ(E)?o(!0):i(!0)},[i,o,n]),y=ze.useCallback(()=>{i(!1),o(!1)},[i,o]),_=ze.useCallback(()=>{o(!a)},[o,a]),b=ze.useMemo(()=>{if(d){const E=new URL(d);return E.searchParams.append("guest","true"),E.toString()}return""},[d]),A=ze.useCallback(async E=>{var p;if(f(E),kQ(E))r(Ri.LOADING_MAGIC),await MQ(E);else try{c(!0),r(Ri.CONNECTING_WALLET);const I=await MQ(E);t.get("fromRequests")!=="true"&&(r(Ri.WAITING_FOR_SIGNATURE),await Bce(((p=I.account)==null?void 0:p.toLowerCase())??"",I.provider)),d?window.location.href=decodeURIComponent(d):window.location.href="/",c(!1)}catch{r(Ri.ERROR)}},[r,c,f,d,t]),x=ze.useCallback(()=>{c(!1),f(void 0),r(Ri.CONNECTING_WALLET)},[c]),O=ze.useCallback(()=>{u&&A(u)},[u]);return ze.useEffect(()=>{const E=setInterval(()=>{w(p=>p===LQ.length-1?0:p+1)},5e3);return()=>{clearInterval(E)}},[]),Ye.jsxs("main",{className:Yv.main,children:[Ye.jsx("div",{className:Yv.background,style:{backgroundImage:`url(${LQ[m]})`}}),Ye.jsx(lWe,{open:n,onClose:y}),Ye.jsx(eWe,{open:a,onClose:_}),Ye.jsx(ace,{open:s,state:e,onClose:x,onTryAgain:O,providerType:u?Uce(u):null}),Ye.jsx("div",{className:Yv.left,children:Ye.jsxs("div",{className:Yv.leftInfo,children:[Ye.jsx(CGe,{onLearnMore:v,onConnect:A,loadingOption:u,socialOptions:{primary:Hn.GOOGLE,secondary:[Hn.DISCORD,Hn.APPLE,Hn.X]},web3Options:{primary:Hn.METAMASK,secondary:[Hn.FORTMATIC,Hn.COINBASE,Hn.WALLET_CONNECT]}}),g&&Ye.jsxs("div",{className:Yv.guestInfo,children:["Quick dive? ",Ye.jsx("a",{href:b,children:"Explore as a guest"})]})]})})]})};uye.render(Ye.jsx(eJ.StrictMode,{children:Ye.jsx(rme,{basename:"/auth",children:Ye.jsxs(Zye,{children:[Ye.jsx(tb,{path:"/login",element:Ye.jsx(vWe,{})}),Ye.jsx(tb,{path:"/callback",element:Ye.jsx(kGe,{})}),Ye.jsx(tb,{path:"/requests/:requestId",element:Ye.jsx(Mqe,{})}),Ye.jsx(tb,{path:"*",element:Ye.jsx(kqe,{})})]})})}),document.getElementById("root"));export{ut as B,m5e as R,zae as T,T$e as _,ii as a,za as b,Ne as c,Dc as d,fo as e,yN as f,uo as g,Ma as h,FW as n,TWe as o,Ic as p,nM as r,Ene as s,PWe as t,Cy as y};
187
- //# sourceMappingURL=index-2d000047.js.map
186
+ */(function(t){(function(){var e={}.hasOwnProperty;function r(){for(var n=[],i=0;i<arguments.length;i++){var a=arguments[i];if(a){var o=typeof a;if(o==="string"||o==="number")n.push(a);else if(Array.isArray(a)){if(a.length){var s=r.apply(null,a);s&&n.push(s)}}else if(o==="object"){if(a.toString!==Object.prototype.toString&&!a.toString.toString().includes("[native code]")){n.push(a.toString());continue}for(var c in a)e.call(a,c)&&a[c]&&n.push(c)}}}return n.join(" ")}t.exports?(r.default=r,t.exports=r):window.classNames=r})()})(Ece);var vze=Ece.exports;const dp=Dc(vze);var bze=_S();const wze=Dc(bze),_ze="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/logo-9a364aec.svg";var Gv={},JN,lQ;function Eze(){if(lQ)return JN;lQ=1;var t=kc(),e=bS();function r(n){return t(n)&&n.nodeType===1&&!e(n)}return JN=r,JN}var xce=ze.createContext(),Ace=ze.createContext();function xze(t){var e=t.children,r=ze.useState(null),n=r[0],i=r[1],a=ze.useRef(!1);ze.useEffect(function(){return function(){a.current=!0}},[]);var o=ze.useCallback(function(s){a.current||i(s)},[]);return ze.createElement(xce.Provider,{value:n},ze.createElement(Ace.Provider,{value:o},e))}var Sce=function(e){return Array.isArray(e)?e[0]:e},Oce=function(e){if(typeof e=="function"){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return e.apply(void 0,n)}},L5=function(e,r){if(typeof e=="function")return Oce(e,r);e!=null&&(e.current=r)},fQ=function(e){return e.reduce(function(r,n){var i=n[0],a=n[1];return r[i]=a,r},{})},dQ=typeof window<"u"&&window.document&&window.document.createElement?ze.useLayoutEffect:ze.useEffect,Mo="top",zs="bottom",Vs="right",ko="left",dL="auto",jw=[Mo,zs,Vs,ko],Dy="start",$1="end",Aze="clippingParents",Ice="viewport",Wv="popper",Sze="reference",hQ=jw.reduce(function(t,e){return t.concat([e+"-"+Dy,e+"-"+$1])},[]),Pce=[].concat(jw,[dL]).reduce(function(t,e){return t.concat([e,e+"-"+Dy,e+"-"+$1])},[]),Oze="beforeRead",Ize="read",Pze="afterRead",Tze="beforeMain",Rze="main",Cze="afterMain",Nze="beforeWrite",Dze="write",$ze="afterWrite",Mze=[Oze,Ize,Pze,Tze,Rze,Cze,Nze,Dze,$ze];function Au(t){return t?(t.nodeName||"").toLowerCase():null}function es(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function hp(t){var e=es(t).Element;return t instanceof e||t instanceof Element}function Bs(t){var e=es(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function hL(t){if(typeof ShadowRoot>"u")return!1;var e=es(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function kze(t){var e=t.state;Object.keys(e.elements).forEach(function(r){var n=e.styles[r]||{},i=e.attributes[r]||{},a=e.elements[r];!Bs(a)||!Au(a)||(Object.assign(a.style,n),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function Lze(t){var e=t.state,r={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,r.popper),e.styles=r,e.elements.arrow&&Object.assign(e.elements.arrow.style,r.arrow),function(){Object.keys(e.elements).forEach(function(n){var i=e.elements[n],a=e.attributes[n]||{},o=Object.keys(e.styles.hasOwnProperty(n)?e.styles[n]:r[n]),s=o.reduce(function(c,u){return c[u]="",c},{});!Bs(i)||!Au(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(c){i.removeAttribute(c)}))})}}const Uze={name:"applyStyles",enabled:!0,phase:"write",fn:kze,effect:Lze,requires:["computeStyles"]};function bu(t){return t.split("-")[0]}var Zh=Math.max,r2=Math.min,$y=Math.round;function U5(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function Tce(){return!/^((?!chrome|android).)*safari/i.test(U5())}function My(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!1);var n=t.getBoundingClientRect(),i=1,a=1;e&&Bs(t)&&(i=t.offsetWidth>0&&$y(n.width)/t.offsetWidth||1,a=t.offsetHeight>0&&$y(n.height)/t.offsetHeight||1);var o=hp(t)?es(t):window,s=o.visualViewport,c=!Tce()&&r,u=(n.left+(c&&s?s.offsetLeft:0))/i,f=(n.top+(c&&s?s.offsetTop:0))/a,d=n.width/i,g=n.height/a;return{width:d,height:g,top:f,right:u+d,bottom:f+g,left:u,x:u,y:f}}function pL(t){var e=My(t),r=t.offsetWidth,n=t.offsetHeight;return Math.abs(e.width-r)<=1&&(r=e.width),Math.abs(e.height-n)<=1&&(n=e.height),{x:t.offsetLeft,y:t.offsetTop,width:r,height:n}}function Rce(t,e){var r=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(r&&hL(r)){var n=e;do{if(n&&t.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function kl(t){return es(t).getComputedStyle(t)}function Bze(t){return["table","td","th"].indexOf(Au(t))>=0}function Td(t){return((hp(t)?t.ownerDocument:t.document)||window.document).documentElement}function DO(t){return Au(t)==="html"?t:t.assignedSlot||t.parentNode||(hL(t)?t.host:null)||Td(t)}function pQ(t){return!Bs(t)||kl(t).position==="fixed"?null:t.offsetParent}function Fze(t){var e=/firefox/i.test(U5()),r=/Trident/i.test(U5());if(r&&Bs(t)){var n=kl(t);if(n.position==="fixed")return null}var i=DO(t);for(hL(i)&&(i=i.host);Bs(i)&&["html","body"].indexOf(Au(i))<0;){var a=kl(i);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||e&&a.willChange==="filter"||e&&a.filter&&a.filter!=="none")return i;i=i.parentNode}return null}function qw(t){for(var e=es(t),r=pQ(t);r&&Bze(r)&&kl(r).position==="static";)r=pQ(r);return r&&(Au(r)==="html"||Au(r)==="body"&&kl(r).position==="static")?e:r||Fze(t)||e}function gL(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Gb(t,e,r){return Zh(t,r2(e,r))}function jze(t,e,r){var n=Gb(t,e,r);return n>r?r:n}function Cce(){return{top:0,right:0,bottom:0,left:0}}function Nce(t){return Object.assign({},Cce(),t)}function Dce(t,e){return e.reduce(function(r,n){return r[n]=t,r},{})}var qze=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,Nce(typeof e!="number"?e:Dce(e,jw))};function Hze(t){var e,r=t.state,n=t.name,i=t.options,a=r.elements.arrow,o=r.modifiersData.popperOffsets,s=bu(r.placement),c=gL(s),u=[ko,Vs].indexOf(s)>=0,f=u?"height":"width";if(!(!a||!o)){var d=qze(i.padding,r),g=pL(a),m=c==="y"?Mo:ko,w=c==="y"?zs:Vs,v=r.rects.reference[f]+r.rects.reference[c]-o[c]-r.rects.popper[f],y=o[c]-r.rects.reference[c],_=qw(a),b=_?c==="y"?_.clientHeight||0:_.clientWidth||0:0,A=v/2-y/2,x=d[m],O=b-g[f]-d[w],E=b/2-g[f]/2+A,p=Gb(x,E,O),I=c;r.modifiersData[n]=(e={},e[I]=p,e.centerOffset=p-E,e)}}function zze(t){var e=t.state,r=t.options,n=r.element,i=n===void 0?"[data-popper-arrow]":n;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||Rce(e.elements.popper,i)&&(e.elements.arrow=i))}const Vze={name:"arrow",enabled:!0,phase:"main",fn:Hze,effect:zze,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ky(t){return t.split("-")[1]}var Gze={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Wze(t,e){var r=t.x,n=t.y,i=e.devicePixelRatio||1;return{x:$y(r*i)/i||0,y:$y(n*i)/i||0}}function gQ(t){var e,r=t.popper,n=t.popperRect,i=t.placement,a=t.variation,o=t.offsets,s=t.position,c=t.gpuAcceleration,u=t.adaptive,f=t.roundOffsets,d=t.isFixed,g=o.x,m=g===void 0?0:g,w=o.y,v=w===void 0?0:w,y=typeof f=="function"?f({x:m,y:v}):{x:m,y:v};m=y.x,v=y.y;var _=o.hasOwnProperty("x"),b=o.hasOwnProperty("y"),A=ko,x=Mo,O=window;if(u){var E=qw(r),p="clientHeight",I="clientWidth";if(E===es(r)&&(E=Td(r),kl(E).position!=="static"&&s==="absolute"&&(p="scrollHeight",I="scrollWidth")),E=E,i===Mo||(i===ko||i===Vs)&&a===$1){x=zs;var C=d&&E===O&&O.visualViewport?O.visualViewport.height:E[p];v-=C-n.height,v*=c?1:-1}if(i===ko||(i===Mo||i===zs)&&a===$1){A=Vs;var L=d&&E===O&&O.visualViewport?O.visualViewport.width:E[I];m-=L-n.width,m*=c?1:-1}}var q=Object.assign({position:s},u&&Gze),le=f===!0?Wze({x:m,y:v},es(r)):{x:m,y:v};if(m=le.x,v=le.y,c){var pe;return Object.assign({},q,(pe={},pe[x]=b?"0":"",pe[A]=_?"0":"",pe.transform=(O.devicePixelRatio||1)<=1?"translate("+m+"px, "+v+"px)":"translate3d("+m+"px, "+v+"px, 0)",pe))}return Object.assign({},q,(e={},e[x]=b?v+"px":"",e[A]=_?m+"px":"",e.transform="",e))}function Kze(t){var e=t.state,r=t.options,n=r.gpuAcceleration,i=n===void 0?!0:n,a=r.adaptive,o=a===void 0?!0:a,s=r.roundOffsets,c=s===void 0?!0:s,u={placement:bu(e.placement),variation:ky(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,gQ(Object.assign({},u,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,gQ(Object.assign({},u,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Yze={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Kze,data:{}};var CE={passive:!0};function Qze(t){var e=t.state,r=t.instance,n=t.options,i=n.scroll,a=i===void 0?!0:i,o=n.resize,s=o===void 0?!0:o,c=es(e.elements.popper),u=[].concat(e.scrollParents.reference,e.scrollParents.popper);return a&&u.forEach(function(f){f.addEventListener("scroll",r.update,CE)}),s&&c.addEventListener("resize",r.update,CE),function(){a&&u.forEach(function(f){f.removeEventListener("scroll",r.update,CE)}),s&&c.removeEventListener("resize",r.update,CE)}}const Jze={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Qze,data:{}};var Xze={left:"right",right:"left",bottom:"top",top:"bottom"};function Rx(t){return t.replace(/left|right|bottom|top/g,function(e){return Xze[e]})}var Zze={start:"end",end:"start"};function yQ(t){return t.replace(/start|end/g,function(e){return Zze[e]})}function yL(t){var e=es(t),r=e.pageXOffset,n=e.pageYOffset;return{scrollLeft:r,scrollTop:n}}function mL(t){return My(Td(t)).left+yL(t).scrollLeft}function eVe(t,e){var r=es(t),n=Td(t),i=r.visualViewport,a=n.clientWidth,o=n.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;var u=Tce();(u||!u&&e==="fixed")&&(s=i.offsetLeft,c=i.offsetTop)}return{width:a,height:o,x:s+mL(t),y:c}}function tVe(t){var e,r=Td(t),n=yL(t),i=(e=t.ownerDocument)==null?void 0:e.body,a=Zh(r.scrollWidth,r.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=Zh(r.scrollHeight,r.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-n.scrollLeft+mL(t),c=-n.scrollTop;return kl(i||r).direction==="rtl"&&(s+=Zh(r.clientWidth,i?i.clientWidth:0)-a),{width:a,height:o,x:s,y:c}}function vL(t){var e=kl(t),r=e.overflow,n=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(r+i+n)}function $ce(t){return["html","body","#document"].indexOf(Au(t))>=0?t.ownerDocument.body:Bs(t)&&vL(t)?t:$ce(DO(t))}function Wb(t,e){var r;e===void 0&&(e=[]);var n=$ce(t),i=n===((r=t.ownerDocument)==null?void 0:r.body),a=es(n),o=i?[a].concat(a.visualViewport||[],vL(n)?n:[]):n,s=e.concat(o);return i?s:s.concat(Wb(DO(o)))}function B5(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function rVe(t,e){var r=My(t,!1,e==="fixed");return r.top=r.top+t.clientTop,r.left=r.left+t.clientLeft,r.bottom=r.top+t.clientHeight,r.right=r.left+t.clientWidth,r.width=t.clientWidth,r.height=t.clientHeight,r.x=r.left,r.y=r.top,r}function mQ(t,e,r){return e===Ice?B5(eVe(t,r)):hp(e)?rVe(e,r):B5(tVe(Td(t)))}function nVe(t){var e=Wb(DO(t)),r=["absolute","fixed"].indexOf(kl(t).position)>=0,n=r&&Bs(t)?qw(t):t;return hp(n)?e.filter(function(i){return hp(i)&&Rce(i,n)&&Au(i)!=="body"}):[]}function iVe(t,e,r,n){var i=e==="clippingParents"?nVe(t):[].concat(e),a=[].concat(i,[r]),o=a[0],s=a.reduce(function(c,u){var f=mQ(t,u,n);return c.top=Zh(f.top,c.top),c.right=r2(f.right,c.right),c.bottom=r2(f.bottom,c.bottom),c.left=Zh(f.left,c.left),c},mQ(t,o,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Mce(t){var e=t.reference,r=t.element,n=t.placement,i=n?bu(n):null,a=n?ky(n):null,o=e.x+e.width/2-r.width/2,s=e.y+e.height/2-r.height/2,c;switch(i){case Mo:c={x:o,y:e.y-r.height};break;case zs:c={x:o,y:e.y+e.height};break;case Vs:c={x:e.x+e.width,y:s};break;case ko:c={x:e.x-r.width,y:s};break;default:c={x:e.x,y:e.y}}var u=i?gL(i):null;if(u!=null){var f=u==="y"?"height":"width";switch(a){case Dy:c[u]=c[u]-(e[f]/2-r[f]/2);break;case $1:c[u]=c[u]+(e[f]/2-r[f]/2);break}}return c}function M1(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=n===void 0?t.placement:n,a=r.strategy,o=a===void 0?t.strategy:a,s=r.boundary,c=s===void 0?Aze:s,u=r.rootBoundary,f=u===void 0?Ice:u,d=r.elementContext,g=d===void 0?Wv:d,m=r.altBoundary,w=m===void 0?!1:m,v=r.padding,y=v===void 0?0:v,_=Nce(typeof y!="number"?y:Dce(y,jw)),b=g===Wv?Sze:Wv,A=t.rects.popper,x=t.elements[w?b:g],O=iVe(hp(x)?x:x.contextElement||Td(t.elements.popper),c,f,o),E=My(t.elements.reference),p=Mce({reference:E,element:A,strategy:"absolute",placement:i}),I=B5(Object.assign({},A,p)),C=g===Wv?I:E,L={top:O.top-C.top+_.top,bottom:C.bottom-O.bottom+_.bottom,left:O.left-C.left+_.left,right:C.right-O.right+_.right},q=t.modifiersData.offset;if(g===Wv&&q){var le=q[i];Object.keys(L).forEach(function(pe){var B=[Vs,zs].indexOf(pe)>=0?1:-1,U=[Mo,zs].indexOf(pe)>=0?"y":"x";L[pe]+=le[U]*B})}return L}function aVe(t,e){e===void 0&&(e={});var r=e,n=r.placement,i=r.boundary,a=r.rootBoundary,o=r.padding,s=r.flipVariations,c=r.allowedAutoPlacements,u=c===void 0?Pce:c,f=ky(n),d=f?s?hQ:hQ.filter(function(w){return ky(w)===f}):jw,g=d.filter(function(w){return u.indexOf(w)>=0});g.length===0&&(g=d);var m=g.reduce(function(w,v){return w[v]=M1(t,{placement:v,boundary:i,rootBoundary:a,padding:o})[bu(v)],w},{});return Object.keys(m).sort(function(w,v){return m[w]-m[v]})}function oVe(t){if(bu(t)===dL)return[];var e=Rx(t);return[yQ(t),e,yQ(e)]}function sVe(t){var e=t.state,r=t.options,n=t.name;if(!e.modifiersData[n]._skip){for(var i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!0:o,c=r.fallbackPlacements,u=r.padding,f=r.boundary,d=r.rootBoundary,g=r.altBoundary,m=r.flipVariations,w=m===void 0?!0:m,v=r.allowedAutoPlacements,y=e.options.placement,_=bu(y),b=_===y,A=c||(b||!w?[Rx(y)]:oVe(y)),x=[y].concat(A).reduce(function(M,G){return M.concat(bu(G)===dL?aVe(e,{placement:G,boundary:f,rootBoundary:d,padding:u,flipVariations:w,allowedAutoPlacements:v}):G)},[]),O=e.rects.reference,E=e.rects.popper,p=new Map,I=!0,C=x[0],L=0;L<x.length;L++){var q=x[L],le=bu(q),pe=ky(q)===Dy,B=[Mo,zs].indexOf(le)>=0,U=B?"width":"height",K=M1(e,{placement:q,boundary:f,rootBoundary:d,altBoundary:g,padding:u}),ne=B?pe?Vs:ko:pe?zs:Mo;O[U]>E[U]&&(ne=Rx(ne));var F=Rx(ne),j=[];if(a&&j.push(K[le]<=0),s&&j.push(K[ne]<=0,K[F]<=0),j.every(function(M){return M})){C=q,I=!1;break}p.set(q,j)}if(I)for(var z=w?3:1,$=function(G){var ge=x.find(function(Q){var te=p.get(Q);if(te)return te.slice(0,G).every(function(ce){return ce})});if(ge)return C=ge,"break"},H=z;H>0;H--){var k=$(H);if(k==="break")break}e.placement!==C&&(e.modifiersData[n]._skip=!0,e.placement=C,e.reset=!0)}}const cVe={name:"flip",enabled:!0,phase:"main",fn:sVe,requiresIfExists:["offset"],data:{_skip:!1}};function vQ(t,e,r){return r===void 0&&(r={x:0,y:0}),{top:t.top-e.height-r.y,right:t.right-e.width+r.x,bottom:t.bottom-e.height+r.y,left:t.left-e.width-r.x}}function bQ(t){return[Mo,Vs,zs,ko].some(function(e){return t[e]>=0})}function uVe(t){var e=t.state,r=t.name,n=e.rects.reference,i=e.rects.popper,a=e.modifiersData.preventOverflow,o=M1(e,{elementContext:"reference"}),s=M1(e,{altBoundary:!0}),c=vQ(o,n),u=vQ(s,i,a),f=bQ(c),d=bQ(u);e.modifiersData[r]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:f,hasPopperEscaped:d},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":d})}const lVe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:uVe};function fVe(t,e,r){var n=bu(t),i=[ko,Mo].indexOf(n)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},e,{placement:t})):r,o=a[0],s=a[1];return o=o||0,s=(s||0)*i,[ko,Vs].indexOf(n)>=0?{x:s,y:o}:{x:o,y:s}}function dVe(t){var e=t.state,r=t.options,n=t.name,i=r.offset,a=i===void 0?[0,0]:i,o=Pce.reduce(function(f,d){return f[d]=fVe(d,e.rects,a),f},{}),s=o[e.placement],c=s.x,u=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=u),e.modifiersData[n]=o}const hVe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:dVe};function pVe(t){var e=t.state,r=t.name;e.modifiersData[r]=Mce({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const gVe={name:"popperOffsets",enabled:!0,phase:"read",fn:pVe,data:{}};function yVe(t){return t==="x"?"y":"x"}function mVe(t){var e=t.state,r=t.options,n=t.name,i=r.mainAxis,a=i===void 0?!0:i,o=r.altAxis,s=o===void 0?!1:o,c=r.boundary,u=r.rootBoundary,f=r.altBoundary,d=r.padding,g=r.tether,m=g===void 0?!0:g,w=r.tetherOffset,v=w===void 0?0:w,y=M1(e,{boundary:c,rootBoundary:u,padding:d,altBoundary:f}),_=bu(e.placement),b=ky(e.placement),A=!b,x=gL(_),O=yVe(x),E=e.modifiersData.popperOffsets,p=e.rects.reference,I=e.rects.popper,C=typeof v=="function"?v(Object.assign({},e.rects,{placement:e.placement})):v,L=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),q=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,le={x:0,y:0};if(E){if(a){var pe,B=x==="y"?Mo:ko,U=x==="y"?zs:Vs,K=x==="y"?"height":"width",ne=E[x],F=ne+y[B],j=ne-y[U],z=m?-I[K]/2:0,$=b===Dy?p[K]:I[K],H=b===Dy?-I[K]:-p[K],k=e.elements.arrow,M=m&&k?pL(k):{width:0,height:0},G=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:Cce(),ge=G[B],Q=G[U],te=Gb(0,p[K],M[K]),ce=A?p[K]/2-z-te-ge-L.mainAxis:$-te-ge-L.mainAxis,T=A?-p[K]/2+z+te+Q+L.mainAxis:H+te+Q+L.mainAxis,fe=e.elements.arrow&&qw(e.elements.arrow),Ve=fe?x==="y"?fe.clientTop||0:fe.clientLeft||0:0,tt=(pe=q==null?void 0:q[x])!=null?pe:0,mt=ne+ce-tt-Ve,vt=ne+T-tt,gt=Gb(m?r2(F,mt):F,ne,m?Zh(j,vt):j);E[x]=gt,le[x]=gt-ne}if(s){var Lt,Yt=x==="x"?Mo:ko,wr=x==="x"?zs:Vs,Rt=E[O],Pt=O==="y"?"height":"width",kt=Rt+y[Yt],Nt=Rt-y[wr],Kt=[Mo,ko].indexOf(_)!==-1,Ut=(Lt=q==null?void 0:q[O])!=null?Lt:0,zt=Kt?kt:Rt-p[Pt]-I[Pt]-Ut+L.altAxis,$t=Kt?Rt+p[Pt]+I[Pt]-Ut-L.altAxis:Nt,Dt=m&&Kt?jze(zt,Rt,$t):Gb(m?zt:kt,Rt,m?$t:Nt);E[O]=Dt,le[O]=Dt-Rt}e.modifiersData[n]=le}}const vVe={name:"preventOverflow",enabled:!0,phase:"main",fn:mVe,requiresIfExists:["offset"]};function bVe(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function wVe(t){return t===es(t)||!Bs(t)?yL(t):bVe(t)}function _Ve(t){var e=t.getBoundingClientRect(),r=$y(e.width)/t.offsetWidth||1,n=$y(e.height)/t.offsetHeight||1;return r!==1||n!==1}function EVe(t,e,r){r===void 0&&(r=!1);var n=Bs(e),i=Bs(e)&&_Ve(e),a=Td(e),o=My(t,i,r),s={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(n||!n&&!r)&&((Au(e)!=="body"||vL(a))&&(s=wVe(e)),Bs(e)?(c=My(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):a&&(c.x=mL(a))),{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function xVe(t){var e=new Map,r=new Set,n=[];t.forEach(function(a){e.set(a.name,a)});function i(a){r.add(a.name);var o=[].concat(a.requires||[],a.requiresIfExists||[]);o.forEach(function(s){if(!r.has(s)){var c=e.get(s);c&&i(c)}}),n.push(a)}return t.forEach(function(a){r.has(a.name)||i(a)}),n}function AVe(t){var e=xVe(t);return Mze.reduce(function(r,n){return r.concat(e.filter(function(i){return i.phase===n}))},[])}function SVe(t){var e;return function(){return e||(e=new Promise(function(r){Promise.resolve().then(function(){e=void 0,r(t())})})),e}}function OVe(t){var e=t.reduce(function(r,n){var i=r[n.name];return r[n.name]=i?Object.assign({},i,n,{options:Object.assign({},i.options,n.options),data:Object.assign({},i.data,n.data)}):n,r},{});return Object.keys(e).map(function(r){return e[r]})}var wQ={placement:"bottom",modifiers:[],strategy:"absolute"};function _Q(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return!e.some(function(n){return!(n&&typeof n.getBoundingClientRect=="function")})}function IVe(t){t===void 0&&(t={});var e=t,r=e.defaultModifiers,n=r===void 0?[]:r,i=e.defaultOptions,a=i===void 0?wQ:i;return function(s,c,u){u===void 0&&(u=a);var f={placement:"bottom",orderedModifiers:[],options:Object.assign({},wQ,a),modifiersData:{},elements:{reference:s,popper:c},attributes:{},styles:{}},d=[],g=!1,m={state:f,setOptions:function(_){var b=typeof _=="function"?_(f.options):_;v(),f.options=Object.assign({},a,f.options,b),f.scrollParents={reference:hp(s)?Wb(s):s.contextElement?Wb(s.contextElement):[],popper:Wb(c)};var A=AVe(OVe([].concat(n,f.options.modifiers)));return f.orderedModifiers=A.filter(function(x){return x.enabled}),w(),m.update()},forceUpdate:function(){if(!g){var _=f.elements,b=_.reference,A=_.popper;if(_Q(b,A)){f.rects={reference:EVe(b,qw(A),f.options.strategy==="fixed"),popper:pL(A)},f.reset=!1,f.placement=f.options.placement,f.orderedModifiers.forEach(function(L){return f.modifiersData[L.name]=Object.assign({},L.data)});for(var x=0;x<f.orderedModifiers.length;x++){if(f.reset===!0){f.reset=!1,x=-1;continue}var O=f.orderedModifiers[x],E=O.fn,p=O.options,I=p===void 0?{}:p,C=O.name;typeof E=="function"&&(f=E({state:f,options:I,name:C,instance:m})||f)}}}},update:SVe(function(){return new Promise(function(y){m.forceUpdate(),y(f)})}),destroy:function(){v(),g=!0}};if(!_Q(s,c))return m;m.setOptions(u).then(function(y){!g&&u.onFirstUpdate&&u.onFirstUpdate(y)});function w(){f.orderedModifiers.forEach(function(y){var _=y.name,b=y.options,A=b===void 0?{}:b,x=y.effect;if(typeof x=="function"){var O=x({state:f,name:_,instance:m,options:A}),E=function(){};d.push(O||E)}})}function v(){d.forEach(function(y){return y()}),d=[]}return m}}var PVe=[Jze,gVe,Yze,Uze,hVe,cVe,vVe,Vze,lVe],TVe=IVe({defaultModifiers:PVe}),RVe=typeof Element<"u",CVe=typeof Map=="function",NVe=typeof Set=="function",DVe=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Cx(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,i;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Cx(t[n],e[n]))return!1;return!0}var a;if(CVe&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;for(a=t.entries();!(n=a.next()).done;)if(!Cx(n.value[1],e.get(n.value[0])))return!1;return!0}if(NVe&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(a=t.entries();!(n=a.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(DVe&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===e.toString();if(i=Object.keys(t),r=i.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,i[n]))return!1;if(RVe&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((i[n]==="_owner"||i[n]==="__v"||i[n]==="__o")&&t.$$typeof)&&!Cx(t[i[n]],e[i[n]]))return!1;return!0}return t!==t&&e!==e}var $Ve=function(e,r){try{return Cx(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const MVe=Dc($Ve);var kVe=[],kce=function(e,r,n){n===void 0&&(n={});var i=ze.useRef(null),a={onFirstUpdate:n.onFirstUpdate,placement:n.placement||"bottom",strategy:n.strategy||"absolute",modifiers:n.modifiers||kVe},o=ze.useState({styles:{popper:{position:a.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),s=o[0],c=o[1],u=ze.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(m){var w=m.state,v=Object.keys(w.elements);l1.flushSync(function(){c({styles:fQ(v.map(function(y){return[y,w.styles[y]||{}]})),attributes:fQ(v.map(function(y){return[y,w.attributes[y]]}))})})},requires:["computeStyles"]}},[]),f=ze.useMemo(function(){var g={onFirstUpdate:a.onFirstUpdate,placement:a.placement,strategy:a.strategy,modifiers:[].concat(a.modifiers,[u,{name:"applyStyles",enabled:!1}])};return MVe(i.current,g)?i.current||g:(i.current=g,g)},[a.onFirstUpdate,a.placement,a.strategy,a.modifiers,u]),d=ze.useRef();return dQ(function(){d.current&&d.current.setOptions(f)},[f]),dQ(function(){if(!(e==null||r==null)){var g=n.createPopper||TVe,m=g(e,r,f);return d.current=m,function(){m.destroy(),d.current=null}}},[e,r,n.createPopper]),{state:d.current?d.current.state:null,styles:s.styles,attributes:s.attributes,update:d.current?d.current.update:null,forceUpdate:d.current?d.current.forceUpdate:null}},LVe=function(){},UVe=function(){return Promise.resolve(null)},BVe=[];function FVe(t){var e=t.placement,r=e===void 0?"bottom":e,n=t.strategy,i=n===void 0?"absolute":n,a=t.modifiers,o=a===void 0?BVe:a,s=t.referenceElement,c=t.onFirstUpdate,u=t.innerRef,f=t.children,d=ze.useContext(xce),g=ze.useState(null),m=g[0],w=g[1],v=ze.useState(null),y=v[0],_=v[1];ze.useEffect(function(){L5(u,m)},[u,m]);var b=ze.useMemo(function(){return{placement:r,strategy:i,onFirstUpdate:c,modifiers:[].concat(o,[{name:"arrow",enabled:y!=null,options:{element:y}}])}},[r,i,c,o,y]),A=kce(s||d,m,b),x=A.state,O=A.styles,E=A.forceUpdate,p=A.update,I=ze.useMemo(function(){return{ref:w,style:O.popper,placement:x?x.placement:r,hasPopperEscaped:x&&x.modifiersData.hide?x.modifiersData.hide.hasPopperEscaped:null,isReferenceHidden:x&&x.modifiersData.hide?x.modifiersData.hide.isReferenceHidden:null,arrowProps:{style:O.arrow,ref:_},forceUpdate:E||LVe,update:p||UVe}},[w,_,r,x,O,p,E]);return Sce(f)(I)}var jVe=function(){},qVe=jVe;const HVe=Dc(qVe);function zVe(t){var e=t.children,r=t.innerRef,n=ze.useContext(Ace),i=ze.useCallback(function(a){L5(r,a),Oce(n,a)},[r,n]);return ze.useEffect(function(){return function(){return L5(r,null)}},[]),ze.useEffect(function(){HVe(!!n,"`Reference` should not be used outside of a `Manager` component.")},[n]),Sce(e)({ref:i})}const VVe=Object.freeze(Object.defineProperty({__proto__:null,Manager:xze,Popper:FVe,Reference:zVe,usePopper:kce},Symbol.toStringTag,{value:"Module"})),GVe=uo(VVe);var Ku={},XN,EQ;function WVe(){if(EQ)return XN;EQ=1;var t=$$();function e(r,n,i,a){return t(r,function(o,s,c){n(a,i(o),s,c)}),a}return XN=e,XN}var ZN,xQ;function KVe(){if(xQ)return ZN;xQ=1;var t=WVe();function e(r,n){return function(i,a){return t(i,r,n(a),{})}}return ZN=e,ZN}var e6,AQ;function YVe(){if(AQ)return e6;AQ=1;var t=nre(),e=KVe(),r=md(),n=Object.prototype,i=n.toString,a=e(function(o,s,c){s!=null&&typeof s.toString!="function"&&(s=i.call(s)),o[s]=c},t(r));return e6=a,e6}var SQ;function QVe(){if(SQ)return Ku;SQ=1;var t=br;Ku.__esModule=!0,Ku.placementMapping=Ku.positions=Ku.positionsMapping=void 0;var e=t(YVe()),r=t(Hl()),n={"top center":"top","top left":"top-start","top right":"top-end","bottom center":"bottom","bottom left":"bottom-start","bottom right":"bottom-end","right center":"right","left center":"left"};Ku.positionsMapping=n;var i=(0,r.default)(n);Ku.positions=i;var a=(0,e.default)(n);return Ku.placementMapping=a,Ku}var Kv={},t6={exports:{}},r6={exports:{}},n6={exports:{}},OQ;function JVe(){return OQ||(OQ=1,function(t){var e=w$.default;function r(n,i){if(e(n)!=="object"||n===null)return n;var a=n[Symbol.toPrimitive];if(a!==void 0){var o=a.call(n,i||"default");if(e(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(n)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(n6)),n6.exports}var IQ;function XVe(){return IQ||(IQ=1,function(t){var e=w$.default,r=JVe();function n(i){var a=r(i,"string");return e(a)==="symbol"?a:String(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(r6)),r6.exports}var PQ;function ZVe(){return PQ||(PQ=1,function(t){var e=XVe();function r(i,a){for(var o=0;o<a.length;o++){var s=a[o];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(i,e(s.key),s)}}function n(i,a,o){return a&&r(i.prototype,a),o&&r(i,o),Object.defineProperty(i,"prototype",{writable:!1}),i}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}(t6)),t6.exports}var TQ;function eGe(){if(TQ)return Kv;TQ=1;var t=br;Kv.__esModule=!0,Kv.default=void 0;var e=t(ZVe()),r=t(A$()),n=t(Ks()),i=vd,a=function(){function c(f){this.ref=f}var u=c.prototype;return u.getBoundingClientRect=function(){return(0,n.default)(this.ref.current,"getBoundingClientRect")||{}},(0,e.default)(c,[{key:"clientWidth",get:function(){return this.getBoundingClientRect().width}},{key:"clientHeight",get:function(){return this.getBoundingClientRect().height}},{key:"parentNode",get:function(){return this.ref.current?this.ref.current.parentNode:void 0}}]),c}(),o=(0,r.default)(function(c){return new a((0,i.isRefObject)(c)?c:{current:c})}),s=o;return Kv.default=s,Kv}var NE={},RQ;function tGe(){if(RQ)return NE;RQ=1;var t=br;NE.__esModule=!0,NE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("content",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),NE}var DE={},CQ;function rGe(){if(CQ)return DE;CQ=1;var t=br;DE.__esModule=!0,DE.default=a;var e=t(Bn()),r=t(ii);t(Ln());var n=t(ze),i=Wn();function a(o){var s=o.children,c=o.className,u=o.content,f=(0,r.default)("header",c),d=(0,i.getUnhandledProps)(a,o),g=(0,i.getElementType)(a,o);return n.default.createElement(g,(0,e.default)({},d,{className:f}),i.childrenUtils.isNil(s)?u:s)}return a.handledProps=["as","children","className","content"],a.propTypes={},a.create=(0,i.createShorthandFactory)(a,function(o){return{children:o}}),DE}var NQ;function nGe(){if(NQ)return Gv;NQ=1;var t=Ws,e=br;Gv.__esModule=!0,Gv.default=void 0;var r=e(Bn()),n=e(Mc());e(G$());var i=e(ql()),a=e(C$()),o=e(Ks()),s=e(Eze()),c=e(Di()),u=e(H$()),f=e(V$()),d=e(Zse()),g=e(z$()),m=e(ii);e(Ln());var w=t(ze),v=GVe,y=e(ece()),_=Wn(),b=e(W$()),A=QVe(),x=e(eGe()),O=e(tGe()),E=e(rGe()),p=function(I){(0,n.default)(C,I);function C(){for(var q,le=arguments.length,pe=new Array(le),B=0;B<le;B++)pe[B]=arguments[B];return q=I.call.apply(I,[this].concat(pe))||this,q.state={},q.open=!1,q.zIndexWasSynced=!1,q.triggerRef=w.default.createRef(),q.elementRef=w.default.createRef(),q.getPortalProps=function(){var U={},K=q.props,ne=K.on,F=K.hoverable,j=(0,c.default)(ne)?ne:[ne];return F&&(U.closeOnPortalMouseLeave=!0,U.mouseLeaveDelay=300),(0,f.default)(j,"hover")&&(U.openOnTriggerClick=!1,U.closeOnTriggerClick=!1,U.openOnTriggerMouseEnter=!0,U.closeOnTriggerMouseLeave=!0,U.mouseLeaveDelay=70,U.mouseEnterDelay=50),(0,f.default)(j,"click")&&(U.openOnTriggerClick=!0,U.closeOnTriggerClick=!0,U.closeOnDocumentClick=!0),(0,f.default)(j,"focus")&&(U.openOnTriggerFocus=!0,U.closeOnTriggerBlur=!0),U},q.hideOnScroll=function(U){(0,s.default)(U.target)&&q.elementRef.current.contains(U.target)||(q.setState({closed:!0}),_.eventStack.unsub("scroll",q.hideOnScroll,{target:window}),q.timeoutId=setTimeout(function(){q.setState({closed:!1})},50),q.handleClose(U))},q.handleClose=function(U){(0,o.default)(q.props,"onClose",U,(0,r.default)({},q.props,{open:!1}))},q.handleOpen=function(U){(0,o.default)(q.props,"onOpen",U,(0,r.default)({},q.props,{open:!0}))},q.handlePortalMount=function(U){(0,o.default)(q.props,"onMount",U,q.props)},q.handlePortalUnmount=function(U){q.positionUpdate=null,(0,o.default)(q.props,"onUnmount",U,q.props)},q.renderContent=function(U){var K=U.placement,ne=U.ref,F=U.update,j=U.style,z=q.props,$=z.basic,H=z.children,k=z.className,M=z.content,G=z.hideOnScroll,ge=z.flowing,Q=z.header,te=z.inverted,ce=z.popper,T=z.size,fe=z.style,Ve=z.wide,tt=q.state.contentRestProps;q.positionUpdate=F;var mt=(0,m.default)("ui",A.placementMapping[K],T,(0,_.useKeyOrValueAndKey)(Ve,"wide"),(0,_.useKeyOnly)($,"basic"),(0,_.useKeyOnly)(ge,"flowing"),(0,_.useKeyOnly)(te,"inverted"),"popup transition visible",k),vt=(0,_.getElementType)(C,q.props),gt=(0,r.default)({left:"auto",right:"auto",position:"initial"},fe),Lt=w.default.createElement(vt,(0,r.default)({},tt,{className:mt,style:gt,ref:q.elementRef}),_.childrenUtils.isNil(H)?w.default.createElement(w.default.Fragment,null,E.default.create(Q,{autoGenerateKey:!1}),O.default.create(M,{autoGenerateKey:!1})):H,G&&w.default.createElement(g.default,{on:q.hideOnScroll,name:"scroll",target:"window"}));return(0,_.createHTMLDivision)(ce||{},{overrideProps:{children:Lt,ref:ne,style:(0,r.default)({display:"flex"},j)}})},q}C.getDerivedStateFromProps=function(le,pe){if(pe.closed||pe.disabled)return{};var B=(0,_.getUnhandledProps)(C,le),U=(0,d.default)(B,function(ne,F,j){return(0,f.default)(b.default.handledProps,j)||(ne[j]=F),ne},{}),K=(0,u.default)(B,b.default.handledProps);return{contentRestProps:U,portalRestProps:K}};var L=C.prototype;return L.componentDidUpdate=function(le){var pe=(0,y.default)(this.props.popperDependencies,le.popperDependencies);pe||this.handleUpdate()},L.componentWillUnmount=function(){clearTimeout(this.timeoutId)},L.handleUpdate=function(){this.positionUpdate&&this.positionUpdate()},L.render=function(){var le=this,pe=this.props,B=pe.context,U=pe.disabled,K=pe.eventsEnabled,ne=pe.offset,F=pe.pinned,j=pe.popper,z=pe.popperModifiers,$=pe.position,H=pe.positionFixed,k=pe.trigger,M=this.state,G=M.closed,ge=M.portalRestProps;if(G||U)return k;var Q=[{name:"arrow",enabled:!1},{name:"eventListeners",options:{scroll:!!K,resize:!!K}},{name:"flip",enabled:!F},{name:"preventOverflow",enabled:!!ne},{name:"offset",enabled:!!ne,options:{offset:ne}}].concat(z,[{name:"syncZIndex",enabled:!0,phase:"beforeRead",fn:function(fe){var Ve,tt=fe.state;if(!le.zIndexWasSynced){var mt=j==null||(Ve=j.style)==null?void 0:Ve.zIndex;(0,a.default)(mt)&&(tt.elements.popper.style.zIndex=window.getComputedStyle(tt.elements.popper.firstChild).zIndex),le.zIndexWasSynced=!0}},effect:function(){return function(){le.zIndexWasSynced=!1}}}]),te=(0,x.default)((0,i.default)(B)?this.triggerRef:B),ce=(0,r.default)({},this.getPortalProps(),ge);return w.default.createElement(b.default,(0,r.default)({},ce,{onClose:this.handleClose,onMount:this.handlePortalMount,onOpen:this.handleOpen,onUnmount:this.handlePortalUnmount,trigger:k,triggerRef:this.triggerRef}),w.default.createElement(v.Popper,{modifiers:Q,placement:A.positionsMapping[$],strategy:H?"fixed":null,referenceElement:te},this.renderContent))},C}(w.Component);return Gv.default=p,p.handledProps=["as","basic","children","className","content","context","disabled","eventsEnabled","flowing","header","hideOnScroll","hoverable","inverted","offset","on","onClose","onMount","onOpen","onUnmount","pinned","popper","popperDependencies","popperModifiers","position","positionFixed","size","style","trigger","wide"],p.propTypes={},p.defaultProps={disabled:!1,eventsEnabled:!0,on:["click","hover"],pinned:!1,popperModifiers:[],position:"top left"},p.Content=O.default,p.Header=E.default,Gv}var iGe=br,aGe=iGe(nGe()),oGe=aGe.default;const sGe=t=>t.charAt(0).toUpperCase()+t.slice(1),cGe="_button_1uvkr_1",uGe="_icon_1uvkr_5",$E={button:cGe,icon:uGe,"icon-metamask-mobile":"_icon-metamask-mobile_1uvkr_13","icon-metamask":"_icon-metamask_1uvkr_13","icon-dapper":"_icon-dapper_1uvkr_18","icon-fortmatic":"_icon-fortmatic_1uvkr_22","icon-wallet-connect":"_icon-wallet-connect_1uvkr_26","icon-samsung-blockchain-wallet":"_icon-samsung-blockchain-wallet_1uvkr_30","icon-coinbase":"_icon-coinbase_1uvkr_34","icon-wallet-link":"_icon-wallet-link_1uvkr_35","icon-google":"_icon-google_1uvkr_39","icon-discord":"_icon-discord_1uvkr_43","icon-apple":"_icon-apple_1uvkr_47","icon-x":"_icon-x_1uvkr_51"},Lce=t=>{const{className:e,children:r,type:n,testId:i,showTooltip:a,tooltipPosition:o,disabled:s,loading:c,onClick:u}=t;return Ye.jsx(oGe,{position:a&&o?o:"top center",disabled:!a,trigger:Ye.jsxs(xc.Button,{primary:!0,size:"small","data-testid":`${i}-${n}-button`,className:dp(e,$E.button),onClick:()=>u(n),disabled:s,loading:c,children:[c?null:Ye.jsx("div",{role:"img","aria-label":n,className:dp($E.icon,$E[`icon-${n}`],$E.primaryImage)}),r]},n),content:sGe(n),on:"hover"})},lGe="social-primary-test-id",fGe="social-secondary-test-id",dGe="web3-primary-test-id",hGe="web3-secondary-test-id",pGe="show-more-button-test-id",gGe="_connection_ge0tp_3",yGe="_dclLogo_ge0tp_9",mGe="_title_ge0tp_15",vGe="_subtitle_ge0tp_20",bGe="_primaryButton_ge0tp_29",wGe="_primaryImage_ge0tp_38",_Ge="_primaryMessage_ge0tp_42",EGe="_primaryMagic_ge0tp_50",xGe="_primaryLearnMore_ge0tp_61",AGe="_primary_ge0tp_29",SGe="_showMore_ge0tp_76",OGe="_showMoreButton_ge0tp_80",IGe="_showMoreSecondaryOptions_ge0tp_89",PGe="_primaryOption_ge0tp_103",TGe="_secondaryOptionButton_ge0tp_107",Da={connection:gGe,dclLogo:yGe,title:mGe,subtitle:vGe,primaryButton:bGe,primaryImage:wGe,primaryMessage:_Ge,primaryMagic:EGe,primaryLearnMore:xGe,primary:AGe,showMore:SGe,showMoreButton:OGe,showMoreSecondaryOptions:IGe,primaryOption:PGe,secondaryOptionButton:TGe},DQ=({message:t,children:e,option:r,testId:n,loadingOption:i,onConnect:a})=>Ye.jsxs("div",{className:Da.primary,"data-testid":n,children:[Ye.jsx("div",{className:Da.primaryMessage,children:t}),Ye.jsx(Lce,{disabled:!!i,loading:i===r,type:r,onClick:a,className:dp(Da.primaryButton,Da.primaryOption),testId:n,children:e})]}),$Q=({options:t,tooltipDirection:e,testId:r,loadingOption:n,onConnect:i})=>Ye.jsx("div",{className:Da.showMoreSecondaryOptions,"data-testid":r,children:t.map(a=>Ye.jsx(Lce,{className:dp(Da.primaryButton,Da.secondaryOptionButton),showTooltip:!0,tooltipPosition:e,type:a,onClick:i,testId:r,loading:n===a,disabled:!!n},a))}),RGe={i18n:{title:"Unlock Your Virtual World.",subtitle:"Access and start exploring.",accessWith:t=>`Access with ${t}`,connectWith:t=>`Connect with ${t}`,moreOptions:"More Options",socialMessage:t=>Ye.jsxs(Ye.Fragment,{children:["Access secured by ",t]}),web3Message:t=>Ye.jsxs(Ye.Fragment,{children:["Curious about wallets? ",t("Learn More")]})}},CGe=t=>{const{i18n:e=RGe.i18n,onConnect:r,onLearnMore:n,socialOptions:i,web3Options:a,className:o,loadingOption:s}=t,[c,u]=ze.useState(!1),f=ze.useCallback(()=>{u(!c)},[c]),d=i&&i.secondary&&i.secondary.length>0,g=a&&a.secondary&&a.secondary.length>0;return Ye.jsxs("div",{className:dp(o,Da.connection),children:[Ye.jsx("img",{className:Da.dclLogo,src:_ze,alt:"Decentraland logo"}),Ye.jsxs("div",{children:[Ye.jsx("h1",{className:Da.title,children:e.title}),Ye.jsx("h2",{className:Da.subtitle,children:e.subtitle}),i?Ye.jsx(DQ,{onConnect:r,testId:lGe,option:i==null?void 0:i.primary,loadingOption:s,message:Ye.jsxs(Ye.Fragment,{children:[e.socialMessage(Ye.jsx("div",{className:Da.primaryMagic,role:"img","aria-label":"Magic"})),Ye.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(i==null?void 0:i.primary),children:"Learn More"})]}),children:Ye.jsx(Ye.Fragment,{children:e.accessWith(i==null?void 0:i.primary)})}):null,a?Ye.jsx(DQ,{onConnect:r,testId:dGe,option:a==null?void 0:a.primary,loadingOption:s,message:e.web3Message(m=>Ye.jsx("span",{className:Da.primaryLearnMore,role:"button",onClick:()=>n(a.primary),children:m})),children:Ye.jsx(Ye.Fragment,{children:e.connectWith(a==null?void 0:a.primary)})}):null]}),Ye.jsxs("div",{className:Da.showMore,children:[(g||d)&&Ye.jsxs(xc.Button,{"data-testid":pGe,basic:!0,size:"medium",fluid:!0,className:Da.showMoreButton,onClick:f,children:[e.moreOptions,Ye.jsx(wze,{name:c?"chevron up":"chevron down"})]}),c&&d&&Ye.jsx($Q,{testId:fGe,options:i.secondary,onConnect:r,tooltipDirection:"top center",loadingOption:s}),c&&g&&Ye.jsx($Q,{testId:hGe,options:a.secondary,onConnect:r,tooltipDirection:"bottom center",loadingOption:s})]})]})};var Hn=(t=>(t.METAMASK="metamask",t.DAPPER="dapper",t.FORTMATIC="fortmatic",t.COINBASE="coinbase",t.SAMSUNG="samsung-blockchain-wallet",t.WALLET_CONNECT="wallet-connect",t.WALLET_LINK="wallet-link",t.METAMASK_MOBILE="metamask-mobile",t.GOOGLE="google",t.APPLE="apple",t.DISCORD="discord",t.X="x",t))(Hn||{});const NGe=60*24*30,DGe=Il.getConfiguration().magic.apiKey;function Uce(t){switch(t){case Hn.DISCORD:case Hn.X:case Hn.GOOGLE:case Hn.APPLE:return Sc.ProviderType.MAGIC;case Hn.WALLET_CONNECT:case Hn.METAMASK_MOBILE:return Sc.ProviderType.WALLET_CONNECT_V2;case Hn.COINBASE:case Hn.WALLET_LINK:return Sc.ProviderType.WALLET_LINK;case Hn.FORTMATIC:return Sc.ProviderType.FORTMATIC;case Hn.METAMASK:case Hn.DAPPER:case Hn.SAMSUNG:return Sc.ProviderType.INJECTED;default:throw new Error("Invalid provider")}}async function $Ge(t,e){const r=new ute(e),n=R8.createRandom(),i={address:n.address.toString(),publicKey:xt(n.publicKey),privateKey:xt(n.privateKey)},a=await r.getSigner();return oce.Authenticator.initializeAuthChain(t,i,NGe,o=>a.signMessage(o))}async function MQ(t){const e=Uce(t);if(Sc.ProviderType.MAGIC===e){const{Magic:n}=await Ry(()=>Promise.resolve().then(()=>Xk),void 0),{OAuthExtension:i}=await Ry(()=>Promise.resolve().then(()=>Zk),void 0),a=new n(DGe,{extensions:[new i]}),o=new URL(window.location.href);o.pathname="/auth/callback",await a.oauth.loginWithRedirect({provider:t===Hn.X?"twitter":t,redirectURI:o.href})}const r=await Il.connection.connect(e);if(!r.account||!r.provider)throw new Error("Could not get provider");return r}function kQ(t){return[Hn.APPLE,Hn.GOOGLE,Hn.X,Hn.DISCORD].includes(t)}async function Bce(t,e){let r;const n=C5.localStorageGetIdentity(t);return n?r=n:(r=await $Ge(t,e),C5.localStorageStoreIdentity(t,r)),r}const MGe=Il.getConfiguration().magic.apiKey,kGe=()=>{const t=Xse(),e=P2(),[r,n]=ze.useState(!0),i=ze.useCallback(async()=>{var s;const o=await Il.connection.connect(Ml.ProviderType.MAGIC);await Bce(((s=o.account)==null?void 0:s.toLowerCase())??"",o.provider)},[]),a=ze.useCallback(async()=>{const{Magic:o}=await Ry(()=>Promise.resolve().then(()=>Xk),void 0),{OAuthExtension:s}=await Ry(()=>Promise.resolve().then(()=>Zk),void 0),c=new o(MGe,{extensions:[new s]});try{await(c==null?void 0:c.oauth.getRedirectResult()),n(!1),await i(),t?window.location.href=decodeURIComponent(t):window.location.href="/"}catch(u){console.log(u),e("/login")}},[e]);return ze.useEffect(()=>{a()},[]),Ye.jsx(ace,{open:!0,state:r?Ri.VALIDATING_SIGN_IN:Ri.WAITING_FOR_SIGNATURE,onTryAgain:i,providerType:Ml.ProviderType.MAGIC})},LGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image1-a4aa795b.webp",UGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image10-c7fbcc61.webp",BGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image2-0af6ed59.webp",FGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image3-c864ad86.webp",jGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image4-7964be5f.webp",qGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image5-fcca517e.webp",HGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image6-c770bdf5.webp",zGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image7-341595c4.webp",VGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image8-fea9fe85.webp",GGe="https://cdn.decentraland.org/@dcl/auth-site/0.1.3-7423579639.commit-0c1b974/assets/image9-714885ef.webp",WGe="_main_a0a53_1",KGe="_title_a0a53_11",YGe="_infoModal_a0a53_15",QGe="_infoContent_a0a53_19",JGe="_info_a0a53_15",XGe="_goBackButton_a0a53_31",b0={main:WGe,title:KGe,infoModal:YGe,infoContent:QGe,info:JGe,goBackButton:XGe},ZGe={i18n:{title:"How does Magic work?",subtitle:"Magic handles digital wallet creation & management behind the scenes so you don't have to. Just log into Decentraland with your favorite social account and let Magic handle the rest.<br /> <br />If you'd rather take a more hands-on approach to your digital asset storage (e.g. Wearables, NAMEs, etc.), get a digital wallet from a provider such as MetaMask and use it to create your Decentraland account.",goBack:"Return to log in page"}},eWe=t=>{const{i18n:e=ZGe.i18n,onClose:r,open:n}=t;return Ye.jsxs(xO.Modal,{size:"tiny",open:n,className:b0.infoModal,onClose:r,children:[Ye.jsx(SO,{title:"",onClose:r}),Ye.jsx(EO,{className:b0.infoContent,children:Ye.jsxs("div",{className:b0.main,children:[Ye.jsx("h1",{className:b0.title,children:e==null?void 0:e.title}),Ye.jsx("span",{className:b0.info,dangerouslySetInnerHTML:{__html:e==null?void 0:e.subtitle}}),Ye.jsx(xc.Button,{className:b0.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},tWe="_main_1c8le_1",rWe="_infoModal_1c8le_11",nWe="_infoContent_1c8le_15",iWe="_info_1c8le_11",aWe="_infoImage_1c8le_26",oWe="_assets_1c8le_34",sWe="_login_1c8le_38",cWe="_goBackButton_1c8le_42",cc={main:tWe,infoModal:rWe,infoContent:nWe,info:iWe,infoImage:aWe,assets:oWe,login:sWe,goBackButton:cWe},uWe={i18n:{title:"What is a wallet?",assets:{title:"A home for your digital assets",text:"Wallets are used to send, receive, store, and display digital assets like Ethereum and NFTs."},logIn:{title:"A New Way To Log In",text:"Instead of creating new accounts and passwords on every website, just connect your wallet."},goBack:"Return to log in page"}},lWe=t=>{const{i18n:e=uWe.i18n,onClose:r,open:n}=t;return Ye.jsxs(xO.Modal,{size:"tiny",open:n,className:cc.infoModal,onClose:r,children:[Ye.jsx(SO,{title:"",onClose:r}),Ye.jsx(EO,{className:cc.infoContent,children:Ye.jsxs("div",{className:cc.main,children:[Ye.jsx("h1",{className:cc.title,children:e==null?void 0:e.title}),Ye.jsxs("article",{className:cc.info,children:[Ye.jsx("div",{className:dp(cc.infoImage,cc.assets)}),Ye.jsx("h3",{children:e==null?void 0:e.assets.title}),Ye.jsx("p",{children:e==null?void 0:e.assets.text})]}),Ye.jsxs("article",{className:cc.info,children:[Ye.jsx("div",{className:dp(cc.infoImage,cc.login)}),Ye.jsx("h3",{children:e==null?void 0:e.logIn.title}),Ye.jsx("p",{children:e==null?void 0:e.logIn.text})]}),Ye.jsx(xc.Button,{className:cc.goBackButton,secondary:!0,inverted:!0,onClick:r,children:e==null?void 0:e.goBack})]})})]})},fWe="_main_ray7b_1",dWe="_background_ray7b_8",hWe="_left_ray7b_32",pWe="_leftInfo_ray7b_42",gWe="_right_ray7b_51",yWe="_footer_ray7b_60",mWe="_guestInfo_ray7b_79",Yv={main:fWe,background:dWe,"move-background":"_move-background_ray7b_1",left:hWe,leftInfo:pWe,right:gWe,footer:yWe,guestInfo:mWe},LQ=[LGe,BGe,FGe,jGe,qGe,HGe,zGe,VGe,GGe,UGe],vWe=()=>{const[t]=nme(),[e,r]=ze.useState(Ri.CONNECTING_WALLET),[n,i]=ze.useState(!1),[a,o]=ze.useState(!1),[s,c]=ze.useState(!1),[u,f]=ze.useState(),d=Xse(),g=d&&new URL(d).pathname.includes("/play"),[m,w]=ze.useState(0),v=ze.useCallback(E=>{E&&kQ(E)?o(!0):i(!0)},[i,o,n]),y=ze.useCallback(()=>{i(!1),o(!1)},[i,o]),_=ze.useCallback(()=>{o(!a)},[o,a]),b=ze.useMemo(()=>{if(d){const E=new URL(d);return E.searchParams.append("guest","true"),E.toString()}return""},[d]),A=ze.useCallback(async E=>{var p;if(f(E),kQ(E))r(Ri.LOADING_MAGIC),await MQ(E);else try{c(!0),r(Ri.CONNECTING_WALLET);const I=await MQ(E);t.get("fromRequests")!=="true"&&(r(Ri.WAITING_FOR_SIGNATURE),await Bce(((p=I.account)==null?void 0:p.toLowerCase())??"",I.provider)),d?window.location.href=decodeURIComponent(d):window.location.href="/",c(!1)}catch{r(Ri.ERROR)}},[r,c,f,d,t]),x=ze.useCallback(()=>{c(!1),f(void 0),r(Ri.CONNECTING_WALLET)},[c]),O=ze.useCallback(()=>{u&&A(u)},[u]);return ze.useEffect(()=>{const E=setInterval(()=>{w(p=>p===LQ.length-1?0:p+1)},5e3);return()=>{clearInterval(E)}},[]),Ye.jsxs("main",{className:Yv.main,children:[Ye.jsx("div",{className:Yv.background,style:{backgroundImage:`url(${LQ[m]})`}}),Ye.jsx(lWe,{open:n,onClose:y}),Ye.jsx(eWe,{open:a,onClose:_}),Ye.jsx(ace,{open:s,state:e,onClose:x,onTryAgain:O,providerType:u?Uce(u):null}),Ye.jsx("div",{className:Yv.left,children:Ye.jsxs("div",{className:Yv.leftInfo,children:[Ye.jsx(CGe,{onLearnMore:v,onConnect:A,loadingOption:u,socialOptions:{primary:Hn.GOOGLE,secondary:[Hn.DISCORD,Hn.APPLE,Hn.X]},web3Options:{primary:Hn.METAMASK,secondary:[Hn.FORTMATIC,Hn.COINBASE,Hn.WALLET_CONNECT]}}),g&&Ye.jsxs("div",{className:Yv.guestInfo,children:["Quick dive? ",Ye.jsx("a",{href:b,children:"Explore as a guest"})]})]})})]})};uye.render(Ye.jsx(eJ.StrictMode,{children:Ye.jsx(rme,{basename:"/auth",children:Ye.jsxs(Zye,{children:[Ye.jsx(tb,{path:"/login",element:Ye.jsx(vWe,{})}),Ye.jsx(tb,{path:"/callback",element:Ye.jsx(kGe,{})}),Ye.jsx(tb,{path:"/requests/:requestId",element:Ye.jsx(Mqe,{})}),Ye.jsx(tb,{path:"*",element:Ye.jsx(kqe,{})})]})})}),document.getElementById("root"));export{ut as B,m5e as R,zae as T,T$e as _,ii as a,za as b,Ne as c,Dc as d,fo as e,yN as f,uo as g,Ma as h,FW as n,TWe as o,Ic as p,nM as r,Ene as s,PWe as t,Cy as y};
187
+ //# sourceMappingURL=index-d8ca8cca.js.map