diff --git a/.DS_Store b/.DS_Store index 91110cc5..3bf020df 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/dist/assets/browser-D5krnwSE.js b/dist/assets/browser-DHZSeGC2.js similarity index 78% rename from dist/assets/browser-D5krnwSE.js rename to dist/assets/browser-DHZSeGC2.js index 921195ac..fce0cddd 100644 --- a/dist/assets/browser-D5krnwSE.js +++ b/dist/assets/browser-DHZSeGC2.js @@ -1 +1 @@ -import{g as e}from"./index-CpEY026w.js";var o=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};const r=e(o),s=Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"}));export{s as b}; +import{g as e}from"./index-Be04aCUX.js";var o=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")};const r=e(o),s=Object.freeze(Object.defineProperty({__proto__:null,default:r},Symbol.toStringTag,{value:"Module"}));export{s as b}; diff --git a/dist/assets/ccip-BMEFCFyc.js b/dist/assets/ccip-EeY6Gpji.js similarity index 97% rename from dist/assets/ccip-BMEFCFyc.js rename to dist/assets/ccip-EeY6Gpji.js index 3c19bf39..6f819aa7 100644 --- a/dist/assets/ccip-BMEFCFyc.js +++ b/dist/assets/ccip-EeY6Gpji.js @@ -1 +1 @@ -import{B as l,a as m,s as y,d as k,i as b,c as O,b as E,e as L,H as h,f as x}from"./index-CpEY026w.js";class M extends l{constructor({callbackSelector:r,cause:a,data:o,extraData:i,sender:d,urls:t}){var n;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(n=a.metaMessages)!=null&&n.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(f=>` ${m(f)}`)],` Sender: ${d}`,` Data: ${o}`,` Callback selector: ${r}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class R extends l{constructor({result:r,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(a)}`,`Response: ${y(r)}`],name:"OffchainLookupResponseMalformedError"})}}class S extends l{constructor({sender:r,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}const A="0x556f1830",$={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function C(c,{blockNumber:r,blockTag:a,data:o,to:i}){const{args:d}=k({data:o,abi:[$]}),[t,n,f,u,s]=d,{ccipRead:e}=c,w=e&&typeof(e==null?void 0:e.request)=="function"?e.request:T;try{if(!b(i,t))throw new S({sender:t,to:i});const p=await w({data:f,sender:t,urls:n}),{data:g}=await O(c,{blockNumber:r,blockTag:a,data:E([u,L([{type:"bytes"},{type:"bytes"}],[p,s])]),to:i});return g}catch(p){throw new M({callbackSelector:u,cause:p,data:o,extraData:s,sender:t,urls:n})}}async function T({data:c,sender:r,urls:a}){var i;let o=new Error("An unknown error occurred.");for(let d=0;d` ${m(f)}`)],` Sender: ${d}`,` Data: ${o}`,` Callback selector: ${r}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class R extends l{constructor({result:r,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(a)}`,`Response: ${y(r)}`],name:"OffchainLookupResponseMalformedError"})}}class S extends l{constructor({sender:r,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}const A="0x556f1830",$={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function C(c,{blockNumber:r,blockTag:a,data:o,to:i}){const{args:d}=k({data:o,abi:[$]}),[t,n,f,u,s]=d,{ccipRead:e}=c,w=e&&typeof(e==null?void 0:e.request)=="function"?e.request:T;try{if(!b(i,t))throw new S({sender:t,to:i});const p=await w({data:f,sender:t,urls:n}),{data:g}=await O(c,{blockNumber:r,blockTag:a,data:E([u,L([{type:"bytes"},{type:"bytes"}],[p,s])]),to:i});return g}catch(p){throw new M({callbackSelector:u,cause:p,data:o,extraData:s,sender:t,urls:n})}}async function T({data:c,sender:r,urls:a}){var i;let o=new Error("An unknown error occurred.");for(let d=0;dn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function To(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function fh(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var Rq={exports:{}},D8={},Dq={exports:{}},Pr={};/** +function Tge(t,e){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const s of a.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(i){if(i.ep)return;i.ep=!0;const a=r(i);fetch(i.href,a)}})();var Xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function No(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function wh(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var nV={exports:{}},q8={},iV={exports:{}},Pr={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function nge(t,e){for(var r=0;r>>1,$=P[D];if(0>>1;Di(H,M))ee<$&&0>i(J,H)?(P[D]=J,P[ee]=M,D=ee):(P[D]=H,P[le]=M,D=le);else if(ee<$&&0>i(J,M))P[D]=J,P[ee]=M,D=ee;else break e}}return R}function i(P,R){var M=P.sortIndex-R.sortIndex;return M!==0?M:P.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,f=null,h=3,g=!1,m=!1,w=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(P){for(var R=r(c);R!==null;){if(R.callback===null)n(c);else if(R.startTime<=P)n(c),R.sortIndex=R.expirationTime,e(l,R);else break;R=r(c)}}function S(P){if(w=!1,A(P),!m)if(r(l)!==null)m=!0,L(j);else{var R=r(c);R!==null&&O(S,R.startTime-P)}}function j(P,R){m=!1,w&&(w=!1,v(B),B=-1),g=!0;var M=h;try{for(A(R),f=r(l);f!==null&&(!(f.expirationTime>R)||P&&!Y());){var D=f.callback;if(typeof D=="function"){f.callback=null,h=f.priorityLevel;var $=D(f.expirationTime<=R);R=t.unstable_now(),typeof $=="function"?f.callback=$:f===r(l)&&n(l),A(R)}else n(l);f=r(l)}if(f!==null)var X=!0;else{var le=r(c);le!==null&&O(S,le.startTime-R),X=!1}return X}finally{f=null,h=M,g=!1}}var U=!1,I=null,B=-1,V=5,se=-1;function Y(){return!(t.unstable_now()-seP||125D?(P.sortIndex=M,e(c,P),r(l)===null&&P===r(c)&&(w?(v(B),B=-1):w=!0,O(S,M-D))):(P.sortIndex=$,e(l,P),m||g||(m=!0,L(j))),P},t.unstable_shouldYield=Y,t.unstable_wrapCallback=function(P){var R=h;return function(){var M=h;h=R;try{return P.apply(this,arguments)}finally{h=M}}}})(Kq);Yq.exports=Kq;var Sge=Yq.exports;/** + */(function(t){function e(P,R){var M=P.length;P.push(R);e:for(;0>>1,$=P[D];if(0>>1;Di(H,M))ee<$&&0>i(J,H)?(P[D]=J,P[ee]=M,D=ee):(P[D]=H,P[le]=M,D=le);else if(ee<$&&0>i(J,M))P[D]=J,P[ee]=M,D=ee;else break e}}return R}function i(P,R){var M=P.sortIndex-R.sortIndex;return M!==0?M:P.id-R.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,o=s.now();t.unstable_now=function(){return s.now()-o}}var l=[],c=[],u=1,f=null,h=3,g=!1,m=!1,w=!1,C=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(P){for(var R=r(c);R!==null;){if(R.callback===null)n(c);else if(R.startTime<=P)n(c),R.sortIndex=R.expirationTime,e(l,R);else break;R=r(c)}}function S(P){if(w=!1,A(P),!m)if(r(l)!==null)m=!0,L(j);else{var R=r(c);R!==null&&O(S,R.startTime-P)}}function j(P,R){m=!1,w&&(w=!1,v(B),B=-1),g=!0;var M=h;try{for(A(R),f=r(l);f!==null&&(!(f.expirationTime>R)||P&&!Y());){var D=f.callback;if(typeof D=="function"){f.callback=null,h=f.priorityLevel;var $=D(f.expirationTime<=R);R=t.unstable_now(),typeof $=="function"?f.callback=$:f===r(l)&&n(l),A(R)}else n(l);f=r(l)}if(f!==null)var X=!0;else{var le=r(c);le!==null&&O(S,le.startTime-R),X=!1}return X}finally{f=null,h=M,g=!1}}var F=!1,I=null,B=-1,V=5,se=-1;function Y(){return!(t.unstable_now()-seP||125D?(P.sortIndex=M,e(c,P),r(l)===null&&P===r(c)&&(w?(v(B),B=-1):w=!0,O(S,M-D))):(P.sortIndex=$,e(l,P),m||g||(m=!0,L(j))),P},t.unstable_shouldYield=Y,t.unstable_wrapCallback=function(P){var R=h;return function(){var M=h;h=R;try{return P.apply(this,arguments)}finally{h=M}}}})(mV);gV.exports=mV;var Qge=gV.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function nge(t,e){for(var r=0;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),EA=Object.prototype.hasOwnProperty,Ige=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,FR={},UR={};function Mge(t){return EA.call(UR,t)?!0:EA.call(FR,t)?!1:Ige.test(t)?UR[t]=!0:(FR[t]=!0,!1)}function Tge(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function kge(t,e,r,n){if(e===null||typeof e>"u"||Tge(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function fs(t,e,r,n,i,a,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=s}var wa={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){wa[t]=new fs(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];wa[e]=new fs(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){wa[t]=new fs(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){wa[t]=new fs(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){wa[t]=new fs(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){wa[t]=new fs(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){wa[t]=new fs(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){wa[t]=new fs(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){wa[t]=new fs(t,5,!1,t.toLowerCase(),null,!1,!1)});var pk=/[\-:]([a-z])/g;function gk(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(pk,gk);wa[e]=new fs(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(pk,gk);wa[e]=new fs(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(pk,gk);wa[e]=new fs(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){wa[t]=new fs(t,1,!1,t.toLowerCase(),null,!1,!1)});wa.xlinkHref=new fs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){wa[t]=new fs(t,1,!1,t.toLowerCase(),null,!0,!0)});function mk(t,e,r,n){var i=wa.hasOwnProperty(e)?wa[e]:null;(i!==null?i.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jA=Object.prototype.hasOwnProperty,Xge=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,ZR={},XR={};function eme(t){return jA.call(XR,t)?!0:jA.call(ZR,t)?!1:Xge.test(t)?XR[t]=!0:(ZR[t]=!0,!1)}function tme(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function rme(t,e,r,n){if(e===null||typeof e>"u"||tme(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function ps(t,e,r,n,i,a,s){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=a,this.removeEmptyString=s}var va={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){va[t]=new ps(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];va[e]=new ps(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){va[t]=new ps(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){va[t]=new ps(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){va[t]=new ps(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){va[t]=new ps(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){va[t]=new ps(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){va[t]=new ps(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){va[t]=new ps(t,5,!1,t.toLowerCase(),null,!1,!1)});var Sk=/[\-:]([a-z])/g;function Ak(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Sk,Ak);va[e]=new ps(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Sk,Ak);va[e]=new ps(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Sk,Ak);va[e]=new ps(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){va[t]=new ps(t,1,!1,t.toLowerCase(),null,!1,!1)});va.xlinkHref=new ps("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){va[t]=new ps(t,1,!1,t.toLowerCase(),null,!0,!0)});function Ik(t,e,r,n){var i=va.hasOwnProperty(e)?va[e]:null;(i!==null?i.type!==0:n||!(2o||i[s]!==a[o]){var l=` -`+i[s].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{w_=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Z2(t):""}function Nge(t){switch(t.tag){case 5:return Z2(t.type);case 16:return Z2("Lazy");case 13:return Z2("Suspense");case 19:return Z2("SuspenseList");case 0:case 2:case 15:return t=v_(t.type,!1),t;case 11:return t=v_(t.type.render,!1),t;case 1:return t=v_(t.type,!0),t;default:return""}}function AA(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Np:return"Fragment";case kp:return"Portal";case _A:return"Profiler";case yk:return"StrictMode";case CA:return"Suspense";case SA:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case Qq:return(t.displayName||"Context")+".Consumer";case Zq:return(t._context.displayName||"Context")+".Provider";case wk:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case vk:return e=t.displayName||null,e!==null?e:AA(t.type)||"Memo";case xf:e=t._payload,t=t._init;try{return AA(t(e))}catch{}}return null}function Lge(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return AA(e);case 8:return e===yk?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Xf(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function eV(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function jge(t){var e=eV(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Ob(t){t._valueTracker||(t._valueTracker=jge(t))}function tV(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=eV(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function G6(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function IA(t,e){var r=e.checked;return Xn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function zR(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Xf(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function rV(t,e){e=e.checked,e!=null&&mk(t,"checked",e,!1)}function MA(t,e){rV(t,e);var r=Xf(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?TA(t,e.type,r):e.hasOwnProperty("defaultValue")&&TA(t,e.type,Xf(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function WR(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function TA(t,e,r){(e!=="number"||G6(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Q2=Array.isArray;function Qp(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Fb.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function Gy(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var py={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},$ge=["Webkit","ms","Moz","O"];Object.keys(py).forEach(function(t){$ge.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),py[e]=py[t]})});function sV(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||py.hasOwnProperty(t)&&py[t]?(""+e).trim():e+"px"}function oV(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=sV(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var Pge=Xn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function LA(t,e){if(e){if(Pge[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(at(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(at(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(at(61))}if(e.style!=null&&typeof e.style!="object")throw Error(at(62))}}function jA(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $A=null;function bk(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var PA=null,Xp=null,eg=null;function qR(t){if(t=gw(t)){if(typeof PA!="function")throw Error(at(280));var e=t.stateNode;e&&(e=z8(e),PA(t.stateNode,t.type,e))}}function lV(t){Xp?eg?eg.push(t):eg=[t]:Xp=t}function cV(){if(Xp){var t=Xp,e=eg;if(eg=Xp=null,qR(t),e)for(t=0;t>>=0,t===0?32:31-(qge(t)/Vge|0)|0}var Ub=64,Bb=4194304;function X2(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function K6(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,a=t.pingedLanes,s=r&268435455;if(s!==0){var o=s&~i;o!==0?n=X2(o):(a&=s,a!==0&&(n=X2(a)))}else s=r&~i,s!==0?n=X2(s):a!==0&&(n=X2(a));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function hw(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ic(e),t[e]=r}function Zge(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=my),tD=" ",rD=!1;function TV(t,e){switch(t){case"keyup":return Sme.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function kV(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Lp=!1;function Ime(t,e){switch(t){case"compositionend":return kV(e);case"keypress":return e.which!==32?null:(rD=!0,tD);case"textInput":return t=e.data,t===tD&&rD?null:t;default:return null}}function Mme(t,e){if(Lp)return t==="compositionend"||!Mk&&TV(t,e)?(t=IV(),J4=Sk=Lf=null,Lp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=sD(r)}}function $V(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?$V(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function PV(){for(var t=window,e=G6();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=G6(t.document)}return e}function Tk(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Dme(t){var e=PV(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&$V(r.ownerDocument.documentElement,r)){if(n!==null&&Tk(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!t.extend&&a>n&&(i=n,n=a,a=i),i=oD(r,a);var s=oD(r,n);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,jp=null,BA=null,wy=null,zA=!1;function lD(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;zA||jp==null||jp!==G6(n)||(n=jp,"selectionStart"in n&&Tk(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),wy&&Zy(wy,n)||(wy=n,n=Q6(BA,"onSelect"),0Rp||(t.current=YA[Rp],YA[Rp]=null,Rp--)}function An(t,e){Rp++,YA[Rp]=t.current,t.current=e}var eh={},za=ph(eh),Os=ph(!1),P0=eh;function xg(t,e){var r=t.type.contextTypes;if(!r)return eh;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=e[a];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function Fs(t){return t=t.childContextTypes,t!=null}function e5(){Rn(Os),Rn(za)}function gD(t,e,r){if(za.current!==eh)throw Error(at(168));An(za,e),An(Os,r)}function HV(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(at(108,Lge(t)||"Unknown",i));return Xn({},r,n)}function t5(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||eh,P0=za.current,An(za,t),An(Os,Os.current),!0}function mD(t,e,r){var n=t.stateNode;if(!n)throw Error(at(169));r?(t=HV(t,e,P0),n.__reactInternalMemoizedMergedChildContext=t,Rn(Os),Rn(za),An(za,t)):Rn(Os),An(Os,r)}var ld=null,W8=!1,j_=!1;function GV(t){ld===null?ld=[t]:ld.push(t)}function Kme(t){W8=!0,GV(t)}function gh(){if(!j_&&ld!==null){j_=!0;var t=0,e=un;try{var r=ld;for(un=1;t>=s,i-=s,wd=1<<32-ic(e)+i|r<B?(V=I,I=null):V=I.sibling;var se=h(v,I,A[B],S);if(se===null){I===null&&(I=V);break}t&&I&&se.alternate===null&&e(v,I),b=a(se,b,B),U===null?j=se:U.sibling=se,U=se,I=V}if(B===A.length)return r(v,I),Un&&e0(v,B),j;if(I===null){for(;BB?(V=I,I=null):V=I.sibling;var Y=h(v,I,se.value,S);if(Y===null){I===null&&(I=V);break}t&&I&&Y.alternate===null&&e(v,I),b=a(Y,b,B),U===null?j=Y:U.sibling=Y,U=Y,I=V}if(se.done)return r(v,I),Un&&e0(v,B),j;if(I===null){for(;!se.done;B++,se=A.next())se=f(v,se.value,S),se!==null&&(b=a(se,b,B),U===null?j=se:U.sibling=se,U=se);return Un&&e0(v,B),j}for(I=n(v,I);!se.done;B++,se=A.next())se=g(I,v,B,se.value,S),se!==null&&(t&&se.alternate!==null&&I.delete(se.key===null?B:se.key),b=a(se,b,B),U===null?j=se:U.sibling=se,U=se);return t&&I.forEach(function(N){return e(v,N)}),Un&&e0(v,B),j}function _(v,b,A,S){if(typeof A=="object"&&A!==null&&A.type===Np&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case Db:e:{for(var j=A.key,U=b;U!==null;){if(U.key===j){if(j=A.type,j===Np){if(U.tag===7){r(v,U.sibling),b=i(U,A.props.children),b.return=v,v=b;break e}}else if(U.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===xf&&vD(j)===U.type){r(v,U.sibling),b=i(U,A.props),b.ref=b2(v,U,A),b.return=v,v=b;break e}r(v,U);break}else e(v,U);U=U.sibling}A.type===Np?(b=_0(A.props.children,v.mode,S,A.key),b.return=v,v=b):(S=i6(A.type,A.key,A.props,null,v.mode,S),S.ref=b2(v,b,A),S.return=v,v=S)}return s(v);case kp:e:{for(U=A.key;b!==null;){if(b.key===U)if(b.tag===4&&b.stateNode.containerInfo===A.containerInfo&&b.stateNode.implementation===A.implementation){r(v,b.sibling),b=i(b,A.children||[]),b.return=v,v=b;break e}else{r(v,b);break}else e(v,b);b=b.sibling}b=B_(A,v.mode,S),b.return=v,v=b}return s(v);case xf:return U=A._init,_(v,b,U(A._payload),S)}if(Q2(A))return m(v,b,A,S);if(g2(A))return w(v,b,A,S);Yb(v,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,b!==null&&b.tag===6?(r(v,b.sibling),b=i(b,A),b.return=v,v=b):(r(v,b),b=U_(A,v.mode,S),b.return=v,v=b),s(v)):r(v,b)}return _}var _g=KV(!0),JV=KV(!1),i5=ph(null),a5=null,Fp=null,jk=null;function $k(){jk=Fp=a5=null}function Pk(t){var e=i5.current;Rn(i5),t._currentValue=e}function ZA(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function rg(t,e){a5=t,jk=Fp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Rs=!0),t.firstContext=null)}function fl(t){var e=t._currentValue;if(jk!==t)if(t={context:t,memoizedValue:e,next:null},Fp===null){if(a5===null)throw Error(at(308));Fp=t,a5.dependencies={lanes:0,firstContext:t}}else Fp=Fp.next=t;return e}var p0=null;function Rk(t){p0===null?p0=[t]:p0.push(t)}function ZV(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,Rk(e)):(r.next=i.next,i.next=r),e.interleaved=r,Td(t,n)}function Td(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Ef=!1;function Dk(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function QV(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Cd(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Hf(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Jr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,Td(t,r)}return i=n.interleaved,i===null?(e.next=e,Rk(n)):(e.next=i.next,i.next=e),n.interleaved=e,Td(t,r)}function Q4(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Ek(t,r)}}function bD(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=s:a=a.next=s,r=r.next}while(r!==null);a===null?i=a=e:a=a.next=e}else i=a=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function s5(t,e,r,n){var i=t.updateQueue;Ef=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?a=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==s&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;s=0,u=c=l=null,o=a;do{var h=o.lane,g=o.eventTime;if((n&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=t,w=o;switch(h=e,g=r,w.tag){case 1:if(m=w.payload,typeof m=="function"){f=m.call(g,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=w.payload,h=typeof m=="function"?m.call(g,f,h):m,h==null)break e;f=Xn({},f,h);break e;case 2:Ef=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else g={eventTime:g,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,s|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);O0|=s,t.lanes=s,t.memoizedState=f}}function xD(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=P_.transition;P_.transition={};try{t(!1),e()}finally{un=r,P_.transition=n}}function gY(){return hl().memoizedState}function Xme(t,e,r){var n=qf(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},mY(t))yY(e,r);else if(r=ZV(t,e,r,n),r!==null){var i=ss();ac(r,t,n,i),wY(r,e,n)}}function e2e(t,e,r){var n=qf(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(mY(t))yY(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,r);if(i.hasEagerState=!0,i.eagerState=o,fc(o,s)){var l=e.interleaved;l===null?(i.next=i,Rk(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=ZV(t,e,i,n),r!==null&&(i=ss(),ac(r,t,n,i),wY(r,e,n))}}function mY(t){var e=t.alternate;return t===Zn||e!==null&&e===Zn}function yY(t,e){vy=l5=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function wY(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,Ek(t,r)}}var c5={readContext:fl,useCallback:Sa,useContext:Sa,useEffect:Sa,useImperativeHandle:Sa,useInsertionEffect:Sa,useLayoutEffect:Sa,useMemo:Sa,useReducer:Sa,useRef:Sa,useState:Sa,useDebugValue:Sa,useDeferredValue:Sa,useTransition:Sa,useMutableSource:Sa,useSyncExternalStore:Sa,useId:Sa,unstable_isNewReconciler:!1},t2e={readContext:fl,useCallback:function(t,e){return zc().memoizedState=[t,e===void 0?null:e],t},useContext:fl,useEffect:_D,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,e6(4194308,4,uY.bind(null,e,t),r)},useLayoutEffect:function(t,e){return e6(4194308,4,t,e)},useInsertionEffect:function(t,e){return e6(4,2,t,e)},useMemo:function(t,e){var r=zc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=zc();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=Xme.bind(null,Zn,t),[n.memoizedState,t]},useRef:function(t){var e=zc();return t={current:t},e.memoizedState=t},useState:ED,useDebugValue:Gk,useDeferredValue:function(t){return zc().memoizedState=t},useTransition:function(){var t=ED(!1),e=t[0];return t=Qme.bind(null,t[1]),zc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Zn,i=zc();if(Un){if(r===void 0)throw Error(at(407));r=r()}else{if(r=e(),ra===null)throw Error(at(349));D0&30||rY(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,_D(iY.bind(null,n,a,t),[t]),n.flags|=2048,a3(9,nY.bind(null,n,a,r,e),void 0,null),r},useId:function(){var t=zc(),e=ra.identifierPrefix;if(Un){var r=vd,n=wd;r=(n&~(1<<32-ic(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=n3++,0")&&(l=l.replace("",t.displayName)),l}while(1<=s&&0<=o);break}}}finally{I_=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?ay(t):""}function nme(t){switch(t.tag){case 5:return ay(t.type);case 16:return ay("Lazy");case 13:return ay("Suspense");case 19:return ay("SuspenseList");case 0:case 2:case 15:return t=M_(t.type,!1),t;case 11:return t=M_(t.type.render,!1),t;case 1:return t=M_(t.type,!0),t;default:return""}}function DA(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Op:return"Fragment";case Dp:return"Portal";case $A:return"Profiler";case Mk:return"StrictMode";case PA:return"Suspense";case RA:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case vV:return(t.displayName||"Context")+".Consumer";case wV:return(t._context.displayName||"Context")+".Provider";case Tk:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case kk:return e=t.displayName||null,e!==null?e:DA(t.type)||"Memo";case If:e=t._payload,t=t._init;try{return DA(t(e))}catch{}}return null}function ime(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return DA(e);case 8:return e===Mk?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function ah(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function xV(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function ame(t){var e=xV(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var i=r.get,a=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return i.call(this)},set:function(s){n=""+s,a.call(this,s)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(s){n=""+s},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function qb(t){t._valueTracker||(t._valueTracker=ame(t))}function EV(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=xV(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function e5(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function OA(t,e){var r=e.checked;return Xn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function tD(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=ah(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function _V(t,e){e=e.checked,e!=null&&Ik(t,"checked",e,!1)}function FA(t,e){_V(t,e);var r=ah(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?UA(t,e.type,r):e.hasOwnProperty("defaultValue")&&UA(t,e.type,ah(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function rD(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function UA(t,e,r){(e!=="number"||e5(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var sy=Array.isArray;function ag(t,e,r,n){if(t=t.options,e){e={};for(var i=0;i"+e.valueOf().toString()+"",e=Vb.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function e3(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var _y={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},sme=["Webkit","ms","Moz","O"];Object.keys(_y).forEach(function(t){sme.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),_y[e]=_y[t]})});function IV(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||_y.hasOwnProperty(t)&&_y[t]?(""+e).trim():e+"px"}function MV(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,i=IV(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,i):t[r]=i}}var ome=Xn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function WA(t,e){if(e){if(ome[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(at(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(at(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(at(61))}if(e.style!=null&&typeof e.style!="object")throw Error(at(62))}}function HA(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var GA=null;function Nk(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var qA=null,sg=null,og=null;function aD(t){if(t=_w(t)){if(typeof qA!="function")throw Error(at(280));var e=t.stateNode;e&&(e=Q8(e),qA(t.stateNode,t.type,e))}}function TV(t){sg?og?og.push(t):og=[t]:sg=t}function kV(){if(sg){var t=sg,e=og;if(og=sg=null,aD(t),e)for(t=0;t>>=0,t===0?32:31-(wme(t)/vme|0)|0}var Yb=64,Kb=4194304;function oy(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function i5(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,i=t.suspendedLanes,a=t.pingedLanes,s=r&268435455;if(s!==0){var o=s&~i;o!==0?n=oy(o):(a&=s,a!==0&&(n=oy(a)))}else s=r&~i,s!==0?n=oy(s):a!==0&&(n=oy(a));if(n===0)return 0;if(e!==0&&e!==n&&!(e&i)&&(i=n&-n,a=e&-e,i>=a||i===16&&(a&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function xw(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-lc(e),t[e]=r}function _me(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Sy),pD=" ",gD=!1;function JV(t,e){switch(t){case"keyup":return Qme.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function QV(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fp=!1;function Xme(t,e){switch(t){case"compositionend":return QV(e);case"keypress":return e.which!==32?null:(gD=!0,pD);case"textInput":return t=e.data,t===pD&&gD?null:t;default:return null}}function e2e(t,e){if(Fp)return t==="compositionend"||!Fk&&JV(t,e)?(t=YV(),a6=Rk=Of=null,Fp=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=vD(r)}}function tY(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?tY(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function rY(){for(var t=window,e=e5();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=e5(t.document)}return e}function Uk(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function c2e(t){var e=rY(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&tY(r.ownerDocument.documentElement,r)){if(n!==null&&Uk(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var i=r.textContent.length,a=Math.min(n.start,i);n=n.end===void 0?a:Math.min(n.end,i),!t.extend&&a>n&&(i=n,n=a,a=i),i=bD(r,a);var s=bD(r,n);i&&s&&(t.rangeCount!==1||t.anchorNode!==i.node||t.anchorOffset!==i.offset||t.focusNode!==s.node||t.focusOffset!==s.offset)&&(e=e.createRange(),e.setStart(i.node,i.offset),t.removeAllRanges(),a>n?(t.addRange(e),t.extend(s.node,s.offset)):(e.setEnd(s.node,s.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Up=null,ZA=null,Iy=null,XA=!1;function xD(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;XA||Up==null||Up!==e5(n)||(n=Up,"selectionStart"in n&&Uk(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Iy&&s3(Iy,n)||(Iy=n,n=o5(ZA,"onSelect"),0Wp||(t.current=aI[Wp],aI[Wp]=null,Wp--)}function An(t,e){Wp++,aI[Wp]=t.current,t.current=e}var sh={},Wa=bh(sh),Bs=bh(!1),z0=sh;function Mg(t,e){var r=t.type.contextTypes;if(!r)return sh;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in r)i[a]=e[a];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=i),i}function zs(t){return t=t.childContextTypes,t!=null}function c5(){Rn(Bs),Rn(Wa)}function MD(t,e,r){if(Wa.current!==sh)throw Error(at(168));An(Wa,e),An(Bs,r)}function dY(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var i in n)if(!(i in e))throw Error(at(108,ime(t)||"Unknown",i));return Xn({},r,n)}function u5(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||sh,z0=Wa.current,An(Wa,t),An(Bs,Bs.current),!0}function TD(t,e,r){var n=t.stateNode;if(!n)throw Error(at(169));r?(t=dY(t,e,z0),n.__reactInternalMemoizedMergedChildContext=t,Rn(Bs),Rn(Wa),An(Wa,t)):Rn(Bs),An(Bs,r)}var pd=null,Z8=!1,z_=!1;function fY(t){pd===null?pd=[t]:pd.push(t)}function x2e(t){Z8=!0,fY(t)}function xh(){if(!z_&&pd!==null){z_=!0;var t=0,e=un;try{var r=pd;for(un=1;t>=s,i-=s,Cd=1<<32-lc(e)+i|r<B?(V=I,I=null):V=I.sibling;var se=h(v,I,A[B],S);if(se===null){I===null&&(I=V);break}t&&I&&se.alternate===null&&e(v,I),b=a(se,b,B),F===null?j=se:F.sibling=se,F=se,I=V}if(B===A.length)return r(v,I),Un&&o0(v,B),j;if(I===null){for(;BB?(V=I,I=null):V=I.sibling;var Y=h(v,I,se.value,S);if(Y===null){I===null&&(I=V);break}t&&I&&Y.alternate===null&&e(v,I),b=a(Y,b,B),F===null?j=Y:F.sibling=Y,F=Y,I=V}if(se.done)return r(v,I),Un&&o0(v,B),j;if(I===null){for(;!se.done;B++,se=A.next())se=f(v,se.value,S),se!==null&&(b=a(se,b,B),F===null?j=se:F.sibling=se,F=se);return Un&&o0(v,B),j}for(I=n(v,I);!se.done;B++,se=A.next())se=g(I,v,B,se.value,S),se!==null&&(t&&se.alternate!==null&&I.delete(se.key===null?B:se.key),b=a(se,b,B),F===null?j=se:F.sibling=se,F=se);return t&&I.forEach(function(N){return e(v,N)}),Un&&o0(v,B),j}function C(v,b,A,S){if(typeof A=="object"&&A!==null&&A.type===Op&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case Gb:e:{for(var j=A.key,F=b;F!==null;){if(F.key===j){if(j=A.type,j===Op){if(F.tag===7){r(v,F.sibling),b=i(F,A.props.children),b.return=v,v=b;break e}}else if(F.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===If&&LD(j)===F.type){r(v,F.sibling),b=i(F,A.props),b.ref=M2(v,F,A),b.return=v,v=b;break e}r(v,F);break}else e(v,F);F=F.sibling}A.type===Op?(b=k0(A.props.children,v.mode,S,A.key),b.return=v,v=b):(S=h6(A.type,A.key,A.props,null,v.mode,S),S.ref=M2(v,b,A),S.return=v,v=S)}return s(v);case Dp:e:{for(F=A.key;b!==null;){if(b.key===F)if(b.tag===4&&b.stateNode.containerInfo===A.containerInfo&&b.stateNode.implementation===A.implementation){r(v,b.sibling),b=i(b,A.children||[]),b.return=v,v=b;break e}else{r(v,b);break}else e(v,b);b=b.sibling}b=J_(A,v.mode,S),b.return=v,v=b}return s(v);case If:return F=A._init,C(v,b,F(A._payload),S)}if(sy(A))return m(v,b,A,S);if(_2(A))return w(v,b,A,S);r4(v,A)}return typeof A=="string"&&A!==""||typeof A=="number"?(A=""+A,b!==null&&b.tag===6?(r(v,b.sibling),b=i(b,A),b.return=v,v=b):(r(v,b),b=K_(A,v.mode,S),b.return=v,v=b),s(v)):r(v,b)}return C}var kg=mY(!0),yY=mY(!1),h5=bh(null),p5=null,qp=null,Hk=null;function Gk(){Hk=qp=p5=null}function qk(t){var e=h5.current;Rn(h5),t._currentValue=e}function lI(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function cg(t,e){p5=t,Hk=qp=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Fs=!0),t.firstContext=null)}function ml(t){var e=t._currentValue;if(Hk!==t)if(t={context:t,memoizedValue:e,next:null},qp===null){if(p5===null)throw Error(at(308));qp=t,p5.dependencies={lanes:0,firstContext:t}}else qp=qp.next=t;return e}var x0=null;function Vk(t){x0===null?x0=[t]:x0.push(t)}function wY(t,e,r,n){var i=e.interleaved;return i===null?(r.next=r,Vk(e)):(r.next=i.next,i.next=r),e.interleaved=r,Pd(t,n)}function Pd(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Mf=!1;function Yk(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function vY(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function kd(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Jf(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Jr&2){var i=n.pending;return i===null?e.next=e:(e.next=i.next,i.next=e),n.pending=e,Pd(t,r)}return i=n.interleaved,i===null?(e.next=e,Vk(n)):(e.next=i.next,i.next=e),n.interleaved=e,Pd(t,r)}function o6(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,jk(t,r)}}function jD(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var i=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var s={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?i=a=s:a=a.next=s,r=r.next}while(r!==null);a===null?i=a=e:a=a.next=e}else i=a=e;r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function g5(t,e,r,n){var i=t.updateQueue;Mf=!1;var a=i.firstBaseUpdate,s=i.lastBaseUpdate,o=i.shared.pending;if(o!==null){i.shared.pending=null;var l=o,c=l.next;l.next=null,s===null?a=c:s.next=c,s=l;var u=t.alternate;u!==null&&(u=u.updateQueue,o=u.lastBaseUpdate,o!==s&&(o===null?u.firstBaseUpdate=c:o.next=c,u.lastBaseUpdate=l))}if(a!==null){var f=i.baseState;s=0,u=c=l=null,o=a;do{var h=o.lane,g=o.eventTime;if((n&h)===h){u!==null&&(u=u.next={eventTime:g,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var m=t,w=o;switch(h=e,g=r,w.tag){case 1:if(m=w.payload,typeof m=="function"){f=m.call(g,f,h);break e}f=m;break e;case 3:m.flags=m.flags&-65537|128;case 0:if(m=w.payload,h=typeof m=="function"?m.call(g,f,h):m,h==null)break e;f=Xn({},f,h);break e;case 2:Mf=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,h=i.effects,h===null?i.effects=[o]:h.push(o))}else g={eventTime:g,lane:h,tag:o.tag,payload:o.payload,callback:o.callback,next:null},u===null?(c=u=g,l=f):u=u.next=g,s|=h;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;h=o,o=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(u===null&&(l=f),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=u,e=i.shared.interleaved,e!==null){i=e;do s|=i.lane,i=i.next;while(i!==e)}else a===null&&(i.shared.lanes=0);G0|=s,t.lanes=s,t.memoizedState=f}}function $D(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;er?r:4,t(!0);var n=H_.transition;H_.transition={};try{t(!1),e()}finally{un=r,H_.transition=n}}function RY(){return yl().memoizedState}function S2e(t,e,r){var n=Zf(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},DY(t))OY(e,r);else if(r=wY(t,e,r,n),r!==null){var i=ls();cc(r,t,n,i),FY(r,e,n)}}function A2e(t,e,r){var n=Zf(t),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(DY(t))OY(e,i);else{var a=t.alternate;if(t.lanes===0&&(a===null||a.lanes===0)&&(a=e.lastRenderedReducer,a!==null))try{var s=e.lastRenderedState,o=a(s,r);if(i.hasEagerState=!0,i.eagerState=o,mc(o,s)){var l=e.interleaved;l===null?(i.next=i,Vk(e)):(i.next=l.next,l.next=i),e.interleaved=i;return}}catch{}finally{}r=wY(t,e,i,n),r!==null&&(i=ls(),cc(r,t,n,i),FY(r,e,n))}}function DY(t){var e=t.alternate;return t===Qn||e!==null&&e===Qn}function OY(t,e){My=y5=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function FY(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,jk(t,r)}}var w5={readContext:ml,useCallback:Aa,useContext:Aa,useEffect:Aa,useImperativeHandle:Aa,useInsertionEffect:Aa,useLayoutEffect:Aa,useMemo:Aa,useReducer:Aa,useRef:Aa,useState:Aa,useDebugValue:Aa,useDeferredValue:Aa,useTransition:Aa,useMutableSource:Aa,useSyncExternalStore:Aa,useId:Aa,unstable_isNewReconciler:!1},I2e={readContext:ml,useCallback:function(t,e){return qc().memoizedState=[t,e===void 0?null:e],t},useContext:ml,useEffect:RD,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,c6(4194308,4,NY.bind(null,e,t),r)},useLayoutEffect:function(t,e){return c6(4194308,4,t,e)},useInsertionEffect:function(t,e){return c6(4,2,t,e)},useMemo:function(t,e){var r=qc();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=qc();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=S2e.bind(null,Qn,t),[n.memoizedState,t]},useRef:function(t){var e=qc();return t={current:t},e.memoizedState=t},useState:PD,useDebugValue:rN,useDeferredValue:function(t){return qc().memoizedState=t},useTransition:function(){var t=PD(!1),e=t[0];return t=C2e.bind(null,t[1]),qc().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Qn,i=qc();if(Un){if(r===void 0)throw Error(at(407));r=r()}else{if(r=e(),na===null)throw Error(at(349));H0&30||_Y(n,e,r)}i.memoizedState=r;var a={value:r,getSnapshot:e};return i.queue=a,RD(SY.bind(null,n,a,t),[t]),n.flags|=2048,p3(9,CY.bind(null,n,a,r,e),void 0,null),r},useId:function(){var t=qc(),e=na.identifierPrefix;if(Un){var r=Sd,n=Cd;r=(n&~(1<<32-lc(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=f3++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[Kc]=e,t[e3]=n,MY(t,e,!1,!1),e.stateNode=t;e:{switch(s=jA(r,n),r){case"dialog":jn("cancel",t),jn("close",t),i=n;break;case"iframe":case"object":case"embed":jn("load",t),i=n;break;case"video":case"audio":for(i=0;iAg&&(e.flags|=128,n=!0,x2(a,!1),e.lanes=4194304)}else{if(!n)if(t=o5(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),x2(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Un)return Aa(e),null}else 2*gi()-a.renderingStartTime>Ag&&r!==1073741824&&(e.flags|=128,n=!0,x2(a,!1),e.lanes=4194304);a.isBackwards?(s.sibling=e.child,e.child=s):(r=a.last,r!==null?r.sibling=s:e.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=gi(),e.sibling=null,r=Kn.current,An(Kn,n?r&1|2:r&1),e):(Aa(e),null);case 22:case 23:return Zk(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?fo&1073741824&&(Aa(e),e.subtreeFlags&6&&(e.flags|=8192)):Aa(e),null;case 24:return null;case 25:return null}throw Error(at(156,e.tag))}function c2e(t,e){switch(Nk(e),e.tag){case 1:return Fs(e.type)&&e5(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Cg(),Rn(Os),Rn(za),Uk(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Fk(e),null;case 13:if(Rn(Kn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(at(340));Eg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rn(Kn),null;case 4:return Cg(),null;case 10:return Pk(e.type._context),null;case 22:case 23:return Zk(),null;case 24:return null;default:return null}}var Jb=!1,La=!1,u2e=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Up(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ii(t,e,n)}else r.current=null}function sI(t,e,r){try{r()}catch(n){ii(t,e,n)}}var $D=!1;function d2e(t,e){if(WA=J6,t=PV(),Tk(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==r||i!==0&&f.nodeType!==3||(o=s+i),f!==a||n!==0&&f.nodeType!==3||(l=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===r&&++c===i&&(o=s),h===a&&++u===n&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(HA={focusedElem:t,selectionRange:r},J6=!1,Tt=e;Tt!==null;)if(e=Tt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Tt=t;else for(;Tt!==null;){e=Tt;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var w=m.memoizedProps,_=m.memoizedState,v=e.stateNode,b=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:ql(e.type,w),_);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var A=e.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(at(163))}}catch(S){ii(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,Tt=t;break}Tt=e.return}return m=$D,$D=!1,m}function by(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&sI(e,r,a)}i=i.next}while(i!==n)}}function q8(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function oI(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function NY(t){var e=t.alternate;e!==null&&(t.alternate=null,NY(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Kc],delete e[e3],delete e[VA],delete e[Vme],delete e[Yme])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function LY(t){return t.tag===5||t.tag===3||t.tag===4}function PD(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||LY(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function lI(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=X6));else if(n!==4&&(t=t.child,t!==null))for(lI(t,e,r),t=t.sibling;t!==null;)lI(t,e,r),t=t.sibling}function cI(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(cI(t,e,r),t=t.sibling;t!==null;)cI(t,e,r),t=t.sibling}var ga=null,Yl=!1;function uf(t,e,r){for(r=r.child;r!==null;)jY(t,e,r),r=r.sibling}function jY(t,e,r){if(iu&&typeof iu.onCommitFiberUnmount=="function")try{iu.onCommitFiberUnmount(O8,r)}catch{}switch(r.tag){case 5:La||Up(r,e);case 6:var n=ga,i=Yl;ga=null,uf(t,e,r),ga=n,Yl=i,ga!==null&&(Yl?(t=ga,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ga.removeChild(r.stateNode));break;case 18:ga!==null&&(Yl?(t=ga,r=r.stateNode,t.nodeType===8?L_(t.parentNode,r):t.nodeType===1&&L_(t,r),Ky(t)):L_(ga,r.stateNode));break;case 4:n=ga,i=Yl,ga=r.stateNode.containerInfo,Yl=!0,uf(t,e,r),ga=n,Yl=i;break;case 0:case 11:case 14:case 15:if(!La&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&sI(r,e,s),i=i.next}while(i!==n)}uf(t,e,r);break;case 1:if(!La&&(Up(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){ii(r,e,o)}uf(t,e,r);break;case 21:uf(t,e,r);break;case 22:r.mode&1?(La=(n=La)||r.memoizedState!==null,uf(t,e,r),La=n):uf(t,e,r);break;default:uf(t,e,r)}}function RD(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new u2e),e.forEach(function(n){var i=b2e.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Pl(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=s),n&=~a}if(n=i,n=gi()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*h2e(n/1960))-n,10t?16:t,jf===null)var n=!1;else{if(t=jf,jf=null,f5=0,Jr&6)throw Error(at(331));var i=Jr;for(Jr|=4,Tt=t.current;Tt!==null;){var a=Tt,s=a.child;if(Tt.flags&16){var o=a.deletions;if(o!==null){for(var l=0;lgi()-Kk?E0(t,0):Yk|=r),Us(t,e)}function BY(t,e){e===0&&(t.mode&1?(e=Bb,Bb<<=1,!(Bb&130023424)&&(Bb=4194304)):e=1);var r=ss();t=Td(t,e),t!==null&&(hw(t,e,r),Us(t,r))}function v2e(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),BY(t,r)}function b2e(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(at(314))}n!==null&&n.delete(e),BY(t,r)}var zY;zY=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Os.current)Rs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Rs=!1,o2e(t,e,r);Rs=!!(t.flags&131072)}else Rs=!1,Un&&e.flags&1048576&&qV(e,n5,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;t6(t,e),t=e.pendingProps;var i=xg(e,za.current);rg(e,r),i=zk(null,e,n,t,i,r);var a=Wk();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Fs(n)?(a=!0,t5(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Dk(e),i.updater=G8,e.stateNode=i,i._reactInternals=e,XA(e,n,t,r),e=rI(null,e,n,!0,a,r)):(e.tag=0,Un&&a&&kk(e),Za(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(t6(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=E2e(n),t=ql(n,t),i){case 0:e=tI(null,e,n,t,r);break e;case 1:e=ND(null,e,n,t,r);break e;case 11:e=TD(null,e,n,t,r);break e;case 14:e=kD(null,e,n,ql(n.type,t),r);break e}throw Error(at(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ql(n,i),tI(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ql(n,i),ND(t,e,n,i,r);case 3:e:{if(SY(e),t===null)throw Error(at(387));n=e.pendingProps,a=e.memoizedState,i=a.element,QV(t,e),s5(e,n,null,r);var s=e.memoizedState;if(n=s.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=Sg(Error(at(423)),e),e=LD(t,e,n,r,i);break e}else if(n!==i){i=Sg(Error(at(424)),e),e=LD(t,e,n,r,i);break e}else for(vo=Wf(e.stateNode.containerInfo.firstChild),_o=e,Un=!0,Jl=null,r=JV(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Eg(),n===i){e=kd(t,e,r);break e}Za(t,e,n,r)}e=e.child}return e;case 5:return XV(e),t===null&&JA(e),n=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,GA(n,i)?s=null:a!==null&&GA(n,a)&&(e.flags|=32),CY(t,e),Za(t,e,s,r),e.child;case 6:return t===null&&JA(e),null;case 13:return AY(t,e,r);case 4:return Ok(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=_g(e,null,n,r):Za(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ql(n,i),TD(t,e,n,i,r);case 7:return Za(t,e,e.pendingProps,r),e.child;case 8:return Za(t,e,e.pendingProps.children,r),e.child;case 12:return Za(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value,An(i5,n._currentValue),n._currentValue=s,a!==null)if(fc(a.value,s)){if(a.children===i.children&&!Os.current){e=kd(t,e,r);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=Cd(-1,r&-r),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),ZA(a.return,r,e),o.lanes|=r;break}l=l.next}}else if(a.tag===10)s=a.type===e.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(at(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),ZA(s,r,e),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Za(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,rg(e,r),i=fl(i),n=n(i),e.flags|=1,Za(t,e,n,r),e.child;case 14:return n=e.type,i=ql(n,e.pendingProps),i=ql(n.type,i),kD(t,e,n,i,r);case 15:return EY(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:ql(n,i),t6(t,e),e.tag=1,Fs(n)?(t=!0,t5(e)):t=!1,rg(e,r),vY(e,n,i),XA(e,n,i,r),rI(null,e,n,!0,t,r);case 19:return IY(t,e,r);case 22:return _Y(t,e,r)}throw Error(at(156,e.tag))};function WY(t,e){return mV(t,e)}function x2e(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sl(t,e,r,n){return new x2e(t,e,r,n)}function Xk(t){return t=t.prototype,!(!t||!t.isReactComponent)}function E2e(t){if(typeof t=="function")return Xk(t)?1:0;if(t!=null){if(t=t.$$typeof,t===wk)return 11;if(t===vk)return 14}return 2}function Vf(t,e){var r=t.alternate;return r===null?(r=sl(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function i6(t,e,r,n,i,a){var s=2;if(n=t,typeof t=="function")Xk(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Np:return _0(r.children,i,a,e);case yk:s=8,i|=8;break;case _A:return t=sl(12,r,e,i|2),t.elementType=_A,t.lanes=a,t;case CA:return t=sl(13,r,e,i),t.elementType=CA,t.lanes=a,t;case SA:return t=sl(19,r,e,i),t.elementType=SA,t.lanes=a,t;case Xq:return Y8(r,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Zq:s=10;break e;case Qq:s=9;break e;case wk:s=11;break e;case vk:s=14;break e;case xf:s=16,n=null;break e}throw Error(at(130,t==null?t:typeof t,""))}return e=sl(s,r,e,i),e.elementType=t,e.type=n,e.lanes=a,e}function _0(t,e,r,n){return t=sl(7,t,n,e),t.lanes=r,t}function Y8(t,e,r,n){return t=sl(22,t,n,e),t.elementType=Xq,t.lanes=r,t.stateNode={isHidden:!1},t}function U_(t,e,r){return t=sl(6,t,null,e),t.lanes=r,t}function B_(t,e,r){return e=sl(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function _2e(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=x_(0),this.expirationTimes=x_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=x_(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function eN(t,e,r,n,i,a,s,o,l){return t=new _2e(t,e,r,o,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=sl(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Dk(a),t}function C2e(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(VY)}catch(t){console.error(t)}}VY(),Vq.exports=ko;var sc=Vq.exports,YY,HD=sc;YY=HD.createRoot,HD.hydrateRoot;/** +`+a.stack}return{value:t,source:e,stack:i,digest:null}}function V_(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function dI(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var k2e=typeof WeakMap=="function"?WeakMap:Map;function BY(t,e,r){r=kd(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){b5||(b5=!0,xI=n),dI(t,e)},r}function zY(t,e,r){r=kd(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var i=e.value;r.payload=function(){return n(i)},r.callback=function(){dI(t,e)}}var a=t.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){dI(t,e),typeof n!="function"&&(Qf===null?Qf=new Set([this]):Qf.add(this));var s=e.stack;this.componentDidCatch(e.value,{componentStack:s!==null?s:""})}),r}function FD(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new k2e;var i=new Set;n.set(e,i)}else i=n.get(e),i===void 0&&(i=new Set,n.set(e,i));i.has(r)||(i.add(r),t=H2e.bind(null,t,e,r),e.then(t,t))}function UD(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function BD(t,e,r,n,i){return t.mode&1?(t.flags|=65536,t.lanes=i,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=kd(-1,1),e.tag=2,Jf(r,e,1))),r.lanes|=1),t)}var N2e=Zd.ReactCurrentOwner,Fs=!1;function Za(t,e,r,n){e.child=t===null?yY(e,null,r,n):kg(e,t.child,r,n)}function zD(t,e,r,n,i){r=r.render;var a=e.ref;return cg(e,i),n=Xk(t,e,r,n,a,i),r=eN(),t!==null&&!Fs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Rd(t,e,i)):(Un&&r&&Bk(e),e.flags|=1,Za(t,e,n,i),e.child)}function WD(t,e,r,n,i){if(t===null){var a=r.type;return typeof a=="function"&&!uN(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=a,WY(t,e,a,n,i)):(t=h6(r.type,null,n,e,e.mode,i),t.ref=e.ref,t.return=e,e.child=t)}if(a=t.child,!(t.lanes&i)){var s=a.memoizedProps;if(r=r.compare,r=r!==null?r:s3,r(s,n)&&t.ref===e.ref)return Rd(t,e,i)}return e.flags|=1,t=Xf(a,n),t.ref=e.ref,t.return=e,e.child=t}function WY(t,e,r,n,i){if(t!==null){var a=t.memoizedProps;if(s3(a,n)&&t.ref===e.ref)if(Fs=!1,e.pendingProps=n=a,(t.lanes&i)!==0)t.flags&131072&&(Fs=!0);else return e.lanes=t.lanes,Rd(t,e,i)}return fI(t,e,r,n,i)}function HY(t,e,r){var n=e.pendingProps,i=n.children,a=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},An(Yp,go),go|=r;else{if(!(r&1073741824))return t=a!==null?a.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,An(Yp,go),go|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,An(Yp,go),go|=n}else a!==null?(n=a.baseLanes|r,e.memoizedState=null):n=r,An(Yp,go),go|=n;return Za(t,e,i,r),e.child}function GY(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function fI(t,e,r,n,i){var a=zs(r)?z0:Wa.current;return a=Mg(e,a),cg(e,i),r=Xk(t,e,r,n,a,i),n=eN(),t!==null&&!Fs?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~i,Rd(t,e,i)):(Un&&n&&Bk(e),e.flags|=1,Za(t,e,r,i),e.child)}function HD(t,e,r,n,i){if(zs(r)){var a=!0;u5(e)}else a=!1;if(cg(e,i),e.stateNode===null)u6(t,e),UY(e,r,n),uI(e,r,n,i),n=!0;else if(t===null){var s=e.stateNode,o=e.memoizedProps;s.props=o;var l=s.context,c=r.contextType;typeof c=="object"&&c!==null?c=ml(c):(c=zs(r)?z0:Wa.current,c=Mg(e,c));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof s.getSnapshotBeforeUpdate=="function";f||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==n||l!==c)&&OD(e,s,n,c),Mf=!1;var h=e.memoizedState;s.state=h,g5(e,n,s,i),l=e.memoizedState,o!==n||h!==l||Bs.current||Mf?(typeof u=="function"&&(cI(e,r,u,n),l=e.memoizedState),(o=Mf||DD(e,r,o,n,h,l,c))?(f||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(e.flags|=4194308)):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),s.props=n,s.state=l,s.context=c,n=o):(typeof s.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{s=e.stateNode,vY(t,e),o=e.memoizedProps,c=e.type===e.elementType?o:Kl(e.type,o),s.props=c,f=e.pendingProps,h=s.context,l=r.contextType,typeof l=="object"&&l!==null?l=ml(l):(l=zs(r)?z0:Wa.current,l=Mg(e,l));var g=r.getDerivedStateFromProps;(u=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(o!==f||h!==l)&&OD(e,s,n,l),Mf=!1,h=e.memoizedState,s.state=h,g5(e,n,s,i);var m=e.memoizedState;o!==f||h!==m||Bs.current||Mf?(typeof g=="function"&&(cI(e,r,g,n),m=e.memoizedState),(c=Mf||DD(e,r,c,n,h,m,l)||!1)?(u||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(n,m,l),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(n,m,l)),typeof s.componentDidUpdate=="function"&&(e.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=m),s.props=n,s.state=m,s.context=l,n=c):(typeof s.componentDidUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&h===t.memoizedState||(e.flags|=1024),n=!1)}return hI(t,e,r,n,a,i)}function hI(t,e,r,n,i,a){GY(t,e);var s=(e.flags&128)!==0;if(!n&&!s)return i&&TD(e,r,!1),Rd(t,e,a);n=e.stateNode,N2e.current=e;var o=s&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&s?(e.child=kg(e,t.child,null,a),e.child=kg(e,null,o,a)):Za(t,e,o,a),e.memoizedState=n.state,i&&TD(e,r,!0),e.child}function qY(t){var e=t.stateNode;e.pendingContext?MD(t,e.pendingContext,e.pendingContext!==e.context):e.context&&MD(t,e.context,!1),Kk(t,e.containerInfo)}function GD(t,e,r,n,i){return Tg(),Wk(i),e.flags|=256,Za(t,e,r,n),e.child}var pI={dehydrated:null,treeContext:null,retryLane:0};function gI(t){return{baseLanes:t,cachePool:null,transitions:null}}function VY(t,e,r){var n=e.pendingProps,i=Kn.current,a=!1,s=(e.flags&128)!==0,o;if((o=s)||(o=t!==null&&t.memoizedState===null?!1:(i&2)!==0),o?(a=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(i|=1),An(Kn,i&1),t===null)return oI(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(s=n.children,t=n.fallback,a?(n=e.mode,a=e.child,s={mode:"hidden",children:s},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=s):a=n9(s,n,0,null),t=k0(t,n,r,null),a.return=e,t.return=e,a.sibling=t,e.child=a,e.child.memoizedState=gI(r),e.memoizedState=pI,t):nN(e,s));if(i=t.memoizedState,i!==null&&(o=i.dehydrated,o!==null))return L2e(t,e,s,n,o,i,r);if(a){a=n.fallback,s=e.mode,i=t.child,o=i.sibling;var l={mode:"hidden",children:n.children};return!(s&1)&&e.child!==i?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=Xf(i,l),n.subtreeFlags=i.subtreeFlags&14680064),o!==null?a=Xf(o,a):(a=k0(a,s,r,null),a.flags|=2),a.return=e,n.return=e,n.sibling=a,e.child=n,n=a,a=e.child,s=t.child.memoizedState,s=s===null?gI(r):{baseLanes:s.baseLanes|r,cachePool:null,transitions:s.transitions},a.memoizedState=s,a.childLanes=t.childLanes&~r,e.memoizedState=pI,n}return a=t.child,t=a.sibling,n=Xf(a,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function nN(t,e){return e=n9({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function n4(t,e,r,n){return n!==null&&Wk(n),kg(e,t.child,null,r),t=nN(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function L2e(t,e,r,n,i,a,s){if(r)return e.flags&256?(e.flags&=-257,n=V_(Error(at(422))),n4(t,e,s,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(a=n.fallback,i=e.mode,n=n9({mode:"visible",children:n.children},i,0,null),a=k0(a,i,s,null),a.flags|=2,n.return=e,a.return=e,n.sibling=a,e.child=n,e.mode&1&&kg(e,t.child,null,s),e.child.memoizedState=gI(s),e.memoizedState=pI,a);if(!(e.mode&1))return n4(t,e,s,null);if(i.data==="$!"){if(n=i.nextSibling&&i.nextSibling.dataset,n)var o=n.dgst;return n=o,a=Error(at(419)),n=V_(a,n,void 0),n4(t,e,s,n)}if(o=(s&t.childLanes)!==0,Fs||o){if(n=na,n!==null){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(n.suspendedLanes|s)?0:i,i!==0&&i!==a.retryLane&&(a.retryLane=i,Pd(t,i),cc(n,t,i,-1))}return cN(),n=V_(Error(at(421))),n4(t,e,s,n)}return i.data==="$?"?(e.flags|=128,e.child=t.child,e=G2e.bind(null,t),i._reactRetry=e,null):(t=a.treeContext,xo=Kf(i.nextSibling),So=e,Un=!0,ec=null,t!==null&&(ol[ll++]=Cd,ol[ll++]=Sd,ol[ll++]=W0,Cd=t.id,Sd=t.overflow,W0=e),e=nN(e,n.children),e.flags|=4096,e)}function qD(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),lI(t.return,e,r)}function Y_(t,e,r,n,i){var a=t.memoizedState;a===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(a.isBackwards=e,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=i)}function YY(t,e,r){var n=e.pendingProps,i=n.revealOrder,a=n.tail;if(Za(t,e,n.children,r),n=Kn.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qD(t,r,e);else if(t.tag===19)qD(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(An(Kn,n),!(e.mode&1))e.memoizedState=null;else switch(i){case"forwards":for(r=e.child,i=null;r!==null;)t=r.alternate,t!==null&&m5(t)===null&&(i=r),r=r.sibling;r=i,r===null?(i=e.child,e.child=null):(i=r.sibling,r.sibling=null),Y_(e,!1,i,r,a);break;case"backwards":for(r=null,i=e.child,e.child=null;i!==null;){if(t=i.alternate,t!==null&&m5(t)===null){e.child=i;break}t=i.sibling,i.sibling=r,r=i,i=t}Y_(e,!0,r,null,a);break;case"together":Y_(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function u6(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Rd(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),G0|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(at(153));if(e.child!==null){for(t=e.child,r=Xf(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Xf(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function j2e(t,e,r){switch(e.tag){case 3:qY(e),Tg();break;case 5:bY(e);break;case 1:zs(e.type)&&u5(e);break;case 4:Kk(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,i=e.memoizedProps.value;An(h5,n._currentValue),n._currentValue=i;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(An(Kn,Kn.current&1),e.flags|=128,null):r&e.child.childLanes?VY(t,e,r):(An(Kn,Kn.current&1),t=Rd(t,e,r),t!==null?t.sibling:null);An(Kn,Kn.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return YY(t,e,r);e.flags|=128}if(i=e.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),An(Kn,Kn.current),n)break;return null;case 22:case 23:return e.lanes=0,HY(t,e,r)}return Rd(t,e,r)}var KY,mI,JY,QY;KY=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};mI=function(){};JY=function(t,e,r,n){var i=t.memoizedProps;if(i!==n){t=e.stateNode,E0(uu.current);var a=null;switch(r){case"input":i=OA(t,i),n=OA(t,n),a=[];break;case"select":i=Xn({},i,{value:void 0}),n=Xn({},n,{value:void 0}),a=[];break;case"textarea":i=BA(t,i),n=BA(t,n),a=[];break;default:typeof i.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=l5)}WA(r,n);var s;r=null;for(c in i)if(!n.hasOwnProperty(c)&&i.hasOwnProperty(c)&&i[c]!=null)if(c==="style"){var o=i[c];for(s in o)o.hasOwnProperty(s)&&(r||(r={}),r[s]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(Xy.hasOwnProperty(c)?a||(a=[]):(a=a||[]).push(c,null));for(c in n){var l=n[c];if(o=i!=null?i[c]:void 0,n.hasOwnProperty(c)&&l!==o&&(l!=null||o!=null))if(c==="style")if(o){for(s in o)!o.hasOwnProperty(s)||l&&l.hasOwnProperty(s)||(r||(r={}),r[s]="");for(s in l)l.hasOwnProperty(s)&&o[s]!==l[s]&&(r||(r={}),r[s]=l[s])}else r||(a||(a=[]),a.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(a=a||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(a=a||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(Xy.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&jn("scroll",t),a||o===l||(a=[])):(a=a||[]).push(c,l))}r&&(a=a||[]).push("style",r);var c=a;(e.updateQueue=c)&&(e.flags|=4)}};QY=function(t,e,r,n){r!==n&&(e.flags|=4)};function T2(t,e){if(!Un)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Ia(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags&14680064,n|=i.flags&14680064,i.return=t,i=i.sibling;else for(i=t.child;i!==null;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=t,i=i.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function $2e(t,e,r){var n=e.pendingProps;switch(zk(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ia(e),null;case 1:return zs(e.type)&&c5(),Ia(e),null;case 3:return n=e.stateNode,Ng(),Rn(Bs),Rn(Wa),Qk(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(t4(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ec!==null&&(CI(ec),ec=null))),mI(t,e),Ia(e),null;case 5:Jk(e);var i=E0(d3.current);if(r=e.type,t!==null&&e.stateNode!=null)JY(t,e,r,n,i),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(at(166));return Ia(e),null}if(t=E0(uu.current),t4(e)){n=e.stateNode,r=e.type;var a=e.memoizedProps;switch(n[eu]=e,n[c3]=a,t=(e.mode&1)!==0,r){case"dialog":jn("cancel",n),jn("close",n);break;case"iframe":case"object":case"embed":jn("load",n);break;case"video":case"audio":for(i=0;i<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=s.createElement(r,{is:n.is}):(t=s.createElement(r),r==="select"&&(s=t,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):t=s.createElementNS(t,r),t[eu]=e,t[c3]=n,KY(t,e,!1,!1),e.stateNode=t;e:{switch(s=HA(r,n),r){case"dialog":jn("cancel",t),jn("close",t),i=n;break;case"iframe":case"object":case"embed":jn("load",t),i=n;break;case"video":case"audio":for(i=0;ijg&&(e.flags|=128,n=!0,T2(a,!1),e.lanes=4194304)}else{if(!n)if(t=m5(s),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),T2(a,!0),a.tail===null&&a.tailMode==="hidden"&&!s.alternate&&!Un)return Ia(e),null}else 2*gi()-a.renderingStartTime>jg&&r!==1073741824&&(e.flags|=128,n=!0,T2(a,!1),e.lanes=4194304);a.isBackwards?(s.sibling=e.child,e.child=s):(r=a.last,r!==null?r.sibling=s:e.child=s,a.last=s)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=gi(),e.sibling=null,r=Kn.current,An(Kn,n?r&1|2:r&1),e):(Ia(e),null);case 22:case 23:return lN(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?go&1073741824&&(Ia(e),e.subtreeFlags&6&&(e.flags|=8192)):Ia(e),null;case 24:return null;case 25:return null}throw Error(at(156,e.tag))}function P2e(t,e){switch(zk(e),e.tag){case 1:return zs(e.type)&&c5(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ng(),Rn(Bs),Rn(Wa),Qk(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Jk(e),null;case 13:if(Rn(Kn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(at(340));Tg()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Rn(Kn),null;case 4:return Ng(),null;case 10:return qk(e.type._context),null;case 22:case 23:return lN(),null;case 24:return null;default:return null}}var i4=!1,ja=!1,R2e=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Vp(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){ii(t,e,n)}else r.current=null}function yI(t,e,r){try{r()}catch(n){ii(t,e,n)}}var VD=!1;function D2e(t,e){if(eI=a5,t=rY(),Uk(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var s=0,o=-1,l=-1,c=0,u=0,f=t,h=null;t:for(;;){for(var g;f!==r||i!==0&&f.nodeType!==3||(o=s+i),f!==a||n!==0&&f.nodeType!==3||(l=s+n),f.nodeType===3&&(s+=f.nodeValue.length),(g=f.firstChild)!==null;)h=f,f=g;for(;;){if(f===t)break t;if(h===r&&++c===i&&(o=s),h===a&&++u===n&&(l=s),(g=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=g}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(tI={focusedElem:t,selectionRange:r},a5=!1,Tt=e;Tt!==null;)if(e=Tt,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Tt=t;else for(;Tt!==null;){e=Tt;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var w=m.memoizedProps,C=m.memoizedState,v=e.stateNode,b=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:Kl(e.type,w),C);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var A=e.stateNode.containerInfo;A.nodeType===1?A.textContent="":A.nodeType===9&&A.documentElement&&A.removeChild(A.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(at(163))}}catch(S){ii(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,Tt=t;break}Tt=e.return}return m=VD,VD=!1,m}function Ty(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var i=n=n.next;do{if((i.tag&t)===t){var a=i.destroy;i.destroy=void 0,a!==void 0&&yI(e,r,a)}i=i.next}while(i!==n)}}function t9(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function wI(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function ZY(t){var e=t.alternate;e!==null&&(t.alternate=null,ZY(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[eu],delete e[c3],delete e[iI],delete e[v2e],delete e[b2e])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function XY(t){return t.tag===5||t.tag===3||t.tag===4}function YD(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||XY(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function vI(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=l5));else if(n!==4&&(t=t.child,t!==null))for(vI(t,e,r),t=t.sibling;t!==null;)vI(t,e,r),t=t.sibling}function bI(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(bI(t,e,r),t=t.sibling;t!==null;)bI(t,e,r),t=t.sibling}var ma=null,Ql=!1;function mf(t,e,r){for(r=r.child;r!==null;)eK(t,e,r),r=r.sibling}function eK(t,e,r){if(cu&&typeof cu.onCommitFiberUnmount=="function")try{cu.onCommitFiberUnmount(V8,r)}catch{}switch(r.tag){case 5:ja||Vp(r,e);case 6:var n=ma,i=Ql;ma=null,mf(t,e,r),ma=n,Ql=i,ma!==null&&(Ql?(t=ma,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ma.removeChild(r.stateNode));break;case 18:ma!==null&&(Ql?(t=ma,r=r.stateNode,t.nodeType===8?B_(t.parentNode,r):t.nodeType===1&&B_(t,r),i3(t)):B_(ma,r.stateNode));break;case 4:n=ma,i=Ql,ma=r.stateNode.containerInfo,Ql=!0,mf(t,e,r),ma=n,Ql=i;break;case 0:case 11:case 14:case 15:if(!ja&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){i=n=n.next;do{var a=i,s=a.destroy;a=a.tag,s!==void 0&&(a&2||a&4)&&yI(r,e,s),i=i.next}while(i!==n)}mf(t,e,r);break;case 1:if(!ja&&(Vp(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){ii(r,e,o)}mf(t,e,r);break;case 21:mf(t,e,r);break;case 22:r.mode&1?(ja=(n=ja)||r.memoizedState!==null,mf(t,e,r),ja=n):mf(t,e,r);break;default:mf(t,e,r)}}function KD(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new R2e),e.forEach(function(n){var i=q2e.bind(null,t,n);r.has(n)||(r.add(n),n.then(i,i))})}}function Ol(t,e){var r=e.deletions;if(r!==null)for(var n=0;ni&&(i=s),n&=~a}if(n=i,n=gi()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*F2e(n/1960))-n,10t?16:t,Ff===null)var n=!1;else{if(t=Ff,Ff=null,x5=0,Jr&6)throw Error(at(331));var i=Jr;for(Jr|=4,Tt=t.current;Tt!==null;){var a=Tt,s=a.child;if(Tt.flags&16){var o=a.deletions;if(o!==null){for(var l=0;lgi()-sN?T0(t,0):aN|=r),Ws(t,e)}function lK(t,e){e===0&&(t.mode&1?(e=Kb,Kb<<=1,!(Kb&130023424)&&(Kb=4194304)):e=1);var r=ls();t=Pd(t,e),t!==null&&(xw(t,e,r),Ws(t,r))}function G2e(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),lK(t,r)}function q2e(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,i=t.memoizedState;i!==null&&(r=i.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(at(314))}n!==null&&n.delete(e),lK(t,r)}var cK;cK=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||Bs.current)Fs=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Fs=!1,j2e(t,e,r);Fs=!!(t.flags&131072)}else Fs=!1,Un&&e.flags&1048576&&hY(e,f5,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;u6(t,e),t=e.pendingProps;var i=Mg(e,Wa.current);cg(e,r),i=Xk(null,e,n,t,i,r);var a=eN();return e.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,zs(n)?(a=!0,u5(e)):a=!1,e.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Yk(e),i.updater=e9,e.stateNode=i,i._reactInternals=e,uI(e,n,t,r),e=hI(null,e,n,!0,a,r)):(e.tag=0,Un&&a&&Bk(e),Za(null,e,i,r),e=e.child),e;case 16:n=e.elementType;e:{switch(u6(t,e),t=e.pendingProps,i=n._init,n=i(n._payload),e.type=n,i=e.tag=Y2e(n),t=Kl(n,t),i){case 0:e=fI(null,e,n,t,r);break e;case 1:e=HD(null,e,n,t,r);break e;case 11:e=zD(null,e,n,t,r);break e;case 14:e=WD(null,e,n,Kl(n.type,t),r);break e}throw Error(at(306,n,""))}return e;case 0:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Kl(n,i),fI(t,e,n,i,r);case 1:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Kl(n,i),HD(t,e,n,i,r);case 3:e:{if(qY(e),t===null)throw Error(at(387));n=e.pendingProps,a=e.memoizedState,i=a.element,vY(t,e),g5(e,n,null,r);var s=e.memoizedState;if(n=s.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},e.updateQueue.baseState=a,e.memoizedState=a,e.flags&256){i=Lg(Error(at(423)),e),e=GD(t,e,n,r,i);break e}else if(n!==i){i=Lg(Error(at(424)),e),e=GD(t,e,n,r,i);break e}else for(xo=Kf(e.stateNode.containerInfo.firstChild),So=e,Un=!0,ec=null,r=yY(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Tg(),n===i){e=Rd(t,e,r);break e}Za(t,e,n,r)}e=e.child}return e;case 5:return bY(e),t===null&&oI(e),n=e.type,i=e.pendingProps,a=t!==null?t.memoizedProps:null,s=i.children,rI(n,i)?s=null:a!==null&&rI(n,a)&&(e.flags|=32),GY(t,e),Za(t,e,s,r),e.child;case 6:return t===null&&oI(e),null;case 13:return VY(t,e,r);case 4:return Kk(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=kg(e,null,n,r):Za(t,e,n,r),e.child;case 11:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Kl(n,i),zD(t,e,n,i,r);case 7:return Za(t,e,e.pendingProps,r),e.child;case 8:return Za(t,e,e.pendingProps.children,r),e.child;case 12:return Za(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,i=e.pendingProps,a=e.memoizedProps,s=i.value,An(h5,n._currentValue),n._currentValue=s,a!==null)if(mc(a.value,s)){if(a.children===i.children&&!Bs.current){e=Rd(t,e,r);break e}}else for(a=e.child,a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){s=a.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(a.tag===1){l=kd(-1,r&-r),l.tag=2;var c=a.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}a.lanes|=r,l=a.alternate,l!==null&&(l.lanes|=r),lI(a.return,r,e),o.lanes|=r;break}l=l.next}}else if(a.tag===10)s=a.type===e.type?null:a.child;else if(a.tag===18){if(s=a.return,s===null)throw Error(at(341));s.lanes|=r,o=s.alternate,o!==null&&(o.lanes|=r),lI(s,r,e),s=a.sibling}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}Za(t,e,i.children,r),e=e.child}return e;case 9:return i=e.type,n=e.pendingProps.children,cg(e,r),i=ml(i),n=n(i),e.flags|=1,Za(t,e,n,r),e.child;case 14:return n=e.type,i=Kl(n,e.pendingProps),i=Kl(n.type,i),WD(t,e,n,i,r);case 15:return WY(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,i=e.pendingProps,i=e.elementType===n?i:Kl(n,i),u6(t,e),e.tag=1,zs(n)?(t=!0,u5(e)):t=!1,cg(e,r),UY(e,n,i),uI(e,n,i,r),hI(null,e,n,!0,t,r);case 19:return YY(t,e,r);case 22:return HY(t,e,r)}throw Error(at(156,e.tag))};function uK(t,e){return DV(t,e)}function V2e(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ul(t,e,r,n){return new V2e(t,e,r,n)}function uN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Y2e(t){if(typeof t=="function")return uN(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Tk)return 11;if(t===kk)return 14}return 2}function Xf(t,e){var r=t.alternate;return r===null?(r=ul(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function h6(t,e,r,n,i,a){var s=2;if(n=t,typeof t=="function")uN(t)&&(s=1);else if(typeof t=="string")s=5;else e:switch(t){case Op:return k0(r.children,i,a,e);case Mk:s=8,i|=8;break;case $A:return t=ul(12,r,e,i|2),t.elementType=$A,t.lanes=a,t;case PA:return t=ul(13,r,e,i),t.elementType=PA,t.lanes=a,t;case RA:return t=ul(19,r,e,i),t.elementType=RA,t.lanes=a,t;case bV:return n9(r,i,a,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case wV:s=10;break e;case vV:s=9;break e;case Tk:s=11;break e;case kk:s=14;break e;case If:s=16,n=null;break e}throw Error(at(130,t==null?t:typeof t,""))}return e=ul(s,r,e,i),e.elementType=t,e.type=n,e.lanes=a,e}function k0(t,e,r,n){return t=ul(7,t,n,e),t.lanes=r,t}function n9(t,e,r,n){return t=ul(22,t,n,e),t.elementType=bV,t.lanes=r,t.stateNode={isHidden:!1},t}function K_(t,e,r){return t=ul(6,t,null,e),t.lanes=r,t}function J_(t,e,r){return e=ul(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function K2e(t,e,r,n,i){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=k_(0),this.expirationTimes=k_(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=k_(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function dN(t,e,r,n,i,a,s,o,l){return t=new K2e(t,e,r,o,l),e===1?(e=1,a===!0&&(e|=8)):e=0,a=ul(3,null,null,e),t.current=a,a.stateNode=t,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yk(a),t}function J2e(t,e,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(pK)}catch(t){console.error(t)}}pK(),pV.exports=Lo;var uc=pV.exports,gK,nO=uc;gK=nO.createRoot,nO.hydrateRoot;/** * @remix-run/router v1.21.0 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function o3(){return o3=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function k2e(){return Math.random().toString(36).substr(2,8)}function qD(t,e){return{usr:t.state,key:t.key,idx:e}}function pI(t,e,r,n){return r===void 0&&(r=null),o3({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?X8(e):e,{state:r,key:e&&e.key||n||k2e()})}function KY(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function X8(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function N2e(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,o=m0.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(o3({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function f(){o=m0.Pop;let _=u(),v=_==null?null:_-c;c=_,l&&l({action:o,location:w.location,delta:v})}function h(_,v){o=m0.Push;let b=pI(w.location,_,v);c=u()+1;let A=qD(b,c),S=w.createHref(b);try{s.pushState(A,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(S)}a&&l&&l({action:o,location:w.location,delta:1})}function g(_,v){o=m0.Replace;let b=pI(w.location,_,v);c=u();let A=qD(b,c),S=w.createHref(b);s.replaceState(A,"",S),a&&l&&l({action:o,location:w.location,delta:0})}function m(_){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof _=="string"?_:KY(_);return b=b.replace(/ $/,"%20"),su(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let w={get action(){return o},get location(){return t(i,s)},listen(_){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(GD,f),l=_,()=>{i.removeEventListener(GD,f),l=null}},createHref(_){return e(i,_)},createURL:m,encodeLocation(_){let v=m(_);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:g,go(_){return s.go(_)}};return w}var VD;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(VD||(VD={}));function L2e(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function j2e(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?X8(t):t;return{pathname:r?r.startsWith("/")?r:$2e(r,e):e,search:F2e(n),hash:U2e(i)}}function $2e(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function z_(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function P2e(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function R2e(t,e){let r=P2e(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function D2e(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=X8(t):(i=o3({},t),su(!i.pathname||!i.pathname.includes("?"),z_("?","pathname","search",i)),su(!i.pathname||!i.pathname.includes("#"),z_("#","pathname","hash",i)),su(!i.search||!i.search.includes("#"),z_("#","search","hash",i)));let a=t===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=r;else{let f=e.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}o=f>=0?e[f]:"/"}let l=j2e(i,o),c=s&&s!=="/"&&s.endsWith("/"),u=(a||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const O2e=t=>t.join("/").replace(/\/\/+/g,"/"),F2e=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,U2e=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,JY=["post","put","patch","delete"];new Set(JY);const B2e=["get",...JY];new Set(B2e);/** + */function m3(){return m3=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function rye(){return Math.random().toString(36).substr(2,8)}function aO(t,e){return{usr:t.state,key:t.key,idx:e}}function SI(t,e,r,n){return r===void 0&&(r=null),m3({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?l9(e):e,{state:r,key:e&&e.key||n||rye()})}function mK(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function l9(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function nye(t,e,r,n){n===void 0&&(n={});let{window:i=document.defaultView,v5Compat:a=!1}=n,s=i.history,o=_0.Pop,l=null,c=u();c==null&&(c=0,s.replaceState(m3({},s.state,{idx:c}),""));function u(){return(s.state||{idx:null}).idx}function f(){o=_0.Pop;let C=u(),v=C==null?null:C-c;c=C,l&&l({action:o,location:w.location,delta:v})}function h(C,v){o=_0.Push;let b=SI(w.location,C,v);c=u()+1;let A=aO(b,c),S=w.createHref(b);try{s.pushState(A,"",S)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;i.location.assign(S)}a&&l&&l({action:o,location:w.location,delta:1})}function g(C,v){o=_0.Replace;let b=SI(w.location,C,v);c=u();let A=aO(b,c),S=w.createHref(b);s.replaceState(A,"",S),a&&l&&l({action:o,location:w.location,delta:0})}function m(C){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof C=="string"?C:mK(C);return b=b.replace(/ $/,"%20"),du(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let w={get action(){return o},get location(){return t(i,s)},listen(C){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(iO,f),l=C,()=>{i.removeEventListener(iO,f),l=null}},createHref(C){return e(i,C)},createURL:m,encodeLocation(C){let v=m(C);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:h,replace:g,go(C){return s.go(C)}};return w}var sO;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(sO||(sO={}));function iye(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function aye(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:i=""}=typeof t=="string"?l9(t):t;return{pathname:r?r.startsWith("/")?r:sye(r,e):e,search:dye(n),hash:fye(i)}}function sye(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?r.length>1&&r.pop():i!=="."&&r.push(i)}),r.length>1?r.join("/"):"/"}function Q_(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function oye(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function lye(t,e){let r=oye(t);return e?r.map((n,i)=>i===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function cye(t,e,r,n){n===void 0&&(n=!1);let i;typeof t=="string"?i=l9(t):(i=m3({},t),du(!i.pathname||!i.pathname.includes("?"),Q_("?","pathname","search",i)),du(!i.pathname||!i.pathname.includes("#"),Q_("#","pathname","hash",i)),du(!i.search||!i.search.includes("#"),Q_("#","search","hash",i)));let a=t===""||i.pathname==="",s=a?"/":i.pathname,o;if(s==null)o=r;else{let f=e.length-1;if(!n&&s.startsWith("..")){let h=s.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}o=f>=0?e[f]:"/"}let l=aye(i,o),c=s&&s!=="/"&&s.endsWith("/"),u=(a||s===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}const uye=t=>t.join("/").replace(/\/\/+/g,"/"),dye=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,fye=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,yK=["post","put","patch","delete"];new Set(yK);const hye=["get",...yK];new Set(hye);/** * React Router v6.28.1 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */function g5(){return g5=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),C.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let f=D2e(c,JSON.parse(s),a,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:O2e([e,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[e,n,s,a,t])}var XY=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(XY||{}),eK=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(eK||{});function G2e(t){let e=C.useContext(ZY);return e||su(!1),e}function q2e(t){let e=C.useContext(sN);return e||su(!1),e}function V2e(t){let e=q2e(),r=e.matches[e.matches.length-1];return r.route.id||su(!1),r.route.id}function Y2e(){let{router:t}=G2e(XY.UseNavigateStable),e=V2e(eK.UseNavigateStable),r=C.useRef(!1);return QY(()=>{r.current=!0}),C.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,g5({fromRouteId:e},a)))},[t,e])}const YD={};function K2e(t,e){YD[e]||(YD[e]=!0,console.warn(e))}const KD=(t,e,r)=>K2e(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+r+"."));function J2e(t,e){(t==null?void 0:t.v7_startTransition)===void 0&&KD("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(t==null?void 0:t.v7_relativeSplatPath)===void 0&&!e&&KD("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function Z2e(t){let{basename:e="/",children:r=null,location:n,navigationType:i=m0.Pop,navigator:a,static:s=!1,future:o}=t;oN()&&su(!1);let l=e.replace(/^\/*/,"/"),c=C.useMemo(()=>({basename:l,navigator:a,static:s,future:g5({v7_relativeSplatPath:!1},o)}),[l,o,a,s]);typeof n=="string"&&(n=X8(n));let{pathname:u="/",search:f="",hash:h="",state:g=null,key:m="default"}=n,w=C.useMemo(()=>{let _=L2e(u,l);return _==null?null:{location:{pathname:_,search:f,hash:h,state:g,key:m},navigationType:i}},[l,u,f,h,g,m,i]);return w==null?null:C.createElement(iN.Provider,{value:c},C.createElement(aN.Provider,{children:r,value:w}))}new Promise(()=>{});/** + */function C5(){return C5=Object.assign?Object.assign.bind():function(t){for(var e=1;e{o.current=!0}),_.useCallback(function(c,u){if(u===void 0&&(u={}),!o.current)return;if(typeof c=="number"){n.go(c);return}let f=cye(c,JSON.parse(s),a,u.relative==="path");t==null&&e!=="/"&&(f.pathname=f.pathname==="/"?e:uye([e,f.pathname])),(u.replace?n.replace:n.push)(f,u.state,u)},[e,n,s,a,t])}var bK=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(bK||{}),xK=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(xK||{});function yye(t){let e=_.useContext(wK);return e||du(!1),e}function wye(t){let e=_.useContext(yN);return e||du(!1),e}function vye(t){let e=wye(),r=e.matches[e.matches.length-1];return r.route.id||du(!1),r.route.id}function bye(){let{router:t}=yye(bK.UseNavigateStable),e=vye(xK.UseNavigateStable),r=_.useRef(!1);return vK(()=>{r.current=!0}),_.useCallback(function(i,a){a===void 0&&(a={}),r.current&&(typeof i=="number"?t.navigate(i):t.navigate(i,C5({fromRouteId:e},a)))},[t,e])}const oO={};function xye(t,e){oO[e]||(oO[e]=!0,console.warn(e))}const lO=(t,e,r)=>xye(t,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+t+"` future flag to opt-in early. ")+("For more information, see "+r+"."));function Eye(t,e){(t==null?void 0:t.v7_startTransition)===void 0&&lO("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(t==null?void 0:t.v7_relativeSplatPath)===void 0&&!e&&lO("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function _ye(t){let{basename:e="/",children:r=null,location:n,navigationType:i=_0.Pop,navigator:a,static:s=!1,future:o}=t;wN()&&du(!1);let l=e.replace(/^\/*/,"/"),c=_.useMemo(()=>({basename:l,navigator:a,static:s,future:C5({v7_relativeSplatPath:!1},o)}),[l,o,a,s]);typeof n=="string"&&(n=l9(n));let{pathname:u="/",search:f="",hash:h="",state:g=null,key:m="default"}=n,w=_.useMemo(()=>{let C=iye(u,l);return C==null?null:{location:{pathname:C,search:f,hash:h,state:g,key:m},navigationType:i}},[l,u,f,h,g,m,i]);return w==null?null:_.createElement(gN.Provider,{value:c},_.createElement(mN.Provider,{children:r,value:w}))}new Promise(()=>{});/** * React Router DOM v6.28.1 * * Copyright (c) Remix Software Inc. @@ -64,70 +64,70 @@ Error generating stack: `+a.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */const Q2e="6";try{window.__reactRouterVersion=Q2e}catch{}const X2e="startTransition",JD=H6[X2e];function eye(t){let{basename:e,children:r,future:n,window:i}=t,a=C.useRef();a.current==null&&(a.current=T2e({window:i,v5Compat:!0}));let s=a.current,[o,l]=C.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},u=C.useCallback(f=>{c&&JD?JD(()=>l(f)):l(f)},[l,c]);return C.useLayoutEffect(()=>s.listen(u),[s,u]),C.useEffect(()=>J2e(n),[n]),C.createElement(Z2e,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:s,future:n})}var ZD;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(ZD||(ZD={}));var QD;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(QD||(QD={}));const tye="modulepreload",rye=function(t){return"/"+t},XD={},Ws=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=rye(l),l in XD)return;XD[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":tye,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((h,g)=>{f.addEventListener("load",h),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})},nye="logger/5.7.0";let eO=!1,tO=!1;const a6={debug:1,default:2,info:2,warning:3,error:4,off:5};let rO=a6.default,W_=null;function iye(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const nO=iye();var gI;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(gI||(gI={}));var Ta;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(Ta||(Ta={}));const iO="0123456789abcdef";class Le{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();a6[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(rO>a6[n])&&console.log.apply(console,r)}debug(...e){this._log(Le.levels.DEBUG,e)}info(...e){this._log(Le.levels.INFO,e)}warn(...e){this._log(Le.levels.WARNING,e)}makeError(e,r,n){if(tO)return this.makeError("censored error",r,{});r||(r=Le.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const c=n[l];try{if(c instanceof Uint8Array){let u="";for(let f=0;f>4],u+=iO[c[f]&15];i.push(l+"=Uint8Array(0x"+u+")")}else i.push(l+"="+JSON.stringify(c))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=e;let s="";switch(r){case Ta.NUMERIC_FAULT:{s="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":s+="-"+l;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case Ta.CALL_EXCEPTION:case Ta.INSUFFICIENT_FUNDS:case Ta.MISSING_NEW:case Ta.NONCE_EXPIRED:case Ta.REPLACEMENT_UNDERPRICED:case Ta.TRANSACTION_REPLACED:case Ta.UNPREDICTABLE_GAS_LIMIT:s=r;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const o=new Error(e);return o.reason=a,o.code=r,Object.keys(n).forEach(function(l){o[l]=n[l]}),o}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,Le.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){nO&&this.throwError("platform missing String.prototype.normalize",Le.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:nO})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Le.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Le.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,Le.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Le.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Le.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Le.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return W_||(W_=new Le(nye)),W_}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Le.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),eO){if(!e)return;this.globalLogger().throwError("error censorship permanent",Le.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}tO=!!e,eO=!!r}static setLogLevel(e){const r=a6[e.toLowerCase()];if(r==null){Le.globalLogger().warn("invalid log level - "+e);return}rO=r}static from(e){return new Le(e)}}Le.errors=Ta;Le.levels=gI;const aye="bytes/5.7.0",ni=new Le(aye);function tK(t){return!!t.toHexString}function ig(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return ig(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function lN(t){return Kr(t)&&!(t.length%2)||cm(t)}function aO(t){return typeof t=="number"&&t==t&&t%1===0}function cm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!aO(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function er(t,e){if(e||(e={}),typeof t=="number"){ni.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),ig(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),tK(t)&&(t=t.toHexString()),Kr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ni.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ier(i)),r=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return e.reduce((i,a)=>(n.set(a,i),i+a.length),0),ig(n)}function U0(t){let e=er(t);if(e.length===0)return e;let r=0;for(;re&&ni.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),ig(r)}function Kr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const H_="0123456789abcdef";function Bt(t,e){if(e||(e={}),typeof t=="number"){ni.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=H_[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),tK(t))return t.toHexString();if(Kr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ni.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(cm(t)){let r="0x";for(let n=0;n>4]+H_[i&15]}return r}return ni.throwArgumentError("invalid hexlify value","value",t)}function B0(t){if(typeof t!="string")t=Bt(t);else if(!Kr(t)||t.length%2)return null;return(t.length-2)/2}function ka(t,e,r){return typeof t!="string"?t=Bt(t):(!Kr(t)||t.length%2)&&ni.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function $s(t){let e="0x";return t.forEach(r=>{e+=Bt(r).substring(2)}),e}function cN(t){const e=oye(Bt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function oye(t){typeof t!="string"&&(t=Bt(t)),Kr(t)||ni.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&ni.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function e9(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(lN(t)){let r=er(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Bt(r.slice(0,32)),e.s=Bt(r.slice(32,64))):r.length===65?(e.r=Bt(r.slice(0,32)),e.s=Bt(r.slice(32,64)),e.v=r[64]):ni.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ni.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Bt(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=sye(er(e._vs),32);e._vs=Bt(i);const a=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&ni.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const s=Bt(i);e.s==null?e.s=s:e.s!==s&&ni.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ni.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&ni.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Kr(e.r)?ni.throwArgumentError("signature missing or invalid r","signature",t):e.r=Bn(e.r,32),e.s==null||!Kr(e.s)?ni.throwArgumentError("signature missing or invalid s","signature",t):e.s=Bn(e.s,32);const r=er(e.s);r[0]>=128&&ni.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Bt(r);e._vs&&(Kr(e._vs)||ni.throwArgumentError("signature invalid _vs","signature",t),e._vs=Bn(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ni.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var uN={exports:{}};const lye={},cye=Object.freeze(Object.defineProperty({__proto__:null,default:lye},Symbol.toStringTag,{value:"Module"})),um=fh(cye);uN.exports;(function(t){(function(e,r){function n(k,x){if(!k)throw new Error(x||"Assertion failed")}function i(k,x){k.super_=x;var E=function(){};E.prototype=x.prototype,k.prototype=new E,k.prototype.constructor=k}function a(k,x,E){if(a.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((x==="le"||x==="be")&&(E=x,x=10),this._init(k||0,x||10,E||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=um.Buffer}catch{}a.isBN=function(x){return x instanceof a?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===a.wordSize&&Array.isArray(x.words)},a.max=function(x,E){return x.cmp(E)>0?x:E},a.min=function(x,E){return x.cmp(E)<0?x:E},a.prototype._init=function(x,E,L){if(typeof x=="number")return this._initNumber(x,E,L);if(typeof x=="object")return this._initArray(x,E,L);E==="hex"&&(E=16),n(E===(E|0)&&E>=2&&E<=36),x=x.toString().replace(/\s+/g,"");var O=0;x[0]==="-"&&(O++,this.negative=1),O=0;O-=3)R=x[O]|x[O-1]<<8|x[O-2]<<16,this.words[P]|=R<>>26-M&67108863,M+=24,M>=26&&(M-=26,P++);else if(L==="le")for(O=0,P=0;O>>26-M&67108863,M+=24,M>=26&&(M-=26,P++);return this._strip()};function o(k,x){var E=k.charCodeAt(x);if(E>=48&&E<=57)return E-48;if(E>=65&&E<=70)return E-55;if(E>=97&&E<=102)return E-87;n(!1,"Invalid character in "+k)}function l(k,x,E){var L=o(k,E);return E-1>=x&&(L|=o(k,E-1)<<4),L}a.prototype._parseHex=function(x,E,L){this.length=Math.ceil((x.length-E)/6),this.words=new Array(this.length);for(var O=0;O=E;O-=2)M=l(x,E,O)<=18?(P-=18,R+=1,this.words[R]|=M>>>26):P+=8;else{var D=x.length-E;for(O=D%2===0?E+1:E;O=18?(P-=18,R+=1,this.words[R]|=M>>>26):P+=8}this._strip()};function c(k,x,E,L){for(var O=0,P=0,R=Math.min(k.length,E),M=x;M=49?P=D-49+10:D>=17?P=D-17+10:P=D,n(D>=0&&P1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(x,E){x=x||10,E=E|0||1;var L;if(x===16||x==="hex"){L="";for(var O=0,P=0,R=0;R>>24-O&16777215,O+=2,O>=26&&(O-=26,R--),P!==0||R!==this.length-1?L=h[6-D.length]+D+L:L=D+L}for(P!==0&&(L=P.toString(16)+L);L.length%E!==0;)L="0"+L;return this.negative!==0&&(L="-"+L),L}if(x===(x|0)&&x>=2&&x<=36){var $=g[x],X=m[x];L="";var le=this.clone();for(le.negative=0;!le.isZero();){var H=le.modrn(X).toString(x);le=le.idivn(X),le.isZero()?L=H+L:L=h[$-H.length]+H+L}for(this.isZero()&&(L="0"+L);L.length%E!==0;)L="0"+L;return this.negative!==0&&(L="-"+L),L}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=this.words[1]*67108864:this.length===3&&this.words[2]===1?x+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(x,E){return this.toArrayLike(s,x,E)}),a.prototype.toArray=function(x,E){return this.toArrayLike(Array,x,E)};var w=function(x,E){return x.allocUnsafe?x.allocUnsafe(E):new x(E)};a.prototype.toArrayLike=function(x,E,L){this._strip();var O=this.byteLength(),P=L||Math.max(1,O);n(O<=P,"byte array longer than desired length"),n(P>0,"Requested array length <= 0");var R=w(x,P),M=E==="le"?"LE":"BE";return this["_toArrayLike"+M](R,O),R},a.prototype._toArrayLikeLE=function(x,E){for(var L=0,O=0,P=0,R=0;P>8&255),L>16&255),R===6?(L>24&255),O=0,R=0):(O=M>>>24,R+=2)}if(L=0&&(x[L--]=M>>8&255),L>=0&&(x[L--]=M>>16&255),R===6?(L>=0&&(x[L--]=M>>24&255),O=0,R=0):(O=M>>>24,R+=2)}if(L>=0)for(x[L--]=O;L>=0;)x[L--]=0},Math.clz32?a.prototype._countBits=function(x){return 32-Math.clz32(x)}:a.prototype._countBits=function(x){var E=x,L=0;return E>=4096&&(L+=13,E>>>=13),E>=64&&(L+=7,E>>>=7),E>=8&&(L+=4,E>>>=4),E>=2&&(L+=2,E>>>=2),L+E},a.prototype._zeroBits=function(x){if(x===0)return 26;var E=x,L=0;return E&8191||(L+=13,E>>>=13),E&127||(L+=7,E>>>=7),E&15||(L+=4,E>>>=4),E&3||(L+=2,E>>>=2),E&1||L++,L},a.prototype.bitLength=function(){var x=this.words[this.length-1],E=this._countBits(x);return(this.length-1)*26+E};function _(k){for(var x=new Array(k.bitLength()),E=0;E>>O&1}return x}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,E=0;Ex.length?this.clone().ior(x):x.clone().ior(this)},a.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},a.prototype.iuand=function(x){var E;this.length>x.length?E=x:E=this;for(var L=0;Lx.length?this.clone().iand(x):x.clone().iand(this)},a.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},a.prototype.iuxor=function(x){var E,L;this.length>x.length?(E=this,L=x):(E=x,L=this);for(var O=0;Ox.length?this.clone().ixor(x):x.clone().ixor(this)},a.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},a.prototype.inotn=function(x){n(typeof x=="number"&&x>=0);var E=Math.ceil(x/26)|0,L=x%26;this._expand(E),L>0&&E--;for(var O=0;O0&&(this.words[O]=~this.words[O]&67108863>>26-L),this._strip()},a.prototype.notn=function(x){return this.clone().inotn(x)},a.prototype.setn=function(x,E){n(typeof x=="number"&&x>=0);var L=x/26|0,O=x%26;return this._expand(L+1),E?this.words[L]=this.words[L]|1<x.length?(L=this,O=x):(L=x,O=this);for(var P=0,R=0;R>>26;for(;P!==0&&R>>26;if(this.length=L.length,P!==0)this.words[this.length]=P,this.length++;else if(L!==this)for(;Rx.length?this.clone().iadd(x):x.clone().iadd(this)},a.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var E=this.iadd(x);return x.negative=1,E._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var L=this.cmp(x);if(L===0)return this.negative=0,this.length=1,this.words[0]=0,this;var O,P;L>0?(O=this,P=x):(O=x,P=this);for(var R=0,M=0;M>26,this.words[M]=E&67108863;for(;R!==0&&M>26,this.words[M]=E&67108863;if(R===0&&M>>26,le=D&67108863,H=Math.min($,x.length-1),ee=Math.max(0,$-k.length+1);ee<=H;ee++){var J=$-ee|0;O=k.words[J]|0,P=x.words[ee]|0,R=O*P+le,X+=R/67108864|0,le=R&67108863}E.words[$]=le|0,D=X|0}return D!==0?E.words[$]=D|0:E.length--,E._strip()}var b=function(x,E,L){var O=x.words,P=E.words,R=L.words,M=0,D,$,X,le=O[0]|0,H=le&8191,ee=le>>>13,J=O[1]|0,te=J&8191,re=J>>>13,z=O[2]|0,G=z&8191,Z=z>>>13,me=O[3]|0,be=me&8191,Ce=me>>>13,Fe=O[4]|0,Ue=Fe&8191,Ke=Fe>>>13,lt=O[5]|0,Ee=lt&8191,He=lt>>>13,qe=O[6]|0,Ie=qe&8191,Ne=qe>>>13,Pe=O[7]|0,$e=Pe&8191,K=Pe>>>13,F=O[8]|0,W=F&8191,ie=F>>>13,pe=O[9]|0,we=pe&8191,he=pe>>>13,De=P[0]|0,Je=De&8191,et=De>>>13,it=P[1]|0,ut=it&8191,pt=it>>>13,tr=P[2]|0,zt=tr&8191,At=tr>>>13,mt=P[3]|0,St=mt&8191,dt=mt>>>13,Nt=P[4]|0,Rt=Nt&8191,gt=Nt>>>13,qt=P[5]|0,Wt=qt&8191,ot=qt>>>13,Vt=P[6]|0,Ft=Vt&8191,yt=Vt>>>13,Qe=P[7]|0,Pt=Qe&8191,xt=Qe>>>13,Jt=P[8]|0,Cr=Jt&8191,Gt=Jt>>>13,Sr=P[9]|0,cr=Sr&8191,br=Sr>>>13;L.negative=x.negative^E.negative,L.length=19,D=Math.imul(H,Je),$=Math.imul(H,et),$=$+Math.imul(ee,Je)|0,X=Math.imul(ee,et);var Q=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Q>>>26)|0,Q&=67108863,D=Math.imul(te,Je),$=Math.imul(te,et),$=$+Math.imul(re,Je)|0,X=Math.imul(re,et),D=D+Math.imul(H,ut)|0,$=$+Math.imul(H,pt)|0,$=$+Math.imul(ee,ut)|0,X=X+Math.imul(ee,pt)|0;var ae=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ae>>>26)|0,ae&=67108863,D=Math.imul(G,Je),$=Math.imul(G,et),$=$+Math.imul(Z,Je)|0,X=Math.imul(Z,et),D=D+Math.imul(te,ut)|0,$=$+Math.imul(te,pt)|0,$=$+Math.imul(re,ut)|0,X=X+Math.imul(re,pt)|0,D=D+Math.imul(H,zt)|0,$=$+Math.imul(H,At)|0,$=$+Math.imul(ee,zt)|0,X=X+Math.imul(ee,At)|0;var de=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(de>>>26)|0,de&=67108863,D=Math.imul(be,Je),$=Math.imul(be,et),$=$+Math.imul(Ce,Je)|0,X=Math.imul(Ce,et),D=D+Math.imul(G,ut)|0,$=$+Math.imul(G,pt)|0,$=$+Math.imul(Z,ut)|0,X=X+Math.imul(Z,pt)|0,D=D+Math.imul(te,zt)|0,$=$+Math.imul(te,At)|0,$=$+Math.imul(re,zt)|0,X=X+Math.imul(re,At)|0,D=D+Math.imul(H,St)|0,$=$+Math.imul(H,dt)|0,$=$+Math.imul(ee,St)|0,X=X+Math.imul(ee,dt)|0;var ue=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ue>>>26)|0,ue&=67108863,D=Math.imul(Ue,Je),$=Math.imul(Ue,et),$=$+Math.imul(Ke,Je)|0,X=Math.imul(Ke,et),D=D+Math.imul(be,ut)|0,$=$+Math.imul(be,pt)|0,$=$+Math.imul(Ce,ut)|0,X=X+Math.imul(Ce,pt)|0,D=D+Math.imul(G,zt)|0,$=$+Math.imul(G,At)|0,$=$+Math.imul(Z,zt)|0,X=X+Math.imul(Z,At)|0,D=D+Math.imul(te,St)|0,$=$+Math.imul(te,dt)|0,$=$+Math.imul(re,St)|0,X=X+Math.imul(re,dt)|0,D=D+Math.imul(H,Rt)|0,$=$+Math.imul(H,gt)|0,$=$+Math.imul(ee,Rt)|0,X=X+Math.imul(ee,gt)|0;var ve=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ve>>>26)|0,ve&=67108863,D=Math.imul(Ee,Je),$=Math.imul(Ee,et),$=$+Math.imul(He,Je)|0,X=Math.imul(He,et),D=D+Math.imul(Ue,ut)|0,$=$+Math.imul(Ue,pt)|0,$=$+Math.imul(Ke,ut)|0,X=X+Math.imul(Ke,pt)|0,D=D+Math.imul(be,zt)|0,$=$+Math.imul(be,At)|0,$=$+Math.imul(Ce,zt)|0,X=X+Math.imul(Ce,At)|0,D=D+Math.imul(G,St)|0,$=$+Math.imul(G,dt)|0,$=$+Math.imul(Z,St)|0,X=X+Math.imul(Z,dt)|0,D=D+Math.imul(te,Rt)|0,$=$+Math.imul(te,gt)|0,$=$+Math.imul(re,Rt)|0,X=X+Math.imul(re,gt)|0,D=D+Math.imul(H,Wt)|0,$=$+Math.imul(H,ot)|0,$=$+Math.imul(ee,Wt)|0,X=X+Math.imul(ee,ot)|0;var je=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(je>>>26)|0,je&=67108863,D=Math.imul(Ie,Je),$=Math.imul(Ie,et),$=$+Math.imul(Ne,Je)|0,X=Math.imul(Ne,et),D=D+Math.imul(Ee,ut)|0,$=$+Math.imul(Ee,pt)|0,$=$+Math.imul(He,ut)|0,X=X+Math.imul(He,pt)|0,D=D+Math.imul(Ue,zt)|0,$=$+Math.imul(Ue,At)|0,$=$+Math.imul(Ke,zt)|0,X=X+Math.imul(Ke,At)|0,D=D+Math.imul(be,St)|0,$=$+Math.imul(be,dt)|0,$=$+Math.imul(Ce,St)|0,X=X+Math.imul(Ce,dt)|0,D=D+Math.imul(G,Rt)|0,$=$+Math.imul(G,gt)|0,$=$+Math.imul(Z,Rt)|0,X=X+Math.imul(Z,gt)|0,D=D+Math.imul(te,Wt)|0,$=$+Math.imul(te,ot)|0,$=$+Math.imul(re,Wt)|0,X=X+Math.imul(re,ot)|0,D=D+Math.imul(H,Ft)|0,$=$+Math.imul(H,yt)|0,$=$+Math.imul(ee,Ft)|0,X=X+Math.imul(ee,yt)|0;var Ge=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,D=Math.imul($e,Je),$=Math.imul($e,et),$=$+Math.imul(K,Je)|0,X=Math.imul(K,et),D=D+Math.imul(Ie,ut)|0,$=$+Math.imul(Ie,pt)|0,$=$+Math.imul(Ne,ut)|0,X=X+Math.imul(Ne,pt)|0,D=D+Math.imul(Ee,zt)|0,$=$+Math.imul(Ee,At)|0,$=$+Math.imul(He,zt)|0,X=X+Math.imul(He,At)|0,D=D+Math.imul(Ue,St)|0,$=$+Math.imul(Ue,dt)|0,$=$+Math.imul(Ke,St)|0,X=X+Math.imul(Ke,dt)|0,D=D+Math.imul(be,Rt)|0,$=$+Math.imul(be,gt)|0,$=$+Math.imul(Ce,Rt)|0,X=X+Math.imul(Ce,gt)|0,D=D+Math.imul(G,Wt)|0,$=$+Math.imul(G,ot)|0,$=$+Math.imul(Z,Wt)|0,X=X+Math.imul(Z,ot)|0,D=D+Math.imul(te,Ft)|0,$=$+Math.imul(te,yt)|0,$=$+Math.imul(re,Ft)|0,X=X+Math.imul(re,yt)|0,D=D+Math.imul(H,Pt)|0,$=$+Math.imul(H,xt)|0,$=$+Math.imul(ee,Pt)|0,X=X+Math.imul(ee,xt)|0;var Be=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Be>>>26)|0,Be&=67108863,D=Math.imul(W,Je),$=Math.imul(W,et),$=$+Math.imul(ie,Je)|0,X=Math.imul(ie,et),D=D+Math.imul($e,ut)|0,$=$+Math.imul($e,pt)|0,$=$+Math.imul(K,ut)|0,X=X+Math.imul(K,pt)|0,D=D+Math.imul(Ie,zt)|0,$=$+Math.imul(Ie,At)|0,$=$+Math.imul(Ne,zt)|0,X=X+Math.imul(Ne,At)|0,D=D+Math.imul(Ee,St)|0,$=$+Math.imul(Ee,dt)|0,$=$+Math.imul(He,St)|0,X=X+Math.imul(He,dt)|0,D=D+Math.imul(Ue,Rt)|0,$=$+Math.imul(Ue,gt)|0,$=$+Math.imul(Ke,Rt)|0,X=X+Math.imul(Ke,gt)|0,D=D+Math.imul(be,Wt)|0,$=$+Math.imul(be,ot)|0,$=$+Math.imul(Ce,Wt)|0,X=X+Math.imul(Ce,ot)|0,D=D+Math.imul(G,Ft)|0,$=$+Math.imul(G,yt)|0,$=$+Math.imul(Z,Ft)|0,X=X+Math.imul(Z,yt)|0,D=D+Math.imul(te,Pt)|0,$=$+Math.imul(te,xt)|0,$=$+Math.imul(re,Pt)|0,X=X+Math.imul(re,xt)|0,D=D+Math.imul(H,Cr)|0,$=$+Math.imul(H,Gt)|0,$=$+Math.imul(ee,Cr)|0,X=X+Math.imul(ee,Gt)|0;var tt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(tt>>>26)|0,tt&=67108863,D=Math.imul(we,Je),$=Math.imul(we,et),$=$+Math.imul(he,Je)|0,X=Math.imul(he,et),D=D+Math.imul(W,ut)|0,$=$+Math.imul(W,pt)|0,$=$+Math.imul(ie,ut)|0,X=X+Math.imul(ie,pt)|0,D=D+Math.imul($e,zt)|0,$=$+Math.imul($e,At)|0,$=$+Math.imul(K,zt)|0,X=X+Math.imul(K,At)|0,D=D+Math.imul(Ie,St)|0,$=$+Math.imul(Ie,dt)|0,$=$+Math.imul(Ne,St)|0,X=X+Math.imul(Ne,dt)|0,D=D+Math.imul(Ee,Rt)|0,$=$+Math.imul(Ee,gt)|0,$=$+Math.imul(He,Rt)|0,X=X+Math.imul(He,gt)|0,D=D+Math.imul(Ue,Wt)|0,$=$+Math.imul(Ue,ot)|0,$=$+Math.imul(Ke,Wt)|0,X=X+Math.imul(Ke,ot)|0,D=D+Math.imul(be,Ft)|0,$=$+Math.imul(be,yt)|0,$=$+Math.imul(Ce,Ft)|0,X=X+Math.imul(Ce,yt)|0,D=D+Math.imul(G,Pt)|0,$=$+Math.imul(G,xt)|0,$=$+Math.imul(Z,Pt)|0,X=X+Math.imul(Z,xt)|0,D=D+Math.imul(te,Cr)|0,$=$+Math.imul(te,Gt)|0,$=$+Math.imul(re,Cr)|0,X=X+Math.imul(re,Gt)|0,D=D+Math.imul(H,cr)|0,$=$+Math.imul(H,br)|0,$=$+Math.imul(ee,cr)|0,X=X+Math.imul(ee,br)|0;var vt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(vt>>>26)|0,vt&=67108863,D=Math.imul(we,ut),$=Math.imul(we,pt),$=$+Math.imul(he,ut)|0,X=Math.imul(he,pt),D=D+Math.imul(W,zt)|0,$=$+Math.imul(W,At)|0,$=$+Math.imul(ie,zt)|0,X=X+Math.imul(ie,At)|0,D=D+Math.imul($e,St)|0,$=$+Math.imul($e,dt)|0,$=$+Math.imul(K,St)|0,X=X+Math.imul(K,dt)|0,D=D+Math.imul(Ie,Rt)|0,$=$+Math.imul(Ie,gt)|0,$=$+Math.imul(Ne,Rt)|0,X=X+Math.imul(Ne,gt)|0,D=D+Math.imul(Ee,Wt)|0,$=$+Math.imul(Ee,ot)|0,$=$+Math.imul(He,Wt)|0,X=X+Math.imul(He,ot)|0,D=D+Math.imul(Ue,Ft)|0,$=$+Math.imul(Ue,yt)|0,$=$+Math.imul(Ke,Ft)|0,X=X+Math.imul(Ke,yt)|0,D=D+Math.imul(be,Pt)|0,$=$+Math.imul(be,xt)|0,$=$+Math.imul(Ce,Pt)|0,X=X+Math.imul(Ce,xt)|0,D=D+Math.imul(G,Cr)|0,$=$+Math.imul(G,Gt)|0,$=$+Math.imul(Z,Cr)|0,X=X+Math.imul(Z,Gt)|0,D=D+Math.imul(te,cr)|0,$=$+Math.imul(te,br)|0,$=$+Math.imul(re,cr)|0,X=X+Math.imul(re,br)|0;var Lt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,D=Math.imul(we,zt),$=Math.imul(we,At),$=$+Math.imul(he,zt)|0,X=Math.imul(he,At),D=D+Math.imul(W,St)|0,$=$+Math.imul(W,dt)|0,$=$+Math.imul(ie,St)|0,X=X+Math.imul(ie,dt)|0,D=D+Math.imul($e,Rt)|0,$=$+Math.imul($e,gt)|0,$=$+Math.imul(K,Rt)|0,X=X+Math.imul(K,gt)|0,D=D+Math.imul(Ie,Wt)|0,$=$+Math.imul(Ie,ot)|0,$=$+Math.imul(Ne,Wt)|0,X=X+Math.imul(Ne,ot)|0,D=D+Math.imul(Ee,Ft)|0,$=$+Math.imul(Ee,yt)|0,$=$+Math.imul(He,Ft)|0,X=X+Math.imul(He,yt)|0,D=D+Math.imul(Ue,Pt)|0,$=$+Math.imul(Ue,xt)|0,$=$+Math.imul(Ke,Pt)|0,X=X+Math.imul(Ke,xt)|0,D=D+Math.imul(be,Cr)|0,$=$+Math.imul(be,Gt)|0,$=$+Math.imul(Ce,Cr)|0,X=X+Math.imul(Ce,Gt)|0,D=D+Math.imul(G,cr)|0,$=$+Math.imul(G,br)|0,$=$+Math.imul(Z,cr)|0,X=X+Math.imul(Z,br)|0;var Ct=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,D=Math.imul(we,St),$=Math.imul(we,dt),$=$+Math.imul(he,St)|0,X=Math.imul(he,dt),D=D+Math.imul(W,Rt)|0,$=$+Math.imul(W,gt)|0,$=$+Math.imul(ie,Rt)|0,X=X+Math.imul(ie,gt)|0,D=D+Math.imul($e,Wt)|0,$=$+Math.imul($e,ot)|0,$=$+Math.imul(K,Wt)|0,X=X+Math.imul(K,ot)|0,D=D+Math.imul(Ie,Ft)|0,$=$+Math.imul(Ie,yt)|0,$=$+Math.imul(Ne,Ft)|0,X=X+Math.imul(Ne,yt)|0,D=D+Math.imul(Ee,Pt)|0,$=$+Math.imul(Ee,xt)|0,$=$+Math.imul(He,Pt)|0,X=X+Math.imul(He,xt)|0,D=D+Math.imul(Ue,Cr)|0,$=$+Math.imul(Ue,Gt)|0,$=$+Math.imul(Ke,Cr)|0,X=X+Math.imul(Ke,Gt)|0,D=D+Math.imul(be,cr)|0,$=$+Math.imul(be,br)|0,$=$+Math.imul(Ce,cr)|0,X=X+Math.imul(Ce,br)|0;var ir=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ir>>>26)|0,ir&=67108863,D=Math.imul(we,Rt),$=Math.imul(we,gt),$=$+Math.imul(he,Rt)|0,X=Math.imul(he,gt),D=D+Math.imul(W,Wt)|0,$=$+Math.imul(W,ot)|0,$=$+Math.imul(ie,Wt)|0,X=X+Math.imul(ie,ot)|0,D=D+Math.imul($e,Ft)|0,$=$+Math.imul($e,yt)|0,$=$+Math.imul(K,Ft)|0,X=X+Math.imul(K,yt)|0,D=D+Math.imul(Ie,Pt)|0,$=$+Math.imul(Ie,xt)|0,$=$+Math.imul(Ne,Pt)|0,X=X+Math.imul(Ne,xt)|0,D=D+Math.imul(Ee,Cr)|0,$=$+Math.imul(Ee,Gt)|0,$=$+Math.imul(He,Cr)|0,X=X+Math.imul(He,Gt)|0,D=D+Math.imul(Ue,cr)|0,$=$+Math.imul(Ue,br)|0,$=$+Math.imul(Ke,cr)|0,X=X+Math.imul(Ke,br)|0;var Qt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,D=Math.imul(we,Wt),$=Math.imul(we,ot),$=$+Math.imul(he,Wt)|0,X=Math.imul(he,ot),D=D+Math.imul(W,Ft)|0,$=$+Math.imul(W,yt)|0,$=$+Math.imul(ie,Ft)|0,X=X+Math.imul(ie,yt)|0,D=D+Math.imul($e,Pt)|0,$=$+Math.imul($e,xt)|0,$=$+Math.imul(K,Pt)|0,X=X+Math.imul(K,xt)|0,D=D+Math.imul(Ie,Cr)|0,$=$+Math.imul(Ie,Gt)|0,$=$+Math.imul(Ne,Cr)|0,X=X+Math.imul(Ne,Gt)|0,D=D+Math.imul(Ee,cr)|0,$=$+Math.imul(Ee,br)|0,$=$+Math.imul(He,cr)|0,X=X+Math.imul(He,br)|0;var sn=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(sn>>>26)|0,sn&=67108863,D=Math.imul(we,Ft),$=Math.imul(we,yt),$=$+Math.imul(he,Ft)|0,X=Math.imul(he,yt),D=D+Math.imul(W,Pt)|0,$=$+Math.imul(W,xt)|0,$=$+Math.imul(ie,Pt)|0,X=X+Math.imul(ie,xt)|0,D=D+Math.imul($e,Cr)|0,$=$+Math.imul($e,Gt)|0,$=$+Math.imul(K,Cr)|0,X=X+Math.imul(K,Gt)|0,D=D+Math.imul(Ie,cr)|0,$=$+Math.imul(Ie,br)|0,$=$+Math.imul(Ne,cr)|0,X=X+Math.imul(Ne,br)|0;var Rr=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,D=Math.imul(we,Pt),$=Math.imul(we,xt),$=$+Math.imul(he,Pt)|0,X=Math.imul(he,xt),D=D+Math.imul(W,Cr)|0,$=$+Math.imul(W,Gt)|0,$=$+Math.imul(ie,Cr)|0,X=X+Math.imul(ie,Gt)|0,D=D+Math.imul($e,cr)|0,$=$+Math.imul($e,br)|0,$=$+Math.imul(K,cr)|0,X=X+Math.imul(K,br)|0;var dn=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(dn>>>26)|0,dn&=67108863,D=Math.imul(we,Cr),$=Math.imul(we,Gt),$=$+Math.imul(he,Cr)|0,X=Math.imul(he,Gt),D=D+Math.imul(W,cr)|0,$=$+Math.imul(W,br)|0,$=$+Math.imul(ie,cr)|0,X=X+Math.imul(ie,br)|0;var Ga=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,D=Math.imul(we,cr),$=Math.imul(we,br),$=$+Math.imul(he,cr)|0,X=Math.imul(he,br);var ws=(M+D|0)+(($&8191)<<13)|0;return M=(X+($>>>13)|0)+(ws>>>26)|0,ws&=67108863,R[0]=Q,R[1]=ae,R[2]=de,R[3]=ue,R[4]=ve,R[5]=je,R[6]=Ge,R[7]=Be,R[8]=tt,R[9]=vt,R[10]=Lt,R[11]=Ct,R[12]=ir,R[13]=Qt,R[14]=sn,R[15]=Rr,R[16]=dn,R[17]=Ga,R[18]=ws,M!==0&&(R[19]=M,L.length++),L};Math.imul||(b=v);function A(k,x,E){E.negative=x.negative^k.negative,E.length=k.length+x.length;for(var L=0,O=0,P=0;P>>26)|0,O+=R>>>26,R&=67108863}E.words[P]=M,L=R,R=O}return L!==0?E.words[P]=L:E.length--,E._strip()}function S(k,x,E){return A(k,x,E)}a.prototype.mulTo=function(x,E){var L,O=this.length+x.length;return this.length===10&&x.length===10?L=b(this,x,E):O<63?L=v(this,x,E):O<1024?L=A(this,x,E):L=S(this,x,E),L},a.prototype.mul=function(x){var E=new a(null);return E.words=new Array(this.length+x.length),this.mulTo(x,E)},a.prototype.mulf=function(x){var E=new a(null);return E.words=new Array(this.length+x.length),S(this,x,E)},a.prototype.imul=function(x){return this.clone().mulTo(x,this)},a.prototype.imuln=function(x){var E=x<0;E&&(x=-x),n(typeof x=="number"),n(x<67108864);for(var L=0,O=0;O>=26,L+=P/67108864|0,L+=R>>>26,this.words[O]=R&67108863}return L!==0&&(this.words[O]=L,this.length++),E?this.ineg():this},a.prototype.muln=function(x){return this.clone().imuln(x)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(x){var E=_(x);if(E.length===0)return new a(1);for(var L=this,O=0;O=0);var E=x%26,L=(x-E)/26,O=67108863>>>26-E<<26-E,P;if(E!==0){var R=0;for(P=0;P>>26-E}R&&(this.words[P]=R,this.length++)}if(L!==0){for(P=this.length-1;P>=0;P--)this.words[P+L]=this.words[P];for(P=0;P=0);var O;E?O=(E-E%26)/26:O=0;var P=x%26,R=Math.min((x-P)/26,this.length),M=67108863^67108863>>>P<R)for(this.length-=R,$=0;$=0&&(X!==0||$>=O);$--){var le=this.words[$]|0;this.words[$]=X<<26-P|le>>>P,X=le&M}return D&&X!==0&&(D.words[D.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(x,E,L){return n(this.negative===0),this.iushrn(x,E,L)},a.prototype.shln=function(x){return this.clone().ishln(x)},a.prototype.ushln=function(x){return this.clone().iushln(x)},a.prototype.shrn=function(x){return this.clone().ishrn(x)},a.prototype.ushrn=function(x){return this.clone().iushrn(x)},a.prototype.testn=function(x){n(typeof x=="number"&&x>=0);var E=x%26,L=(x-E)/26,O=1<=0);var E=x%26,L=(x-E)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=L)return this;if(E!==0&&L++,this.length=Math.min(L,this.length),E!==0){var O=67108863^67108863>>>E<=67108864;E++)this.words[E]-=67108864,E===this.length-1?this.words[E+1]=1:this.words[E+1]++;return this.length=Math.max(this.length,E+1),this},a.prototype.isubn=function(x){if(n(typeof x=="number"),n(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var E=0;E>26)-(D/67108864|0),this.words[P+L]=R&67108863}for(;P>26,this.words[P+L]=R&67108863;if(M===0)return this._strip();for(n(M===-1),M=0,P=0;P>26,this.words[P]=R&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(x,E){var L=this.length-x.length,O=this.clone(),P=x,R=P.words[P.length-1]|0,M=this._countBits(R);L=26-M,L!==0&&(P=P.ushln(L),O.iushln(L),R=P.words[P.length-1]|0);var D=O.length-P.length,$;if(E!=="mod"){$=new a(null),$.length=D+1,$.words=new Array($.length);for(var X=0;X<$.length;X++)$.words[X]=0}var le=O.clone()._ishlnsubmul(P,1,D);le.negative===0&&(O=le,$&&($.words[D]=1));for(var H=D-1;H>=0;H--){var ee=(O.words[P.length+H]|0)*67108864+(O.words[P.length+H-1]|0);for(ee=Math.min(ee/R|0,67108863),O._ishlnsubmul(P,ee,H);O.negative!==0;)ee--,O.negative=0,O._ishlnsubmul(P,1,H),O.isZero()||(O.negative^=1);$&&($.words[H]=ee)}return $&&$._strip(),O._strip(),E!=="div"&&L!==0&&O.iushrn(L),{div:$||null,mod:O}},a.prototype.divmod=function(x,E,L){if(n(!x.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var O,P,R;return this.negative!==0&&x.negative===0?(R=this.neg().divmod(x,E),E!=="mod"&&(O=R.div.neg()),E!=="div"&&(P=R.mod.neg(),L&&P.negative!==0&&P.iadd(x)),{div:O,mod:P}):this.negative===0&&x.negative!==0?(R=this.divmod(x.neg(),E),E!=="mod"&&(O=R.div.neg()),{div:O,mod:R.mod}):this.negative&x.negative?(R=this.neg().divmod(x.neg(),E),E!=="div"&&(P=R.mod.neg(),L&&P.negative!==0&&P.isub(x)),{div:R.div,mod:P}):x.length>this.length||this.cmp(x)<0?{div:new a(0),mod:this}:x.length===1?E==="div"?{div:this.divn(x.words[0]),mod:null}:E==="mod"?{div:null,mod:new a(this.modrn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new a(this.modrn(x.words[0]))}:this._wordDiv(x,E)},a.prototype.div=function(x){return this.divmod(x,"div",!1).div},a.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},a.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},a.prototype.divRound=function(x){var E=this.divmod(x);if(E.mod.isZero())return E.div;var L=E.div.negative!==0?E.mod.isub(x):E.mod,O=x.ushrn(1),P=x.andln(1),R=L.cmp(O);return R<0||P===1&&R===0?E.div:E.div.negative!==0?E.div.isubn(1):E.div.iaddn(1)},a.prototype.modrn=function(x){var E=x<0;E&&(x=-x),n(x<=67108863);for(var L=(1<<26)%x,O=0,P=this.length-1;P>=0;P--)O=(L*O+(this.words[P]|0))%x;return E?-O:O},a.prototype.modn=function(x){return this.modrn(x)},a.prototype.idivn=function(x){var E=x<0;E&&(x=-x),n(x<=67108863);for(var L=0,O=this.length-1;O>=0;O--){var P=(this.words[O]|0)+L*67108864;this.words[O]=P/x|0,L=P%x}return this._strip(),E?this.ineg():this},a.prototype.divn=function(x){return this.clone().idivn(x)},a.prototype.egcd=function(x){n(x.negative===0),n(!x.isZero());var E=this,L=x.clone();E.negative!==0?E=E.umod(x):E=E.clone();for(var O=new a(1),P=new a(0),R=new a(0),M=new a(1),D=0;E.isEven()&&L.isEven();)E.iushrn(1),L.iushrn(1),++D;for(var $=L.clone(),X=E.clone();!E.isZero();){for(var le=0,H=1;!(E.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(E.iushrn(le);le-- >0;)(O.isOdd()||P.isOdd())&&(O.iadd($),P.isub(X)),O.iushrn(1),P.iushrn(1);for(var ee=0,J=1;!(L.words[0]&J)&&ee<26;++ee,J<<=1);if(ee>0)for(L.iushrn(ee);ee-- >0;)(R.isOdd()||M.isOdd())&&(R.iadd($),M.isub(X)),R.iushrn(1),M.iushrn(1);E.cmp(L)>=0?(E.isub(L),O.isub(R),P.isub(M)):(L.isub(E),R.isub(O),M.isub(P))}return{a:R,b:M,gcd:L.iushln(D)}},a.prototype._invmp=function(x){n(x.negative===0),n(!x.isZero());var E=this,L=x.clone();E.negative!==0?E=E.umod(x):E=E.clone();for(var O=new a(1),P=new a(0),R=L.clone();E.cmpn(1)>0&&L.cmpn(1)>0;){for(var M=0,D=1;!(E.words[0]&D)&&M<26;++M,D<<=1);if(M>0)for(E.iushrn(M);M-- >0;)O.isOdd()&&O.iadd(R),O.iushrn(1);for(var $=0,X=1;!(L.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(L.iushrn($);$-- >0;)P.isOdd()&&P.iadd(R),P.iushrn(1);E.cmp(L)>=0?(E.isub(L),O.isub(P)):(L.isub(E),P.isub(O))}var le;return E.cmpn(1)===0?le=O:le=P,le.cmpn(0)<0&&le.iadd(x),le},a.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var E=this.clone(),L=x.clone();E.negative=0,L.negative=0;for(var O=0;E.isEven()&&L.isEven();O++)E.iushrn(1),L.iushrn(1);do{for(;E.isEven();)E.iushrn(1);for(;L.isEven();)L.iushrn(1);var P=E.cmp(L);if(P<0){var R=E;E=L,L=R}else if(P===0||L.cmpn(1)===0)break;E.isub(L)}while(!0);return L.iushln(O)},a.prototype.invm=function(x){return this.egcd(x).a.umod(x)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(x){return this.words[0]&x},a.prototype.bincn=function(x){n(typeof x=="number");var E=x%26,L=(x-E)/26,O=1<>>26,M&=67108863,this.words[R]=M}return P!==0&&(this.words[R]=P,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(x){var E=x<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;this._strip();var L;if(this.length>1)L=1;else{E&&(x=-x),n(x<=67108863,"Number is too big");var O=this.words[0]|0;L=O===x?0:Ox.length)return 1;if(this.length=0;L--){var O=this.words[L]|0,P=x.words[L]|0;if(O!==P){OP&&(E=1);break}}return E},a.prototype.gtn=function(x){return this.cmpn(x)===1},a.prototype.gt=function(x){return this.cmp(x)===1},a.prototype.gten=function(x){return this.cmpn(x)>=0},a.prototype.gte=function(x){return this.cmp(x)>=0},a.prototype.ltn=function(x){return this.cmpn(x)===-1},a.prototype.lt=function(x){return this.cmp(x)===-1},a.prototype.lten=function(x){return this.cmpn(x)<=0},a.prototype.lte=function(x){return this.cmp(x)<=0},a.prototype.eqn=function(x){return this.cmpn(x)===0},a.prototype.eq=function(x){return this.cmp(x)===0},a.red=function(x){return new Y(x)},a.prototype.toRed=function(x){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(x){return this.red=x,this},a.prototype.forceRed=function(x){return n(!this.red,"Already a number in reduction context"),this._forceRed(x)},a.prototype.redAdd=function(x){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},a.prototype.redIAdd=function(x){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},a.prototype.redSub=function(x){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},a.prototype.redISub=function(x){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},a.prototype.redShl=function(x){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},a.prototype.redMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},a.prototype.redIMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(x){return n(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var j={k256:null,p224:null,p192:null,p25519:null};function U(k,x){this.name=k,this.p=new a(x,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}U.prototype._tmp=function(){var x=new a(null);return x.words=new Array(Math.ceil(this.n/13)),x},U.prototype.ireduce=function(x){var E=x,L;do this.split(E,this.tmp),E=this.imulK(E),E=E.iadd(this.tmp),L=E.bitLength();while(L>this.n);var O=L0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},U.prototype.split=function(x,E){x.iushrn(this.n,0,E)},U.prototype.imulK=function(x){return x.imul(this.k)};function I(){U.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(I,U),I.prototype.split=function(x,E){for(var L=4194303,O=Math.min(x.length,9),P=0;P>>22,R=M}R>>>=22,x.words[P-10]=R,R===0&&x.length>10?x.length-=10:x.length-=9},I.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var E=0,L=0;L>>=26,x.words[L]=P,E=O}return E!==0&&(x.words[x.length++]=E),x},a._prime=function(x){if(j[x])return j[x];var E;if(x==="k256")E=new I;else if(x==="p224")E=new B;else if(x==="p192")E=new V;else if(x==="p25519")E=new se;else throw new Error("Unknown prime "+x);return j[x]=E,E};function Y(k){if(typeof k=="string"){var x=a._prime(k);this.m=x.p,this.prime=x}else n(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Y.prototype._verify1=function(x){n(x.negative===0,"red works only with positives"),n(x.red,"red works only with red numbers")},Y.prototype._verify2=function(x,E){n((x.negative|E.negative)===0,"red works only with positives"),n(x.red&&x.red===E.red,"red works only with red numbers")},Y.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):(u(x,x.umod(this.m)._forceRed(this)),x)},Y.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},Y.prototype.add=function(x,E){this._verify2(x,E);var L=x.add(E);return L.cmp(this.m)>=0&&L.isub(this.m),L._forceRed(this)},Y.prototype.iadd=function(x,E){this._verify2(x,E);var L=x.iadd(E);return L.cmp(this.m)>=0&&L.isub(this.m),L},Y.prototype.sub=function(x,E){this._verify2(x,E);var L=x.sub(E);return L.cmpn(0)<0&&L.iadd(this.m),L._forceRed(this)},Y.prototype.isub=function(x,E){this._verify2(x,E);var L=x.isub(E);return L.cmpn(0)<0&&L.iadd(this.m),L},Y.prototype.shl=function(x,E){return this._verify1(x),this.imod(x.ushln(E))},Y.prototype.imul=function(x,E){return this._verify2(x,E),this.imod(x.imul(E))},Y.prototype.mul=function(x,E){return this._verify2(x,E),this.imod(x.mul(E))},Y.prototype.isqr=function(x){return this.imul(x,x.clone())},Y.prototype.sqr=function(x){return this.mul(x,x)},Y.prototype.sqrt=function(x){if(x.isZero())return x.clone();var E=this.m.andln(3);if(n(E%2===1),E===3){var L=this.m.add(new a(1)).iushrn(2);return this.pow(x,L)}for(var O=this.m.subn(1),P=0;!O.isZero()&&O.andln(1)===0;)P++,O.iushrn(1);n(!O.isZero());var R=new a(1).toRed(this),M=R.redNeg(),D=this.m.subn(1).iushrn(1),$=this.m.bitLength();for($=new a(2*$*$).toRed(this);this.pow($,D).cmp(M)!==0;)$.redIAdd(M);for(var X=this.pow($,O),le=this.pow(x,O.addn(1).iushrn(1)),H=this.pow(x,O),ee=P;H.cmp(R)!==0;){for(var J=H,te=0;J.cmp(R)!==0;te++)J=J.redSqr();n(te=0;P--){for(var X=E.words[P],le=$-1;le>=0;le--){var H=X>>le&1;if(R!==O[0]&&(R=this.sqr(R)),H===0&&M===0){D=0;continue}M<<=1,M|=H,D++,!(D!==L&&(P!==0||le!==0))&&(R=this.mul(R,O[M]),D=0,M=0)}$=26}return R},Y.prototype.convertTo=function(x){var E=x.umod(this.m);return E===x?E.clone():E},Y.prototype.convertFrom=function(x){var E=x.clone();return E.red=null,E},a.mont=function(x){return new N(x)};function N(k){Y.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(N,Y),N.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},N.prototype.convertFrom=function(x){var E=this.imod(x.mul(this.rinv));return E.red=null,E},N.prototype.imul=function(x,E){if(x.isZero()||E.isZero())return x.words[0]=0,x.length=1,x;var L=x.imul(E),O=L.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=L.isub(O).iushrn(this.shift),R=P;return P.cmp(this.m)>=0?R=P.isub(this.m):P.cmpn(0)<0&&(R=P.iadd(this.m)),R._forceRed(this)},N.prototype.mul=function(x,E){if(x.isZero()||E.isZero())return new a(0)._forceRed(this);var L=x.mul(E),O=L.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=L.isub(O).iushrn(this.shift),R=P;return P.cmp(this.m)>=0?R=P.isub(this.m):P.cmpn(0)<0&&(R=P.iadd(this.m)),R._forceRed(this)},N.prototype.invm=function(x){var E=this.imod(x._invmp(this.m).mul(this.r2));return E._forceRed(this)}})(t,Xt)})(uN);var uye=uN.exports;const yr=To(uye),rK="bignumber/5.7.0";var m5=yr.BN;const nd=new Le(rK),G_={},sO=9007199254740991;function dye(t){return t!=null&&(nt.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Kr(t)||typeof t=="bigint"||cm(t))}let oO=!1;class nt{constructor(e,r){e!==G_&&nd.throwError("cannot call constructor directly; use BigNumber.from",Le.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Cs(Or(this).fromTwos(e))}toTwos(e){return Cs(Or(this).toTwos(e))}abs(){return this._hex[0]==="-"?nt.from(this._hex.substring(1)):this}add(e){return Cs(Or(this).add(Or(e)))}sub(e){return Cs(Or(this).sub(Or(e)))}div(e){return nt.from(e).isZero()&&Vo("division-by-zero","div"),Cs(Or(this).div(Or(e)))}mul(e){return Cs(Or(this).mul(Or(e)))}mod(e){const r=Or(e);return r.isNeg()&&Vo("division-by-zero","mod"),Cs(Or(this).umod(r))}pow(e){const r=Or(e);return r.isNeg()&&Vo("negative-power","pow"),Cs(Or(this).pow(r))}and(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Vo("unbound-bitwise-result","and"),Cs(Or(this).and(r))}or(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Vo("unbound-bitwise-result","or"),Cs(Or(this).or(r))}xor(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Vo("unbound-bitwise-result","xor"),Cs(Or(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Vo("negative-width","mask"),Cs(Or(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Vo("negative-width","shl"),Cs(Or(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Vo("negative-width","shr"),Cs(Or(this).shrn(e))}eq(e){return Or(this).eq(Or(e))}lt(e){return Or(this).lt(Or(e))}lte(e){return Or(this).lte(Or(e))}gt(e){return Or(this).gt(Or(e))}gte(e){return Or(this).gte(Or(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Or(this).isZero()}toNumber(){try{return Or(this).toNumber()}catch{Vo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return nd.throwError("this platform does not support BigInt",Le.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?oO||(oO=!0,nd.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?nd.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Le.errors.UNEXPECTED_ARGUMENT,{}):nd.throwError("BigNumber.toString does not accept parameters",Le.errors.UNEXPECTED_ARGUMENT,{})),Or(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof nt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new nt(G_,l3(e)):e.match(/^-?[0-9]+$/)?new nt(G_,l3(new m5(e))):nd.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Vo("underflow","BigNumber.from",e),(e>=sO||e<=-sO)&&Vo("overflow","BigNumber.from",e),nt.from(String(e));const r=e;if(typeof r=="bigint")return nt.from(r.toString());if(cm(r))return nt.from(Bt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return nt.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(Kr(n)||n[0]==="-"&&Kr(n.substring(1))))return nt.from(n)}return nd.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function l3(t){if(typeof t!="string")return l3(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&nd.throwArgumentError("invalid hex","value",t),t=l3(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function Cs(t){return nt.from(l3(t))}function Or(t){const e=nt.from(t).toHexString();return e[0]==="-"?new m5("-"+e.substring(3),16):new m5(e.substring(2),16)}function Vo(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),nd.throwError(t,Le.errors.NUMERIC_FAULT,n)}function fye(t){return new m5(t,36).toString(16)}const ts=new Le(rK),_y={},nK=nt.from(0),iK=nt.from(-1);function aK(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),ts.throwError(t,Le.errors.NUMERIC_FAULT,i)}let Cy="0";for(;Cy.length<256;)Cy+=Cy;function dN(t){if(typeof t!="number")try{t=nt.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+Cy.substring(0,t):ts.throwArgumentError("invalid decimal size","decimals",t)}function s6(t,e){e==null&&(e=0);const r=dN(e);t=nt.from(t);const n=t.lt(nK);n&&(t=t.mul(iK));let i=t.mod(r).toString();for(;i.length2&&ts.throwArgumentError("too many decimal points","value",t);let a=i[0],s=i[1];for(a||(a="0"),s||(s="0");s[s.length-1]==="0";)s=s.substring(0,s.length-1);for(s.length>r.length-1&&aK("fractional component exceeds decimals","underflow","parseFixed"),s===""&&(s="0");s.lengthe[s]==null?l:(typeof e[s]!==o&&ts.throwArgumentError("invalid fixed format ("+s+" not "+o+")","format."+s,e[s]),e[s]);r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&ts.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&ts.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new ag(_y,r,n,i)}}class pa{constructor(e,r,n,i){e!==_y&&ts.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Le.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ts.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Fc(this._value,this.format.decimals),n=Fc(e._value,e.format.decimals);return pa.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Fc(this._value,this.format.decimals),n=Fc(e._value,e.format.decimals);return pa.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Fc(this._value,this.format.decimals),n=Fc(e._value,e.format.decimals);return pa.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Fc(this._value,this.format.decimals),n=Fc(e._value,e.format.decimals);return pa.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=pa.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(lO.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=pa.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(lO.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&ts.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=pa.from("1"+Cy.substring(0,e),this.format),i=hye.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&ts.throwArgumentError("invalid byte width","width",e);const r=nt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Bn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return pa.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!dye(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),pa.fromString(s6(e,r),ag.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=ag.from(r),i=Fc(e,n.decimals);!n.signed&&i.lt(nK)&&aK("unsigned value cannot be negative","overflow","value",e);let a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=Bn(a,n.width/8));const s=s6(i,n.decimals);return new pa(_y,a,s,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=ag.from(r);if(er(e).length>n.width/8)throw new Error("overflow");let i=nt.from(e);n.signed&&(i=i.fromTwos(n.width));const a=i.toTwos((n.signed?0:1)+n.width).toHexString(),s=s6(i,n.decimals);return new pa(_y,a,s,n)}static from(e,r){if(typeof e=="string")return pa.fromString(e,r);if(cm(e))return pa.fromBytes(e,r);try{return pa.fromValue(e,0,r)}catch(n){if(n.code!==Le.errors.INVALID_ARGUMENT)throw n}return ts.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const lO=pa.from(1),hye=pa.from("0.5");var sK={exports:{}};/** + */const Cye="6";try{window.__reactRouterVersion=Cye}catch{}const Sye="startTransition",cO=X6[Sye];function Aye(t){let{basename:e,children:r,future:n,window:i}=t,a=_.useRef();a.current==null&&(a.current=tye({window:i,v5Compat:!0}));let s=a.current,[o,l]=_.useState({action:s.action,location:s.location}),{v7_startTransition:c}=n||{},u=_.useCallback(f=>{c&&cO?cO(()=>l(f)):l(f)},[l,c]);return _.useLayoutEffect(()=>s.listen(u),[s,u]),_.useEffect(()=>Eye(n),[n]),_.createElement(_ye,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:s,future:n})}var uO;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(uO||(uO={}));var dO;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(dO||(dO={}));const Iye="modulepreload",Mye=function(t){return"/"+t},fO={},qs=function(e,r,n){let i=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));i=Promise.allSettled(r.map(l=>{if(l=Mye(l),l in fO)return;fO[l]=!0;const c=l.endsWith(".css"),u=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const f=document.createElement("link");if(f.rel=c?"stylesheet":Iye,c||(f.as="script"),f.crossOrigin="",f.href=l,o&&f.setAttribute("nonce",o),document.head.appendChild(f),c)return new Promise((h,g)=>{f.addEventListener("load",h),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${l}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return i.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})},Tye="logger/5.7.0";let hO=!1,pO=!1;const p6={debug:1,default:2,info:2,warning:3,error:4,off:5};let gO=p6.default,Z_=null;function kye(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(t){return t.message}return null}const mO=kye();var AI;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(AI||(AI={}));var ka;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(ka||(ka={}));const yO="0123456789abcdef";let De=class ki{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const n=e.toLowerCase();p6[n]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(gO>p6[n])&&console.log.apply(console,r)}debug(...e){this._log(ki.levels.DEBUG,e)}info(...e){this._log(ki.levels.INFO,e)}warn(...e){this._log(ki.levels.WARNING,e)}makeError(e,r,n){if(pO)return this.makeError("censored error",r,{});r||(r=ki.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(l=>{const c=n[l];try{if(c instanceof Uint8Array){let u="";for(let f=0;f>4],u+=yO[c[f]&15];i.push(l+"=Uint8Array(0x"+u+")")}else i.push(l+"="+JSON.stringify(c))}catch{i.push(l+"="+JSON.stringify(n[l].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=e;let s="";switch(r){case ka.NUMERIC_FAULT:{s="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":s+="-"+l;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case ka.CALL_EXCEPTION:case ka.INSUFFICIENT_FUNDS:case ka.MISSING_NEW:case ka.NONCE_EXPIRED:case ka.REPLACEMENT_UNDERPRICED:case ka.TRANSACTION_REPLACED:case ka.UNPREDICTABLE_GAS_LIMIT:s=r;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),i.length&&(e+=" ("+i.join(", ")+")");const o=new Error(e);return o.reason=a,o.code=r,Object.keys(n).forEach(function(l){o[l]=n[l]}),o}throwError(e,r,n){throw this.makeError(e,r,n)}throwArgumentError(e,r,n){return this.throwError(e,ki.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,r,n,i){e||this.throwError(r,n,i)}assertArgument(e,r,n,i){e||this.throwArgumentError(r,n,i)}checkNormalize(e){mO&&this.throwError("platform missing String.prototype.normalize",ki.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:mO})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,ki.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,ki.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,n){n?n=": "+n:n="",er&&this.throwError("too many arguments"+n,ki.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",ki.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",ki.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",ki.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return Z_||(Z_=new ki(Tye)),Z_}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",ki.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),hO){if(!e)return;this.globalLogger().throwError("error censorship permanent",ki.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}pO=!!e,hO=!!r}static setLogLevel(e){const r=p6[e.toLowerCase()];if(r==null){ki.globalLogger().warn("invalid log level - "+e);return}gO=r}static from(e){return new ki(e)}};De.errors=ka;De.levels=AI;const Nye="bytes/5.7.0",ni=new De(Nye);function EK(t){return!!t.toHexString}function dg(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return dg(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function vN(t){return Kr(t)&&!(t.length%2)||ym(t)}function wO(t){return typeof t=="number"&&t==t&&t%1===0}function ym(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!wO(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function er(t,e){if(e||(e={}),typeof t=="number"){ni.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),dg(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),EK(t)&&(t=t.toHexString()),Kr(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":ni.throwArgumentError("hex data is odd-length","value",t));const n=[];for(let i=0;ier(i)),r=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(r);return e.reduce((i,a)=>(n.set(a,i),i+a.length),0),dg(n)}function V0(t){let e=er(t);if(e.length===0)return e;let r=0;for(;re&&ni.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),dg(r)}function Kr(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const X_="0123456789abcdef";function Bt(t,e){if(e||(e={}),typeof t=="number"){ni.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=X_[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),EK(t))return t.toHexString();if(Kr(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":ni.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(ym(t)){let r="0x";for(let n=0;n>4]+X_[i&15]}return r}return ni.throwArgumentError("invalid hexlify value","value",t)}function Y0(t){if(typeof t!="string")t=Bt(t);else if(!Kr(t)||t.length%2)return null;return(t.length-2)/2}function Na(t,e,r){return typeof t!="string"?t=Bt(t):(!Kr(t)||t.length%2)&&ni.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Ds(t){let e="0x";return t.forEach(r=>{e+=Bt(r).substring(2)}),e}function bN(t){const e=jye(Bt(t,{hexPad:"left"}));return e==="0x"?"0x0":e}function jye(t){typeof t!="string"&&(t=Bt(t)),Kr(t)||ni.throwArgumentError("invalid hex string","value",t),t=t.substring(2);let e=0;for(;e2*e+2&&ni.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function c9(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(vN(t)){let r=er(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=Bt(r.slice(0,32)),e.s=Bt(r.slice(32,64))):r.length===65?(e.r=Bt(r.slice(0,32)),e.s=Bt(r.slice(32,64)),e.v=r[64]):ni.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:ni.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=Bt(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const i=Lye(er(e._vs),32);e._vs=Bt(i);const a=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=a:e.recoveryParam!==a&&ni.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;const s=Bt(i);e.s==null?e.s=s:e.s!==s&&ni.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?ni.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&ni.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Kr(e.r)?ni.throwArgumentError("signature missing or invalid r","signature",t):e.r=Bn(e.r,32),e.s==null||!Kr(e.s)?ni.throwArgumentError("signature missing or invalid s","signature",t):e.s=Bn(e.s,32);const r=er(e.s);r[0]>=128&&ni.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const n=Bt(r);e._vs&&(Kr(e._vs)||ni.throwArgumentError("signature invalid _vs","signature",t),e._vs=Bn(e._vs,32)),e._vs==null?e._vs=n:e._vs!==n&&ni.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}var xN={exports:{}};const $ye={},Pye=Object.freeze(Object.defineProperty({__proto__:null,default:$ye},Symbol.toStringTag,{value:"Module"})),wm=wh(Pye);xN.exports;(function(t){(function(e,r){function n(k,x){if(!k)throw new Error(x||"Assertion failed")}function i(k,x){k.super_=x;var E=function(){};E.prototype=x.prototype,k.prototype=new E,k.prototype.constructor=k}function a(k,x,E){if(a.isBN(k))return k;this.negative=0,this.words=null,this.length=0,this.red=null,k!==null&&((x==="le"||x==="be")&&(E=x,x=10),this._init(k||0,x||10,E||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=wm.Buffer}catch{}a.isBN=function(x){return x instanceof a?!0:x!==null&&typeof x=="object"&&x.constructor.wordSize===a.wordSize&&Array.isArray(x.words)},a.max=function(x,E){return x.cmp(E)>0?x:E},a.min=function(x,E){return x.cmp(E)<0?x:E},a.prototype._init=function(x,E,L){if(typeof x=="number")return this._initNumber(x,E,L);if(typeof x=="object")return this._initArray(x,E,L);E==="hex"&&(E=16),n(E===(E|0)&&E>=2&&E<=36),x=x.toString().replace(/\s+/g,"");var O=0;x[0]==="-"&&(O++,this.negative=1),O=0;O-=3)R=x[O]|x[O-1]<<8|x[O-2]<<16,this.words[P]|=R<>>26-M&67108863,M+=24,M>=26&&(M-=26,P++);else if(L==="le")for(O=0,P=0;O>>26-M&67108863,M+=24,M>=26&&(M-=26,P++);return this._strip()};function o(k,x){var E=k.charCodeAt(x);if(E>=48&&E<=57)return E-48;if(E>=65&&E<=70)return E-55;if(E>=97&&E<=102)return E-87;n(!1,"Invalid character in "+k)}function l(k,x,E){var L=o(k,E);return E-1>=x&&(L|=o(k,E-1)<<4),L}a.prototype._parseHex=function(x,E,L){this.length=Math.ceil((x.length-E)/6),this.words=new Array(this.length);for(var O=0;O=E;O-=2)M=l(x,E,O)<=18?(P-=18,R+=1,this.words[R]|=M>>>26):P+=8;else{var D=x.length-E;for(O=D%2===0?E+1:E;O=18?(P-=18,R+=1,this.words[R]|=M>>>26):P+=8}this._strip()};function c(k,x,E,L){for(var O=0,P=0,R=Math.min(k.length,E),M=x;M=49?P=D-49+10:D>=17?P=D-17+10:P=D,n(D>=0&&P1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{a.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch{a.prototype.inspect=f}else a.prototype.inspect=f;function f(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(x,E){x=x||10,E=E|0||1;var L;if(x===16||x==="hex"){L="";for(var O=0,P=0,R=0;R>>24-O&16777215,O+=2,O>=26&&(O-=26,R--),P!==0||R!==this.length-1?L=h[6-D.length]+D+L:L=D+L}for(P!==0&&(L=P.toString(16)+L);L.length%E!==0;)L="0"+L;return this.negative!==0&&(L="-"+L),L}if(x===(x|0)&&x>=2&&x<=36){var $=g[x],X=m[x];L="";var le=this.clone();for(le.negative=0;!le.isZero();){var H=le.modrn(X).toString(x);le=le.idivn(X),le.isZero()?L=H+L:L=h[$-H.length]+H+L}for(this.isZero()&&(L="0"+L);L.length%E!==0;)L="0"+L;return this.negative!==0&&(L="-"+L),L}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var x=this.words[0];return this.length===2?x+=this.words[1]*67108864:this.length===3&&this.words[2]===1?x+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-x:x},a.prototype.toJSON=function(){return this.toString(16,2)},s&&(a.prototype.toBuffer=function(x,E){return this.toArrayLike(s,x,E)}),a.prototype.toArray=function(x,E){return this.toArrayLike(Array,x,E)};var w=function(x,E){return x.allocUnsafe?x.allocUnsafe(E):new x(E)};a.prototype.toArrayLike=function(x,E,L){this._strip();var O=this.byteLength(),P=L||Math.max(1,O);n(O<=P,"byte array longer than desired length"),n(P>0,"Requested array length <= 0");var R=w(x,P),M=E==="le"?"LE":"BE";return this["_toArrayLike"+M](R,O),R},a.prototype._toArrayLikeLE=function(x,E){for(var L=0,O=0,P=0,R=0;P>8&255),L>16&255),R===6?(L>24&255),O=0,R=0):(O=M>>>24,R+=2)}if(L=0&&(x[L--]=M>>8&255),L>=0&&(x[L--]=M>>16&255),R===6?(L>=0&&(x[L--]=M>>24&255),O=0,R=0):(O=M>>>24,R+=2)}if(L>=0)for(x[L--]=O;L>=0;)x[L--]=0},Math.clz32?a.prototype._countBits=function(x){return 32-Math.clz32(x)}:a.prototype._countBits=function(x){var E=x,L=0;return E>=4096&&(L+=13,E>>>=13),E>=64&&(L+=7,E>>>=7),E>=8&&(L+=4,E>>>=4),E>=2&&(L+=2,E>>>=2),L+E},a.prototype._zeroBits=function(x){if(x===0)return 26;var E=x,L=0;return E&8191||(L+=13,E>>>=13),E&127||(L+=7,E>>>=7),E&15||(L+=4,E>>>=4),E&3||(L+=2,E>>>=2),E&1||L++,L},a.prototype.bitLength=function(){var x=this.words[this.length-1],E=this._countBits(x);return(this.length-1)*26+E};function C(k){for(var x=new Array(k.bitLength()),E=0;E>>O&1}return x}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var x=0,E=0;Ex.length?this.clone().ior(x):x.clone().ior(this)},a.prototype.uor=function(x){return this.length>x.length?this.clone().iuor(x):x.clone().iuor(this)},a.prototype.iuand=function(x){var E;this.length>x.length?E=x:E=this;for(var L=0;Lx.length?this.clone().iand(x):x.clone().iand(this)},a.prototype.uand=function(x){return this.length>x.length?this.clone().iuand(x):x.clone().iuand(this)},a.prototype.iuxor=function(x){var E,L;this.length>x.length?(E=this,L=x):(E=x,L=this);for(var O=0;Ox.length?this.clone().ixor(x):x.clone().ixor(this)},a.prototype.uxor=function(x){return this.length>x.length?this.clone().iuxor(x):x.clone().iuxor(this)},a.prototype.inotn=function(x){n(typeof x=="number"&&x>=0);var E=Math.ceil(x/26)|0,L=x%26;this._expand(E),L>0&&E--;for(var O=0;O0&&(this.words[O]=~this.words[O]&67108863>>26-L),this._strip()},a.prototype.notn=function(x){return this.clone().inotn(x)},a.prototype.setn=function(x,E){n(typeof x=="number"&&x>=0);var L=x/26|0,O=x%26;return this._expand(L+1),E?this.words[L]=this.words[L]|1<x.length?(L=this,O=x):(L=x,O=this);for(var P=0,R=0;R>>26;for(;P!==0&&R>>26;if(this.length=L.length,P!==0)this.words[this.length]=P,this.length++;else if(L!==this)for(;Rx.length?this.clone().iadd(x):x.clone().iadd(this)},a.prototype.isub=function(x){if(x.negative!==0){x.negative=0;var E=this.iadd(x);return x.negative=1,E._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(x),this.negative=1,this._normSign();var L=this.cmp(x);if(L===0)return this.negative=0,this.length=1,this.words[0]=0,this;var O,P;L>0?(O=this,P=x):(O=x,P=this);for(var R=0,M=0;M>26,this.words[M]=E&67108863;for(;R!==0&&M>26,this.words[M]=E&67108863;if(R===0&&M>>26,le=D&67108863,H=Math.min($,x.length-1),ee=Math.max(0,$-k.length+1);ee<=H;ee++){var J=$-ee|0;O=k.words[J]|0,P=x.words[ee]|0,R=O*P+le,X+=R/67108864|0,le=R&67108863}E.words[$]=le|0,D=X|0}return D!==0?E.words[$]=D|0:E.length--,E._strip()}var b=function(x,E,L){var O=x.words,P=E.words,R=L.words,M=0,D,$,X,le=O[0]|0,H=le&8191,ee=le>>>13,J=O[1]|0,te=J&8191,re=J>>>13,z=O[2]|0,G=z&8191,Q=z>>>13,me=O[3]|0,be=me&8191,Ce=me>>>13,Fe=O[4]|0,Ue=Fe&8191,Ke=Fe>>>13,lt=O[5]|0,Ee=lt&8191,He=lt>>>13,qe=O[6]|0,Ie=qe&8191,Ne=qe>>>13,$e=O[7]|0,je=$e&8191,K=$e>>>13,U=O[8]|0,W=U&8191,ie=U>>>13,pe=O[9]|0,we=pe&8191,he=pe>>>13,Re=P[0]|0,Je=Re&8191,et=Re>>>13,it=P[1]|0,ut=it&8191,pt=it>>>13,tr=P[2]|0,zt=tr&8191,At=tr>>>13,mt=P[3]|0,St=mt&8191,dt=mt>>>13,Nt=P[4]|0,Rt=Nt&8191,gt=Nt>>>13,qt=P[5]|0,Wt=qt&8191,ot=qt>>>13,Vt=P[6]|0,Ft=Vt&8191,yt=Vt>>>13,Ze=P[7]|0,Pt=Ze&8191,xt=Ze>>>13,Jt=P[8]|0,Cr=Jt&8191,Gt=Jt>>>13,Sr=P[9]|0,cr=Sr&8191,br=Sr>>>13;L.negative=x.negative^E.negative,L.length=19,D=Math.imul(H,Je),$=Math.imul(H,et),$=$+Math.imul(ee,Je)|0,X=Math.imul(ee,et);var Z=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Z>>>26)|0,Z&=67108863,D=Math.imul(te,Je),$=Math.imul(te,et),$=$+Math.imul(re,Je)|0,X=Math.imul(re,et),D=D+Math.imul(H,ut)|0,$=$+Math.imul(H,pt)|0,$=$+Math.imul(ee,ut)|0,X=X+Math.imul(ee,pt)|0;var ae=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ae>>>26)|0,ae&=67108863,D=Math.imul(G,Je),$=Math.imul(G,et),$=$+Math.imul(Q,Je)|0,X=Math.imul(Q,et),D=D+Math.imul(te,ut)|0,$=$+Math.imul(te,pt)|0,$=$+Math.imul(re,ut)|0,X=X+Math.imul(re,pt)|0,D=D+Math.imul(H,zt)|0,$=$+Math.imul(H,At)|0,$=$+Math.imul(ee,zt)|0,X=X+Math.imul(ee,At)|0;var de=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(de>>>26)|0,de&=67108863,D=Math.imul(be,Je),$=Math.imul(be,et),$=$+Math.imul(Ce,Je)|0,X=Math.imul(Ce,et),D=D+Math.imul(G,ut)|0,$=$+Math.imul(G,pt)|0,$=$+Math.imul(Q,ut)|0,X=X+Math.imul(Q,pt)|0,D=D+Math.imul(te,zt)|0,$=$+Math.imul(te,At)|0,$=$+Math.imul(re,zt)|0,X=X+Math.imul(re,At)|0,D=D+Math.imul(H,St)|0,$=$+Math.imul(H,dt)|0,$=$+Math.imul(ee,St)|0,X=X+Math.imul(ee,dt)|0;var ue=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ue>>>26)|0,ue&=67108863,D=Math.imul(Ue,Je),$=Math.imul(Ue,et),$=$+Math.imul(Ke,Je)|0,X=Math.imul(Ke,et),D=D+Math.imul(be,ut)|0,$=$+Math.imul(be,pt)|0,$=$+Math.imul(Ce,ut)|0,X=X+Math.imul(Ce,pt)|0,D=D+Math.imul(G,zt)|0,$=$+Math.imul(G,At)|0,$=$+Math.imul(Q,zt)|0,X=X+Math.imul(Q,At)|0,D=D+Math.imul(te,St)|0,$=$+Math.imul(te,dt)|0,$=$+Math.imul(re,St)|0,X=X+Math.imul(re,dt)|0,D=D+Math.imul(H,Rt)|0,$=$+Math.imul(H,gt)|0,$=$+Math.imul(ee,Rt)|0,X=X+Math.imul(ee,gt)|0;var ve=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ve>>>26)|0,ve&=67108863,D=Math.imul(Ee,Je),$=Math.imul(Ee,et),$=$+Math.imul(He,Je)|0,X=Math.imul(He,et),D=D+Math.imul(Ue,ut)|0,$=$+Math.imul(Ue,pt)|0,$=$+Math.imul(Ke,ut)|0,X=X+Math.imul(Ke,pt)|0,D=D+Math.imul(be,zt)|0,$=$+Math.imul(be,At)|0,$=$+Math.imul(Ce,zt)|0,X=X+Math.imul(Ce,At)|0,D=D+Math.imul(G,St)|0,$=$+Math.imul(G,dt)|0,$=$+Math.imul(Q,St)|0,X=X+Math.imul(Q,dt)|0,D=D+Math.imul(te,Rt)|0,$=$+Math.imul(te,gt)|0,$=$+Math.imul(re,Rt)|0,X=X+Math.imul(re,gt)|0,D=D+Math.imul(H,Wt)|0,$=$+Math.imul(H,ot)|0,$=$+Math.imul(ee,Wt)|0,X=X+Math.imul(ee,ot)|0;var Le=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Le>>>26)|0,Le&=67108863,D=Math.imul(Ie,Je),$=Math.imul(Ie,et),$=$+Math.imul(Ne,Je)|0,X=Math.imul(Ne,et),D=D+Math.imul(Ee,ut)|0,$=$+Math.imul(Ee,pt)|0,$=$+Math.imul(He,ut)|0,X=X+Math.imul(He,pt)|0,D=D+Math.imul(Ue,zt)|0,$=$+Math.imul(Ue,At)|0,$=$+Math.imul(Ke,zt)|0,X=X+Math.imul(Ke,At)|0,D=D+Math.imul(be,St)|0,$=$+Math.imul(be,dt)|0,$=$+Math.imul(Ce,St)|0,X=X+Math.imul(Ce,dt)|0,D=D+Math.imul(G,Rt)|0,$=$+Math.imul(G,gt)|0,$=$+Math.imul(Q,Rt)|0,X=X+Math.imul(Q,gt)|0,D=D+Math.imul(te,Wt)|0,$=$+Math.imul(te,ot)|0,$=$+Math.imul(re,Wt)|0,X=X+Math.imul(re,ot)|0,D=D+Math.imul(H,Ft)|0,$=$+Math.imul(H,yt)|0,$=$+Math.imul(ee,Ft)|0,X=X+Math.imul(ee,yt)|0;var Ge=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,D=Math.imul(je,Je),$=Math.imul(je,et),$=$+Math.imul(K,Je)|0,X=Math.imul(K,et),D=D+Math.imul(Ie,ut)|0,$=$+Math.imul(Ie,pt)|0,$=$+Math.imul(Ne,ut)|0,X=X+Math.imul(Ne,pt)|0,D=D+Math.imul(Ee,zt)|0,$=$+Math.imul(Ee,At)|0,$=$+Math.imul(He,zt)|0,X=X+Math.imul(He,At)|0,D=D+Math.imul(Ue,St)|0,$=$+Math.imul(Ue,dt)|0,$=$+Math.imul(Ke,St)|0,X=X+Math.imul(Ke,dt)|0,D=D+Math.imul(be,Rt)|0,$=$+Math.imul(be,gt)|0,$=$+Math.imul(Ce,Rt)|0,X=X+Math.imul(Ce,gt)|0,D=D+Math.imul(G,Wt)|0,$=$+Math.imul(G,ot)|0,$=$+Math.imul(Q,Wt)|0,X=X+Math.imul(Q,ot)|0,D=D+Math.imul(te,Ft)|0,$=$+Math.imul(te,yt)|0,$=$+Math.imul(re,Ft)|0,X=X+Math.imul(re,yt)|0,D=D+Math.imul(H,Pt)|0,$=$+Math.imul(H,xt)|0,$=$+Math.imul(ee,Pt)|0,X=X+Math.imul(ee,xt)|0;var Be=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Be>>>26)|0,Be&=67108863,D=Math.imul(W,Je),$=Math.imul(W,et),$=$+Math.imul(ie,Je)|0,X=Math.imul(ie,et),D=D+Math.imul(je,ut)|0,$=$+Math.imul(je,pt)|0,$=$+Math.imul(K,ut)|0,X=X+Math.imul(K,pt)|0,D=D+Math.imul(Ie,zt)|0,$=$+Math.imul(Ie,At)|0,$=$+Math.imul(Ne,zt)|0,X=X+Math.imul(Ne,At)|0,D=D+Math.imul(Ee,St)|0,$=$+Math.imul(Ee,dt)|0,$=$+Math.imul(He,St)|0,X=X+Math.imul(He,dt)|0,D=D+Math.imul(Ue,Rt)|0,$=$+Math.imul(Ue,gt)|0,$=$+Math.imul(Ke,Rt)|0,X=X+Math.imul(Ke,gt)|0,D=D+Math.imul(be,Wt)|0,$=$+Math.imul(be,ot)|0,$=$+Math.imul(Ce,Wt)|0,X=X+Math.imul(Ce,ot)|0,D=D+Math.imul(G,Ft)|0,$=$+Math.imul(G,yt)|0,$=$+Math.imul(Q,Ft)|0,X=X+Math.imul(Q,yt)|0,D=D+Math.imul(te,Pt)|0,$=$+Math.imul(te,xt)|0,$=$+Math.imul(re,Pt)|0,X=X+Math.imul(re,xt)|0,D=D+Math.imul(H,Cr)|0,$=$+Math.imul(H,Gt)|0,$=$+Math.imul(ee,Cr)|0,X=X+Math.imul(ee,Gt)|0;var tt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(tt>>>26)|0,tt&=67108863,D=Math.imul(we,Je),$=Math.imul(we,et),$=$+Math.imul(he,Je)|0,X=Math.imul(he,et),D=D+Math.imul(W,ut)|0,$=$+Math.imul(W,pt)|0,$=$+Math.imul(ie,ut)|0,X=X+Math.imul(ie,pt)|0,D=D+Math.imul(je,zt)|0,$=$+Math.imul(je,At)|0,$=$+Math.imul(K,zt)|0,X=X+Math.imul(K,At)|0,D=D+Math.imul(Ie,St)|0,$=$+Math.imul(Ie,dt)|0,$=$+Math.imul(Ne,St)|0,X=X+Math.imul(Ne,dt)|0,D=D+Math.imul(Ee,Rt)|0,$=$+Math.imul(Ee,gt)|0,$=$+Math.imul(He,Rt)|0,X=X+Math.imul(He,gt)|0,D=D+Math.imul(Ue,Wt)|0,$=$+Math.imul(Ue,ot)|0,$=$+Math.imul(Ke,Wt)|0,X=X+Math.imul(Ke,ot)|0,D=D+Math.imul(be,Ft)|0,$=$+Math.imul(be,yt)|0,$=$+Math.imul(Ce,Ft)|0,X=X+Math.imul(Ce,yt)|0,D=D+Math.imul(G,Pt)|0,$=$+Math.imul(G,xt)|0,$=$+Math.imul(Q,Pt)|0,X=X+Math.imul(Q,xt)|0,D=D+Math.imul(te,Cr)|0,$=$+Math.imul(te,Gt)|0,$=$+Math.imul(re,Cr)|0,X=X+Math.imul(re,Gt)|0,D=D+Math.imul(H,cr)|0,$=$+Math.imul(H,br)|0,$=$+Math.imul(ee,cr)|0,X=X+Math.imul(ee,br)|0;var vt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(vt>>>26)|0,vt&=67108863,D=Math.imul(we,ut),$=Math.imul(we,pt),$=$+Math.imul(he,ut)|0,X=Math.imul(he,pt),D=D+Math.imul(W,zt)|0,$=$+Math.imul(W,At)|0,$=$+Math.imul(ie,zt)|0,X=X+Math.imul(ie,At)|0,D=D+Math.imul(je,St)|0,$=$+Math.imul(je,dt)|0,$=$+Math.imul(K,St)|0,X=X+Math.imul(K,dt)|0,D=D+Math.imul(Ie,Rt)|0,$=$+Math.imul(Ie,gt)|0,$=$+Math.imul(Ne,Rt)|0,X=X+Math.imul(Ne,gt)|0,D=D+Math.imul(Ee,Wt)|0,$=$+Math.imul(Ee,ot)|0,$=$+Math.imul(He,Wt)|0,X=X+Math.imul(He,ot)|0,D=D+Math.imul(Ue,Ft)|0,$=$+Math.imul(Ue,yt)|0,$=$+Math.imul(Ke,Ft)|0,X=X+Math.imul(Ke,yt)|0,D=D+Math.imul(be,Pt)|0,$=$+Math.imul(be,xt)|0,$=$+Math.imul(Ce,Pt)|0,X=X+Math.imul(Ce,xt)|0,D=D+Math.imul(G,Cr)|0,$=$+Math.imul(G,Gt)|0,$=$+Math.imul(Q,Cr)|0,X=X+Math.imul(Q,Gt)|0,D=D+Math.imul(te,cr)|0,$=$+Math.imul(te,br)|0,$=$+Math.imul(re,cr)|0,X=X+Math.imul(re,br)|0;var Lt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,D=Math.imul(we,zt),$=Math.imul(we,At),$=$+Math.imul(he,zt)|0,X=Math.imul(he,At),D=D+Math.imul(W,St)|0,$=$+Math.imul(W,dt)|0,$=$+Math.imul(ie,St)|0,X=X+Math.imul(ie,dt)|0,D=D+Math.imul(je,Rt)|0,$=$+Math.imul(je,gt)|0,$=$+Math.imul(K,Rt)|0,X=X+Math.imul(K,gt)|0,D=D+Math.imul(Ie,Wt)|0,$=$+Math.imul(Ie,ot)|0,$=$+Math.imul(Ne,Wt)|0,X=X+Math.imul(Ne,ot)|0,D=D+Math.imul(Ee,Ft)|0,$=$+Math.imul(Ee,yt)|0,$=$+Math.imul(He,Ft)|0,X=X+Math.imul(He,yt)|0,D=D+Math.imul(Ue,Pt)|0,$=$+Math.imul(Ue,xt)|0,$=$+Math.imul(Ke,Pt)|0,X=X+Math.imul(Ke,xt)|0,D=D+Math.imul(be,Cr)|0,$=$+Math.imul(be,Gt)|0,$=$+Math.imul(Ce,Cr)|0,X=X+Math.imul(Ce,Gt)|0,D=D+Math.imul(G,cr)|0,$=$+Math.imul(G,br)|0,$=$+Math.imul(Q,cr)|0,X=X+Math.imul(Q,br)|0;var Ct=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,D=Math.imul(we,St),$=Math.imul(we,dt),$=$+Math.imul(he,St)|0,X=Math.imul(he,dt),D=D+Math.imul(W,Rt)|0,$=$+Math.imul(W,gt)|0,$=$+Math.imul(ie,Rt)|0,X=X+Math.imul(ie,gt)|0,D=D+Math.imul(je,Wt)|0,$=$+Math.imul(je,ot)|0,$=$+Math.imul(K,Wt)|0,X=X+Math.imul(K,ot)|0,D=D+Math.imul(Ie,Ft)|0,$=$+Math.imul(Ie,yt)|0,$=$+Math.imul(Ne,Ft)|0,X=X+Math.imul(Ne,yt)|0,D=D+Math.imul(Ee,Pt)|0,$=$+Math.imul(Ee,xt)|0,$=$+Math.imul(He,Pt)|0,X=X+Math.imul(He,xt)|0,D=D+Math.imul(Ue,Cr)|0,$=$+Math.imul(Ue,Gt)|0,$=$+Math.imul(Ke,Cr)|0,X=X+Math.imul(Ke,Gt)|0,D=D+Math.imul(be,cr)|0,$=$+Math.imul(be,br)|0,$=$+Math.imul(Ce,cr)|0,X=X+Math.imul(Ce,br)|0;var ir=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(ir>>>26)|0,ir&=67108863,D=Math.imul(we,Rt),$=Math.imul(we,gt),$=$+Math.imul(he,Rt)|0,X=Math.imul(he,gt),D=D+Math.imul(W,Wt)|0,$=$+Math.imul(W,ot)|0,$=$+Math.imul(ie,Wt)|0,X=X+Math.imul(ie,ot)|0,D=D+Math.imul(je,Ft)|0,$=$+Math.imul(je,yt)|0,$=$+Math.imul(K,Ft)|0,X=X+Math.imul(K,yt)|0,D=D+Math.imul(Ie,Pt)|0,$=$+Math.imul(Ie,xt)|0,$=$+Math.imul(Ne,Pt)|0,X=X+Math.imul(Ne,xt)|0,D=D+Math.imul(Ee,Cr)|0,$=$+Math.imul(Ee,Gt)|0,$=$+Math.imul(He,Cr)|0,X=X+Math.imul(He,Gt)|0,D=D+Math.imul(Ue,cr)|0,$=$+Math.imul(Ue,br)|0,$=$+Math.imul(Ke,cr)|0,X=X+Math.imul(Ke,br)|0;var Zt=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,D=Math.imul(we,Wt),$=Math.imul(we,ot),$=$+Math.imul(he,Wt)|0,X=Math.imul(he,ot),D=D+Math.imul(W,Ft)|0,$=$+Math.imul(W,yt)|0,$=$+Math.imul(ie,Ft)|0,X=X+Math.imul(ie,yt)|0,D=D+Math.imul(je,Pt)|0,$=$+Math.imul(je,xt)|0,$=$+Math.imul(K,Pt)|0,X=X+Math.imul(K,xt)|0,D=D+Math.imul(Ie,Cr)|0,$=$+Math.imul(Ie,Gt)|0,$=$+Math.imul(Ne,Cr)|0,X=X+Math.imul(Ne,Gt)|0,D=D+Math.imul(Ee,cr)|0,$=$+Math.imul(Ee,br)|0,$=$+Math.imul(He,cr)|0,X=X+Math.imul(He,br)|0;var sn=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(sn>>>26)|0,sn&=67108863,D=Math.imul(we,Ft),$=Math.imul(we,yt),$=$+Math.imul(he,Ft)|0,X=Math.imul(he,yt),D=D+Math.imul(W,Pt)|0,$=$+Math.imul(W,xt)|0,$=$+Math.imul(ie,Pt)|0,X=X+Math.imul(ie,xt)|0,D=D+Math.imul(je,Cr)|0,$=$+Math.imul(je,Gt)|0,$=$+Math.imul(K,Cr)|0,X=X+Math.imul(K,Gt)|0,D=D+Math.imul(Ie,cr)|0,$=$+Math.imul(Ie,br)|0,$=$+Math.imul(Ne,cr)|0,X=X+Math.imul(Ne,br)|0;var Rr=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,D=Math.imul(we,Pt),$=Math.imul(we,xt),$=$+Math.imul(he,Pt)|0,X=Math.imul(he,xt),D=D+Math.imul(W,Cr)|0,$=$+Math.imul(W,Gt)|0,$=$+Math.imul(ie,Cr)|0,X=X+Math.imul(ie,Gt)|0,D=D+Math.imul(je,cr)|0,$=$+Math.imul(je,br)|0,$=$+Math.imul(K,cr)|0,X=X+Math.imul(K,br)|0;var dn=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(dn>>>26)|0,dn&=67108863,D=Math.imul(we,Cr),$=Math.imul(we,Gt),$=$+Math.imul(he,Cr)|0,X=Math.imul(he,Gt),D=D+Math.imul(W,cr)|0,$=$+Math.imul(W,br)|0,$=$+Math.imul(ie,cr)|0,X=X+Math.imul(ie,br)|0;var qa=(M+D|0)+(($&8191)<<13)|0;M=(X+($>>>13)|0)+(qa>>>26)|0,qa&=67108863,D=Math.imul(we,cr),$=Math.imul(we,br),$=$+Math.imul(he,cr)|0,X=Math.imul(he,br);var bs=(M+D|0)+(($&8191)<<13)|0;return M=(X+($>>>13)|0)+(bs>>>26)|0,bs&=67108863,R[0]=Z,R[1]=ae,R[2]=de,R[3]=ue,R[4]=ve,R[5]=Le,R[6]=Ge,R[7]=Be,R[8]=tt,R[9]=vt,R[10]=Lt,R[11]=Ct,R[12]=ir,R[13]=Zt,R[14]=sn,R[15]=Rr,R[16]=dn,R[17]=qa,R[18]=bs,M!==0&&(R[19]=M,L.length++),L};Math.imul||(b=v);function A(k,x,E){E.negative=x.negative^k.negative,E.length=k.length+x.length;for(var L=0,O=0,P=0;P>>26)|0,O+=R>>>26,R&=67108863}E.words[P]=M,L=R,R=O}return L!==0?E.words[P]=L:E.length--,E._strip()}function S(k,x,E){return A(k,x,E)}a.prototype.mulTo=function(x,E){var L,O=this.length+x.length;return this.length===10&&x.length===10?L=b(this,x,E):O<63?L=v(this,x,E):O<1024?L=A(this,x,E):L=S(this,x,E),L},a.prototype.mul=function(x){var E=new a(null);return E.words=new Array(this.length+x.length),this.mulTo(x,E)},a.prototype.mulf=function(x){var E=new a(null);return E.words=new Array(this.length+x.length),S(this,x,E)},a.prototype.imul=function(x){return this.clone().mulTo(x,this)},a.prototype.imuln=function(x){var E=x<0;E&&(x=-x),n(typeof x=="number"),n(x<67108864);for(var L=0,O=0;O>=26,L+=P/67108864|0,L+=R>>>26,this.words[O]=R&67108863}return L!==0&&(this.words[O]=L,this.length++),E?this.ineg():this},a.prototype.muln=function(x){return this.clone().imuln(x)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(x){var E=C(x);if(E.length===0)return new a(1);for(var L=this,O=0;O=0);var E=x%26,L=(x-E)/26,O=67108863>>>26-E<<26-E,P;if(E!==0){var R=0;for(P=0;P>>26-E}R&&(this.words[P]=R,this.length++)}if(L!==0){for(P=this.length-1;P>=0;P--)this.words[P+L]=this.words[P];for(P=0;P=0);var O;E?O=(E-E%26)/26:O=0;var P=x%26,R=Math.min((x-P)/26,this.length),M=67108863^67108863>>>P<R)for(this.length-=R,$=0;$=0&&(X!==0||$>=O);$--){var le=this.words[$]|0;this.words[$]=X<<26-P|le>>>P,X=le&M}return D&&X!==0&&(D.words[D.length++]=X),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},a.prototype.ishrn=function(x,E,L){return n(this.negative===0),this.iushrn(x,E,L)},a.prototype.shln=function(x){return this.clone().ishln(x)},a.prototype.ushln=function(x){return this.clone().iushln(x)},a.prototype.shrn=function(x){return this.clone().ishrn(x)},a.prototype.ushrn=function(x){return this.clone().iushrn(x)},a.prototype.testn=function(x){n(typeof x=="number"&&x>=0);var E=x%26,L=(x-E)/26,O=1<=0);var E=x%26,L=(x-E)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=L)return this;if(E!==0&&L++,this.length=Math.min(L,this.length),E!==0){var O=67108863^67108863>>>E<=67108864;E++)this.words[E]-=67108864,E===this.length-1?this.words[E+1]=1:this.words[E+1]++;return this.length=Math.max(this.length,E+1),this},a.prototype.isubn=function(x){if(n(typeof x=="number"),n(x<67108864),x<0)return this.iaddn(-x);if(this.negative!==0)return this.negative=0,this.iaddn(x),this.negative=1,this;if(this.words[0]-=x,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var E=0;E>26)-(D/67108864|0),this.words[P+L]=R&67108863}for(;P>26,this.words[P+L]=R&67108863;if(M===0)return this._strip();for(n(M===-1),M=0,P=0;P>26,this.words[P]=R&67108863;return this.negative=1,this._strip()},a.prototype._wordDiv=function(x,E){var L=this.length-x.length,O=this.clone(),P=x,R=P.words[P.length-1]|0,M=this._countBits(R);L=26-M,L!==0&&(P=P.ushln(L),O.iushln(L),R=P.words[P.length-1]|0);var D=O.length-P.length,$;if(E!=="mod"){$=new a(null),$.length=D+1,$.words=new Array($.length);for(var X=0;X<$.length;X++)$.words[X]=0}var le=O.clone()._ishlnsubmul(P,1,D);le.negative===0&&(O=le,$&&($.words[D]=1));for(var H=D-1;H>=0;H--){var ee=(O.words[P.length+H]|0)*67108864+(O.words[P.length+H-1]|0);for(ee=Math.min(ee/R|0,67108863),O._ishlnsubmul(P,ee,H);O.negative!==0;)ee--,O.negative=0,O._ishlnsubmul(P,1,H),O.isZero()||(O.negative^=1);$&&($.words[H]=ee)}return $&&$._strip(),O._strip(),E!=="div"&&L!==0&&O.iushrn(L),{div:$||null,mod:O}},a.prototype.divmod=function(x,E,L){if(n(!x.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var O,P,R;return this.negative!==0&&x.negative===0?(R=this.neg().divmod(x,E),E!=="mod"&&(O=R.div.neg()),E!=="div"&&(P=R.mod.neg(),L&&P.negative!==0&&P.iadd(x)),{div:O,mod:P}):this.negative===0&&x.negative!==0?(R=this.divmod(x.neg(),E),E!=="mod"&&(O=R.div.neg()),{div:O,mod:R.mod}):this.negative&x.negative?(R=this.neg().divmod(x.neg(),E),E!=="div"&&(P=R.mod.neg(),L&&P.negative!==0&&P.isub(x)),{div:R.div,mod:P}):x.length>this.length||this.cmp(x)<0?{div:new a(0),mod:this}:x.length===1?E==="div"?{div:this.divn(x.words[0]),mod:null}:E==="mod"?{div:null,mod:new a(this.modrn(x.words[0]))}:{div:this.divn(x.words[0]),mod:new a(this.modrn(x.words[0]))}:this._wordDiv(x,E)},a.prototype.div=function(x){return this.divmod(x,"div",!1).div},a.prototype.mod=function(x){return this.divmod(x,"mod",!1).mod},a.prototype.umod=function(x){return this.divmod(x,"mod",!0).mod},a.prototype.divRound=function(x){var E=this.divmod(x);if(E.mod.isZero())return E.div;var L=E.div.negative!==0?E.mod.isub(x):E.mod,O=x.ushrn(1),P=x.andln(1),R=L.cmp(O);return R<0||P===1&&R===0?E.div:E.div.negative!==0?E.div.isubn(1):E.div.iaddn(1)},a.prototype.modrn=function(x){var E=x<0;E&&(x=-x),n(x<=67108863);for(var L=(1<<26)%x,O=0,P=this.length-1;P>=0;P--)O=(L*O+(this.words[P]|0))%x;return E?-O:O},a.prototype.modn=function(x){return this.modrn(x)},a.prototype.idivn=function(x){var E=x<0;E&&(x=-x),n(x<=67108863);for(var L=0,O=this.length-1;O>=0;O--){var P=(this.words[O]|0)+L*67108864;this.words[O]=P/x|0,L=P%x}return this._strip(),E?this.ineg():this},a.prototype.divn=function(x){return this.clone().idivn(x)},a.prototype.egcd=function(x){n(x.negative===0),n(!x.isZero());var E=this,L=x.clone();E.negative!==0?E=E.umod(x):E=E.clone();for(var O=new a(1),P=new a(0),R=new a(0),M=new a(1),D=0;E.isEven()&&L.isEven();)E.iushrn(1),L.iushrn(1),++D;for(var $=L.clone(),X=E.clone();!E.isZero();){for(var le=0,H=1;!(E.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(E.iushrn(le);le-- >0;)(O.isOdd()||P.isOdd())&&(O.iadd($),P.isub(X)),O.iushrn(1),P.iushrn(1);for(var ee=0,J=1;!(L.words[0]&J)&&ee<26;++ee,J<<=1);if(ee>0)for(L.iushrn(ee);ee-- >0;)(R.isOdd()||M.isOdd())&&(R.iadd($),M.isub(X)),R.iushrn(1),M.iushrn(1);E.cmp(L)>=0?(E.isub(L),O.isub(R),P.isub(M)):(L.isub(E),R.isub(O),M.isub(P))}return{a:R,b:M,gcd:L.iushln(D)}},a.prototype._invmp=function(x){n(x.negative===0),n(!x.isZero());var E=this,L=x.clone();E.negative!==0?E=E.umod(x):E=E.clone();for(var O=new a(1),P=new a(0),R=L.clone();E.cmpn(1)>0&&L.cmpn(1)>0;){for(var M=0,D=1;!(E.words[0]&D)&&M<26;++M,D<<=1);if(M>0)for(E.iushrn(M);M-- >0;)O.isOdd()&&O.iadd(R),O.iushrn(1);for(var $=0,X=1;!(L.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(L.iushrn($);$-- >0;)P.isOdd()&&P.iadd(R),P.iushrn(1);E.cmp(L)>=0?(E.isub(L),O.isub(P)):(L.isub(E),P.isub(O))}var le;return E.cmpn(1)===0?le=O:le=P,le.cmpn(0)<0&&le.iadd(x),le},a.prototype.gcd=function(x){if(this.isZero())return x.abs();if(x.isZero())return this.abs();var E=this.clone(),L=x.clone();E.negative=0,L.negative=0;for(var O=0;E.isEven()&&L.isEven();O++)E.iushrn(1),L.iushrn(1);do{for(;E.isEven();)E.iushrn(1);for(;L.isEven();)L.iushrn(1);var P=E.cmp(L);if(P<0){var R=E;E=L,L=R}else if(P===0||L.cmpn(1)===0)break;E.isub(L)}while(!0);return L.iushln(O)},a.prototype.invm=function(x){return this.egcd(x).a.umod(x)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(x){return this.words[0]&x},a.prototype.bincn=function(x){n(typeof x=="number");var E=x%26,L=(x-E)/26,O=1<>>26,M&=67108863,this.words[R]=M}return P!==0&&(this.words[R]=P,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(x){var E=x<0;if(this.negative!==0&&!E)return-1;if(this.negative===0&&E)return 1;this._strip();var L;if(this.length>1)L=1;else{E&&(x=-x),n(x<=67108863,"Number is too big");var O=this.words[0]|0;L=O===x?0:Ox.length)return 1;if(this.length=0;L--){var O=this.words[L]|0,P=x.words[L]|0;if(O!==P){OP&&(E=1);break}}return E},a.prototype.gtn=function(x){return this.cmpn(x)===1},a.prototype.gt=function(x){return this.cmp(x)===1},a.prototype.gten=function(x){return this.cmpn(x)>=0},a.prototype.gte=function(x){return this.cmp(x)>=0},a.prototype.ltn=function(x){return this.cmpn(x)===-1},a.prototype.lt=function(x){return this.cmp(x)===-1},a.prototype.lten=function(x){return this.cmpn(x)<=0},a.prototype.lte=function(x){return this.cmp(x)<=0},a.prototype.eqn=function(x){return this.cmpn(x)===0},a.prototype.eq=function(x){return this.cmp(x)===0},a.red=function(x){return new Y(x)},a.prototype.toRed=function(x){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),x.convertTo(this)._forceRed(x)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(x){return this.red=x,this},a.prototype.forceRed=function(x){return n(!this.red,"Already a number in reduction context"),this._forceRed(x)},a.prototype.redAdd=function(x){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,x)},a.prototype.redIAdd=function(x){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,x)},a.prototype.redSub=function(x){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,x)},a.prototype.redISub=function(x){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,x)},a.prototype.redShl=function(x){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,x)},a.prototype.redMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.mul(this,x)},a.prototype.redIMul=function(x){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,x),this.red.imul(this,x)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(x){return n(this.red&&!x.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,x)};var j={k256:null,p224:null,p192:null,p25519:null};function F(k,x){this.name=k,this.p=new a(x,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}F.prototype._tmp=function(){var x=new a(null);return x.words=new Array(Math.ceil(this.n/13)),x},F.prototype.ireduce=function(x){var E=x,L;do this.split(E,this.tmp),E=this.imulK(E),E=E.iadd(this.tmp),L=E.bitLength();while(L>this.n);var O=L0?E.isub(this.p):E.strip!==void 0?E.strip():E._strip(),E},F.prototype.split=function(x,E){x.iushrn(this.n,0,E)},F.prototype.imulK=function(x){return x.imul(this.k)};function I(){F.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(I,F),I.prototype.split=function(x,E){for(var L=4194303,O=Math.min(x.length,9),P=0;P>>22,R=M}R>>>=22,x.words[P-10]=R,R===0&&x.length>10?x.length-=10:x.length-=9},I.prototype.imulK=function(x){x.words[x.length]=0,x.words[x.length+1]=0,x.length+=2;for(var E=0,L=0;L>>=26,x.words[L]=P,E=O}return E!==0&&(x.words[x.length++]=E),x},a._prime=function(x){if(j[x])return j[x];var E;if(x==="k256")E=new I;else if(x==="p224")E=new B;else if(x==="p192")E=new V;else if(x==="p25519")E=new se;else throw new Error("Unknown prime "+x);return j[x]=E,E};function Y(k){if(typeof k=="string"){var x=a._prime(k);this.m=x.p,this.prime=x}else n(k.gtn(1),"modulus must be greater than 1"),this.m=k,this.prime=null}Y.prototype._verify1=function(x){n(x.negative===0,"red works only with positives"),n(x.red,"red works only with red numbers")},Y.prototype._verify2=function(x,E){n((x.negative|E.negative)===0,"red works only with positives"),n(x.red&&x.red===E.red,"red works only with red numbers")},Y.prototype.imod=function(x){return this.prime?this.prime.ireduce(x)._forceRed(this):(u(x,x.umod(this.m)._forceRed(this)),x)},Y.prototype.neg=function(x){return x.isZero()?x.clone():this.m.sub(x)._forceRed(this)},Y.prototype.add=function(x,E){this._verify2(x,E);var L=x.add(E);return L.cmp(this.m)>=0&&L.isub(this.m),L._forceRed(this)},Y.prototype.iadd=function(x,E){this._verify2(x,E);var L=x.iadd(E);return L.cmp(this.m)>=0&&L.isub(this.m),L},Y.prototype.sub=function(x,E){this._verify2(x,E);var L=x.sub(E);return L.cmpn(0)<0&&L.iadd(this.m),L._forceRed(this)},Y.prototype.isub=function(x,E){this._verify2(x,E);var L=x.isub(E);return L.cmpn(0)<0&&L.iadd(this.m),L},Y.prototype.shl=function(x,E){return this._verify1(x),this.imod(x.ushln(E))},Y.prototype.imul=function(x,E){return this._verify2(x,E),this.imod(x.imul(E))},Y.prototype.mul=function(x,E){return this._verify2(x,E),this.imod(x.mul(E))},Y.prototype.isqr=function(x){return this.imul(x,x.clone())},Y.prototype.sqr=function(x){return this.mul(x,x)},Y.prototype.sqrt=function(x){if(x.isZero())return x.clone();var E=this.m.andln(3);if(n(E%2===1),E===3){var L=this.m.add(new a(1)).iushrn(2);return this.pow(x,L)}for(var O=this.m.subn(1),P=0;!O.isZero()&&O.andln(1)===0;)P++,O.iushrn(1);n(!O.isZero());var R=new a(1).toRed(this),M=R.redNeg(),D=this.m.subn(1).iushrn(1),$=this.m.bitLength();for($=new a(2*$*$).toRed(this);this.pow($,D).cmp(M)!==0;)$.redIAdd(M);for(var X=this.pow($,O),le=this.pow(x,O.addn(1).iushrn(1)),H=this.pow(x,O),ee=P;H.cmp(R)!==0;){for(var J=H,te=0;J.cmp(R)!==0;te++)J=J.redSqr();n(te=0;P--){for(var X=E.words[P],le=$-1;le>=0;le--){var H=X>>le&1;if(R!==O[0]&&(R=this.sqr(R)),H===0&&M===0){D=0;continue}M<<=1,M|=H,D++,!(D!==L&&(P!==0||le!==0))&&(R=this.mul(R,O[M]),D=0,M=0)}$=26}return R},Y.prototype.convertTo=function(x){var E=x.umod(this.m);return E===x?E.clone():E},Y.prototype.convertFrom=function(x){var E=x.clone();return E.red=null,E},a.mont=function(x){return new N(x)};function N(k){Y.call(this,k),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(N,Y),N.prototype.convertTo=function(x){return this.imod(x.ushln(this.shift))},N.prototype.convertFrom=function(x){var E=this.imod(x.mul(this.rinv));return E.red=null,E},N.prototype.imul=function(x,E){if(x.isZero()||E.isZero())return x.words[0]=0,x.length=1,x;var L=x.imul(E),O=L.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=L.isub(O).iushrn(this.shift),R=P;return P.cmp(this.m)>=0?R=P.isub(this.m):P.cmpn(0)<0&&(R=P.iadd(this.m)),R._forceRed(this)},N.prototype.mul=function(x,E){if(x.isZero()||E.isZero())return new a(0)._forceRed(this);var L=x.mul(E),O=L.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=L.isub(O).iushrn(this.shift),R=P;return P.cmp(this.m)>=0?R=P.isub(this.m):P.cmpn(0)<0&&(R=P.iadd(this.m)),R._forceRed(this)},N.prototype.invm=function(x){var E=this.imod(x._invmp(this.m).mul(this.r2));return E._forceRed(this)}})(t,Xt)})(xN);var Rye=xN.exports;const yr=No(Rye),_K="bignumber/5.7.0";var S5=yr.BN;const cd=new De(_K),eC={},vO=9007199254740991;function Dye(t){return t!=null&&(nt.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Kr(t)||typeof t=="bigint"||ym(t))}let bO=!1;class nt{constructor(e,r){e!==eC&&cd.throwError("cannot call constructor directly; use BigNumber.from",De.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return As(Or(this).fromTwos(e))}toTwos(e){return As(Or(this).toTwos(e))}abs(){return this._hex[0]==="-"?nt.from(this._hex.substring(1)):this}add(e){return As(Or(this).add(Or(e)))}sub(e){return As(Or(this).sub(Or(e)))}div(e){return nt.from(e).isZero()&&Jo("division-by-zero","div"),As(Or(this).div(Or(e)))}mul(e){return As(Or(this).mul(Or(e)))}mod(e){const r=Or(e);return r.isNeg()&&Jo("division-by-zero","mod"),As(Or(this).umod(r))}pow(e){const r=Or(e);return r.isNeg()&&Jo("negative-power","pow"),As(Or(this).pow(r))}and(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Jo("unbound-bitwise-result","and"),As(Or(this).and(r))}or(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Jo("unbound-bitwise-result","or"),As(Or(this).or(r))}xor(e){const r=Or(e);return(this.isNegative()||r.isNeg())&&Jo("unbound-bitwise-result","xor"),As(Or(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Jo("negative-width","mask"),As(Or(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Jo("negative-width","shl"),As(Or(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Jo("negative-width","shr"),As(Or(this).shrn(e))}eq(e){return Or(this).eq(Or(e))}lt(e){return Or(this).lt(Or(e))}lte(e){return Or(this).lte(Or(e))}gt(e){return Or(this).gt(Or(e))}gte(e){return Or(this).gte(Or(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Or(this).isZero()}toNumber(){try{return Or(this).toNumber()}catch{Jo("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return cd.throwError("this platform does not support BigInt",De.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?bO||(bO=!0,cd.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?cd.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",De.errors.UNEXPECTED_ARGUMENT,{}):cd.throwError("BigNumber.toString does not accept parameters",De.errors.UNEXPECTED_ARGUMENT,{})),Or(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof nt)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new nt(eC,y3(e)):e.match(/^-?[0-9]+$/)?new nt(eC,y3(new S5(e))):cd.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Jo("underflow","BigNumber.from",e),(e>=vO||e<=-vO)&&Jo("overflow","BigNumber.from",e),nt.from(String(e));const r=e;if(typeof r=="bigint")return nt.from(r.toString());if(ym(r))return nt.from(Bt(r));if(r)if(r.toHexString){const n=r.toHexString();if(typeof n=="string")return nt.from(n)}else{let n=r._hex;if(n==null&&r.type==="BigNumber"&&(n=r.hex),typeof n=="string"&&(Kr(n)||n[0]==="-"&&Kr(n.substring(1))))return nt.from(n)}return cd.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function y3(t){if(typeof t!="string")return y3(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&cd.throwArgumentError("invalid hex","value",t),t=y3(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function As(t){return nt.from(y3(t))}function Or(t){const e=nt.from(t).toHexString();return e[0]==="-"?new S5("-"+e.substring(3),16):new S5(e.substring(2),16)}function Jo(t,e,r){const n={fault:t,operation:e};return r!=null&&(n.value=r),cd.throwError(t,De.errors.NUMERIC_FAULT,n)}function Oye(t){return new S5(t,36).toString(16)}const ns=new De(_K),Ly={},CK=nt.from(0),SK=nt.from(-1);function AK(t,e,r,n){const i={fault:e,operation:r};return n!==void 0&&(i.value=n),ns.throwError(t,De.errors.NUMERIC_FAULT,i)}let jy="0";for(;jy.length<256;)jy+=jy;function EN(t){if(typeof t!="number")try{t=nt.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+jy.substring(0,t):ns.throwArgumentError("invalid decimal size","decimals",t)}function g6(t,e){e==null&&(e=0);const r=EN(e);t=nt.from(t);const n=t.lt(CK);n&&(t=t.mul(SK));let i=t.mod(r).toString();for(;i.length2&&ns.throwArgumentError("too many decimal points","value",t);let a=i[0],s=i[1];for(a||(a="0"),s||(s="0");s[s.length-1]==="0";)s=s.substring(0,s.length-1);for(s.length>r.length-1&&AK("fractional component exceeds decimals","underflow","parseFixed"),s===""&&(s="0");s.lengthe[s]==null?l:(typeof e[s]!==o&&ns.throwArgumentError("invalid fixed format ("+s+" not "+o+")","format."+s,e[s]),e[s]);r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&ns.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&ns.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new fg(Ly,r,n,i)}}class ga{constructor(e,r,n,i){e!==Ly&&ns.throwError("cannot use FixedNumber constructor; use FixedNumber.from",De.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&ns.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Wc(this._value,this.format.decimals),n=Wc(e._value,e.format.decimals);return ga.fromValue(r.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Wc(this._value,this.format.decimals),n=Wc(e._value,e.format.decimals);return ga.fromValue(r.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Wc(this._value,this.format.decimals),n=Wc(e._value,e.format.decimals);return ga.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Wc(this._value,this.format.decimals),n=Wc(e._value,e.format.decimals);return ga.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=ga.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe(xO.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=ga.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe(xO.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&ns.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const n=ga.from("1"+jy.substring(0,e),this.format),i=Fye.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&ns.throwArgumentError("invalid byte width","width",e);const r=nt.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Bn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ga.fromString(this._value,e)}static fromValue(e,r,n){return n==null&&r!=null&&!Dye(r)&&(n=r,r=null),r==null&&(r=0),n==null&&(n="fixed"),ga.fromString(g6(e,r),fg.from(n))}static fromString(e,r){r==null&&(r="fixed");const n=fg.from(r),i=Wc(e,n.decimals);!n.signed&&i.lt(CK)&&AK("unsigned value cannot be negative","overflow","value",e);let a=null;n.signed?a=i.toTwos(n.width).toHexString():(a=i.toHexString(),a=Bn(a,n.width/8));const s=g6(i,n.decimals);return new ga(Ly,a,s,n)}static fromBytes(e,r){r==null&&(r="fixed");const n=fg.from(r);if(er(e).length>n.width/8)throw new Error("overflow");let i=nt.from(e);n.signed&&(i=i.fromTwos(n.width));const a=i.toTwos((n.signed?0:1)+n.width).toHexString(),s=g6(i,n.decimals);return new ga(Ly,a,s,n)}static from(e,r){if(typeof e=="string")return ga.fromString(e,r);if(ym(e))return ga.fromBytes(e,r);try{return ga.fromValue(e,0,r)}catch(n){if(n.code!==De.errors.INVALID_ARGUMENT)throw n}return ns.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const xO=ga.from(1),Fye=ga.from("0.5");var IK={exports:{}};/** * [js-sha3]{@link https://github.com/emn178/js-sha3} * * @version 0.8.0 * @author Chen, Yi-Cyuan [emn178@gmail.com] * @copyright Chen, Yi-Cyuan 2015-2018 * @license MIT - */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var a=!n&&typeof self=="object",s=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?i=Xt:a&&(i=self);var o=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],h=[1,256,65536,16777216],g=[6,1536,393216,100663296],m=[0,8,16,24],w=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],_=[224,256,384,512],v=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],A={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(H){return Object.prototype.toString.call(H)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(H){return typeof H=="object"&&H.buffer&&H.buffer.constructor===ArrayBuffer});for(var S=function(H,ee,J){return function(te){return new $(H,ee,H).update(te)[J]()}},j=function(H,ee,J){return function(te,re){return new $(H,ee,re).update(te)[J]()}},U=function(H,ee,J){return function(te,re,z,G){return x["cshake"+H].update(te,re,z,G)[J]()}},I=function(H,ee,J){return function(te,re,z,G){return x["kmac"+H].update(te,re,z,G)[J]()}},B=function(H,ee,J,te){for(var re=0;re>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var te=0;te<50;++te)this.s[te]=0}$.prototype.update=function(H){if(this.finalized)throw new Error(r);var ee,J=typeof H;if(J!=="string"){if(J==="object"){if(H===null)throw new Error(e);if(l&&H.constructor===ArrayBuffer)H=new Uint8Array(H);else if(!Array.isArray(H)&&(!l||!ArrayBuffer.isView(H)))throw new Error(e)}else throw new Error(e);ee=!0}for(var te=this.blocks,re=this.byteCount,z=H.length,G=this.blockCount,Z=0,me=this.s,be,Ce;Z>2]|=H[Z]<>2]|=Ce<>2]|=(192|Ce>>6)<>2]|=(128|Ce&63)<=57344?(te[be>>2]|=(224|Ce>>12)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<>2]|=(240|Ce>>18)<>2]|=(128|Ce>>12&63)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<=re){for(this.start=be-re,this.block=te[G],be=0;be>8,J=H&255;J>0;)re.unshift(J),H=H>>8,J=H&255,++te;return ee?re.push(te):re.unshift(te),this.update(re),re.length},$.prototype.encodeString=function(H){var ee,J=typeof H;if(J!=="string"){if(J==="object"){if(H===null)throw new Error(e);if(l&&H.constructor===ArrayBuffer)H=new Uint8Array(H);else if(!Array.isArray(H)&&(!l||!ArrayBuffer.isView(H)))throw new Error(e)}else throw new Error(e);ee=!0}var te=0,re=H.length;if(ee)te=re;else for(var z=0;z=57344?te+=3:(G=65536+((G&1023)<<10|H.charCodeAt(++z)&1023),te+=4)}return te+=this.encode(te*8),this.update(H),te},$.prototype.bytepad=function(H,ee){for(var J=this.encode(ee),te=0;te>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(H[0]=H[J],ee=1;ee>4&15]+c[Z&15]+c[Z>>12&15]+c[Z>>8&15]+c[Z>>20&15]+c[Z>>16&15]+c[Z>>28&15]+c[Z>>24&15];z%H===0&&(le(ee),re=0)}return te&&(Z=ee[re],G+=c[Z>>4&15]+c[Z&15],te>1&&(G+=c[Z>>12&15]+c[Z>>8&15]),te>2&&(G+=c[Z>>20&15]+c[Z>>16&15])),G},$.prototype.arrayBuffer=function(){this.finalize();var H=this.blockCount,ee=this.s,J=this.outputBlocks,te=this.extraBytes,re=0,z=0,G=this.outputBits>>3,Z;te?Z=new ArrayBuffer(J+1<<2):Z=new ArrayBuffer(G);for(var me=new Uint32Array(Z);z>8&255,G[Z+2]=me>>16&255,G[Z+3]=me>>24&255;z%H===0&&le(ee)}return te&&(Z=z<<2,me=ee[re],G[Z]=me&255,te>1&&(G[Z+1]=me>>8&255),te>2&&(G[Z+2]=me>>16&255)),G};function X(H,ee,J){$.call(this,H,ee,J)}X.prototype=new $,X.prototype.finalize=function(){return this.encode(this.outputBits,!0),$.prototype.finalize.call(this)};var le=function(H){var ee,J,te,re,z,G,Z,me,be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne,Pe,$e,K,F,W,ie,pe,we,he,De,Je,et,it,ut,pt,tr,zt,At,mt,St,dt,Nt,Rt,gt,qt,Wt,ot,Vt,Ft,yt,Qe,Pt,xt,Jt,Cr,Gt,Sr,cr,br,Q,ae,de,ue,ve;for(te=0;te<48;te+=2)re=H[0]^H[10]^H[20]^H[30]^H[40],z=H[1]^H[11]^H[21]^H[31]^H[41],G=H[2]^H[12]^H[22]^H[32]^H[42],Z=H[3]^H[13]^H[23]^H[33]^H[43],me=H[4]^H[14]^H[24]^H[34]^H[44],be=H[5]^H[15]^H[25]^H[35]^H[45],Ce=H[6]^H[16]^H[26]^H[36]^H[46],Fe=H[7]^H[17]^H[27]^H[37]^H[47],Ue=H[8]^H[18]^H[28]^H[38]^H[48],Ke=H[9]^H[19]^H[29]^H[39]^H[49],ee=Ue^(G<<1|Z>>>31),J=Ke^(Z<<1|G>>>31),H[0]^=ee,H[1]^=J,H[10]^=ee,H[11]^=J,H[20]^=ee,H[21]^=J,H[30]^=ee,H[31]^=J,H[40]^=ee,H[41]^=J,ee=re^(me<<1|be>>>31),J=z^(be<<1|me>>>31),H[2]^=ee,H[3]^=J,H[12]^=ee,H[13]^=J,H[22]^=ee,H[23]^=J,H[32]^=ee,H[33]^=J,H[42]^=ee,H[43]^=J,ee=G^(Ce<<1|Fe>>>31),J=Z^(Fe<<1|Ce>>>31),H[4]^=ee,H[5]^=J,H[14]^=ee,H[15]^=J,H[24]^=ee,H[25]^=J,H[34]^=ee,H[35]^=J,H[44]^=ee,H[45]^=J,ee=me^(Ue<<1|Ke>>>31),J=be^(Ke<<1|Ue>>>31),H[6]^=ee,H[7]^=J,H[16]^=ee,H[17]^=J,H[26]^=ee,H[27]^=J,H[36]^=ee,H[37]^=J,H[46]^=ee,H[47]^=J,ee=Ce^(re<<1|z>>>31),J=Fe^(z<<1|re>>>31),H[8]^=ee,H[9]^=J,H[18]^=ee,H[19]^=J,H[28]^=ee,H[29]^=J,H[38]^=ee,H[39]^=J,H[48]^=ee,H[49]^=J,lt=H[0],Ee=H[1],ot=H[11]<<4|H[10]>>>28,Vt=H[10]<<4|H[11]>>>28,he=H[20]<<3|H[21]>>>29,De=H[21]<<3|H[20]>>>29,ae=H[31]<<9|H[30]>>>23,de=H[30]<<9|H[31]>>>23,Rt=H[40]<<18|H[41]>>>14,gt=H[41]<<18|H[40]>>>14,pt=H[2]<<1|H[3]>>>31,tr=H[3]<<1|H[2]>>>31,He=H[13]<<12|H[12]>>>20,qe=H[12]<<12|H[13]>>>20,Ft=H[22]<<10|H[23]>>>22,yt=H[23]<<10|H[22]>>>22,Je=H[33]<<13|H[32]>>>19,et=H[32]<<13|H[33]>>>19,ue=H[42]<<2|H[43]>>>30,ve=H[43]<<2|H[42]>>>30,Cr=H[5]<<30|H[4]>>>2,Gt=H[4]<<30|H[5]>>>2,zt=H[14]<<6|H[15]>>>26,At=H[15]<<6|H[14]>>>26,Ie=H[25]<<11|H[24]>>>21,Ne=H[24]<<11|H[25]>>>21,Qe=H[34]<<15|H[35]>>>17,Pt=H[35]<<15|H[34]>>>17,it=H[45]<<29|H[44]>>>3,ut=H[44]<<29|H[45]>>>3,W=H[6]<<28|H[7]>>>4,ie=H[7]<<28|H[6]>>>4,Sr=H[17]<<23|H[16]>>>9,cr=H[16]<<23|H[17]>>>9,mt=H[26]<<25|H[27]>>>7,St=H[27]<<25|H[26]>>>7,Pe=H[36]<<21|H[37]>>>11,$e=H[37]<<21|H[36]>>>11,xt=H[47]<<24|H[46]>>>8,Jt=H[46]<<24|H[47]>>>8,qt=H[8]<<27|H[9]>>>5,Wt=H[9]<<27|H[8]>>>5,pe=H[18]<<20|H[19]>>>12,we=H[19]<<20|H[18]>>>12,br=H[29]<<7|H[28]>>>25,Q=H[28]<<7|H[29]>>>25,dt=H[38]<<8|H[39]>>>24,Nt=H[39]<<8|H[38]>>>24,K=H[48]<<14|H[49]>>>18,F=H[49]<<14|H[48]>>>18,H[0]=lt^~He&Ie,H[1]=Ee^~qe&Ne,H[10]=W^~pe&he,H[11]=ie^~we&De,H[20]=pt^~zt&mt,H[21]=tr^~At&St,H[30]=qt^~ot&Ft,H[31]=Wt^~Vt&yt,H[40]=Cr^~Sr&br,H[41]=Gt^~cr&Q,H[2]=He^~Ie&Pe,H[3]=qe^~Ne&$e,H[12]=pe^~he&Je,H[13]=we^~De&et,H[22]=zt^~mt&dt,H[23]=At^~St&Nt,H[32]=ot^~Ft&Qe,H[33]=Vt^~yt&Pt,H[42]=Sr^~br&ae,H[43]=cr^~Q&de,H[4]=Ie^~Pe&K,H[5]=Ne^~$e&F,H[14]=he^~Je&it,H[15]=De^~et&ut,H[24]=mt^~dt&Rt,H[25]=St^~Nt>,H[34]=Ft^~Qe&xt,H[35]=yt^~Pt&Jt,H[44]=br^~ae&ue,H[45]=Q^~de&ve,H[6]=Pe^~K<,H[7]=$e^~F&Ee,H[16]=Je^~it&W,H[17]=et^~ut&ie,H[26]=dt^~Rt&pt,H[27]=Nt^~gt&tr,H[36]=Qe^~xt&qt,H[37]=Pt^~Jt&Wt,H[46]=ae^~ue&Cr,H[47]=de^~ve&Gt,H[8]=K^~lt&He,H[9]=F^~Ee&qe,H[18]=it^~W&pe,H[19]=ut^~ie&we,H[28]=Rt^~pt&zt,H[29]=gt^~tr&At,H[38]=xt^~qt&ot,H[39]=Jt^~Wt&Vt,H[48]=ue^~Cr&Sr,H[49]=ve^~Gt&cr,H[0]^=w[te],H[1]^=w[te+1]};if(o)t.exports=x;else for(L=0;L>=8;return e}function uO(t,e,r){let n=0;for(let i=0;ie+1+n&&qc.throwError("child data too short",Le.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function lK(t,e){if(t.length===0&&qc.throwError("data too short",Le.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&qc.throwError("data short segment too short",Le.errors.BUFFER_OVERRUN,{});const n=uO(t,e+1,r);return e+1+r+n>t.length&&qc.throwError("data long segment too short",Le.errors.BUFFER_OVERRUN,{}),dO(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&qc.throwError("data array too short",Le.errors.BUFFER_OVERRUN,{}),dO(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&qc.throwError("data array too short",Le.errors.BUFFER_OVERRUN,{});const n=uO(t,e+1,r);e+1+r+n>t.length&&qc.throwError("data array too short",Le.errors.BUFFER_OVERRUN,{});const i=Bt(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&qc.throwError("data too short",Le.errors.BUFFER_OVERRUN,{});const n=Bt(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Bt(t[e])}}function fN(t){const e=er(t),r=lK(e,0);return r.consumed!==e.length&&qc.throwArgumentError("invalid rlp data","data",t),r.result}const yye="address/5.7.0",zp=new Le(yye);function fO(t){Kr(t,20)||zp.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=er(_i(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const wye=9007199254740991;function vye(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const hN={};for(let t=0;t<10;t++)hN[String(t)]=String(t);for(let t=0;t<26;t++)hN[String.fromCharCode(65+t)]=String(10+t);const hO=Math.floor(vye(wye));function bye(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>hN[n]).join("");for(;e.length>=hO;){let n=e.substring(0,hO);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Ir(t){let e=null;if(typeof t!="string"&&zp.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=fO(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&zp.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==bye(t)&&zp.throwArgumentError("bad icap checksum","address",t),e=fye(t.substring(4));e.length<40;)e="0"+e;e=fO("0x"+e)}else zp.throwArgumentError("invalid address","address",t);return e}function xye(t){try{return Ir(t),!0}catch{}return!1}function cK(t){let e=null;try{e=Ir(t.from)}catch{zp.throwArgumentError("missing from address","transaction",t)}const r=U0(er(nt.from(t.nonce).toHexString()));return Ir(ka(_i(yw([e,r])),12))}const Eye="properties/5.7.0";var _ye=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const y5=new Le(Eye);function st(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function tu(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function vi(t){return _ye(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(a=>({key:n,value:a}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function uK(t,e){(!t||typeof t!="object")&&y5.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||y5.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Pi(t){const e={};for(const r in t)e[r]=t[r];return e}const Cye={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function dK(t){if(t==null||Cye[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rNd(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&st(e,r,Nd(n))}return e}return y5.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Nd(t){return Sye(t)}class ww{constructor(e){for(const r in e)this[r]=Nd(e[r])}}const Aye="abstract-provider/5.7.0";var Iye=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Mye=new Le(Aye);class Tye extends ww{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class t9{constructor(){Mye.checkAbstract(new.target,t9),st(this,"_isProvider",!0)}getFeeData(){return Iye(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield vi({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(s=>null)});let n=null,i=null,a=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,a=nt.from("1500000000"),i=e.baseFeePerGas.mul(2).add(a)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:a,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const kye="networks/5.7.1",pO=new Le(kye);function Nye(t){return t&&typeof t.renetwork=="function"}function cd(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const a=["goerli","ropsten","rinkeby","sepolia"];try{const s=new r.PocketProvider(t,n.pocket);s.network&&a.indexOf(s.network.name)===-1&&i.push(s)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const a=["ropsten"],s=new r.AnkrProvider(t,n.ankr);s.network&&a.indexOf(s.network.name)===-1&&i.push(s)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let a=1;return n.quorum!=null?a=n.quorum:t==="homestead"&&(a=2),new r.FallbackProvider(i,a)}return i[0]};return e.renetwork=function(r){return cd(r)},e}function w5(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return w5(t,n)},r}const gO={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:cd("homestead")},mO={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:cd("ropsten")},yO={chainId:63,name:"classicMordor",_defaultProvider:w5("https://www.ethercluster.com/mordor","classicMordor")},Xb={unspecified:{chainId:0,name:"unspecified"},homestead:gO,mainnet:gO,morden:{chainId:2,name:"morden"},ropsten:mO,testnet:mO,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:cd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:cd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:cd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:cd("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:w5("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:yO,classicTestnet:yO,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:w5("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:cd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:cd("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Lye(t){if(t==null)return null;if(typeof t=="number"){for(const n in Xb){const i=Xb[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=Xb[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=Xb[t.name];if(!e)return typeof t.chainId!="number"&&pO.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&pO.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(Nye(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}function fK(t){t=atob(t);const e=[];for(let r=0;r0;)n.push(s%this.base),s=s/this.base|0}let i="";for(let a=0;r[a]===0&&a=0;--a)i+=this.alphabet[n[a]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;a>0;)r.push(a&255),a>>=8}for(let n=0;e[n]===this._leader&&n>6===2;s++)a++;return a}return t===po.OVERRUN?r.length-e-1:0}function Uye(t,e,r,n,i){return t===po.OVERLONG?(n.push(i),0):(n.push(65533),yK(t,e,r))}const Bye=Object.freeze({error:Fye,ignore:yK,replace:Uye});function wK(t,e){e==null&&(e=Bye.error),t=er(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let a=null,s=null;if((i&224)===192)a=1,s=127;else if((i&240)===224)a=2,s=2047;else if((i&248)===240)a=3,s=65535;else{(i&192)===128?n+=e(po.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(po.BAD_PREFIX,n-1,t,r);continue}if(n-1+a>=t.length){n+=e(po.OVERRUN,n-1,t,r);continue}let o=i&(1<<8-a-1)-1;for(let l=0;l1114111){n+=e(po.OUT_OF_RANGE,n-1-a,t,r,o);continue}if(o>=55296&&o<=57343){n+=e(po.UTF16_SURROGATE,n-1-a,t,r,o);continue}if(o<=s){n+=e(po.OVERLONG,n-1-a,t,r,o);continue}r.push(o)}}return r}function Co(t,e=c3.current){e!=c3.current&&(mK.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const a=t.charCodeAt(n);if(n>=t.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const s=65536+((i&1023)<<10)+(a&1023);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return er(r)}function zye(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function dm(t,e){return zye(wK(t,e))}function Wye(t,e=c3.current){return wK(Co(t,e))}function Wp(t){return _i(Co(t))}const vK="hash/5.7.0";function bK(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(a,s){n.call(a,function(o){s>0&&Array.isArray(o)?i(o,s-1):r.push(o)})};return i(t,e),r}function Hye(t){const e={};for(let r=0;r>--l&1}const f=31,h=Math.pow(2,f),g=h>>>1,m=g>>1,w=h-1;let _=0;for(let j=0;j1;){let se=U+I>>>1;j>>1|u(),B=B<<1^g,V=(V^g)<<1|g|1;b=B,A=1+V-B}let S=n-4;return v.map(j=>{switch(j-S){case 3:return S+65792+(t[o++]<<16|t[o++]<<8|t[o++]);case 2:return S+256+(t[o++]<<8|t[o++]);case 1:return S+t[o++];default:return j-1}})}function qye(t){let e=0;return()=>t[e++]}function Vye(t){return qye(Gye(t))}function Yye(t){return t&1?~t>>1:t>>1}function Kye(t,e){let r=Array(t);for(let n=0;ne[s]):r}function Zye(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(Xye(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(e3e(r,t))}return Hye(bK(e))}function Qye(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function xK(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[s].push(a));return n}function Xye(t,e){let r=1+e(),n=e(),i=Qye(e),a=xK(i.length,1+t,e);return bK(a.map((s,o)=>{const l=s[0],c=s.slice(1);return Array(i[o]).fill(void 0).map((u,f)=>{let h=f*n;return[l+f*r,c.map(g=>g+h)]})}))}function e3e(t,e){let r=1+e();return xK(r,1+t,e).map(i=>[i[0],i.slice(1)])}function t3e(t){let e=v5(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=v5(t,e);if(c.length==0)break;n.push({set:new Set(c),node:r()})}n.sort((c,u)=>u.set.size-c.set.size);let i=t(),a=i%3;i=i/3|0;let s=!!(i&1);i>>=1;let o=i==1,l=i==2;return{branches:n,valid:a,fe0f:s,save:o,check:l}}}function r3e(){return Vye(fK("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const r9=r3e(),n3e=new Set(v5(r9)),i3e=new Set(v5(r9)),a3e=Zye(r9),s3e=t3e(r9),vO=45,bO=95;function EK(t){return Wye(t)}function o3e(t){return t.filter(e=>e!=65039)}function _K(t){for(let e of t.split(".")){let r=EK(e);try{for(let n=r.lastIndexOf(bO)-1;n>=0;n--)if(r[n]!==bO)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===vO&&r[3]===vO)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function l3e(t){return _K(c3e(t,o3e))}function c3e(t,e){let r=EK(t).reverse(),n=[];for(;r.length;){let i=d3e(r);if(i){n.push(...e(i));continue}let a=r.pop();if(n3e.has(a)){n.push(a);continue}if(i3e.has(a))continue;let s=a3e[a];if(s){n.push(...s);continue}throw new Error(`Disallowed codepoint: 0x${a.toString(16).toUpperCase()}`)}return _K(u3e(String.fromCodePoint(...n)))}function u3e(t){return t.normalize("NFC")}function d3e(t,e){var r;let n=s3e,i,a,s=[],o=t.length;for(;o;){let l=t[--o];if(n=(r=n.branches.find(c=>c.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)a=l;else if(n.check&&l===a)break;s.push(l),n.fe0f&&(s.push(65039),o>0&&t[o-1]==65039&&o--),n.valid&&(i=s.slice(),n.valid==2&&i.splice(1,1),t.length=o)}return i}const f3e=new Le(vK),CK=new Uint8Array(32);CK.fill(0);function xO(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function SK(t){const e=Co(l3e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push(xO(e.slice(n))),r}function o6(t){typeof t!="string"&&f3e.throwArgumentError("invalid ENS name; not a string","name",t);let e=CK;const r=SK(t);for(;r.length;)e=_i(Ds([e,_i(r.pop())]));return Bt(e)}function h3e(t){return Bt(Ds(SK(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const p3e=`Ethereum Signed Message: -`;function AK(t){return typeof t=="string"&&(t=Co(t)),_i(Ds([Co(p3e),Co(String(t.length)),t]))}var g3e=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Vn=new Le(vK),IK=new Uint8Array(32);IK.fill(0);const m3e=nt.from(-1),MK=nt.from(0),TK=nt.from(1),y3e=nt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function w3e(t){const e=er(t),r=e.length%32;return r?$s([e,IK.slice(r)]):Bt(e)}const v3e=Bn(TK.toHexString(),32),b3e=Bn(MK.toHexString(),32),EO={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},q_=["name","version","chainId","verifyingContract","salt"];function _O(t){return function(e){return typeof e!="string"&&Vn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const x3e={name:_O("name"),version:_O("version"),chainId:function(t){try{return nt.from(t).toString()}catch{}return Vn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ir(t).toLowerCase()}catch{}return Vn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=er(t);if(e.length!==32)throw new Error("bad length");return Bt(e)}catch{}return Vn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function V_(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Vn.throwArgumentError("invalid numeric width","type",t);const i=y3e.mask(r?n-1:n),a=r?i.add(TK).mul(m3e):MK;return function(s){const o=nt.from(s);return(o.lt(a)||o.gt(i))&&Vn.throwArgumentError(`value out-of-bounds for ${t}`,"value",s),Bn(o.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Vn.throwArgumentError("invalid bytes width","type",t),function(n){return er(n).length!==r&&Vn.throwArgumentError(`invalid length for ${t}`,"value",n),w3e(n)}}}switch(t){case"address":return function(e){return Bn(Ir(e),32)};case"bool":return function(e){return e?v3e:b3e};case"bytes":return function(e){return _i(e)};case"string":return function(e){return Wp(e)}}return null}function CO(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class co{constructor(e){st(this,"types",Object.freeze(Nd(e))),st(this,"_encoderCache",{}),st(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(o=>{r[o]={},n[o]=[],i[o]={}});for(const o in e){const l={};e[o].forEach(c=>{l[c.name]&&Vn.throwArgumentError(`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(o)}`,"types",e),l[c.name]=!0;const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===o&&Vn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!V_(u)&&(n[u]||Vn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(o),r[o][u]=!0)})}const a=Object.keys(n).filter(o=>n[o].length===0);a.length===0?Vn.throwArgumentError("missing primary type","types",e):a.length>1&&Vn.throwArgumentError(`ambiguous primary types or unused types: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),st(this,"primaryType",a[0]);function s(o,l){l[o]&&Vn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),l[o]=!0,Object.keys(r[o]).forEach(c=>{n[c]&&(s(c,l),Object.keys(l).forEach(u=>{i[u][c]=!0}))}),delete l[o]}s(this.primaryType,{});for(const o in i){const l=Object.keys(i[o]);l.sort(),this._types[o]=CO(o,e[o])+l.map(c=>CO(c,e[c])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=V_(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],a=this.getEncoder(i),s=parseInt(r[3]);return o=>{s>=0&&o.length!==s&&Vn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",o);let l=o.map(a);return this._types[i]&&(l=l.map(_i)),_i($s(l))}}const n=this.types[e];if(n){const i=Wp(this._types[e]);return a=>{const s=n.map(({name:o,type:l})=>{const c=this.getEncoder(l)(a[o]);return this._types[l]?_i(c):c});return s.unshift(i),$s(s)}}return Vn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Vn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return _i(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(V_(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const s=i[1],o=parseInt(i[3]);return o>=0&&r.length!==o&&Vn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(s,l,n))}const a=this.types[e];return a?a.reduce((s,{name:o,type:l})=>(s[o]=this._visit(l,r[o],n),s),{}):Vn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new co(e)}static getPrimaryType(e){return co.from(e).primaryType}static hashStruct(e,r,n){return co.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=EO[n];i||Vn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>q_.indexOf(n.name)-q_.indexOf(i.name)),co.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return $s(["0x1901",co.hashDomain(e),co.from(r).hash(n)])}static hash(e,r,n){return _i(co.encode(e,r,n))}static resolveNames(e,r,n,i){return g3e(this,void 0,void 0,function*(){e=Pi(e);const a={};e.verifyingContract&&!Kr(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const s=co.from(r);s.visit(n,(o,l)=>(o==="address"&&!Kr(l,20)&&(a[l]="0x"),l));for(const o in a)a[o]=yield i(o);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=s.visit(n,(o,l)=>o==="address"&&a[l]?a[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){co.hashDomain(e);const i={},a=[];q_.forEach(l=>{const c=e[l];c!=null&&(i[l]=x3e[l](c),a.push({name:l,type:EO[l]}))});const s=co.from(r),o=Pi(r);return o.EIP712Domain?Vn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):o.EIP712Domain=a,s.encode(n),{types:o,domain:i,primaryType:s.primaryType,message:s.visit(n,(l,c)=>{if(l.match(/^bytes(\d*)/))return Bt(er(c));if(l.match(/^u?int/))return nt.from(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return typeof c!="string"&&Vn.throwArgumentError("invalid string","value",c),c}return Vn.throwArgumentError("unsupported type","type",l)})}}}var vw={},Ur={},f1=kK;function kK(t,e){if(!t)throw new Error(e||"Assertion failed")}kK.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var yI={exports:{}};typeof Object.create=="function"?yI.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:yI.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var hs=yI.exports,E3e=f1,_3e=hs;Ur.inherits=_3e;function C3e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function S3e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=a&63|128):C3e(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Ur.htonl=NK;function I3e(t,e){for(var r="",n=0;n>>0}return a}Ur.join32=M3e;function T3e(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}Ur.split32=T3e;function k3e(t,e){return t>>>e|t<<32-e}Ur.rotr32=k3e;function N3e(t,e){return t<>>32-e}Ur.rotl32=N3e;function L3e(t,e){return t+e>>>0}Ur.sum32=L3e;function j3e(t,e,r){return t+e+r>>>0}Ur.sum32_3=j3e;function $3e(t,e,r,n){return t+e+r+n>>>0}Ur.sum32_4=$3e;function P3e(t,e,r,n,i){return t+e+r+n+i>>>0}Ur.sum32_5=P3e;function R3e(t,e,r,n){var i=t[e],a=t[e+1],s=n+a>>>0,o=(s>>0,t[e+1]=s}Ur.sum64=R3e;function D3e(t,e,r,n){var i=e+n>>>0,a=(i>>0}Ur.sum64_hi=D3e;function O3e(t,e,r,n){var i=e+n;return i>>>0}Ur.sum64_lo=O3e;function F3e(t,e,r,n,i,a,s,o){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}Ur.sum64_4_hi=F3e;function U3e(t,e,r,n,i,a,s,o){var l=e+n+a+o;return l>>>0}Ur.sum64_4_lo=U3e;function B3e(t,e,r,n,i,a,s,o,l,c){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Ur.sum64_5_hi=B3e;function z3e(t,e,r,n,i,a,s,o,l,c){var u=e+n+a+o+c;return u>>>0}Ur.sum64_5_lo=z3e;function W3e(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Ur.rotr64_hi=W3e;function H3e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ur.rotr64_lo=H3e;function G3e(t,e,r){return t>>>r}Ur.shr64_hi=G3e;function q3e(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ur.shr64_lo=q3e;var fm={},SO=Ur,V3e=f1;function n9(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}fm.BlockHash=n9;n9.prototype.update=function(e,r){if(e=SO.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=SO.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=e&255}else for(i[a++]=e&255,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,s=8;s>>3}Iu.g0_256=Q3e;function X3e(t){return ou(t,17)^ou(t,19)^t>>>10}Iu.g1_256=X3e;var Ig=Ur,ewe=fm,twe=Iu,Y_=Ig.rotl32,_2=Ig.sum32,rwe=Ig.sum32_5,nwe=twe.ft_1,DK=ewe.BlockHash,iwe=[1518500249,1859775393,2400959708,3395469782];function vu(){if(!(this instanceof vu))return new vu;DK.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ig.inherits(vu,DK);var awe=vu;vu.blockSize=512;vu.outSize=160;vu.hmacStrength=80;vu.padLength=64;vu.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),qwe(e.length<=this.blockSize);for(var r=e.length;r{a[o.toLowerCase()]=s}):n.headers.keys().forEach(s=>{a[s.toLowerCase()]=n.headers.get(s)}),{headers:a,statusCode:n.status,statusMessage:n.statusText,body:er(new Uint8Array(i))}})}var Zwe=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const zl=new Le(Ywe);function kO(t){return new Promise(e=>{setTimeout(e,t)})}function ff(t,e){if(t==null)return null;if(typeof t=="string")return t;if(lN(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return dm(t)}catch{}return Bt(t)}return t}function Qwe(t){return Co(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function Xwe(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;zl.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,a=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;zl.assertArgument(a>0&&a%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);const s=typeof t=="object"?!!t.errorPassThrough:!1,o={};let l=null;const c={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&zl.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const v in t.headers)o[v.toLowerCase()]={key:v,value:String(t.headers[v])},["if-none-match","if-modified-since"].indexOf(v.toLowerCase())>=0&&(u=!0);if(c.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&zl.throwError("basic authentication requires a secure https url",Le.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const v=t.user+":"+t.password;o.authorization={key:"Authorization",value:"Basic "+hK(Co(v))}}t.skipFetchSetup!=null&&(c.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(c.fetchOptions=Pi(t.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=l?l.match(h):null;if(g)try{const v={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?fK(g[3]):Qwe(g[3])};let b=v.body;return r&&(b=r(v.body,v)),Promise.resolve(b)}catch(v){zl.throwError("processing response error",Le.errors.SERVER_ERROR,{body:ff(g[1],g[2]),error:v,requestBody:null,requestMethod:"GET",url:l})}e&&(c.method="POST",c.body=e,o["content-type"]==null&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),o["content-length"]==null&&(o["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(o).forEach(v=>{const b=o[v];m[b.key]=b.value}),c.headers=m;const w=function(){let v=null;return{promise:new Promise(function(S,j){f&&(v=setTimeout(()=>{v!=null&&(v=null,j(zl.makeError("timeout",Le.errors.TIMEOUT,{requestBody:ff(c.body,m["content-type"]),requestMethod:c.method,timeout:f,url:l})))},f))}),cancel:function(){v!=null&&(clearTimeout(v),v=null)}}}(),_=function(){return Zwe(this,void 0,void 0,function*(){for(let v=0;v=300)&&(w.cancel(),zl.throwError("bad response",Le.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:ff(A,b.headers?b.headers["content-type"]:null),requestBody:ff(c.body,m["content-type"]),requestMethod:c.method,url:l})),r)try{const S=yield r(A,b);return w.cancel(),S}catch(S){if(S.throttleRetry&&v{let o=null;if(a!=null)try{o=JSON.parse(dm(a))}catch(l){zl.throwError("invalid JSON",Le.errors.SERVER_ERROR,{body:a,error:l})}return r&&(o=r(o,s)),o},i=null;if(e!=null){i=Co(e);const a=typeof t=="string"?{url:t}:Pi(t);a.headers?Object.keys(a.headers).filter(o=>o.toLowerCase()==="content-type").length!==0||(a.headers=Pi(a.headers),a.headers["content-type"]="application/json"):a.headers={"content-type":"application/json"},t=a}return Xwe(t,i,n)}function ty(t,e){return e||(e={}),e=Pi(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,a=!1;const s=()=>a?!1:(a=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&n(new Error("timeout"))},e.timeout));const o=e.retryLimit;let l=0;function c(){return t().then(function(u){if(u!==void 0)s()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",c);else if(e.onceBlock)e.onceBlock.once("block",c);else if(!a){if(l++,l>o){s()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));fe.ceiling&&(f=e.ceiling),setTimeout(c,f)}return null},function(u){s()&&n(u)})}c()})}var b5="qpzry9x8gf2tvdw0s3jn54khce6mua7l",bI={};for(var t4=0;t4>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function YK(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=sg(e)^n>>5}for(e=sg(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=YK(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",a=0;a>5)throw new Error("Non 5-bit word");n=sg(n)^s,i+=b5.charAt(s)}for(a=0;a<6;++a)n=sg(n);for(n^=1,a=0;a<6;++a){var o=n>>(5-a)*5&31;i+=b5.charAt(o)}return i}function KK(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var a=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var o=YK(a);if(typeof o=="string")return o;for(var l=[],c=0;c=s.length)&&l.push(f)}return o!==1?"Invalid checksum for "+t:{prefix:a,words:l}}function tve(){var t=KK.apply(null,arguments);if(typeof t=="object")return t}function rve(t){var e=KK.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function i9(t,e,r,n){for(var i=0,a=0,s=(1<=r;)a-=r,o.push(i>>a&s);if(n)a>0&&o.push(i<=e)return"Excess padding";if(i<>8,h=u&255;f?l.push(f,h):l.push(h)}return l}r.toArray=n;function i(s){return s.length===1?"0"+s:s}r.zero2=i;function a(s){for(var o="",l=0;l(h>>1)-1?w=(h>>1)-_:w=_,g.isubn(w)):w=0,f[m]=w,g.iushrn(1)}return f}r.getNAF=n;function i(l,c){var u=[[],[]];l=l.clone(),c=c.clone();for(var f=0,h=0,g;l.cmpn(-f)>0||c.cmpn(-h)>0;){var m=l.andln(3)+f&3,w=c.andln(3)+h&3;m===3&&(m=-1),w===3&&(w=-1);var _;m&1?(g=l.andln(7)+f&7,(g===3||g===5)&&w===2?_=-m:_=m):_=0,u[0].push(_);var v;w&1?(g=c.andln(7)+h&7,(g===3||g===5)&&m===2?v=-w:v=w):v=0,u[1].push(v),2*f===_+1&&(f=1-f),2*h===v+1&&(h=1-h),l.iushrn(1),c.iushrn(1)}return u}r.getJSF=i;function a(l,c,u){var f="_"+c;l.prototype[c]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=a;function s(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=s;function o(l){return new yr(l,"hex","le")}r.intFromLE=o}),x5=Lo.getNAF,cve=Lo.getJSF,E5=Lo.assert;function mh(t,e){this.type=t,this.p=new yr(e.p,16),this.red=e.prime?yr.red(e.prime):yr.mont(this.p),this.zero=new yr(0).toRed(this.red),this.one=new yr(1).toRed(this.red),this.two=new yr(2).toRed(this.red),this.n=e.n&&new yr(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var h1=mh;mh.prototype.point=function(){throw new Error("Not implemented")};mh.prototype.validate=function(){throw new Error("Not implemented")};mh.prototype._fixedNafMul=function(e,r){E5(e.precomputed);var n=e._getDoubles(),i=x5(r,1,this._bitLength),a=(1<=o;c--)l=(l<<1)+i[c];s.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&s[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=s[l];E5(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(a[u-1>>1]):o=o.mixedAdd(a[-u-1>>1].neg()):u>0?o=o.add(a[u-1>>1]):o=o.add(a[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};mh.prototype._wnafMulAdd=function(e,r,n,i,a){var s=this._wnafT1,o=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(s[m]!==1||s[w]!==1){l[m]=x5(n[m],s[m],this._bitLength),l[w]=x5(n[w],s[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var _=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(_[1]=r[m].add(r[w]),_[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(_[1]=r[m].toJ().mixedAdd(r[w]),_[2]=r[m].add(r[w].neg())):(_[1]=r[m].toJ().mixedAdd(r[w]),_[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=cve(n[m],n[w]);for(c=Math.max(b[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var I=0;u>=0;){var B=!0;for(f=0;f=0&&I++,j=j.dblp(I),u<0)break;for(f=0;f0?h=o[f][V-1>>1]:V<0&&(h=o[f][-V-1>>1].neg()),h.type==="affine"?j=j.mixedAdd(h):j=j.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};wl.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a=0&&(g=c,m=u),f.negative&&(f=f.neg(),h=h.neg()),g.negative&&(g=g.neg(),m=m.neg()),[{a:f,b:h},{a:g,b:m}]};vl.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),o=a.mul(n.a),l=s.mul(i.a),c=a.mul(n.b),u=s.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};vl.prototype.pointFromX=function(e,r){e=new yr(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)};vl.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};vl.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,s=0;s":""};ca.prototype.isInfinity=function(){return this.inf};ca.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};ca.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)};ca.prototype.getX=function(){return this.x.fromRed()};ca.prototype.getY=function(){return this.y.fromRed()};ca.prototype.mul=function(e){return e=new yr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};ca.prototype.mulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};ca.prototype.jmulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};ca.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};ca.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(a){return a.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};ca.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function va(t,e,r,n){h1.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yr(0)):(this.x=new yr(e,16),this.y=new yr(r,16),this.z=new yr(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}mN(va,h1.BasePoint);vl.prototype.jpoint=function(e,r,n){return new va(this,e,r,n)};va.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};va.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};va.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(a),c=s.redSub(o);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),f=u.redMul(l),h=i.redMul(u),g=c.redSqr().redIAdd(f).redISub(h).redISub(h),m=c.redMul(h.redISub(g)).redISub(s.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};va.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,s=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=a.redSub(s);if(o.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(a.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};va.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}};va.prototype.inspect=function(){return this.isInfinity()?"":""};va.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var l6=gm(function(t,e){var r=e;r.base=h1,r.short=dve,r.mont=null,r.edwards=null}),c6=gm(function(t,e){var r=e,n=Lo.assert;function i(o){o.type==="short"?this.curve=new l6.short(o):o.type==="edwards"?this.curve=new l6.edwards(o):this.curve=new l6.mont(o),this.g=this.curve.g,this.n=this.curve.n,this.hash=o.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function a(o,l){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,get:function(){var c=new i(l);return Object.defineProperty(r,o,{configurable:!0,enumerable:!0,value:c}),c}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Wc.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Wc.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Wc.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Wc.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Wc.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Wc.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Wc.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Wc.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function th(t){if(!(this instanceof th))return new th(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=tc.toArray(t.entropy,t.entropyEnc||"hex"),r=tc.toArray(t.nonce,t.nonceEnc||"hex"),n=tc.toArray(t.pers,t.persEnc||"hex");gN(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var ZK=th;th.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};th.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=tc.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length"};var fve=Lo.assert;function a9(t,e){if(t instanceof a9)return t;this._importDER(t,e)||(fve(t.r&&t.s,"Signature without r or s"),this.r=new yr(t.r,16),this.s=new yr(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var s9=a9;function hve(){this.place=0}function Q_(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,s=e.place;a>>=0;return i<=127?!1:(e.place=s,i)}function LO(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}a9.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=LO(r),n=LO(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];X_(i,r.length),i=i.concat(r),i.push(2),X_(i,n.length);var a=i.concat(n),s=[48];return X_(s,a.length),s=s.concat(a),Lo.encode(s,e)};var pve=function(){throw new Error("unsupported")},QK=Lo.assert;function pl(t){if(!(this instanceof pl))return new pl(t);typeof t=="string"&&(QK(Object.prototype.hasOwnProperty.call(c6,t),"Unknown curve "+t),t=c6[t]),t instanceof c6.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var gve=pl;pl.prototype.keyPair=function(e){return new yN(this,e)};pl.prototype.keyFromPrivate=function(e,r){return yN.fromPrivate(this,e,r)};pl.prototype.keyFromPublic=function(e,r){return yN.fromPublic(this,e,r)};pl.prototype.genKeyPair=function(e){e||(e={});for(var r=new ZK({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||pve(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yr(2));;){var a=new yr(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};pl.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};pl.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new yr(e,16));for(var a=this.n.byteLength(),s=r.getPrivate().toArray("be",a),o=e.toArray("be",a),l=new ZK({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new yr(1)),u=0;;u++){var f=i.k?i.k(u):new yr(l.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(c)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var g=h.getX(),m=g.umod(this.n);if(m.cmpn(0)!==0){var w=f.invm(this.n).mul(m.mul(r.getPrivate()).iadd(e));if(w=w.umod(this.n),w.cmpn(0)!==0){var _=(h.getY().isOdd()?1:0)|(g.cmp(m)!==0?2:0);return i.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),_^=1),new s9({r:m,s:w,recoveryParam:_})}}}}}};pl.prototype.verify=function(e,r,n,i){e=this._truncateToN(new yr(e,16)),n=this.keyFromPublic(n,i),r=new s9(r,"hex");var a=r.r,s=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o=s.invm(this.n),l=o.mul(e).umod(this.n),c=o.mul(a).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.eqXToP(a)):(u=this.g.mulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.getX().umod(this.n).cmp(a)===0)};pl.prototype.recoverPubKey=function(t,e,r,n){QK((3&r)===r,"The recovery param is more than two bits"),e=new s9(e,n);var i=this.n,a=new yr(t),s=e.r,o=e.s,l=r&1,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,s,h)};pl.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new s9(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var mve=gm(function(t,e){var r=e;r.version="6.5.4",r.utils=Lo,r.rand=function(){throw new Error("unsupported")},r.curve=l6,r.curves=c6,r.ec=gve,r.eddsa=null}),yve=mve.ec;const wve="signing-key/5.7.0",EI=new Le(wve);let eC=null;function _f(){return eC||(eC=new yve("secp256k1")),eC}class vve{constructor(e){st(this,"curve","secp256k1"),st(this,"privateKey",Bt(e)),B0(this.privateKey)!==32&&EI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=_f().keyFromPrivate(er(this.privateKey));st(this,"publicKey","0x"+r.getPublic(!1,"hex")),st(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),st(this,"_isSigningKey",!0)}_addPoint(e){const r=_f().keyFromPublic(er(this.publicKey)),n=_f().keyFromPublic(er(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=_f().keyFromPrivate(er(this.privateKey)),n=er(e);n.length!==32&&EI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return e9({recoveryParam:i.recoveryParam,r:Bn("0x"+i.r.toString(16),32),s:Bn("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=_f().keyFromPrivate(er(this.privateKey)),n=_f().keyFromPublic(er(XK(e)));return Bn("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function bve(t,e){const r=e9(e),n={r:er(r.r),s:er(r.s)};return"0x"+_f().recoverPubKey(er(t),n,r.recoveryParam).encode("hex",!1)}function XK(t,e){const r=er(t);return r.length===32?new vve(r).publicKey:r.length===33?"0x"+_f().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Bt(r):EI.throwArgumentError("invalid public or private key","key","[REDACTED]")}const xve="transactions/5.7.0",Bs=new Le(xve);var jO;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(jO||(jO={}));function wN(t){return t==="0x"?null:Ir(t)}function ja(t){return t==="0x"?gK:nt.from(t)}const Eve=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],_ve={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Cve(t){const e=XK(t);return Ir(ka(_i(ka(e,1)),12))}function vN(t,e){return Cve(bve(er(t),e))}function go(t,e){const r=U0(nt.from(t).toHexString());return r.length>32&&Bs.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function tC(t,e){return{address:Ir(t),storageKeys:(e||[]).map((r,n)=>(B0(r)!==32&&Bs.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function mm(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Bs.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),tC(r[0],r[1])):tC(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,a)=>(i[a]=!0,i),{});return tC(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function eJ(t){return mm(t).map(e=>[e.address,e.storageKeys])}function tJ(t,e){if(t.gasPrice!=null){const n=nt.from(t.gasPrice),i=nt.from(t.maxFeePerGas||0);n.eq(i)||Bs.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[go(t.chainId||0,"chainId"),go(t.nonce||0,"nonce"),go(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),go(t.maxFeePerGas||0,"maxFeePerGas"),go(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",go(t.value||0,"value"),t.data||"0x",eJ(t.accessList||[])];if(e){const n=e9(e);r.push(go(n.recoveryParam,"recoveryParam")),r.push(U0(n.r)),r.push(U0(n.s))}return $s(["0x02",yw(r)])}function rJ(t,e){const r=[go(t.chainId||0,"chainId"),go(t.nonce||0,"nonce"),go(t.gasPrice||0,"gasPrice"),go(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",go(t.value||0,"value"),t.data||"0x",eJ(t.accessList||[])];if(e){const n=e9(e);r.push(go(n.recoveryParam,"recoveryParam")),r.push(U0(n.r)),r.push(U0(n.s))}return $s(["0x01",yw(r)])}function Sve(t,e){uK(t,_ve);const r=[];Eve.forEach(function(i){let a=t[i.name]||[];const s={};i.numeric&&(s.hexPad="left"),a=er(Bt(a,s)),i.length&&a.length!==i.length&&a.length>0&&Bs.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,a),i.maxLength&&(a=U0(a),a.length>i.maxLength&&Bs.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,a)),r.push(Bt(a))});let n=0;return t.chainId!=null&&(n=t.chainId,typeof n!="number"&&Bs.throwArgumentError("invalid transaction.chainId","transaction",t)),n!==0&&(r.push(Bt(n)),r.push("0x"),r.push("0x")),yw(r)}function Ave(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Bs.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),Sve(t);switch(t.type){case 1:return rJ(t,e);case 2:return tJ(t,e)}return Bs.throwError(`unsupported transaction type: ${t.type}`,Le.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function nJ(t,e,r){try{const n=ja(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Bs.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Bn(e[1],32),t.s=Bn(e[2],32);try{const n=_i(r(t));t.from=vN(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function Ive(t){const e=fN(t.slice(1));e.length!==9&&e.length!==12&&Bs.throwArgumentError("invalid component count for transaction type: 2","payload",Bt(t));const r=ja(e[2]),n=ja(e[3]),i={type:2,chainId:ja(e[0]).toNumber(),nonce:ja(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:ja(e[4]),to:wN(e[5]),value:ja(e[6]),data:e[7],accessList:mm(e[8])};return e.length===9||(i.hash=_i(t),nJ(i,e.slice(9),tJ)),i}function Mve(t){const e=fN(t.slice(1));e.length!==8&&e.length!==11&&Bs.throwArgumentError("invalid component count for transaction type: 1","payload",Bt(t));const r={type:1,chainId:ja(e[0]).toNumber(),nonce:ja(e[1]).toNumber(),gasPrice:ja(e[2]),gasLimit:ja(e[3]),to:wN(e[4]),value:ja(e[5]),data:e[6],accessList:mm(e[7])};return e.length===8||(r.hash=_i(t),nJ(r,e.slice(8),rJ)),r}function Tve(t){const e=fN(t);e.length!==9&&e.length!==6&&Bs.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:ja(e[0]).toNumber(),gasPrice:ja(e[1]),gasLimit:ja(e[2]),to:wN(e[3]),value:ja(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=nt.from(e[6]).toNumber()}catch{return r}if(r.r=Bn(e[7],32),r.s=Bn(e[8],32),nt.from(r.r).isZero()&&nt.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(Bt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const a=_i(yw(i));try{r.from=vN(a,{r:Bt(r.r),s:Bt(r.s),recoveryParam:n})}catch{}r.hash=_i(t)}return r.type=null,r}function kve(t){const e=er(t);if(e[0]>127)return Tve(e);switch(e[0]){case 1:return Mve(e);case 2:return Ive(e)}return Bs.throwError(`unsupported transaction type: ${e[0]}`,Le.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const S2=new Le(bw);class jt{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),o=this.hex.bind(this),l=this.number.bind(this),c=this.type.bind(this),u=f=>this.data(f,!0);return e.transaction={hash:s,type:c,accessList:jt.allowNull(this.accessList.bind(this),null),blockHash:jt.allowNull(s,null),blockNumber:jt.allowNull(l,null),transactionIndex:jt.allowNull(l,null),confirmations:jt.allowNull(l,null),from:r,gasPrice:jt.allowNull(n),maxPriorityFeePerGas:jt.allowNull(n),maxFeePerGas:jt.allowNull(n),gasLimit:n,to:jt.allowNull(r,null),value:n,nonce:l,data:a,r:jt.allowNull(this.uint256),s:jt.allowNull(this.uint256),v:jt.allowNull(l),creates:jt.allowNull(r,null),raw:jt.allowNull(a)},e.transactionRequest={from:jt.allowNull(r),nonce:jt.allowNull(l),gasLimit:jt.allowNull(n),gasPrice:jt.allowNull(n),maxPriorityFeePerGas:jt.allowNull(n),maxFeePerGas:jt.allowNull(n),to:jt.allowNull(r),value:jt.allowNull(n),data:jt.allowNull(u),type:jt.allowNull(l),accessList:jt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:s,address:r,topics:jt.arrayOf(s),data:a,logIndex:l,blockHash:s},e.receipt={to:jt.allowNull(this.address,null),from:jt.allowNull(this.address,null),contractAddress:jt.allowNull(r,null),transactionIndex:l,root:jt.allowNull(o),gasUsed:n,logsBloom:jt.allowNull(a),blockHash:s,transactionHash:s,logs:jt.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:jt.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:jt.allowNull(n),status:jt.allowNull(l),type:c},e.block={hash:jt.allowNull(s),parentHash:s,number:l,timestamp:l,nonce:jt.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:jt.allowNull(r),extraData:a,transactions:jt.allowNull(jt.arrayOf(s)),baseFeePerGas:jt.allowNull(n)},e.blockWithTransactions=Pi(e.block),e.blockWithTransactions.transactions=jt.allowNull(jt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:jt.allowNull(i,void 0),toBlock:jt.allowNull(i,void 0),blockHash:jt.allowNull(s,void 0),address:jt.allowNull(r,void 0),topics:jt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:jt.allowNull(l),blockHash:jt.allowNull(s),transactionIndex:l,removed:jt.allowNull(this.boolean.bind(this)),address:r,data:jt.allowFalsish(a,"0x"),topics:jt.arrayOf(s),transactionHash:s,logIndex:l},e}accessList(e){return mm(e||[])}number(e){return e==="0x"?0:nt.from(e).toNumber()}type(e){return e==="0x"||e==null?0:nt.from(e).toNumber()}bigNumber(e){return nt.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Kr(e))?e.toLowerCase():S2.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Ir(e)}callAddress(e){if(!Kr(e,32))return null;const r=Ir(ka(e,12));return r===jye?null:r}contractAddress(e){return cK(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Kr(e))return cN(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return B0(n)!==32?S2.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=nt.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Kr(e))throw new Error("invalid uint256");return Bn(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=jt.check(r,e);return i._difficulty=n==null?null:nt.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return jt.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&nt.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=jt.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Kr(n)&&(n=nt.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Kr(n)&&(n=nt.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return kve(e)}receiptLog(e){return jt.check(this.formats.receiptLog,e)}receipt(e){const r=jt.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=nt.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&S2.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):S2.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&S2.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return jt.check(this.formats.filter,e)}filterLog(e){return jt.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const a=e[i](r[i]);a!==void 0&&(n[i]=a)}catch(a){throw a.checkKey=i,a.checkValue=r[i],a}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var hr=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Mr=new Le(bw),Nve=10;function $O(t){return t==null?"null":(B0(t)!==32&&Mr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function PO(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[$O(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return $O(e)}).join("&")}function Lve(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function sp(t){if(typeof t=="string"){if(t=t.toLowerCase(),B0(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+PO(t);if(Tye.isForkEvent(t))throw Mr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+PO(t.topics||[])}throw new Error("invalid event - "+t)}function A2(){return new Date().getTime()}function RO(t){return new Promise(e=>{setTimeout(e,t)})}const jve=["block","network","pending","poll"];let $ve=class{constructor(e,r,n){st(this,"tag",e),st(this,"listener",r),st(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=Lve(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||jve.indexOf(this.tag)>=0}};const Pve={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function rC(t){return Bn(nt.from(t).toHexString(),32)}function DO(t){return mI.encode(Ds([t,ka(TO(TO(t)),0,4)]))}const iJ=new RegExp("^(ipfs)://(.*)$","i"),OO=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),iJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function u6(t,e){try{return dm(u3(t,e))}catch{}return null}function u3(t,e){if(t==="0x")return null;const r=nt.from(ka(t,e,e+32)).toNumber(),n=nt.from(ka(t,r,r+32)).toNumber();return ka(t,r+32,r+32+n)}function nC(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Mr.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function FO(t){const e=er(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function Rve(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function aJ(t){const e=[];let r=0;for(let n=0;nnt.from(e).eq(1)).catch(e=>{if(e.code===Le.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return hr(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:$s([e,o6(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=$s(["0x9061b923",aJ([h3e(this.name),n.data])]));try{let a=yield this.provider.call(n);return er(a).length%32===4&&Mr.throwError("resolver threw error",Le.errors.CALL_EXCEPTION,{transaction:n,data:a}),i&&(a=u3(a,0)),a}catch(a){if(a.code===Le.errors.CALL_EXCEPTION)return null;throw a}})}_fetchBytes(e,r){return hr(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?u3(n,0):null})}_getAddress(e,r){const n=Pve[String(e)];if(n==null&&Mr.throwError(`unsupported coin type: ${e}`,Le.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=er(r);if(n.p2pkh!=null){const a=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(a){const s=parseInt(a[1],16);if(a[2].length===s*2&&s>=1&&s<=75)return DO(Ds([[n.p2pkh],"0x"+a[2]]))}}if(n.p2sh!=null){const a=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){const s=parseInt(a[1],16);if(a[2].length===s*2&&s>=1&&s<=75)return DO(Ds([[n.p2sh],"0x"+a[2]]))}}if(n.prefix!=null){const a=i[1];let s=i[0];if(s===0?a!==20&&a!==32&&(s=-1):s=-1,s>=0&&i.length===2+a&&a>=1&&a<=75){const o=NO.toWords(i.slice(2));return o.unshift(s),NO.encode(n.prefix,o)}}return null}getAddress(e){return hr(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===Dye?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===Le.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",rC(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Mr.throwError("invalid or unsupported coin data",Le.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return hr(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;ns[l])}return Mr.throwError("invalid or unsupported content hash data",Le.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return hr(this,void 0,void 0,function*(){let r=Co(e);r=Ds([rC(64),rC(r.length),r]),r.length%32!==0&&(r=Ds([r,Bn("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Bt(r));return n==null||n==="0x"?null:dm(n)})}}let iC=null,Dve=1;class Ove extends t9{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),st(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=tu(new.target,"getNetwork")(e);r?(st(this,"_network",r),this.emit("network",r,null)):Mr.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return hr(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Mr.throwError("no network detected",Le.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:st(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return ty(()=>this._ready().then(e=>e,e=>{if(!(e.code===Le.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return iC==null&&(iC=new jt),iC}static getNetwork(e){return Lye(e??"homestead")}ccipReadFetch(e,r,n){return hr(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),a=r.toLowerCase(),s=[];for(let o=0;o=0?null:JSON.stringify({data:a,sender:i}),f=yield pN({url:c,errorPassThrough:!0},u,(g,m)=>(g.status=m.statusCode,g));if(f.data)return f.data;const h=f.message||"unknown error";if(f.status>=400&&f.status<500)return Mr.throwError(`response not found during CCIP fetch: ${h}`,Le.errors.SERVER_ERROR,{url:l,errorMessage:h});s.push(h)}return Mr.throwError(`error encountered during CCIP fetch: ${s.map(o=>JSON.stringify(o)).join(", ")}`,Le.errors.SERVER_ERROR,{urls:n,errorMessages:s})})}_getInternalBlockNumber(e){return hr(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const a=yield i;if(A2()-a.respTime<=e)return a.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=A2(),n=vi({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:a})=>{if(a)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),a;const s=A2();return i=nt.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return hr(this,void 0,void 0,function*(){const e=Dve++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Mr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Mr.makeError("network block skew detected",Le.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const a=this._emitted[i];a!=="pending"&&n-a>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const a=i.hash;let s=this.getTransactionReceipt(a).then(o=>(!o||o.blockNumber==null||(this._emitted["t:"+a]=o.blockNumber,this.emit(a,o)),null)).catch(o=>{this.emit("error",o)});r.push(s);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const a=i.filter;a.fromBlock=i._lastBlockNumber+1,a.toBlock=n;const s=a.toBlock-this._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);const o=this.getLogs(a).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(c=>{c.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=c.blockNumber),this._emitted["b:"+c.blockHash]=c.blockNumber,this._emitted["t:"+c.transactionHash]=c.blockNumber,this.emit(a,c)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(o)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return hr(this,void 0,void 0,function*(){return Mr.throwError("provider does not support network detection",Le.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return hr(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield RO(0),this._network;const n=Mr.makeError("underlying network changed",Le.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=A2();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return hr(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return hr(this,void 0,void 0,function*(){const a=yield this.getTransactionReceipt(e);return(a?a.confirmations:0)>=r?a:new Promise((s,o)=>{const l=[];let c=!1;const u=function(){return c?!0:(c=!0,l.forEach(h=>{h()}),!1)},f=h=>{h.confirmations{this.removeListener(e,f)}),i){let h=i.startBlock,g=null;const m=w=>hr(this,void 0,void 0,function*(){c||(yield RO(1e3),this.getTransactionCount(i.from).then(_=>hr(this,void 0,void 0,function*(){if(!c){if(_<=i.nonce)h=w;else{{const v=yield this.getTransaction(e);if(v&&v.blockNumber!=null)return}for(g==null&&(g=h-3,g{c||this.once("block",m)}))});if(c)return;this.once("block",m),l.push(()=>{this.removeListener("block",m)})}if(typeof n=="number"&&n>0){const h=setTimeout(()=>{u()||o(Mr.makeError("timeout exceeded",Le.errors.TIMEOUT,{timeout:n}))},n);h.unref&&h.unref(),l.push(()=>{clearTimeout(h)})}})})}getBlockNumber(){return hr(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return nt.from(e)}catch(r){return Mr.throwError("bad result from backend",Le.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return nt.from(i)}catch(a){return Mr.throwError("bad result from backend",Le.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:a})}})}getTransactionCount(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return nt.from(i).toNumber()}catch(a){return Mr.throwError("bad result from backend",Le.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:a})}})}getCode(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Bt(i)}catch(a){return Mr.throwError("bad result from backend",Le.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:a})}})}getStorageAt(e,r,n){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(s=>cN(s))}),a=yield this.perform("getStorageAt",i);try{return Bt(a)}catch(s){return Mr.throwError("bad result from backend",Le.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:a,error:s})}})}_wrapTransaction(e,r,n){if(r!=null&&B0(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Mr.throwError("Transaction hash mismatch from Provider.sendTransaction.",Le.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(a,s)=>hr(this,void 0,void 0,function*(){a==null&&(a=1),s==null&&(s=0);let o;a!==0&&n!=null&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,a,s,o);return l==null&&a===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Mr.throwError("transaction failed",Le.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(a=>Bt(a)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const a=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,a,i)}catch(a){throw a.transaction=n,a.transactionHash=n.hash,a}})}_getTransactionRequest(e){return hr(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?this._getAddress(a):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?nt.from(a):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?Bt(a):null))}),this.formatter.transactionRequest(yield vi(n))})}_getFilter(e){return hr(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield vi(r))})}_call(e,r,n){return hr(this,void 0,void 0,function*(){n>=Nve&&Mr.throwError("CCIP read exceeded maximum redirections",Le.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,a=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&a.substring(0,10)==="0x556f1830"&&B0(a)%32===4)try{const s=ka(a,4),o=ka(s,0,32);nt.from(o).eq(i)||Mr.throwError("CCIP Read sender did not match",Le.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:a});const l=[],c=nt.from(ka(s,32,64)).toNumber(),u=nt.from(ka(s,c,c+32)).toNumber(),f=ka(s,c+32);for(let v=0;vhr(this,void 0,void 0,function*(){const a=yield this.perform("getBlock",i);if(a==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let s=null;for(let l=0;lthis._wrapTransaction(l)),o}return this.formatter.block(a)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return ty(()=>hr(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return ty(()=>hr(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return i}),{oncePoll:this})})}getLogs(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield vi({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),jt.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return hr(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return hr(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Mr.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return hr(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new UO(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return hr(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Mr.throwError("network does not support ENS",Le.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+o6(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return hr(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(Kr(e))throw n}typeof e!="string"&&Mr.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return hr(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=u6(yield this.call({to:n,data:"0x691f3431"+o6(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return hr(this,void 0,void 0,function*(){let r=null;if(Kr(e)){const a=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(a,"getAvatar");if(!s)return null;r=new UO(this,s,a);try{const o=yield r.getAvatar();if(o)return o.url}catch(o){if(o.code!==Le.errors.CALL_EXCEPTION)throw o}try{const o=u6(yield this.call({to:s,data:"0x691f3431"+o6(a).substring(2)}),0);r=yield this.getResolver(o)}catch(o){if(o.code!==Le.errors.CALL_EXCEPTION)throw o;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Mr.throwError(e+" not implemented",Le.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new $ve(sp(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],a=sp(e);return this._events=this._events.filter(s=>s.tag!==a?!0:(setTimeout(()=>{s.listener.apply(this,r)},0),n=!0,s.once?(i.push(s),!1):!0)),i.forEach(s=>{this._stopEvent(s)}),n}listenerCount(e){if(!e)return this._events.length;let r=sp(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=sp(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,a=sp(e);return this._events=this._events.filter(s=>s.tag!==a||s.listener!=r||i?!0:(i=!0,n.push(s),!1)),n.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=sp(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const Fve="abstract-signer/5.7.0";var Dl=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Qo=new Le(Fve),Uve=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Bve=[Le.errors.INSUFFICIENT_FUNDS,Le.errors.NONCE_EXPIRED,Le.errors.REPLACEMENT_UNDERPRICED];class xw{constructor(){Qo.checkAbstract(new.target,xw),st(this,"_isSigner",!0)}getBalance(e){return Dl(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Dl(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Dl(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield vi(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Dl(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield vi(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Dl(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Dl(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Dl(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Dl(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Dl(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)Uve.indexOf(n)===-1&&Qo.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Pi(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&Qo.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Dl(this,void 0,void 0,function*(){const r=yield vi(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Dl(this,void 0,void 0,function*(){if(i==null)return null;const a=yield this.resolveName(i);return a==null&&Qo.throwArgumentError("provided ENS name resolves to null","tx.to",i),a})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?Qo.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&Qo.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&Qo.throwError("network does not support EIP-1559",Le.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Qo.throwError("failed to get consistent fee data",Le.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(Bve.indexOf(i.code)>=0)throw i;return Qo.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Le.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Qo.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield vi(r)})}_checkProvider(e){this.provider||Qo.throwError("missing provider",Le.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class o9 extends xw{constructor(e,r){super(),st(this,"address",e),st(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{Qo.throwError(e,Le.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new o9(this.address,e)}}var id=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const bi=new Le(bw),zve=["call","estimateGas"];function Sy(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Kr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=Sy(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return Sy(JSON.parse(t),e)}catch{}return null}function sJ(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const a=Sy(e,!0);if(a)return a.data;bi.throwError("missing revert data in call exception; Transaction reverted without a reason string",Le.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let a=Sy(e.body,!1);a==null&&(a=Sy(e,!1)),a&&bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Le.errors.UNPREDICTABLE_GAS_LIMIT,{reason:a.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===Le.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&bi.throwError("insufficient funds for intrinsic transaction cost",Le.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&bi.throwError("nonce has already been used",Le.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&bi.throwError("replacement fee too low",Le.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&bi.throwError("legacy pre-eip-155 transactions not supported",Le.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),zve.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",Le.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function BO(t){return new Promise(function(e){setTimeout(e,t)})}function Wve(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function I2(t){return t&&t.toLowerCase()}const _I={};class oJ extends xw{constructor(e,r,n){if(super(),e!==_I)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");st(this,"provider",r),n==null&&(n=0),typeof n=="string"?(st(this,"_address",this.provider.formatter.address(n)),st(this,"_index",null)):typeof n=="number"?(st(this,"_index",n),st(this,"_address",null)):bi.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return bi.throwError("cannot alter JSON-RPC Signer connection",Le.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Hve(_I,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&bi.throwError("unknown account #"+this._index,Le.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Pi(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Pi(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>id(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&bi.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),vi({tx:vi(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&bi.throwArgumentError("from address mismatch","transaction",e):n.from=i;const a=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[a]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&bi.throwError("user rejected transaction",Le.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),sJ("sendTransaction",s,a)))})}signTransaction(e){return bi.throwError("signing transactions is unsupported",Le.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return id(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield ty(()=>id(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return id(this,void 0,void 0,function*(){const r=typeof e=="string"?Co(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Bt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&bi.throwError("user rejected signing",Le.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return id(this,void 0,void 0,function*(){const r=typeof e=="string"?Co(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Bt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&bi.throwError("user rejected signing",Le.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return id(this,void 0,void 0,function*(){const i=yield co.resolveNames(e,r,n,s=>this.provider.resolveName(s)),a=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[a.toLowerCase(),JSON.stringify(co.getPayload(i.domain,r,i.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&bi.throwError("user rejected signing",Le.errors.ACTION_REJECTED,{action:"_signTypedData",from:a,messageData:{domain:i.domain,types:r,value:i.value}}),s}})}unlock(e){return id(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class Hve extends oJ{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const Gve={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class lJ extends Ove{constructor(e,r){let n=r;n==null&&(n=new Promise((i,a)=>{setTimeout(()=>{this.detectNetwork().then(s=>{i(s)},s=>{a(s)})},0)})),super(n),e||(e=tu(this.constructor,"defaultUrl")()),typeof e=="string"?st(this,"connection",Object.freeze({url:e})):st(this,"connection",Object.freeze(Pi(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return id(this,void 0,void 0,function*(){yield BO(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=tu(this.constructor,"getNetwork");try{return r(nt.from(e).toNumber())}catch(n){return bi.throwError("could not detect network",Le.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return bi.throwError("could not detect network",Le.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new oJ(_I,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Nd(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const a=pN(this.connection,JSON.stringify(n),Wve).then(s=>(this.emit("debug",{action:"response",request:n,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:n,provider:this}),s});return i&&(this._cache[e]=a,setTimeout(()=>{this._cache[e]=null},0)),a}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[I2(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[I2(r.address),r.blockTag]];case"getCode":return["eth_getCode",[I2(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[I2(r.address),Bn(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[tu(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[tu(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=I2(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return id(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&nt.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=yield this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(r=Pi(r),r.transaction=Pi(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&bi.throwError(e+" not implemented",Le.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return sJ(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(a){if(e._pendingFilter!=r)return null;let s=Promise.resolve();return a.forEach(function(o){e._emitted["t:"+o.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(o).then(function(l){return e.emit("pending",l),null})})}),s.then(function(){return BO(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(a=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Pi(Gve);if(r)for(const a in r)r[a]&&(n[a]=!0);uK(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(a){if(e[a]==null)return;const s=cN(nt.from(e[a]));a==="gasLimit"&&(a="gas"),i[a]=s}),["from","to","data"].forEach(function(a){e[a]!=null&&(i[a]=Bt(e[a]))}),e.accessList&&(i.accessList=mm(e.accessList)),i}}var qve=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Vve=new Le(bw);class Yve extends lJ{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return qve(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||Vve.throwError("no network detected",Le.errors.UNKNOWN_ERROR,{}),this._network==null&&(st(this,"_network",r),this.emit("network",r,null))),r})}}const zO=new Le(bw);let Kve=1;function WO(t,e){const r="Web3LegacyFetcher";return function(n,i){const a={method:n,params:i,id:Kve++,jsonrpc:"2.0"};return new Promise((s,o)=>{this.emit("debug",{action:"request",fetcher:r,request:Nd(a),provider:this}),e(a,(l,c)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:a,provider:this}),o(l);if(this.emit("debug",{action:"response",fetcher:r,request:a,response:c,provider:this}),c.error){const u=new Error(c.error.message);return u.code=c.error.code,u.data=c.error.data,o(u)}s(c.result)})})}}function Jve(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Nd(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class _5 extends lJ{constructor(e,r){e==null&&zO.throwArgumentError("missing provider","provider",e);let n=null,i=null,a=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),a=e,e.request?(n===""&&(n="eip-1193:"),i=Jve(e)):e.sendAsync?i=WO(e,e.sendAsync.bind(e)):e.send?i=WO(e,e.send.bind(e)):zO.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),st(this,"jsonRpcFetchFunc",i),st(this,"provider",a)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}function Zve(t){if(typeof window>"u")return;const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function Qve(){const t=new Set;let e=[];const r=()=>Zve(i=>{e.some(({info:a})=>a.uuid===i.info.uuid)||(e=[...e,i],t.forEach(a=>a(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n==null||n()},findProvider({rdns:i}){return e.find(a=>a.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:a}={}){return t.add(i),a&&i(e,{added:e}),()=>t.delete(i)}}}var kt={},CI={exports:{}};(function(t,e){(function(r,n){var i="1.0.40",a="",s="?",o="function",l="undefined",c="object",u="string",f="major",h="model",g="name",m="type",w="vendor",_="version",v="architecture",b="console",A="mobile",S="tablet",j="smarttv",U="wearable",I="embedded",B=500,V="Amazon",se="Apple",Y="ASUS",N="BlackBerry",k="Browser",x="Chrome",E="Edge",L="Firefox",O="Google",P="Huawei",R="LG",M="Microsoft",D="Motorola",$="Opera",X="Samsung",le="Sharp",H="Sony",ee="Xiaomi",J="Zebra",te="Facebook",re="Chromium OS",z="Mac OS",G=" Browser",Z=function($e,K){var F={};for(var W in $e)K[W]&&K[W].length%2===0?F[W]=K[W].concat($e[W]):F[W]=$e[W];return F},me=function($e){for(var K={},F=0;F<$e.length;F++)K[$e[F].toUpperCase()]=$e[F];return K},be=function($e,K){return typeof $e===u?Ce(K).indexOf(Ce($e))!==-1:!1},Ce=function($e){return $e.toLowerCase()},Fe=function($e){return typeof $e===u?$e.replace(/[^\d\.]/g,a).split(".")[0]:n},Ue=function($e,K){if(typeof $e===u)return $e=$e.replace(/^\s\s*/,a),typeof K===l?$e:$e.substring(0,B)},Ke=function($e,K){for(var F=0,W,ie,pe,we,he,De;F0?we.length===2?typeof we[1]==o?this[we[0]]=we[1].call(this,De):this[we[0]]=we[1]:we.length===3?typeof we[1]===o&&!(we[1].exec&&we[1].test)?this[we[0]]=De?we[1].call(this,De,we[2]):n:this[we[0]]=De?De.replace(we[1],we[2]):n:we.length===4&&(this[we[0]]=De?we[3].call(this,De.replace(we[1],we[2])):n):this[we]=De||n;F+=2}},lt=function($e,K){for(var F in K)if(typeof K[F]===c&&K[F].length>0){for(var W=0;W2&&(he[h]="iPad",he[m]=S),he},this.getEngine=function(){var he={};return he[g]=n,he[_]=n,Ke.call(he,W,pe.engine),he},this.getOS=function(){var he={};return he[g]=n,he[_]=n,Ke.call(he,W,pe.os),we&&!he[g]&&ie&&ie.platform&&ie.platform!="Unknown"&&(he[g]=ie.platform.replace(/chrome os/i,re).replace(/macos/i,z)),he},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return W},this.setUA=function(he){return W=typeof he===u&&he.length>B?Ue(he,B):he,this},this.setUA(W),this};Ie.VERSION=i,Ie.BROWSER=me([g,_,f]),Ie.CPU=me([v]),Ie.DEVICE=me([h,w,m,b,A,j,S,U,I]),Ie.ENGINE=Ie.OS=me([g,_]),t.exports&&(e=t.exports=Ie),e.UAParser=Ie;var Ne=typeof r!==l&&(r.jQuery||r.Zepto);if(Ne&&!Ne.ua){var Pe=new Ie;Ne.ua=Pe.getResult(),Ne.ua.get=function(){return Pe.getUA()},Ne.ua.set=function($e){Pe.setUA($e);var K=Pe.getResult();for(var F in K)Ne.ua[F]=K[F]}}})(typeof window=="object"?window:Xt)})(CI,CI.exports);var Xve=CI.exports;Object.defineProperty(kt,"__esModule",{value:!0});function ebe(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Ua=C,Mn=ebe(Ua),cJ=Xve,yh=new cJ,Ha=yh.getBrowser(),tbe=yh.getCPU(),jo=yh.getDevice(),bN=yh.getEngine(),wh=yh.getOS(),Ew=yh.getUA(),uJ=function(e){return yh.setUA(e)},_w=function(e){if(!e){console.error("No userAgent string was provided");return}var r=new cJ(e);return{UA:r,browser:r.getBrowser(),cpu:r.getCPU(),device:r.getDevice(),engine:r.getEngine(),os:r.getOS(),ua:r.getUA(),setUserAgent:function(i){return r.setUA(i)}}},dJ=Object.freeze({ClientUAInstance:yh,browser:Ha,cpu:tbe,device:jo,engine:bN,os:wh,ua:Ew,setUa:uJ,parseUserAgent:_w});function HO(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function rbe(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function bl(t,e){if(t==null)return{};var r=lbe(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function d6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function cbe(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return d6(t)}function ube(t,e){return dbe(t)||fbe(t,e)||hbe(t,e)||pbe()}function dbe(t){if(Array.isArray(t))return t}function fbe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,s,o;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(l){a=!0,o=l}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw o}}return n}}function hbe(t,e){if(t){if(typeof t=="string")return GO(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return GO(t,e)}}function GO(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&arguments[1]!==void 0?arguments[1]:"none";return e||r},xN=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},EN=function(e){var r=xN();return r&&r.platform&&(r.platform.indexOf(e)!==-1||r.platform==="MacIntel"&&r.maxTouchPoints>1&&!window.MSStream)},wbe=function(e,r,n,i,a){return{isBrowser:e,browserMajorVersion:dr(r.major),browserFullVersion:dr(r.version),browserName:dr(r.name),engineName:dr(n.name),engineVersion:dr(n.version),osName:dr(i.name),osVersion:dr(i.version),userAgent:dr(a)}},qO=function(e,r,n,i){return rbe({},e,{vendor:dr(r.vendor),model:dr(r.model),os:dr(n.name),osVersion:dr(n.version),ua:dr(i)})},vbe=function(e,r,n,i){return{isSmartTV:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},bbe=function(e,r,n,i){return{isConsole:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},xbe=function(e,r,n,i){return{isWearable:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},Ebe=function(e,r,n,i,a){return{isEmbedded:e,vendor:dr(r.vendor),model:dr(r.model),engineName:dr(n.name),engineVersion:dr(n.version),osName:dr(i.name),osVersion:dr(i.version),userAgent:dr(a)}};function _be(t){var e=t?_w(t):dJ,r=e.device,n=e.browser,i=e.engine,a=e.os,s=e.ua,o=mbe(r.type),l=o.isBrowser,c=o.isMobile,u=o.isTablet,f=o.isSmartTV,h=o.isConsole,g=o.isWearable,m=o.isEmbedded;if(l)return wbe(l,n,i,a,s);if(f)return vbe(f,i,a,s);if(h)return bbe(h,i,a,s);if(c||u)return qO(o,r,a,s);if(g)return xbe(g,i,a,s);if(m)return Ebe(m,r,i,a,s)}var fJ=function(e){var r=e.type;return r===Na.Mobile},hJ=function(e){var r=e.type;return r===Na.Tablet},pJ=function(e){var r=e.type;return r===Na.Mobile||r===Na.Tablet},gJ=function(e){var r=e.type;return r===Na.SmartTv},C5=function(e){var r=e.type;return r===Na.Browser},mJ=function(e){var r=e.type;return r===Na.Wearable},yJ=function(e){var r=e.type;return r===Na.Console},wJ=function(e){var r=e.type;return r===Na.Embedded},vJ=function(e){var r=e.vendor;return dr(r)},bJ=function(e){var r=e.model;return dr(r)},xJ=function(e){var r=e.type;return dr(r,"browser")},EJ=function(e){var r=e.name;return r===ym.Android},_J=function(e){var r=e.name;return r===ym.Windows},CJ=function(e){var r=e.name;return r===ym.MAC_OS},SJ=function(e){var r=e.name;return r===ym.WindowsPhone},AJ=function(e){var r=e.name;return r===ym.IOS},IJ=function(e){var r=e.version;return dr(r)},MJ=function(e){var r=e.name;return dr(r)},TJ=function(e){var r=e.name;return r===Gs.Chrome},kJ=function(e){var r=e.name;return r===Gs.Firefox},NJ=function(e){var r=e.name;return r===Gs.Chromium},S5=function(e){var r=e.name;return r===Gs.Edge},LJ=function(e){var r=e.name;return r===Gs.Yandex},jJ=function(e){var r=e.name;return r===Gs.Safari||r===Gs.MobileSafari},$J=function(e){var r=e.name;return r===Gs.MobileSafari},PJ=function(e){var r=e.name;return r===Gs.Opera},RJ=function(e){var r=e.name;return r===Gs.InternetExplorer||r===Gs.Ie},DJ=function(e){var r=e.name;return r===Gs.MIUI},OJ=function(e){var r=e.name;return r===Gs.SamsungBrowser},FJ=function(e){var r=e.version;return dr(r)},UJ=function(e){var r=e.major;return dr(r)},BJ=function(e){var r=e.name;return dr(r)},zJ=function(e){var r=e.name;return dr(r)},WJ=function(e){var r=e.version;return dr(r)},HJ=function(){var e=xN(),r=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof r=="string"?/electron/.test(r):!1},og=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},GJ=function(){var e=xN();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},Jc=function(){return EN("iPad")},qJ=function(){return EN("iPhone")},VJ=function(){return EN("iPod")},YJ=function(e){return dr(e)};function KJ(t){var e=t||dJ,r=e.device,n=e.browser,i=e.os,a=e.engine,s=e.ua;return{isSmartTV:gJ(r),isConsole:yJ(r),isWearable:mJ(r),isEmbedded:wJ(r),isMobileSafari:$J(n)||Jc(),isChromium:NJ(n),isMobile:pJ(r)||Jc(),isMobileOnly:fJ(r),isTablet:hJ(r)||Jc(),isBrowser:C5(r),isDesktop:C5(r),isAndroid:EJ(i),isWinPhone:SJ(i),isIOS:AJ(i)||Jc(),isChrome:TJ(n),isFirefox:kJ(n),isSafari:jJ(n),isOpera:PJ(n),isIE:RJ(n),osVersion:IJ(i),osName:MJ(i),fullBrowserVersion:FJ(n),browserVersion:UJ(n),browserName:BJ(n),mobileVendor:vJ(r),mobileModel:bJ(r),engineName:zJ(a),engineVersion:WJ(a),getUA:YJ(s),isEdge:S5(n)||og(s),isYandex:LJ(n),deviceType:xJ(r),isIOS13:GJ(),isIPad13:Jc(),isIPhone13:qJ(),isIPod13:VJ(),isElectron:HJ(),isEdgeChromium:og(s),isLegacyEdge:S5(n)&&!og(s),isWindows:_J(i),isMacOs:CJ(i),isMIUI:DJ(n),isSamsungBrowser:OJ(n)}}var JJ=gJ(jo),ZJ=yJ(jo),QJ=mJ(jo),Cbe=wJ(jo),Sbe=$J(Ha)||Jc(),Abe=NJ(Ha),l9=pJ(jo)||Jc(),XJ=fJ(jo),eZ=hJ(jo)||Jc(),tZ=C5(jo),Ibe=C5(jo),rZ=EJ(wh),nZ=SJ(wh),iZ=AJ(wh)||Jc(),Mbe=TJ(Ha),Tbe=kJ(Ha),kbe=jJ(Ha),Nbe=PJ(Ha),aZ=RJ(Ha),Lbe=IJ(wh),jbe=MJ(wh),$be=FJ(Ha),Pbe=UJ(Ha),Rbe=BJ(Ha),Dbe=vJ(jo),Obe=bJ(jo),Fbe=zJ(bN),Ube=WJ(bN),Bbe=YJ(Ew),zbe=S5(Ha)||og(Ew),Wbe=LJ(Ha),Hbe=xJ(jo),Gbe=GJ(),qbe=Jc(),Vbe=qJ(),Ybe=VJ(),Kbe=HJ(),Jbe=og(Ew),Zbe=S5(Ha)&&!og(Ew),Qbe=_J(wh),Xbe=CJ(wh),e4e=DJ(Ha),t4e=OJ(Ha),r4e=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var r=_w(e),n=r.device,i=r.browser,a=r.os,s=r.engine,o=r.ua;return KJ({device:n,browser:i,os:a,engine:s,ua:o})},n4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return rZ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},i4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return tZ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},a4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return aZ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},s4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return iZ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},o4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return l9?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},l4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return eZ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},c4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return nZ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},u4e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=bl(e,["renderWithFragment","children","viewClassName","style"]);return XJ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},d4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return JJ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},f4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return ZJ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},h4e=function(e){var r=e.renderWithFragment,n=e.children,i=bl(e,["renderWithFragment","children"]);return QJ?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",i,n):null},p4e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=e.condition,a=bl(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?r?Mn.createElement(Ua.Fragment,null,n):Mn.createElement("div",a,n):null};function g4e(t){return function(e){obe(r,e);function r(n){var i;return nbe(this,r),i=cbe(this,AI(r).call(this,n)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(d6(i)),i.onOrientationChange=i.onOrientationChange.bind(d6(i)),i.onPageLoad=i.onPageLoad.bind(d6(i)),i.state={isLandscape:!1,isPortrait:!1},i}return abe(r,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var i=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:i===0,isLandscape:i===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":Ay(window))!==void 0&&l9&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return Mn.createElement(t,SI({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),r}(Mn.Component)}function m4e(){var t=Ua.useState(function(){var a=window.innerWidth>window.innerHeight?90:0;return{isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"}}),e=ube(t,2),r=e[0],n=e[1],i=Ua.useCallback(function(){var a=window.innerWidth>window.innerHeight?90:0,s={isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"};r.orientation!==s.orientation&&n(s)},[r.orientation]);return Ua.useEffect(function(){return(typeof window>"u"?"undefined":Ay(window))!==void 0&&l9&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),r}function sZ(t){var e=t||window.navigator.userAgent;return _w(e)}function y4e(t){var e=t||window.navigator.userAgent,r=sZ(e),n=KJ(r);return[n,r]}kt.AndroidView=n4e;kt.BrowserTypes=Gs;kt.BrowserView=i4e;kt.ConsoleView=f4e;kt.CustomView=p4e;kt.IEView=a4e;kt.IOSView=s4e;kt.MobileOnlyView=u4e;kt.MobileView=o4e;kt.OsTypes=ym;kt.SmartTVView=d4e;kt.TabletView=l4e;kt.WearableView=h4e;kt.WinPhoneView=c4e;kt.browserName=Rbe;kt.browserVersion=Pbe;kt.deviceDetect=_be;kt.deviceType=Hbe;kt.engineName=Fbe;kt.engineVersion=Ube;kt.fullBrowserVersion=$be;kt.getSelectorsByUserAgent=r4e;kt.getUA=Bbe;var w4e=kt.isAndroid=rZ;kt.isBrowser=tZ;kt.isChrome=Mbe;kt.isChromium=Abe;kt.isConsole=ZJ;kt.isDesktop=Ibe;kt.isEdge=zbe;kt.isEdgeChromium=Jbe;kt.isElectron=Kbe;kt.isEmbedded=Cbe;var v4e=kt.isFirefox=Tbe;kt.isIE=aZ;var _N=kt.isIOS=iZ;kt.isIOS13=Gbe;kt.isIPad13=qbe;kt.isIPhone13=Vbe;kt.isIPod13=Ybe;kt.isLegacyEdge=Zbe;kt.isMIUI=e4e;kt.isMacOs=Xbe;var ma=kt.isMobile=l9;kt.isMobileOnly=XJ;kt.isMobileSafari=Sbe;kt.isOpera=Nbe;var b4e=kt.isSafari=kbe;kt.isSamsungBrowser=t4e;kt.isSmartTV=JJ;kt.isTablet=eZ;kt.isWearable=QJ;kt.isWinPhone=nZ;kt.isWindows=Qbe;kt.isYandex=Wbe;kt.mobileModel=Obe;kt.mobileVendor=Dbe;kt.osName=jbe;kt.osVersion=Lbe;kt.parseUserAgent=_w;kt.setUserAgent=ybe;kt.useDeviceData=sZ;kt.useDeviceSelectors=y4e;kt.useMobileOrientation=m4e;kt.withOrientationChange=g4e;const Cw="abi/5.7.0",Hr=new Le(Cw),W0={};let VO={calldata:!0,memory:!0,storage:!0},x4e={calldata:!0,memory:!0};function r4(t,e){if(t==="bytes"||t==="string"){if(VO[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&x4e[e])return!0;return(VO[e]||e==="payable")&&Hr.throwArgumentError("invalid modifier","name",e),!1}function E4e(t,e){let r=t;function n(o){Hr.throwArgumentError(`unexpected character at position ${o}`,"param",t)}t=t.replace(/\s/g," ");function i(o){let l={type:"",name:"",parent:o,state:{allowType:!0}};return e&&(l.indexed=!1),l}let a={type:"",name:"",state:{allowType:!0}},s=a;for(let o=0;oJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Qr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Qr.full?", ":",")+")"):r+=this.type,e!==Qr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Qr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Ji.fromString(e,r):Ji.fromObject(e)}static fromObject(e){return Ji.isParamType(e)?e:new Ji(W0,{name:e.name||null,type:Cp(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Ji.fromObject):null})}static fromString(e,r){function n(i){return Ji.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(E4e(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function d3(t,e){return S4e(t).map(r=>Ji.fromString(r,e))}class bd{constructor(e,r){e!==W0&&Hr.throwError("use a static from method",Le.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),f6(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return bd.isFragment(e)?e:typeof e=="string"?bd.fromString(e):bd.fromObject(e)}static fromObject(e){if(bd.isFragment(e))return e;switch(e.type){case"function":return Qc.fromObject(e);case"event":return md.fromObject(e);case"constructor":return Zc.fromObject(e);case"error":return Mf.fromObject(e);case"fallback":case"receive":return null}return Hr.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?md.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?Qc.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?Zc.fromString(e.trim()):e.split(" ")[0]==="error"?Mf.fromString(e.substring(5).trim()):Hr.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class md extends bd{format(e){if(e||(e=Qr.sighash),Qr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Qr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Qr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Qr.full?", ":",")+") ",e!==Qr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?md.fromString(e):md.fromObject(e)}static fromObject(e){if(md.isEventFragment(e))return e;e.type!=="event"&&Hr.throwArgumentError("invalid event object","value",e);const r={name:f3(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ji.fromObject):[],type:"event"};return new md(W0,r)}static fromString(e){let r=e.match(h3);r||Hr.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Hr.warn("unknown modifier: "+i)}}),md.fromObject({name:r[1].trim(),anonymous:n,inputs:d3(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function oZ(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Hr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Hr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=nt.from(r[1]),r[0]):t}function lZ(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function cZ(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Hr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Hr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Hr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Hr.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Hr.throwArgumentError("unable to determine stateMutability","value",t),e}class Zc extends bd{format(e){if(e||(e=Qr.sighash),Qr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Qr.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===Qr.sighash&&Hr.throwError("cannot format a constructor for sighash",Le.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Qr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?Zc.fromString(e):Zc.fromObject(e)}static fromObject(e){if(Zc.isConstructorFragment(e))return e;e.type!=="constructor"&&Hr.throwArgumentError("invalid constructor object","value",e);let r=cZ(e);r.constant&&Hr.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ji.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new Zc(W0,n)}static fromString(e){let r={type:"constructor"};e=oZ(e,r);let n=e.match(h3);return(!n||n[1].trim()!=="constructor")&&Hr.throwArgumentError("invalid constructor string","value",e),r.inputs=d3(n[2].trim(),!1),lZ(n[3].trim(),r),Zc.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class Qc extends Zc{format(e){if(e||(e=Qr.sighash),Qr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Qr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Qr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Qr.full?", ":",")+") ",e!==Qr.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?Qc.fromString(e):Qc.fromObject(e)}static fromObject(e){if(Qc.isFunctionFragment(e))return e;e.type!=="function"&&Hr.throwArgumentError("invalid function object","value",e);let r=cZ(e);const n={type:e.type,name:f3(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Ji.fromObject):[],outputs:e.outputs?e.outputs.map(Ji.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new Qc(W0,n)}static fromString(e){let r={type:"function"};e=oZ(e,r);let n=e.split(" returns ");n.length>2&&Hr.throwArgumentError("invalid function string","value",e);let i=n[0].match(h3);if(i||Hr.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&f3(r.name),r.inputs=d3(i[2],!1),lZ(i[3].trim(),r),n.length>1){let a=n[1].match(h3);(a[1].trim()!=""||a[3].trim()!="")&&Hr.throwArgumentError("unexpected tokens","value",e),r.outputs=d3(a[2],!1)}else r.outputs=[];return Qc.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function YO(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Hr.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class Mf extends bd{format(e){if(e||(e=Qr.sighash),Qr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Qr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Qr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Qr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?Mf.fromString(e):Mf.fromObject(e)}static fromObject(e){if(Mf.isErrorFragment(e))return e;e.type!=="error"&&Hr.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:f3(e.name),inputs:e.inputs?e.inputs.map(Ji.fromObject):[]};return YO(new Mf(W0,r))}static fromString(e){let r={type:"error"},n=e.match(h3);return n||Hr.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&f3(r.name),r.inputs=d3(n[2],!1),YO(Mf.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Cp(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const C4e=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function f3(t){return(!t||!t.match(C4e))&&Hr.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const h3=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function S4e(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&CN.throwError("value out-of-bounds",Le.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Ds([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class A5{constructor(e,r,n,i){st(this,"_data",er(e)),st(this,"wordSize",r||32),st(this,"_coerceFunc",n),st(this,"allowLoose",i),this._offset=0}get data(){return Bt(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):A5.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:CN.throwError("data out-of-bounds",Le.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new A5(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return nt.from(this.readBytes(this.wordSize))}}class I4e extends Vd{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Ir(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Ir(Bn(e.readValue().toHexString(),20))}}class M4e extends Vd{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Hp=new Le(Cw);function uZ(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(c=>{const u=c.localName;return u||Hp.throwError("cannot encode object for signature with missing names",Le.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]&&Hp.throwError("cannot encode object for signature with duplicate names",Le.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]=!0,r[u]})}else Hp.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Hp.throwArgumentError("types/value length mismatch","tuple",r);let i=new MI(t.wordSize),a=new MI(t.wordSize),s=[];e.forEach((l,c)=>{let u=n[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();s.push(g=>{h(g+f)})}else l.encode(i,u)}),s.forEach(l=>{l(i.length)});let o=t.appendWriter(i);return o+=t.appendWriter(a),o}function dZ(t,e){let r=[],n=t.subReader(0);e.forEach(a=>{let s=null;if(a.dynamic){let o=t.readValue(),l=n.subReader(o.toNumber());try{s=a.decode(l)}catch(c){if(c.code===Le.errors.BUFFER_OVERRUN)throw c;s=c,s.baseType=a.name,s.name=a.localName,s.type=a.type}}else try{s=a.decode(t)}catch(o){if(o.code===Le.errors.BUFFER_OVERRUN)throw o;s=o,s.baseType=a.name,s.name=a.localName,s.type=a.type}s!=null&&r.push(s)});const i=e.reduce((a,s)=>{const o=s.localName;return o&&(a[o]||(a[o]=0),a[o]++),a},{});e.forEach((a,s)=>{let o=a.localName;if(!o||i[o]!==1||(o==="length"&&(o="_length"),r[o]!=null))return;const l=r[s];l instanceof Error?Object.defineProperty(r,o,{enumerable:!0,get:()=>{throw l}}):r[o]=l});for(let a=0;a{throw s}})}return Object.freeze(r)}class T4e extends Vd{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",a=r===-1||e.dynamic;super("array",i,n,a),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Hp.throwError("insufficient data length",Le.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i{s.dynamic&&(n=!0),i.push(s.type)});const a="tuple("+i.join(",")+")";super("tuple",a,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const a=i.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});return this.coders.forEach((n,i)=>{let a=n.localName;!a||r[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,r){return uZ(e,this.coders,r)}decode(e){return e.coerce(this.name,dZ(e,this.coders))}}const i4=new Le(Cw),R4e=new RegExp(/^bytes([0-9]*)$/),D4e=new RegExp(/^(u?int)([0-9]*)$/);class O4e{constructor(e){st(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new I4e(e.name);case"bool":return new k4e(e.name);case"string":return new P4e(e.name);case"bytes":return new N4e(e.name);case"array":return new T4e(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new n4((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new j4e(e.name)}let r=e.type.match(D4e);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&i4.throwArgumentError("invalid "+r[1]+" bit length","param",e),new $4e(n/8,r[1]==="int",e.name)}if(r=e.type.match(R4e),r){let n=parseInt(r[1]);return(n===0||n>32)&&i4.throwArgumentError("invalid bytes length","param",e),new L4e(n,e.name)}return i4.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new A5(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new MI(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Ji.from(i)));return new n4(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&i4.throwError("types/values length mismatch",Le.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(s=>this._getCoder(Ji.from(s))),i=new n4(n,"_"),a=this._getWriter();return i.encode(a,r),a.data}decode(e,r,n){const i=e.map(s=>this._getCoder(Ji.from(s)));return new n4(i,"_").decode(this._getReader(er(r),n))}}const F4e=new O4e,Gn=new Le(Cw);class U4e extends ww{}class B4e extends ww{}class z4e extends ww{}class TI extends ww{static isIndexed(e){return!!(e&&e._isIndexed)}}const W4e={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function KO(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class JO{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,st(this,"fragments",r.map(n=>bd.from(n)).filter(n=>n!=null)),st(this,"_abiCoder",tu(new.target,"getAbiCoder")()),st(this,"functions",{}),st(this,"errors",{}),st(this,"events",{}),st(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Gn.warn("duplicate definition - constructor");return}st(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let a=n.format();if(i[a]){Gn.warn("duplicate definition - "+a);return}i[a]=n}),this.deploy||st(this,"deploy",Zc.from({payable:!1,type:"constructor"})),st(this,"_isInterface",!0)}format(e){e||(e=Qr.full),e===Qr.sighash&&Gn.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===Qr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return F4e}static getAddress(e){return Ir(e)}static getSighash(e){return ka(Wp(e.format()),0,4)}static getEventTopic(e){return Wp(e.format())}getFunction(e){if(Kr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Gn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching function","name",n):i.length>1&&Gn.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[Qc.fromString(e).format()];return r||Gn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Kr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Gn.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching event","name",n):i.length>1&&Gn.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[md.fromString(e).format()];return r||Gn.throwArgumentError("no matching event","signature",e),r}getError(e){if(Kr(e)){const n=tu(this.constructor,"getSighash");for(const i in this.errors){const a=this.errors[i];if(e===n(a))return this.errors[i]}Gn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching error","name",n):i.length>1&&Gn.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[Qc.fromString(e).format()];return r||Gn.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return tu(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),tu(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=er(r);return Bt(n.slice(0,4))!==this.getSighash(e)&&Gn.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Bt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),Bt(Ds([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=er(r);return Bt(n.slice(0,4))!==this.getSighash(e)&&Gn.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Bt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Bt(Ds([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=er(r),i=null,a="",s=null,o=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const c=Bt(n.slice(0,4)),u=W4e[c];if(u)s=this._abiCoder.decode(u.inputs,n.slice(4)),o=u.name,l=u.signature,u.reason&&(i=s[0]),o==="Error"?a=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:o==="Panic"&&(a=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const f=this.getError(c);s=this._abiCoder.decode(f.inputs,n.slice(4)),o=f.name,l=f.format()}catch{}break}}return Gn.throwError("call revert exception"+a,Le.errors.CALL_EXCEPTION,{method:e.format(),data:Bt(r),errorArgs:s,errorName:o,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Bt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Gn.throwError("too many arguments for "+e.format(),Le.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(a,s)=>a.type==="string"?Wp(s):a.type==="bytes"?_i(Bt(s)):(a.type==="bool"&&typeof s=="boolean"&&(s=s?"0x01":"0x00"),a.type.match(/^u?int/)&&(s=nt.from(s).toHexString()),a.type==="address"&&this._abiCoder.encode(["address"],[s]),Bn(Bt(s),32));for(r.forEach((a,s)=>{let o=e.inputs[s];if(!o.indexed){a!=null&&Gn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,a);return}a==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Gn.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,a):Array.isArray(a)?n.push(a.map(l=>i(o,l))):n.push(i(o,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],a=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Gn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((s,o)=>{const l=r[o];if(s.indexed)if(s.type==="string")n.push(Wp(l));else if(s.type==="bytes")n.push(_i(l));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([s.type],[l]))}else i.push(s),a.push(l)}),{data:this._abiCoder.encode(i,a),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let h=this.getEventTopic(e);(!Kr(n[0],32)||n[0].toLowerCase()!==h)&&Gn.throwError("fragment/topic mismatch",Le.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:h,value:n[0]}),n=n.slice(1)}let i=[],a=[],s=[];e.inputs.forEach((h,g)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(i.push(Ji.fromObject({type:"bytes32",name:h.name})),s.push(!0)):(i.push(h),s.push(!1)):(a.push(h),s.push(!1))});let o=n!=null?this._abiCoder.decode(i,Ds(n)):null,l=this._abiCoder.decode(a,r,!0),c=[],u=0,f=0;e.inputs.forEach((h,g)=>{if(h.indexed)if(o==null)c[g]=new TI({_isIndexed:!0,hash:null});else if(s[g])c[g]=new TI({_isIndexed:!0,hash:o[f++]});else try{c[g]=o[f++]}catch(m){c[g]=m}else try{c[g]=l[u++]}catch(m){c[g]=m}if(h.name&&c[h.name]==null){const m=c[g];m instanceof Error?Object.defineProperty(c,h.name,{enumerable:!0,get:()=>{throw KO(`property ${JSON.stringify(h.name)}`,m)}}):c[h.name]=m}});for(let h=0;h{throw KO(`index ${h}`,g)}})}return Object.freeze(c)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new B4e({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:nt.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new U4e({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=Bt(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new z4e({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const H4e="contracts/5.7.0";var H0=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const hi=new Le(H4e);function I5(t,e){return H0(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&hi.throwArgumentError("invalid address or ENS name","name",r);try{return Ir(r)}catch{}t||hi.throwError("a provider or signer is needed to resolve ENS names",Le.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&hi.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function h6(t,e,r){return H0(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>h6(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield I5(t,e):r.type==="tuple"?yield h6(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>h6(t,n,r.arrayChildren))):Promise.reject(hi.makeError("invalid value for array",Le.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function c9(t,e,r){return H0(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Pi(r.pop())),hi.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=vi({override:I5(t.signer,n.from),signer:t.signer.getAddress()}).then(c=>H0(this,void 0,void 0,function*(){return Ir(c.signer)!==c.override&&hi.throwError("Contract with a Signer cannot override from",Le.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),c.override})):n.from=t.signer.getAddress():n.from&&(n.from=I5(t.provider,n.from));const i=yield vi({args:h6(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:vi(n)||{}}),a=t.interface.encodeFunctionData(e,i.args),s={data:a,to:i.address},o=i.overrides;if(o.nonce!=null&&(s.nonce=nt.from(o.nonce).toNumber()),o.gasLimit!=null&&(s.gasLimit=nt.from(o.gasLimit)),o.gasPrice!=null&&(s.gasPrice=nt.from(o.gasPrice)),o.maxFeePerGas!=null&&(s.maxFeePerGas=nt.from(o.maxFeePerGas)),o.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=nt.from(o.maxPriorityFeePerGas)),o.from!=null&&(s.from=o.from),o.type!=null&&(s.type=o.type),o.accessList!=null&&(s.accessList=mm(o.accessList)),s.gasLimit==null&&e.gas!=null){let c=21e3;const u=er(a);for(let f=0;fn[c]!=null);return l.length&&hi.throwError(`cannot override ${l.map(c=>JSON.stringify(c)).join(",")}`,Le.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),s})}function G4e(t,e){return function(...r){return c9(t,e,r)}}function q4e(t,e){const r=t.signer||t.provider;return function(...n){return H0(this,void 0,void 0,function*(){r||hi.throwError("estimate require a provider or signer",Le.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield c9(t,e,n);return yield r.estimateGas(i)})}}function V4e(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(a=>{let s=Nd(a),o=null;try{o=t.interface.parseLog(a)}catch{}return o&&(s.args=o.args,s.decode=(l,c)=>t.interface.decodeEventLog(o.eventFragment,l,c),s.event=o.name,s.eventSignature=o.signature),s.removeListener=()=>t.provider,s.getBlock=()=>t.provider.getBlock(i.blockHash),s.getTransaction=()=>t.provider.getTransaction(i.transactionHash),s.getTransactionReceipt=()=>Promise.resolve(i),s}),i))}function hZ(t,e,r){const n=t.signer||t.provider;return function(...i){return H0(this,void 0,void 0,function*(){let a;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Pi(i.pop());l.blockTag!=null&&(a=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(a));const s=yield c9(t,e,i),o=yield n.call(s,a);try{let l=t.interface.decodeFunctionResult(e,o);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===Le.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=s),l}})}}function Y4e(t,e){return function(...r){return H0(this,void 0,void 0,function*(){t.signer||hi.throwError("sending a transaction requires a signer",Le.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield c9(t,e,r),i=yield t.signer.sendTransaction(n);return V4e(t,i),i})}}function ZO(t,e,r){return e.constant?hZ(t,e,r):Y4e(t,e)}function pZ(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class p3{constructor(e,r){st(this,"tag",e),st(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class K4e extends p3{constructor(){super("error",null)}}class QO extends p3{constructor(e,r,n,i){const a={address:e};let s=r.getEventTopic(n);i?(s!==i[0]&&hi.throwArgumentError("topic mismatch","topics",i),a.topics=i.slice()):a.topics=[s],super(pZ(a),a),st(this,"address",e),st(this,"interface",r),st(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=A4e(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class XO extends p3{constructor(e,r){super("*",{address:e}),st(this,"address",e),st(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class J4e{constructor(e,r,n){st(this,"interface",tu(new.target,"getInterface")(r)),n==null?(st(this,"provider",null),st(this,"signer",null)):xw.isSigner(n)?(st(this,"provider",n.provider||null),st(this,"signer",n)):t9.isProvider(n)?(st(this,"provider",n),st(this,"signer",null)):hi.throwArgumentError("invalid signer or provider","signerOrProvider",n),st(this,"callStatic",{}),st(this,"estimateGas",{}),st(this,"functions",{}),st(this,"populateTransaction",{}),st(this,"filters",{});{const s={};Object.keys(this.interface.events).forEach(o=>{const l=this.interface.events[o];st(this.filters,o,(...c)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,c)})),s[l.name]||(s[l.name]=[]),s[l.name].push(o)}),Object.keys(s).forEach(o=>{const l=s[o];l.length===1?st(this.filters,o,this.filters[l[0]]):hi.warn(`Duplicate definition of ${o} (${l.join(", ")})`)})}if(st(this,"_runningEvents",{}),st(this,"_wrappedEmits",{}),e==null&&hi.throwArgumentError("invalid contract address or ENS name","addressOrName",e),st(this,"address",e),this.provider)st(this,"resolvedAddress",I5(this.provider,e));else try{st(this,"resolvedAddress",Promise.resolve(Ir(e)))}catch{hi.throwError("provider is required to use ENS name as contract address",Le.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(s=>{});const i={},a={};Object.keys(this.interface.functions).forEach(s=>{const o=this.interface.functions[s];if(a[s]){hi.warn(`Duplicate ABI entry for ${JSON.stringify(s)}`);return}a[s]=!0;{const l=o.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(s)}this[s]==null&&st(this,s,ZO(this,o,!0)),this.functions[s]==null&&st(this.functions,s,ZO(this,o,!1)),this.callStatic[s]==null&&st(this.callStatic,s,hZ(this,o,!0)),this.populateTransaction[s]==null&&st(this.populateTransaction,s,G4e(this,o)),this.estimateGas[s]==null&&st(this.estimateGas,s,q4e(this,o))}),Object.keys(i).forEach(s=>{const o=i[s];if(o.length>1)return;s=s.substring(1);const l=o[0];try{this[s]==null&&st(this,s,this[l])}catch{}this.functions[s]==null&&st(this.functions,s,this.functions[l]),this.callStatic[s]==null&&st(this.callStatic,s,this.callStatic[l]),this.populateTransaction[s]==null&&st(this.populateTransaction,s,this.populateTransaction[l]),this.estimateGas[s]==null&&st(this.estimateGas,s,this.estimateGas[l])})}static getContractAddress(e){return cK(e)}static getInterface(e){return JO.isInterface(e)?e:new JO(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&hi.throwError("contract not deployed",Le.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||hi.throwError("sending a transactions require a signer",Le.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Pi(e||{});return["from","to"].forEach(function(n){r[n]!=null&&hi.throwError("cannot override "+n,Le.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new o9(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&st(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return TI.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new K4e);if(e==="event")return this._normalizeRunningEvent(new p3("event",null));if(e==="*")return this._normalizeRunningEvent(new XO(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new QO(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new QO(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new p3(pZ(r),r))}return this._normalizeRunningEvent(new XO(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=Nd(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||hi.throwError("events require a provider or a signer with a provider",Le.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=a=>{let s=this._wrapEvent(e,a,r);if(s.decodeError==null)try{const o=e.getEmit(s);this.emit(e.filter,...o)}catch(o){s.decodeError=o.error}e.filter!=null&&this.emit("event",s),s.decodeError!=null&&this.emit("error",s.decodeError,s)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),a=Pi(i.filter);return typeof r=="string"&&Kr(r,32)?(n!=null&&hi.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),a.blockHash=r):(a.fromBlock=r??0,a.toBlock=n??"latest"),this.provider.getLogs(a).then(s=>s.map(o=>this._wrapEvent(i,o,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class Z4e extends J4e{}const Q4e="units/5.7.0",X4e=new Le(Q4e),e6e=["wei","kwei","mwei","gwei","szabo","finney","ether"];function t6e(t,e){return s6(t,e)}function eF(t,e){if(typeof t!="string"&&X4e.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=e6e.indexOf(e);r!==-1&&(e=3*r)}return Fc(t,e??18)}function gZ(t){return t6e(t,18)}function kI(t){"@babel/helpers - typeof";return kI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},kI(t)}function r6e(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}function n6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g3(t,e)}function a6e(t){var e=yZ();return function(){var n=m3(t),i;if(e){var a=m3(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return s6e(this,i)}}function s6e(t,e){if(e&&(kI(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return mZ(t)}function mZ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function NI(t){var e=typeof Map=="function"?new Map:void 0;return NI=function(n){if(n===null||!o6e(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 p6(n,arguments,m3(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),g3(i,n)},NI(t)}function p6(t,e,r){return yZ()?p6=Reflect.construct:p6=function(i,a,s){var o=[null];o.push.apply(o,a);var l=Function.bind.apply(i,o),c=new l;return s&&g3(c,s.prototype),c},p6.apply(null,arguments)}function yZ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function o6e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function g3(t,e){return g3=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},g3(t,e)}function m3(t){return m3=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},m3(t)}var ud=function(t){i6e(r,t);var e=a6e(r);function r(n){var i;return n6e(this,r),i=e.call(this,n),Object.setPrototypeOf(mZ(i),r.prototype),i.name=i.constructor.name,i}return r6e(r)}(NI(Error)),SN=2,l6e=17,c6e=3,cs="0-90-9٠-٩۰-۹",u6e="-‐-―−ー-",d6e="//",f6e="..",h6e="  ­​⁠ ",p6e="()()[]\\[\\]",g6e="~⁓∼~",oc="".concat(u6e).concat(d6e).concat(f6e).concat(h6e).concat(p6e).concat(g6e),u9="++";function tF(t,e){t=t.split("-"),e=e.split("-");for(var r=t[0].split("."),n=e[0].split("."),i=0;i<3;i++){var a=Number(r[i]),s=Number(n[i]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]=SN&&L6e.test(t)}function $6e(t){return k6e.test(t)}var aF=new RegExp("(?:"+vZ()+")$","i");function P6e(t){var e=t.search(aF);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(aF),i=1;i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D6e(t,e){if(t){if(typeof t=="string")return sF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return sF(t,e)}}function sF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function U6e(t,e){if(t){if(typeof t=="string")return oF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oF(t,e)}}function oF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);ra?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function W6e(t,e,r){if(e===void 0&&(e={}),r=new sa(r),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return xZ(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function xZ(t,e){switch(p9(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}function $d(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function H6e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=G6e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function G6e(t,e){if(t){if(typeof t=="string")return cF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cF(t,e)}}function cF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0}function EZ(t){return t.replace(new RegExp("[".concat(oc,"]+"),"g")," ").trim()}var _Z=/(\$\d)/;function CZ(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var a=t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(_Z,e.nationalPrefixFormattingRule()):e.format());return n?EZ(a):a}var J6e=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function Z6e(t,e,r){var n=new sa(r);if(n.selectNumberingPlan(t,e),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(J6e.test(n.IDDPrefix()))return n.IDDPrefix()}function Q6e(t){var e=t.number,r=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(r?";ext="+r:"")}function X6e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=e5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e5e(t,e){if(t){if(typeof t=="string")return uF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uF(t,e)}}function uF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var a=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(e.search(a)!==0)continue}if($d(e,i.pattern()))return i}}function sC(t,e,r,n){return e?n(t,e,r):t}function i5e(t,e,r,n,i){var a=h9(n,i.metadata);if(a===r){var s=T5(t,e,"NATIONAL",i);return r==="1"?r+" "+s:s}var o=Z6e(n,void 0,i.metadata);if(o)return"".concat(o," ").concat(r," ").concat(T5(t,null,"INTERNATIONAL",i))}function pF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function gF(t){for(var e=1;e0&&s[1]==="0"))return t}}}function jI(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(t);if(n){var i,a,s=n.length-1,o=s>0&&n[s];if(e.nationalPrefixTransformRule()&&o)i=t.replace(r,e.nationalPrefixTransformRule()),s>1&&(a=n[1]);else{var l=n[0];i=t.slice(l.length),o&&(a=n[1])}var c;if(o){var u=t.indexOf(n[1]),f=t.slice(0,u);f===e.numberingPlan.nationalPrefix()&&(c=e.numberingPlan.nationalPrefix())}else c=n[0];return{nationalNumber:i,nationalPrefix:c,carrierCode:a}}}return{nationalNumber:t}}function $I(t,e){var r=jI(t,e),n=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!f5e(t,i,e))return{nationalNumber:t};if(e.possibleLengths()&&!h5e(i,e))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:n}}function f5e(t,e,r){return!($d(t,r.nationalNumberPattern())&&!$d(e,r.nationalNumberPattern()))}function h5e(t,e){switch(p9(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function AZ(t,e,r,n){var i=e?h9(e,n):r;if(t.indexOf(i)===0){n=new sa(n),n.selectNumberingPlan(e,r);var a=t.slice(i.length),s=$I(a,n),o=s.nationalNumber,l=$I(t,n),c=l.nationalNumber;if(!$d(c,n.nationalNumberPattern())&&$d(o,n.nationalNumberPattern())||p9(c,n)==="TOO_LONG")return{countryCallingCode:i,number:a}}return{number:t}}function IZ(t,e,r,n){if(!t)return{};var i;if(t[0]!=="+"){var a=SZ(t,e,r,n);if(a&&a!==t)i=!0,t="+"+a;else{if(e||r){var s=AZ(t,e,r,n),o=s.countryCallingCode,l=s.number;if(o)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:o,number:l}}return{number:t}}}if(t[1]==="0")return{};n=new sa(n);for(var c=2;c-1<=c6e&&c<=t.length;){var u=t.slice(1,c);if(n.hasCallingCode(u))return n.selectNumberingPlan(u),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:t.slice(c)};c++}return{}}function p5e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=g5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g5e(t,e){if(t){if(typeof t=="string")return mF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mF(t,e)}}function mF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length)return"";var n=t.indexOf(";",r);return n>=0?t.substring(r,n):t.substring(r)}function A5e(t){return t===null?!0:t.length===0?!1:w5e.test(t)||_5e.test(t)}function I5e(t,e){var r=e.extractFormattedPhoneNumber,n=S5e(t);if(!A5e(n))throw new ud("NOT_A_NUMBER");var i;if(n===null)i=r(t)||"";else{i="",n.charAt(0)===kZ&&(i+=n);var a=t.indexOf(wF),s;a>=0?s=a+wF.length:s=0;var o=t.indexOf(RI);i+=t.substring(s,o)}var l=i.indexOf(C5e);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var M5e=250,T5e=new RegExp("["+u9+cs+"]"),k5e=new RegExp("[^"+cs+"#]+$");function N5e(t,e,r){if(e=e||{},r=new sa(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new ud("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var n=j5e(t,e.v2,e.extract),i=n.number,a=n.ext,s=n.error;if(!i){if(e.v2)throw s==="TOO_SHORT"?new ud("TOO_SHORT"):new ud("NOT_A_NUMBER");return{}}var o=P5e(i,e.defaultCountry,e.defaultCallingCode,r),l=o.country,c=o.nationalNumber,u=o.countryCallingCode,f=o.countryCallingCodeSource,h=o.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new ud("INVALID_COUNTRY");return{}}if(!c||c.lengthl6e){if(e.v2)throw new ud("TOO_LONG");return{}}if(e.v2){var g=new IN(u,c,r.metadata);return l&&(g.country=l),h&&(g.carrierCode=h),a&&(g.ext=a),g.__countryCallingCodeSource=f,g}var m=(e.extended?r.hasSelectedNumberingPlan():l)?$d(c,r.nationalNumberPattern()):!1;return e.extended?{country:l,countryCallingCode:u,carrierCode:h,valid:m,possible:m?!0:!!(e.extended===!0&&r.possibleLengths()&&xZ(c,r)),phone:c,ext:a}:m?$5e(l,c,a):{}}function L5e(t,e,r){if(t){if(t.length>M5e){if(r)throw new ud("TOO_LONG");return}if(e===!1)return t;var n=t.search(T5e);if(!(n<0))return t.slice(n).replace(k5e,"")}}function j5e(t,e,r){var n=I5e(t,{extractFormattedPhoneNumber:function(s){return L5e(s,r,e)}});if(!n)return{};if(!j6e(n))return $6e(n)?{error:"TOO_SHORT"}:{};var i=P6e(n);return i.ext?i:{number:n}}function $5e(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}function P5e(t,e,r,n){var i=IZ(lF(t),e,r,n.metadata),a=i.countryCallingCodeSource,s=i.countryCallingCode,o=i.number,l;if(s)n.selectNumberingPlan(s);else if(o&&(e||r))n.selectNumberingPlan(e,r),e&&(l=e),s=r||h9(e,n.metadata);else return{};if(!o)return{countryCallingCodeSource:a,countryCallingCode:s};var c=$I(lF(o),n),u=c.nationalNumber,f=c.carrierCode,h=TZ(s,{nationalNumber:u,defaultCountry:e,metadata:n});return h&&(l=h,h==="001"||n.country(l)),{country:l,countryCallingCode:s,countryCallingCodeSource:a,nationalNumber:u,carrierCode:f}}function vF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function bF(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function t8e(t,e){if(t){if(typeof t=="string")return IF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return IF(t,e)}}function IF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1;)e&1&&(r+=t),e>>=1,t+=t;return r+t}function MF(t,e){return t[e]===")"&&e++,r8e(t.slice(0,e))}function r8e(t){for(var e=[],r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function g8e(t,e){if(t){if(typeof t=="string")return NF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return NF(t,e)}}function NF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&arguments[1]!==void 0?arguments[1]:{},i=n.allowOverflow;if(!r)throw new Error("String is required");var a=DI(r.split(""),this.matchTree,!0);if(a&&a.match&&delete a.matchedChars,!(a&&a.overflow&&!i))return a}}]),t}();function DI(t,e,r){if(typeof e=="string"){var n=t.join("");return e.indexOf(n)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:n.indexOf(e)===0?r&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b8e(t,e){if(t){if(typeof t=="string")return jF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return jF(t,e)}}function jF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0)){var i=this.getTemplateForFormat(r,n);if(i)return this.setNationalNumberTemplate(i,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&A8e.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,a=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":a?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,a=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";ic.length)){var u=new RegExp("^"+l+"$"),f=i.replace(/\d/g,OI);u.test(f)&&(c=f);var h=this.getFormatFormat(r,a),g;if(this.shouldTryNationalPrefixFormattingRule(r,{international:a,nationalPrefix:s})){var m=h.replace(_Z,r.nationalPrefixFormattingRule());if(M5(r.nationalPrefixFormattingRule())===(s||"")+M5("$1")&&(h=m,g=!0,s))for(var w=s.length;w>0;)h=h.replace(/\d/,Gl),w--}var _=c.replace(new RegExp(l),h).replace(new RegExp(OI,"g"),Gl);return g||(o?_=g6(Gl,o.length)+" "+_:s&&(_=g6(Gl,s.length)+this.getSeparatorAfterNationalPrefix(r)+_)),a&&(_=EZ(_)),_}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=n8e(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],MF(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,a=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var s=r.usesNationalPrefix();if(s&&a||!s&&!i)return!0}}}]),t}();function NZ(t,e){return $8e(t)||j8e(t,e)||L8e(t,e)||N8e()}function N8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function L8e(t,e){if(t){if(typeof t=="string")return PF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return PF(t,e)}}function PF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=3;if(n.appendDigits(r),a&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(s){return n.update(s)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=IZ("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,a=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:a}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&z8e.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=jI(r,this.metadata),a=i.nationalPrefix,s=i.nationalNumber,o=i.carrierCode;if(s!==r)return this.onExtractedNationalNumber(a,o,s,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var a=jI(r,this.metadata),s=a.nationalPrefix,o=a.nationalNumber,l=a.carrierCode;if(o!==n)return this.onExtractedNationalNumber(s,l,o,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,a,s){var o,l,c=a.lastIndexOf(i);if(c>=0&&c===a.length-i.length){l=!0;var u=a.slice(0,c);u!==r&&(o=u)}s({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:l,complexPrefixBeforeNationalSignificantNumber:o}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,i=r.IDDPrefix,a=r.digits;if(r.nationalSignificantNumber,!(n||i)){var s=SZ(a,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(s!==void 0&&s!==a)return r.update({IDDPrefix:a.slice(0,a.length-s.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=AZ(r.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode;if(n.number,i)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(r,n){var i=n.country,a=n.callingCode;r.startInternationalNumber(i,a),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}]),t}();function H8e(t){var e=t.search(U8e);if(!(e<0)){t=t.slice(e);var r;return t[0]==="+"&&(r=!0,t=t.slice(1)),t=t.replace(B8e,""),r&&(t="+"+t),t}}function G8e(t){var e=H8e(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function q8e(t){var e=G8e(t),r=NZ(e,2),n=r[0],i=r[1];return F8e.test(n)||(n=""),[n,i]}function V8e(t,e){return Z8e(t)||J8e(t,e)||K8e(t,e)||Y8e()}function Y8e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function K8e(t,e){if(t){if(typeof t=="string")return RF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return RF(t,e)}}function RF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1}},{key:"determineTheCountry",value:function(){this.state.setCountry(TZ(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,i=r.callingCode,a=r.country,s=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+s:"+"+n;if(a||i){var o=a?this.metadata.countryCallingCode():i;return"+"+o+s}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,a=r.callingCode,s=this._getCountry();if(n&&!(!s&&!a)){if(s&&s===this.defaultCountry){var o=new sa(this.metadata.metadata);o.selectNumberingPlan(s);var l=o.numberingPlan.callingCode(),c=this.metadata.getCountryCodesForCallingCode(l);if(c.length>1){var u=MZ(n,{countries:c,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});u&&(s=u)}}var f=new IN(s||a,n,this.metadata.metadata);return i&&(f.carrierCode=i),f}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),t}();function t9e(t){return new sa(t).getCountries()}function r9e(t,e,r){if(e[t])return new IN(t,e[t],r)}const n9e={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},i9e={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0},a9e={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},s9e={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},o9e={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0},l9e={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},c9e={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},u9e={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0},d9e={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},jZ={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},$Z={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0},f9e={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},h9e={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},p9e={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Ss;(Ss={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",Ss.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",Ss.INVALID_DATA="invalid_data",Ss.LINKED_TO_ANOTHER_USER="linked_to_another_user",Ss.ALLOWLIST_REJECTED="allowlist_rejected",Ss.OAUTH_USER_DENIED="oauth_user_denied",Ss.UNKNOWN_AUTH_ERROR="unknown_auth_error",Ss.USER_EXITED_AUTH_FLOW="exited_auth_flow",Ss.MUST_BE_AUTHENTICATED="must_be_authenticated",Ss.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",Ss.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",Ss.CLIENT_REQUEST_TIMEOUT="client_request_timeout",Ss.INVALID_CREDENTIALS="invalid_credentials";let g9e=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},m9e=class extends g9e{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}};const Qi={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};let cC=class extends m9e{constructor(e){var n,i,a;super(e.message,e.code,e.data);let r=Object.values(Qi).find(s=>s.eipCode===e.code);this.details=r||Qi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=Qi.E32002_CONNECTION_ALREADY_PENDING:this.details=Qi.E32002_REQUEST_ALREADY_PENDING:(a=e.message)!=null&&a.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=Qi.E32002_WALLET_LOCKED))}};const Xa=t=>nt.from(t);function FI(t){if(typeof t=="number"||typeof t=="bigint"||typeof t=="string")return t;if(typeof t.toHexString=="function")return t.toHexString();throw Error(`Expected numeric value but received ${t}`)}function y9e(t){let e={};return t.to!==void 0&&(e.to=t.to),t.data!==void 0&&(e.data=t.data),t.chainId!==void 0&&(e.chainId=t.chainId),t.type!==void 0&&(e.type=t.type),t.accessList!==void 0&&(e.accessList=t.accessList),t.nonce!==void 0&&(e.nonce=Xa(t.nonce).toNumber()),t.gasLimit!==void 0&&(e.gasLimit=Xa(t.gasLimit)),t.gasPrice!==void 0&&(e.gasPrice=Xa(t.gasPrice)),t.value!==void 0&&(e.value=Xa(t.value)),t.maxFeePerGas!==void 0&&(e.maxFeePerGas=Xa(t.maxFeePerGas)),t.maxPriorityFeePerGas!==void 0&&(e.maxPriorityFeePerGas=Xa(t.maxPriorityFeePerGas)),e}const PZ=t=>[n9e.id,i9e.id,a9e.id].includes(t),w9e=async(t,e)=>{if(!PZ(t.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(t.type===void 0&&(t.type=2),t.maxFeePerGas)return t;try{let{lastBaseFeePerGas:r}=await e.getFeeData();if(r){let n=r.mul(nt.from(120)).div(nt.from(100));t.maxFeePerGas=FI(n),t.maxPriorityFeePerGas=FI(nt.from(0))}}catch(r){throw Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return t},RZ=t=>[56,97].includes(t),v9e=async(t,e)=>{var r;if(!RZ(t.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(t.type===void 0?t.type=0:(t.type==1||t.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!t.gasPrice){let n=await e.getFeeData();t.gasPrice=(r=n.gasPrice)==null?void 0:r.toHexString()}return t},b9e=["function getL1Fee(bytes memory _data) external view returns (uint256)"],g9=t=>[s9e.id,o9e.id,l9e.id,c9e.id,u9e.id,d9e.id,f9e.id,p9e.id,h9e.id,81457,168587773].includes(t),x9e=async(t,e)=>{if(!g9(t.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(t.type===void 0&&(t.type=2),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{if(!t.maxPriorityFeePerGas){let r=await e.send("eth_maxPriorityFeePerGas",[]);t.maxPriorityFeePerGas=r}if(t.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),t.maxPriorityFeePerGas>=t.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!t.maxFeePerGas){let{lastBaseFeePerGas:r}=await e.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let n=nt.from(r).mul(nt.from(126)).div(nt.from(100)).add(nt.from(t.maxPriorityFeePerGas));t.maxFeePerGas=FI(n)}}catch(r){throw Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return t};async function E9e(t,e){if(!t.chainId||t.chainId&&!g9(t.chainId))return nt.from(0);let r=nt.from(0);try{let n=new Z4e("0x420000000000000000000000000000000000000F",b9e,e),i=y9e(t),a=Ave(i);r=await n.getL1Fee(a)}catch{}return r}var DZ={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Xt,function(){var r=function(a,s){if(s=s||{},typeof a!="function")throw new i("fetch must be a function");if(typeof s!="object")throw new i("defaults must be an object");if(s.retries!==void 0&&!n(s.retries))throw new i("retries must be a positive integer");if(s.retryDelay!==void 0&&!n(s.retryDelay)&&typeof s.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(s.retryOn!==void 0&&!Array.isArray(s.retryOn)&&typeof s.retryOn!="function")throw new i("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return s=Object.assign(o,s),function(c,u){var f=s.retries,h=s.retryDelay,g=s.retryOn;if(u&&u.retries!==void 0)if(n(u.retries))f=u.retries;else throw new i("retries must be a positive integer");if(u&&u.retryDelay!==void 0)if(n(u.retryDelay)||typeof u.retryDelay=="function")h=u.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(u&&u.retryOn)if(Array.isArray(u.retryOn)||typeof u.retryOn=="function")g=u.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(m,w){var _=function(b){var A=typeof Request<"u"&&c instanceof Request?c.clone():c;a(A,u).then(function(S){if(Array.isArray(g)&&g.indexOf(S.status)===-1)m(S);else if(typeof g=="function")try{return Promise.resolve(g(b,null,S)).then(function(j){j?v(b,null,S):m(S)}).catch(w)}catch(j){w(j)}else b=0}function i(a){this.name="ArgumentError",this.message=a}return r})})(DZ);var _9e=DZ.exports;const C9e=To(_9e),OZ={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};let S9e=C9e(fetch,{retries:3,retryDelay:500});const FZ=t=>[jZ.id,$Z.id,OZ.id].includes(t);let uC=t=>({maxPriorityFee:eF(t.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:eF(t.maxFee.toFixed(9),"gwei").toHexString()}),A9e=t=>({safeLow:uC(t.safeLow),standard:uC(t.standard),fast:uC(t.fast)});const I9e=async t=>{let e="";switch(t){case jZ.id:e="https://gasstation.polygon.technology/v2";break;case $Z.id:e="https://gasstation-testnet.polygon.technology/v2";break;case OZ.id:e="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${t} does not support polygon gas stations`)}let r=await S9e(e),n=await r.json();if(r.status>399)throw n;return A9e(n)};async function M9e(t){if(!FZ(t.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(t.type===void 0&&(t.type=2),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{let{standard:e}=await I9e(t.chainId);t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=e.maxPriorityFee),t.maxFeePerGas||(t.maxFeePerGas=e.maxFee),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return t}const T9e=async(t,e)=>{var r,n,i;if(t.type===void 0&&(t.type=2),t.type===2){if(!t.maxFeePerGas||!t.maxPriorityFeePerGas){let a=await e.getFeeData();t.maxFeePerGas||(t.maxFeePerGas=(r=a.maxFeePerGas)==null?void 0:r.toHexString()),t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=(n=a.maxPriorityFeePerGas)==null?void 0:n.toHexString())}}else if(!t.gasPrice){let a=await e.getFeeData();t.gasPrice=(i=a.gasPrice)==null?void 0:i.toHexString()}return t};async function MN(t,e){if(!t.gasLimit)throw new cC("gasLimit was not successfully set for transaction.");let r=Xa(t.gasLimit),n=nt.from(0);if(t.type==2){if(!t.maxFeePerGas)throw new cC("maxFeePerGas was not successfully set for transaction of type 2.");n=Xa(t.maxFeePerGas)}else{if(!t.gasPrice)throw new cC("gasPrice was not successfully set for transaction of type 0 or 1.");n=Xa(t.gasPrice)}let i=r.mul(n),a=nt.from(0);if(t.chainId&&g9(t.chainId))try{a=await E9e(t,e),i=i.add(a)}catch{}return{totalGasEstimate:i,l1ExecutionFeeEstimate:a}}async function k9e(t,e){try{return(await e.estimateGas(t)).toHexString()}catch(r){let n;if("message"in r&&r.message.includes("insufficient funds")&&(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'value'`),n=await async function({txRequest:i,provider:a}){try{let s={...i,value:void 0};return(await a.estimateGas(s)).toHexString()}catch(s){return console.warn(`Gas estimation failed with error: ${s} when omitting the 'value'`),null}}({txRequest:t,provider:e})),n||(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from'`),n=await async function({txRequest:i,provider:a}){try{let s={...i,from:void 0};return(await a.estimateGas(s)).toHexString()}catch(s){return console.warn(`Gas estimation failed with error: ${s} when omitting the 'from' address`),null}}({txRequest:t,provider:e})),!n)throw r;return n}}function UZ(t){return/^-?0x[a-f0-9]+$/i.test(t)}function N9e(t){for(let e of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=t[e];if(r!==void 0&&!function(n){let i=typeof n=="number",a=typeof n=="bigint",s=typeof n=="string"&&UZ(n);return i||a||s}(r))throw Error(`Transaction request property '${e}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof t.chainId!="number")throw Error("Transaction request property 'chainId' must be a number")}async function TN(t,e,r){if(e.chainId=Number(e.chainId),N9e(e),e.from||(e.from=t),!e.nonce){let n=new o9(t,r);e.nonce=await n.getTransactionCount("pending")}return e.gasLimit||(e.gas?(e.gasLimit=e.gas,delete e.gas):e.gasLimit=await k9e(e,r)),typeof e.type=="string"&&UZ(e.type)&&(e.type=Number(e.type)),[23294,23295].includes(e.chainId)&&(e.type=0),(e=FZ(e.chainId)?await M9e(e):PZ(e.chainId)?await w9e(e,r):g9(e.chainId)?await x9e(e,r):RZ(e.chainId)?await v9e(e,r):await T9e(e,r)).type===0&&delete e.accessList,e.type!==2&&(delete e.maxPriorityFeePerGas,delete e.maxFeePerGas),e}var BZ={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function a(l,c,u,f,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var g=new i(u,f||l,h),m=r?r+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],g]:l._events[m].push(g):(l._events[m]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},o.prototype.listeners=function(c){var u=r?r+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,g=f.length,m=new Array(g);h{let e=t;typeof e=="string"&&(e=F9e.encode(e));const r=32768,n=[];for(let i=0;iU9e(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),z9e=t=>{const e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{let e=t;e instanceof Uint8Array&&(e=zZ.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return z9e(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class H9e extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var r;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class qh extends H9e{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function G9e(t){return typeof t=="object"&&t!==null}function q9e(t){if(!G9e(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const k5=B9e,V9e=W9e;function OF(t){if(typeof t!="string")throw new qh("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:r}=t.split(".");if(r===5)throw new qh("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new qh("Invalid JWT");if(!e)throw new qh("JWTs must contain a payload");let n;try{n=V9e(e)}catch{throw new qh("Failed to base64url decode the payload")}let i;try{i=JSON.parse(zZ.decode(n))}catch{throw new qh("Failed to parse the decoded payload as JSON")}if(!q9e(i))throw new qh("Invalid JWT Claims Set");return i}/*! js-cookie v3.0.5 | MIT */function s4(t){for(var e=1;e"u")){s=s4({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var l in s)s[l]&&(o+="; "+l,s[l]!==!0&&(o+="="+s[l].split(";")[0]));return document.cookie=i+"="+t.write(a,i)+o}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],s={},o=0;oJ9e(String(t),e),dC=(t,e)=>`+${kN(e)} ${t}`,X9e=t=>`*${t.replaceAll("-","").slice(-4)}`,exe=t=>new w3(t),txe=Z9e().map(t=>({code:t,callCode:kN(t)})),rxe=t=>{var r;let e=(r=Q9e(t,K9e))==null?void 0:r.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},nxe=t=>{let e=new w3;e.input(t);let r=e.getCountry()||"US",n=e.getCallingCode()||"1";return{countryCode:r,phone:t.replace("+"+n,"")}},ixe=(t,e=!0)=>t.reduce((r,n)=>({...r,[n]:e}),{});let axe={buy:"CARD",send:"CRYPTO_ACCOUNT"},sxe={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1"};function oxe({input:t,amount:e,blockchain:r,asset:n,experience:i}){let a=new URL("https://pay.coinbase.com/buy/select-asset");return a.searchParams.set("appId",t.app_id),a.searchParams.set("sessionToken",t.session_token),a.searchParams.set("defaultExperience",i),a.searchParams.set("presetCryptoAmount",e.startsWith(".")?`0${e}`:e),a.searchParams.set("defaultNetwork",r),a.searchParams.set("defaultPaymentMethod",axe[i]),a.searchParams.set("defaultAsset",sxe[n]),a.searchParams.set("partnerUserId",t.partner_user_id),{url:a}}const lxe="1.0.7";let xl=class BI extends Error{constructor(e,r={}){var s;const n=r.cause instanceof BI?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof BI&&r.cause.docsPath||r.docsPath,a=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${lxe}`].join(` -`);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}};function vh(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const HZ=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,GZ=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,qZ=/^\(.+?\).*?$/,FF=/^tuple(?(\[(\d*)\])*)$/;function zI(t){let e=t.type;if(FF.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function uxe(t){return VZ.test(t)}function dxe(t){return vh(VZ,t)}const YZ=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function fxe(t){return YZ.test(t)}function hxe(t){return vh(YZ,t)}const KZ=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function pxe(t){return KZ.test(t)}function gxe(t){return vh(KZ,t)}const JZ=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function ZZ(t){return JZ.test(t)}function mxe(t){return vh(JZ,t)}const QZ=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function yxe(t){return QZ.test(t)}function wxe(t){return vh(QZ,t)}const vxe=/^fallback\(\) external(?:\s(?payable{1}))?$/;function bxe(t){return vxe.test(t)}const xxe=/^receive\(\) external payable$/;function Exe(t){return xxe.test(t)}const _xe=new Set(["indexed"]),WI=new Set(["calldata","memory","storage"]);class Cxe extends xl{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Sxe extends xl{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Axe extends xl{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Ixe extends xl{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Mxe extends xl{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Txe extends xl{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class kxe extends xl{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class ry extends xl{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Nxe extends xl{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Lxe extends xl{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class jxe extends xl{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class $xe extends xl{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function Pxe(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let a="";for(const s of i[1])a+=`[${s.type}${s.name?`:${s.name}`:""}]`;n+=`(${i[0]}{${a}})`}return e?`${e}:${t}${n}`:t}const fC=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function Rxe(t,e={}){if(pxe(t)){const r=gxe(t);if(!r)throw new ry({signature:t,type:"function"});const n=Ql(r.parameters),i=[],a=n.length;for(let o=0;o[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Oxe=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,Fxe=/^u?int$/;function a0(t,e){var f,h;const r=Pxe(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(fC.has(r))return fC.get(r);const n=qZ.test(t),i=vh(n?Oxe:Dxe,t);if(!i)throw new Axe({param:t});if(i.name&&Bxe(i.name))throw new Ixe({param:t,name:i.name});const a=i.name?{name:i.name}:{},s=i.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let l,c={};if(n){l="tuple";const g=Ql(i.type),m=[],w=g.length;for(let _=0;_[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function eQ(t,e,r=new Set){const n=[],i=t.length;for(let a=0;ae(t,a)}function Eu(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new i7e(t.type);return`${t.name}(${w9(t.inputs,{includeName:e})})`}function w9(t,{includeName:e=!1}={}){return t?t.map(r=>Gxe(r,{includeName:e})).join(e?", ":","):""}function Gxe(t,{includeName:e}){return t.type.startsWith("tuple")?`(${w9(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function pc(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function ai(t){return pc(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const tQ="2.22.1";let T2={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${tQ}`},Ze=class HI extends Error{constructor(e,r={}){var o;const n=(()=>{var l;return r.cause instanceof HI?r.cause.details:(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof HI&&r.cause.docsPath||r.docsPath,a=(o=T2.getDocsUrl)==null?void 0:o.call(T2,{...r,docsPath:i}),s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...T2.version?[`Version: ${T2.version}`]:[]].join(` -`);super(s,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=tQ}walk(e){return rQ(this,e)}};function rQ(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?rQ(t.cause,e):e?null:t}class qxe extends Ze{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class UF extends Ze{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class nQ extends Ze{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${w9(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class Sw extends Ze{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class Vxe extends Ze{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` -`),{name:"AbiEncodingArrayLengthMismatchError"})}}class Yxe extends Ze{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${ai(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Kxe extends Ze{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` -`),{name:"AbiEncodingLengthMismatchError"})}}class iQ extends Ze{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class Jxe extends Ze{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class aQ extends Ze{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}}class BF extends Ze{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` -`),{docsPath:r,name:"AbiEventNotFoundError"})}}class N5 extends Ze{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class Zxe extends Ze{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}}class Qxe extends Ze{constructor(e,{docsPath:r}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` -`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}}class Xxe extends Ze{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Eu(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Eu(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class e7e extends Ze{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}}class v3 extends Ze{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` -`),{metaMessages:[`Params: (${w9(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class v9 extends Ze{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Eu(e,{includeName:!0})}".`].join(` -`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class t7e extends Ze{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class r7e extends Ze{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:r,name:"InvalidAbiDecodingType"})}}class n7e extends Ze{constructor(e){super([`Value "${e}" is not a valid array.`].join(` -`),{name:"InvalidArrayError"})}}class i7e extends Ze{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`),{name:"InvalidDefinitionTypeError"})}}class a7e extends Ze{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}class sQ extends Ze{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}let oQ=class extends Ze{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class zF extends Ze{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function wm(t,{dir:e,size:r=32}={}){return typeof t=="string"?Yf(t,{dir:e,size:r}):s7e(t,{dir:e,size:r})}function Yf(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new oQ({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function s7e(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new oQ({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie)throw new c7e({givenSize:ai(t),maxSize:e})}function yo(t,e={}){const{signed:r}=e;e.size&&_c(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,a=(1n<e.toString(16).padStart(2,"0"));function ur(t,e={}){return typeof t=="number"||typeof t=="bigint"?lr(t,e):typeof t=="string"?kg(t,e):typeof t=="boolean"?cQ(t,e):Si(t,e)}function cQ(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(_c(r,{size:e.size}),wm(r,{size:e.size})):r}function Si(t,e={}){let r="";for(let i=0;ia||i=Vu.zero&&t<=Vu.nine)return t-Vu.zero;if(t>=Vu.A&&t<=Vu.F)return t-(Vu.A-10);if(t>=Vu.a&&t<=Vu.f)return t-(Vu.a-10)}function gc(t,e={}){let r=t;e.size&&(_c(r,{size:e.size}),r=wm(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,a=new Uint8Array(i);for(let s=0,o=0;s0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function L5(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function uQ(t,e){NN(t);const r=e.outputLen;if(t.length>GF&l4)}:{h:Number(t>>GF&l4)|0,l:Number(t&l4)|0}}function w7e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,b7e=(t,e,r)=>e<>>32-r,x7e=(t,e,r)=>e<>>64-r,E7e=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _7e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),hC=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),$c=(t,e)=>t<<32-e|t>>>e,qF=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,C7e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function VF(t){for(let e=0;et().update(LN(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const hQ=[],pQ=[],gQ=[],A7e=BigInt(0),k2=BigInt(1),I7e=BigInt(2),M7e=BigInt(7),T7e=BigInt(256),k7e=BigInt(113);for(let t=0,e=k2,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],hQ.push(2*(5*n+r)),pQ.push((t+1)*(t+2)/2%64);let i=A7e;for(let a=0;a<7;a++)e=(e<>M7e)*k7e)%T7e,e&I7e&&(i^=k2<<(k2<r>32?x7e(t,e,r):v7e(t,e,r),KF=(t,e,r)=>r>32?E7e(t,e,r):b7e(t,e,r);function j7e(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const o=(s+8)%10,l=(s+2)%10,c=r[l],u=r[l+1],f=YF(c,u,1)^r[o],h=KF(c,u,1)^r[o+1];for(let g=0;g<50;g+=10)t[s+g]^=f,t[s+g+1]^=h}let i=t[2],a=t[3];for(let s=0;s<24;s++){const o=pQ[s],l=YF(i,a,o),c=KF(i,a,o),u=hQ[s];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let s=0;s<50;s+=10){for(let o=0;o<10;o++)r[o]=t[s+o];for(let o=0;o<10;o++)t[s+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=N7e[n],t[1]^=L7e[n]}r.fill(0)}let $7e=class mQ extends dQ{constructor(e,r,n,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,HF(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=_7e(this.state)}keccak(){qF||VF(this.state32),j7e(this.state32,this.rounds),qF||VF(this.state32),this.posOut=0,this.pos=0}update(e){L5(this);const{blockLen:r,state:n}=this;e=LN(e);const i=e.length;for(let a=0;a=n&&this.keccak();const s=Math.min(n-this.posOut,a-i);e.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return HF(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(uQ(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:a,enableXOF:s}=this;return e||(e=new mQ(r,n,i,s,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}};const P7e=(t,e,r)=>fQ(()=>new $7e(e,t,r)),R7e=P7e(1,136,256/8);function Xi(t,e){const r=e||"hex",n=R7e(pc(t,{strict:!1})?vm(t):t);return r==="bytes"?n:ur(n)}const D7e=t=>Xi(vm(t));function O7e(t){return D7e(t)}function F7e(t){let e=!0,r="",n=0,i="",a=!1;for(let s=0;s{const e=typeof t=="string"?t:cxe(t);return F7e(e)};function yQ(t){return O7e(U7e(t))}const b9=yQ;class us extends Ze{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class x9 extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const pC=new x9(8192);function Aw(t,e){if(pC.has(`${t}.${e}`))return pC.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=Xi(C0(r),"bytes"),i=r.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());const a=`0x${i.join("")}`;return pC.set(`${t}.${e}`,a),a}function jN(t,e){if(!Tn(t,{strict:!1}))throw new us({address:t});return Aw(t,e)}const B7e=/^0x[a-fA-F0-9]{40}$/,gC=new x9(8192);function Tn(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(gC.has(n))return gC.get(n);const i=B7e.test(t)?t.toLowerCase()===t?!0:r?Aw(t)===t:!0:!1;return gC.set(n,i),i}function Pd(t){return typeof t[0]=="string"?Mu(t):z7e(t)}function z7e(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function Mu(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function G0(t,e,r,{strict:n}={}){return pc(t,{strict:!1})?xQ(t,e,r,{strict:n}):bQ(t,e,r,{strict:n})}function wQ(t,e){if(typeof e=="number"&&e>0&&e>ai(t)-1)throw new sQ({offset:e,position:"start",size:ai(t)})}function vQ(t,e,r){if(typeof e=="number"&&typeof r=="number"&&ai(t)!==r-e)throw new sQ({offset:r,position:"end",size:ai(t)})}function bQ(t,e,r,{strict:n}={}){wQ(t,e);const i=t.slice(e,r);return n&&vQ(i,e,r),i}function xQ(t,e,r,{strict:n}={}){wQ(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&vQ(i,e,r),i}const W7e=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,EQ=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function bm(t,e){if(t.length!==e.length)throw new Kxe({expectedLength:t.length,givenLength:e.length});const r=H7e({params:t,values:e}),n=PN(r);return n.length===0?"0x":n}function H7e({params:t,values:e}){const r=[];for(let n=0;n0?Pd([o,s]):o}}if(i)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:Pd(a.map(({encoded:s})=>s))}}function V7e(t,{param:e}){const[,r]=e.type.split("bytes"),n=ai(t);if(!r){let i=t;return n%32!==0&&(i=Yf(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Pd([Yf(lr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new Yxe({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:Yf(t,{dir:"right"})}}function Y7e(t){if(typeof t!="boolean")throw new Ze(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Yf(cQ(t))}}function K7e(t,{signed:e,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(e?1n:0n))-1n,i=e?-n-1n:0n;if(t>n||ti))}}function RN(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const E9=t=>G0(yQ(t),0,4);function Iw(t){const{abi:e,args:r=[],name:n}=t,i=pc(n,{strict:!1}),a=e.filter(o=>i?o.type==="function"?E9(o)===n:o.type==="event"?b9(o)===n:!1:"name"in o&&o.name===n);if(a.length===0)return;if(a.length===1)return a[0];let s;for(const o of a){if(!("inputs"in o))continue;if(!r||r.length===0){if(!o.inputs||o.inputs.length===0)return o;continue}if(!o.inputs||o.inputs.length===0||o.inputs.length!==r.length)continue;if(r.every((c,u)=>{const f="inputs"in o&&o.inputs[u];return f?GI(c,f):!1})){if(s&&"inputs"in s&&s.inputs){const c=_Q(o.inputs,s.inputs,r);if(c)throw new Xxe({abiItem:o,type:c[0]},{abiItem:s,type:c[1]})}s=o}}return s||a[0]}function GI(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Tn(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,a)=>GI(Object.values(t)[a],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>GI(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function _Q(t,e,r){for(const n in t){const i=t[n],a=e[n];if(i.type==="tuple"&&a.type==="tuple"&&"components"in i&&"components"in a)return _Q(i.components,a.components,r[n]);const s=[i.type,a.type];if(s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?Tn(r[n],{strict:!1}):s.includes("address")&&s.includes("bytes")?Tn(r[n],{strict:!1}):!1)return s}}const JF="/docs/contract/encodeEventTopics";function Mw(t){var l;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const c=Iw({abi:e,name:r});if(!c)throw new BF(r,{docsPath:JF});i=c}if(i.type!=="event")throw new BF(void 0,{docsPath:JF});const a=Eu(i),s=b9(a);let o=[];if(n&&"inputs"in i){const c=(l=i.inputs)==null?void 0:l.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(c==null?void 0:c.map(f=>n[f.name]))??[]:[];u.length>0&&(o=(c==null?void 0:c.map((f,h)=>Array.isArray(u[h])?u[h].map((g,m)=>ZF({param:f,value:u[h][m]})):u[h]?ZF({param:f,value:u[h]}):null))??[])}return[s,...o]}function ZF({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return Xi(vm(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new a7e(t.type);return bm([t],[e])}function _9(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:a,response:s,status:o,transport:l})=>{o==="success"&&e===a&&(r[s]=l.request)})),a=>r[a]||t.request}async function CQ(t,e){const{address:r,abi:n,args:i,eventName:a,fromBlock:s,strict:o,toBlock:l}=e,c=_9(t,{method:"eth_newFilter"}),u=a?Mw({abi:n,args:i,eventName:a}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof s=="bigint"?lr(s):s,toBlock:typeof l=="bigint"?lr(l):l,topics:u}]});return{abi:n,args:i,eventName:a,id:f,request:c(f),strict:!!o,type:"event"}}function ps(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const QF="/docs/contract/encodeFunctionData";function Q7e(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const a=Iw({abi:e,args:r,name:n});if(!a)throw new N5(n,{docsPath:QF});i=a}if(i.type!=="function")throw new N5(void 0,{docsPath:QF});return{abi:[i],functionName:E9(Eu(i))}}function Cc(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var o;return t.abi.length===1&&((o=t.functionName)!=null&&o.startsWith("0x"))?t:Q7e(t)})(),i=r[0],a=n,s="inputs"in i&&i.inputs?bm(i.inputs,e??[]):void 0;return Mu([a,s??"0x"])}const SQ={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},X7e={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},eEe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class XF extends Ze{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class AQ extends Ze{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class tEe extends Ze{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const rEe={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new tEe({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new AQ({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new XF({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new XF({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function DN(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(rEe);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function nEe(t,e={}){typeof e.size<"u"&&_c(t,{size:e.size});const r=Si(t,e);return yo(r,e)}function iEe(t,e={}){let r=t;if(typeof e.size<"u"&&(_c(r,{size:e.size}),r=lc(r)),r.length>1||r[0]>1)throw new o7e(r);return!!r[0]}function Sd(t,e={}){typeof e.size<"u"&&_c(t,{size:e.size});const r=Si(t,e);return _u(r,e)}function aEe(t,e={}){let r=t;return typeof e.size<"u"&&(_c(r,{size:e.size}),r=lc(r,{dir:"right"})),new TextDecoder().decode(r)}function xm(t,e){const r=typeof e=="string"?gc(e):e,n=DN(r);if(ai(r)===0&&t.length>0)throw new Sw;if(ai(e)&&ai(e)<32)throw new nQ({data:typeof e=="string"?e:Si(e),params:t,size:ai(e)});let i=0;const a=[];for(let s=0;s48?nEe(i,{signed:r}):Sd(i,{signed:r}),32]}function dEe(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:s})=>!s),i=n?[]:{};let a=0;if(b3(e)){const s=Sd(t.readBytes(qI)),o=r+s;for(let l=0;ls.type==="error"&&n===E9(Eu(s)));if(!a)throw new iQ(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?xm(a.inputs,G0(r,4)):void 0,errorName:a.name}}const na=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r);function IQ({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,a)=>`${n&&i.name?`${i.name}: `:""}${typeof e[a]=="object"?na(e[a]):e[a]}`).join(", ")})`}const MQ={gwei:9,wei:18},pEe={ether:-9,wei:9};function C9(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,a]=[r.slice(0,r.length-e),r.slice(r.length-e)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${a?`.${a}`:""}`}function Tw(t,e="wei"){return C9(t,MQ[e])}function zs(t,e="wei"){return C9(t,pEe[e])}class gEe extends Ze{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class mEe extends Ze{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function tU(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} -`,"")}function yEe(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: + */(function(t){(function(){var e="input is invalid type",r="finalize already called",n=typeof window=="object",i=n?window:{};i.JS_SHA3_NO_WINDOW&&(n=!1);var a=!n&&typeof self=="object",s=!i.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;s?i=Xt:a&&(i=self);var o=!i.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!i.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",c="0123456789abcdef".split(""),u=[31,7936,2031616,520093696],f=[4,1024,262144,67108864],h=[1,256,65536,16777216],g=[6,1536,393216,100663296],m=[0,8,16,24],w=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],C=[224,256,384,512],v=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],A={128:168,256:136};(i.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(H){return Object.prototype.toString.call(H)==="[object Array]"}),l&&(i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(H){return typeof H=="object"&&H.buffer&&H.buffer.constructor===ArrayBuffer});for(var S=function(H,ee,J){return function(te){return new $(H,ee,H).update(te)[J]()}},j=function(H,ee,J){return function(te,re){return new $(H,ee,re).update(te)[J]()}},F=function(H,ee,J){return function(te,re,z,G){return x["cshake"+H].update(te,re,z,G)[J]()}},I=function(H,ee,J){return function(te,re,z,G){return x["kmac"+H].update(te,re,z,G)[J]()}},B=function(H,ee,J,te){for(var re=0;re>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var te=0;te<50;++te)this.s[te]=0}$.prototype.update=function(H){if(this.finalized)throw new Error(r);var ee,J=typeof H;if(J!=="string"){if(J==="object"){if(H===null)throw new Error(e);if(l&&H.constructor===ArrayBuffer)H=new Uint8Array(H);else if(!Array.isArray(H)&&(!l||!ArrayBuffer.isView(H)))throw new Error(e)}else throw new Error(e);ee=!0}for(var te=this.blocks,re=this.byteCount,z=H.length,G=this.blockCount,Q=0,me=this.s,be,Ce;Q>2]|=H[Q]<>2]|=Ce<>2]|=(192|Ce>>6)<>2]|=(128|Ce&63)<=57344?(te[be>>2]|=(224|Ce>>12)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<>2]|=(240|Ce>>18)<>2]|=(128|Ce>>12&63)<>2]|=(128|Ce>>6&63)<>2]|=(128|Ce&63)<=re){for(this.start=be-re,this.block=te[G],be=0;be>8,J=H&255;J>0;)re.unshift(J),H=H>>8,J=H&255,++te;return ee?re.push(te):re.unshift(te),this.update(re),re.length},$.prototype.encodeString=function(H){var ee,J=typeof H;if(J!=="string"){if(J==="object"){if(H===null)throw new Error(e);if(l&&H.constructor===ArrayBuffer)H=new Uint8Array(H);else if(!Array.isArray(H)&&(!l||!ArrayBuffer.isView(H)))throw new Error(e)}else throw new Error(e);ee=!0}var te=0,re=H.length;if(ee)te=re;else for(var z=0;z=57344?te+=3:(G=65536+((G&1023)<<10|H.charCodeAt(++z)&1023),te+=4)}return te+=this.encode(te*8),this.update(H),te},$.prototype.bytepad=function(H,ee){for(var J=this.encode(ee),te=0;te>2]|=this.padding[ee&3],this.lastByteIndex===this.byteCount)for(H[0]=H[J],ee=1;ee>4&15]+c[Q&15]+c[Q>>12&15]+c[Q>>8&15]+c[Q>>20&15]+c[Q>>16&15]+c[Q>>28&15]+c[Q>>24&15];z%H===0&&(le(ee),re=0)}return te&&(Q=ee[re],G+=c[Q>>4&15]+c[Q&15],te>1&&(G+=c[Q>>12&15]+c[Q>>8&15]),te>2&&(G+=c[Q>>20&15]+c[Q>>16&15])),G},$.prototype.arrayBuffer=function(){this.finalize();var H=this.blockCount,ee=this.s,J=this.outputBlocks,te=this.extraBytes,re=0,z=0,G=this.outputBits>>3,Q;te?Q=new ArrayBuffer(J+1<<2):Q=new ArrayBuffer(G);for(var me=new Uint32Array(Q);z>8&255,G[Q+2]=me>>16&255,G[Q+3]=me>>24&255;z%H===0&&le(ee)}return te&&(Q=z<<2,me=ee[re],G[Q]=me&255,te>1&&(G[Q+1]=me>>8&255),te>2&&(G[Q+2]=me>>16&255)),G};function X(H,ee,J){$.call(this,H,ee,J)}X.prototype=new $,X.prototype.finalize=function(){return this.encode(this.outputBits,!0),$.prototype.finalize.call(this)};var le=function(H){var ee,J,te,re,z,G,Q,me,be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne,$e,je,K,U,W,ie,pe,we,he,Re,Je,et,it,ut,pt,tr,zt,At,mt,St,dt,Nt,Rt,gt,qt,Wt,ot,Vt,Ft,yt,Ze,Pt,xt,Jt,Cr,Gt,Sr,cr,br,Z,ae,de,ue,ve;for(te=0;te<48;te+=2)re=H[0]^H[10]^H[20]^H[30]^H[40],z=H[1]^H[11]^H[21]^H[31]^H[41],G=H[2]^H[12]^H[22]^H[32]^H[42],Q=H[3]^H[13]^H[23]^H[33]^H[43],me=H[4]^H[14]^H[24]^H[34]^H[44],be=H[5]^H[15]^H[25]^H[35]^H[45],Ce=H[6]^H[16]^H[26]^H[36]^H[46],Fe=H[7]^H[17]^H[27]^H[37]^H[47],Ue=H[8]^H[18]^H[28]^H[38]^H[48],Ke=H[9]^H[19]^H[29]^H[39]^H[49],ee=Ue^(G<<1|Q>>>31),J=Ke^(Q<<1|G>>>31),H[0]^=ee,H[1]^=J,H[10]^=ee,H[11]^=J,H[20]^=ee,H[21]^=J,H[30]^=ee,H[31]^=J,H[40]^=ee,H[41]^=J,ee=re^(me<<1|be>>>31),J=z^(be<<1|me>>>31),H[2]^=ee,H[3]^=J,H[12]^=ee,H[13]^=J,H[22]^=ee,H[23]^=J,H[32]^=ee,H[33]^=J,H[42]^=ee,H[43]^=J,ee=G^(Ce<<1|Fe>>>31),J=Q^(Fe<<1|Ce>>>31),H[4]^=ee,H[5]^=J,H[14]^=ee,H[15]^=J,H[24]^=ee,H[25]^=J,H[34]^=ee,H[35]^=J,H[44]^=ee,H[45]^=J,ee=me^(Ue<<1|Ke>>>31),J=be^(Ke<<1|Ue>>>31),H[6]^=ee,H[7]^=J,H[16]^=ee,H[17]^=J,H[26]^=ee,H[27]^=J,H[36]^=ee,H[37]^=J,H[46]^=ee,H[47]^=J,ee=Ce^(re<<1|z>>>31),J=Fe^(z<<1|re>>>31),H[8]^=ee,H[9]^=J,H[18]^=ee,H[19]^=J,H[28]^=ee,H[29]^=J,H[38]^=ee,H[39]^=J,H[48]^=ee,H[49]^=J,lt=H[0],Ee=H[1],ot=H[11]<<4|H[10]>>>28,Vt=H[10]<<4|H[11]>>>28,he=H[20]<<3|H[21]>>>29,Re=H[21]<<3|H[20]>>>29,ae=H[31]<<9|H[30]>>>23,de=H[30]<<9|H[31]>>>23,Rt=H[40]<<18|H[41]>>>14,gt=H[41]<<18|H[40]>>>14,pt=H[2]<<1|H[3]>>>31,tr=H[3]<<1|H[2]>>>31,He=H[13]<<12|H[12]>>>20,qe=H[12]<<12|H[13]>>>20,Ft=H[22]<<10|H[23]>>>22,yt=H[23]<<10|H[22]>>>22,Je=H[33]<<13|H[32]>>>19,et=H[32]<<13|H[33]>>>19,ue=H[42]<<2|H[43]>>>30,ve=H[43]<<2|H[42]>>>30,Cr=H[5]<<30|H[4]>>>2,Gt=H[4]<<30|H[5]>>>2,zt=H[14]<<6|H[15]>>>26,At=H[15]<<6|H[14]>>>26,Ie=H[25]<<11|H[24]>>>21,Ne=H[24]<<11|H[25]>>>21,Ze=H[34]<<15|H[35]>>>17,Pt=H[35]<<15|H[34]>>>17,it=H[45]<<29|H[44]>>>3,ut=H[44]<<29|H[45]>>>3,W=H[6]<<28|H[7]>>>4,ie=H[7]<<28|H[6]>>>4,Sr=H[17]<<23|H[16]>>>9,cr=H[16]<<23|H[17]>>>9,mt=H[26]<<25|H[27]>>>7,St=H[27]<<25|H[26]>>>7,$e=H[36]<<21|H[37]>>>11,je=H[37]<<21|H[36]>>>11,xt=H[47]<<24|H[46]>>>8,Jt=H[46]<<24|H[47]>>>8,qt=H[8]<<27|H[9]>>>5,Wt=H[9]<<27|H[8]>>>5,pe=H[18]<<20|H[19]>>>12,we=H[19]<<20|H[18]>>>12,br=H[29]<<7|H[28]>>>25,Z=H[28]<<7|H[29]>>>25,dt=H[38]<<8|H[39]>>>24,Nt=H[39]<<8|H[38]>>>24,K=H[48]<<14|H[49]>>>18,U=H[49]<<14|H[48]>>>18,H[0]=lt^~He&Ie,H[1]=Ee^~qe&Ne,H[10]=W^~pe&he,H[11]=ie^~we&Re,H[20]=pt^~zt&mt,H[21]=tr^~At&St,H[30]=qt^~ot&Ft,H[31]=Wt^~Vt&yt,H[40]=Cr^~Sr&br,H[41]=Gt^~cr&Z,H[2]=He^~Ie&$e,H[3]=qe^~Ne&je,H[12]=pe^~he&Je,H[13]=we^~Re&et,H[22]=zt^~mt&dt,H[23]=At^~St&Nt,H[32]=ot^~Ft&Ze,H[33]=Vt^~yt&Pt,H[42]=Sr^~br&ae,H[43]=cr^~Z&de,H[4]=Ie^~$e&K,H[5]=Ne^~je&U,H[14]=he^~Je&it,H[15]=Re^~et&ut,H[24]=mt^~dt&Rt,H[25]=St^~Nt>,H[34]=Ft^~Ze&xt,H[35]=yt^~Pt&Jt,H[44]=br^~ae&ue,H[45]=Z^~de&ve,H[6]=$e^~K<,H[7]=je^~U&Ee,H[16]=Je^~it&W,H[17]=et^~ut&ie,H[26]=dt^~Rt&pt,H[27]=Nt^~gt&tr,H[36]=Ze^~xt&qt,H[37]=Pt^~Jt&Wt,H[46]=ae^~ue&Cr,H[47]=de^~ve&Gt,H[8]=K^~lt&He,H[9]=U^~Ee&qe,H[18]=it^~W&pe,H[19]=ut^~ie&we,H[28]=Rt^~pt&zt,H[29]=gt^~tr&At,H[38]=xt^~qt&ot,H[39]=Jt^~Wt&Vt,H[48]=ue^~Cr&Sr,H[49]=ve^~Gt&cr,H[0]^=w[te],H[1]^=w[te+1]};if(o)t.exports=x;else for(L=0;L>=8;return e}function _O(t,e,r){let n=0;for(let i=0;ie+1+n&&Qc.throwError("child data too short",De.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function TK(t,e){if(t.length===0&&Qc.throwError("data too short",De.errors.BUFFER_OVERRUN,{}),t[e]>=248){const r=t[e]-247;e+1+r>t.length&&Qc.throwError("data short segment too short",De.errors.BUFFER_OVERRUN,{});const n=_O(t,e+1,r);return e+1+r+n>t.length&&Qc.throwError("data long segment too short",De.errors.BUFFER_OVERRUN,{}),CO(t,e,e+1+r,r+n)}else if(t[e]>=192){const r=t[e]-192;return e+1+r>t.length&&Qc.throwError("data array too short",De.errors.BUFFER_OVERRUN,{}),CO(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;e+1+r>t.length&&Qc.throwError("data array too short",De.errors.BUFFER_OVERRUN,{});const n=_O(t,e+1,r);e+1+r+n>t.length&&Qc.throwError("data array too short",De.errors.BUFFER_OVERRUN,{});const i=Bt(t.slice(e+1+r,e+1+r+n));return{consumed:1+r+n,result:i}}else if(t[e]>=128){const r=t[e]-128;e+1+r>t.length&&Qc.throwError("data too short",De.errors.BUFFER_OVERRUN,{});const n=Bt(t.slice(e+1,e+1+r));return{consumed:1+r,result:n}}return{consumed:1,result:Bt(t[e])}}function _N(t){const e=er(t),r=TK(e,0);return r.consumed!==e.length&&Qc.throwArgumentError("invalid rlp data","data",t),r.result}const Wye="address/5.7.0",Kp=new De(Wye);function SO(t){Kr(t,20)||Kp.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);const n=er(_i(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Hye=9007199254740991;function Gye(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const CN={};for(let t=0;t<10;t++)CN[String(t)]=String(t);for(let t=0;t<26;t++)CN[String.fromCharCode(65+t)]=String(10+t);const AO=Math.floor(Gye(Hye));function qye(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>CN[n]).join("");for(;e.length>=AO;){let n=e.substring(0,AO);e=parseInt(n,10)%97+e.substring(n.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Ir(t){let e=null;if(typeof t!="string"&&Kp.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=SO(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Kp.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==qye(t)&&Kp.throwArgumentError("bad icap checksum","address",t),e=Oye(t.substring(4));e.length<40;)e="0"+e;e=SO("0x"+e)}else Kp.throwArgumentError("invalid address","address",t);return e}function Vye(t){try{return Ir(t),!0}catch{}return!1}function kK(t){let e=null;try{e=Ir(t.from)}catch{Kp.throwArgumentError("missing from address","transaction",t)}const r=V0(er(nt.from(t.nonce).toHexString()));return Ir(Na(_i(Sw([e,r])),12))}const Yye="properties/5.7.0";var Kye=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const A5=new De(Yye);function st(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function su(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||typeof t.prototype!="object")break;t=Object.getPrototypeOf(t.prototype).constructor}return null}function vi(t){return Kye(this,void 0,void 0,function*(){const e=Object.keys(t).map(n=>{const i=t[n];return Promise.resolve(i).then(a=>({key:n,value:a}))});return(yield Promise.all(e)).reduce((n,i)=>(n[i.key]=i.value,n),{})})}function NK(t,e){(!t||typeof t!="object")&&A5.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||A5.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Ri(t){const e={};for(const r in t)e[r]=t[r];return e}const Jye={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function LK(t){if(t==null||Jye[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;const e=Object.keys(t);for(let r=0;rDd(e)));if(typeof t=="object"){const e={};for(const r in t){const n=t[r];n!==void 0&&st(e,r,Dd(n))}return e}return A5.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Dd(t){return Qye(t)}class Aw{constructor(e){for(const r in e)this[r]=Dd(e[r])}}const Zye="abstract-provider/5.7.0";var Xye=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const e3e=new De(Zye);class t3e extends Aw{static isForkEvent(e){return!!(e&&e._isForkEvent)}}class u9{constructor(){e3e.checkAbstract(new.target,u9),st(this,"_isProvider",!0)}getFeeData(){return Xye(this,void 0,void 0,function*(){const{block:e,gasPrice:r}=yield vi({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(s=>null)});let n=null,i=null,a=null;return e&&e.baseFeePerGas&&(n=e.baseFeePerGas,a=nt.from("1500000000"),i=e.baseFeePerGas.mul(2).add(a)),{lastBaseFeePerGas:n,maxFeePerGas:i,maxPriorityFeePerGas:a,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}}const r3e="networks/5.7.1",IO=new De(r3e);function n3e(t){return t&&typeof t.renetwork=="function"}function gd(t){const e=function(r,n){n==null&&(n={});const i=[];if(r.InfuraProvider&&n.infura!=="-")try{i.push(new r.InfuraProvider(t,n.infura))}catch{}if(r.EtherscanProvider&&n.etherscan!=="-")try{i.push(new r.EtherscanProvider(t,n.etherscan))}catch{}if(r.AlchemyProvider&&n.alchemy!=="-")try{i.push(new r.AlchemyProvider(t,n.alchemy))}catch{}if(r.PocketProvider&&n.pocket!=="-"){const a=["goerli","ropsten","rinkeby","sepolia"];try{const s=new r.PocketProvider(t,n.pocket);s.network&&a.indexOf(s.network.name)===-1&&i.push(s)}catch{}}if(r.CloudflareProvider&&n.cloudflare!=="-")try{i.push(new r.CloudflareProvider(t))}catch{}if(r.AnkrProvider&&n.ankr!=="-")try{const a=["ropsten"],s=new r.AnkrProvider(t,n.ankr);s.network&&a.indexOf(s.network.name)===-1&&i.push(s)}catch{}if(i.length===0)return null;if(r.FallbackProvider){let a=1;return n.quorum!=null?a=n.quorum:t==="homestead"&&(a=2),new r.FallbackProvider(i,a)}return i[0]};return e.renetwork=function(r){return gd(r)},e}function I5(t,e){const r=function(n,i){return n.JsonRpcProvider?new n.JsonRpcProvider(t,e):null};return r.renetwork=function(n){return I5(t,n)},r}const MO={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:gd("homestead")},TO={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:gd("ropsten")},kO={chainId:63,name:"classicMordor",_defaultProvider:I5("https://www.ethercluster.com/mordor","classicMordor")},o4={unspecified:{chainId:0,name:"unspecified"},homestead:MO,mainnet:MO,morden:{chainId:2,name:"morden"},ropsten:TO,testnet:TO,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:gd("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:gd("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:gd("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:gd("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:I5("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:kO,classicTestnet:kO,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:I5("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:gd("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:gd("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function i3e(t){if(t==null)return null;if(typeof t=="number"){for(const n in o4){const i=o4[n];if(i.chainId===t)return{name:i.name,chainId:i.chainId,ensAddress:i.ensAddress||null,_defaultProvider:i._defaultProvider||null}}return{chainId:t,name:"unknown"}}if(typeof t=="string"){const n=o4[t];return n==null?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}const e=o4[t.name];if(!e)return typeof t.chainId!="number"&&IO.throwArgumentError("invalid network chainId","network",t),t;t.chainId!==0&&t.chainId!==e.chainId&&IO.throwArgumentError("network chainId mismatch","network",t);let r=t._defaultProvider||null;return r==null&&e._defaultProvider&&(n3e(e._defaultProvider)?r=e._defaultProvider.renetwork(t):r=e._defaultProvider),{name:t.name,chainId:e.chainId,ensAddress:t.ensAddress||e.ensAddress||null,_defaultProvider:r}}function jK(t){t=atob(t);const e=[];for(let r=0;r0;)n.push(s%this.base),s=s/this.base|0}let i="";for(let a=0;r[a]===0&&a=0;--a)i+=this.alphabet[n[a]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let n=0;n>=8;for(;a>0;)r.push(a&255),a>>=8}for(let n=0;e[n]===this._leader&&n>6===2;s++)a++;return a}return t===yo.OVERRUN?r.length-e-1:0}function f3e(t,e,r,n,i){return t===yo.OVERLONG?(n.push(i),0):(n.push(65533),OK(t,e,r))}const h3e=Object.freeze({error:d3e,ignore:OK,replace:f3e});function FK(t,e){e==null&&(e=h3e.error),t=er(t);const r=[];let n=0;for(;n>7)){r.push(i);continue}let a=null,s=null;if((i&224)===192)a=1,s=127;else if((i&240)===224)a=2,s=2047;else if((i&248)===240)a=3,s=65535;else{(i&192)===128?n+=e(yo.UNEXPECTED_CONTINUE,n-1,t,r):n+=e(yo.BAD_PREFIX,n-1,t,r);continue}if(n-1+a>=t.length){n+=e(yo.OVERRUN,n-1,t,r);continue}let o=i&(1<<8-a-1)-1;for(let l=0;l1114111){n+=e(yo.OUT_OF_RANGE,n-1-a,t,r,o);continue}if(o>=55296&&o<=57343){n+=e(yo.UTF16_SURROGATE,n-1-a,t,r,o);continue}if(o<=s){n+=e(yo.OVERLONG,n-1-a,t,r,o);continue}r.push(o)}}return r}function Ao(t,e=w3.current){e!=w3.current&&(DK.checkNormalize(),t=t.normalize(e));let r=[];for(let n=0;n>6|192),r.push(i&63|128);else if((i&64512)==55296){n++;const a=t.charCodeAt(n);if(n>=t.length||(a&64512)!==56320)throw new Error("invalid utf-8 string");const s=65536+((i&1023)<<10)+(a&1023);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return er(r)}function p3e(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function vm(t,e){return p3e(FK(t,e))}function g3e(t,e=w3.current){return FK(Ao(t,e))}function Jp(t){return _i(Ao(t))}const UK="hash/5.7.0";function BK(t,e){e==null&&(e=1);const r=[],n=r.forEach,i=function(a,s){n.call(a,function(o){s>0&&Array.isArray(o)?i(o,s-1):r.push(o)})};return i(t,e),r}function m3e(t){const e={};for(let r=0;r>--l&1}const f=31,h=Math.pow(2,f),g=h>>>1,m=g>>1,w=h-1;let C=0;for(let j=0;j1;){let se=F+I>>>1;j>>1|u(),B=B<<1^g,V=(V^g)<<1|g|1;b=B,A=1+V-B}let S=n-4;return v.map(j=>{switch(j-S){case 3:return S+65792+(t[o++]<<16|t[o++]<<8|t[o++]);case 2:return S+256+(t[o++]<<8|t[o++]);case 1:return S+t[o++];default:return j-1}})}function w3e(t){let e=0;return()=>t[e++]}function v3e(t){return w3e(y3e(t))}function b3e(t){return t&1?~t>>1:t>>1}function x3e(t,e){let r=Array(t);for(let n=0;ne[s]):r}function _3e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(S3e(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(A3e(r,t))}return m3e(BK(e))}function C3e(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function zK(t,e,r){let n=Array(t).fill(void 0).map(()=>[]);for(let i=0;in[s].push(a));return n}function S3e(t,e){let r=1+e(),n=e(),i=C3e(e),a=zK(i.length,1+t,e);return BK(a.map((s,o)=>{const l=s[0],c=s.slice(1);return Array(i[o]).fill(void 0).map((u,f)=>{let h=f*n;return[l+f*r,c.map(g=>g+h)]})}))}function A3e(t,e){let r=1+e();return zK(r,1+t,e).map(i=>[i[0],i.slice(1)])}function I3e(t){let e=M5(t).sort((n,i)=>n-i);return r();function r(){let n=[];for(;;){let c=M5(t,e);if(c.length==0)break;n.push({set:new Set(c),node:r()})}n.sort((c,u)=>u.set.size-c.set.size);let i=t(),a=i%3;i=i/3|0;let s=!!(i&1);i>>=1;let o=i==1,l=i==2;return{branches:n,valid:a,fe0f:s,save:o,check:l}}}function M3e(){return v3e(jK("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const d9=M3e(),T3e=new Set(M5(d9)),k3e=new Set(M5(d9)),N3e=_3e(d9),L3e=I3e(d9),LO=45,jO=95;function WK(t){return g3e(t)}function j3e(t){return t.filter(e=>e!=65039)}function HK(t){for(let e of t.split(".")){let r=WK(e);try{for(let n=r.lastIndexOf(jO)-1;n>=0;n--)if(r[n]!==jO)throw new Error("underscore only allowed at start");if(r.length>=4&&r.every(n=>n<128)&&r[2]===LO&&r[3]===LO)throw new Error("invalid label extension")}catch(n){throw new Error(`Invalid label "${e}": ${n.message}`)}}return t}function $3e(t){return HK(P3e(t,j3e))}function P3e(t,e){let r=WK(t).reverse(),n=[];for(;r.length;){let i=D3e(r);if(i){n.push(...e(i));continue}let a=r.pop();if(T3e.has(a)){n.push(a);continue}if(k3e.has(a))continue;let s=N3e[a];if(s){n.push(...s);continue}throw new Error(`Disallowed codepoint: 0x${a.toString(16).toUpperCase()}`)}return HK(R3e(String.fromCodePoint(...n)))}function R3e(t){return t.normalize("NFC")}function D3e(t,e){var r;let n=L3e,i,a,s=[],o=t.length;for(;o;){let l=t[--o];if(n=(r=n.branches.find(c=>c.set.has(l)))===null||r===void 0?void 0:r.node,!n)break;if(n.save)a=l;else if(n.check&&l===a)break;s.push(l),n.fe0f&&(s.push(65039),o>0&&t[o-1]==65039&&o--),n.valid&&(i=s.slice(),n.valid==2&&i.splice(1,1),t.length=o)}return i}const O3e=new De(UK),GK=new Uint8Array(32);GK.fill(0);function $O(t){if(t.length===0)throw new Error("invalid ENS name; empty component");return t}function qK(t){const e=Ao($3e(t)),r=[];if(t.length===0)return r;let n=0;for(let i=0;i=e.length)throw new Error("invalid ENS name; empty component");return r.push($O(e.slice(n))),r}function m6(t){typeof t!="string"&&O3e.throwArgumentError("invalid ENS name; not a string","name",t);let e=GK;const r=qK(t);for(;r.length;)e=_i(Us([e,_i(r.pop())]));return Bt(e)}function F3e(t){return Bt(Us(qK(t).map(e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r})))+"00"}const U3e=`Ethereum Signed Message: +`;function VK(t){return typeof t=="string"&&(t=Ao(t)),_i(Us([Ao(U3e),Ao(String(t.length)),t]))}var B3e=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Vn=new De(UK),YK=new Uint8Array(32);YK.fill(0);const z3e=nt.from(-1),KK=nt.from(0),JK=nt.from(1),W3e=nt.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function H3e(t){const e=er(t),r=e.length%32;return r?Ds([e,YK.slice(r)]):Bt(e)}const G3e=Bn(JK.toHexString(),32),q3e=Bn(KK.toHexString(),32),PO={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},tC=["name","version","chainId","verifyingContract","salt"];function RO(t){return function(e){return typeof e!="string"&&Vn.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const V3e={name:RO("name"),version:RO("version"),chainId:function(t){try{return nt.from(t).toString()}catch{}return Vn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Ir(t).toLowerCase()}catch{}return Vn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{const e=er(t);if(e.length!==32)throw new Error("bad length");return Bt(e)}catch{}return Vn.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function rC(t){{const e=t.match(/^(u?)int(\d*)$/);if(e){const r=e[1]==="",n=parseInt(e[2]||"256");(n%8!==0||n>256||e[2]&&e[2]!==String(n))&&Vn.throwArgumentError("invalid numeric width","type",t);const i=W3e.mask(r?n-1:n),a=r?i.add(JK).mul(z3e):KK;return function(s){const o=nt.from(s);return(o.lt(a)||o.gt(i))&&Vn.throwArgumentError(`value out-of-bounds for ${t}`,"value",s),Bn(o.toTwos(256).toHexString(),32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&Vn.throwArgumentError("invalid bytes width","type",t),function(n){return er(n).length!==r&&Vn.throwArgumentError(`invalid length for ${t}`,"value",n),H3e(n)}}}switch(t){case"address":return function(e){return Bn(Ir(e),32)};case"bool":return function(e){return e?G3e:q3e};case"bytes":return function(e){return _i(e)};case"string":return function(e){return Jp(e)}}return null}function DO(t,e){return`${t}(${e.map(({name:r,type:n})=>n+" "+r).join(",")})`}class ho{constructor(e){st(this,"types",Object.freeze(Dd(e))),st(this,"_encoderCache",{}),st(this,"_types",{});const r={},n={},i={};Object.keys(e).forEach(o=>{r[o]={},n[o]=[],i[o]={}});for(const o in e){const l={};e[o].forEach(c=>{l[c.name]&&Vn.throwArgumentError(`duplicate variable name ${JSON.stringify(c.name)} in ${JSON.stringify(o)}`,"types",e),l[c.name]=!0;const u=c.type.match(/^([^\x5b]*)(\x5b|$)/)[1];u===o&&Vn.throwArgumentError(`circular type reference to ${JSON.stringify(u)}`,"types",e),!rC(u)&&(n[u]||Vn.throwArgumentError(`unknown type ${JSON.stringify(u)}`,"types",e),n[u].push(o),r[o][u]=!0)})}const a=Object.keys(n).filter(o=>n[o].length===0);a.length===0?Vn.throwArgumentError("missing primary type","types",e):a.length>1&&Vn.throwArgumentError(`ambiguous primary types or unused types: ${a.map(o=>JSON.stringify(o)).join(", ")}`,"types",e),st(this,"primaryType",a[0]);function s(o,l){l[o]&&Vn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),l[o]=!0,Object.keys(r[o]).forEach(c=>{n[c]&&(s(c,l),Object.keys(l).forEach(u=>{i[u][c]=!0}))}),delete l[o]}s(this.primaryType,{});for(const o in i){const l=Object.keys(i[o]);l.sort(),this._types[o]=DO(o,e[o])+l.map(c=>DO(c,e[c])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{const i=rC(e);if(i)return i}const r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){const i=r[1],a=this.getEncoder(i),s=parseInt(r[3]);return o=>{s>=0&&o.length!==s&&Vn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",o);let l=o.map(a);return this._types[i]&&(l=l.map(_i)),_i(Ds(l))}}const n=this.types[e];if(n){const i=Jp(this._types[e]);return a=>{const s=n.map(({name:o,type:l})=>{const c=this.getEncoder(l)(a[o]);return this._types[l]?_i(c):c});return s.unshift(i),Ds(s)}}return Vn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const r=this._types[e];return r||Vn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return _i(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,n){if(rC(e))return n(e,r);const i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){const s=i[1],o=parseInt(i[3]);return o>=0&&r.length!==o&&Vn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(l=>this._visit(s,l,n))}const a=this.types[e];return a?a.reduce((s,{name:o,type:l})=>(s[o]=this._visit(l,r[o],n),s),{}):Vn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new ho(e)}static getPrimaryType(e){return ho.from(e).primaryType}static hashStruct(e,r,n){return ho.from(r).hashStruct(e,n)}static hashDomain(e){const r=[];for(const n in e){const i=PO[n];i||Vn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(n)}`,"domain",e),r.push({name:n,type:i})}return r.sort((n,i)=>tC.indexOf(n.name)-tC.indexOf(i.name)),ho.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,n){return Ds(["0x1901",ho.hashDomain(e),ho.from(r).hash(n)])}static hash(e,r,n){return _i(ho.encode(e,r,n))}static resolveNames(e,r,n,i){return B3e(this,void 0,void 0,function*(){e=Ri(e);const a={};e.verifyingContract&&!Kr(e.verifyingContract,20)&&(a[e.verifyingContract]="0x");const s=ho.from(r);s.visit(n,(o,l)=>(o==="address"&&!Kr(l,20)&&(a[l]="0x"),l));for(const o in a)a[o]=yield i(o);return e.verifyingContract&&a[e.verifyingContract]&&(e.verifyingContract=a[e.verifyingContract]),n=s.visit(n,(o,l)=>o==="address"&&a[l]?a[l]:l),{domain:e,value:n}})}static getPayload(e,r,n){ho.hashDomain(e);const i={},a=[];tC.forEach(l=>{const c=e[l];c!=null&&(i[l]=V3e[l](c),a.push({name:l,type:PO[l]}))});const s=ho.from(r),o=Ri(r);return o.EIP712Domain?Vn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):o.EIP712Domain=a,s.encode(n),{types:o,domain:i,primaryType:s.primaryType,message:s.visit(n,(l,c)=>{if(l.match(/^bytes(\d*)/))return Bt(er(c));if(l.match(/^u?int/))return nt.from(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return typeof c!="string"&&Vn.throwArgumentError("invalid string","value",c),c}return Vn.throwArgumentError("unsupported type","type",l)})}}}var Iw={},Ur={},v1=QK;function QK(t,e){if(!t)throw new Error(e||"Assertion failed")}QK.equal=function(e,r,n){if(e!=r)throw new Error(n||"Assertion failed: "+e+" != "+r)};var MI={exports:{}};typeof Object.create=="function"?MI.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:MI.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var gs=MI.exports,Y3e=v1,K3e=gs;Ur.inherits=K3e;function J3e(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function Q3e(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),i=0;i>6|192,r[n++]=a&63|128):J3e(t,i)?(a=65536+((a&1023)<<10)+(t.charCodeAt(++i)&1023),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128)}else for(i=0;i>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Ur.htonl=ZK;function X3e(t,e){for(var r="",n=0;n>>0}return a}Ur.join32=ewe;function twe(t,e){for(var r=new Array(t.length*4),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=a&255):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=a&255)}return r}Ur.split32=twe;function rwe(t,e){return t>>>e|t<<32-e}Ur.rotr32=rwe;function nwe(t,e){return t<>>32-e}Ur.rotl32=nwe;function iwe(t,e){return t+e>>>0}Ur.sum32=iwe;function awe(t,e,r){return t+e+r>>>0}Ur.sum32_3=awe;function swe(t,e,r,n){return t+e+r+n>>>0}Ur.sum32_4=swe;function owe(t,e,r,n,i){return t+e+r+n+i>>>0}Ur.sum32_5=owe;function lwe(t,e,r,n){var i=t[e],a=t[e+1],s=n+a>>>0,o=(s>>0,t[e+1]=s}Ur.sum64=lwe;function cwe(t,e,r,n){var i=e+n>>>0,a=(i>>0}Ur.sum64_hi=cwe;function uwe(t,e,r,n){var i=e+n;return i>>>0}Ur.sum64_lo=uwe;function dwe(t,e,r,n,i,a,s,o){var l=0,c=e;c=c+n>>>0,l+=c>>0,l+=c>>0,l+=c>>0}Ur.sum64_4_hi=dwe;function fwe(t,e,r,n,i,a,s,o){var l=e+n+a+o;return l>>>0}Ur.sum64_4_lo=fwe;function hwe(t,e,r,n,i,a,s,o,l,c){var u=0,f=e;f=f+n>>>0,u+=f>>0,u+=f>>0,u+=f>>0,u+=f>>0}Ur.sum64_5_hi=hwe;function pwe(t,e,r,n,i,a,s,o,l,c){var u=e+n+a+o+c;return u>>>0}Ur.sum64_5_lo=pwe;function gwe(t,e,r){var n=e<<32-r|t>>>r;return n>>>0}Ur.rotr64_hi=gwe;function mwe(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ur.rotr64_lo=mwe;function ywe(t,e,r){return t>>>r}Ur.shr64_hi=ywe;function wwe(t,e,r){var n=t<<32-r|e>>>r;return n>>>0}Ur.shr64_lo=wwe;var bm={},OO=Ur,vwe=v1;function f9(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}bm.BlockHash=f9;f9.prototype.update=function(e,r){if(e=OO.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var n=e.length%this._delta8;this.pending=e.slice(e.length-n,e.length),this.pending.length===0&&(this.pending=null),e=OO.join32(e,0,e.length-n,this.endian);for(var i=0;i>>24&255,i[a++]=e>>>16&255,i[a++]=e>>>8&255,i[a++]=e&255}else for(i[a++]=e&255,i[a++]=e>>>8&255,i[a++]=e>>>16&255,i[a++]=e>>>24&255,i[a++]=0,i[a++]=0,i[a++]=0,i[a++]=0,s=8;s>>3}Lu.g0_256=Cwe;function Swe(t){return fu(t,17)^fu(t,19)^t>>>10}Lu.g1_256=Swe;var $g=Ur,Awe=bm,Iwe=Lu,nC=$g.rotl32,N2=$g.sum32,Mwe=$g.sum32_5,Twe=Iwe.ft_1,iJ=Awe.BlockHash,kwe=[1518500249,1859775393,2400959708,3395469782];function Cu(){if(!(this instanceof Cu))return new Cu;iJ.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}$g.inherits(Cu,iJ);var Nwe=Cu;Cu.blockSize=512;Cu.outSize=160;Cu.hmacStrength=80;Cu.padLength=64;Cu.prototype._update=function(e,r){for(var n=this.W,i=0;i<16;i++)n[i]=e[r+i];for(;ithis.blockSize&&(e=new this.Hash().update(e).digest()),wve(e.length<=this.blockSize);for(var r=e.length;r{a[o.toLowerCase()]=s}):n.headers.keys().forEach(s=>{a[s.toLowerCase()]=n.headers.get(s)}),{headers:a,statusCode:n.status,statusMessage:n.statusText,body:er(new Uint8Array(i))}})}var _ve=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Gl=new De(bve);function WO(t){return new Promise(e=>{setTimeout(e,t)})}function wf(t,e){if(t==null)return null;if(typeof t=="string")return t;if(vN(t)){if(e&&(e.split("/")[0]==="text"||e.split(";")[0].trim()==="application/json"))try{return vm(t)}catch{}return Bt(t)}return t}function Cve(t){return Ao(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,r)=>String.fromCharCode(parseInt(r,16))))}function Sve(t,e,r){const n=typeof t=="object"&&t.throttleLimit!=null?t.throttleLimit:12;Gl.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);const i=typeof t=="object"?t.throttleCallback:null,a=typeof t=="object"&&typeof t.throttleSlotInterval=="number"?t.throttleSlotInterval:100;Gl.assertArgument(a>0&&a%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);const s=typeof t=="object"?!!t.errorPassThrough:!1,o={};let l=null;const c={method:"GET"};let u=!1,f=2*60*1e3;if(typeof t=="string")l=t;else if(typeof t=="object"){if((t==null||t.url==null)&&Gl.throwArgumentError("missing URL","connection.url",t),l=t.url,typeof t.timeout=="number"&&t.timeout>0&&(f=t.timeout),t.headers)for(const v in t.headers)o[v.toLowerCase()]={key:v,value:String(t.headers[v])},["if-none-match","if-modified-since"].indexOf(v.toLowerCase())>=0&&(u=!0);if(c.allowGzip=!!t.allowGzip,t.user!=null&&t.password!=null){l.substring(0,6)!=="https:"&&t.allowInsecureAuthentication!==!0&&Gl.throwError("basic authentication requires a secure https url",De.errors.INVALID_ARGUMENT,{argument:"url",url:l,user:t.user,password:"[REDACTED]"});const v=t.user+":"+t.password;o.authorization={key:"Authorization",value:"Basic "+$K(Ao(v))}}t.skipFetchSetup!=null&&(c.skipFetchSetup=!!t.skipFetchSetup),t.fetchOptions!=null&&(c.fetchOptions=Ri(t.fetchOptions))}const h=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=l?l.match(h):null;if(g)try{const v={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?jK(g[3]):Cve(g[3])};let b=v.body;return r&&(b=r(v.body,v)),Promise.resolve(b)}catch(v){Gl.throwError("processing response error",De.errors.SERVER_ERROR,{body:wf(g[1],g[2]),error:v,requestBody:null,requestMethod:"GET",url:l})}e&&(c.method="POST",c.body=e,o["content-type"]==null&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),o["content-length"]==null&&(o["content-length"]={key:"Content-Length",value:String(e.length)}));const m={};Object.keys(o).forEach(v=>{const b=o[v];m[b.key]=b.value}),c.headers=m;const w=function(){let v=null;return{promise:new Promise(function(S,j){f&&(v=setTimeout(()=>{v!=null&&(v=null,j(Gl.makeError("timeout",De.errors.TIMEOUT,{requestBody:wf(c.body,m["content-type"]),requestMethod:c.method,timeout:f,url:l})))},f))}),cancel:function(){v!=null&&(clearTimeout(v),v=null)}}}(),C=function(){return _ve(this,void 0,void 0,function*(){for(let v=0;v=300)&&(w.cancel(),Gl.throwError("bad response",De.errors.SERVER_ERROR,{status:b.statusCode,headers:b.headers,body:wf(A,b.headers?b.headers["content-type"]:null),requestBody:wf(c.body,m["content-type"]),requestMethod:c.method,url:l})),r)try{const S=yield r(A,b);return w.cancel(),S}catch(S){if(S.throttleRetry&&v{let o=null;if(a!=null)try{o=JSON.parse(vm(a))}catch(l){Gl.throwError("invalid JSON",De.errors.SERVER_ERROR,{body:a,error:l})}return r&&(o=r(o,s)),o},i=null;if(e!=null){i=Ao(e);const a=typeof t=="string"?{url:t}:Ri(t);a.headers?Object.keys(a.headers).filter(o=>o.toLowerCase()==="content-type").length!==0||(a.headers=Ri(a.headers),a.headers["content-type"]="application/json"):a.headers={"content-type":"application/json"},t=a}return Sve(t,i,n)}function cy(t,e){return e||(e={}),e=Ri(e),e.floor==null&&(e.floor=0),e.ceiling==null&&(e.ceiling=1e4),e.interval==null&&(e.interval=250),new Promise(function(r,n){let i=null,a=!1;const s=()=>a?!1:(a=!0,i&&clearTimeout(i),!0);e.timeout&&(i=setTimeout(()=>{s()&&n(new Error("timeout"))},e.timeout));const o=e.retryLimit;let l=0;function c(){return t().then(function(u){if(u!==void 0)s()&&r(u);else if(e.oncePoll)e.oncePoll.once("poll",c);else if(e.onceBlock)e.onceBlock.once("block",c);else if(!a){if(l++,l>o){s()&&n(new Error("retry limit reached"));return}let f=e.interval*parseInt(String(Math.random()*Math.pow(2,l)));fe.ceiling&&(f=e.ceiling),setTimeout(c,f)}return null},function(u){s()&&n(u)})}c()})}var T5="qpzry9x8gf2tvdw0s3jn54khce6mua7l",NI={};for(var c4=0;c4>25;return(t&33554431)<<5^-(e>>0&1)&996825010^-(e>>1&1)&642813549^-(e>>2&1)&513874426^-(e>>3&1)&1027748829^-(e>>4&1)&705979059}function gJ(t){for(var e=1,r=0;r126)return"Invalid prefix ("+t+")";e=hg(e)^n>>5}for(e=hg(e),r=0;rr)throw new TypeError("Exceeds length limit");t=t.toLowerCase();var n=gJ(t);if(typeof n=="string")throw new Error(n);for(var i=t+"1",a=0;a>5)throw new Error("Non 5-bit word");n=hg(n)^s,i+=T5.charAt(s)}for(a=0;a<6;++a)n=hg(n);for(n^=1,a=0;a<6;++a){var o=n>>(5-a)*5&31;i+=T5.charAt(o)}return i}function mJ(t,e){if(e=e||90,t.length<8)return t+" too short";if(t.length>e)return"Exceeds length limit";var r=t.toLowerCase(),n=t.toUpperCase();if(t!==r&&t!==n)return"Mixed-case string "+t;t=r;var i=t.lastIndexOf("1");if(i===-1)return"No separator character for "+t;if(i===0)return"Missing prefix for "+t;var a=t.slice(0,i),s=t.slice(i+1);if(s.length<6)return"Data too short";var o=gJ(a);if(typeof o=="string")return o;for(var l=[],c=0;c=s.length)&&l.push(f)}return o!==1?"Invalid checksum for "+t:{prefix:a,words:l}}function Ive(){var t=mJ.apply(null,arguments);if(typeof t=="object")return t}function Mve(t){var e=mJ.apply(null,arguments);if(typeof e=="object")return e;throw new Error(e)}function h9(t,e,r,n){for(var i=0,a=0,s=(1<=r;)a-=r,o.push(i>>a&s);if(n)a>0&&o.push(i<=e)return"Excess padding";if(i<>8,h=u&255;f?l.push(f,h):l.push(h)}return l}r.toArray=n;function i(s){return s.length===1?"0"+s:s}r.zero2=i;function a(s){for(var o="",l=0;l(h>>1)-1?w=(h>>1)-C:w=C,g.isubn(w)):w=0,f[m]=w,g.iushrn(1)}return f}r.getNAF=n;function i(l,c){var u=[[],[]];l=l.clone(),c=c.clone();for(var f=0,h=0,g;l.cmpn(-f)>0||c.cmpn(-h)>0;){var m=l.andln(3)+f&3,w=c.andln(3)+h&3;m===3&&(m=-1),w===3&&(w=-1);var C;m&1?(g=l.andln(7)+f&7,(g===3||g===5)&&w===2?C=-m:C=m):C=0,u[0].push(C);var v;w&1?(g=c.andln(7)+h&7,(g===3||g===5)&&m===2?v=-w:v=w):v=0,u[1].push(v),2*f===C+1&&(f=1-f),2*h===v+1&&(h=1-h),l.iushrn(1),c.iushrn(1)}return u}r.getJSF=i;function a(l,c,u){var f="_"+c;l.prototype[c]=function(){return this[f]!==void 0?this[f]:this[f]=u.call(this)}}r.cachedProperty=a;function s(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=s;function o(l){return new yr(l,"hex","le")}r.intFromLE=o}),k5=$o.getNAF,Pve=$o.getJSF,N5=$o.assert;function Eh(t,e){this.type=t,this.p=new yr(e.p,16),this.red=e.prime?yr.red(e.prime):yr.mont(this.p),this.zero=new yr(0).toRed(this.red),this.one=new yr(1).toRed(this.red),this.two=new yr(2).toRed(this.red),this.n=e.n&&new yr(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var b1=Eh;Eh.prototype.point=function(){throw new Error("Not implemented")};Eh.prototype.validate=function(){throw new Error("Not implemented")};Eh.prototype._fixedNafMul=function(e,r){N5(e.precomputed);var n=e._getDoubles(),i=k5(r,1,this._bitLength),a=(1<=o;c--)l=(l<<1)+i[c];s.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&s[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=s[l];N5(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(a[u-1>>1]):o=o.mixedAdd(a[-u-1>>1].neg()):u>0?o=o.add(a[u-1>>1]):o=o.add(a[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};Eh.prototype._wnafMulAdd=function(e,r,n,i,a){var s=this._wnafT1,o=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(s[m]!==1||s[w]!==1){l[m]=k5(n[m],s[m],this._bitLength),l[w]=k5(n[w],s[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var C=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(C[1]=r[m].add(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].add(r[w].neg())):(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=Pve(n[m],n[w]);for(c=Math.max(b[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var I=0;u>=0;){var B=!0;for(f=0;f=0&&I++,j=j.dblp(I),u<0)break;for(f=0;f0?h=o[f][V-1>>1]:V<0&&(h=o[f][-V-1>>1].neg()),h.type==="affine"?j=j.mixedAdd(h):j=j.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};El.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a=0&&(g=c,m=u),f.negative&&(f=f.neg(),h=h.neg()),g.negative&&(g=g.neg(),m=m.neg()),[{a:f,b:h},{a:g,b:m}]};_l.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),o=a.mul(n.a),l=s.mul(i.a),c=a.mul(n.b),u=s.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};_l.prototype.pointFromX=function(e,r){e=new yr(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)};_l.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};_l.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,s=0;s":""};ua.prototype.isInfinity=function(){return this.inf};ua.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};ua.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)};ua.prototype.getX=function(){return this.x.fromRed()};ua.prototype.getY=function(){return this.y.fromRed()};ua.prototype.mul=function(e){return e=new yr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};ua.prototype.mulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};ua.prototype.jmulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};ua.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};ua.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(a){return a.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};ua.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function ba(t,e,r,n){b1.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new yr(0)):(this.x=new yr(e,16),this.y=new yr(r,16),this.z=new yr(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}IN(ba,b1.BasePoint);_l.prototype.jpoint=function(e,r,n){return new ba(this,e,r,n)};ba.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};ba.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};ba.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(a),c=s.redSub(o);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),f=u.redMul(l),h=i.redMul(u),g=c.redSqr().redIAdd(f).redISub(h).redISub(h),m=c.redMul(h.redISub(g)).redISub(s.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};ba.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,s=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=a.redSub(s);if(o.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(a.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};ba.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}};ba.prototype.inspect=function(){return this.isInfinity()?"":""};ba.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var y6=_m(function(t,e){var r=e;r.base=b1,r.short=Dve,r.mont=null,r.edwards=null}),w6=_m(function(t,e){var r=e,n=$o.assert;function i(o){o.type==="short"?this.curve=new y6.short(o):o.type==="edwards"?this.curve=new y6.edwards(o):this.curve=new y6.mont(o),this.g=this.curve.g,this.n=this.curve.n,this.hash=o.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function a(o,l){Object.defineProperty(r,o,{configurable:!0,enumerable:!0,get:function(){var c=new i(l);return Object.defineProperty(r,o,{configurable:!0,enumerable:!0,value:c}),c}})}a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Vc.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Vc.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Vc.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Vc.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Vc.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Vc.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Vc.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var s;try{s=null.crash()}catch{s=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Vc.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",s]})});function oh(t){if(!(this instanceof oh))return new oh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=ac.toArray(t.entropy,t.entropyEnc||"hex"),r=ac.toArray(t.nonce,t.nonceEnc||"hex"),n=ac.toArray(t.pers,t.persEnc||"hex");AN(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var wJ=oh;oh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};oh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=ac.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length"};var Ove=$o.assert;function p9(t,e){if(t instanceof p9)return t;this._importDER(t,e)||(Ove(t.r&&t.s,"Signature without r or s"),this.r=new yr(t.r,16),this.s=new yr(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var g9=p9;function Fve(){this.place=0}function oC(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var i=0,a=0,s=e.place;a>>=0;return i<=127?!1:(e.place=s,i)}function GO(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}p9.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=GO(r),n=GO(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];lC(i,r.length),i=i.concat(r),i.push(2),lC(i,n.length);var a=i.concat(n),s=[48];return lC(s,a.length),s=s.concat(a),$o.encode(s,e)};var Uve=function(){throw new Error("unsupported")},vJ=$o.assert;function wl(t){if(!(this instanceof wl))return new wl(t);typeof t=="string"&&(vJ(Object.prototype.hasOwnProperty.call(w6,t),"Unknown curve "+t),t=w6[t]),t instanceof w6.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var Bve=wl;wl.prototype.keyPair=function(e){return new MN(this,e)};wl.prototype.keyFromPrivate=function(e,r){return MN.fromPrivate(this,e,r)};wl.prototype.keyFromPublic=function(e,r){return MN.fromPublic(this,e,r)};wl.prototype.genKeyPair=function(e){e||(e={});for(var r=new wJ({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Uve(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new yr(2));;){var a=new yr(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};wl.prototype._truncateToN=function(e,r){var n=e.byteLength()*8-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};wl.prototype.sign=function(e,r,n,i){typeof n=="object"&&(i=n,n=null),i||(i={}),r=this.keyFromPrivate(r,n),e=this._truncateToN(new yr(e,16));for(var a=this.n.byteLength(),s=r.getPrivate().toArray("be",a),o=e.toArray("be",a),l=new wJ({hash:this.hash,entropy:s,nonce:o,pers:i.pers,persEnc:i.persEnc||"utf8"}),c=this.n.sub(new yr(1)),u=0;;u++){var f=i.k?i.k(u):new yr(l.generate(this.n.byteLength()));if(f=this._truncateToN(f,!0),!(f.cmpn(1)<=0||f.cmp(c)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var g=h.getX(),m=g.umod(this.n);if(m.cmpn(0)!==0){var w=f.invm(this.n).mul(m.mul(r.getPrivate()).iadd(e));if(w=w.umod(this.n),w.cmpn(0)!==0){var C=(h.getY().isOdd()?1:0)|(g.cmp(m)!==0?2:0);return i.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),C^=1),new g9({r:m,s:w,recoveryParam:C})}}}}}};wl.prototype.verify=function(e,r,n,i){e=this._truncateToN(new yr(e,16)),n=this.keyFromPublic(n,i),r=new g9(r,"hex");var a=r.r,s=r.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var o=s.invm(this.n),l=o.mul(e).umod(this.n),c=o.mul(a).umod(this.n),u;return this.curve._maxwellTrick?(u=this.g.jmulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.eqXToP(a)):(u=this.g.mulAdd(l,n.getPublic(),c),u.isInfinity()?!1:u.getX().umod(this.n).cmp(a)===0)};wl.prototype.recoverPubKey=function(t,e,r,n){vJ((3&r)===r,"The recovery param is more than two bits"),e=new g9(e,n);var i=this.n,a=new yr(t),s=e.r,o=e.s,l=r&1,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,s,h)};wl.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new g9(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var zve=_m(function(t,e){var r=e;r.version="6.5.4",r.utils=$o,r.rand=function(){throw new Error("unsupported")},r.curve=y6,r.curves=w6,r.ec=Bve,r.eddsa=null}),Wve=zve.ec;const Hve="signing-key/5.7.0",jI=new De(Hve);let cC=null;function Tf(){return cC||(cC=new Wve("secp256k1")),cC}class Gve{constructor(e){st(this,"curve","secp256k1"),st(this,"privateKey",Bt(e)),Y0(this.privateKey)!==32&&jI.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=Tf().keyFromPrivate(er(this.privateKey));st(this,"publicKey","0x"+r.getPublic(!1,"hex")),st(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),st(this,"_isSigningKey",!0)}_addPoint(e){const r=Tf().keyFromPublic(er(this.publicKey)),n=Tf().keyFromPublic(er(e));return"0x"+r.pub.add(n.pub).encodeCompressed("hex")}signDigest(e){const r=Tf().keyFromPrivate(er(this.privateKey)),n=er(e);n.length!==32&&jI.throwArgumentError("bad digest length","digest",e);const i=r.sign(n,{canonical:!0});return c9({recoveryParam:i.recoveryParam,r:Bn("0x"+i.r.toString(16),32),s:Bn("0x"+i.s.toString(16),32)})}computeSharedSecret(e){const r=Tf().keyFromPrivate(er(this.privateKey)),n=Tf().keyFromPublic(er(bJ(e)));return Bn("0x"+r.derive(n.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function qve(t,e){const r=c9(e),n={r:er(r.r),s:er(r.s)};return"0x"+Tf().recoverPubKey(er(t),n,r.recoveryParam).encode("hex",!1)}function bJ(t,e){const r=er(t);return r.length===32?new Gve(r).publicKey:r.length===33?"0x"+Tf().keyFromPublic(r).getPublic(!1,"hex"):r.length===65?Bt(r):jI.throwArgumentError("invalid public or private key","key","[REDACTED]")}const Vve="transactions/5.7.0",Hs=new De(Vve);var qO;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(qO||(qO={}));function TN(t){return t==="0x"?null:Ir(t)}function $a(t){return t==="0x"?RK:nt.from(t)}const Yve=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Kve={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Jve(t){const e=bJ(t);return Ir(Na(_i(Na(e,1)),12))}function kN(t,e){return Jve(qve(er(t),e))}function wo(t,e){const r=V0(nt.from(t).toHexString());return r.length>32&&Hs.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function uC(t,e){return{address:Ir(t),storageKeys:(e||[]).map((r,n)=>(Y0(r)!==32&&Hs.throwArgumentError("invalid access list storageKey",`accessList[${t}:${n}]`,r),r.toLowerCase()))}}function Cm(t){if(Array.isArray(t))return t.map((r,n)=>Array.isArray(r)?(r.length>2&&Hs.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${n}]`,r),uC(r[0],r[1])):uC(r.address,r.storageKeys));const e=Object.keys(t).map(r=>{const n=t[r].reduce((i,a)=>(i[a]=!0,i),{});return uC(r,Object.keys(n).sort())});return e.sort((r,n)=>r.address.localeCompare(n.address)),e}function xJ(t){return Cm(t).map(e=>[e.address,e.storageKeys])}function EJ(t,e){if(t.gasPrice!=null){const n=nt.from(t.gasPrice),i=nt.from(t.maxFeePerGas||0);n.eq(i)||Hs.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:n,maxFeePerGas:i})}const r=[wo(t.chainId||0,"chainId"),wo(t.nonce||0,"nonce"),wo(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),wo(t.maxFeePerGas||0,"maxFeePerGas"),wo(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",wo(t.value||0,"value"),t.data||"0x",xJ(t.accessList||[])];if(e){const n=c9(e);r.push(wo(n.recoveryParam,"recoveryParam")),r.push(V0(n.r)),r.push(V0(n.s))}return Ds(["0x02",Sw(r)])}function _J(t,e){const r=[wo(t.chainId||0,"chainId"),wo(t.nonce||0,"nonce"),wo(t.gasPrice||0,"gasPrice"),wo(t.gasLimit||0,"gasLimit"),t.to!=null?Ir(t.to):"0x",wo(t.value||0,"value"),t.data||"0x",xJ(t.accessList||[])];if(e){const n=c9(e);r.push(wo(n.recoveryParam,"recoveryParam")),r.push(V0(n.r)),r.push(V0(n.s))}return Ds(["0x01",Sw(r)])}function Qve(t,e){NK(t,Kve);const r=[];Yve.forEach(function(i){let a=t[i.name]||[];const s={};i.numeric&&(s.hexPad="left"),a=er(Bt(a,s)),i.length&&a.length!==i.length&&a.length>0&&Hs.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,a),i.maxLength&&(a=V0(a),a.length>i.maxLength&&Hs.throwArgumentError("invalid length for "+i.name,"transaction:"+i.name,a)),r.push(Bt(a))});let n=0;return t.chainId!=null&&(n=t.chainId,typeof n!="number"&&Hs.throwArgumentError("invalid transaction.chainId","transaction",t)),n!==0&&(r.push(Bt(n)),r.push("0x"),r.push("0x")),Sw(r)}function Zve(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Hs.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),Qve(t);switch(t.type){case 1:return _J(t,e);case 2:return EJ(t,e)}return Hs.throwError(`unsupported transaction type: ${t.type}`,De.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}function CJ(t,e,r){try{const n=$a(e[0]).toNumber();if(n!==0&&n!==1)throw new Error("bad recid");t.v=n}catch{Hs.throwArgumentError("invalid v for transaction type: 1","v",e[0])}t.r=Bn(e[1],32),t.s=Bn(e[2],32);try{const n=_i(r(t));t.from=kN(n,{r:t.r,s:t.s,recoveryParam:t.v})}catch{}}function Xve(t){const e=_N(t.slice(1));e.length!==9&&e.length!==12&&Hs.throwArgumentError("invalid component count for transaction type: 2","payload",Bt(t));const r=$a(e[2]),n=$a(e[3]),i={type:2,chainId:$a(e[0]).toNumber(),nonce:$a(e[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:$a(e[4]),to:TN(e[5]),value:$a(e[6]),data:e[7],accessList:Cm(e[8])};return e.length===9||(i.hash=_i(t),CJ(i,e.slice(9),EJ)),i}function ebe(t){const e=_N(t.slice(1));e.length!==8&&e.length!==11&&Hs.throwArgumentError("invalid component count for transaction type: 1","payload",Bt(t));const r={type:1,chainId:$a(e[0]).toNumber(),nonce:$a(e[1]).toNumber(),gasPrice:$a(e[2]),gasLimit:$a(e[3]),to:TN(e[4]),value:$a(e[5]),data:e[6],accessList:Cm(e[7])};return e.length===8||(r.hash=_i(t),CJ(r,e.slice(8),_J)),r}function tbe(t){const e=_N(t);e.length!==9&&e.length!==6&&Hs.throwArgumentError("invalid raw transaction","rawTransaction",t);const r={nonce:$a(e[0]).toNumber(),gasPrice:$a(e[1]),gasLimit:$a(e[2]),to:TN(e[3]),value:$a(e[4]),data:e[5],chainId:0};if(e.length===6)return r;try{r.v=nt.from(e[6]).toNumber()}catch{return r}if(r.r=Bn(e[7],32),r.s=Bn(e[8],32),nt.from(r.r).isZero()&&nt.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=e.slice(0,6);r.chainId!==0&&(i.push(Bt(r.chainId)),i.push("0x"),i.push("0x"),n-=r.chainId*2+8);const a=_i(Sw(i));try{r.from=kN(a,{r:Bt(r.r),s:Bt(r.s),recoveryParam:n})}catch{}r.hash=_i(t)}return r.type=null,r}function rbe(t){const e=er(t);if(e[0]>127)return tbe(e);switch(e[0]){case 1:return ebe(e);case 2:return Xve(e)}return Hs.throwError(`unsupported transaction type: ${e[0]}`,De.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:e[0]})}const j2=new De(Mw);class jt{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},r=this.address.bind(this),n=this.bigNumber.bind(this),i=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),o=this.hex.bind(this),l=this.number.bind(this),c=this.type.bind(this),u=f=>this.data(f,!0);return e.transaction={hash:s,type:c,accessList:jt.allowNull(this.accessList.bind(this),null),blockHash:jt.allowNull(s,null),blockNumber:jt.allowNull(l,null),transactionIndex:jt.allowNull(l,null),confirmations:jt.allowNull(l,null),from:r,gasPrice:jt.allowNull(n),maxPriorityFeePerGas:jt.allowNull(n),maxFeePerGas:jt.allowNull(n),gasLimit:n,to:jt.allowNull(r,null),value:n,nonce:l,data:a,r:jt.allowNull(this.uint256),s:jt.allowNull(this.uint256),v:jt.allowNull(l),creates:jt.allowNull(r,null),raw:jt.allowNull(a)},e.transactionRequest={from:jt.allowNull(r),nonce:jt.allowNull(l),gasLimit:jt.allowNull(n),gasPrice:jt.allowNull(n),maxPriorityFeePerGas:jt.allowNull(n),maxFeePerGas:jt.allowNull(n),to:jt.allowNull(r),value:jt.allowNull(n),data:jt.allowNull(u),type:jt.allowNull(l),accessList:jt.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:l,blockNumber:l,transactionHash:s,address:r,topics:jt.arrayOf(s),data:a,logIndex:l,blockHash:s},e.receipt={to:jt.allowNull(this.address,null),from:jt.allowNull(this.address,null),contractAddress:jt.allowNull(r,null),transactionIndex:l,root:jt.allowNull(o),gasUsed:n,logsBloom:jt.allowNull(a),blockHash:s,transactionHash:s,logs:jt.arrayOf(this.receiptLog.bind(this)),blockNumber:l,confirmations:jt.allowNull(l,null),cumulativeGasUsed:n,effectiveGasPrice:jt.allowNull(n),status:jt.allowNull(l),type:c},e.block={hash:jt.allowNull(s),parentHash:s,number:l,timestamp:l,nonce:jt.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:n,gasUsed:n,miner:jt.allowNull(r),extraData:a,transactions:jt.allowNull(jt.arrayOf(s)),baseFeePerGas:jt.allowNull(n)},e.blockWithTransactions=Ri(e.block),e.blockWithTransactions.transactions=jt.allowNull(jt.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:jt.allowNull(i,void 0),toBlock:jt.allowNull(i,void 0),blockHash:jt.allowNull(s,void 0),address:jt.allowNull(r,void 0),topics:jt.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:jt.allowNull(l),blockHash:jt.allowNull(s),transactionIndex:l,removed:jt.allowNull(this.boolean.bind(this)),address:r,data:jt.allowFalsish(a,"0x"),topics:jt.arrayOf(s),transactionHash:s,logIndex:l},e}accessList(e){return Cm(e||[])}number(e){return e==="0x"?0:nt.from(e).toNumber()}type(e){return e==="0x"||e==null?0:nt.from(e).toNumber()}bigNumber(e){return nt.from(e)}boolean(e){if(typeof e=="boolean")return e;if(typeof e=="string"){if(e=e.toLowerCase(),e==="true")return!0;if(e==="false")return!1}throw new Error("invalid boolean - "+e)}hex(e,r){return typeof e=="string"&&(!r&&e.substring(0,2)!=="0x"&&(e="0x"+e),Kr(e))?e.toLowerCase():j2.throwArgumentError("invalid hash","value",e)}data(e,r){const n=this.hex(e,r);if(n.length%2!==0)throw new Error("invalid data; odd-length - "+e);return n}address(e){return Ir(e)}callAddress(e){if(!Kr(e,32))return null;const r=Ir(Na(e,12));return r===a3e?null:r}contractAddress(e){return kK(e)}blockTag(e){if(e==null)return"latest";if(e==="earliest")return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if(typeof e=="number"||Kr(e))return bN(e);throw new Error("invalid blockTag")}hash(e,r){const n=this.hex(e,r);return Y0(n)!==32?j2.throwArgumentError("invalid hash","value",e):n}difficulty(e){if(e==null)return null;const r=nt.from(e);try{return r.toNumber()}catch{}return null}uint256(e){if(!Kr(e))throw new Error("invalid uint256");return Bn(e,32)}_block(e,r){e.author!=null&&e.miner==null&&(e.miner=e.author);const n=e._difficulty!=null?e._difficulty:e.difficulty,i=jt.check(r,e);return i._difficulty=n==null?null:nt.from(n),i}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return jt.check(this.formats.transactionRequest,e)}transactionResponse(e){e.gas!=null&&e.gasLimit==null&&(e.gasLimit=e.gas),e.to&&nt.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),e.input!=null&&e.data==null&&(e.data=e.input),e.to==null&&e.creates==null&&(e.creates=this.contractAddress(e)),(e.type===1||e.type===2)&&e.accessList==null&&(e.accessList=[]);const r=jt.check(this.formats.transaction,e);if(e.chainId!=null){let n=e.chainId;Kr(n)&&(n=nt.from(n).toNumber()),r.chainId=n}else{let n=e.networkId;n==null&&r.v==null&&(n=e.chainId),Kr(n)&&(n=nt.from(n).toNumber()),typeof n!="number"&&r.v!=null&&(n=(r.v-35)/2,n<0&&(n=0),n=parseInt(n)),typeof n!="number"&&(n=0),r.chainId=n}return r.blockHash&&r.blockHash.replace(/0/g,"")==="x"&&(r.blockHash=null),r}transaction(e){return rbe(e)}receiptLog(e){return jt.check(this.formats.receiptLog,e)}receipt(e){const r=jt.check(this.formats.receipt,e);if(r.root!=null)if(r.root.length<=4){const n=nt.from(r.root).toNumber();n===0||n===1?(r.status!=null&&r.status!==n&&j2.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):j2.throwArgumentError("invalid alt-root-status","value.root",r.root)}else r.root.length!==66&&j2.throwArgumentError("invalid root hash","value.root",r.root);return r.status!=null&&(r.byzantium=!0),r}topics(e){return Array.isArray(e)?e.map(r=>this.topics(r)):e!=null?this.hash(e,!0):null}filter(e){return jt.check(this.formats.filter,e)}filterLog(e){return jt.check(this.formats.filterLog,e)}static check(e,r){const n={};for(const i in e)try{const a=e[i](r[i]);a!==void 0&&(n[i]=a)}catch(a){throw a.checkKey=i,a.checkValue=r[i],a}return n}static allowNull(e,r){return function(n){return n==null?r:e(n)}}static allowFalsish(e,r){return function(n){return n?e(n):r}}static arrayOf(e){return function(r){if(!Array.isArray(r))throw new Error("not an array");const n=[];return r.forEach(function(i){n.push(e(i))}),n}}}var hr=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const Mr=new De(Mw),nbe=10;function VO(t){return t==null?"null":(Y0(t)!==32&&Mr.throwArgumentError("invalid topic","topic",t),t.toLowerCase())}function YO(t){for(t=t.slice();t.length>0&&t[t.length-1]==null;)t.pop();return t.map(e=>{if(Array.isArray(e)){const r={};e.forEach(i=>{r[VO(i)]=!0});const n=Object.keys(r);return n.sort(),n.join("|")}else return VO(e)}).join("&")}function ibe(t){return t===""?[]:t.split(/&/g).map(e=>{if(e==="")return[];const r=e.split("|").map(n=>n==="null"?null:n);return r.length===1?r[0]:r})}function hp(t){if(typeof t=="string"){if(t=t.toLowerCase(),Y0(t)===32)return"tx:"+t;if(t.indexOf(":")===-1)return t}else{if(Array.isArray(t))return"filter:*:"+YO(t);if(t3e.isForkEvent(t))throw Mr.warn("not implemented"),new Error("not implemented");if(t&&typeof t=="object")return"filter:"+(t.address||"*")+":"+YO(t.topics||[])}throw new Error("invalid event - "+t)}function $2(){return new Date().getTime()}function KO(t){return new Promise(e=>{setTimeout(e,t)})}const abe=["block","network","pending","poll"];let sbe=class{constructor(e,r,n){st(this,"tag",e),st(this,"listener",r),st(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return e[0]!=="tx"?null:e[1]}get filter(){const e=this.tag.split(":");if(e[0]!=="filter")return null;const r=e[1],n=ibe(e[2]),i={};return n.length>0&&(i.topics=n),r&&r!=="*"&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||abe.indexOf(this.tag)>=0}};const obe={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function dC(t){return Bn(nt.from(t).toHexString(),32)}function JO(t){return II.encode(Us([t,Na(zO(zO(t)),0,4)]))}const SJ=new RegExp("^(ipfs)://(.*)$","i"),QO=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),SJ,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function v6(t,e){try{return vm(v3(t,e))}catch{}return null}function v3(t,e){if(t==="0x")return null;const r=nt.from(Na(t,e,e+32)).toNumber(),n=nt.from(Na(t,r,r+32)).toNumber();return Na(t,r+32,r+32+n)}function fC(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):Mr.throwArgumentError("unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}function ZO(t){const e=er(t);if(e.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(e,32-e.length),r}function lbe(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}function AJ(t){const e=[];let r=0;for(let n=0;nnt.from(e).eq(1)).catch(e=>{if(e.code===De.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,r){return hr(this,void 0,void 0,function*(){const n={to:this.address,ccipReadEnabled:!0,data:Ds([e,m6(this.name),r||"0x"])};let i=!1;(yield this.supportsWildcard())&&(i=!0,n.data=Ds(["0x9061b923",AJ([F3e(this.name),n.data])]));try{let a=yield this.provider.call(n);return er(a).length%32===4&&Mr.throwError("resolver threw error",De.errors.CALL_EXCEPTION,{transaction:n,data:a}),i&&(a=v3(a,0)),a}catch(a){if(a.code===De.errors.CALL_EXCEPTION)return null;throw a}})}_fetchBytes(e,r){return hr(this,void 0,void 0,function*(){const n=yield this._fetch(e,r);return n!=null?v3(n,0):null})}_getAddress(e,r){const n=obe[String(e)];if(n==null&&Mr.throwError(`unsupported coin type: ${e}`,De.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),n.ilk==="eth")return this.provider.formatter.address(r);const i=er(r);if(n.p2pkh!=null){const a=r.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(a){const s=parseInt(a[1],16);if(a[2].length===s*2&&s>=1&&s<=75)return JO(Us([[n.p2pkh],"0x"+a[2]]))}}if(n.p2sh!=null){const a=r.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){const s=parseInt(a[1],16);if(a[2].length===s*2&&s>=1&&s<=75)return JO(Us([[n.p2sh],"0x"+a[2]]))}}if(n.prefix!=null){const a=i[1];let s=i[0];if(s===0?a!==20&&a!==32&&(s=-1):s=-1,s>=0&&i.length===2+a&&a>=1&&a<=75){const o=HO.toWords(i.slice(2));return o.unshift(s),HO.encode(n.prefix,o)}}return null}getAddress(e){return hr(this,void 0,void 0,function*(){if(e==null&&(e=60),e===60)try{const i=yield this._fetch("0x3b3b57de");return i==="0x"||i===c3e?null:this.provider.formatter.callAddress(i)}catch(i){if(i.code===De.errors.CALL_EXCEPTION)return null;throw i}const r=yield this._fetchBytes("0xf1cb7e06",dC(e));if(r==null||r==="0x")return null;const n=this._getAddress(e,r);return n==null&&Mr.throwError("invalid or unsupported coin data",De.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:r}),n})}getAvatar(){return hr(this,void 0,void 0,function*(){const e=[{type:"name",content:this.name}];try{const r=yield this.getText("avatar");if(r==null)return null;for(let n=0;ns[l])}return Mr.throwError("invalid or unsupported content hash data",De.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return hr(this,void 0,void 0,function*(){let r=Ao(e);r=Us([dC(64),dC(r.length),r]),r.length%32!==0&&(r=Us([r,Bn("0x",32-e.length%32)]));const n=yield this._fetchBytes("0x59d1d43c",Bt(r));return n==null||n==="0x"?null:vm(n)})}}let hC=null,cbe=1;class ube extends u9{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),st(this,"anyNetwork",e==="any"),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(r=>{}),this._ready().catch(r=>{});else{const r=su(new.target,"getNetwork")(e);r?(st(this,"_network",r),this.emit("network",r,null)):Mr.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return hr(this,void 0,void 0,function*(){if(this._network==null){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch{}e==null&&(e=yield this.detectNetwork()),e||Mr.throwError("no network detected",De.errors.UNKNOWN_ERROR,{}),this._network==null&&(this.anyNetwork?this._network=e:st(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return cy(()=>this._ready().then(e=>e,e=>{if(!(e.code===De.errors.NETWORK_ERROR&&e.event==="noNetwork"))throw e}))}static getFormatter(){return hC==null&&(hC=new jt),hC}static getNetwork(e){return i3e(e??"homestead")}ccipReadFetch(e,r,n){return hr(this,void 0,void 0,function*(){if(this.disableCcipRead||n.length===0)return null;const i=e.to.toLowerCase(),a=r.toLowerCase(),s=[];for(let o=0;o=0?null:JSON.stringify({data:a,sender:i}),f=yield SN({url:c,errorPassThrough:!0},u,(g,m)=>(g.status=m.statusCode,g));if(f.data)return f.data;const h=f.message||"unknown error";if(f.status>=400&&f.status<500)return Mr.throwError(`response not found during CCIP fetch: ${h}`,De.errors.SERVER_ERROR,{url:l,errorMessage:h});s.push(h)}return Mr.throwError(`error encountered during CCIP fetch: ${s.map(o=>JSON.stringify(o)).join(", ")}`,De.errors.SERVER_ERROR,{urls:n,errorMessages:s})})}_getInternalBlockNumber(e){return hr(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const i=this._internalBlockNumber;try{const a=yield i;if($2()-a.respTime<=e)return a.blockNumber;break}catch{if(this._internalBlockNumber===i)break}}const r=$2(),n=vi({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(i=>null,i=>i)}).then(({blockNumber:i,networkError:a})=>{if(a)throw this._internalBlockNumber===n&&(this._internalBlockNumber=null),a;const s=$2();return i=nt.from(i).toNumber(),i{this._internalBlockNumber===n&&(this._internalBlockNumber=null)}),(yield n).blockNumber})}poll(){return hr(this,void 0,void 0,function*(){const e=cbe++,r=[];let n=null;try{n=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(i){this.emit("error",i);return}if(this._setFastBlockNumber(n),this.emit("poll",e,n),n===this._lastBlockNumber){this.emit("didPoll",e);return}if(this._emitted.block===-2&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)Mr.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${n})`),this.emit("error",Mr.makeError("network block skew detected",De.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(let i=this._emitted.block+1;i<=n;i++)this.emit("block",i);this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach(i=>{if(i==="block")return;const a=this._emitted[i];a!=="pending"&&n-a>12&&delete this._emitted[i]})),this._lastBlockNumber===-2&&(this._lastBlockNumber=n-1),this._events.forEach(i=>{switch(i.type){case"tx":{const a=i.hash;let s=this.getTransactionReceipt(a).then(o=>(!o||o.blockNumber==null||(this._emitted["t:"+a]=o.blockNumber,this.emit(a,o)),null)).catch(o=>{this.emit("error",o)});r.push(s);break}case"filter":{if(!i._inflight){i._inflight=!0,i._lastBlockNumber===-2&&(i._lastBlockNumber=n-1);const a=i.filter;a.fromBlock=i._lastBlockNumber+1,a.toBlock=n;const s=a.toBlock-this._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);const o=this.getLogs(a).then(l=>{i._inflight=!1,l.length!==0&&l.forEach(c=>{c.blockNumber>i._lastBlockNumber&&(i._lastBlockNumber=c.blockNumber),this._emitted["b:"+c.blockHash]=c.blockNumber,this._emitted["t:"+c.transactionHash]=c.blockNumber,this.emit(a,c)})}).catch(l=>{this.emit("error",l),i._inflight=!1});r.push(o)}break}}}),this._lastBlockNumber=n,Promise.all(r).then(()=>{this.emit("didPoll",e)}).catch(i=>{this.emit("error",i)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return hr(this,void 0,void 0,function*(){return Mr.throwError("provider does not support network detection",De.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return hr(this,void 0,void 0,function*(){const e=yield this._ready(),r=yield this.detectNetwork();if(e.chainId!==r.chainId){if(this.anyNetwork)return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,e),yield KO(0),this._network;const n=Mr.makeError("underlying network changed",De.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:r});throw this.emit("error",n),n}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),this._fastBlockNumber!=null?this._fastBlockNumber:-1}get polling(){return this._poller!=null}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if(typeof e!="number"||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){const e=$2();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(r=>((this._fastBlockNumber==null||r>this._fastBlockNumber)&&(this._fastBlockNumber=r),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){this._fastBlockNumber!=null&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,r,n){return hr(this,void 0,void 0,function*(){return this._waitForTransaction(e,r??1,n||0,null)})}_waitForTransaction(e,r,n,i){return hr(this,void 0,void 0,function*(){const a=yield this.getTransactionReceipt(e);return(a?a.confirmations:0)>=r?a:new Promise((s,o)=>{const l=[];let c=!1;const u=function(){return c?!0:(c=!0,l.forEach(h=>{h()}),!1)},f=h=>{h.confirmations{this.removeListener(e,f)}),i){let h=i.startBlock,g=null;const m=w=>hr(this,void 0,void 0,function*(){c||(yield KO(1e3),this.getTransactionCount(i.from).then(C=>hr(this,void 0,void 0,function*(){if(!c){if(C<=i.nonce)h=w;else{{const v=yield this.getTransaction(e);if(v&&v.blockNumber!=null)return}for(g==null&&(g=h-3,g{c||this.once("block",m)}))});if(c)return;this.once("block",m),l.push(()=>{this.removeListener("block",m)})}if(typeof n=="number"&&n>0){const h=setTimeout(()=>{u()||o(Mr.makeError("timeout exceeded",De.errors.TIMEOUT,{timeout:n}))},n);h.unref&&h.unref(),l.push(()=>{clearTimeout(h)})}})})}getBlockNumber(){return hr(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return nt.from(e)}catch(r){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:r})}})}getBalance(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getBalance",n);try{return nt.from(i)}catch(a){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:a})}})}getTransactionCount(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getTransactionCount",n);try{return nt.from(i).toNumber()}catch(a){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:a})}})}getCode(e,r){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const n=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(r)}),i=yield this.perform("getCode",n);try{return Bt(i)}catch(a){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:a})}})}getStorageAt(e,r,n){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const i=yield vi({address:this._getAddress(e),blockTag:this._getBlockTag(n),position:Promise.resolve(r).then(s=>bN(s))}),a=yield this.perform("getStorageAt",i);try{return Bt(a)}catch(s){return Mr.throwError("bad result from backend",De.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:a,error:s})}})}_wrapTransaction(e,r,n){if(r!=null&&Y0(r)!==32)throw new Error("invalid response - sendTransaction");const i=e;return r!=null&&e.hash!==r&&Mr.throwError("Transaction hash mismatch from Provider.sendTransaction.",De.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:r}),i.wait=(a,s)=>hr(this,void 0,void 0,function*(){a==null&&(a=1),s==null&&(s=0);let o;a!==0&&n!=null&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:n});const l=yield this._waitForTransaction(e.hash,a,s,o);return l==null&&a===0?null:(this._emitted["t:"+e.hash]=l.blockNumber,l.status===0&&Mr.throwError("transaction failed",De.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:l}),l)}),i}sendTransaction(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield Promise.resolve(e).then(a=>Bt(a)),n=this.formatter.transaction(e);n.confirmations==null&&(n.confirmations=0);const i=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const a=yield this.perform("sendTransaction",{signedTransaction:r});return this._wrapTransaction(n,a,i)}catch(a){throw a.transaction=n,a.transactionHash=n.hash,a}})}_getTransactionRequest(e){return hr(this,void 0,void 0,function*(){const r=yield e,n={};return["from","to"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?this._getAddress(a):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?nt.from(a):null))}),["type"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a??null))}),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach(i=>{r[i]!=null&&(n[i]=Promise.resolve(r[i]).then(a=>a?Bt(a):null))}),this.formatter.transactionRequest(yield vi(n))})}_getFilter(e){return hr(this,void 0,void 0,function*(){e=yield e;const r={};return e.address!=null&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach(n=>{e[n]!=null&&(r[n]=e[n])}),["fromBlock","toBlock"].forEach(n=>{e[n]!=null&&(r[n]=this._getBlockTag(e[n]))}),this.formatter.filter(yield vi(r))})}_call(e,r,n){return hr(this,void 0,void 0,function*(){n>=nbe&&Mr.throwError("CCIP read exceeded maximum redirections",De.errors.SERVER_ERROR,{redirects:n,transaction:e});const i=e.to,a=yield this.perform("call",{transaction:e,blockTag:r});if(n>=0&&r==="latest"&&i!=null&&a.substring(0,10)==="0x556f1830"&&Y0(a)%32===4)try{const s=Na(a,4),o=Na(s,0,32);nt.from(o).eq(i)||Mr.throwError("CCIP Read sender did not match",De.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:a});const l=[],c=nt.from(Na(s,32,64)).toNumber(),u=nt.from(Na(s,c,c+32)).toNumber(),f=Na(s,c+32);for(let v=0;vhr(this,void 0,void 0,function*(){const a=yield this.perform("getBlock",i);if(a==null)return i.blockHash!=null&&this._emitted["b:"+i.blockHash]==null||i.blockTag!=null&&n>this._emitted.block?null:void 0;if(r){let s=null;for(let l=0;lthis._wrapTransaction(l)),o}return this.formatter.block(a)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return cy(()=>hr(this,void 0,void 0,function*(){const n=yield this.perform("getTransaction",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;const i=this.formatter.transactionResponse(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return this._wrapTransaction(i)}),{oncePoll:this})})}getTransactionReceipt(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;const r={transactionHash:this.formatter.hash(e,!0)};return cy(()=>hr(this,void 0,void 0,function*(){const n=yield this.perform("getTransactionReceipt",r);if(n==null)return this._emitted["t:"+e]==null?null:void 0;if(n.blockHash==null)return;const i=this.formatter.receipt(n);if(i.blockNumber==null)i.confirmations=0;else if(i.confirmations==null){let s=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-i.blockNumber+1;s<=0&&(s=1),i.confirmations=s}return i}),{oncePoll:this})})}getLogs(e){return hr(this,void 0,void 0,function*(){yield this.getNetwork();const r=yield vi({filter:this._getFilter(e)}),n=yield this.perform("getLogs",r);return n.forEach(i=>{i.removed==null&&(i.removed=!1)}),jt.arrayOf(this.formatter.filterLog.bind(this.formatter))(n)})}getEtherPrice(){return hr(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return hr(this,void 0,void 0,function*(){if(e=yield e,typeof e=="number"&&e<0){e%1&&Mr.throwArgumentError("invalid BlockTag","blockTag",e);let r=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return r+=e,r<0&&(r=0),this.formatter.blockTag(r)}return this.formatter.blockTag(e)})}getResolver(e){return hr(this,void 0,void 0,function*(){let r=e;for(;;){if(r===""||r==="."||e!=="eth"&&r==="eth")return null;const n=yield this._getResolver(r,"getResolver");if(n!=null){const i=new XO(this,n,e);return r!==e&&!(yield i.supportsWildcard())?null:i}r=r.split(".").slice(1).join(".")}})}_getResolver(e,r){return hr(this,void 0,void 0,function*(){r==null&&(r="ENS");const n=yield this.getNetwork();n.ensAddress||Mr.throwError("network does not support ENS",De.errors.UNSUPPORTED_OPERATION,{operation:r,network:n.name});try{const i=yield this.call({to:n.ensAddress,data:"0x0178b8bf"+m6(e).substring(2)});return this.formatter.callAddress(i)}catch{}return null})}resolveName(e){return hr(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(n){if(Kr(e))throw n}typeof e!="string"&&Mr.throwArgumentError("invalid ENS name","name",e);const r=yield this.getResolver(e);return r?yield r.getAddress():null})}lookupAddress(e){return hr(this,void 0,void 0,function*(){e=yield e,e=this.formatter.address(e);const r=e.substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"lookupAddress");if(n==null)return null;const i=v6(yield this.call({to:n,data:"0x691f3431"+m6(r).substring(2)}),0);return(yield this.resolveName(i))!=e?null:i})}getAvatar(e){return hr(this,void 0,void 0,function*(){let r=null;if(Kr(e)){const a=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",s=yield this._getResolver(a,"getAvatar");if(!s)return null;r=new XO(this,s,a);try{const o=yield r.getAvatar();if(o)return o.url}catch(o){if(o.code!==De.errors.CALL_EXCEPTION)throw o}try{const o=v6(yield this.call({to:s,data:"0x691f3431"+m6(a).substring(2)}),0);r=yield this.getResolver(o)}catch(o){if(o.code!==De.errors.CALL_EXCEPTION)throw o;return null}}else if(r=yield this.getResolver(e),!r)return null;const n=yield r.getAvatar();return n==null?null:n.url})}perform(e,r){return Mr.throwError(e+" not implemented",De.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(r=>r.pollable()).length>0}_addEventListener(e,r,n){const i=new sbe(hp(e),r,n);return this._events.push(i),this._startEvent(i),this}on(e,r){return this._addEventListener(e,r,!1)}once(e,r){return this._addEventListener(e,r,!0)}emit(e,...r){let n=!1,i=[],a=hp(e);return this._events=this._events.filter(s=>s.tag!==a?!0:(setTimeout(()=>{s.listener.apply(this,r)},0),n=!0,s.once?(i.push(s),!1):!0)),i.forEach(s=>{this._stopEvent(s)}),n}listenerCount(e){if(!e)return this._events.length;let r=hp(e);return this._events.filter(n=>n.tag===r).length}listeners(e){if(e==null)return this._events.map(n=>n.listener);let r=hp(e);return this._events.filter(n=>n.tag===r).map(n=>n.listener)}off(e,r){if(r==null)return this.removeAllListeners(e);const n=[];let i=!1,a=hp(e);return this._events=this._events.filter(s=>s.tag!==a||s.listener!=r||i?!0:(i=!0,n.push(s),!1)),n.forEach(s=>{this._stopEvent(s)}),this}removeAllListeners(e){let r=[];if(e==null)r=this._events,this._events=[];else{const n=hp(e);this._events=this._events.filter(i=>i.tag!==n?!0:(r.push(i),!1))}return r.forEach(n=>{this._stopEvent(n)}),this}}const dbe="abstract-signer/5.7.0";var Ul=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const rl=new De(dbe),fbe=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],hbe=[De.errors.INSUFFICIENT_FUNDS,De.errors.NONCE_EXPIRED,De.errors.REPLACEMENT_UNDERPRICED];class Tw{constructor(){rl.checkAbstract(new.target,Tw),st(this,"_isSigner",!0)}getBalance(e){return Ul(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return Ul(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return Ul(this,void 0,void 0,function*(){this._checkProvider("estimateGas");const r=yield vi(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return Ul(this,void 0,void 0,function*(){this._checkProvider("call");const n=yield vi(this.checkTransaction(e));return yield this.provider.call(n,r)})}sendTransaction(e){return Ul(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");const r=yield this.populateTransaction(e),n=yield this.signTransaction(r);return yield this.provider.sendTransaction(n)})}getChainId(){return Ul(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return Ul(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return Ul(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return Ul(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(const n in e)fbe.indexOf(n)===-1&&rl.throwArgumentError("invalid transaction key: "+n,"transaction",e);const r=Ri(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(n=>(n[0].toLowerCase()!==n[1].toLowerCase()&&rl.throwArgumentError("from address mismatch","transaction",e),n[0])),r}populateTransaction(e){return Ul(this,void 0,void 0,function*(){const r=yield vi(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>Ul(this,void 0,void 0,function*(){if(i==null)return null;const a=yield this.resolveName(i);return a==null&&rl.throwArgumentError("provided ENS name resolves to null","tx.to",i),a})),r.to.catch(i=>{}));const n=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||n)?rl.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&n&&rl.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{const i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(n&&rl.throwError("network does not support EIP-1559",De.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):rl.throwError("failed to get consistent fee data",De.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(hbe.indexOf(i.code)>=0)throw i;return rl.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",De.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&rl.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield vi(r)})}_checkProvider(e){this.provider||rl.throwError("missing provider",De.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class m9 extends Tw{constructor(e,r){super(),st(this,"address",e),st(this,"provider",r||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,r){return Promise.resolve().then(()=>{rl.throwError(e,De.errors.UNSUPPORTED_OPERATION,{operation:r})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,r,n){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new m9(this.address,e)}}var ud=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const bi=new De(Mw),pbe=["call","estimateGas"];function $y(t,e){if(t==null)return null;if(typeof t.message=="string"&&t.message.match("reverted")){const r=Kr(t.data)?t.data:null;if(!e||r)return{message:t.message,data:r}}if(typeof t=="object"){for(const r in t){const n=$y(t[r],e);if(n)return n}return null}if(typeof t=="string")try{return $y(JSON.parse(t),e)}catch{}return null}function IJ(t,e,r){const n=r.transaction||r.signedTransaction;if(t==="call"){const a=$y(e,!0);if(a)return a.data;bi.throwError("missing revert data in call exception; Transaction reverted without a reason string",De.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:e})}if(t==="estimateGas"){let a=$y(e.body,!1);a==null&&(a=$y(e,!1)),a&&bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",De.errors.UNPREDICTABLE_GAS_LIMIT,{reason:a.message,method:t,transaction:n,error:e})}let i=e.message;throw e.code===De.errors.SERVER_ERROR&&e.error&&typeof e.error.message=="string"?i=e.error.message:typeof e.body=="string"?i=e.body:typeof e.responseText=="string"&&(i=e.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&bi.throwError("insufficient funds for intrinsic transaction cost",De.errors.INSUFFICIENT_FUNDS,{error:e,method:t,transaction:n}),i.match(/nonce (is )?too low/i)&&bi.throwError("nonce has already been used",De.errors.NONCE_EXPIRED,{error:e,method:t,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&bi.throwError("replacement fee too low",De.errors.REPLACEMENT_UNDERPRICED,{error:e,method:t,transaction:n}),i.match(/only replay-protected/i)&&bi.throwError("legacy pre-eip-155 transactions not supported",De.errors.UNSUPPORTED_OPERATION,{error:e,method:t,transaction:n}),pbe.indexOf(t)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&bi.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",De.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,method:t,transaction:n}),e}function eF(t){return new Promise(function(e){setTimeout(e,t)})}function gbe(t){if(t.error){const e=new Error(t.error.message);throw e.code=t.error.code,e.data=t.error.data,e}return t.result}function P2(t){return t&&t.toLowerCase()}const $I={};class MJ extends Tw{constructor(e,r,n){if(super(),e!==$I)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");st(this,"provider",r),n==null&&(n=0),typeof n=="string"?(st(this,"_address",this.provider.formatter.address(n)),st(this,"_index",null)):typeof n=="number"?(st(this,"_index",n),st(this,"_address",null)):bi.throwArgumentError("invalid address or index","addressOrIndex",n)}connect(e){return bi.throwError("cannot alter JSON-RPC Signer connection",De.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new mbe($I,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&bi.throwError("unknown account #"+this._index,De.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=Ri(e);const r=this.getAddress().then(n=>(n&&(n=n.toLowerCase()),n));if(e.gasLimit==null){const n=Ri(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return e.to!=null&&(e.to=Promise.resolve(e.to).then(n=>ud(this,void 0,void 0,function*(){if(n==null)return null;const i=yield this.provider.resolveName(n);return i==null&&bi.throwArgumentError("provided ENS name resolves to null","tx.to",n),i}))),vi({tx:vi(e),sender:r}).then(({tx:n,sender:i})=>{n.from!=null?n.from.toLowerCase()!==i&&bi.throwArgumentError("from address mismatch","transaction",e):n.from=i;const a=this.provider.constructor.hexlifyTransaction(n,{from:!0});return this.provider.send("eth_sendTransaction",[a]).then(s=>s,s=>(typeof s.message=="string"&&s.message.match(/user denied/i)&&bi.throwError("user rejected transaction",De.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),IJ("sendTransaction",s,a)))})}signTransaction(e){return bi.throwError("signing transactions is unsupported",De.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ud(this,void 0,void 0,function*(){const r=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),n=yield this.sendUncheckedTransaction(e);try{return yield cy(()=>ud(this,void 0,void 0,function*(){const i=yield this.provider.getTransaction(n);if(i!==null)return this.provider._wrapTransaction(i,n,r)}),{oncePoll:this.provider})}catch(i){throw i.transactionHash=n,i}})}signMessage(e){return ud(this,void 0,void 0,function*(){const r=typeof e=="string"?Ao(e):e,n=yield this.getAddress();try{return yield this.provider.send("personal_sign",[Bt(r),n.toLowerCase()])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&bi.throwError("user rejected signing",De.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),i}})}_legacySignMessage(e){return ud(this,void 0,void 0,function*(){const r=typeof e=="string"?Ao(e):e,n=yield this.getAddress();try{return yield this.provider.send("eth_sign",[n.toLowerCase(),Bt(r)])}catch(i){throw typeof i.message=="string"&&i.message.match(/user denied/i)&&bi.throwError("user rejected signing",De.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),i}})}_signTypedData(e,r,n){return ud(this,void 0,void 0,function*(){const i=yield ho.resolveNames(e,r,n,s=>this.provider.resolveName(s)),a=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[a.toLowerCase(),JSON.stringify(ho.getPayload(i.domain,r,i.value))])}catch(s){throw typeof s.message=="string"&&s.message.match(/user denied/i)&&bi.throwError("user rejected signing",De.errors.ACTION_REJECTED,{action:"_signTypedData",from:a,messageData:{domain:i.domain,types:r,value:i.value}}),s}})}unlock(e){return ud(this,void 0,void 0,function*(){const r=this.provider,n=yield this.getAddress();return r.send("personal_unlockAccount",[n.toLowerCase(),e,null])})}}class mbe extends MJ{sendTransaction(e){return this.sendUncheckedTransaction(e).then(r=>({hash:r,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:n=>this.provider.waitForTransaction(r,n)}))}}const ybe={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class TJ extends ube{constructor(e,r){let n=r;n==null&&(n=new Promise((i,a)=>{setTimeout(()=>{this.detectNetwork().then(s=>{i(s)},s=>{a(s)})},0)})),super(n),e||(e=su(this.constructor,"defaultUrl")()),typeof e=="string"?st(this,"connection",Object.freeze({url:e})):st(this,"connection",Object.freeze(Ri(e))),this._nextId=42}get _cache(){return this._eventLoopCache==null&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ud(this,void 0,void 0,function*(){yield eF(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch{try{e=yield this.send("net_version",[])}catch{}}if(e!=null){const r=su(this.constructor,"getNetwork");try{return r(nt.from(e).toNumber())}catch(n){return bi.throwError("could not detect network",De.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:n})}}return bi.throwError("could not detect network",De.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new MJ($I,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(r=>this.formatter.address(r)))}send(e,r){const n={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:Dd(n),provider:this});const i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];const a=SN(this.connection,JSON.stringify(n),gbe).then(s=>(this.emit("debug",{action:"response",request:n,response:s,provider:this}),s),s=>{throw this.emit("debug",{action:"response",error:s,request:n,provider:this}),s});return i&&(this._cache[e]=a,setTimeout(()=>{this._cache[e]=null},0)),a}prepareRequest(e,r){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[P2(r.address),r.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[P2(r.address),r.blockTag]];case"getCode":return["eth_getCode",[P2(r.address),r.blockTag]];case"getStorageAt":return["eth_getStorageAt",[P2(r.address),Bn(r.position,32),r.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[r.signedTransaction]];case"getBlock":return r.blockTag?["eth_getBlockByNumber",[r.blockTag,!!r.includeTransactions]]:r.blockHash?["eth_getBlockByHash",[r.blockHash,!!r.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[r.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[r.transactionHash]];case"call":return["eth_call",[su(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0}),r.blockTag]];case"estimateGas":return["eth_estimateGas",[su(this.constructor,"hexlifyTransaction")(r.transaction,{from:!0})]];case"getLogs":return r.filter&&r.filter.address!=null&&(r.filter.address=P2(r.filter.address)),["eth_getLogs",[r.filter]]}return null}perform(e,r){return ud(this,void 0,void 0,function*(){if(e==="call"||e==="estimateGas"){const i=r.transaction;if(i&&i.type!=null&&nt.from(i.type).isZero()&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const a=yield this.getFeeData();a.maxFeePerGas==null&&a.maxPriorityFeePerGas==null&&(r=Ri(r),r.transaction=Ri(i),delete r.transaction.type)}}const n=this.prepareRequest(e,r);n==null&&bi.throwError(e+" not implemented",De.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(n[0],n[1])}catch(i){return IJ(e,i,r)}})}_startEvent(e){e.tag==="pending"&&this._startPending(),super._startEvent(e)}_startPending(){if(this._pendingFilter!=null)return;const e=this,r=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=r,r.then(function(n){function i(){e.send("eth_getFilterChanges",[n]).then(function(a){if(e._pendingFilter!=r)return null;let s=Promise.resolve();return a.forEach(function(o){e._emitted["t:"+o.toLowerCase()]="pending",s=s.then(function(){return e.getTransaction(o).then(function(l){return e.emit("pending",l),null})})}),s.then(function(){return eF(1e3)})}).then(function(){if(e._pendingFilter!=r){e.send("eth_uninstallFilter",[n]);return}return setTimeout(function(){i()},0),null}).catch(a=>{})}return i(),n}).catch(n=>{})}_stopEvent(e){e.tag==="pending"&&this.listenerCount("pending")===0&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,r){const n=Ri(ybe);if(r)for(const a in r)r[a]&&(n[a]=!0);NK(e,n);const i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(a){if(e[a]==null)return;const s=bN(nt.from(e[a]));a==="gasLimit"&&(a="gas"),i[a]=s}),["from","to","data"].forEach(function(a){e[a]!=null&&(i[a]=Bt(e[a]))}),e.accessList&&(i.accessList=Cm(e.accessList)),i}}var wbe=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const vbe=new De(Mw);class bbe extends TJ{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return wbe(this,void 0,void 0,function*(){let r=this.network;return r==null&&(r=yield e.detectNetwork.call(this),r||vbe.throwError("no network detected",De.errors.UNKNOWN_ERROR,{}),this._network==null&&(st(this,"_network",r),this.emit("network",r,null))),r})}}const tF=new De(Mw);let xbe=1;function rF(t,e){const r="Web3LegacyFetcher";return function(n,i){const a={method:n,params:i,id:xbe++,jsonrpc:"2.0"};return new Promise((s,o)=>{this.emit("debug",{action:"request",fetcher:r,request:Dd(a),provider:this}),e(a,(l,c)=>{if(l)return this.emit("debug",{action:"response",fetcher:r,error:l,request:a,provider:this}),o(l);if(this.emit("debug",{action:"response",fetcher:r,request:a,response:c,provider:this}),c.error){const u=new Error(c.error.message);return u.code=c.error.code,u.data=c.error.data,o(u)}s(c.result)})})}}function Ebe(t){return function(e,r){r==null&&(r=[]);const n={method:e,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:Dd(n),provider:this}),t.request(n).then(i=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:i,provider:this}),i),i=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:i,provider:this}),i})}}class L5 extends TJ{constructor(e,r){e==null&&tF.throwArgumentError("missing provider","provider",e);let n=null,i=null,a=null;typeof e=="function"?(n="unknown:",i=e):(n=e.host||e.path||"",!n&&e.isMetaMask&&(n="metamask"),a=e,e.request?(n===""&&(n="eip-1193:"),i=Ebe(e)):e.sendAsync?i=rF(e,e.sendAsync.bind(e)):e.send?i=rF(e,e.send.bind(e)):tF.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),super(n,r),st(this,"jsonRpcFetchFunc",i),st(this,"provider",a)}send(e,r){return this.jsonRpcFetchFunc(e,r)}}function _be(t){if(typeof window>"u")return;const e=r=>t(r.detail);return window.addEventListener("eip6963:announceProvider",e),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",e)}function Cbe(){const t=new Set;let e=[];const r=()=>_be(i=>{e.some(({info:a})=>a.uuid===i.info.uuid)||(e=[...e,i],t.forEach(a=>a(e,{added:[i]})))});let n=r();return{_listeners(){return t},clear(){t.forEach(i=>i([],{removed:[...e]})),e=[]},destroy(){this.clear(),t.clear(),n==null||n()},findProvider({rdns:i}){return e.find(a=>a.info.rdns===i)},getProviders(){return e},reset(){this.clear(),n==null||n(),n=r()},subscribe(i,{emitImmediately:a}={}){return t.add(i),a&&i(e,{added:e}),()=>t.delete(i)}}}var kt={},PI={exports:{}};(function(t,e){(function(r,n){var i="1.0.40",a="",s="?",o="function",l="undefined",c="object",u="string",f="major",h="model",g="name",m="type",w="vendor",C="version",v="architecture",b="console",A="mobile",S="tablet",j="smarttv",F="wearable",I="embedded",B=500,V="Amazon",se="Apple",Y="ASUS",N="BlackBerry",k="Browser",x="Chrome",E="Edge",L="Firefox",O="Google",P="Huawei",R="LG",M="Microsoft",D="Motorola",$="Opera",X="Samsung",le="Sharp",H="Sony",ee="Xiaomi",J="Zebra",te="Facebook",re="Chromium OS",z="Mac OS",G=" Browser",Q=function(je,K){var U={};for(var W in je)K[W]&&K[W].length%2===0?U[W]=K[W].concat(je[W]):U[W]=je[W];return U},me=function(je){for(var K={},U=0;U0?we.length===2?typeof we[1]==o?this[we[0]]=we[1].call(this,Re):this[we[0]]=we[1]:we.length===3?typeof we[1]===o&&!(we[1].exec&&we[1].test)?this[we[0]]=Re?we[1].call(this,Re,we[2]):n:this[we[0]]=Re?Re.replace(we[1],we[2]):n:we.length===4&&(this[we[0]]=Re?we[3].call(this,Re.replace(we[1],we[2])):n):this[we]=Re||n;U+=2}},lt=function(je,K){for(var U in K)if(typeof K[U]===c&&K[U].length>0){for(var W=0;W2&&(he[h]="iPad",he[m]=S),he},this.getEngine=function(){var he={};return he[g]=n,he[C]=n,Ke.call(he,W,pe.engine),he},this.getOS=function(){var he={};return he[g]=n,he[C]=n,Ke.call(he,W,pe.os),we&&!he[g]&&ie&&ie.platform&&ie.platform!="Unknown"&&(he[g]=ie.platform.replace(/chrome os/i,re).replace(/macos/i,z)),he},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return W},this.setUA=function(he){return W=typeof he===u&&he.length>B?Ue(he,B):he,this},this.setUA(W),this};Ie.VERSION=i,Ie.BROWSER=me([g,C,f]),Ie.CPU=me([v]),Ie.DEVICE=me([h,w,m,b,A,j,S,F,I]),Ie.ENGINE=Ie.OS=me([g,C]),t.exports&&(e=t.exports=Ie),e.UAParser=Ie;var Ne=typeof r!==l&&(r.jQuery||r.Zepto);if(Ne&&!Ne.ua){var $e=new Ie;Ne.ua=$e.getResult(),Ne.ua.get=function(){return $e.getUA()},Ne.ua.set=function(je){$e.setUA(je);var K=$e.getResult();for(var U in K)Ne.ua[U]=K[U]}}})(typeof window=="object"?window:Xt)})(PI,PI.exports);var Sbe=PI.exports;Object.defineProperty(kt,"__esModule",{value:!0});function Abe(t){return t&&typeof t=="object"&&"default"in t?t.default:t}var Ba=_,Mn=Abe(Ba),kJ=Sbe,_h=new kJ,Ga=_h.getBrowser(),Ibe=_h.getCPU(),Po=_h.getDevice(),NN=_h.getEngine(),Ch=_h.getOS(),kw=_h.getUA(),NJ=function(e){return _h.setUA(e)},Nw=function(e){if(!e){console.error("No userAgent string was provided");return}var r=new kJ(e);return{UA:r,browser:r.getBrowser(),cpu:r.getCPU(),device:r.getDevice(),engine:r.getEngine(),os:r.getOS(),ua:r.getUA(),setUserAgent:function(i){return r.setUA(i)}}},LJ=Object.freeze({ClientUAInstance:_h,browser:Ga,cpu:Ibe,device:Po,engine:NN,os:Ch,ua:kw,setUa:NJ,parseUserAgent:Nw});function nF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Mbe(t){for(var e=1;e=0)&&(r[i]=t[i]);return r}function Cl(t,e){if(t==null)return{};var r=$be(t,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function b6(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Pbe(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b6(t)}function Rbe(t,e){return Dbe(t)||Obe(t,e)||Fbe(t,e)||Ube()}function Dbe(t){if(Array.isArray(t))return t}function Obe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,a=!1,s,o;try{for(r=r.call(t);!(i=(s=r.next()).done)&&(n.push(s.value),!(e&&n.length===e));i=!0);}catch(l){a=!0,o=l}finally{try{!i&&r.return!=null&&r.return()}finally{if(a)throw o}}return n}}function Fbe(t,e){if(t){if(typeof t=="string")return iF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return iF(t,e)}}function iF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&arguments[1]!==void 0?arguments[1]:"none";return e||r},LN=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},jN=function(e){var r=LN();return r&&r.platform&&(r.platform.indexOf(e)!==-1||r.platform==="MacIntel"&&r.maxTouchPoints>1&&!window.MSStream)},Hbe=function(e,r,n,i,a){return{isBrowser:e,browserMajorVersion:dr(r.major),browserFullVersion:dr(r.version),browserName:dr(r.name),engineName:dr(n.name),engineVersion:dr(n.version),osName:dr(i.name),osVersion:dr(i.version),userAgent:dr(a)}},aF=function(e,r,n,i){return Mbe({},e,{vendor:dr(r.vendor),model:dr(r.model),os:dr(n.name),osVersion:dr(n.version),ua:dr(i)})},Gbe=function(e,r,n,i){return{isSmartTV:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},qbe=function(e,r,n,i){return{isConsole:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},Vbe=function(e,r,n,i){return{isWearable:e,engineName:dr(r.name),engineVersion:dr(r.version),osName:dr(n.name),osVersion:dr(n.version),userAgent:dr(i)}},Ybe=function(e,r,n,i,a){return{isEmbedded:e,vendor:dr(r.vendor),model:dr(r.model),engineName:dr(n.name),engineVersion:dr(n.version),osName:dr(i.name),osVersion:dr(i.version),userAgent:dr(a)}};function Kbe(t){var e=t?Nw(t):LJ,r=e.device,n=e.browser,i=e.engine,a=e.os,s=e.ua,o=zbe(r.type),l=o.isBrowser,c=o.isMobile,u=o.isTablet,f=o.isSmartTV,h=o.isConsole,g=o.isWearable,m=o.isEmbedded;if(l)return Hbe(l,n,i,a,s);if(f)return Gbe(f,i,a,s);if(h)return qbe(h,i,a,s);if(c||u)return aF(o,r,a,s);if(g)return Vbe(g,i,a,s);if(m)return Ybe(m,r,i,a,s)}var jJ=function(e){var r=e.type;return r===La.Mobile},$J=function(e){var r=e.type;return r===La.Tablet},PJ=function(e){var r=e.type;return r===La.Mobile||r===La.Tablet},RJ=function(e){var r=e.type;return r===La.SmartTv},j5=function(e){var r=e.type;return r===La.Browser},DJ=function(e){var r=e.type;return r===La.Wearable},OJ=function(e){var r=e.type;return r===La.Console},FJ=function(e){var r=e.type;return r===La.Embedded},UJ=function(e){var r=e.vendor;return dr(r)},BJ=function(e){var r=e.model;return dr(r)},zJ=function(e){var r=e.type;return dr(r,"browser")},WJ=function(e){var r=e.name;return r===Sm.Android},HJ=function(e){var r=e.name;return r===Sm.Windows},GJ=function(e){var r=e.name;return r===Sm.MAC_OS},qJ=function(e){var r=e.name;return r===Sm.WindowsPhone},VJ=function(e){var r=e.name;return r===Sm.IOS},YJ=function(e){var r=e.version;return dr(r)},KJ=function(e){var r=e.name;return dr(r)},JJ=function(e){var r=e.name;return r===Ys.Chrome},QJ=function(e){var r=e.name;return r===Ys.Firefox},ZJ=function(e){var r=e.name;return r===Ys.Chromium},$5=function(e){var r=e.name;return r===Ys.Edge},XJ=function(e){var r=e.name;return r===Ys.Yandex},eQ=function(e){var r=e.name;return r===Ys.Safari||r===Ys.MobileSafari},tQ=function(e){var r=e.name;return r===Ys.MobileSafari},rQ=function(e){var r=e.name;return r===Ys.Opera},nQ=function(e){var r=e.name;return r===Ys.InternetExplorer||r===Ys.Ie},iQ=function(e){var r=e.name;return r===Ys.MIUI},aQ=function(e){var r=e.name;return r===Ys.SamsungBrowser},sQ=function(e){var r=e.version;return dr(r)},oQ=function(e){var r=e.major;return dr(r)},lQ=function(e){var r=e.name;return dr(r)},cQ=function(e){var r=e.name;return dr(r)},uQ=function(e){var r=e.version;return dr(r)},dQ=function(){var e=LN(),r=e&&e.userAgent&&e.userAgent.toLowerCase();return typeof r=="string"?/electron/.test(r):!1},pg=function(e){return typeof e=="string"&&e.indexOf("Edg/")!==-1},fQ=function(){var e=LN();return e&&(/iPad|iPhone|iPod/.test(e.platform)||e.platform==="MacIntel"&&e.maxTouchPoints>1)&&!window.MSStream},tu=function(){return jN("iPad")},hQ=function(){return jN("iPhone")},pQ=function(){return jN("iPod")},gQ=function(e){return dr(e)};function mQ(t){var e=t||LJ,r=e.device,n=e.browser,i=e.os,a=e.engine,s=e.ua;return{isSmartTV:RJ(r),isConsole:OJ(r),isWearable:DJ(r),isEmbedded:FJ(r),isMobileSafari:tQ(n)||tu(),isChromium:ZJ(n),isMobile:PJ(r)||tu(),isMobileOnly:jJ(r),isTablet:$J(r)||tu(),isBrowser:j5(r),isDesktop:j5(r),isAndroid:WJ(i),isWinPhone:qJ(i),isIOS:VJ(i)||tu(),isChrome:JJ(n),isFirefox:QJ(n),isSafari:eQ(n),isOpera:rQ(n),isIE:nQ(n),osVersion:YJ(i),osName:KJ(i),fullBrowserVersion:sQ(n),browserVersion:oQ(n),browserName:lQ(n),mobileVendor:UJ(r),mobileModel:BJ(r),engineName:cQ(a),engineVersion:uQ(a),getUA:gQ(s),isEdge:$5(n)||pg(s),isYandex:XJ(n),deviceType:zJ(r),isIOS13:fQ(),isIPad13:tu(),isIPhone13:hQ(),isIPod13:pQ(),isElectron:dQ(),isEdgeChromium:pg(s),isLegacyEdge:$5(n)&&!pg(s),isWindows:HJ(i),isMacOs:GJ(i),isMIUI:iQ(n),isSamsungBrowser:aQ(n)}}var yQ=RJ(Po),wQ=OJ(Po),vQ=DJ(Po),Jbe=FJ(Po),Qbe=tQ(Ga)||tu(),Zbe=ZJ(Ga),y9=PJ(Po)||tu(),bQ=jJ(Po),xQ=$J(Po)||tu(),EQ=j5(Po),Xbe=j5(Po),_Q=WJ(Ch),CQ=qJ(Ch),SQ=VJ(Ch)||tu(),e4e=JJ(Ga),t4e=QJ(Ga),r4e=eQ(Ga),n4e=rQ(Ga),AQ=nQ(Ga),i4e=YJ(Ch),a4e=KJ(Ch),s4e=sQ(Ga),o4e=oQ(Ga),l4e=lQ(Ga),c4e=UJ(Po),u4e=BJ(Po),d4e=cQ(NN),f4e=uQ(NN),h4e=gQ(kw),p4e=$5(Ga)||pg(kw),g4e=XJ(Ga),m4e=zJ(Po),y4e=fQ(),w4e=tu(),v4e=hQ(),b4e=pQ(),x4e=dQ(),E4e=pg(kw),_4e=$5(Ga)&&!pg(kw),C4e=HJ(Ch),S4e=GJ(Ch),A4e=iQ(Ga),I4e=aQ(Ga),M4e=function(e){if(!e||typeof e!="string"){console.error("No valid user agent string was provided");return}var r=Nw(e),n=r.device,i=r.browser,a=r.os,s=r.engine,o=r.ua;return mQ({device:n,browser:i,os:a,engine:s,ua:o})},T4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return _Q?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},k4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return EQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},N4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return AQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},L4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return SQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},j4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return y9?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},$4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return xQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},P4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return CQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},R4e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=Cl(e,["renderWithFragment","children","viewClassName","style"]);return bQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},D4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return yQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},O4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return wQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},F4e=function(e){var r=e.renderWithFragment,n=e.children,i=Cl(e,["renderWithFragment","children"]);return vQ?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",i,n):null},U4e=function(e){var r=e.renderWithFragment,n=e.children;e.viewClassName,e.style;var i=e.condition,a=Cl(e,["renderWithFragment","children","viewClassName","style","condition"]);return i?r?Mn.createElement(Ba.Fragment,null,n):Mn.createElement("div",a,n):null};function B4e(t){return function(e){jbe(r,e);function r(n){var i;return Tbe(this,r),i=Pbe(this,DI(r).call(this,n)),i.isEventListenerAdded=!1,i.handleOrientationChange=i.handleOrientationChange.bind(b6(i)),i.onOrientationChange=i.onOrientationChange.bind(b6(i)),i.onPageLoad=i.onPageLoad.bind(b6(i)),i.state={isLandscape:!1,isPortrait:!1},i}return Nbe(r,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var i=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:i===0,isLandscape:i===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":Py(window))!==void 0&&y9&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return Mn.createElement(t,RI({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),r}(Mn.Component)}function z4e(){var t=Ba.useState(function(){var a=window.innerWidth>window.innerHeight?90:0;return{isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"}}),e=Rbe(t,2),r=e[0],n=e[1],i=Ba.useCallback(function(){var a=window.innerWidth>window.innerHeight?90:0,s={isPortrait:a===0,isLandscape:a===90,orientation:a===0?"portrait":"landscape"};r.orientation!==s.orientation&&n(s)},[r.orientation]);return Ba.useEffect(function(){return(typeof window>"u"?"undefined":Py(window))!==void 0&&y9&&(i(),window.addEventListener("load",i,!1),window.addEventListener("resize",i,!1)),function(){window.removeEventListener("resize",i,!1),window.removeEventListener("load",i,!1)}},[i]),r}function IQ(t){var e=t||window.navigator.userAgent;return Nw(e)}function W4e(t){var e=t||window.navigator.userAgent,r=IQ(e),n=mQ(r);return[n,r]}kt.AndroidView=T4e;kt.BrowserTypes=Ys;kt.BrowserView=k4e;kt.ConsoleView=O4e;kt.CustomView=U4e;kt.IEView=N4e;kt.IOSView=L4e;kt.MobileOnlyView=R4e;kt.MobileView=j4e;kt.OsTypes=Sm;kt.SmartTVView=D4e;kt.TabletView=$4e;kt.WearableView=F4e;kt.WinPhoneView=P4e;kt.browserName=l4e;kt.browserVersion=o4e;kt.deviceDetect=Kbe;kt.deviceType=m4e;kt.engineName=d4e;kt.engineVersion=f4e;kt.fullBrowserVersion=s4e;kt.getSelectorsByUserAgent=M4e;kt.getUA=h4e;var H4e=kt.isAndroid=_Q;kt.isBrowser=EQ;kt.isChrome=e4e;kt.isChromium=Zbe;kt.isConsole=wQ;kt.isDesktop=Xbe;kt.isEdge=p4e;kt.isEdgeChromium=E4e;kt.isElectron=x4e;kt.isEmbedded=Jbe;var G4e=kt.isFirefox=t4e;kt.isIE=AQ;var $N=kt.isIOS=SQ;kt.isIOS13=y4e;kt.isIPad13=w4e;kt.isIPhone13=v4e;kt.isIPod13=b4e;kt.isLegacyEdge=_4e;kt.isMIUI=A4e;kt.isMacOs=S4e;var ya=kt.isMobile=y9;kt.isMobileOnly=bQ;kt.isMobileSafari=Qbe;kt.isOpera=n4e;var q4e=kt.isSafari=r4e;kt.isSamsungBrowser=I4e;kt.isSmartTV=yQ;kt.isTablet=xQ;kt.isWearable=vQ;kt.isWinPhone=CQ;kt.isWindows=C4e;kt.isYandex=g4e;kt.mobileModel=u4e;kt.mobileVendor=c4e;kt.osName=a4e;kt.osVersion=i4e;kt.parseUserAgent=Nw;kt.setUserAgent=Wbe;kt.useDeviceData=IQ;kt.useDeviceSelectors=W4e;kt.useMobileOrientation=z4e;kt.withOrientationChange=B4e;const Lw="abi/5.7.0",Hr=new De(Lw),J0={};let sF={calldata:!0,memory:!0,storage:!0},V4e={calldata:!0,memory:!0};function u4(t,e){if(t==="bytes"||t==="string"){if(sF[e])return!0}else if(t==="address"){if(e==="payable")return!0}else if((t.indexOf("[")>=0||t==="tuple")&&V4e[e])return!0;return(sF[e]||e==="payable")&&Hr.throwArgumentError("invalid modifier","name",e),!1}function Y4e(t,e){let r=t;function n(o){Hr.throwArgumentError(`unexpected character at position ${o}`,"param",t)}t=t.replace(/\s/g," ");function i(o){let l={type:"",name:"",parent:o,state:{allowType:!0}};return e&&(l.indexed=!1),l}let a={type:"",name:"",state:{allowType:!0}},s=a;for(let o=0;oJSON.parse(i.format(e)))),JSON.stringify(n)}let r="";return this.baseType==="array"?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):this.baseType==="tuple"?(e!==Zr.sighash&&(r+=this.type),r+="("+this.components.map(n=>n.format(e)).join(e===Zr.full?", ":",")+")"):r+=this.type,e!==Zr.sighash&&(this.indexed===!0&&(r+=" indexed"),e===Zr.full&&this.name&&(r+=" "+this.name)),r}static from(e,r){return typeof e=="string"?Qi.fromString(e,r):Qi.fromObject(e)}static fromObject(e){return Qi.isParamType(e)?e:new Qi(J0,{name:e.name||null,type:Np(e.type),indexed:e.indexed==null?null:!!e.indexed,components:e.components?e.components.map(Qi.fromObject):null})}static fromString(e,r){function n(i){return Qi.fromObject({name:i.name,type:i.type,indexed:i.indexed,components:i.components})}return n(Y4e(e,!!r))}static isParamType(e){return!!(e!=null&&e._isParamType)}}function b3(t,e){return Q4e(t).map(r=>Qi.fromString(r,e))}class Ad{constructor(e,r){e!==J0&&Hr.throwError("use a static from method",De.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),x6(this,r),this._isFragment=!0,Object.freeze(this)}static from(e){return Ad.isFragment(e)?e:typeof e=="string"?Ad.fromString(e):Ad.fromObject(e)}static fromObject(e){if(Ad.isFragment(e))return e;switch(e.type){case"function":return nu.fromObject(e);case"event":return Ed.fromObject(e);case"constructor":return ru.fromObject(e);case"error":return $f.fromObject(e);case"fallback":case"receive":return null}return Hr.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return e=e.replace(/\s/g," "),e=e.replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," "),e=e.trim(),e.split(" ")[0]==="event"?Ed.fromString(e.substring(5).trim()):e.split(" ")[0]==="function"?nu.fromString(e.substring(8).trim()):e.split("(")[0].trim()==="constructor"?ru.fromString(e.trim()):e.split(" ")[0]==="error"?$f.fromString(e.substring(5).trim()):Hr.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class Ed extends Ad{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Zr.sighash&&(r+="event "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ",e!==Zr.sighash&&this.anonymous&&(r+="anonymous "),r.trim()}static from(e){return typeof e=="string"?Ed.fromString(e):Ed.fromObject(e)}static fromObject(e){if(Ed.isEventFragment(e))return e;e.type!=="event"&&Hr.throwArgumentError("invalid event object","value",e);const r={name:x3(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Qi.fromObject):[],type:"event"};return new Ed(J0,r)}static fromString(e){let r=e.match(E3);r||Hr.throwArgumentError("invalid event string","value",e);let n=!1;return r[3].split(" ").forEach(i=>{switch(i.trim()){case"anonymous":n=!0;break;case"":break;default:Hr.warn("unknown modifier: "+i)}}),Ed.fromObject({name:r[1].trim(),anonymous:n,inputs:b3(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&e.type==="event"}}function MQ(t,e){e.gas=null;let r=t.split("@");return r.length!==1?(r.length>2&&Hr.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||Hr.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=nt.from(r[1]),r[0]):t}function TQ(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(r=>{switch(r.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+r)}})}function kQ(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return t.stateMutability!=null?(e.stateMutability=t.stateMutability,e.constant=e.stateMutability==="view"||e.stateMutability==="pure",t.constant!=null&&!!t.constant!==e.constant&&Hr.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable=e.stateMutability==="payable",t.payable!=null&&!!t.payable!==e.payable&&Hr.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):t.payable!=null?(e.payable=!!t.payable,t.constant==null&&!e.payable&&t.type!=="constructor"&&Hr.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&Hr.throwArgumentError("cannot have constant payable function","value",t)):t.constant!=null?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):t.type!=="constructor"&&Hr.throwArgumentError("unable to determine stateMutability","value",t),e}class ru extends Ad{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.json)return JSON.stringify({type:"constructor",stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});e===Zr.sighash&&Hr.throwError("cannot format a constructor for sighash",De.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let r="constructor("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ";return this.stateMutability&&this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "),r.trim()}static from(e){return typeof e=="string"?ru.fromString(e):ru.fromObject(e)}static fromObject(e){if(ru.isConstructorFragment(e))return e;e.type!=="constructor"&&Hr.throwArgumentError("invalid constructor object","value",e);let r=kQ(e);r.constant&&Hr.throwArgumentError("constructor cannot be constant","value",e);const n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Qi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new ru(J0,n)}static fromString(e){let r={type:"constructor"};e=MQ(e,r);let n=e.match(E3);return(!n||n[1].trim()!=="constructor")&&Hr.throwArgumentError("invalid constructor string","value",e),r.inputs=b3(n[2].trim(),!1),TQ(n[3].trim(),r),ru.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&e.type==="constructor"}}class nu extends ru{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(n=>JSON.parse(n.format(e))),outputs:this.outputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Zr.sighash&&(r+="function "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ",e!==Zr.sighash&&(this.stateMutability?this.stateMutability!=="nonpayable"&&(r+=this.stateMutability+" "):this.constant&&(r+="view "),this.outputs&&this.outputs.length&&(r+="returns ("+this.outputs.map(n=>n.format(e)).join(", ")+") "),this.gas!=null&&(r+="@"+this.gas.toString()+" ")),r.trim()}static from(e){return typeof e=="string"?nu.fromString(e):nu.fromObject(e)}static fromObject(e){if(nu.isFunctionFragment(e))return e;e.type!=="function"&&Hr.throwArgumentError("invalid function object","value",e);let r=kQ(e);const n={type:e.type,name:x3(e.name),constant:r.constant,inputs:e.inputs?e.inputs.map(Qi.fromObject):[],outputs:e.outputs?e.outputs.map(Qi.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:e.gas?nt.from(e.gas):null};return new nu(J0,n)}static fromString(e){let r={type:"function"};e=MQ(e,r);let n=e.split(" returns ");n.length>2&&Hr.throwArgumentError("invalid function string","value",e);let i=n[0].match(E3);if(i||Hr.throwArgumentError("invalid function signature","value",e),r.name=i[1].trim(),r.name&&x3(r.name),r.inputs=b3(i[2],!1),TQ(i[3].trim(),r),n.length>1){let a=n[1].match(E3);(a[1].trim()!=""||a[3].trim()!="")&&Hr.throwArgumentError("unexpected tokens","value",e),r.outputs=b3(a[2],!1)}else r.outputs=[];return nu.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&e.type==="function"}}function oF(t){const e=t.format();return(e==="Error(string)"||e==="Panic(uint256)")&&Hr.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class $f extends Ad{format(e){if(e||(e=Zr.sighash),Zr[e]||Hr.throwArgumentError("invalid format type","format",e),e===Zr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(n=>JSON.parse(n.format(e)))});let r="";return e!==Zr.sighash&&(r+="error "),r+=this.name+"("+this.inputs.map(n=>n.format(e)).join(e===Zr.full?", ":",")+") ",r.trim()}static from(e){return typeof e=="string"?$f.fromString(e):$f.fromObject(e)}static fromObject(e){if($f.isErrorFragment(e))return e;e.type!=="error"&&Hr.throwArgumentError("invalid error object","value",e);const r={type:e.type,name:x3(e.name),inputs:e.inputs?e.inputs.map(Qi.fromObject):[]};return oF(new $f(J0,r))}static fromString(e){let r={type:"error"},n=e.match(E3);return n||Hr.throwArgumentError("invalid error signature","value",e),r.name=n[1].trim(),r.name&&x3(r.name),r.inputs=b3(n[2],!1),oF($f.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&e.type==="error"}}function Np(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}const J4e=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function x3(t){return(!t||!t.match(J4e))&&Hr.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}const E3=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Q4e(t){t=t.trim();let e=[],r="",n=0;for(let i=0;ithis.wordSize&&PN.throwError("value out-of-bounds",De.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:r.length}),r.length%this.wordSize&&(r=Us([this._padding.slice(r.length%this.wordSize),r])),r}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,r=>{this._data[e]=this._getValue(r)}}}class P5{constructor(e,r,n,i){st(this,"_data",er(e)),st(this,"wordSize",r||32),st(this,"_coerceFunc",n),st(this,"allowLoose",i),this._offset=0}get data(){return Bt(this._data)}get consumed(){return this._offset}static coerce(e,r){let n=e.match("^u?int([0-9]+)$");return n&&parseInt(n[1])<=48&&(r=r.toNumber()),r}coerce(e,r){return this._coerceFunc?this._coerceFunc(e,r):P5.coerce(e,r)}_peekBytes(e,r,n){let i=Math.ceil(r/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&n&&this._offset+r<=this._data.length?i=r:PN.throwError("data out-of-bounds",De.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(e){return new P5(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,r){let n=this._peekBytes(0,e,!!r);return this._offset+=n.length,n.slice(0,e)}readValue(){return nt.from(this.readBytes(this.wordSize))}}class X4e extends Xd{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,r){try{r=Ir(r)}catch(n){this._throwError(n.message,r)}return e.writeValue(r)}decode(e){return Ir(Bn(e.readValue().toHexString(),20))}}class e6e extends Xd{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,r){return this.coder.encode(e,r)}decode(e){return this.coder.decode(e)}}const Qp=new De(Lw);function NQ(t,e,r){let n=null;if(Array.isArray(r))n=r;else if(r&&typeof r=="object"){let l={};n=e.map(c=>{const u=c.localName;return u||Qp.throwError("cannot encode object for signature with missing names",De.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]&&Qp.throwError("cannot encode object for signature with duplicate names",De.errors.INVALID_ARGUMENT,{argument:"values",coder:c,value:r}),l[u]=!0,r[u]})}else Qp.throwArgumentError("invalid tuple value","tuple",r);e.length!==n.length&&Qp.throwArgumentError("types/value length mismatch","tuple",r);let i=new FI(t.wordSize),a=new FI(t.wordSize),s=[];e.forEach((l,c)=>{let u=n[c];if(l.dynamic){let f=a.length;l.encode(a,u);let h=i.writeUpdatableValue();s.push(g=>{h(g+f)})}else l.encode(i,u)}),s.forEach(l=>{l(i.length)});let o=t.appendWriter(i);return o+=t.appendWriter(a),o}function LQ(t,e){let r=[],n=t.subReader(0);e.forEach(a=>{let s=null;if(a.dynamic){let o=t.readValue(),l=n.subReader(o.toNumber());try{s=a.decode(l)}catch(c){if(c.code===De.errors.BUFFER_OVERRUN)throw c;s=c,s.baseType=a.name,s.name=a.localName,s.type=a.type}}else try{s=a.decode(t)}catch(o){if(o.code===De.errors.BUFFER_OVERRUN)throw o;s=o,s.baseType=a.name,s.name=a.localName,s.type=a.type}s!=null&&r.push(s)});const i=e.reduce((a,s)=>{const o=s.localName;return o&&(a[o]||(a[o]=0),a[o]++),a},{});e.forEach((a,s)=>{let o=a.localName;if(!o||i[o]!==1||(o==="length"&&(o="_length"),r[o]!=null))return;const l=r[s];l instanceof Error?Object.defineProperty(r,o,{enumerable:!0,get:()=>{throw l}}):r[o]=l});for(let a=0;a{throw s}})}return Object.freeze(r)}class t6e extends Xd{constructor(e,r,n){const i=e.type+"["+(r>=0?r:"")+"]",a=r===-1||e.dynamic;super("array",i,n,a),this.coder=e,this.length=r}defaultValue(){const e=this.coder.defaultValue(),r=[];for(let n=0;ne._data.length&&Qp.throwError("insufficient data length",De.errors.BUFFER_OVERRUN,{length:e._data.length,count:r}));let n=[];for(let i=0;i{s.dynamic&&(n=!0),i.push(s.type)});const a="tuple("+i.join(",")+")";super("tuple",a,r,n),this.coders=e}defaultValue(){const e=[];this.coders.forEach(n=>{e.push(n.defaultValue())});const r=this.coders.reduce((n,i)=>{const a=i.localName;return a&&(n[a]||(n[a]=0),n[a]++),n},{});return this.coders.forEach((n,i)=>{let a=n.localName;!a||r[a]!==1||(a==="length"&&(a="_length"),e[a]==null&&(e[a]=e[i]))}),Object.freeze(e)}encode(e,r){return NQ(e,this.coders,r)}decode(e){return e.coerce(this.name,LQ(e,this.coders))}}const f4=new De(Lw),l6e=new RegExp(/^bytes([0-9]*)$/),c6e=new RegExp(/^(u?int)([0-9]*)$/);class u6e{constructor(e){st(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new X4e(e.name);case"bool":return new r6e(e.name);case"string":return new o6e(e.name);case"bytes":return new n6e(e.name);case"array":return new t6e(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new d4((e.components||[]).map(n=>this._getCoder(n)),e.name);case"":return new a6e(e.name)}let r=e.type.match(c6e);if(r){let n=parseInt(r[2]||"256");return(n===0||n>256||n%8!==0)&&f4.throwArgumentError("invalid "+r[1]+" bit length","param",e),new s6e(n/8,r[1]==="int",e.name)}if(r=e.type.match(l6e),r){let n=parseInt(r[1]);return(n===0||n>32)&&f4.throwArgumentError("invalid bytes length","param",e),new i6e(n,e.name)}return f4.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,r){return new P5(e,this._getWordSize(),this.coerceFunc,r)}_getWriter(){return new FI(this._getWordSize())}getDefaultValue(e){const r=e.map(i=>this._getCoder(Qi.from(i)));return new d4(r,"_").defaultValue()}encode(e,r){e.length!==r.length&&f4.throwError("types/values length mismatch",De.errors.INVALID_ARGUMENT,{count:{types:e.length,values:r.length},value:{types:e,values:r}});const n=e.map(s=>this._getCoder(Qi.from(s))),i=new d4(n,"_"),a=this._getWriter();return i.encode(a,r),a.data}decode(e,r,n){const i=e.map(s=>this._getCoder(Qi.from(s)));return new d4(i,"_").decode(this._getReader(er(r),n))}}const d6e=new u6e,Gn=new De(Lw);class f6e extends Aw{}class h6e extends Aw{}class p6e extends Aw{}class UI extends Aw{static isIndexed(e){return!!(e&&e._isIndexed)}}const g6e={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function lF(t,e){const r=new Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class cF{constructor(e){let r=[];typeof e=="string"?r=JSON.parse(e):r=e,st(this,"fragments",r.map(n=>Ad.from(n)).filter(n=>n!=null)),st(this,"_abiCoder",su(new.target,"getAbiCoder")()),st(this,"functions",{}),st(this,"errors",{}),st(this,"events",{}),st(this,"structs",{}),this.fragments.forEach(n=>{let i=null;switch(n.type){case"constructor":if(this.deploy){Gn.warn("duplicate definition - constructor");return}st(this,"deploy",n);return;case"function":i=this.functions;break;case"event":i=this.events;break;case"error":i=this.errors;break;default:return}let a=n.format();if(i[a]){Gn.warn("duplicate definition - "+a);return}i[a]=n}),this.deploy||st(this,"deploy",ru.from({payable:!1,type:"constructor"})),st(this,"_isInterface",!0)}format(e){e||(e=Zr.full),e===Zr.sighash&&Gn.throwArgumentError("interface does not support formatting sighash","format",e);const r=this.fragments.map(n=>n.format(e));return e===Zr.json?JSON.stringify(r.map(n=>JSON.parse(n))):r}static getAbiCoder(){return d6e}static getAddress(e){return Ir(e)}static getSighash(e){return Na(Jp(e.format()),0,4)}static getEventTopic(e){return Jp(e.format())}getFunction(e){if(Kr(e)){for(const n in this.functions)if(e===this.getSighash(n))return this.functions[n];Gn.throwArgumentError("no matching function","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.functions).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching function","name",n):i.length>1&&Gn.throwArgumentError("multiple matching functions","name",n),this.functions[i[0]]}const r=this.functions[nu.fromString(e).format()];return r||Gn.throwArgumentError("no matching function","signature",e),r}getEvent(e){if(Kr(e)){const n=e.toLowerCase();for(const i in this.events)if(n===this.getEventTopic(i))return this.events[i];Gn.throwArgumentError("no matching event","topichash",n)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.events).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching event","name",n):i.length>1&&Gn.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}const r=this.events[Ed.fromString(e).format()];return r||Gn.throwArgumentError("no matching event","signature",e),r}getError(e){if(Kr(e)){const n=su(this.constructor,"getSighash");for(const i in this.errors){const a=this.errors[i];if(e===n(a))return this.errors[i]}Gn.throwArgumentError("no matching error","sighash",e)}if(e.indexOf("(")===-1){const n=e.trim(),i=Object.keys(this.errors).filter(a=>a.split("(")[0]===n);return i.length===0?Gn.throwArgumentError("no matching error","name",n):i.length>1&&Gn.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}const r=this.errors[nu.fromString(e).format()];return r||Gn.throwArgumentError("no matching error","signature",e),r}getSighash(e){if(typeof e=="string")try{e=this.getFunction(e)}catch(r){try{e=this.getError(e)}catch{throw r}}return su(this.constructor,"getSighash")(e)}getEventTopic(e){return typeof e=="string"&&(e=this.getEvent(e)),su(this.constructor,"getEventTopic")(e)}_decodeParams(e,r){return this._abiCoder.decode(e,r)}_encodeParams(e,r){return this._abiCoder.encode(e,r)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,r){typeof e=="string"&&(e=this.getError(e));const n=er(r);return Bt(n.slice(0,4))!==this.getSighash(e)&&Gn.throwArgumentError(`data signature does not match error ${e.name}.`,"data",Bt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeErrorResult(e,r){return typeof e=="string"&&(e=this.getError(e)),Bt(Us([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionData(e,r){typeof e=="string"&&(e=this.getFunction(e));const n=er(r);return Bt(n.slice(0,4))!==this.getSighash(e)&&Gn.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Bt(n)),this._decodeParams(e.inputs,n.slice(4))}encodeFunctionData(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Bt(Us([this.getSighash(e),this._encodeParams(e.inputs,r||[])]))}decodeFunctionResult(e,r){typeof e=="string"&&(e=this.getFunction(e));let n=er(r),i=null,a="",s=null,o=null,l=null;switch(n.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,n)}catch{}break;case 4:{const c=Bt(n.slice(0,4)),u=g6e[c];if(u)s=this._abiCoder.decode(u.inputs,n.slice(4)),o=u.name,l=u.signature,u.reason&&(i=s[0]),o==="Error"?a=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:o==="Panic"&&(a=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{const f=this.getError(c);s=this._abiCoder.decode(f.inputs,n.slice(4)),o=f.name,l=f.format()}catch{}break}}return Gn.throwError("call revert exception"+a,De.errors.CALL_EXCEPTION,{method:e.format(),data:Bt(r),errorArgs:s,errorName:o,errorSignature:l,reason:i})}encodeFunctionResult(e,r){return typeof e=="string"&&(e=this.getFunction(e)),Bt(this._abiCoder.encode(e.outputs,r||[]))}encodeFilterTopics(e,r){typeof e=="string"&&(e=this.getEvent(e)),r.length>e.inputs.length&&Gn.throwError("too many arguments for "+e.format(),De.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:r});let n=[];e.anonymous||n.push(this.getEventTopic(e));const i=(a,s)=>a.type==="string"?Jp(s):a.type==="bytes"?_i(Bt(s)):(a.type==="bool"&&typeof s=="boolean"&&(s=s?"0x01":"0x00"),a.type.match(/^u?int/)&&(s=nt.from(s).toHexString()),a.type==="address"&&this._abiCoder.encode(["address"],[s]),Bn(Bt(s),32));for(r.forEach((a,s)=>{let o=e.inputs[s];if(!o.indexed){a!=null&&Gn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,a);return}a==null?n.push(null):o.baseType==="array"||o.baseType==="tuple"?Gn.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,a):Array.isArray(a)?n.push(a.map(l=>i(o,l))):n.push(i(o,a))});n.length&&n[n.length-1]===null;)n.pop();return n}encodeEventLog(e,r){typeof e=="string"&&(e=this.getEvent(e));const n=[],i=[],a=[];return e.anonymous||n.push(this.getEventTopic(e)),r.length!==e.inputs.length&&Gn.throwArgumentError("event arguments/values mismatch","values",r),e.inputs.forEach((s,o)=>{const l=r[o];if(s.indexed)if(s.type==="string")n.push(Jp(l));else if(s.type==="bytes")n.push(_i(l));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");n.push(this._abiCoder.encode([s.type],[l]))}else i.push(s),a.push(l)}),{data:this._abiCoder.encode(i,a),topics:n}}decodeEventLog(e,r,n){if(typeof e=="string"&&(e=this.getEvent(e)),n!=null&&!e.anonymous){let h=this.getEventTopic(e);(!Kr(n[0],32)||n[0].toLowerCase()!==h)&&Gn.throwError("fragment/topic mismatch",De.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:h,value:n[0]}),n=n.slice(1)}let i=[],a=[],s=[];e.inputs.forEach((h,g)=>{h.indexed?h.type==="string"||h.type==="bytes"||h.baseType==="tuple"||h.baseType==="array"?(i.push(Qi.fromObject({type:"bytes32",name:h.name})),s.push(!0)):(i.push(h),s.push(!1)):(a.push(h),s.push(!1))});let o=n!=null?this._abiCoder.decode(i,Us(n)):null,l=this._abiCoder.decode(a,r,!0),c=[],u=0,f=0;e.inputs.forEach((h,g)=>{if(h.indexed)if(o==null)c[g]=new UI({_isIndexed:!0,hash:null});else if(s[g])c[g]=new UI({_isIndexed:!0,hash:o[f++]});else try{c[g]=o[f++]}catch(m){c[g]=m}else try{c[g]=l[u++]}catch(m){c[g]=m}if(h.name&&c[h.name]==null){const m=c[g];m instanceof Error?Object.defineProperty(c,h.name,{enumerable:!0,get:()=>{throw lF(`property ${JSON.stringify(h.name)}`,m)}}):c[h.name]=m}});for(let h=0;h{throw lF(`index ${h}`,g)}})}return Object.freeze(c)}parseTransaction(e){let r=this.getFunction(e.data.substring(0,10).toLowerCase());return r?new h6e({args:this._abiCoder.decode(r.inputs,"0x"+e.data.substring(10)),functionFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r),value:nt.from(e.value||"0")}):null}parseLog(e){let r=this.getEvent(e.topics[0]);return!r||r.anonymous?null:new f6e({eventFragment:r,name:r.name,signature:r.format(),topic:this.getEventTopic(r),args:this.decodeEventLog(r,e.data,e.topics)})}parseError(e){const r=Bt(e);let n=this.getError(r.substring(0,10).toLowerCase());return n?new p6e({args:this._abiCoder.decode(n.inputs,"0x"+r.substring(10)),errorFragment:n,name:n.name,signature:n.format(),sighash:this.getSighash(n)}):null}static isInterface(e){return!!(e&&e._isInterface)}}const m6e="contracts/5.7.0";var Q0=function(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})};const hi=new De(m6e);function R5(t,e){return Q0(this,void 0,void 0,function*(){const r=yield e;typeof r!="string"&&hi.throwArgumentError("invalid address or ENS name","name",r);try{return Ir(r)}catch{}t||hi.throwError("a provider or signer is needed to resolve ENS names",De.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield t.resolveName(r);return n==null&&hi.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function E6(t,e,r){return Q0(this,void 0,void 0,function*(){return Array.isArray(r)?yield Promise.all(r.map((n,i)=>E6(t,Array.isArray(e)?e[i]:e[n.name],n))):r.type==="address"?yield R5(t,e):r.type==="tuple"?yield E6(t,e,r.components):r.baseType==="array"?Array.isArray(e)?yield Promise.all(e.map(n=>E6(t,n,r.arrayChildren))):Promise.reject(hi.makeError("invalid value for array",De.errors.INVALID_ARGUMENT,{argument:"value",value:e})):e})}function w9(t,e,r){return Q0(this,void 0,void 0,function*(){let n={};r.length===e.inputs.length+1&&typeof r[r.length-1]=="object"&&(n=Ri(r.pop())),hi.checkArgumentCount(r.length,e.inputs.length,"passed to contract"),t.signer?n.from?n.from=vi({override:R5(t.signer,n.from),signer:t.signer.getAddress()}).then(c=>Q0(this,void 0,void 0,function*(){return Ir(c.signer)!==c.override&&hi.throwError("Contract with a Signer cannot override from",De.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),c.override})):n.from=t.signer.getAddress():n.from&&(n.from=R5(t.provider,n.from));const i=yield vi({args:E6(t.signer||t.provider,r,e.inputs),address:t.resolvedAddress,overrides:vi(n)||{}}),a=t.interface.encodeFunctionData(e,i.args),s={data:a,to:i.address},o=i.overrides;if(o.nonce!=null&&(s.nonce=nt.from(o.nonce).toNumber()),o.gasLimit!=null&&(s.gasLimit=nt.from(o.gasLimit)),o.gasPrice!=null&&(s.gasPrice=nt.from(o.gasPrice)),o.maxFeePerGas!=null&&(s.maxFeePerGas=nt.from(o.maxFeePerGas)),o.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=nt.from(o.maxPriorityFeePerGas)),o.from!=null&&(s.from=o.from),o.type!=null&&(s.type=o.type),o.accessList!=null&&(s.accessList=Cm(o.accessList)),s.gasLimit==null&&e.gas!=null){let c=21e3;const u=er(a);for(let f=0;fn[c]!=null);return l.length&&hi.throwError(`cannot override ${l.map(c=>JSON.stringify(c)).join(",")}`,De.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:l}),s})}function y6e(t,e){return function(...r){return w9(t,e,r)}}function w6e(t,e){const r=t.signer||t.provider;return function(...n){return Q0(this,void 0,void 0,function*(){r||hi.throwError("estimate require a provider or signer",De.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield w9(t,e,n);return yield r.estimateGas(i)})}}function v6e(t,e){const r=e.wait.bind(e);e.wait=n=>r(n).then(i=>(i.events=i.logs.map(a=>{let s=Dd(a),o=null;try{o=t.interface.parseLog(a)}catch{}return o&&(s.args=o.args,s.decode=(l,c)=>t.interface.decodeEventLog(o.eventFragment,l,c),s.event=o.name,s.eventSignature=o.signature),s.removeListener=()=>t.provider,s.getBlock=()=>t.provider.getBlock(i.blockHash),s.getTransaction=()=>t.provider.getTransaction(i.transactionHash),s.getTransactionReceipt=()=>Promise.resolve(i),s}),i))}function $Q(t,e,r){const n=t.signer||t.provider;return function(...i){return Q0(this,void 0,void 0,function*(){let a;if(i.length===e.inputs.length+1&&typeof i[i.length-1]=="object"){const l=Ri(i.pop());l.blockTag!=null&&(a=yield l.blockTag),delete l.blockTag,i.push(l)}t.deployTransaction!=null&&(yield t._deployed(a));const s=yield w9(t,e,i),o=yield n.call(s,a);try{let l=t.interface.decodeFunctionResult(e,o);return r&&e.outputs.length===1&&(l=l[0]),l}catch(l){throw l.code===De.errors.CALL_EXCEPTION&&(l.address=t.address,l.args=i,l.transaction=s),l}})}}function b6e(t,e){return function(...r){return Q0(this,void 0,void 0,function*(){t.signer||hi.throwError("sending a transaction requires a signer",De.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),t.deployTransaction!=null&&(yield t._deployed());const n=yield w9(t,e,r),i=yield t.signer.sendTransaction(n);return v6e(t,i),i})}}function uF(t,e,r){return e.constant?$Q(t,e,r):b6e(t,e)}function PQ(t){return t.address&&(t.topics==null||t.topics.length===0)?"*":(t.address||"*")+"@"+(t.topics?t.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class _3{constructor(e,r){st(this,"tag",e),st(this,"filter",r),this._listeners=[]}addListener(e,r){this._listeners.push({listener:e,once:r})}removeListener(e){let r=!1;this._listeners=this._listeners.filter(n=>r||n.listener!==e?!0:(r=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){const r=this.listenerCount();return this._listeners=this._listeners.filter(n=>{const i=e.slice();return setTimeout(()=>{n.listener.apply(this,i)},0),!n.once}),r}prepareEvent(e){}getEmit(e){return[e]}}class x6e extends _3{constructor(){super("error",null)}}class dF extends _3{constructor(e,r,n,i){const a={address:e};let s=r.getEventTopic(n);i?(s!==i[0]&&hi.throwArgumentError("topic mismatch","topics",i),a.topics=i.slice()):a.topics=[s],super(PQ(a),a),st(this,"address",e),st(this,"interface",r),st(this,"fragment",n)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(r,n)=>this.interface.decodeEventLog(this.fragment,r,n);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(r){e.args=null,e.decodeError=r}}getEmit(e){const r=Z4e(e.args);if(r.length)throw r[0].error;const n=(e.args||[]).slice();return n.push(e),n}}class fF extends _3{constructor(e,r){super("*",{address:e}),st(this,"address",e),st(this,"interface",r)}prepareEvent(e){super.prepareEvent(e);try{const r=this.interface.parseLog(e);e.event=r.name,e.eventSignature=r.signature,e.decode=(n,i)=>this.interface.decodeEventLog(r.eventFragment,n,i),e.args=r.args}catch{}}}class E6e{constructor(e,r,n){st(this,"interface",su(new.target,"getInterface")(r)),n==null?(st(this,"provider",null),st(this,"signer",null)):Tw.isSigner(n)?(st(this,"provider",n.provider||null),st(this,"signer",n)):u9.isProvider(n)?(st(this,"provider",n),st(this,"signer",null)):hi.throwArgumentError("invalid signer or provider","signerOrProvider",n),st(this,"callStatic",{}),st(this,"estimateGas",{}),st(this,"functions",{}),st(this,"populateTransaction",{}),st(this,"filters",{});{const s={};Object.keys(this.interface.events).forEach(o=>{const l=this.interface.events[o];st(this.filters,o,(...c)=>({address:this.address,topics:this.interface.encodeFilterTopics(l,c)})),s[l.name]||(s[l.name]=[]),s[l.name].push(o)}),Object.keys(s).forEach(o=>{const l=s[o];l.length===1?st(this.filters,o,this.filters[l[0]]):hi.warn(`Duplicate definition of ${o} (${l.join(", ")})`)})}if(st(this,"_runningEvents",{}),st(this,"_wrappedEmits",{}),e==null&&hi.throwArgumentError("invalid contract address or ENS name","addressOrName",e),st(this,"address",e),this.provider)st(this,"resolvedAddress",R5(this.provider,e));else try{st(this,"resolvedAddress",Promise.resolve(Ir(e)))}catch{hi.throwError("provider is required to use ENS name as contract address",De.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(s=>{});const i={},a={};Object.keys(this.interface.functions).forEach(s=>{const o=this.interface.functions[s];if(a[s]){hi.warn(`Duplicate ABI entry for ${JSON.stringify(s)}`);return}a[s]=!0;{const l=o.name;i[`%${l}`]||(i[`%${l}`]=[]),i[`%${l}`].push(s)}this[s]==null&&st(this,s,uF(this,o,!0)),this.functions[s]==null&&st(this.functions,s,uF(this,o,!1)),this.callStatic[s]==null&&st(this.callStatic,s,$Q(this,o,!0)),this.populateTransaction[s]==null&&st(this.populateTransaction,s,y6e(this,o)),this.estimateGas[s]==null&&st(this.estimateGas,s,w6e(this,o))}),Object.keys(i).forEach(s=>{const o=i[s];if(o.length>1)return;s=s.substring(1);const l=o[0];try{this[s]==null&&st(this,s,this[l])}catch{}this.functions[s]==null&&st(this.functions,s,this.functions[l]),this.callStatic[s]==null&&st(this.callStatic,s,this.callStatic[l]),this.populateTransaction[s]==null&&st(this.populateTransaction,s,this.populateTransaction[l]),this.estimateGas[s]==null&&st(this.estimateGas,s,this.estimateGas[l])})}static getContractAddress(e){return kK(e)}static getInterface(e){return cF.isInterface(e)?e:new cF(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(r=>(r==="0x"&&hi.throwError("contract not deployed",De.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||hi.throwError("sending a transactions require a signer",De.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const r=Ri(e||{});return["from","to"].forEach(function(n){r[n]!=null&&hi.throwError("cannot override "+n,De.errors.UNSUPPORTED_OPERATION,{operation:n})}),r.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(r))}connect(e){typeof e=="string"&&(e=new m9(e,this.provider));const r=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&st(r,"deployTransaction",this.deployTransaction),r}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return UI.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if(typeof e=="string"){if(e==="error")return this._normalizeRunningEvent(new x6e);if(e==="event")return this._normalizeRunningEvent(new _3("event",null));if(e==="*")return this._normalizeRunningEvent(new fF(this.address,this.interface));const r=this.interface.getEvent(e);return this._normalizeRunningEvent(new dF(this.address,this.interface,r))}if(e.topics&&e.topics.length>0){try{const n=e.topics[0];if(typeof n!="string")throw new Error("invalid topic");const i=this.interface.getEvent(n);return this._normalizeRunningEvent(new dF(this.address,this.interface,i,e.topics))}catch{}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new _3(PQ(r),r))}return this._normalizeRunningEvent(new fF(this.address,this.interface))}_checkRunningEvents(e){if(e.listenerCount()===0){delete this._runningEvents[e.tag];const r=this._wrappedEmits[e.tag];r&&e.filter&&(this.provider.off(e.filter,r),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,r,n){const i=Dd(r);return i.removeListener=()=>{n&&(e.removeListener(n),this._checkRunningEvents(e))},i.getBlock=()=>this.provider.getBlock(r.blockHash),i.getTransaction=()=>this.provider.getTransaction(r.transactionHash),i.getTransactionReceipt=()=>this.provider.getTransactionReceipt(r.transactionHash),e.prepareEvent(i),i}_addEventListener(e,r,n){if(this.provider||hi.throwError("events require a provider or a signer with a provider",De.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(r,n),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const i=a=>{let s=this._wrapEvent(e,a,r);if(s.decodeError==null)try{const o=e.getEmit(s);this.emit(e.filter,...o)}catch(o){s.decodeError=o.error}e.filter!=null&&this.emit("event",s),s.decodeError!=null&&this.emit("error",s.decodeError,s)};this._wrappedEmits[e.tag]=i,e.filter!=null&&this.provider.on(e.filter,i)}}queryFilter(e,r,n){const i=this._getRunningEvent(e),a=Ri(i.filter);return typeof r=="string"&&Kr(r,32)?(n!=null&&hi.throwArgumentError("cannot specify toBlock with blockhash","toBlock",n),a.blockHash=r):(a.fromBlock=r??0,a.toBlock=n??"latest"),this.provider.getLogs(a).then(s=>s.map(o=>this._wrapEvent(i,o,null)))}on(e,r){return this._addEventListener(this._getRunningEvent(e),r,!1),this}once(e,r){return this._addEventListener(this._getRunningEvent(e),r,!0),this}emit(e,...r){if(!this.provider)return!1;const n=this._getRunningEvent(e),i=n.run(r)>0;return this._checkRunningEvents(n),i}listenerCount(e){return this.provider?e==null?Object.keys(this._runningEvents).reduce((r,n)=>r+this._runningEvents[n].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(e==null){const r=[];for(let n in this._runningEvents)this._runningEvents[n].listeners().forEach(i=>{r.push(i)});return r}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(e==null){for(const n in this._runningEvents){const i=this._runningEvents[n];i.removeAllListeners(),this._checkRunningEvents(i)}return this}const r=this._getRunningEvent(e);return r.removeAllListeners(),this._checkRunningEvents(r),this}off(e,r){if(!this.provider)return this;const n=this._getRunningEvent(e);return n.removeListener(r),this._checkRunningEvents(n),this}removeListener(e,r){return this.off(e,r)}}class _6e extends E6e{}const C6e="units/5.7.0",S6e=new De(C6e),A6e=["wei","kwei","mwei","gwei","szabo","finney","ether"];function I6e(t,e){return g6(t,e)}function hF(t,e){if(typeof t!="string"&&S6e.throwArgumentError("value must be a string","value",t),typeof e=="string"){const r=A6e.indexOf(e);r!==-1&&(e=3*r)}return Wc(t,e??18)}function RQ(t){return I6e(t,18)}function BI(t){"@babel/helpers - typeof";return BI=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},BI(t)}function M6e(t,e,r){return Object.defineProperty(t,"prototype",{writable:!1}),t}function T6e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k6e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&C3(t,e)}function N6e(t){var e=OQ();return function(){var n=S3(t),i;if(e){var a=S3(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return L6e(this,i)}}function L6e(t,e){if(e&&(BI(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return DQ(t)}function DQ(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function zI(t){var e=typeof Map=="function"?new Map:void 0;return zI=function(n){if(n===null||!j6e(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 _6(n,arguments,S3(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),C3(i,n)},zI(t)}function _6(t,e,r){return OQ()?_6=Reflect.construct:_6=function(i,a,s){var o=[null];o.push.apply(o,a);var l=Function.bind.apply(i,o),c=new l;return s&&C3(c,s.prototype),c},_6.apply(null,arguments)}function OQ(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function j6e(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function C3(t,e){return C3=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},C3(t,e)}function S3(t){return S3=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},S3(t)}var md=function(t){k6e(r,t);var e=N6e(r);function r(n){var i;return T6e(this,r),i=e.call(this,n),Object.setPrototypeOf(DQ(i),r.prototype),i.name=i.constructor.name,i}return M6e(r)}(zI(Error)),RN=2,$6e=17,P6e=3,ds="0-90-9٠-٩۰-۹",R6e="-‐-―−ー-",D6e="//",O6e="..",F6e="  ­​⁠ ",U6e="()()[]\\[\\]",B6e="~⁓∼~",dc="".concat(R6e).concat(D6e).concat(O6e).concat(F6e).concat(U6e).concat(B6e),v9="++";function pF(t,e){t=t.split("-"),e=e.split("-");for(var r=t[0].split("."),n=e[0].split("."),i=0;i<3;i++){var a=Number(r[i]),s=Number(n[i]);if(a>s)return 1;if(s>a)return-1;if(!isNaN(a)&&isNaN(s))return 1;if(isNaN(a)&&!isNaN(s))return-1}return t[1]&&e[1]?t[1]>e[1]?1:t[1]=RN&&i5e.test(t)}function s5e(t){return r5e.test(t)}var wF=new RegExp("(?:"+UQ()+")$","i");function o5e(t){var e=t.search(wF);if(e<0)return{};for(var r=t.slice(0,e),n=t.match(wF),i=1;i=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c5e(t,e){if(t){if(typeof t=="string")return vF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return vF(t,e)}}function vF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f5e(t,e){if(t){if(typeof t=="string")return bF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return bF(t,e)}}function bF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);ra?"TOO_SHORT":i[i.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}function g5e(t,e,r){if(e===void 0&&(e={}),r=new oa(r),e.v2){if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}else{if(!t.phone)return!1;if(t.country){if(!r.hasCountry(t.country))throw new Error("Unknown country: ".concat(t.country));r.country(t.country)}else{if(!t.countryCallingCode)throw new Error("Invalid phone number object passed");r.selectNumberingPlan(t.countryCallingCode)}}if(r.possibleLengths())return zQ(t.phone||t.nationalNumber,r);if(t.countryCallingCode&&r.isNonGeographicCallingCode(t.countryCallingCode))return!0;throw new Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function zQ(t,e){switch(_9(t,e)){case"IS_POSSIBLE":return!0;default:return!1}}function Ud(t,e){return t=t||"",new RegExp("^(?:"+e+")$").test(t)}function m5e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=y5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function y5e(t,e){if(t){if(typeof t=="string")return EF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return EF(t,e)}}function EF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0}function WQ(t){return t.replace(new RegExp("[".concat(dc,"]+"),"g")," ").trim()}var HQ=/(\$\d)/;function GQ(t,e,r){var n=r.useInternationalFormat,i=r.withNationalPrefix;r.carrierCode,r.metadata;var a=t.replace(new RegExp(e.pattern()),n?e.internationalFormat():i&&e.nationalPrefixFormattingRule()?e.format().replace(HQ,e.nationalPrefixFormattingRule()):e.format());return n?WQ(a):a}var E5e=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function _5e(t,e,r){var n=new oa(r);if(n.selectNumberingPlan(t,e),n.defaultIDDPrefix())return n.defaultIDDPrefix();if(E5e.test(n.IDDPrefix()))return n.IDDPrefix()}function C5e(t){var e=t.number,r=t.ext;if(!e)return"";if(e[0]!=="+")throw new Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(e).concat(r?";ext="+r:"")}function S5e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=A5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A5e(t,e){if(t){if(typeof t=="string")return _F(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _F(t,e)}}function _F(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var a=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(e.search(a)!==0)continue}if(Ud(e,i.pattern()))return i}}function gC(t,e,r,n){return e?n(t,e,r):t}function k5e(t,e,r,n,i){var a=E9(n,i.metadata);if(a===r){var s=O5(t,e,"NATIONAL",i);return r==="1"?r+" "+s:s}var o=_5e(n,void 0,i.metadata);if(o)return"".concat(o," ").concat(r," ").concat(O5(t,null,"INTERNATIONAL",i))}function IF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function MF(t){for(var e=1;e0&&s[1]==="0"))return t}}}function HI(t,e){if(t&&e.numberingPlan.nationalPrefixForParsing()){var r=new RegExp("^(?:"+e.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(t);if(n){var i,a,s=n.length-1,o=s>0&&n[s];if(e.nationalPrefixTransformRule()&&o)i=t.replace(r,e.nationalPrefixTransformRule()),s>1&&(a=n[1]);else{var l=n[0];i=t.slice(l.length),o&&(a=n[1])}var c;if(o){var u=t.indexOf(n[1]),f=t.slice(0,u);f===e.numberingPlan.nationalPrefix()&&(c=e.numberingPlan.nationalPrefix())}else c=n[0];return{nationalNumber:i,nationalPrefix:c,carrierCode:a}}}return{nationalNumber:t}}function GI(t,e){var r=HI(t,e),n=r.carrierCode,i=r.nationalNumber;if(i!==t){if(!O5e(t,i,e))return{nationalNumber:t};if(e.possibleLengths()&&!F5e(i,e))return{nationalNumber:t}}return{nationalNumber:i,carrierCode:n}}function O5e(t,e,r){return!(Ud(t,r.nationalNumberPattern())&&!Ud(e,r.nationalNumberPattern()))}function F5e(t,e){switch(_9(t,e)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}function VQ(t,e,r,n){var i=e?E9(e,n):r;if(t.indexOf(i)===0){n=new oa(n),n.selectNumberingPlan(e,r);var a=t.slice(i.length),s=GI(a,n),o=s.nationalNumber,l=GI(t,n),c=l.nationalNumber;if(!Ud(c,n.nationalNumberPattern())&&Ud(o,n.nationalNumberPattern())||_9(c,n)==="TOO_LONG")return{countryCallingCode:i,number:a}}return{number:t}}function YQ(t,e,r,n){if(!t)return{};var i;if(t[0]!=="+"){var a=qQ(t,e,r,n);if(a&&a!==t)i=!0,t="+"+a;else{if(e||r){var s=VQ(t,e,r,n),o=s.countryCallingCode,l=s.number;if(o)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:o,number:l}}return{number:t}}}if(t[1]==="0")return{};n=new oa(n);for(var c=2;c-1<=P6e&&c<=t.length;){var u=t.slice(1,c);if(n.hasCallingCode(u))return n.selectNumberingPlan(u),{countryCallingCodeSource:i?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:u,number:t.slice(c)};c++}return{}}function U5e(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=B5e(t))||e){r&&(t=r);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B5e(t,e){if(t){if(typeof t=="string")return TF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return TF(t,e)}}function TF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length)return"";var n=t.indexOf(";",r);return n>=0?t.substring(r,n):t.substring(r)}function Z5e(t){return t===null?!0:t.length===0?!1:H5e.test(t)||K5e.test(t)}function X5e(t,e){var r=e.extractFormattedPhoneNumber,n=Q5e(t);if(!Z5e(n))throw new md("NOT_A_NUMBER");var i;if(n===null)i=r(t)||"";else{i="",n.charAt(0)===QQ&&(i+=n);var a=t.indexOf(NF),s;a>=0?s=a+NF.length:s=0;var o=t.indexOf(VI);i+=t.substring(s,o)}var l=i.indexOf(J5e);if(l>0&&(i=i.substring(0,l)),i!=="")return i}var e8e=250,t8e=new RegExp("["+v9+ds+"]"),r8e=new RegExp("[^"+ds+"#]+$");function n8e(t,e,r){if(e=e||{},r=new oa(r),e.defaultCountry&&!r.hasCountry(e.defaultCountry))throw e.v2?new md("INVALID_COUNTRY"):new Error("Unknown country: ".concat(e.defaultCountry));var n=a8e(t,e.v2,e.extract),i=n.number,a=n.ext,s=n.error;if(!i){if(e.v2)throw s==="TOO_SHORT"?new md("TOO_SHORT"):new md("NOT_A_NUMBER");return{}}var o=o8e(i,e.defaultCountry,e.defaultCallingCode,r),l=o.country,c=o.nationalNumber,u=o.countryCallingCode,f=o.countryCallingCodeSource,h=o.carrierCode;if(!r.hasSelectedNumberingPlan()){if(e.v2)throw new md("INVALID_COUNTRY");return{}}if(!c||c.length$6e){if(e.v2)throw new md("TOO_LONG");return{}}if(e.v2){var g=new ON(u,c,r.metadata);return l&&(g.country=l),h&&(g.carrierCode=h),a&&(g.ext=a),g.__countryCallingCodeSource=f,g}var m=(e.extended?r.hasSelectedNumberingPlan():l)?Ud(c,r.nationalNumberPattern()):!1;return e.extended?{country:l,countryCallingCode:u,carrierCode:h,valid:m,possible:m?!0:!!(e.extended===!0&&r.possibleLengths()&&zQ(c,r)),phone:c,ext:a}:m?s8e(l,c,a):{}}function i8e(t,e,r){if(t){if(t.length>e8e){if(r)throw new md("TOO_LONG");return}if(e===!1)return t;var n=t.search(t8e);if(!(n<0))return t.slice(n).replace(r8e,"")}}function a8e(t,e,r){var n=X5e(t,{extractFormattedPhoneNumber:function(s){return i8e(s,r,e)}});if(!n)return{};if(!a5e(n))return s5e(n)?{error:"TOO_SHORT"}:{};var i=o5e(n);return i.ext?i:{number:n}}function s8e(t,e,r){var n={country:t,phone:e};return r&&(n.ext=r),n}function o8e(t,e,r,n){var i=YQ(xF(t),e,r,n.metadata),a=i.countryCallingCodeSource,s=i.countryCallingCode,o=i.number,l;if(s)n.selectNumberingPlan(s);else if(o&&(e||r))n.selectNumberingPlan(e,r),e&&(l=e),s=r||E9(e,n.metadata);else return{};if(!o)return{countryCallingCodeSource:a,countryCallingCode:s};var c=GI(xF(o),n),u=c.nationalNumber,f=c.carrierCode,h=JQ(s,{nationalNumber:u,defaultCountry:e,metadata:n});return h&&(l=h,h==="001"||n.country(l)),{country:l,countryCallingCode:s,countryCallingCodeSource:a,nationalNumber:u,carrierCode:f}}function LF(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function jF(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function I8e(t,e){if(t){if(typeof t=="string")return UF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return UF(t,e)}}function UF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1;)e&1&&(r+=t),e>>=1,t+=t;return r+t}function BF(t,e){return t[e]===")"&&e++,M8e(t.slice(0,e))}function M8e(t){for(var e=[],r=0;r=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B8e(t,e){if(t){if(typeof t=="string")return HF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return HF(t,e)}}function HF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1&&arguments[1]!==void 0?arguments[1]:{},i=n.allowOverflow;if(!r)throw new Error("String is required");var a=YI(r.split(""),this.matchTree,!0);if(a&&a.match&&delete a.matchedChars,!(a&&a.overflow&&!i))return a}}]),t}();function YI(t,e,r){if(typeof e=="string"){var n=t.join("");return e.indexOf(n)===0?t.length===e.length?{match:!0,matchedChars:t}:{partialMatch:!0}:n.indexOf(e)===0?r&&t.length>e.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,e.length)}:void 0}if(Array.isArray(e)){for(var i=t.slice(),a=0;a=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q8e(t,e){if(t){if(typeof t=="string")return qF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qF(t,e)}}function qF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0)){var i=this.getTemplateForFormat(r,n);if(i)return this.setNationalNumberTemplate(i,n),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(r){return this.isNANP||r&&r.nationalPrefixFormattingRule()&&Z8e.test(r.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(r,n){var i=r.IDDPrefix,a=r.missingPlus;return i?n&&n.spacing===!1?i:i+" ":a?"":"+"}},{key:"getTemplate",value:function(r){if(this.template){for(var n=-1,i=0,a=r.international?this.getInternationalPrefixBeforeCountryCallingCode(r,{spacing:!1}):"";ic.length)){var u=new RegExp("^"+l+"$"),f=i.replace(/\d/g,KI);u.test(f)&&(c=f);var h=this.getFormatFormat(r,a),g;if(this.shouldTryNationalPrefixFormattingRule(r,{international:a,nationalPrefix:s})){var m=h.replace(HQ,r.nationalPrefixFormattingRule());if(D5(r.nationalPrefixFormattingRule())===(s||"")+D5("$1")&&(h=m,g=!0,s))for(var w=s.length;w>0;)h=h.replace(/\d/,Yl),w--}var C=c.replace(new RegExp(l),h).replace(new RegExp(KI,"g"),Yl);return g||(o?C=C6(Yl,o.length)+" "+C:s&&(C=C6(Yl,s.length)+this.getSeparatorAfterNationalPrefix(r)+C)),a&&(C=WQ(C)),C}}},{key:"formatNextNationalNumberDigits",value:function(r){var n=T8e(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,r);if(!n){this.resetFormat();return}return this.populatedNationalNumberTemplate=n[0],this.populatedNationalNumberTemplatePosition=n[1],BF(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(r,n){var i=n.international,a=n.nationalPrefix;if(r.nationalPrefixFormattingRule()){var s=r.usesNationalPrefix();if(s&&a||!s&&!i)return!0}}}]),t}();function ZQ(t,e){return s9e(t)||a9e(t,e)||i9e(t,e)||n9e()}function n9e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i9e(t,e){if(t){if(typeof t=="string")return YF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return YF(t,e)}}function YF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=3;if(n.appendDigits(r),a&&this.extractIddPrefix(n),this.isWaitingForCountryCallingCode(n)){if(!this.extractCountryCallingCode(n))return}else n.appendNationalSignificantNumberDigits(r);n.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(n.getNationalDigits(),function(s){return n.update(s)})}},{key:"isWaitingForCountryCallingCode",value:function(r){var n=r.international,i=r.callingCode;return n&&!i}},{key:"extractCountryCallingCode",value:function(r){var n=YQ("+"+r.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode,a=n.number;if(i)return r.setCallingCode(i),r.update({nationalSignificantNumber:a}),!0}},{key:"reset",value:function(r){if(r){this.hasSelectedNumberingPlan=!0;var n=r._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=n&&p9e.test(n)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(r,n){if(this.hasSelectedNumberingPlan){var i=HI(r,this.metadata),a=i.nationalPrefix,s=i.nationalNumber,o=i.carrierCode;if(s!==r)return this.onExtractedNationalNumber(a,o,s,r,n),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(r,n,i){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(r,i);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var a=HI(r,this.metadata),s=a.nationalPrefix,o=a.nationalNumber,l=a.carrierCode;if(o!==n)return this.onExtractedNationalNumber(s,l,o,r,i),!0}}},{key:"onExtractedNationalNumber",value:function(r,n,i,a,s){var o,l,c=a.lastIndexOf(i);if(c>=0&&c===a.length-i.length){l=!0;var u=a.slice(0,c);u!==r&&(o=u)}s({nationalPrefix:r,carrierCode:n,nationalSignificantNumber:i,nationalSignificantNumberMatchesInput:l,complexPrefixBeforeNationalSignificantNumber:o}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(r){if(this.extractAnotherNationalSignificantNumber(r.getNationalDigits(),r.nationalSignificantNumber,function(n){return r.update(n)}))return!0;if(this.extractIddPrefix(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0;if(this.fixMissingPlus(r))return this.extractCallingCodeAndNationalSignificantNumber(r),!0}},{key:"extractIddPrefix",value:function(r){var n=r.international,i=r.IDDPrefix,a=r.digits;if(r.nationalSignificantNumber,!(n||i)){var s=qQ(a,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(s!==void 0&&s!==a)return r.update({IDDPrefix:a.slice(0,a.length-s.length)}),this.startInternationalNumber(r,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(r){if(!r.international){var n=VQ(r.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),i=n.countryCallingCode;if(n.number,i)return r.update({missingPlus:!0}),this.startInternationalNumber(r,{country:r.country,callingCode:i}),!0}}},{key:"startInternationalNumber",value:function(r,n){var i=n.country,a=n.callingCode;r.startInternationalNumber(i,a),r.nationalSignificantNumber&&(r.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(r){this.extractCountryCallingCode(r)&&this.extractNationalSignificantNumber(r.getNationalDigits(),function(n){return r.update(n)})}}]),t}();function m9e(t){var e=t.search(f9e);if(!(e<0)){t=t.slice(e);var r;return t[0]==="+"&&(r=!0,t=t.slice(1)),t=t.replace(h9e,""),r&&(t="+"+t),t}}function y9e(t){var e=m9e(t)||"";return e[0]==="+"?[e.slice(1),!0]:[e]}function w9e(t){var e=y9e(t),r=ZQ(e,2),n=r[0],i=r[1];return d9e.test(n)||(n=""),[n,i]}function v9e(t,e){return _9e(t)||E9e(t,e)||x9e(t,e)||b9e()}function b9e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x9e(t,e){if(t){if(typeof t=="string")return KF(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return KF(t,e)}}function KF(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1}},{key:"determineTheCountry",value:function(){this.state.setCountry(JQ(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var r=this.state,n=r.digits,i=r.callingCode,a=r.country,s=r.nationalSignificantNumber;if(n){if(this.isInternational())return i?"+"+i+s:"+"+n;if(a||i){var o=a?this.metadata.countryCallingCode():i;return"+"+o+s}}}},{key:"getNumber",value:function(){var r=this.state,n=r.nationalSignificantNumber,i=r.carrierCode,a=r.callingCode,s=this._getCountry();if(n&&!(!s&&!a)){if(s&&s===this.defaultCountry){var o=new oa(this.metadata.metadata);o.selectNumberingPlan(s);var l=o.numberingPlan.callingCode(),c=this.metadata.getCountryCodesForCallingCode(l);if(c.length>1){var u=KQ(n,{countries:c,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});u&&(s=u)}}var f=new ON(s||a,n,this.metadata.metadata);return i&&(f.carrierCode=i),f}}},{key:"isPossible",value:function(){var r=this.getNumber();return r?r.isPossible():!1}},{key:"isValid",value:function(){var r=this.getNumber();return r?r.isValid():!1}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}]),t}();function I9e(t){return new oa(t).getCountries()}function M9e(t,e,r){if(e[t])return new ON(t,e[t],r)}const T9e={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},k9e={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0},N9e={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},L9e={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},j9e={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0},$9e={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},P9e={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},R9e={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0},D9e={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},eZ={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},tZ={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0},O9e={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},F9e={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},U9e={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0};var Is;(Is={}).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",Is.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",Is.INVALID_DATA="invalid_data",Is.LINKED_TO_ANOTHER_USER="linked_to_another_user",Is.ALLOWLIST_REJECTED="allowlist_rejected",Is.OAUTH_USER_DENIED="oauth_user_denied",Is.UNKNOWN_AUTH_ERROR="unknown_auth_error",Is.USER_EXITED_AUTH_FLOW="exited_auth_flow",Is.MUST_BE_AUTHENTICATED="must_be_authenticated",Is.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",Is.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",Is.CLIENT_REQUEST_TIMEOUT="client_request_timeout",Is.INVALID_CREDENTIALS="invalid_credentials";let B9e=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},z9e=class extends B9e{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}};const Xi={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};let wC=class extends z9e{constructor(e){var n,i,a;super(e.message,e.code,e.data);let r=Object.values(Xi).find(s=>s.eipCode===e.code);this.details=r||Xi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=Xi.E32002_CONNECTION_ALREADY_PENDING:this.details=Xi.E32002_REQUEST_ALREADY_PENDING:(a=e.message)!=null&&a.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=Xi.E32002_WALLET_LOCKED))}};const ts=t=>nt.from(t);function JI(t){if(typeof t=="number"||typeof t=="bigint"||typeof t=="string")return t;if(typeof t.toHexString=="function")return t.toHexString();throw Error(`Expected numeric value but received ${t}`)}function W9e(t){let e={};return t.to!==void 0&&(e.to=t.to),t.data!==void 0&&(e.data=t.data),t.chainId!==void 0&&(e.chainId=t.chainId),t.type!==void 0&&(e.type=t.type),t.accessList!==void 0&&(e.accessList=t.accessList),t.nonce!==void 0&&(e.nonce=ts(t.nonce).toNumber()),t.gasLimit!==void 0&&(e.gasLimit=ts(t.gasLimit)),t.gasPrice!==void 0&&(e.gasPrice=ts(t.gasPrice)),t.value!==void 0&&(e.value=ts(t.value)),t.maxFeePerGas!==void 0&&(e.maxFeePerGas=ts(t.maxFeePerGas)),t.maxPriorityFeePerGas!==void 0&&(e.maxPriorityFeePerGas=ts(t.maxPriorityFeePerGas)),e}const rZ=t=>[T9e.id,k9e.id,N9e.id].includes(t),H9e=async(t,e)=>{if(!rZ(t.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(t.type===void 0&&(t.type=2),t.maxFeePerGas)return t;try{let{lastBaseFeePerGas:r}=await e.getFeeData();if(r){let n=r.mul(nt.from(120)).div(nt.from(100));t.maxFeePerGas=JI(n),t.maxPriorityFeePerGas=JI(nt.from(0))}}catch(r){throw Error(`Failed to set gas price for Arbitrum transaction: ${r}.`)}return t},nZ=t=>[56,97].includes(t),G9e=async(t,e)=>{var r;if(!nZ(t.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(t.type===void 0?t.type=0:(t.type==1||t.type==2)&&console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!t.gasPrice){let n=await e.getFeeData();t.gasPrice=(r=n.gasPrice)==null?void 0:r.toHexString()}return t},q9e=["function getL1Fee(bytes memory _data) external view returns (uint256)"],C9=t=>[L9e.id,j9e.id,$9e.id,P9e.id,R9e.id,D9e.id,O9e.id,U9e.id,F9e.id,81457,168587773].includes(t),V9e=async(t,e)=>{if(!C9(t.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(t.type===void 0&&(t.type=2),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{if(!t.maxPriorityFeePerGas){let r=await e.send("eth_maxPriorityFeePerGas",[]);t.maxPriorityFeePerGas=r}if(t.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),t.maxPriorityFeePerGas>=t.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!t.maxFeePerGas){let{lastBaseFeePerGas:r}=await e.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let n=nt.from(r).mul(nt.from(126)).div(nt.from(100)).add(nt.from(t.maxPriorityFeePerGas));t.maxFeePerGas=JI(n)}}catch(r){throw Error(`Failed to set gas price for OP stack transaction: ${r}.`)}return t};async function Y9e(t,e){if(!t.chainId||t.chainId&&!C9(t.chainId))return nt.from(0);let r=nt.from(0);try{let n=new _6e("0x420000000000000000000000000000000000000F",q9e,e),i=W9e(t),a=Zve(i);r=await n.getL1Fee(a)}catch{}return r}var iZ={exports:{}};(function(t,e){(function(r,n){t.exports=n()})(Xt,function(){var r=function(a,s){if(s=s||{},typeof a!="function")throw new i("fetch must be a function");if(typeof s!="object")throw new i("defaults must be an object");if(s.retries!==void 0&&!n(s.retries))throw new i("retries must be a positive integer");if(s.retryDelay!==void 0&&!n(s.retryDelay)&&typeof s.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(s.retryOn!==void 0&&!Array.isArray(s.retryOn)&&typeof s.retryOn!="function")throw new i("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return s=Object.assign(o,s),function(c,u){var f=s.retries,h=s.retryDelay,g=s.retryOn;if(u&&u.retries!==void 0)if(n(u.retries))f=u.retries;else throw new i("retries must be a positive integer");if(u&&u.retryDelay!==void 0)if(n(u.retryDelay)||typeof u.retryDelay=="function")h=u.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(u&&u.retryOn)if(Array.isArray(u.retryOn)||typeof u.retryOn=="function")g=u.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(m,w){var C=function(b){var A=typeof Request<"u"&&c instanceof Request?c.clone():c;a(A,u).then(function(S){if(Array.isArray(g)&&g.indexOf(S.status)===-1)m(S);else if(typeof g=="function")try{return Promise.resolve(g(b,null,S)).then(function(j){j?v(b,null,S):m(S)}).catch(w)}catch(j){w(j)}else b=0}function i(a){this.name="ArgumentError",this.message=a}return r})})(iZ);var K9e=iZ.exports;const J9e=No(K9e),aZ={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0};let Q9e=J9e(fetch,{retries:3,retryDelay:500});const sZ=t=>[eZ.id,tZ.id,aZ.id].includes(t);let vC=t=>({maxPriorityFee:hF(t.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:hF(t.maxFee.toFixed(9),"gwei").toHexString()}),Z9e=t=>({safeLow:vC(t.safeLow),standard:vC(t.standard),fast:vC(t.fast)});const X9e=async t=>{let e="";switch(t){case eZ.id:e="https://gasstation.polygon.technology/v2";break;case tZ.id:e="https://gasstation-testnet.polygon.technology/v2";break;case aZ.id:e="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${t} does not support polygon gas stations`)}let r=await Q9e(e),n=await r.json();if(r.status>399)throw n;return Z9e(n)};async function exe(t){if(!sZ(t.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(t.type===void 0&&(t.type=2),t.maxPriorityFeePerGas&&t.maxFeePerGas)return t;try{let{standard:e}=await X9e(t.chainId);t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=e.maxPriorityFee),t.maxFeePerGas||(t.maxFeePerGas=e.maxFee),t.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete t.gasPrice)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return t}const txe=async(t,e)=>{var r,n,i;if(t.type===void 0&&(t.type=2),t.type===2){if(!t.maxFeePerGas||!t.maxPriorityFeePerGas){let a=await e.getFeeData();t.maxFeePerGas||(t.maxFeePerGas=(r=a.maxFeePerGas)==null?void 0:r.toHexString()),t.maxPriorityFeePerGas||(t.maxPriorityFeePerGas=(n=a.maxPriorityFeePerGas)==null?void 0:n.toHexString())}}else if(!t.gasPrice){let a=await e.getFeeData();t.gasPrice=(i=a.gasPrice)==null?void 0:i.toHexString()}return t};async function FN(t,e){if(!t.gasLimit)throw new wC("gasLimit was not successfully set for transaction.");let r=ts(t.gasLimit),n=nt.from(0);if(t.type==2){if(!t.maxFeePerGas)throw new wC("maxFeePerGas was not successfully set for transaction of type 2.");n=ts(t.maxFeePerGas)}else{if(!t.gasPrice)throw new wC("gasPrice was not successfully set for transaction of type 0 or 1.");n=ts(t.gasPrice)}let i=r.mul(n),a=nt.from(0);if(t.chainId&&C9(t.chainId))try{a=await Y9e(t,e),i=i.add(a)}catch{}return{totalGasEstimate:i,l1ExecutionFeeEstimate:a}}async function rxe(t,e){try{return(await e.estimateGas(t)).toHexString()}catch(r){let n;if("message"in r&&r.message.includes("insufficient funds")&&(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'value'`),n=await async function({txRequest:i,provider:a}){try{let s={...i,value:void 0};return(await a.estimateGas(s)).toHexString()}catch(s){return console.warn(`Gas estimation failed with error: ${s} when omitting the 'value'`),null}}({txRequest:t,provider:e})),n||(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from'`),n=await async function({txRequest:i,provider:a}){try{let s={...i,from:void 0};return(await a.estimateGas(s)).toHexString()}catch(s){return console.warn(`Gas estimation failed with error: ${s} when omitting the 'from' address`),null}}({txRequest:t,provider:e})),!n)throw r;return n}}function oZ(t){return/^-?0x[a-f0-9]+$/i.test(t)}function nxe(t){for(let e of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=t[e];if(r!==void 0&&!function(n){let i=typeof n=="number",a=typeof n=="bigint",s=typeof n=="string"&&oZ(n);return i||a||s}(r))throw Error(`Transaction request property '${e}' must be a valid number, bigint, or hex string representing a quantity`)}if(typeof t.chainId!="number")throw Error("Transaction request property 'chainId' must be a number")}async function UN(t,e,r){if(e.chainId=Number(e.chainId),nxe(e),e.from||(e.from=t),!e.nonce){let n=new m9(t,r);e.nonce=await n.getTransactionCount("pending")}return e.gasLimit||(e.gas?(e.gasLimit=e.gas,delete e.gas):e.gasLimit=await rxe(e,r)),typeof e.type=="string"&&oZ(e.type)&&(e.type=Number(e.type)),[23294,23295].includes(e.chainId)&&(e.type=0),(e=sZ(e.chainId)?await exe(e):rZ(e.chainId)?await H9e(e,r):C9(e.chainId)?await V9e(e,r):nZ(e.chainId)?await G9e(e,r):await txe(e,r)).type===0&&delete e.accessList,e.type!==2&&(delete e.maxPriorityFeePerGas,delete e.maxFeePerGas),e}var lZ={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function a(l,c,u,f,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var g=new i(u,f||l,h),m=r?r+c:c;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],g]:l._events[m].push(g):(l._events[m]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)e.call(u,f)&&c.push(r?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},o.prototype.listeners=function(c){var u=r?r+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,g=f.length,m=new Array(g);h{let e=t;typeof e=="string"&&(e=uxe.encode(e));const r=32768,n=[];for(let i=0;idxe(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),hxe=t=>{const e=atob(t),r=new Uint8Array(e.length);for(let n=0;n{let e=t;e instanceof Uint8Array&&(e=uZ.decode(e)),e=e.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return hxe(e)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class gxe extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var r;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(r=Error.captureStackTrace)===null||r===void 0||r.call(Error,this,this.constructor)}}class Zh extends gxe{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function mxe(t){return typeof t=="object"&&t!==null}function yxe(t){if(!mxe(t)||Object.prototype.toString.call(t)!=="[object Object]")return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}const F5=fxe,wxe=pxe;function QF(t){if(typeof t!="string")throw new Zh("JWTs must use Compact JWS serialization, JWT must be a string");const{1:e,length:r}=t.split(".");if(r===5)throw new Zh("Only JWTs using Compact JWS serialization can be decoded");if(r!==3)throw new Zh("Invalid JWT");if(!e)throw new Zh("JWTs must contain a payload");let n;try{n=wxe(e)}catch{throw new Zh("Failed to base64url decode the payload")}let i;try{i=JSON.parse(uZ.decode(n))}catch{throw new Zh("Failed to parse the decoded payload as JSON")}if(!yxe(i))throw new Zh("Invalid JWT Claims Set");return i}/*! js-cookie v3.0.5 | MIT */function p4(t){for(var e=1;e"u")){s=p4({},e,s),typeof s.expires=="number"&&(s.expires=new Date(Date.now()+s.expires*864e5)),s.expires&&(s.expires=s.expires.toUTCString()),i=encodeURIComponent(i).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var l in s)s[l]&&(o+="; "+l,s[l]!==!0&&(o+="="+s[l].split(";")[0]));return document.cookie=i+"="+t.write(a,i)+o}}function n(i){if(!(typeof document>"u"||arguments.length&&!i)){for(var a=document.cookie?document.cookie.split("; "):[],s={},o=0;oxxe(String(t),e),bC=(t,e)=>`+${BN(e)} ${t}`,Cxe=t=>`*${t.replaceAll("-","").slice(-4)}`,Sxe=t=>new I3(t),Axe=Exe().map(t=>({code:t,callCode:BN(t)})),Ixe=t=>{var r;let e=(r=_xe(t,bxe))==null?void 0:r.formatInternational();return e==null?void 0:e.substring(e.indexOf(" ")+1)},Mxe=t=>{let e=new I3;e.input(t);let r=e.getCountry()||"US",n=e.getCallingCode()||"1";return{countryCode:r,phone:t.replace("+"+n,"")}},Txe=(t,e=!0)=>t.reduce((r,n)=>({...r,[n]:e}),{});let kxe={buy:"CARD",send:"CRYPTO_ACCOUNT"},Nxe={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1"};function Lxe({input:t,amount:e,blockchain:r,asset:n,experience:i}){let a=new URL("https://pay.coinbase.com/buy/select-asset");return a.searchParams.set("appId",t.app_id),a.searchParams.set("sessionToken",t.session_token),a.searchParams.set("defaultExperience",i),a.searchParams.set("presetCryptoAmount",e.startsWith(".")?`0${e}`:e),a.searchParams.set("defaultNetwork",r),a.searchParams.set("defaultPaymentMethod",kxe[i]),a.searchParams.set("defaultAsset",Nxe[n]),a.searchParams.set("partnerUserId",t.partner_user_id),{url:a}}const jxe="1.0.7";let Sl=class ZI extends Error{constructor(e,r={}){var s;const n=r.cause instanceof ZI?r.cause.details:(s=r.cause)!=null&&s.message?r.cause.message:r.details,i=r.cause instanceof ZI&&r.cause.docsPath||r.docsPath,a=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: https://abitype.dev${i}`]:[],...n?[`Details: ${n}`]:[],`Version: abitype@${jxe}`].join(` +`);super(a),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),r.cause&&(this.cause=r.cause),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.shortMessage=e}};function Sh(t,e){const r=t.exec(e);return r==null?void 0:r.groups}const fZ=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,hZ=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,pZ=/^\(.+?\).*?$/,ZF=/^tuple(?(\[(\d*)\])*)$/;function XI(t){let e=t.type;if(ZF.test(t.type)&&"components"in t){e="(";const r=t.components.length;for(let i=0;i[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function Pxe(t){return gZ.test(t)}function Rxe(t){return Sh(gZ,t)}const mZ=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function Dxe(t){return mZ.test(t)}function Oxe(t){return Sh(mZ,t)}const yZ=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function Fxe(t){return yZ.test(t)}function Uxe(t){return Sh(yZ,t)}const wZ=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function vZ(t){return wZ.test(t)}function Bxe(t){return Sh(wZ,t)}const bZ=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function zxe(t){return bZ.test(t)}function Wxe(t){return Sh(bZ,t)}const Hxe=/^fallback\(\) external(?:\s(?payable{1}))?$/;function Gxe(t){return Hxe.test(t)}const qxe=/^receive\(\) external payable$/;function Vxe(t){return qxe.test(t)}const Yxe=new Set(["indexed"]),eM=new Set(["calldata","memory","storage"]);class Kxe extends Sl{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Jxe extends Sl{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Qxe extends Sl{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Zxe extends Sl{constructor({param:e,name:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class Xxe extends Sl{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class e7e extends Sl{constructor({param:e,type:r,modifier:n}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class t7e extends Sl{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class uy extends Sl{constructor({signature:e,type:r}){super(`Invalid ${r} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class r7e extends Sl{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class n7e extends Sl{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class i7e extends Sl{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class a7e extends Sl{constructor({current:e,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function s7e(t,e,r){let n="";if(r)for(const i of Object.entries(r)){if(!i)continue;let a="";for(const s of i[1])a+=`[${s.type}${s.name?`:${s.name}`:""}]`;n+=`(${i[0]}{${a}})`}return e?`${e}:${t}${n}`:t}const xC=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function o7e(t,e={}){if(Fxe(t)){const r=Uxe(t);if(!r)throw new uy({signature:t,type:"function"});const n=rc(r.parameters),i=[],a=n.length;for(let o=0;o[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,c7e=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,u7e=/^u?int$/;function f0(t,e){var f,h;const r=s7e(t,e==null?void 0:e.type,e==null?void 0:e.structs);if(xC.has(r))return xC.get(r);const n=pZ.test(t),i=Sh(n?c7e:l7e,t);if(!i)throw new Qxe({param:t});if(i.name&&f7e(i.name))throw new Zxe({param:t,name:i.name});const a=i.name?{name:i.name}:{},s=i.modifier==="indexed"?{indexed:!0}:{},o=(e==null?void 0:e.structs)??{};let l,c={};if(n){l="tuple";const g=rc(i.type),m=[],w=g.length;for(let C=0;C[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function EZ(t,e,r=new Set){const n=[],i=t.length;for(let a=0;ae(t,a)}function Iu(t,{includeName:e=!1}={}){if(t.type!=="function"&&t.type!=="event"&&t.type!=="error")throw new T7e(t.type);return`${t.name}(${I9(t.inputs,{includeName:e})})`}function I9(t,{includeName:e=!1}={}){return t?t.map(r=>m7e(r,{includeName:e})).join(e?", ":","):""}function m7e(t,{includeName:e}){return t.type.startsWith("tuple")?`(${I9(t.components,{includeName:e})})${t.type.slice(5)}`:t.type+(e&&t.name?` ${t.name}`:"")}function wc(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function ai(t){return wc(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const _Z="2.22.1";let D2={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:r})=>e?`${t??"https://viem.sh"}${e}${r?`#${r}`:""}`:void 0,version:`viem@${_Z}`},Qe=class tM extends Error{constructor(e,r={}){var o;const n=(()=>{var l;return r.cause instanceof tM?r.cause.details:(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof tM&&r.cause.docsPath||r.docsPath,a=(o=D2.getDocsUrl)==null?void 0:o.call(D2,{...r,docsPath:i}),s=[e||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...n?[`Details: ${n}`]:[],...D2.version?[`Version: ${D2.version}`]:[]].join(` +`);super(s,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=n,this.docsPath=i,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=e,this.version=_Z}walk(e){return CZ(this,e)}};function CZ(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?CZ(t.cause,e):e?null:t}class y7e extends Qe{constructor({docsPath:e}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:e,name:"AbiConstructorNotFoundError"})}}class XF extends Qe{constructor({docsPath:e}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:e,name:"AbiConstructorParamsNotFoundError"})}}class SZ extends Qe{constructor({data:e,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${I9(r,{includeName:!0})})`,`Data: ${e} (${n} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=r,this.size=n}}class jw extends Qe{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class w7e extends Qe{constructor({expectedLength:e,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${e}`,`Given length: ${r}`].join(` +`),{name:"AbiEncodingArrayLengthMismatchError"})}}class v7e extends Qe{constructor({expectedSize:e,value:r}){super(`Size of bytes "${r}" (bytes${ai(r)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class b7e extends Qe{constructor({expectedLength:e,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${r}`].join(` +`),{name:"AbiEncodingLengthMismatchError"})}}class AZ extends Qe{constructor(e,{docsPath:r}){super([`Encoded error signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class x7e extends Qe{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e,name:"AbiEventSignatureEmptyTopicsError"})}}class IZ extends Qe{constructor(e,{docsPath:r}){super([`Encoded event signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}}class eU extends Qe{constructor(e,{docsPath:r}={}){super([`Event ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:r,name:"AbiEventNotFoundError"})}}class U5 extends Qe{constructor(e,{docsPath:r}={}){super([`Function ${e?`"${e}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class E7e extends Qe{constructor(e,{docsPath:r}){super([`Function "${e}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}}class _7e extends Qe{constructor(e,{docsPath:r}){super([`Encoded function signature "${e}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`].join(` +`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}}class C7e extends Qe{constructor(e,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${Iu(e.abiItem)}\`, and`,`\`${r.type}\` in \`${Iu(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class S7e extends Qe{constructor({expectedSize:e,givenSize:r}){super(`Expected bytes${e}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}}class M3 extends Qe{constructor({abiItem:e,data:r,params:n,size:i}){super([`Data size of ${i} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${I9(n,{includeName:!0})})`,`Data: ${r} (${i} bytes)`],name:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=r,this.params=n,this.size=i}}class M9 extends Qe{constructor({abiItem:e,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Iu(e,{includeName:!0})}".`].join(` +`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class A7e extends Qe{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class I7e extends Qe{constructor(e,{docsPath:r}){super([`Type "${e}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r,name:"InvalidAbiDecodingType"})}}class M7e extends Qe{constructor(e){super([`Value "${e}" is not a valid array.`].join(` +`),{name:"InvalidArrayError"})}}class T7e extends Qe{constructor(e){super([`"${e}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`),{name:"InvalidDefinitionTypeError"})}}class k7e extends Qe{constructor(e){super(`Filter type "${e}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}class MZ extends Qe{constructor({offset:e,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}}let TZ=class extends Qe{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class tU extends Qe{constructor({size:e,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`,{name:"InvalidBytesLengthError"})}}function Am(t,{dir:e,size:r=32}={}){return typeof t=="string"?eh(t,{dir:e,size:r}):N7e(t,{dir:e,size:r})}function eh(t,{dir:e,size:r=32}={}){if(r===null)return t;const n=t.replace("0x","");if(n.length>r*2)throw new TZ({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`}function N7e(t,{dir:e,size:r=32}={}){if(r===null)return t;if(t.length>r)throw new TZ({size:t.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let i=0;ie)throw new $7e({givenSize:ai(t),maxSize:e})}function vo(t,e={}){const{signed:r}=e;e.size&&Ic(t,{size:e.size});const n=BigInt(t);if(!r)return n;const i=(t.length-2)/2,a=(1n<e.toString(16).padStart(2,"0"));function ur(t,e={}){return typeof t=="number"||typeof t=="bigint"?lr(t,e):typeof t=="string"?Dg(t,e):typeof t=="boolean"?NZ(t,e):Si(t,e)}function NZ(t,e={}){const r=`0x${Number(t)}`;return typeof e.size=="number"?(Ic(r,{size:e.size}),Am(r,{size:e.size})):r}function Si(t,e={}){let r="";for(let i=0;ia||i=Zu.zero&&t<=Zu.nine)return t-Zu.zero;if(t>=Zu.A&&t<=Zu.F)return t-(Zu.A-10);if(t>=Zu.a&&t<=Zu.f)return t-(Zu.a-10)}function vc(t,e={}){let r=t;e.size&&(Ic(r,{size:e.size}),r=Am(r,{dir:"right",size:e.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const i=n.length/2,a=new Uint8Array(i);for(let s=0,o=0;s0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function B5(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function LZ(t,e){zN(t);const r=e.outputLen;if(t.length>iU&m4)}:{h:Number(t>>iU&m4)|0,l:Number(t&m4)|0}}function W7e(t,e=!1){let r=new Uint32Array(t.length),n=new Uint32Array(t.length);for(let i=0;it<>>32-r,G7e=(t,e,r)=>e<>>32-r,q7e=(t,e,r)=>e<>>64-r,V7e=(t,e,r)=>t<>>64-r;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Y7e=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),EC=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Oc=(t,e)=>t<<32-e|t>>>e,aU=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,K7e=t=>t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255;function sU(t){for(let e=0;et().update(WN(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}const PZ=[],RZ=[],DZ=[],Q7e=BigInt(0),O2=BigInt(1),Z7e=BigInt(2),X7e=BigInt(7),eEe=BigInt(256),tEe=BigInt(113);for(let t=0,e=O2,r=1,n=0;t<24;t++){[r,n]=[n,(2*r+3*n)%5],PZ.push(2*(5*n+r)),RZ.push((t+1)*(t+2)/2%64);let i=Q7e;for(let a=0;a<7;a++)e=(e<>X7e)*tEe)%eEe,e&Z7e&&(i^=O2<<(O2<r>32?q7e(t,e,r):H7e(t,e,r),lU=(t,e,r)=>r>32?V7e(t,e,r):G7e(t,e,r);function iEe(t,e=24){const r=new Uint32Array(10);for(let n=24-e;n<24;n++){for(let s=0;s<10;s++)r[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const o=(s+8)%10,l=(s+2)%10,c=r[l],u=r[l+1],f=oU(c,u,1)^r[o],h=lU(c,u,1)^r[o+1];for(let g=0;g<50;g+=10)t[s+g]^=f,t[s+g+1]^=h}let i=t[2],a=t[3];for(let s=0;s<24;s++){const o=RZ[s],l=oU(i,a,o),c=lU(i,a,o),u=PZ[s];i=t[u],a=t[u+1],t[u]=l,t[u+1]=c}for(let s=0;s<50;s+=10){for(let o=0;o<10;o++)r[o]=t[s+o];for(let o=0;o<10;o++)t[s+o]^=~r[(o+2)%10]&r[(o+4)%10]}t[0]^=rEe[n],t[1]^=nEe[n]}r.fill(0)}let aEe=class OZ extends jZ{constructor(e,r,n,i=!1,a=24){if(super(),this.blockLen=e,this.suffix=r,this.outputLen=n,this.enableXOF=i,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,nU(n),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Y7e(this.state)}keccak(){aU||sU(this.state32),iEe(this.state32,this.rounds),aU||sU(this.state32),this.posOut=0,this.pos=0}update(e){B5(this);const{blockLen:r,state:n}=this;e=WN(e);const i=e.length;for(let a=0;a=n&&this.keccak();const s=Math.min(n-this.posOut,a-i);e.set(r.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return nU(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(LZ(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:r,suffix:n,outputLen:i,rounds:a,enableXOF:s}=this;return e||(e=new OZ(r,n,i,s,a)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=a,e.suffix=n,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}};const sEe=(t,e,r)=>$Z(()=>new aEe(e,t,r)),oEe=sEe(1,136,256/8);function ea(t,e){const r=e||"hex",n=oEe(wc(t,{strict:!1})?Im(t):t);return r==="bytes"?n:ur(n)}const lEe=t=>ea(Im(t));function cEe(t){return lEe(t)}function uEe(t){let e=!0,r="",n=0,i="",a=!1;for(let s=0;s{const e=typeof t=="string"?t:$xe(t);return uEe(e)};function FZ(t){return cEe(dEe(t))}const T9=FZ;class fs extends Qe{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class k9 extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const r=super.get(e);return super.has(e)&&r!==void 0&&(this.delete(e),super.set(e,r)),r}set(e,r){if(super.set(e,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const _C=new k9(8192);function $w(t,e){if(_C.has(`${t}.${e}`))return _C.get(`${t}.${e}`);const r=t.substring(2).toLowerCase(),n=ea(N0(r),"bytes"),i=r.split("");for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(n[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());const a=`0x${i.join("")}`;return _C.set(`${t}.${e}`,a),a}function HN(t,e){if(!Tn(t,{strict:!1}))throw new fs({address:t});return $w(t,e)}const fEe=/^0x[a-fA-F0-9]{40}$/,CC=new k9(8192);function Tn(t,e){const{strict:r=!0}=e??{},n=`${t}.${r}`;if(CC.has(n))return CC.get(n);const i=fEe.test(t)?t.toLowerCase()===t?!0:r?$w(t)===t:!0:!1;return CC.set(n,i),i}function Bd(t){return typeof t[0]=="string"?ju(t):hEe(t)}function hEe(t){let e=0;for(const i of t)e+=i.length;const r=new Uint8Array(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function ju(t){return`0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`}function Z0(t,e,r,{strict:n}={}){return wc(t,{strict:!1})?WZ(t,e,r,{strict:n}):zZ(t,e,r,{strict:n})}function UZ(t,e){if(typeof e=="number"&&e>0&&e>ai(t)-1)throw new MZ({offset:e,position:"start",size:ai(t)})}function BZ(t,e,r){if(typeof e=="number"&&typeof r=="number"&&ai(t)!==r-e)throw new MZ({offset:r,position:"end",size:ai(t)})}function zZ(t,e,r,{strict:n}={}){UZ(t,e);const i=t.slice(e,r);return n&&BZ(i,e,r),i}function WZ(t,e,r,{strict:n}={}){UZ(t,e);const i=`0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;return n&&BZ(i,e,r),i}const pEe=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,HZ=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function Mm(t,e){if(t.length!==e.length)throw new b7e({expectedLength:t.length,givenLength:e.length});const r=gEe({params:t,values:e}),n=qN(r);return n.length===0?"0x":n}function gEe({params:t,values:e}){const r=[];for(let n=0;n0?Bd([o,s]):o}}if(i)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:Bd(a.map(({encoded:s})=>s))}}function wEe(t,{param:e}){const[,r]=e.type.split("bytes"),n=ai(t);if(!r){let i=t;return n%32!==0&&(i=eh(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Bd([eh(lr(n,{size:32})),i])}}if(n!==Number.parseInt(r))throw new v7e({expectedSize:Number.parseInt(r),value:t});return{dynamic:!1,encoded:eh(t,{dir:"right"})}}function vEe(t){if(typeof t!="boolean")throw new Qe(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:eh(NZ(t))}}function bEe(t,{signed:e,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(e?1n:0n))-1n,i=e?-n-1n:0n;if(t>n||ti))}}function VN(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}const N9=t=>Z0(FZ(t),0,4);function Pw(t){const{abi:e,args:r=[],name:n}=t,i=wc(n,{strict:!1}),a=e.filter(o=>i?o.type==="function"?N9(o)===n:o.type==="event"?T9(o)===n:!1:"name"in o&&o.name===n);if(a.length===0)return;if(a.length===1)return a[0];let s;for(const o of a){if(!("inputs"in o))continue;if(!r||r.length===0){if(!o.inputs||o.inputs.length===0)return o;continue}if(!o.inputs||o.inputs.length===0||o.inputs.length!==r.length)continue;if(r.every((c,u)=>{const f="inputs"in o&&o.inputs[u];return f?rM(c,f):!1})){if(s&&"inputs"in s&&s.inputs){const c=GZ(o.inputs,s.inputs,r);if(c)throw new C7e({abiItem:o,type:c[0]},{abiItem:s,type:c[1]})}s=o}}return s||a[0]}function rM(t,e){const r=typeof t,n=e.type;switch(n){case"address":return Tn(t,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in e?Object.values(e.components).every((i,a)=>rM(Object.values(t)[a],i)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||t instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(t)&&t.every(i=>rM(i,{...e,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function GZ(t,e,r){for(const n in t){const i=t[n],a=e[n];if(i.type==="tuple"&&a.type==="tuple"&&"components"in i&&"components"in a)return GZ(i.components,a.components,r[n]);const s=[i.type,a.type];if(s.includes("address")&&s.includes("bytes20")?!0:s.includes("address")&&s.includes("string")?Tn(r[n],{strict:!1}):s.includes("address")&&s.includes("bytes")?Tn(r[n],{strict:!1}):!1)return s}}const cU="/docs/contract/encodeEventTopics";function Rw(t){var l;const{abi:e,eventName:r,args:n}=t;let i=e[0];if(r){const c=Pw({abi:e,name:r});if(!c)throw new eU(r,{docsPath:cU});i=c}if(i.type!=="event")throw new eU(void 0,{docsPath:cU});const a=Iu(i),s=T9(a);let o=[];if(n&&"inputs"in i){const c=(l=i.inputs)==null?void 0:l.filter(f=>"indexed"in f&&f.indexed),u=Array.isArray(n)?n:Object.values(n).length>0?(c==null?void 0:c.map(f=>n[f.name]))??[]:[];u.length>0&&(o=(c==null?void 0:c.map((f,h)=>Array.isArray(u[h])?u[h].map((g,m)=>uU({param:f,value:u[h][m]})):u[h]?uU({param:f,value:u[h]}):null))??[])}return[s,...o]}function uU({param:t,value:e}){if(t.type==="string"||t.type==="bytes")return ea(Im(e));if(t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/))throw new k7e(t.type);return Mm([t],[e])}function L9(t,{method:e}){var n,i;const r={};return t.transport.type==="fallback"&&((i=(n=t.transport).onResponse)==null||i.call(n,({method:a,response:s,status:o,transport:l})=>{o==="success"&&e===a&&(r[s]=l.request)})),a=>r[a]||t.request}async function qZ(t,e){const{address:r,abi:n,args:i,eventName:a,fromBlock:s,strict:o,toBlock:l}=e,c=L9(t,{method:"eth_newFilter"}),u=a?Rw({abi:n,args:i,eventName:a}):void 0,f=await t.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof s=="bigint"?lr(s):s,toBlock:typeof l=="bigint"?lr(l):l,topics:u}]});return{abi:n,args:i,eventName:a,id:f,request:c(f),strict:!!o,type:"event"}}function ms(t){return typeof t=="string"?{address:t,type:"json-rpc"}:t}const dU="/docs/contract/encodeFunctionData";function _Ee(t){const{abi:e,args:r,functionName:n}=t;let i=e[0];if(n){const a=Pw({abi:e,args:r,name:n});if(!a)throw new U5(n,{docsPath:dU});i=a}if(i.type!=="function")throw new U5(void 0,{docsPath:dU});return{abi:[i],functionName:N9(Iu(i))}}function Mc(t){const{args:e}=t,{abi:r,functionName:n}=(()=>{var o;return t.abi.length===1&&((o=t.functionName)!=null&&o.startsWith("0x"))?t:_Ee(t)})(),i=r[0],a=n,s="inputs"in i&&i.inputs?Mm(i.inputs,e??[]):void 0;return ju([a,s??"0x"])}const VZ={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},CEe={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},SEe={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};class fU extends Qe{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class YZ extends Qe{constructor({length:e,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`,{name:"PositionOutOfBoundsError"})}}class AEe extends Qe{constructor({count:e,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`,{name:"RecursiveReadLimitExceededError"})}}const IEe={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new AEe({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(t){if(t<0||t>this.bytes.length-1)throw new YZ({length:this.bytes.length,position:t})},decrementPosition(t){if(t<0)throw new fU({offset:t});const e=this.position-t;this.assertPosition(e),this.position=e},getReadCount(t){return this.positionReadCount.get(t||this.position)||0},incrementPosition(t){if(t<0)throw new fU({offset:t});const e=this.position+t;this.assertPosition(e),this.position=e},inspectByte(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectBytes(t,e){const r=e??this.position;return this.assertPosition(r+t-1),this.bytes.subarray(r,r+t)},inspectUint8(t){const e=t??this.position;return this.assertPosition(e),this.bytes[e]},inspectUint16(t){const e=t??this.position;return this.assertPosition(e+1),this.dataView.getUint16(e)},inspectUint24(t){const e=t??this.position;return this.assertPosition(e+2),(this.dataView.getUint16(e)<<8)+this.dataView.getUint8(e+2)},inspectUint32(t){const e=t??this.position;return this.assertPosition(e+3),this.dataView.getUint32(e)},pushByte(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushBytes(t){this.assertPosition(this.position+t.length-1),this.bytes.set(t,this.position),this.position+=t.length},pushUint8(t){this.assertPosition(this.position),this.bytes[this.position]=t,this.position++},pushUint16(t){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,t),this.position+=2},pushUint24(t){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,t>>8),this.dataView.setUint8(this.position+2,t&255),this.position+=3},pushUint32(t){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,t),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const t=this.inspectByte();return this.position++,t},readBytes(t,e){this.assertReadLimit(),this._touch();const r=this.inspectBytes(t);return this.position+=e??t,r},readUint8(){this.assertReadLimit(),this._touch();const t=this.inspectUint8();return this.position+=1,t},readUint16(){this.assertReadLimit(),this._touch();const t=this.inspectUint16();return this.position+=2,t},readUint24(){this.assertReadLimit(),this._touch();const t=this.inspectUint24();return this.position+=3,t},readUint32(){this.assertReadLimit(),this._touch();const t=this.inspectUint32();return this.position+=4,t},get remaining(){return this.bytes.length-this.position},setPosition(t){const e=this.position;return this.assertPosition(t),this.position=t,()=>this.position=e},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const t=this.getReadCount();this.positionReadCount.set(this.position,t+1),t>0&&this.recursiveReadCount++}};function YN(t,{recursiveReadLimit:e=8192}={}){const r=Object.create(IEe);return r.bytes=t,r.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=e,r}function MEe(t,e={}){typeof e.size<"u"&&Ic(t,{size:e.size});const r=Si(t,e);return vo(r,e)}function TEe(t,e={}){let r=t;if(typeof e.size<"u"&&(Ic(r,{size:e.size}),r=fc(r)),r.length>1||r[0]>1)throw new L7e(r);return!!r[0]}function Nd(t,e={}){typeof e.size<"u"&&Ic(t,{size:e.size});const r=Si(t,e);return Mu(r,e)}function kEe(t,e={}){let r=t;return typeof e.size<"u"&&(Ic(r,{size:e.size}),r=fc(r,{dir:"right"})),new TextDecoder().decode(r)}function Tm(t,e){const r=typeof e=="string"?vc(e):e,n=YN(r);if(ai(r)===0&&t.length>0)throw new jw;if(ai(e)&&ai(e)<32)throw new SZ({data:typeof e=="string"?e:Si(e),params:t,size:ai(e)});let i=0;const a=[];for(let s=0;s48?MEe(i,{signed:r}):Nd(i,{signed:r}),32]}function REe(t,e,{staticPosition:r}){const n=e.components.length===0||e.components.some(({name:s})=>!s),i=n?[]:{};let a=0;if(T3(e)){const s=Nd(t.readBytes(nM)),o=r+s;for(let l=0;ls.type==="error"&&n===N9(Iu(s)));if(!a)throw new AZ(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:a,args:"inputs"in a&&a.inputs&&a.inputs.length>0?Tm(a.inputs,Z0(r,4)):void 0,errorName:a.name}}const ia=(t,e,r)=>JSON.stringify(t,(n,i)=>typeof i=="bigint"?i.toString():i,r);function KZ({abiItem:t,args:e,includeFunctionName:r=!0,includeName:n=!1}){if("name"in t&&"inputs"in t&&t.inputs)return`${r?t.name:""}(${t.inputs.map((i,a)=>`${n&&i.name?`${i.name}: `:""}${typeof e[a]=="object"?ia(e[a]):e[a]}`).join(", ")})`}const JZ={gwei:9,wei:18},FEe={ether:-9,wei:9};function j9(t,e){let r=t.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(e,"0");let[i,a]=[r.slice(0,r.length-e),r.slice(r.length-e)];return a=a.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${a?`.${a}`:""}`}function Dw(t,e="wei"){return j9(t,JZ[e])}function Gs(t,e="wei"){return j9(t,FEe[e])}class UEe extends Qe{constructor({address:e}){super(`State for account "${e}" is set multiple times.`,{name:"AccountStateConflictError"})}}class BEe extends Qe{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function pU(t){return t.reduce((e,{slot:r,value:n})=>`${e} ${r}: ${n} +`,"")}function zEe(t){return t.reduce((e,{address:r,...n})=>{let i=`${e} ${r}: `;return n.nonce&&(i+=` nonce: ${n.nonce} `),n.balance&&(i+=` balance: ${n.balance} `),n.code&&(i+=` code: ${n.code} `),n.state&&(i+=` state: -`,i+=tU(n.state)),n.stateDiff&&(i+=` stateDiff: -`,i+=tU(n.stateDiff)),i},` State Override: -`).slice(0,-1)}function kw(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` -`)}class wEe extends Ze{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` -`),{name:"FeeConflictError"})}}class vEe extends Ze{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class bEe extends Ze{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",kw(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class xEe extends Ze{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class EEe extends Ze{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=kw({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof h<"u"&&`${Tw(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${zs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${zs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${zs(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class TQ extends Ze{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){let s="Transaction";n&&a!==void 0&&(s=`Transaction at block time "${n}" at index "${a}"`),e&&a!==void 0&&(s=`Transaction at block hash "${e}" at index "${a}"`),r&&a!==void 0&&(s=`Transaction at block number "${r}" at index "${a}"`),i&&(s=`Transaction with hash "${i}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}}class kQ extends Ze{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class _Ee extends Ze{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const CEe=t=>t,ON=t=>t;class NQ extends Ze{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,stateOverride:g}){var _;const m=r?ps(r):void 0;let w=kw({from:m==null?void 0:m.address,to:f,value:typeof h<"u"&&`${Tw(h)} ${((_=i==null?void 0:i.nativeCurrency)==null?void 0:_.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${zs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${zs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${zs(c)} gwei`,nonce:u});g&&(w+=` -${yEe(g)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class SEe extends Ze{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:a,functionName:s,sender:o}){const l=Iw({abi:r,args:n,name:s}),c=l?IQ({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=l?Eu(l,{includeName:!0}):void 0,f=kw({address:i&&CEe(i),function:u,args:c&&c!=="()"&&`${[...Array((s==null?void 0:s.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=s,this.sender=o}}class VI extends Ze{constructor({abi:e,data:r,functionName:n,message:i}){let a,s,o,l;if(r&&r!=="0x")try{s=hEe({abi:e,data:r});const{abiItem:u,errorName:f,args:h}=s;if(f==="Error")l=h[0];else if(f==="Panic"){const[g]=h;l=SQ[g]}else{const g=u?Eu(u,{includeName:!0}):void 0,m=u&&h?IQ({abiItem:u,args:h,includeFunctionName:!1,includeName:!1}):void 0;o=[g?`Error: ${g}`:"",m&&m!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(u){a=u}else i&&(l=i);let c;a instanceof iQ&&(c=a.signature,o=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(l&&l!=="execution reverted"||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,l||c].join(` -`):`The contract function "${n}" reverted.`,{cause:a,metaMessages:o,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.reason=l,this.signature=c}}class AEe extends Ze{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class IEe extends Ze{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class S9 extends Ze{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class My extends Ze{constructor({body:e,cause:r,details:n,headers:i,status:a,url:s}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[a&&`Status: ${a}`,`URL: ${ON(s)}`,e&&`Request body: ${na(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=a,this.url=s}}class FN extends Ze{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${ON(n)}`,`Request body: ${na(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data}}class rU extends Ze{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${ON(r)}`,`Request body: ${na(e)}`],name:"TimeoutError"})}}const MEe=-1;class Js extends Ze{constructor(e,{code:r,docsPath:n,metaMessages:i,name:a,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof FN?e.code:r??MEe}}class Em extends Js{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class x3 extends Js{constructor(e){super(e,{code:x3.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(x3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class E3 extends Js{constructor(e){super(e,{code:E3.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(E3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class _3 extends Js{constructor(e,{method:r}={}){super(e,{code:_3.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(_3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class C3 extends Js{constructor(e){super(e,{code:C3.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(C3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class q0 extends Js{constructor(e){super(e,{code:q0.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(q0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class V0 extends Js{constructor(e){super(e,{code:V0.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(V0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class S3 extends Js{constructor(e){super(e,{code:S3.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(S3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class A3 extends Js{constructor(e){super(e,{code:A3.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(A3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class I3 extends Js{constructor(e){super(e,{code:I3.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(I3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class M3 extends Js{constructor(e,{method:r}={}){super(e,{code:M3.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(M3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Ng extends Js{constructor(e){super(e,{code:Ng.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Ng,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class T3 extends Js{constructor(e){super(e,{code:T3.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(T3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class cg extends Em{constructor(e){super(e,{code:cg.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(cg,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class k3 extends Em{constructor(e){super(e,{code:k3.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(k3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class N3 extends Em{constructor(e,{method:r}={}){super(e,{code:N3.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(N3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class L3 extends Em{constructor(e){super(e,{code:L3.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(L3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class j3 extends Em{constructor(e){super(e,{code:j3.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(j3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class $3 extends Em{constructor(e){super(e,{code:$3.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty($3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class TEe extends Js{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const kEe=3;function Y0(t,{abi:e,address:r,args:n,docsPath:i,functionName:a,sender:s}){const o=t instanceof S9?t:t instanceof Ze?t.walk(m=>"data"in m)||t.walk():{},{code:l,data:c,details:u,message:f,shortMessage:h}=o,g=t instanceof Sw?new AEe({functionName:a}):[kEe,q0.code].includes(l)&&(c||u||f||h)?new VI({abi:e,data:typeof c=="object"?c.data:c,functionName:a,message:o instanceof FN?u:h??f}):t;return new SEe(g,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:a,sender:s})}function NEe(t){const e=Xi(`0x${t.substring(4)}`).substring(26);return Aw(`0x${e}`)}async function LEe({hash:t,signature:e}){const r=pc(t)?t:ur(t),{secp256k1:n}=await Ws(async()=>{const{secp256k1:s}=await Promise.resolve().then(()=>QSe);return{secp256k1:s}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:u,v:f,yParity:h}=e,g=Number(h??f),m=nU(g);return new n.Signature(yo(c),yo(u)).addRecoveryBit(m)}const s=pc(e)?e:ur(e),o=_u(`0x${s.slice(130)}`),l=nU(o);return n.Signature.fromCompact(s.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function nU(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function LQ({hash:t,signature:e}){return NEe(await LEe({hash:t,signature:e}))}function rh(t,e="hex"){const r=jQ(t),n=DN(new Uint8Array(r.length));return r.encode(n),e==="hex"?Si(n.bytes):n.bytes}function jQ(t){return Array.isArray(t)?jEe(t.map(e=>jQ(e))):$Ee(t)}function jEe(t){const e=t.reduce((i,a)=>i+a.length,0),r=$Q(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:a}of t)a(i)}}}function $Ee(t){const e=typeof t=="string"?gc(t):t,r=$Q(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function $Q(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new Ze("Length is too large.")}function PEe(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,a=Xi(Mu(["0x05",rh([e?lr(e):"0x",r,n?lr(n):"0x"])]));return i==="bytes"?gc(a):a}async function PQ(t){const{authorization:e,signature:r}=t;return LQ({hash:PEe(e),signature:r??e})}class REe extends Ze{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=kw({from:r==null?void 0:r.address,to:f,value:typeof h<"u"&&`${Tw(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${zs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${zs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${zs(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class Gp extends Ze{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(Gp,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Gp,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class K0 extends Ze{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${zs(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(K0,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class YI extends Ze{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${zs(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(YI,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class KI extends Ze{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(KI,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class JI extends Ze{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(JI,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class ZI extends Ze{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(ZI,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class QI extends Ze{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(QI,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class XI extends Ze{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(XI,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class eM extends Ze{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(eM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class tM extends Ze{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(tM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class P3 extends Ze{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${zs(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${zs(n)} gwei`:""}).`].join(` -`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(P3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Nw extends Ze{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function A9(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Ze?t.walk(i=>(i==null?void 0:i.code)===Gp.code):t;return n instanceof Ze?new Gp({cause:t,message:n.details}):Gp.nodeMessage.test(r)?new Gp({cause:t,message:t.details}):K0.nodeMessage.test(r)?new K0({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):YI.nodeMessage.test(r)?new YI({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):KI.nodeMessage.test(r)?new KI({cause:t,nonce:e==null?void 0:e.nonce}):JI.nodeMessage.test(r)?new JI({cause:t,nonce:e==null?void 0:e.nonce}):ZI.nodeMessage.test(r)?new ZI({cause:t,nonce:e==null?void 0:e.nonce}):QI.nodeMessage.test(r)?new QI({cause:t}):XI.nodeMessage.test(r)?new XI({cause:t,gas:e==null?void 0:e.gas}):eM.nodeMessage.test(r)?new eM({cause:t,gas:e==null?void 0:e.gas}):tM.nodeMessage.test(r)?new tM({cause:t}):P3.nodeMessage.test(r)?new P3({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Nw({cause:t})}function DEe(t,{docsPath:e,...r}){const n=(()=>{const i=A9(t,r);return i instanceof Nw?t:i})();return new REe(n,{docsPath:e,...r})}function I9(t,{format:e}){if(!e)return{};const r={};function n(a){const s=Object.keys(a);for(const o of s)o in t&&(r[o]=t[o]),a[o]&&typeof a[o]=="object"&&!Array.isArray(a[o])&&n(a[o])}const i=e(t||{});return n(i),r}function UN(t,e){return({exclude:r,format:n})=>({exclude:r,format:i=>{const a=e(i);if(r)for(const s of r)delete a[s];return{...a,...n(i)}},type:t})}const OEe={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function _m(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=FEe(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(r=>Si(r)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=lr(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=lr(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=lr(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=lr(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=lr(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=lr(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=OEe[t.type]),typeof t.value<"u"&&(e.value=lr(t.value)),e}function FEe(t){return t.map(e=>({address:e.contractAddress,r:e.r,s:e.s,chainId:lr(e.chainId),nonce:lr(e.nonce),...typeof e.yParity<"u"?{yParity:lr(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:lr(e.v)}:{}}))}function iU(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new zF({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new zF({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function UEe(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:a}=t,s={};if(a!==void 0&&(s.code=a),e!==void 0&&(s.balance=lr(e)),r!==void 0&&(s.nonce=lr(r)),n!==void 0&&(s.state=iU(n)),i!==void 0){if(s.state)throw new mEe;s.stateDiff=iU(i)}return s}function BN(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!Tn(r,{strict:!1}))throw new us({address:r});if(e[r])throw new gEe({address:r});e[r]=UEe(n)}return e}const M9=2n**256n-1n;function p1(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:a}=t,s=e?ps(e):void 0;if(s&&!Tn(s.address))throw new us({address:s.address});if(a&&!Tn(a))throw new us({address:a});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new wEe;if(n&&n>M9)throw new K0({maxFeePerGas:n});if(i&&n&&i>n)throw new P3({maxFeePerGas:n,maxPriorityFeePerGas:i})}class BEe extends Ze{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class zN extends Ze{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class zEe extends Ze{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${zs(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class RQ extends Ze{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const DQ={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function T9(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?_u(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?_u(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?DQ[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(e.authorizationList=HEe(t.authorizationList)),e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}const WEe=UN("transaction",T9);function HEe(t){return t.map(e=>({contractAddress:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function WN(t){const e=(t.transactions??[]).map(r=>typeof r=="string"?r:T9(r));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const GEe=UN("block",WN);async function ru(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,h;const a=n??"latest",s=i??!1,o=r!==void 0?lr(r):void 0;let l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):l=await t.request({method:"eth_getBlockByNumber",params:[o||a,s]},{dedupe:!!o}),!l)throw new RQ({blockHash:e,blockNumber:r});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:h.format)||WN)(l)}async function HN(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function qEe(t,e){return OQ(t,e)}async function OQ(t,e){var a,s;const{block:r,chain:n=t.chain,request:i}=e||{};try{const o=((a=n==null?void 0:n.fees)==null?void 0:a.maxPriorityFeePerGas)??((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee);if(typeof o=="function"){const c=r||await nr(t,ru,"getBlock")({}),u=await o({block:c,client:t,request:i});if(u===null)throw new Error;return u}if(typeof o<"u")return o;const l=await t.request({method:"eth_maxPriorityFeePerGas"});return yo(l)}catch{const[o,l]=await Promise.all([r?Promise.resolve(r):nr(t,ru,"getBlock")({}),nr(t,HN,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new zN;const c=l-o.baseFeePerGas;return c<0n?0n:c}}async function VEe(t,e){return rM(t,e)}async function rM(t,e){var h,g;const{block:r,chain:n=t.chain,request:i,type:a="eip1559"}=e||{},s=await(async()=>{var m,w;return typeof((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((w=n==null?void 0:n.fees)==null?void 0:w.baseFeeMultiplier)??1.2})();if(s<1)throw new BEe;const l=10**(((h=s.toString().split(".")[1])==null?void 0:h.length)??0),c=m=>m*BigInt(Math.ceil(s*l))/BigInt(l),u=r||await nr(t,ru,"getBlock")({});if(typeof((g=n==null?void 0:n.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const m=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:c,request:i,type:a});if(m!==null)return m}if(a==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new zN;const m=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await OQ(t,{block:u,chain:n,request:i}),w=c(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??w+m,maxPriorityFeePerGas:m}}return{gasPrice:(i==null?void 0:i.gasPrice)??c(await nr(t,HN,"getGasPrice")({}))}}async function FQ(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?lr(n):r]},{dedupe:!!n});return _u(i)}function GN(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(a=>gc(a)):t.blobs,i=[];for(const a of n)i.push(Uint8Array.from(e.blobToKzgCommitment(a)));return r==="bytes"?i:i.map(a=>Si(a))}function qN(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(s=>gc(s)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(s=>gc(s)):t.commitments,a=[];for(let s=0;sSi(s))}function YEe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),l=n?4:0,c=n?0:4;t.setUint32(e+l,s,n),t.setUint32(e+c,o,n)}const KEe=(t,e,r)=>t&e^~t&r,JEe=(t,e,r)=>t&e^t&r^e&r;let ZEe=class extends dQ{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=hC(this.buffer)}update(e){L5(this);const{view:r,buffer:n,blockLen:i}=this;e=LN(e);const a=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=$c(g,17)^$c(g,19)^g>>>10;gf[f]=w+gf[f-7]+m+gf[f-16]|0}let{A:n,B:i,C:a,D:s,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=$c(o,6)^$c(o,11)^$c(o,25),g=u+h+KEe(o,l,c)+QEe[f]+gf[f]|0,w=($c(n,2)^$c(n,13)^$c(n,22))+JEe(n,i,a)|0;u=c,c=l,l=o,o=s+g|0,s=a,a=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,s,o,l,c,u)}roundClean(){gf.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const e_e=fQ(()=>new XEe);function t_e(t,e){return e_e(pc(t,{strict:!1})?vm(t):t)}function r_e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=t_e(e);return i.set([r],0),n==="bytes"?i:Si(i)}function UQ(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const a of e)i.push(r_e({commitment:a,to:n,version:r}));return i}const aU=6,BQ=32,VN=4096,zQ=BQ*VN,sU=zQ*aU-1-1*VN*aU,WQ=1;class n_e extends Ze{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class HQ extends Ze{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class i_e extends Ze{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class a_e extends Ze{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${WQ}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function s_e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?gc(t.data):t.data,n=ai(r);if(!n)throw new HQ;if(n>sU)throw new n_e({maxSize:sU,size:n});const i=[];let a=!0,s=0;for(;a;){const o=DN(new Uint8Array(zQ));let l=0;for(;lo.bytes):i.map(o=>Si(o.bytes))}function GQ(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??s_e({data:e,to:n}),a=t.commitments??GN({blobs:i,kzg:r,to:n}),s=t.proofs??qN({blobs:i,commitments:a,kzg:r,to:n}),o=[];for(let l=0;l"u"&&f)if(l){const v=await _();h.nonce=await l.consume({address:f.address,chainId:v,client:t})}else h.nonce=await nr(t,FQ,"getTransactionCount")({address:f.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{h.type=qQ(h)}catch{const v=await m();h.type=typeof(v==null?void 0:v.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(h.type!=="legacy"&&h.type!=="eip2930"){if(typeof h.maxFeePerGas>"u"||typeof h.maxPriorityFeePerGas>"u"){const v=await m(),{maxFeePerGas:b,maxPriorityFeePerGas:A}=await rM(t,{block:v,chain:i,request:h});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(h.gas=await nr(t,YN,"estimateGas")({...h,account:f&&{address:f.address,type:"json-rpc"}})),p1(h),delete h.parameters,h}async function YQ(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?lr(r):void 0,a=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(a)}async function YN(t,e){var i,a,s;const{account:r=t.account}=e,n=r?ps(r):void 0;try{let x=function(L){const{block:O,request:P,rpcStateOverride:R}=L;return t.request({method:"eth_estimateGas",params:R?[P,O??"latest",R]:O?[P,O]:[P]})};const{accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,blockNumber:f,blockTag:h,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:_,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:A,value:S,stateOverride:j,...U}=await k9(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),B=(f?lr(f):void 0)||h,V=BN(j),se=await(async()=>{if(U.to)return U.to;if(l&&l.length>0)return await PQ({authorization:l[0]}).catch(()=>{throw new Ze("`to` is required. Could not infer from `authorizationList`")})})();p1(e);const Y=(s=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionRequest)==null?void 0:s.format,k=(Y||_m)({...I9(U,{format:Y}),from:n==null?void 0:n.address,accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:_,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:A,to:se,value:S});let E=BigInt(await x({block:B,request:k,rpcStateOverride:V}));if(l){const L=await YQ(t,{address:k.from}),O=await Promise.all(l.map(async P=>{const{contractAddress:R}=P,M=await x({block:B,request:{authorizationList:void 0,data:g,from:n==null?void 0:n.address,to:R,value:lr(L)},rpcStateOverride:V}).catch(()=>100000n);return 2n*BigInt(M)}));E+=O.reduce((P,R)=>P+R,0n)}return E}catch(o){throw DEe(o,{...e,account:n,chain:t.chain})}}async function o_e(t,e){const{abi:r,address:n,args:i,functionName:a,dataSuffix:s,...o}=e,l=Cc({abi:r,args:i,functionName:a});try{return await nr(t,YN,"estimateGas")({data:`${l}${s?s.replace("0x",""):""}`,to:n,...o})}catch(c){const u=o.account?ps(o.account):void 0;throw Y0(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:u==null?void 0:u.address})}}function KN(t,e){if(!Tn(t,{strict:!1}))throw new us({address:t});if(!Tn(e,{strict:!1}))throw new us({address:e});return t.toLowerCase()===e.toLowerCase()}const oU="/docs/contract/decodeEventLog";function JN(t){const{abi:e,data:r,strict:n,topics:i}=t,a=n??!0,[s,...o]=i;if(!s)throw new Jxe({docsPath:oU});const l=e.length===1?e[0]:e.find(w=>w.type==="event"&&s===b9(Eu(w)));if(!(l&&"name"in l)||l.type!=="event")throw new aQ(s,{docsPath:oU});const{name:c,inputs:u}=l,f=u==null?void 0:u.some(w=>!("name"in w&&w.name));let h=f?[]:{};const g=u.filter(w=>"indexed"in w&&w.indexed);for(let w=0;w!("indexed"in w&&w.indexed));if(m.length>0){if(r&&r!=="0x")try{const w=xm(m,r);if(w)if(f)h=[...h,...w];else for(let _=0;_0?h:void 0}}function l_e({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(xm([t],e)||[])[0]}function ZN(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,a=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})();return n.map(s=>{var o;try{const l=e.find(u=>u.type==="event"&&s.topics[0]===b9(u));if(!l)return null;const c=JN({...s,abi:[l],strict:i});return a&&!a.includes(c.eventName)||!c_e({args:c.args,inputs:l.inputs,matchArgs:r})?null:{...c,...s}}catch(l){let c,u;if(l instanceof aQ)return null;if(l instanceof v3||l instanceof v9){if(i)return null;c=l.abiItem.name,u=(o=l.abiItem.inputs)==null?void 0:o.some(f=>!("name"in f&&f.name))}return{...s,args:u?[]:{},eventName:c}}}).filter(Boolean)}function c_e(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(a,s,o){try{return a.type==="address"?KN(s,o):a.type==="string"||a.type==="bytes"?Xi(vm(s))===o:s===o}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((a,s)=>{if(a==null)return!0;const o=r[s];return o?(Array.isArray(a)?a:[a]).some(c=>i(o,c,e[s])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([a,s])=>{if(s==null)return!0;const o=r.find(c=>c.name===a);return o?(Array.isArray(s)?s:[s]).some(c=>i(o,c,e[a])):!1}):!1}function Rd(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}async function QN(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:a,events:s,args:o,strict:l}={}){const c=l??!1,u=s??(a?[a]:void 0);let f=[];u&&(f=[u.flatMap(w=>Mw({abi:[w],eventName:w.name,args:s?void 0:o}))],a&&(f=f[0]));let h;r?h=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):h=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?lr(n):n,toBlock:typeof i=="bigint"?lr(i):i}]});const g=h.map(m=>Rd(m));return u?ZN({abi:u,args:o,logs:g,strict:c}):g}async function KQ(t,e){const{abi:r,address:n,args:i,blockHash:a,eventName:s,fromBlock:o,toBlock:l,strict:c}=e,u=s?Iw({abi:r,name:s}):void 0,f=u?void 0:r.filter(h=>h.type==="event");return nr(t,QN,"getLogs")({address:n,args:i,blockHash:a,event:u,events:f,fromBlock:o,toBlock:l,strict:c})}const mC="/docs/contract/decodeFunctionResult";function g1(t){const{abi:e,args:r,functionName:n,data:i}=t;let a=e[0];if(n){const o=Iw({abi:e,args:r,name:n});if(!o)throw new N5(n,{docsPath:mC});a=o}if(a.type!=="function")throw new N5(void 0,{docsPath:mC});if(!a.outputs)throw new Zxe(a.name,{docsPath:mC});const s=xm(a.outputs,i);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}const nM=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],JQ=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],ZQ=[...JQ,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],u_e=[...JQ,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],lU=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],cU=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],uU=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],d_e="0x82ad56cb",f_e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",h_e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",p_e="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";class iM extends Ze{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class g_e extends Ze{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class m_e extends Ze{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`),{name:"ChainNotFoundError"})}}class QQ extends Ze{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class N9 extends Ze{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const yC="/docs/contract/encodeDeployData";function L9(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(s=>"type"in s&&s.type==="constructor");if(!i)throw new qxe({docsPath:yC});if(!("inputs"in i))throw new UF({docsPath:yC});if(!i.inputs||i.inputs.length===0)throw new UF({docsPath:yC});const a=bm(i.inputs,r);return Mu([n,a])}function Cm({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new iM({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new iM({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function XQ(t,{docsPath:e,...r}){const n=(()=>{const i=A9(t,r);return i instanceof Nw?t:i})();return new NQ(n,{docsPath:e,...r})}function eX(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const wC=new Map;function tX({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const a=async()=>{const u=l();s();const f=u.map(({args:h})=>h);f.length!==0&&t(f).then(h=>{i&&Array.isArray(h)&&h.sort(i);for(let g=0;g{for(let g=0;gwC.delete(e),o=()=>l().map(({args:u})=>u),l=()=>wC.get(e)||[],c=u=>wC.set(e,[...l(),u]);return{flush:s,async schedule(u){const{promise:f,resolve:h,reject:g}=eX();return(r==null?void 0:r([...o(),u]))&&a(),l().length>0?(c({args:u,resolve:h,reject:g}),f):(c({args:u,resolve:h,reject:g}),setTimeout(a,n),f)}}}async function j9(t,e){var Y,N,k,x;const{account:r=t.account,batch:n=!!((Y=t.batch)!=null&&Y.multicall),blockNumber:i,blockTag:a="latest",accessList:s,blobs:o,code:l,data:c,factory:u,factoryData:f,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:_,nonce:v,to:b,value:A,stateOverride:S,...j}=e,U=r?ps(r):void 0;if(l&&(u||f))throw new Ze("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&b)throw new Ze("Cannot provide both `code` & `to` as parameters.");const I=l&&c,B=u&&f&&b&&c,V=I||B,se=I?v_e({code:l,data:c}):B?b_e({data:c,factory:u,factoryData:f,to:b}):c;try{p1(e);const L=(i?lr(i):void 0)||a,O=BN(S),P=(x=(k=(N=t.chain)==null?void 0:N.formatters)==null?void 0:k.transactionRequest)==null?void 0:x.format,M=(P||_m)({...I9(j,{format:P}),from:U==null?void 0:U.address,accessList:s,blobs:o,data:se,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:_,nonce:v,to:V?void 0:b,value:A});if(n&&y_e({request:M})&&!O)try{return await w_e(t,{...M,blockNumber:i,blockTag:a})}catch($){if(!($ instanceof QQ)&&!($ instanceof iM))throw $}const D=await t.request({method:"eth_call",params:O?[M,L,O]:[M,L]});return D==="0x"?{data:void 0}:{data:D}}catch(E){const L=x_e(E),{offchainLookup:O,offchainLookupSignature:P}=await Ws(async()=>{const{offchainLookup:R,offchainLookupSignature:M}=await import("./ccip-BMEFCFyc.js");return{offchainLookup:R,offchainLookupSignature:M}},[]);if(t.ccipRead!==!1&&(L==null?void 0:L.slice(0,10))===P&&b)return{data:await O(t,{data:L,to:b})};throw V&&(L==null?void 0:L.slice(0,10))==="0x101bb98d"?new IEe({factory:u}):XQ(E,{...e,account:U,chain:t.chain})}}function y_e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(d_e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function w_e(t,e){var w;const{batchSize:r=1024,wait:n=0}=typeof((w=t.batch)==null?void 0:w.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:a="latest",data:s,multicallAddress:o,to:l}=e;let c=o;if(!c){if(!t.chain)throw new QQ;c=Cm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?lr(i):void 0)||a,{schedule:h}=tX({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(_){return _.reduce((b,{data:A})=>b+(A.length-2),0)>r*2},fn:async _=>{const v=_.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),b=Cc({abi:nM,args:[v],functionName:"aggregate3"}),A=await t.request({method:"eth_call",params:[{data:b,to:c},f]});return g1({abi:nM,args:[v],functionName:"aggregate3",data:A||"0x"})}}),[{returnData:g,success:m}]=await h({data:s,to:l});if(!m)throw new S9({data:g});return g==="0x"?{data:void 0}:{data:g}}function v_e(t){const{code:e,data:r}=t;return L9({abi:y9(["constructor(bytes, bytes)"]),bytecode:f_e,args:[e,r]})}function b_e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return L9({abi:y9(["constructor(address, bytes, address, bytes)"]),bytecode:h_e,args:[i,e,r,n]})}function x_e(t){var r;if(!(t instanceof Ze))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(r=e.data)==null?void 0:r.data:e.data}async function Dd(t,e){const{abi:r,address:n,args:i,functionName:a,...s}=e,o=Cc({abi:r,args:i,functionName:a});try{const{data:l}=await nr(t,j9,"call")({...s,data:o,to:n});return g1({abi:r,args:i,functionName:a,data:l||"0x"})}catch(l){throw Y0(l,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:a})}}async function E_e(t,e){const{abi:r,address:n,args:i,dataSuffix:a,functionName:s,...o}=e,l=o.account?ps(o.account):t.account,c=Cc({abi:r,args:i,functionName:s});try{const{data:u}=await nr(t,j9,"call")({batch:!1,data:`${c}${a?a.replace("0x",""):""}`,to:n,...o,account:l}),f=g1({abi:r,args:i,functionName:s,data:u||"0x"}),h=r.filter(g=>"name"in g&&g.name===e.functionName);return{result:f,request:{abi:h,address:n,args:i,dataSuffix:a,functionName:s,...o,account:l}}}catch(u){throw Y0(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:l==null?void 0:l.address})}}const vC=new Map,dU=new Map;let __e=0;function nh(t,e,r){const n=++__e,i=()=>vC.get(t)||[],a=()=>{const u=i();vC.set(t,u.filter(f=>f.id!==n))},s=()=>{const u=i();if(!u.some(h=>h.id===n))return;const f=dU.get(t);u.length===1&&f&&f(),a()},o=i();if(vC.set(t,[...o,{id:n,fns:e}]),o&&o.length>0)return s;const l={};for(const u in e)l[u]=(...f)=>{var g,m;const h=i();if(h.length!==0)for(const w of h)(m=(g=w.fns)[u])==null||m.call(g,...f)};const c=r(l);return typeof c=="function"&&dU.set(t,c),s}async function aM(t){return new Promise(e=>setTimeout(e,t))}function jw(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const a=()=>i=!1;return(async()=>{let o;e&&(o=await t({unpoll:a}));const l=await(r==null?void 0:r(o))??n;await aM(l);const c=async()=>{i&&(await t({unpoll:a}),await aM(n),c())};c()})(),a}const C_e=new Map,S_e=new Map;function A_e(t){const e=(i,a)=>({clear:()=>a.delete(i),get:()=>a.get(i),set:s=>a.set(i,s)}),r=e(t,C_e),n=e(t,S_e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function I_e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=A_e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function $w(t,{cacheTime:e=t.cacheTime}={}){const r=await I_e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:M_e(t.uid),cacheTime:e});return BigInt(r)}async function $9(t,{filter:e}){const r="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;const i=n.map(a=>Rd(a));return!("abi"in e)||!e.abi?i:ZN({abi:e.abi,logs:i,strict:r})}async function P9(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function T_e(t,e){const{abi:r,address:n,args:i,batch:a=!0,eventName:s,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:f=t.pollingInterval,strict:h}=e;return(typeof u<"u"?u:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"))?(()=>{const _=h??!1,v=na(["watchContractEvent",n,i,a,t.uid,s,f,_,o]);return nh(v,{onLogs:c,onError:l},b=>{let A;o!==void 0&&(A=o-1n);let S,j=!1;const U=jw(async()=>{var I;if(!j){try{S=await nr(t,CQ,"createContractEventFilter")({abi:r,address:n,args:i,eventName:s,strict:_,fromBlock:o})}catch{}j=!0;return}try{let B;if(S)B=await nr(t,$9,"getFilterChanges")({filter:S});else{const V=await nr(t,$w,"getBlockNumber")({});A&&A{S&&await nr(t,P9,"uninstallFilter")({filter:S}),U()}})})():(()=>{const _=h??!1,v=na(["watchContractEvent",n,i,a,t.uid,s,f,_]);let b=!0,A=()=>b=!1;return nh(v,{onLogs:c,onError:l},S=>((async()=>{try{const j=(()=>{if(t.transport.type==="fallback"){const B=t.transport.transports.find(V=>V.config.type==="webSocket");return B?B.value:t.transport}return t.transport})(),U=s?Mw({abi:r,eventName:s,args:i}):[],{unsubscribe:I}=await j.subscribe({params:["logs",{address:n,topics:U}],onData(B){var se;if(!b)return;const V=B.result;try{const{eventName:Y,args:N}=JN({abi:r,data:V.data,topics:V.topics,strict:h}),k=Rd(V,{args:N,eventName:Y});S.onLogs([k])}catch(Y){let N,k;if(Y instanceof v3||Y instanceof v9){if(h)return;N=Y.abiItem.name,k=(se=Y.abiItem.inputs)==null?void 0:se.some(E=>!("name"in E&&E.name))}const x=Rd(V,{args:k?[]:{},eventName:N});S.onLogs([x])}},onError(B){var V;(V=S.onError)==null||V.call(S,B)}});A=I,b||A()}catch(j){l==null||l(j)}})(),()=>A()))})()}class Pw extends Ze{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` -`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class bC extends Ze{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function rX({chain:t,currentChainId:e}){if(!t)throw new m_e;if(e!==t.id)throw new g_e({chain:t,currentChainId:e})}function k_e(t,{docsPath:e,...r}){const n=(()=>{const i=A9(t,r);return i instanceof Nw?t:i})();return new EEe(n,{docsPath:e,...r})}async function XN(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const xC=new x9(128);async function eL(t,e){var v,b,A,S;const{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:a,blobs:s,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,value:m,...w}=e;if(typeof r>"u")throw new Pw({docsPath:"/docs/actions/wallet/sendTransaction"});const _=r?ps(r):null;try{p1(e);const j=await(async()=>{if(e.to)return e.to;if(a&&a.length>0)return await PQ({authorization:a[0]}).catch(()=>{throw new Ze("`to` is required. Could not infer from `authorizationList`.")})})();if((_==null?void 0:_.type)==="json-rpc"||_===null){let U;n!==null&&(U=await nr(t,Lw,"getChainId")({}),rX({currentChainId:U,chain:n}));const I=(A=(b=(v=t.chain)==null?void 0:v.formatters)==null?void 0:b.transactionRequest)==null?void 0:A.format,V=(I||_m)({...I9(w,{format:I}),accessList:i,authorizationList:a,blobs:s,chainId:U,data:o,from:_==null?void 0:_.address,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,to:j,value:m}),se=xC.get(t.uid),Y=se?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:Y,params:[V]},{retryCount:0})}catch(N){if(se===!1)throw N;const k=N;if(k.name==="InvalidInputRpcError"||k.name==="InvalidParamsRpcError"||k.name==="MethodNotFoundRpcError"||k.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[V]},{retryCount:0}).then(x=>(xC.set(t.uid,!0),x)).catch(x=>{const E=x;throw E.name==="MethodNotFoundRpcError"||E.name==="MethodNotSupportedRpcError"?(xC.set(t.uid,!1),k):E});throw k}}if((_==null?void 0:_.type)==="local"){const U=await nr(t,k9,"prepareTransactionRequest")({account:_,accessList:i,authorizationList:a,blobs:s,chain:n,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,nonceManager:_.nonceManager,parameters:[...VQ,"sidecars"],value:m,...w,to:j}),I=(S=n==null?void 0:n.serializers)==null?void 0:S.transaction,B=await _.signTransaction(U,{serializer:I});return await nr(t,XN,"sendRawTransaction")({serializedTransaction:B})}throw(_==null?void 0:_.type)==="smart"?new bC({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new bC({docsPath:"/docs/actions/wallet/sendTransaction",type:_==null?void 0:_.type})}catch(j){throw j instanceof bC?j:k_e(j,{...e,account:_,chain:e.chain||void 0})}}async function N_e(t,e){const{abi:r,account:n=t.account,address:i,args:a,dataSuffix:s,functionName:o,...l}=e;if(typeof n>"u")throw new Pw({docsPath:"/docs/contract/writeContract"});const c=n?ps(n):null,u=Cc({abi:r,args:a,functionName:o});try{return await nr(t,eL,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:i,account:c,...l})}catch(f){throw Y0(f,{abi:r,address:i,args:a,docsPath:"/docs/contract/writeContract",functionName:o,sender:c==null?void 0:c.address})}}class L_e extends Ze{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function j_e(t,e){const{address:r,factory:n,factoryData:i}=e;try{const[a,s,o,l,c,u,f]=await nr(t,Dd,"readContract")({abi:$_e,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:s,version:o,chainId:Number(l),verifyingContract:c,salt:u},extensions:f,fields:a}}catch(a){const s=a;throw s.name==="ContractFunctionExecutionError"&&s.cause.name==="ContractFunctionZeroDataError"?new L_e({address:r}):s}}const $_e=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function P_e(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:a,blockExplorers:s}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:lr(r),chainName:n,nativeCurrency:i,rpcUrls:a.default.http,blockExplorerUrls:s?Object.values(s).map(({url:o})=>o):void 0}]},{dedupe:!0,retryCount:0})}const sM=256;let c4=sM,u4;function nX(t=11){if(!u4||c4+t>sM*2){u4="",c4=0;for(let e=0;e{const b=v(_);for(const S in m)delete b[S];const A={..._,...b};return Object.assign(A,{extend:w(A)})}}return Object.assign(m,{extend:w(m)})}const d4=new x9(8192);function R_e(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(d4.get(r))return d4.get(r);const n=t().finally(()=>d4.delete(r));return d4.set(r,n),n}function oM(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,a)=>{const s=async({count:o=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:o,error:c}):e;u&&await aM(u),s({count:o+1})};try{const c=await t();i(c)}catch(c){if(o{const{dedupe:i=!1,retryDelay:a=150,retryCount:s=3,uid:o}={...e,...n},l=i?Xi(kg(`${o}.${na(r)}`)):void 0;return R_e(()=>oM(async()=>{try{return await t(r)}catch(c){const u=c;switch(u.code){case x3.code:throw new x3(u);case E3.code:throw new E3(u);case _3.code:throw new _3(u,{method:r.method});case C3.code:throw new C3(u);case q0.code:throw new q0(u);case V0.code:throw new V0(u);case S3.code:throw new S3(u);case A3.code:throw new A3(u);case I3.code:throw new I3(u);case M3.code:throw new M3(u,{method:r.method});case Ng.code:throw new Ng(u);case T3.code:throw new T3(u);case cg.code:throw new cg(u);case k3.code:throw new k3(u);case N3.code:throw new N3(u);case L3.code:throw new L3(u);case j3.code:throw new j3(u);case $3.code:throw new $3(u);case 5e3:throw new cg(u);default:throw c instanceof Ze?c:new TEe(u)}}},{delay:({count:c,error:u})=>{var f;if(u&&u instanceof My){const h=(f=u==null?void 0:u.headers)==null?void 0:f.get("Retry-After");if(h!=null&&h.match(/\d/))return Number.parseInt(h)*1e3}return~~(1<O_e(c)}),{enabled:i,id:l})}}function O_e(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Ng.code||t.code===q0.code:t instanceof My&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function aX({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:a,type:s},o){const l=nX();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:a,type:s},request:D_e(r,{retryCount:n,retryDelay:i,uid:l}),value:o}}function sX(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:a})=>aX({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??a,retryDelay:i,type:"custom"})}class F_e extends Ze{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function U_e(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,a)=>{(async()=>{let s;try{const o=new AbortController;r>0&&(s=setTimeout(()=>{n?o.abort():a(e)},r)),i(await t({signal:(o==null?void 0:o.signal)||null}))}catch(o){(o==null?void 0:o.name)==="AbortError"&&a(e),a(o)}finally{clearTimeout(s)}})()})}function B_e(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const fU=B_e();function z_e(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:a=e.onResponse,timeout:s=e.timeout??1e4}=r,o={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:c,signal:u}=o;try{const h=await U_e(async({signal:m})=>{const w={...o,body:Array.isArray(n)?na(n.map(A=>({jsonrpc:"2.0",id:A.id??fU.take(),...A}))):na({jsonrpc:"2.0",id:n.id??fU.take(),...n}),headers:{"Content-Type":"application/json",...l},method:c||"POST",signal:u||(s>0?m:null)},_=new Request(t,w),v=await(i==null?void 0:i(_,w))??{...w,url:t};return await fetch(v.url??t,v)},{errorInstance:new rU({body:n,url:t}),timeout:s,signal:!0});a&&await a(h);let g;if((f=h.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))g=await h.json();else{g=await h.text();try{g=JSON.parse(g||"{}")}catch(m){if(h.ok)throw m;g={error:g}}}if(!h.ok)throw new My({body:n,details:na(g.error)||h.statusText,headers:h.headers,status:h.status,url:t});return g}catch(h){throw h instanceof My||h instanceof rU?h:new My({body:n,cause:h,url:t})}}}}function mc(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:a="HTTP JSON-RPC",onFetchRequest:s,onFetchResponse:o,retryDelay:l}=e;return({chain:c,retryCount:u,timeout:f})=>{const{batchSize:h=1e3,wait:g=0}=typeof r=="object"?r:{},m=e.retryCount??u,w=f??e.timeout??1e4,_=t||(c==null?void 0:c.rpcUrls.default.http[0]);if(!_)throw new F_e;const v=z_e(_,{fetchOptions:n,onRequest:s,onResponse:o,timeout:w});return aX({key:i,name:a,async request({method:b,params:A}){const S={method:b,params:A},{schedule:j}=tX({id:_,wait:g,shouldSplitBatch(V){return V.length>h},fn:V=>v.request({body:V}),sort:(V,se)=>V.id-se.id}),U=async V=>r?j(V):[await v.request({body:V})],[{error:I,result:B}]=await U(S);if(I)throw new FN({body:S,error:I,url:_});return B},retryCount:m,retryDelay:l,timeout:w,type:"http"},{fetchOptions:n,url:_})}}function tL(t,e){var n,i,a,s,o,l;if(!(t instanceof Ze))return!1;const r=t.walk(c=>c instanceof VI);return r instanceof VI?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((a=r.data)==null?void 0:a.errorName)==="ResolverNotContract"||((s=r.data)==null?void 0:s.errorName)==="ResolverError"||((o=r.data)==null?void 0:o.errorName)==="HttpError"||(l=r.reason)!=null&&l.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===SQ[50]):!1}function oX(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return pc(e)?e:null}function m6(t){let e=new Uint8Array(32).fill(0);if(!t)return Si(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=oX(r[n]),a=i?vm(i):Xi(C0(r[n]),"bytes");e=Xi(Pd([e,a]),"bytes")}return Si(e)}function W_e(t){return`[${t.slice(2)}]`}function H_e(t){const e=new Uint8Array(32).fill(0);return t?oX(t)||Xi(C0(t)):Si(e)}function R9(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(C0(e).byteLength+2);let n=0;const i=e.split(".");for(let a=0;a255&&(s=C0(W_e(H_e(i[a])))),r[n]=s.length,r.set(s,n+1),n+=s.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function G_e(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Cm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c=Cc({abi:cU,functionName:"addr",...n!=null?{args:[m6(i),BigInt(n)]}:{args:[m6(i)]}}),u={address:l,abi:ZQ,functionName:"resolve",args:[ur(R9(i)),c],blockNumber:e,blockTag:r},f=nr(t,Dd,"readContract"),h=a?await f({...u,args:[...u.args,a]}):await f(u);if(h[0]==="0x")return null;const g=g1({abi:cU,args:n!=null?[m6(i),BigInt(n)]:void 0,functionName:"addr",data:h[0]});return g==="0x"||lc(g)==="0x00"?null:g}catch(c){if(s)throw c;if(tL(c,"resolve"))return null;throw c}}class q_e extends Ze{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class N2 extends Ze{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class rL extends Ze{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class V_e extends Ze{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Y_e=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,K_e=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,J_e=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Z_e=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Q_e(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function hU(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function lX({uri:t,gatewayUrls:e}){const r=J_e.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=hU(e==null?void 0:e.ipfs,"https://ipfs.io"),i=hU(e==null?void 0:e.arweave,"https://arweave.net"),a=t.match(Y_e),{protocol:s,subpath:o,target:l,subtarget:c=""}=(a==null?void 0:a.groups)||{},u=s==="ipns:/"||o==="ipns/",f=s==="ipfs:/"||o==="ipfs/"||K_e.test(t);if(t.startsWith("http")&&!u&&!f){let g=t;return e!=null&&e.arweave&&(g=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((u||f)&&l)return{uri:`${n}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let h=t.replace(Z_e,"");if(h.startsWith("i.json());return await nL({gatewayUrls:t,uri:cX(r)})}catch{throw new rL({uri:e})}}async function nL({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=lX({uri:e,gatewayUrls:t});if(n||await Q_e(r))return r;throw new rL({uri:e})}function eCe(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[a,s]=r.split(":"),[o,l]=n.split(":");if(!a||a.toLowerCase()!=="eip155")throw new N2({reason:"Only EIP-155 supported"});if(!s)throw new N2({reason:"Chain ID not found"});if(!l)throw new N2({reason:"Contract address not found"});if(!i)throw new N2({reason:"Token ID not found"});if(!o)throw new N2({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s),namespace:o.toLowerCase(),contractAddress:l,tokenID:i}}async function tCe(t,{nft:e}){if(e.namespace==="erc721")return Dd(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Dd(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new V_e({namespace:e.namespace})}async function rCe(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?nCe(t,{gatewayUrls:e,record:r}):nL({uri:r,gatewayUrls:e})}async function nCe(t,{gatewayUrls:e,record:r}){const n=eCe(r),i=await tCe(t,{nft:n}),{uri:a,isOnChain:s,isEncoded:o}=lX({uri:i,gatewayUrls:e});if(s&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const c=o?atob(a.replace("data:application/json;base64,","")):a,u=JSON.parse(c);return nL({uri:cX(u),gatewayUrls:e})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),X_e({gatewayUrls:e,uri:a.replace(/(?:0x)?{id}/,l)})}async function uX(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Cm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c={address:l,abi:ZQ,functionName:"resolve",args:[ur(R9(n)),Cc({abi:lU,functionName:"text",args:[m6(n),i]})],blockNumber:e,blockTag:r},u=nr(t,Dd,"readContract"),f=a?await u({...c,args:[...c.args,a]}):await u(c);if(f[0]==="0x")return null;const h=g1({abi:lU,functionName:"text",data:f[0]});return h===""?null:h}catch(c){if(s)throw c;if(tL(c,"resolve"))return null;throw c}}async function iCe(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){const l=await nr(t,uX,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:a,strict:s});if(!l)return null;try{return await rCe(t,{record:l,gatewayUrls:n})}catch{return null}}async function aCe(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:a,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Cm({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:o,abi:u_e,functionName:"reverse",args:[ur(R9(l))],blockNumber:r,blockTag:n},u=nr(t,Dd,"readContract"),[f,h]=i?await u({...c,args:[...c.args,i]}):await u(c);return e.toLowerCase()!==h.toLowerCase()?null:f}catch(c){if(a)throw c;if(tL(c,"reverse"))return null;throw c}}async function sCe(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let a=i;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Cm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[s]=await nr(t,Dd,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ur(R9(n))],blockNumber:e,blockTag:r});return s}async function oCe(t,e){var _,v,b;const{account:r=t.account,blockNumber:n,blockTag:i="latest",blobs:a,data:s,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g,...m}=e,w=r?ps(r):void 0;try{p1(e);const S=(n?lr(n):void 0)||i,j=(b=(v=(_=t.chain)==null?void 0:_.formatters)==null?void 0:v.transactionRequest)==null?void 0:b.format,I=(j||_m)({...I9(m,{format:j}),from:w==null?void 0:w.address,blobs:a,data:s,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g}),B=await t.request({method:"eth_createAccessList",params:[I,S]});return{accessList:B.accessList,gasUsed:BigInt(B.gasUsed)}}catch(A){throw XQ(A,{...e,account:w,chain:t.chain})}}async function lCe(t){const e=_9(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function dX(t,{address:e,args:r,event:n,events:i,fromBlock:a,strict:s,toBlock:o}={}){const l=i??(n?[n]:void 0),c=_9(t,{method:"eth_newFilter"});let u=[];l&&(u=[l.flatMap(g=>Mw({abi:[g],eventName:g.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof a=="bigint"?lr(a):a,toBlock:typeof o=="bigint"?lr(o):o,...u.length?{topics:u}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:a,id:f,request:c(f),strict:!!s,toBlock:o,type:"event"}}async function fX(t){const e=_9(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function cCe(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function uCe(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?lr(r):void 0;let a;return e?a=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):a=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]},{dedupe:!!i}),_u(a)}async function pU(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?lr(r):void 0,a=await t.request({method:"eth_getCode",params:[e,i||n]},{dedupe:!!i});if(a!=="0x")return a}function dCe(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function fCe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const a=r?lr(r):void 0,s=await t.request({method:"eth_feeHistory",params:[lr(e),a||n,i]},{dedupe:!!a});return dCe(s)}async function hCe(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(a=>Rd(a));return e.abi?ZN({abi:e.abi,logs:i,strict:r}):i}function pCe(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}class gCe extends Ze{constructor({domain:e}){super(`Invalid domain "${na(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class mCe extends Ze{constructor({primaryType:e,types:r}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class yCe extends Ze{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function wCe(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:wX({domain:e}),...t.types};yX({domain:e,message:r,primaryType:n,types:i});const a=["0x1901"];return e&&a.push(vCe({domain:e,types:i})),n!=="EIP712Domain"&&a.push(hX({data:r,primaryType:n,types:i})),Xi(Pd(a))}function vCe({domain:t,types:e}){return hX({data:t,primaryType:"EIP712Domain",types:e})}function hX({data:t,primaryType:e,types:r}){const n=pX({data:t,primaryType:e,types:r});return Xi(n)}function pX({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[bCe({primaryType:e,types:r})];for(const a of r[e]){const[s,o]=mX({types:r,name:a.name,type:a.type,value:t[a.name]});n.push(s),i.push(o)}return bm(n,i)}function bCe({primaryType:t,types:e}){const r=ur(xCe({primaryType:t,types:e}));return Xi(r)}function xCe({primaryType:t,types:e}){let r="";const n=gX({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const a of i)r+=`${a}(${e[a].map(({name:s,type:o})=>`${o} ${s}`).join(",")})`;return r}function gX({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const a of e[i])gX({primaryType:a.type,types:e},r);return r}function mX({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},Xi(pX({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},Xi(n)];if(r==="string")return[{type:"bytes32"},Xi(ur(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),a=n.map(s=>mX({name:e,type:i,types:t,value:s}));return[{type:"bytes32"},Xi(bm(a.map(([s])=>s),a.map(([,s])=>s)))]}return[{type:r},n]}function ECe(t){const{domain:e,message:r,primaryType:n,types:i}=t,a=(l,c)=>{const u={...c};for(const f of l){const{name:h,type:g}=f;g==="address"&&(u[h]=u[h].toLowerCase())}return u},s=i.EIP712Domain?e?a(i.EIP712Domain,e):{}:{},o=(()=>{if(n!=="EIP712Domain")return a(i[n],r)})();return na({domain:s,message:o,primaryType:n,types:i})}function yX(t){const{domain:e,message:r,primaryType:n,types:i}=t,a=(s,o)=>{for(const l of s){const{name:c,type:u}=l,f=o[c],h=u.match(EQ);if(h&&(typeof f=="number"||typeof f=="bigint")){const[w,_,v]=h;lr(f,{signed:_==="int",size:Number.parseInt(v)/8})}if(u==="address"&&typeof f=="string"&&!Tn(f))throw new us({address:f});const g=u.match(W7e);if(g){const[w,_]=g;if(_&&ai(f)!==Number.parseInt(_))throw new e7e({expectedSize:Number.parseInt(_),givenSize:ai(f)})}const m=i[u];m&&(_Ce(u),a(m,f))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new gCe({domain:e});a(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])a(i[n],r);else throw new mCe({primaryType:n,types:i})}function wX({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function _Ce(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new yCe({type:t})}function CCe(t){const{abi:e,data:r}=t,n=G0(r,0,4),i=e.find(a=>a.type==="function"&&n===E9(Eu(a)));if(!i)throw new Qxe(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?xm(i.inputs,G0(r,4)):void 0}}const SCe={"0x0":"reverted","0x1":"success"};function vX(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>Rd(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?_u(t.transactionIndex):null,status:t.status?SCe[t.status]:null,type:t.type?DQ[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const ACe=UN("transactionReceipt",vX),ICe=`Ethereum Signed Message: -`;function MCe(t){const e=typeof t=="string"?kg(t):typeof t.raw=="string"?t.raw:Si(t.raw),r=kg(`${ICe}${ai(e)}`);return Pd([r,e])}function bX(t,e){return Xi(MCe(t),e)}const xX="0x6492649264926492649264926492649264926492649264926492649264926492";function TCe(t){return xQ(t,-32)===xX}function kCe(t){const{address:e,data:r,signature:n,to:i="hex"}=t,a=Mu([bm([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,r,n]),xX]);return i==="hex"?a:gc(a)}function NCe(t){const{authorizationList:e}=t;if(e)for(const r of e){const{contractAddress:n,chainId:i}=r;if(!Tn(n))throw new us({address:n});if(i<0)throw new N9({chainId:i})}iL(t)}function LCe(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new HQ;for(const r of e){const n=ai(r),i=_u(G0(r,0,1));if(n!==32)throw new i_e({hash:r,size:n});if(i!==WQ)throw new a_e({hash:r,version:i})}}iL(t)}function iL(t){const{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new N9({chainId:e});if(i&&!Tn(i))throw new us({address:i});if(n&&n>M9)throw new K0({maxFeePerGas:n});if(r&&n&&r>n)throw new P3({maxFeePerGas:n,maxPriorityFeePerGas:r})}function jCe(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:a}=t;if(e<=0)throw new N9({chainId:e});if(a&&!Tn(a))throw new us({address:a});if(r||i)throw new Ze("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>M9)throw new K0({maxFeePerGas:n})}function $Ce(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:a}=t;if(a&&!Tn(a))throw new us({address:a});if(typeof e<"u"&&e<=0)throw new N9({chainId:e});if(r||i)throw new Ze("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>M9)throw new K0({maxFeePerGas:n})}function PCe(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{contractAddress:n,chainId:i,nonce:a,...s}=r;e.push([i?ur(i):"0x",n,a?ur(a):"0x",...Rw({},s)])}return e}function D9(t){if(!t||t.length===0)return[];const e=[];for(let r=0;r"u"||typeof g>"u")){const A=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(U=>Si(U)),S=t.kzg,j=GN({blobs:A,kzg:S});if(typeof h>"u"&&(h=UQ({commitments:j})),typeof g>"u"){const U=qN({blobs:A,commitments:j,kzg:S});g=GQ({blobs:A,commitments:j,proofs:U})}}const m=D9(u),w=[ur(r),i?ur(i):"0x",c?ur(c):"0x",l?ur(l):"0x",n?ur(n):"0x",a??"0x",s?ur(s):"0x",f??"0x",m,o?ur(o):"0x",h??[],...Rw(t,e)],_=[],v=[],b=[];if(g)for(let A=0;A{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+e.v-27n);const g=27n+(e.v===27n?0n:1n);if(e.v!==g)throw new vEe({v:e.v});return g})(),f=lc(e.r),h=lc(e.s);c=[...c,ur(u),f==="0x00"?"0x":f,h==="0x00"?"0x":h]}else r>0&&(c=[...c,ur(r),"0x","0x"]);return rh(c)}function Rw(t,e){const r=e??t,{v:n,yParity:i}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof i>"u")return[];const a=lc(r.r),s=lc(r.s);return[typeof i=="number"?i?ur(1):"0x":n===0n?"0x":n===1n?ur(1):n===27n?"0x":ur(1),a==="0x00"?"0x":a,s==="0x00"?"0x":s]}class zCe extends Ze{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function WCe(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new zCe({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[a,s,o]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],l=Math.round(+`${s}.${o}`);l>9?n=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):n=`${a}${l}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}function EX(t,e="wei"){return WCe(t,MQ[e])}function HCe(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function GCe(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?_u(t.nonce):void 0,storageProof:t.storageProof?HCe(t.storageProof):void 0}}async function qCe(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const a=n??"latest",s=r!==void 0?lr(r):void 0,o=await t.request({method:"eth_getProof",params:[e,i,s||a]});return GCe(o)}async function VCe(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const a=r!==void 0?lr(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,a||n]})}async function aL(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){var u,f,h;const s=n||"latest",o=r!==void 0?lr(r):void 0;let l=null;if(i?l=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?l=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,lr(a)]},{dedupe:!0}):(o||s)&&(l=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||s,lr(a)]},{dedupe:!!o})),!l)throw new TQ({blockHash:e,blockNumber:r,blockTag:s,hash:i,index:a});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:h.format)||T9)(l)}async function YCe(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([nr(t,$w,"getBlockNumber")({}),e?nr(t,aL,"getTransaction")({hash:e}):void 0]),a=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return a?n-a+1n:0n}async function lM(t,{hash:e}){var i,a,s;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new kQ({hash:e});return(((s=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionReceipt)==null?void 0:s.format)||vX)(r)}async function KCe(t,e){var _;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:a,multicallAddress:s,stateOverride:o}=e,l=e.contracts,c=n??(typeof((_=t.batch)==null?void 0:_.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=s;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=Cm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let h=0,g=0;for(let v=0;v0&&g>c&&f[h].length>0&&(h++,g=(U.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:U,target:A}]}catch(U){const I=Y0(U,{abi:b,address:A,args:S,docsPath:"/docs/contract/multicall",functionName:j});if(!r)throw I;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:A}]}}const m=await Promise.allSettled(f.map(v=>nr(t,Dd,"readContract")({abi:nM,address:u,args:[v],blockNumber:i,blockTag:a,functionName:"aggregate3",stateOverride:o}))),w=[];for(let v=0;ve.toString(16).padStart(2,"0"));function jg(t){Dw(t);let e="";for(let r=0;r=Yu._0&&t<=Yu._9)return t-Yu._0;if(t>=Yu.A&&t<=Yu.F)return t-(Yu.A-10);if(t>=Yu.a&&t<=Yu.f)return t-(Yu.a-10)}function $g(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,a=0;itypeof t=="bigint"&&O9<=t;function U9(t,e,r){return EC(t)&&EC(e)&&EC(r)&&e<=t&&tO9;t>>=F9,e+=1);return e}function tSe(t,e){return t>>BigInt(e)&F9}function rSe(t,e,r){return t|(r?F9:O9)<(JCe<new Uint8Array(t),mU=t=>Uint8Array.from(t);function CX(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=_C(t),i=_C(t),a=0;const s=()=>{n.fill(1),i.fill(0),a=0},o=(...f)=>r(i,n,...f),l=(f=_C())=>{i=o(mU([0]),f),n=o(),f.length!==0&&(i=o(mU([1]),f),n=o())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{s(),l(f);let g;for(;!(g=h(c()));)l();return s(),g}}const nSe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||J0(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Ow(t,e,r={}){const n=(i,a,s)=>{const o=nSe[a];if(typeof o!="function")throw new Error("invalid validator function");const l=t[i];if(!(s&&l===void 0)&&!o(l,t))throw new Error("param "+String(i)+" is invalid. Expected "+a+", got "+l)};for(const[i,a]of Object.entries(e))n(i,a,!1);for(const[i,a]of Object.entries(r))n(i,a,!0);return t}const iSe=()=>{throw new Error("not implemented")};function cM(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const a=t(r,...n);return e.set(r,a),a}}const aSe=Object.freeze(Object.defineProperty({__proto__:null,aInRange:A0,abool:Lg,abytes:Dw,bitGet:tSe,bitLen:_X,bitMask:cL,bitSet:rSe,bytesToHex:jg,bytesToNumberBE:S0,bytesToNumberLE:oL,concatBytes:R3,createHmacDrbg:CX,ensureBytes:Vl,equalBytes:XCe,hexToBytes:$g,hexToNumber:sL,inRange:U9,isBytes:J0,memoized:cM,notImplemented:iSe,numberToBytesBE:Pg,numberToBytesLE:lL,numberToHexUnpadded:qp,numberToVarBytesBE:QCe,utf8ToBytes:eSe,validateObject:Ow},Symbol.toStringTag,{value:"Module"})),sSe="0.1.1";function oSe(){return sSe}class D3 extends Error{constructor(e,r={}){const n=(()=>{var l;if(r.cause instanceof D3){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof D3&&r.cause.docsPath||r.docsPath,s=`https://oxlib.sh${i??""}`,o=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i?["",n?`Details: ${n}`:void 0,i?`See: ${s}`:void 0]:[]].filter(l=>typeof l=="string").join(` -`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${oSe()}`}),this.cause=r.cause,this.details=n,this.docs=s,this.docsPath=i,this.shortMessage=e}walk(e){return SX(this,e)}}function SX(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?SX(t.cause,e):e?null:t}function lSe(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;const i=t.replace("0x","");if(i.length>n*2)throw new dSe({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function dd(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let a;n?r?a=(1n<a||i{const v=_,b=v.account?ps(v.account):void 0,A={...v,data:v.abi?Cc(v):v.data,from:v.from??(b==null?void 0:b.address)};return p1(A),_m(A)}),w=h.stateOverrides?BN(h.stateOverrides):void 0;l.push({blockOverrides:g,calls:m,stateOverrides:w})}const u=(r?lr(r):void 0)||n;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:l,returnFullTransactions:a,traceTransfers:s,validation:o},u]})).map((h,g)=>({...WN(h),calls:h.calls.map((m,w)=>{var se,Y;const{abi:_,args:v,functionName:b,to:A}=i[g].calls[w],S=((se=m.error)==null?void 0:se.data)??m.returnData,j=BigInt(m.gasUsed),U=(Y=m.logs)==null?void 0:Y.map(N=>Rd(N)),I=m.status==="0x1"?"success":"failure",B=_?g1({abi:_,data:S,functionName:b}):null,V=(()=>{var k;if(I==="success")return;let N;if(((k=m.error)==null?void 0:k.data)==="0x"?N=new Sw:m.error&&(N=new S9(m.error)),!!N)return Y0(N,{abi:_??[],address:A,args:v,functionName:b??""})})();return{data:S,gasUsed:j,logs:U,status:I,...I==="success"?{result:B}:{error:V}}})}))}catch(l){const c=l,u=A9(c,{});throw u instanceof Nw?c:u}}function yU(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function gSe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function B9(t,...e){if(!gSe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function mSe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");yU(t.outputLen),yU(t.blockLen)}function j5(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function ySe(t,e){B9(t);const r=e.outputLen;if(t.lengthnew DataView(t.buffer,t.byteOffset,t.byteLength),Pc=(t,e)=>t<<32-e|t>>>e;function wSe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function uL(t){return typeof t=="string"&&(t=wSe(t)),B9(t),t}function vSe(...t){let e=0;for(let n=0;nt().update(uL(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function xSe(t=32){if(lp&&typeof lp.getRandomValues=="function")return lp.getRandomValues(new Uint8Array(t));if(lp&&typeof lp.randomBytes=="function")return lp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function ESe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),l=n?4:0,c=n?0:4;t.setUint32(e+l,s,n),t.setUint32(e+c,o,n)}const _Se=(t,e,r)=>t&e^~t&r,CSe=(t,e,r)=>t&e^t&r^e&r;class SSe extends AX{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=CC(this.buffer)}update(e){j5(this);const{view:r,buffer:n,blockLen:i}=this;e=uL(e);const a=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=Pc(g,17)^Pc(g,19)^g>>>10;yf[f]=w+yf[f-7]+m+yf[f-16]|0}let{A:n,B:i,C:a,D:s,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Pc(o,6)^Pc(o,11)^Pc(o,25),g=u+h+_Se(o,l,c)+ASe[f]+yf[f]|0,w=(Pc(n,2)^Pc(n,13)^Pc(n,22))+CSe(n,i,a)|0;u=c,c=l,l=o,o=s+g|0,s=a,a=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,s,o,l,c,u)}roundClean(){yf.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const MSe=bSe(()=>new ISe);let IX=class extends AX{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,mSe(e);const n=uL(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let s=0;snew IX(t,e).update(r).digest();MX.create=(t,e)=>new IX(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ea=BigInt(0),mi=BigInt(1),s0=BigInt(2),TSe=BigInt(3),uM=BigInt(4),wU=BigInt(5),vU=BigInt(8);function Ns(t,e){const r=t%e;return r>=ea?r:e+r}function kSe(t,e,r){if(eea;)e&mi&&(n=n*t%r),t=t*t%r,e>>=mi;return n}function Yo(t,e,r){let n=t;for(;e-- >ea;)n*=n,n%=r;return n}function dM(t,e){if(t===ea)throw new Error("invert: expected non-zero number");if(e<=ea)throw new Error("invert: expected positive modulus, got "+e);let r=Ns(t,e),n=e,i=ea,a=mi;for(;r!==ea;){const o=n/r,l=n%r,c=i-a*o;n=r,r=l,i=a,a=c}if(n!==mi)throw new Error("invert: does not exist");return Ns(i,e)}function NSe(t){const e=(t-mi)/s0;let r,n,i;for(r=t-mi,n=0;r%s0===ea;r/=s0,n++);for(i=s0;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const s=(t+mi)/uM;return function(l,c){const u=l.pow(c,s);if(!l.eql(l.sqr(u),c))throw new Error("Cannot find square root");return u}}const a=(r+mi)/s0;return function(o,l){if(o.pow(l,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=n,u=o.pow(o.mul(o.ONE,i),r),f=o.pow(l,a),h=o.pow(l,r);for(;!o.eql(h,o.ONE);){if(o.eql(h,o.ZERO))return o.ZERO;let g=1;for(let w=o.sqr(h);g(n[i]="function",n),e);return Ow(t,r)}function PSe(t,e,r){if(rea;)r&mi&&(n=t.mul(n,i)),i=t.sqr(i),r>>=mi;return n}function RSe(t,e){const r=new Array(e.length),n=e.reduce((a,s,o)=>t.is0(s)?a:(r[o]=a,t.mul(a,s)),t.ONE),i=t.inv(n);return e.reduceRight((a,s,o)=>t.is0(s)?a:(r[o]=t.mul(a,r[o]),t.mul(a,s)),i),r}function TX(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function kX(t,e,r=!1,n={}){if(t<=ea)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:a}=TX(t,e);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const o=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:cL(i),ZERO:ea,ONE:mi,create:l=>Ns(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return ea<=l&&ll===ea,isOdd:l=>(l&mi)===mi,neg:l=>Ns(-l,t),eql:(l,c)=>l===c,sqr:l=>Ns(l*l,t),add:(l,c)=>Ns(l+c,t),sub:(l,c)=>Ns(l-c,t),mul:(l,c)=>Ns(l*c,t),pow:(l,c)=>PSe(o,l,c),div:(l,c)=>Ns(l*dM(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>dM(l,t),sqrt:n.sqrt||(l=>(s||(s=LSe(t)),s(o,l))),invertBatch:l=>RSe(o,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>r?lL(l,a):Pg(l,a),fromBytes:l=>{if(l.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+l.length);return r?oL(l):S0(l)}});return Object.freeze(o)}function NX(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function LX(t){const e=NX(t);return e+Math.ceil(e/2)}function DSe(t,e,r=!1){const n=t.length,i=NX(e),a=LX(e);if(n<16||n1024)throw new Error("expected "+a+"-1024 bytes of input, got "+n);const s=r?S0(t):oL(t),o=Ns(s,e-mi)+mi;return r?lL(o,i):Pg(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const bU=BigInt(0),f4=BigInt(1);function SC(t,e){const r=e.negate();return t?r:e}function jX(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function AC(t,e){jX(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function OSe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function FSe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const IC=new WeakMap,$X=new WeakMap;function MC(t){return $X.get(t)||1}function USe(t,e){return{constTimeNegate:SC,hasPrecomputes(r){return MC(r)!==1},unsafeLadder(r,n,i=t.ZERO){let a=r;for(;n>bU;)n&f4&&(i=i.add(a)),a=a.double(),n>>=f4;return i},precomputeWindow(r,n){const{windows:i,windowSize:a}=AC(n,e),s=[];let o=r,l=o;for(let c=0;c>=f,m>s&&(m-=u,i+=f4);const w=g,_=g+Math.abs(m)-1,v=h%2!==0,b=m<0;m===0?l=l.add(SC(v,n[w])):o=o.add(SC(b,n[_]))}return{p:o,f:l}},wNAFUnsafe(r,n,i,a=t.ZERO){const{windows:s,windowSize:o}=AC(r,e),l=BigInt(2**r-1),c=2**r,u=BigInt(r);for(let f=0;f>=u,g>o&&(g-=c,i+=f4),g===0)continue;let m=n[h+Math.abs(g)-1];g<0&&(m=m.negate()),a=a.add(m)}return a},getPrecomputes(r,n,i){let a=IC.get(n);return a||(a=this.precomputeWindow(n,r),r!==1&&IC.set(n,i(a))),a},wNAFCached(r,n,i){const a=MC(r);return this.wNAF(a,this.getPrecomputes(a,r,i),n)},wNAFCachedUnsafe(r,n,i,a){const s=MC(r);return s===1?this.unsafeLadder(r,n,a):this.wNAFUnsafe(s,this.getPrecomputes(s,r,i),n,a)},setWindowSize(r,n){jX(n,e),$X.set(r,n),IC.delete(r)}}}function BSe(t,e,r,n){if(OSe(r,t),FSe(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,a=_X(BigInt(r.length)),s=a>12?a-3:a>4?a-2:a?2:1,o=(1<=0;f-=s){l.fill(i);for(let g=0;g>BigInt(f)&BigInt(o));l[w]=l[w].add(r[g])}let h=i;for(let g=l.length-1,m=i;g>0;g--)m=m.add(l[g]),h=h.add(m);if(u=u.add(h),f!==0)for(let g=0;g{const{Err:r}=fd;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=qp(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const a=n>127?qp(i.length/2|128):"";return qp(t)+a+i+e},decode(t,e){const{Err:r}=fd;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],a=!!(i&128);let s=0;if(!a)s=i;else{const l=i&127;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const c=e.subarray(n,n+l);if(c.length!==l)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const u of c)s=s<<8|u;if(n+=l,s<128)throw new r("tlv.decode(long): not minimal encoding")}const o=e.subarray(n,n+s);if(o.length!==s)throw new r("tlv.decode: wrong value length");return{v:o,l:e.subarray(n+s)}}},_int:{encode(t){const{Err:e}=fd;if(t{const b=_.toAffine();return R3(Uint8Array.from([4]),r.toBytes(b.x),r.toBytes(b.y))}),a=e.fromBytes||(w=>{const _=w.subarray(1),v=r.fromBytes(_.subarray(0,r.BYTES)),b=r.fromBytes(_.subarray(r.BYTES,2*r.BYTES));return{x:v,y:b}});function s(w){const{a:_,b:v}=e,b=r.sqr(w),A=r.mul(b,w);return r.add(r.add(A,r.mul(w,_)),v)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(w){return U9(w,Gi,e.n)}function l(w){const{allowedPrivateKeyLengths:_,nByteLength:v,wrapPrivateKey:b,n:A}=e;if(_&&typeof w!="bigint"){if(J0(w)&&(w=jg(w)),typeof w!="string"||!_.includes(w.length))throw new Error("invalid private key");w=w.padStart(v*2,"0")}let S;try{S=typeof w=="bigint"?w:S0(Vl("private key",w,v))}catch{throw new Error("invalid private key, expected hex or "+v+" bytes, got "+typeof w)}return b&&(S=Ns(S,A)),A0("private key",S,Gi,A),S}function c(w){if(!(w instanceof h))throw new Error("ProjectivePoint expected")}const u=cM((w,_)=>{const{px:v,py:b,pz:A}=w;if(r.eql(A,r.ONE))return{x:v,y:b};const S=w.is0();_==null&&(_=S?r.ONE:r.inv(A));const j=r.mul(v,_),U=r.mul(b,_),I=r.mul(A,_);if(S)return{x:r.ZERO,y:r.ZERO};if(!r.eql(I,r.ONE))throw new Error("invZ was invalid");return{x:j,y:U}}),f=cM(w=>{if(w.is0()){if(e.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:_,y:v}=w.toAffine();if(!r.isValid(_)||!r.isValid(v))throw new Error("bad point: x or y not FE");const b=r.sqr(v),A=s(_);if(!r.eql(b,A))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(_,v,b){if(this.px=_,this.py=v,this.pz=b,_==null||!r.isValid(_))throw new Error("x required");if(v==null||!r.isValid(v))throw new Error("y required");if(b==null||!r.isValid(b))throw new Error("z required");Object.freeze(this)}static fromAffine(_){const{x:v,y:b}=_||{};if(!_||!r.isValid(v)||!r.isValid(b))throw new Error("invalid affine point");if(_ instanceof h)throw new Error("projective point not allowed");const A=S=>r.eql(S,r.ZERO);return A(v)&&A(b)?h.ZERO:new h(v,b,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(_){const v=r.invertBatch(_.map(b=>b.pz));return _.map((b,A)=>b.toAffine(v[A])).map(h.fromAffine)}static fromHex(_){const v=h.fromAffine(a(Vl("pointHex",_)));return v.assertValidity(),v}static fromPrivateKey(_){return h.BASE.multiply(l(_))}static msm(_,v){return BSe(h,n,_,v)}_setWindowSize(_){m.setWindowSize(this,_)}assertValidity(){f(this)}hasEvenY(){const{y:_}=this.toAffine();if(r.isOdd)return!r.isOdd(_);throw new Error("Field doesn't support isOdd")}equals(_){c(_);const{px:v,py:b,pz:A}=this,{px:S,py:j,pz:U}=_,I=r.eql(r.mul(v,U),r.mul(S,A)),B=r.eql(r.mul(b,U),r.mul(j,A));return I&&B}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:_,b:v}=e,b=r.mul(v,EU),{px:A,py:S,pz:j}=this;let U=r.ZERO,I=r.ZERO,B=r.ZERO,V=r.mul(A,A),se=r.mul(S,S),Y=r.mul(j,j),N=r.mul(A,S);return N=r.add(N,N),B=r.mul(A,j),B=r.add(B,B),U=r.mul(_,B),I=r.mul(b,Y),I=r.add(U,I),U=r.sub(se,I),I=r.add(se,I),I=r.mul(U,I),U=r.mul(N,U),B=r.mul(b,B),Y=r.mul(_,Y),N=r.sub(V,Y),N=r.mul(_,N),N=r.add(N,B),B=r.add(V,V),V=r.add(B,V),V=r.add(V,Y),V=r.mul(V,N),I=r.add(I,V),Y=r.mul(S,j),Y=r.add(Y,Y),V=r.mul(Y,N),U=r.sub(U,V),B=r.mul(Y,se),B=r.add(B,B),B=r.add(B,B),new h(U,I,B)}add(_){c(_);const{px:v,py:b,pz:A}=this,{px:S,py:j,pz:U}=_;let I=r.ZERO,B=r.ZERO,V=r.ZERO;const se=e.a,Y=r.mul(e.b,EU);let N=r.mul(v,S),k=r.mul(b,j),x=r.mul(A,U),E=r.add(v,b),L=r.add(S,j);E=r.mul(E,L),L=r.add(N,k),E=r.sub(E,L),L=r.add(v,A);let O=r.add(S,U);return L=r.mul(L,O),O=r.add(N,x),L=r.sub(L,O),O=r.add(b,A),I=r.add(j,U),O=r.mul(O,I),I=r.add(k,x),O=r.sub(O,I),V=r.mul(se,L),I=r.mul(Y,x),V=r.add(I,V),I=r.sub(k,V),V=r.add(k,V),B=r.mul(I,V),k=r.add(N,N),k=r.add(k,N),x=r.mul(se,x),L=r.mul(Y,L),k=r.add(k,x),x=r.sub(N,x),x=r.mul(se,x),L=r.add(L,x),N=r.mul(k,L),B=r.add(B,N),N=r.mul(O,L),I=r.mul(E,I),I=r.sub(I,N),N=r.mul(E,k),V=r.mul(O,V),V=r.add(V,N),new h(I,B,V)}subtract(_){return this.add(_.negate())}is0(){return this.equals(h.ZERO)}wNAF(_){return m.wNAFCached(this,_,h.normalizeZ)}multiplyUnsafe(_){const{endo:v,n:b}=e;A0("scalar",_,yd,b);const A=h.ZERO;if(_===yd)return A;if(this.is0()||_===Gi)return this;if(!v||m.hasPrecomputes(this))return m.wNAFCachedUnsafe(this,_,h.normalizeZ);let{k1neg:S,k1:j,k2neg:U,k2:I}=v.splitScalar(_),B=A,V=A,se=this;for(;j>yd||I>yd;)j&Gi&&(B=B.add(se)),I&Gi&&(V=V.add(se)),se=se.double(),j>>=Gi,I>>=Gi;return S&&(B=B.negate()),U&&(V=V.negate()),V=new h(r.mul(V.px,v.beta),V.py,V.pz),B.add(V)}multiply(_){const{endo:v,n:b}=e;A0("scalar",_,Gi,b);let A,S;if(v){const{k1neg:j,k1:U,k2neg:I,k2:B}=v.splitScalar(_);let{p:V,f:se}=this.wNAF(U),{p:Y,f:N}=this.wNAF(B);V=m.constTimeNegate(j,V),Y=m.constTimeNegate(I,Y),Y=new h(r.mul(Y.px,v.beta),Y.py,Y.pz),A=V.add(Y),S=se.add(N)}else{const{p:j,f:U}=this.wNAF(_);A=j,S=U}return h.normalizeZ([A,S])[0]}multiplyAndAddUnsafe(_,v,b){const A=h.BASE,S=(U,I)=>I===yd||I===Gi||!U.equals(A)?U.multiplyUnsafe(I):U.multiply(I),j=S(this,v).add(S(_,b));return j.is0()?void 0:j}toAffine(_){return u(this,_)}isTorsionFree(){const{h:_,isTorsionFree:v}=e;if(_===Gi)return!0;if(v)return v(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:_,clearCofactor:v}=e;return _===Gi?this:v?v(h,this):this.multiplyUnsafe(e.h)}toRawBytes(_=!0){return Lg("isCompressed",_),this.assertValidity(),i(h,this,_)}toHex(_=!0){return Lg("isCompressed",_),jg(this.toRawBytes(_))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const g=e.nBitLength,m=USe(h,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function qSe(t){const e=PX(t);return Ow(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function VSe(t){const e=qSe(t),{Fp:r,n}=e,i=r.BYTES+1,a=2*r.BYTES+1;function s(x){return Ns(x,n)}function o(x){return dM(x,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:u,isWithinCurveOrder:f}=GSe({...e,toBytes(x,E,L){const O=E.toAffine(),P=r.toBytes(O.x),R=R3;return Lg("isCompressed",L),L?R(Uint8Array.from([E.hasEvenY()?2:3]),P):R(Uint8Array.from([4]),P,r.toBytes(O.y))},fromBytes(x){const E=x.length,L=x[0],O=x.subarray(1);if(E===i&&(L===2||L===3)){const P=S0(O);if(!U9(P,Gi,r.ORDER))throw new Error("Point is not on curve");const R=u(P);let M;try{M=r.sqrt(R)}catch(X){const le=X instanceof Error?": "+X.message:"";throw new Error("Point is not on curve"+le)}const D=(M&Gi)===Gi;return(L&1)===1!==D&&(M=r.neg(M)),{x:P,y:M}}else if(E===a&&L===4){const P=r.fromBytes(O.subarray(0,r.BYTES)),R=r.fromBytes(O.subarray(r.BYTES,2*r.BYTES));return{x:P,y:R}}else{const P=i,R=a;throw new Error("invalid Point, expected length of "+P+", or uncompressed "+R+", got "+E)}}}),h=x=>jg(Pg(x,e.nByteLength));function g(x){const E=n>>Gi;return x>E}function m(x){return g(x)?s(-x):x}const w=(x,E,L)=>S0(x.slice(E,L));class _{constructor(E,L,O){this.r=E,this.s=L,this.recovery=O,this.assertValidity()}static fromCompact(E){const L=e.nByteLength;return E=Vl("compactSignature",E,L*2),new _(w(E,0,L),w(E,L,2*L))}static fromDER(E){const{r:L,s:O}=fd.toSig(Vl("DER",E));return new _(L,O)}assertValidity(){A0("r",this.r,Gi,n),A0("s",this.s,Gi,n)}addRecoveryBit(E){return new _(this.r,this.s,E)}recoverPublicKey(E){const{r:L,s:O,recovery:P}=this,R=U(Vl("msgHash",E));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");const M=P===2||P===3?L+e.n:L;if(M>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const D=P&1?"03":"02",$=l.fromHex(D+h(M)),X=o(M),le=s(-R*X),H=s(O*X),ee=l.BASE.multiplyAndAddUnsafe($,le,H);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new _(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return $g(this.toDERHex())}toDERHex(){return fd.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return $g(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(x){try{return c(x),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const x=LX(e.n);return DSe(e.randomBytes(x),e.n)},precompute(x=8,E=l.BASE){return E._setWindowSize(x),E.multiply(BigInt(3)),E}};function b(x,E=!0){return l.fromPrivateKey(x).toRawBytes(E)}function A(x){const E=J0(x),L=typeof x=="string",O=(E||L)&&x.length;return E?O===i||O===a:L?O===2*i||O===2*a:x instanceof l}function S(x,E,L=!0){if(A(x))throw new Error("first arg must be private key");if(!A(E))throw new Error("second arg must be public key");return l.fromHex(E).multiply(c(x)).toRawBytes(L)}const j=e.bits2int||function(x){if(x.length>8192)throw new Error("input is too large");const E=S0(x),L=x.length*8-e.nBitLength;return L>0?E>>BigInt(L):E},U=e.bits2int_modN||function(x){return s(j(x))},I=cL(e.nBitLength);function B(x){return A0("num < 2^"+e.nBitLength,x,yd,I),Pg(x,e.nByteLength)}function V(x,E,L=se){if(["recovered","canonical"].some(te=>te in L))throw new Error("sign() legacy options not supported");const{hash:O,randomBytes:P}=e;let{lowS:R,prehash:M,extraEntropy:D}=L;R==null&&(R=!0),x=Vl("msgHash",x),xU(L),M&&(x=Vl("prehashed msgHash",O(x)));const $=U(x),X=c(E),le=[B(X),B($)];if(D!=null&&D!==!1){const te=D===!0?P(r.BYTES):D;le.push(Vl("extraEntropy",te))}const H=R3(...le),ee=$;function J(te){const re=j(te);if(!f(re))return;const z=o(re),G=l.BASE.multiply(re).toAffine(),Z=s(G.x);if(Z===yd)return;const me=s(z*s(ee+Z*X));if(me===yd)return;let be=(G.x===Z?0:2)|Number(G.y&Gi),Ce=me;return R&&g(me)&&(Ce=m(me),be^=1),new _(Z,Ce,be)}return{seed:H,k2sig:J}}const se={lowS:e.lowS,prehash:!1},Y={lowS:e.lowS,prehash:!1};function N(x,E,L=se){const{seed:O,k2sig:P}=V(x,E,L),R=e;return CX(R.hash.outputLen,R.nByteLength,R.hmac)(O,P)}l.BASE._setWindowSize(8);function k(x,E,L,O=Y){var be;const P=x;E=Vl("msgHash",E),L=Vl("publicKey",L);const{lowS:R,prehash:M,format:D}=O;if(xU(O),"strict"in O)throw new Error("options.strict was renamed to lowS");if(D!==void 0&&D!=="compact"&&D!=="der")throw new Error("format must be compact or der");const $=typeof P=="string"||J0(P),X=!$&&!D&&typeof P=="object"&&P!==null&&typeof P.r=="bigint"&&typeof P.s=="bigint";if(!$&&!X)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let le,H;try{if(X&&(le=new _(P.r,P.s)),$){try{D!=="compact"&&(le=_.fromDER(P))}catch(Ce){if(!(Ce instanceof fd.Err))throw Ce}!le&&D!=="der"&&(le=_.fromCompact(P))}H=l.fromHex(L)}catch{return!1}if(!le||R&&le.hasHighS())return!1;M&&(E=e.hash(E));const{r:ee,s:J}=le,te=U(E),re=o(J),z=s(te*re),G=s(ee*re),Z=(be=l.BASE.multiplyAndAddUnsafe(H,z,G))==null?void 0:be.toAffine();return Z?s(Z.x)===ee:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:S,sign:N,verify:k,ProjectivePoint:l,Signature:_,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function YSe(t){return{hash:t,hmac:(e,...r)=>MX(t,e,vSe(...r)),randomBytes:xSe}}function KSe(t,e){const r=n=>VSe({...t,...YSe(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const RX=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),_U=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),JSe=BigInt(1),fM=BigInt(2),CU=(t,e)=>(t+e/fM)/e;function ZSe(t){const e=RX,r=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),s=BigInt(23),o=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=Yo(u,r,e)*u%e,h=Yo(f,r,e)*u%e,g=Yo(h,fM,e)*c%e,m=Yo(g,i,e)*g%e,w=Yo(m,a,e)*m%e,_=Yo(w,o,e)*w%e,v=Yo(_,l,e)*_%e,b=Yo(v,o,e)*w%e,A=Yo(b,r,e)*u%e,S=Yo(A,s,e)*m%e,j=Yo(S,n,e)*c%e,U=Yo(j,fM,e);if(!hM.eql(hM.sqr(U),t))throw new Error("Cannot find square root");return U}const hM=kX(RX,void 0,void 0,{sqrt:ZSe}),dL=KSe({a:BigInt(0),b:BigInt(7),Fp:hM,n:_U,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=_U,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-JSe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,s=BigInt("0x100000000000000000000000000000000"),o=CU(a*t,e),l=CU(-n*t,e);let c=Ns(t-o*r-l*i,e),u=Ns(-o*n-l*a,e);const f=c>s,h=u>s;if(f&&(c=e-c),h&&(u=e-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},MSe);BigInt(0);dL.ProjectivePoint;const QSe=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:dL},Symbol.toStringTag,{value:"Module"}));function XSe({r:t,s:e,to:r="hex",v:n,yParity:i}){const a=(()=>{if(i===0||i===1)return i;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),s=`0x${new dL.Signature(yo(t),yo(e)).toCompactHex()}${a===0?"1b":"1c"}`;return r==="hex"?s:gc(s)}async function fL(t,e){var f,h,g;const{address:r,factory:n,factoryData:i,hash:a,signature:s,universalSignatureVerifierAddress:o=(g=(h=(f=t.chain)==null?void 0:f.contracts)==null?void 0:h.universalSignatureVerifier)==null?void 0:g.address,...l}=e,c=pc(s)?s:typeof s=="object"&&"r"in s&&"s"in s?XSe(s):Si(s),u=await(async()=>!n&&!i||TCe(c)?c:kCe({address:n,data:i,signature:c}))();try{const m=o?{to:o,data:Cc({abi:uU,functionName:"isValidSig",args:[r,a,u]}),...l}:{data:L9({abi:uU,args:[r,a,u],bytecode:p_e}),...l},{data:w}=await nr(t,j9,"call")(m);return u7e(w??"0x0")}catch(m){try{if(KN(jN(r),await LQ({hash:a,signature:s})))return!0}catch{}if(m instanceof NQ)return!1;throw m}}async function eAe(t,{address:e,message:r,factory:n,factoryData:i,signature:a,...s}){const o=bX(r);return fL(t,{address:e,factory:n,factoryData:i,hash:o,signature:a,...s})}async function tAe(t,e){const{address:r,factory:n,factoryData:i,signature:a,message:s,primaryType:o,types:l,domain:c,...u}=e,f=wCe({message:s,primaryType:o,types:l,domain:c});return fL(t,{address:r,factory:n,factoryData:i,hash:f,signature:a,...u})}function DX(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:a,pollingInterval:s=t.pollingInterval}){const o=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let l;return o?(()=>{const f=na(["watchBlockNumber",t.uid,e,r,s]);return nh(f,{onBlockNumber:n,onError:i},h=>jw(async()=>{var g;try{const m=await nr(t,$w,"getBlockNumber")({cacheTime:0});if(l){if(m===l)return;if(m-l>1&&r)for(let w=l+1n;wl)&&(h.onBlockNumber(m,l),l=m)}catch(m){(g=h.onError)==null||g.call(h,m)}},{emitOnBegin:e,interval:s}))})():(()=>{const f=na(["watchBlockNumber",t.uid,e,r]);return nh(f,{onBlockNumber:n,onError:i},h=>{let g=!0,m=()=>g=!1;return(async()=>{try{const w=(()=>{if(t.transport.type==="fallback"){const v=t.transport.transports.find(b=>b.config.type==="webSocket");return v?v.value:t.transport}return t.transport})(),{unsubscribe:_}=await w.subscribe({params:["newHeads"],onData(v){var A;if(!g)return;const b=yo((A=v.result)==null?void 0:A.number);h.onBlockNumber(b,l),l=b},onError(v){var b;(b=h.onError)==null||b.call(h,v)}});m=_,g||m()}catch(w){i==null||i(w)}})(),()=>m()})})()}async function rAe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:a=6,retryDelay:s=({count:l})=>~~(1<w(new _Ee({hash:r})),o):void 0,v=nh(l,{onReplaced:n,resolve:m,reject:w},b=>{const A=nr(t,DX,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(S){const j=I=>{clearTimeout(_),A(),I(),v()};let U=S;if(!h)try{if(f){if(e>1&&(!f.blockNumber||U-f.blockNumber+1nb.resolve(f));return}if(c||(h=!0,await oM(async()=>{c=await nr(t,aL,"getTransaction")({hash:r}),c.blockNumber&&(U=c.blockNumber)},{delay:s,retryCount:a}),h=!1),f=await nr(t,lM,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||U-f.blockNumber+1nb.resolve(f))}catch(I){if(I instanceof TQ||I instanceof kQ){if(!c){h=!1;return}try{u=c,h=!0;const B=await oM(()=>nr(t,ru,"getBlock")({blockNumber:U,includeTransactions:!0}),{delay:s,retryCount:a,shouldRetry:({error:Y})=>Y instanceof RQ});h=!1;const V=B.transactions.find(({from:Y,nonce:N})=>Y===u.from&&N===u.nonce);if(!V||(f=await nr(t,lM,"getTransactionReceipt")({hash:V.hash}),e>1&&(!f.blockNumber||U-f.blockNumber+1n{var Y;(Y=b.onReplaced)==null||Y.call(b,{reason:se,replacedTransaction:u,transaction:V,transactionReceipt:f}),b.resolve(f)})}catch(B){j(()=>b.reject(B))}}else j(()=>b.reject(I))}}})});return g}function nAe(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:a,includeTransactions:s,poll:o,pollingInterval:l=t.pollingInterval}){const c=typeof o<"u"?o:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),u=s??!1;let f;return c?(()=>{const m=na(["watchBlocks",t.uid,e,r,n,u,l]);return nh(m,{onBlock:i,onError:a},w=>jw(async()=>{var _;try{const v=await nr(t,ru,"getBlock")({blockTag:e,includeTransactions:u});if(v.number&&(f!=null&&f.number)){if(v.number===f.number)return;if(v.number-f.number>1&&r)for(let b=(f==null?void 0:f.number)+1n;bf.number)&&(w.onBlock(v,f),f=v)}catch(v){(_=w.onError)==null||_.call(w,v)}},{emitOnBegin:n,interval:l}))})():(()=>{let m=!0,w=!0,_=()=>m=!1;return(async()=>{try{n&&nr(t,ru,"getBlock")({blockTag:e,includeTransactions:u}).then(A=>{m&&w&&(i(A,void 0),w=!1)});const v=(()=>{if(t.transport.type==="fallback"){const A=t.transport.transports.find(S=>S.config.type==="webSocket");return A?A.value:t.transport}return t.transport})(),{unsubscribe:b}=await v.subscribe({params:["newHeads"],async onData(A){if(!m)return;const S=await nr(t,ru,"getBlock")({blockNumber:A.blockNumber,includeTransactions:u}).catch(()=>{});m&&(i(S,f),w=!1,f=S)},onError(A){a==null||a(A)}});_=b,m||_()}catch(v){a==null||a(v)}})(),()=>_()})()}function iAe(t,{address:e,args:r,batch:n=!0,event:i,events:a,fromBlock:s,onError:o,onLogs:l,poll:c,pollingInterval:u=t.pollingInterval,strict:f}){const h=typeof c<"u"?c:typeof s=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),g=f??!1;return h?(()=>{const _=na(["watchEvent",e,r,n,t.uid,i,u,s]);return nh(_,{onLogs:l,onError:o},v=>{let b;s!==void 0&&(b=s-1n);let A,S=!1;const j=jw(async()=>{var U;if(!S){try{A=await nr(t,dX,"createEventFilter")({address:e,args:r,event:i,events:a,strict:g,fromBlock:s})}catch{}S=!0;return}try{let I;if(A)I=await nr(t,$9,"getFilterChanges")({filter:A});else{const B=await nr(t,$w,"getBlockNumber")({});b&&b!==B?I=await nr(t,QN,"getLogs")({address:e,args:r,event:i,events:a,fromBlock:b+1n,toBlock:B}):I=[],b=B}if(I.length===0)return;if(n)v.onLogs(I);else for(const B of I)v.onLogs([B])}catch(I){A&&I instanceof V0&&(S=!1),(U=v.onError)==null||U.call(v,I)}},{emitOnBegin:!0,interval:u});return async()=>{A&&await nr(t,P9,"uninstallFilter")({filter:A}),j()}})})():(()=>{let _=!0,v=()=>_=!1;return(async()=>{try{const b=(()=>{if(t.transport.type==="fallback"){const U=t.transport.transports.find(I=>I.config.type==="webSocket");return U?U.value:t.transport}return t.transport})(),A=a??(i?[i]:void 0);let S=[];A&&(S=[A.flatMap(I=>Mw({abi:[I],eventName:I.name,args:r}))],i&&(S=S[0]));const{unsubscribe:j}=await b.subscribe({params:["logs",{address:e,topics:S}],onData(U){var B;if(!_)return;const I=U.result;try{const{eventName:V,args:se}=JN({abi:A??[],data:I.data,topics:I.topics,strict:g}),Y=Rd(I,{args:se,eventName:V});l([Y])}catch(V){let se,Y;if(V instanceof v3||V instanceof v9){if(f)return;se=V.abiItem.name,Y=(B=V.abiItem.inputs)==null?void 0:B.some(k=>!("name"in k&&k.name))}const N=Rd(I,{args:Y?[]:{},eventName:se});l([N])}},onError(U){o==null||o(U)}});v=j,_||v()}catch(b){o==null||o(b)}})(),()=>v()})()}function aAe(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:a=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const c=na(["watchPendingTransactions",t.uid,e,a]);return nh(c,{onTransactions:n,onError:r},u=>{let f;const h=jw(async()=>{var g;try{if(!f)try{f=await nr(t,fX,"createPendingTransactionFilter")({});return}catch(w){throw h(),w}const m=await nr(t,$9,"getFilterChanges")({filter:f});if(m.length===0)return;if(e)u.onTransactions(m);else for(const w of m)u.onTransactions([w])}catch(m){(g=u.onError)==null||g.call(u,m)}},{emitOnBegin:!0,interval:a});return async()=>{f&&await nr(t,P9,"uninstallFilter")({filter:f}),h()}})})():(()=>{let c=!0,u=()=>c=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(h){if(!c)return;const g=h.result;n([g])},onError(h){r==null||r(h)}});u=f,c||u()}catch(f){r==null||r(f)}})(),()=>u()})()}function sAe(t){var f,h,g;const{scheme:e,statement:r,...n}=((f=t.match(oAe))==null?void 0:f.groups)??{},{chainId:i,expirationTime:a,issuedAt:s,notBefore:o,requestId:l,...c}=((h=t.match(lAe))==null?void 0:h.groups)??{},u=(g=t.split("Resources:")[1])==null?void 0:g.split(` -- `).slice(1);return{...n,...c,...i?{chainId:Number(i)}:{},...a?{expirationTime:new Date(a)}:{},...s?{issuedAt:new Date(s)}:{},...o?{notBefore:new Date(o)}:{},...l?{requestId:l}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}const oAe=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,lAe=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function cAe(t){const{address:e,domain:r,message:n,nonce:i,scheme:a,time:s=new Date}=t;if(r&&n.domain!==r||i&&n.nonce!==i||a&&n.scheme!==a||n.expirationTime&&s>=n.expirationTime||n.notBefore&&sj9(t,e),createAccessList:e=>oCe(t,e),createBlockFilter:()=>lCe(t),createContractEventFilter:e=>CQ(t,e),createEventFilter:e=>dX(t,e),createPendingTransactionFilter:()=>fX(t),estimateContractGas:e=>o_e(t,e),estimateGas:e=>YN(t,e),getBalance:e=>YQ(t,e),getBlobBaseFee:()=>cCe(t),getBlock:e=>ru(t,e),getBlockNumber:e=>$w(t,e),getBlockTransactionCount:e=>uCe(t,e),getBytecode:e=>pU(t,e),getChainId:()=>Lw(t),getCode:e=>pU(t,e),getContractEvents:e=>KQ(t,e),getEip712Domain:e=>j_e(t,e),getEnsAddress:e=>G_e(t,e),getEnsAvatar:e=>iCe(t,e),getEnsName:e=>aCe(t,e),getEnsResolver:e=>sCe(t,e),getEnsText:e=>uX(t,e),getFeeHistory:e=>fCe(t,e),estimateFeesPerGas:e=>VEe(t,e),getFilterChanges:e=>$9(t,e),getFilterLogs:e=>hCe(t,e),getGasPrice:()=>HN(t),getLogs:e=>QN(t,e),getProof:e=>qCe(t,e),estimateMaxPriorityFeePerGas:e=>qEe(t,e),getStorageAt:e=>VCe(t,e),getTransaction:e=>aL(t,e),getTransactionConfirmations:e=>YCe(t,e),getTransactionCount:e=>FQ(t,e),getTransactionReceipt:e=>lM(t,e),multicall:e=>KCe(t,e),prepareTransactionRequest:e=>k9(t,e),readContract:e=>Dd(t,e),sendRawTransaction:e=>XN(t,e),simulate:e=>pSe(t,e),simulateContract:e=>E_e(t,e),verifyMessage:e=>eAe(t,e),verifySiweMessage:e=>uAe(t,e),verifyTypedData:e=>tAe(t,e),uninstallFilter:e=>P9(t,e),waitForTransactionReceipt:e=>rAe(t,e),watchBlocks:e=>nAe(t,e),watchBlockNumber:e=>DX(t,e),watchContractEvent:e=>T_e(t,e),watchEvent:e=>iAe(t,e),watchPendingTransactions:e=>aAe(t,e)}}function yc(t){const{key:e="public",name:r="Public Client"}=t;return iX({...t,key:e,name:r,type:"publicClient"}).extend(hL)}function dAe(t,e){const{abi:r,args:n,bytecode:i,...a}=e,s=L9({abi:r,args:n,bytecode:i});return eL(t,{...a,data:s})}async function fAe(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Aw(n))}async function hAe(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function pAe(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>jN(r))}async function gAe(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function mAe(t,{account:e=t.account,message:r}){if(!e)throw new Pw({docsPath:"/docs/actions/wallet/signMessage"});const n=ps(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?kg(r):r.raw instanceof Uint8Array?ur(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function yAe(t,e){var c,u,f,h;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new Pw({docsPath:"/docs/actions/wallet/signTransaction"});const a=ps(r);p1({account:a,...e});const s=await nr(t,Lw,"getChainId")({});n!==null&&rX({currentChainId:s,chain:n});const o=(n==null?void 0:n.formatters)||((c=t.chain)==null?void 0:c.formatters),l=((u=o==null?void 0:o.transactionRequest)==null?void 0:u.format)||_m;return a.signTransaction?a.signTransaction({...i,chainId:s},{serializer:(h=(f=t.chain)==null?void 0:f.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...l(i),chainId:lr(s),from:a.address}]},{retryCount:0})}async function wAe(t,e){const{account:r=t.account,domain:n,message:i,primaryType:a}=e;if(!r)throw new Pw({docsPath:"/docs/actions/wallet/signTypedData"});const s=ps(r),o={EIP712Domain:wX({domain:n}),...e.types};if(yX({domain:n,message:i,primaryType:a,types:o}),s.signTypedData)return s.signTypedData({domain:n,message:i,primaryType:a,types:o});const l=ECe({domain:n,message:i,primaryType:a,types:o});return t.request({method:"eth_signTypedData_v4",params:[s.address,l]},{retryCount:0})}async function vAe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(e)}]},{retryCount:0})}async function bAe(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function xAe(t){return{addChain:e=>P_e(t,e),deployContract:e=>dAe(t,e),getAddresses:()=>fAe(t),getChainId:()=>Lw(t),getPermissions:()=>hAe(t),prepareTransactionRequest:e=>k9(t,e),requestAddresses:()=>pAe(t),requestPermissions:e=>gAe(t,e),sendRawTransaction:e=>XN(t,e),sendTransaction:e=>eL(t,e),signMessage:e=>mAe(t,e),signTransaction:e=>yAe(t,e),signTypedData:e=>wAe(t,e),switchChain:e=>vAe(t,e),watchAsset:e=>bAe(t,e),writeContract:e=>N_e(t,e)}}function OX(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return iX({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(xAe)}function SU(t){return t?`${t.slice(0,5)}…${t.slice(-4)}`:""}function EAe({wei:t,precision:e=3}){return parseFloat(Tw(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function AU({amount:t,decimals:e}){return C9(BigInt(t),e)}const _Ae=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,CAe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,SAe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function AAe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){IAe(t);return}return e}function IAe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function ny(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!SAe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(_Ae.test(t)||CAe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,AAe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const MAe=/#/g,TAe=/&/g,kAe=/\//g,NAe=/=/g,pL=/\+/g,LAe=/%5e/gi,jAe=/%60/gi,$Ae=/%7c/gi,PAe=/%20/gi;function RAe(t){return encodeURI(""+t).replace($Ae,"|")}function pM(t){return RAe(typeof t=="string"?t:JSON.stringify(t)).replace(pL,"%2B").replace(PAe,"+").replace(MAe,"%23").replace(TAe,"%26").replace(jAe,"`").replace(LAe,"^").replace(kAe,"%2F")}function TC(t){return pM(t).replace(NAe,"%3D")}function FX(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function DAe(t){return FX(t.replace(pL," "))}function OAe(t){return FX(t.replace(pL," "))}function FAe(t=""){const e={};t[0]==="?"&&(t=t.slice(1));for(const r of t.split("&")){const n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const i=DAe(n[1]);if(i==="__proto__"||i==="constructor")continue;const a=OAe(n[2]||"");e[i]===void 0?e[i]=a:Array.isArray(e[i])?e[i].push(a):e[i]=[e[i],a]}return e}function UAe(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${TC(t)}=${pM(r)}`).join("&"):`${TC(t)}=${pM(e)}`:TC(t)}function BAe(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>UAe(e,t[e])).filter(Boolean).join("&")}const zAe=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,WAe=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,HAe=/^([/\\]\s*){2,}[^/\\]/,GAe=/^\.?\//;function UX(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?zAe.test(t):WAe.test(t)||(e.acceptRelative?HAe.test(t):!1)}function qAe(t="",e){return t.endsWith("/")}function VAe(t="",e){return(qAe(t)?t.slice(0,-1):t)||"/"}function YAe(t="",e){return t.endsWith("/")?t:t+"/"}function KAe(t,e){if(ZAe(e)||UX(t))return t;const r=VAe(e);return t.startsWith(r)?t:XAe(r,t)}function JAe(t,e){const r=eIe(t),n={...FAe(r.search),...e};return r.search=BAe(n),tIe(r)}function ZAe(t){return!t||t==="/"}function QAe(t){return t&&t!=="/"}function XAe(t,...e){let r=t||"";for(const n of e.filter(i=>QAe(i)))if(r){const i=n.replace(GAe,"");r=YAe(r)+i}else r=n;return r}const BX=Symbol.for("ufo:protocolRelative");function eIe(t="",e){const r=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(r){const[,f,h=""]=r;return{protocol:f.toLowerCase(),pathname:h,href:f+h,auth:"",host:"",search:"",hash:""}}if(!UX(t,{acceptRelative:!0}))return IU(t);const[,n="",i,a=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,s="",o=""]=a.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:c,hash:u}=IU(o);return{protocol:n.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:s,pathname:l,search:c,hash:u,[BX]:!n}}function IU(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function tIe(t){const e=t.pathname||"",r=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",i=t.auth?t.auth+"@":"",a=t.host||"";return(t.protocol||t[BX]?(t.protocol||"")+"//":"")+i+a+e+r+n}class zX extends Error{constructor(e,r){super(e,r),this.name="FetchError",r!=null&&r.cause&&!this.cause&&(this.cause=r.cause)}}function rIe(t){var l,c,u,f,h;const e=((l=t.error)==null?void 0:l.message)||((c=t.error)==null?void 0:c.toString())||"",r=((u=t.request)==null?void 0:u.method)||((f=t.options)==null?void 0:f.method)||"GET",n=((h=t.request)==null?void 0:h.url)||String(t.request)||"/",i=`[${r}] ${JSON.stringify(n)}`,a=t.response?`${t.response.status} ${t.response.statusText}`:"",s=`${i}: ${a}${e?` ${e}`:""}`,o=new zX(s,t.error?{cause:t.error}:void 0);for(const g of["request","options","response"])Object.defineProperty(o,g,{get(){return t[g]}});for(const[g,m]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(o,g,{get(){return t.response&&t.response[m]}});return o}const nIe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function MU(t="GET"){return nIe.has(t.toUpperCase())}function iIe(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const aIe=new Set(["image/svg","application/xml","application/xhtml","application/html"]),sIe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function oIe(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return sIe.test(e)?"json":aIe.has(e)||e.startsWith("text/")?"text":"blob"}function lIe(t,e,r,n){const i=cIe((e==null?void 0:e.headers)??(t==null?void 0:t.headers),r==null?void 0:r.headers,n);let a;return(r!=null&&r.query||r!=null&&r.params||e!=null&&e.params||e!=null&&e.query)&&(a={...r==null?void 0:r.params,...r==null?void 0:r.query,...e==null?void 0:e.params,...e==null?void 0:e.query}),{...r,...e,query:a,params:a,headers:i}}function cIe(t,e,r){if(!e)return new r(t);const n=new r(e);if(t)for(const[i,a]of Symbol.iterator in t||Array.isArray(t)?t:new r(t))n.set(i,a);return n}async function h4(t,e){if(e)if(Array.isArray(e))for(const r of e)await r(t);else await e(t)}const uIe=new Set([408,409,425,429,500,502,503,504]),dIe=new Set([101,204,205,304]);function WX(t={}){const{fetch:e=globalThis.fetch,Headers:r=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function i(o){const l=o.error&&o.error.name==="AbortError"&&!o.options.timeout||!1;if(o.options.retry!==!1&&!l){let u;typeof o.options.retry=="number"?u=o.options.retry:u=MU(o.options.method)?0:1;const f=o.response&&o.response.status||500;if(u>0&&(Array.isArray(o.options.retryStatusCodes)?o.options.retryStatusCodes.includes(f):uIe.has(f))){const h=typeof o.options.retryDelay=="function"?o.options.retryDelay(o):o.options.retryDelay||0;return h>0&&await new Promise(g=>setTimeout(g,h)),a(o.request,{...o.options,retry:u-1})}}const c=rIe(o);throw Error.captureStackTrace&&Error.captureStackTrace(c,a),c}const a=async function(l,c={}){const u={request:l,options:lIe(l,c,t.defaults,r),response:void 0,error:void 0};u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&await h4(u,u.options.onRequest),typeof u.request=="string"&&(u.options.baseURL&&(u.request=KAe(u.request,u.options.baseURL)),u.options.query&&(u.request=JAe(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&MU(u.options.method)&&(iIe(u.options.body)?(u.options.body=typeof u.options.body=="string"?u.options.body:JSON.stringify(u.options.body),u.options.headers=new r(u.options.headers||{}),u.options.headers.has("content-type")||u.options.headers.set("content-type","application/json"),u.options.headers.has("accept")||u.options.headers.set("accept","application/json")):("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half")));let f;if(!u.options.signal&&u.options.timeout){const g=new n;f=setTimeout(()=>{const m=new Error("[TimeoutError]: The operation was aborted due to timeout");m.name="TimeoutError",m.code=23,g.abort(m)},u.options.timeout),u.options.signal=g.signal}try{u.response=await e(u.request,u.options)}catch(g){return u.error=g,u.options.onRequestError&&await h4(u,u.options.onRequestError),await i(u)}finally{f&&clearTimeout(f)}if((u.response.body||u.response._bodyInit)&&!dIe.has(u.response.status)&&u.options.method!=="HEAD"){const g=(u.options.parseResponse?"json":u.options.responseType)||oIe(u.response.headers.get("content-type")||"");switch(g){case"json":{const m=await u.response.text(),w=u.options.parseResponse||ny;u.response._data=w(m);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[g]()}}return u.options.onResponse&&await h4(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await h4(u,u.options.onResponseError),await i(u)):u.response},s=async function(l,c){return(await a(l,c))._data};return s.raw=a,s.native=(...o)=>e(...o),s.create=(o={},l={})=>WX({...t,...l,defaults:{...t.defaults,...l.defaults,...o}}),s}const $5=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),fIe=$5.fetch?(...t)=>$5.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),hIe=$5.Headers,pIe=$5.AbortController,HX=WX({fetch:fIe,Headers:hIe,AbortController:pIe});var or;let qs=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},rl=class extends qs{constructor(e,r,n,i,a,s){super(n,i,a),this.type=e,this.status=r,this.data=s}},_e=class extends qs{constructor(e,r,n){super(e,r,n),this.type="client_error"}},gIe=class extends _e{constructor(){super("Request timed out",void 0,"client_request_timeout")}},Pn=class extends qs{constructor(e,r,n){super(e,r,n),this.type="connector_error"}};const Vr=t=>{if(t instanceof qs)return t;if(!(t instanceof zX))return _n(t);if(!t.response)return new rl("api_error",null,t.message,t);let{type:e,message:r,error:n,code:i}=t.data;return new rl(e||"ApiError",t.response.status,r||n,t,i,t.data)},_n=t=>t instanceof qs?t:t instanceof Error?new _e(t.message,t):new _e(`Internal error: ${t}`);var Ae=((or={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",or.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",or.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",or.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",or.INVALID_DATA="invalid_data",or.INVALID_CAPTCHA="invalid_captcha",or.LINKED_TO_ANOTHER_USER="linked_to_another_user",or.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",or.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",or.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",or.USER_EXITED_UPDATE_FLOW="exited_update_flow",or.ALLOWLIST_REJECTED="allowlist_rejected",or.OAUTH_USER_DENIED="oauth_user_denied",or.OAUTH_UNEXPECTED="oauth_unexpected",or.UNKNOWN_AUTH_ERROR="unknown_auth_error",or.USER_EXITED_AUTH_FLOW="exited_auth_flow",or.USER_EXITED_LINK_FLOW="exited_link_flow",or.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",or.MUST_BE_AUTHENTICATED="must_be_authenticated",or.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",or.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",or.CLIENT_REQUEST_TIMEOUT="client_request_timeout",or.INVALID_CREDENTIALS="invalid_credentials",or.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",or.UNKNOWN_MFA_ERROR="unknown_mfa_error",or.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",or.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",or.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",or.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",or.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",or.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",or.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",or.TRANSACTION_FAILURE="transaction_failure",or.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",or.NOT_SUPPORTED="not_supported",or.CAPTCHA_TIMEOUT="captcha_timeout",or.INVALID_MESSAGE="invalid_message",or.UNABLE_TO_SIGN="unable_to_sign",or.CAPTCHA_FAILURE="captcha_failure",or.CAPTCHA_DISABLED="captcha_disabled",or.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",or.TOO_MANY_REQUESTS="too_many_requests",or.USER_LIMIT_REACHED="max_accounts_reached",or.DISALLOWED_LOGIN_METHOD="disallowed_login_method",or.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",or.PASSKEY_NOT_ALLOWED="passkey_not_allowed",or.USER_DOES_NOT_EXIST="user_does_not_exist",or.INSUFFICIENT_BALANCE="insufficient_balance",or.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",or);let cp=class extends _e{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},Kf=class extends _e{constructor(e="Embedded wallet error",r){super(e,r,"unknown_embedded_wallet_error")}},mIe=class extends _e{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},Fw=class extends _e{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}};const GX="/api/v1/sessions",qX="/api/v1/sessions/logout",yIe="/api/v1/sessions/fork",VX="/api/v1/sessions/fork/recover",wIe="/api/v1/siwe/init",vIe="/api/v1/siwe/authenticate",bIe="/api/v1/siwe/link",xIe="/api/v1/siwe/link_smart_wallet",EIe="/api/v1/siwe/unlink",_Ie="/api/v1/siwe/transfer",CIe="/api/v1/siws/init",SIe="/api/v1/siws/authenticate",AIe="/api/v1/siws/link",IIe="/api/v1/siws/unlink",MIe="/api/v1/farcaster/init",TIe="/api/v1/farcaster/authenticate",kIe="/api/v1/farcaster/link",NIe="/api/v1/farcaster/status",LIe="/api/v1/farcaster/unlink",jIe="/api/v1/farcaster/transfer",$Ie="/api/v1/passwordless/init",PIe="/api/v1/passwordless/authenticate",RIe="/api/v1/passwordless/link",DIe="/api/v1/passwordless/unlink",OIe="/api/v1/passwordless/update",FIe="/api/v1/passwordless/transfer",UIe="/api/v1/passwordless_sms/init",BIe="/api/v1/passwordless_sms/link",zIe="/api/v1/passwordless_sms/unlink",WIe="/api/v1/passwordless_sms/authenticate",HIe="/api/v1/passwordless_sms/update",GIe="/api/v1/passwordless_sms/transfer",YX="/api/v1/oauth/init",KX="/api/v1/oauth/authenticate",JX="/api/v1/oauth/link",qIe="/api/v1/oauth/unlink",VIe="/api/v1/oauth/transfer",YIe="/api/v1/recovery/oauth/init",KIe="/api/v1/recovery/oauth/init_icloud",JIe="/api/v1/recovery/oauth/authenticate",ZIe="/api/v1/passkeys/link/init",QIe="/api/v1/passkeys/authenticate/init",XIe="/api/v1/passkeys/link",eMe="/api/v1/passkeys/authenticate",tMe="/api/v1/passkeys/unlink",rMe="/api/v1/telegram/authenticate",nMe="/api/v1/telegram/link",iMe="/api/v1/telegram/unlink",aMe="/api/v1/telegram/transfer",sMe="/api/v1/mfa/passwordless_sms/init",oMe="/api/v1/mfa/passkeys/init",lMe="/api/v1/users/me/accept_terms",ZX="/api/v1/analytics_events",cMe="/api/v1/custom_jwt_account/authenticate",uMe="/api/v1/guest/authenticate",dMe="/api/v1/plugins/moonpay_on_ramp/sign",fMe="/api/v1/funding/coinbase_on_ramp/init",hMe="/api/v1/funding/coinbase_on_ramp/status",pMe="/api/v1/wallets/revoke";let QX=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(cMe,{token:this.meta.token})}catch(e){throw Vr(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}};function z9(t){return t?{"privy-ui":"t"}:void 0}let Vp=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _e("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(PIe,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _e("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(RIe,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw Vr(e)}}async sendCodeEmail({email:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new _e("Auth flow has no API instance");if(e&&(this.meta.email=e),r&&(this.meta.captchaToken=r),!this.meta.email)throw new _e("Email must be set when initialzing authentication.");let i=z9(n);try{return await this.api.post($Ie,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(a){throw Vr(a)}}constructor({email:e,captchaToken:r,disableSignup:n}){this.meta={email:e,captchaToken:r,disableSignup:n??!1}}},gMe=class extends Vp{async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new _e("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(OIe,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw Vr(e)}}constructor(e,r,n){super({email:r,captchaToken:n}),this.meta={email:r,captchaToken:n,oldAddress:e,disableSignup:!1}}},mMe=class{get(e){return this._cache[e]}put(e,r){r!==void 0?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}},XX=class{get(e){let r=localStorage.getItem(e);return r===null?void 0:JSON.parse(r)}put(e,r){r!==void 0?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}};function gM(){try{let t="privy:__session_storage__test",e=new XX;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var Dt=typeof window<"u"&&window.localStorage?new XX:new mMe;function yMe(){var n;let t=window,e=t.ethereum;if(!e)return[];let r=[];if((n=e.providers)!=null&&n.length)for(let i of e.providers)i&&r.push(i);return r.push(t.ethereum),r}const eee=t=>t.isApexWallet?"Apex Wallet":t.isAvalanche?"Core Wallet":t.isBackpack?"Backpack":t.isBifrost?"Bifrost Wallet":t.isBitKeep?"BitKeep":t.isBitski?"Bitski":t.isBlockWallet?"BlockWallet":t.isBraveWallet?"Brave Wallet":t.isClover?"Clover":t.isCoin98?"Coin98 Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isDawn?"Dawn Wallet":t.isDefiant?"Defiant":t.isDesig?"Desig Wallet":t.isEnkrypt?"Enkrypt":t.isExodus?"Exodus":t.isFordefi?"Fordefi":t.isFrame?"Frame":t.isFrontier?"Frontier Wallet":t.isGamestop?"GameStop Wallet":t.isHaqqWallet?"HAQQ Wallet":t.isHyperPay?"HyperPay Wallet":t.isImToken?"ImToken":t.isHaloWallet?"Halo Wallet":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isNovaWallet?"Nova Wallet":t.isOkxWallet||t.isOKExWallet?"OKX Wallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOneKey?"OneKey Wallet":t.isOpera?"Opera":t.isPhantom?"Phantom":t.isPortal?"Ripio Portal":t.isRabby?"Rabby Wallet":t.isRainbow?"Rainbow":t.isSafePal?"SafePal Wallet":t.isStatus?"Status":t.isSubWallet?"SubWallet":t.isTalisman?"Talisman":t.isTally||t.isTaho?"Taho":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isTTWallet?"TTWallet":t.isXDEFI?"XDEFI Wallet":t.isZeal?"Zeal":t.isZerion?"Zerion":t.isMetaMask?"MetaMask":void 0,tee=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;if(t.isBraveWallet&&!t._events&&!t._state||eee(t)!=="MetaMask")return!1;if(t.providers){for(let r of t.providers)if(!tee(r))return!1}return!0},W9=()=>{var t,e,r,n,i,a;if("phantom"in window){let s=window;if((e=(t=s==null?void 0:s.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((n=(r=s==null?void 0:s.phantom)==null?void 0:r.ethereum)!=null&&n.chainId)||(a=(i=s==null?void 0:s.phantom)==null?void 0:i.solana)!=null&&a.isPhantom)return!0}return!1},ree=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let e of t.ethereum.providers)if(e&&e.isCoinbaseWallet)return!0}return!1},wMe=(t,e)=>{let r=[],n=[];for(let[i,a]of t.entries())i!!String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),vMe=(t,e)=>{let r=t.slice(0),n=[];for(;r.length;)n.push(r.splice(0,e));return n},ns=(t,e=3,r=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0;return e+r+i+3>=t.length?t:`${t.slice(0,i+e)}...${t.slice(t.length-r,t.length)}`},kC=(t,e=3,r=4)=>ns(t,e,r,"solana"),iee=t=>new Promise(e=>setTimeout(e,t));function bMe(t,{interval:e=100,timeout:r=5e3}={}){return new Promise((n,i)=>{let a,s=0,o=()=>{s>=r?i("Max attempts reached without result"):(a=t(),s+=e,a==null?setTimeout(o,e):n(a))};o()})}const mM=(t,e={})=>{let r=e.delayMs||150,n=e.maxAttempts||270;return new Promise(async(i,a)=>{var l;let s=!1,o=0;for(;!s&&o{s=!0,i(c)},(...c)=>{s=!0,a(...c)}),o+=1,await iee(r)}s||a(Error("Exceeded max attempts before resolving function"))})},aee=(t,e,r={},n={})=>{let i=new URL(e,t);for(let[s,o]of Object.entries(r))o!==void 0&&i.searchParams.set(s,o);let a=Object.entries(n);if(a.length>0){let s=new URLSearchParams;for(let[o,l]of a)s.append(o,l);i.hash=s.toString()}return i.href},xMe=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),P5=t=>typeof t=="string"?t:"0x"+t.toString(16);async function EMe({store:t,walletList:e,externalWalletConfig:r,walletChainType:n,timeout:i=3e3}){let a=!1,s=window;return new Promise(o=>{function l(){if(a)return;a=!0,window.removeEventListener("ethereum#initialized",l);let c=t.getProviders();console.debug("Detected injected providers:",c.map(f=>f.info));let u=[];for(let f of c)e.includes("coinbase_wallet")&&f.info.rdns==="com.coinbase.wallet"||n==="solana-only"&&f.info.rdns==="app.phantom"||u.push({type:f.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:f});if(n!=="solana-only")for(let f of yMe()){let h=eee(f);if(!c.some(g=>g.info.name===h)){if(tee(f,!0)&&!u.find(g=>g.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:f});continue}if(h==="Phantom"&&!u.find(g=>g.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:f});continue}if(h==="Coinbase Wallet"&&!u.find(g=>{var m;return g.type==="coinbase_wallet"&&((m=r.coinbaseWallet)==null?void 0:m.connectionOptions)!=="smartWalletOnly"})){u.push({type:"coinbase_wallet",legacyInjectedProvider:f});continue}u.find(g=>g.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:f})}}o(u)}s.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},i))})}function y6(t){return`eip155:${String(Number(t))}`}const _Me=(t,e,r,n)=>{let i=Number(t),a=e.find(s=>s.id===i);if(!a)throw new Pn(`Unsupported chainId ${t}`,4901);return ih(a,r,n)},ih=(t,e,r)=>{var s,o,l;let n,i=t.id,a=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])n=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[a])n=e.rpcUrls[a];else if((s=t.rpcUrls.privy)!=null&&s.http[0]){let c=new URL(t.rpcUrls.privy.http[0]);c.searchParams.append("privyAppId",r),n=c.toString()}else n=(o=t.rpcUrls.public)!=null&&o.http[0]?t.rpcUrls.public.http[0]:(l=t.rpcUrls.default)==null?void 0:l.http[0];if(!n)throw new Pn(`No RPC url found for ${i}`);return n},CMe=(t,e)=>{var i;let r=Number(t),n=e.find(a=>a.id===r);if(!n)throw new Pn(`Unsupported chainId ${t}`,4901);return(i=n.blockExplorers)==null?void 0:i.default.url},Rg=(t,e,r,n)=>{var s,o,l;let i=Number(t),a=e.find(c=>c.id===i);if(!a)throw new Pn(`Unsupported chainId ${t}`,4901);return new Yve(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?a.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[i]?r.rpcUrls[i]:(s=a.rpcUrls.privy)!=null&&s.http[0]?{url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:(o=a.rpcUrls.public)!=null&&o.http[0]?a.rpcUrls.public.http[0]:(l=a.rpcUrls.default)==null?void 0:l.http[0])},yM=t=>{let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=t.types.EIP712Domain??Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in e)return{name:n,type:e[n]}}).filter(n=>n!==void 0);return{...t,types:{...t.types,EIP712Domain:r}}};function SMe(t,{min:e,max:r}){return Math.min(Math.max(t,e),r)}const NC=t=>{let e;try{e=new URL(t).hostname}catch{return}for(let[r,n]of Object.entries(wM))if(e.includes(n.hostname))return{walletClientType:r,entry:n}},wM={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}},bybit_wallet:{id:"15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f",displayName:"Bybit Wallet",hostname:"bybit.com",mobile:{}}};function see(t){return{name:t.displayName||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function AMe(t,e){let r=see(e);if(r.deepLink)return cee(r.deepLink,t);if(r.universalLink)return gL(r.universalLink,t);throw new _e(`Unsupported wallet ${e.id}`)}function IMe(t,e){let r=see(e);if(r.universalLink)return gL(r.universalLink,t)}let oee="WALLETCONNECT_DEEPLINK_CHOICE";function MMe(){try{localStorage.removeItem(oee)}catch{}}function TMe({href:t,name:e}){try{localStorage.setItem(oee,JSON.stringify({href:t,name:e}))}catch{}}function lee(t){return t.startsWith("http://")||t.startsWith("https://")}function cee(t,e){if(lee(t))return gL(t,e);let r=t;return r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function gL(t,e){if(!lee(t))return cee(t,e);let r=t;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function uee(t,e){window.open(t,e,"noreferrer noopener")}let rs=class{execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}},TU=class{get meta(){return this._meta}async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.channelToken)throw new _e("Auth flow must be initialized first");try{let e=await this.api.post(TIe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new _e("No response from authentication");return e}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(kIe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw Vr(e)}}async _startChannelOnce(){if(!this.api)throw new _e("Auth flow has no API instance");let e=await this.api.post(MIe,{token:this.captchaToken});ma&&!_N&&e.connect_uri&&uee(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new _e("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.channelToken)throw new _e("Auth flow must be initialized first");let e=await this.api.get(NIe,{headers:{"farcaster-channel-token":this.meta.channelToken}});return e.state==="completed"&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,r=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new rs(this._startChannelOnce.bind(this)),this.pollForReady=new rs(this._pollForReady.bind(this)),this._meta.disableSignup=r}};const kMe="34357d3c125c2bcf2ce2bc3309d98715",vM="https://auth.privy.io",NMe=2e4,Dn=1400,mL=2500,H9=4e3,LMe="1.98.4",iy="privy:token",kU="privy-token",LC="privy:refresh_token",jMe="privy-refresh-token",w6="privy:pat",NU="privy:id_token",LU="privy-id-token",jC="privy-session",bM="privy:session_transfer_token",xM="privy:caid",dee=t=>`privy:guest:${t}`,p4=t=>`privy:cross-app:${t}`,R5="privy:state_code",ay="privy:code_verifier",D5="privy:headless_oauth",O5="privy:oauth_disable_signup",$C=t=>`privy:wallet:${t}`,jU="privy:connectors",fee="privy:connections",G9=12e4,O3=1,$U="0x1",yL=3e4,$Me="https://api.moonpay.com/v1",PMe="https://api.moonpay.com/v1",RMe="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",DMe="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",OMe="deprecated";async function FMe(t){let e=new TextEncoder().encode(t);return new Uint8Array(await crypto.subtle.digest("SHA-256",e))}function EM(t){return crypto.getRandomValues(new Uint8Array(t))}let hee=class{getOrCreateGuestCredential(e){let r=dee(e);if(gM()){if(Dt.get(r))return Dt.get(r);{let n=k5(EM(32));return Dt.put(r,n),n}}return k5(EM(32))}async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(uMe,{guest_credential:this.meta.guestCredential})}catch(e){throw Vr(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}},g4=class{async initAuthenticationFlow(e){if(!this.api)throw new _e("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new _e("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){var r,n;let e=await Ws(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new _e("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new _e("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let i=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(eMe,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(i)})}catch(i){throw i.name==="NotAllowedError"?new _e("Passkey request timed out or rejected by user.",void 0,Ae.PASSKEY_NOT_ALLOWED):Vr(i)}}async link(){var r,n;let e=await Ws(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new _e("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new _e("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,a=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(XIe,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(a)})}catch(i){throw i.name==="NotAllowedError"?new _e("Passkey request timed out or rejected by user.",void 0,Ae.PASSKEY_NOT_ALLOWED):Vr(i)}}async _initAuthenticateOnce(e){if(!this.api)throw new _e("Auth flow has no API instance");let r=z9(e);return await this.api.post(QIe,{token:this.meta.captchaToken},{headers:{...r}})}async _initLinkOnce(){if(!this.api)throw new _e("Auth flow has no API instance");return await this.api.post(ZIe,{})}_transformInitLinkOptionsToCamelCase(e){var r,n,i,a,s,o,l,c,u;return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map(f=>({type:f.type,alg:f.alg})),timeout:e.timeout,excludeCredentials:(r=e.exclude_credentials)==null?void 0:r.map(f=>({id:f.id,type:f.type,transports:f.transports})),authenticatorSelection:{authenticatorAttachment:(n=e.authenticator_selection)==null?void 0:n.authenticator_attachment,requireResidentKey:(i=e.authenticator_selection)==null?void 0:i.require_resident_key,residentKey:(a=e.authenticator_selection)==null?void 0:a.resident_key,userVerification:(s=e.authenticator_selection)==null?void 0:s.user_verification},attestation:e.attestation,extensions:{appid:(o=e.extensions)==null?void 0:o.app_id,credProps:(c=(l=e.extensions)==null?void 0:l.cred_props)==null?void 0:c.rk,hmacCreateSecret:(u=e.extensions)==null?void 0:u.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){var r,n,i,a;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((r=e.allow_credentials)==null?void 0:r.map(s=>({id:s.id,type:s.type,transports:s.transports})))||[],timeout:e.timeout,extensions:{appid:(n=e.extensions)==null?void 0:n.app_id,credProps:(i=e.extensions)==null?void 0:i.cred_props,hmacCreateSecret:(a=e.extensions)==null?void 0:a.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:r}){this.initAuthenticateOnce=new rs(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new rs(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:r}}};const _M=({address:t,chainId:e,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account: +`,i+=pU(n.state)),n.stateDiff&&(i+=` stateDiff: +`,i+=pU(n.stateDiff)),i},` State Override: +`).slice(0,-1)}function Ow(t){const e=Object.entries(t).map(([n,i])=>i===void 0||i===!1?null:[n,i]).filter(Boolean),r=e.reduce((n,[i])=>Math.max(n,i.length),0);return e.map(([n,i])=>` ${`${n}:`.padEnd(r+1)} ${i}`).join(` +`)}class WEe extends Qe{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(` +`),{name:"FeeConflictError"})}}class HEe extends Qe{constructor({v:e}){super(`Invalid \`v\` value "${e}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class GEe extends Qe{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Ow(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class qEe extends Qe{constructor({storageKey:e}){super(`Size for storage key "${e}" is invalid. Expected 32 bytes. Got ${Math.floor((e.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}class VEe extends Qe{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=Ow({chain:i&&`${i==null?void 0:i.name} (id: ${i==null?void 0:i.id})`,from:r==null?void 0:r.address,to:f,value:typeof h<"u"&&`${Dw(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${Gs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Gs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Gs(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Request Arguments:",g].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class QZ extends Qe{constructor({blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){let s="Transaction";n&&a!==void 0&&(s=`Transaction at block time "${n}" at index "${a}"`),e&&a!==void 0&&(s=`Transaction at block hash "${e}" at index "${a}"`),r&&a!==void 0&&(s=`Transaction at block number "${r}" at index "${a}"`),i&&(s=`Transaction with hash "${i}"`),super(`${s} could not be found.`,{name:"TransactionNotFoundError"})}}class ZZ extends Qe{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class YEe extends Qe{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const KEe=t=>t,KN=t=>t;class XZ extends Qe{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h,stateOverride:g}){var C;const m=r?ms(r):void 0;let w=Ow({from:m==null?void 0:m.address,to:f,value:typeof h<"u"&&`${Dw(h)} ${((C=i==null?void 0:i.nativeCurrency)==null?void 0:C.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${Gs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Gs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Gs(c)} gwei`,nonce:u});g&&(w+=` +${zEe(g)}`),super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",w].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class JEe extends Qe{constructor(e,{abi:r,args:n,contractAddress:i,docsPath:a,functionName:s,sender:o}){const l=Pw({abi:r,args:n,name:s}),c=l?KZ({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,u=l?Iu(l,{includeName:!0}):void 0,f=Ow({address:i&&KEe(i),function:u,args:c&&c!=="()"&&`${[...Array((s==null?void 0:s.length)??0).keys()].map(()=>" ").join("")}${c}`,sender:o});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:a,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=r,this.args=n,this.cause=e,this.contractAddress=i,this.functionName=s,this.sender=o}}class iM extends Qe{constructor({abi:e,data:r,functionName:n,message:i}){let a,s,o,l;if(r&&r!=="0x")try{s=OEe({abi:e,data:r});const{abiItem:u,errorName:f,args:h}=s;if(f==="Error")l=h[0];else if(f==="Panic"){const[g]=h;l=VZ[g]}else{const g=u?Iu(u,{includeName:!0}):void 0,m=u&&h?KZ({abiItem:u,args:h,includeFunctionName:!1,includeName:!1}):void 0;o=[g?`Error: ${g}`:"",m&&m!=="()"?` ${[...Array((f==null?void 0:f.length)??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(u){a=u}else i&&(l=i);let c;a instanceof AZ&&(c=a.signature,o=[`Unable to decode signature "${c}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${c}.`]),super(l&&l!=="execution reverted"||c?[`The contract function "${n}" reverted with the following ${c?"signature":"reason"}:`,l||c].join(` +`):`The contract function "${n}" reverted.`,{cause:a,metaMessages:o,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=s,this.reason=l,this.signature=c}}class QEe extends Qe{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class ZEe extends Qe{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class $9 extends Qe{constructor({data:e,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}class Dy extends Qe{constructor({body:e,cause:r,details:n,headers:i,status:a,url:s}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[a&&`Status: ${a}`,`URL: ${KN(s)}`,e&&`Request body: ${ia(e)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=a,this.url=s}}class JN extends Qe{constructor({body:e,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${KN(n)}`,`Request body: ${ia(e)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data}}class gU extends Qe{constructor({body:e,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${KN(r)}`,`Request body: ${ia(e)}`],name:"TimeoutError"})}}const XEe=-1;class Xs extends Qe{constructor(e,{code:r,docsPath:n,metaMessages:i,name:a,shortMessage:s}){super(s,{cause:e,docsPath:n,metaMessages:i||(e==null?void 0:e.metaMessages),name:a||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=a||e.name,this.code=e instanceof JN?e.code:r??XEe}}class km extends Xs{constructor(e,r){super(e,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class k3 extends Xs{constructor(e){super(e,{code:k3.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(k3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class N3 extends Xs{constructor(e){super(e,{code:N3.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(N3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class L3 extends Xs{constructor(e,{method:r}={}){super(e,{code:L3.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(L3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class j3 extends Xs{constructor(e){super(e,{code:j3.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(j3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class X0 extends Xs{constructor(e){super(e,{code:X0.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(X0,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class e1 extends Xs{constructor(e){super(e,{code:e1.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(e1,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class $3 extends Xs{constructor(e){super(e,{code:$3.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty($3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class P3 extends Xs{constructor(e){super(e,{code:P3.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(P3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class R3 extends Xs{constructor(e){super(e,{code:R3.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(R3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class D3 extends Xs{constructor(e,{method:r}={}){super(e,{code:D3.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not implemented.`})}}Object.defineProperty(D3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class Og extends Xs{constructor(e){super(e,{code:Og.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(Og,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class O3 extends Xs{constructor(e){super(e,{code:O3.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(O3,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class mg extends km{constructor(e){super(e,{code:mg.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(mg,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class F3 extends km{constructor(e){super(e,{code:F3.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(F3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class U3 extends km{constructor(e,{method:r}={}){super(e,{code:U3.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(U3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class B3 extends km{constructor(e){super(e,{code:B3.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(B3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class z3 extends km{constructor(e){super(e,{code:z3.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(z3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class W3 extends km{constructor(e){super(e,{code:W3.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(W3,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class e_e extends Xs{constructor(e){super(e,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const t_e=3;function t1(t,{abi:e,address:r,args:n,docsPath:i,functionName:a,sender:s}){const o=t instanceof $9?t:t instanceof Qe?t.walk(m=>"data"in m)||t.walk():{},{code:l,data:c,details:u,message:f,shortMessage:h}=o,g=t instanceof jw?new QEe({functionName:a}):[t_e,X0.code].includes(l)&&(c||u||f||h)?new iM({abi:e,data:typeof c=="object"?c.data:c,functionName:a,message:o instanceof JN?u:h??f}):t;return new JEe(g,{abi:e,args:n,contractAddress:r,docsPath:i,functionName:a,sender:s})}function r_e(t){const e=ea(`0x${t.substring(4)}`).substring(26);return $w(`0x${e}`)}async function n_e({hash:t,signature:e}){const r=wc(t)?t:ur(t),{secp256k1:n}=await qs(async()=>{const{secp256k1:s}=await Promise.resolve().then(()=>_Ae);return{secp256k1:s}},void 0);return`0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:c,s:u,v:f,yParity:h}=e,g=Number(h??f),m=mU(g);return new n.Signature(vo(c),vo(u)).addRecoveryBit(m)}const s=wc(e)?e:ur(e),o=Mu(`0x${s.slice(130)}`),l=mU(o);return n.Signature.fromCompact(s.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function mU(t){if(t===0||t===1)return t;if(t===27)return 0;if(t===28)return 1;throw new Error("Invalid yParityOrV value")}async function eX({hash:t,signature:e}){return r_e(await n_e({hash:t,signature:e}))}function lh(t,e="hex"){const r=tX(t),n=YN(new Uint8Array(r.length));return r.encode(n),e==="hex"?Si(n.bytes):n.bytes}function tX(t){return Array.isArray(t)?i_e(t.map(e=>tX(e))):a_e(t)}function i_e(t){const e=t.reduce((i,a)=>i+a.length,0),r=rX(e);return{length:e<=55?1+e:1+r+e,encode(i){e<=55?i.pushByte(192+e):(i.pushByte(247+r),r===1?i.pushUint8(e):r===2?i.pushUint16(e):r===3?i.pushUint24(e):i.pushUint32(e));for(const{encode:a}of t)a(i)}}}function a_e(t){const e=typeof t=="string"?vc(t):t,r=rX(e.length);return{length:e.length===1&&e[0]<128?1:e.length<=55?1+e.length:1+r+e.length,encode(i){e.length===1&&e[0]<128?i.pushBytes(e):e.length<=55?(i.pushByte(128+e.length),i.pushBytes(e)):(i.pushByte(183+r),r===1?i.pushUint8(e.length):r===2?i.pushUint16(e.length):r===3?i.pushUint24(e.length):i.pushUint32(e.length),i.pushBytes(e))}}}function rX(t){if(t<2**8)return 1;if(t<2**16)return 2;if(t<2**24)return 3;if(t<2**32)return 4;throw new Qe("Length is too large.")}function s_e(t){const{chainId:e,contractAddress:r,nonce:n,to:i}=t,a=ea(ju(["0x05",lh([e?lr(e):"0x",r,n?lr(n):"0x"])]));return i==="bytes"?vc(a):a}async function nX(t){const{authorization:e,signature:r}=t;return eX({hash:s_e(e),signature:r??e})}class o_e extends Qe{constructor(e,{account:r,docsPath:n,chain:i,data:a,gas:s,gasPrice:o,maxFeePerGas:l,maxPriorityFeePerGas:c,nonce:u,to:f,value:h}){var m;const g=Ow({from:r==null?void 0:r.address,to:f,value:typeof h<"u"&&`${Dw(h)} ${((m=i==null?void 0:i.nativeCurrency)==null?void 0:m.symbol)||"ETH"}`,data:a,gas:s,gasPrice:typeof o<"u"&&`${Gs(o)} gwei`,maxFeePerGas:typeof l<"u"&&`${Gs(l)} gwei`,maxPriorityFeePerGas:typeof c<"u"&&`${Gs(c)} gwei`,nonce:u});super(e.shortMessage,{cause:e,docsPath:n,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",g].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=e}}class Zp extends Qe{constructor({cause:e,message:r}={}){var i;const n=(i=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:i.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:e,name:"ExecutionRevertedError"})}}Object.defineProperty(Zp,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(Zp,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class r1 extends Qe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Gs(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e,name:"FeeCapTooHighError"})}}Object.defineProperty(r1,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class aM extends Qe{constructor({cause:e,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${Gs(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e,name:"FeeCapTooLowError"})}}Object.defineProperty(aM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class sM extends Qe{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:e,name:"NonceTooHighError"})}}Object.defineProperty(sM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class oM extends Qe{constructor({cause:e,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:e,name:"NonceTooLowError"})}}Object.defineProperty(oM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class lM extends Qe{constructor({cause:e,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:e,name:"NonceMaxValueError"})}}Object.defineProperty(lM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class cM extends Qe{constructor({cause:e}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(cM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class uM extends Qe{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(uM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class dM extends Qe{constructor({cause:e,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:e,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(dM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class fM extends Qe{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(fM,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class H3 extends Qe{constructor({cause:e,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${Gs(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${Gs(n)} gwei`:""}).`].join(` +`),{cause:e,name:"TipAboveFeeCapError"})}}Object.defineProperty(H3,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Fw extends Qe{constructor({cause:e}){super(`An error occurred while executing: ${e==null?void 0:e.shortMessage}`,{cause:e,name:"UnknownNodeError"})}}function P9(t,e){const r=(t.details||"").toLowerCase(),n=t instanceof Qe?t.walk(i=>(i==null?void 0:i.code)===Zp.code):t;return n instanceof Qe?new Zp({cause:t,message:n.details}):Zp.nodeMessage.test(r)?new Zp({cause:t,message:t.details}):r1.nodeMessage.test(r)?new r1({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):aM.nodeMessage.test(r)?new aM({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas}):sM.nodeMessage.test(r)?new sM({cause:t,nonce:e==null?void 0:e.nonce}):oM.nodeMessage.test(r)?new oM({cause:t,nonce:e==null?void 0:e.nonce}):lM.nodeMessage.test(r)?new lM({cause:t,nonce:e==null?void 0:e.nonce}):cM.nodeMessage.test(r)?new cM({cause:t}):uM.nodeMessage.test(r)?new uM({cause:t,gas:e==null?void 0:e.gas}):dM.nodeMessage.test(r)?new dM({cause:t,gas:e==null?void 0:e.gas}):fM.nodeMessage.test(r)?new fM({cause:t}):H3.nodeMessage.test(r)?new H3({cause:t,maxFeePerGas:e==null?void 0:e.maxFeePerGas,maxPriorityFeePerGas:e==null?void 0:e.maxPriorityFeePerGas}):new Fw({cause:t})}function l_e(t,{docsPath:e,...r}){const n=(()=>{const i=P9(t,r);return i instanceof Fw?t:i})();return new o_e(n,{docsPath:e,...r})}function R9(t,{format:e}){if(!e)return{};const r={};function n(a){const s=Object.keys(a);for(const o of s)o in t&&(r[o]=t[o]),a[o]&&typeof a[o]=="object"&&!Array.isArray(a[o])&&n(a[o])}const i=e(t||{});return n(i),r}function QN(t,e){return({exclude:r,format:n})=>({exclude:r,format:i=>{const a=e(i);if(r)for(const s of r)delete a[s];return{...a,...n(i)}},type:t})}const c_e={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Nm(t){const e={};return typeof t.authorizationList<"u"&&(e.authorizationList=u_e(t.authorizationList)),typeof t.accessList<"u"&&(e.accessList=t.accessList),typeof t.blobVersionedHashes<"u"&&(e.blobVersionedHashes=t.blobVersionedHashes),typeof t.blobs<"u"&&(typeof t.blobs[0]!="string"?e.blobs=t.blobs.map(r=>Si(r)):e.blobs=t.blobs),typeof t.data<"u"&&(e.data=t.data),typeof t.from<"u"&&(e.from=t.from),typeof t.gas<"u"&&(e.gas=lr(t.gas)),typeof t.gasPrice<"u"&&(e.gasPrice=lr(t.gasPrice)),typeof t.maxFeePerBlobGas<"u"&&(e.maxFeePerBlobGas=lr(t.maxFeePerBlobGas)),typeof t.maxFeePerGas<"u"&&(e.maxFeePerGas=lr(t.maxFeePerGas)),typeof t.maxPriorityFeePerGas<"u"&&(e.maxPriorityFeePerGas=lr(t.maxPriorityFeePerGas)),typeof t.nonce<"u"&&(e.nonce=lr(t.nonce)),typeof t.to<"u"&&(e.to=t.to),typeof t.type<"u"&&(e.type=c_e[t.type]),typeof t.value<"u"&&(e.value=lr(t.value)),e}function u_e(t){return t.map(e=>({address:e.contractAddress,r:e.r,s:e.s,chainId:lr(e.chainId),nonce:lr(e.nonce),...typeof e.yParity<"u"?{yParity:lr(e.yParity)}:{},...typeof e.v<"u"&&typeof e.yParity>"u"?{v:lr(e.v)}:{}}))}function yU(t){if(!(!t||t.length===0))return t.reduce((e,{slot:r,value:n})=>{if(r.length!==66)throw new tU({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new tU({size:n.length,targetSize:66,type:"hex"});return e[r]=n,e},{})}function d_e(t){const{balance:e,nonce:r,state:n,stateDiff:i,code:a}=t,s={};if(a!==void 0&&(s.code=a),e!==void 0&&(s.balance=lr(e)),r!==void 0&&(s.nonce=lr(r)),n!==void 0&&(s.state=yU(n)),i!==void 0){if(s.state)throw new BEe;s.stateDiff=yU(i)}return s}function ZN(t){if(!t)return;const e={};for(const{address:r,...n}of t){if(!Tn(r,{strict:!1}))throw new fs({address:r});if(e[r])throw new UEe({address:r});e[r]=d_e(n)}return e}const D9=2n**256n-1n;function x1(t){const{account:e,gasPrice:r,maxFeePerGas:n,maxPriorityFeePerGas:i,to:a}=t,s=e?ms(e):void 0;if(s&&!Tn(s.address))throw new fs({address:s.address});if(a&&!Tn(a))throw new fs({address:a});if(typeof r<"u"&&(typeof n<"u"||typeof i<"u"))throw new WEe;if(n&&n>D9)throw new r1({maxFeePerGas:n});if(i&&n&&i>n)throw new H3({maxFeePerGas:n,maxPriorityFeePerGas:i})}class f_e extends Qe{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class XN extends Qe{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class h_e extends Qe{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${Gs(e)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class iX extends Qe{constructor({blockHash:e,blockNumber:r}){let n="Block";e&&(n=`Block at hash "${e}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const aX={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function O9(t){const e={...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,chainId:t.chainId?Mu(t.chainId):void 0,gas:t.gas?BigInt(t.gas):void 0,gasPrice:t.gasPrice?BigInt(t.gasPrice):void 0,maxFeePerBlobGas:t.maxFeePerBlobGas?BigInt(t.maxFeePerBlobGas):void 0,maxFeePerGas:t.maxFeePerGas?BigInt(t.maxFeePerGas):void 0,maxPriorityFeePerGas:t.maxPriorityFeePerGas?BigInt(t.maxPriorityFeePerGas):void 0,nonce:t.nonce?Mu(t.nonce):void 0,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,type:t.type?aX[t.type]:void 0,typeHex:t.type?t.type:void 0,value:t.value?BigInt(t.value):void 0,v:t.v?BigInt(t.v):void 0};return t.authorizationList&&(e.authorizationList=g_e(t.authorizationList)),e.yParity=(()=>{if(t.yParity)return Number(t.yParity);if(typeof e.v=="bigint"){if(e.v===0n||e.v===27n)return 0;if(e.v===1n||e.v===28n)return 1;if(e.v>=35n)return e.v%2n===0n?1:0}})(),e.type==="legacy"&&(delete e.accessList,delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas,delete e.yParity),e.type==="eip2930"&&(delete e.maxFeePerBlobGas,delete e.maxFeePerGas,delete e.maxPriorityFeePerGas),e.type==="eip1559"&&delete e.maxFeePerBlobGas,e}const p_e=QN("transaction",O9);function g_e(t){return t.map(e=>({contractAddress:e.address,chainId:Number(e.chainId),nonce:Number(e.nonce),r:e.r,s:e.s,yParity:Number(e.yParity)}))}function eL(t){const e=(t.transactions??[]).map(r=>typeof r=="string"?r:O9(r));return{...t,baseFeePerGas:t.baseFeePerGas?BigInt(t.baseFeePerGas):null,blobGasUsed:t.blobGasUsed?BigInt(t.blobGasUsed):void 0,difficulty:t.difficulty?BigInt(t.difficulty):void 0,excessBlobGas:t.excessBlobGas?BigInt(t.excessBlobGas):void 0,gasLimit:t.gasLimit?BigInt(t.gasLimit):void 0,gasUsed:t.gasUsed?BigInt(t.gasUsed):void 0,hash:t.hash?t.hash:null,logsBloom:t.logsBloom?t.logsBloom:null,nonce:t.nonce?t.nonce:null,number:t.number?BigInt(t.number):null,size:t.size?BigInt(t.size):void 0,timestamp:t.timestamp?BigInt(t.timestamp):void 0,transactions:e,totalDifficulty:t.totalDifficulty?BigInt(t.totalDifficulty):null}}const m_e=QN("block",eL);async function ou(t,{blockHash:e,blockNumber:r,blockTag:n,includeTransactions:i}={}){var u,f,h;const a=n??"latest",s=i??!1,o=r!==void 0?lr(r):void 0;let l=null;if(e?l=await t.request({method:"eth_getBlockByHash",params:[e,s]},{dedupe:!0}):l=await t.request({method:"eth_getBlockByNumber",params:[o||a,s]},{dedupe:!!o}),!l)throw new iX({blockHash:e,blockNumber:r});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.block)==null?void 0:h.format)||eL)(l)}async function tL(t){const e=await t.request({method:"eth_gasPrice"});return BigInt(e)}async function y_e(t,e){return sX(t,e)}async function sX(t,e){var a,s;const{block:r,chain:n=t.chain,request:i}=e||{};try{const o=((a=n==null?void 0:n.fees)==null?void 0:a.maxPriorityFeePerGas)??((s=n==null?void 0:n.fees)==null?void 0:s.defaultPriorityFee);if(typeof o=="function"){const c=r||await nr(t,ou,"getBlock")({}),u=await o({block:c,client:t,request:i});if(u===null)throw new Error;return u}if(typeof o<"u")return o;const l=await t.request({method:"eth_maxPriorityFeePerGas"});return vo(l)}catch{const[o,l]=await Promise.all([r?Promise.resolve(r):nr(t,ou,"getBlock")({}),nr(t,tL,"getGasPrice")({})]);if(typeof o.baseFeePerGas!="bigint")throw new XN;const c=l-o.baseFeePerGas;return c<0n?0n:c}}async function w_e(t,e){return hM(t,e)}async function hM(t,e){var h,g;const{block:r,chain:n=t.chain,request:i,type:a="eip1559"}=e||{},s=await(async()=>{var m,w;return typeof((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:t,request:i}):((w=n==null?void 0:n.fees)==null?void 0:w.baseFeeMultiplier)??1.2})();if(s<1)throw new f_e;const l=10**(((h=s.toString().split(".")[1])==null?void 0:h.length)??0),c=m=>m*BigInt(Math.ceil(s*l))/BigInt(l),u=r||await nr(t,ou,"getBlock")({});if(typeof((g=n==null?void 0:n.fees)==null?void 0:g.estimateFeesPerGas)=="function"){const m=await n.fees.estimateFeesPerGas({block:r,client:t,multiply:c,request:i,type:a});if(m!==null)return m}if(a==="eip1559"){if(typeof u.baseFeePerGas!="bigint")throw new XN;const m=typeof(i==null?void 0:i.maxPriorityFeePerGas)=="bigint"?i.maxPriorityFeePerGas:await sX(t,{block:u,chain:n,request:i}),w=c(u.baseFeePerGas);return{maxFeePerGas:(i==null?void 0:i.maxFeePerGas)??w+m,maxPriorityFeePerGas:m}}return{gasPrice:(i==null?void 0:i.gasPrice)??c(await nr(t,tL,"getGasPrice")({}))}}async function oX(t,{address:e,blockTag:r="latest",blockNumber:n}){const i=await t.request({method:"eth_getTransactionCount",params:[e,n?lr(n):r]},{dedupe:!!n});return Mu(i)}function rL(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(a=>vc(a)):t.blobs,i=[];for(const a of n)i.push(Uint8Array.from(e.blobToKzgCommitment(a)));return r==="bytes"?i:i.map(a=>Si(a))}function nL(t){const{kzg:e}=t,r=t.to??(typeof t.blobs[0]=="string"?"hex":"bytes"),n=typeof t.blobs[0]=="string"?t.blobs.map(s=>vc(s)):t.blobs,i=typeof t.commitments[0]=="string"?t.commitments.map(s=>vc(s)):t.commitments,a=[];for(let s=0;sSi(s))}function v_e(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),l=n?4:0,c=n?0:4;t.setUint32(e+l,s,n),t.setUint32(e+c,o,n)}const b_e=(t,e,r)=>t&e^~t&r,x_e=(t,e,r)=>t&e^t&r^e&r;let E_e=class extends jZ{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=EC(this.buffer)}update(e){B5(this);const{view:r,buffer:n,blockLen:i}=this;e=WN(e);const a=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=Oc(g,17)^Oc(g,19)^g>>>10;xf[f]=w+xf[f-7]+m+xf[f-16]|0}let{A:n,B:i,C:a,D:s,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Oc(o,6)^Oc(o,11)^Oc(o,25),g=u+h+b_e(o,l,c)+__e[f]+xf[f]|0,w=(Oc(n,2)^Oc(n,13)^Oc(n,22))+x_e(n,i,a)|0;u=c,c=l,l=o,o=s+g|0,s=a,a=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,s,o,l,c,u)}roundClean(){xf.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const S_e=$Z(()=>new C_e);function A_e(t,e){return S_e(wc(t,{strict:!1})?Im(t):t)}function I_e(t){const{commitment:e,version:r=1}=t,n=t.to??(typeof e=="string"?"hex":"bytes"),i=A_e(e);return i.set([r],0),n==="bytes"?i:Si(i)}function lX(t){const{commitments:e,version:r}=t,n=t.to??(typeof e[0]=="string"?"hex":"bytes"),i=[];for(const a of e)i.push(I_e({commitment:a,to:n,version:r}));return i}const wU=6,cX=32,iL=4096,uX=cX*iL,vU=uX*wU-1-1*iL*wU,dX=1;class M_e extends Qe{constructor({maxSize:e,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class fX extends Qe{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class T_e extends Qe{constructor({hash:e,size:r}){super(`Versioned hash "${e}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${r}`],name:"InvalidVersionedHashSizeError"})}}class k_e extends Qe{constructor({hash:e,version:r}){super(`Versioned hash "${e}" version is invalid.`,{metaMessages:[`Expected: ${dX}`,`Received: ${r}`],name:"InvalidVersionedHashVersionError"})}}function N_e(t){const e=t.to??(typeof t.data=="string"?"hex":"bytes"),r=typeof t.data=="string"?vc(t.data):t.data,n=ai(r);if(!n)throw new fX;if(n>vU)throw new M_e({maxSize:vU,size:n});const i=[];let a=!0,s=0;for(;a;){const o=YN(new Uint8Array(uX));let l=0;for(;lo.bytes):i.map(o=>Si(o.bytes))}function hX(t){const{data:e,kzg:r,to:n}=t,i=t.blobs??N_e({data:e,to:n}),a=t.commitments??rL({blobs:i,kzg:r,to:n}),s=t.proofs??nL({blobs:i,commitments:a,kzg:r,to:n}),o=[];for(let l=0;l"u"&&f)if(l){const v=await C();h.nonce=await l.consume({address:f.address,chainId:v,client:t})}else h.nonce=await nr(t,oX,"getTransactionCount")({address:f.address,blockTag:"pending"});if((c.includes("fees")||c.includes("type"))&&typeof u>"u")try{h.type=pX(h)}catch{const v=await m();h.type=typeof(v==null?void 0:v.baseFeePerGas)=="bigint"?"eip1559":"legacy"}if(c.includes("fees"))if(h.type!=="legacy"&&h.type!=="eip2930"){if(typeof h.maxFeePerGas>"u"||typeof h.maxPriorityFeePerGas>"u"){const v=await m(),{maxFeePerGas:b,maxPriorityFeePerGas:A}=await hM(t,{block:v,chain:i,request:h});if(typeof e.maxPriorityFeePerGas>"u"&&e.maxFeePerGas&&e.maxFeePerGas"u"&&(h.gas=await nr(t,aL,"estimateGas")({...h,account:f&&{address:f.address,type:"json-rpc"}})),x1(h),delete h.parameters,h}async function mX(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r?lr(r):void 0,a=await t.request({method:"eth_getBalance",params:[e,i||n]});return BigInt(a)}async function aL(t,e){var i,a,s;const{account:r=t.account}=e,n=r?ms(r):void 0;try{let x=function(L){const{block:O,request:P,rpcStateOverride:R}=L;return t.request({method:"eth_estimateGas",params:R?[P,O??"latest",R]:O?[P,O]:[P]})};const{accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,blockNumber:f,blockTag:h,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:A,value:S,stateOverride:j,...F}=await F9(t,{...e,parameters:(n==null?void 0:n.type)==="local"?void 0:["blobVersionedHashes"]}),B=(f?lr(f):void 0)||h,V=ZN(j),se=await(async()=>{if(F.to)return F.to;if(l&&l.length>0)return await nX({authorization:l[0]}).catch(()=>{throw new Qe("`to` is required. Could not infer from `authorizationList`")})})();x1(e);const Y=(s=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionRequest)==null?void 0:s.format,k=(Y||Nm)({...R9(F,{format:Y}),from:n==null?void 0:n.address,accessList:o,authorizationList:l,blobs:c,blobVersionedHashes:u,data:g,gas:m,gasPrice:w,maxFeePerBlobGas:C,maxFeePerGas:v,maxPriorityFeePerGas:b,nonce:A,to:se,value:S});let E=BigInt(await x({block:B,request:k,rpcStateOverride:V}));if(l){const L=await mX(t,{address:k.from}),O=await Promise.all(l.map(async P=>{const{contractAddress:R}=P,M=await x({block:B,request:{authorizationList:void 0,data:g,from:n==null?void 0:n.address,to:R,value:lr(L)},rpcStateOverride:V}).catch(()=>100000n);return 2n*BigInt(M)}));E+=O.reduce((P,R)=>P+R,0n)}return E}catch(o){throw l_e(o,{...e,account:n,chain:t.chain})}}async function L_e(t,e){const{abi:r,address:n,args:i,functionName:a,dataSuffix:s,...o}=e,l=Mc({abi:r,args:i,functionName:a});try{return await nr(t,aL,"estimateGas")({data:`${l}${s?s.replace("0x",""):""}`,to:n,...o})}catch(c){const u=o.account?ms(o.account):void 0;throw t1(c,{abi:r,address:n,args:i,docsPath:"/docs/contract/estimateContractGas",functionName:a,sender:u==null?void 0:u.address})}}function sL(t,e){if(!Tn(t,{strict:!1}))throw new fs({address:t});if(!Tn(e,{strict:!1}))throw new fs({address:e});return t.toLowerCase()===e.toLowerCase()}const bU="/docs/contract/decodeEventLog";function oL(t){const{abi:e,data:r,strict:n,topics:i}=t,a=n??!0,[s,...o]=i;if(!s)throw new x7e({docsPath:bU});const l=e.length===1?e[0]:e.find(w=>w.type==="event"&&s===T9(Iu(w)));if(!(l&&"name"in l)||l.type!=="event")throw new IZ(s,{docsPath:bU});const{name:c,inputs:u}=l,f=u==null?void 0:u.some(w=>!("name"in w&&w.name));let h=f?[]:{};const g=u.filter(w=>"indexed"in w&&w.indexed);for(let w=0;w!("indexed"in w&&w.indexed));if(m.length>0){if(r&&r!=="0x")try{const w=Tm(m,r);if(w)if(f)h=[...h,...w];else for(let C=0;C0?h:void 0}}function j_e({param:t,value:e}){return t.type==="string"||t.type==="bytes"||t.type==="tuple"||t.type.match(/^(.*)\[(\d+)?\]$/)?e:(Tm([t],e)||[])[0]}function lL(t){const{abi:e,args:r,logs:n,strict:i=!0}=t,a=(()=>{if(t.eventName)return Array.isArray(t.eventName)?t.eventName:[t.eventName]})();return n.map(s=>{var o;try{const l=e.find(u=>u.type==="event"&&s.topics[0]===T9(u));if(!l)return null;const c=oL({...s,abi:[l],strict:i});return a&&!a.includes(c.eventName)||!$_e({args:c.args,inputs:l.inputs,matchArgs:r})?null:{...c,...s}}catch(l){let c,u;if(l instanceof IZ)return null;if(l instanceof M3||l instanceof M9){if(i)return null;c=l.abiItem.name,u=(o=l.abiItem.inputs)==null?void 0:o.some(f=>!("name"in f&&f.name))}return{...s,args:u?[]:{},eventName:c}}}).filter(Boolean)}function $_e(t){const{args:e,inputs:r,matchArgs:n}=t;if(!n)return!0;if(!e)return!1;function i(a,s,o){try{return a.type==="address"?sL(s,o):a.type==="string"||a.type==="bytes"?ea(Im(s))===o:s===o}catch{return!1}}return Array.isArray(e)&&Array.isArray(n)?n.every((a,s)=>{if(a==null)return!0;const o=r[s];return o?(Array.isArray(a)?a:[a]).some(c=>i(o,c,e[s])):!1}):typeof e=="object"&&!Array.isArray(e)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([a,s])=>{if(s==null)return!0;const o=r.find(c=>c.name===a);return o?(Array.isArray(s)?s:[s]).some(c=>i(o,c,e[a])):!1}):!1}function zd(t,{args:e,eventName:r}={}){return{...t,blockHash:t.blockHash?t.blockHash:null,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,logIndex:t.logIndex?Number(t.logIndex):null,transactionHash:t.transactionHash?t.transactionHash:null,transactionIndex:t.transactionIndex?Number(t.transactionIndex):null,...r?{args:e,eventName:r}:{}}}async function cL(t,{address:e,blockHash:r,fromBlock:n,toBlock:i,event:a,events:s,args:o,strict:l}={}){const c=l??!1,u=s??(a?[a]:void 0);let f=[];u&&(f=[u.flatMap(w=>Rw({abi:[w],eventName:w.name,args:s?void 0:o}))],a&&(f=f[0]));let h;r?h=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,blockHash:r}]}):h=await t.request({method:"eth_getLogs",params:[{address:e,topics:f,fromBlock:typeof n=="bigint"?lr(n):n,toBlock:typeof i=="bigint"?lr(i):i}]});const g=h.map(m=>zd(m));return u?lL({abi:u,args:o,logs:g,strict:c}):g}async function yX(t,e){const{abi:r,address:n,args:i,blockHash:a,eventName:s,fromBlock:o,toBlock:l,strict:c}=e,u=s?Pw({abi:r,name:s}):void 0,f=u?void 0:r.filter(h=>h.type==="event");return nr(t,cL,"getLogs")({address:n,args:i,blockHash:a,event:u,events:f,fromBlock:o,toBlock:l,strict:c})}const SC="/docs/contract/decodeFunctionResult";function E1(t){const{abi:e,args:r,functionName:n,data:i}=t;let a=e[0];if(n){const o=Pw({abi:e,args:r,name:n});if(!o)throw new U5(n,{docsPath:SC});a=o}if(a.type!=="function")throw new U5(void 0,{docsPath:SC});if(!a.outputs)throw new E7e(a.name,{docsPath:SC});const s=Tm(a.outputs,i);if(s&&s.length>1)return s;if(s&&s.length===1)return s[0]}const pM=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],wX=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],vX=[...wX,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],P_e=[...wX,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],xU=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],EU=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],_U=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],R_e="0x82ad56cb",D_e="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",O_e="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",F_e="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";class gM extends Qe{constructor({blockNumber:e,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...e&&n.blockCreated&&n.blockCreated>e?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class U_e extends Qe{constructor({chain:e,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${e.id} – ${e.name}`],name:"ChainMismatchError"})}}class B_e extends Qe{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`),{name:"ChainNotFoundError"})}}class bX extends Qe{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}class U9 extends Qe{constructor({chainId:e}){super(typeof e=="number"?`Chain ID "${e}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}const AC="/docs/contract/encodeDeployData";function B9(t){const{abi:e,args:r,bytecode:n}=t;if(!r||r.length===0)return n;const i=e.find(s=>"type"in s&&s.type==="constructor");if(!i)throw new y7e({docsPath:AC});if(!("inputs"in i))throw new XF({docsPath:AC});if(!i.inputs||i.inputs.length===0)throw new XF({docsPath:AC});const a=Mm(i.inputs,r);return ju([n,a])}function Lm({blockNumber:t,chain:e,contract:r}){var i;const n=(i=e==null?void 0:e.contracts)==null?void 0:i[r];if(!n)throw new gM({chain:e,contract:{name:r}});if(t&&n.blockCreated&&n.blockCreated>t)throw new gM({blockNumber:t,chain:e,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function xX(t,{docsPath:e,...r}){const n=(()=>{const i=P9(t,r);return i instanceof Fw?t:i})();return new XZ(n,{docsPath:e,...r})}function EX(){let t=()=>{},e=()=>{};return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}}const IC=new Map;function _X({fn:t,id:e,shouldSplitBatch:r,wait:n=0,sort:i}){const a=async()=>{const u=l();s();const f=u.map(({args:h})=>h);f.length!==0&&t(f).then(h=>{i&&Array.isArray(h)&&h.sort(i);for(let g=0;g{for(let g=0;gIC.delete(e),o=()=>l().map(({args:u})=>u),l=()=>IC.get(e)||[],c=u=>IC.set(e,[...l(),u]);return{flush:s,async schedule(u){const{promise:f,resolve:h,reject:g}=EX();return(r==null?void 0:r([...o(),u]))&&a(),l().length>0?(c({args:u,resolve:h,reject:g}),f):(c({args:u,resolve:h,reject:g}),setTimeout(a,n),f)}}}async function z9(t,e){var Y,N,k,x;const{account:r=t.account,batch:n=!!((Y=t.batch)!=null&&Y.multicall),blockNumber:i,blockTag:a="latest",accessList:s,blobs:o,code:l,data:c,factory:u,factoryData:f,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:v,to:b,value:A,stateOverride:S,...j}=e,F=r?ms(r):void 0;if(l&&(u||f))throw new Qe("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(l&&b)throw new Qe("Cannot provide both `code` & `to` as parameters.");const I=l&&c,B=u&&f&&b&&c,V=I||B,se=I?H_e({code:l,data:c}):B?G_e({data:c,factory:u,factoryData:f,to:b}):c;try{x1(e);const L=(i?lr(i):void 0)||a,O=ZN(S),P=(x=(k=(N=t.chain)==null?void 0:N.formatters)==null?void 0:k.transactionRequest)==null?void 0:x.format,M=(P||Nm)({...R9(j,{format:P}),from:F==null?void 0:F.address,accessList:s,blobs:o,data:se,gas:h,gasPrice:g,maxFeePerBlobGas:m,maxFeePerGas:w,maxPriorityFeePerGas:C,nonce:v,to:V?void 0:b,value:A});if(n&&z_e({request:M})&&!O)try{return await W_e(t,{...M,blockNumber:i,blockTag:a})}catch($){if(!($ instanceof bX)&&!($ instanceof gM))throw $}const D=await t.request({method:"eth_call",params:O?[M,L,O]:[M,L]});return D==="0x"?{data:void 0}:{data:D}}catch(E){const L=q_e(E),{offchainLookup:O,offchainLookupSignature:P}=await qs(async()=>{const{offchainLookup:R,offchainLookupSignature:M}=await import("./ccip-EeY6Gpji.js");return{offchainLookup:R,offchainLookupSignature:M}},[]);if(t.ccipRead!==!1&&(L==null?void 0:L.slice(0,10))===P&&b)return{data:await O(t,{data:L,to:b})};throw V&&(L==null?void 0:L.slice(0,10))==="0x101bb98d"?new ZEe({factory:u}):xX(E,{...e,account:F,chain:t.chain})}}function z_e({request:t}){const{data:e,to:r,...n}=t;return!(!e||e.startsWith(R_e)||!r||Object.values(n).filter(i=>typeof i<"u").length>0)}async function W_e(t,e){var w;const{batchSize:r=1024,wait:n=0}=typeof((w=t.batch)==null?void 0:w.multicall)=="object"?t.batch.multicall:{},{blockNumber:i,blockTag:a="latest",data:s,multicallAddress:o,to:l}=e;let c=o;if(!c){if(!t.chain)throw new bX;c=Lm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=(i?lr(i):void 0)||a,{schedule:h}=_X({id:`${t.uid}.${f}`,wait:n,shouldSplitBatch(C){return C.reduce((b,{data:A})=>b+(A.length-2),0)>r*2},fn:async C=>{const v=C.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),b=Mc({abi:pM,args:[v],functionName:"aggregate3"}),A=await t.request({method:"eth_call",params:[{data:b,to:c},f]});return E1({abi:pM,args:[v],functionName:"aggregate3",data:A||"0x"})}}),[{returnData:g,success:m}]=await h({data:s,to:l});if(!m)throw new $9({data:g});return g==="0x"?{data:void 0}:{data:g}}function H_e(t){const{code:e,data:r}=t;return B9({abi:A9(["constructor(bytes, bytes)"]),bytecode:D_e,args:[e,r]})}function G_e(t){const{data:e,factory:r,factoryData:n,to:i}=t;return B9({abi:A9(["constructor(address, bytes, address, bytes)"]),bytecode:O_e,args:[i,e,r,n]})}function q_e(t){var r;if(!(t instanceof Qe))return;const e=t.walk();return typeof(e==null?void 0:e.data)=="object"?(r=e.data)==null?void 0:r.data:e.data}async function Wd(t,e){const{abi:r,address:n,args:i,functionName:a,...s}=e,o=Mc({abi:r,args:i,functionName:a});try{const{data:l}=await nr(t,z9,"call")({...s,data:o,to:n});return E1({abi:r,args:i,functionName:a,data:l||"0x"})}catch(l){throw t1(l,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:a})}}async function V_e(t,e){const{abi:r,address:n,args:i,dataSuffix:a,functionName:s,...o}=e,l=o.account?ms(o.account):t.account,c=Mc({abi:r,args:i,functionName:s});try{const{data:u}=await nr(t,z9,"call")({batch:!1,data:`${c}${a?a.replace("0x",""):""}`,to:n,...o,account:l}),f=E1({abi:r,args:i,functionName:s,data:u||"0x"}),h=r.filter(g=>"name"in g&&g.name===e.functionName);return{result:f,request:{abi:h,address:n,args:i,dataSuffix:a,functionName:s,...o,account:l}}}catch(u){throw t1(u,{abi:r,address:n,args:i,docsPath:"/docs/contract/simulateContract",functionName:s,sender:l==null?void 0:l.address})}}const MC=new Map,CU=new Map;let Y_e=0;function ch(t,e,r){const n=++Y_e,i=()=>MC.get(t)||[],a=()=>{const u=i();MC.set(t,u.filter(f=>f.id!==n))},s=()=>{const u=i();if(!u.some(h=>h.id===n))return;const f=CU.get(t);u.length===1&&f&&f(),a()},o=i();if(MC.set(t,[...o,{id:n,fns:e}]),o&&o.length>0)return s;const l={};for(const u in e)l[u]=(...f)=>{var g,m;const h=i();if(h.length!==0)for(const w of h)(m=(g=w.fns)[u])==null||m.call(g,...f)};const c=r(l);return typeof c=="function"&&CU.set(t,c),s}async function mM(t){return new Promise(e=>setTimeout(e,t))}function Bw(t,{emitOnBegin:e,initialWaitTime:r,interval:n}){let i=!0;const a=()=>i=!1;return(async()=>{let o;e&&(o=await t({unpoll:a}));const l=await(r==null?void 0:r(o))??n;await mM(l);const c=async()=>{i&&(await t({unpoll:a}),await mM(n),c())};c()})(),a}const K_e=new Map,J_e=new Map;function Q_e(t){const e=(i,a)=>({clear:()=>a.delete(i),get:()=>a.get(i),set:s=>a.set(i,s)}),r=e(t,K_e),n=e(t,J_e);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function Z_e(t,{cacheKey:e,cacheTime:r=Number.POSITIVE_INFINITY}){const n=Q_e(e),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${t}`;async function zw(t,{cacheTime:e=t.cacheTime}={}){const r=await Z_e(()=>t.request({method:"eth_blockNumber"}),{cacheKey:X_e(t.uid),cacheTime:e});return BigInt(r)}async function W9(t,{filter:e}){const r="strict"in e&&e.strict,n=await e.request({method:"eth_getFilterChanges",params:[e.id]});if(typeof n[0]=="string")return n;const i=n.map(a=>zd(a));return!("abi"in e)||!e.abi?i:lL({abi:e.abi,logs:i,strict:r})}async function H9(t,{filter:e}){return e.request({method:"eth_uninstallFilter",params:[e.id]})}function eCe(t,e){const{abi:r,address:n,args:i,batch:a=!0,eventName:s,fromBlock:o,onError:l,onLogs:c,poll:u,pollingInterval:f=t.pollingInterval,strict:h}=e;return(typeof u<"u"?u:typeof o=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"))?(()=>{const C=h??!1,v=ia(["watchContractEvent",n,i,a,t.uid,s,f,C,o]);return ch(v,{onLogs:c,onError:l},b=>{let A;o!==void 0&&(A=o-1n);let S,j=!1;const F=Bw(async()=>{var I;if(!j){try{S=await nr(t,qZ,"createContractEventFilter")({abi:r,address:n,args:i,eventName:s,strict:C,fromBlock:o})}catch{}j=!0;return}try{let B;if(S)B=await nr(t,W9,"getFilterChanges")({filter:S});else{const V=await nr(t,zw,"getBlockNumber")({});A&&A{S&&await nr(t,H9,"uninstallFilter")({filter:S}),F()}})})():(()=>{const C=h??!1,v=ia(["watchContractEvent",n,i,a,t.uid,s,f,C]);let b=!0,A=()=>b=!1;return ch(v,{onLogs:c,onError:l},S=>((async()=>{try{const j=(()=>{if(t.transport.type==="fallback"){const B=t.transport.transports.find(V=>V.config.type==="webSocket");return B?B.value:t.transport}return t.transport})(),F=s?Rw({abi:r,eventName:s,args:i}):[],{unsubscribe:I}=await j.subscribe({params:["logs",{address:n,topics:F}],onData(B){var se;if(!b)return;const V=B.result;try{const{eventName:Y,args:N}=oL({abi:r,data:V.data,topics:V.topics,strict:h}),k=zd(V,{args:N,eventName:Y});S.onLogs([k])}catch(Y){let N,k;if(Y instanceof M3||Y instanceof M9){if(h)return;N=Y.abiItem.name,k=(se=Y.abiItem.inputs)==null?void 0:se.some(E=>!("name"in E&&E.name))}const x=zd(V,{args:k?[]:{},eventName:N});S.onLogs([x])}},onError(B){var V;(V=S.onError)==null||V.call(S,B)}});A=I,b||A()}catch(j){l==null||l(j)}})(),()=>A()))})()}class Ww extends Qe{constructor({docsPath:e}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` +`),{docsPath:e,docsSlug:"account",name:"AccountNotFoundError"})}}class TC extends Qe{constructor({docsPath:e,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:e,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function CX({chain:t,currentChainId:e}){if(!t)throw new B_e;if(e!==t.id)throw new U_e({chain:t,currentChainId:e})}function tCe(t,{docsPath:e,...r}){const n=(()=>{const i=P9(t,r);return i instanceof Fw?t:i})();return new VEe(n,{docsPath:e,...r})}async function uL(t,{serializedTransaction:e}){return t.request({method:"eth_sendRawTransaction",params:[e]},{retryCount:0})}const kC=new k9(128);async function dL(t,e){var v,b,A,S;const{account:r=t.account,chain:n=t.chain,accessList:i,authorizationList:a,blobs:s,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,value:m,...w}=e;if(typeof r>"u")throw new Ww({docsPath:"/docs/actions/wallet/sendTransaction"});const C=r?ms(r):null;try{x1(e);const j=await(async()=>{if(e.to)return e.to;if(a&&a.length>0)return await nX({authorization:a[0]}).catch(()=>{throw new Qe("`to` is required. Could not infer from `authorizationList`.")})})();if((C==null?void 0:C.type)==="json-rpc"||C===null){let F;n!==null&&(F=await nr(t,Uw,"getChainId")({}),CX({currentChainId:F,chain:n}));const I=(A=(b=(v=t.chain)==null?void 0:v.formatters)==null?void 0:b.transactionRequest)==null?void 0:A.format,V=(I||Nm)({...R9(w,{format:I}),accessList:i,authorizationList:a,blobs:s,chainId:F,data:o,from:C==null?void 0:C.address,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,to:j,value:m}),se=kC.get(t.uid),Y=se?"wallet_sendTransaction":"eth_sendTransaction";try{return await t.request({method:Y,params:[V]},{retryCount:0})}catch(N){if(se===!1)throw N;const k=N;if(k.name==="InvalidInputRpcError"||k.name==="InvalidParamsRpcError"||k.name==="MethodNotFoundRpcError"||k.name==="MethodNotSupportedRpcError")return await t.request({method:"wallet_sendTransaction",params:[V]},{retryCount:0}).then(x=>(kC.set(t.uid,!0),x)).catch(x=>{const E=x;throw E.name==="MethodNotFoundRpcError"||E.name==="MethodNotSupportedRpcError"?(kC.set(t.uid,!1),k):E});throw k}}if((C==null?void 0:C.type)==="local"){const F=await nr(t,F9,"prepareTransactionRequest")({account:C,accessList:i,authorizationList:a,blobs:s,chain:n,data:o,gas:l,gasPrice:c,maxFeePerBlobGas:u,maxFeePerGas:f,maxPriorityFeePerGas:h,nonce:g,nonceManager:C.nonceManager,parameters:[...gX,"sidecars"],value:m,...w,to:j}),I=(S=n==null?void 0:n.serializers)==null?void 0:S.transaction,B=await C.signTransaction(F,{serializer:I});return await nr(t,uL,"sendRawTransaction")({serializedTransaction:B})}throw(C==null?void 0:C.type)==="smart"?new TC({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new TC({docsPath:"/docs/actions/wallet/sendTransaction",type:C==null?void 0:C.type})}catch(j){throw j instanceof TC?j:tCe(j,{...e,account:C,chain:e.chain||void 0})}}async function rCe(t,e){const{abi:r,account:n=t.account,address:i,args:a,dataSuffix:s,functionName:o,...l}=e;if(typeof n>"u")throw new Ww({docsPath:"/docs/contract/writeContract"});const c=n?ms(n):null,u=Mc({abi:r,args:a,functionName:o});try{return await nr(t,dL,"sendTransaction")({data:`${u}${s?s.replace("0x",""):""}`,to:i,account:c,...l})}catch(f){throw t1(f,{abi:r,address:i,args:a,docsPath:"/docs/contract/writeContract",functionName:o,sender:c==null?void 0:c.address})}}class nCe extends Qe{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function iCe(t,e){const{address:r,factory:n,factoryData:i}=e;try{const[a,s,o,l,c,u,f]=await nr(t,Wd,"readContract")({abi:aCe,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:s,version:o,chainId:Number(l),verifyingContract:c,salt:u},extensions:f,fields:a}}catch(a){const s=a;throw s.name==="ContractFunctionExecutionError"&&s.cause.name==="ContractFunctionZeroDataError"?new nCe({address:r}):s}}const aCe=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function sCe(t,{chain:e}){const{id:r,name:n,nativeCurrency:i,rpcUrls:a,blockExplorers:s}=e;await t.request({method:"wallet_addEthereumChain",params:[{chainId:lr(r),chainName:n,nativeCurrency:i,rpcUrls:a.default.http,blockExplorerUrls:s?Object.values(s).map(({url:o})=>o):void 0}]},{dedupe:!0,retryCount:0})}const yM=256;let y4=yM,w4;function SX(t=11){if(!w4||y4+t>yM*2){w4="",y4=0;for(let e=0;e{const b=v(C);for(const S in m)delete b[S];const A={...C,...b};return Object.assign(A,{extend:w(A)})}}return Object.assign(m,{extend:w(m)})}const v4=new k9(8192);function oCe(t,{enabled:e=!0,id:r}){if(!e||!r)return t();if(v4.get(r))return v4.get(r);const n=t().finally(()=>v4.delete(r));return v4.set(r,n),n}function wM(t,{delay:e=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((i,a)=>{const s=async({count:o=0}={})=>{const l=async({error:c})=>{const u=typeof e=="function"?e({count:o,error:c}):e;u&&await mM(u),s({count:o+1})};try{const c=await t();i(c)}catch(c){if(o{const{dedupe:i=!1,retryDelay:a=150,retryCount:s=3,uid:o}={...e,...n},l=i?ea(Dg(`${o}.${ia(r)}`)):void 0;return oCe(()=>wM(async()=>{try{return await t(r)}catch(c){const u=c;switch(u.code){case k3.code:throw new k3(u);case N3.code:throw new N3(u);case L3.code:throw new L3(u,{method:r.method});case j3.code:throw new j3(u);case X0.code:throw new X0(u);case e1.code:throw new e1(u);case $3.code:throw new $3(u);case P3.code:throw new P3(u);case R3.code:throw new R3(u);case D3.code:throw new D3(u,{method:r.method});case Og.code:throw new Og(u);case O3.code:throw new O3(u);case mg.code:throw new mg(u);case F3.code:throw new F3(u);case U3.code:throw new U3(u);case B3.code:throw new B3(u);case z3.code:throw new z3(u);case W3.code:throw new W3(u);case 5e3:throw new mg(u);default:throw c instanceof Qe?c:new e_e(u)}}},{delay:({count:c,error:u})=>{var f;if(u&&u instanceof Dy){const h=(f=u==null?void 0:u.headers)==null?void 0:f.get("Retry-After");if(h!=null&&h.match(/\d/))return Number.parseInt(h)*1e3}return~~(1<cCe(c)}),{enabled:i,id:l})}}function cCe(t){return"code"in t&&typeof t.code=="number"?t.code===-1||t.code===Og.code||t.code===X0.code:t instanceof Dy&&t.status?t.status===403||t.status===408||t.status===413||t.status===429||t.status===500||t.status===502||t.status===503||t.status===504:!0}function IX({key:t,name:e,request:r,retryCount:n=3,retryDelay:i=150,timeout:a,type:s},o){const l=SX();return{config:{key:t,name:e,request:r,retryCount:n,retryDelay:i,timeout:a,type:s},request:lCe(r,{retryCount:n,retryDelay:i,uid:l}),value:o}}function MX(t,e={}){const{key:r="custom",name:n="Custom Provider",retryDelay:i}=e;return({retryCount:a})=>IX({key:r,name:n,request:t.request.bind(t),retryCount:e.retryCount??a,retryDelay:i,type:"custom"})}class uCe extends Qe{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function dCe(t,{errorInstance:e=new Error("timed out"),timeout:r,signal:n}){return new Promise((i,a)=>{(async()=>{let s;try{const o=new AbortController;r>0&&(s=setTimeout(()=>{n?o.abort():a(e)},r)),i(await t({signal:(o==null?void 0:o.signal)||null}))}catch(o){(o==null?void 0:o.name)==="AbortError"&&a(e),a(o)}finally{clearTimeout(s)}})()})}function fCe(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const SU=fCe();function hCe(t,e={}){return{async request(r){var f;const{body:n,onRequest:i=e.onRequest,onResponse:a=e.onResponse,timeout:s=e.timeout??1e4}=r,o={...e.fetchOptions??{},...r.fetchOptions??{}},{headers:l,method:c,signal:u}=o;try{const h=await dCe(async({signal:m})=>{const w={...o,body:Array.isArray(n)?ia(n.map(A=>({jsonrpc:"2.0",id:A.id??SU.take(),...A}))):ia({jsonrpc:"2.0",id:n.id??SU.take(),...n}),headers:{"Content-Type":"application/json",...l},method:c||"POST",signal:u||(s>0?m:null)},C=new Request(t,w),v=await(i==null?void 0:i(C,w))??{...w,url:t};return await fetch(v.url??t,v)},{errorInstance:new gU({body:n,url:t}),timeout:s,signal:!0});a&&await a(h);let g;if((f=h.headers.get("Content-Type"))!=null&&f.startsWith("application/json"))g=await h.json();else{g=await h.text();try{g=JSON.parse(g||"{}")}catch(m){if(h.ok)throw m;g={error:g}}}if(!h.ok)throw new Dy({body:n,details:ia(g.error)||h.statusText,headers:h.headers,status:h.status,url:t});return g}catch(h){throw h instanceof Dy||h instanceof gU?h:new Dy({body:n,cause:h,url:t})}}}}function bc(t,e={}){const{batch:r,fetchOptions:n,key:i="http",name:a="HTTP JSON-RPC",onFetchRequest:s,onFetchResponse:o,retryDelay:l}=e;return({chain:c,retryCount:u,timeout:f})=>{const{batchSize:h=1e3,wait:g=0}=typeof r=="object"?r:{},m=e.retryCount??u,w=f??e.timeout??1e4,C=t||(c==null?void 0:c.rpcUrls.default.http[0]);if(!C)throw new uCe;const v=hCe(C,{fetchOptions:n,onRequest:s,onResponse:o,timeout:w});return IX({key:i,name:a,async request({method:b,params:A}){const S={method:b,params:A},{schedule:j}=_X({id:C,wait:g,shouldSplitBatch(V){return V.length>h},fn:V=>v.request({body:V}),sort:(V,se)=>V.id-se.id}),F=async V=>r?j(V):[await v.request({body:V})],[{error:I,result:B}]=await F(S);if(I)throw new JN({body:S,error:I,url:C});return B},retryCount:m,retryDelay:l,timeout:w,type:"http"},{fetchOptions:n,url:C})}}function fL(t,e){var n,i,a,s,o,l;if(!(t instanceof Qe))return!1;const r=t.walk(c=>c instanceof iM);return r instanceof iM?!!(((n=r.data)==null?void 0:n.errorName)==="ResolverNotFound"||((i=r.data)==null?void 0:i.errorName)==="ResolverWildcardNotSupported"||((a=r.data)==null?void 0:a.errorName)==="ResolverNotContract"||((s=r.data)==null?void 0:s.errorName)==="ResolverError"||((o=r.data)==null?void 0:o.errorName)==="HttpError"||(l=r.reason)!=null&&l.includes("Wildcard on non-extended resolvers is not supported")||e==="reverse"&&r.reason===VZ[50]):!1}function TX(t){if(t.length!==66||t.indexOf("[")!==0||t.indexOf("]")!==65)return null;const e=`0x${t.slice(1,65)}`;return wc(e)?e:null}function S6(t){let e=new Uint8Array(32).fill(0);if(!t)return Si(e);const r=t.split(".");for(let n=r.length-1;n>=0;n-=1){const i=TX(r[n]),a=i?Im(i):ea(N0(r[n]),"bytes");e=ea(Bd([e,a]),"bytes")}return Si(e)}function pCe(t){return`[${t.slice(2)}]`}function gCe(t){const e=new Uint8Array(32).fill(0);return t?TX(t)||ea(N0(t)):Si(e)}function G9(t){const e=t.replace(/^\.|\.$/gm,"");if(e.length===0)return new Uint8Array(1);const r=new Uint8Array(N0(e).byteLength+2);let n=0;const i=e.split(".");for(let a=0;a255&&(s=N0(pCe(gCe(i[a])))),r[n]=s.length,r.set(s,n+1),n+=s.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function mCe(t,{blockNumber:e,blockTag:r,coinType:n,name:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Lm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c=Mc({abi:EU,functionName:"addr",...n!=null?{args:[S6(i),BigInt(n)]}:{args:[S6(i)]}}),u={address:l,abi:vX,functionName:"resolve",args:[ur(G9(i)),c],blockNumber:e,blockTag:r},f=nr(t,Wd,"readContract"),h=a?await f({...u,args:[...u.args,a]}):await f(u);if(h[0]==="0x")return null;const g=E1({abi:EU,args:n!=null?[S6(i),BigInt(n)]:void 0,functionName:"addr",data:h[0]});return g==="0x"||fc(g)==="0x00"?null:g}catch(c){if(s)throw c;if(fL(c,"resolve"))return null;throw c}}class yCe extends Qe{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`],name:"EnsAvatarInvalidMetadataError"})}}class F2 extends Qe{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`,{name:"EnsAvatarInvalidNftUriError"})}}class hL extends Qe{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class wCe extends Qe{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const vCe=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,bCe=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,xCe=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,ECe=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function _Ce(t){try{const e=await fetch(t,{method:"HEAD"});if(e.status===200){const r=e.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(e){return typeof e=="object"&&typeof e.response<"u"||!globalThis.hasOwnProperty("Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=t})}}function AU(t,e){return t?t.endsWith("/")?t.slice(0,-1):t:e}function kX({uri:t,gatewayUrls:e}){const r=xCe.test(t);if(r)return{uri:t,isOnChain:!0,isEncoded:r};const n=AU(e==null?void 0:e.ipfs,"https://ipfs.io"),i=AU(e==null?void 0:e.arweave,"https://arweave.net"),a=t.match(vCe),{protocol:s,subpath:o,target:l,subtarget:c=""}=(a==null?void 0:a.groups)||{},u=s==="ipns:/"||o==="ipns/",f=s==="ipfs:/"||o==="ipfs/"||bCe.test(t);if(t.startsWith("http")&&!u&&!f){let g=t;return e!=null&&e.arweave&&(g=t.replace(/https:\/\/arweave.net/g,e==null?void 0:e.arweave)),{uri:g,isOnChain:!1,isEncoded:!1}}if((u||f)&&l)return{uri:`${n}/${u?"ipns":"ipfs"}/${l}${c}`,isOnChain:!1,isEncoded:!1};if(s==="ar:/"&&l)return{uri:`${i}/${l}${c||""}`,isOnChain:!1,isEncoded:!1};let h=t.replace(ECe,"");if(h.startsWith("i.json());return await pL({gatewayUrls:t,uri:NX(r)})}catch{throw new hL({uri:e})}}async function pL({gatewayUrls:t,uri:e}){const{uri:r,isOnChain:n}=kX({uri:e,gatewayUrls:t});if(n||await _Ce(r))return r;throw new hL({uri:e})}function SCe(t){let e=t;e.startsWith("did:nft:")&&(e=e.replace("did:nft:","").replace(/_/g,"/"));const[r,n,i]=e.split("/"),[a,s]=r.split(":"),[o,l]=n.split(":");if(!a||a.toLowerCase()!=="eip155")throw new F2({reason:"Only EIP-155 supported"});if(!s)throw new F2({reason:"Chain ID not found"});if(!l)throw new F2({reason:"Contract address not found"});if(!i)throw new F2({reason:"Token ID not found"});if(!o)throw new F2({reason:"ERC namespace not found"});return{chainID:Number.parseInt(s),namespace:o.toLowerCase(),contractAddress:l,tokenID:i}}async function ACe(t,{nft:e}){if(e.namespace==="erc721")return Wd(t,{address:e.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(e.tokenID)]});if(e.namespace==="erc1155")return Wd(t,{address:e.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(e.tokenID)]});throw new wCe({namespace:e.namespace})}async function ICe(t,{gatewayUrls:e,record:r}){return/eip155:/i.test(r)?MCe(t,{gatewayUrls:e,record:r}):pL({uri:r,gatewayUrls:e})}async function MCe(t,{gatewayUrls:e,record:r}){const n=SCe(r),i=await ACe(t,{nft:n}),{uri:a,isOnChain:s,isEncoded:o}=kX({uri:i,gatewayUrls:e});if(s&&(a.includes("data:application/json;base64,")||a.startsWith("{"))){const c=o?atob(a.replace("data:application/json;base64,","")):a,u=JSON.parse(c);return pL({uri:NX(u),gatewayUrls:e})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),CCe({gatewayUrls:e,uri:a.replace(/(?:0x)?{id}/,l)})}async function LX(t,{blockNumber:e,blockTag:r,name:n,key:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){let l=o;if(!l){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");l=Lm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}try{const c={address:l,abi:vX,functionName:"resolve",args:[ur(G9(n)),Mc({abi:xU,functionName:"text",args:[S6(n),i]})],blockNumber:e,blockTag:r},u=nr(t,Wd,"readContract"),f=a?await u({...c,args:[...c.args,a]}):await u(c);if(f[0]==="0x")return null;const h=E1({abi:xU,functionName:"text",data:f[0]});return h===""?null:h}catch(c){if(s)throw c;if(fL(c,"resolve"))return null;throw c}}async function TCe(t,{blockNumber:e,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:a,strict:s,universalResolverAddress:o}){const l=await nr(t,LX,"getEnsText")({blockNumber:e,blockTag:r,key:"avatar",name:i,universalResolverAddress:o,gatewayUrls:a,strict:s});if(!l)return null;try{return await ICe(t,{record:l,gatewayUrls:n})}catch{return null}}async function kCe(t,{address:e,blockNumber:r,blockTag:n,gatewayUrls:i,strict:a,universalResolverAddress:s}){let o=s;if(!o){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");o=Lm({blockNumber:r,chain:t.chain,contract:"ensUniversalResolver"})}const l=`${e.toLowerCase().substring(2)}.addr.reverse`;try{const c={address:o,abi:P_e,functionName:"reverse",args:[ur(G9(l))],blockNumber:r,blockTag:n},u=nr(t,Wd,"readContract"),[f,h]=i?await u({...c,args:[...c.args,i]}):await u(c);return e.toLowerCase()!==h.toLowerCase()?null:f}catch(c){if(a)throw c;if(fL(c,"reverse"))return null;throw c}}async function NCe(t,{blockNumber:e,blockTag:r,name:n,universalResolverAddress:i}){let a=i;if(!a){if(!t.chain)throw new Error("client chain not configured. universalResolverAddress is required.");a=Lm({blockNumber:e,chain:t.chain,contract:"ensUniversalResolver"})}const[s]=await nr(t,Wd,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[ur(G9(n))],blockNumber:e,blockTag:r});return s}async function LCe(t,e){var C,v,b;const{account:r=t.account,blockNumber:n,blockTag:i="latest",blobs:a,data:s,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g,...m}=e,w=r?ms(r):void 0;try{x1(e);const S=(n?lr(n):void 0)||i,j=(b=(v=(C=t.chain)==null?void 0:C.formatters)==null?void 0:v.transactionRequest)==null?void 0:b.format,I=(j||Nm)({...R9(m,{format:j}),from:w==null?void 0:w.address,blobs:a,data:s,gas:o,gasPrice:l,maxFeePerBlobGas:c,maxFeePerGas:u,maxPriorityFeePerGas:f,to:h,value:g}),B=await t.request({method:"eth_createAccessList",params:[I,S]});return{accessList:B.accessList,gasUsed:BigInt(B.gasUsed)}}catch(A){throw xX(A,{...e,account:w,chain:t.chain})}}async function jCe(t){const e=L9(t,{method:"eth_newBlockFilter"}),r=await t.request({method:"eth_newBlockFilter"});return{id:r,request:e(r),type:"block"}}async function jX(t,{address:e,args:r,event:n,events:i,fromBlock:a,strict:s,toBlock:o}={}){const l=i??(n?[n]:void 0),c=L9(t,{method:"eth_newFilter"});let u=[];l&&(u=[l.flatMap(g=>Rw({abi:[g],eventName:g.name,args:r}))],n&&(u=u[0]));const f=await t.request({method:"eth_newFilter",params:[{address:e,fromBlock:typeof a=="bigint"?lr(a):a,toBlock:typeof o=="bigint"?lr(o):o,...u.length?{topics:u}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:a,id:f,request:c(f),strict:!!s,toBlock:o,type:"event"}}async function $X(t){const e=L9(t,{method:"eth_newPendingTransactionFilter"}),r=await t.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:e(r),type:"transaction"}}async function $Ce(t){const e=await t.request({method:"eth_blobBaseFee"});return BigInt(e)}async function PCe(t,{blockHash:e,blockNumber:r,blockTag:n="latest"}={}){const i=r!==void 0?lr(r):void 0;let a;return e?a=await t.request({method:"eth_getBlockTransactionCountByHash",params:[e]},{dedupe:!0}):a=await t.request({method:"eth_getBlockTransactionCountByNumber",params:[i||n]},{dedupe:!!i}),Mu(a)}async function IU(t,{address:e,blockNumber:r,blockTag:n="latest"}){const i=r!==void 0?lr(r):void 0,a=await t.request({method:"eth_getCode",params:[e,i||n]},{dedupe:!!i});if(a!=="0x")return a}function RCe(t){var e;return{baseFeePerGas:t.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:t.gasUsedRatio,oldestBlock:BigInt(t.oldestBlock),reward:(e=t.reward)==null?void 0:e.map(r=>r.map(n=>BigInt(n)))}}async function DCe(t,{blockCount:e,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){const a=r?lr(r):void 0,s=await t.request({method:"eth_feeHistory",params:[lr(e),a||n,i]},{dedupe:!!a});return RCe(s)}async function OCe(t,{filter:e}){const r=e.strict??!1,i=(await e.request({method:"eth_getFilterLogs",params:[e.id]})).map(a=>zd(a));return e.abi?lL({abi:e.abi,logs:i,strict:r}):i}function FCe(t){return{formatters:void 0,fees:void 0,serializers:void 0,...t}}class UCe extends Qe{constructor({domain:e}){super(`Invalid domain "${ia(e)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class BCe extends Qe{constructor({primaryType:e,types:r}){super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class zCe extends Qe{constructor({type:e}){super(`Struct type "${e}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function WCe(t){const{domain:e={},message:r,primaryType:n}=t,i={EIP712Domain:UX({domain:e}),...t.types};FX({domain:e,message:r,primaryType:n,types:i});const a=["0x1901"];return e&&a.push(HCe({domain:e,types:i})),n!=="EIP712Domain"&&a.push(PX({data:r,primaryType:n,types:i})),ea(Bd(a))}function HCe({domain:t,types:e}){return PX({data:t,primaryType:"EIP712Domain",types:e})}function PX({data:t,primaryType:e,types:r}){const n=RX({data:t,primaryType:e,types:r});return ea(n)}function RX({data:t,primaryType:e,types:r}){const n=[{type:"bytes32"}],i=[GCe({primaryType:e,types:r})];for(const a of r[e]){const[s,o]=OX({types:r,name:a.name,type:a.type,value:t[a.name]});n.push(s),i.push(o)}return Mm(n,i)}function GCe({primaryType:t,types:e}){const r=ur(qCe({primaryType:t,types:e}));return ea(r)}function qCe({primaryType:t,types:e}){let r="";const n=DX({primaryType:t,types:e});n.delete(t);const i=[t,...Array.from(n).sort()];for(const a of i)r+=`${a}(${e[a].map(({name:s,type:o})=>`${o} ${s}`).join(",")})`;return r}function DX({primaryType:t,types:e},r=new Set){const n=t.match(/^\w*/u),i=n==null?void 0:n[0];if(r.has(i)||e[i]===void 0)return r;r.add(i);for(const a of e[i])DX({primaryType:a.type,types:e},r);return r}function OX({types:t,name:e,type:r,value:n}){if(t[r]!==void 0)return[{type:"bytes32"},ea(RX({data:n,primaryType:r,types:t}))];if(r==="bytes")return n=`0x${(n.length%2?"0":"")+n.slice(2)}`,[{type:"bytes32"},ea(n)];if(r==="string")return[{type:"bytes32"},ea(ur(n))];if(r.lastIndexOf("]")===r.length-1){const i=r.slice(0,r.lastIndexOf("[")),a=n.map(s=>OX({name:e,type:i,types:t,value:s}));return[{type:"bytes32"},ea(Mm(a.map(([s])=>s),a.map(([,s])=>s)))]}return[{type:r},n]}function VCe(t){const{domain:e,message:r,primaryType:n,types:i}=t,a=(l,c)=>{const u={...c};for(const f of l){const{name:h,type:g}=f;g==="address"&&(u[h]=u[h].toLowerCase())}return u},s=i.EIP712Domain?e?a(i.EIP712Domain,e):{}:{},o=(()=>{if(n!=="EIP712Domain")return a(i[n],r)})();return ia({domain:s,message:o,primaryType:n,types:i})}function FX(t){const{domain:e,message:r,primaryType:n,types:i}=t,a=(s,o)=>{for(const l of s){const{name:c,type:u}=l,f=o[c],h=u.match(HZ);if(h&&(typeof f=="number"||typeof f=="bigint")){const[w,C,v]=h;lr(f,{signed:C==="int",size:Number.parseInt(v)/8})}if(u==="address"&&typeof f=="string"&&!Tn(f))throw new fs({address:f});const g=u.match(pEe);if(g){const[w,C]=g;if(C&&ai(f)!==Number.parseInt(C))throw new S7e({expectedSize:Number.parseInt(C),givenSize:ai(f)})}const m=i[u];m&&(YCe(u),a(m,f))}};if(i.EIP712Domain&&e){if(typeof e!="object")throw new UCe({domain:e});a(i.EIP712Domain,e)}if(n!=="EIP712Domain")if(i[n])a(i[n],r);else throw new BCe({primaryType:n,types:i})}function UX({domain:t}){return[typeof(t==null?void 0:t.name)=="string"&&{name:"name",type:"string"},(t==null?void 0:t.version)&&{name:"version",type:"string"},typeof(t==null?void 0:t.chainId)=="number"&&{name:"chainId",type:"uint256"},(t==null?void 0:t.verifyingContract)&&{name:"verifyingContract",type:"address"},(t==null?void 0:t.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function YCe(t){if(t==="address"||t==="bool"||t==="string"||t.startsWith("bytes")||t.startsWith("uint")||t.startsWith("int"))throw new zCe({type:t})}function KCe(t){const{abi:e,data:r}=t,n=Z0(r,0,4),i=e.find(a=>a.type==="function"&&n===N9(Iu(a)));if(!i)throw new _7e(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:i.name,args:"inputs"in i&&i.inputs&&i.inputs.length>0?Tm(i.inputs,Z0(r,4)):void 0}}const JCe={"0x0":"reverted","0x1":"success"};function BX(t){const e={...t,blockNumber:t.blockNumber?BigInt(t.blockNumber):null,contractAddress:t.contractAddress?t.contractAddress:null,cumulativeGasUsed:t.cumulativeGasUsed?BigInt(t.cumulativeGasUsed):null,effectiveGasPrice:t.effectiveGasPrice?BigInt(t.effectiveGasPrice):null,gasUsed:t.gasUsed?BigInt(t.gasUsed):null,logs:t.logs?t.logs.map(r=>zd(r)):null,to:t.to?t.to:null,transactionIndex:t.transactionIndex?Mu(t.transactionIndex):null,status:t.status?JCe[t.status]:null,type:t.type?aX[t.type]||t.type:null};return t.blobGasPrice&&(e.blobGasPrice=BigInt(t.blobGasPrice)),t.blobGasUsed&&(e.blobGasUsed=BigInt(t.blobGasUsed)),e}const QCe=QN("transactionReceipt",BX),ZCe=`Ethereum Signed Message: +`;function XCe(t){const e=typeof t=="string"?Dg(t):typeof t.raw=="string"?t.raw:Si(t.raw),r=Dg(`${ZCe}${ai(e)}`);return Bd([r,e])}function zX(t,e){return ea(XCe(t),e)}const WX="0x6492649264926492649264926492649264926492649264926492649264926492";function eSe(t){return WZ(t,-32)===WX}function tSe(t){const{address:e,data:r,signature:n,to:i="hex"}=t,a=ju([Mm([{type:"address"},{type:"bytes"},{type:"bytes"}],[e,r,n]),WX]);return i==="hex"?a:vc(a)}function rSe(t){const{authorizationList:e}=t;if(e)for(const r of e){const{contractAddress:n,chainId:i}=r;if(!Tn(n))throw new fs({address:n});if(i<0)throw new U9({chainId:i})}gL(t)}function nSe(t){const{blobVersionedHashes:e}=t;if(e){if(e.length===0)throw new fX;for(const r of e){const n=ai(r),i=Mu(Z0(r,0,1));if(n!==32)throw new T_e({hash:r,size:n});if(i!==dX)throw new k_e({hash:r,version:i})}}gL(t)}function gL(t){const{chainId:e,maxPriorityFeePerGas:r,maxFeePerGas:n,to:i}=t;if(e<=0)throw new U9({chainId:e});if(i&&!Tn(i))throw new fs({address:i});if(n&&n>D9)throw new r1({maxFeePerGas:n});if(r&&n&&r>n)throw new H3({maxFeePerGas:n,maxPriorityFeePerGas:r})}function iSe(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:a}=t;if(e<=0)throw new U9({chainId:e});if(a&&!Tn(a))throw new fs({address:a});if(r||i)throw new Qe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(n&&n>D9)throw new r1({maxFeePerGas:n})}function aSe(t){const{chainId:e,maxPriorityFeePerGas:r,gasPrice:n,maxFeePerGas:i,to:a}=t;if(a&&!Tn(a))throw new fs({address:a});if(typeof e<"u"&&e<=0)throw new U9({chainId:e});if(r||i)throw new Qe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(n&&n>D9)throw new r1({maxFeePerGas:n})}function sSe(t){if(!t||t.length===0)return[];const e=[];for(const r of t){const{contractAddress:n,chainId:i,nonce:a,...s}=r;e.push([i?ur(i):"0x",n,a?ur(a):"0x",...Hw({},s)])}return e}function q9(t){if(!t||t.length===0)return[];const e=[];for(let r=0;r"u"||typeof g>"u")){const A=typeof t.blobs[0]=="string"?t.blobs:t.blobs.map(F=>Si(F)),S=t.kzg,j=rL({blobs:A,kzg:S});if(typeof h>"u"&&(h=lX({commitments:j})),typeof g>"u"){const F=nL({blobs:A,commitments:j,kzg:S});g=hX({blobs:A,commitments:j,proofs:F})}}const m=q9(u),w=[ur(r),i?ur(i):"0x",c?ur(c):"0x",l?ur(l):"0x",n?ur(n):"0x",a??"0x",s?ur(s):"0x",f??"0x",m,o?ur(o):"0x",h??[],...Hw(t,e)],C=[],v=[],b=[];if(g)for(let A=0;A{if(e.v>=35n)return(e.v-35n)/2n>0?e.v:27n+(e.v===35n?0n:1n);if(r>0)return BigInt(r*2)+BigInt(35n+e.v-27n);const g=27n+(e.v===27n?0n:1n);if(e.v!==g)throw new HEe({v:e.v});return g})(),f=fc(e.r),h=fc(e.s);c=[...c,ur(u),f==="0x00"?"0x":f,h==="0x00"?"0x":h]}else r>0&&(c=[...c,ur(r),"0x","0x"]);return lh(c)}function Hw(t,e){const r=e??t,{v:n,yParity:i}=r;if(typeof r.r>"u")return[];if(typeof r.s>"u")return[];if(typeof n>"u"&&typeof i>"u")return[];const a=fc(r.r),s=fc(r.s);return[typeof i=="number"?i?ur(1):"0x":n===0n?"0x":n===1n?ur(1):n===27n?"0x":ur(1),a==="0x00"?"0x":a,s==="0x00"?"0x":s]}class hSe extends Qe{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function pSe(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new hSe({value:t});let[r,n="0"]=t.split(".");const i=r.startsWith("-");if(i&&(r=r.slice(1)),n=n.replace(/(0+)$/,""),e===0)Math.round(+`.${n}`)===1&&(r=`${BigInt(r)+1n}`),n="";else if(n.length>e){const[a,s,o]=[n.slice(0,e-1),n.slice(e-1,e),n.slice(e)],l=Math.round(+`${s}.${o}`);l>9?n=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):n=`${a}${l}`,n.length>e&&(n=n.slice(1),r=`${BigInt(r)+1n}`),n=n.slice(0,e)}else n=n.padEnd(e,"0");return BigInt(`${i?"-":""}${r}${n}`)}function HX(t,e="wei"){return pSe(t,JZ[e])}function gSe(t){return t.map(e=>({...e,value:BigInt(e.value)}))}function mSe(t){return{...t,balance:t.balance?BigInt(t.balance):void 0,nonce:t.nonce?Mu(t.nonce):void 0,storageProof:t.storageProof?gSe(t.storageProof):void 0}}async function ySe(t,{address:e,blockNumber:r,blockTag:n,storageKeys:i}){const a=n??"latest",s=r!==void 0?lr(r):void 0,o=await t.request({method:"eth_getProof",params:[e,i,s||a]});return mSe(o)}async function wSe(t,{address:e,blockNumber:r,blockTag:n="latest",slot:i}){const a=r!==void 0?lr(r):void 0;return await t.request({method:"eth_getStorageAt",params:[e,i,a||n]})}async function mL(t,{blockHash:e,blockNumber:r,blockTag:n,hash:i,index:a}){var u,f,h;const s=n||"latest",o=r!==void 0?lr(r):void 0;let l=null;if(i?l=await t.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):e?l=await t.request({method:"eth_getTransactionByBlockHashAndIndex",params:[e,lr(a)]},{dedupe:!0}):(o||s)&&(l=await t.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[o||s,lr(a)]},{dedupe:!!o})),!l)throw new QZ({blockHash:e,blockNumber:r,blockTag:s,hash:i,index:a});return(((h=(f=(u=t.chain)==null?void 0:u.formatters)==null?void 0:f.transaction)==null?void 0:h.format)||O9)(l)}async function vSe(t,{hash:e,transactionReceipt:r}){const[n,i]=await Promise.all([nr(t,zw,"getBlockNumber")({}),e?nr(t,mL,"getTransaction")({hash:e}):void 0]),a=(r==null?void 0:r.blockNumber)||(i==null?void 0:i.blockNumber);return a?n-a+1n:0n}async function vM(t,{hash:e}){var i,a,s;const r=await t.request({method:"eth_getTransactionReceipt",params:[e]},{dedupe:!0});if(!r)throw new ZZ({hash:e});return(((s=(a=(i=t.chain)==null?void 0:i.formatters)==null?void 0:a.transactionReceipt)==null?void 0:s.format)||BX)(r)}async function bSe(t,e){var C;const{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:a,multicallAddress:s,stateOverride:o}=e,l=e.contracts,c=n??(typeof((C=t.batch)==null?void 0:C.multicall)=="object"&&t.batch.multicall.batchSize||1024);let u=s;if(!u){if(!t.chain)throw new Error("client chain not configured. multicallAddress is required.");u=Lm({blockNumber:i,chain:t.chain,contract:"multicall3"})}const f=[[]];let h=0,g=0;for(let v=0;v0&&g>c&&f[h].length>0&&(h++,g=(F.length-2)/2,f[h]=[]),f[h]=[...f[h],{allowFailure:!0,callData:F,target:A}]}catch(F){const I=t1(F,{abi:b,address:A,args:S,docsPath:"/docs/contract/multicall",functionName:j});if(!r)throw I;f[h]=[...f[h],{allowFailure:!0,callData:"0x",target:A}]}}const m=await Promise.allSettled(f.map(v=>nr(t,Wd,"readContract")({abi:pM,address:u,args:[v],blockNumber:i,blockTag:a,functionName:"aggregate3",stateOverride:o}))),w=[];for(let v=0;ve.toString(16).padStart(2,"0"));function Ug(t){Gw(t);let e="";for(let r=0;r=Xu._0&&t<=Xu._9)return t-Xu._0;if(t>=Xu.A&&t<=Xu.F)return t-(Xu.A-10);if(t>=Xu.a&&t<=Xu.f)return t-(Xu.a-10)}function Bg(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,r=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(r);for(let i=0,a=0;itypeof t=="bigint"&&V9<=t;function K9(t,e,r){return NC(t)&&NC(e)&&NC(r)&&e<=t&&tV9;t>>=Y9,e+=1);return e}function ASe(t,e){return t>>BigInt(e)&Y9}function ISe(t,e,r){return t|(r?Y9:V9)<(xSe<new Uint8Array(t),TU=t=>Uint8Array.from(t);function qX(t,e,r){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=LC(t),i=LC(t),a=0;const s=()=>{n.fill(1),i.fill(0),a=0},o=(...f)=>r(i,n,...f),l=(f=LC())=>{i=o(TU([0]),f),n=o(),f.length!==0&&(i=o(TU([1]),f),n=o())},c=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let f=0;const h=[];for(;f{s(),l(f);let g;for(;!(g=h(c()));)l();return s(),g}}const MSe={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||n1(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function qw(t,e,r={}){const n=(i,a,s)=>{const o=MSe[a];if(typeof o!="function")throw new Error("invalid validator function");const l=t[i];if(!(s&&l===void 0)&&!o(l,t))throw new Error("param "+String(i)+" is invalid. Expected "+a+", got "+l)};for(const[i,a]of Object.entries(e))n(i,a,!1);for(const[i,a]of Object.entries(r))n(i,a,!0);return t}const TSe=()=>{throw new Error("not implemented")};function bM(t){const e=new WeakMap;return(r,...n)=>{const i=e.get(r);if(i!==void 0)return i;const a=t(r,...n);return e.set(r,a),a}}const kSe=Object.freeze(Object.defineProperty({__proto__:null,aInRange:j0,abool:Fg,abytes:Gw,bitGet:ASe,bitLen:GX,bitMask:bL,bitSet:ISe,bytesToHex:Ug,bytesToNumberBE:L0,bytesToNumberLE:wL,concatBytes:G3,createHmacDrbg:qX,ensureBytes:Jl,equalBytes:CSe,hexToBytes:Bg,hexToNumber:yL,inRange:K9,isBytes:n1,memoized:bM,notImplemented:TSe,numberToBytesBE:zg,numberToBytesLE:vL,numberToHexUnpadded:Xp,numberToVarBytesBE:_Se,utf8ToBytes:SSe,validateObject:qw},Symbol.toStringTag,{value:"Module"})),NSe="0.1.1";function LSe(){return NSe}class q3 extends Error{constructor(e,r={}){const n=(()=>{var l;if(r.cause instanceof q3){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),i=r.cause instanceof q3&&r.cause.docsPath||r.docsPath,s=`https://oxlib.sh${i??""}`,o=[e||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||i?["",n?`Details: ${n}`:void 0,i?`See: ${s}`:void 0]:[]].filter(l=>typeof l=="string").join(` +`);super(o,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${LSe()}`}),this.cause=r.cause,this.details=n,this.docs=s,this.docsPath=i,this.shortMessage=e}walk(e){return VX(this,e)}}function VX(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause?VX(t.cause,e):e?null:t}function jSe(t,e={}){const{dir:r,size:n=32}=e;if(n===0)return t;const i=t.replace("0x","");if(i.length>n*2)throw new RSe({size:Math.ceil(i.length/2),targetSize:n,type:"Hex"});return`0x${i[r==="right"?"padEnd":"padStart"](n*2,"0")}`}function yd(t,e={}){const{signed:r,size:n}=e,i=BigInt(t);let a;n?r?a=(1n<a||i{const v=C,b=v.account?ms(v.account):void 0,A={...v,data:v.abi?Mc(v):v.data,from:v.from??(b==null?void 0:b.address)};return x1(A),Nm(A)}),w=h.stateOverrides?ZN(h.stateOverrides):void 0;l.push({blockOverrides:g,calls:m,stateOverrides:w})}const u=(r?lr(r):void 0)||n;return(await t.request({method:"eth_simulateV1",params:[{blockStateCalls:l,returnFullTransactions:a,traceTransfers:s,validation:o},u]})).map((h,g)=>({...eL(h),calls:h.calls.map((m,w)=>{var se,Y;const{abi:C,args:v,functionName:b,to:A}=i[g].calls[w],S=((se=m.error)==null?void 0:se.data)??m.returnData,j=BigInt(m.gasUsed),F=(Y=m.logs)==null?void 0:Y.map(N=>zd(N)),I=m.status==="0x1"?"success":"failure",B=C?E1({abi:C,data:S,functionName:b}):null,V=(()=>{var k;if(I==="success")return;let N;if(((k=m.error)==null?void 0:k.data)==="0x"?N=new jw:m.error&&(N=new $9(m.error)),!!N)return t1(N,{abi:C??[],address:A,args:v,functionName:b??""})})();return{data:S,gasUsed:j,logs:F,status:I,...I==="success"?{result:B}:{error:V}}})}))}catch(l){const c=l,u=P9(c,{});throw u instanceof Fw?c:u}}function kU(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function USe(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function J9(t,...e){if(!USe(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function BSe(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");kU(t.outputLen),kU(t.blockLen)}function z5(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function zSe(t,e){J9(t);const r=e.outputLen;if(t.lengthnew DataView(t.buffer,t.byteOffset,t.byteLength),Fc=(t,e)=>t<<32-e|t>>>e;function WSe(t){if(typeof t!="string")throw new Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array(new TextEncoder().encode(t))}function xL(t){return typeof t=="string"&&(t=WSe(t)),J9(t),t}function HSe(...t){let e=0;for(let n=0;nt().update(xL(n)).digest(),r=t();return e.outputLen=r.outputLen,e.blockLen=r.blockLen,e.create=()=>t(),e}function qSe(t=32){if(gp&&typeof gp.getRandomValues=="function")return gp.getRandomValues(new Uint8Array(t));if(gp&&typeof gp.randomBytes=="function")return gp.randomBytes(t);throw new Error("crypto.getRandomValues must be defined")}function VSe(t,e,r,n){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,r,n);const i=BigInt(32),a=BigInt(4294967295),s=Number(r>>i&a),o=Number(r&a),l=n?4:0,c=n?0:4;t.setUint32(e+l,s,n),t.setUint32(e+c,o,n)}const YSe=(t,e,r)=>t&e^~t&r,KSe=(t,e,r)=>t&e^t&r^e&r;class JSe extends YX{constructor(e,r,n,i){super(),this.blockLen=e,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=jC(this.buffer)}update(e){z5(this);const{view:r,buffer:n,blockLen:i}=this;e=xL(e);const a=e.length;for(let s=0;si-s&&(this.process(n,0),s=0);for(let f=s;fu.length)throw new Error("_sha2: outputLen bigger than state");for(let f=0;f>>3,w=Fc(g,17)^Fc(g,19)^g>>>10;_f[f]=w+_f[f-7]+m+_f[f-16]|0}let{A:n,B:i,C:a,D:s,E:o,F:l,G:c,H:u}=this;for(let f=0;f<64;f++){const h=Fc(o,6)^Fc(o,11)^Fc(o,25),g=u+h+YSe(o,l,c)+QSe[f]+_f[f]|0,w=(Fc(n,2)^Fc(n,13)^Fc(n,22))+KSe(n,i,a)|0;u=c,c=l,l=o,o=s+g|0,s=a,a=i,i=n,n=g+w|0}n=n+this.A|0,i=i+this.B|0,a=a+this.C|0,s=s+this.D|0,o=o+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(n,i,a,s,o,l,c,u)}roundClean(){_f.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const XSe=GSe(()=>new ZSe);let KX=class extends YX{constructor(e,r){super(),this.finished=!1,this.destroyed=!1,BSe(e);const n=xL(r);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,a=new Uint8Array(i);a.set(n.length>i?e.create().update(n).digest():n);for(let s=0;snew KX(t,e).update(r).digest();JX.create=(t,e)=>new KX(t,e);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ta=BigInt(0),mi=BigInt(1),h0=BigInt(2),eAe=BigInt(3),xM=BigInt(4),NU=BigInt(5),LU=BigInt(8);function $s(t,e){const r=t%e;return r>=ta?r:e+r}function tAe(t,e,r){if(eta;)e&mi&&(n=n*t%r),t=t*t%r,e>>=mi;return n}function Qo(t,e,r){let n=t;for(;e-- >ta;)n*=n,n%=r;return n}function EM(t,e){if(t===ta)throw new Error("invert: expected non-zero number");if(e<=ta)throw new Error("invert: expected positive modulus, got "+e);let r=$s(t,e),n=e,i=ta,a=mi;for(;r!==ta;){const o=n/r,l=n%r,c=i-a*o;n=r,r=l,i=a,a=c}if(n!==mi)throw new Error("invert: does not exist");return $s(i,e)}function rAe(t){const e=(t-mi)/h0;let r,n,i;for(r=t-mi,n=0;r%h0===ta;r/=h0,n++);for(i=h0;i1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const s=(t+mi)/xM;return function(l,c){const u=l.pow(c,s);if(!l.eql(l.sqr(u),c))throw new Error("Cannot find square root");return u}}const a=(r+mi)/h0;return function(o,l){if(o.pow(l,e)===o.neg(o.ONE))throw new Error("Cannot find square root");let c=n,u=o.pow(o.mul(o.ONE,i),r),f=o.pow(l,a),h=o.pow(l,r);for(;!o.eql(h,o.ONE);){if(o.eql(h,o.ZERO))return o.ZERO;let g=1;for(let w=o.sqr(h);g(n[i]="function",n),e);return qw(t,r)}function sAe(t,e,r){if(rta;)r&mi&&(n=t.mul(n,i)),i=t.sqr(i),r>>=mi;return n}function oAe(t,e){const r=new Array(e.length),n=e.reduce((a,s,o)=>t.is0(s)?a:(r[o]=a,t.mul(a,s)),t.ONE),i=t.inv(n);return e.reduceRight((a,s,o)=>t.is0(s)?a:(r[o]=t.mul(a,r[o]),t.mul(a,s)),i),r}function QX(t,e){const r=e!==void 0?e:t.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function ZX(t,e,r=!1,n={}){if(t<=ta)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:i,nByteLength:a}=QX(t,e);if(a>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const o=Object.freeze({ORDER:t,BITS:i,BYTES:a,MASK:bL(i),ZERO:ta,ONE:mi,create:l=>$s(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return ta<=l&&ll===ta,isOdd:l=>(l&mi)===mi,neg:l=>$s(-l,t),eql:(l,c)=>l===c,sqr:l=>$s(l*l,t),add:(l,c)=>$s(l+c,t),sub:(l,c)=>$s(l-c,t),mul:(l,c)=>$s(l*c,t),pow:(l,c)=>sAe(o,l,c),div:(l,c)=>$s(l*EM(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>EM(l,t),sqrt:n.sqrt||(l=>(s||(s=nAe(t)),s(o,l))),invertBatch:l=>oAe(o,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>r?vL(l,a):zg(l,a),fromBytes:l=>{if(l.length!==a)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+l.length);return r?wL(l):L0(l)}});return Object.freeze(o)}function XX(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function eee(t){const e=XX(t);return e+Math.ceil(e/2)}function lAe(t,e,r=!1){const n=t.length,i=XX(e),a=eee(e);if(n<16||n1024)throw new Error("expected "+a+"-1024 bytes of input, got "+n);const s=r?L0(t):wL(t),o=$s(s,e-mi)+mi;return r?vL(o,i):zg(o,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const jU=BigInt(0),b4=BigInt(1);function $C(t,e){const r=e.negate();return t?r:e}function tee(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function PC(t,e){tee(t,e);const r=Math.ceil(e/t)+1,n=2**(t-1);return{windows:r,windowSize:n}}function cAe(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((r,n)=>{if(!(r instanceof e))throw new Error("invalid point at index "+n)})}function uAe(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((r,n)=>{if(!e.isValid(r))throw new Error("invalid scalar at index "+n)})}const RC=new WeakMap,ree=new WeakMap;function DC(t){return ree.get(t)||1}function dAe(t,e){return{constTimeNegate:$C,hasPrecomputes(r){return DC(r)!==1},unsafeLadder(r,n,i=t.ZERO){let a=r;for(;n>jU;)n&b4&&(i=i.add(a)),a=a.double(),n>>=b4;return i},precomputeWindow(r,n){const{windows:i,windowSize:a}=PC(n,e),s=[];let o=r,l=o;for(let c=0;c>=f,m>s&&(m-=u,i+=b4);const w=g,C=g+Math.abs(m)-1,v=h%2!==0,b=m<0;m===0?l=l.add($C(v,n[w])):o=o.add($C(b,n[C]))}return{p:o,f:l}},wNAFUnsafe(r,n,i,a=t.ZERO){const{windows:s,windowSize:o}=PC(r,e),l=BigInt(2**r-1),c=2**r,u=BigInt(r);for(let f=0;f>=u,g>o&&(g-=c,i+=b4),g===0)continue;let m=n[h+Math.abs(g)-1];g<0&&(m=m.negate()),a=a.add(m)}return a},getPrecomputes(r,n,i){let a=RC.get(n);return a||(a=this.precomputeWindow(n,r),r!==1&&RC.set(n,i(a))),a},wNAFCached(r,n,i){const a=DC(r);return this.wNAF(a,this.getPrecomputes(a,r,i),n)},wNAFCachedUnsafe(r,n,i,a){const s=DC(r);return s===1?this.unsafeLadder(r,n,a):this.wNAFUnsafe(s,this.getPrecomputes(s,r,i),n,a)},setWindowSize(r,n){tee(n,e),ree.set(r,n),RC.delete(r)}}}function fAe(t,e,r,n){if(cAe(r,t),uAe(n,e),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=t.ZERO,a=GX(BigInt(r.length)),s=a>12?a-3:a>4?a-2:a?2:1,o=(1<=0;f-=s){l.fill(i);for(let g=0;g>BigInt(f)&BigInt(o));l[w]=l[w].add(r[g])}let h=i;for(let g=l.length-1,m=i;g>0;g--)m=m.add(l[g]),h=h.add(m);if(u=u.add(h),f!==0)for(let g=0;g{const{Err:r}=wd;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length&1)throw new r("tlv.encode: unpadded data");const n=e.length/2,i=Xp(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");const a=n>127?Xp(i.length/2|128):"";return Xp(t)+a+i+e},decode(t,e){const{Err:r}=wd;let n=0;if(t<0||t>256)throw new r("tlv.encode: wrong tag");if(e.length<2||e[n++]!==t)throw new r("tlv.decode: wrong tlv");const i=e[n++],a=!!(i&128);let s=0;if(!a)s=i;else{const l=i&127;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const c=e.subarray(n,n+l);if(c.length!==l)throw new r("tlv.decode: length bytes not complete");if(c[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const u of c)s=s<<8|u;if(n+=l,s<128)throw new r("tlv.decode(long): not minimal encoding")}const o=e.subarray(n,n+s);if(o.length!==s)throw new r("tlv.decode: wrong value length");return{v:o,l:e.subarray(n+s)}}},_int:{encode(t){const{Err:e}=wd;if(t<_d)throw new e("integer: negative integers are not allowed");let r=Xp(t);if(Number.parseInt(r[0],16)&8&&(r="00"+r),r.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return r},decode(t){const{Err:e}=wd;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return pAe(t)}},toSig(t){const{Err:e,_int:r,_tlv:n}=wd,i=typeof t=="string"?gAe(t):t;Gw(i);const{v:a,l:s}=n.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:o,l}=n.decode(2,a),{v:c,l:u}=n.decode(2,l);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:r.decode(o),s:r.decode(c)}},hexFromSig(t){const{_tlv:e,_int:r}=wd,n=e.encode(2,r.encode(t.r)),i=e.encode(2,r.encode(t.s)),a=n+i;return e.encode(48,a)}},_d=BigInt(0),qi=BigInt(1);BigInt(2);const PU=BigInt(3);BigInt(4);function mAe(t){const e=hAe(t),{Fp:r}=e,n=ZX(e.n,e.nBitLength),i=e.toBytes||((w,C,v)=>{const b=C.toAffine();return G3(Uint8Array.from([4]),r.toBytes(b.x),r.toBytes(b.y))}),a=e.fromBytes||(w=>{const C=w.subarray(1),v=r.fromBytes(C.subarray(0,r.BYTES)),b=r.fromBytes(C.subarray(r.BYTES,2*r.BYTES));return{x:v,y:b}});function s(w){const{a:C,b:v}=e,b=r.sqr(w),A=r.mul(b,w);return r.add(r.add(A,r.mul(w,C)),v)}if(!r.eql(r.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function o(w){return K9(w,qi,e.n)}function l(w){const{allowedPrivateKeyLengths:C,nByteLength:v,wrapPrivateKey:b,n:A}=e;if(C&&typeof w!="bigint"){if(n1(w)&&(w=Ug(w)),typeof w!="string"||!C.includes(w.length))throw new Error("invalid private key");w=w.padStart(v*2,"0")}let S;try{S=typeof w=="bigint"?w:L0(Jl("private key",w,v))}catch{throw new Error("invalid private key, expected hex or "+v+" bytes, got "+typeof w)}return b&&(S=$s(S,A)),j0("private key",S,qi,A),S}function c(w){if(!(w instanceof h))throw new Error("ProjectivePoint expected")}const u=bM((w,C)=>{const{px:v,py:b,pz:A}=w;if(r.eql(A,r.ONE))return{x:v,y:b};const S=w.is0();C==null&&(C=S?r.ONE:r.inv(A));const j=r.mul(v,C),F=r.mul(b,C),I=r.mul(A,C);if(S)return{x:r.ZERO,y:r.ZERO};if(!r.eql(I,r.ONE))throw new Error("invZ was invalid");return{x:j,y:F}}),f=bM(w=>{if(w.is0()){if(e.allowInfinityPoint&&!r.is0(w.py))return;throw new Error("bad point: ZERO")}const{x:C,y:v}=w.toAffine();if(!r.isValid(C)||!r.isValid(v))throw new Error("bad point: x or y not FE");const b=r.sqr(v),A=s(C);if(!r.eql(b,A))throw new Error("bad point: equation left != right");if(!w.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class h{constructor(C,v,b){if(this.px=C,this.py=v,this.pz=b,C==null||!r.isValid(C))throw new Error("x required");if(v==null||!r.isValid(v))throw new Error("y required");if(b==null||!r.isValid(b))throw new Error("z required");Object.freeze(this)}static fromAffine(C){const{x:v,y:b}=C||{};if(!C||!r.isValid(v)||!r.isValid(b))throw new Error("invalid affine point");if(C instanceof h)throw new Error("projective point not allowed");const A=S=>r.eql(S,r.ZERO);return A(v)&&A(b)?h.ZERO:new h(v,b,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(C){const v=r.invertBatch(C.map(b=>b.pz));return C.map((b,A)=>b.toAffine(v[A])).map(h.fromAffine)}static fromHex(C){const v=h.fromAffine(a(Jl("pointHex",C)));return v.assertValidity(),v}static fromPrivateKey(C){return h.BASE.multiply(l(C))}static msm(C,v){return fAe(h,n,C,v)}_setWindowSize(C){m.setWindowSize(this,C)}assertValidity(){f(this)}hasEvenY(){const{y:C}=this.toAffine();if(r.isOdd)return!r.isOdd(C);throw new Error("Field doesn't support isOdd")}equals(C){c(C);const{px:v,py:b,pz:A}=this,{px:S,py:j,pz:F}=C,I=r.eql(r.mul(v,F),r.mul(S,A)),B=r.eql(r.mul(b,F),r.mul(j,A));return I&&B}negate(){return new h(this.px,r.neg(this.py),this.pz)}double(){const{a:C,b:v}=e,b=r.mul(v,PU),{px:A,py:S,pz:j}=this;let F=r.ZERO,I=r.ZERO,B=r.ZERO,V=r.mul(A,A),se=r.mul(S,S),Y=r.mul(j,j),N=r.mul(A,S);return N=r.add(N,N),B=r.mul(A,j),B=r.add(B,B),F=r.mul(C,B),I=r.mul(b,Y),I=r.add(F,I),F=r.sub(se,I),I=r.add(se,I),I=r.mul(F,I),F=r.mul(N,F),B=r.mul(b,B),Y=r.mul(C,Y),N=r.sub(V,Y),N=r.mul(C,N),N=r.add(N,B),B=r.add(V,V),V=r.add(B,V),V=r.add(V,Y),V=r.mul(V,N),I=r.add(I,V),Y=r.mul(S,j),Y=r.add(Y,Y),V=r.mul(Y,N),F=r.sub(F,V),B=r.mul(Y,se),B=r.add(B,B),B=r.add(B,B),new h(F,I,B)}add(C){c(C);const{px:v,py:b,pz:A}=this,{px:S,py:j,pz:F}=C;let I=r.ZERO,B=r.ZERO,V=r.ZERO;const se=e.a,Y=r.mul(e.b,PU);let N=r.mul(v,S),k=r.mul(b,j),x=r.mul(A,F),E=r.add(v,b),L=r.add(S,j);E=r.mul(E,L),L=r.add(N,k),E=r.sub(E,L),L=r.add(v,A);let O=r.add(S,F);return L=r.mul(L,O),O=r.add(N,x),L=r.sub(L,O),O=r.add(b,A),I=r.add(j,F),O=r.mul(O,I),I=r.add(k,x),O=r.sub(O,I),V=r.mul(se,L),I=r.mul(Y,x),V=r.add(I,V),I=r.sub(k,V),V=r.add(k,V),B=r.mul(I,V),k=r.add(N,N),k=r.add(k,N),x=r.mul(se,x),L=r.mul(Y,L),k=r.add(k,x),x=r.sub(N,x),x=r.mul(se,x),L=r.add(L,x),N=r.mul(k,L),B=r.add(B,N),N=r.mul(O,L),I=r.mul(E,I),I=r.sub(I,N),N=r.mul(E,k),V=r.mul(O,V),V=r.add(V,N),new h(I,B,V)}subtract(C){return this.add(C.negate())}is0(){return this.equals(h.ZERO)}wNAF(C){return m.wNAFCached(this,C,h.normalizeZ)}multiplyUnsafe(C){const{endo:v,n:b}=e;j0("scalar",C,_d,b);const A=h.ZERO;if(C===_d)return A;if(this.is0()||C===qi)return this;if(!v||m.hasPrecomputes(this))return m.wNAFCachedUnsafe(this,C,h.normalizeZ);let{k1neg:S,k1:j,k2neg:F,k2:I}=v.splitScalar(C),B=A,V=A,se=this;for(;j>_d||I>_d;)j&qi&&(B=B.add(se)),I&qi&&(V=V.add(se)),se=se.double(),j>>=qi,I>>=qi;return S&&(B=B.negate()),F&&(V=V.negate()),V=new h(r.mul(V.px,v.beta),V.py,V.pz),B.add(V)}multiply(C){const{endo:v,n:b}=e;j0("scalar",C,qi,b);let A,S;if(v){const{k1neg:j,k1:F,k2neg:I,k2:B}=v.splitScalar(C);let{p:V,f:se}=this.wNAF(F),{p:Y,f:N}=this.wNAF(B);V=m.constTimeNegate(j,V),Y=m.constTimeNegate(I,Y),Y=new h(r.mul(Y.px,v.beta),Y.py,Y.pz),A=V.add(Y),S=se.add(N)}else{const{p:j,f:F}=this.wNAF(C);A=j,S=F}return h.normalizeZ([A,S])[0]}multiplyAndAddUnsafe(C,v,b){const A=h.BASE,S=(F,I)=>I===_d||I===qi||!F.equals(A)?F.multiplyUnsafe(I):F.multiply(I),j=S(this,v).add(S(C,b));return j.is0()?void 0:j}toAffine(C){return u(this,C)}isTorsionFree(){const{h:C,isTorsionFree:v}=e;if(C===qi)return!0;if(v)return v(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:C,clearCofactor:v}=e;return C===qi?this:v?v(h,this):this.multiplyUnsafe(e.h)}toRawBytes(C=!0){return Fg("isCompressed",C),this.assertValidity(),i(h,this,C)}toHex(C=!0){return Fg("isCompressed",C),Ug(this.toRawBytes(C))}}h.BASE=new h(e.Gx,e.Gy,r.ONE),h.ZERO=new h(r.ZERO,r.ONE,r.ZERO);const g=e.nBitLength,m=dAe(h,e.endo?Math.ceil(g/2):g);return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:l,weierstrassEquation:s,isWithinCurveOrder:o}}function yAe(t){const e=nee(t);return qw(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function wAe(t){const e=yAe(t),{Fp:r,n}=e,i=r.BYTES+1,a=2*r.BYTES+1;function s(x){return $s(x,n)}function o(x){return EM(x,n)}const{ProjectivePoint:l,normPrivateKeyToScalar:c,weierstrassEquation:u,isWithinCurveOrder:f}=mAe({...e,toBytes(x,E,L){const O=E.toAffine(),P=r.toBytes(O.x),R=G3;return Fg("isCompressed",L),L?R(Uint8Array.from([E.hasEvenY()?2:3]),P):R(Uint8Array.from([4]),P,r.toBytes(O.y))},fromBytes(x){const E=x.length,L=x[0],O=x.subarray(1);if(E===i&&(L===2||L===3)){const P=L0(O);if(!K9(P,qi,r.ORDER))throw new Error("Point is not on curve");const R=u(P);let M;try{M=r.sqrt(R)}catch(X){const le=X instanceof Error?": "+X.message:"";throw new Error("Point is not on curve"+le)}const D=(M&qi)===qi;return(L&1)===1!==D&&(M=r.neg(M)),{x:P,y:M}}else if(E===a&&L===4){const P=r.fromBytes(O.subarray(0,r.BYTES)),R=r.fromBytes(O.subarray(r.BYTES,2*r.BYTES));return{x:P,y:R}}else{const P=i,R=a;throw new Error("invalid Point, expected length of "+P+", or uncompressed "+R+", got "+E)}}}),h=x=>Ug(zg(x,e.nByteLength));function g(x){const E=n>>qi;return x>E}function m(x){return g(x)?s(-x):x}const w=(x,E,L)=>L0(x.slice(E,L));class C{constructor(E,L,O){this.r=E,this.s=L,this.recovery=O,this.assertValidity()}static fromCompact(E){const L=e.nByteLength;return E=Jl("compactSignature",E,L*2),new C(w(E,0,L),w(E,L,2*L))}static fromDER(E){const{r:L,s:O}=wd.toSig(Jl("DER",E));return new C(L,O)}assertValidity(){j0("r",this.r,qi,n),j0("s",this.s,qi,n)}addRecoveryBit(E){return new C(this.r,this.s,E)}recoverPublicKey(E){const{r:L,s:O,recovery:P}=this,R=F(Jl("msgHash",E));if(P==null||![0,1,2,3].includes(P))throw new Error("recovery id invalid");const M=P===2||P===3?L+e.n:L;if(M>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const D=P&1?"03":"02",$=l.fromHex(D+h(M)),X=o(M),le=s(-R*X),H=s(O*X),ee=l.BASE.multiplyAndAddUnsafe($,le,H);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return g(this.s)}normalizeS(){return this.hasHighS()?new C(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return Bg(this.toDERHex())}toDERHex(){return wd.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Bg(this.toCompactHex())}toCompactHex(){return h(this.r)+h(this.s)}}const v={isValidPrivateKey(x){try{return c(x),!0}catch{return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{const x=eee(e.n);return lAe(e.randomBytes(x),e.n)},precompute(x=8,E=l.BASE){return E._setWindowSize(x),E.multiply(BigInt(3)),E}};function b(x,E=!0){return l.fromPrivateKey(x).toRawBytes(E)}function A(x){const E=n1(x),L=typeof x=="string",O=(E||L)&&x.length;return E?O===i||O===a:L?O===2*i||O===2*a:x instanceof l}function S(x,E,L=!0){if(A(x))throw new Error("first arg must be private key");if(!A(E))throw new Error("second arg must be public key");return l.fromHex(E).multiply(c(x)).toRawBytes(L)}const j=e.bits2int||function(x){if(x.length>8192)throw new Error("input is too large");const E=L0(x),L=x.length*8-e.nBitLength;return L>0?E>>BigInt(L):E},F=e.bits2int_modN||function(x){return s(j(x))},I=bL(e.nBitLength);function B(x){return j0("num < 2^"+e.nBitLength,x,_d,I),zg(x,e.nByteLength)}function V(x,E,L=se){if(["recovered","canonical"].some(te=>te in L))throw new Error("sign() legacy options not supported");const{hash:O,randomBytes:P}=e;let{lowS:R,prehash:M,extraEntropy:D}=L;R==null&&(R=!0),x=Jl("msgHash",x),$U(L),M&&(x=Jl("prehashed msgHash",O(x)));const $=F(x),X=c(E),le=[B(X),B($)];if(D!=null&&D!==!1){const te=D===!0?P(r.BYTES):D;le.push(Jl("extraEntropy",te))}const H=G3(...le),ee=$;function J(te){const re=j(te);if(!f(re))return;const z=o(re),G=l.BASE.multiply(re).toAffine(),Q=s(G.x);if(Q===_d)return;const me=s(z*s(ee+Q*X));if(me===_d)return;let be=(G.x===Q?0:2)|Number(G.y&qi),Ce=me;return R&&g(me)&&(Ce=m(me),be^=1),new C(Q,Ce,be)}return{seed:H,k2sig:J}}const se={lowS:e.lowS,prehash:!1},Y={lowS:e.lowS,prehash:!1};function N(x,E,L=se){const{seed:O,k2sig:P}=V(x,E,L),R=e;return qX(R.hash.outputLen,R.nByteLength,R.hmac)(O,P)}l.BASE._setWindowSize(8);function k(x,E,L,O=Y){var be;const P=x;E=Jl("msgHash",E),L=Jl("publicKey",L);const{lowS:R,prehash:M,format:D}=O;if($U(O),"strict"in O)throw new Error("options.strict was renamed to lowS");if(D!==void 0&&D!=="compact"&&D!=="der")throw new Error("format must be compact or der");const $=typeof P=="string"||n1(P),X=!$&&!D&&typeof P=="object"&&P!==null&&typeof P.r=="bigint"&&typeof P.s=="bigint";if(!$&&!X)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let le,H;try{if(X&&(le=new C(P.r,P.s)),$){try{D!=="compact"&&(le=C.fromDER(P))}catch(Ce){if(!(Ce instanceof wd.Err))throw Ce}!le&&D!=="der"&&(le=C.fromCompact(P))}H=l.fromHex(L)}catch{return!1}if(!le||R&&le.hasHighS())return!1;M&&(E=e.hash(E));const{r:ee,s:J}=le,te=F(E),re=o(J),z=s(te*re),G=s(ee*re),Q=(be=l.BASE.multiplyAndAddUnsafe(H,z,G))==null?void 0:be.toAffine();return Q?s(Q.x)===ee:!1}return{CURVE:e,getPublicKey:b,getSharedSecret:S,sign:N,verify:k,ProjectivePoint:l,Signature:C,utils:v}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function vAe(t){return{hash:t,hmac:(e,...r)=>JX(t,e,HSe(...r)),randomBytes:qSe}}function bAe(t,e){const r=n=>wAe({...t,...vAe(n)});return Object.freeze({...r(e),create:r})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const iee=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),RU=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),xAe=BigInt(1),_M=BigInt(2),DU=(t,e)=>(t+e/_M)/e;function EAe(t){const e=iee,r=BigInt(3),n=BigInt(6),i=BigInt(11),a=BigInt(22),s=BigInt(23),o=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,f=Qo(u,r,e)*u%e,h=Qo(f,r,e)*u%e,g=Qo(h,_M,e)*c%e,m=Qo(g,i,e)*g%e,w=Qo(m,a,e)*m%e,C=Qo(w,o,e)*w%e,v=Qo(C,l,e)*C%e,b=Qo(v,o,e)*w%e,A=Qo(b,r,e)*u%e,S=Qo(A,s,e)*m%e,j=Qo(S,n,e)*c%e,F=Qo(j,_M,e);if(!CM.eql(CM.sqr(F),t))throw new Error("Cannot find square root");return F}const CM=ZX(iee,void 0,void 0,{sqrt:EAe}),EL=bAe({a:BigInt(0),b:BigInt(7),Fp:CM,n:RU,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=RU,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-xAe*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),a=r,s=BigInt("0x100000000000000000000000000000000"),o=DU(a*t,e),l=DU(-n*t,e);let c=$s(t-o*r-l*i,e),u=$s(-o*n-l*a,e);const f=c>s,h=u>s;if(f&&(c=e-c),h&&(u=e-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:f,k1:c,k2neg:h,k2:u}}}},XSe);BigInt(0);EL.ProjectivePoint;const _Ae=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:EL},Symbol.toStringTag,{value:"Module"}));function CAe({r:t,s:e,to:r="hex",v:n,yParity:i}){const a=(()=>{if(i===0||i===1)return i;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),s=`0x${new EL.Signature(vo(t),vo(e)).toCompactHex()}${a===0?"1b":"1c"}`;return r==="hex"?s:vc(s)}async function _L(t,e){var f,h,g;const{address:r,factory:n,factoryData:i,hash:a,signature:s,universalSignatureVerifierAddress:o=(g=(h=(f=t.chain)==null?void 0:f.contracts)==null?void 0:h.universalSignatureVerifier)==null?void 0:g.address,...l}=e,c=wc(s)?s:typeof s=="object"&&"r"in s&&"s"in s?CAe(s):Si(s),u=await(async()=>!n&&!i||eSe(c)?c:tSe({address:n,data:i,signature:c}))();try{const m=o?{to:o,data:Mc({abi:_U,functionName:"isValidSig",args:[r,a,u]}),...l}:{data:B9({abi:_U,args:[r,a,u],bytecode:F_e}),...l},{data:w}=await nr(t,z9,"call")(m);return P7e(w??"0x0")}catch(m){try{if(sL(HN(r),await eX({hash:a,signature:s})))return!0}catch{}if(m instanceof XZ)return!1;throw m}}async function SAe(t,{address:e,message:r,factory:n,factoryData:i,signature:a,...s}){const o=zX(r);return _L(t,{address:e,factory:n,factoryData:i,hash:o,signature:a,...s})}async function AAe(t,e){const{address:r,factory:n,factoryData:i,signature:a,message:s,primaryType:o,types:l,domain:c,...u}=e,f=WCe({message:s,primaryType:o,types:l,domain:c});return _L(t,{address:r,factory:n,factoryData:i,hash:f,signature:a,...u})}function aee(t,{emitOnBegin:e=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:a,pollingInterval:s=t.pollingInterval}){const o=typeof a<"u"?a:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket");let l;return o?(()=>{const f=ia(["watchBlockNumber",t.uid,e,r,s]);return ch(f,{onBlockNumber:n,onError:i},h=>Bw(async()=>{var g;try{const m=await nr(t,zw,"getBlockNumber")({cacheTime:0});if(l){if(m===l)return;if(m-l>1&&r)for(let w=l+1n;wl)&&(h.onBlockNumber(m,l),l=m)}catch(m){(g=h.onError)==null||g.call(h,m)}},{emitOnBegin:e,interval:s}))})():(()=>{const f=ia(["watchBlockNumber",t.uid,e,r]);return ch(f,{onBlockNumber:n,onError:i},h=>{let g=!0,m=()=>g=!1;return(async()=>{try{const w=(()=>{if(t.transport.type==="fallback"){const v=t.transport.transports.find(b=>b.config.type==="webSocket");return v?v.value:t.transport}return t.transport})(),{unsubscribe:C}=await w.subscribe({params:["newHeads"],onData(v){var A;if(!g)return;const b=vo((A=v.result)==null?void 0:A.number);h.onBlockNumber(b,l),l=b},onError(v){var b;(b=h.onError)==null||b.call(h,v)}});m=C,g||m()}catch(w){i==null||i(w)}})(),()=>m()})})()}async function IAe(t,{confirmations:e=1,hash:r,onReplaced:n,pollingInterval:i=t.pollingInterval,retryCount:a=6,retryDelay:s=({count:l})=>~~(1<w(new YEe({hash:r})),o):void 0,v=ch(l,{onReplaced:n,resolve:m,reject:w},b=>{const A=nr(t,aee,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(S){const j=I=>{clearTimeout(C),A(),I(),v()};let F=S;if(!h)try{if(f){if(e>1&&(!f.blockNumber||F-f.blockNumber+1nb.resolve(f));return}if(c||(h=!0,await wM(async()=>{c=await nr(t,mL,"getTransaction")({hash:r}),c.blockNumber&&(F=c.blockNumber)},{delay:s,retryCount:a}),h=!1),f=await nr(t,vM,"getTransactionReceipt")({hash:r}),e>1&&(!f.blockNumber||F-f.blockNumber+1nb.resolve(f))}catch(I){if(I instanceof QZ||I instanceof ZZ){if(!c){h=!1;return}try{u=c,h=!0;const B=await wM(()=>nr(t,ou,"getBlock")({blockNumber:F,includeTransactions:!0}),{delay:s,retryCount:a,shouldRetry:({error:Y})=>Y instanceof iX});h=!1;const V=B.transactions.find(({from:Y,nonce:N})=>Y===u.from&&N===u.nonce);if(!V||(f=await nr(t,vM,"getTransactionReceipt")({hash:V.hash}),e>1&&(!f.blockNumber||F-f.blockNumber+1n{var Y;(Y=b.onReplaced)==null||Y.call(b,{reason:se,replacedTransaction:u,transaction:V,transactionReceipt:f}),b.resolve(f)})}catch(B){j(()=>b.reject(B))}}else j(()=>b.reject(I))}}})});return g}function MAe(t,{blockTag:e="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:a,includeTransactions:s,poll:o,pollingInterval:l=t.pollingInterval}){const c=typeof o<"u"?o:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),u=s??!1;let f;return c?(()=>{const m=ia(["watchBlocks",t.uid,e,r,n,u,l]);return ch(m,{onBlock:i,onError:a},w=>Bw(async()=>{var C;try{const v=await nr(t,ou,"getBlock")({blockTag:e,includeTransactions:u});if(v.number&&(f!=null&&f.number)){if(v.number===f.number)return;if(v.number-f.number>1&&r)for(let b=(f==null?void 0:f.number)+1n;bf.number)&&(w.onBlock(v,f),f=v)}catch(v){(C=w.onError)==null||C.call(w,v)}},{emitOnBegin:n,interval:l}))})():(()=>{let m=!0,w=!0,C=()=>m=!1;return(async()=>{try{n&&nr(t,ou,"getBlock")({blockTag:e,includeTransactions:u}).then(A=>{m&&w&&(i(A,void 0),w=!1)});const v=(()=>{if(t.transport.type==="fallback"){const A=t.transport.transports.find(S=>S.config.type==="webSocket");return A?A.value:t.transport}return t.transport})(),{unsubscribe:b}=await v.subscribe({params:["newHeads"],async onData(A){if(!m)return;const S=await nr(t,ou,"getBlock")({blockNumber:A.blockNumber,includeTransactions:u}).catch(()=>{});m&&(i(S,f),w=!1,f=S)},onError(A){a==null||a(A)}});C=b,m||C()}catch(v){a==null||a(v)}})(),()=>C()})()}function TAe(t,{address:e,args:r,batch:n=!0,event:i,events:a,fromBlock:s,onError:o,onLogs:l,poll:c,pollingInterval:u=t.pollingInterval,strict:f}){const h=typeof c<"u"?c:typeof s=="bigint"?!0:!(t.transport.type==="webSocket"||t.transport.type==="fallback"&&t.transport.transports[0].config.type==="webSocket"),g=f??!1;return h?(()=>{const C=ia(["watchEvent",e,r,n,t.uid,i,u,s]);return ch(C,{onLogs:l,onError:o},v=>{let b;s!==void 0&&(b=s-1n);let A,S=!1;const j=Bw(async()=>{var F;if(!S){try{A=await nr(t,jX,"createEventFilter")({address:e,args:r,event:i,events:a,strict:g,fromBlock:s})}catch{}S=!0;return}try{let I;if(A)I=await nr(t,W9,"getFilterChanges")({filter:A});else{const B=await nr(t,zw,"getBlockNumber")({});b&&b!==B?I=await nr(t,cL,"getLogs")({address:e,args:r,event:i,events:a,fromBlock:b+1n,toBlock:B}):I=[],b=B}if(I.length===0)return;if(n)v.onLogs(I);else for(const B of I)v.onLogs([B])}catch(I){A&&I instanceof e1&&(S=!1),(F=v.onError)==null||F.call(v,I)}},{emitOnBegin:!0,interval:u});return async()=>{A&&await nr(t,H9,"uninstallFilter")({filter:A}),j()}})})():(()=>{let C=!0,v=()=>C=!1;return(async()=>{try{const b=(()=>{if(t.transport.type==="fallback"){const F=t.transport.transports.find(I=>I.config.type==="webSocket");return F?F.value:t.transport}return t.transport})(),A=a??(i?[i]:void 0);let S=[];A&&(S=[A.flatMap(I=>Rw({abi:[I],eventName:I.name,args:r}))],i&&(S=S[0]));const{unsubscribe:j}=await b.subscribe({params:["logs",{address:e,topics:S}],onData(F){var B;if(!C)return;const I=F.result;try{const{eventName:V,args:se}=oL({abi:A??[],data:I.data,topics:I.topics,strict:g}),Y=zd(I,{args:se,eventName:V});l([Y])}catch(V){let se,Y;if(V instanceof M3||V instanceof M9){if(f)return;se=V.abiItem.name,Y=(B=V.abiItem.inputs)==null?void 0:B.some(k=>!("name"in k&&k.name))}const N=zd(I,{args:Y?[]:{},eventName:se});l([N])}},onError(F){o==null||o(F)}});v=j,C||v()}catch(b){o==null||o(b)}})(),()=>v()})()}function kAe(t,{batch:e=!0,onError:r,onTransactions:n,poll:i,pollingInterval:a=t.pollingInterval}){return(typeof i<"u"?i:t.transport.type!=="webSocket")?(()=>{const c=ia(["watchPendingTransactions",t.uid,e,a]);return ch(c,{onTransactions:n,onError:r},u=>{let f;const h=Bw(async()=>{var g;try{if(!f)try{f=await nr(t,$X,"createPendingTransactionFilter")({});return}catch(w){throw h(),w}const m=await nr(t,W9,"getFilterChanges")({filter:f});if(m.length===0)return;if(e)u.onTransactions(m);else for(const w of m)u.onTransactions([w])}catch(m){(g=u.onError)==null||g.call(u,m)}},{emitOnBegin:!0,interval:a});return async()=>{f&&await nr(t,H9,"uninstallFilter")({filter:f}),h()}})})():(()=>{let c=!0,u=()=>c=!1;return(async()=>{try{const{unsubscribe:f}=await t.transport.subscribe({params:["newPendingTransactions"],onData(h){if(!c)return;const g=h.result;n([g])},onError(h){r==null||r(h)}});u=f,c||u()}catch(f){r==null||r(f)}})(),()=>u()})()}function NAe(t){var f,h,g;const{scheme:e,statement:r,...n}=((f=t.match(LAe))==null?void 0:f.groups)??{},{chainId:i,expirationTime:a,issuedAt:s,notBefore:o,requestId:l,...c}=((h=t.match(jAe))==null?void 0:h.groups)??{},u=(g=t.split("Resources:")[1])==null?void 0:g.split(` +- `).slice(1);return{...n,...c,...i?{chainId:Number(i)}:{},...a?{expirationTime:new Date(a)}:{},...s?{issuedAt:new Date(s)}:{},...o?{notBefore:new Date(o)}:{},...l?{requestId:l}:{},...u?{resources:u}:{},...e?{scheme:e}:{},...r?{statement:r}:{}}}const LAe=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,jAe=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function $Ae(t){const{address:e,domain:r,message:n,nonce:i,scheme:a,time:s=new Date}=t;if(r&&n.domain!==r||i&&n.nonce!==i||a&&n.scheme!==a||n.expirationTime&&s>=n.expirationTime||n.notBefore&&sz9(t,e),createAccessList:e=>LCe(t,e),createBlockFilter:()=>jCe(t),createContractEventFilter:e=>qZ(t,e),createEventFilter:e=>jX(t,e),createPendingTransactionFilter:()=>$X(t),estimateContractGas:e=>L_e(t,e),estimateGas:e=>aL(t,e),getBalance:e=>mX(t,e),getBlobBaseFee:()=>$Ce(t),getBlock:e=>ou(t,e),getBlockNumber:e=>zw(t,e),getBlockTransactionCount:e=>PCe(t,e),getBytecode:e=>IU(t,e),getChainId:()=>Uw(t),getCode:e=>IU(t,e),getContractEvents:e=>yX(t,e),getEip712Domain:e=>iCe(t,e),getEnsAddress:e=>mCe(t,e),getEnsAvatar:e=>TCe(t,e),getEnsName:e=>kCe(t,e),getEnsResolver:e=>NCe(t,e),getEnsText:e=>LX(t,e),getFeeHistory:e=>DCe(t,e),estimateFeesPerGas:e=>w_e(t,e),getFilterChanges:e=>W9(t,e),getFilterLogs:e=>OCe(t,e),getGasPrice:()=>tL(t),getLogs:e=>cL(t,e),getProof:e=>ySe(t,e),estimateMaxPriorityFeePerGas:e=>y_e(t,e),getStorageAt:e=>wSe(t,e),getTransaction:e=>mL(t,e),getTransactionConfirmations:e=>vSe(t,e),getTransactionCount:e=>oX(t,e),getTransactionReceipt:e=>vM(t,e),multicall:e=>bSe(t,e),prepareTransactionRequest:e=>F9(t,e),readContract:e=>Wd(t,e),sendRawTransaction:e=>uL(t,e),simulate:e=>FSe(t,e),simulateContract:e=>V_e(t,e),verifyMessage:e=>SAe(t,e),verifySiweMessage:e=>PAe(t,e),verifyTypedData:e=>AAe(t,e),uninstallFilter:e=>H9(t,e),waitForTransactionReceipt:e=>IAe(t,e),watchBlocks:e=>MAe(t,e),watchBlockNumber:e=>aee(t,e),watchContractEvent:e=>eCe(t,e),watchEvent:e=>TAe(t,e),watchPendingTransactions:e=>kAe(t,e)}}function xc(t){const{key:e="public",name:r="Public Client"}=t;return AX({...t,key:e,name:r,type:"publicClient"}).extend(CL)}function RAe(t,e){const{abi:r,args:n,bytecode:i,...a}=e,s=B9({abi:r,args:n,bytecode:i});return dL(t,{...a,data:s})}async function DAe(t){var r;return((r=t.account)==null?void 0:r.type)==="local"?[t.account.address]:(await t.request({method:"eth_accounts"},{dedupe:!0})).map(n=>$w(n))}async function OAe(t){return await t.request({method:"wallet_getPermissions"},{dedupe:!0})}async function FAe(t){return(await t.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>HN(r))}async function UAe(t,e){return t.request({method:"wallet_requestPermissions",params:[e]},{retryCount:0})}async function BAe(t,{account:e=t.account,message:r}){if(!e)throw new Ww({docsPath:"/docs/actions/wallet/signMessage"});const n=ms(e);if(n.signMessage)return n.signMessage({message:r});const i=typeof r=="string"?Dg(r):r.raw instanceof Uint8Array?ur(r.raw):r.raw;return t.request({method:"personal_sign",params:[i,n.address]},{retryCount:0})}async function zAe(t,e){var c,u,f,h;const{account:r=t.account,chain:n=t.chain,...i}=e;if(!r)throw new Ww({docsPath:"/docs/actions/wallet/signTransaction"});const a=ms(r);x1({account:a,...e});const s=await nr(t,Uw,"getChainId")({});n!==null&&CX({currentChainId:s,chain:n});const o=(n==null?void 0:n.formatters)||((c=t.chain)==null?void 0:c.formatters),l=((u=o==null?void 0:o.transactionRequest)==null?void 0:u.format)||Nm;return a.signTransaction?a.signTransaction({...i,chainId:s},{serializer:(h=(f=t.chain)==null?void 0:f.serializers)==null?void 0:h.transaction}):await t.request({method:"eth_signTransaction",params:[{...l(i),chainId:lr(s),from:a.address}]},{retryCount:0})}async function WAe(t,e){const{account:r=t.account,domain:n,message:i,primaryType:a}=e;if(!r)throw new Ww({docsPath:"/docs/actions/wallet/signTypedData"});const s=ms(r),o={EIP712Domain:UX({domain:n}),...e.types};if(FX({domain:n,message:i,primaryType:a,types:o}),s.signTypedData)return s.signTypedData({domain:n,message:i,primaryType:a,types:o});const l=VCe({domain:n,message:i,primaryType:a,types:o});return t.request({method:"eth_signTypedData_v4",params:[s.address,l]},{retryCount:0})}async function HAe(t,{id:e}){await t.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(e)}]},{retryCount:0})}async function GAe(t,e){return await t.request({method:"wallet_watchAsset",params:e},{retryCount:0})}function qAe(t){return{addChain:e=>sCe(t,e),deployContract:e=>RAe(t,e),getAddresses:()=>DAe(t),getChainId:()=>Uw(t),getPermissions:()=>OAe(t),prepareTransactionRequest:e=>F9(t,e),requestAddresses:()=>FAe(t),requestPermissions:e=>UAe(t,e),sendRawTransaction:e=>uL(t,e),sendTransaction:e=>dL(t,e),signMessage:e=>BAe(t,e),signTransaction:e=>zAe(t,e),signTypedData:e=>WAe(t,e),switchChain:e=>HAe(t,e),watchAsset:e=>GAe(t,e),writeContract:e=>rCe(t,e)}}function see(t){const{key:e="wallet",name:r="Wallet Client",transport:n}=t;return AX({...t,key:e,name:r,transport:n,type:"walletClient"}).extend(qAe)}function OU(t){return t?`${t.slice(0,5)}…${t.slice(-4)}`:""}function VAe({wei:t,precision:e=3}){return parseFloat(Dw(t)).toFixed(e).replace(/0+$/,"").replace(/\.$/,"")}function FU({amount:t,decimals:e}){return j9(BigInt(t),e)}const YAe=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,KAe=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,JAe=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function QAe(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){ZAe(t);return}return e}function ZAe(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function dy(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.endsWith('"')&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const n=r.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;if(n==="undefined")return;if(n==="null")return null;if(n==="nan")return Number.NaN;if(n==="infinity")return Number.POSITIVE_INFINITY;if(n==="-infinity")return Number.NEGATIVE_INFINITY}if(!JAe.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(YAe.test(t)||KAe.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,QAe)}return JSON.parse(t)}catch(n){if(e.strict)throw n;return t}}const XAe=/#/g,eIe=/&/g,tIe=/\//g,rIe=/=/g,SL=/\+/g,nIe=/%5e/gi,iIe=/%60/gi,aIe=/%7c/gi,sIe=/%20/gi;function oIe(t){return encodeURI(""+t).replace(aIe,"|")}function SM(t){return oIe(typeof t=="string"?t:JSON.stringify(t)).replace(SL,"%2B").replace(sIe,"+").replace(XAe,"%23").replace(eIe,"%26").replace(iIe,"`").replace(nIe,"^").replace(tIe,"%2F")}function OC(t){return SM(t).replace(rIe,"%3D")}function oee(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function lIe(t){return oee(t.replace(SL," "))}function cIe(t){return oee(t.replace(SL," "))}function uIe(t=""){const e={};t[0]==="?"&&(t=t.slice(1));for(const r of t.split("&")){const n=r.match(/([^=]+)=?(.*)/)||[];if(n.length<2)continue;const i=lIe(n[1]);if(i==="__proto__"||i==="constructor")continue;const a=cIe(n[2]||"");e[i]===void 0?e[i]=a:Array.isArray(e[i])?e[i].push(a):e[i]=[e[i],a]}return e}function dIe(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(r=>`${OC(t)}=${SM(r)}`).join("&"):`${OC(t)}=${SM(e)}`:OC(t)}function fIe(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>dIe(e,t[e])).filter(Boolean).join("&")}const hIe=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,pIe=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,gIe=/^([/\\]\s*){2,}[^/\\]/,mIe=/^\.?\//;function lee(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?hIe.test(t):pIe.test(t)||(e.acceptRelative?gIe.test(t):!1)}function yIe(t="",e){return t.endsWith("/")}function wIe(t="",e){return(yIe(t)?t.slice(0,-1):t)||"/"}function vIe(t="",e){return t.endsWith("/")?t:t+"/"}function bIe(t,e){if(EIe(e)||lee(t))return t;const r=wIe(e);return t.startsWith(r)?t:CIe(r,t)}function xIe(t,e){const r=SIe(t),n={...uIe(r.search),...e};return r.search=fIe(n),AIe(r)}function EIe(t){return!t||t==="/"}function _Ie(t){return t&&t!=="/"}function CIe(t,...e){let r=t||"";for(const n of e.filter(i=>_Ie(i)))if(r){const i=n.replace(mIe,"");r=vIe(r)+i}else r=n;return r}const cee=Symbol.for("ufo:protocolRelative");function SIe(t="",e){const r=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(r){const[,f,h=""]=r;return{protocol:f.toLowerCase(),pathname:h,href:f+h,auth:"",host:"",search:"",hash:""}}if(!lee(t,{acceptRelative:!0}))return UU(t);const[,n="",i,a=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,s="",o=""]=a.match(/([^#/?]*)(.*)?/)||[];n==="file:"&&(o=o.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:l,search:c,hash:u}=UU(o);return{protocol:n.toLowerCase(),auth:i?i.slice(0,Math.max(0,i.length-1)):"",host:s,pathname:l,search:c,hash:u,[cee]:!n}}function UU(t=""){const[e="",r="",n=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:r,hash:n}}function AIe(t){const e=t.pathname||"",r=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",n=t.hash||"",i=t.auth?t.auth+"@":"",a=t.host||"";return(t.protocol||t[cee]?(t.protocol||"")+"//":"")+i+a+e+r+n}let uee=class extends Error{constructor(e,r){super(e,r),this.name="FetchError",r!=null&&r.cause&&!this.cause&&(this.cause=r.cause)}};function IIe(t){var l,c,u,f,h;const e=((l=t.error)==null?void 0:l.message)||((c=t.error)==null?void 0:c.toString())||"",r=((u=t.request)==null?void 0:u.method)||((f=t.options)==null?void 0:f.method)||"GET",n=((h=t.request)==null?void 0:h.url)||String(t.request)||"/",i=`[${r}] ${JSON.stringify(n)}`,a=t.response?`${t.response.status} ${t.response.statusText}`:"",s=`${i}: ${a}${e?` ${e}`:""}`,o=new uee(s,t.error?{cause:t.error}:void 0);for(const g of["request","options","response"])Object.defineProperty(o,g,{get(){return t[g]}});for(const[g,m]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(o,g,{get(){return t.response&&t.response[m]}});return o}const MIe=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function BU(t="GET"){return MIe.has(t.toUpperCase())}function TIe(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const kIe=new Set(["image/svg","application/xml","application/xhtml","application/html"]),NIe=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function LIe(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return NIe.test(e)?"json":kIe.has(e)||e.startsWith("text/")?"text":"blob"}function jIe(t,e,r,n){const i=$Ie((e==null?void 0:e.headers)??(t==null?void 0:t.headers),r==null?void 0:r.headers,n);let a;return(r!=null&&r.query||r!=null&&r.params||e!=null&&e.params||e!=null&&e.query)&&(a={...r==null?void 0:r.params,...r==null?void 0:r.query,...e==null?void 0:e.params,...e==null?void 0:e.query}),{...r,...e,query:a,params:a,headers:i}}function $Ie(t,e,r){if(!e)return new r(t);const n=new r(e);if(t)for(const[i,a]of Symbol.iterator in t||Array.isArray(t)?t:new r(t))n.set(i,a);return n}async function x4(t,e){if(e)if(Array.isArray(e))for(const r of e)await r(t);else await e(t)}const PIe=new Set([408,409,425,429,500,502,503,504]),RIe=new Set([101,204,205,304]);function dee(t={}){const{fetch:e=globalThis.fetch,Headers:r=globalThis.Headers,AbortController:n=globalThis.AbortController}=t;async function i(o){const l=o.error&&o.error.name==="AbortError"&&!o.options.timeout||!1;if(o.options.retry!==!1&&!l){let u;typeof o.options.retry=="number"?u=o.options.retry:u=BU(o.options.method)?0:1;const f=o.response&&o.response.status||500;if(u>0&&(Array.isArray(o.options.retryStatusCodes)?o.options.retryStatusCodes.includes(f):PIe.has(f))){const h=typeof o.options.retryDelay=="function"?o.options.retryDelay(o):o.options.retryDelay||0;return h>0&&await new Promise(g=>setTimeout(g,h)),a(o.request,{...o.options,retry:u-1})}}const c=IIe(o);throw Error.captureStackTrace&&Error.captureStackTrace(c,a),c}const a=async function(l,c={}){const u={request:l,options:jIe(l,c,t.defaults,r),response:void 0,error:void 0};u.options.method&&(u.options.method=u.options.method.toUpperCase()),u.options.onRequest&&await x4(u,u.options.onRequest),typeof u.request=="string"&&(u.options.baseURL&&(u.request=bIe(u.request,u.options.baseURL)),u.options.query&&(u.request=xIe(u.request,u.options.query),delete u.options.query),"query"in u.options&&delete u.options.query,"params"in u.options&&delete u.options.params),u.options.body&&BU(u.options.method)&&(TIe(u.options.body)?(u.options.body=typeof u.options.body=="string"?u.options.body:JSON.stringify(u.options.body),u.options.headers=new r(u.options.headers||{}),u.options.headers.has("content-type")||u.options.headers.set("content-type","application/json"),u.options.headers.has("accept")||u.options.headers.set("accept","application/json")):("pipeTo"in u.options.body&&typeof u.options.body.pipeTo=="function"||typeof u.options.body.pipe=="function")&&("duplex"in u.options||(u.options.duplex="half")));let f;if(!u.options.signal&&u.options.timeout){const g=new n;f=setTimeout(()=>{const m=new Error("[TimeoutError]: The operation was aborted due to timeout");m.name="TimeoutError",m.code=23,g.abort(m)},u.options.timeout),u.options.signal=g.signal}try{u.response=await e(u.request,u.options)}catch(g){return u.error=g,u.options.onRequestError&&await x4(u,u.options.onRequestError),await i(u)}finally{f&&clearTimeout(f)}if((u.response.body||u.response._bodyInit)&&!RIe.has(u.response.status)&&u.options.method!=="HEAD"){const g=(u.options.parseResponse?"json":u.options.responseType)||LIe(u.response.headers.get("content-type")||"");switch(g){case"json":{const m=await u.response.text(),w=u.options.parseResponse||dy;u.response._data=w(m);break}case"stream":{u.response._data=u.response.body||u.response._bodyInit;break}default:u.response._data=await u.response[g]()}}return u.options.onResponse&&await x4(u,u.options.onResponse),!u.options.ignoreResponseError&&u.response.status>=400&&u.response.status<600?(u.options.onResponseError&&await x4(u,u.options.onResponseError),await i(u)):u.response},s=async function(l,c){return(await a(l,c))._data};return s.raw=a,s.native=(...o)=>e(...o),s.create=(o={},l={})=>dee({...t,...l,defaults:{...t.defaults,...l.defaults,...o}}),s}const W5=function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}(),DIe=W5.fetch?(...t)=>W5.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),OIe=W5.Headers,FIe=W5.AbortController,fee=dee({fetch:DIe,Headers:OIe,AbortController:FIe});var or;let Ks=class extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,r,n){super(e),r instanceof Error&&(this.cause=r),this.privyErrorCode=n}},sl=class extends Ks{constructor(e,r,n,i,a,s){super(n,i,a),this.type=e,this.status=r,this.data=s}},_e=class extends Ks{constructor(e,r,n){super(e,r,n),this.type="client_error"}},UIe=class extends _e{constructor(){super("Request timed out",void 0,"client_request_timeout")}},Pn=class extends Ks{constructor(e,r,n){super(e,r,n),this.type="connector_error"}};const Vr=t=>{if(t instanceof Ks)return t;if(!(t instanceof uee))return _n(t);if(!t.response)return new sl("api_error",null,t.message,t);let{type:e,message:r,error:n,code:i}=t.data;return new sl(e||"ApiError",t.response.status,r||n,t,i,t.data)},_n=t=>t instanceof Ks?t:t instanceof Error?new _e(t.message,t):new _e(`Internal error: ${t}`);var Ae=((or={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",or.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",or.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",or.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",or.INVALID_DATA="invalid_data",or.INVALID_CAPTCHA="invalid_captcha",or.LINKED_TO_ANOTHER_USER="linked_to_another_user",or.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",or.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",or.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",or.USER_EXITED_UPDATE_FLOW="exited_update_flow",or.ALLOWLIST_REJECTED="allowlist_rejected",or.OAUTH_USER_DENIED="oauth_user_denied",or.OAUTH_UNEXPECTED="oauth_unexpected",or.UNKNOWN_AUTH_ERROR="unknown_auth_error",or.USER_EXITED_AUTH_FLOW="exited_auth_flow",or.USER_EXITED_LINK_FLOW="exited_link_flow",or.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",or.MUST_BE_AUTHENTICATED="must_be_authenticated",or.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",or.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",or.CLIENT_REQUEST_TIMEOUT="client_request_timeout",or.INVALID_CREDENTIALS="invalid_credentials",or.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",or.UNKNOWN_MFA_ERROR="unknown_mfa_error",or.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",or.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",or.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",or.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",or.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",or.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",or.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",or.TRANSACTION_FAILURE="transaction_failure",or.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",or.NOT_SUPPORTED="not_supported",or.CAPTCHA_TIMEOUT="captcha_timeout",or.INVALID_MESSAGE="invalid_message",or.UNABLE_TO_SIGN="unable_to_sign",or.CAPTCHA_FAILURE="captcha_failure",or.CAPTCHA_DISABLED="captcha_disabled",or.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",or.TOO_MANY_REQUESTS="too_many_requests",or.USER_LIMIT_REACHED="max_accounts_reached",or.DISALLOWED_LOGIN_METHOD="disallowed_login_method",or.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",or.PASSKEY_NOT_ALLOWED="passkey_not_allowed",or.USER_DOES_NOT_EXIST="user_does_not_exist",or.INSUFFICIENT_BALANCE="insufficient_balance",or.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",or);let mp=class extends _e{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},th=class extends _e{constructor(e="Embedded wallet error",r){super(e,r,"unknown_embedded_wallet_error")}},BIe=class extends _e{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},Vw=class extends _e{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}};const hee="/api/v1/sessions",pee="/api/v1/sessions/logout",zIe="/api/v1/sessions/fork",gee="/api/v1/sessions/fork/recover",WIe="/api/v1/siwe/init",HIe="/api/v1/siwe/authenticate",GIe="/api/v1/siwe/link",qIe="/api/v1/siwe/link_smart_wallet",VIe="/api/v1/siwe/unlink",YIe="/api/v1/siwe/transfer",KIe="/api/v1/siws/init",JIe="/api/v1/siws/authenticate",QIe="/api/v1/siws/link",ZIe="/api/v1/siws/unlink",XIe="/api/v1/farcaster/init",eMe="/api/v1/farcaster/authenticate",tMe="/api/v1/farcaster/link",rMe="/api/v1/farcaster/status",nMe="/api/v1/farcaster/unlink",iMe="/api/v1/farcaster/transfer",aMe="/api/v1/passwordless/init",sMe="/api/v1/passwordless/authenticate",oMe="/api/v1/passwordless/link",lMe="/api/v1/passwordless/unlink",cMe="/api/v1/passwordless/update",uMe="/api/v1/passwordless/transfer",dMe="/api/v1/passwordless_sms/init",fMe="/api/v1/passwordless_sms/link",hMe="/api/v1/passwordless_sms/unlink",pMe="/api/v1/passwordless_sms/authenticate",gMe="/api/v1/passwordless_sms/update",mMe="/api/v1/passwordless_sms/transfer",mee="/api/v1/oauth/init",yee="/api/v1/oauth/authenticate",wee="/api/v1/oauth/link",yMe="/api/v1/oauth/unlink",wMe="/api/v1/oauth/transfer",vMe="/api/v1/recovery/oauth/init",bMe="/api/v1/recovery/oauth/init_icloud",xMe="/api/v1/recovery/oauth/authenticate",EMe="/api/v1/passkeys/link/init",_Me="/api/v1/passkeys/authenticate/init",CMe="/api/v1/passkeys/link",SMe="/api/v1/passkeys/authenticate",AMe="/api/v1/passkeys/unlink",IMe="/api/v1/telegram/authenticate",MMe="/api/v1/telegram/link",TMe="/api/v1/telegram/unlink",kMe="/api/v1/telegram/transfer",NMe="/api/v1/mfa/passwordless_sms/init",LMe="/api/v1/mfa/passkeys/init",jMe="/api/v1/users/me/accept_terms",vee="/api/v1/analytics_events",$Me="/api/v1/custom_jwt_account/authenticate",PMe="/api/v1/guest/authenticate",RMe="/api/v1/plugins/moonpay_on_ramp/sign",DMe="/api/v1/funding/coinbase_on_ramp/init",OMe="/api/v1/funding/coinbase_on_ramp/status",FMe="/api/v1/wallets/revoke";let bee=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post($Me,{token:this.meta.token})}catch(e){throw Vr(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}};function Q9(t){return t?{"privy-ui":"t"}:void 0}let eg=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _e("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(sMe,{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new _e("Email and email code must be set prior to calling authenticate.");try{return await this.api.post(oMe,{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw Vr(e)}}async sendCodeEmail({email:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new _e("Auth flow has no API instance");if(e&&(this.meta.email=e),r&&(this.meta.captchaToken=r),!this.meta.email)throw new _e("Email must be set when initialzing authentication.");let i=Q9(n);try{return await this.api.post(aMe,{email:this.meta.email,token:this.meta.captchaToken},{headers:{...i}})}catch(a){throw Vr(a)}}constructor({email:e,captchaToken:r,disableSignup:n}){this.meta={email:e,captchaToken:r,disableSignup:n??!1}}},UMe=class extends eg{async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new _e("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post(cMe,{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw Vr(e)}}constructor(e,r,n){super({email:r,captchaToken:n}),this.meta={email:r,captchaToken:n,oldAddress:e,disableSignup:!1}}},BMe=class{get(e){return this._cache[e]}put(e,r){r!==void 0?this._cache[e]=r:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}},xee=class{get(e){let r=localStorage.getItem(e);return r===null?void 0:JSON.parse(r)}put(e,r){r!==void 0?localStorage.setItem(e,JSON.stringify(r)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}};function AM(){try{let t="privy:__session_storage__test",e=new xee;return e.put(t,"blobby"),e.del(t),!0}catch{return!1}}var Dt=typeof window<"u"&&window.localStorage?new xee:new BMe;function zMe(){var n;let t=window,e=t.ethereum;if(!e)return[];let r=[];if((n=e.providers)!=null&&n.length)for(let i of e.providers)i&&r.push(i);return r.push(t.ethereum),r}const Eee=t=>t.isApexWallet?"Apex Wallet":t.isAvalanche?"Core Wallet":t.isBackpack?"Backpack":t.isBifrost?"Bifrost Wallet":t.isBitKeep?"BitKeep":t.isBitski?"Bitski":t.isBlockWallet?"BlockWallet":t.isBraveWallet?"Brave Wallet":t.isClover?"Clover":t.isCoin98?"Coin98 Wallet":t.isCoinbaseWallet?"Coinbase Wallet":t.isDawn?"Dawn Wallet":t.isDefiant?"Defiant":t.isDesig?"Desig Wallet":t.isEnkrypt?"Enkrypt":t.isExodus?"Exodus":t.isFordefi?"Fordefi":t.isFrame?"Frame":t.isFrontier?"Frontier Wallet":t.isGamestop?"GameStop Wallet":t.isHaqqWallet?"HAQQ Wallet":t.isHyperPay?"HyperPay Wallet":t.isImToken?"ImToken":t.isHaloWallet?"Halo Wallet":t.isKuCoinWallet?"KuCoin Wallet":t.isMathWallet?"MathWallet":t.isNovaWallet?"Nova Wallet":t.isOkxWallet||t.isOKExWallet?"OKX Wallet":t.isOneInchIOSWallet||t.isOneInchAndroidWallet?"1inch Wallet":t.isOneKey?"OneKey Wallet":t.isOpera?"Opera":t.isPhantom?"Phantom":t.isPortal?"Ripio Portal":t.isRabby?"Rabby Wallet":t.isRainbow?"Rainbow":t.isSafePal?"SafePal Wallet":t.isStatus?"Status":t.isSubWallet?"SubWallet":t.isTalisman?"Talisman":t.isTally||t.isTaho?"Taho":t.isTokenPocket?"TokenPocket":t.isTokenary?"Tokenary":t.isTrust||t.isTrustWallet?"Trust Wallet":t.isTTWallet?"TTWallet":t.isXDEFI?"XDEFI Wallet":t.isZeal?"Zeal":t.isZerion?"Zerion":t.isMetaMask?"MetaMask":void 0,_ee=(t,e)=>{if(!t.isMetaMask)return!1;if(t.isMetaMask&&!e)return!0;if(t.isBraveWallet&&!t._events&&!t._state||Eee(t)!=="MetaMask")return!1;if(t.providers){for(let r of t.providers)if(!_ee(r))return!1}return!0},Z9=()=>{var t,e,r,n,i,a;if("phantom"in window){let s=window;if((e=(t=s==null?void 0:s.phantom)==null?void 0:t.ethereum)!=null&&e.isPhantom&&((n=(r=s==null?void 0:s.phantom)==null?void 0:r.ethereum)!=null&&n.chainId)||(a=(i=s==null?void 0:s.phantom)==null?void 0:i.solana)!=null&&a.isPhantom)return!0}return!1},Cee=()=>{let t=window;if(!t.ethereum)return!1;if(t.ethereum.isCoinbaseWallet)return!0;if(t.ethereum.providers){for(let e of t.ethereum.providers)if(e&&e.isCoinbaseWallet)return!0}return!1},WMe=(t,e)=>{let r=[],n=[];for(let[i,a]of t.entries())i!!String(t).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),HMe=(t,e)=>{let r=t.slice(0),n=[];for(;r.length;)n.push(r.splice(0,e));return n},as=(t,e=3,r=4,n="ethereum")=>{if(!t)return"";let i=n==="ethereum"?2:0;return e+r+i+3>=t.length?t:`${t.slice(0,i+e)}...${t.slice(t.length-r,t.length)}`},FC=(t,e=3,r=4)=>as(t,e,r,"solana"),Aee=t=>new Promise(e=>setTimeout(e,t));function GMe(t,{interval:e=100,timeout:r=5e3}={}){return new Promise((n,i)=>{let a,s=0,o=()=>{s>=r?i("Max attempts reached without result"):(a=t(),s+=e,a==null?setTimeout(o,e):n(a))};o()})}const IM=(t,e={})=>{let r=e.delayMs||150,n=e.maxAttempts||270;return new Promise(async(i,a)=>{var l;let s=!1,o=0;for(;!s&&o{s=!0,i(c)},(...c)=>{s=!0,a(...c)}),o+=1,await Aee(r)}s||a(Error("Exceeded max attempts before resolving function"))})},Iee=(t,e,r={},n={})=>{let i=new URL(e,t);for(let[s,o]of Object.entries(r))o!==void 0&&i.searchParams.set(s,o);let a=Object.entries(n);if(a.length>0){let s=new URLSearchParams;for(let[o,l]of a)s.append(o,l);i.hash=s.toString()}return i.href},qMe=t=>t.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),H5=t=>typeof t=="string"?t:"0x"+t.toString(16);async function VMe({store:t,walletList:e,externalWalletConfig:r,walletChainType:n,timeout:i=3e3}){let a=!1,s=window;return new Promise(o=>{function l(){if(a)return;a=!0,window.removeEventListener("ethereum#initialized",l);let c=t.getProviders();console.debug("Detected injected providers:",c.map(f=>f.info));let u=[];for(let f of c)e.includes("coinbase_wallet")&&f.info.rdns==="com.coinbase.wallet"||n==="solana-only"&&f.info.rdns==="app.phantom"||u.push({type:f.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:f});if(n!=="solana-only")for(let f of zMe()){let h=Eee(f);if(!c.some(g=>g.info.name===h)){if(_ee(f,!0)&&!u.find(g=>g.type==="metamask")){u.push({type:"metamask",legacyInjectedProvider:f});continue}if(h==="Phantom"&&!u.find(g=>g.type==="phantom")){u.push({type:"phantom",legacyInjectedProvider:f});continue}if(h==="Coinbase Wallet"&&!u.find(g=>{var m;return g.type==="coinbase_wallet"&&((m=r.coinbaseWallet)==null?void 0:m.connectionOptions)!=="smartWalletOnly"})){u.push({type:"coinbase_wallet",legacyInjectedProvider:f});continue}u.find(g=>g.type==="unknown_browser_extension")||u.push({type:"unknown_browser_extension",legacyInjectedProvider:f})}}o(u)}s.ethereum?l():(window.addEventListener("ethereum#initialized",l,{once:!0}),setTimeout(()=>{l()},i))})}function A6(t){return`eip155:${String(Number(t))}`}const YMe=(t,e,r,n)=>{let i=Number(t),a=e.find(s=>s.id===i);if(!a)throw new Pn(`Unsupported chainId ${t}`,4901);return uh(a,r,n)},uh=(t,e,r)=>{var s,o,l;let n,i=t.id,a=Number(t.id);if(t.rpcUrls.privyWalletOverride&&t.rpcUrls.privyWalletOverride.http[0])n=t.rpcUrls.privyWalletOverride.http[0];else if(e.rpcUrls&&e.rpcUrls[a])n=e.rpcUrls[a];else if((s=t.rpcUrls.privy)!=null&&s.http[0]){let c=new URL(t.rpcUrls.privy.http[0]);c.searchParams.append("privyAppId",r),n=c.toString()}else n=(o=t.rpcUrls.public)!=null&&o.http[0]?t.rpcUrls.public.http[0]:(l=t.rpcUrls.default)==null?void 0:l.http[0];if(!n)throw new Pn(`No RPC url found for ${i}`);return n},KMe=(t,e)=>{var i;let r=Number(t),n=e.find(a=>a.id===r);if(!n)throw new Pn(`Unsupported chainId ${t}`,4901);return(i=n.blockExplorers)==null?void 0:i.default.url},Wg=(t,e,r,n)=>{var s,o,l;let i=Number(t),a=e.find(c=>c.id===i);if(!a)throw new Pn(`Unsupported chainId ${t}`,4901);return new bbe(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?a.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[i]?r.rpcUrls[i]:(s=a.rpcUrls.privy)!=null&&s.http[0]?{url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:(o=a.rpcUrls.public)!=null&&o.http[0]?a.rpcUrls.public.http[0]:(l=a.rpcUrls.default)==null?void 0:l.http[0])},MM=t=>{let e={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=t.types.EIP712Domain??Object.entries(t.domain).map(([n,i])=>{if(i!=null&&typeof n=="string"&&n in e)return{name:n,type:e[n]}}).filter(n=>n!==void 0);return{...t,types:{...t.types,EIP712Domain:r}}};function JMe(t,{min:e,max:r}){return Math.min(Math.max(t,e),r)}const UC=t=>{let e;try{e=new URL(t).hostname}catch{return}for(let[r,n]of Object.entries(TM))if(e.includes(n.hostname))return{walletClientType:r,entry:n}},TM={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}},bybit_wallet:{id:"15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f",displayName:"Bybit Wallet",hostname:"bybit.com",mobile:{}}};function Mee(t){return{name:t.displayName||"",universalLink:t.mobile.universal,deepLink:t.mobile.native}}function QMe(t,e){let r=Mee(e);if(r.deepLink)return Nee(r.deepLink,t);if(r.universalLink)return AL(r.universalLink,t);throw new _e(`Unsupported wallet ${e.id}`)}function ZMe(t,e){let r=Mee(e);if(r.universalLink)return AL(r.universalLink,t)}let Tee="WALLETCONNECT_DEEPLINK_CHOICE";function XMe(){try{localStorage.removeItem(Tee)}catch{}}function eTe({href:t,name:e}){try{localStorage.setItem(Tee,JSON.stringify({href:t,name:e}))}catch{}}function kee(t){return t.startsWith("http://")||t.startsWith("https://")}function Nee(t,e){if(kee(t))return AL(t,e);let r=t;return r.includes("://")||(r=t.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function AL(t,e){if(!kee(t))return Nee(t,e);let r=t;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(e)}`,href:r}}function Lee(t,e){window.open(t,e,"noreferrer noopener")}let is=class{execute(e){return this.promise===null&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}},zU=class{get meta(){return this._meta}async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.channelToken)throw new _e("Auth flow must be initialized first");try{let e=await this.api.post(eMe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new _e("No response from authentication");return e}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(tMe,{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw Vr(e)}}async _startChannelOnce(){if(!this.api)throw new _e("Auth flow has no API instance");let e=await this.api.post(XIe,{token:this.captchaToken});ya&&!$N&&e.connect_uri&&Lee(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new _e("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.channelToken)throw new _e("Auth flow must be initialized first");let e=await this.api.get(rMe,{headers:{"farcaster-channel-token":this.meta.channelToken}});return e.state==="completed"&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,r=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new is(this._startChannelOnce.bind(this)),this.pollForReady=new is(this._pollForReady.bind(this)),this._meta.disableSignup=r}};const tTe="34357d3c125c2bcf2ce2bc3309d98715",kM="https://auth.privy.io",rTe=2e4,Dn=1400,IL=2500,X9=4e3,nTe="1.98.4",fy="privy:token",WU="privy-token",BC="privy:refresh_token",iTe="privy-refresh-token",I6="privy:pat",HU="privy:id_token",GU="privy-id-token",zC="privy-session",NM="privy:session_transfer_token",LM="privy:caid",jee=t=>`privy:guest:${t}`,E4=t=>`privy:cross-app:${t}`,G5="privy:state_code",hy="privy:code_verifier",q5="privy:headless_oauth",V5="privy:oauth_disable_signup",WC=t=>`privy:wallet:${t}`,qU="privy:connectors",$ee="privy:connections",ex=12e4,V3=1,VU="0x1",ML=3e4,aTe="https://api.moonpay.com/v1",sTe="https://api.moonpay.com/v1",oTe="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",lTe="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",cTe="deprecated";async function uTe(t){let e=new TextEncoder().encode(t);return new Uint8Array(await crypto.subtle.digest("SHA-256",e))}function jM(t){return crypto.getRandomValues(new Uint8Array(t))}let Pee=class{getOrCreateGuestCredential(e){let r=jee(e);if(AM()){if(Dt.get(r))return Dt.get(r);{let n=F5(jM(32));return Dt.put(r,n),n}}return F5(jM(32))}async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(PMe,{guest_credential:this.meta.guestCredential})}catch(e){throw Vr(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}},_4=class{async initAuthenticationFlow(e){if(!this.api)throw new _e("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new _e("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){var r,n;let e=await qs(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new _e("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new _e("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let i=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(SMe,{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(i)})}catch(i){throw i.name==="NotAllowedError"?new _e("Passkey request timed out or rejected by user.",void 0,Ae.PASSKEY_NOT_ALLOWED):Vr(i)}}async link(){var r,n;let e=await qs(()=>import("./index-Bjltdz_y.js"),[]);if(!this.api)throw new _e("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new _e("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let i=this.meta.initLinkResponse.options,a=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(i));return(n=(r=this.meta).setPasskeyAuthState)==null||n.call(r,{status:"submitting-response"}),await this.api.post(CMe,{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(a)})}catch(i){throw i.name==="NotAllowedError"?new _e("Passkey request timed out or rejected by user.",void 0,Ae.PASSKEY_NOT_ALLOWED):Vr(i)}}async _initAuthenticateOnce(e){if(!this.api)throw new _e("Auth flow has no API instance");let r=Q9(e);return await this.api.post(_Me,{token:this.meta.captchaToken},{headers:{...r}})}async _initLinkOnce(){if(!this.api)throw new _e("Auth flow has no API instance");return await this.api.post(EMe,{})}_transformInitLinkOptionsToCamelCase(e){var r,n,i,a,s,o,l,c,u;return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map(f=>({type:f.type,alg:f.alg})),timeout:e.timeout,excludeCredentials:(r=e.exclude_credentials)==null?void 0:r.map(f=>({id:f.id,type:f.type,transports:f.transports})),authenticatorSelection:{authenticatorAttachment:(n=e.authenticator_selection)==null?void 0:n.authenticator_attachment,requireResidentKey:(i=e.authenticator_selection)==null?void 0:i.require_resident_key,residentKey:(a=e.authenticator_selection)==null?void 0:a.resident_key,userVerification:(s=e.authenticator_selection)==null?void 0:s.user_verification},attestation:e.attestation,extensions:{appid:(o=e.extensions)==null?void 0:o.app_id,credProps:(c=(l=e.extensions)==null?void 0:l.cred_props)==null?void 0:c.rk,hmacCreateSecret:(u=e.extensions)==null?void 0:u.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){var r,n,i,a;return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:((r=e.allow_credentials)==null?void 0:r.map(s=>({id:s.id,type:s.type,transports:s.transports})))||[],timeout:e.timeout,extensions:{appid:(n=e.extensions)==null?void 0:n.app_id,credProps:(i=e.extensions)==null?void 0:i.cred_props,hmacCreateSecret:(a=e.extensions)==null?void 0:a.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:r}){this.initAuthenticateOnce=new is(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new is(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:r}}};const $M=({address:t,chainId:e,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account: ${t} By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees. @@ -138,7 +138,7 @@ Chain ID: ${e} Nonce: ${r} Issued At: ${new Date().toISOString()} Resources: -- https://privy.io`;let F5=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new _e("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.client)throw new _e("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Vr(e)}}async sign(){if(!this.client)throw new _e("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new _e("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new _e("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _e("SiweFlow has no client instance");let e=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=_M({address:e,chainId:r,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new rs(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}};const UMe=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: +- https://privy.io`;let Y5=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new _e("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.client)throw new _e("SiweFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:r,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Vr(e)}}async sign(){if(!this.client)throw new _e("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new _e("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new _e("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _e("SiweFlow has no client instance");let e=this.wallet.address,r=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=$M({address:e,chainId:r,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new is(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}};const dTe=({address:t,nonce:e})=>`${window.location.host} wants you to sign in with your Solana account: ${t} ${`You are proving you own ${t}.`} @@ -149,13 +149,13 @@ Chain ID: mainnet Nonce: ${e} Issued At: ${new Date().toISOString()} Resources: -- https://privy.io`;let CM=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new _e("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.client)throw new _e("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Vr(e)}}async sign(){if(!this.client)throw new _e("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new _e("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new _e("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new _e("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _e("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=UMe({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new rs(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}},Yp=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _e("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(WIe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _e("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(BIe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Vr(e)}}async sendSmsCode({phoneNumber:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new _e("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new _e("phone nNumber must be set when initialzing authentication.");let i=z9(n);try{return await this.api.post(UIe,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(a){throw Vr(a)}}constructor({phoneNumber:e,captchaToken:r,disableSignup:n}){this.meta={phoneNumber:e,captchaToken:r,disableSignup:n??!1}}},BMe=class extends Yp{async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new _e("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(HIe,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Vr(e)}}constructor(e,r,n){super({phoneNumber:r,captchaToken:n}),this.meta={phoneNumber:r,captchaToken:n,oldPhoneNumber:e,disableSignup:!1}}};const Re=()=>{throw Error("You need to wrap your application with the initialized with your app id.")},m4=t=>()=>{throw Error(t.trim())},pee=C.createContext({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:Re,setError:Re,setExecuting:Re,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:Re,reset:Re,execute:Re});let q9=class extends qs{constructor(e,r,n){super(e||"Captcha failed"),this.type="Captcha",r instanceof Error&&(this.cause=r),this.privyErrorCode=n}};const zMe=({children:t,id:e,captchaSiteKey:r,captchaEnabled:n})=>{let i=C.useRef(null),[a,s]=C.useState(),[o,l]=C.useState(),[c,u]=C.useState(!1),f=C.useMemo(()=>n?c||a||o?!c||a||o?a&&!o?{status:"success",token:a}:o?{status:"error",error:o}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[n,a,o,c]);return d.jsx(pee.Provider,{value:{...f,ref:i,enabled:n,siteKey:r,appId:e,setToken:s,setError:l,setExecuting:u,remove(){var h;n&&((h=i.current)==null||h.remove(),u(!1),l(void 0),s(void 0))},reset(){var h;n&&((h=i.current)==null||h.reset(),u(!1),l(void 0),s(void 0))},execute(){var h;n&&(u(!0),(h=i.current)==null||h.execute())},async waitForResult(){if(!n)return"";try{return await bMe(()=>{var h;return(h=i.current)==null?void 0:h.getResponse()},{interval:200,timeout:2e4})}catch{throw new q9("Captcha failed",null,Ae.CAPTCHA_TIMEOUT)}}},children:t})},$o=()=>C.useContext(pee);let y4=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(rMe,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(nMe,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw Vr(e)}}constructor(e,r=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=r}};function PU(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Ae.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Ae.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof q9&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function WMe(){let t;return(t=function(){let e=new URLSearchParams(window.location.search),r=Number(e.get("id")||""),n=e.get("hash"),i=Number(e.get("auth_date")||""),a=e.get("first_name");if(r&&a&&i&&n)return Object.fromEntries(e.entries())}())?(RU(),{flowType:"login-url",authData:t}):(t=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let r=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),n=r.get("user"),i=Number(r.get("auth_date")||""),a=r.get("hash");return n&&i&&a?Object.fromEntries(r.entries()):void 0}())?(RU(),{flowType:"web-app",authData:t}):void 0}function RU(){let t=new URL(window.location.href);t.searchParams.delete("id"),t.searchParams.delete("hash"),t.searchParams.delete("auth_date"),t.searchParams.delete("first_name"),t.searchParams.delete("last_name"),t.searchParams.delete("username"),t.searchParams.delete("photo_url"),t.hash="",window.history.replaceState({},"",t)}let Sp=class gee{static parse(e){try{return new gee(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return OF(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=OF(e)}},HMe=class mee extends Sp{static parse(e){try{return new mee(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}};function Yt(t){return t?new Date(1e3*t):null}function Ja(t,e){return t.slice().sort((r,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===e)}const ks=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"&&e.walletIndex===0))||null,v6=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"),GMe=t=>v6(t).reduce((e,r)=>!e||e.walletIndex((t==null?void 0:t.linkedAccounts)??[]).filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType===e),b6=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"),Xc=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"&&e.walletIndex===0))||null,qMe=t=>b6(t).reduce((e,r)=>!e||e.walletIndex(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.imported&&e.chainType==="ethereum"))||null,Ty=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana"))||null,B5=(t,e)=>(t==null?void 0:t.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===e))||null,ho=t=>ks(t)??Xc(t),qn=t=>{if(t.chainType==="ethereum")return{entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"};if(t.chainType==="solana")return{entropyId:t.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},VMe=t=>{let e=ho(t);if(!e)throw Error("Failed to find primary wallet");return qn(e)},w4=(t,e)=>{let r=yee(t,"ethereum").find(n=>Ir(n.address)===Ir(e));return{signingWallet:r,rootWallet:r?r.imported?r:ks(t):void 0}},x6=(t,e)=>{let r=yee(t,"solana").find(n=>n.address===e);return r?r.imported||r.walletIndex===0?{signingWallet:r,rootWallet:r}:{signingWallet:r,rootWallet:Xc(t)}:{}},Od=(t,e)=>{var r;return!(ks(t)||Xc(t)||e!=="all-users"&&(e!=="users-without-wallets"||(r=(n=>n.linkedAccounts.filter(i=>i.type==="wallet"))(t))!=null&&r.length))};function Ma(t){if(!t)return null;let e=function(b){let A=[];for(let S of b){let j=S.type;switch(S.type){case"wallet":let U={address:S.address,type:S.type,imported:S.imported,delegated:S.delegated,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),chainType:S.chain_type,chainId:S.chain_id,walletClient:S.wallet_client_type==="privy"?"privy":"unknown",walletClientType:S.wallet_client_type,connectorType:S.connector_type,recoveryMethod:S.recovery_method,walletIndex:S.wallet_index};A.push(U);break;case"smart_wallet":let I={address:S.address,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),smartWalletType:S.smart_wallet_type};A.push(I);break;case"cross_app":let B={type:S.type,subject:S.subject,embeddedWallets:S.embedded_wallets,smartWallets:S.smart_wallets,providerApp:{id:S.provider_app_id},verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(B);break;case"email":let V={address:S.address,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(V);break;case"phone":let se={number:S.phoneNumber,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(se);break;case"google_oauth":let Y={subject:S.subject,email:S.email,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(Y);break;case"spotify_oauth":let N={subject:S.subject,email:S.email,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(N);break;case"instagram_oauth":let k={subject:S.subject,username:S.username,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(k);break;case"twitter_oauth":let x={subject:S.subject,username:S.username,name:S.name,type:S.type,profilePictureUrl:S.profile_picture_url,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(x);break;case"discord_oauth":let E={subject:S.subject,username:S.username,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(E);break;case"github_oauth":let L={subject:S.subject,username:S.username,name:S.name,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(L);break;case"tiktok_oauth":let O={subject:S.subject,username:S.username,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(O);break;case"linkedin_oauth":let P={subject:S.subject,name:S.name,email:S.email,vanityName:S.vanity_name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(P);break;case"apple_oauth":let R={subject:S.subject,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(R);break;case"custom_auth":A.push({type:S.type,customUserId:S.custom_user_id,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)});break;case"farcaster":let M={type:S.type,fid:S.fid,ownerAddress:S.owner_address,displayName:S.display_name,username:S.username,bio:S.bio,pfp:S.profile_picture_url,url:S.homepage_url,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),signerPublicKey:S.signer_public_key};A.push(M);break;case"passkey":let D={type:S.type,enrolledInMfa:S.enrolled_in_mfa,credentialId:S.credential_id,authenticatorName:S.authenticator_name,createdWithDevice:S.created_with_device,createdWithOs:S.created_with_os,createdWithBrowser:S.created_with_browser,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(D);break;case"telegram":let $={type:S.type,telegramUserId:S.telegram_user_id,firstName:S.first_name,lastName:S.last_name,username:S.username,photoUrl:S.photo_url,verifiedAt:Yt(S.first_verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push($);break;default:console.warn(`Unrecognized account type: ${j}. Please consider upgrading the Privy SDK.`)}}return A}(t.linked_accounts),r=Ja(e,"wallet"),n=Ja(e,"smart_wallet"),i=Ja(e,"email"),a=Ja(e,"phone"),s=Ja(e,"google_oauth"),o=Ja(e,"twitter_oauth"),l=Ja(e,"discord_oauth"),c=Ja(e,"github_oauth"),u=Ja(e,"spotify_oauth"),f=Ja(e,"instagram_oauth"),h=Ja(e,"tiktok_oauth"),g=Ja(e,"linkedin_oauth"),m=Ja(e,"apple_oauth"),w=Ja(e,"farcaster"),_=Ja(e,"telegram"),v=t.mfa_methods.map(({type:b,verified_at:A})=>({type:b,verifiedAt:Yt(A)}));return{id:t.id,createdAt:Yt(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:a&&{number:a==null?void 0:a.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,delegated:r.delegated,walletIndex:r.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:w&&{fid:w.fid,ownerAddress:w.ownerAddress,displayName:w.displayName,username:w.username,bio:w.bio,pfp:w.pfp,url:w.url,signerPublicKey:w.signerPublicKey},telegram:_&&{telegramUserId:_.telegramUserId,firstName:_.firstName,lastName:_.lastName,username:_.username,photoUrl:_.photoUrl},delegatedWallets:[],mfaMethods:v.map(b=>b.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}var wee={},F3={},V9={};Object.defineProperty(V9,"__esModule",{value:!0});V9.walletLogo=void 0;const YMe=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};V9.walletLogo=YMe;var Y9={};const KMe=fh(j9e);var Tu={},Fd={};Object.defineProperty(Fd,"__esModule",{value:!0});Fd.errorValues=Fd.standardErrorCodes=void 0;Fd.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Fd.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var K9={},wL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Fd,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,g=r){if(h&&Number.isInteger(h)){const m=h.toString();if(u(e.errorValues,m))return e.errorValues[m].message;if(l(h))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return g}t.getMessageFromCode=n;function i(h){if(!Number.isInteger(h))return!1;const g=h.toString();return!!(e.errorValues[g]||l(h))}t.isValidCode=i;function a(h){var g;if(typeof h=="number")return h;if(s(h))return(g=h.code)!==null&&g!==void 0?g:h.errorCode}t.getErrorCode=a;function s(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function o(h,{shouldIncludeStack:g=!1}={}){const m={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&i(h.code)){const w=h;m.code=w.code,w.message&&typeof w.message=="string"?(m.message=w.message,u(w,"data")&&(m.data=w.data)):(m.message=n(m.code),m.data={originalError:c(h)})}else m.code=e.standardErrorCodes.rpc.internal,m.message=f(h,"message")?h.message:r,m.data={originalError:c(h)};return g&&(m.stack=f(h,"stack")?h.stack:void 0),m}t.serialize=o;function l(h){return h>=-32099&&h<=-32e3}function c(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,g){return Object.prototype.hasOwnProperty.call(h,g)}function f(h,g){return typeof h=="object"&&h!==null&&g in h&&typeof h[g]=="string"}})(wL);Object.defineProperty(K9,"__esModule",{value:!0});K9.standardErrors=void 0;const fa=Fd,vee=wL;K9.standardErrors={rpc:{parse:t=>Ko(fa.standardErrorCodes.rpc.parse,t),invalidRequest:t=>Ko(fa.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>Ko(fa.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>Ko(fa.standardErrorCodes.rpc.methodNotFound,t),internal:t=>Ko(fa.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Ko(e,t)},invalidInput:t=>Ko(fa.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>Ko(fa.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Ko(fa.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Ko(fa.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Ko(fa.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Ko(fa.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>up(fa.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>up(fa.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>up(fa.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>up(fa.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>up(fa.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>up(fa.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Eee(e,r,n)}}};function Ko(t,e){const[r,n]=bee(e);return new xee(t,r||(0,vee.getMessageFromCode)(t),n)}function up(t,e){const[r,n]=bee(e);return new Eee(t,r||(0,vee.getMessageFromCode)(t),n)}function bee(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}class xee extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}}class Eee extends xee{constructor(e,r,n){if(!JMe(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}function JMe(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=void 0;var e=Fd;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var r=K9;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}})})(Tu);var J9={},Sm={};Object.defineProperty(Sm,"__esModule",{value:!0});Sm.isErrorResponse=void 0;function ZMe(t){return t.errorMessage!==void 0}Sm.isErrorResponse=ZMe;var m1={};Object.defineProperty(m1,"__esModule",{value:!0});m1.LIB_VERSION=void 0;m1.LIB_VERSION="4.0.3";Object.defineProperty(J9,"__esModule",{value:!0});J9.serializeError=void 0;const QMe=Sm,XMe=m1,eTe=Fd,tTe=wL;function rTe(t,e){const r=(0,tTe.serialize)(nTe(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",XMe.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=iTe(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}J9.serializeError=rTe;function nTe(t){return typeof t=="string"?{message:t,code:eTe.standardErrorCodes.rpc.internal}:(0,QMe.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function iTe(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var $a={};Object.defineProperty($a,"__esModule",{value:!0});$a.RegExpString=$a.IntNumber=$a.BigIntString=$a.AddressString=$a.HexString=$a.OpaqueType=void 0;function Uw(){return t=>t}$a.OpaqueType=Uw;$a.HexString=Uw();$a.AddressString=Uw();$a.BigIntString=Uw();function aTe(t){return Math.floor(t)}$a.IntNumber=aTe;$a.RegExpString=Uw();var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.areAddressArraysEqual=Kt.getFavicon=Kt.range=Kt.isBigNumber=Kt.ensureParsedJSONObject=Kt.ensureBigInt=Kt.ensureRegExpString=Kt.ensureIntNumber=Kt.ensureBuffer=Kt.ensureAddressString=Kt.ensureEvenLengthHexString=Kt.ensureHexString=Kt.isHexString=Kt.prepend0x=Kt.strip0x=Kt.has0xPrefix=Kt.hexStringFromIntNumber=Kt.intNumberFromHexString=Kt.bigIntStringFromBigInt=Kt.hexStringFromBuffer=Kt.hexStringToUint8Array=Kt.uint8ArrayToHex=Kt.randomBytesHex=void 0;const y1=Tu,ul=$a,_ee=/^[0-9]*$/,Cee=/^[a-f0-9]*$/;function sTe(t){return See(crypto.getRandomValues(new Uint8Array(t)))}Kt.randomBytesHex=sTe;function See(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}Kt.uint8ArrayToHex=See;function oTe(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Kt.hexStringToUint8Array=oTe;function lTe(t,e=!1){const r=t.toString("hex");return(0,ul.HexString)(e?`0x${r}`:r)}Kt.hexStringFromBuffer=lTe;function cTe(t){return(0,ul.BigIntString)(t.toString(10))}Kt.bigIntStringFromBigInt=cTe;function uTe(t){return(0,ul.IntNumber)(Number(BigInt(zw(t,!0))))}Kt.intNumberFromHexString=uTe;function dTe(t){return(0,ul.HexString)(`0x${BigInt(t).toString(16)}`)}Kt.hexStringFromIntNumber=dTe;function vL(t){return t.startsWith("0x")||t.startsWith("0X")}Kt.has0xPrefix=vL;function Z9(t){return vL(t)?t.slice(2):t}Kt.strip0x=Z9;function Aee(t){return vL(t)?`0x${t.slice(2)}`:`0x${t}`}Kt.prepend0x=Aee;function Bw(t){if(typeof t!="string")return!1;const e=Z9(t).toLowerCase();return Cee.test(e)}Kt.isHexString=Bw;function Iee(t,e=!1){if(typeof t=="string"){const r=Z9(t).toLowerCase();if(Cee.test(r))return(0,ul.HexString)(e?`0x${r}`:r)}throw y1.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}Kt.ensureHexString=Iee;function zw(t,e=!1){let r=Iee(t,!1);return r.length%2===1&&(r=(0,ul.HexString)(`0${r}`)),e?(0,ul.HexString)(`0x${r}`):r}Kt.ensureEvenLengthHexString=zw;function fTe(t){if(typeof t=="string"){const e=Z9(t).toLowerCase();if(Bw(e)&&e.length===40)return(0,ul.AddressString)(Aee(e))}throw y1.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}Kt.ensureAddressString=fTe;function hTe(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(Bw(t)){const e=zw(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw y1.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}Kt.ensureBuffer=hTe;function Mee(t){if(typeof t=="number"&&Number.isInteger(t))return(0,ul.IntNumber)(t);if(typeof t=="string"){if(_ee.test(t))return(0,ul.IntNumber)(Number(t));if(Bw(t))return(0,ul.IntNumber)(Number(BigInt(zw(t,!0))))}throw y1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Kt.ensureIntNumber=Mee;function pTe(t){if(t instanceof RegExp)return(0,ul.RegExpString)(t.toString());throw y1.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}Kt.ensureRegExpString=pTe;function gTe(t){if(t!==null&&(typeof t=="bigint"||Tee(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(Mee(t));if(typeof t=="string"){if(_ee.test(t))return BigInt(t);if(Bw(t))return BigInt(zw(t,!0))}throw y1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Kt.ensureBigInt=gTe;function mTe(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw y1.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}Kt.ensureParsedJSONObject=mTe;function Tee(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}Kt.isBigNumber=Tee;function yTe(t,e){return Array.from({length:e-t},(r,n)=>t+n)}Kt.range=yTe;function wTe(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}Kt.getFavicon=wTe;function vTe(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}Kt.areAddressArraysEqual=vTe;var nu={},Q9={},X9={},ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.decryptContent=ji.encryptContent=ji.importKeyFromHexString=ji.exportKeyToHexString=ji.decrypt=ji.encrypt=ji.deriveSharedSecret=ji.generateKeyPair=void 0;const kee=Kt;async function bTe(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}ji.generateKeyPair=bTe;async function xTe(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}ji.deriveSharedSecret=xTe;async function Nee(t,e){const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},t,new TextEncoder().encode(e));return{iv:r,cipherText:n}}ji.encrypt=Nee;async function Lee(t,{iv:e,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return new TextDecoder().decode(n)}ji.decrypt=Lee;function jee(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function ETe(t,e){const r=jee(t),n=await crypto.subtle.exportKey(r,e);return(0,kee.uint8ArrayToHex)(new Uint8Array(n))}ji.exportKeyToHexString=ETe;async function _Te(t,e){const r=jee(t),n=(0,kee.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(r,n,{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}ji.importKeyFromHexString=_Te;async function CTe(t,e){const r=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;const a=i;return Object.assign(Object.assign({},a.code?{code:a.code}:{}),{message:a.message})});return Nee(e,r)}ji.encryptContent=CTe;async function STe(t,e){return JSON.parse(await Lee(e,t))}ji.decryptContent=STe;var ku={};Object.defineProperty(ku,"__esModule",{value:!0});ku.ScopedLocalStorage=void 0;class z5{constructor(e,r){this.scope=e,this.module=r}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new z5("CBWSDK").clear(),new z5("walletlink").clear()}}ku.ScopedLocalStorage=z5;Object.defineProperty(X9,"__esModule",{value:!0});X9.SCWKeyManager=void 0;const v4=ji,ATe=ku,PC={storageKey:"ownPrivateKey",keyType:"private"},RC={storageKey:"ownPublicKey",keyType:"public"},DC={storageKey:"peerPublicKey",keyType:"public"};class ITe{constructor(){this.storage=new ATe.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(DC,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(RC.storageKey),this.storage.removeItem(PC.storageKey),this.storage.removeItem(DC.storageKey)}async generateKeyPair(){const e=await(0,v4.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(PC,e.privateKey),await this.storeKey(RC,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(PC)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(RC)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(DC)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,v4.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const r=this.storage.getItem(e.storageKey);return r?(0,v4.importKeyFromHexString)(e.keyType,r):null}async storeKey(e,r){const n=await(0,v4.exportKeyToHexString)(e.keyType,r);this.storage.setItem(e.storageKey,n)}}X9.SCWKeyManager=ITe;var ex={};Object.defineProperty(ex,"__esModule",{value:!0});ex.SCWStateManager=void 0;const MTe=ku,DU="accounts",OU="activeChain",FU="availableChains",UU="walletCapabilities";class TTe{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var r,n;this.storage=new MTe.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(FU),this._walletCapabilities=this.loadItemFromStorage(UU);const i=this.loadItemFromStorage(DU),a=this.loadItemFromStorage(OU);i&&this.updateListener.onAccountsUpdate({accounts:i,source:"storage"}),a&&this.updateListener.onChainUpdate({chain:a,source:"storage"}),this._accounts=i||[],this._activeChain=a||{id:(n=(r=e.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(DU,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var r;const n=(r=this.availableChains)===null||r===void 0?void 0:r.find(i=>i.id===e);return n?(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(OU,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const r=Object.entries(e).map(([n,i])=>({id:Number(n),rpcUrl:i}));this.availableChains=r,this.storeItemToStorage(FU,r),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(UU,e)}storeItemToStorage(e,r){this.storage.setItem(e,JSON.stringify(r))}loadItemFromStorage(e){const r=this.storage.getItem(e);return r?JSON.parse(r):void 0}clear(){this.storage.clear()}}ex.SCWStateManager=TTe;Object.defineProperty(Q9,"__esModule",{value:!0});Q9.SCWSigner=void 0;const kTe=X9,NTe=ex,b4=Tu,BU=Kt,x4=ji;class LTe{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new kTe.SCWKeyManager,this.stateManager=new NTe.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),r=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in r.content)throw r.content.failure;const n=await(0,x4.importKeyFromHexString)("public",r.sender);await this.keyManager.setPeerPublicKey(n);const i=await this.decryptResponseMessage(r);this.updateInternalState({method:"eth_requestAccounts"},i);const a=i.result;if("error"in a)throw a.error;return this.stateManager.accounts}async request(e){const r=this.tryLocalHandling(e);if(r!==void 0){if(r instanceof Error)throw r;return r}await this.communicator.waitForPopupLoaded();const n=await this.sendEncryptedRequest(e),i=await this.decryptResponseMessage(n);this.updateInternalState(e,i);const a=i.result;if("error"in a)throw a.error;return a.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var r;switch(e.method){case"wallet_switchEthereumChain":{const n=e.params;if(!n||!(!((r=n[0])===null||r===void 0)&&r.chainId))throw b4.standardErrors.rpc.invalidParams();const i=(0,BU.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(i)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw b4.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return n}default:return}}async sendEncryptedRequest(e){const r=await this.keyManager.getSharedSecret();if(!r)throw b4.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,x4.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},r),i=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const r=await(0,x4.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:r,content:e,timestamp:new Date}}async decryptResponseMessage(e){const r=e.content;if("failure"in r)throw r.failure;const n=await this.keyManager.getSharedSecret();if(!n)throw b4.standardErrors.provider.unauthorized("Invalid session");return(0,x4.decryptContent)(r.encrypted,n)}updateInternalState(e,r){var n,i;const a=(n=r.data)===null||n===void 0?void 0:n.chains;a&&this.stateManager.updateAvailableChains(a);const s=(i=r.data)===null||i===void 0?void 0:i.capabilities;s&&this.stateManager.updateWalletCapabilities(s);const o=r.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const l=o.value;this.stateManager.updateAccounts(l);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const l=e.params,c=(0,BU.ensureIntNumber)(l[0].chainId);this.stateManager.switchChain(c);break}}}}Q9.SCWSigner=LTe;var tx={},SM={exports:{}},bL={exports:{}},ug=typeof Reflect=="object"?Reflect:null,zU=ug&&typeof ug.apply=="function"?ug.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},E6;ug&&typeof ug.ownKeys=="function"?E6=ug.ownKeys:Object.getOwnPropertySymbols?E6=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:E6=function(e){return Object.getOwnPropertyNames(e)};function jTe(t){console&&console.warn&&console.warn(t)}var $ee=Number.isNaN||function(e){return e!==e};function gn(){gn.init.call(this)}bL.exports=gn;bL.exports.once=DTe;gn.EventEmitter=gn;gn.prototype._events=void 0;gn.prototype._eventsCount=0;gn.prototype._maxListeners=void 0;var WU=10;function rx(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(gn,"defaultMaxListeners",{enumerable:!0,get:function(){return WU},set:function(t){if(typeof t!="number"||t<0||$ee(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");WU=t}});gn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};gn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||$ee(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Pee(t){return t._maxListeners===void 0?gn.defaultMaxListeners:t._maxListeners}gn.prototype.getMaxListeners=function(){return Pee(this)};gn.prototype.emit=function(e){for(var r=[],n=1;n0&&(s=r[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(l===void 0)return!1;if(typeof l=="function")zU(l,this,r);else for(var c=l.length,u=Uee(l,c),n=0;n0&&s.length>i&&!s.warned){s.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=t,o.type=e,o.count=s.length,jTe(o)}return t}gn.prototype.addListener=function(e,r){return Ree(this,e,r,!1)};gn.prototype.on=gn.prototype.addListener;gn.prototype.prependListener=function(e,r){return Ree(this,e,r,!0)};function $Te(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Dee(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=$Te.bind(n);return i.listener=r,n.wrapFn=i,i}gn.prototype.once=function(e,r){return rx(r),this.on(e,Dee(this,e,r)),this};gn.prototype.prependOnceListener=function(e,r){return rx(r),this.prependListener(e,Dee(this,e,r)),this};gn.prototype.removeListener=function(e,r){var n,i,a,s,o;if(rx(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(a=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){o=n[s].listener,a=s;break}if(a<0)return this;a===0?n.shift():PTe(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,o||r)}return this};gn.prototype.off=gn.prototype.removeListener;gn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),s;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function Oee(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?RTe(i):Uee(i,i.length)}gn.prototype.listeners=function(e){return Oee(this,e,!0)};gn.prototype.rawListeners=function(e){return Oee(this,e,!1)};gn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Fee.call(t,e)};gn.prototype.listenerCount=Fee;function Fee(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}gn.prototype.eventNames=function(){return this._eventsCount>0?E6(this._events):[]};function Uee(t,e){for(var r=new Array(e),n=0;n0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function BTe(t){var e=Wee(t),r=e[0],n=e[1];return(r+n)*3/4-n}function zTe(t,e,r){return(e+r)*3/4-r}function WTe(t){var e,r=Wee(t),n=r[0],i=r[1],a=new FTe(zTe(t,n,i)),s=0,o=i>0?n-4:n,l;for(l=0;l>16&255,a[s++]=e>>8&255,a[s++]=e&255;return i===2&&(e=el[t.charCodeAt(l)]<<2|el[t.charCodeAt(l+1)]>>4,a[s++]=e&255),i===1&&(e=el[t.charCodeAt(l)]<<10|el[t.charCodeAt(l+1)]<<4|el[t.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}function HTe(t){return eu[t>>18&63]+eu[t>>12&63]+eu[t>>6&63]+eu[t&63]}function GTe(t,e,r){for(var n,i=[],a=e;ao?o:s+a));return n===1?(e=t[r-1],i.push(eu[e>>2]+eu[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(eu[e>>10]+eu[e>>4&63]+eu[e<<2&63]+"=")),i.join("")}var EL={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */EL.read=function(t,e,r,n,i){var a,s,o=i*8-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,g=t[e+f];for(f+=h,a=g&(1<<-u)-1,g>>=-u,u+=o;u>0;a=a*256+t[e+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=s*256+t[e+f],f+=h,u-=8);if(a===0)a=1-c;else{if(a===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-c}return(g?-1:1)*s*Math.pow(2,a-n)};EL.write=function(t,e,r,n,i,a){var s,o,l,c=a*8-i-1,u=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,m=n?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(e*l-1)*Math.pow(2,i),s=s+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+g]=o&255,g+=m,o/=256,i-=8);for(s=s<0;t[r+g]=s&255,g+=m,s/=256,c-=8);t[r+g-m]|=w*128};/*! +- https://privy.io`;let PM=class{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new _e("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.client)throw new _e("SiwsFlow has no client instance");try{let{message:e,signature:r}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:r,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw Vr(e)}}async sign(){if(!this.client)throw new _e("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new _e("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new _e("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new _e("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new _e("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=dTe({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,r,n,i=!1){this._meta={disableSignup:!1},this.getNonceOnce=new is(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=n,this.client=r,this._meta.disableSignup=i}},tg=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _e("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(pMe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new _e("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post(fMe,{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Vr(e)}}async sendSmsCode({phoneNumber:e,captchaToken:r,withPrivyUi:n}){if(!this.api)throw new _e("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),r&&(this.meta.captchaToken=r),!this.meta.phoneNumber)throw new _e("phone nNumber must be set when initialzing authentication.");let i=Q9(n);try{return await this.api.post(dMe,{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...i}})}catch(a){throw Vr(a)}}constructor({phoneNumber:e,captchaToken:r,disableSignup:n}){this.meta={phoneNumber:e,captchaToken:r,disableSignup:n??!1}}},fTe=class extends tg{async link(){if(!this.api)throw new _e("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new _e("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post(gMe,{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw Vr(e)}}constructor(e,r,n){super({phoneNumber:r,captchaToken:n}),this.meta={phoneNumber:r,captchaToken:n,oldPhoneNumber:e,disableSignup:!1}}};const Pe=()=>{throw Error("You need to wrap your application with the initialized with your app id.")},C4=t=>()=>{throw Error(t.trim())},Ree=_.createContext({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:Pe,setError:Pe,setExecuting:Pe,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:Pe,reset:Pe,execute:Pe});let tx=class extends Ks{constructor(e,r,n){super(e||"Captcha failed"),this.type="Captcha",r instanceof Error&&(this.cause=r),this.privyErrorCode=n}};const hTe=({children:t,id:e,captchaSiteKey:r,captchaEnabled:n})=>{let i=_.useRef(null),[a,s]=_.useState(),[o,l]=_.useState(),[c,u]=_.useState(!1),f=_.useMemo(()=>n?c||a||o?!c||a||o?a&&!o?{status:"success",token:a}:o?{status:"error",error:o}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[n,a,o,c]);return d.jsx(Ree.Provider,{value:{...f,ref:i,enabled:n,siteKey:r,appId:e,setToken:s,setError:l,setExecuting:u,remove(){var h;n&&((h=i.current)==null||h.remove(),u(!1),l(void 0),s(void 0))},reset(){var h;n&&((h=i.current)==null||h.reset(),u(!1),l(void 0),s(void 0))},execute(){var h;n&&(u(!0),(h=i.current)==null||h.execute())},async waitForResult(){if(!n)return"";try{return await GMe(()=>{var h;return(h=i.current)==null?void 0:h.getResponse()},{interval:200,timeout:2e4})}catch{throw new tx("Captcha failed",null,Ae.CAPTCHA_TIMEOUT)}}},children:t})},Ro=()=>_.useContext(Ree);let S4=class{async authenticate(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(IMe,{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw Vr(e)}}async link(){if(!this.api)throw new _e("Auth flow has no API instance");try{return await this.api.post(MMe,{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw Vr(e)}}constructor(e,r=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=r}};function YU(t){let e={detail:"",retryable:!1};return(t==null?void 0:t.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER&&(e.detail="This account has already been linked to another user."),(t==null?void 0:t.privyErrorCode)===Ae.DISALLOWED_LOGIN_METHOD&&(e.detail="Login with Telegram not allowed."),(t==null?void 0:t.privyErrorCode)===Ae.INVALID_DATA&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.CANNOT_LINK_MORE_OF_TYPE&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.INVALID_CREDENTIALS&&(e.retryable=!0,e.detail="Something went wrong. Try again."),(t==null?void 0:t.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&(e.detail="Too many requests. Please wait before trying again."),(t==null?void 0:t.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&t.message.includes("rate limit")&&(e.detail="Request limit reached for Telegram. Please wait a moment and try again."),t instanceof tx&&(e.retryable=!0,e.detail="Something went wrong. Try again."),e}function pTe(){let t;return(t=function(){let e=new URLSearchParams(window.location.search),r=Number(e.get("id")||""),n=e.get("hash"),i=Number(e.get("auth_date")||""),a=e.get("first_name");if(r&&a&&i&&n)return Object.fromEntries(e.entries())}())?(KU(),{flowType:"login-url",authData:t}):(t=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let r=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),n=r.get("user"),i=Number(r.get("auth_date")||""),a=r.get("hash");return n&&i&&a?Object.fromEntries(r.entries()):void 0}())?(KU(),{flowType:"web-app",authData:t}):void 0}function KU(){let t=new URL(window.location.href);t.searchParams.delete("id"),t.searchParams.delete("hash"),t.searchParams.delete("auth_date"),t.searchParams.delete("first_name"),t.searchParams.delete("last_name"),t.searchParams.delete("username"),t.searchParams.delete("photo_url"),t.hash="",window.history.replaceState({},"",t)}let Lp=class Dee{static parse(e){try{return new Dee(e)}catch{return null}}static throwIfNotWellFormedJwt(e){return QF(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=QF(e)}},gTe=class Oee extends Lp{static parse(e){try{return new Oee(e)}catch{return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}};function Yt(t){return t?new Date(1e3*t):null}function Qa(t,e){return t.slice().sort((r,n)=>(n.firstVerifiedAt??n.verifiedAt).getTime()-(r.firstVerifiedAt??r.verifiedAt).getTime()).find(r=>r.type===e)}const js=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"&&e.walletIndex===0))||null,M6=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="ethereum"),mTe=t=>M6(t).reduce((e,r)=>!e||e.walletIndex((t==null?void 0:t.linkedAccounts)??[]).filter(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.chainType===e),T6=t=>((t==null?void 0:t.linkedAccounts)??[]).filter(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"),iu=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&!e.imported&&e.chainType==="solana"&&e.walletIndex===0))||null,yTe=t=>T6(t).reduce((e,r)=>!e||e.walletIndex(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.walletClientType==="privy"&&e.imported&&e.chainType==="ethereum"))||null,Oy=t=>(t==null?void 0:t.linkedAccounts.find(e=>e.type==="wallet"&&e.imported&&e.walletClientType==="privy"&&e.chainType==="solana"))||null,J5=(t,e)=>(t==null?void 0:t.linkedAccounts.find(r=>r.type==="wallet"&&r.walletClientType==="privy"&&r.address===e))||null,mo=t=>js(t)??iu(t),qn=t=>{if(t.chainType==="ethereum")return{entropyId:t.address,entropyIdVerifier:"ethereum-address-verifier"};if(t.chainType==="solana")return{entropyId:t.address,entropyIdVerifier:"solana-address-verifier"};throw Error("Failed to get account entropy details")},wTe=t=>{let e=mo(t);if(!e)throw Error("Failed to find primary wallet");return qn(e)},A4=(t,e)=>{let r=Fee(t,"ethereum").find(n=>Ir(n.address)===Ir(e));return{signingWallet:r,rootWallet:r?r.imported?r:js(t):void 0}},k6=(t,e)=>{let r=Fee(t,"solana").find(n=>n.address===e);return r?r.imported||r.walletIndex===0?{signingWallet:r,rootWallet:r}:{signingWallet:r,rootWallet:iu(t)}:{}},Hd=(t,e)=>{var r;return!(js(t)||iu(t)||e!=="all-users"&&(e!=="users-without-wallets"||(r=(n=>n.linkedAccounts.filter(i=>i.type==="wallet"))(t))!=null&&r.length))};function Ta(t){if(!t)return null;let e=function(b){let A=[];for(let S of b){let j=S.type;switch(S.type){case"wallet":let F={address:S.address,type:S.type,imported:S.imported,delegated:S.delegated,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),chainType:S.chain_type,chainId:S.chain_id,walletClient:S.wallet_client_type==="privy"?"privy":"unknown",walletClientType:S.wallet_client_type,connectorType:S.connector_type,recoveryMethod:S.recovery_method,walletIndex:S.wallet_index};A.push(F);break;case"smart_wallet":let I={address:S.address,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),smartWalletType:S.smart_wallet_type};A.push(I);break;case"cross_app":let B={type:S.type,subject:S.subject,embeddedWallets:S.embedded_wallets,smartWallets:S.smart_wallets,providerApp:{id:S.provider_app_id},verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(B);break;case"email":let V={address:S.address,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(V);break;case"phone":let se={number:S.phoneNumber,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(se);break;case"google_oauth":let Y={subject:S.subject,email:S.email,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(Y);break;case"spotify_oauth":let N={subject:S.subject,email:S.email,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(N);break;case"instagram_oauth":let k={subject:S.subject,username:S.username,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(k);break;case"twitter_oauth":let x={subject:S.subject,username:S.username,name:S.name,type:S.type,profilePictureUrl:S.profile_picture_url,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(x);break;case"discord_oauth":let E={subject:S.subject,username:S.username,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(E);break;case"github_oauth":let L={subject:S.subject,username:S.username,name:S.name,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(L);break;case"tiktok_oauth":let O={subject:S.subject,username:S.username,name:S.name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(O);break;case"linkedin_oauth":let P={subject:S.subject,name:S.name,email:S.email,vanityName:S.vanity_name,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(P);break;case"apple_oauth":let R={subject:S.subject,email:S.email,type:S.type,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(R);break;case"custom_auth":A.push({type:S.type,customUserId:S.custom_user_id,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)});break;case"farcaster":let M={type:S.type,fid:S.fid,ownerAddress:S.owner_address,displayName:S.display_name,username:S.username,bio:S.bio,pfp:S.profile_picture_url,url:S.homepage_url,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at),signerPublicKey:S.signer_public_key};A.push(M);break;case"passkey":let D={type:S.type,enrolledInMfa:S.enrolled_in_mfa,credentialId:S.credential_id,authenticatorName:S.authenticator_name,createdWithDevice:S.created_with_device,createdWithOs:S.created_with_os,createdWithBrowser:S.created_with_browser,verifiedAt:Yt(S.verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push(D);break;case"telegram":let $={type:S.type,telegramUserId:S.telegram_user_id,firstName:S.first_name,lastName:S.last_name,username:S.username,photoUrl:S.photo_url,verifiedAt:Yt(S.first_verified_at),firstVerifiedAt:Yt(S.first_verified_at),latestVerifiedAt:Yt(S.latest_verified_at)};A.push($);break;default:console.warn(`Unrecognized account type: ${j}. Please consider upgrading the Privy SDK.`)}}return A}(t.linked_accounts),r=Qa(e,"wallet"),n=Qa(e,"smart_wallet"),i=Qa(e,"email"),a=Qa(e,"phone"),s=Qa(e,"google_oauth"),o=Qa(e,"twitter_oauth"),l=Qa(e,"discord_oauth"),c=Qa(e,"github_oauth"),u=Qa(e,"spotify_oauth"),f=Qa(e,"instagram_oauth"),h=Qa(e,"tiktok_oauth"),g=Qa(e,"linkedin_oauth"),m=Qa(e,"apple_oauth"),w=Qa(e,"farcaster"),C=Qa(e,"telegram"),v=t.mfa_methods.map(({type:b,verified_at:A})=>({type:b,verifiedAt:Yt(A)}));return{id:t.id,createdAt:Yt(t.created_at),linkedAccounts:e,email:i&&{address:i==null?void 0:i.address},phone:a&&{number:a==null?void 0:a.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported,delegated:r.delegated,walletIndex:r.walletIndex},smartWallet:n&&{address:n.address,smartWalletType:n.smartWalletType},google:s&&{subject:s.subject,email:s.email,name:s.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:l&&{subject:l.subject,username:l.username,email:l.email},github:c&&{subject:c.subject,username:c.username,name:c.name,email:c.email},spotify:u&&{subject:u.subject,email:u.email,name:u.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},linkedin:g&&{subject:g.subject,name:g.name,email:g.email,vanityName:g.vanityName},apple:m&&{subject:m.subject,email:m.email},farcaster:w&&{fid:w.fid,ownerAddress:w.ownerAddress,displayName:w.displayName,username:w.username,bio:w.bio,pfp:w.pfp,url:w.url,signerPublicKey:w.signerPublicKey},telegram:C&&{telegramUserId:C.telegramUserId,firstName:C.firstName,lastName:C.lastName,username:C.username,photoUrl:C.photoUrl},delegatedWallets:[],mfaMethods:v.map(b=>b.type),hasAcceptedTerms:t.has_accepted_terms??!1,isGuest:t.is_guest,customMetadata:t.custom_metadata}}var Uee={},Y3={},rx={};Object.defineProperty(rx,"__esModule",{value:!0});rx.walletLogo=void 0;const vTe=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};rx.walletLogo=vTe;var nx={};const bTe=wh(axe);var $u={},Gd={};Object.defineProperty(Gd,"__esModule",{value:!0});Gd.errorValues=Gd.standardErrorCodes=void 0;Gd.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Gd.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var ix={},TL={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Gd,r="Unspecified error message.";t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(h,g=r){if(h&&Number.isInteger(h)){const m=h.toString();if(u(e.errorValues,m))return e.errorValues[m].message;if(l(h))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return g}t.getMessageFromCode=n;function i(h){if(!Number.isInteger(h))return!1;const g=h.toString();return!!(e.errorValues[g]||l(h))}t.isValidCode=i;function a(h){var g;if(typeof h=="number")return h;if(s(h))return(g=h.code)!==null&&g!==void 0?g:h.errorCode}t.getErrorCode=a;function s(h){return typeof h=="object"&&h!==null&&(typeof h.code=="number"||typeof h.errorCode=="number")}function o(h,{shouldIncludeStack:g=!1}={}){const m={};if(h&&typeof h=="object"&&!Array.isArray(h)&&u(h,"code")&&i(h.code)){const w=h;m.code=w.code,w.message&&typeof w.message=="string"?(m.message=w.message,u(w,"data")&&(m.data=w.data)):(m.message=n(m.code),m.data={originalError:c(h)})}else m.code=e.standardErrorCodes.rpc.internal,m.message=f(h,"message")?h.message:r,m.data={originalError:c(h)};return g&&(m.stack=f(h,"stack")?h.stack:void 0),m}t.serialize=o;function l(h){return h>=-32099&&h<=-32e3}function c(h){return h&&typeof h=="object"&&!Array.isArray(h)?Object.assign({},h):h}function u(h,g){return Object.prototype.hasOwnProperty.call(h,g)}function f(h,g){return typeof h=="object"&&h!==null&&g in h&&typeof h[g]=="string"}})(TL);Object.defineProperty(ix,"__esModule",{value:!0});ix.standardErrors=void 0;const ha=Gd,Bee=TL;ix.standardErrors={rpc:{parse:t=>Zo(ha.standardErrorCodes.rpc.parse,t),invalidRequest:t=>Zo(ha.standardErrorCodes.rpc.invalidRequest,t),invalidParams:t=>Zo(ha.standardErrorCodes.rpc.invalidParams,t),methodNotFound:t=>Zo(ha.standardErrorCodes.rpc.methodNotFound,t),internal:t=>Zo(ha.standardErrorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Zo(e,t)},invalidInput:t=>Zo(ha.standardErrorCodes.rpc.invalidInput,t),resourceNotFound:t=>Zo(ha.standardErrorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Zo(ha.standardErrorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Zo(ha.standardErrorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Zo(ha.standardErrorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Zo(ha.standardErrorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>yp(ha.standardErrorCodes.provider.userRejectedRequest,t),unauthorized:t=>yp(ha.standardErrorCodes.provider.unauthorized,t),unsupportedMethod:t=>yp(ha.standardErrorCodes.provider.unsupportedMethod,t),disconnected:t=>yp(ha.standardErrorCodes.provider.disconnected,t),chainDisconnected:t=>yp(ha.standardErrorCodes.provider.chainDisconnected,t),unsupportedChain:t=>yp(ha.standardErrorCodes.provider.unsupportedChain,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new Hee(e,r,n)}}};function Zo(t,e){const[r,n]=zee(e);return new Wee(t,r||(0,Bee.getMessageFromCode)(t),n)}function yp(t,e){const[r,n]=zee(e);return new Hee(t,r||(0,Bee.getMessageFromCode)(t),n)}function zee(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}class Wee extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}}class Hee extends Wee{constructor(e,r,n){if(!xTe(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}function xTe(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=void 0;var e=Gd;Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return e.standardErrorCodes}});var r=ix;Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}})})($u);var ax={},jm={};Object.defineProperty(jm,"__esModule",{value:!0});jm.isErrorResponse=void 0;function ETe(t){return t.errorMessage!==void 0}jm.isErrorResponse=ETe;var _1={};Object.defineProperty(_1,"__esModule",{value:!0});_1.LIB_VERSION=void 0;_1.LIB_VERSION="4.0.3";Object.defineProperty(ax,"__esModule",{value:!0});ax.serializeError=void 0;const _Te=jm,CTe=_1,STe=Gd,ATe=TL;function ITe(t,e){const r=(0,ATe.serialize)(MTe(t),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",CTe.LIB_VERSION),n.searchParams.set("code",r.code.toString());const i=TTe(r.data,e);return i&&n.searchParams.set("method",i),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ax.serializeError=ITe;function MTe(t){return typeof t=="string"?{message:t,code:STe.standardErrorCodes.rpc.internal}:(0,_Te.isErrorResponse)(t)?Object.assign(Object.assign({},t),{message:t.errorMessage,code:t.errorCode,data:{method:t.method}}):t}function TTe(t,e){const r=t==null?void 0:t.method;if(r)return r;if(e!==void 0){if(typeof e=="string")return e;if(Array.isArray(e)){if(e.length>0)return e[0].method}else return e.method}}var Pa={};Object.defineProperty(Pa,"__esModule",{value:!0});Pa.RegExpString=Pa.IntNumber=Pa.BigIntString=Pa.AddressString=Pa.HexString=Pa.OpaqueType=void 0;function Yw(){return t=>t}Pa.OpaqueType=Yw;Pa.HexString=Yw();Pa.AddressString=Yw();Pa.BigIntString=Yw();function kTe(t){return Math.floor(t)}Pa.IntNumber=kTe;Pa.RegExpString=Yw();var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.areAddressArraysEqual=Kt.getFavicon=Kt.range=Kt.isBigNumber=Kt.ensureParsedJSONObject=Kt.ensureBigInt=Kt.ensureRegExpString=Kt.ensureIntNumber=Kt.ensureBuffer=Kt.ensureAddressString=Kt.ensureEvenLengthHexString=Kt.ensureHexString=Kt.isHexString=Kt.prepend0x=Kt.strip0x=Kt.has0xPrefix=Kt.hexStringFromIntNumber=Kt.intNumberFromHexString=Kt.bigIntStringFromBigInt=Kt.hexStringFromBuffer=Kt.hexStringToUint8Array=Kt.uint8ArrayToHex=Kt.randomBytesHex=void 0;const C1=$u,pl=Pa,Gee=/^[0-9]*$/,qee=/^[a-f0-9]*$/;function NTe(t){return Vee(crypto.getRandomValues(new Uint8Array(t)))}Kt.randomBytesHex=NTe;function Vee(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}Kt.uint8ArrayToHex=Vee;function LTe(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Kt.hexStringToUint8Array=LTe;function jTe(t,e=!1){const r=t.toString("hex");return(0,pl.HexString)(e?`0x${r}`:r)}Kt.hexStringFromBuffer=jTe;function $Te(t){return(0,pl.BigIntString)(t.toString(10))}Kt.bigIntStringFromBigInt=$Te;function PTe(t){return(0,pl.IntNumber)(Number(BigInt(Jw(t,!0))))}Kt.intNumberFromHexString=PTe;function RTe(t){return(0,pl.HexString)(`0x${BigInt(t).toString(16)}`)}Kt.hexStringFromIntNumber=RTe;function kL(t){return t.startsWith("0x")||t.startsWith("0X")}Kt.has0xPrefix=kL;function sx(t){return kL(t)?t.slice(2):t}Kt.strip0x=sx;function Yee(t){return kL(t)?`0x${t.slice(2)}`:`0x${t}`}Kt.prepend0x=Yee;function Kw(t){if(typeof t!="string")return!1;const e=sx(t).toLowerCase();return qee.test(e)}Kt.isHexString=Kw;function Kee(t,e=!1){if(typeof t=="string"){const r=sx(t).toLowerCase();if(qee.test(r))return(0,pl.HexString)(e?`0x${r}`:r)}throw C1.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}Kt.ensureHexString=Kee;function Jw(t,e=!1){let r=Kee(t,!1);return r.length%2===1&&(r=(0,pl.HexString)(`0${r}`)),e?(0,pl.HexString)(`0x${r}`):r}Kt.ensureEvenLengthHexString=Jw;function DTe(t){if(typeof t=="string"){const e=sx(t).toLowerCase();if(Kw(e)&&e.length===40)return(0,pl.AddressString)(Yee(e))}throw C1.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}Kt.ensureAddressString=DTe;function OTe(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string"){if(Kw(t)){const e=Jw(t,!1);return Buffer.from(e,"hex")}return Buffer.from(t,"utf8")}throw C1.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}Kt.ensureBuffer=OTe;function Jee(t){if(typeof t=="number"&&Number.isInteger(t))return(0,pl.IntNumber)(t);if(typeof t=="string"){if(Gee.test(t))return(0,pl.IntNumber)(Number(t));if(Kw(t))return(0,pl.IntNumber)(Number(BigInt(Jw(t,!0))))}throw C1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Kt.ensureIntNumber=Jee;function FTe(t){if(t instanceof RegExp)return(0,pl.RegExpString)(t.toString());throw C1.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}Kt.ensureRegExpString=FTe;function UTe(t){if(t!==null&&(typeof t=="bigint"||Qee(t)))return BigInt(t.toString(10));if(typeof t=="number")return BigInt(Jee(t));if(typeof t=="string"){if(Gee.test(t))return BigInt(t);if(Kw(t))return BigInt(Jw(t,!0))}throw C1.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Kt.ensureBigInt=UTe;function BTe(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw C1.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}Kt.ensureParsedJSONObject=BTe;function Qee(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}Kt.isBigNumber=Qee;function zTe(t,e){return Array.from({length:e-t},(r,n)=>t+n)}Kt.range=zTe;function WTe(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}Kt.getFavicon=WTe;function HTe(t,e){return t.length===e.length&&t.every((r,n)=>r===e[n])}Kt.areAddressArraysEqual=HTe;var lu={},ox={},lx={},$i={};Object.defineProperty($i,"__esModule",{value:!0});$i.decryptContent=$i.encryptContent=$i.importKeyFromHexString=$i.exportKeyToHexString=$i.decrypt=$i.encrypt=$i.deriveSharedSecret=$i.generateKeyPair=void 0;const Zee=Kt;async function GTe(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}$i.generateKeyPair=GTe;async function qTe(t,e){return crypto.subtle.deriveKey({name:"ECDH",public:e},t,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}$i.deriveSharedSecret=qTe;async function Xee(t,e){const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},t,new TextEncoder().encode(e));return{iv:r,cipherText:n}}$i.encrypt=Xee;async function ete(t,{iv:e,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:e},t,r);return new TextDecoder().decode(n)}$i.decrypt=ete;function tte(t){switch(t){case"public":return"spki";case"private":return"pkcs8"}}async function VTe(t,e){const r=tte(t),n=await crypto.subtle.exportKey(r,e);return(0,Zee.uint8ArrayToHex)(new Uint8Array(n))}$i.exportKeyToHexString=VTe;async function YTe(t,e){const r=tte(t),n=(0,Zee.hexStringToUint8Array)(e).buffer;return await crypto.subtle.importKey(r,n,{name:"ECDH",namedCurve:"P-256"},!0,t==="private"?["deriveKey"]:[])}$i.importKeyFromHexString=YTe;async function KTe(t,e){const r=JSON.stringify(t,(n,i)=>{if(!(i instanceof Error))return i;const a=i;return Object.assign(Object.assign({},a.code?{code:a.code}:{}),{message:a.message})});return Xee(e,r)}$i.encryptContent=KTe;async function JTe(t,e){return JSON.parse(await ete(e,t))}$i.decryptContent=JTe;var Pu={};Object.defineProperty(Pu,"__esModule",{value:!0});Pu.ScopedLocalStorage=void 0;class Q5{constructor(e,r){this.scope=e,this.module=r}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;nlocalStorage.removeItem(n))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new Q5("CBWSDK").clear(),new Q5("walletlink").clear()}}Pu.ScopedLocalStorage=Q5;Object.defineProperty(lx,"__esModule",{value:!0});lx.SCWKeyManager=void 0;const I4=$i,QTe=Pu,HC={storageKey:"ownPrivateKey",keyType:"private"},GC={storageKey:"ownPublicKey",keyType:"public"},qC={storageKey:"peerPublicKey",keyType:"public"};class ZTe{constructor(){this.storage=new QTe.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(qC,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(GC.storageKey),this.storage.removeItem(HC.storageKey),this.storage.removeItem(qC.storageKey)}async generateKeyPair(){const e=await(0,I4.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(HC,e.privateKey),await this.storeKey(GC,e.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(HC)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(GC)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(qC)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,I4.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const r=this.storage.getItem(e.storageKey);return r?(0,I4.importKeyFromHexString)(e.keyType,r):null}async storeKey(e,r){const n=await(0,I4.exportKeyToHexString)(e.keyType,r);this.storage.setItem(e.storageKey,n)}}lx.SCWKeyManager=ZTe;var cx={};Object.defineProperty(cx,"__esModule",{value:!0});cx.SCWStateManager=void 0;const XTe=Pu,JU="accounts",QU="activeChain",ZU="availableChains",XU="walletCapabilities";class eke{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var r,n;this.storage=new XTe.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(ZU),this._walletCapabilities=this.loadItemFromStorage(XU);const i=this.loadItemFromStorage(JU),a=this.loadItemFromStorage(QU);i&&this.updateListener.onAccountsUpdate({accounts:i,source:"storage"}),a&&this.updateListener.onChainUpdate({chain:a,source:"storage"}),this._accounts=i||[],this._activeChain=a||{id:(n=(r=e.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(JU,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var r;const n=(r=this.availableChains)===null||r===void 0?void 0:r.find(i=>i.id===e);return n?(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(QU,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0):!1}updateAvailableChains(e){if(!e||Object.keys(e).length===0)return;const r=Object.entries(e).map(([n,i])=>({id:Number(n),rpcUrl:i}));this.availableChains=r,this.storeItemToStorage(ZU,r),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(XU,e)}storeItemToStorage(e,r){this.storage.setItem(e,JSON.stringify(r))}loadItemFromStorage(e){const r=this.storage.getItem(e);return r?JSON.parse(r):void 0}clear(){this.storage.clear()}}cx.SCWStateManager=eke;Object.defineProperty(ox,"__esModule",{value:!0});ox.SCWSigner=void 0;const tke=lx,rke=cx,M4=$u,eB=Kt,T4=$i;class nke{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new tke.SCWKeyManager,this.stateManager=new rke.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),r=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in r.content)throw r.content.failure;const n=await(0,T4.importKeyFromHexString)("public",r.sender);await this.keyManager.setPeerPublicKey(n);const i=await this.decryptResponseMessage(r);this.updateInternalState({method:"eth_requestAccounts"},i);const a=i.result;if("error"in a)throw a.error;return this.stateManager.accounts}async request(e){const r=this.tryLocalHandling(e);if(r!==void 0){if(r instanceof Error)throw r;return r}await this.communicator.waitForPopupLoaded();const n=await this.sendEncryptedRequest(e),i=await this.decryptResponseMessage(n);this.updateInternalState(e,i);const a=i.result;if("error"in a)throw a.error;return a.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var r;switch(e.method){case"wallet_switchEthereumChain":{const n=e.params;if(!n||!(!((r=n[0])===null||r===void 0)&&r.chainId))throw M4.standardErrors.rpc.invalidParams();const i=(0,eB.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(i)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw M4.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return n}default:return}}async sendEncryptedRequest(e){const r=await this.keyManager.getSharedSecret();if(!r)throw M4.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,T4.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},r),i=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(i)}async createRequestMessage(e){const r=await(0,T4.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:r,content:e,timestamp:new Date}}async decryptResponseMessage(e){const r=e.content;if("failure"in r)throw r.failure;const n=await this.keyManager.getSharedSecret();if(!n)throw M4.standardErrors.provider.unauthorized("Invalid session");return(0,T4.decryptContent)(r.encrypted,n)}updateInternalState(e,r){var n,i;const a=(n=r.data)===null||n===void 0?void 0:n.chains;a&&this.stateManager.updateAvailableChains(a);const s=(i=r.data)===null||i===void 0?void 0:i.capabilities;s&&this.stateManager.updateWalletCapabilities(s);const o=r.result;if(!("error"in o))switch(e.method){case"eth_requestAccounts":{const l=o.value;this.stateManager.updateAccounts(l);break}case"wallet_switchEthereumChain":{if(o.value!==null)return;const l=e.params,c=(0,eB.ensureIntNumber)(l[0].chainId);this.stateManager.switchChain(c);break}}}}ox.SCWSigner=nke;var ux={},RM={exports:{}},NL={exports:{}},yg=typeof Reflect=="object"?Reflect:null,tB=yg&&typeof yg.apply=="function"?yg.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},N6;yg&&typeof yg.ownKeys=="function"?N6=yg.ownKeys:Object.getOwnPropertySymbols?N6=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:N6=function(e){return Object.getOwnPropertyNames(e)};function ike(t){console&&console.warn&&console.warn(t)}var rte=Number.isNaN||function(e){return e!==e};function gn(){gn.init.call(this)}NL.exports=gn;NL.exports.once=lke;gn.EventEmitter=gn;gn.prototype._events=void 0;gn.prototype._eventsCount=0;gn.prototype._maxListeners=void 0;var rB=10;function dx(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(gn,"defaultMaxListeners",{enumerable:!0,get:function(){return rB},set:function(t){if(typeof t!="number"||t<0||rte(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");rB=t}});gn.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};gn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||rte(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function nte(t){return t._maxListeners===void 0?gn.defaultMaxListeners:t._maxListeners}gn.prototype.getMaxListeners=function(){return nte(this)};gn.prototype.emit=function(e){for(var r=[],n=1;n0&&(s=r[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var l=a[e];if(l===void 0)return!1;if(typeof l=="function")tB(l,this,r);else for(var c=l.length,u=lte(l,c),n=0;n0&&s.length>i&&!s.warned){s.warned=!0;var o=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=t,o.type=e,o.count=s.length,ike(o)}return t}gn.prototype.addListener=function(e,r){return ite(this,e,r,!1)};gn.prototype.on=gn.prototype.addListener;gn.prototype.prependListener=function(e,r){return ite(this,e,r,!0)};function ake(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function ate(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=ake.bind(n);return i.listener=r,n.wrapFn=i,i}gn.prototype.once=function(e,r){return dx(r),this.on(e,ate(this,e,r)),this};gn.prototype.prependOnceListener=function(e,r){return dx(r),this.prependListener(e,ate(this,e,r)),this};gn.prototype.removeListener=function(e,r){var n,i,a,s,o;if(dx(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(a=-1,s=n.length-1;s>=0;s--)if(n[s]===r||n[s].listener===r){o=n[s].listener,a=s;break}if(a<0)return this;a===0?n.shift():ske(n,a),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,o||r)}return this};gn.prototype.off=gn.prototype.removeListener;gn.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var a=Object.keys(n),s;for(i=0;i=0;i--)this.removeListener(e,r[i]);return this};function ste(t,e,r){var n=t._events;if(n===void 0)return[];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?oke(i):lte(i,i.length)}gn.prototype.listeners=function(e){return ste(this,e,!0)};gn.prototype.rawListeners=function(e){return ste(this,e,!1)};gn.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ote.call(t,e)};gn.prototype.listenerCount=ote;function ote(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}gn.prototype.eventNames=function(){return this._eventsCount>0?N6(this._events):[]};function lte(t,e){for(var r=new Array(e),n=0;n0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function fke(t){var e=dte(t),r=e[0],n=e[1];return(r+n)*3/4-n}function hke(t,e,r){return(e+r)*3/4-r}function pke(t){var e,r=dte(t),n=r[0],i=r[1],a=new uke(hke(t,n,i)),s=0,o=i>0?n-4:n,l;for(l=0;l>16&255,a[s++]=e>>8&255,a[s++]=e&255;return i===2&&(e=il[t.charCodeAt(l)]<<2|il[t.charCodeAt(l+1)]>>4,a[s++]=e&255),i===1&&(e=il[t.charCodeAt(l)]<<10|il[t.charCodeAt(l+1)]<<4|il[t.charCodeAt(l+2)]>>2,a[s++]=e>>8&255,a[s++]=e&255),a}function gke(t){return au[t>>18&63]+au[t>>12&63]+au[t>>6&63]+au[t&63]}function mke(t,e,r){for(var n,i=[],a=e;ao?o:s+a));return n===1?(e=t[r-1],i.push(au[e>>2]+au[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(au[e>>10]+au[e>>4&63]+au[e<<2&63]+"=")),i.join("")}var jL={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */jL.read=function(t,e,r,n,i){var a,s,o=i*8-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,g=t[e+f];for(f+=h,a=g&(1<<-u)-1,g>>=-u,u+=o;u>0;a=a*256+t[e+f],f+=h,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=s*256+t[e+f],f+=h,u-=8);if(a===0)a=1-c;else{if(a===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,n),a=a-c}return(g?-1:1)*s*Math.pow(2,a-n)};jL.write=function(t,e,r,n,i,a){var s,o,l,c=a*8-i-1,u=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:a-1,m=n?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=h/l:e+=h*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=u?(o=0,s=u):s+f>=1?(o=(e*l-1)*Math.pow(2,i),s=s+f):(o=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+g]=o&255,g+=m,o/=256,i-=8);for(s=s<0;t[r+g]=s&255,g+=m,s/=256,c-=8);t[r+g-m]|=w*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT - */(function(t){const e=nx,r=EL,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=b,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=a(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const K=new Uint8Array(1),F={foo:function(){return 42}};return Object.setPrototypeOf(F,Uint8Array.prototype),Object.setPrototypeOf(K,F),K.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(K){if(K>i)throw new RangeError('The value "'+K+'" is invalid for option "size"');const F=new Uint8Array(K);return Object.setPrototypeOf(F,o.prototype),F}function o(K,F,W){if(typeof K=="number"){if(typeof F=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(K)}return l(K,F,W)}o.poolSize=8192;function l(K,F,W){if(typeof K=="string")return h(K,F);if(ArrayBuffer.isView(K))return m(K);if(K==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K);if(qe(K,ArrayBuffer)||K&&qe(K.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(K,SharedArrayBuffer)||K&&qe(K.buffer,SharedArrayBuffer)))return w(K,F,W);if(typeof K=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=K.valueOf&&K.valueOf();if(ie!=null&&ie!==K)return o.from(ie,F,W);const pe=_(K);if(pe)return pe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof K[Symbol.toPrimitive]=="function")return o.from(K[Symbol.toPrimitive]("string"),F,W);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K)}o.from=function(K,F,W){return l(K,F,W)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function c(K){if(typeof K!="number")throw new TypeError('"size" argument must be of type number');if(K<0)throw new RangeError('The value "'+K+'" is invalid for option "size"')}function u(K,F,W){return c(K),K<=0?s(K):F!==void 0?typeof W=="string"?s(K).fill(F,W):s(K).fill(F):s(K)}o.alloc=function(K,F,W){return u(K,F,W)};function f(K){return c(K),s(K<0?0:v(K)|0)}o.allocUnsafe=function(K){return f(K)},o.allocUnsafeSlow=function(K){return f(K)};function h(K,F){if((typeof F!="string"||F==="")&&(F="utf8"),!o.isEncoding(F))throw new TypeError("Unknown encoding: "+F);const W=A(K,F)|0;let ie=s(W);const pe=ie.write(K,F);return pe!==W&&(ie=ie.slice(0,pe)),ie}function g(K){const F=K.length<0?0:v(K.length)|0,W=s(F);for(let ie=0;ie=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return K|0}function b(K){return+K!=K&&(K=0),o.alloc(+K)}o.isBuffer=function(F){return F!=null&&F._isBuffer===!0&&F!==o.prototype},o.compare=function(F,W){if(qe(F,Uint8Array)&&(F=o.from(F,F.offset,F.byteLength)),qe(W,Uint8Array)&&(W=o.from(W,W.offset,W.byteLength)),!o.isBuffer(F)||!o.isBuffer(W))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(F===W)return 0;let ie=F.length,pe=W.length;for(let we=0,he=Math.min(ie,pe);wepe.length?(o.isBuffer(he)||(he=o.from(he)),he.copy(pe,we)):Uint8Array.prototype.set.call(pe,he,we);else if(o.isBuffer(he))he.copy(pe,we);else throw new TypeError('"list" argument must be an Array of Buffers');we+=he.length}return pe};function A(K,F){if(o.isBuffer(K))return K.length;if(ArrayBuffer.isView(K)||qe(K,ArrayBuffer))return K.byteLength;if(typeof K!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof K);const W=K.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&W===0)return 0;let pe=!1;for(;;)switch(F){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return Ue(K).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W*2;case"hex":return W>>>1;case"base64":return Ee(K).length;default:if(pe)return ie?-1:Ue(K).length;F=(""+F).toLowerCase(),pe=!0}}o.byteLength=A;function S(K,F,W){let ie=!1;if((F===void 0||F<0)&&(F=0),F>this.length||((W===void 0||W>this.length)&&(W=this.length),W<=0)||(W>>>=0,F>>>=0,W<=F))return"";for(K||(K="utf8");;)switch(K){case"hex":return R(this,F,W);case"utf8":case"utf-8":return x(this,F,W);case"ascii":return O(this,F,W);case"latin1":case"binary":return P(this,F,W);case"base64":return k(this,F,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,F,W);default:if(ie)throw new TypeError("Unknown encoding: "+K);K=(K+"").toLowerCase(),ie=!0}}o.prototype._isBuffer=!0;function j(K,F,W){const ie=K[F];K[F]=K[W],K[W]=ie}o.prototype.swap16=function(){const F=this.length;if(F%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let W=0;WW&&(F+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(F,W,ie,pe,we){if(qe(F,Uint8Array)&&(F=o.from(F,F.offset,F.byteLength)),!o.isBuffer(F))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof F);if(W===void 0&&(W=0),ie===void 0&&(ie=F?F.length:0),pe===void 0&&(pe=0),we===void 0&&(we=this.length),W<0||ie>F.length||pe<0||we>this.length)throw new RangeError("out of range index");if(pe>=we&&W>=ie)return 0;if(pe>=we)return-1;if(W>=ie)return 1;if(W>>>=0,ie>>>=0,pe>>>=0,we>>>=0,this===F)return 0;let he=we-pe,De=ie-W;const Je=Math.min(he,De),et=this.slice(pe,we),it=F.slice(W,ie);for(let ut=0;ut2147483647?W=2147483647:W<-2147483648&&(W=-2147483648),W=+W,Ie(W)&&(W=pe?0:K.length-1),W<0&&(W=K.length+W),W>=K.length){if(pe)return-1;W=K.length-1}else if(W<0)if(pe)W=0;else return-1;if(typeof F=="string"&&(F=o.from(F,ie)),o.isBuffer(F))return F.length===0?-1:I(K,F,W,ie,pe);if(typeof F=="number")return F=F&255,typeof Uint8Array.prototype.indexOf=="function"?pe?Uint8Array.prototype.indexOf.call(K,F,W):Uint8Array.prototype.lastIndexOf.call(K,F,W):I(K,[F],W,ie,pe);throw new TypeError("val must be string, number or Buffer")}function I(K,F,W,ie,pe){let we=1,he=K.length,De=F.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(K.length<2||F.length<2)return-1;we=2,he/=2,De/=2,W/=2}function Je(it,ut){return we===1?it[ut]:it.readUInt16BE(ut*we)}let et;if(pe){let it=-1;for(et=W;ethe&&(W=he-De),et=W;et>=0;et--){let it=!0;for(let ut=0;utpe&&(ie=pe)):ie=pe;const we=F.length;ie>we/2&&(ie=we/2);let he;for(he=0;he>>0,isFinite(ie)?(ie=ie>>>0,pe===void 0&&(pe="utf8")):(pe=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const we=this.length-W;if((ie===void 0||ie>we)&&(ie=we),F.length>0&&(ie<0||W<0)||W>this.length)throw new RangeError("Attempt to write outside buffer bounds");pe||(pe="utf8");let he=!1;for(;;)switch(pe){case"hex":return B(this,F,W,ie);case"utf8":case"utf-8":return V(this,F,W,ie);case"ascii":case"latin1":case"binary":return se(this,F,W,ie);case"base64":return Y(this,F,W,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,F,W,ie);default:if(he)throw new TypeError("Unknown encoding: "+pe);pe=(""+pe).toLowerCase(),he=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(K,F,W){return F===0&&W===K.length?e.fromByteArray(K):e.fromByteArray(K.slice(F,W))}function x(K,F,W){W=Math.min(K.length,W);const ie=[];let pe=F;for(;pe239?4:we>223?3:we>191?2:1;if(pe+De<=W){let Je,et,it,ut;switch(De){case 1:we<128&&(he=we);break;case 2:Je=K[pe+1],(Je&192)===128&&(ut=(we&31)<<6|Je&63,ut>127&&(he=ut));break;case 3:Je=K[pe+1],et=K[pe+2],(Je&192)===128&&(et&192)===128&&(ut=(we&15)<<12|(Je&63)<<6|et&63,ut>2047&&(ut<55296||ut>57343)&&(he=ut));break;case 4:Je=K[pe+1],et=K[pe+2],it=K[pe+3],(Je&192)===128&&(et&192)===128&&(it&192)===128&&(ut=(we&15)<<18|(Je&63)<<12|(et&63)<<6|it&63,ut>65535&&ut<1114112&&(he=ut))}}he===null?(he=65533,De=1):he>65535&&(he-=65536,ie.push(he>>>10&1023|55296),he=56320|he&1023),ie.push(he),pe+=De}return L(ie)}const E=4096;function L(K){const F=K.length;if(F<=E)return String.fromCharCode.apply(String,K);let W="",ie=0;for(;ieie)&&(W=ie);let pe="";for(let we=F;weie&&(F=ie),W<0?(W+=ie,W<0&&(W=0)):W>ie&&(W=ie),WW)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(F,W,ie){F=F>>>0,W=W>>>0,ie||D(F,W,this.length);let pe=this[F],we=1,he=0;for(;++he>>0,W=W>>>0,ie||D(F,W,this.length);let pe=this[F+--W],we=1;for(;W>0&&(we*=256);)pe+=this[F+--W]*we;return pe},o.prototype.readUint8=o.prototype.readUInt8=function(F,W){return F=F>>>0,W||D(F,1,this.length),this[F]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(F,W){return F=F>>>0,W||D(F,2,this.length),this[F]|this[F+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(F,W){return F=F>>>0,W||D(F,2,this.length),this[F]<<8|this[F+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(F,W){return F=F>>>0,W||D(F,4,this.length),(this[F]|this[F+1]<<8|this[F+2]<<16)+this[F+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(F,W){return F=F>>>0,W||D(F,4,this.length),this[F]*16777216+(this[F+1]<<16|this[F+2]<<8|this[F+3])},o.prototype.readBigUInt64LE=Pe(function(F){F=F>>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=W+this[++F]*2**8+this[++F]*2**16+this[++F]*2**24,we=this[++F]+this[++F]*2**8+this[++F]*2**16+ie*2**24;return BigInt(pe)+(BigInt(we)<>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=W*2**24+this[++F]*2**16+this[++F]*2**8+this[++F],we=this[++F]*2**24+this[++F]*2**16+this[++F]*2**8+ie;return(BigInt(pe)<>>0,W=W>>>0,ie||D(F,W,this.length);let pe=this[F],we=1,he=0;for(;++he=we&&(pe-=Math.pow(2,8*W)),pe},o.prototype.readIntBE=function(F,W,ie){F=F>>>0,W=W>>>0,ie||D(F,W,this.length);let pe=W,we=1,he=this[F+--pe];for(;pe>0&&(we*=256);)he+=this[F+--pe]*we;return we*=128,he>=we&&(he-=Math.pow(2,8*W)),he},o.prototype.readInt8=function(F,W){return F=F>>>0,W||D(F,1,this.length),this[F]&128?(255-this[F]+1)*-1:this[F]},o.prototype.readInt16LE=function(F,W){F=F>>>0,W||D(F,2,this.length);const ie=this[F]|this[F+1]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt16BE=function(F,W){F=F>>>0,W||D(F,2,this.length);const ie=this[F+1]|this[F]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt32LE=function(F,W){return F=F>>>0,W||D(F,4,this.length),this[F]|this[F+1]<<8|this[F+2]<<16|this[F+3]<<24},o.prototype.readInt32BE=function(F,W){return F=F>>>0,W||D(F,4,this.length),this[F]<<24|this[F+1]<<16|this[F+2]<<8|this[F+3]},o.prototype.readBigInt64LE=Pe(function(F){F=F>>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=this[F+4]+this[F+5]*2**8+this[F+6]*2**16+(ie<<24);return(BigInt(pe)<>>0,me(F,"offset");const W=this[F],ie=this[F+7];(W===void 0||ie===void 0)&&be(F,this.length-8);const pe=(W<<24)+this[++F]*2**16+this[++F]*2**8+this[++F];return(BigInt(pe)<>>0,W||D(F,4,this.length),r.read(this,F,!0,23,4)},o.prototype.readFloatBE=function(F,W){return F=F>>>0,W||D(F,4,this.length),r.read(this,F,!1,23,4)},o.prototype.readDoubleLE=function(F,W){return F=F>>>0,W||D(F,8,this.length),r.read(this,F,!0,52,8)},o.prototype.readDoubleBE=function(F,W){return F=F>>>0,W||D(F,8,this.length),r.read(this,F,!1,52,8)};function $(K,F,W,ie,pe,we){if(!o.isBuffer(K))throw new TypeError('"buffer" argument must be a Buffer instance');if(F>pe||FK.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(F,W,ie,pe){if(F=+F,W=W>>>0,ie=ie>>>0,!pe){const De=Math.pow(2,8*ie)-1;$(this,F,W,ie,De,0)}let we=1,he=0;for(this[W]=F&255;++he>>0,ie=ie>>>0,!pe){const De=Math.pow(2,8*ie)-1;$(this,F,W,ie,De,0)}let we=ie-1,he=1;for(this[W+we]=F&255;--we>=0&&(he*=256);)this[W+we]=F/he&255;return W+ie},o.prototype.writeUint8=o.prototype.writeUInt8=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,1,255,0),this[W]=F&255,W+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,65535,0),this[W]=F&255,this[W+1]=F>>>8,W+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,65535,0),this[W]=F>>>8,this[W+1]=F&255,W+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,4294967295,0),this[W+3]=F>>>24,this[W+2]=F>>>16,this[W+1]=F>>>8,this[W]=F&255,W+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,4294967295,0),this[W]=F>>>24,this[W+1]=F>>>16,this[W+2]=F>>>8,this[W+3]=F&255,W+4};function X(K,F,W,ie,pe){Z(F,ie,pe,K,W,7);let we=Number(F&BigInt(4294967295));K[W++]=we,we=we>>8,K[W++]=we,we=we>>8,K[W++]=we,we=we>>8,K[W++]=we;let he=Number(F>>BigInt(32)&BigInt(4294967295));return K[W++]=he,he=he>>8,K[W++]=he,he=he>>8,K[W++]=he,he=he>>8,K[W++]=he,W}function le(K,F,W,ie,pe){Z(F,ie,pe,K,W,7);let we=Number(F&BigInt(4294967295));K[W+7]=we,we=we>>8,K[W+6]=we,we=we>>8,K[W+5]=we,we=we>>8,K[W+4]=we;let he=Number(F>>BigInt(32)&BigInt(4294967295));return K[W+3]=he,he=he>>8,K[W+2]=he,he=he>>8,K[W+1]=he,he=he>>8,K[W]=he,W+8}o.prototype.writeBigUInt64LE=Pe(function(F,W=0){return X(this,F,W,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Pe(function(F,W=0){return le(this,F,W,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(F,W,ie,pe){if(F=+F,W=W>>>0,!pe){const Je=Math.pow(2,8*ie-1);$(this,F,W,ie,Je-1,-Je)}let we=0,he=1,De=0;for(this[W]=F&255;++we>0)-De&255;return W+ie},o.prototype.writeIntBE=function(F,W,ie,pe){if(F=+F,W=W>>>0,!pe){const Je=Math.pow(2,8*ie-1);$(this,F,W,ie,Je-1,-Je)}let we=ie-1,he=1,De=0;for(this[W+we]=F&255;--we>=0&&(he*=256);)F<0&&De===0&&this[W+we+1]!==0&&(De=1),this[W+we]=(F/he>>0)-De&255;return W+ie},o.prototype.writeInt8=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,1,127,-128),F<0&&(F=255+F+1),this[W]=F&255,W+1},o.prototype.writeInt16LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,32767,-32768),this[W]=F&255,this[W+1]=F>>>8,W+2},o.prototype.writeInt16BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,2,32767,-32768),this[W]=F>>>8,this[W+1]=F&255,W+2},o.prototype.writeInt32LE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,2147483647,-2147483648),this[W]=F&255,this[W+1]=F>>>8,this[W+2]=F>>>16,this[W+3]=F>>>24,W+4},o.prototype.writeInt32BE=function(F,W,ie){return F=+F,W=W>>>0,ie||$(this,F,W,4,2147483647,-2147483648),F<0&&(F=4294967295+F+1),this[W]=F>>>24,this[W+1]=F>>>16,this[W+2]=F>>>8,this[W+3]=F&255,W+4},o.prototype.writeBigInt64LE=Pe(function(F,W=0){return X(this,F,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Pe(function(F,W=0){return le(this,F,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(K,F,W,ie,pe,we){if(W+ie>K.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("Index out of range")}function ee(K,F,W,ie,pe){return F=+F,W=W>>>0,pe||H(K,F,W,4),r.write(K,F,W,ie,23,4),W+4}o.prototype.writeFloatLE=function(F,W,ie){return ee(this,F,W,!0,ie)},o.prototype.writeFloatBE=function(F,W,ie){return ee(this,F,W,!1,ie)};function J(K,F,W,ie,pe){return F=+F,W=W>>>0,pe||H(K,F,W,8),r.write(K,F,W,ie,52,8),W+8}o.prototype.writeDoubleLE=function(F,W,ie){return J(this,F,W,!0,ie)},o.prototype.writeDoubleBE=function(F,W,ie){return J(this,F,W,!1,ie)},o.prototype.copy=function(F,W,ie,pe){if(!o.isBuffer(F))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!pe&&pe!==0&&(pe=this.length),W>=F.length&&(W=F.length),W||(W=0),pe>0&&pe=this.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("sourceEnd out of bounds");pe>this.length&&(pe=this.length),F.length-W>>0,ie=ie===void 0?this.length:ie>>>0,F||(F=0);let we;if(typeof F=="number")for(we=W;we2**32?pe=z(String(W)):typeof W=="bigint"&&(pe=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(pe=z(pe)),pe+="n"),ie+=` It must be ${F}. Received ${pe}`,ie},RangeError);function z(K){let F="",W=K.length;const ie=K[0]==="-"?1:0;for(;W>=ie+4;W-=3)F=`_${K.slice(W-3,W)}${F}`;return`${K.slice(0,W)}${F}`}function G(K,F,W){me(F,"offset"),(K[F]===void 0||K[F+W]===void 0)&&be(F,K.length-(W+1))}function Z(K,F,W,ie,pe,we){if(K>W||K= 0${he} and < 2${he} ** ${(we+1)*8}${he}`:De=`>= -(2${he} ** ${(we+1)*8-1}${he}) and < 2 ** ${(we+1)*8-1}${he}`,new te.ERR_OUT_OF_RANGE("value",De,K)}G(ie,pe,we)}function me(K,F){if(typeof K!="number")throw new te.ERR_INVALID_ARG_TYPE(F,"number",K)}function be(K,F,W){throw Math.floor(K)!==K?(me(K,W),new te.ERR_OUT_OF_RANGE("offset","an integer",K)):F<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${F}`,K)}const Ce=/[^+/0-9A-Za-z-_]/g;function Fe(K){if(K=K.split("=")[0],K=K.trim().replace(Ce,""),K.length<2)return"";for(;K.length%4!==0;)K=K+"=";return K}function Ue(K,F){F=F||1/0;let W;const ie=K.length;let pe=null;const we=[];for(let he=0;he55295&&W<57344){if(!pe){if(W>56319){(F-=3)>-1&&we.push(239,191,189);continue}else if(he+1===ie){(F-=3)>-1&&we.push(239,191,189);continue}pe=W;continue}if(W<56320){(F-=3)>-1&&we.push(239,191,189),pe=W;continue}W=(pe-55296<<10|W-56320)+65536}else pe&&(F-=3)>-1&&we.push(239,191,189);if(pe=null,W<128){if((F-=1)<0)break;we.push(W)}else if(W<2048){if((F-=2)<0)break;we.push(W>>6|192,W&63|128)}else if(W<65536){if((F-=3)<0)break;we.push(W>>12|224,W>>6&63|128,W&63|128)}else if(W<1114112){if((F-=4)<0)break;we.push(W>>18|240,W>>12&63|128,W>>6&63|128,W&63|128)}else throw new Error("Invalid code point")}return we}function Ke(K){const F=[];for(let W=0;W>8,pe=W%256,we.push(pe),we.push(ie);return we}function Ee(K){return e.toByteArray(Fe(K))}function He(K,F,W,ie){let pe;for(pe=0;pe=F.length||pe>=K.length);++pe)F[pe+W]=K[pe];return pe}function qe(K,F){return K instanceof F||K!=null&&K.constructor!=null&&K.constructor.name!=null&&K.constructor.name===F.name}function Ie(K){return K!==K}const Ne=function(){const K="0123456789abcdef",F=new Array(256);for(let W=0;W<16;++W){const ie=W*16;for(let pe=0;pe<16;++pe)F[ie+pe]=K[W]+K[pe]}return F}();function Pe(K){return typeof BigInt>"u"?$e:K}function $e(){throw new Error("BigInt not supported")}})(Ww);var FC,HU;function VTe(){if(HU)return FC;HU=1;function t(m,w){var _=Object.keys(m);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(m);w&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(m,b).enumerable})),_.push.apply(_,v)}return _}function e(m){for(var w=1;w0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(_){var v={data:_,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var _=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,_}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(_){if(this.length===0)return"";for(var v=this.head,b=""+v.data;v=v.next;)b+=_+v.data;return b}},{key:"concat",value:function(_){if(this.length===0)return c.alloc(0);for(var v=c.allocUnsafe(_>>>0),b=this.head,A=0;b;)g(b.data,v,A),A+=b.data.length,b=b.next;return v}},{key:"consume",value:function(_,v){var b;return _S.length?S.length:_;if(j===S.length?A+=S:A+=S.slice(0,_),_-=j,_===0){j===S.length?(++b,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=S.slice(j));break}++b}return this.length-=b,A}},{key:"_getBuffer",value:function(_){var v=c.allocUnsafe(_),b=this.head,A=1;for(b.data.copy(v),_-=b.data.length;b=b.next;){var S=b.data,j=_>S.length?S.length:_;if(S.copy(v,v.length-_,0,j),_-=j,_===0){j===S.length?(++A,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=S.slice(j));break}++A}return this.length-=A,v}},{key:h,value:function(_,v){return f(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),m}(),FC}function YTe(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(AM,this,t)):process.nextTick(AM,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(a){!e&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(_6,r):(r._writableState.errorEmitted=!0,process.nextTick(GU,r,a)):process.nextTick(GU,r,a):e?(process.nextTick(_6,r),e(a)):process.nextTick(_6,r)}),this)}function GU(t,e){AM(t,e),_6(t)}function _6(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function KTe(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function AM(t,e){t.emit("error",e)}function JTe(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var Hee={destroy:YTe,undestroy:KTe,errorOrDestroy:JTe},w1={};function ZTe(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Gee={};function El(t,e,r){r||(r=Error);function n(a,s,o){return typeof e=="string"?e:e(a,s,o)}var i=function(a){ZTe(s,a);function s(o,l,c){return a.call(this,n(o,l,c))||this}return s}(r);i.prototype.name=r.name,i.prototype.code=t,Gee[t]=i}function qU(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function QTe(t,e,r){return t.substr(0,e.length)===e}function XTe(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function eke(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}El("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);El("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&QTe(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(XTe(t," argument"))i="The ".concat(t," ").concat(n," ").concat(qU(e,"type"));else{var a=eke(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(a," ").concat(n," ").concat(qU(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);El("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");El("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});El("ERR_STREAM_PREMATURE_CLOSE","Premature close");El("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});El("ERR_MULTIPLE_CALLBACK","Callback called multiple times");El("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");El("ERR_STREAM_WRITE_AFTER_END","write after end");El("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);El("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);El("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");w1.codes=Gee;var tke=w1.codes.ERR_INVALID_OPT_VALUE;function rke(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function nke(t,e,r,n){var i=rke(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new tke(a,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var qee={getHighWaterMark:nke},ike=ake;function ake(t,e){if(UC("noDeprecation"))return t;var r=!1;function n(){if(!r){if(UC("throwDeprecation"))throw new Error(e);UC("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function UC(t){try{if(!Xt.localStorage)return!1}catch{return!1}var e=Xt.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var BC,VU;function Vee(){if(VU)return BC;VU=1,BC=B;function t(ee){var J=this;this.next=null,this.entry=null,this.finish=function(){H(J,ee)}}var e;B.WritableState=U;var r={deprecate:ike},n=zee,i=Ww.Buffer,a=(typeof Xt<"u"?Xt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(ee){return i.from(ee)}function o(ee){return i.isBuffer(ee)||ee instanceof a}var l=Hee,c=qee,u=c.getHighWaterMark,f=w1.codes,h=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,w=f.ERR_STREAM_CANNOT_PIPE,_=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,A=f.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;hs(B,n);function j(){}function U(ee,J,te){e=e||Dg(),ee=ee||{},typeof te!="boolean"&&(te=J instanceof e),this.objectMode=!!ee.objectMode,te&&(this.objectMode=this.objectMode||!!ee.writableObjectMode),this.highWaterMark=u(this,ee,"writableHighWaterMark",te),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var re=ee.decodeStrings===!1;this.decodeStrings=!re,this.defaultEncoding=ee.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){L(J,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ee.emitClose!==!1,this.autoDestroy=!!ee.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}U.prototype.getBuffer=function(){for(var J=this.bufferedRequest,te=[];J;)te.push(J),J=J.next;return te},function(){try{Object.defineProperty(U.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(J){return I.call(this,J)?!0:this!==B?!1:J&&J._writableState instanceof U}})):I=function(J){return J instanceof this};function B(ee){e=e||Dg();var J=this instanceof e;if(!J&&!I.call(B,this))return new B(ee);this._writableState=new U(ee,this,J),this.writable=!0,ee&&(typeof ee.write=="function"&&(this._write=ee.write),typeof ee.writev=="function"&&(this._writev=ee.writev),typeof ee.destroy=="function"&&(this._destroy=ee.destroy),typeof ee.final=="function"&&(this._final=ee.final)),n.call(this)}B.prototype.pipe=function(){S(this,new w)};function V(ee,J){var te=new b;S(ee,te),process.nextTick(J,te)}function se(ee,J,te,re){var z;return te===null?z=new v:typeof te!="string"&&!J.objectMode&&(z=new h("chunk",["string","Buffer"],te)),z?(S(ee,z),process.nextTick(re,z),!1):!0}B.prototype.write=function(ee,J,te){var re=this._writableState,z=!1,G=!re.objectMode&&o(ee);return G&&!i.isBuffer(ee)&&(ee=s(ee)),typeof J=="function"&&(te=J,J=null),G?J="buffer":J||(J=re.defaultEncoding),typeof te!="function"&&(te=j),re.ending?V(this,te):(G||se(this,re,ee,te))&&(re.pendingcb++,z=N(this,re,G,ee,J,te)),z},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&R(this,ee))},B.prototype.setDefaultEncoding=function(J){if(typeof J=="string"&&(J=J.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((J+"").toLowerCase())>-1))throw new A(J);return this._writableState.defaultEncoding=J,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Y(ee,J,te){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof J=="string"&&(J=i.from(J,te)),J}Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(ee,J,te,re,z,G){if(!te){var Z=Y(J,re,z);re!==Z&&(te=!0,z="buffer",re=Z)}var me=J.objectMode?1:re.length;J.length+=me;var be=J.length */(function(t,e){var r=Ww,n=r.Buffer;function i(s,o){for(var l in s)o[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=a);function a(s,o,l){return n(s,o,l)}a.prototype=Object.create(n.prototype),i(n,a),a.from=function(s,o,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,o,l)},a.alloc=function(s,o,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=n(s);return o!==void 0?typeof l=="string"?c.fill(o,l):c.fill(o):c.fill(0),c},a.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},a.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}})(IM,IM.exports);var bh=IM.exports,KU;function JU(){if(KU)return WC;KU=1;var t=bh.Buffer,e=t.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(v){if(!v)return"utf8";for(var b;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(b)return;v=(""+v).toLowerCase(),b=!0}}function n(v){var b=r(v);if(typeof b!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return b||v}WC.StringDecoder=i;function i(v){this.encoding=n(v);var b;switch(this.encoding){case"utf16le":this.text=f,this.end=h,b=4;break;case"utf8":this.fillLast=l,b=4;break;case"base64":this.text=g,this.end=m,b=3;break;default:this.write=w,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(b)}i.prototype.write=function(v){if(v.length===0)return"";var b,A;if(this.lastNeed){if(b=this.fillLast(v),b===void 0)return"";A=this.lastNeed,this.lastNeed=0}else A=0;return A>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,b,A){var S=b.length-1;if(S=0?(j>0&&(v.lastNeed=j-1),j):--S=0?(j>0&&(v.lastNeed=j-2),j):--S=0?(j>0&&(j===2?j=0:v.lastNeed=j-3),j):0))}function o(v,b,A){if((b[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&b.length>1){if((b[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&b.length>2&&(b[2]&192)!==128)return v.lastNeed=2,"�"}}function l(v){var b=this.lastTotal-this.lastNeed,A=o(this,v);if(A!==void 0)return A;if(this.lastNeed<=v.length)return v.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,b,0,v.length),this.lastNeed-=v.length}function c(v,b){var A=s(this,v,b);if(!this.lastNeed)return v.toString("utf8",b);this.lastTotal=A;var S=v.length-(A-this.lastNeed);return v.copy(this.lastChar,0,S),v.toString("utf8",b,S)}function u(v){var b=v&&v.length?this.write(v):"";return this.lastNeed?b+"�":b}function f(v,b){if((v.length-b)%2===0){var A=v.toString("utf16le",b);if(A){var S=A.charCodeAt(A.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",b,v.length-1)}function h(v){var b=v&&v.length?this.write(v):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,A)}return b}function g(v,b){var A=(v.length-b)%3;return A===0?v.toString("base64",b):(this.lastNeed=3-A,this.lastTotal=3,A===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",b,v.length-A))}function m(v){var b=v&&v.length?this.write(v):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function w(v){return v.toString(this.encoding)}function _(v){return v&&v.length?this.write(v):""}return WC}var ZU=w1.codes.ERR_STREAM_PREMATURE_CLOSE;function ske(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof Z!="string"&&!Fe.objectMode&&Object.getPrototypeOf(Z)!==n.prototype&&(Z=a(Z)),be)Fe.endEmitted?j(G,new v):Y(G,Fe,Z,!0);else if(Fe.ended)j(G,new w);else{if(Fe.destroyed)return!1;Fe.reading=!1,Fe.decoder&&!me?(Z=Fe.decoder.write(Z),Fe.objectMode||Z.length!==0?Y(G,Fe,Z,!1):R(G,Fe)):Y(G,Fe,Z,!1)}else be||(Fe.reading=!1,R(G,Fe))}return!Fe.ended&&(Fe.length=k?G=k:(G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++),G}function E(G,Z){return G<=0||Z.length===0&&Z.ended?0:Z.objectMode?1:G!==G?Z.flowing&&Z.length?Z.buffer.head.data.length:Z.length:(G>Z.highWaterMark&&(Z.highWaterMark=x(G)),G<=Z.length?G:Z.ended?Z.length:(Z.needReadable=!0,0))}V.prototype.read=function(G){l("read",G),G=parseInt(G,10);var Z=this._readableState,me=G;if(G!==0&&(Z.emittedReadable=!1),G===0&&Z.needReadable&&((Z.highWaterMark!==0?Z.length>=Z.highWaterMark:Z.length>0)||Z.ended))return l("read: emitReadable",Z.length,Z.ended),Z.length===0&&Z.ended?te(this):O(this),null;if(G=E(G,Z),G===0&&Z.ended)return Z.length===0&&te(this),null;var be=Z.needReadable;l("need readable",be),(Z.length===0||Z.length-G0?Ce=J(G,Z):Ce=null,Ce===null?(Z.needReadable=Z.length<=Z.highWaterMark,G=0):(Z.length-=G,Z.awaitDrain=0),Z.length===0&&(Z.ended||(Z.needReadable=!0),me!==G&&Z.ended&&te(this)),Ce!==null&&this.emit("data",Ce),Ce};function L(G,Z){if(l("onEofChunk"),!Z.ended){if(Z.decoder){var me=Z.decoder.end();me&&me.length&&(Z.buffer.push(me),Z.length+=Z.objectMode?1:me.length)}Z.ended=!0,Z.sync?O(G):(Z.needReadable=!1,Z.emittedReadable||(Z.emittedReadable=!0,P(G)))}}function O(G){var Z=G._readableState;l("emitReadable",Z.needReadable,Z.emittedReadable),Z.needReadable=!1,Z.emittedReadable||(l("emitReadable",Z.flowing),Z.emittedReadable=!0,process.nextTick(P,G))}function P(G){var Z=G._readableState;l("emitReadable_",Z.destroyed,Z.length,Z.ended),!Z.destroyed&&(Z.length||Z.ended)&&(G.emit("readable"),Z.emittedReadable=!1),Z.needReadable=!Z.flowing&&!Z.ended&&Z.length<=Z.highWaterMark,ee(G)}function R(G,Z){Z.readingMore||(Z.readingMore=!0,process.nextTick(M,G,Z))}function M(G,Z){for(;!Z.reading&&!Z.ended&&(Z.length1&&z(be.pipes,G)!==-1)&&!Ee&&(l("false write response, pause",be.awaitDrain),be.awaitDrain++),me.pause())}function Ie(K){l("onerror",K),$e(),G.removeListener("error",Ie),e(G,"error")===0&&j(G,K)}I(G,"error",Ie);function Ne(){G.removeListener("finish",Pe),$e()}G.once("close",Ne);function Pe(){l("onfinish"),G.removeListener("close",Ne),$e()}G.once("finish",Pe);function $e(){l("unpipe"),me.unpipe(G)}return G.emit("pipe",me),be.flowing||(l("pipe resume"),me.resume()),G};function D(G){return function(){var me=G._readableState;l("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&e(G,"data")&&(me.flowing=!0,ee(G))}}V.prototype.unpipe=function(G){var Z=this._readableState,me={hasUnpiped:!1};if(Z.pipesCount===0)return this;if(Z.pipesCount===1)return G&&G!==Z.pipes?this:(G||(G=Z.pipes),Z.pipes=null,Z.pipesCount=0,Z.flowing=!1,G&&G.emit("unpipe",this,me),this);if(!G){var be=Z.pipes,Ce=Z.pipesCount;Z.pipes=null,Z.pipesCount=0,Z.flowing=!1;for(var Fe=0;Fe0,be.flowing!==!1&&this.resume()):G==="readable"&&!be.endEmitted&&!be.readableListening&&(be.readableListening=be.needReadable=!0,be.flowing=!1,be.emittedReadable=!1,l("on readable",be.length,be.reading),be.length?O(this):be.reading||process.nextTick(X,this)),me},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(G,Z){var me=r.prototype.removeListener.call(this,G,Z);return G==="readable"&&process.nextTick($,this),me},V.prototype.removeAllListeners=function(G){var Z=r.prototype.removeAllListeners.apply(this,arguments);return(G==="readable"||G===void 0)&&process.nextTick($,this),Z};function $(G){var Z=G._readableState;Z.readableListening=G.listenerCount("readable")>0,Z.resumeScheduled&&!Z.paused?Z.flowing=!0:G.listenerCount("data")>0&&G.resume()}function X(G){l("readable nexttick read 0"),G.read(0)}V.prototype.resume=function(){var G=this._readableState;return G.flowing||(l("resume"),G.flowing=!G.readableListening,le(this,G)),G.paused=!1,this};function le(G,Z){Z.resumeScheduled||(Z.resumeScheduled=!0,process.nextTick(H,G,Z))}function H(G,Z){l("resume",Z.reading),Z.reading||G.read(0),Z.resumeScheduled=!1,G.emit("resume"),ee(G),Z.flowing&&!Z.reading&&G.read(0)}V.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ee(G){var Z=G._readableState;for(l("flow",Z.flowing);Z.flowing&&G.read()!==null;);}V.prototype.wrap=function(G){var Z=this,me=this._readableState,be=!1;G.on("end",function(){if(l("wrapped end"),me.decoder&&!me.ended){var Ue=me.decoder.end();Ue&&Ue.length&&Z.push(Ue)}Z.push(null)}),G.on("data",function(Ue){if(l("wrapped data"),me.decoder&&(Ue=me.decoder.write(Ue)),!(me.objectMode&&Ue==null)&&!(!me.objectMode&&(!Ue||!Ue.length))){var Ke=Z.push(Ue);Ke||(be=!0,G.pause())}});for(var Ce in G)this[Ce]===void 0&&typeof G[Ce]=="function"&&(this[Ce]=function(Ke){return function(){return G[Ke].apply(G,arguments)}}(Ce));for(var Fe=0;Fe=Z.length?(Z.decoder?me=Z.buffer.join(""):Z.buffer.length===1?me=Z.buffer.first():me=Z.buffer.concat(Z.length),Z.buffer.clear()):me=Z.buffer.consume(G,Z.decoder),me}function te(G){var Z=G._readableState;l("endReadable",Z.endEmitted),Z.endEmitted||(Z.ended=!0,process.nextTick(re,Z,G))}function re(G,Z){if(l("endReadableNT",G.endEmitted,G.length),!G.endEmitted&&G.length===0&&(G.endEmitted=!0,Z.readable=!1,Z.emit("end"),G.autoDestroy)){var me=Z._writableState;(!me||me.autoDestroy&&me.finished)&&Z.destroy()}}typeof Symbol=="function"&&(V.from=function(G,Z){return S===void 0&&(S=uke()),S(V,G,Z)});function z(G,Z){for(var me=0,be=G.length;me0;return Eke(s,l,c,function(u){i||(i=u),u&&a.forEach(nB),!l&&(a.forEach(nB),n(i))})});return e.reduce(_ke)}var Ake=Ske;(function(t,e){e=t.exports=Kee(),e.Stream=e,e.Readable=e,e.Writable=Vee(),e.Duplex=Dg(),e.Transform=Jee,e.PassThrough=yke,e.finished=_L,e.pipeline=Ake})(SM,SM.exports);var Xee=SM.exports;const{Transform:Ike}=Xee;var Mke=t=>class ete extends Ike{constructor(r,n,i,a,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=a,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let a=null;try{this.update(r,n)}catch(s){a=s}i(a)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new ete(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:Tke}=Xee;var kke=t=>class tte extends Tke{constructor(r,n,i,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=a,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let a=null;try{this.update(r,n)}catch(s){a=s}i(a)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new tte(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Nke=Mke,Lke=kke;var jke=function(t){const e=Nke(t),r=Lke(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},rte={};const iB=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];rte.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],o=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let h=u^(i<<1|a>>>31),g=f^(a<<1|i>>>31);const m=t[0]^h,w=t[1]^g,_=t[10]^h,v=t[11]^g,b=t[20]^h,A=t[21]^g,S=t[30]^h,j=t[31]^g,U=t[40]^h,I=t[41]^g;h=r^(s<<1|o>>>31),g=n^(o<<1|s>>>31);const B=t[2]^h,V=t[3]^g,se=t[12]^h,Y=t[13]^g,N=t[22]^h,k=t[23]^g,x=t[32]^h,E=t[33]^g,L=t[42]^h,O=t[43]^g;h=i^(l<<1|c>>>31),g=a^(c<<1|l>>>31);const P=t[4]^h,R=t[5]^g,M=t[14]^h,D=t[15]^g,$=t[24]^h,X=t[25]^g,le=t[34]^h,H=t[35]^g,ee=t[44]^h,J=t[45]^g;h=s^(u<<1|f>>>31),g=o^(f<<1|u>>>31);const te=t[6]^h,re=t[7]^g,z=t[16]^h,G=t[17]^g,Z=t[26]^h,me=t[27]^g,be=t[36]^h,Ce=t[37]^g,Fe=t[46]^h,Ue=t[47]^g;h=l^(r<<1|n>>>31),g=c^(n<<1|r>>>31);const Ke=t[8]^h,lt=t[9]^g,Ee=t[18]^h,He=t[19]^g,qe=t[28]^h,Ie=t[29]^g,Ne=t[38]^h,Pe=t[39]^g,$e=t[48]^h,K=t[49]^g,F=m,W=w,ie=v<<4|_>>>28,pe=_<<4|v>>>28,we=b<<3|A>>>29,he=A<<3|b>>>29,De=j<<9|S>>>23,Je=S<<9|j>>>23,et=U<<18|I>>>14,it=I<<18|U>>>14,ut=B<<1|V>>>31,pt=V<<1|B>>>31,tr=Y<<12|se>>>20,zt=se<<12|Y>>>20,At=N<<10|k>>>22,mt=k<<10|N>>>22,St=E<<13|x>>>19,dt=x<<13|E>>>19,Nt=L<<2|O>>>30,Rt=O<<2|L>>>30,gt=R<<30|P>>>2,qt=P<<30|R>>>2,Wt=M<<6|D>>>26,ot=D<<6|M>>>26,Vt=X<<11|$>>>21,Ft=$<<11|X>>>21,yt=le<<15|H>>>17,Qe=H<<15|le>>>17,Pt=J<<29|ee>>>3,xt=ee<<29|J>>>3,Jt=te<<28|re>>>4,Cr=re<<28|te>>>4,Gt=G<<23|z>>>9,Sr=z<<23|G>>>9,cr=Z<<25|me>>>7,br=me<<25|Z>>>7,Q=be<<21|Ce>>>11,ae=Ce<<21|be>>>11,de=Ue<<24|Fe>>>8,ue=Fe<<24|Ue>>>8,ve=Ke<<27|lt>>>5,je=lt<<27|Ke>>>5,Ge=Ee<<20|He>>>12,Be=He<<20|Ee>>>12,tt=Ie<<7|qe>>>25,vt=qe<<7|Ie>>>25,Lt=Ne<<8|Pe>>>24,Ct=Pe<<8|Ne>>>24,ir=$e<<14|K>>>18,Qt=K<<14|$e>>>18;t[0]=F^~tr&Vt,t[1]=W^~zt&Ft,t[10]=Jt^~Ge&we,t[11]=Cr^~Be&he,t[20]=ut^~Wt&cr,t[21]=pt^~ot&br,t[30]=ve^~ie&At,t[31]=je^~pe&mt,t[40]=gt^~Gt&tt,t[41]=qt^~Sr&vt,t[2]=tr^~Vt&Q,t[3]=zt^~Ft&ae,t[12]=Ge^~we&St,t[13]=Be^~he&dt,t[22]=Wt^~cr&Lt,t[23]=ot^~br&Ct,t[32]=ie^~At&yt,t[33]=pe^~mt&Qe,t[42]=Gt^~tt&De,t[43]=Sr^~vt&Je,t[4]=Vt^~Q&ir,t[5]=Ft^~ae&Qt,t[14]=we^~St&Pt,t[15]=he^~dt&xt,t[24]=cr^~Lt&et,t[25]=br^~Ct&it,t[34]=At^~yt&de,t[35]=mt^~Qe&ue,t[44]=tt^~De&Nt,t[45]=vt^~Je&Rt,t[6]=Q^~ir&F,t[7]=ae^~Qt&W,t[16]=St^~Pt&Jt,t[17]=dt^~xt&Cr,t[26]=Lt^~et&ut,t[27]=Ct^~it&pt,t[36]=yt^~de&ve,t[37]=Qe^~ue&je,t[46]=De^~Nt>,t[47]=Je^~Rt&qt,t[8]=ir^~F&tr,t[9]=Qt^~W&zt,t[18]=Pt^~Jt&Ge,t[19]=xt^~Cr&Be,t[28]=et^~ut&Wt,t[29]=it^~pt&ot,t[38]=de^~ve&ie,t[39]=ue^~je&pe,t[48]=Nt^~gt&Gt,t[49]=Rt^~qt&Sr,t[0]^=iB[e*2],t[1]^=iB[e*2+1]}};const W5=rte;function Am(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}Am.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};Am.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(W5.p1600(this.state),this.count=0);return e};Am.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var $ke=Am,Pke=jke($ke);const Rke=Pke;function nte(t){return Buffer.allocUnsafe(t).fill(0)}function Dke(t){return t.toString(2).length}function ite(t,e){let r=t.toString(16);r.length%2!==0&&(r="0"+r);const n=r.match(/.{1,2}/g).map(i=>parseInt(i,16));for(;n.length"u")throw new Error("Not an array?");if(r=ute(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(a in e)i.push(Hc(t,e[a]));if(r==="dynamic"){var s=Hc("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Hc("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,Qa.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=dg(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Qa.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=dg(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=o0(e);const o=Qa.bitLengthFromBigInt(n);if(o>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+o);if(n<0)throw new Error("Supplied uint is negative");return Qa.bufferBEFromBigInt(n,32)}else if(t.startsWith("int")){if(r=dg(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=o0(e);const o=Qa.bitLengthFromBigInt(n);if(o>r)throw new Error("Supplied int exceeds width: "+r+" vs "+o);const l=Qa.twosFromBigInt(n,256);return Qa.bufferBEFromBigInt(l,32)}else if(t.startsWith("ufixed")){if(r=aB(t),n=o0(e),n<0)throw new Error("Supplied ufixed is negative");return Hc("uint256",n*BigInt(2)**BigInt(r[1]))}else if(t.startsWith("fixed"))return r=aB(t),Hc("int256",o0(e)*BigInt(2)**BigInt(r[1]))}throw new Error("Unsupported or invalid type: "+t)}function Wke(t){return t==="string"||t==="bytes"||ute(t)==="dynamic"}function Hke(t){return t.lastIndexOf("]")===t.length-1}function Gke(t,e){var r=[],n=[],i=32*t.length;for(var a in t){var s=cte(t[a]),o=e[a],l=Hc(s,o);Wke(s)?(r.push(Hc("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function dte(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],a=0;a32)throw new Error("Invalid bytes width: "+r);i.push(Qa.setLengthRight(o,r))}else if(s.startsWith("uint")){if(r=dg(s),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=o0(o);const l=Qa.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+l);i.push(Qa.bufferBEFromBigInt(n,r/8))}else if(s.startsWith("int")){if(r=dg(s),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=o0(o);const l=Qa.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied int exceeds width: "+r+" vs "+l);const c=Qa.twosFromBigInt(n,r);i.push(Qa.bufferBEFromBigInt(c,r/8))}else throw new Error("Unsupported or invalid type: "+s)}return Buffer.concat(i)}function qke(t,e){return Qa.keccak(dte(t,e))}var Vke={rawEncode:Gke,solidityPack:dte,soliditySHA3:qke};const Wl=lte,ky=Vke,fte={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},YC={encodeData(t,e,r,n=!0){const i=["bytes32"],a=[this.hashType(t,r)];if(n){const s=(o,l,c)=>{if(r[l]!==void 0)return["bytes32",c==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Wl.keccak(this.encodeData(l,c,r,n))];if(c===void 0)throw new Error(`missing value for field ${o} of type ${l}`);if(l==="bytes")return["bytes32",Wl.keccak(c)];if(l==="string")return typeof c=="string"&&(c=Buffer.from(c,"utf8")),["bytes32",Wl.keccak(c)];if(l.lastIndexOf("]")===l.length-1){const u=l.slice(0,l.lastIndexOf("[")),f=c.map(h=>s(o,u,h));return["bytes32",Wl.keccak(ky.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[l,c]};for(const o of r[t]){const[l,c]=s(o.name,o.type,e[o.name]);i.push(l),a.push(c)}}else for(const s of r[t]){let o=e[s.name];if(o!==void 0)if(s.type==="bytes")i.push("bytes32"),o=Wl.keccak(o),a.push(o);else if(s.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=Wl.keccak(o),a.push(o);else if(r[s.type]!==void 0)i.push("bytes32"),o=Wl.keccak(this.encodeData(s.type,o,r,n)),a.push(o);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),a.push(o)}}return ky.rawEncode(i,a)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:s,type:o})=>o+" "+s).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return Wl.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Wl.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in fte.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Wl.keccak(Buffer.concat(n))}};var Yke={TYPED_MESSAGE_SCHEMA:fte,TypedDataUtils:YC,hashForSignTypedDataLegacy:function(t){return Kke(t.data)},hashForSignTypedData_v3:function(t){return YC.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return YC.hash(t.data)}};function Kke(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(a){return a.type==="bytes"?Wl.toBuffer(a.value):a.value}),n=t.map(function(a){return a.type}),i=t.map(function(a){if(!a.name)throw e;return a.type+" "+a.name});return ky.soliditySHA3(["bytes32","bytes32"],[ky.soliditySHA3(new Array(t.length).fill("string"),i),ky.soliditySHA3(n,r)])}var uu={};Object.defineProperty(uu,"__esModule",{value:!0});uu.APP_VERSION_KEY=uu.LOCAL_STORAGE_ADDRESSES_KEY=uu.WALLET_USER_NAME_KEY=void 0;uu.WALLET_USER_NAME_KEY="walletUsername";uu.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";uu.APP_VERSION_KEY="AppVersion";var Hw={};Object.defineProperty(Hw,"__esModule",{value:!0});Hw.RelayEventManager=void 0;const Jke=Kt;class Zke{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,Jke.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}Hw.RelayEventManager=Zke;var ox={},lx={},cx={};Object.defineProperty(cx,"__esModule",{value:!0});cx.WalletLinkCipher=void 0;const E4=Kt;class Qke{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,E4.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,a.encode(e)),o=16,l=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),u=new Uint8Array(l),f=new Uint8Array(c),h=new Uint8Array([...n,...u,...f]);return(0,E4.uint8ArrayToHex)(h)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const a=await crypto.subtle.importKey("raw",(0,E4.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,E4.hexStringToUint8Array)(e),o=s.slice(0,12),l=s.slice(12,28),c=s.slice(28),u=new Uint8Array([...c,...l]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const h=await window.crypto.subtle.decrypt(f,a,u),g=new TextDecoder;n(g.decode(h))}catch(h){i(h)}})()})}}cx.WalletLinkCipher=Qke;var ux={};Object.defineProperty(ux,"__esModule",{value:!0});ux.WalletLinkHTTP=void 0;class Xke{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const a=(e=n==null?void 0:n.filter(s=>s.event==="Web3Response").map(s=>({type:"Event",sessionId:this.sessionId,eventId:s.id,event:s.event,data:s.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${r.status}`)}}ux.WalletLinkHTTP=Xke;var Og={};Object.defineProperty(Og,"__esModule",{value:!0});Og.WalletLinkWebSocket=Og.ConnectionState=void 0;var Kp;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(Kp||(Og.ConnectionState=Kp={}));class eNe{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(a){r(a);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,Kp.CONNECTING),i.onclose=a=>{var s;this.clearWebSocket(),r(new Error(`websocket error ${a.code}: ${a.reason}`)),(s=this.connectionStateListener)===null||s===void 0||s.call(this,Kp.DISCONNECTED)},i.onopen=a=>{var s;e(),(s=this.connectionStateListener)===null||s===void 0||s.call(this,Kp.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=a=>{var s,o;if(a.data==="h")(s=this.incomingDataListener)===null||s===void 0||s.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(a.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,l)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,Kp.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}Og.WalletLinkWebSocket=eNe;Object.defineProperty(lx,"__esModule",{value:!0});lx.WalletLinkConnection=void 0;const sB=uu,tNe=cx,rNe=ux,_4=Og,fp=$a,oB=1e4,nNe=6e4;class iNe{constructor({session:e,linkAPIUrl:r,listener:n,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,fp.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=s=>{if(!s)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>s.JsonRpcUrl&&this.handleChainUpdated(l,s.JsonRpcUrl)]]).forEach((l,c)=>{const u=s[c];u!==void 0&&l(u)})},this.handleDestroyed=s=>{var o;s==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async s=>{var o;{const l=await this.cipher.decrypt(s);(o=this.listener)===null||o===void 0||o.accountUpdated(l)}},this.handleMetadataUpdated=async(s,o)=>{var l;{const c=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.metadataUpdated(s,c)}},this.handleWalletUsernameUpdated=async s=>{this.handleMetadataUpdated(sB.WALLET_USER_NAME_KEY,s)},this.handleAppVersionUpdated=async s=>{this.handleMetadataUpdated(sB.APP_VERSION_KEY,s)},this.handleChainUpdated=async(s,o)=>{var l;{const c=await this.cipher.decrypt(s),u=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.chainUpdated(c,u)}},this.session=e,this.cipher=new tNe.WalletLinkCipher(e.secret),this.listener=n;const a=new _4.WalletLinkWebSocket(`${r}/rpc`,i);a.setConnectionStateListener(async s=>{let o=!1;switch(s){case _4.ConnectionState.DISCONNECTED:if(!this.destroyed){const l=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||a.connect().catch(()=>{l()})};l()}break;case _4.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},oB),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case _4.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),a.setIncomingDataListener(s=>{var o;switch(s.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const l=s.type==="IsLinkedOK"?s.linked:void 0;this.linked=l||s.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(s.metadata);break}case"Event":{this.handleIncomingEvent(s);break}}s.id!==void 0&&((o=this.requestResolutions.get(s.id))===null||o===void 0||o(s))}),this.ws=a,this.http=new rNe.WalletLinkHTTP(r,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this))}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r;if(!(e.type!=="Event"||e.event!=="Web3Response")){const n=await this.cipher.decrypt(e.data),i=JSON.parse(n);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,fp.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),a={type:"PublishEvent",id:(0,fp.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const s=await this.makeRequest(a);if(s.type==="Fail")throw new Error(s.error||"failed to publish event");return s.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>oB*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=nNe){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((a,s)=>{i=window.setTimeout(()=>{s(new Error(`request ${n} timed out`))},r)}),new Promise(a=>{this.requestResolutions.set(n,s=>{clearTimeout(i),a(s),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,fp.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,fp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,fp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}lx.WalletLinkConnection=iNe;var dx={},hte={exports:{}},pte=bh.Buffer;function fx(t,e){this._block=pte.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}fx.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=pte.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a};fx.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Im=fx,aNe=hs,gte=Im,sNe=bh.Buffer,oNe=[1518500249,1859775393,-1894007588,-899497514],lNe=new Array(80);function Gw(){this.init(),this._w=lNe,gte.call(this,64,56)}aNe(Gw,gte);Gw.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function cNe(t){return t<<5|t>>>27}function uNe(t){return t<<30|t>>>2}function dNe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Gw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=e[o-3]^e[o-8]^e[o-14]^e[o-16];for(var l=0;l<80;++l){var c=~~(l/20),u=cNe(r)+dNe(c,n,i,a)+s+e[l]+oNe[c]|0;s=a,a=i,i=uNe(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};Gw.prototype._hash=function(){var t=sNe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var fNe=Gw,hNe=hs,mte=Im,pNe=bh.Buffer,gNe=[1518500249,1859775393,-1894007588,-899497514],mNe=new Array(80);function qw(){this.init(),this._w=mNe,mte.call(this,64,56)}hNe(qw,mte);qw.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function yNe(t){return t<<1|t>>>31}function wNe(t){return t<<5|t>>>27}function vNe(t){return t<<30|t>>>2}function bNe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}qw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=yNe(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=wNe(r)+bNe(c,n,i,a)+s+e[l]+gNe[c]|0;s=a,a=i,i=vNe(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};qw.prototype._hash=function(){var t=pNe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var xNe=qw,ENe=hs,yte=Im,_Ne=bh.Buffer,CNe=[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],SNe=new Array(64);function Vw(){this.init(),this._w=SNe,yte.call(this,64,56)}ENe(Vw,yte);Vw.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function ANe(t,e,r){return r^t&(e^r)}function INe(t,e,r){return t&e|r&(t|e)}function MNe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function TNe(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function kNe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function NNe(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Vw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=this._f|0,l=this._g|0,c=this._h|0,u=0;u<16;++u)e[u]=t.readInt32BE(u*4);for(;u<64;++u)e[u]=NNe(e[u-2])+e[u-7]+kNe(e[u-15])+e[u-16]|0;for(var f=0;f<64;++f){var h=c+TNe(s)+ANe(s,o,l)+CNe[f]+e[f]|0,g=MNe(r)+INe(r,n,i)|0;c=l,l=o,o=s,s=a+h|0,a=i,i=n,n=r,r=h+g|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=o+this._f|0,this._g=l+this._g|0,this._h=c+this._h|0};Vw.prototype._hash=function(){var t=_Ne.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var wte=Vw,LNe=hs,jNe=wte,$Ne=Im,PNe=bh.Buffer,RNe=new Array(64);function hx(){this.init(),this._w=RNe,$Ne.call(this,64,56)}LNe(hx,jNe);hx.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};hx.prototype._hash=function(){var t=PNe.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var DNe=hx,ONe=hs,vte=Im,FNe=bh.Buffer,lB=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],UNe=new Array(160);function Yw(){this.init(),this._w=UNe,vte.call(this,128,112)}ONe(Yw,vte);Yw.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function cB(t,e,r){return r^t&(e^r)}function uB(t,e,r){return t&e|r&(t|e)}function dB(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function fB(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function BNe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function zNe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function WNe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function HNe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Oi(t,e){return t>>>0>>0?1:0}Yw.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,a=this._dh|0,s=this._eh|0,o=this._fh|0,l=this._gh|0,c=this._hh|0,u=this._al|0,f=this._bl|0,h=this._cl|0,g=this._dl|0,m=this._el|0,w=this._fl|0,_=this._gl|0,v=this._hl|0,b=0;b<32;b+=2)e[b]=t.readInt32BE(b*4),e[b+1]=t.readInt32BE(b*4+4);for(;b<160;b+=2){var A=e[b-30],S=e[b-15*2+1],j=BNe(A,S),U=zNe(S,A);A=e[b-2*2],S=e[b-2*2+1];var I=WNe(A,S),B=HNe(S,A),V=e[b-7*2],se=e[b-7*2+1],Y=e[b-16*2],N=e[b-16*2+1],k=U+se|0,x=j+V+Oi(k,U)|0;k=k+B|0,x=x+I+Oi(k,B)|0,k=k+N|0,x=x+Y+Oi(k,N)|0,e[b]=x,e[b+1]=k}for(var E=0;E<160;E+=2){x=e[E],k=e[E+1];var L=uB(r,n,i),O=uB(u,f,h),P=dB(r,u),R=dB(u,r),M=fB(s,m),D=fB(m,s),$=lB[E],X=lB[E+1],le=cB(s,o,l),H=cB(m,w,_),ee=v+D|0,J=c+M+Oi(ee,v)|0;ee=ee+H|0,J=J+le+Oi(ee,H)|0,ee=ee+X|0,J=J+$+Oi(ee,X)|0,ee=ee+k|0,J=J+x+Oi(ee,k)|0;var te=R+O|0,re=P+L+Oi(te,R)|0;c=l,v=_,l=o,_=w,o=s,w=m,m=g+ee|0,s=a+J+Oi(m,g)|0,a=i,g=h,i=n,h=f,n=r,f=u,u=ee+te|0,r=J+re+Oi(u,ee)|0}this._al=this._al+u|0,this._bl=this._bl+f|0,this._cl=this._cl+h|0,this._dl=this._dl+g|0,this._el=this._el+m|0,this._fl=this._fl+w|0,this._gl=this._gl+_|0,this._hl=this._hl+v|0,this._ah=this._ah+r+Oi(this._al,u)|0,this._bh=this._bh+n+Oi(this._bl,f)|0,this._ch=this._ch+i+Oi(this._cl,h)|0,this._dh=this._dh+a+Oi(this._dl,g)|0,this._eh=this._eh+s+Oi(this._el,m)|0,this._fh=this._fh+o+Oi(this._fl,w)|0,this._gh=this._gh+l+Oi(this._gl,_)|0,this._hh=this._hh+c+Oi(this._hl,v)|0};Yw.prototype._hash=function(){var t=FNe.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var bte=Yw,GNe=hs,qNe=bte,VNe=Im,YNe=bh.Buffer,KNe=new Array(160);function px(){this.init(),this._w=KNe,VNe.call(this,128,112)}GNe(px,qNe);px.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};px.prototype._hash=function(){var t=YNe.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var JNe=px,v1=hte.exports=function(e){e=e.toLowerCase();var r=v1[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};v1.sha=fNe;v1.sha1=xNe;v1.sha224=DNe;v1.sha256=wte;v1.sha384=JNe;v1.sha512=bte;var ZNe=hte.exports;Object.defineProperty(dx,"__esModule",{value:!0});dx.WalletLinkSession=void 0;const QNe=ZNe,hB=Kt,pB="session:id",gB="session:secret",mB="session:linked";class CL{constructor(e,r,n,i){this._storage=e,this._id=r||(0,hB.randomBytesHex)(16),this._secret=n||(0,hB.randomBytesHex)(32),this._key=new QNe.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(pB),n=e.getItem(mB),i=e.getItem(gB);return r&&i?new CL(e,r,i,n==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(pB,this._id),this._storage.setItem(gB,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(mB,this._linked?"1":"0")}}dx.WalletLinkSession=CL;var bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.isDarkMode=bo.isMobileWeb=bo.getLocation=bo.createQrUrl=void 0;function XNe(t,e,r,n,i,a){const s=n?"parent-id":"id",o=new URLSearchParams({[s]:t,secret:e,server:r,v:i,chainId:a.toString()}).toString();return`${r}/#/link?${o}`}bo.createQrUrl=XNe;function eLe(){try{return window.frameElement!==null}catch{return!1}}function tLe(){try{return eLe()&&window.top?window.top.location:window.location}catch{return window.location}}bo.getLocation=tLe;function rLe(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}bo.isMobileWeb=rLe;function nLe(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}bo.isDarkMode=nLe;var gx={},Kw={},SL={};Object.defineProperty(SL,"__esModule",{value:!0});SL.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var iLe=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Kw,"__esModule",{value:!0});Kw.injectCssReset=void 0;const aLe=iLe(SL);function sLe(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(aLe.default)),document.documentElement.appendChild(t)}Kw.injectCssReset=sLe;var AL={};function xte(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e2&&(s.children=arguments.length>3?Jw.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)s[a]===void 0&&(s[a]=t.defaultProps[a]);return Ny(t,s,n,i,null)}function Ny(t,e,r,n,i){var a={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++_te,__i:-1,__u:0};return i==null&&In.vnode!=null&&In.vnode(a),a}function cLe(){return{current:null}}function Zw(t){return t.children}function Ly(t,e){this.props=t,this.context=e}function Fg(t,e){if(e==null)return t.__?Fg(t.__,t.__i+1):null;for(var r;ee&&l0.sort(MM));H5.__r=0}function kte(t,e,r,n,i,a,s,o,l,c,u){var f,h,g,m,w,_,v=n&&n.__k||Mte,b=e.length;for(l=uLe(r,e,v,l,b),f=0;f0?Ny(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,o=null,(c=s.__i=dLe(s,r,l,f))!==-1&&(f--,(o=r[c])&&(o.__u|=2)),o==null||o.__v===null?(c==-1&&h--,typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):t.__k[a]=null;if(f)for(a=0;a(l!=null&&!(2&l.__u)?1:0))for(i=r-1,a=r+1;i>=0||a=0){if((l=e[i])&&!(2&l.__u)&&s==l.key&&o===l.type)return i;i--}if(a2&&(o.children=arguments.length>3?Jw.call(arguments,2):r),Ny(t.type,o,n||t.key,i||t.ref,null)}function gLe(t,e){var r={__c:e="__cC"+Ite++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=new Set,(a={})[e]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&i.forEach(function(o){o.__e=!0,LM(o)})},this.sub=function(s){i.add(s);var o=s.componentWillUnmount;s.componentWillUnmount=function(){i&&i.delete(s),o&&o.call(s)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}Jw=Mte.slice,In={__e:function(t,e,r,n){for(var i,a,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(o){t=o}throw t}},_te=0,Cte=function(t){return t!=null&&t.constructor==null},Ly.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=xd({},this.state),typeof t=="function"&&(t=t(xd({},r),this.props)),t&&xd(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),LM(this))},Ly.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),LM(this))},Ly.prototype.render=Zw,l0=[],Ste=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,MM=function(t,e){return t.__v.__b-e.__v.__b},H5.__r=0,Ate=/(PointerCapture)$|Capture$/i,IL=0,TM=bB(!1),kM=bB(!0),Ite=0;const mLe=Object.freeze(Object.defineProperty({__proto__:null,Component:Ly,Fragment:Zw,cloneElement:pLe,createContext:gLe,createElement:NM,createRef:cLe,h:NM,hydrate:Rte,get isValidElement(){return Cte},get options(){return In},render:Pte,toChildArray:Lte},Symbol.toStringTag,{value:"Module"})),Dte=fh(mLe);var Bd,bn,KC,xB,Ug=0,Ote=[],Yn=In,EB=Yn.__b,_B=Yn.__r,CB=Yn.diffed,SB=Yn.__c,AB=Yn.unmount,IB=Yn.__;function b1(t,e){Yn.__h&&Yn.__h(bn,t,Ug||e),Ug=0;var r=bn.__H||(bn.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Fte(t){return Ug=1,Ute(zte,t)}function Ute(t,e,r){var n=b1(Bd++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):zte(void 0,e),function(o){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,o);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=bn,!bn.u)){var i=function(o,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!a||a.call(this,o,l,c);var f=n.__c.props!==o;return u.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(f=!0)}}),a&&a.call(this,o,l,c)||f};bn.u=!0;var a=bn.shouldComponentUpdate,s=bn.componentWillUpdate;bn.componentWillUpdate=function(o,l,c){if(this.__e){var u=a;a=void 0,i(o,l,c),a=u}s&&s.call(this,o,l,c)},bn.shouldComponentUpdate=i}return n.__N||n.__}function yLe(t,e){var r=b1(Bd++,3);!Yn.__s&&LL(r.__H,e)&&(r.__=t,r.i=e,bn.__H.__h.push(r))}function Bte(t,e){var r=b1(Bd++,4);!Yn.__s&&LL(r.__H,e)&&(r.__=t,r.i=e,bn.__h.push(r))}function wLe(t){return Ug=5,NL(function(){return{current:t}},[])}function vLe(t,e,r){Ug=6,Bte(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function NL(t,e){var r=b1(Bd++,7);return LL(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function bLe(t,e){return Ug=8,NL(function(){return t},e)}function xLe(t){var e=bn.context[t.__c],r=b1(Bd++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(bn)),e.props.value):t.__}function ELe(t,e){Yn.useDebugValue&&Yn.useDebugValue(e?e(t):t)}function _Le(t){var e=b1(Bd++,10),r=Fte();return e.__=t,bn.componentDidCatch||(bn.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function CLe(){var t=b1(Bd++,11);if(!t.__){for(var e=bn.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function SLe(){for(var t;t=Ote.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(C6),t.__H.__h.forEach(jM),t.__H.__h=[]}catch(e){t.__H.__h=[],Yn.__e(e,t.__v)}}Yn.__b=function(t){bn=null,EB&&EB(t)},Yn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),IB&&IB(t,e)},Yn.__r=function(t){_B&&_B(t),Bd=0;var e=(bn=t.__c).__H;e&&(KC===bn?(e.__h=[],bn.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(C6),e.__h.forEach(jM),e.__h=[],Bd=0)),KC=bn},Yn.diffed=function(t){CB&&CB(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Ote.push(e)!==1&&xB===Yn.requestAnimationFrame||((xB=Yn.requestAnimationFrame)||ALe)(SLe)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),KC=bn=null},Yn.__c=function(t,e){e.some(function(r){try{r.__h.forEach(C6),r.__h=r.__h.filter(function(n){return!n.__||jM(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Yn.__e(n,r.__v)}}),SB&&SB(t,e)},Yn.unmount=function(t){AB&&AB(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{C6(n)}catch(i){e=i}}),r.__H=void 0,e&&Yn.__e(e,r.__v))};var MB=typeof requestAnimationFrame=="function";function ALe(t){var e,r=function(){clearTimeout(n),MB&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);MB&&(e=requestAnimationFrame(r))}function C6(t){var e=bn,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),bn=e}function jM(t){var e=bn;t.__c=t.__(),bn=e}function LL(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function zte(t,e){return typeof e=="function"?e(t):e}const ILe=Object.freeze(Object.defineProperty({__proto__:null,useCallback:bLe,useContext:xLe,useDebugValue:ELe,useEffect:yLe,useErrorBoundary:_Le,useId:CLe,useImperativeHandle:vLe,useLayoutEffect:Bte,useMemo:NL,useReducer:Ute,useRef:wLe,useState:Fte},Symbol.toStringTag,{value:"Module"})),MLe=fh(ILe);var jL={};Object.defineProperty(jL,"__esModule",{value:!0});jL.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=Xt&&Xt.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Ete),n=Dte,i=MLe,a=bo,s=e(jL),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",l="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,a.isDarkMode)()}attach(g){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",g.appendChild(this.root),this.render()}presentItem(g){const m=this.nextItemKey++;return this.items.set(m,g),this.render(),()=>{this.items.delete(m),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([g,m])=>(0,n.h)(t.SnackbarInstance,Object.assign({},m,{key:g}))))),this.root)}}t.Snackbar=c;const u=h=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},h.children));t.SnackbarContainer=u;const f=({autoExpand:h,message:g,menuItems:m})=>{const[w,_]=(0,i.useState)(!0),[v,b]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const S=[window.setTimeout(()=>{_(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{S.forEach(window.clearTimeout)}});const A=()=>{b(!v)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",w&&"-cbwsdk-snackbar-instance-hidden",v&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:A},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},g),(0,n.h)("div",{class:"-gear-container"},!v&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:l,class:"-gear-icon",title:"Expand"}))),m&&m.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},m.map((S,j)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:S.onClick,key:j},(0,n.h)("svg",{width:S.svgWidth,height:S.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":S.defaultFillRule,"clip-rule":S.defaultClipRule,d:S.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},S.info)))))};t.SnackbarInstance=f})(AL);Object.defineProperty(gx,"__esModule",{value:!0});gx.WalletLinkRelayUI=void 0;const TLe=Kw,kLe=AL;class NLe{constructor(){this.attached=!1,this.snackbar=new kLe.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.snackbar.attach(r),this.attached=!0,(0,TLe.injectCssReset)()}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}}gx.WalletLinkRelayUI=NLe;var yx={},wx={},$L={};Object.defineProperty($L,"__esModule",{value:!0});$L.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Wte=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wx,"__esModule",{value:!0});wx.RedirectDialog=void 0;const LLe=Wte(Ete),Vc=Dte,jLe=Kw,$Le=AL,PLe=bo,RLe=Wte($L);class DLe{constructor(){this.root=null,this.darkMode=(0,PLe.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,jLe.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,Vc.render)(null,this.root),e&&(0,Vc.render)((0,Vc.h)(OLe,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}wx.RedirectDialog=DLe;const OLe=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const a=r?"dark":"light";return(0,Vc.h)($Le.SnackbarContainer,{darkMode:r},(0,Vc.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Vc.h)("style",null,RLe.default),(0,Vc.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Vc.h)("div",{class:(0,LLe.default)("-cbwsdk-redirect-dialog-box",a)},(0,Vc.h)("p",null,t),(0,Vc.h)("button",{onClick:n},e))))};var du={};Object.defineProperty(du,"__esModule",{value:!0});du.CBW_MOBILE_DEEPLINK_URL=du.WALLETLINK_URL=du.CB_KEYS_URL=void 0;du.CB_KEYS_URL="https://keys.coinbase.com/connect";du.WALLETLINK_URL="https://www.walletlink.org";du.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(yx,"__esModule",{value:!0});yx.WLMobileRelayUI=void 0;const FLe=wx,ULe=bo,BLe=du;class zLe{constructor(){this.attached=!1,this.redirectDialog=new FLe.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const r=new URL(BLe.CBW_MOBILE_DEEPLINK_URL);r.searchParams.append("redirect_url",(0,ULe.getLocation)().href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}yx.WLMobileRelayUI=zLe;Object.defineProperty(ox,"__esModule",{value:!0});ox.WalletLinkRelay=void 0;const WLe=lx,HLe=uu,GLe=Hw,JC=dx,hp=Sm,qLe=bo,VLe=gx,TB=yx,YLe=Tu,fi=Kt,KLe=ku;class hd{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,qLe.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{this.isLinked=a;const s=this.storage.getItem(HLe.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this._session.linked=a),this.isUnlinkedErrorState=!1,s){const o=s.split(" "),l=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!a&&this._session.linked&&!l&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(a,s)=>{this.storage.setItem(a,s)},this.chainUpdated=(a,s)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===s||(this.chainCallbackParams={chainId:a,jsonRpcUrl:s},this.chainCallback&&this.chainCallback(a,s))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),hd.accountRequestCallbackIds.size>0&&(Array.from(hd.accountRequestCallbackIds.values()).forEach(s=>{const o={type:"WEB3_RESPONSE",id:s,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),hd.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:r,ui:n,connection:i}=this.subscribe();this._session=r,this.connection=i,this.relayEventManager=new GLe.RelayEventManager,this.ui=n}subscribe(){const e=JC.WalletLinkSession.load(this.storage)||new JC.WalletLinkSession(this.storage).save(),{linkAPIUrl:r}=this,n=new WLe.WalletLinkConnection({session:e,linkAPIUrl:r,listener:this}),i=this.isMobileWeb?new TB.WLMobileRelayUI:new VLe.WalletLinkRelayUI;return n.connect(),{session:e,ui:i,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=JC.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&KLe.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,fi.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,fi.hexStringFromBuffer)(e,!0),signature:(0,fi.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,fi.bigIntStringFromBigInt)(e.weiValue),data:(0,fi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,fi.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,fi.bigIntStringFromBigInt)(e.weiValue),data:(0,fi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,fi.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,fi.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,fi.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,fi.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,fi.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,a),r==null||r()};return new Promise((a,s)=>{r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,o=>{if(r==null||r(),(0,hp.isErrorResponse)(o))return s(new Error(o.errorMessage));a(o)}),this.publishWeb3RequestEvent(n,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,r){const n={type:"WEB3_REQUEST",id:e,request:r};this.publishEvent("Web3Request",n,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:r.method,errorMessage:i.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(r.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof TB.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){const{response:r}=e;if(r.method==="requestEthereumAccounts"){hd.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),hd.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n){var i;const a=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:a}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,fi.randomBytesHex)(8);return new Promise((n,i)=>{this.relayEventManager.callbacks.set(r,a=>{if((0,hp.isErrorResponse)(a))return i(new Error(a.errorMessage));n(a)}),hd.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,e)})}watchAsset(e,r,n,i,a,s){const o={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:a},chainId:s}};let l=null;const c=(0,fi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,f),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((f,h)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,hp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,o)})}addEthereumChain(e,r,n,i,a,s){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:a,iconUrls:n,nativeCurrency:s}};let l=null;const c=(0,fi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,f),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((f,h)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,hp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,o)})}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,fi.randomBytesHex)(8);return new Promise((a,s)=>{this.relayEventManager.callbacks.set(i,o=>{if((0,hp.isErrorResponse)(o)&&o.errorCode)return s(YLe.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,hp.isErrorResponse)(o))return s(new Error(o.errorMessage));a(o)}),this.publishWeb3RequestEvent(i,n)})}}ox.WalletLinkRelay=hd;hd.accountRequestCallbackIds=new Set;var JLe=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(tx,"__esModule",{value:!0});tx.WalletLinkSigner=void 0;const ZC=JLe(Yke),kB=uu,ZLe=Hw,Ku=Sm,QLe=ox,NB=du,Fi=Tu,Gr=Kt,XLe=ku,QC="DefaultChainId",LB="DefaultJsonRpcUrl";class eje{constructor(e){var r,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:i,appLogoUrl:a}=e.metadata;this._appName=i,this._appLogoUrl=a,this._storage=new XLe.ScopedLocalStorage("walletlink",NB.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new ZLe.RelayEventManager,this._jsonRpcUrlFromOpts="";const s=this._storage.getItem(kB.LOCAL_STORAGE_ADDRESSES_KEY);if(s){const l=s.split(" ");l[0]!==""&&(this._addresses=l.map(c=>(0,Gr.ensureAddressString)(c)),(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(QC)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:r,secret:n}=e.getWalletLinkSession();return{id:r,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(LB))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(LB,e)}updateProviderInfo(e,r){var n;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(QC,r.toString(10)),((0,Gr.ensureIntNumber)(r)!==i||!this.hasMadeFirstChainChangedEmission)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:r,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,a,s){const l=await this.initializeRelay().watchAsset(e,r,n,i,a,s==null?void 0:s.toString());return(0,Ku.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(e,r,n,i,a,s){var o,l;if((0,Gr.ensureIntNumber)(e)===this.getChainId())return!1;const c=this.initializeRelay();this._isAuthorized()||await c.requestEthereumAccounts();const u=await c.addEthereumChain(e.toString(),r,a,n,i,s);return(0,Ku.isErrorResponse)(u)?!1:(((o=u.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(r[0],e),((l=u.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(e){const n=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,Ku.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===Fi.standardErrorCodes.provider.unsupportedChain?Fi.standardErrors.provider.unsupportedChain():Fi.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(r=>{throw r})}catch(r){return Promise.reject(r)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Fi.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw Fi.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Fi.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,a=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:a})).result}_setAddresses(e,r){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(a=>(0,Gr.ensureAddressString)(a));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(n=this.updateListener)===null||n===void 0||n.onAccountsUpdate({accounts:i,source:"wallet"}),this._storage.setItem(kB.LOCAL_STORAGE_ADDRESSES_KEY,i.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i})}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_handleSynchronousMethods(e){const{method:r}=e;switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const r=(0,Gr.ensureAddressString)(e);return this._addresses.map(i=>(0,Gr.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,Gr.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,Gr.ensureAddressString)(e.to):null,i=e.value!=null?(0,Gr.ensureBigInt)(e.value):BigInt(0),a=e.data?(0,Gr.ensureBuffer)(e.data):Buffer.alloc(0),s=e.nonce!=null?(0,Gr.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,Gr.ensureBigInt)(e.gasPrice):null,l=e.maxFeePerGas!=null?(0,Gr.ensureBigInt)(e.maxFeePerGas):null,c=e.maxPriorityFeePerGas!=null?(0,Gr.ensureBigInt)(e.maxPriorityFeePerGas):null,u=e.gas!=null?(0,Gr.ensureBigInt)(e.gas):null,f=e.chainId?(0,Gr.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:a,nonce:s,gasPriceInWei:o,maxFeePerGas:l,maxPriorityFeePerGas:c,gasLimit:u,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Fi.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Fi.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const s=await this.initializeRelay().signEthereumMessage(e,r,n,i);if((0,Ku.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(a){throw typeof a.message=="string"&&a.message.match(/(denied|rejected)/i)?Fi.standardErrors.provider.userRejectedRequest("User denied message signature"):a}}async _ethereumAddressFromSignedMessage(e,r,n){const a=await this.initializeRelay().ethereumAddressFromSignedMessage(e,r,n);if((0,Ku.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,Gr.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(QC);if(!e)return(0,Gr.ensureIntNumber)(1);const r=parseInt(e,10);return(0,Gr.ensureIntNumber)(r)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,Ku.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Fi.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await this.initializeRelay().signEthereumTransaction(r);if((0,Ku.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Fi.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,Gr.ensureBuffer)(e[0]),i=await this.initializeRelay().submitEthereumTransaction(r,this.getChainId());if((0,Ku.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await this.initializeRelay().signAndSubmitEthereumTransaction(r);if((0,Ku.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Fi.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,Gr.ensureParsedJSONObject)(e[0]),n=(0,Gr.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=ZC.default.hashForSignTypedDataLegacy({data:r}),a=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,a)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=ZC.default.hashForSignTypedData_v3({data:n}),a=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,a)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=ZC.default.hashForSignTypedData_v4({data:n}),a=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,a)}async _wallet_addEthereumChain(e){var r,n,i,a;const s=e[0];if(((r=s.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||s.chainName.trim()==="")throw Fi.standardErrors.rpc.invalidParams("chainName is a required field");if(!s.nativeCurrency)throw Fi.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(s.chainId,16);return await this.addEthereumChain(o,(n=s.rpcUrls)!==null&&n!==void 0?n:[],(i=s.blockExplorerUrls)!==null&&i!==void 0?i:[],s.chainName,(a=s.iconUrls)!==null&&a!==void 0?a:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw Fi.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Fi.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Fi.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Fi.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:a,image:s,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,a,o,s,n)}}initializeRelay(){if(!this._relay){const e=new QLe.WalletLinkRelay({linkAPIUrl:NB.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),this._relay=e}return this._relay}}tx.WalletLinkSigner=eje;var ol={};Object.defineProperty(ol,"__esModule",{value:!0});ol.checkErrorForInvalidRequestArgs=ol.getCoinbaseInjectedProvider=ol.getCoinbaseInjectedSigner=ol.fetchRPCRequest=void 0;const tje=m1,S6=Tu;async function rje(t,e){if(!e.rpcUrl)throw S6.standardErrors.rpc.internal("No RPC URL set for chain");const r=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":tje.LIB_VERSION}})).json()).result}ol.fetchRPCRequest=rje;function Hte(){return globalThis.coinbaseWalletSigner}ol.getCoinbaseInjectedSigner=Hte;function nje({metadata:t,preference:e}){var r,n,i;const a=globalThis;if(e.options!=="smartWalletOnly"){if(Hte())return;const l=a.coinbaseWalletExtension;if(l){const{appName:c,appLogoUrl:u,appChainIds:f}=t;return(r=l.setAppInfo)===null||r===void 0||r.call(l,c,u,f),l}}const s=(n=a.ethereum)!==null&&n!==void 0?n:(i=a.top)===null||i===void 0?void 0:i.ethereum;if(s!=null&&s.isCoinbaseBrowser)return s}ol.getCoinbaseInjectedProvider=nje;function ije(t){if(!t||typeof t!="object"||Array.isArray(t))return S6.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:r}=t;if(typeof e!="string"||e.length===0)return S6.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))return S6.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t})}ol.checkErrorForInvalidRequestArgs=ije;Object.defineProperty(nu,"__esModule",{value:!0});nu.createSigner=nu.fetchSignerType=nu.storeSignerType=nu.loadSignerType=void 0;const aje=Q9,Gte=tx,sje=Tu,oje=ol,lje=ku,qte="SignerType",Vte=new lje.ScopedLocalStorage("CBWSDK","SignerConfigurator");function cje(){return Vte.getItem(qte)}nu.loadSignerType=cje;function uje(t){Vte.setItem(qte,t)}nu.storeSignerType=uje;async function dje(t){const{communicator:e,metadata:r}=t;hje(e,r).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:t.preference},{data:i}=await e.postRequestAndWaitForResponse(n);return i}nu.fetchSignerType=dje;function fje(t){const{signerType:e,metadata:r,communicator:n,updateListener:i}=t;switch(e){case"scw":return new aje.SCWSigner({metadata:r,updateListener:i,communicator:n});case"walletlink":return new Gte.WalletLinkSigner({metadata:r,updateListener:i});case"extension":{const a=(0,oje.getCoinbaseInjectedSigner)();if(!a)throw sje.standardErrors.rpc.internal("injected signer not found");return a}}}nu.createSigner=fje;async function hje(t,e){await t.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const r=new Gte.WalletLinkSigner({metadata:e});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var vx={},Bg={};Object.defineProperty(Bg,"__esModule",{value:!0});Bg.closePopup=Bg.openPopup=void 0;const pje=Tu,jB=420,$B=540;function gje(t){const e=(window.innerWidth-jB)/2+window.screenX,r=(window.innerHeight-$B)/2+window.screenY,n=window.open(t,"Smart Wallet",`width=${jB}, height=${$B}, left=${e}, top=${r}`);if(n==null||n.focus(),!n)throw pje.standardErrors.rpc.internal("Pop up window failed to open");return n}Bg.openPopup=gje;function mje(t){t&&!t.closed&&t.close()}Bg.closePopup=mje;Object.defineProperty(vx,"__esModule",{value:!0});vx.Communicator=void 0;const yje=m1,PB=Bg,wje=du,RB=Tu;class vje{constructor(e=wje.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{const n=this.onMessage(({requestId:i})=>i===r.id);return this.postMessage(r),await n},this.onMessage=async r=>new Promise((n,i)=>{const a=s=>{if(s.origin!==this.url.origin)return;const o=s.data;r(o)&&(n(o),window.removeEventListener("message",a),this.listeners.delete(a))};window.addEventListener("message",a),this.listeners.set(a,{reject:i})}),this.disconnect=()=>{(0,PB.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:r},n)=>{r(RB.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",n)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?this.popup:(this.popup=(0,PB.openPopup)(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:yje.LIB_VERSION}})}).then(()=>{if(!this.popup)throw RB.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}vx.Communicator=vje;var bx={};Object.defineProperty(bx,"__esModule",{value:!0});bx.determineMethodCategory=void 0;const DB={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function bje(t){for(const e in DB){const r=e;if(DB[r].includes(t))return r}}bx.determineMethodCategory=bje;var xje=Xt&&Xt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i{try{if(this.connected)return this.emit("connect",{chainId:(0,L2.hexStringFromIntNumber)((0,S4.IntNumber)(this.chain.id))}),this.accounts;const u=await this.requestSignerSelection(),f=this.initSigner(u),h=await f.handshake();return this.signer=f,(0,A4.storeSignerType)(u),this.emit("connect",{chainId:(0,L2.hexStringFromIntNumber)((0,S4.IntNumber)(this.chain.id))}),h}catch(u){throw this.handleUnauthorizedError(u),u}},sign:async c=>{if(!this.connected||!this.signer)throw pp.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(c)}catch(u){throw this.handleUnauthorizedError(u),u}},fetch:c=>(0,OB.fetchRPCRequest)(c,this.chain),state:c=>{const u=()=>{if(this.connected)return this.accounts;throw pp.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(c.method){case"eth_chainId":return(0,L2.hexStringFromIntNumber)((0,S4.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return u();case"eth_coinbase":return u()[0];default:return this.handlers.unsupported(c)}},deprecated:({method:c})=>{throw pp.standardErrors.rpc.methodNotSupported(`Method ${c} is deprecated.`)},unsupported:({method:c})=>{throw pp.standardErrors.rpc.methodNotSupported(`Method ${c} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:c,source:u})=>{(0,L2.areAddressArraysEqual)(this.accounts,c)||(this.accounts=c,u!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:c,source:u})=>{c.id===this.chain.id&&c.rpcUrl===this.chain.rpcUrl||(this.chain=c,u!=="storage"&&this.emit("chainChanged",(0,L2.hexStringFromIntNumber)((0,S4.IntNumber)(c.id))))}},this.metadata=i,this.preference=o,this.communicator=new Sje.Communicator(s),this.chain={id:(n=(r=i.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1};const l=(0,A4.loadSignerType)();this.signer=l?this.initSigner(l):null}get connected(){return this.accounts.length>0}async request(e){var r;try{const n=(0,OB.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const i=(r=(0,Aje.determineMethodCategory)(e.method))!==null&&r!==void 0?r:"fetch";return this.handlers[i](e)}catch(n){return Promise.reject((0,Cje.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===pp.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},Ije.ScopedLocalStorage.clearAll(),this.emit("disconnect",pp.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,A4.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,A4.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}Y9.CoinbaseWalletProvider=Mje;Object.defineProperty(F3,"__esModule",{value:!0});F3.CoinbaseWalletSDK=void 0;const Tje=V9,kje=Y9,Nje=ku,Lje=m1,jje=Kt,$je=ol;class Pje{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,jje.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var r;const n={metadata:this.metadata,preference:e};return(r=(0,$je.getCoinbaseInjectedProvider)(n))!==null&&r!==void 0?r:new kje.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,r=240){return(0,Tje.walletLogo)(e,r)}storeLatestVersion(){new Nje.ScopedLocalStorage("CBWSDK").setItem("VERSION",Lje.LIB_VERSION)}}F3.CoinbaseWalletSDK=Pje;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;const e=F3;t.default=e.CoinbaseWalletSDK;var r=F3;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}})})(wee);const $M=({style:t,...e})=>d.jsxs("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),Rje="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",xh={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},Yte={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},PL={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},Kte={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},Yd={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},Jte={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},Dje={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},RL={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},Oje={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},Fje={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},Uje={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},Bje={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}},zje={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},Zte={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},Wje={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},Hje={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},Nu={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},x1={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},Qte={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},Kd={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},Xte={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},Gje={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},ere={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},tre={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},qje={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},Vje={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},G5=[xh,Yte,ere,Nu,x1,Qte,Kd,Xte,RL,Oje,Fje,Uje,Yd,Jte,Dje,Hje,Zte,Wje,PL,Kte,tre,Vje,qje,zje,Gje,Bje],rre=new Set(G5.map(t=>t.id));let nre=class extends Pn{constructor(){super("Wallet timeout"),this.type="wallet_error"}},ire=class extends Pn{constructor(){super("User rejected connection"),this.type="wallet_error"}};const E1=t=>{if(t instanceof Pn)return t;if(t!=null&&t.code&&(t!=null&&t.reason)){let e=new cc(t);return t.code===Ta.ACTION_REJECTED&&(e.details=Qi.E4001_USER_REJECTED_REQUEST),e}return t!=null&&t.code?new cc(t):new Pn("Unknown connector error",t)};let I0=class extends qs{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}},cc=class extends I0{constructor(e){var n,i,a;super(e.message,e.code,e.data);let r=Object.values(Qi).find(s=>s.eipCode===e.code);this.details=r||Qi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=Qi.E32002_CONNECTION_ALREADY_PENDING:this.details=Qi.E32002_REQUEST_ALREADY_PENDING:(a=e.message)!=null&&a.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=Qi.E32002_WALLET_LOCKED))}};const Tf={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...Qi};function pd(t){return t.type==="ethereum"}function PM(t,e){if(t.length!==e.length)return!1;for(let r=0;rt.rpcTimeouts&&t.rpcTimeouts[e]||G9;let es=class{on(e,r){if(this.walletProvider)return this.walletProvider.on(e,r);this._subscriptions.push({eventName:e,listener:r})}async request(e){if(!this.walletProvider)throw new Pn(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(r=>{throw E1(r)})}constructor(e,r){this.removeListener=(n,i)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(n,i)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(n=new nre,i=this.rpcTimeoutDuration)=>new Promise((a,s)=>setTimeout(()=>{s(n)},i)),this.setWalletProvider=n=>{this.walletProvider&&this._subscriptions.forEach(i=>{this.removeListener(i.eventName,i.listener)}),this.walletProvider=n,this._subscriptions.forEach(i=>{var a;(a=this.walletProvider)==null||a.on(i.eventName,i.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=r||G9,this._subscriptions=[]}},q5=class extends es{constructor(e){super(e,e.rpcTimeoutDuration)}},RM=class extends es{sendAsync(e,r){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}constructor(e){super(e,e.rpcTimeoutDuration)}};function j2(t){return t.chainType==="ethereum"}let Mm=class extends are{buildConnectedWallet(e,r,n,i){let a=async()=>!!this.wallets.find(s=>Ir(s.address)===Ir(e));return{type:"ethereum",address:Ir(e),chainId:r,meta:n,imported:i,switchChain:async s=>{var h,g,m,w;let o,l;if(!a)throw new Pn("Wallet is not currently connected.");let c=(h=this.wallets.find(_=>Ir(_.address)===Ir(e)))==null?void 0:h.chainId;if(!c)throw new Pn("Unable to determine current chainId.");if(typeof s=="number"?(o=`0x${s.toString(16)}`,l=s):(o=s,l=Number(s)),c===y6(o))return;let u=this.chains.find(_=>_.id===l);if(!u)throw new Pn(`Unsupported chainId: ${s}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})};try{return await f()}catch(_){if(((v,b)=>{var A;return b==="coinbase_wallet"?v.message.includes("addEthereumChain"):v.code===4902||((A=v.message)==null?void 0:A.includes("4902"))})(_,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[((g=u.rpcUrls.default)==null?void 0:g.http[0])??""],blockExplorerUrls:[((m=u.blockExplorers)==null?void 0:m.default.url)??""]}]}),f();throw this.walletClientType==="rainbow"&&((w=_.message)!=null&&w.includes("wallet_switchEthereumChain"))?new Pn(`Rainbow does not support the chainId ${r}`):_}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return new _5(new q5(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return new RM(this.proxyProvider)},sign:async s=>{if(!await a())throw new Pn("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let r,n=e;try{if(n===void 0){let l=await mM(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,l),Array.isArray(l)&&(n=l)}}catch(l){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",l)}if(!n||!Array.isArray(n)||n.length<=0||!n[0])return;let i=n[0],a=Ir(i),s=[];if(this.walletClientType==="privy"){let l=Dt.get($C(a));this.chains.find(c=>c.id===Number(l))||(Dt.del($C(a)),l=null),r=l||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${r} on initialization`)}}else try{let l=await mM(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,l),typeof l=="string")r=l;else{if(typeof l!="number")throw Error("Invalid chainId returned from provider");r=`0x${l.toString(16)}`}}catch(l){console.warn(`Failed to get chainId from provider, defaulting to ${$U}`,l),r=$U}let o=y6(r);if(!s.find(l=>Ir(l.address)===a)){let l={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};s.push(this.buildConnectedWallet(Ir(i),o,l,this.connectorType==="embedded_imported"))}PM(s,this.wallets)||(this.wallets=s,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>e.find(n=>Ir(n)===Ir(r.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new _5(new q5(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,r,n,i){super(e),this.chainType="ethereum",this.onAccountsChanged=a=>{a.length===0?this.onDisconnect():this.syncAccounts(a)},this.onChainChanged=a=>{this.wallets.forEach(s=>{s.chainId=y6(a),this.walletClientType==="privy"&&Dt.put($C(s.address),a)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=r,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=DL(i,e),this.connected=!1,this.initialized=!1}},I4,Yje=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],FB=(t,e)=>t.makeWeb3Provider({options:e}),Kje=class extends Mm{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:Rje,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new Pn("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw E1(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(FB(I4,this.connectionOptions))}constructor(e,r,n,i,a,s){if(super("coinbase_wallet",e,r,n),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new es(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!I4){let o=[r.id].concat(e.map(c=>c.id)),l=this.connectionOptions!=="eoaOnly"?o.filter(c=>!Yje.includes(c)):[];l.length>0&&!l.every(c=>rre.has(c))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${l.join(", ")}`),I4=new wee.CoinbaseWalletSDK({appName:a,appLogoUrl:s,appChainIds:o})}this.proxyProvider.setWalletProvider(FB(I4,this.connectionOptions))}};const sre=({...t})=>d.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});let UB=class extends Mm{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[P5((e==null?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:sre,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:r,defaultChain:n,rpcConfig:i,imported:a,walletIndex:s}){super("privy",r,n,i),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=s,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}};const Jje=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"],Zje=t=>Jje.includes(t),Qje=({as:t="div",...e},r)=>d.jsx(t,{...e,ref:r}),Xje=C.forwardRef(Qje),e$e="https://challenges.cloudflare.com/turnstile/v0/api.js",V5="cf-turnstile-script",t$e="cf-turnstile",ore="onloadTurnstileCallback",Y5=t=>!!document.getElementById(t),r$e=({render:t="explicit",onLoadCallbackName:e=ore,scriptOptions:{nonce:r="",defer:n=!0,async:i=!0,id:a="",appendTo:s,onError:o,crossOrigin:l=""}={}})=>{const c=a||V5;if(Y5(c))return;const u=document.createElement("script");if(u.id=c,u.src=`${e$e}?onload=${e}&render=${t}`,document.querySelector(`script[src="${u.src}"]`))return;u.defer=!!n,u.async=!!i,r&&(u.nonce=r),l&&(u.crossOrigin=l),o&&(u.onerror=o),(s==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(u)},Rc={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}};function n$e(t){let e;return t!=="invisible"&&(e=t),e}function i$e(t=V5){const[e,r]=C.useState(!1);return C.useEffect(()=>{const n=()=>{Y5(t)&&r(!0)},i=new MutationObserver(n);return i.observe(document,{childList:!0,subtree:!0}),n(),()=>{i.disconnect()}},[t]),e}const lre=C.forwardRef((t,e)=>{const{scriptOptions:r,options:n={},siteKey:i,onWidgetLoad:a,onSuccess:s,onExpire:o,onError:l,onBeforeInteractive:c,onAfterInteractive:u,onUnsupported:f,onLoadScript:h,id:g,style:m,as:w="div",injectScript:_=!0,...v}=t,b=n.size??"normal",[A,S]=C.useState(n.execution==="execute"?Rc.invisible:n.appearance==="interaction-only"?Rc.interactionOnly:Rc[b]),j=C.useRef(null),U=C.useRef(!1),[I,B]=C.useState(),[V,se]=C.useState(!1),Y=g??t$e,N=_?(r==null?void 0:r.id)||`${V5}__${Y}`:(r==null?void 0:r.id)||V5,k=i$e(N),x=r!=null&&r.onLoadCallbackName?`${r.onLoadCallbackName}__${Y}`:`${ore}__${Y}`,E=C.useMemo(()=>({sitekey:i,action:n.action,cData:n.cData,callback:s,"error-callback":l,"expired-callback":o,"before-interactive-callback":c,"after-interactive-callback":u,"unsupported-callback":f,theme:n.theme??"auto",language:n.language??"auto",tabindex:n.tabIndex,"response-field":n.responseField,"response-field-name":n.responseFieldName,size:n$e(b),retry:n.retry??"auto","retry-interval":n.retryInterval??8e3,"refresh-expired":n.refreshExpired??"auto",execution:n.execution??"render",appearance:n.appearance??"always"}),[i,n,s,l,o,b,c,u,f]),L=C.useMemo(()=>JSON.stringify(E),[E]);return C.useImperativeHandle(e,()=>{if(typeof window>"u"||!k)return;const{turnstile:O}=window;return{getResponse(){if(!(O!=null&&O.getResponse)||!I){console.warn("Turnstile has not been loaded");return}return O.getResponse(I)},reset(){if(!(O!=null&&O.reset)||!I){console.warn("Turnstile has not been loaded");return}n.execution==="execute"&&S(Rc.invisible);try{O.reset(I)}catch(P){console.warn(`Failed to reset Turnstile widget ${I}`,P)}},remove(){if(!(O!=null&&O.remove)||!I){console.warn("Turnstile has not been loaded");return}B(""),S(Rc.invisible),O.remove(I)},render(){if(!(O!=null&&O.render)||!j.current||I){console.warn("Turnstile has not been loaded or widget already rendered");return}const P=O.render(j.current,E);return B(P),n.execution!=="execute"&&S(Rc[b]),P},execute(){if(n.execution==="execute"){if(!(O!=null&&O.execute)||!j.current||!I){console.warn("Turnstile has not been loaded or widget has not been rendered");return}O.execute(j.current,E),S(Rc[b])}},isExpired(){if(!(O!=null&&O.isExpired)||!I){console.warn("Turnstile has not been loaded");return}return O.isExpired(I)}}},[k,I,n.execution,b,E,j]),C.useEffect(()=>(window[x]=()=>se(!0),()=>{delete window[x]}),[x]),C.useEffect(()=>{_&&!V&&r$e({onLoadCallbackName:x,scriptOptions:{...r,id:N}})},[_,V,x,r,N]),C.useEffect(()=>{k&&!V&&window.turnstile&&se(!0)},[V,k]),C.useEffect(()=>{if(!i){console.warn("sitekey was not provided");return}if(!k||!j.current||!V||U.current)return;const O=window.turnstile.render(j.current,E);B(O),U.current=!0},[k,i,E,U,V]),C.useEffect(()=>{if(window.turnstile&&j.current&&I){Y5(I)&&window.turnstile.remove(I);const O=window.turnstile.render(j.current,E);B(O),U.current=!0}},[L,i]),C.useEffect(()=>{if(window.turnstile&&I&&Y5(I))return a==null||a(I),()=>{window.turnstile.remove(I)}},[I,a]),C.useEffect(()=>{S(n.execution==="execute"?Rc.invisible:E.appearance==="interaction-only"?Rc.interactionOnly:Rc[b])},[n.execution,b,E.appearance]),C.useEffect(()=>{!k||typeof h!="function"||h()},[k,h]),d.jsx(Xje,{ref:j,as:w,id:Y,style:{...A,...m},...v})});lre.displayName="Turnstile";const a$e=t=>{let{enabled:e,siteKey:r,appId:n,setError:i,setToken:a,setExecuting:s,ref:o}=$o(),[,l]=C.useMemo(()=>(r==null?void 0:r.split("t:"))||[],[r]);if(C.useEffect(()=>{var c;return(c=o.current)==null?void 0:c.remove},[]),!e)return null;if(!l)throw Error("Unsupported captcha site key");return d.jsx("div",{className:"hidden h-0 w-0",children:d.jsx(lre,{...t,ref:o,siteKey:l,options:{action:n,size:"invisible",...t.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{var c;(c=t.onUnsupported)==null||c.call(t),console.warn("Browser does not support Turnstile.")},onError:()=>{var c;(c=t.onError)==null||c.call(t),i("Captcha failed"),s(!1)},onSuccess:c=>{var u;(u=t.onSuccess)==null||u.call(t,c),a(c),s(!1)},onExpire:()=>{var c,u;(c=t.onExpire)==null||c.call(t);try{(u=o.current)==null||u.reset(),i(void 0),a(void 0)}catch{i("expired_and_failed_reset")}}})})};var Oa=function(){return Oa=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0?Ki(Tm,--gl):0,Hg--,xi===10&&(Hg=1,Ex--),xi}function uc(){return xi=gl2||OM(xi)>3?"":" "}function g$e(t,e){for(;--e&&uc()&&!(xi<48||xi>102||xi>57&&xi<65||xi>70&&xi<97););return Cx(t,I6()+(e<6&&M0()==32&&uc()==32))}function FM(t){for(;uc();)switch(xi){case t:return gl;case 34:case 39:t!==34&&t!==39&&FM(xi);break;case 40:t===41&&FM(t);break;case 92:uc();break}return gl}function m$e(t,e){for(;uc()&&t+xi!==57;)if(t+xi===84&&M0()===47)break;return"/*"+Cx(e,gl-1)+"*"+FL(t===47?t:uc())}function y$e(t){for(;!OM(M0());)uc();return Cx(t,gl)}function w$e(t){return h$e(M6("",null,null,null,[""],t=f$e(t),0,[0],t))}function M6(t,e,r,n,i,a,s,o,l){for(var c=0,u=0,f=s,h=0,g=0,m=0,w=1,_=1,v=1,b=0,A="",S=i,j=a,U=n,I=A;_;)switch(m=b,b=uc()){case 40:if(m!=108&&Ki(I,f-1)==58){A6(I+=Er(XC(b),"&","&\f"),"&\f",dre(c?o[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:I+=XC(b);break;case 9:case 10:case 13:case 32:I+=p$e(m);break;case 92:I+=g$e(I6()-1,7);continue;case 47:switch(M0()){case 42:case 47:sy(v$e(m$e(uc(),I6()),e,r,l),l);break;default:I+="/"}break;case 123*w:o[c++]=Yc(I)*v;case 125*w:case 59:case 0:switch(b){case 0:case 125:_=0;case 59+u:v==-1&&(I=Er(I,/\f/g,"")),g>0&&Yc(I)-f&&sy(g>32?WB(I+";",n,r,f-1,l):WB(Er(I," ","")+";",n,r,f-2,l),l);break;case 59:I+=";";default:if(sy(U=zB(I,e,r,c,u,i,o,A,S=[],j=[],f,a),a),b===123)if(u===0)M6(I,e,U,U,S,a,f,o,j);else switch(h===99&&Ki(I,3)===110?100:h){case 100:case 108:case 109:case 115:M6(t,U,U,n&&sy(zB(t,U,U,0,0,i,o,A,i,S=[],f,j),j),i,j,f,o,n?S:j);break;default:M6(I,U,U,U,[""],j,0,o,j)}}c=u=g=0,w=v=1,A=I="",f=s;break;case 58:f=1+Yc(I),g=m;default:if(w<1){if(b==123)--w;else if(b==125&&w++==0&&d$e()==125)continue}switch(I+=FL(b),b*w){case 38:v=u>0?1:(I+="\f",-1);break;case 44:o[c++]=(Yc(I)-1)*v,v=1;break;case 64:M0()===45&&(I+=XC(uc())),h=M0(),u=f=Yc(A=I+=y$e(I6())),b++;break;case 45:m===45&&Yc(I)==2&&(w=0)}}return a}function zB(t,e,r,n,i,a,s,o,l,c,u,f){for(var h=i-1,g=i===0?a:[""],m=hre(g),w=0,_=0,v=0;w0?g[b]+" "+A:Er(A,/&\f/g,g[b])))&&(l[v++]=S);return _x(t,e,r,i===0?xx:o,l,c,u,f)}function v$e(t,e,r,n){return _x(t,e,r,cre,FL(u$e()),Wg(t,2,-2),0,n)}function WB(t,e,r,n,i){return _x(t,e,r,OL,Wg(t,0,n),Wg(t,n+1,-1),n,i)}function gre(t,e,r){switch(l$e(t,e)){case 5103:return nn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return nn+t+t;case 4789:return jy+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nn+t+jy+t+$n+t+t;case 5936:switch(Ki(t,e+11)){case 114:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return nn+t+$n+t+t;case 6165:return nn+t+$n+"flex-"+t+t;case 5187:return nn+t+Er(t,/(\w+).+(:[^]+)/,nn+"box-$1$2"+$n+"flex-$1$2")+t;case 5443:return nn+t+$n+"flex-item-"+Er(t,/flex-|-self/g,"")+(ad(t,/flex-|baseline/)?"":$n+"grid-row-"+Er(t,/flex-|-self/g,""))+t;case 4675:return nn+t+$n+"flex-line-pack"+Er(t,/align-content|flex-|-self/g,"")+t;case 5548:return nn+t+$n+Er(t,"shrink","negative")+t;case 5292:return nn+t+$n+Er(t,"basis","preferred-size")+t;case 6060:return nn+"box-"+Er(t,"-grow","")+nn+t+$n+Er(t,"grow","positive")+t;case 4554:return nn+Er(t,/([^-])(transform)/g,"$1"+nn+"$2")+t;case 6187:return Er(Er(Er(t,/(zoom-|grab)/,nn+"$1"),/(image-set)/,nn+"$1"),t,"")+t;case 5495:case 3959:return Er(t,/(image-set\([^]*)/,nn+"$1$`$1");case 4968:return Er(Er(t,/(.+:)(flex-)?(.*)/,nn+"box-pack:$3"+$n+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nn+t+t;case 4200:if(!ad(t,/flex-|baseline/))return $n+"grid-column-align"+Wg(t,e)+t;break;case 2592:case 3360:return $n+Er(t,"template-","")+t;case 4384:case 3616:return r&&r.some(function(n,i){return e=i,ad(n.props,/grid-\w+-end/)})?~A6(t+(r=r[e].value),"span",0)?t:$n+Er(t,"-start","")+t+$n+"grid-row-span:"+(~A6(r,"span",0)?ad(r,/\d+/):+ad(r,/\d+/)-+ad(t,/\d+/))+";":$n+Er(t,"-start","")+t;case 4896:case 4128:return r&&r.some(function(n){return ad(n.props,/grid-\w+-start/)})?t:$n+Er(Er(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Er(t,/(.+)-inline(.+)/,nn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Yc(t)-1-e>6)switch(Ki(t,e+1)){case 109:if(Ki(t,e+4)!==45)break;case 102:return Er(t,/(.+:)(.+)-([^]+)/,"$1"+nn+"$2-$3$1"+jy+(Ki(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~A6(t,"stretch",0)?gre(Er(t,"stretch","fill-available"),e,r)+t:t}break;case 5152:case 5920:return Er(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,a,s,o,l,c){return $n+i+":"+a+c+(s?$n+i+"-span:"+(o?l:+l-+a)+c:"")+t});case 4949:if(Ki(t,e+6)===121)return Er(t,":",":"+nn)+t;break;case 6444:switch(Ki(t,Ki(t,14)===45?18:11)){case 120:return Er(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+nn+(Ki(t,14)===45?"inline-":"")+"box$3$1"+nn+"$2$3$1"+$n+"$2box$3")+t;case 100:return Er(t,":",":"+$n)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Er(t,"scroll-","scroll-snap-")+t}return t}function K5(t,e){for(var r="",n=0;n-1&&!t.return)switch(t.type){case OL:t.return=gre(t.value,t.length,r);return;case ure:return K5([wf(t,{value:Er(t.value,"@","@"+nn)})],n);case xx:if(t.length)return c$e(r=t.props,function(i){switch(ad(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":gp(wf(t,{props:[Er(i,/:(read-\w+)/,":"+jy+"$1")]})),gp(wf(t,{props:[i]})),DM(t,{props:BB(r,n)});break;case"::placeholder":gp(wf(t,{props:[Er(i,/:(plac\w+)/,":"+nn+"input-$1")]})),gp(wf(t,{props:[Er(i,/:(plac\w+)/,":"+jy+"$1")]})),gp(wf(t,{props:[Er(i,/:(plac\w+)/,$n+"input-$1")]})),gp(wf(t,{props:[i]})),DM(t,{props:BB(r,n)});break}return""})}}var C$e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},uo={},Gg=typeof process<"u"&&uo!==void 0&&(uo.REACT_APP_SC_ATTR||uo.SC_ATTR)||"data-styled",mre="active",yre="data-styled-version",Sx="6.1.13",UL=`/*!sc*/ -`,J5=typeof window<"u"&&"HTMLElement"in window,S$e=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&uo!==void 0&&uo.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&uo.REACT_APP_SC_DISABLE_SPEEDY!==""?uo.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&uo.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&uo!==void 0&&uo.SC_DISABLE_SPEEDY!==void 0&&uo.SC_DISABLE_SPEEDY!==""&&uo.SC_DISABLE_SPEEDY!=="false"&&uo.SC_DISABLE_SPEEDY),A$e={},Ax=Object.freeze([]),qg=Object.freeze({});function wre(t,e,r){return r===void 0&&(r=qg),t.theme!==r.theme&&t.theme||e||r.theme}var vre=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),I$e=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,M$e=/(^-|-$)/g;function HB(t){return t.replace(I$e,"-").replace(M$e,"")}var T$e=/(a)(d)/gi,M4=52,GB=function(t){return String.fromCharCode(t+(t>25?39:97))};function UM(t){var e,r="";for(e=Math.abs(t);e>M4;e=e/M4|0)r=GB(e%M4)+r;return(GB(e%M4)+r).replace(T$e,"$1-$2")}var eS,bre=5381,Jp=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},xre=function(t){return Jp(bre,t)};function BL(t){return UM(xre(t)>>>0)}function k$e(t){return t.displayName||t.name||"Component"}function tS(t){return typeof t=="string"&&!0}var Ere=typeof Symbol=="function"&&Symbol.for,_re=Ere?Symbol.for("react.memo"):60115,N$e=Ere?Symbol.for("react.forward_ref"):60112,L$e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},j$e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},Cre={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},$$e=((eS={})[N$e]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},eS[_re]=Cre,eS);function qB(t){return("type"in(e=t)&&e.type.$$typeof)===_re?Cre:"$$typeof"in t?$$e[t.$$typeof]:L$e;var e}var P$e=Object.defineProperty,R$e=Object.getOwnPropertyNames,VB=Object.getOwnPropertySymbols,D$e=Object.getOwnPropertyDescriptor,O$e=Object.getPrototypeOf,YB=Object.prototype;function Sre(t,e,r){if(typeof e!="string"){if(YB){var n=O$e(e);n&&n!==YB&&Sre(t,n,r)}var i=R$e(e);VB&&(i=i.concat(VB(e)));for(var a=qB(t),s=qB(e),o=0;o0?" Args: ".concat(e.join(", ")):""))}var F$e=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var r=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,a=i;e>=a;)if((a<<=1)<0)throw Qw(16,"".concat(e));this.groupSizes=new Uint32Array(a),this.groupSizes.set(n),this.length=a;for(var s=i;s=this.length||this.groupSizes[e]===0)return r;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),a=i+n,s=i;s=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e0&&(_+="".concat(v,","))}),l+="".concat(m).concat(w,'{content:"').concat(_,'"}').concat(UL)},u=0;u0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===xx&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(J$e,r).replace(n,c))}),s.prefix&&u.push(_$e),u.push(b$e);var f=function(h,g,m,w){g===void 0&&(g=""),m===void 0&&(m=""),w===void 0&&(w="&"),e=w,r=g,n=new RegExp("\\".concat(r,"\\b"),"g");var _=h.replace(Z$e,""),v=w$e(m||g?"".concat(m," ").concat(g," { ").concat(_," }"):_);s.namespace&&(v=Ire(v,s.namespace));var b=[];return K5(v,x$e(u.concat(E$e(function(A){return b.push(A)})))),b};return f.hash=l.length?l.reduce(function(h,g){return g.name||Qw(15),Jp(h,g.name)},bre).toString():"",f}var X$e=new X5,zM=Q$e(),Mre=Et.createContext({shouldForwardProp:void 0,styleSheet:X$e,stylis:zM});Mre.Consumer;Et.createContext(void 0);function WM(){return C.useContext(Mre)}var Tre=function(){function t(e,r){var n=this;this.inject=function(i,a){a===void 0&&(a=zM);var s=n.name+a.hash;i.hasNameForId(n.id,s)||i.insertRules(n.id,s,a(n.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=r,WL(this,function(){throw Qw(12,String(n.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=zM),this.name+e.hash},t}(),ePe=function(t){return t>="A"&&t<="Z"};function ZB(t){for(var e="",r=0;r>>0);if(!r.hasNameForId(this.componentId,s)){var o=n(a,".".concat(s),void 0,this.componentId);r.insertRules(this.componentId,s,o)}i=y0(i,s),this.staticRulesId=s}else{for(var l=Jp(this.baseHash,n.hash),c="",u=0;u>>0);r.hasNameForId(this.componentId,g)||r.insertRules(this.componentId,g,n(c,".".concat(g),void 0,this.componentId)),i=y0(i,g)}}return i},t}(),HL=Et.createContext(void 0);HL.Consumer;var rS={};function nPe(t,e,r){var n=zL(t),i=t,a=!tS(t),s=e.attrs,o=s===void 0?Ax:s,l=e.componentId,c=l===void 0?function(S,j){var U=typeof S!="string"?"sc":HB(S);rS[U]=(rS[U]||0)+1;var I="".concat(U,"-").concat(BL(Sx+U+rS[U]));return j?"".concat(j,"-").concat(I):I}(e.displayName,e.parentComponentId):l,u=e.displayName,f=u===void 0?function(S){return tS(S)?"styled.".concat(S):"Styled(".concat(k$e(S),")")}(t):u,h=e.displayName&&e.componentId?"".concat(HB(e.displayName),"-").concat(e.componentId):e.componentId||c,g=n&&i.attrs?i.attrs.concat(o).filter(Boolean):o,m=e.shouldForwardProp;if(n&&i.shouldForwardProp){var w=i.shouldForwardProp;if(e.shouldForwardProp){var _=e.shouldForwardProp;m=function(S,j){return w(S,j)&&_(S,j)}}else m=w}var v=new rPe(r,h,n?i.componentStyle:void 0);function b(S,j){return function(U,I,B){var V=U.attrs,se=U.componentStyle,Y=U.defaultProps,N=U.foldedComponentIds,k=U.styledComponentId,x=U.target,E=Et.useContext(HL),L=WM(),O=U.shouldForwardProp||L.shouldForwardProp,P=wre(I,E,Y)||qg,R=function(H,ee,J){for(var te,re=Oa(Oa({},ee),{className:void 0,theme:J}),z=0;z2&&X5.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,r,n,i)},t}();function aPe(t){for(var e=[],r=1;r{if(!t||!t.primary[0])return;let e=[t.primary[0]],r=[];for(let n of(t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),t.primary.slice(1)))e.includes(n)?console.warn(`Duplicated login method: ${n}`):e.push(n);for(let n of t.overflow??[])e.includes(n)||r.includes(n)?console.warn(`Duplicated login method: ${n}`):r.push(n);return{primary:e,overflow:r}};let oPe=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),ez=t=>oPe.has(t),tz=(t,e,r)=>r.indexOf(t)===e;const lPe=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(ez).filter(tz):t?t.filter(ez).filter(tz):ao.appearance.walletList;function GL(t){let e=t.filter(r=>!rre.has(r.id));return G5.concat(e)}function cPe(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const uPe="https://api.mainnet-beta.solana.com",dPe="https://api.testnet.solana.com",fPe="https://api.devnet.solana.com",GM=792703809,qM="11111111111111111111111111111111",hPe="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function qL(t){return t.includes("testnet")?"testnet":t.includes("devnet")?"devnet":"mainnet-beta"}function pPe(t,e){return`https://explorer.solana.com/tx/${t}?cluster=${e}`}function gPe(t,e){return`https://explorer.solana.com/account/${t}?cluster=${e}`}function mPe({name:t,rpcUrl:e}){if(e)return e;switch(t){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}function e8(t){"@babel/helpers - typeof";return e8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e8(t)}var yPe=/^\s+/,wPe=/\s+$/;function $t(t,e){if(t=t||"",e=e||{},t instanceof $t)return t;if(!(this instanceof $t))return new $t(t,e);var r=vPe(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}$t.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,n,i,a,s,o;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*s+.0722*o},setAlpha:function(e){return this._a=Pre(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=nz(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=nz(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=rz(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=rz(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return iz(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return _Pe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Fn(this._r,255)*100)+"%",g:Math.round(Fn(this._g,255)*100)+"%",b:Math.round(Fn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Fn(this._r,255)*100)+"%, "+Math.round(Fn(this._g,255)*100)+"%, "+Math.round(Fn(this._b,255)*100)+"%)":"rgba("+Math.round(Fn(this._r,255)*100)+"%, "+Math.round(Fn(this._g,255)*100)+"%, "+Math.round(Fn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:PPe[iz(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+az(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var a=$t(e);n="#"+az(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(e){var r=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return a?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return $t(this.toString())},_applyModification:function(e,r){var n=e.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(IPe,arguments)},brighten:function(){return this._applyModification(MPe,arguments)},darken:function(){return this._applyModification(TPe,arguments)},desaturate:function(){return this._applyModification(CPe,arguments)},saturate:function(){return this._applyModification(SPe,arguments)},greyscale:function(){return this._applyModification(APe,arguments)},spin:function(){return this._applyModification(kPe,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(jPe,arguments)},complement:function(){return this._applyCombination(NPe,arguments)},monochromatic:function(){return this._applyCombination($Pe,arguments)},splitcomplement:function(){return this._applyCombination(LPe,arguments)},triad:function(){return this._applyCombination(sz,[3])},tetrad:function(){return this._applyCombination(sz,[4])}};$t.fromRatio=function(t,e){if(e8(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=oy(t[n]));t=r}return $t(t,e)};function vPe(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,a=null,s=!1,o=!1;return typeof t=="string"&&(t=FPe(t)),e8(t)=="object"&&(Ju(t.r)&&Ju(t.g)&&Ju(t.b)?(e=bPe(t.r,t.g,t.b),s=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):Ju(t.h)&&Ju(t.s)&&Ju(t.v)?(n=oy(t.s),i=oy(t.v),e=EPe(t.h,n,i),s=!0,o="hsv"):Ju(t.h)&&Ju(t.s)&&Ju(t.l)&&(n=oy(t.s),a=oy(t.l),e=xPe(t.h,n,a),s=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=Pre(r),{ok:s,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function bPe(t,e,r){return{r:Fn(t,255)*255,g:Fn(e,255)*255,b:Fn(r,255)*255}}function rz(t,e,r){t=Fn(t,255),e=Fn(e,255),r=Fn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,s,o=(n+i)/2;if(n==i)a=s=0;else{var l=n-i;switch(s=o>.5?l/(2-n-i):l/(n+i),n){case t:a=(e-r)/l+(e1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(e===0)n=i=a=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=s(l,o,t+1/3),i=s(l,o,t),a=s(l,o,t-1/3)}return{r:n*255,g:i*255,b:a*255}}function nz(t,e,r){t=Fn(t,255),e=Fn(e,255),r=Fn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,s,o=n,l=n-i;if(s=n===0?0:l/n,n==i)a=0;else{switch(n){case t:a=(e-r)/l+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push($t(n));return a}function $Pe(t,e){e=e||6;for(var r=$t(t).toHsv(),n=r.h,i=r.s,a=r.v,s=[],o=1/e;e--;)s.push($t({h:n,s:i,v:a})),a=(a+o)%1;return s}$t.mix=function(t,e,r){r=r===0?0:r||50;var n=$t(t).toRgb(),i=$t(e).toRgb(),a=r/100,s={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return $t(s)};$t.readability=function(t,e){var r=$t(t),n=$t(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};$t.isReadable=function(t,e,r){var n=$t.readability(t,e),i,a;switch(a=!1,i=UPe(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};$t.mostReadable=function(t,e,r){var n=null,i=0,a,s,o,l;r=r||{},s=r.includeFallbackColors,o=r.level,l=r.size;for(var c=0;ci&&(i=a,n=$t(e[c]));return $t.isReadable(t,n,{level:o,size:l})||!s?n:(r.includeFallbackColors=!1,$t.mostReadable(t,["#fff","#000"],r))};var VM=$t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},PPe=$t.hexNames=RPe(VM);function RPe(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function Pre(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Fn(t,e){DPe(t)&&(t="100%");var r=OPe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Ix(t){return Math.min(1,Math.max(0,t))}function so(t){return parseInt(t,16)}function DPe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function OPe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function rc(t){return t.length==1?"0"+t:""+t}function oy(t){return t<=1&&(t=t*100+"%"),t}function Rre(t){return Math.round(parseFloat(t)*255).toString(16)}function oz(t){return so(t)/255}var Hl=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Ju(t){return!!Hl.CSS_UNIT.exec(t)}function FPe(t){t=t.replace(yPe,"").replace(wPe,"").toLowerCase();var e=!1;if(VM[t])t=VM[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Hl.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Hl.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Hl.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Hl.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Hl.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Hl.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Hl.hex8.exec(t))?{r:so(r[1]),g:so(r[2]),b:so(r[3]),a:oz(r[4]),format:e?"name":"hex8"}:(r=Hl.hex6.exec(t))?{r:so(r[1]),g:so(r[2]),b:so(r[3]),format:e?"name":"hex"}:(r=Hl.hex4.exec(t))?{r:so(r[1]+""+r[1]),g:so(r[2]+""+r[2]),b:so(r[3]+""+r[3]),a:oz(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=Hl.hex3.exec(t))?{r:so(r[1]+""+r[1]),g:so(r[2]+""+r[2]),b:so(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function UPe(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}let lz="#FFFFFF";function BPe(t){return t<.8&&t>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),t>.5?"light":"dark"}function As(t,e){let r=Math.max(0,Math.min(1,t.toHsl().l+e));return $t({...t.toHsl(),l:r})}function zPe({backgroundTheme:t,accentHex:e}){let r;switch(t){case"light":r=lz;break;case"dark":r="#1E1E1D";break;default:r=t}let n=$t(r),i=$t(e),a=$t("#51BA81"),s=$t("#FFB74D"),o=$t("#EC6351"),l=BPe(n.getLuminance()),c=As(n,l==="light"?-.04:.11),u=As(n,l==="light"?-.08:.16),f=As(n,l==="light"?-.88:.87),h=As(n,l==="light"?-.7:.75),g=As(n,l==="light"?-.43:.45).desaturate(l==="light"?60:20),m=As(n,l==="light"?-.08:.25).desaturate(l==="light"?60:20),w=As(i,.15),_=As(i,.25),v=As(i,-.06),b=As(i,-.6),A=As(o,.3),S=As(s,.3),j=$t(i.getLuminance()>.5?"#040217":lz),U=As(a,-.16),I=As(a,.4);return{colorScheme:l,background:n.toHslString(),background2:c.toHslString(),background3:u.toHslString(),foreground:f.toHslString(),foreground2:h.toHslString(),foreground3:g.toHslString(),foreground4:m.toHslString(),accent:i.toHslString(),accentLight:w.toHslString(),accentLightest:_.toHslString(),accentDark:v.toHslString(),accentDarkest:b.toHslString(),foregroundAccent:j.toHslString(),success:a.toHslString(),successDark:U.toHslString(),successLight:I.toHslString(),error:o.toHslString(),errorLight:A.toHslString(),warn:s.toHslString(),warnLight:S.toHslString()}}function Dre(t,e,r){var M,D,$,X,le,H,ee,J,te,re,z,G,Z,me,be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne,Pe,$e,K,F,W,ie,pe,we,he,De,Je,et,it,ut,pt,tr;let n,i,a,s,o,l,c,u,f,h,g,m,w,_,v,b,A=r?console.warn:()=>{};e!=null&&e.loginMethods?(n=e.loginMethods.includes("email"),i=e.loginMethods.includes("sms"),s=e.loginMethods.includes("wallet"),o=e.loginMethods.includes("google"),l=e.loginMethods.includes("twitter"),c=e.loginMethods.includes("discord"),f=e.loginMethods.includes("spotify"),h=e.loginMethods.includes("instagram"),u=e.loginMethods.includes("tiktok"),m=e.loginMethods.includes("github"),g=e.loginMethods.includes("linkedin"),w=e.loginMethods.includes("apple"),_=e.loginMethods.includes("farcaster"),v=e.loginMethods.includes("telegram")):(n=t.emailAuth,i=t.smsAuth,s=t.walletAuth||t.solanaWalletAuth,o=t.googleOAuth,l=t.twitterOAuth,c=t.discordOAuth,m=t.githubOAuth,f=t.spotifyOAuth,h=t.instagramOAuth,u=t.tiktokOAuth,g=t.linkedinOAuth,w=t.appleOAuth,_=t.farcasterAuth,v=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:t.passkeyAuth&&(a=!0);let S=[n,i].filter(Boolean),j=[o,l,c,m,f,h,u,g,w,_,v].filter(Boolean),U=[s].filter(Boolean);if(S.length+j.length+U.length===0)throw Error("You must enable at least one login method");let I=((M=e==null?void 0:e.appearance)==null?void 0:M.showWalletLoginFirst)!==void 0?(D=e==null?void 0:e.appearance)==null?void 0:D.showWalletLoginFirst:t.showWalletLoginFirst;I&&U.length===0?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):I||j.length+S.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let B=((X=($=e==null?void 0:e.externalWallets)==null?void 0:$.walletConnect)==null?void 0:X.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let V=lPe({input:(le=e==null?void 0:e.appearance)==null?void 0:le.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder}),se=sPe({input:e==null?void 0:e.loginMethodsAndOrder}),Y=((H=e==null?void 0:e.intl)==null?void 0:H.defaultCountry)??"US",{chains:N,defaultChain:k}=HPe({additionalChains:e==null?void 0:e.additionalChains,supportedChains:e==null?void 0:e.supportedChains,defaultChainFromConfig:e==null?void 0:e.defaultChain,hasRpcConfigDefined:Object.keys(((ee=e==null?void 0:e.rpcConfig)==null?void 0:ee.rpcUrls)??{}).length>0}),x=!!(e!=null&&e.defaultChain),E=((J=e==null?void 0:e.customAuth)==null?void 0:J.getCustomAccessToken)&&((te=e==null?void 0:e.customAuth)==null?void 0:te.enabled)!==!1,L=!(t.enforceWalletUis??1);if(b=t.legacyWalletUiConfig??1?E?((re=e==null?void 0:e.embeddedWallets)==null?void 0:re.noPromptOnSignature)??!0:((z=e==null?void 0:e.embeddedWallets)==null?void 0:z.noPromptOnSignature)??L:L,((G=e==null?void 0:e.embeddedWallets)==null?void 0:G.waitForTransactionConfirmation)===!1&&b!==!0)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:O,...P}=(e==null?void 0:e.embeddedWallets)??{},R=(e==null?void 0:e.solanaClusters)??[];return t.solanaWalletAuth&&!((me=(Z=e==null?void 0:e.externalWallets)==null?void 0:Z.solana)!=null&&me.connectors)&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:((be=e==null?void 0:e.appearance)==null?void 0:be.logo)??t.logoUrl,landingHeader:((Ce=e==null?void 0:e.appearance)==null?void 0:Ce.landingHeader)??ao.appearance.landingHeader,loginMessage:typeof((Fe=e==null?void 0:e.appearance)==null?void 0:Fe.loginMessage)=="string"?(Ue=e==null?void 0:e.appearance)==null?void 0:Ue.loginMessage.slice(0,100):(Ke=e==null?void 0:e.appearance)==null?void 0:Ke.loginMessage,palette:zPe({backgroundTheme:((lt=e==null?void 0:e.appearance)==null?void 0:lt.theme)??ao.appearance.theme,accentHex:((Ee=e==null?void 0:e.appearance)==null?void 0:Ee.accentColor)??t.accentColor??ao.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((He=e==null?void 0:e.appearance)!=null&&He.hideDirectWeb2Inputs),walletList:V,walletChainType:((qe=e==null?void 0:e.appearance)==null?void 0:qe.walletChainType)??(({evmWalletAuth:zt,solanaWalletAuth:At})=>zt&&At?"ethereum-and-solana":zt?"ethereum-only":At?"solana-only":"ethereum-only")({evmWalletAuth:t.walletAuth??!1,solanaWalletAuth:t.solanaWalletAuth??!1})},loginMethods:{wallet:s,email:n,sms:i,passkey:a,google:o,twitter:l,discord:c,github:m,spotify:f,instagram:h,tiktok:u,linkedin:g,apple:w,farcaster:_,telegram:v},disablePlusEmails:t.disablePlusEmails,loginMethodsAndOrder:se,legal:{termsAndConditionsUrl:((Ie=e==null?void 0:e.legal)==null?void 0:Ie.termsAndConditionsUrl)??t.termsAndConditionsUrl,privacyPolicyUrl:((Ne=e==null?void 0:e.legal)==null?void 0:Ne.privacyPolicyUrl)??t.privacyPolicyUrl,requireUsersAcceptTerms:t.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:(e==null?void 0:e.walletConnectCloudProjectId)??t.walletConnectCloudProjectId??ao.walletConnectCloudProjectId,rpcConfig:{rpcUrls:((Pe=e==null?void 0:e.rpcConfig)==null?void 0:Pe.rpcUrls)??ao.rpcConfig.rpcUrls,rpcTimeouts:(($e=e==null?void 0:e.rpcConfig)==null?void 0:$e.rpcTimeouts)??ao.rpcConfig.rpcTimeouts},chains:N,solanaClusters:{"mainnet-beta":((K=R.find(zt=>zt.name==="mainnet-beta"))==null?void 0:K.rpcUrl)||uPe,testnet:((F=R.find(zt=>zt.name==="testnet"))==null?void 0:F.rpcUrl)||dPe,devnet:((W=R.find(zt=>zt.name==="devnet"))==null?void 0:W.rpcUrl)||fPe},defaultChain:k,intl:{defaultCountry:Y},shouldEnforceDefaultChainOnConnect:x,captchaEnabled:t.captchaEnabled??ao.captchaEnabled,captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:((pe=(ie=e==null?void 0:e.externalWallets)==null?void 0:ie.coinbaseWallet)==null?void 0:pe.connectionOptions)??ao.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:B},solana:{connectors:(he=(we=e==null?void 0:e.externalWallets)==null?void 0:we.solana)==null?void 0:he.connectors}},embeddedWallets:{...t.embeddedWalletConfig,...typeof O=="boolean"?{requireUserOwnedRecoveryOnCreate:O}:{},...E?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...P,noPromptOnSignature:b,showWalletUIs:(De=e==null?void 0:e.embeddedWallets)==null?void 0:De.showWalletUIs,extendedCalldataDecoding:(Je=e==null?void 0:e.embeddedWallets)==null?void 0:Je.extendedCalldataDecoding},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:((et=e==null?void 0:e.mfa)==null?void 0:et.noPromptOnMfaRequired)??!1},customAuth:E?{enabled:!0,...e.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration},headless:!!(e!=null&&e.headless),render:{standalone:((it=e==null?void 0:e._render)==null?void 0:it.standalone)??ao._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??ao.fundingMethodConfig,moonpay:{...((ut=e==null?void 0:e.fundingMethodConfig)==null?void 0:ut.moonpay)??ao.fundingMethodConfig.moonpay,useSandbox:((pt=e==null?void 0:e.fundingMethodConfig)==null?void 0:pt.moonpay.useSandbox)??((tr=e==null?void 0:e.fiatOnRamp)==null?void 0:tr.useSandbox)??ao.fundingMethodConfig.moonpay.useSandbox}}}}function WPe(t,e){var l,c;if(!t)return{legacyCreateEmbeddedWalletFlag:e};let{appearance:r,additionalChains:n,supportedChains:i,defaultChain:a,externalWallets:s,...o}=t;return{...o,...n?{additionalChains:n.map(u=>u.id)}:void 0,...i?{supportedChains:i.map(u=>u.id)}:void 0,...a?{defaultChain:a.id}:void 0,...s?{walletConnect:s.walletConnect,coinbaseWallet:s.coinbaseWallet,solana:{connectors:(c=(l=s.solana)==null?void 0:l.connectors)==null?void 0:c.get().map(u=>u.walletClientType)}}:void 0,legacyCreateEmbeddedWalletFlag:e}}function HPe({additionalChains:t,supportedChains:e,defaultChainFromConfig:r,hasRpcConfigDefined:n}){let i;if(t&&e&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),e){if(e.length===0)throw Error("`supportedChains` must contain at least one chain");e.filter(o=>o.rpcUrls.privyWalletOverride).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),i=e.map(o=>{var u;if(o.rpcUrls.privyWalletOverride)return o;let l=G5.find(f=>f.id===o.id),c=(u=l==null?void 0:l.rpcUrls.privy)==null?void 0:u.http[0];return c?cPe(o,c):o})}else i=G5.concat(t??[]);let a=e?i[0]:Nu,s=r??a;if(!i.find(o=>o.id===s.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:s}}const GPe=function(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i,a=0;a>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)};let Ore={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const Fre=Dre(Ore,void 0,!1);let VL=C.createContext({appConfig:Fre,isServerConfigLoaded:!1});const qPe=({children:t,legacyCreateEmbeddedWalletFlag:e,client:r,clientConfig:n})=>{let[i,a]=C.useState(null),s=C.useMemo(()=>Dre(i??Ore,n,!!i),[i,n]);return C.useEffect(()=>{if(!i)return;let o=WPe(n,e),l=GPe(JSON.stringify(o)).toString(),c=`privy:sent:${i.id}:${l}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:o}),localStorage.setItem(c,"t"))},[n,e,i]),C.useEffect(()=>{i||(async()=>{try{let o=await r.getServerConfig();o.customApiUrl&&r.updateApiUrl(o.customApiUrl),a(o)}catch(o){console.warn("Error generating app config: ",o)}})()},[]),d.jsx(VL.Provider,{value:{appConfig:s,isServerConfigLoaded:!!i},children:t})},Ai=()=>{let{appConfig:t}=C.useContext(VL);return t},VPe=()=>{let{isServerConfigLoaded:t}=C.useContext(VL);return t},Ure=C.createContext({setAuthenticated:Re,setUser:Re,isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:Re,initializeWalletProxy:Re,getAuthMeta:Re,getAuthFlow:Re,closePrivyModal:Re,openPrivyModal:Re,connectWallet:Re,initLoginWithWallet:Re,loginWithWallet:Re,initLoginWithFarcaster:Re,loginWithFarcaster:Re,loginWithCode:Re,initLoginWithEmail:Re,initLoginWithSms:Re,initUpdateEmail:Re,initUpdatePhone:Re,resendEmailCode:Re,resendSmsCode:Re,initLoginWithHeadlessOAuth:Re,loginWithHeadlessOAuth:Re,crossAppAuthFlow:Re,initLoginWithOAuth:Re,recoveryOAuthFlow:Re,loginWithOAuth:Re,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Re,initLoginWithPasskey:Re,loginWithPasskey:Re,initLinkWithPasskey:Re,linkWithPasskey:Re,refreshUser:Re,loginWithGuestAccountFlow:Re,walletProxy:null,createAnalyticsEvent:Re,acceptTerms:Re,getUsdTokenPrice:Re,getUsdPriceForSol:Re,recoverPrimaryWallet:Re,updateWallets:Re,fundWallet:Re,openModal:Re,setReadyToTrue:Re,requestFarcasterSignerStatus:Re,initLoginWithTelegram:Re,loginWithTelegram:Re,generateSiweMessage:Re,generateSiweMessageForSmartWallet:Re,linkWithSiwe:Re,linkSmartWallet:Re,delegateWallet:Re,revokeDelegatedWallets:Re,createEmbeddedSolanaWallet:Re,exportSolanaWallet:Re,solanaSignMessage:Re,connectCoinbaseSmartWallet:Re,initiateAccountTransfer:Re,emailOtpState:{status:"initial"},setEmailOtpState:Re,smsOtpState:{status:"initial"},setSmsOtpState:Re,siweState:{status:"initial"},setSiweState:Re,oAuthState:{status:"initial"},setOAuthState:Re,isHeadlessOAuthLoading:!1}),_t=()=>C.useContext(Ure);function YPe({src:t,...e}){return d.jsx("img",{src:t,...e,style:{display:"none"}})}var Ht,ye=((Ht={}).LANDING="LANDING",Ht.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Ht.AWAITING_CONNECTION="AWAITING_CONNECTION",Ht.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Ht.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Ht.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Ht.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Ht.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Ht.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Ht.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Ht.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Ht.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Ht.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Ht.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Ht.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Ht.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Ht.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Ht.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Ht.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Ht.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Ht.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Ht.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Ht.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Ht.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Ht.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Ht.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Ht.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Ht.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Ht.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Ht.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Ht.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Ht.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Ht.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Ht.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Ht.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",Ht.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",Ht.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Ht.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Ht.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Ht.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Ht.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Ht.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Ht.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Ht.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Ht.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Ht.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Ht.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Ht.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Ht.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Ht.ERROR_SCREEN="ERROR_SCREEN",Ht.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Ht.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Ht.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Ht);const Bre=C.createContext({ready:!1,app:Fre,currentScreen:null,lastScreen:null,navigate:Re,navigateBack:Re,resetNavigation:Re,setModalData:Re,onUserCloseViaDialogOrKeybindRef:void 0});let KPe=[ye.LANDING,ye.CONNECT_ONLY_LANDING_SCREEN,null];const JPe=t=>{var o;let e=Ai(),r=t.authenticated,[n,i]=C.useState(t.initialScreen);C.useEffect(()=>{r||KPe.includes(t.initialScreen)||t.setInitialScreen(null)},[r]);let a=C.useRef(null);C.useEffect(()=>{t.open||(a.current=null)},[t.open]),C.useEffect(()=>{a.current=null},[t.initialScreen]);let s={ready:!!e.id,app:e,data:t.data,setModalData:t.setModalData,currentScreen:t.initialScreen,lastScreen:n,navigate:(l,c=!0)=>{t.setInitialScreen(l),c&&i(t.initialScreen)},navigateBack:()=>{t.setInitialScreen(n)},resetNavigation:()=>{t.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:a};return d.jsxs(Bre.Provider,{value:s,children:[(typeof e.appearance.logo=="string"||((o=e.appearance.logo)==null?void 0:o.type)==="img")&&d.jsx(YPe,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},wt=()=>C.useContext(Bre),km=C.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:Re,login:Re,connectOrCreateWallet:Re,linkEmail:Re,linkPhone:Re,linkFarcaster:Re,linkWallet:Re,startCrossAppAuthFlow:Re,linkGoogle:Re,linkTwitter:Re,linkDiscord:Re,linkGithub:Re,linkSpotify:Re,linkInstagram:Re,linkTelegram:Re,linkTiktok:Re,linkLinkedIn:Re,linkApple:Re,linkPasskey:Re,updateEmail:Re,updatePhone:Re,logout:Re,getAccessToken:Re,getEthereumProvider:Re,getEthersProvider:Re,getWeb3jsProvider:Re,unlinkEmail:Re,unlinkPhone:Re,unlinkWallet:Re,unlinkGoogle:Re,unlinkTwitter:Re,unlinkDiscord:Re,unlinkGithub:Re,unlinkSpotify:Re,unlinkInstagram:Re,unlinkTiktok:Re,unlinkLinkedIn:Re,unlinkApple:Re,unlinkCrossAppAccount:Re,unlinkFarcaster:Re,unlinkTelegram:Re,unlinkPasskey:Re,setActiveWallet:Re,forkSession:Re,createWallet:Re,signMessage:Re,signTypedData:Re,enrollInMfa:Re,initEnrollmentWithSms:Re,initEnrollmentWithTotp:Re,initEnrollmentWithPasskey:Re,promptMfa:Re,init:Re,submitEnrollmentWithSms:Re,submitEnrollmentWithTotp:Re,submitEnrollmentWithPasskey:Re,unenroll:Re,submit:Re,cancel:Re,sendTransaction:Re,sendSolanaTransaction:Re,exportWallet:Re,setWalletPassword:Re,setWalletRecovery:Re,requestFarcasterSignerFromWarpcast:Re,getFarcasterSignerPublicKey:Re,signFarcasterMessage:Re,createGuestAccount:Re,signMessageWithCrossAppWallet:Re,signTypedDataWithCrossAppWallet:Re,sendTransactionWithCrossAppWallet:Re,isModalOpen:!1,mfaMethods:[]}),$r=()=>C.useContext(km),ZPe=t=>{let[e,r]=C.useState("auto");return C.useEffect(()=>{let n=new ResizeObserver(i=>{var a;r(((a=i[0])==null?void 0:a.contentRect.height)??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),e},QPe={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},zre=C.createContext(void 0);let Wre=()=>C.useContext(zre);function YL(t,e){if(!e)return;let r=Wre().current[t];return C.useEffect(()=>{var n;for(let[i,a]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,i)||console.warn(`Invalid event type "${i}" for action "${t}"`),(n=r[i])==null||n.push(a);return()=>{var i;for(let[a,s]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,a)||console.warn(`Invalid event type "${a}" for action "${t}"`),r[a]=(i=r[a])==null?void 0:i.filter(o=>o!==s)}},[e])}function ze(t,e,r,...n){for(let i of t.current[e][r])i(...n)}function KL(){let t=Wre();return(e,r,...n)=>ze(t,e,r,...n)}function XPe(t){YL("configureMfa",t)}function eRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const T0=C.forwardRef(eRe),wc=({success:t,fail:e})=>d.jsxs(d.Fragment,{children:[d.jsx(ml,{className:t?"success":e?"fail":""}),d.jsx(JL,{className:t?"success":e?"fail":""})]}),ml=fe.span.withConfig({displayName:"Loader",componentId:"sc-ce7792e2-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-success);border-bottom-color:var(--privy-color-success);}&&&.fail{border-color:var(--privy-color-error);border-bottom-color:var(--privy-color-error);}"],t=>t.color??"var(--privy-color-accent)"),JL=fe(ml).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],t=>t.color??"var(--privy-color-accent)"),Eh=t=>d.jsx(tRe,{color:t.color||"var(--privy-color-foreground-3)"});let tRe=fe(ml).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const Mx=fe.button.withConfig({displayName:"Button",componentId:"sc-e15d0508-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{padding:12px 16px;}"]),Ot=({children:t,loading:e,disabled:r,success:n,loadingText:i="Loading...",...a})=>d.jsx(Hre,{disabled:e||r,success:n,...a,children:e?d.jsxs("span",{children:[d.jsx(Eh,{}),i?d.jsx("span",{children:i}):null]}):t}),W3=({children:t,loading:e,disabled:r,...n})=>d.jsx(rRe,{disabled:r,...n,children:e?d.jsx(Eh,{color:"var(--privy-color-foreground-accent)"}):t});let rRe=fe(Mx).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-e15d0508-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;pointer-events:none;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent-dark);}"]);const nRe=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(Hre,{as:"a",disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(Eh,{}),n?d.jsx("span",{children:n}):null]}):t});let Hre=fe(Mx).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-e15d0508-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}"," > span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.disabled?oa(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):"");const zd=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(iRe,{disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(Eh,{}),n?d.jsx("span",{children:n}):null]}):t});let iRe=fe(Mx).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-e15d0508-3"})(["&&{border-width:1px;border-color:",";color:var(--privy-color-foreground);transition:border-color 200ms ease;}&:hover,&:active{border-color:",";}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-3);cursor:not-allowed;}> span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)",t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)");const ZL=fe.button.withConfig({displayName:"SoftCtaButton",componentId:"sc-e15d0508-4"})(["&&{padding:12px 16px;font-weight:500;text-align:center;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent);border-radius:var(--privy-border-radius-sm);min-width:144px;opacity:",";transition:opacity 200ms ease,background-color 200ms ease,color 200ms ease;user-select:none;"," &:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.invisible?"0":"1",t=>t.invisible&&oa(["pointer-events:none;"])),QL=({children:t,onClick:e,disabled:r,isSubmitting:n,...i})=>d.jsxs(aRe,{$isSubmitting:n,onClick:e,disabled:r,...i,children:[d.jsx("span",{children:t}),d.jsx("span",{children:d.jsx(Eh,{})})]});let aRe=fe.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-e15d0508-6"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.$isSubmitting?0:1,t=>t.$isSubmitting?1:0);const Gre=fe.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");function sRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const oRe=C.forwardRef(sRe);function lRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const cRe=C.forwardRef(lRe);function uRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const dRe=C.forwardRef(uRe),qre=({backFn:t})=>d.jsx("div",{children:d.jsx(Tx,{onClick:t,children:d.jsx(oRe,{height:"16px",width:"16px",strokeWidth:2})})}),fRe=({nextFn:t})=>d.jsx("div",{children:d.jsx(Tx,{onClick:t,children:d.jsx(cRe,{height:"16px",width:"16px",strokeWidth:2})})}),hRe=({infoFn:t})=>d.jsx("div",{children:d.jsx(gRe,{"aria-label":"info",onClick:t,children:d.jsx(T0,{height:"22px",width:"22px",strokeWidth:2})})}),pRe=t=>d.jsx("div",{children:d.jsx(Tx,{"aria-label":"close modal",onClick:t.onClose,children:d.jsx(dRe,{height:"16px",width:"16px",strokeWidth:2})})}),ft=({backFn:t,infoFn:e,onClose:r,title:n,closeable:i=!0})=>{let{closePrivyModal:a}=_t(),s=Ai();return d.jsxs(mRe,{children:[d.jsxs(yRe,{children:[t&&d.jsx(qre,{backFn:t}),e&&d.jsx(hRe,{infoFn:e})]}),n&&d.jsx(vRe,{id:"privy-dialog-title",children:n}),d.jsx(wRe,{children:!s.render.standalone&&i&&d.jsx(pRe,{onClose:r||(()=>a())})})]})};let Tx=fe.button.withConfig({displayName:"StyledButton",componentId:"sc-f295093d-0"})(["&&{cursor:pointer;display:flex;opacity:0.6;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-full);padding:4px;> svg{margin:auto;color:var(--privy-color-foreground);}:hover{opacity:1;}}"]),gRe=fe(Tx).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),mRe=fe.div.withConfig({displayName:"StyledHeader",componentId:"sc-f295093d-2"})(["padding:16px 0;display:flex;align-items:center;justify-content:space-between;h2{font-size:16px;line-height:24px;font-weight:600;color:var(--privy-color-foreground);}"]),yRe=fe.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),wRe=fe.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),vRe=fe.div.withConfig({displayName:"TitleContainer",componentId:"sc-f295093d-5"})(["overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis;text-align:center;color:var(--privy-color-foreground-2);"]),Vs=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-f7e7d474-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const ah=fe.div.withConfig({displayName:"Grow",componentId:"sc-b51c7c74-0"})(["text-align:left;flex-grow:1;"]),Vre=fe.div.withConfig({displayName:"AlignBottom",componentId:"sc-b51c7c74-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),sh=fe.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-b51c7c74-2"})(["display:flex;flex-direction:column;gap:12px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),bRe=fe(sh).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-b51c7c74-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],t=>t.$colorScheme==="light"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":t.$colorScheme==="dark"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0);let Yre=oa(["&&{width:100%;font-size:16px;line-height:24px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;padding:12px 16px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-mdlg);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}svg{height:24px;max-height:24px;max-width:24px;}}"]);const Kre=fe.div.withConfig({displayName:"Subtitle",componentId:"sc-b51c7c74-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Jn=fe.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-b51c7c74-5"})(["",""],Yre),cz=fe.a.withConfig({displayName:"LoginMethodButtonLink",componentId:"sc-b51c7c74-6"})(["",""],Yre),Z0=fe.div.withConfig({displayName:"Hide",componentId:"sc-b51c7c74-7"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],t=>t.$if?"display: none;":""),xRe=fe.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-b51c7c74-8"})(["width:100%;height:100%;padding:",";"],t=>t.$withPadding?"64px 0px":"0px"),ERe=fe.div.withConfig({displayName:"Header",componentId:"sc-b51c7c74-9"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),_Re=()=>{let{navigate:t,app:e}=wt();return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(CRe,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(Gre,{color:"var(--privy-color-warn-light)"}),d.jsx(T0,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),d.jsxs(SRe,{children:[d.jsx("h3",{children:"Account not found"}),d.jsxs("p",{children:["Please try logging in again or go to ",e.name," to create an account."]})]}),d.jsx(ah,{}),d.jsx(Ot,{onClick:()=>t(ye.LANDING),children:"Try logging in again"})]})]})};let CRe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-408d3d00-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;margin-top:24px;"]),SRe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-408d3d00-1"})(["display:flex;flex-direction:column;gap:8px;"]);function ARe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const Jd=C.forwardRef(ARe);function IRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))}const Xw=C.forwardRef(IRe),XL=fe.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");function MRe(t){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...t,children:d.jsx("g",{fill:t.color||"var(--privy-color-foreground)",children:d.jsx("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let uz=fe.div.withConfig({displayName:"TermsAndConditionsContainer",componentId:"sc-c97bf02f-0"})(["margin-top:16px;font-size:13px;text-align:center;color:var(--privy-color-foreground-3);&& > a{color:var(--privy-color-accent);}"]);function ej(t){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:r,requireUsersAcceptTerms:n}}=t.app;if(n&&!t.alwaysShowImplicitConsent||!r&&!e)return d.jsx(uz,{});let i=!(!e||!r);return d.jsxs(uz,{children:["By logging in I agree to the"," ",r&&d.jsx("a",{href:r,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",e&&d.jsx("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const Zt=()=>d.jsx(kr,{children:d.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:d.jsx(MRe,{height:13,width:150})})}),kr=fe.div.withConfig({displayName:"ModalFooter",componentId:"sc-c97bf02f-1"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]);function TRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const kRe=C.forwardRef(TRe);function NRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"}))}const Jre=C.forwardRef(NRe),wo=({address:t,showCopyIcon:e,url:r,className:n})=>{let[i,a]=C.useState(!1);return C.useEffect(()=>{if(i){let s=setTimeout(()=>a(!1),2e3);return()=>clearTimeout(s)}},[i]),r?d.jsx("a",{title:t,className:n,href:`${r}/address/${t}`,target:"_blank",children:ns(t)}):d.jsxs("button",{title:t,className:n,onClick:s=>(s.stopPropagation(),navigator.clipboard.writeText(t).then(()=>a(!0)).catch(console.error)),children:[ns(t),e&&d.jsx(i?jRe:LRe,{})]})};let LRe=fe(Jre).withConfig({displayName:"StyledSquare2StackIcon",componentId:"sc-6eaa0c94-0"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-foreground-3);"]),jRe=fe(kRe).withConfig({displayName:"StyledCheckIcon",componentId:"sc-6eaa0c94-1"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-success);"]);function Zre(t){return t.charAt(0).toUpperCase()+t.slice(1)}const Qre=({onTransfer:t,isTransferring:e,transferSuccess:r})=>d.jsx(Ot,{...r?{success:!0,children:"Success!"}:{warn:!0,loading:e,onClick:t,children:"Transfer and delete account"}});function $Re({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const kx=C.forwardRef($Re),Xre=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-aa2e65ff-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),YM=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-aa2e65ff-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),ene=fe.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-aa2e65ff-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),tne=fe(kx).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-aa2e65ff-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],t=>`${t.iconSize}px`,t=>`${t.iconSize}px`),PRe=fe(Jre).withConfig({displayName:"StyledCopyIcon",componentId:"sc-aa2e65ff-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),RRe=fe.ol.withConfig({displayName:"ListContainer",componentId:"sc-aa2e65ff-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),dz=fe.li.withConfig({displayName:"ListItem",componentId:"sc-aa2e65ff-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),DRe=fe.div.withConfig({displayName:"CircleContainer",componentId:"sc-aa2e65ff-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let ORe=()=>d.jsx(DRe,{children:d.jsx(tne,{iconSize:60})});const FRe=({address:t,onClose:e,onRetry:r,onTransfer:n,isTransferring:i,transferSuccess:a})=>{var l;let{defaultChain:s}=Ai(),o=((l=s.blockExplorers)==null?void 0:l.default.url)??"https://etherscan.io";return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:e,backFn:r}),d.jsxs(Xre,{children:[d.jsx(ORe,{}),d.jsxs(YM,{children:[d.jsx("h3",{children:"Check account assets before transferring"}),d.jsx("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),d.jsxs(RRe,{children:[d.jsx("p",{children:" To check your balance, you can:"}),d.jsx(dz,{children:"Log out and log back into the other account, or "}),d.jsxs(dz,{children:["Copy your wallet address and use a"," ",d.jsx("u",{children:d.jsx("a",{target:"_blank",href:o,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),d.jsxs(ene,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[d.jsx(Xw,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(wo,{address:t,showCopyIcon:!1}),d.jsx(PRe,{})]}),d.jsx(Qre,{onTransfer:n,isTransferring:i,transferSuccess:a})]})]}),d.jsx(Zt,{})]})},URe=()=>{let{initiateAccountTransfer:t,closePrivyModal:e}=_t(),{data:r,navigate:n,lastScreen:i,setModalData:a}=wt(),[s,o]=C.useState(void 0),[l,c]=C.useState(!1),[u,f]=C.useState(!1),h=async()=>{var g,m,w,_,v,b,A,S,j;try{if(!((g=r==null?void 0:r.accountTransfer)!=null&&g.nonce)||!((m=r==null?void 0:r.accountTransfer)!=null&&m.account))throw Error("missing account transfer inputs");f(!0),await t({nonce:(w=r==null?void 0:r.accountTransfer)==null?void 0:w.nonce,account:(_=r==null?void 0:r.accountTransfer)==null?void 0:_.account,accountType:(v=r==null?void 0:r.accountTransfer)==null?void 0:v.linkMethod,externalWalletMetadata:(b=r==null?void 0:r.accountTransfer)==null?void 0:b.externalWalletMetadata,telegramAuthResult:(A=r==null?void 0:r.accountTransfer)==null?void 0:A.telegramAuthResult,farcasterEmbeddedAddress:(S=r==null?void 0:r.accountTransfer)==null?void 0:S.farcasterEmbeddedAddress,oAuthUserInfo:(j=r==null?void 0:r.accountTransfer)==null?void 0:j.oAuthUserInfo}),c(!0),f(!1),setTimeout(e,1e3)}catch(U){a({errorModalData:{error:U,previousScreen:i||ye.LINK_CONFLICT_SCREEN}}),n(ye.ERROR_SCREEN,!0)}};return s?d.jsx(FRe,{address:s,onClose:e,onRetry:()=>o(void 0),onTransfer:h,isTransferring:u,transferSuccess:l}):d.jsx(BRe,{onClose:e,onInfo:()=>{var g;return o((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onContinue:()=>{var g;return o((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onTransfer:h,isTransferring:u,transferSuccess:l,data:r})},BRe=({onClose:t,onContinue:e,onInfo:r,onTransfer:n,transferSuccess:i,isTransferring:a,data:s})=>{var l,c,u,f,h,g,m;if(!((l=s==null?void 0:s.accountTransfer)!=null&&l.linkMethod)||!((c=s==null?void 0:s.accountTransfer)!=null&&c.displayName))return;let o={method:(u=s==null?void 0:s.accountTransfer)==null?void 0:u.linkMethod,handle:(f=s==null?void 0:s.accountTransfer)==null?void 0:f.displayName,disclosedAccount:(h=s==null?void 0:s.accountTransfer)!=null&&h.embeddedWalletAddress?{type:"wallet",handle:(g=s==null?void 0:s.accountTransfer)==null?void 0:g.embeddedWalletAddress}:void 0};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!0}),d.jsxs(Xre,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(XL,{color:"var(--privy-color-error)"}),d.jsx(Jd,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),d.jsxs(YM,{children:[d.jsxs("h3",{children:[function(w){switch(w){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"twitter":case"telegram":case"farcaster":return`${Zre(w.replace("_oauth",""))} profile`;default:return w}}(o.method)," is associated with another account"]}),d.jsxs("p",{children:["Do you want to transfer",d.jsx("b",{children:o.handle?` ${o.handle}`:""})," to this account instead? This will delete your other account."]}),d.jsx(zRe,{onClick:r,disclosedAccount:o.disclosedAccount})]}),d.jsxs(YM,{style:{gap:12,marginTop:12},children:[(m=s==null?void 0:s.accountTransfer)!=null&&m.embeddedWalletAddress?d.jsx(Ot,{onClick:e,children:"Continue"}):d.jsx(Qre,{onTransfer:n,transferSuccess:i,isTransferring:a}),d.jsx(zd,{onClick:t,children:"No thanks"})]})]}),d.jsx(Zt,{})]})};function zRe({disclosedAccount:t,onClick:e}){return t?d.jsxs(ene,{onClick:e,children:[d.jsx(Xw,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(wo,{address:t.handle,showCopyIcon:!1}),d.jsx(tne,{iconSize:15})]}):null}function WRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const KM=C.forwardRef(WRe);function HRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}),C.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const GRe=C.forwardRef(HRe),Nx=fe.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-a63b1990-0"})(["display:flex;flex-direction:column;align-items:center;padding:0px 0px 30px;@media (max-width:440px){padding:10px 10px 20px;}"]),hn=fe.div.withConfig({displayName:"Title",componentId:"sc-a63b1990-1"})(["font-size:18px;line-height:30px;text-align:center;font-weight:600;margin-bottom:10px;"]),pn=fe.div.withConfig({displayName:"SubTitle",componentId:"sc-a63b1990-2"})(["font-size:0.875rem;text-align:center;"]),Q0=fe.div.withConfig({displayName:"Container",componentId:"sc-a63b1990-3"})(["display:flex;flex-direction:column;align-items:center;gap:10px;flex-grow:1;padding:20px 0;@media (max-width:440px){padding:10px 10px 20px;}"]),Lx=fe.div.withConfig({displayName:"List",componentId:"sc-a63b1990-4"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.75rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),fu=fe.div.withConfig({displayName:"ListItemIcon",componentId:"sc-a63b1990-5"})(["width:25px;display:flex;align-items:center;justify-content:flex-start;> svg{z-index:2;height:25px !important;width:25px !important;color:var(--privy-color-accent);}"]),hu=fe.div.withConfig({displayName:"ListItem",componentId:"sc-a63b1990-6"})(["display:flex;align-items:center;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;"]),Xl=fe.div.withConfig({displayName:"BottomSection",componentId:"sc-a63b1990-7"})(["display:flex;flex-direction:column;gap:10px;padding-top:20px;"]),rne=fe.div.withConfig({displayName:"MethodList",componentId:"sc-a63b1990-8"})(["display:flex;flex-direction:column;align-items:stretch;gap:1rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),nS=fe.div.withConfig({displayName:"MethodListItem",componentId:"sc-a63b1990-9"})(["display:flex;gap:5px;width:100%;position:relative;"]),iS=fe.button.withConfig({displayName:"RemoveMethodButton",componentId:"sc-a63b1990-10"})(["&&{background-color:transparent;color:var(--privy-color-foreground-3);padding:0 0.75rem;display:flex;align-items:center;height:100%;> svg{z-index:2;height:20px !important;width:20px !important;}}&&:hover{color:var(--privy-color-error);}"]),aS=fe.div.withConfig({displayName:"MethodText",componentId:"sc-a63b1990-11"})(["display:flex;align-items:center;gap:0.5rem;> svg{z-index:2;height:20px !important;width:20px !important;}"]),sS=fe.div.withConfig({displayName:"ExtraText",componentId:"sc-a63b1990-12"})(["display:flex;align-items:center;gap:6px;font-weight:400 !important;color:",";> svg{z-index:2;height:18px !important;width:18px !important;display:flex !important;align-items:flex-end;}"],t=>t.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)"),oS=fe.div.withConfig({displayName:"SmsInsecureText",componentId:"sc-a63b1990-13"})(["width:100%;display:flex;justify-content:space-between;"]),qRe=fe.p.withConfig({displayName:"TermsText",componentId:"sc-a63b1990-14"})(["text-align:left;width:100%;color:var(--privy-color-foreground-3) !important;"]),JM=fe.button.withConfig({displayName:"PrimaryTextButton",componentId:"sc-a63b1990-15"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:0.875rem;line-height:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{color:",";background-color:transparent;padding:0.5rem 0px;}&:hover{text-decoration:underline;}"],t=>t.theme==="dark"?"var(--privy-color-foreground-2)":"var(--privy-color-accent)"),Ra=fe.div.withConfig({displayName:"IconWrapper",componentId:"sc-a63b1990-16"})(["display:flex;align-items:center;justify-content:center;color:var(--privy-color-accent);width:100%;> svg{z-index:2;width:3rem;height:3rem;}"]),nne=fe.div.withConfig({displayName:"ErrorMessage",componentId:"sc-a63b1990-17"})(["color:var(--privy-color-error);"]),VRe=()=>{let{user:t,logout:e}=$r(),{app:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:i,navigate:a}=wt(),{acceptTerms:s,closePrivyModal:o,createAnalyticsEvent:l}=_t(),c=u=>{u==null||u.preventDefault(),o({shouldCallAuthOnSuccess:!1}),e()};return n.current=c,d.jsx(YRe,{termsAndConditionsUrl:r==null?void 0:r.legal.termsAndConditionsUrl,privacyPolicyUrl:r==null?void 0:r.legal.privacyPolicyUrl,onAccept:async u=>{var f;u.preventDefault(),await s(),t&&Od(t,(f=r==null?void 0:r.embeddedWallets)==null?void 0:f.createOnLogin)?(i({createWallet:{onSuccess:()=>{},onFailure:h=>{console.error(h),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:h,screen:"AffirmativeConsentScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):o()},onDecline:c})},YRe=({termsAndConditionsUrl:t,privacyPolicyUrl:e,onAccept:r,onDecline:n})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(GRe,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24},children:"One last step"}),d.jsx(pn,{children:"By signing up, you agree to our terms and privacy policy."}),d.jsxs(sh,{style:{marginTop:24},children:[t&&d.jsxs(cz,{target:"_blank",href:t,children:["View Terms ",d.jsx(KM,{style:{marginLeft:"auto"}})]}),e&&d.jsxs(cz,{target:"_blank",href:e,children:["View Privacy Policy ",d.jsx(KM,{style:{marginLeft:"auto"}})]})]}),d.jsxs(KRe,{style:{marginTop:24},children:[d.jsx(zd,{onClick:n,children:"No thanks"}),d.jsx(Ot,{onClick:r,children:"Accept"})]}),d.jsx(Zt,{})]});let KRe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-4aff18c8-0"})(["display:flex;gap:10px;"]);const ine=({style:t,...e})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...e,children:d.jsx("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})}),JRe=()=>{let{navigate:t,app:e}=wt(),r=(e==null?void 0:e.allowlistConfig.errorTitle)||"You don't have access to this app",n=(e==null?void 0:e.allowlistConfig.errorDetail)||"Have you been invited?",i=(e==null?void 0:e.allowlistConfig.errorCtaText)||"Try another account";return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(ZRe,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(XL,{}),d.jsx(ine,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),d.jsxs(QRe,{children:[d.jsx(typeof r=="string"?"h3":d.Fragment,{children:r}),d.jsx(typeof n=="string"?"p":d.Fragment,{children:n})]}),e!=null&&e.allowlistConfig.errorCtaLink?d.jsx(Ot,{as:"a",href:e.allowlistConfig.errorCtaLink,children:i}):d.jsx(Ot,{onClick:()=>{t(ye.LANDING)},children:i})]})]})};let ZRe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-ed4ecf-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),QRe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-ed4ecf-1"})(["display:flex;flex-direction:column;gap:8px;"]);function XRe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const eDe=C.forwardRef(XRe);function tDe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}))}const _1=C.forwardRef(tDe);function rDe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"}))}const vc=C.forwardRef(rDe),C1=fe.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),bc=fe.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),tj=fe.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),rj=fe(bc).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),Zd=fe(bc).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),jx=fe.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),Io=fe.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),nDe=fe.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),tn=fe.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),an=fe.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),iDe=fe.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),nj=fe.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],t=>t.height??"12"),aDe=fe.div.withConfig({displayName:"Circle",componentId:"sc-cb963810-13"})(["background-color:var(--privy-color-accent);display:flex;justify-content:center;align-items:center;border-radius:50%;border-color:white;border-width:2px !important;"]),$x=({title:t,description:e,children:r,...n})=>d.jsx(ane,{...n,children:d.jsxs(d.Fragment,{children:[d.jsx("h3",{children:t}),typeof e=="string"?d.jsx("p",{children:e}):e,r]})}),ev=fe($x).withConfig({displayName:"PaddedScreenHeader",componentId:"sc-523a75d6-0"})(["margin-bottom:24px;"]),zn=({title:t,description:e,icon:r,children:n,...i})=>d.jsxs(sDe,{...i,children:[r||null,d.jsx("h3",{children:t}),e&&typeof e=="string"?d.jsx("p",{children:e}):e,n]});let ane=fe.div.withConfig({displayName:"StyledSection",componentId:"sc-523a75d6-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;width:100%;margin-bottom:24px;&& h3{font-size:17px;color:var(--privy-color-foreground);}&& p{color:var(--privy-color-foreground-2);font-size:14px;}"]),sDe=fe(ane).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]),fz=Array(6).fill("");var $2,P2,oDe=(($2=oDe||{})[$2.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",$2[$2.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",$2),lDe=((P2=lDe||{})[P2.EMAIL=0]="EMAIL",P2[P2.SMS=1]="SMS",P2);const cDe=()=>{var E,L,O;let{app:t,navigate:e,lastScreen:r,navigateBack:n,setModalData:i,onUserCloseViaDialogOrKeybindRef:a}=wt(),{closePrivyModal:s,resendEmailCode:o,resendSmsCode:l,getAuthMeta:c,loginWithCode:u,updateWallets:f,createAnalyticsEvent:h}=_t(),{authenticated:g,logout:m,user:w}=$r(),[_,v]=C.useState(fz),[b,A]=C.useState(!1),[S,j]=C.useState(null),[U,I]=C.useState(null),[B,V]=C.useState(0);a.current=()=>null;let se=(E=c())!=null&&E.email?0:1,Y=Dn-500;C.useEffect(()=>{if(B){let P=setTimeout(()=>{V(B-1)},1e3);return()=>clearTimeout(P)}},[B]),C.useEffect(()=>{var P;if(g&&b&&w){if(t!=null&&t.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let R=setTimeout(()=>{e(ye.AFFIRMATIVE_CONSENT_SCREEN)},Y);return()=>clearTimeout(R)}if(Od(w,(P=t==null?void 0:t.embeddedWallets)==null?void 0:P.createOnLogin)){let R=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:M=>{console.error(M),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:M,screen:"AwaitingPasswordlessCodeScreen"}}),m()},callAuthOnSuccessOnClose:!0}}),e(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Y);return()=>clearTimeout(R)}{f();let R=setTimeout(()=>s({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn);return()=>clearTimeout(R)}}},[g,b,w]),C.useEffect(()=>{if(S&&U===0){let P=setTimeout(()=>{v(fz),j(null);let R=document.querySelector("input[name=code-0]");R==null||R.focus()},1400);return()=>clearTimeout(P)}},[S]);let N=P=>{var le;P.preventDefault();let R=P.currentTarget.value.replace(" ","");if(R==="")return;if(isNaN(Number(R)))return j("Code should be numeric"),void I(1);j(null),I(null);let M=Number((le=P.currentTarget.name)==null?void 0:le.charAt(5)),D=[...R||[""]].slice(0,6-M),$=[..._.slice(0,M),...D,..._.slice(M+D.length)];v($);let X=Math.min(Math.max(M+D.length,0),5);if(!isNaN(Number(P.currentTarget.value))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.focus()}if($.every(H=>H&&!isNaN(+H))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.blur(),u($.join("")).then(()=>A(!0)).catch(ee=>{var J,te,re,z,G,Z,me,be,Ce,Fe,Ue,Ke;if(ee instanceof rl&&ee.privyErrorCode===Ae.INVALID_CREDENTIALS)j("Invalid or expired verification code");else if(ee instanceof rl&&ee.privyErrorCode===Ae.CANNOT_LINK_MORE_OF_TYPE)j(ee.message);else{if(ee instanceof rl&&ee.privyErrorCode===Ae.USER_LIMIT_REACHED)return console.error(new Fw(ee).toString()),void e(ye.USER_LIMIT_REACHED_SCREEN);if(ee instanceof rl&&ee.privyErrorCode===Ae.USER_DOES_NOT_EXIST)return void e(ye.ACCOUNT_NOT_FOUND_SCREEN);if(ee instanceof rl&&ee.privyErrorCode===Ae.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:ee,previousScreen:r??ye.AWAITING_PASSWORDLESS_CODE}}),void e(ye.ERROR_SCREEN,!1);if(ee instanceof rl&&ee.privyErrorCode===Ae.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:ee}}),void e(ye.CONNECT_OR_CREATE,!1);if(ee instanceof rl&&ee.privyErrorCode===Ae.ACCOUNT_TRANSFER_REQUIRED&&((te=(J=ee.data)==null?void 0:J.data)!=null&&te.nonce))return i({accountTransfer:{nonce:(z=(re=ee.data)==null?void 0:re.data)==null?void 0:z.nonce,account:se===0?(G=c())==null?void 0:G.email:(Z=c())==null?void 0:Z.phoneNumber,displayName:(Ce=(be=(me=ee.data)==null?void 0:me.data)==null?void 0:be.account)==null?void 0:Ce.displayName,linkMethod:se===0?"email":"sms",embeddedWalletAddress:(Ke=(Ue=(Fe=ee.data)==null?void 0:Fe.data)==null?void 0:Ue.otherUser)==null?void 0:Ke.embeddedWalletAddress}}),void e(ye.LINK_CONFLICT_SCREEN);j("Issue verifying code")}I(0)})}},k=se==0?d.jsx(_1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):d.jsx(vc,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),x=d.jsxs("p",se==0?{children:["Please check ",d.jsx(hz,{children:(L=c())==null?void 0:L.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",d.jsx(hz,{children:(O=c())==null?void 0:O.phoneNumber})," for a message from ",(t==null?void 0:t.name)||"Privy"," and enter your code below."]});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:()=>n()},"header"),d.jsxs(uDe,{children:[d.jsx(zn,{title:"Enter confirmation code",description:x,icon:k}),d.jsxs(tj,{children:[d.jsxs(dDe,{children:[d.jsx(fDe,{$fail:!!S,$success:b,children:d.jsx("span",{children:S||(b?"Success!":"")})}),d.jsx("div",{children:_.map((P,R)=>d.jsx("input",{name:`code-${R}`,type:"text",value:_[R],onChange:N,onKeyUp:M=>{M.key==="Backspace"&&(D=>{if(U===1&&(j(null),I(null)),v([..._.slice(0,D),"",..._.slice(D+1)]),D>0){let $=document.querySelector(`input[name=code-${D-1}]`);$==null||$.focus()}})(R)},inputMode:"numeric",autoFocus:R===0,pattern:"[0-9]",className:`${b?"success":""} ${S?"fail":""}`,autoComplete:ma?"one-time-code":"off"},R))})]}),d.jsxs(hDe,{children:[d.jsxs("span",{children:["Didn't get ",se==0?"an email":"a message","?"]}),B?d.jsxs(gDe,{children:[d.jsx(eDe,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),d.jsx("span",{children:"Code sent"})]}):d.jsx(pDe,{children:d.jsx("button",{onClick:async()=>{V(30),se==0?await o():await l()},children:"Resend code"})})]})]})]}),d.jsx(Zt,{})]})};let uDe=fe.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-463c12b2-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:center;margin:auto;gap:16px;flex-grow:1;"]),dDe=fe.div.withConfig({displayName:"CodeInput",componentId:"sc-463c12b2-1"})(["display:flex;flex-direction:column;width:100%;gap:8px;> div:last-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-md);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);padding:8px 10px;height:58px;width:46px;text-align:center;font-size:18px;}> input:focus{border:1px solid var(--privy-color-accent);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-success);}> input.fail{border:1px solid var(--privy-color-error);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),fDe=fe.div.withConfig({displayName:"InputHelp",componentId:"sc-463c12b2-2"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-end;width:100%;"],t=>t.$success?"var(--privy-color-success)":t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),hDe=fe.div.withConfig({displayName:"HelpText",componentId:"sc-463c12b2-3"})(["font-size:13px;color:var(--privy-color-foreground);display:flex;gap:8px;align-items:center;width:100%;margin-top:16px;padding-bottom:32px;"]),pDe=fe.div.withConfig({displayName:"ResendButtonContainer",componentId:"sc-463c12b2-4"})(["color:var(--privy-color-accent);padding:2px 0;> button{text-decoration:underline;}"]),gDe=fe.div.withConfig({displayName:"Badge",componentId:"sc-463c12b2-5"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),hz=fe.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-463c12b2-6"})(["font-weight:500;word-break:break-all;"]);function mDe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const X0=C.forwardRef(mDe);function yDe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const Px=C.forwardRef(yDe),wDe=({icon:t})=>d.jsx(d.Fragment,{children:d.jsx(vDe,{children:d.jsxs("div",{children:[d.jsx(wc,{}),typeof t=="string"?d.jsx("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?d.jsx(t,{style:{width:"38px",height:"38px"}}):d.jsx("span",{})]})})});let vDe=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-26c1d9b9-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const bDe=()=>{let{lastScreen:t,currentScreen:e,data:r,navigateBack:n,navigate:i,setModalData:a}=wt(),{status:s,token:o,waitForResult:l,reset:c,execute:u}=$o(),f=C.useRef([]),h=N=>{f.current=[N,...f.current]},[g,m]=C.useState(!0);C.useEffect(()=>(h(setTimeout(m,1e3,!1)),()=>{f.current.forEach(N=>clearTimeout(N)),f.current=[]}),[]);let[w,_]=C.useState(""),[v,b]=C.useState("Checking that you are a human..."),[A,S]=C.useState(d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Continue"})),[j,U]=C.useState(!1),[I,B]=C.useState(3),V=r==null?void 0:r.captchaModalData,se=async N=>{try{await(V==null?void 0:V.callback(N)),V!=null&&V.onSuccessNavigateTo&&i(V==null?void 0:V.onSuccessNavigateTo,!1)}catch(k){if(k instanceof q9)return;a({errorModalData:{error:k,previousScreen:t||ye.LANDING}}),i((V==null?void 0:V.onErrorNavigateTo)||ye.ERROR_SCREEN,!1)}};C.useEffect(()=>{s==="success"?h(setTimeout(async()=>{let N=await l();!N||V!=null&&V.userIntentRequired||se(N)},1e3)):s==="ready"&&h(setTimeout(()=>{s==="ready"&&u()},500))},[s]),C.useEffect(()=>{if(!g)switch(s){case"success":_("Success!"),b("CAPTCHA passed successfully."),S(d.jsx(Ot,{onClick:()=>{U(!0),se(o)},disabled:!(V!=null&&V.userIntentRequired),loading:j,children:V!=null&&V.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":_(""),b("Checking that you are a human..."),S(d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":_("Something went wrong"),I<=0?(b("If you use an adblocker or VPN, try disabling and re-attempting."),S(null)):(b("You did not pass CAPTCHA. Please try again."),S(d.jsx(Ot,{onClick:Y,children:"Retry"})))}},[s,g,j]);let Y=async()=>{if(I<=0)return;B(k=>k-1),c(),u();let N=await l();!N||V!=null&&V.userIntentRequired||se(N)};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:t&&e!==t?n:void 0}),d.jsxs(xDe,{children:[s==="success"?d.jsx(X0,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):s==="error"?d.jsx(Px,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(wDe,{}),d.jsxs(Io,{children:[w?d.jsx("h3",{children:w}):null,d.jsx("p",{children:v})]}),A]}),d.jsx(kr,{})]})};let xDe=fe.div.withConfig({displayName:"CaptchaContainer",componentId:"sc-9afcf974-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const N6=({chainType:t,withPadding:e})=>{let r="";return r=t==="ethereum-only"||t==="ethereum-and-solana"?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",d.jsx(xRe,{$withPadding:e,children:d.jsxs(ERe,{children:[d.jsx(T0,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),d.jsx("h3",{children:"No wallets available"}),d.jsxs("p",{children:["Please download an external wallet provider, like ",r,"."]})]})},"empty-wallet-state")},sne=({icon:t,name:e})=>typeof t=="string"?d.jsx("img",{alt:`${e||"wallet"} logo`,src:t,style:{height:24,width:24,borderRadius:4}}):t===void 0?d.jsx(Xw,{}):t?d.jsx(t,{}):null;let EDe=$re(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const one=oa(["",""],t=>t.$isLoading?oa(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],EDe):""),xc=({children:t,color:e,isLoading:r,isPulsing:n,...i})=>d.jsx(_De,{$color:e,$isLoading:r,$isPulsing:n,...i,children:t});let _De=fe.span.withConfig({displayName:"StyledSpan",componentId:"sc-eba15c9-0"})(["padding:0.125rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);display:flex;align-items:center;"," ",""],t=>{let e,r;t.$color==="green"&&(e="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),t.$color==="red"&&(e="var(--privy-color-error)",r="var(--privy-color-error-light)"),t.$color==="gray"&&(e="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let n=$re(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],r,r);return oa(["color:",";background-color:",";",";"],e,r,t.$isPulsing&&oa(["animation:"," 3s linear infinite;"],n))},one);const CDe=({...t})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...t,children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{offset:"0",stopColor:"#f1562b"}),d.jsx("stop",{offset:"0.3",stopColor:"#f1542b"}),d.jsx("stop",{offset:"0.41",stopColor:"#f04d2a"}),d.jsx("stop",{offset:"0.49",stopColor:"#ef4229"}),d.jsx("stop",{offset:"0.5",stopColor:"#ef4029"}),d.jsx("stop",{offset:"0.56",stopColor:"#e83e28"}),d.jsx("stop",{offset:"0.67",stopColor:"#e13c26"}),d.jsx("stop",{offset:"1",stopColor:"#df3c26"})]})}),d.jsx("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),d.jsx("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]}),SDe=({style:t,...e})=>d.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("path",{d:"M0 10.2C0 4.56669 4.5667 0 10.2 0H37.8C43.4333 0 48 4.5667 48 10.2V37.8C48 43.4333 43.4333 48 37.8 48H10.2C4.56669 48 0 43.4333 0 37.8V10.2Z",fill:"#604E93"}),d.jsx("path",{d:"M4.13353 14.6218C3.70207 13.1338 4.62517 11.5926 6.14065 11.2707L31.424 5.90036C32.6242 5.64544 33.8434 6.24236 34.3782 7.34668L45.7343 30.7995L13.7343 47.7328L4.13353 14.6218Z",fill:"url(#paint0_linear_362_37285)"}),d.jsx("path",{d:"M4.46332 16.4519C4.00953 14.8821 5.06159 13.277 6.68213 13.0669L40.1928 8.72077C41.5851 8.5402 42.879 9.47008 43.1517 10.8473L48.0004 35.333L13.467 47.5999L4.46332 16.4519Z",fill:"white"}),d.jsx("path",{d:"M0 18.6666C0 15.7211 2.38781 13.3333 5.33333 13.3333H37.3333C43.2244 13.3333 48 18.1089 48 24V37.3333C48 43.2243 43.2244 48 37.3333 48H10.6667C4.77563 48 0 43.2243 0 37.3333V18.6666Z",fill:"black"}),d.jsx("path",{d:"M31.7559 33.3796V23.3867H33.7051V33.3796H31.7559Z",fill:"#F7A600"}),d.jsx("path",{d:"M9.51303 36.362H5.33398V26.3691H9.3449C11.2941 26.3691 12.4301 27.4639 12.4301 29.176C12.4301 30.2844 11.7008 31.0006 11.1964 31.2393C11.7996 31.5201 12.5709 32.1511 12.5709 33.4846C12.5709 35.3513 11.2941 36.362 9.51303 36.362ZM9.19043 28.1096H7.28322V30.4117H9.19043C10.0174 30.4117 10.4808 29.9489 10.4808 29.2612C10.4808 28.5723 10.0185 28.1096 9.19043 28.1096ZM9.31653 32.1658H7.28322V34.6215H9.31653C10.2003 34.6215 10.6206 34.0599 10.6206 33.3868C10.6216 32.7127 10.2003 32.1658 9.31653 32.1658Z",fill:"white"}),d.jsx("path",{d:"M17.9425 32.2637V36.362H16.007V32.2637L13.0059 26.3691H15.1232L16.9884 30.3969L18.8252 26.3691H20.9426L17.9425 32.2637Z",fill:"white"}),d.jsx("path",{d:"M26.4896 36.362H22.3105V26.3691H26.3215C28.2707 26.3691 29.4066 27.4639 29.4066 29.176C29.4066 30.2844 28.6774 31.0006 28.173 31.2393C28.7761 31.5201 29.5474 32.1511 29.5474 33.4846C29.5464 35.3513 28.2696 36.362 26.4896 36.362ZM26.167 28.1096H24.2598V30.4117H26.167C26.994 30.4117 27.4574 29.9489 27.4574 29.2612C27.4563 28.5723 26.994 28.1096 26.167 28.1096ZM26.2931 32.1658H24.2598V34.6215H26.2931C27.1768 34.6215 27.5971 34.0599 27.5971 33.3868C27.5971 32.7127 27.1758 32.1658 26.2931 32.1658Z",fill:"white"}),d.jsx("path",{d:"M40.0573 28.1096V36.362H38.1081V28.1096H35.5V26.3691H42.6665V28.1096H40.0573Z",fill:"white"}),d.jsx("defs",{children:d.jsxs("linearGradient",{id:"paint0_linear_362_37285",x1:"4.00094",y1:"13.9604",x2:"46.1673",y2:"11.8482",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{"stop-color":"#FFD748"}),d.jsx("stop",{offset:"1","stop-color":"#F7A600"})]})})]}),ADe=({style:t,...e})=>d.jsxs("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),d.jsx("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask0_16909_31415)",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#002D72"}),d.jsx("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),d.jsxs("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),d.jsx("stop",{offset:"1",stopColor:"#002D72"})]})]})]}),lne=({style:t,...e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),d.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),d.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),d.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),d.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),d.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),d.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),d.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),d.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),d.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),d.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),d.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),d.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),IDe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfoDAIVMQ8VNW19AAAGKUlEQVRYw+2WTWxcVxXHf+feN98Tf43j2KmduMEibZOilEjNl9KmImrCoipSkSohIQQSQkJhSdmAAEV0ka742CF11WURsEJRHSg4TWooUhPagkgcO/6IY8ffnhk/z8y9h8Wbsd/4AwEbFnCkJ7173zn/c87/nHPfhf91kcbLt892cX9RebrbcOaA4ViPoVyNvvVemfqPwMdfewyAbAI+nPbcGPfcnvYc6hCuDM0CEDSUDeAUkw54wRqW2gvmL+WHvgIwWQdCofeNqX/JaVwKnSZpZ/zTaUtbpaa/FUSbGPjOc3tRFbyyNzC809sifSf77FBvq/zKKb+rOR23ZtNoJ1a2Oq45SAQctMILk8v6heEJd3ZqRe87z4sizKkqb1x/FDGgGlXCCMe9cvj+sqbLVffyyT7z0uMd5l5gZVCVXwPDmTSL6SSUf9TsUBXWKlAOaQdOJAJe9sr5kXl/aHjCm7myIpAR4ThwVUSaSyARwxeAtACPSso7d515Zj8Dx3rMQCrgK6rcdo5rIsxvayaBmqMAfE6Ez4Q1MremPR8+cKzXou9ABriIcJU6nxsBKKSBo3HA0MHwhGO2pJzuM5lCVk54zwnVDcAmBryPEpkvKTfHPaOLHmWb7lGUNBA2BYBoiMpYU1ZRYIzMexbXlFN9hoGCadR3W81rDu7Oe96f8CyWFZHYmG3KmKoPRUwzA0R9cGunzhaBhbIyOBKxcarfUtjTrLO8BjfHHbcfeiq17QzF5FbDOUTTF5ePgPJuQaw7+NOkZ/COI6xG2QkQVmHwjuODSU/F/VPn5bqPRgvUA9Ami9qu5gq5JPS2CFYiEAWsRHu5ZAx5Z6k1NER1swQi2rAL60/LFr+oQmdWeK7fcrBdmrIUgSNdhlxC+MOYY373+jfwN2ja0kpMAbNAl2rk2EiUdXdeONlr2ZuPUtdYplqnor9dyCYsw5OOh0WlXAGv9VJF/maBB02lbby8drYLIKnws8Dw9da0sL9VeLxD6GkRkgg2xnA+C8lE9F6pQrG8CeiAKsqDFWV0QXmwrCyHSs3zc4FLQGXbvwDgVL+pAD/p75CXulukuyUlGAOlMoSV5vJuYyBWLgO0poT9B4TP9sLKuvJwRadH5/XHCJX3x/yG/kYAP7iYwER89AGtjbo7B0urnnBdMUJDh0RgSCejRbWqFIsRqNfoSaeEdNJgDLRlhPaMtD25jz7g44tPWK4MRThNY1g3ftErmUZWxsCenMU7KK55xpYDZouCd2zMofPwqCiMLgcUyx7vIhtjNhnySqaO3SQGYOX1g411AXh+a+vmMlBoS7AY5Hlrro+bqwWsFbTejNYIN1Y7eGuuj4VEnkJbglyGneQc0AkQvt6zWYJa6AhSABwDDm+1MkbJZoVn81UGuqdZWrMYa4CIdmMN5w+FfDFToiPhEB/Z7CCH6z4GS2uxo9iYOv2e5wWycQvntd5knkDgsaxnf6ZKpbo55QmrPNURIgLVWnTarFeis8CaptMgq3DOGgatjTVhzUVjZAwl3RJ4qayU1xxGhEK7pWWPYA0EwWZDBkHU/TUHK0VlftHhVclmLLls83EkQsl7SKdiATRUvOc6sAps/GpSKWEtFJxXqg6KJU86JcyEUK5E0eaS0JVWwnWlWhOcU4wVUilhS0Krqgxta8LC5cnG+hPg73EFa4R8zmINGBFq+QOMdFzg0rUcr75d5dW3q1y6luNexwVq+QMYI1gL+ZzZSj917E8AOi9PbTIQk0XgPeB4fDOVIHRtbQvhk5/fJ33P2kezZSZX32O1GhVyYhVmO0/R8tR5dOKPLv3X38ykKHYQXXLicgNYiG9sDQDg98A3gCXg48hIr7Pv06NLPWe+msR+K591uW9++RV8fajFCLlsmhLpUqXnzE/bFu69ycwHh0DOAKeBI0A78O5WZ7ErmSDRYTsEfAn4GzBG/X5QDfKMTdz/7r7Ozj9bY77/zNHDRzfOZgFBP1peXfnhzPzcL48EeQfcAa4STVU/8EQdu7kp44vJHe70Dbl74jKqSmAtNec+JSKngfow4VT1RmDtSM05RISB4e/tihW/0u9+d9lB3v3Fm6gooruZRbfIc6987d+B/b/8d+UfeVGT8xvC5akAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMTItMDJUMjE6NDk6MTArMDA6MDB60KjYAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI0LTEyLTAyVDIxOjQ5OjEwKzAwOjAwC40QZAAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNC0xMi0wMlQyMTo0OToxNSswMDowMA6gHhwAAAAASUVORK5CYII=",Rx=({style:t,...e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]}),cne="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyB2aWV3Qm94PScwIDAgMTA4IDEwOCcgZmlsbD0nbm9uZScgc3R5bGU9J2hlaWdodDoyOHB4O3dpZHRoOjI4cHgnPjxyZWN0IHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyByeD0nMjMnIGZpbGw9JyNBQjlGRjInPjwvcmVjdD48cGF0aCBmaWxsLXJ1bGU9J2V2ZW5vZGQnIGNsaXAtcnVsZT0nZXZlbm9kZCcgZD0nTTQ2LjUyNjcgNjkuOTIyOUM0Mi4wMDU0IDc2Ljg1MDkgMzQuNDI5MiA4NS42MTgyIDI0LjM0OCA4NS42MTgyQzE5LjU4MjQgODUuNjE4MiAxNSA4My42NTYzIDE1IDc1LjEzNDJDMTUgNTMuNDMwNSA0NC42MzI2IDE5LjgzMjcgNzIuMTI2OCAxOS44MzI3Qzg3Ljc2OCAxOS44MzI3IDk0IDMwLjY4NDYgOTQgNDMuMDA3OUM5NCA1OC44MjU4IDgzLjczNTUgNzYuOTEyMiA3My41MzIxIDc2LjkxMjJDNzAuMjkzOSA3Ni45MTIyIDY4LjcwNTMgNzUuMTM0MiA2OC43MDUzIDcyLjMxNEM2OC43MDUzIDcxLjU3ODMgNjguODI3NSA3MC43ODEyIDY5LjA3MTkgNjkuOTIyOUM2NS41ODkzIDc1Ljg2OTkgNTguODY4NSA4MS4zODc4IDUyLjU3NTQgODEuMzg3OEM0Ny45OTMgODEuMzg3OCA0NS42NzEzIDc4LjUwNjMgNDUuNjcxMyA3NC40NTk4QzQ1LjY3MTMgNzIuOTg4NCA0NS45NzY4IDcxLjQ1NTYgNDYuNTI2NyA2OS45MjI5Wk04My42NzYxIDQyLjU3OTRDODMuNjc2MSA0Ni4xNzA0IDgxLjU1NzUgNDcuOTY1OCA3OS4xODc1IDQ3Ljk2NThDNzYuNzgxNiA0Ny45NjU4IDc0LjY5ODkgNDYuMTcwNCA3NC42OTg5IDQyLjU3OTRDNzQuNjk4OSAzOC45ODg1IDc2Ljc4MTYgMzcuMTkzMSA3OS4xODc1IDM3LjE5MzFDODEuNTU3NSAzNy4xOTMxIDgzLjY3NjEgMzguOTg4NSA4My42NzYxIDQyLjU3OTRaTTcwLjIxMDMgNDIuNTc5NUM3MC4yMTAzIDQ2LjE3MDQgNjguMDkxNiA0Ny45NjU4IDY1LjcyMTYgNDcuOTY1OEM2My4zMTU3IDQ3Ljk2NTggNjEuMjMzIDQ2LjE3MDQgNjEuMjMzIDQyLjU3OTVDNjEuMjMzIDM4Ljk4ODUgNjMuMzE1NyAzNy4xOTMxIDY1LjcyMTYgMzcuMTkzMUM2OC4wOTE2IDM3LjE5MzEgNzAuMjEwMyAzOC45ODg1IDcwLjIxMDMgNDIuNTc5NVonIGZpbGw9JyNGRkZERjgnPjwvcGF0aD48L3N2Zz4=",MDe=t=>d.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),d.jsx("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),d.jsx("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"white"}),d.jsx("stop",{offset:"1",stopColor:"white"})]}),d.jsxs("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8697FF"}),d.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),d.jsxs("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8697FF"}),d.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),d.jsxs("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"white"}),d.jsx("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]}),TDe=({style:t,...e})=>d.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("g",{clipPath:"url(#clip0_5_32)",children:d.jsxs("g",{clipPath:"url(#clip1_5_32)",children:[d.jsx("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:d.jsx("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),d.jsx("g",{mask:"url(#mask0_5_32)",children:d.jsx("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),d.jsx("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),d.jsx("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),d.jsx("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),d.jsx("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),d.jsx("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),d.jsx("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),d.jsx("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),d.jsx("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),d.jsx("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#174299"}),d.jsx("stop",{offset:"1",stopColor:"#001E59"})]}),d.jsxs("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[d.jsx("stop",{offset:"0.770277",stopColor:"#FF4000"}),d.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),d.jsxs("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FF4000"}),d.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),d.jsxs("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8754C9"}),d.jsx("stop",{offset:"1",stopColor:"#FF4000"})]}),d.jsxs("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[d.jsx("stop",{offset:"0.723929",stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[d.jsx("stop",{offset:"0.59513",stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsxs("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[d.jsx("stop",{stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsxs("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[d.jsx("stop",{stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsx("clipPath",{id:"clip0_5_32",children:d.jsx("rect",{width:"120",height:"120",fill:"white"})}),d.jsx("clipPath",{id:"clip1_5_32",children:d.jsx("rect",{width:"120",height:"120",fill:"white"})})]})]}),kDe=({style:t,...e})=>d.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),d.jsx("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),d.jsx("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),d.jsx("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]}),NDe=({style:t,...e})=>d.jsxs("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),d.jsxs("g",{children:[d.jsx("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),d.jsx("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),d.jsx("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),d.jsx("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),d.jsx("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),d.jsx("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),d.jsx("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]}),LDe=({style:t,...e})=>d.jsxs("svg",{fill:"none",height:"1024",width:"1024",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsxs("filter",{id:"a","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"1228",width:"1244",x:"-72",y:"-72",children:[d.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),d.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"-72",dy:"-72"}),d.jsx("feGaussianBlur",{stdDeviation:"54"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),d.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"152",dy:"132"}),d.jsx("feGaussianBlur",{stdDeviation:"74"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),d.jsx("feBlend",{in2:"effect1_innerShadow_3981_20791",mode:"normal",result:"effect2_innerShadow_3981_20791"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"32",dy:"20"}),d.jsx("feGaussianBlur",{stdDeviation:"50"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),d.jsx("feBlend",{in2:"effect2_innerShadow_3981_20791",mode:"normal",result:"effect3_innerShadow_3981_20791"})]}),d.jsxs("filter",{id:"b","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"352",width:"747",x:"142",y:"352",children:[d.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),d.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"8",dy:"12"}),d.jsx("feGaussianBlur",{stdDeviation:"5"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0.69 0"}),d.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"})]}),d.jsxs("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:"0",x2:"1024",y1:"0",y2:"1024",children:[d.jsx("stop",{offset:"0",stopColor:"#8992d1"}),d.jsx("stop",{offset:"1",stopColor:"#646c9f"})]}),d.jsx("clipPath",{id:"d",children:d.jsx("path",{d:"m0 0h1024v1024h-1024z"})}),d.jsxs("g",{"clip-path":"url(#d)",children:[d.jsx("g",{filter:"url(#a)",children:d.jsx("rect",{fill:"url(#c)",height:"1024",rx:"230",width:"1024"})}),d.jsxs("g",{fill:"#fff",filter:"url(#b)",children:[d.jsx("path",{d:"m212.459 354h-54.459c-8.837 0-16 7.163-16 16v203c0 66.826 54.174 121 121 121h44c66.826 0 121-54.174 121-121v-203c0-8.837-7.163-16-16-16h-56.548c-8.837 0-16 7.163-16 16v198.829c0 28.607-23.19 51.797-51.797 51.797-32.693 0-59.196-26.503-59.196-59.196v-191.43c0-8.837-7.163-16-16-16z"}),d.jsx("path",{d:"m868.426 352h-68.495c-6.98 0-12.487 5.934-11.967 12.895l14.206 190c.468 6.263 5.686 11.105 11.966 11.105h45.412c6.409 0 11.687-5.037 11.987-11.44l8.878-190c.32-6.84-5.14-12.56-11.987-12.56z"}),d.jsx("ellipse",{cx:"834",cy:"649.5",rx:"47",ry:"44.5"}),d.jsx("path",{clipRule:"evenodd",d:"m522 687h50c8.837 0 16-7.163 16-16v-80c0-8.837 7.163-16 16-16h33.5c61.58 0 111.5-49.92 111.5-111.5s-49.92-111.5-111.5-111.5h-115.5c-8.837 0-16 7.163-16 16v303c0 8.837 7.163 16 16 16zm70-252v58c0 6.627 5.373 12 12 12h14c20.987 0 38-17.013 38-38v-6c0-20.987-17.013-38-38-38h-14c-6.627 0-12 5.373-12 12z",fillRule:"evenodd"})]})]})]}),une=({style:t,...e})=>{let{app:r}=wt();return d.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"28",height:"28",rx:"3",fill:(r==null?void 0:r.appearance.palette.colorScheme)==="dark"?"#3396ff":"#141414"}),d.jsx("g",{clipPath:"url(#clip0_1765_9946)",children:d.jsx("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_1765_9946",children:d.jsx("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},jDe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",$De=({style:t,...e})=>d.jsxs("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsxs("g",{clipPath:"url(#clip0_1704_1423)",children:[d.jsx("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_1704_1423",children:d.jsx("rect",{width:"176",height:"176",fill:"white"})})})]}),pu={coinbase_wallet:{logo:$M,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:$M,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:lne,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Rx,displayName:"Phantom"},rainbow:{logo:TDe,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:une,displayName:"WalletConnect"},zerion:{logo:$De,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:CDe,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:ADe,displayName:"Crypto.com Onchain",rdns:"com.crypto.wallet"},uniswap:{logo:NDe,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:MDe,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:kDe},universal_profile:{displayName:"Universal Profile",logo:LDe},bybit_wallet:{displayName:"Bybit Wallet",logo:SDe}},Nm=(t,e,r)=>{var n;return(n=pu[t])!=null&&n.displayName?t==="coinbase_wallet"?pu[r].displayName:pu[t].displayName:e==="wallet_connect_v2"&&t==="wallet_connect"?"Wallet Connect":void 0},dne=(t,e,r)=>{var n;return(n=pu[t])!=null&&n.logo?t==="coinbase_wallet"?pu[r].logo:pu[t].logo:e==="wallet_connect_v2"&&t==="wallet_connect"?une:void 0};function ZM(t){var r,n;let e=t.toLowerCase();return!!((n=(r=window==null?void 0:window.webkit)==null?void 0:r.messageHandlers)!=null&&n.ReactNativeWebView)||!!(window!=null&&window.ReactNativeWebView)||["fbav","fban","instagram","snapchat","linkedinapp"].some(i=>e.includes(i))}let fne=C.createContext({});const PDe=({children:t})=>{let e=Ai(),[r,n]=C.useState({});return YL("login",{onComplete:(i,a,s,o,l)=>{l&&l.type!=="passkey"&&l.type!=="cross_app"&&(l.type!=="wallet"||l.walletClientType!=="privy")&&(Dt.put(pz(e.id),l.type),l.type==="wallet"?(Dt.put(lS(e.id),l.walletClientType),Dt.put(cS(e.id),l.chainType),n({accountType:l.type,walletClientType:l.walletClientType,chainType:l.chainType})):(Dt.del(lS(e.id)),Dt.del(cS(e.id)),n({accountType:l.type})))}}),C.useEffect(()=>{if(!e.id)return;let i=Dt.get(pz(e.id)),a=Dt.get(lS(e.id)),s=Dt.get(cS(e.id));i&&n(i==="wallet"?{accountType:i,walletClientType:a,chainType:s}:{accountType:i})},[e.id]),d.jsx(fne.Provider,{value:r,children:t})};let pz=t=>`privy:${t}:recent-login-method`,lS=t=>`privy:${t}:recent-login-wallet-client`,cS=t=>`privy:${t}:recent-login-chain-type`;const _h=()=>C.useContext(fne),Zu=({provider:t,displayName:e,logo:r,connectOnly:n,connector:i})=>{let{navigate:a}=wt(),{connectWallet:s}=_t(),o=_h(),l=i.connectorType==="wallet_connect_v2"?t:i.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches;return d.jsxs(RDe,{onClick:i.connectorType==="phantom"||i.connectorType==="solana_adapter"&&i.walletClientType==="phantom"?()=>{W9()||i.chainType==="solana"&&"isInstalled"in i&&i.isInstalled?(s(i,l),a(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION)):a(ma?ye.PHANTOM_INTERSTITIAL_SCREEN:ye.INSTALL_PHANTOM_SCREEN)}:i.connectorType!=="coinbase_wallet"||i.connectionOptions!=="eoaOnly"||!ma||c||ree()?()=>{(!ZM(window.navigator.userAgent)||event!=null&&event.isTrusted)&&(s(i,l),a(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`},children:[d.jsx(sne,{icon:dne(t,i.connectorType,i.walletClientType)??r,name:i.walletClientType}),d.jsx("span",{children:Nm(t,i.connectorType,i.walletClientType)||e||i.walletClientType}),d.jsxs(DDe,{id:"chip-container",children:[(o==null?void 0:o.walletClientType)===l&&(o==null?void 0:o.chainType)===i.chainType?d.jsx(gz,{color:"gray",children:"Recent"}):d.jsx("span",{id:"connect-text",children:"Connect"}),i.connectorType==="solana_adapter"&&d.jsx(gz,{color:"gray",children:"Solana"})]})]})};let RDe=fe(Jn).withConfig({displayName:"ConnectWalletButton",componentId:"sc-b6343d12-0"})(["> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),gz=fe(xc).withConfig({displayName:"StyledChip",componentId:"sc-b6343d12-1"})(["margin-left:auto;"]),DDe=fe.div.withConfig({displayName:"ChipContainer",componentId:"sc-b6343d12-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const ODe=["coinbase_wallet"];let FDe=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];const UDe=["safe"],BDe=["phantom","universal_profile"],ij=({wallets:t})=>{let{app:e}=wt();return t.length===0?d.jsx(N6,{chainType:e.appearance.walletChainType,withPadding:!0}):d.jsx(d.Fragment,{children:t})},e1=({walletList:t,walletChainType:e,connectors:r,connectOnly:n,ignore:i,walletConnectEnabled:a,forceWallet:s})=>{var h,g;let o=[],l=[],c=[],u=r.filter(m=>e==="ethereum-only"?m.chainType==="ethereum":e!=="solana-only"||m.chainType==="solana"),f=u.find(m=>m.connectorType==="wallet_connect_v2");for(let[m,w]of(s?[s.wallet]:t).entries()){if(w==="detected_ethereum_wallets"||w==="detected_wallets")for(let[_,v]of u.filter(({chainType:b,connectorType:A,walletClientType:S})=>b!=="solana"&&(S==="uniswap_wallet_extension"||S==="uniswap_extension"?!i.includes("uniswap"):S==="crypto.com_wallet_extension"||S==="crypto.com_onchain"?!i.includes("cryptocom"):A==="injected"&&!i.includes(S))).entries()){let{walletClientType:b,walletBranding:A,chainType:S}=v;(b==="unknown"?l:o).push(d.jsx(Zu,{connectOnly:n,provider:b,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${b}-${S}-${_}`))}if(w==="detected_solana_wallets"||w==="detected_wallets")for(let[_,v]of u.filter(({chainType:b,walletClientType:A})=>{if(b==="solana")return e!=="ethereum-only"&&!i.includes(A)}).entries()){let{walletClientType:b,walletBranding:A,chainType:S}=v;(b==="unknown"?l:o).push(d.jsx(Zu,{connectOnly:n,provider:b,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${b}-${S}-${_}`))}if(BDe.includes(w)){let _=u.find(v=>v.connectorType==="injected"&&v.walletClientType===w||v.connectorType===w);if(_&&o.push(d.jsx(Zu,{connectOnly:n,provider:w,connector:_},`${m}-${w}`)),e==="solana-only"||e==="ethereum-and-solana"){let v=u.find(({chainType:b,connectorType:A,walletClientType:S})=>b==="solana"&&A==="solana_adapter"&&S===w);v&&o.push(d.jsx(Zu,{connectOnly:n,provider:w,connector:v},`${w}-solana`))}}else if(FDe.includes(w)){let _=u.find(v=>w==="uniswap"?v.walletClientType==="uniswap_wallet_extension"||v.walletClientType==="uniswap_extension":w==="cryptocom"?v.walletClientType==="crypto.com_wallet_extension"||v.walletClientType==="crypto.com_onchain":v.connectorType==="injected"&&v.walletClientType===w);a&&!_&&(_=f),_&&o.push(d.jsx(Zu,{connectOnly:n,provider:w,connector:_,logo:_.connectorType==="injected"?_.walletBranding.icon:void 0,displayName:_.connectorType==="injected"?_.walletBranding.name:void 0},`${m}-${w}`))}else if(ODe.includes(w)){let _=u.find(({connectorType:v})=>v===w);_&&o.push(d.jsx(Zu,{connectOnly:n,provider:w,connector:_},`${m}-${w}`))}else if(UDe.includes(w))f&&c.push(d.jsx(Zu,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w==="wallet_connect")f&&c.push(d.jsx(Zu,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w===(s==null?void 0:s.wallet)){let _=s.chainType==="ethereum"&&t.includes("detected_ethereum_wallets"),v=s.chainType==="solana"&&t.includes("detected_solana_wallets");if(t.includes("detected_wallets")||_||v){let b=u.find(({walletClientType:A})=>A===w);b&&o.push(d.jsx(Zu,{connectOnly:n,provider:w,displayName:(h=b.walletBranding)==null?void 0:h.name,logo:(g=b.walletBranding)==null?void 0:g.icon,connector:b},`${m}-${w}`))}}}return[...l,...o,...c]},zDe=()=>{var s,o;let{app:t,data:e}=wt(),r=(s=e==null?void 0:e.externalConnectWallet)==null?void 0:s.suggestedAddress,n=r?`Connect the wallet with address ${ns(r)} ${t!=null&&t.name?`to ${t.name}.`:"."}`:`Connect a wallet to ${t==null?void 0:t.name}`,{connectors:i}=_t(),a=e1({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{},"header"),a.length>0&&d.jsx(ev,{title:"Connect your wallet",description:n}),d.jsx(sh,{children:d.jsx(ij,{wallets:a})}),d.jsx(Zt,{})]})},WDe=()=>{var s,o;let{app:t,data:e}=wt(),r=(s=e==null?void 0:e.externalConnectWallet)==null?void 0:s.suggestedAddress,n=r?d.jsxs("span",{children:["Connect the wallet with address ",d.jsx(wo,{showCopyIcon:!1,address:r})," ",t!=null&&t.name?`to ${t.name}.`:"."]}):`Connect a wallet to your ${t==null?void 0:t.name} account`,{connectors:i}=_t(),a=e1({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{},"header"),a.length>0&&d.jsx($x,{title:"Connect your wallet",description:n}),d.jsx(sh,{children:d.jsx(ij,{wallets:a})}),t&&d.jsx(ej,{app:t,alwaysShowImplicitConsent:!0}),d.jsx(Zt,{})]})},aj=({style:t,...e})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...t},...e,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),mz=t=>{var r;let e=(r=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses"))==null?void 0:r.split(" ").filter(n=>pc(n,{strict:!0})).map(n=>jN(n));return!!(e!=null&&e.length)&&!!(t!=null&&t.linkedAccounts.filter(n=>n.type=="wallet"&&e.includes(n.address)).length)};var yz=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new YDe:typeof navigator<"u"?eOe(navigator.userAgent):rOe()}function XDe(t){return t!==""&&ZDe.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 eOe(t){var e=XDe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new VDe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.lengthi)throw new RangeError('The value "'+K+'" is invalid for option "size"');const U=new Uint8Array(K);return Object.setPrototypeOf(U,o.prototype),U}function o(K,U,W){if(typeof K=="number"){if(typeof U=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(K)}return l(K,U,W)}o.poolSize=8192;function l(K,U,W){if(typeof K=="string")return h(K,U);if(ArrayBuffer.isView(K))return m(K);if(K==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K);if(qe(K,ArrayBuffer)||K&&qe(K.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(qe(K,SharedArrayBuffer)||K&&qe(K.buffer,SharedArrayBuffer)))return w(K,U,W);if(typeof K=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const ie=K.valueOf&&K.valueOf();if(ie!=null&&ie!==K)return o.from(ie,U,W);const pe=C(K);if(pe)return pe;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof K[Symbol.toPrimitive]=="function")return o.from(K[Symbol.toPrimitive]("string"),U,W);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof K)}o.from=function(K,U,W){return l(K,U,W)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function c(K){if(typeof K!="number")throw new TypeError('"size" argument must be of type number');if(K<0)throw new RangeError('The value "'+K+'" is invalid for option "size"')}function u(K,U,W){return c(K),K<=0?s(K):U!==void 0?typeof W=="string"?s(K).fill(U,W):s(K).fill(U):s(K)}o.alloc=function(K,U,W){return u(K,U,W)};function f(K){return c(K),s(K<0?0:v(K)|0)}o.allocUnsafe=function(K){return f(K)},o.allocUnsafeSlow=function(K){return f(K)};function h(K,U){if((typeof U!="string"||U==="")&&(U="utf8"),!o.isEncoding(U))throw new TypeError("Unknown encoding: "+U);const W=A(K,U)|0;let ie=s(W);const pe=ie.write(K,U);return pe!==W&&(ie=ie.slice(0,pe)),ie}function g(K){const U=K.length<0?0:v(K.length)|0,W=s(U);for(let ie=0;ie=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return K|0}function b(K){return+K!=K&&(K=0),o.alloc(+K)}o.isBuffer=function(U){return U!=null&&U._isBuffer===!0&&U!==o.prototype},o.compare=function(U,W){if(qe(U,Uint8Array)&&(U=o.from(U,U.offset,U.byteLength)),qe(W,Uint8Array)&&(W=o.from(W,W.offset,W.byteLength)),!o.isBuffer(U)||!o.isBuffer(W))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(U===W)return 0;let ie=U.length,pe=W.length;for(let we=0,he=Math.min(ie,pe);wepe.length?(o.isBuffer(he)||(he=o.from(he)),he.copy(pe,we)):Uint8Array.prototype.set.call(pe,he,we);else if(o.isBuffer(he))he.copy(pe,we);else throw new TypeError('"list" argument must be an Array of Buffers');we+=he.length}return pe};function A(K,U){if(o.isBuffer(K))return K.length;if(ArrayBuffer.isView(K)||qe(K,ArrayBuffer))return K.byteLength;if(typeof K!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof K);const W=K.length,ie=arguments.length>2&&arguments[2]===!0;if(!ie&&W===0)return 0;let pe=!1;for(;;)switch(U){case"ascii":case"latin1":case"binary":return W;case"utf8":case"utf-8":return Ue(K).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W*2;case"hex":return W>>>1;case"base64":return Ee(K).length;default:if(pe)return ie?-1:Ue(K).length;U=(""+U).toLowerCase(),pe=!0}}o.byteLength=A;function S(K,U,W){let ie=!1;if((U===void 0||U<0)&&(U=0),U>this.length||((W===void 0||W>this.length)&&(W=this.length),W<=0)||(W>>>=0,U>>>=0,W<=U))return"";for(K||(K="utf8");;)switch(K){case"hex":return R(this,U,W);case"utf8":case"utf-8":return x(this,U,W);case"ascii":return O(this,U,W);case"latin1":case"binary":return P(this,U,W);case"base64":return k(this,U,W);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,U,W);default:if(ie)throw new TypeError("Unknown encoding: "+K);K=(K+"").toLowerCase(),ie=!0}}o.prototype._isBuffer=!0;function j(K,U,W){const ie=K[U];K[U]=K[W],K[W]=ie}o.prototype.swap16=function(){const U=this.length;if(U%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let W=0;WW&&(U+=" ... "),""},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(U,W,ie,pe,we){if(qe(U,Uint8Array)&&(U=o.from(U,U.offset,U.byteLength)),!o.isBuffer(U))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof U);if(W===void 0&&(W=0),ie===void 0&&(ie=U?U.length:0),pe===void 0&&(pe=0),we===void 0&&(we=this.length),W<0||ie>U.length||pe<0||we>this.length)throw new RangeError("out of range index");if(pe>=we&&W>=ie)return 0;if(pe>=we)return-1;if(W>=ie)return 1;if(W>>>=0,ie>>>=0,pe>>>=0,we>>>=0,this===U)return 0;let he=we-pe,Re=ie-W;const Je=Math.min(he,Re),et=this.slice(pe,we),it=U.slice(W,ie);for(let ut=0;ut2147483647?W=2147483647:W<-2147483648&&(W=-2147483648),W=+W,Ie(W)&&(W=pe?0:K.length-1),W<0&&(W=K.length+W),W>=K.length){if(pe)return-1;W=K.length-1}else if(W<0)if(pe)W=0;else return-1;if(typeof U=="string"&&(U=o.from(U,ie)),o.isBuffer(U))return U.length===0?-1:I(K,U,W,ie,pe);if(typeof U=="number")return U=U&255,typeof Uint8Array.prototype.indexOf=="function"?pe?Uint8Array.prototype.indexOf.call(K,U,W):Uint8Array.prototype.lastIndexOf.call(K,U,W):I(K,[U],W,ie,pe);throw new TypeError("val must be string, number or Buffer")}function I(K,U,W,ie,pe){let we=1,he=K.length,Re=U.length;if(ie!==void 0&&(ie=String(ie).toLowerCase(),ie==="ucs2"||ie==="ucs-2"||ie==="utf16le"||ie==="utf-16le")){if(K.length<2||U.length<2)return-1;we=2,he/=2,Re/=2,W/=2}function Je(it,ut){return we===1?it[ut]:it.readUInt16BE(ut*we)}let et;if(pe){let it=-1;for(et=W;ethe&&(W=he-Re),et=W;et>=0;et--){let it=!0;for(let ut=0;utpe&&(ie=pe)):ie=pe;const we=U.length;ie>we/2&&(ie=we/2);let he;for(he=0;he>>0,isFinite(ie)?(ie=ie>>>0,pe===void 0&&(pe="utf8")):(pe=ie,ie=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const we=this.length-W;if((ie===void 0||ie>we)&&(ie=we),U.length>0&&(ie<0||W<0)||W>this.length)throw new RangeError("Attempt to write outside buffer bounds");pe||(pe="utf8");let he=!1;for(;;)switch(pe){case"hex":return B(this,U,W,ie);case"utf8":case"utf-8":return V(this,U,W,ie);case"ascii":case"latin1":case"binary":return se(this,U,W,ie);case"base64":return Y(this,U,W,ie);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,U,W,ie);default:if(he)throw new TypeError("Unknown encoding: "+pe);pe=(""+pe).toLowerCase(),he=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(K,U,W){return U===0&&W===K.length?e.fromByteArray(K):e.fromByteArray(K.slice(U,W))}function x(K,U,W){W=Math.min(K.length,W);const ie=[];let pe=U;for(;pe239?4:we>223?3:we>191?2:1;if(pe+Re<=W){let Je,et,it,ut;switch(Re){case 1:we<128&&(he=we);break;case 2:Je=K[pe+1],(Je&192)===128&&(ut=(we&31)<<6|Je&63,ut>127&&(he=ut));break;case 3:Je=K[pe+1],et=K[pe+2],(Je&192)===128&&(et&192)===128&&(ut=(we&15)<<12|(Je&63)<<6|et&63,ut>2047&&(ut<55296||ut>57343)&&(he=ut));break;case 4:Je=K[pe+1],et=K[pe+2],it=K[pe+3],(Je&192)===128&&(et&192)===128&&(it&192)===128&&(ut=(we&15)<<18|(Je&63)<<12|(et&63)<<6|it&63,ut>65535&&ut<1114112&&(he=ut))}}he===null?(he=65533,Re=1):he>65535&&(he-=65536,ie.push(he>>>10&1023|55296),he=56320|he&1023),ie.push(he),pe+=Re}return L(ie)}const E=4096;function L(K){const U=K.length;if(U<=E)return String.fromCharCode.apply(String,K);let W="",ie=0;for(;ieie)&&(W=ie);let pe="";for(let we=U;weie&&(U=ie),W<0?(W+=ie,W<0&&(W=0)):W>ie&&(W=ie),WW)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(U,W,ie){U=U>>>0,W=W>>>0,ie||D(U,W,this.length);let pe=this[U],we=1,he=0;for(;++he>>0,W=W>>>0,ie||D(U,W,this.length);let pe=this[U+--W],we=1;for(;W>0&&(we*=256);)pe+=this[U+--W]*we;return pe},o.prototype.readUint8=o.prototype.readUInt8=function(U,W){return U=U>>>0,W||D(U,1,this.length),this[U]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(U,W){return U=U>>>0,W||D(U,2,this.length),this[U]|this[U+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(U,W){return U=U>>>0,W||D(U,2,this.length),this[U]<<8|this[U+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(U,W){return U=U>>>0,W||D(U,4,this.length),(this[U]|this[U+1]<<8|this[U+2]<<16)+this[U+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(U,W){return U=U>>>0,W||D(U,4,this.length),this[U]*16777216+(this[U+1]<<16|this[U+2]<<8|this[U+3])},o.prototype.readBigUInt64LE=$e(function(U){U=U>>>0,me(U,"offset");const W=this[U],ie=this[U+7];(W===void 0||ie===void 0)&&be(U,this.length-8);const pe=W+this[++U]*2**8+this[++U]*2**16+this[++U]*2**24,we=this[++U]+this[++U]*2**8+this[++U]*2**16+ie*2**24;return BigInt(pe)+(BigInt(we)<>>0,me(U,"offset");const W=this[U],ie=this[U+7];(W===void 0||ie===void 0)&&be(U,this.length-8);const pe=W*2**24+this[++U]*2**16+this[++U]*2**8+this[++U],we=this[++U]*2**24+this[++U]*2**16+this[++U]*2**8+ie;return(BigInt(pe)<>>0,W=W>>>0,ie||D(U,W,this.length);let pe=this[U],we=1,he=0;for(;++he=we&&(pe-=Math.pow(2,8*W)),pe},o.prototype.readIntBE=function(U,W,ie){U=U>>>0,W=W>>>0,ie||D(U,W,this.length);let pe=W,we=1,he=this[U+--pe];for(;pe>0&&(we*=256);)he+=this[U+--pe]*we;return we*=128,he>=we&&(he-=Math.pow(2,8*W)),he},o.prototype.readInt8=function(U,W){return U=U>>>0,W||D(U,1,this.length),this[U]&128?(255-this[U]+1)*-1:this[U]},o.prototype.readInt16LE=function(U,W){U=U>>>0,W||D(U,2,this.length);const ie=this[U]|this[U+1]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt16BE=function(U,W){U=U>>>0,W||D(U,2,this.length);const ie=this[U+1]|this[U]<<8;return ie&32768?ie|4294901760:ie},o.prototype.readInt32LE=function(U,W){return U=U>>>0,W||D(U,4,this.length),this[U]|this[U+1]<<8|this[U+2]<<16|this[U+3]<<24},o.prototype.readInt32BE=function(U,W){return U=U>>>0,W||D(U,4,this.length),this[U]<<24|this[U+1]<<16|this[U+2]<<8|this[U+3]},o.prototype.readBigInt64LE=$e(function(U){U=U>>>0,me(U,"offset");const W=this[U],ie=this[U+7];(W===void 0||ie===void 0)&&be(U,this.length-8);const pe=this[U+4]+this[U+5]*2**8+this[U+6]*2**16+(ie<<24);return(BigInt(pe)<>>0,me(U,"offset");const W=this[U],ie=this[U+7];(W===void 0||ie===void 0)&&be(U,this.length-8);const pe=(W<<24)+this[++U]*2**16+this[++U]*2**8+this[++U];return(BigInt(pe)<>>0,W||D(U,4,this.length),r.read(this,U,!0,23,4)},o.prototype.readFloatBE=function(U,W){return U=U>>>0,W||D(U,4,this.length),r.read(this,U,!1,23,4)},o.prototype.readDoubleLE=function(U,W){return U=U>>>0,W||D(U,8,this.length),r.read(this,U,!0,52,8)},o.prototype.readDoubleBE=function(U,W){return U=U>>>0,W||D(U,8,this.length),r.read(this,U,!1,52,8)};function $(K,U,W,ie,pe,we){if(!o.isBuffer(K))throw new TypeError('"buffer" argument must be a Buffer instance');if(U>pe||UK.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(U,W,ie,pe){if(U=+U,W=W>>>0,ie=ie>>>0,!pe){const Re=Math.pow(2,8*ie)-1;$(this,U,W,ie,Re,0)}let we=1,he=0;for(this[W]=U&255;++he>>0,ie=ie>>>0,!pe){const Re=Math.pow(2,8*ie)-1;$(this,U,W,ie,Re,0)}let we=ie-1,he=1;for(this[W+we]=U&255;--we>=0&&(he*=256);)this[W+we]=U/he&255;return W+ie},o.prototype.writeUint8=o.prototype.writeUInt8=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,1,255,0),this[W]=U&255,W+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,2,65535,0),this[W]=U&255,this[W+1]=U>>>8,W+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,2,65535,0),this[W]=U>>>8,this[W+1]=U&255,W+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,4,4294967295,0),this[W+3]=U>>>24,this[W+2]=U>>>16,this[W+1]=U>>>8,this[W]=U&255,W+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,4,4294967295,0),this[W]=U>>>24,this[W+1]=U>>>16,this[W+2]=U>>>8,this[W+3]=U&255,W+4};function X(K,U,W,ie,pe){Q(U,ie,pe,K,W,7);let we=Number(U&BigInt(4294967295));K[W++]=we,we=we>>8,K[W++]=we,we=we>>8,K[W++]=we,we=we>>8,K[W++]=we;let he=Number(U>>BigInt(32)&BigInt(4294967295));return K[W++]=he,he=he>>8,K[W++]=he,he=he>>8,K[W++]=he,he=he>>8,K[W++]=he,W}function le(K,U,W,ie,pe){Q(U,ie,pe,K,W,7);let we=Number(U&BigInt(4294967295));K[W+7]=we,we=we>>8,K[W+6]=we,we=we>>8,K[W+5]=we,we=we>>8,K[W+4]=we;let he=Number(U>>BigInt(32)&BigInt(4294967295));return K[W+3]=he,he=he>>8,K[W+2]=he,he=he>>8,K[W+1]=he,he=he>>8,K[W]=he,W+8}o.prototype.writeBigUInt64LE=$e(function(U,W=0){return X(this,U,W,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=$e(function(U,W=0){return le(this,U,W,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(U,W,ie,pe){if(U=+U,W=W>>>0,!pe){const Je=Math.pow(2,8*ie-1);$(this,U,W,ie,Je-1,-Je)}let we=0,he=1,Re=0;for(this[W]=U&255;++we>0)-Re&255;return W+ie},o.prototype.writeIntBE=function(U,W,ie,pe){if(U=+U,W=W>>>0,!pe){const Je=Math.pow(2,8*ie-1);$(this,U,W,ie,Je-1,-Je)}let we=ie-1,he=1,Re=0;for(this[W+we]=U&255;--we>=0&&(he*=256);)U<0&&Re===0&&this[W+we+1]!==0&&(Re=1),this[W+we]=(U/he>>0)-Re&255;return W+ie},o.prototype.writeInt8=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,1,127,-128),U<0&&(U=255+U+1),this[W]=U&255,W+1},o.prototype.writeInt16LE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,2,32767,-32768),this[W]=U&255,this[W+1]=U>>>8,W+2},o.prototype.writeInt16BE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,2,32767,-32768),this[W]=U>>>8,this[W+1]=U&255,W+2},o.prototype.writeInt32LE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,4,2147483647,-2147483648),this[W]=U&255,this[W+1]=U>>>8,this[W+2]=U>>>16,this[W+3]=U>>>24,W+4},o.prototype.writeInt32BE=function(U,W,ie){return U=+U,W=W>>>0,ie||$(this,U,W,4,2147483647,-2147483648),U<0&&(U=4294967295+U+1),this[W]=U>>>24,this[W+1]=U>>>16,this[W+2]=U>>>8,this[W+3]=U&255,W+4},o.prototype.writeBigInt64LE=$e(function(U,W=0){return X(this,U,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=$e(function(U,W=0){return le(this,U,W,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(K,U,W,ie,pe,we){if(W+ie>K.length)throw new RangeError("Index out of range");if(W<0)throw new RangeError("Index out of range")}function ee(K,U,W,ie,pe){return U=+U,W=W>>>0,pe||H(K,U,W,4),r.write(K,U,W,ie,23,4),W+4}o.prototype.writeFloatLE=function(U,W,ie){return ee(this,U,W,!0,ie)},o.prototype.writeFloatBE=function(U,W,ie){return ee(this,U,W,!1,ie)};function J(K,U,W,ie,pe){return U=+U,W=W>>>0,pe||H(K,U,W,8),r.write(K,U,W,ie,52,8),W+8}o.prototype.writeDoubleLE=function(U,W,ie){return J(this,U,W,!0,ie)},o.prototype.writeDoubleBE=function(U,W,ie){return J(this,U,W,!1,ie)},o.prototype.copy=function(U,W,ie,pe){if(!o.isBuffer(U))throw new TypeError("argument should be a Buffer");if(ie||(ie=0),!pe&&pe!==0&&(pe=this.length),W>=U.length&&(W=U.length),W||(W=0),pe>0&&pe=this.length)throw new RangeError("Index out of range");if(pe<0)throw new RangeError("sourceEnd out of bounds");pe>this.length&&(pe=this.length),U.length-W>>0,ie=ie===void 0?this.length:ie>>>0,U||(U=0);let we;if(typeof U=="number")for(we=W;we2**32?pe=z(String(W)):typeof W=="bigint"&&(pe=String(W),(W>BigInt(2)**BigInt(32)||W<-(BigInt(2)**BigInt(32)))&&(pe=z(pe)),pe+="n"),ie+=` It must be ${U}. Received ${pe}`,ie},RangeError);function z(K){let U="",W=K.length;const ie=K[0]==="-"?1:0;for(;W>=ie+4;W-=3)U=`_${K.slice(W-3,W)}${U}`;return`${K.slice(0,W)}${U}`}function G(K,U,W){me(U,"offset"),(K[U]===void 0||K[U+W]===void 0)&&be(U,K.length-(W+1))}function Q(K,U,W,ie,pe,we){if(K>W||K= 0${he} and < 2${he} ** ${(we+1)*8}${he}`:Re=`>= -(2${he} ** ${(we+1)*8-1}${he}) and < 2 ** ${(we+1)*8-1}${he}`,new te.ERR_OUT_OF_RANGE("value",Re,K)}G(ie,pe,we)}function me(K,U){if(typeof K!="number")throw new te.ERR_INVALID_ARG_TYPE(U,"number",K)}function be(K,U,W){throw Math.floor(K)!==K?(me(K,W),new te.ERR_OUT_OF_RANGE("offset","an integer",K)):U<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${U}`,K)}const Ce=/[^+/0-9A-Za-z-_]/g;function Fe(K){if(K=K.split("=")[0],K=K.trim().replace(Ce,""),K.length<2)return"";for(;K.length%4!==0;)K=K+"=";return K}function Ue(K,U){U=U||1/0;let W;const ie=K.length;let pe=null;const we=[];for(let he=0;he55295&&W<57344){if(!pe){if(W>56319){(U-=3)>-1&&we.push(239,191,189);continue}else if(he+1===ie){(U-=3)>-1&&we.push(239,191,189);continue}pe=W;continue}if(W<56320){(U-=3)>-1&&we.push(239,191,189),pe=W;continue}W=(pe-55296<<10|W-56320)+65536}else pe&&(U-=3)>-1&&we.push(239,191,189);if(pe=null,W<128){if((U-=1)<0)break;we.push(W)}else if(W<2048){if((U-=2)<0)break;we.push(W>>6|192,W&63|128)}else if(W<65536){if((U-=3)<0)break;we.push(W>>12|224,W>>6&63|128,W&63|128)}else if(W<1114112){if((U-=4)<0)break;we.push(W>>18|240,W>>12&63|128,W>>6&63|128,W&63|128)}else throw new Error("Invalid code point")}return we}function Ke(K){const U=[];for(let W=0;W>8,pe=W%256,we.push(pe),we.push(ie);return we}function Ee(K){return e.toByteArray(Fe(K))}function He(K,U,W,ie){let pe;for(pe=0;pe=U.length||pe>=K.length);++pe)U[pe+W]=K[pe];return pe}function qe(K,U){return K instanceof U||K!=null&&K.constructor!=null&&K.constructor.name!=null&&K.constructor.name===U.name}function Ie(K){return K!==K}const Ne=function(){const K="0123456789abcdef",U=new Array(256);for(let W=0;W<16;++W){const ie=W*16;for(let pe=0;pe<16;++pe)U[ie+pe]=K[W]+K[pe]}return U}();function $e(K){return typeof BigInt>"u"?je:K}function je(){throw new Error("BigInt not supported")}})(Qw);var YC,nB;function wke(){if(nB)return YC;nB=1;function t(m,w){var C=Object.keys(m);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(m);w&&(v=v.filter(function(b){return Object.getOwnPropertyDescriptor(m,b).enumerable})),C.push.apply(C,v)}return C}function e(m){for(var w=1;w0?this.tail.next=v:this.head=v,this.tail=v,++this.length}},{key:"unshift",value:function(C){var v={data:C,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}},{key:"shift",value:function(){if(this.length!==0){var C=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,C}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(C){if(this.length===0)return"";for(var v=this.head,b=""+v.data;v=v.next;)b+=C+v.data;return b}},{key:"concat",value:function(C){if(this.length===0)return c.alloc(0);for(var v=c.allocUnsafe(C>>>0),b=this.head,A=0;b;)g(b.data,v,A),A+=b.data.length,b=b.next;return v}},{key:"consume",value:function(C,v){var b;return CS.length?S.length:C;if(j===S.length?A+=S:A+=S.slice(0,C),C-=j,C===0){j===S.length?(++b,v.next?this.head=v.next:this.head=this.tail=null):(this.head=v,v.data=S.slice(j));break}++b}return this.length-=b,A}},{key:"_getBuffer",value:function(C){var v=c.allocUnsafe(C),b=this.head,A=1;for(b.data.copy(v),C-=b.data.length;b=b.next;){var S=b.data,j=C>S.length?S.length:C;if(S.copy(v,v.length-C,0,j),C-=j,C===0){j===S.length?(++A,b.next?this.head=b.next:this.head=this.tail=null):(this.head=b,b.data=S.slice(j));break}++A}return this.length-=A,v}},{key:h,value:function(C,v){return f(this,e(e({},v),{},{depth:0,customInspect:!1}))}}]),m}(),YC}function vke(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(DM,this,t)):process.nextTick(DM,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(a){!e&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(L6,r):(r._writableState.errorEmitted=!0,process.nextTick(iB,r,a)):process.nextTick(iB,r,a):e?(process.nextTick(L6,r),e(a)):process.nextTick(L6,r)}),this)}function iB(t,e){DM(t,e),L6(t)}function L6(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function bke(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function DM(t,e){t.emit("error",e)}function xke(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var fte={destroy:vke,undestroy:bke,errorOrDestroy:xke},S1={};function Eke(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var hte={};function Al(t,e,r){r||(r=Error);function n(a,s,o){return typeof e=="string"?e:e(a,s,o)}var i=function(a){Eke(s,a);function s(o,l,c){return a.call(this,n(o,l,c))||this}return s}(r);i.prototype.name=r.name,i.prototype.code=t,hte[t]=i}function aB(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function _ke(t,e,r){return t.substr(0,e.length)===e}function Cke(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Ske(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}Al("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);Al("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&_ke(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(Cke(t," argument"))i="The ".concat(t," ").concat(n," ").concat(aB(e,"type"));else{var a=Ske(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(a," ").concat(n," ").concat(aB(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);Al("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Al("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});Al("ERR_STREAM_PREMATURE_CLOSE","Premature close");Al("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});Al("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Al("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Al("ERR_STREAM_WRITE_AFTER_END","write after end");Al("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Al("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);Al("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");S1.codes=hte;var Ake=S1.codes.ERR_INVALID_OPT_VALUE;function Ike(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Mke(t,e,r,n){var i=Ike(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new Ake(a,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var pte={getHighWaterMark:Mke},Tke=kke;function kke(t,e){if(KC("noDeprecation"))return t;var r=!1;function n(){if(!r){if(KC("throwDeprecation"))throw new Error(e);KC("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function KC(t){try{if(!Xt.localStorage)return!1}catch{return!1}var e=Xt.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var JC,sB;function gte(){if(sB)return JC;sB=1,JC=B;function t(ee){var J=this;this.next=null,this.entry=null,this.finish=function(){H(J,ee)}}var e;B.WritableState=F;var r={deprecate:Tke},n=ute,i=Qw.Buffer,a=(typeof Xt<"u"?Xt:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(ee){return i.from(ee)}function o(ee){return i.isBuffer(ee)||ee instanceof a}var l=fte,c=pte,u=c.getHighWaterMark,f=S1.codes,h=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,m=f.ERR_MULTIPLE_CALLBACK,w=f.ERR_STREAM_CANNOT_PIPE,C=f.ERR_STREAM_DESTROYED,v=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,A=f.ERR_UNKNOWN_ENCODING,S=l.errorOrDestroy;gs(B,n);function j(){}function F(ee,J,te){e=e||Hg(),ee=ee||{},typeof te!="boolean"&&(te=J instanceof e),this.objectMode=!!ee.objectMode,te&&(this.objectMode=this.objectMode||!!ee.writableObjectMode),this.highWaterMark=u(this,ee,"writableHighWaterMark",te),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var re=ee.decodeStrings===!1;this.decodeStrings=!re,this.defaultEncoding=ee.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(z){L(J,z)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=ee.emitClose!==!1,this.autoDestroy=!!ee.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}F.prototype.getBuffer=function(){for(var J=this.bufferedRequest,te=[];J;)te.push(J),J=J.next;return te},function(){try{Object.defineProperty(F.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var I;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(I=Function.prototype[Symbol.hasInstance],Object.defineProperty(B,Symbol.hasInstance,{value:function(J){return I.call(this,J)?!0:this!==B?!1:J&&J._writableState instanceof F}})):I=function(J){return J instanceof this};function B(ee){e=e||Hg();var J=this instanceof e;if(!J&&!I.call(B,this))return new B(ee);this._writableState=new F(ee,this,J),this.writable=!0,ee&&(typeof ee.write=="function"&&(this._write=ee.write),typeof ee.writev=="function"&&(this._writev=ee.writev),typeof ee.destroy=="function"&&(this._destroy=ee.destroy),typeof ee.final=="function"&&(this._final=ee.final)),n.call(this)}B.prototype.pipe=function(){S(this,new w)};function V(ee,J){var te=new b;S(ee,te),process.nextTick(J,te)}function se(ee,J,te,re){var z;return te===null?z=new v:typeof te!="string"&&!J.objectMode&&(z=new h("chunk",["string","Buffer"],te)),z?(S(ee,z),process.nextTick(re,z),!1):!0}B.prototype.write=function(ee,J,te){var re=this._writableState,z=!1,G=!re.objectMode&&o(ee);return G&&!i.isBuffer(ee)&&(ee=s(ee)),typeof J=="function"&&(te=J,J=null),G?J="buffer":J||(J=re.defaultEncoding),typeof te!="function"&&(te=j),re.ending?V(this,te):(G||se(this,re,ee,te))&&(re.pendingcb++,z=N(this,re,G,ee,J,te)),z},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){var ee=this._writableState;ee.corked&&(ee.corked--,!ee.writing&&!ee.corked&&!ee.bufferProcessing&&ee.bufferedRequest&&R(this,ee))},B.prototype.setDefaultEncoding=function(J){if(typeof J=="string"&&(J=J.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((J+"").toLowerCase())>-1))throw new A(J);return this._writableState.defaultEncoding=J,this},Object.defineProperty(B.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Y(ee,J,te){return!ee.objectMode&&ee.decodeStrings!==!1&&typeof J=="string"&&(J=i.from(J,te)),J}Object.defineProperty(B.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function N(ee,J,te,re,z,G){if(!te){var Q=Y(J,re,z);re!==Q&&(te=!0,z="buffer",re=Q)}var me=J.objectMode?1:re.length;J.length+=me;var be=J.length */(function(t,e){var r=Qw,n=r.Buffer;function i(s,o){for(var l in s)o[l]=s[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=a);function a(s,o,l){return n(s,o,l)}a.prototype=Object.create(n.prototype),i(n,a),a.from=function(s,o,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return n(s,o,l)},a.alloc=function(s,o,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=n(s);return o!==void 0?typeof l=="string"?c.fill(o,l):c.fill(o):c.fill(0),c},a.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n(s)},a.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(s)}})(OM,OM.exports);var Ah=OM.exports,lB;function cB(){if(lB)return ZC;lB=1;var t=Ah.Buffer,e=t.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(v){if(!v)return"utf8";for(var b;;)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(b)return;v=(""+v).toLowerCase(),b=!0}}function n(v){var b=r(v);if(typeof b!="string"&&(t.isEncoding===e||!e(v)))throw new Error("Unknown encoding: "+v);return b||v}ZC.StringDecoder=i;function i(v){this.encoding=n(v);var b;switch(this.encoding){case"utf16le":this.text=f,this.end=h,b=4;break;case"utf8":this.fillLast=l,b=4;break;case"base64":this.text=g,this.end=m,b=3;break;default:this.write=w,this.end=C;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(b)}i.prototype.write=function(v){if(v.length===0)return"";var b,A;if(this.lastNeed){if(b=this.fillLast(v),b===void 0)return"";A=this.lastNeed,this.lastNeed=0}else A=0;return A>5===6?2:v>>4===14?3:v>>3===30?4:v>>6===2?-1:-2}function s(v,b,A){var S=b.length-1;if(S=0?(j>0&&(v.lastNeed=j-1),j):--S=0?(j>0&&(v.lastNeed=j-2),j):--S=0?(j>0&&(j===2?j=0:v.lastNeed=j-3),j):0))}function o(v,b,A){if((b[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&b.length>1){if((b[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&b.length>2&&(b[2]&192)!==128)return v.lastNeed=2,"�"}}function l(v){var b=this.lastTotal-this.lastNeed,A=o(this,v);if(A!==void 0)return A;if(this.lastNeed<=v.length)return v.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,b,0,v.length),this.lastNeed-=v.length}function c(v,b){var A=s(this,v,b);if(!this.lastNeed)return v.toString("utf8",b);this.lastTotal=A;var S=v.length-(A-this.lastNeed);return v.copy(this.lastChar,0,S),v.toString("utf8",b,S)}function u(v){var b=v&&v.length?this.write(v):"";return this.lastNeed?b+"�":b}function f(v,b){if((v.length-b)%2===0){var A=v.toString("utf16le",b);if(A){var S=A.charCodeAt(A.length-1);if(S>=55296&&S<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],A.slice(0,-1)}return A}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",b,v.length-1)}function h(v){var b=v&&v.length?this.write(v):"";if(this.lastNeed){var A=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,A)}return b}function g(v,b){var A=(v.length-b)%3;return A===0?v.toString("base64",b):(this.lastNeed=3-A,this.lastTotal=3,A===1?this.lastChar[0]=v[v.length-1]:(this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1]),v.toString("base64",b,v.length-A))}function m(v){var b=v&&v.length?this.write(v):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function w(v){return v.toString(this.encoding)}function C(v){return v&&v.length?this.write(v):""}return ZC}var uB=S1.codes.ERR_STREAM_PREMATURE_CLOSE;function Nke(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i0)if(typeof Q!="string"&&!Fe.objectMode&&Object.getPrototypeOf(Q)!==n.prototype&&(Q=a(Q)),be)Fe.endEmitted?j(G,new v):Y(G,Fe,Q,!0);else if(Fe.ended)j(G,new w);else{if(Fe.destroyed)return!1;Fe.reading=!1,Fe.decoder&&!me?(Q=Fe.decoder.write(Q),Fe.objectMode||Q.length!==0?Y(G,Fe,Q,!1):R(G,Fe)):Y(G,Fe,Q,!1)}else be||(Fe.reading=!1,R(G,Fe))}return!Fe.ended&&(Fe.length=k?G=k:(G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++),G}function E(G,Q){return G<=0||Q.length===0&&Q.ended?0:Q.objectMode?1:G!==G?Q.flowing&&Q.length?Q.buffer.head.data.length:Q.length:(G>Q.highWaterMark&&(Q.highWaterMark=x(G)),G<=Q.length?G:Q.ended?Q.length:(Q.needReadable=!0,0))}V.prototype.read=function(G){l("read",G),G=parseInt(G,10);var Q=this._readableState,me=G;if(G!==0&&(Q.emittedReadable=!1),G===0&&Q.needReadable&&((Q.highWaterMark!==0?Q.length>=Q.highWaterMark:Q.length>0)||Q.ended))return l("read: emitReadable",Q.length,Q.ended),Q.length===0&&Q.ended?te(this):O(this),null;if(G=E(G,Q),G===0&&Q.ended)return Q.length===0&&te(this),null;var be=Q.needReadable;l("need readable",be),(Q.length===0||Q.length-G0?Ce=J(G,Q):Ce=null,Ce===null?(Q.needReadable=Q.length<=Q.highWaterMark,G=0):(Q.length-=G,Q.awaitDrain=0),Q.length===0&&(Q.ended||(Q.needReadable=!0),me!==G&&Q.ended&&te(this)),Ce!==null&&this.emit("data",Ce),Ce};function L(G,Q){if(l("onEofChunk"),!Q.ended){if(Q.decoder){var me=Q.decoder.end();me&&me.length&&(Q.buffer.push(me),Q.length+=Q.objectMode?1:me.length)}Q.ended=!0,Q.sync?O(G):(Q.needReadable=!1,Q.emittedReadable||(Q.emittedReadable=!0,P(G)))}}function O(G){var Q=G._readableState;l("emitReadable",Q.needReadable,Q.emittedReadable),Q.needReadable=!1,Q.emittedReadable||(l("emitReadable",Q.flowing),Q.emittedReadable=!0,process.nextTick(P,G))}function P(G){var Q=G._readableState;l("emitReadable_",Q.destroyed,Q.length,Q.ended),!Q.destroyed&&(Q.length||Q.ended)&&(G.emit("readable"),Q.emittedReadable=!1),Q.needReadable=!Q.flowing&&!Q.ended&&Q.length<=Q.highWaterMark,ee(G)}function R(G,Q){Q.readingMore||(Q.readingMore=!0,process.nextTick(M,G,Q))}function M(G,Q){for(;!Q.reading&&!Q.ended&&(Q.length1&&z(be.pipes,G)!==-1)&&!Ee&&(l("false write response, pause",be.awaitDrain),be.awaitDrain++),me.pause())}function Ie(K){l("onerror",K),je(),G.removeListener("error",Ie),e(G,"error")===0&&j(G,K)}I(G,"error",Ie);function Ne(){G.removeListener("finish",$e),je()}G.once("close",Ne);function $e(){l("onfinish"),G.removeListener("close",Ne),je()}G.once("finish",$e);function je(){l("unpipe"),me.unpipe(G)}return G.emit("pipe",me),be.flowing||(l("pipe resume"),me.resume()),G};function D(G){return function(){var me=G._readableState;l("pipeOnDrain",me.awaitDrain),me.awaitDrain&&me.awaitDrain--,me.awaitDrain===0&&e(G,"data")&&(me.flowing=!0,ee(G))}}V.prototype.unpipe=function(G){var Q=this._readableState,me={hasUnpiped:!1};if(Q.pipesCount===0)return this;if(Q.pipesCount===1)return G&&G!==Q.pipes?this:(G||(G=Q.pipes),Q.pipes=null,Q.pipesCount=0,Q.flowing=!1,G&&G.emit("unpipe",this,me),this);if(!G){var be=Q.pipes,Ce=Q.pipesCount;Q.pipes=null,Q.pipesCount=0,Q.flowing=!1;for(var Fe=0;Fe0,be.flowing!==!1&&this.resume()):G==="readable"&&!be.endEmitted&&!be.readableListening&&(be.readableListening=be.needReadable=!0,be.flowing=!1,be.emittedReadable=!1,l("on readable",be.length,be.reading),be.length?O(this):be.reading||process.nextTick(X,this)),me},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(G,Q){var me=r.prototype.removeListener.call(this,G,Q);return G==="readable"&&process.nextTick($,this),me},V.prototype.removeAllListeners=function(G){var Q=r.prototype.removeAllListeners.apply(this,arguments);return(G==="readable"||G===void 0)&&process.nextTick($,this),Q};function $(G){var Q=G._readableState;Q.readableListening=G.listenerCount("readable")>0,Q.resumeScheduled&&!Q.paused?Q.flowing=!0:G.listenerCount("data")>0&&G.resume()}function X(G){l("readable nexttick read 0"),G.read(0)}V.prototype.resume=function(){var G=this._readableState;return G.flowing||(l("resume"),G.flowing=!G.readableListening,le(this,G)),G.paused=!1,this};function le(G,Q){Q.resumeScheduled||(Q.resumeScheduled=!0,process.nextTick(H,G,Q))}function H(G,Q){l("resume",Q.reading),Q.reading||G.read(0),Q.resumeScheduled=!1,G.emit("resume"),ee(G),Q.flowing&&!Q.reading&&G.read(0)}V.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function ee(G){var Q=G._readableState;for(l("flow",Q.flowing);Q.flowing&&G.read()!==null;);}V.prototype.wrap=function(G){var Q=this,me=this._readableState,be=!1;G.on("end",function(){if(l("wrapped end"),me.decoder&&!me.ended){var Ue=me.decoder.end();Ue&&Ue.length&&Q.push(Ue)}Q.push(null)}),G.on("data",function(Ue){if(l("wrapped data"),me.decoder&&(Ue=me.decoder.write(Ue)),!(me.objectMode&&Ue==null)&&!(!me.objectMode&&(!Ue||!Ue.length))){var Ke=Q.push(Ue);Ke||(be=!0,G.pause())}});for(var Ce in G)this[Ce]===void 0&&typeof G[Ce]=="function"&&(this[Ce]=function(Ke){return function(){return G[Ke].apply(G,arguments)}}(Ce));for(var Fe=0;Fe=Q.length?(Q.decoder?me=Q.buffer.join(""):Q.buffer.length===1?me=Q.buffer.first():me=Q.buffer.concat(Q.length),Q.buffer.clear()):me=Q.buffer.consume(G,Q.decoder),me}function te(G){var Q=G._readableState;l("endReadable",Q.endEmitted),Q.endEmitted||(Q.ended=!0,process.nextTick(re,Q,G))}function re(G,Q){if(l("endReadableNT",G.endEmitted,G.length),!G.endEmitted&&G.length===0&&(G.endEmitted=!0,Q.readable=!1,Q.emit("end"),G.autoDestroy)){var me=Q._writableState;(!me||me.autoDestroy&&me.finished)&&Q.destroy()}}typeof Symbol=="function"&&(V.from=function(G,Q){return S===void 0&&(S=Pke()),S(V,G,Q)});function z(G,Q){for(var me=0,be=G.length;me0;return Vke(s,l,c,function(u){i||(i=u),u&&a.forEach(mB),!l&&(a.forEach(mB),n(i))})});return e.reduce(Yke)}var Qke=Jke;(function(t,e){e=t.exports=yte(),e.Stream=e,e.Readable=e,e.Writable=gte(),e.Duplex=Hg(),e.Transform=wte,e.PassThrough=zke,e.finished=$L,e.pipeline=Qke})(RM,RM.exports);var xte=RM.exports;const{Transform:Zke}=xte;var Xke=t=>class Ete extends Zke{constructor(r,n,i,a,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=a,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let a=null;try{this.update(r,n)}catch(s){a=s}i(a)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Ete(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:eNe}=xte;var tNe=t=>class _te extends eNe{constructor(r,n,i,a){super(a),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=a,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let a=null;try{this.update(r,n)}catch(s){a=s}i(a)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new _te(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const rNe=Xke,nNe=tNe;var iNe=function(t){const e=rNe(t),r=nNe(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},Cte={};const yB=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Cte.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],s=t[4]^t[14]^t[24]^t[34]^t[44],o=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],u=t[8]^t[18]^t[28]^t[38]^t[48],f=t[9]^t[19]^t[29]^t[39]^t[49];let h=u^(i<<1|a>>>31),g=f^(a<<1|i>>>31);const m=t[0]^h,w=t[1]^g,C=t[10]^h,v=t[11]^g,b=t[20]^h,A=t[21]^g,S=t[30]^h,j=t[31]^g,F=t[40]^h,I=t[41]^g;h=r^(s<<1|o>>>31),g=n^(o<<1|s>>>31);const B=t[2]^h,V=t[3]^g,se=t[12]^h,Y=t[13]^g,N=t[22]^h,k=t[23]^g,x=t[32]^h,E=t[33]^g,L=t[42]^h,O=t[43]^g;h=i^(l<<1|c>>>31),g=a^(c<<1|l>>>31);const P=t[4]^h,R=t[5]^g,M=t[14]^h,D=t[15]^g,$=t[24]^h,X=t[25]^g,le=t[34]^h,H=t[35]^g,ee=t[44]^h,J=t[45]^g;h=s^(u<<1|f>>>31),g=o^(f<<1|u>>>31);const te=t[6]^h,re=t[7]^g,z=t[16]^h,G=t[17]^g,Q=t[26]^h,me=t[27]^g,be=t[36]^h,Ce=t[37]^g,Fe=t[46]^h,Ue=t[47]^g;h=l^(r<<1|n>>>31),g=c^(n<<1|r>>>31);const Ke=t[8]^h,lt=t[9]^g,Ee=t[18]^h,He=t[19]^g,qe=t[28]^h,Ie=t[29]^g,Ne=t[38]^h,$e=t[39]^g,je=t[48]^h,K=t[49]^g,U=m,W=w,ie=v<<4|C>>>28,pe=C<<4|v>>>28,we=b<<3|A>>>29,he=A<<3|b>>>29,Re=j<<9|S>>>23,Je=S<<9|j>>>23,et=F<<18|I>>>14,it=I<<18|F>>>14,ut=B<<1|V>>>31,pt=V<<1|B>>>31,tr=Y<<12|se>>>20,zt=se<<12|Y>>>20,At=N<<10|k>>>22,mt=k<<10|N>>>22,St=E<<13|x>>>19,dt=x<<13|E>>>19,Nt=L<<2|O>>>30,Rt=O<<2|L>>>30,gt=R<<30|P>>>2,qt=P<<30|R>>>2,Wt=M<<6|D>>>26,ot=D<<6|M>>>26,Vt=X<<11|$>>>21,Ft=$<<11|X>>>21,yt=le<<15|H>>>17,Ze=H<<15|le>>>17,Pt=J<<29|ee>>>3,xt=ee<<29|J>>>3,Jt=te<<28|re>>>4,Cr=re<<28|te>>>4,Gt=G<<23|z>>>9,Sr=z<<23|G>>>9,cr=Q<<25|me>>>7,br=me<<25|Q>>>7,Z=be<<21|Ce>>>11,ae=Ce<<21|be>>>11,de=Ue<<24|Fe>>>8,ue=Fe<<24|Ue>>>8,ve=Ke<<27|lt>>>5,Le=lt<<27|Ke>>>5,Ge=Ee<<20|He>>>12,Be=He<<20|Ee>>>12,tt=Ie<<7|qe>>>25,vt=qe<<7|Ie>>>25,Lt=Ne<<8|$e>>>24,Ct=$e<<8|Ne>>>24,ir=je<<14|K>>>18,Zt=K<<14|je>>>18;t[0]=U^~tr&Vt,t[1]=W^~zt&Ft,t[10]=Jt^~Ge&we,t[11]=Cr^~Be&he,t[20]=ut^~Wt&cr,t[21]=pt^~ot&br,t[30]=ve^~ie&At,t[31]=Le^~pe&mt,t[40]=gt^~Gt&tt,t[41]=qt^~Sr&vt,t[2]=tr^~Vt&Z,t[3]=zt^~Ft&ae,t[12]=Ge^~we&St,t[13]=Be^~he&dt,t[22]=Wt^~cr&Lt,t[23]=ot^~br&Ct,t[32]=ie^~At&yt,t[33]=pe^~mt&Ze,t[42]=Gt^~tt&Re,t[43]=Sr^~vt&Je,t[4]=Vt^~Z&ir,t[5]=Ft^~ae&Zt,t[14]=we^~St&Pt,t[15]=he^~dt&xt,t[24]=cr^~Lt&et,t[25]=br^~Ct&it,t[34]=At^~yt&de,t[35]=mt^~Ze&ue,t[44]=tt^~Re&Nt,t[45]=vt^~Je&Rt,t[6]=Z^~ir&U,t[7]=ae^~Zt&W,t[16]=St^~Pt&Jt,t[17]=dt^~xt&Cr,t[26]=Lt^~et&ut,t[27]=Ct^~it&pt,t[36]=yt^~de&ve,t[37]=Ze^~ue&Le,t[46]=Re^~Nt>,t[47]=Je^~Rt&qt,t[8]=ir^~U&tr,t[9]=Zt^~W&zt,t[18]=Pt^~Jt&Ge,t[19]=xt^~Cr&Be,t[28]=et^~ut&Wt,t[29]=it^~pt&ot,t[38]=de^~ve&ie,t[39]=ue^~Le&pe,t[48]=Nt^~gt&Gt,t[49]=Rt^~qt&Sr,t[0]^=yB[e*2],t[1]^=yB[e*2+1]}};const Z5=Cte;function $m(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}$m.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};$m.prototype.absorb=function(t){for(let e=0;e>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(Z5.p1600(this.state),this.count=0);return e};$m.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var aNe=$m,sNe=iNe(aNe);const oNe=sNe;function Ste(t){return Buffer.allocUnsafe(t).fill(0)}function lNe(t){return t.toString(2).length}function Ate(t,e){let r=t.toString(16);r.length%2!==0&&(r="0"+r);const n=r.match(/.{1,2}/g).map(i=>parseInt(i,16));for(;n.length"u")throw new Error("Not an array?");if(r=Lte(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(a in e)i.push(Yc(t,e[a]));if(r==="dynamic"){var s=Yc("uint256",e.length);i.unshift(s)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Yc("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,Xa.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=wg(t),r<1||r>32)throw new Error("Invalid bytes width: "+r);return Xa.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=wg(t),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=p0(e);const o=Xa.bitLengthFromBigInt(n);if(o>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+o);if(n<0)throw new Error("Supplied uint is negative");return Xa.bufferBEFromBigInt(n,32)}else if(t.startsWith("int")){if(r=wg(t),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=p0(e);const o=Xa.bitLengthFromBigInt(n);if(o>r)throw new Error("Supplied int exceeds width: "+r+" vs "+o);const l=Xa.twosFromBigInt(n,256);return Xa.bufferBEFromBigInt(l,32)}else if(t.startsWith("ufixed")){if(r=wB(t),n=p0(e),n<0)throw new Error("Supplied ufixed is negative");return Yc("uint256",n*BigInt(2)**BigInt(r[1]))}else if(t.startsWith("fixed"))return r=wB(t),Yc("int256",p0(e)*BigInt(2)**BigInt(r[1]))}throw new Error("Unsupported or invalid type: "+t)}function pNe(t){return t==="string"||t==="bytes"||Lte(t)==="dynamic"}function gNe(t){return t.lastIndexOf("]")===t.length-1}function mNe(t,e){var r=[],n=[],i=32*t.length;for(var a in t){var s=Nte(t[a]),o=e[a],l=Yc(s,o);pNe(s)?(r.push(Yc("uint256",i)),n.push(l),i+=l.length):r.push(l)}return Buffer.concat(r.concat(n))}function jte(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],a=0;a32)throw new Error("Invalid bytes width: "+r);i.push(Xa.setLengthRight(o,r))}else if(s.startsWith("uint")){if(r=wg(s),r%8||r<8||r>256)throw new Error("Invalid uint width: "+r);n=p0(o);const l=Xa.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+l);i.push(Xa.bufferBEFromBigInt(n,r/8))}else if(s.startsWith("int")){if(r=wg(s),r%8||r<8||r>256)throw new Error("Invalid int width: "+r);n=p0(o);const l=Xa.bitLengthFromBigInt(n);if(l>r)throw new Error("Supplied int exceeds width: "+r+" vs "+l);const c=Xa.twosFromBigInt(n,r);i.push(Xa.bufferBEFromBigInt(c,r/8))}else throw new Error("Unsupported or invalid type: "+s)}return Buffer.concat(i)}function yNe(t,e){return Xa.keccak(jte(t,e))}var wNe={rawEncode:mNe,solidityPack:jte,soliditySHA3:yNe};const ql=kte,Fy=wNe,$te={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},nS={encodeData(t,e,r,n=!0){const i=["bytes32"],a=[this.hashType(t,r)];if(n){const s=(o,l,c)=>{if(r[l]!==void 0)return["bytes32",c==null?"0x0000000000000000000000000000000000000000000000000000000000000000":ql.keccak(this.encodeData(l,c,r,n))];if(c===void 0)throw new Error(`missing value for field ${o} of type ${l}`);if(l==="bytes")return["bytes32",ql.keccak(c)];if(l==="string")return typeof c=="string"&&(c=Buffer.from(c,"utf8")),["bytes32",ql.keccak(c)];if(l.lastIndexOf("]")===l.length-1){const u=l.slice(0,l.lastIndexOf("[")),f=c.map(h=>s(o,u,h));return["bytes32",ql.keccak(Fy.rawEncode(f.map(([h])=>h),f.map(([,h])=>h)))]}return[l,c]};for(const o of r[t]){const[l,c]=s(o.name,o.type,e[o.name]);i.push(l),a.push(c)}}else for(const s of r[t]){let o=e[s.name];if(o!==void 0)if(s.type==="bytes")i.push("bytes32"),o=ql.keccak(o),a.push(o);else if(s.type==="string")i.push("bytes32"),typeof o=="string"&&(o=Buffer.from(o,"utf8")),o=ql.keccak(o),a.push(o);else if(r[s.type]!==void 0)i.push("bytes32"),o=ql.keccak(this.encodeData(s.type,o,r,n)),a.push(o);else{if(s.type.lastIndexOf("]")===s.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(s.type),a.push(o)}}return Fy.rawEncode(i,a)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:s,type:o})=>o+" "+s).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return ql.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return ql.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in $te.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),ql.keccak(Buffer.concat(n))}};var vNe={TYPED_MESSAGE_SCHEMA:$te,TypedDataUtils:nS,hashForSignTypedDataLegacy:function(t){return bNe(t.data)},hashForSignTypedData_v3:function(t){return nS.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return nS.hash(t.data)}};function bNe(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(a){return a.type==="bytes"?ql.toBuffer(a.value):a.value}),n=t.map(function(a){return a.type}),i=t.map(function(a){if(!a.name)throw e;return a.type+" "+a.name});return Fy.soliditySHA3(["bytes32","bytes32"],[Fy.soliditySHA3(new Array(t.length).fill("string"),i),Fy.soliditySHA3(n,r)])}var gu={};Object.defineProperty(gu,"__esModule",{value:!0});gu.APP_VERSION_KEY=gu.LOCAL_STORAGE_ADDRESSES_KEY=gu.WALLET_USER_NAME_KEY=void 0;gu.WALLET_USER_NAME_KEY="walletUsername";gu.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";gu.APP_VERSION_KEY="AppVersion";var Zw={};Object.defineProperty(Zw,"__esModule",{value:!0});Zw.RelayEventManager=void 0;const xNe=Kt;class ENe{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,xNe.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}Zw.RelayEventManager=ENe;var mx={},yx={},wx={};Object.defineProperty(wx,"__esModule",{value:!0});wx.WalletLinkCipher=void 0;const k4=Kt;class _Ne{constructor(e){this.secret=e}async encrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,k4.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),a=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},i,a.encode(e)),o=16,l=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),u=new Uint8Array(l),f=new Uint8Array(c),h=new Uint8Array([...n,...u,...f]);return(0,k4.uint8ArrayToHex)(h)}async decrypt(e){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,i)=>{(async function(){const a=await crypto.subtle.importKey("raw",(0,k4.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,k4.hexStringToUint8Array)(e),o=s.slice(0,12),l=s.slice(12,28),c=s.slice(28),u=new Uint8Array([...c,...l]),f={name:"AES-GCM",iv:new Uint8Array(o)};try{const h=await window.crypto.subtle.decrypt(f,a,u),g=new TextDecoder;n(g.decode(h))}catch(h){i(h)}})()})}}wx.WalletLinkCipher=_Ne;var vx={};Object.defineProperty(vx,"__esModule",{value:!0});vx.WalletLinkHTTP=void 0;class CNe{constructor(e,r,n){this.linkAPIUrl=e,this.sessionId=r;const i=`${r}:${n}`;this.auth=`Basic ${btoa(i)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var e;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:i}=await r.json();if(i)throw new Error(`Check unseen events failed: ${i}`);const a=(e=n==null?void 0:n.filter(s=>s.event==="Web3Response").map(s=>({type:"Event",sessionId:this.sessionId,eventId:s.id,event:s.event,data:s.data})))!==null&&e!==void 0?e:[];return this.markUnseenEventsAsSeen(a),a}throw new Error(`Check unseen events failed: ${r.status}`)}}vx.WalletLinkHTTP=CNe;var Gg={};Object.defineProperty(Gg,"__esModule",{value:!0});Gg.WalletLinkWebSocket=Gg.ConnectionState=void 0;var rg;(function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"})(rg||(Gg.ConnectionState=rg={}));class SNe{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((e,r)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(a){r(a);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,rg.CONNECTING),i.onclose=a=>{var s;this.clearWebSocket(),r(new Error(`websocket error ${a.code}: ${a.reason}`)),(s=this.connectionStateListener)===null||s===void 0||s.call(this,rg.DISCONNECTED)},i.onopen=a=>{var s;e(),(s=this.connectionStateListener)===null||s===void 0||s.call(this,rg.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(l=>this.sendData(l)),this.pendingData=[])},i.onmessage=a=>{var s,o;if(a.data==="h")(s=this.incomingDataListener)===null||s===void 0||s.call(this,{type:"Heartbeat"});else try{const l=JSON.parse(a.data);(o=this.incomingDataListener)===null||o===void 0||o.call(this,l)}catch{}}})}disconnect(){var e;const{webSocket:r}=this;if(r){this.clearWebSocket(),(e=this.connectionStateListener)===null||e===void 0||e.call(this,rg.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(e){const{webSocket:r}=this;if(!r){this.pendingData.push(e),this.connect();return}r.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}Gg.WalletLinkWebSocket=SNe;Object.defineProperty(yx,"__esModule",{value:!0});yx.WalletLinkConnection=void 0;const vB=gu,ANe=wx,INe=vx,N4=Gg,vp=Pa,bB=1e4,MNe=6e4;class TNe{constructor({session:e,linkAPIUrl:r,listener:n,WebSocketClass:i=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,vp.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=s=>{if(!s)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",l=>s.JsonRpcUrl&&this.handleChainUpdated(l,s.JsonRpcUrl)]]).forEach((l,c)=>{const u=s[c];u!==void 0&&l(u)})},this.handleDestroyed=s=>{var o;s==="1"&&((o=this.listener)===null||o===void 0||o.resetAndReload())},this.handleAccountUpdated=async s=>{var o;{const l=await this.cipher.decrypt(s);(o=this.listener)===null||o===void 0||o.accountUpdated(l)}},this.handleMetadataUpdated=async(s,o)=>{var l;{const c=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.metadataUpdated(s,c)}},this.handleWalletUsernameUpdated=async s=>{this.handleMetadataUpdated(vB.WALLET_USER_NAME_KEY,s)},this.handleAppVersionUpdated=async s=>{this.handleMetadataUpdated(vB.APP_VERSION_KEY,s)},this.handleChainUpdated=async(s,o)=>{var l;{const c=await this.cipher.decrypt(s),u=await this.cipher.decrypt(o);(l=this.listener)===null||l===void 0||l.chainUpdated(c,u)}},this.session=e,this.cipher=new ANe.WalletLinkCipher(e.secret),this.listener=n;const a=new N4.WalletLinkWebSocket(`${r}/rpc`,i);a.setConnectionStateListener(async s=>{let o=!1;switch(s){case N4.ConnectionState.DISCONNECTED:if(!this.destroyed){const l=async()=>{await new Promise(c=>setTimeout(c,5e3)),this.destroyed||a.connect().catch(()=>{l()})};l()}break;case N4.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),o=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},bB),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case N4.ConnectionState.CONNECTING:break}this.connected!==o&&(this.connected=o)}),a.setIncomingDataListener(s=>{var o;switch(s.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const l=s.type==="IsLinkedOK"?s.linked:void 0;this.linked=l||s.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(s.metadata);break}case"Event":{this.handleIncomingEvent(s);break}}s.id!==void 0&&((o=this.requestResolutions.get(s.id))===null||o===void 0||o(s))}),this.ws=a,this.http=new INe.WalletLinkHTTP(r,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var r;this._connected=e,e&&((r=this.onceConnected)===null||r===void 0||r.call(this))}setOnceConnected(e){return new Promise(r=>{this.connected?e().then(r):this.onceConnected=()=>{e().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var r,n;this._linked=e,e&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(r=>{this.linked?e().then(r):this.onceLinked=()=>{e().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(e){var r;if(!(e.type!=="Event"||e.event!=="Web3Response")){const n=await this.cipher.decrypt(e.data),i=JSON.parse(n);if(i.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(i)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(r=>this.handleIncomingEvent(r))}async setSessionMetadata(e,r){const n={type:"SetSessionConfig",id:(0,vp.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:r}};return this.setOnceConnected(async()=>{const i=await this.makeRequest(n);if(i.type==="Fail")throw new Error(i.error||"failed to set session metadata")})}async publishEvent(e,r,n=!1){const i=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),a={type:"PublishEvent",id:(0,vp.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:i,callWebhook:n};return this.setOnceLinked(async()=>{const s=await this.makeRequest(a);if(s.type==="Fail")throw new Error(s.error||"failed to publish event");return s.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>bB*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(e,r=MNe){const n=e.id;this.sendData(e);let i;return Promise.race([new Promise((a,s)=>{i=window.setTimeout(()=>{s(new Error(`request ${n} timed out`))},r)}),new Promise(a=>{this.requestResolutions.set(n,s=>{clearTimeout(i),a(s),this.requestResolutions.delete(n)})})])}async authenticate(){const e={type:"HostSession",id:(0,vp.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(e);if(r.type==="Fail")throw new Error(r.error||"failed to authenticate")}sendIsLinked(){const e={type:"IsLinked",id:(0,vp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){const e={type:"GetSessionConfig",id:(0,vp.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}yx.WalletLinkConnection=TNe;var bx={},Pte={exports:{}},Rte=Ah.Buffer;function xx(t,e){this._block=Rte.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}xx.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=Rte.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var a=this._hash();return t?a.toString(t):a};xx.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var Pm=xx,kNe=gs,Dte=Pm,NNe=Ah.Buffer,LNe=[1518500249,1859775393,-1894007588,-899497514],jNe=new Array(80);function Xw(){this.init(),this._w=jNe,Dte.call(this,64,56)}kNe(Xw,Dte);Xw.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function $Ne(t){return t<<5|t>>>27}function PNe(t){return t<<30|t>>>2}function RNe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Xw.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=e[o-3]^e[o-8]^e[o-14]^e[o-16];for(var l=0;l<80;++l){var c=~~(l/20),u=$Ne(r)+RNe(c,n,i,a)+s+e[l]+LNe[c]|0;s=a,a=i,i=PNe(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};Xw.prototype._hash=function(){var t=NNe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var DNe=Xw,ONe=gs,Ote=Pm,FNe=Ah.Buffer,UNe=[1518500249,1859775393,-1894007588,-899497514],BNe=new Array(80);function ev(){this.init(),this._w=BNe,Ote.call(this,64,56)}ONe(ev,Ote);ev.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function zNe(t){return t<<1|t>>>31}function WNe(t){return t<<5|t>>>27}function HNe(t){return t<<30|t>>>2}function GNe(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}ev.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=0;o<16;++o)e[o]=t.readInt32BE(o*4);for(;o<80;++o)e[o]=zNe(e[o-3]^e[o-8]^e[o-14]^e[o-16]);for(var l=0;l<80;++l){var c=~~(l/20),u=WNe(r)+GNe(c,n,i,a)+s+e[l]+UNe[c]|0;s=a,a=i,i=HNe(n),n=r,r=u}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0};ev.prototype._hash=function(){var t=FNe.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var qNe=ev,VNe=gs,Fte=Pm,YNe=Ah.Buffer,KNe=[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],JNe=new Array(64);function tv(){this.init(),this._w=JNe,Fte.call(this,64,56)}VNe(tv,Fte);tv.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function QNe(t,e,r){return r^t&(e^r)}function ZNe(t,e,r){return t&e|r&(t|e)}function XNe(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function eLe(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function tLe(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function rLe(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}tv.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,a=this._d|0,s=this._e|0,o=this._f|0,l=this._g|0,c=this._h|0,u=0;u<16;++u)e[u]=t.readInt32BE(u*4);for(;u<64;++u)e[u]=rLe(e[u-2])+e[u-7]+tLe(e[u-15])+e[u-16]|0;for(var f=0;f<64;++f){var h=c+eLe(s)+QNe(s,o,l)+KNe[f]+e[f]|0,g=XNe(r)+ZNe(r,n,i)|0;c=l,l=o,o=s,s=a+h|0,a=i,i=n,n=r,r=h+g|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=a+this._d|0,this._e=s+this._e|0,this._f=o+this._f|0,this._g=l+this._g|0,this._h=c+this._h|0};tv.prototype._hash=function(){var t=YNe.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Ute=tv,nLe=gs,iLe=Ute,aLe=Pm,sLe=Ah.Buffer,oLe=new Array(64);function Ex(){this.init(),this._w=oLe,aLe.call(this,64,56)}nLe(Ex,iLe);Ex.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Ex.prototype._hash=function(){var t=sLe.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var lLe=Ex,cLe=gs,Bte=Pm,uLe=Ah.Buffer,xB=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],dLe=new Array(160);function rv(){this.init(),this._w=dLe,Bte.call(this,128,112)}cLe(rv,Bte);rv.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function EB(t,e,r){return r^t&(e^r)}function _B(t,e,r){return t&e|r&(t|e)}function CB(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function SB(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function fLe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function hLe(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function pLe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function gLe(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function Fi(t,e){return t>>>0>>0?1:0}rv.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,a=this._dh|0,s=this._eh|0,o=this._fh|0,l=this._gh|0,c=this._hh|0,u=this._al|0,f=this._bl|0,h=this._cl|0,g=this._dl|0,m=this._el|0,w=this._fl|0,C=this._gl|0,v=this._hl|0,b=0;b<32;b+=2)e[b]=t.readInt32BE(b*4),e[b+1]=t.readInt32BE(b*4+4);for(;b<160;b+=2){var A=e[b-30],S=e[b-15*2+1],j=fLe(A,S),F=hLe(S,A);A=e[b-2*2],S=e[b-2*2+1];var I=pLe(A,S),B=gLe(S,A),V=e[b-7*2],se=e[b-7*2+1],Y=e[b-16*2],N=e[b-16*2+1],k=F+se|0,x=j+V+Fi(k,F)|0;k=k+B|0,x=x+I+Fi(k,B)|0,k=k+N|0,x=x+Y+Fi(k,N)|0,e[b]=x,e[b+1]=k}for(var E=0;E<160;E+=2){x=e[E],k=e[E+1];var L=_B(r,n,i),O=_B(u,f,h),P=CB(r,u),R=CB(u,r),M=SB(s,m),D=SB(m,s),$=xB[E],X=xB[E+1],le=EB(s,o,l),H=EB(m,w,C),ee=v+D|0,J=c+M+Fi(ee,v)|0;ee=ee+H|0,J=J+le+Fi(ee,H)|0,ee=ee+X|0,J=J+$+Fi(ee,X)|0,ee=ee+k|0,J=J+x+Fi(ee,k)|0;var te=R+O|0,re=P+L+Fi(te,R)|0;c=l,v=C,l=o,C=w,o=s,w=m,m=g+ee|0,s=a+J+Fi(m,g)|0,a=i,g=h,i=n,h=f,n=r,f=u,u=ee+te|0,r=J+re+Fi(u,ee)|0}this._al=this._al+u|0,this._bl=this._bl+f|0,this._cl=this._cl+h|0,this._dl=this._dl+g|0,this._el=this._el+m|0,this._fl=this._fl+w|0,this._gl=this._gl+C|0,this._hl=this._hl+v|0,this._ah=this._ah+r+Fi(this._al,u)|0,this._bh=this._bh+n+Fi(this._bl,f)|0,this._ch=this._ch+i+Fi(this._cl,h)|0,this._dh=this._dh+a+Fi(this._dl,g)|0,this._eh=this._eh+s+Fi(this._el,m)|0,this._fh=this._fh+o+Fi(this._fl,w)|0,this._gh=this._gh+l+Fi(this._gl,C)|0,this._hh=this._hh+c+Fi(this._hl,v)|0};rv.prototype._hash=function(){var t=uLe.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var zte=rv,mLe=gs,yLe=zte,wLe=Pm,vLe=Ah.Buffer,bLe=new Array(160);function _x(){this.init(),this._w=bLe,wLe.call(this,128,112)}mLe(_x,yLe);_x.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};_x.prototype._hash=function(){var t=vLe.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var xLe=_x,A1=Pte.exports=function(e){e=e.toLowerCase();var r=A1[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};A1.sha=DNe;A1.sha1=qNe;A1.sha224=lLe;A1.sha256=Ute;A1.sha384=xLe;A1.sha512=zte;var ELe=Pte.exports;Object.defineProperty(bx,"__esModule",{value:!0});bx.WalletLinkSession=void 0;const _Le=ELe,AB=Kt,IB="session:id",MB="session:secret",TB="session:linked";class PL{constructor(e,r,n,i){this._storage=e,this._id=r||(0,AB.randomBytesHex)(16),this._secret=n||(0,AB.randomBytesHex)(32),this._key=new _Le.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(IB),n=e.getItem(TB),i=e.getItem(MB);return r&&i?new PL(e,r,i,n==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(IB,this._id),this._storage.setItem(MB,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(TB,this._linked?"1":"0")}}bx.WalletLinkSession=PL;var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.isDarkMode=Eo.isMobileWeb=Eo.getLocation=Eo.createQrUrl=void 0;function CLe(t,e,r,n,i,a){const s=n?"parent-id":"id",o=new URLSearchParams({[s]:t,secret:e,server:r,v:i,chainId:a.toString()}).toString();return`${r}/#/link?${o}`}Eo.createQrUrl=CLe;function SLe(){try{return window.frameElement!==null}catch{return!1}}function ALe(){try{return SLe()&&window.top?window.top.location:window.location}catch{return window.location}}Eo.getLocation=ALe;function ILe(){var t;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t=window==null?void 0:window.navigator)===null||t===void 0?void 0:t.userAgent)}Eo.isMobileWeb=ILe;function MLe(){var t,e;return(e=(t=window==null?void 0:window.matchMedia)===null||t===void 0?void 0:t.call(window,"(prefers-color-scheme: dark)").matches)!==null&&e!==void 0?e:!1}Eo.isDarkMode=MLe;var Cx={},nv={},RL={};Object.defineProperty(RL,"__esModule",{value:!0});RL.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var TLe=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nv,"__esModule",{value:!0});nv.injectCssReset=void 0;const kLe=TLe(RL);function NLe(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(kLe.default)),document.documentElement.appendChild(t)}nv.injectCssReset=NLe;var DL={};function Wte(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e2&&(s.children=arguments.length>3?iv.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)s[a]===void 0&&(s[a]=t.defaultProps[a]);return Uy(t,s,n,i,null)}function Uy(t,e,r,n,i){var a={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Gte,__i:-1,__u:0};return i==null&&In.vnode!=null&&In.vnode(a),a}function $Le(){return{current:null}}function av(t){return t.children}function By(t,e){this.props=t,this.context=e}function qg(t,e){if(e==null)return t.__?qg(t.__,t.__i+1):null;for(var r;ee&&g0.sort(FM));X5.__r=0}function Zte(t,e,r,n,i,a,s,o,l,c,u){var f,h,g,m,w,C,v=n&&n.__k||Jte,b=e.length;for(l=PLe(r,e,v,l,b),f=0;f0?Uy(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,o=null,(c=s.__i=RLe(s,r,l,f))!==-1&&(f--,(o=r[c])&&(o.__u|=2)),o==null||o.__v===null?(c==-1&&h--,typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,s.__u|=4))):t.__k[a]=null;if(f)for(a=0;a(l!=null&&!(2&l.__u)?1:0))for(i=r-1,a=r+1;i>=0||a=0){if((l=e[i])&&!(2&l.__u)&&s==l.key&&o===l.type)return i;i--}if(a2&&(o.children=arguments.length>3?iv.call(arguments,2):r),Uy(t.type,o,n||t.key,i||t.ref,null)}function ULe(t,e){var r={__c:e="__cC"+Kte++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,a;return this.getChildContext||(i=new Set,(a={})[e]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){i=null},this.shouldComponentUpdate=function(s){this.props.value!==s.value&&i.forEach(function(o){o.__e=!0,WM(o)})},this.sub=function(s){i.add(s);var o=s.componentWillUnmount;s.componentWillUnmount=function(){i&&i.delete(s),o&&o.call(s)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}iv=Jte.slice,In={__e:function(t,e,r,n){for(var i,a,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),s=i.__d),s)return i.__E=i}catch(o){t=o}throw t}},Gte=0,qte=function(t){return t!=null&&t.constructor==null},By.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Id({},this.state),typeof t=="function"&&(t=t(Id({},r),this.props)),t&&Id(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),WM(this))},By.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),WM(this))},By.prototype.render=av,g0=[],Vte=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,FM=function(t,e){return t.__v.__b-e.__v.__b},X5.__r=0,Yte=/(PointerCapture)$|Capture$/i,OL=0,UM=jB(!1),BM=jB(!0),Kte=0;const BLe=Object.freeze(Object.defineProperty({__proto__:null,Component:By,Fragment:av,cloneElement:FLe,createContext:ULe,createElement:zM,createRef:$Le,h:zM,hydrate:ire,get isValidElement(){return qte},get options(){return In},render:nre,toChildArray:ere},Symbol.toStringTag,{value:"Module"})),are=wh(BLe);var Vd,bn,iS,$B,Vg=0,sre=[],Yn=In,PB=Yn.__b,RB=Yn.__r,DB=Yn.diffed,OB=Yn.__c,FB=Yn.unmount,UB=Yn.__;function I1(t,e){Yn.__h&&Yn.__h(bn,t,Vg||e),Vg=0;var r=bn.__H||(bn.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ore(t){return Vg=1,lre(ure,t)}function lre(t,e,r){var n=I1(Vd++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):ure(void 0,e),function(o){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,o);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=bn,!bn.u)){var i=function(o,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return!!h.__c});if(u.every(function(h){return!h.__N}))return!a||a.call(this,o,l,c);var f=n.__c.props!==o;return u.forEach(function(h){if(h.__N){var g=h.__[0];h.__=h.__N,h.__N=void 0,g!==h.__[0]&&(f=!0)}}),a&&a.call(this,o,l,c)||f};bn.u=!0;var a=bn.shouldComponentUpdate,s=bn.componentWillUpdate;bn.componentWillUpdate=function(o,l,c){if(this.__e){var u=a;a=void 0,i(o,l,c),a=u}s&&s.call(this,o,l,c)},bn.shouldComponentUpdate=i}return n.__N||n.__}function zLe(t,e){var r=I1(Vd++,3);!Yn.__s&&WL(r.__H,e)&&(r.__=t,r.i=e,bn.__H.__h.push(r))}function cre(t,e){var r=I1(Vd++,4);!Yn.__s&&WL(r.__H,e)&&(r.__=t,r.i=e,bn.__h.push(r))}function WLe(t){return Vg=5,zL(function(){return{current:t}},[])}function HLe(t,e,r){Vg=6,cre(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function zL(t,e){var r=I1(Vd++,7);return WL(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function GLe(t,e){return Vg=8,zL(function(){return t},e)}function qLe(t){var e=bn.context[t.__c],r=I1(Vd++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(bn)),e.props.value):t.__}function VLe(t,e){Yn.useDebugValue&&Yn.useDebugValue(e?e(t):t)}function YLe(t){var e=I1(Vd++,10),r=ore();return e.__=t,bn.componentDidCatch||(bn.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function KLe(){var t=I1(Vd++,11);if(!t.__){for(var e=bn.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function JLe(){for(var t;t=sre.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(j6),t.__H.__h.forEach(HM),t.__H.__h=[]}catch(e){t.__H.__h=[],Yn.__e(e,t.__v)}}Yn.__b=function(t){bn=null,PB&&PB(t)},Yn.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),UB&&UB(t,e)},Yn.__r=function(t){RB&&RB(t),Vd=0;var e=(bn=t.__c).__H;e&&(iS===bn?(e.__h=[],bn.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(j6),e.__h.forEach(HM),e.__h=[],Vd=0)),iS=bn},Yn.diffed=function(t){DB&&DB(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(sre.push(e)!==1&&$B===Yn.requestAnimationFrame||(($B=Yn.requestAnimationFrame)||QLe)(JLe)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),iS=bn=null},Yn.__c=function(t,e){e.some(function(r){try{r.__h.forEach(j6),r.__h=r.__h.filter(function(n){return!n.__||HM(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Yn.__e(n,r.__v)}}),OB&&OB(t,e)},Yn.unmount=function(t){FB&&FB(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{j6(n)}catch(i){e=i}}),r.__H=void 0,e&&Yn.__e(e,r.__v))};var BB=typeof requestAnimationFrame=="function";function QLe(t){var e,r=function(){clearTimeout(n),BB&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);BB&&(e=requestAnimationFrame(r))}function j6(t){var e=bn,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),bn=e}function HM(t){var e=bn;t.__c=t.__(),bn=e}function WL(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function ure(t,e){return typeof e=="function"?e(t):e}const ZLe=Object.freeze(Object.defineProperty({__proto__:null,useCallback:GLe,useContext:qLe,useDebugValue:VLe,useEffect:zLe,useErrorBoundary:YLe,useId:KLe,useImperativeHandle:HLe,useLayoutEffect:cre,useMemo:zL,useReducer:lre,useRef:WLe,useState:ore},Symbol.toStringTag,{value:"Module"})),XLe=wh(ZLe);var HL={};Object.defineProperty(HL,"__esModule",{value:!0});HL.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=Xt&&Xt.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Hte),n=are,i=XLe,a=Eo,s=e(HL),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",l="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class c{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,a.isDarkMode)()}attach(g){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",g.appendChild(this.root),this.render()}presentItem(g){const m=this.nextItemKey++;return this.items.set(m,g),this.render(),()=>{this.items.delete(m),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([g,m])=>(0,n.h)(t.SnackbarInstance,Object.assign({},m,{key:g}))))),this.root)}}t.Snackbar=c;const u=h=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},h.children));t.SnackbarContainer=u;const f=({autoExpand:h,message:g,menuItems:m})=>{const[w,C]=(0,i.useState)(!0),[v,b]=(0,i.useState)(h??!1);(0,i.useEffect)(()=>{const S=[window.setTimeout(()=>{C(!1)},1),window.setTimeout(()=>{b(!0)},1e4)];return()=>{S.forEach(window.clearTimeout)}});const A=()=>{b(!v)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",w&&"-cbwsdk-snackbar-instance-hidden",v&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:A},(0,n.h)("img",{src:o,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},g),(0,n.h)("div",{class:"-gear-container"},!v&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:l,class:"-gear-icon",title:"Expand"}))),m&&m.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},m.map((S,j)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:S.onClick,key:j},(0,n.h)("svg",{width:S.svgWidth,height:S.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":S.defaultFillRule,"clip-rule":S.defaultClipRule,d:S.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",S.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},S.info)))))};t.SnackbarInstance=f})(DL);Object.defineProperty(Cx,"__esModule",{value:!0});Cx.WalletLinkRelayUI=void 0;const eje=nv,tje=DL;class rje{constructor(){this.attached=!1,this.snackbar=new tje.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.snackbar.attach(r),this.attached=!0,(0,eje.injectCssReset)()}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}}Cx.WalletLinkRelayUI=rje;var Ax={},Ix={},GL={};Object.defineProperty(GL,"__esModule",{value:!0});GL.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var dre=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ix,"__esModule",{value:!0});Ix.RedirectDialog=void 0;const nje=dre(Hte),Zc=are,ije=nv,aje=DL,sje=Eo,oje=dre(GL);class lje{constructor(){this.root=null,this.darkMode=(0,sje.isDarkMode)()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,ije.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,Zc.render)(null,this.root),e&&(0,Zc.render)((0,Zc.h)(cje,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}Ix.RedirectDialog=lje;const cje=({title:t,buttonText:e,darkMode:r,onButtonClick:n,onDismiss:i})=>{const a=r?"dark":"light";return(0,Zc.h)(aje.SnackbarContainer,{darkMode:r},(0,Zc.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Zc.h)("style",null,oje.default),(0,Zc.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Zc.h)("div",{class:(0,nje.default)("-cbwsdk-redirect-dialog-box",a)},(0,Zc.h)("p",null,t),(0,Zc.h)("button",{onClick:n},e))))};var mu={};Object.defineProperty(mu,"__esModule",{value:!0});mu.CBW_MOBILE_DEEPLINK_URL=mu.WALLETLINK_URL=mu.CB_KEYS_URL=void 0;mu.CB_KEYS_URL="https://keys.coinbase.com/connect";mu.WALLETLINK_URL="https://www.walletlink.org";mu.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(Ax,"__esModule",{value:!0});Ax.WLMobileRelayUI=void 0;const uje=Ix,dje=Eo,fje=mu;class hje{constructor(){this.attached=!1,this.redirectDialog=new uje.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const r=new URL(fje.CBW_MOBILE_DEEPLINK_URL);r.searchParams.append("redirect_url",(0,dje.getLocation)().href),e&&r.searchParams.append("wl_url",e);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}Ax.WLMobileRelayUI=hje;Object.defineProperty(mx,"__esModule",{value:!0});mx.WalletLinkRelay=void 0;const pje=yx,gje=gu,mje=Zw,aS=bx,bp=jm,yje=Eo,wje=Cx,zB=Ax,vje=$u,fi=Kt,bje=Pu;class vd{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,yje.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=a=>{this.isLinked=a;const s=this.storage.getItem(gje.LOCAL_STORAGE_ADDRESSES_KEY);if(a&&(this._session.linked=a),this.isUnlinkedErrorState=!1,s){const o=s.split(" "),l=this.storage.getItem("IsStandaloneSigning")==="true";o[0]!==""&&!a&&this._session.linked&&!l&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(a,s)=>{this.storage.setItem(a,s)},this.chainUpdated=(a,s)=>{this.chainCallbackParams.chainId===a&&this.chainCallbackParams.jsonRpcUrl===s||(this.chainCallbackParams={chainId:a,jsonRpcUrl:s},this.chainCallback&&this.chainCallback(a,s))},this.accountUpdated=a=>{this.accountsCallback&&this.accountsCallback([a]),vd.accountRequestCallbackIds.size>0&&(Array.from(vd.accountRequestCallbackIds.values()).forEach(s=>{const o={type:"WEB3_RESPONSE",id:s,response:{method:"requestEthereumAccounts",result:[a]}};this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),vd.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;const{session:r,ui:n,connection:i}=this.subscribe();this._session=r,this.connection=i,this.relayEventManager=new mje.RelayEventManager,this.ui=n}subscribe(){const e=aS.WalletLinkSession.load(this.storage)||new aS.WalletLinkSession(this.storage).save(),{linkAPIUrl:r}=this,n=new pje.WalletLinkConnection({session:e,linkAPIUrl:r,listener:this}),i=this.isMobileWeb?new zB.WLMobileRelayUI:new wje.WalletLinkRelayUI;return n.connect(),{session:e,ui:i,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();const e=aS.WalletLinkSession.load(this.storage);(e==null?void 0:e.id)===this._session.id&&bje.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,fi.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,fi.hexStringFromBuffer)(e,!0),signature:(0,fi.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,fi.bigIntStringFromBigInt)(e.weiValue),data:(0,fi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,fi.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,fi.bigIntStringFromBigInt)(e.weiValue),data:(0,fi.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,fi.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,fi.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,fi.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,fi.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,fi.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,r){return this.sendRequest({method:"generic",params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,fi.randomBytesHex)(8),i=a=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,a),r==null||r()};return new Promise((a,s)=>{r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,o=>{if(r==null||r(),(0,bp.isErrorResponse)(o))return s(new Error(o.errorMessage));a(o)}),this.publishWeb3RequestEvent(n,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,r){const n={type:"WEB3_REQUEST",id:e,request:r};this.publishEvent("Web3Request",n,!0).then(i=>{}).catch(i=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:r.method,errorMessage:i.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(r.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof zB.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(e){const r={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(e,r,n){return this.connection.publishEvent(e,r,n)}handleWeb3ResponseMessage(e){const{response:r}=e;if(r.method==="requestEthereumAccounts"){vd.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},e),{id:n}))),vd.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n){var i;const a=(i=n==null?void 0:n.message)!==null&&i!==void 0?i:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:r,errorMessage:a}})}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,fi.randomBytesHex)(8);return new Promise((n,i)=>{this.relayEventManager.callbacks.set(r,a=>{if((0,bp.isErrorResponse)(a))return i(new Error(a.errorMessage));n(a)}),vd.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,e)})}watchAsset(e,r,n,i,a,s){const o={method:"watchAsset",params:{type:e,options:{address:r,symbol:n,decimals:i,image:a},chainId:s}};let l=null;const c=(0,fi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,f),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((f,h)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,bp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,o)})}addEthereumChain(e,r,n,i,a,s){const o={method:"addEthereumChain",params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:a,iconUrls:n,nativeCurrency:s}};let l=null;const c=(0,fi.randomBytesHex)(8),u=f=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,o.method,f),l==null||l()};return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:u,onResetConnection:this.resetAndReload}),new Promise((f,h)=>{this.relayEventManager.callbacks.set(c,g=>{if(l==null||l(),(0,bp.isErrorResponse)(g))return h(new Error(g.errorMessage));f(g)}),this.publishWeb3RequestEvent(c,o)})}switchEthereumChain(e,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:r})},i=(0,fi.randomBytesHex)(8);return new Promise((a,s)=>{this.relayEventManager.callbacks.set(i,o=>{if((0,bp.isErrorResponse)(o)&&o.errorCode)return s(vje.standardErrors.provider.custom({code:o.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,bp.isErrorResponse)(o))return s(new Error(o.errorMessage));a(o)}),this.publishWeb3RequestEvent(i,n)})}}mx.WalletLinkRelay=vd;vd.accountRequestCallbackIds=new Set;var xje=Xt&&Xt.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ux,"__esModule",{value:!0});ux.WalletLinkSigner=void 0;const sS=xje(vNe),WB=gu,Eje=Zw,ed=jm,_je=mx,HB=mu,Ui=$u,Gr=Kt,Cje=Pu,oS="DefaultChainId",GB="DefaultJsonRpcUrl";class Sje{constructor(e){var r,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:i,appLogoUrl:a}=e.metadata;this._appName=i,this._appLogoUrl=a,this._storage=new Cje.ScopedLocalStorage("walletlink",HB.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new Eje.RelayEventManager,this._jsonRpcUrlFromOpts="";const s=this._storage.getItem(WB.LOCAL_STORAGE_ADDRESSES_KEY);if(s){const l=s.split(" ");l[0]!==""&&(this._addresses=l.map(c=>(0,Gr.ensureAddressString)(c)),(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(oS)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:r,secret:n}=e.getWalletLinkSession();return{id:r,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(GB))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(GB,e)}updateProviderInfo(e,r){var n;this.jsonRpcUrl=e;const i=this.getChainId();this._storage.setItem(oS,r.toString(10)),((0,Gr.ensureIntNumber)(r)!==i||!this.hasMadeFirstChainChangedEmission)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:r,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,a,s){const l=await this.initializeRelay().watchAsset(e,r,n,i,a,s==null?void 0:s.toString());return(0,ed.isErrorResponse)(l)?!1:!!l.result}async addEthereumChain(e,r,n,i,a,s){var o,l;if((0,Gr.ensureIntNumber)(e)===this.getChainId())return!1;const c=this.initializeRelay();this._isAuthorized()||await c.requestEthereumAccounts();const u=await c.addEthereumChain(e.toString(),r,a,n,i,s);return(0,ed.isErrorResponse)(u)?!1:(((o=u.result)===null||o===void 0?void 0:o.isApproved)===!0&&this.updateProviderInfo(r[0],e),((l=u.result)===null||l===void 0?void 0:l.isApproved)===!0)}async switchEthereumChain(e){const n=await this.initializeRelay().switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,ed.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===Ui.standardErrorCodes.provider.unsupportedChain?Ui.standardErrors.provider.unsupportedChain():Ui.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(r=>{throw r})}catch(r){return Promise.reject(r)}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Ui.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw Ui.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Ui.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,a=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:a})).result}_setAddresses(e,r){var n;if(!Array.isArray(e))throw new Error("addresses is not an array");const i=e.map(a=>(0,Gr.ensureAddressString)(a));JSON.stringify(i)!==JSON.stringify(this._addresses)&&(this._addresses=i,(n=this.updateListener)===null||n===void 0||n.onAccountsUpdate({accounts:i,source:"wallet"}),this._storage.setItem(WB.LOCAL_STORAGE_ADDRESSES_KEY,i.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i})}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_handleSynchronousMethods(e){const{method:r}=e;switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(e){try{const r=(0,Gr.ensureAddressString)(e);return this._addresses.map(i=>(0,Gr.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,Gr.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,Gr.ensureAddressString)(e.to):null,i=e.value!=null?(0,Gr.ensureBigInt)(e.value):BigInt(0),a=e.data?(0,Gr.ensureBuffer)(e.data):Buffer.alloc(0),s=e.nonce!=null?(0,Gr.ensureIntNumber)(e.nonce):null,o=e.gasPrice!=null?(0,Gr.ensureBigInt)(e.gasPrice):null,l=e.maxFeePerGas!=null?(0,Gr.ensureBigInt)(e.maxFeePerGas):null,c=e.maxPriorityFeePerGas!=null?(0,Gr.ensureBigInt)(e.maxPriorityFeePerGas):null,u=e.gas!=null?(0,Gr.ensureBigInt)(e.gas):null,f=e.chainId?(0,Gr.ensureIntNumber)(e.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:a,nonce:s,gasPriceInWei:o,maxFeePerGas:l,maxPriorityFeePerGas:c,gasLimit:u,chainId:f}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Ui.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Ui.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{const s=await this.initializeRelay().signEthereumMessage(e,r,n,i);if((0,ed.isErrorResponse)(s))throw new Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(a){throw typeof a.message=="string"&&a.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied message signature"):a}}async _ethereumAddressFromSignedMessage(e,r,n){const a=await this.initializeRelay().ethereumAddressFromSignedMessage(e,r,n);if((0,ed.isErrorResponse)(a))throw new Error(a.errorMessage);return{jsonrpc:"2.0",id:0,result:a.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,Gr.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(oS);if(!e)return(0,Gr.ensureIntNumber)(1);const r=parseInt(e,10);return(0,Gr.ensureIntNumber)(r)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let e;try{if(e=await this.initializeRelay().requestEthereumAccounts(),(0,ed.isErrorResponse)(e))throw new Error(e.errorMessage)}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!e.result)throw new Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,Gr.ensureBuffer)(e[0]),n=(0,Gr.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await this.initializeRelay().signEthereumTransaction(r);if((0,ed.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,Gr.ensureBuffer)(e[0]),i=await this.initializeRelay().submitEthereumTransaction(r,this.getChainId());if((0,ed.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{const i=await this.initializeRelay().signAndSubmitEthereumTransaction(r);if((0,ed.isErrorResponse)(i))throw new Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Ui.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,Gr.ensureParsedJSONObject)(e[0]),n=(0,Gr.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=sS.default.hashForSignTypedDataLegacy({data:r}),a=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,a)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=sS.default.hashForSignTypedData_v3({data:n}),a=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,a)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,Gr.ensureAddressString)(e[0]),n=(0,Gr.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=sS.default.hashForSignTypedData_v4({data:n}),a=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,a)}async _wallet_addEthereumChain(e){var r,n,i,a;const s=e[0];if(((r=s.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||s.chainName.trim()==="")throw Ui.standardErrors.rpc.invalidParams("chainName is a required field");if(!s.nativeCurrency)throw Ui.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const o=parseInt(s.chainId,16);return await this.addEthereumChain(o,(n=s.rpcUrls)!==null&&n!==void 0?n:[],(i=s.blockExplorerUrls)!==null&&i!==void 0?i:[],s.chainName,(a=s.iconUrls)!==null&&a!==void 0?a:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw Ui.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Ui.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Ui.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Ui.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:a,image:s,decimals:o}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,a,o,s,n)}}initializeRelay(){if(!this._relay){const e=new _je.WalletLinkRelay({linkAPIUrl:HB.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),this._relay=e}return this._relay}}ux.WalletLinkSigner=Sje;var dl={};Object.defineProperty(dl,"__esModule",{value:!0});dl.checkErrorForInvalidRequestArgs=dl.getCoinbaseInjectedProvider=dl.getCoinbaseInjectedSigner=dl.fetchRPCRequest=void 0;const Aje=_1,$6=$u;async function Ije(t,e){if(!e.rpcUrl)throw $6.standardErrors.rpc.internal("No RPC URL set for chain");const r=Object.assign(Object.assign({},t),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(e.rpcUrl,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":Aje.LIB_VERSION}})).json()).result}dl.fetchRPCRequest=Ije;function fre(){return globalThis.coinbaseWalletSigner}dl.getCoinbaseInjectedSigner=fre;function Mje({metadata:t,preference:e}){var r,n,i;const a=globalThis;if(e.options!=="smartWalletOnly"){if(fre())return;const l=a.coinbaseWalletExtension;if(l){const{appName:c,appLogoUrl:u,appChainIds:f}=t;return(r=l.setAppInfo)===null||r===void 0||r.call(l,c,u,f),l}}const s=(n=a.ethereum)!==null&&n!==void 0?n:(i=a.top)===null||i===void 0?void 0:i.ethereum;if(s!=null&&s.isCoinbaseBrowser)return s}dl.getCoinbaseInjectedProvider=Mje;function Tje(t){if(!t||typeof t!="object"||Array.isArray(t))return $6.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:t});const{method:e,params:r}=t;if(typeof e!="string"||e.length===0)return $6.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:t});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))return $6.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:t})}dl.checkErrorForInvalidRequestArgs=Tje;Object.defineProperty(lu,"__esModule",{value:!0});lu.createSigner=lu.fetchSignerType=lu.storeSignerType=lu.loadSignerType=void 0;const kje=ox,hre=ux,Nje=$u,Lje=dl,jje=Pu,pre="SignerType",gre=new jje.ScopedLocalStorage("CBWSDK","SignerConfigurator");function $je(){return gre.getItem(pre)}lu.loadSignerType=$je;function Pje(t){gre.setItem(pre,t)}lu.storeSignerType=Pje;async function Rje(t){const{communicator:e,metadata:r}=t;Oje(e,r).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:t.preference},{data:i}=await e.postRequestAndWaitForResponse(n);return i}lu.fetchSignerType=Rje;function Dje(t){const{signerType:e,metadata:r,communicator:n,updateListener:i}=t;switch(e){case"scw":return new kje.SCWSigner({metadata:r,updateListener:i,communicator:n});case"walletlink":return new hre.WalletLinkSigner({metadata:r,updateListener:i});case"extension":{const a=(0,Lje.getCoinbaseInjectedSigner)();if(!a)throw Nje.standardErrors.rpc.internal("injected signer not found");return a}}}lu.createSigner=Dje;async function Oje(t,e){await t.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const r=new hre.WalletLinkSigner({metadata:e});t.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),t.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var Mx={},Yg={};Object.defineProperty(Yg,"__esModule",{value:!0});Yg.closePopup=Yg.openPopup=void 0;const Fje=$u,qB=420,VB=540;function Uje(t){const e=(window.innerWidth-qB)/2+window.screenX,r=(window.innerHeight-VB)/2+window.screenY,n=window.open(t,"Smart Wallet",`width=${qB}, height=${VB}, left=${e}, top=${r}`);if(n==null||n.focus(),!n)throw Fje.standardErrors.rpc.internal("Pop up window failed to open");return n}Yg.openPopup=Uje;function Bje(t){t&&!t.closed&&t.close()}Yg.closePopup=Bje;Object.defineProperty(Mx,"__esModule",{value:!0});Mx.Communicator=void 0;const zje=_1,YB=Yg,Wje=mu,KB=$u;class Hje{constructor(e=Wje.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{const n=this.onMessage(({requestId:i})=>i===r.id);return this.postMessage(r),await n},this.onMessage=async r=>new Promise((n,i)=>{const a=s=>{if(s.origin!==this.url.origin)return;const o=s.data;r(o)&&(n(o),window.removeEventListener("message",a),this.listeners.delete(a))};window.addEventListener("message",a),this.listeners.set(a,{reject:i})}),this.disconnect=()=>{(0,YB.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:r},n)=>{r(KB.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",n)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?this.popup:(this.popup=(0,YB.openPopup)(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:zje.LIB_VERSION}})}).then(()=>{if(!this.popup)throw KB.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}Mx.Communicator=Hje;var Tx={};Object.defineProperty(Tx,"__esModule",{value:!0});Tx.determineMethodCategory=void 0;const JB={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function Gje(t){for(const e in JB){const r=e;if(JB[r].includes(t))return r}}Tx.determineMethodCategory=Gje;var qje=Xt&&Xt.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i{try{if(this.connected)return this.emit("connect",{chainId:(0,U2.hexStringFromIntNumber)((0,j4.IntNumber)(this.chain.id))}),this.accounts;const u=await this.requestSignerSelection(),f=this.initSigner(u),h=await f.handshake();return this.signer=f,(0,$4.storeSignerType)(u),this.emit("connect",{chainId:(0,U2.hexStringFromIntNumber)((0,j4.IntNumber)(this.chain.id))}),h}catch(u){throw this.handleUnauthorizedError(u),u}},sign:async c=>{if(!this.connected||!this.signer)throw xp.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(c)}catch(u){throw this.handleUnauthorizedError(u),u}},fetch:c=>(0,QB.fetchRPCRequest)(c,this.chain),state:c=>{const u=()=>{if(this.connected)return this.accounts;throw xp.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(c.method){case"eth_chainId":return(0,U2.hexStringFromIntNumber)((0,j4.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return u();case"eth_coinbase":return u()[0];default:return this.handlers.unsupported(c)}},deprecated:({method:c})=>{throw xp.standardErrors.rpc.methodNotSupported(`Method ${c} is deprecated.`)},unsupported:({method:c})=>{throw xp.standardErrors.rpc.methodNotSupported(`Method ${c} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:c,source:u})=>{(0,U2.areAddressArraysEqual)(this.accounts,c)||(this.accounts=c,u!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:c,source:u})=>{c.id===this.chain.id&&c.rpcUrl===this.chain.rpcUrl||(this.chain=c,u!=="storage"&&this.emit("chainChanged",(0,U2.hexStringFromIntNumber)((0,j4.IntNumber)(c.id))))}},this.metadata=i,this.preference=o,this.communicator=new Jje.Communicator(s),this.chain={id:(n=(r=i.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1};const l=(0,$4.loadSignerType)();this.signer=l?this.initSigner(l):null}get connected(){return this.accounts.length>0}async request(e){var r;try{const n=(0,QB.checkErrorForInvalidRequestArgs)(e);if(n)throw n;const i=(r=(0,Qje.determineMethodCategory)(e.method))!==null&&r!==void 0?r:"fetch";return this.handlers[i](e)}catch(n){return Promise.reject((0,Kje.serializeError)(n,e.method))}}handleUnauthorizedError(e){e.code===xp.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},Zje.ScopedLocalStorage.clearAll(),this.emit("disconnect",xp.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,$4.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,$4.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}nx.CoinbaseWalletProvider=Xje;Object.defineProperty(Y3,"__esModule",{value:!0});Y3.CoinbaseWalletSDK=void 0;const e$e=rx,t$e=nx,r$e=Pu,n$e=_1,i$e=Kt,a$e=dl;class s$e{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,i$e.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var r;const n={metadata:this.metadata,preference:e};return(r=(0,a$e.getCoinbaseInjectedProvider)(n))!==null&&r!==void 0?r:new t$e.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(e,r=240){return(0,e$e.walletLogo)(e,r)}storeLatestVersion(){new r$e.ScopedLocalStorage("CBWSDK").setItem("VERSION",n$e.LIB_VERSION)}}Y3.CoinbaseWalletSDK=s$e;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;const e=Y3;t.default=e.CoinbaseWalletSDK;var r=Y3;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}})})(Uee);const GM=({style:t,...e})=>d.jsxs("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),o$e="data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",Ih={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},mre={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},qL={id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},yre={id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},ef={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},wre={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},l$e={id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},VL={id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},c$e={id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},u$e={id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},d$e={id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},f$e={id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}},h$e={id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},vre={id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},p$e={id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},g$e={id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},Ru={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},M1={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},bre={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},tf={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},xre={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},m$e={id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},Ere={id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},_re={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},y$e={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},w$e={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},e8=[Ih,mre,Ere,Ru,M1,bre,tf,xre,VL,c$e,u$e,d$e,ef,wre,l$e,g$e,vre,p$e,qL,yre,_re,w$e,y$e,h$e,m$e,f$e],Cre=new Set(e8.map(t=>t.id));let Sre=class extends Pn{constructor(){super("Wallet timeout"),this.type="wallet_error"}},Are=class extends Pn{constructor(){super("User rejected connection"),this.type="wallet_error"}};const T1=t=>{if(t instanceof Pn)return t;if(t!=null&&t.code&&(t!=null&&t.reason)){let e=new hc(t);return t.code===ka.ACTION_REJECTED&&(e.details=Xi.E4001_USER_REJECTED_REQUEST),e}return t!=null&&t.code?new hc(t):new Pn("Unknown connector error",t)};let $0=class extends Ks{constructor(e,r,n){super(e),this.type="provider_error",this.code=r,this.data=n}},hc=class extends $0{constructor(e){var n,i,a;super(e.message,e.code,e.data);let r=Object.values(Xi).find(s=>s.eipCode===e.code);this.details=r||Xi.UNKNOWN_ERROR,e.code===-32002&&((n=e.message)!=null&&n.includes("already pending for origin")?(i=e.message)!=null&&i.includes("wallet_requestPermissions")?this.details=Xi.E32002_CONNECTION_ALREADY_PENDING:this.details=Xi.E32002_REQUEST_ALREADY_PENDING:(a=e.message)!=null&&a.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=Xi.E32002_WALLET_LOCKED))}};const Pf={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...Xi};function bd(t){return t.type==="ethereum"}function qM(t,e){if(t.length!==e.length)return!1;for(let r=0;rt.rpcTimeouts&&t.rpcTimeouts[e]||ex;let rs=class{on(e,r){if(this.walletProvider)return this.walletProvider.on(e,r);this._subscriptions.push({eventName:e,listener:r})}async request(e){if(!this.walletProvider)throw new Pn(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(r=>{throw T1(r)})}constructor(e,r){this.removeListener=(n,i)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(n,i)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(n=new Sre,i=this.rpcTimeoutDuration)=>new Promise((a,s)=>setTimeout(()=>{s(n)},i)),this.setWalletProvider=n=>{this.walletProvider&&this._subscriptions.forEach(i=>{this.removeListener(i.eventName,i.listener)}),this.walletProvider=n,this._subscriptions.forEach(i=>{var a;(a=this.walletProvider)==null||a.on(i.eventName,i.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=r||ex,this._subscriptions=[]}},t8=class extends rs{constructor(e){super(e,e.rpcTimeoutDuration)}},VM=class extends rs{sendAsync(e,r){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}constructor(e){super(e,e.rpcTimeoutDuration)}};function B2(t){return t.chainType==="ethereum"}let Rm=class extends Ire{buildConnectedWallet(e,r,n,i){let a=async()=>!!this.wallets.find(s=>Ir(s.address)===Ir(e));return{type:"ethereum",address:Ir(e),chainId:r,meta:n,imported:i,switchChain:async s=>{var h,g,m,w;let o,l;if(!a)throw new Pn("Wallet is not currently connected.");let c=(h=this.wallets.find(C=>Ir(C.address)===Ir(e)))==null?void 0:h.chainId;if(!c)throw new Pn("Unable to determine current chainId.");if(typeof s=="number"?(o=`0x${s.toString(16)}`,l=s):(o=s,l=Number(s)),c===A6(o))return;let u=this.chains.find(C=>C.id===l);if(!u)throw new Pn(`Unsupported chainId: ${s}`);let f=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})};try{return await f()}catch(C){if(((v,b)=>{var A;return b==="coinbase_wallet"?v.message.includes("addEthereumChain"):v.code===4902||((A=v.message)==null?void 0:A.includes("4902"))})(C,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:o,chainName:u.name,nativeCurrency:u.nativeCurrency,rpcUrls:[((g=u.rpcUrls.default)==null?void 0:g.http[0])??""],blockExplorerUrls:[((m=u.blockExplorers)==null?void 0:m.default.url)??""]}]}),f();throw this.walletClientType==="rainbow"&&((w=C.message)!=null&&w.includes("wallet_switchEthereumChain"))?new Pn(`Rainbow does not support the chainId ${r}`):C}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:a,getEthereumProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return new L5(new t8(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await a())throw new Pn("Wallet is not currently connected.");return new VM(this.proxyProvider)},sign:async s=>{if(!await a())throw new Pn("Wallet is not currently connected.");return await this.sign(s)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let r,n=e;try{if(n===void 0){let l=await IM(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,l),Array.isArray(l)&&(n=l)}}catch(l){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",l)}if(!n||!Array.isArray(n)||n.length<=0||!n[0])return;let i=n[0],a=Ir(i),s=[];if(this.walletClientType==="privy"){let l=Dt.get(WC(a));this.chains.find(c=>c.id===Number(l))||(Dt.del(WC(a)),l=null),r=l||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:r}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${r} on initialization`)}}else try{let l=await IM(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,l),typeof l=="string")r=l;else{if(typeof l!="number")throw Error("Invalid chainId returned from provider");r=`0x${l.toString(16)}`}}catch(l){console.warn(`Failed to get chainId from provider, defaulting to ${VU}`,l),r=VU}let o=A6(r);if(!s.find(l=>Ir(l.address)===a)){let l={name:this.walletBranding.name,icon:typeof this.walletBranding.icon=="string"?this.walletBranding.icon:void 0,id:this.walletBranding.id};s.push(this.buildConnectedWallet(Ir(i),o,l,this.connectorType==="embedded_imported"))}qM(s,this.wallets)||(this.wallets=s,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((r,n)=>n.connectedAt-r.connectedAt).find(r=>e.find(n=>Ir(n)===Ir(r.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new L5(new t8(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,r,n,i){super(e),this.chainType="ethereum",this.onAccountsChanged=a=>{a.length===0?this.onDisconnect():this.syncAccounts(a)},this.onChainChanged=a=>{this.wallets.forEach(s=>{s.chainId=A6(a),this.walletClientType==="privy"&&Dt.put(WC(s.address),a)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=r,this.defaultChain=n,this.rpcConfig=i,this.rpcTimeoutDuration=YL(i,e),this.connected=!1,this.initialized=!1}},P4,v$e=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],ZB=(t,e)=>t.makeWeb3Provider({options:e}),b$e=class extends Rm{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:o$e,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||e.length===0||!e[0])throw new Pn("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw T1(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType=e==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(ZB(P4,this.connectionOptions))}constructor(e,r,n,i,a,s){if(super("coinbase_wallet",e,r,n),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new rs(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=i.coinbaseWallet.connectionOptions??"all",this.walletClientType=this.connectionOptions==="smartWalletOnly"?"coinbase_smart_wallet":"coinbase_wallet",this.walletClientType==="coinbase_smart_wallet"&&(this.displayName="Coinbase Smart Wallet"),!P4){let o=[r.id].concat(e.map(c=>c.id)),l=this.connectionOptions!=="eoaOnly"?o.filter(c=>!v$e.includes(c)):[];l.length>0&&!l.every(c=>Cre.has(c))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${l.join(", ")}`),P4=new Uee.CoinbaseWalletSDK({appName:a,appLogoUrl:s,appChainIds:o})}this.proxyProvider.setWalletProvider(ZB(P4,this.connectionOptions))}};const Mre=({...t})=>d.jsx("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:t.color||"var(--privy-color-foreground-3)"})});let XB=class extends Rm{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[H5((e==null?void 0:e.chainId)||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:Mre,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:r,defaultChain:n,rpcConfig:i,imported:a,walletIndex:s}){super("privy",r,n,i),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=s,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}};const x$e=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"],E$e=t=>x$e.includes(t),_$e=({as:t="div",...e},r)=>d.jsx(t,{...e,ref:r}),C$e=_.forwardRef(_$e),S$e="https://challenges.cloudflare.com/turnstile/v0/api.js",r8="cf-turnstile-script",A$e="cf-turnstile",Tre="onloadTurnstileCallback",n8=t=>!!document.getElementById(t),I$e=({render:t="explicit",onLoadCallbackName:e=Tre,scriptOptions:{nonce:r="",defer:n=!0,async:i=!0,id:a="",appendTo:s,onError:o,crossOrigin:l=""}={}})=>{const c=a||r8;if(n8(c))return;const u=document.createElement("script");if(u.id=c,u.src=`${S$e}?onload=${e}&render=${t}`,document.querySelector(`script[src="${u.src}"]`))return;u.defer=!!n,u.async=!!i,r&&(u.nonce=r),l&&(u.crossOrigin=l),o&&(u.onerror=o),(s==="body"?document.body:document.getElementsByTagName("head")[0]).appendChild(u)},Uc={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}};function M$e(t){let e;return t!=="invisible"&&(e=t),e}function T$e(t=r8){const[e,r]=_.useState(!1);return _.useEffect(()=>{const n=()=>{n8(t)&&r(!0)},i=new MutationObserver(n);return i.observe(document,{childList:!0,subtree:!0}),n(),()=>{i.disconnect()}},[t]),e}const kre=_.forwardRef((t,e)=>{const{scriptOptions:r,options:n={},siteKey:i,onWidgetLoad:a,onSuccess:s,onExpire:o,onError:l,onBeforeInteractive:c,onAfterInteractive:u,onUnsupported:f,onLoadScript:h,id:g,style:m,as:w="div",injectScript:C=!0,...v}=t,b=n.size??"normal",[A,S]=_.useState(n.execution==="execute"?Uc.invisible:n.appearance==="interaction-only"?Uc.interactionOnly:Uc[b]),j=_.useRef(null),F=_.useRef(!1),[I,B]=_.useState(),[V,se]=_.useState(!1),Y=g??A$e,N=C?(r==null?void 0:r.id)||`${r8}__${Y}`:(r==null?void 0:r.id)||r8,k=T$e(N),x=r!=null&&r.onLoadCallbackName?`${r.onLoadCallbackName}__${Y}`:`${Tre}__${Y}`,E=_.useMemo(()=>({sitekey:i,action:n.action,cData:n.cData,callback:s,"error-callback":l,"expired-callback":o,"before-interactive-callback":c,"after-interactive-callback":u,"unsupported-callback":f,theme:n.theme??"auto",language:n.language??"auto",tabindex:n.tabIndex,"response-field":n.responseField,"response-field-name":n.responseFieldName,size:M$e(b),retry:n.retry??"auto","retry-interval":n.retryInterval??8e3,"refresh-expired":n.refreshExpired??"auto",execution:n.execution??"render",appearance:n.appearance??"always"}),[i,n,s,l,o,b,c,u,f]),L=_.useMemo(()=>JSON.stringify(E),[E]);return _.useImperativeHandle(e,()=>{if(typeof window>"u"||!k)return;const{turnstile:O}=window;return{getResponse(){if(!(O!=null&&O.getResponse)||!I){console.warn("Turnstile has not been loaded");return}return O.getResponse(I)},reset(){if(!(O!=null&&O.reset)||!I){console.warn("Turnstile has not been loaded");return}n.execution==="execute"&&S(Uc.invisible);try{O.reset(I)}catch(P){console.warn(`Failed to reset Turnstile widget ${I}`,P)}},remove(){if(!(O!=null&&O.remove)||!I){console.warn("Turnstile has not been loaded");return}B(""),S(Uc.invisible),O.remove(I)},render(){if(!(O!=null&&O.render)||!j.current||I){console.warn("Turnstile has not been loaded or widget already rendered");return}const P=O.render(j.current,E);return B(P),n.execution!=="execute"&&S(Uc[b]),P},execute(){if(n.execution==="execute"){if(!(O!=null&&O.execute)||!j.current||!I){console.warn("Turnstile has not been loaded or widget has not been rendered");return}O.execute(j.current,E),S(Uc[b])}},isExpired(){if(!(O!=null&&O.isExpired)||!I){console.warn("Turnstile has not been loaded");return}return O.isExpired(I)}}},[k,I,n.execution,b,E,j]),_.useEffect(()=>(window[x]=()=>se(!0),()=>{delete window[x]}),[x]),_.useEffect(()=>{C&&!V&&I$e({onLoadCallbackName:x,scriptOptions:{...r,id:N}})},[C,V,x,r,N]),_.useEffect(()=>{k&&!V&&window.turnstile&&se(!0)},[V,k]),_.useEffect(()=>{if(!i){console.warn("sitekey was not provided");return}if(!k||!j.current||!V||F.current)return;const O=window.turnstile.render(j.current,E);B(O),F.current=!0},[k,i,E,F,V]),_.useEffect(()=>{if(window.turnstile&&j.current&&I){n8(I)&&window.turnstile.remove(I);const O=window.turnstile.render(j.current,E);B(O),F.current=!0}},[L,i]),_.useEffect(()=>{if(window.turnstile&&I&&n8(I))return a==null||a(I),()=>{window.turnstile.remove(I)}},[I,a]),_.useEffect(()=>{S(n.execution==="execute"?Uc.invisible:E.appearance==="interaction-only"?Uc.interactionOnly:Uc[b])},[n.execution,b,E.appearance]),_.useEffect(()=>{!k||typeof h!="function"||h()},[k,h]),d.jsx(C$e,{ref:j,as:w,id:Y,style:{...A,...m},...v})});kre.displayName="Turnstile";const k$e=t=>{let{enabled:e,siteKey:r,appId:n,setError:i,setToken:a,setExecuting:s,ref:o}=Ro(),[,l]=_.useMemo(()=>(r==null?void 0:r.split("t:"))||[],[r]);if(_.useEffect(()=>{var c;return(c=o.current)==null?void 0:c.remove},[]),!e)return null;if(!l)throw Error("Unsupported captcha site key");return d.jsx("div",{className:"hidden h-0 w-0",children:d.jsx(kre,{...t,ref:o,siteKey:l,options:{action:n,size:"invisible",...t.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{var c;(c=t.onUnsupported)==null||c.call(t),console.warn("Browser does not support Turnstile.")},onError:()=>{var c;(c=t.onError)==null||c.call(t),i("Captcha failed"),s(!1)},onSuccess:c=>{var u;(u=t.onSuccess)==null||u.call(t,c),a(c),s(!1)},onExpire:()=>{var c,u;(c=t.onExpire)==null||c.call(t);try{(u=o.current)==null||u.reset(),i(void 0),a(void 0)}catch{i("expired_and_failed_reset")}}})})};var Fa=function(){return Fa=Object.assign||function(e){for(var r,n=1,i=arguments.length;n0?Ji(Dm,--vl):0,Qg--,xi===10&&(Qg=1,Nx--),xi}function pc(){return xi=vl2||KM(xi)>3?"":" "}function U$e(t,e){for(;--e&&pc()&&!(xi<48||xi>102||xi>57&&xi<65||xi>70&&xi<97););return jx(t,R6()+(e<6&&P0()==32&&pc()==32))}function JM(t){for(;pc();)switch(xi){case t:return vl;case 34:case 39:t!==34&&t!==39&&JM(xi);break;case 40:t===41&&JM(t);break;case 92:pc();break}return vl}function B$e(t,e){for(;pc()&&t+xi!==57;)if(t+xi===84&&P0()===47)break;return"/*"+jx(e,vl-1)+"*"+JL(t===47?t:pc())}function z$e(t){for(;!KM(P0());)pc();return jx(t,vl)}function W$e(t){return O$e(D6("",null,null,null,[""],t=D$e(t),0,[0],t))}function D6(t,e,r,n,i,a,s,o,l){for(var c=0,u=0,f=s,h=0,g=0,m=0,w=1,C=1,v=1,b=0,A="",S=i,j=a,F=n,I=A;C;)switch(m=b,b=pc()){case 40:if(m!=108&&Ji(I,f-1)==58){P6(I+=Er(lS(b),"&","&\f"),"&\f",jre(c?o[c-1]:0))!=-1&&(v=-1);break}case 34:case 39:case 91:I+=lS(b);break;case 9:case 10:case 13:case 32:I+=F$e(m);break;case 92:I+=U$e(R6()-1,7);continue;case 47:switch(P0()){case 42:case 47:py(H$e(B$e(pc(),R6()),e,r,l),l);break;default:I+="/"}break;case 123*w:o[c++]=Xc(I)*v;case 125*w:case 59:case 0:switch(b){case 0:case 125:C=0;case 59+u:v==-1&&(I=Er(I,/\f/g,"")),g>0&&Xc(I)-f&&py(g>32?rz(I+";",n,r,f-1,l):rz(Er(I," ","")+";",n,r,f-2,l),l);break;case 59:I+=";";default:if(py(F=tz(I,e,r,c,u,i,o,A,S=[],j=[],f,a),a),b===123)if(u===0)D6(I,e,F,F,S,a,f,o,j);else switch(h===99&&Ji(I,3)===110?100:h){case 100:case 108:case 109:case 115:D6(t,F,F,n&&py(tz(t,F,F,0,0,i,o,A,i,S=[],f,j),j),i,j,f,o,n?S:j);break;default:D6(I,F,F,F,[""],j,0,o,j)}}c=u=g=0,w=v=1,A=I="",f=s;break;case 58:f=1+Xc(I),g=m;default:if(w<1){if(b==123)--w;else if(b==125&&w++==0&&R$e()==125)continue}switch(I+=JL(b),b*w){case 38:v=u>0?1:(I+="\f",-1);break;case 44:o[c++]=(Xc(I)-1)*v,v=1;break;case 64:P0()===45&&(I+=lS(pc())),h=P0(),u=f=Xc(A=I+=z$e(R6())),b++;break;case 45:m===45&&Xc(I)==2&&(w=0)}}return a}function tz(t,e,r,n,i,a,s,o,l,c,u,f){for(var h=i-1,g=i===0?a:[""],m=Pre(g),w=0,C=0,v=0;w0?g[b]+" "+A:Er(A,/&\f/g,g[b])))&&(l[v++]=S);return Lx(t,e,r,i===0?kx:o,l,c,u,f)}function H$e(t,e,r,n){return Lx(t,e,r,Nre,JL(P$e()),Jg(t,2,-2),0,n)}function rz(t,e,r,n,i){return Lx(t,e,r,KL,Jg(t,0,n),Jg(t,n+1,-1),n,i)}function Dre(t,e,r){switch(j$e(t,e)){case 5103:return nn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return nn+t+t;case 4789:return zy+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nn+t+zy+t+$n+t+t;case 5936:switch(Ji(t,e+11)){case 114:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nn+t+$n+Er(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return nn+t+$n+t+t;case 6165:return nn+t+$n+"flex-"+t+t;case 5187:return nn+t+Er(t,/(\w+).+(:[^]+)/,nn+"box-$1$2"+$n+"flex-$1$2")+t;case 5443:return nn+t+$n+"flex-item-"+Er(t,/flex-|-self/g,"")+(dd(t,/flex-|baseline/)?"":$n+"grid-row-"+Er(t,/flex-|-self/g,""))+t;case 4675:return nn+t+$n+"flex-line-pack"+Er(t,/align-content|flex-|-self/g,"")+t;case 5548:return nn+t+$n+Er(t,"shrink","negative")+t;case 5292:return nn+t+$n+Er(t,"basis","preferred-size")+t;case 6060:return nn+"box-"+Er(t,"-grow","")+nn+t+$n+Er(t,"grow","positive")+t;case 4554:return nn+Er(t,/([^-])(transform)/g,"$1"+nn+"$2")+t;case 6187:return Er(Er(Er(t,/(zoom-|grab)/,nn+"$1"),/(image-set)/,nn+"$1"),t,"")+t;case 5495:case 3959:return Er(t,/(image-set\([^]*)/,nn+"$1$`$1");case 4968:return Er(Er(t,/(.+:)(flex-)?(.*)/,nn+"box-pack:$3"+$n+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nn+t+t;case 4200:if(!dd(t,/flex-|baseline/))return $n+"grid-column-align"+Jg(t,e)+t;break;case 2592:case 3360:return $n+Er(t,"template-","")+t;case 4384:case 3616:return r&&r.some(function(n,i){return e=i,dd(n.props,/grid-\w+-end/)})?~P6(t+(r=r[e].value),"span",0)?t:$n+Er(t,"-start","")+t+$n+"grid-row-span:"+(~P6(r,"span",0)?dd(r,/\d+/):+dd(r,/\d+/)-+dd(t,/\d+/))+";":$n+Er(t,"-start","")+t;case 4896:case 4128:return r&&r.some(function(n){return dd(n.props,/grid-\w+-start/)})?t:$n+Er(Er(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return Er(t,/(.+)-inline(.+)/,nn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Xc(t)-1-e>6)switch(Ji(t,e+1)){case 109:if(Ji(t,e+4)!==45)break;case 102:return Er(t,/(.+:)(.+)-([^]+)/,"$1"+nn+"$2-$3$1"+zy+(Ji(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~P6(t,"stretch",0)?Dre(Er(t,"stretch","fill-available"),e,r)+t:t}break;case 5152:case 5920:return Er(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(n,i,a,s,o,l,c){return $n+i+":"+a+c+(s?$n+i+"-span:"+(o?l:+l-+a)+c:"")+t});case 4949:if(Ji(t,e+6)===121)return Er(t,":",":"+nn)+t;break;case 6444:switch(Ji(t,Ji(t,14)===45?18:11)){case 120:return Er(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+nn+(Ji(t,14)===45?"inline-":"")+"box$3$1"+nn+"$2$3$1"+$n+"$2box$3")+t;case 100:return Er(t,":",":"+$n)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Er(t,"scroll-","scroll-snap-")+t}return t}function i8(t,e){for(var r="",n=0;n-1&&!t.return)switch(t.type){case KL:t.return=Dre(t.value,t.length,r);return;case Lre:return i8([Cf(t,{value:Er(t.value,"@","@"+nn)})],n);case kx:if(t.length)return $$e(r=t.props,function(i){switch(dd(i,n=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Ep(Cf(t,{props:[Er(i,/:(read-\w+)/,":"+zy+"$1")]})),Ep(Cf(t,{props:[i]})),YM(t,{props:ez(r,n)});break;case"::placeholder":Ep(Cf(t,{props:[Er(i,/:(plac\w+)/,":"+nn+"input-$1")]})),Ep(Cf(t,{props:[Er(i,/:(plac\w+)/,":"+zy+"$1")]})),Ep(Cf(t,{props:[Er(i,/:(plac\w+)/,$n+"input-$1")]})),Ep(Cf(t,{props:[i]})),YM(t,{props:ez(r,n)});break}return""})}}var K$e={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},po={},Zg=typeof process<"u"&&po!==void 0&&(po.REACT_APP_SC_ATTR||po.SC_ATTR)||"data-styled",Ore="active",Fre="data-styled-version",$x="6.1.13",QL=`/*!sc*/ +`,a8=typeof window<"u"&&"HTMLElement"in window,J$e=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&po!==void 0&&po.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&po.REACT_APP_SC_DISABLE_SPEEDY!==""?po.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&po.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&po!==void 0&&po.SC_DISABLE_SPEEDY!==void 0&&po.SC_DISABLE_SPEEDY!==""&&po.SC_DISABLE_SPEEDY!=="false"&&po.SC_DISABLE_SPEEDY),Q$e={},Px=Object.freeze([]),Xg=Object.freeze({});function Ure(t,e,r){return r===void 0&&(r=Xg),t.theme!==r.theme&&t.theme||e||r.theme}var Bre=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),Z$e=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,X$e=/(^-|-$)/g;function nz(t){return t.replace(Z$e,"-").replace(X$e,"")}var ePe=/(a)(d)/gi,R4=52,iz=function(t){return String.fromCharCode(t+(t>25?39:97))};function QM(t){var e,r="";for(e=Math.abs(t);e>R4;e=e/R4|0)r=iz(e%R4)+r;return(iz(e%R4)+r).replace(ePe,"$1-$2")}var cS,zre=5381,ng=function(t,e){for(var r=e.length;r;)t=33*t^e.charCodeAt(--r);return t},Wre=function(t){return ng(zre,t)};function ZL(t){return QM(Wre(t)>>>0)}function tPe(t){return t.displayName||t.name||"Component"}function uS(t){return typeof t=="string"&&!0}var Hre=typeof Symbol=="function"&&Symbol.for,Gre=Hre?Symbol.for("react.memo"):60115,rPe=Hre?Symbol.for("react.forward_ref"):60112,nPe={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},iPe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},qre={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},aPe=((cS={})[rPe]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},cS[Gre]=qre,cS);function az(t){return("type"in(e=t)&&e.type.$$typeof)===Gre?qre:"$$typeof"in t?aPe[t.$$typeof]:nPe;var e}var sPe=Object.defineProperty,oPe=Object.getOwnPropertyNames,sz=Object.getOwnPropertySymbols,lPe=Object.getOwnPropertyDescriptor,cPe=Object.getPrototypeOf,oz=Object.prototype;function Vre(t,e,r){if(typeof e!="string"){if(oz){var n=cPe(e);n&&n!==oz&&Vre(t,n,r)}var i=oPe(e);sz&&(i=i.concat(sz(e)));for(var a=az(t),s=az(e),o=0;o0?" Args: ".concat(e.join(", ")):""))}var uPe=function(){function t(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}return t.prototype.indexOfGroup=function(e){for(var r=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,i=n.length,a=i;e>=a;)if((a<<=1)<0)throw sv(16,"".concat(e));this.groupSizes=new Uint32Array(a),this.groupSizes.set(n),this.length=a;for(var s=i;s=this.length||this.groupSizes[e]===0)return r;for(var n=this.groupSizes[e],i=this.indexOfGroup(e),a=i+n,s=i;s=0){var n=document.createTextNode(r);return this.element.insertBefore(n,this.nodes[e]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.prototype.getRule=function(e){return e0&&(C+="".concat(v,","))}),l+="".concat(m).concat(w,'{content:"').concat(C,'"}').concat(QL)},u=0;u0?".".concat(e):h},u=l.slice();u.push(function(h){h.type===kx&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(xPe,r).replace(n,c))}),s.prefix&&u.push(Y$e),u.push(G$e);var f=function(h,g,m,w){g===void 0&&(g=""),m===void 0&&(m=""),w===void 0&&(w="&"),e=w,r=g,n=new RegExp("\\".concat(r,"\\b"),"g");var C=h.replace(EPe,""),v=W$e(m||g?"".concat(m," ").concat(g," { ").concat(C," }"):C);s.namespace&&(v=Kre(v,s.namespace));var b=[];return i8(v,q$e(u.concat(V$e(function(A){return b.push(A)})))),b};return f.hash=l.length?l.reduce(function(h,g){return g.name||sv(15),ng(h,g.name)},zre).toString():"",f}var CPe=new l8,XM=_Pe(),Jre=Et.createContext({shouldForwardProp:void 0,styleSheet:CPe,stylis:XM});Jre.Consumer;Et.createContext(void 0);function eT(){return _.useContext(Jre)}var Qre=function(){function t(e,r){var n=this;this.inject=function(i,a){a===void 0&&(a=XM);var s=n.name+a.hash;i.hasNameForId(n.id,s)||i.insertRules(n.id,s,a(n.rules,s,"@keyframes"))},this.name=e,this.id="sc-keyframes-".concat(e),this.rules=r,ej(this,function(){throw sv(12,String(n.name))})}return t.prototype.getName=function(e){return e===void 0&&(e=XM),this.name+e.hash},t}(),SPe=function(t){return t>="A"&&t<="Z"};function uz(t){for(var e="",r=0;r>>0);if(!r.hasNameForId(this.componentId,s)){var o=n(a,".".concat(s),void 0,this.componentId);r.insertRules(this.componentId,s,o)}i=C0(i,s),this.staticRulesId=s}else{for(var l=ng(this.baseHash,n.hash),c="",u=0;u>>0);r.hasNameForId(this.componentId,g)||r.insertRules(this.componentId,g,n(c,".".concat(g),void 0,this.componentId)),i=C0(i,g)}}return i},t}(),tj=Et.createContext(void 0);tj.Consumer;var dS={};function MPe(t,e,r){var n=XL(t),i=t,a=!uS(t),s=e.attrs,o=s===void 0?Px:s,l=e.componentId,c=l===void 0?function(S,j){var F=typeof S!="string"?"sc":nz(S);dS[F]=(dS[F]||0)+1;var I="".concat(F,"-").concat(ZL($x+F+dS[F]));return j?"".concat(j,"-").concat(I):I}(e.displayName,e.parentComponentId):l,u=e.displayName,f=u===void 0?function(S){return uS(S)?"styled.".concat(S):"Styled(".concat(tPe(S),")")}(t):u,h=e.displayName&&e.componentId?"".concat(nz(e.displayName),"-").concat(e.componentId):e.componentId||c,g=n&&i.attrs?i.attrs.concat(o).filter(Boolean):o,m=e.shouldForwardProp;if(n&&i.shouldForwardProp){var w=i.shouldForwardProp;if(e.shouldForwardProp){var C=e.shouldForwardProp;m=function(S,j){return w(S,j)&&C(S,j)}}else m=w}var v=new IPe(r,h,n?i.componentStyle:void 0);function b(S,j){return function(F,I,B){var V=F.attrs,se=F.componentStyle,Y=F.defaultProps,N=F.foldedComponentIds,k=F.styledComponentId,x=F.target,E=Et.useContext(tj),L=eT(),O=F.shouldForwardProp||L.shouldForwardProp,P=Ure(I,E,Y)||Xg,R=function(H,ee,J){for(var te,re=Fa(Fa({},ee),{className:void 0,theme:J}),z=0;z2&&l8.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,r,n,i)},t}();function kPe(t){for(var e=[],r=1;r{if(!t||!t.primary[0])return;let e=[t.primary[0]],r=[];for(let n of(t.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),t.primary.slice(1)))e.includes(n)?console.warn(`Duplicated login method: ${n}`):e.push(n);for(let n of t.overflow??[])e.includes(n)||r.includes(n)?console.warn(`Duplicated login method: ${n}`):r.push(n);return{primary:e,overflow:r}};let LPe=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","wallet_connect","detected_wallets","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe"]),hz=t=>LPe.has(t),pz=(t,e,r)=>r.indexOf(t)===e;const jPe=({input:t,overrides:e})=>e?e.primary.concat(e.overflow??[]).filter(hz).filter(pz):t?t.filter(hz).filter(pz):lo.appearance.walletList;function rj(t){let e=t.filter(r=>!Cre.has(r.id));return e8.concat(e)}function $Pe(t,e){return{...t,rpcUrls:{...t.rpcUrls,privy:{http:[e]}}}}const PPe="https://api.mainnet-beta.solana.com",RPe="https://api.testnet.solana.com",DPe="https://api.devnet.solana.com",rT=792703809,nT="11111111111111111111111111111111",OPe="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";function nj(t){return t.includes("testnet")?"testnet":t.includes("devnet")?"devnet":"mainnet-beta"}function FPe(t,e){return`https://explorer.solana.com/tx/${t}?cluster=${e}`}function UPe(t,e){return`https://explorer.solana.com/account/${t}?cluster=${e}`}function BPe({name:t,rpcUrl:e}){if(e)return e;switch(t){case"mainnet-beta":return"https://api.mainnet-beta.solana.com";case"testnet":return"https://api.testnet.solana.com";case"devnet":return"https://api.devnet.solana.com"}}function c8(t){"@babel/helpers - typeof";return c8=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c8(t)}var zPe=/^\s+/,WPe=/\s+$/;function $t(t,e){if(t=t||"",e=e||{},t instanceof $t)return t;if(!(this instanceof $t))return new $t(t,e);var r=HPe(t);this._originalInput=t,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=e.format||r.format,this._gradientType=e.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}$t.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},getLuminance:function(){var e=this.toRgb(),r,n,i,a,s,o;return r=e.r/255,n=e.g/255,i=e.b/255,r<=.03928?a=r/12.92:a=Math.pow((r+.055)/1.055,2.4),n<=.03928?s=n/12.92:s=Math.pow((n+.055)/1.055,2.4),i<=.03928?o=i/12.92:o=Math.pow((i+.055)/1.055,2.4),.2126*a+.7152*s+.0722*o},setAlpha:function(e){return this._a=nne(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=mz(this._r,this._g,this._b);return{h:e.h*360,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=mz(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+i+"%)":"hsva("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHsl:function(){var e=gz(this._r,this._g,this._b);return{h:e.h*360,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=gz(this._r,this._g,this._b),r=Math.round(e.h*360),n=Math.round(e.s*100),i=Math.round(e.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+i+"%)":"hsla("+r+", "+n+"%, "+i+"%, "+this._roundA+")"},toHex:function(e){return yz(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return YPe(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(Fn(this._r,255)*100)+"%",g:Math.round(Fn(this._g,255)*100)+"%",b:Math.round(Fn(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(Fn(this._r,255)*100)+"%, "+Math.round(Fn(this._g,255)*100)+"%, "+Math.round(Fn(this._b,255)*100)+"%)":"rgba("+Math.round(Fn(this._r,255)*100)+"%, "+Math.round(Fn(this._g,255)*100)+"%, "+Math.round(Fn(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:sRe[yz(this._r,this._g,this._b,!0)]||!1},toFilter:function(e){var r="#"+wz(this._r,this._g,this._b,this._a),n=r,i=this._gradientType?"GradientType = 1, ":"";if(e){var a=$t(e);n="#"+wz(a._r,a._g,a._b,a._a)}return"progid:DXImageTransform.Microsoft.gradient("+i+"startColorstr="+r+",endColorstr="+n+")"},toString:function(e){var r=!!e;e=e||this._format;var n=!1,i=this._a<1&&this._a>=0,a=!r&&i&&(e==="hex"||e==="hex6"||e==="hex3"||e==="hex4"||e==="hex8"||e==="name");return a?e==="name"&&this._a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return $t(this.toString())},_applyModification:function(e,r){var n=e.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(ZPe,arguments)},brighten:function(){return this._applyModification(XPe,arguments)},darken:function(){return this._applyModification(eRe,arguments)},desaturate:function(){return this._applyModification(KPe,arguments)},saturate:function(){return this._applyModification(JPe,arguments)},greyscale:function(){return this._applyModification(QPe,arguments)},spin:function(){return this._applyModification(tRe,arguments)},_applyCombination:function(e,r){return e.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(iRe,arguments)},complement:function(){return this._applyCombination(rRe,arguments)},monochromatic:function(){return this._applyCombination(aRe,arguments)},splitcomplement:function(){return this._applyCombination(nRe,arguments)},triad:function(){return this._applyCombination(vz,[3])},tetrad:function(){return this._applyCombination(vz,[4])}};$t.fromRatio=function(t,e){if(c8(t)=="object"){var r={};for(var n in t)t.hasOwnProperty(n)&&(n==="a"?r[n]=t[n]:r[n]=gy(t[n]));t=r}return $t(t,e)};function HPe(t){var e={r:0,g:0,b:0},r=1,n=null,i=null,a=null,s=!1,o=!1;return typeof t=="string"&&(t=uRe(t)),c8(t)=="object"&&(td(t.r)&&td(t.g)&&td(t.b)?(e=GPe(t.r,t.g,t.b),s=!0,o=String(t.r).substr(-1)==="%"?"prgb":"rgb"):td(t.h)&&td(t.s)&&td(t.v)?(n=gy(t.s),i=gy(t.v),e=VPe(t.h,n,i),s=!0,o="hsv"):td(t.h)&&td(t.s)&&td(t.l)&&(n=gy(t.s),a=gy(t.l),e=qPe(t.h,n,a),s=!0,o="hsl"),t.hasOwnProperty("a")&&(r=t.a)),r=nne(r),{ok:s,format:t.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:r}}function GPe(t,e,r){return{r:Fn(t,255)*255,g:Fn(e,255)*255,b:Fn(r,255)*255}}function gz(t,e,r){t=Fn(t,255),e=Fn(e,255),r=Fn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,s,o=(n+i)/2;if(n==i)a=s=0;else{var l=n-i;switch(s=o>.5?l/(2-n-i):l/(n+i),n){case t:a=(e-r)/l+(e1&&(f-=1),f<1/6?c+(u-c)*6*f:f<1/2?u:f<2/3?c+(u-c)*(2/3-f)*6:c}if(e===0)n=i=a=r;else{var o=r<.5?r*(1+e):r+e-r*e,l=2*r-o;n=s(l,o,t+1/3),i=s(l,o,t),a=s(l,o,t-1/3)}return{r:n*255,g:i*255,b:a*255}}function mz(t,e,r){t=Fn(t,255),e=Fn(e,255),r=Fn(r,255);var n=Math.max(t,e,r),i=Math.min(t,e,r),a,s,o=n,l=n-i;if(s=n===0?0:l/n,n==i)a=0;else{switch(n){case t:a=(e-r)/l+(e>1)+720)%360;--e;)n.h=(n.h+i)%360,a.push($t(n));return a}function aRe(t,e){e=e||6;for(var r=$t(t).toHsv(),n=r.h,i=r.s,a=r.v,s=[],o=1/e;e--;)s.push($t({h:n,s:i,v:a})),a=(a+o)%1;return s}$t.mix=function(t,e,r){r=r===0?0:r||50;var n=$t(t).toRgb(),i=$t(e).toRgb(),a=r/100,s={r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a};return $t(s)};$t.readability=function(t,e){var r=$t(t),n=$t(e);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};$t.isReadable=function(t,e,r){var n=$t.readability(t,e),i,a;switch(a=!1,i=dRe(r),i.level+i.size){case"AAsmall":case"AAAlarge":a=n>=4.5;break;case"AAlarge":a=n>=3;break;case"AAAsmall":a=n>=7;break}return a};$t.mostReadable=function(t,e,r){var n=null,i=0,a,s,o,l;r=r||{},s=r.includeFallbackColors,o=r.level,l=r.size;for(var c=0;ci&&(i=a,n=$t(e[c]));return $t.isReadable(t,n,{level:o,size:l})||!s?n:(r.includeFallbackColors=!1,$t.mostReadable(t,["#fff","#000"],r))};var iT=$t.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},sRe=$t.hexNames=oRe(iT);function oRe(t){var e={};for(var r in t)t.hasOwnProperty(r)&&(e[t[r]]=r);return e}function nne(t){return t=parseFloat(t),(isNaN(t)||t<0||t>1)&&(t=1),t}function Fn(t,e){lRe(t)&&(t="100%");var r=cRe(t);return t=Math.min(e,Math.max(0,parseFloat(t))),r&&(t=parseInt(t*e,10)/100),Math.abs(t-e)<1e-6?1:t%e/parseFloat(e)}function Rx(t){return Math.min(1,Math.max(0,t))}function co(t){return parseInt(t,16)}function lRe(t){return typeof t=="string"&&t.indexOf(".")!=-1&&parseFloat(t)===1}function cRe(t){return typeof t=="string"&&t.indexOf("%")!=-1}function sc(t){return t.length==1?"0"+t:""+t}function gy(t){return t<=1&&(t=t*100+"%"),t}function ine(t){return Math.round(parseFloat(t)*255).toString(16)}function bz(t){return co(t)/255}var Vl=function(){var t="[-\\+]?\\d+%?",e="[-\\+]?\\d*\\.\\d+%?",r="(?:"+e+")|(?:"+t+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",i="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+i),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+i),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+i),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function td(t){return!!Vl.CSS_UNIT.exec(t)}function uRe(t){t=t.replace(zPe,"").replace(WPe,"").toLowerCase();var e=!1;if(iT[t])t=iT[t],e=!0;else if(t=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=Vl.rgb.exec(t))?{r:r[1],g:r[2],b:r[3]}:(r=Vl.rgba.exec(t))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=Vl.hsl.exec(t))?{h:r[1],s:r[2],l:r[3]}:(r=Vl.hsla.exec(t))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=Vl.hsv.exec(t))?{h:r[1],s:r[2],v:r[3]}:(r=Vl.hsva.exec(t))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=Vl.hex8.exec(t))?{r:co(r[1]),g:co(r[2]),b:co(r[3]),a:bz(r[4]),format:e?"name":"hex8"}:(r=Vl.hex6.exec(t))?{r:co(r[1]),g:co(r[2]),b:co(r[3]),format:e?"name":"hex"}:(r=Vl.hex4.exec(t))?{r:co(r[1]+""+r[1]),g:co(r[2]+""+r[2]),b:co(r[3]+""+r[3]),a:bz(r[4]+""+r[4]),format:e?"name":"hex8"}:(r=Vl.hex3.exec(t))?{r:co(r[1]+""+r[1]),g:co(r[2]+""+r[2]),b:co(r[3]+""+r[3]),format:e?"name":"hex"}:!1}function dRe(t){var e,r;return t=t||{level:"AA",size:"small"},e=(t.level||"AA").toUpperCase(),r=(t.size||"small").toLowerCase(),e!=="AA"&&e!=="AAA"&&(e="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:e,size:r}}let xz="#FFFFFF";function fRe(t){return t<.8&&t>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),t>.5?"light":"dark"}function Ms(t,e){let r=Math.max(0,Math.min(1,t.toHsl().l+e));return $t({...t.toHsl(),l:r})}function hRe({backgroundTheme:t,accentHex:e}){let r;switch(t){case"light":r=xz;break;case"dark":r="#1E1E1D";break;default:r=t}let n=$t(r),i=$t(e),a=$t("#51BA81"),s=$t("#FFB74D"),o=$t("#EC6351"),l=fRe(n.getLuminance()),c=Ms(n,l==="light"?-.04:.11),u=Ms(n,l==="light"?-.08:.16),f=Ms(n,l==="light"?-.88:.87),h=Ms(n,l==="light"?-.7:.75),g=Ms(n,l==="light"?-.43:.45).desaturate(l==="light"?60:20),m=Ms(n,l==="light"?-.08:.25).desaturate(l==="light"?60:20),w=Ms(i,.15),C=Ms(i,.25),v=Ms(i,-.06),b=Ms(i,-.6),A=Ms(o,.3),S=Ms(s,.3),j=$t(i.getLuminance()>.5?"#040217":xz),F=Ms(a,-.16),I=Ms(a,.4);return{colorScheme:l,background:n.toHslString(),background2:c.toHslString(),background3:u.toHslString(),foreground:f.toHslString(),foreground2:h.toHslString(),foreground3:g.toHslString(),foreground4:m.toHslString(),accent:i.toHslString(),accentLight:w.toHslString(),accentLightest:C.toHslString(),accentDark:v.toHslString(),accentDarkest:b.toHslString(),foregroundAccent:j.toHslString(),success:a.toHslString(),successDark:F.toHslString(),successLight:I.toHslString(),error:o.toHslString(),errorLight:A.toHslString(),warn:s.toHslString(),warnLight:S.toHslString()}}function ane(t,e,r){var M,D,$,X,le,H,ee,J,te,re,z,G,Q,me,be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne,$e,je,K,U,W,ie,pe,we,he,Re,Je,et,it,ut,pt,tr;let n,i,a,s,o,l,c,u,f,h,g,m,w,C,v,b,A=r?console.warn:()=>{};e!=null&&e.loginMethods?(n=e.loginMethods.includes("email"),i=e.loginMethods.includes("sms"),s=e.loginMethods.includes("wallet"),o=e.loginMethods.includes("google"),l=e.loginMethods.includes("twitter"),c=e.loginMethods.includes("discord"),f=e.loginMethods.includes("spotify"),h=e.loginMethods.includes("instagram"),u=e.loginMethods.includes("tiktok"),m=e.loginMethods.includes("github"),g=e.loginMethods.includes("linkedin"),w=e.loginMethods.includes("apple"),C=e.loginMethods.includes("farcaster"),v=e.loginMethods.includes("telegram")):(n=t.emailAuth,i=t.smsAuth,s=t.walletAuth||t.solanaWalletAuth,o=t.googleOAuth,l=t.twitterOAuth,c=t.discordOAuth,m=t.githubOAuth,f=t.spotifyOAuth,h=t.instagramOAuth,u=t.tiktokOAuth,g=t.linkedinOAuth,w=t.appleOAuth,C=t.farcasterAuth,v=t.telegramAuth),typeof window<"u"&&typeof window.PublicKeyCredential!="function"?a=!1:t.passkeyAuth&&(a=!0);let S=[n,i].filter(Boolean),j=[o,l,c,m,f,h,u,g,w,C,v].filter(Boolean),F=[s].filter(Boolean);if(S.length+j.length+F.length===0)throw Error("You must enable at least one login method");let I=((M=e==null?void 0:e.appearance)==null?void 0:M.showWalletLoginFirst)!==void 0?(D=e==null?void 0:e.appearance)==null?void 0:D.showWalletLoginFirst:t.showWalletLoginFirst;I&&F.length===0?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):I||j.length+S.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let B=((X=($=e==null?void 0:e.externalWallets)==null?void 0:$.walletConnect)==null?void 0:X.enabled)??!0;e!=null&&e.loginMethods&&e.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let V=jPe({input:(le=e==null?void 0:e.appearance)==null?void 0:le.walletList,overrides:e==null?void 0:e.loginMethodsAndOrder}),se=NPe({input:e==null?void 0:e.loginMethodsAndOrder}),Y=((H=e==null?void 0:e.intl)==null?void 0:H.defaultCountry)??"US",{chains:N,defaultChain:k}=gRe({additionalChains:e==null?void 0:e.additionalChains,supportedChains:e==null?void 0:e.supportedChains,defaultChainFromConfig:e==null?void 0:e.defaultChain,hasRpcConfigDefined:Object.keys(((ee=e==null?void 0:e.rpcConfig)==null?void 0:ee.rpcUrls)??{}).length>0}),x=!!(e!=null&&e.defaultChain),E=((J=e==null?void 0:e.customAuth)==null?void 0:J.getCustomAccessToken)&&((te=e==null?void 0:e.customAuth)==null?void 0:te.enabled)!==!1,L=!(t.enforceWalletUis??1);if(b=t.legacyWalletUiConfig??1?E?((re=e==null?void 0:e.embeddedWallets)==null?void 0:re.noPromptOnSignature)??!0:((z=e==null?void 0:e.embeddedWallets)==null?void 0:z.noPromptOnSignature)??L:L,((G=e==null?void 0:e.embeddedWallets)==null?void 0:G.waitForTransactionConfirmation)===!1&&b!==!0)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:O,...P}=(e==null?void 0:e.embeddedWallets)??{},R=(e==null?void 0:e.solanaClusters)??[];return t.solanaWalletAuth&&!((me=(Q=e==null?void 0:e.externalWallets)==null?void 0:Q.solana)!=null&&me.connectors)&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`"),{id:t.id,name:t.name,allowlistConfig:t.allowlistConfig,legacyWalletUiConfig:t.legacyWalletUiConfig,appearance:{logo:((be=e==null?void 0:e.appearance)==null?void 0:be.logo)??t.logoUrl,landingHeader:((Ce=e==null?void 0:e.appearance)==null?void 0:Ce.landingHeader)??lo.appearance.landingHeader,loginMessage:typeof((Fe=e==null?void 0:e.appearance)==null?void 0:Fe.loginMessage)=="string"?(Ue=e==null?void 0:e.appearance)==null?void 0:Ue.loginMessage.slice(0,100):(Ke=e==null?void 0:e.appearance)==null?void 0:Ke.loginMessage,palette:hRe({backgroundTheme:((lt=e==null?void 0:e.appearance)==null?void 0:lt.theme)??lo.appearance.theme,accentHex:((Ee=e==null?void 0:e.appearance)==null?void 0:Ee.accentColor)??t.accentColor??lo.appearance.accentColor}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!((He=e==null?void 0:e.appearance)!=null&&He.hideDirectWeb2Inputs),walletList:V,walletChainType:((qe=e==null?void 0:e.appearance)==null?void 0:qe.walletChainType)??(({evmWalletAuth:zt,solanaWalletAuth:At})=>zt&&At?"ethereum-and-solana":zt?"ethereum-only":At?"solana-only":"ethereum-only")({evmWalletAuth:t.walletAuth??!1,solanaWalletAuth:t.solanaWalletAuth??!1})},loginMethods:{wallet:s,email:n,sms:i,passkey:a,google:o,twitter:l,discord:c,github:m,spotify:f,instagram:h,tiktok:u,linkedin:g,apple:w,farcaster:C,telegram:v},disablePlusEmails:t.disablePlusEmails,loginMethodsAndOrder:se,legal:{termsAndConditionsUrl:((Ie=e==null?void 0:e.legal)==null?void 0:Ie.termsAndConditionsUrl)??t.termsAndConditionsUrl,privacyPolicyUrl:((Ne=e==null?void 0:e.legal)==null?void 0:Ne.privacyPolicyUrl)??t.privacyPolicyUrl,requireUsersAcceptTerms:t.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:(e==null?void 0:e.walletConnectCloudProjectId)??t.walletConnectCloudProjectId??lo.walletConnectCloudProjectId,rpcConfig:{rpcUrls:(($e=e==null?void 0:e.rpcConfig)==null?void 0:$e.rpcUrls)??lo.rpcConfig.rpcUrls,rpcTimeouts:((je=e==null?void 0:e.rpcConfig)==null?void 0:je.rpcTimeouts)??lo.rpcConfig.rpcTimeouts},chains:N,solanaClusters:{"mainnet-beta":((K=R.find(zt=>zt.name==="mainnet-beta"))==null?void 0:K.rpcUrl)||PPe,testnet:((U=R.find(zt=>zt.name==="testnet"))==null?void 0:U.rpcUrl)||RPe,devnet:((W=R.find(zt=>zt.name==="devnet"))==null?void 0:W.rpcUrl)||DPe},defaultChain:k,intl:{defaultCountry:Y},shouldEnforceDefaultChainOnConnect:x,captchaEnabled:t.captchaEnabled??lo.captchaEnabled,captchaSiteKey:t.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:((pe=(ie=e==null?void 0:e.externalWallets)==null?void 0:ie.coinbaseWallet)==null?void 0:pe.connectionOptions)??lo.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:B},solana:{connectors:(he=(we=e==null?void 0:e.externalWallets)==null?void 0:we.solana)==null?void 0:he.connectors}},embeddedWallets:{...t.embeddedWalletConfig,...typeof O=="boolean"?{requireUserOwnedRecoveryOnCreate:O}:{},...E?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...P,noPromptOnSignature:b,showWalletUIs:(Re=e==null?void 0:e.embeddedWallets)==null?void 0:Re.showWalletUIs,extendedCalldataDecoding:(Je=e==null?void 0:e.embeddedWallets)==null?void 0:Je.extendedCalldataDecoding},mfa:{methods:t.mfaMethods??[],noPromptOnMfaRequired:((et=e==null?void 0:e.mfa)==null?void 0:et.noPromptOnMfaRequired)??!1},customAuth:E?{enabled:!0,...e.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:t.telegramAuthConfiguration},headless:!!(e!=null&&e.headless),render:{standalone:((it=e==null?void 0:e._render)==null?void 0:it.standalone)??lo._render.standalone},fundingConfig:t.fundingConfig,fundingMethodConfig:{...(e==null?void 0:e.fundingMethodConfig)??lo.fundingMethodConfig,moonpay:{...((ut=e==null?void 0:e.fundingMethodConfig)==null?void 0:ut.moonpay)??lo.fundingMethodConfig.moonpay,useSandbox:((pt=e==null?void 0:e.fundingMethodConfig)==null?void 0:pt.moonpay.useSandbox)??((tr=e==null?void 0:e.fiatOnRamp)==null?void 0:tr.useSandbox)??lo.fundingMethodConfig.moonpay.useSandbox}}}}function pRe(t,e){var l,c;if(!t)return{legacyCreateEmbeddedWalletFlag:e};let{appearance:r,additionalChains:n,supportedChains:i,defaultChain:a,externalWallets:s,...o}=t;return{...o,...n?{additionalChains:n.map(u=>u.id)}:void 0,...i?{supportedChains:i.map(u=>u.id)}:void 0,...a?{defaultChain:a.id}:void 0,...s?{walletConnect:s.walletConnect,coinbaseWallet:s.coinbaseWallet,solana:{connectors:(c=(l=s.solana)==null?void 0:l.connectors)==null?void 0:c.get().map(u=>u.walletClientType)}}:void 0,legacyCreateEmbeddedWalletFlag:e}}function gRe({additionalChains:t,supportedChains:e,defaultChainFromConfig:r,hasRpcConfigDefined:n}){let i;if(t&&e&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),e){if(e.length===0)throw Error("`supportedChains` must contain at least one chain");e.filter(o=>o.rpcUrls.privyWalletOverride).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),i=e.map(o=>{var u;if(o.rpcUrls.privyWalletOverride)return o;let l=e8.find(f=>f.id===o.id),c=(u=l==null?void 0:l.rpcUrls.privy)==null?void 0:u.http[0];return c?$Pe(o,c):o})}else i=e8.concat(t??[]);let a=e?i[0]:Ru,s=r??a;if(!i.find(o=>o.id===s.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:s}}const mRe=function(t,e=0){let r=3735928559^e,n=1103547991^e;for(let i,a=0;a>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)};let sne={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,disablePlusEmails:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:"",enforceWalletUis:!1,legacyWalletUiConfig:!1};const one=ane(sne,void 0,!1);let ij=_.createContext({appConfig:one,isServerConfigLoaded:!1});const yRe=({children:t,legacyCreateEmbeddedWalletFlag:e,client:r,clientConfig:n})=>{let[i,a]=_.useState(null),s=_.useMemo(()=>ane(i??sne,n,!!i),[i,n]);return _.useEffect(()=>{if(!i)return;let o=pRe(n,e),l=mRe(JSON.stringify(o)).toString(),c=`privy:sent:${i.id}:${l}`;localStorage.getItem(c)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:o}),localStorage.setItem(c,"t"))},[n,e,i]),_.useEffect(()=>{i||(async()=>{try{let o=await r.getServerConfig();o.customApiUrl&&r.updateApiUrl(o.customApiUrl),a(o)}catch(o){console.warn("Error generating app config: ",o)}})()},[]),d.jsx(ij.Provider,{value:{appConfig:s,isServerConfigLoaded:!!i},children:t})},Ai=()=>{let{appConfig:t}=_.useContext(ij);return t},wRe=()=>{let{isServerConfigLoaded:t}=_.useContext(ij);return t},lne=_.createContext({setAuthenticated:Pe,setUser:Pe,isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},noPromptOnSignature:{current:!1},nativeTokenSymbolForChainId:Pe,initializeWalletProxy:Pe,getAuthMeta:Pe,getAuthFlow:Pe,closePrivyModal:Pe,openPrivyModal:Pe,connectWallet:Pe,initLoginWithWallet:Pe,loginWithWallet:Pe,initLoginWithFarcaster:Pe,loginWithFarcaster:Pe,loginWithCode:Pe,initLoginWithEmail:Pe,initLoginWithSms:Pe,initUpdateEmail:Pe,initUpdatePhone:Pe,resendEmailCode:Pe,resendSmsCode:Pe,initLoginWithHeadlessOAuth:Pe,loginWithHeadlessOAuth:Pe,crossAppAuthFlow:Pe,initLoginWithOAuth:Pe,recoveryOAuthFlow:Pe,loginWithOAuth:Pe,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Pe,initLoginWithPasskey:Pe,loginWithPasskey:Pe,initLinkWithPasskey:Pe,linkWithPasskey:Pe,refreshUser:Pe,loginWithGuestAccountFlow:Pe,walletProxy:null,createAnalyticsEvent:Pe,acceptTerms:Pe,getUsdTokenPrice:Pe,getUsdPriceForSol:Pe,recoverPrimaryWallet:Pe,updateWallets:Pe,fundWallet:Pe,openModal:Pe,setReadyToTrue:Pe,requestFarcasterSignerStatus:Pe,initLoginWithTelegram:Pe,loginWithTelegram:Pe,generateSiweMessage:Pe,generateSiweMessageForSmartWallet:Pe,linkWithSiwe:Pe,linkSmartWallet:Pe,delegateWallet:Pe,revokeDelegatedWallets:Pe,createEmbeddedSolanaWallet:Pe,exportSolanaWallet:Pe,solanaSignMessage:Pe,connectCoinbaseSmartWallet:Pe,initiateAccountTransfer:Pe,emailOtpState:{status:"initial"},setEmailOtpState:Pe,smsOtpState:{status:"initial"},setSmsOtpState:Pe,siweState:{status:"initial"},setSiweState:Pe,oAuthState:{status:"initial"},setOAuthState:Pe,isHeadlessOAuthLoading:!1}),_t=()=>_.useContext(lne);function vRe({src:t,...e}){return d.jsx("img",{src:t,...e,style:{display:"none"}})}var Ht,ye=((Ht={}).LANDING="LANDING",Ht.CONNECT_OR_CREATE="CONNECT_OR_CREATE",Ht.AWAITING_CONNECTION="AWAITING_CONNECTION",Ht.AWAITING_FARCASTER_CONNECTION="AWAITING_FARCASTER_CONNECTION",Ht.AWAITING_FARCASTER_SIGNER="AWAITING_FARCASTER_SIGNER",Ht.AWAITING_OAUTH_SCREEN="AWAITING_OAUTH_SCREEN",Ht.CROSS_APP_AUTH_SCREEN="CROSS_APP_AUTH_SCREEN",Ht.AWAITING_PASSWORDLESS_CODE="AWAITING_PASSWORDLESS_CODE",Ht.AWAITING_PASSKEY_SYSTEM_DIALOGUE="AWAITING_PASSKEY_SYSTEM_DIALOGUE",Ht.LINK_EMAIL_SCREEN="LINK_EMAIL_SCREEN",Ht.LINK_PHONE_SCREEN="LINK_PHONE_SCREEN",Ht.LINK_WALLET_SCREEN="LINK_WALLET_SCREEN",Ht.LINK_PASSKEY_SCREEN="LINK_PASSKEY_SCREEN",Ht.UPDATE_EMAIL_SCREEN="UPDATE_EMAIL_SCREEN",Ht.UPDATE_PHONE_SCREEN="UPDATE_PHONE_SCREEN",Ht.AWAITING_CONNECT_ONLY_CONNECTION="AWAITING_CONNECT_ONLY_CONNECTION",Ht.CONNECT_ONLY_LANDING_SCREEN="CONNECT_ONLY_LANDING_SCREEN",Ht.CONNECT_ONLY_AUTHENTICATED_SCREEN="CONNECT_ONLY_AUTHENTICATED_SCREEN",Ht.LOGIN_FAILED_SCREEN="LOGIN_FAILED_SCREEN",Ht.ALLOWLIST_REJECTION_SCREEN="ALLOWLIST_REJECTION_SCREEN",Ht.ACCOUNT_NOT_FOUND_SCREEN="ACCOUNT_NOT_FOUND_SCREEN",Ht.USER_LIMIT_REACHED_SCREEN="USER_LIMIT_REACHED_SCREEN",Ht.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN="EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN",Ht.EMBEDDED_WALLET_CREATED_SCREEN="EMBEDDED_WALLET_CREATED_SCREEN",Ht.EMBEDDED_WALLET_CONNECTING_SCREEN="EMBEDDED_WALLET_CONNECTING_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN="EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN",Ht.EMBEDDED_WALLET_KEY_EXPORT_SCREEN="EMBEDDED_WALLET_KEY_EXPORT_SCREEN",Ht.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",Ht.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN="EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN",Ht.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN="EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN="EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN",Ht.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN="EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN",Ht.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN="EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN",Ht.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN="EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN",Ht.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN="EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN",Ht.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN",Ht.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN="EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN",Ht.INSTALL_PHANTOM_SCREEN="INSTALL_PHANTOM_SCREEN",Ht.PHANTOM_INTERSTITIAL_SCREEN="PHANTOM_INTERSTITIAL_SCREEN",Ht.AFFIRMATIVE_CONSENT_SCREEN="AFFIRMATIVE_CONSENT_SCREEN",Ht.FUNDING_METHOD_SELECTION_SCREEN="FUNDING_METHOD_SELECTION_SCREEN",Ht.FUNDING_TRANSFER_FROM_WALLET_SCREEN="FUNDING_TRANSFER_FROM_WALLET_SCREEN",Ht.FUNDING_EDIT_AMOUNT_SCREEN="FUNDING_EDIT_AMOUNT_SCREEN",Ht.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN",Ht.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN="FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN",Ht.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN="FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN",Ht.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN="FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN",Ht.FUNDING_MANUAL_TRANSFER_SCREEN="FUNDING_MANUAL_TRANSFER_SCREEN",Ht.MOONPAY_STATUS_SCREEN="MOONPAY_STATUS_SCREEN",Ht.COINBASE_ONRAMP_STATUS_SCREEN="COINBASE_ONRAMP_STATUS_SCREEN",Ht.MFA_ENROLLMENT_FLOW_SCREEN="MFA_ENROLLMENT_FLOW_SCREEN",Ht.CAPTCHA_SCREEN="CAPTCHA_SCREEN",Ht.ERROR_SCREEN="ERROR_SCREEN",Ht.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE="IN_APP_BROWSER_LOGIN_NOT_POSSIBLE",Ht.TELEGRAM_AUTH_SCREEN="TELEGRAM_AUTH_SCREEN",Ht.LINK_CONFLICT_SCREEN="LINK_CONFLICT_SCREEN",Ht);const cne=_.createContext({ready:!1,app:one,currentScreen:null,lastScreen:null,navigate:Pe,navigateBack:Pe,resetNavigation:Pe,setModalData:Pe,onUserCloseViaDialogOrKeybindRef:void 0});let bRe=[ye.LANDING,ye.CONNECT_ONLY_LANDING_SCREEN,null];const xRe=t=>{var o;let e=Ai(),r=t.authenticated,[n,i]=_.useState(t.initialScreen);_.useEffect(()=>{r||bRe.includes(t.initialScreen)||t.setInitialScreen(null)},[r]);let a=_.useRef(null);_.useEffect(()=>{t.open||(a.current=null)},[t.open]),_.useEffect(()=>{a.current=null},[t.initialScreen]);let s={ready:!!e.id,app:e,data:t.data,setModalData:t.setModalData,currentScreen:t.initialScreen,lastScreen:n,navigate:(l,c=!0)=>{t.setInitialScreen(l),c&&i(t.initialScreen)},navigateBack:()=>{t.setInitialScreen(n)},resetNavigation:()=>{t.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:a};return d.jsxs(cne.Provider,{value:s,children:[(typeof e.appearance.logo=="string"||((o=e.appearance.logo)==null?void 0:o.type)==="img")&&d.jsx(vRe,{src:typeof e.appearance.logo=="string"?e.appearance.logo:e.appearance.logo.props.src}),t.children]})},wt=()=>_.useContext(cne),Om=_.createContext({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:Pe,login:Pe,connectOrCreateWallet:Pe,linkEmail:Pe,linkPhone:Pe,linkFarcaster:Pe,linkWallet:Pe,startCrossAppAuthFlow:Pe,linkGoogle:Pe,linkTwitter:Pe,linkDiscord:Pe,linkGithub:Pe,linkSpotify:Pe,linkInstagram:Pe,linkTelegram:Pe,linkTiktok:Pe,linkLinkedIn:Pe,linkApple:Pe,linkPasskey:Pe,updateEmail:Pe,updatePhone:Pe,logout:Pe,getAccessToken:Pe,getEthereumProvider:Pe,getEthersProvider:Pe,getWeb3jsProvider:Pe,unlinkEmail:Pe,unlinkPhone:Pe,unlinkWallet:Pe,unlinkGoogle:Pe,unlinkTwitter:Pe,unlinkDiscord:Pe,unlinkGithub:Pe,unlinkSpotify:Pe,unlinkInstagram:Pe,unlinkTiktok:Pe,unlinkLinkedIn:Pe,unlinkApple:Pe,unlinkCrossAppAccount:Pe,unlinkFarcaster:Pe,unlinkTelegram:Pe,unlinkPasskey:Pe,setActiveWallet:Pe,forkSession:Pe,createWallet:Pe,signMessage:Pe,signTypedData:Pe,enrollInMfa:Pe,initEnrollmentWithSms:Pe,initEnrollmentWithTotp:Pe,initEnrollmentWithPasskey:Pe,promptMfa:Pe,init:Pe,submitEnrollmentWithSms:Pe,submitEnrollmentWithTotp:Pe,submitEnrollmentWithPasskey:Pe,unenroll:Pe,submit:Pe,cancel:Pe,sendTransaction:Pe,sendSolanaTransaction:Pe,exportWallet:Pe,setWalletPassword:Pe,setWalletRecovery:Pe,requestFarcasterSignerFromWarpcast:Pe,getFarcasterSignerPublicKey:Pe,signFarcasterMessage:Pe,createGuestAccount:Pe,signMessageWithCrossAppWallet:Pe,signTypedDataWithCrossAppWallet:Pe,sendTransactionWithCrossAppWallet:Pe,isModalOpen:!1,mfaMethods:[]}),$r=()=>_.useContext(Om),ERe=t=>{let[e,r]=_.useState("auto");return _.useEffect(()=>{let n=new ResizeObserver(i=>{var a;r(((a=i[0])==null?void 0:a.contentRect.height)??"auto")});return t.current&&n.observe(t.current),()=>{t.current&&n.unobserve(t.current)}},[t.current]),e},_Re={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},sendSolanaTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},une=_.createContext(void 0);let dne=()=>_.useContext(une);function aj(t,e){if(!e)return;let r=dne().current[t];return _.useEffect(()=>{var n;for(let[i,a]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,i)||console.warn(`Invalid event type "${i}" for action "${t}"`),(n=r[i])==null||n.push(a);return()=>{var i;for(let[a,s]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,a)||console.warn(`Invalid event type "${a}" for action "${t}"`),r[a]=(i=r[a])==null?void 0:i.filter(o=>o!==s)}},[e])}function ze(t,e,r,...n){for(let i of t.current[e][r])i(...n)}function sj(){let t=dne();return(e,r,...n)=>ze(t,e,r,...n)}function CRe(t){aj("configureMfa",t)}function SRe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const R0=_.forwardRef(SRe),Ec=({success:t,fail:e})=>d.jsxs(d.Fragment,{children:[d.jsx(bl,{className:t?"success":e?"fail":""}),d.jsx(oj,{className:t?"success":e?"fail":""})]}),bl=fe.span.withConfig({displayName:"Loader",componentId:"sc-ce7792e2-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-success);border-bottom-color:var(--privy-color-success);}&&&.fail{border-color:var(--privy-color-error);border-bottom-color:var(--privy-color-error);}"],t=>t.color??"var(--privy-color-accent)"),oj=fe(bl).withConfig({displayName:"LoaderFaint",componentId:"sc-ce7792e2-1"})(["&&{border-bottom-color:",";animation:none;opacity:0.5;}"],t=>t.color??"var(--privy-color-accent)"),Mh=t=>d.jsx(ARe,{color:t.color||"var(--privy-color-foreground-3)"});let ARe=fe(bl).withConfig({displayName:"StyledButtonLoader",componentId:"sc-ce7792e2-2"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const Dx=fe.button.withConfig({displayName:"Button",componentId:"sc-e15d0508-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{padding:12px 16px;}"]),Ot=({children:t,loading:e,disabled:r,success:n,loadingText:i="Loading...",...a})=>d.jsx(fne,{disabled:e||r,success:n,...a,children:e?d.jsxs("span",{children:[d.jsx(Mh,{}),i?d.jsx("span",{children:i}):null]}):t}),Z3=({children:t,loading:e,disabled:r,...n})=>d.jsx(IRe,{disabled:r,...n,children:e?d.jsx(Mh,{color:"var(--privy-color-foreground-accent)"}):t});let IRe=fe(Dx).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-e15d0508-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;pointer-events:none;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent-dark);}"]);const MRe=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(fne,{as:"a",disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(Mh,{}),n?d.jsx("span",{children:n}):null]}):t});let fne=fe(Dx).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-e15d0508-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}"," > span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.warn?"var(--privy-color-error)":t.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)",t=>t.disabled?la(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;pointer-events:none;}"]):"");const Yd=({children:t,loading:e,disabled:r,loadingText:n="Loading...",...i})=>d.jsx(TRe,{disabled:e||r,...i,children:e?d.jsxs("span",{children:[d.jsx(Mh,{}),n?d.jsx("span",{children:n}):null]}):t});let TRe=fe(Dx).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-e15d0508-3"})(["&&{border-width:1px;border-color:",";color:var(--privy-color-foreground);transition:border-color 200ms ease;}&:hover,&:active{border-color:",";}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-3);cursor:not-allowed;}> span{display:flex;align-items:center;gap:8px;opacity:1;animation:fadein 200ms ease;}"],t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)",t=>t.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)");const lj=fe.button.withConfig({displayName:"SoftCtaButton",componentId:"sc-e15d0508-4"})(["&&{padding:12px 16px;font-weight:500;text-align:center;color:var(--privy-color-foreground-accent);background-color:var(--privy-color-accent);border-radius:var(--privy-border-radius-sm);min-width:144px;opacity:",";transition:opacity 200ms ease,background-color 200ms ease,color 200ms ease;user-select:none;"," &:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.invisible?"0":"1",t=>t.invisible&&la(["pointer-events:none;"])),cj=({children:t,onClick:e,disabled:r,isSubmitting:n,...i})=>d.jsxs(kRe,{$isSubmitting:n,onClick:e,disabled:r,...i,children:[d.jsx("span",{children:t}),d.jsx("span",{children:d.jsx(Mh,{})})]});let kRe=fe.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-e15d0508-6"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-3);cursor:not-allowed;}}"],t=>t.$isSubmitting?0:1,t=>t.$isSubmitting?1:0);const hne=fe.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");function NRe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const LRe=_.forwardRef(NRe);function jRe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const $Re=_.forwardRef(jRe);function PRe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const RRe=_.forwardRef(PRe),pne=({backFn:t})=>d.jsx("div",{children:d.jsx(Ox,{onClick:t,children:d.jsx(LRe,{height:"16px",width:"16px",strokeWidth:2})})}),DRe=({nextFn:t})=>d.jsx("div",{children:d.jsx(Ox,{onClick:t,children:d.jsx($Re,{height:"16px",width:"16px",strokeWidth:2})})}),ORe=({infoFn:t})=>d.jsx("div",{children:d.jsx(URe,{"aria-label":"info",onClick:t,children:d.jsx(R0,{height:"22px",width:"22px",strokeWidth:2})})}),FRe=t=>d.jsx("div",{children:d.jsx(Ox,{"aria-label":"close modal",onClick:t.onClose,children:d.jsx(RRe,{height:"16px",width:"16px",strokeWidth:2})})}),ft=({backFn:t,infoFn:e,onClose:r,title:n,closeable:i=!0})=>{let{closePrivyModal:a}=_t(),s=Ai();return d.jsxs(BRe,{children:[d.jsxs(zRe,{children:[t&&d.jsx(pne,{backFn:t}),e&&d.jsx(ORe,{infoFn:e})]}),n&&d.jsx(HRe,{id:"privy-dialog-title",children:n}),d.jsx(WRe,{children:!s.render.standalone&&i&&d.jsx(FRe,{onClose:r||(()=>a())})})]})};let Ox=fe.button.withConfig({displayName:"StyledButton",componentId:"sc-f295093d-0"})(["&&{cursor:pointer;display:flex;opacity:0.6;background-color:var(--privy-color-background-2);border-radius:var(--privy-border-radius-full);padding:4px;> svg{margin:auto;color:var(--privy-color-foreground);}:hover{opacity:1;}}"]),URe=fe(Ox).withConfig({displayName:"TransparentStyledButton",componentId:"sc-f295093d-1"})(["&&{background-color:transparent;}"]),BRe=fe.div.withConfig({displayName:"StyledHeader",componentId:"sc-f295093d-2"})(["padding:16px 0;display:flex;align-items:center;justify-content:space-between;h2{font-size:16px;line-height:24px;font-weight:600;color:var(--privy-color-foreground);}"]),zRe=fe.div.withConfig({displayName:"LeftActionContainer",componentId:"sc-f295093d-3"})(["flex:1;align-items:center;display:flex;gap:8px;"]),WRe=fe.div.withConfig({displayName:"RightActionContainer",componentId:"sc-f295093d-4"})(["flex:1;display:flex;justify-content:flex-end;"]),HRe=fe.div.withConfig({displayName:"TitleContainer",componentId:"sc-f295093d-5"})(["overflow:hidden;white-space:nowrap;max-width:100%;text-overflow:ellipsis;text-align:center;color:var(--privy-color-foreground-2);"]),Js=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-f7e7d474-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const dh=fe.div.withConfig({displayName:"Grow",componentId:"sc-b51c7c74-0"})(["text-align:left;flex-grow:1;"]),gne=fe.div.withConfig({displayName:"AlignBottom",componentId:"sc-b51c7c74-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),fh=fe.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-b51c7c74-2"})(["display:flex;flex-direction:column;gap:12px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),GRe=fe(fh).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-b51c7c74-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],t=>t.$colorScheme==="light"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":t.$colorScheme==="dark"?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0);let mne=la(["&&{width:100%;font-size:16px;line-height:24px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;padding:12px 16px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-mdlg);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}svg{height:24px;max-height:24px;max-width:24px;}}"]);const yne=fe.div.withConfig({displayName:"Subtitle",componentId:"sc-b51c7c74-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Jn=fe.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-b51c7c74-5"})(["",""],mne),Ez=fe.a.withConfig({displayName:"LoginMethodButtonLink",componentId:"sc-b51c7c74-6"})(["",""],mne),i1=fe.div.withConfig({displayName:"Hide",componentId:"sc-b51c7c74-7"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],t=>t.$if?"display: none;":""),qRe=fe.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-b51c7c74-8"})(["width:100%;height:100%;padding:",";"],t=>t.$withPadding?"64px 0px":"0px"),VRe=fe.div.withConfig({displayName:"Header",componentId:"sc-b51c7c74-9"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),YRe=()=>{let{navigate:t,app:e}=wt();return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(KRe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(hne,{color:"var(--privy-color-warn-light)"}),d.jsx(R0,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),d.jsxs(JRe,{children:[d.jsx("h3",{children:"Account not found"}),d.jsxs("p",{children:["Please try logging in again or go to ",e.name," to create an account."]})]}),d.jsx(dh,{}),d.jsx(Ot,{onClick:()=>t(ye.LANDING),children:"Try logging in again"})]})]})};let KRe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-408d3d00-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;margin-top:24px;"]),JRe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-408d3d00-1"})(["display:flex;flex-direction:column;gap:8px;"]);function QRe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const rf=_.forwardRef(QRe);function ZRe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))}const ov=_.forwardRef(ZRe),uj=fe.span.withConfig({displayName:"CircleBorder",componentId:"sc-9056b8b8-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;border-bottom-color:",";}"],t=>t.color??"var(--privy-color-accent)",t=>t.color??"var(--privy-color-accent)");function XRe(t){return d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...t,children:d.jsx("g",{fill:t.color||"var(--privy-color-foreground)",children:d.jsx("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let _z=fe.div.withConfig({displayName:"TermsAndConditionsContainer",componentId:"sc-c97bf02f-0"})(["margin-top:16px;font-size:13px;text-align:center;color:var(--privy-color-foreground-3);&& > a{color:var(--privy-color-accent);}"]);function dj(t){let{legal:{privacyPolicyUrl:e,termsAndConditionsUrl:r,requireUsersAcceptTerms:n}}=t.app;if(n&&!t.alwaysShowImplicitConsent||!r&&!e)return d.jsx(_z,{});let i=!(!e||!r);return d.jsxs(_z,{children:["By logging in I agree to the"," ",r&&d.jsx("a",{href:r,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",e&&d.jsx("a",{href:e,target:"_blank",children:"Privacy Policy"})]})}const Qt=()=>d.jsx(kr,{children:d.jsx("a",{href:"https://www.privy.io/",target:"_blank",children:d.jsx(XRe,{height:13,width:150})})}),kr=fe.div.withConfig({displayName:"ModalFooter",componentId:"sc-c97bf02f-1"})(["display:flex;align-items:center;justify-content:center;padding-top:8px;padding-bottom:12px;gap:8px;font-size:13px;&& a{padding:0.5rem 0;&:hover{text-decoration:none;}}@media all and (display-mode:standalone){padding-bottom:30px;}"]);function eDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const tDe=_.forwardRef(eDe);function rDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"}))}const wne=_.forwardRef(rDe),bo=({address:t,showCopyIcon:e,url:r,className:n})=>{let[i,a]=_.useState(!1);return _.useEffect(()=>{if(i){let s=setTimeout(()=>a(!1),2e3);return()=>clearTimeout(s)}},[i]),r?d.jsx("a",{title:t,className:n,href:`${r}/address/${t}`,target:"_blank",children:as(t)}):d.jsxs("button",{title:t,className:n,onClick:s=>(s.stopPropagation(),navigator.clipboard.writeText(t).then(()=>a(!0)).catch(console.error)),children:[as(t),e&&d.jsx(i?iDe:nDe,{})]})};let nDe=fe(wne).withConfig({displayName:"StyledSquare2StackIcon",componentId:"sc-6eaa0c94-0"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-foreground-3);"]),iDe=fe(tDe).withConfig({displayName:"StyledCheckIcon",componentId:"sc-6eaa0c94-1"})(["&&{display:inline;}stroke-width:2;height:0.875rem;width:0.875rem;margin-left:0.125rem;color:var(--privy-color-success);"]);function vne(t){return t.charAt(0).toUpperCase()+t.slice(1)}const bne=({onTransfer:t,isTransferring:e,transferSuccess:r})=>d.jsx(Ot,{...r?{success:!0,children:"Success!"}:{warn:!0,loading:e,onClick:t,children:"Transfer and delete account"}});function aDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const Fx=_.forwardRef(aDe),xne=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-aa2e65ff-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:100%;padding-bottom:16px;"]),aT=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-aa2e65ff-1"})(["display:flex;flex-direction:column;&& p{font-size:14px;}width:100%;gap:16px;"]),Ene=fe.div.withConfig({displayName:"DisclosedAccountContainer",componentId:"sc-aa2e65ff-2"})(["display:flex;cursor:pointer;align-items:center;width:100%;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);padding:8px 10px;font-size:14px;font-weight:500;gap:8px;"]),_ne=fe(Fx).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-aa2e65ff-3"})(["position:relative;width:",";height:",";color:var(--privy-color-foreground-3);margin-left:auto;"],t=>`${t.iconSize}px`,t=>`${t.iconSize}px`),sDe=fe(wne).withConfig({displayName:"StyledCopyIcon",componentId:"sc-aa2e65ff-4"})(["position:relative;width:15px;height:15px;color:var(--privy-color-foreground-3);margin-left:auto;"]),oDe=fe.ol.withConfig({displayName:"ListContainer",componentId:"sc-aa2e65ff-5"})(["display:flex;flex-direction:column;font-size:14px;width:100%;text-align:left;"]),Cz=fe.li.withConfig({displayName:"ListItem",componentId:"sc-aa2e65ff-6"})(["font-size:14px;list-style-type:auto;list-style-position:outside;margin-left:1rem;margin-bottom:0.5rem;&:last-child{margin-bottom:0;}"]),lDe=fe.div.withConfig({displayName:"CircleContainer",componentId:"sc-aa2e65ff-7"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]);let cDe=()=>d.jsx(lDe,{children:d.jsx(_ne,{iconSize:60})});const uDe=({address:t,onClose:e,onRetry:r,onTransfer:n,isTransferring:i,transferSuccess:a})=>{var l;let{defaultChain:s}=Ai(),o=((l=s.blockExplorers)==null?void 0:l.default.url)??"https://etherscan.io";return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:e,backFn:r}),d.jsxs(xne,{children:[d.jsx(cDe,{}),d.jsxs(aT,{children:[d.jsx("h3",{children:"Check account assets before transferring"}),d.jsx("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),d.jsxs(oDe,{children:[d.jsx("p",{children:" To check your balance, you can:"}),d.jsx(Cz,{children:"Log out and log back into the other account, or "}),d.jsxs(Cz,{children:["Copy your wallet address and use a"," ",d.jsx("u",{children:d.jsx("a",{target:"_blank",href:o,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),d.jsxs(Ene,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[d.jsx(ov,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(bo,{address:t,showCopyIcon:!1}),d.jsx(sDe,{})]}),d.jsx(bne,{onTransfer:n,isTransferring:i,transferSuccess:a})]})]}),d.jsx(Qt,{})]})},dDe=()=>{let{initiateAccountTransfer:t,closePrivyModal:e}=_t(),{data:r,navigate:n,lastScreen:i,setModalData:a}=wt(),[s,o]=_.useState(void 0),[l,c]=_.useState(!1),[u,f]=_.useState(!1),h=async()=>{var g,m,w,C,v,b,A,S,j;try{if(!((g=r==null?void 0:r.accountTransfer)!=null&&g.nonce)||!((m=r==null?void 0:r.accountTransfer)!=null&&m.account))throw Error("missing account transfer inputs");f(!0),await t({nonce:(w=r==null?void 0:r.accountTransfer)==null?void 0:w.nonce,account:(C=r==null?void 0:r.accountTransfer)==null?void 0:C.account,accountType:(v=r==null?void 0:r.accountTransfer)==null?void 0:v.linkMethod,externalWalletMetadata:(b=r==null?void 0:r.accountTransfer)==null?void 0:b.externalWalletMetadata,telegramAuthResult:(A=r==null?void 0:r.accountTransfer)==null?void 0:A.telegramAuthResult,farcasterEmbeddedAddress:(S=r==null?void 0:r.accountTransfer)==null?void 0:S.farcasterEmbeddedAddress,oAuthUserInfo:(j=r==null?void 0:r.accountTransfer)==null?void 0:j.oAuthUserInfo}),c(!0),f(!1),setTimeout(e,1e3)}catch(F){a({errorModalData:{error:F,previousScreen:i||ye.LINK_CONFLICT_SCREEN}}),n(ye.ERROR_SCREEN,!0)}};return s?d.jsx(uDe,{address:s,onClose:e,onRetry:()=>o(void 0),onTransfer:h,isTransferring:u,transferSuccess:l}):d.jsx(fDe,{onClose:e,onInfo:()=>{var g;return o((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onContinue:()=>{var g;return o((g=r==null?void 0:r.accountTransfer)==null?void 0:g.embeddedWalletAddress)},onTransfer:h,isTransferring:u,transferSuccess:l,data:r})},fDe=({onClose:t,onContinue:e,onInfo:r,onTransfer:n,transferSuccess:i,isTransferring:a,data:s})=>{var l,c,u,f,h,g,m;if(!((l=s==null?void 0:s.accountTransfer)!=null&&l.linkMethod)||!((c=s==null?void 0:s.accountTransfer)!=null&&c.displayName))return;let o={method:(u=s==null?void 0:s.accountTransfer)==null?void 0:u.linkMethod,handle:(f=s==null?void 0:s.accountTransfer)==null?void 0:f.displayName,disclosedAccount:(h=s==null?void 0:s.accountTransfer)!=null&&h.embeddedWalletAddress?{type:"wallet",handle:(g=s==null?void 0:s.accountTransfer)==null?void 0:g.embeddedWalletAddress}:void 0};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!0}),d.jsxs(xne,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(uj,{color:"var(--privy-color-error)"}),d.jsx(rf,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),d.jsxs(aT,{children:[d.jsxs("h3",{children:[function(w){switch(w){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"twitter":case"telegram":case"farcaster":return`${vne(w.replace("_oauth",""))} profile`;default:return w}}(o.method)," is associated with another account"]}),d.jsxs("p",{children:["Do you want to transfer",d.jsx("b",{children:o.handle?` ${o.handle}`:""})," to this account instead? This will delete your other account."]}),d.jsx(hDe,{onClick:r,disclosedAccount:o.disclosedAccount})]}),d.jsxs(aT,{style:{gap:12,marginTop:12},children:[(m=s==null?void 0:s.accountTransfer)!=null&&m.embeddedWalletAddress?d.jsx(Ot,{onClick:e,children:"Continue"}):d.jsx(bne,{onTransfer:n,transferSuccess:i,isTransferring:a}),d.jsx(Yd,{onClick:t,children:"No thanks"})]})]}),d.jsx(Qt,{})]})};function hDe({disclosedAccount:t,onClick:e}){return t?d.jsxs(Ene,{onClick:e,children:[d.jsx(ov,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),d.jsx(bo,{address:t.handle,showCopyIcon:!1}),d.jsx(_ne,{iconSize:15})]}):null}function pDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const sT=_.forwardRef(pDe);function gDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{fillRule:"evenodd",d:"M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}),_.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))}const mDe=_.forwardRef(gDe),Ux=fe.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-a63b1990-0"})(["display:flex;flex-direction:column;align-items:center;padding:0px 0px 30px;@media (max-width:440px){padding:10px 10px 20px;}"]),hn=fe.div.withConfig({displayName:"Title",componentId:"sc-a63b1990-1"})(["font-size:18px;line-height:30px;text-align:center;font-weight:600;margin-bottom:10px;"]),pn=fe.div.withConfig({displayName:"SubTitle",componentId:"sc-a63b1990-2"})(["font-size:0.875rem;text-align:center;"]),a1=fe.div.withConfig({displayName:"Container",componentId:"sc-a63b1990-3"})(["display:flex;flex-direction:column;align-items:center;gap:10px;flex-grow:1;padding:20px 0;@media (max-width:440px){padding:10px 10px 20px;}"]),Bx=fe.div.withConfig({displayName:"List",componentId:"sc-a63b1990-4"})(["display:flex;flex-direction:column;align-items:stretch;gap:0.75rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),yu=fe.div.withConfig({displayName:"ListItemIcon",componentId:"sc-a63b1990-5"})(["width:25px;display:flex;align-items:center;justify-content:flex-start;> svg{z-index:2;height:25px !important;width:25px !important;color:var(--privy-color-accent);}"]),wu=fe.div.withConfig({displayName:"ListItem",componentId:"sc-a63b1990-6"})(["display:flex;align-items:center;gap:10px;font-size:0.875rem;line-height:1rem;text-align:left;"]),nc=fe.div.withConfig({displayName:"BottomSection",componentId:"sc-a63b1990-7"})(["display:flex;flex-direction:column;gap:10px;padding-top:20px;"]),Cne=fe.div.withConfig({displayName:"MethodList",componentId:"sc-a63b1990-8"})(["display:flex;flex-direction:column;align-items:stretch;gap:1rem;padding:1rem 0rem 0rem;flex-grow:1;width:100%;"]),fS=fe.div.withConfig({displayName:"MethodListItem",componentId:"sc-a63b1990-9"})(["display:flex;gap:5px;width:100%;position:relative;"]),hS=fe.button.withConfig({displayName:"RemoveMethodButton",componentId:"sc-a63b1990-10"})(["&&{background-color:transparent;color:var(--privy-color-foreground-3);padding:0 0.75rem;display:flex;align-items:center;height:100%;> svg{z-index:2;height:20px !important;width:20px !important;}}&&:hover{color:var(--privy-color-error);}"]),pS=fe.div.withConfig({displayName:"MethodText",componentId:"sc-a63b1990-11"})(["display:flex;align-items:center;gap:0.5rem;> svg{z-index:2;height:20px !important;width:20px !important;}"]),gS=fe.div.withConfig({displayName:"ExtraText",componentId:"sc-a63b1990-12"})(["display:flex;align-items:center;gap:6px;font-weight:400 !important;color:",";> svg{z-index:2;height:18px !important;width:18px !important;display:flex !important;align-items:flex-end;}"],t=>t.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)"),mS=fe.div.withConfig({displayName:"SmsInsecureText",componentId:"sc-a63b1990-13"})(["width:100%;display:flex;justify-content:space-between;"]),yDe=fe.p.withConfig({displayName:"TermsText",componentId:"sc-a63b1990-14"})(["text-align:left;width:100%;color:var(--privy-color-foreground-3) !important;"]),oT=fe.button.withConfig({displayName:"PrimaryTextButton",componentId:"sc-a63b1990-15"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:100%;cursor:pointer;border-radius:var(--privy-border-radius-md);font-size:0.875rem;line-height:1rem;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{color:",";background-color:transparent;padding:0.5rem 0px;}&:hover{text-decoration:underline;}"],t=>t.theme==="dark"?"var(--privy-color-foreground-2)":"var(--privy-color-accent)"),Da=fe.div.withConfig({displayName:"IconWrapper",componentId:"sc-a63b1990-16"})(["display:flex;align-items:center;justify-content:center;color:var(--privy-color-accent);width:100%;> svg{z-index:2;width:3rem;height:3rem;}"]),Sne=fe.div.withConfig({displayName:"ErrorMessage",componentId:"sc-a63b1990-17"})(["color:var(--privy-color-error);"]),wDe=()=>{let{user:t,logout:e}=$r(),{app:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:i,navigate:a}=wt(),{acceptTerms:s,closePrivyModal:o,createAnalyticsEvent:l}=_t(),c=u=>{u==null||u.preventDefault(),o({shouldCallAuthOnSuccess:!1}),e()};return n.current=c,d.jsx(vDe,{termsAndConditionsUrl:r==null?void 0:r.legal.termsAndConditionsUrl,privacyPolicyUrl:r==null?void 0:r.legal.privacyPolicyUrl,onAccept:async u=>{var f;u.preventDefault(),await s(),t&&Hd(t,(f=r==null?void 0:r.embeddedWallets)==null?void 0:f.createOnLogin)?(i({createWallet:{onSuccess:()=>{},onFailure:h=>{console.error(h),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:h,screen:"AffirmativeConsentScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):o()},onDecline:c})},vDe=({termsAndConditionsUrl:t,privacyPolicyUrl:e,onAccept:r,onDecline:n})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(mDe,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24},children:"One last step"}),d.jsx(pn,{children:"By signing up, you agree to our terms and privacy policy."}),d.jsxs(fh,{style:{marginTop:24},children:[t&&d.jsxs(Ez,{target:"_blank",href:t,children:["View Terms ",d.jsx(sT,{style:{marginLeft:"auto"}})]}),e&&d.jsxs(Ez,{target:"_blank",href:e,children:["View Privacy Policy ",d.jsx(sT,{style:{marginLeft:"auto"}})]})]}),d.jsxs(bDe,{style:{marginTop:24},children:[d.jsx(Yd,{onClick:n,children:"No thanks"}),d.jsx(Ot,{onClick:r,children:"Accept"})]}),d.jsx(Qt,{})]});let bDe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-4aff18c8-0"})(["display:flex;gap:10px;"]);const Ane=({style:t,...e})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...e,children:d.jsx("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})}),xDe=()=>{let{navigate:t,app:e}=wt(),r=(e==null?void 0:e.allowlistConfig.errorTitle)||"You don't have access to this app",n=(e==null?void 0:e.allowlistConfig.errorDetail)||"Have you been invited?",i=(e==null?void 0:e.allowlistConfig.errorCtaText)||"Try another account";return d.jsxs(d.Fragment,{children:[d.jsx(ft,{}),d.jsxs(EDe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(uj,{}),d.jsx(Ane,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),d.jsxs(_De,{children:[d.jsx(typeof r=="string"?"h3":d.Fragment,{children:r}),d.jsx(typeof n=="string"?"p":d.Fragment,{children:n})]}),e!=null&&e.allowlistConfig.errorCtaLink?d.jsx(Ot,{as:"a",href:e.allowlistConfig.errorCtaLink,children:i}):d.jsx(Ot,{onClick:()=>{t(ye.LANDING)},children:i})]})]})};let EDe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-ed4ecf-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),_De=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-ed4ecf-1"})(["display:flex;flex-direction:column;gap:8px;"]);function CDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const SDe=_.forwardRef(CDe);function ADe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}))}const k1=_.forwardRef(ADe);function IDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"}))}const _c=_.forwardRef(IDe),N1=fe.div.withConfig({displayName:"BottomPusherContainer",componentId:"sc-cb963810-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-end;margin-top:auto;gap:16px;flex-grow:100;"]),Cc=fe.div.withConfig({displayName:"CenteredItem",componentId:"sc-cb963810-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;flex-grow:1;width:100%;"]),fj=fe.div.withConfig({displayName:"HorizontallyCenteredItem",componentId:"sc-cb963810-2"})(["display:flex;flex-direction:column;align-items:center;width:100%;"]),hj=fe(Cc).withConfig({displayName:"CenteredItemWithPadding",componentId:"sc-cb963810-3"})(["padding:20px 0;"]),nf=fe(Cc).withConfig({displayName:"CenteredItemWithGap",componentId:"sc-cb963810-4"})(["gap:16px;"]),zx=fe.div.withConfig({displayName:"FlexContainer",componentId:"sc-cb963810-5"})(["display:flex;flex-direction:column;width:100%;"]),To=fe.div.withConfig({displayName:"FixedGappedContainer",componentId:"sc-cb963810-6"})(["display:flex;flex-direction:column;gap:8px;"]),MDe=fe.div.withConfig({displayName:"StyledCalloutSection",componentId:"sc-cb963810-8"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;padding:16px;margin-top:16px;margin-bottom:16px;width:100%;background:var(--privy-color-background-2);border-radius:var(--privy-border-radius-md);&& h4{color:var(--privy-color-foreground-3);font-size:14px;text-decoration:underline;font-weight:medium;}&& p{color:var(--privy-color-foreground-3);font-size:14px;}"]),tn=fe.div.withConfig({displayName:"RefactorSpacerTop",componentId:"sc-cb963810-9"})(["height:16px;"]),an=fe.div.withConfig({displayName:"RefactorSpacerBottom",componentId:"sc-cb963810-10"})(["height:12px;"]),TDe=fe.div.withConfig({displayName:"RelativeContainer",componentId:"sc-cb963810-11"})(["position:relative;"]),pj=fe.div.withConfig({displayName:"ConfigurableSpacer",componentId:"sc-cb963810-12"})(["height:","px;"],t=>t.height??"12"),kDe=fe.div.withConfig({displayName:"Circle",componentId:"sc-cb963810-13"})(["background-color:var(--privy-color-accent);display:flex;justify-content:center;align-items:center;border-radius:50%;border-color:white;border-width:2px !important;"]),Wx=({title:t,description:e,children:r,...n})=>d.jsx(Ine,{...n,children:d.jsxs(d.Fragment,{children:[d.jsx("h3",{children:t}),typeof e=="string"?d.jsx("p",{children:e}):e,r]})}),lv=fe(Wx).withConfig({displayName:"PaddedScreenHeader",componentId:"sc-523a75d6-0"})(["margin-bottom:24px;"]),zn=({title:t,description:e,icon:r,children:n,...i})=>d.jsxs(NDe,{...i,children:[r||null,d.jsx("h3",{children:t}),e&&typeof e=="string"?d.jsx("p",{children:e}):e,n]});let Ine=fe.div.withConfig({displayName:"StyledSection",componentId:"sc-523a75d6-1"})(["display:flex;flex-direction:column;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;width:100%;margin-bottom:24px;&& h3{font-size:17px;color:var(--privy-color-foreground);}&& p{color:var(--privy-color-foreground-2);font-size:14px;}"]),NDe=fe(Ine).withConfig({displayName:"CenteredStyledSection",componentId:"sc-523a75d6-2"})(["align-items:center;text-align:center;gap:16px;h3{margin-bottom:24px;}"]),Sz=Array(6).fill("");var z2,W2,LDe=((z2=LDe||{})[z2.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",z2[z2.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",z2),jDe=((W2=jDe||{})[W2.EMAIL=0]="EMAIL",W2[W2.SMS=1]="SMS",W2);const $De=()=>{var E,L,O;let{app:t,navigate:e,lastScreen:r,navigateBack:n,setModalData:i,onUserCloseViaDialogOrKeybindRef:a}=wt(),{closePrivyModal:s,resendEmailCode:o,resendSmsCode:l,getAuthMeta:c,loginWithCode:u,updateWallets:f,createAnalyticsEvent:h}=_t(),{authenticated:g,logout:m,user:w}=$r(),[C,v]=_.useState(Sz),[b,A]=_.useState(!1),[S,j]=_.useState(null),[F,I]=_.useState(null),[B,V]=_.useState(0);a.current=()=>null;let se=(E=c())!=null&&E.email?0:1,Y=Dn-500;_.useEffect(()=>{if(B){let P=setTimeout(()=>{V(B-1)},1e3);return()=>clearTimeout(P)}},[B]),_.useEffect(()=>{var P;if(g&&b&&w){if(t!=null&&t.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let R=setTimeout(()=>{e(ye.AFFIRMATIVE_CONSENT_SCREEN)},Y);return()=>clearTimeout(R)}if(Hd(w,(P=t==null?void 0:t.embeddedWallets)==null?void 0:P.createOnLogin)){let R=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:M=>{console.error(M),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:M,screen:"AwaitingPasswordlessCodeScreen"}}),m()},callAuthOnSuccessOnClose:!0}}),e(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Y);return()=>clearTimeout(R)}{f();let R=setTimeout(()=>s({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn);return()=>clearTimeout(R)}}},[g,b,w]),_.useEffect(()=>{if(S&&F===0){let P=setTimeout(()=>{v(Sz),j(null);let R=document.querySelector("input[name=code-0]");R==null||R.focus()},1400);return()=>clearTimeout(P)}},[S]);let N=P=>{var le;P.preventDefault();let R=P.currentTarget.value.replace(" ","");if(R==="")return;if(isNaN(Number(R)))return j("Code should be numeric"),void I(1);j(null),I(null);let M=Number((le=P.currentTarget.name)==null?void 0:le.charAt(5)),D=[...R||[""]].slice(0,6-M),$=[...C.slice(0,M),...D,...C.slice(M+D.length)];v($);let X=Math.min(Math.max(M+D.length,0),5);if(!isNaN(Number(P.currentTarget.value))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.focus()}if($.every(H=>H&&!isNaN(+H))){let H=document.querySelector(`input[name=code-${X}]`);H==null||H.blur(),u($.join("")).then(()=>A(!0)).catch(ee=>{var J,te,re,z,G,Q,me,be,Ce,Fe,Ue,Ke;if(ee instanceof sl&&ee.privyErrorCode===Ae.INVALID_CREDENTIALS)j("Invalid or expired verification code");else if(ee instanceof sl&&ee.privyErrorCode===Ae.CANNOT_LINK_MORE_OF_TYPE)j(ee.message);else{if(ee instanceof sl&&ee.privyErrorCode===Ae.USER_LIMIT_REACHED)return console.error(new Vw(ee).toString()),void e(ye.USER_LIMIT_REACHED_SCREEN);if(ee instanceof sl&&ee.privyErrorCode===Ae.USER_DOES_NOT_EXIST)return void e(ye.ACCOUNT_NOT_FOUND_SCREEN);if(ee instanceof sl&&ee.privyErrorCode===Ae.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:ee,previousScreen:r??ye.AWAITING_PASSWORDLESS_CODE}}),void e(ye.ERROR_SCREEN,!1);if(ee instanceof sl&&ee.privyErrorCode===Ae.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:ee}}),void e(ye.CONNECT_OR_CREATE,!1);if(ee instanceof sl&&ee.privyErrorCode===Ae.ACCOUNT_TRANSFER_REQUIRED&&((te=(J=ee.data)==null?void 0:J.data)!=null&&te.nonce))return i({accountTransfer:{nonce:(z=(re=ee.data)==null?void 0:re.data)==null?void 0:z.nonce,account:se===0?(G=c())==null?void 0:G.email:(Q=c())==null?void 0:Q.phoneNumber,displayName:(Ce=(be=(me=ee.data)==null?void 0:me.data)==null?void 0:be.account)==null?void 0:Ce.displayName,linkMethod:se===0?"email":"sms",embeddedWalletAddress:(Ke=(Ue=(Fe=ee.data)==null?void 0:Fe.data)==null?void 0:Ue.otherUser)==null?void 0:Ke.embeddedWalletAddress}}),void e(ye.LINK_CONFLICT_SCREEN);j("Issue verifying code")}I(0)})}},k=se==0?d.jsx(k1,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):d.jsx(_c,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),x=d.jsxs("p",se==0?{children:["Please check ",d.jsx(Az,{children:(L=c())==null?void 0:L.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",d.jsx(Az,{children:(O=c())==null?void 0:O.phoneNumber})," for a message from ",(t==null?void 0:t.name)||"Privy"," and enter your code below."]});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:()=>n()},"header"),d.jsxs(PDe,{children:[d.jsx(zn,{title:"Enter confirmation code",description:x,icon:k}),d.jsxs(fj,{children:[d.jsxs(RDe,{children:[d.jsx(DDe,{$fail:!!S,$success:b,children:d.jsx("span",{children:S||(b?"Success!":"")})}),d.jsx("div",{children:C.map((P,R)=>d.jsx("input",{name:`code-${R}`,type:"text",value:C[R],onChange:N,onKeyUp:M=>{M.key==="Backspace"&&(D=>{if(F===1&&(j(null),I(null)),v([...C.slice(0,D),"",...C.slice(D+1)]),D>0){let $=document.querySelector(`input[name=code-${D-1}]`);$==null||$.focus()}})(R)},inputMode:"numeric",autoFocus:R===0,pattern:"[0-9]",className:`${b?"success":""} ${S?"fail":""}`,autoComplete:ya?"one-time-code":"off"},R))})]}),d.jsxs(ODe,{children:[d.jsxs("span",{children:["Didn't get ",se==0?"an email":"a message","?"]}),B?d.jsxs(UDe,{children:[d.jsx(SDe,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),d.jsx("span",{children:"Code sent"})]}):d.jsx(FDe,{children:d.jsx("button",{onClick:async()=>{V(30),se==0?await o():await l()},children:"Resend code"})})]})]})]}),d.jsx(Qt,{})]})};let PDe=fe.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-463c12b2-0"})(["display:flex;flex-direction:column;align-items:flex-start;justify-content:center;margin:auto;gap:16px;flex-grow:1;"]),RDe=fe.div.withConfig({displayName:"CodeInput",componentId:"sc-463c12b2-1"})(["display:flex;flex-direction:column;width:100%;gap:8px;> div:last-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-md);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);padding:8px 10px;height:58px;width:46px;text-align:center;font-size:18px;}> input:focus{border:1px solid var(--privy-color-accent);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-success);}> input.fail{border:1px solid var(--privy-color-error);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),DDe=fe.div.withConfig({displayName:"InputHelp",componentId:"sc-463c12b2-2"})(["line-height:20px;height:20px;font-size:13px;color:",";display:flex;justify-content:flex-end;width:100%;"],t=>t.$success?"var(--privy-color-success)":t.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"),ODe=fe.div.withConfig({displayName:"HelpText",componentId:"sc-463c12b2-3"})(["font-size:13px;color:var(--privy-color-foreground);display:flex;gap:8px;align-items:center;width:100%;margin-top:16px;padding-bottom:32px;"]),FDe=fe.div.withConfig({displayName:"ResendButtonContainer",componentId:"sc-463c12b2-4"})(["color:var(--privy-color-accent);padding:2px 0;> button{text-decoration:underline;}"]),UDe=fe.div.withConfig({displayName:"Badge",componentId:"sc-463c12b2-5"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),Az=fe.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-463c12b2-6"})(["font-weight:500;word-break:break-all;"]);function BDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))}const s1=_.forwardRef(BDe);function zDe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))}const Hx=_.forwardRef(zDe),WDe=({icon:t})=>d.jsx(d.Fragment,{children:d.jsx(HDe,{children:d.jsxs("div",{children:[d.jsx(Ec,{}),typeof t=="string"?d.jsx("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t?d.jsx(t,{style:{width:"38px",height:"38px"}}):d.jsx("span",{})]})})});let HDe=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-26c1d9b9-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const GDe=()=>{let{lastScreen:t,currentScreen:e,data:r,navigateBack:n,navigate:i,setModalData:a}=wt(),{status:s,token:o,waitForResult:l,reset:c,execute:u}=Ro(),f=_.useRef([]),h=N=>{f.current=[N,...f.current]},[g,m]=_.useState(!0);_.useEffect(()=>(h(setTimeout(m,1e3,!1)),()=>{f.current.forEach(N=>clearTimeout(N)),f.current=[]}),[]);let[w,C]=_.useState(""),[v,b]=_.useState("Checking that you are a human..."),[A,S]=_.useState(d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Continue"})),[j,F]=_.useState(!1),[I,B]=_.useState(3),V=r==null?void 0:r.captchaModalData,se=async N=>{try{await(V==null?void 0:V.callback(N)),V!=null&&V.onSuccessNavigateTo&&i(V==null?void 0:V.onSuccessNavigateTo,!1)}catch(k){if(k instanceof tx)return;a({errorModalData:{error:k,previousScreen:t||ye.LANDING}}),i((V==null?void 0:V.onErrorNavigateTo)||ye.ERROR_SCREEN,!1)}};_.useEffect(()=>{s==="success"?h(setTimeout(async()=>{let N=await l();!N||V!=null&&V.userIntentRequired||se(N)},1e3)):s==="ready"&&h(setTimeout(()=>{s==="ready"&&u()},500))},[s]),_.useEffect(()=>{if(!g)switch(s){case"success":C("Success!"),b("CAPTCHA passed successfully."),S(d.jsx(Ot,{onClick:()=>{F(!0),se(o)},disabled:!(V!=null&&V.userIntentRequired),loading:j,children:V!=null&&V.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":C(""),b("Checking that you are a human..."),S(d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":C("Something went wrong"),I<=0?(b("If you use an adblocker or VPN, try disabling and re-attempting."),S(null)):(b("You did not pass CAPTCHA. Please try again."),S(d.jsx(Ot,{onClick:Y,children:"Retry"})))}},[s,g,j]);let Y=async()=>{if(I<=0)return;B(k=>k-1),c(),u();let N=await l();!N||V!=null&&V.userIntentRequired||se(N)};return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:t&&e!==t?n:void 0}),d.jsxs(qDe,{children:[s==="success"?d.jsx(s1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):s==="error"?d.jsx(Hx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(WDe,{}),d.jsxs(To,{children:[w?d.jsx("h3",{children:w}):null,d.jsx("p",{children:v})]}),A]}),d.jsx(kr,{})]})};let qDe=fe.div.withConfig({displayName:"CaptchaContainer",componentId:"sc-9afcf974-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const U6=({chainType:t,withPadding:e})=>{let r="";return r=t==="ethereum-only"||t==="ethereum-and-solana"?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",d.jsx(qRe,{$withPadding:e,children:d.jsxs(VRe,{children:[d.jsx(R0,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),d.jsx("h3",{children:"No wallets available"}),d.jsxs("p",{children:["Please download an external wallet provider, like ",r,"."]})]})},"empty-wallet-state")},Mne=({icon:t,name:e})=>typeof t=="string"?d.jsx("img",{alt:`${e||"wallet"} logo`,src:t,style:{height:24,width:24,borderRadius:4}}):t===void 0?d.jsx(ov,{}):t?d.jsx(t,{}):null;let VDe=rne(["from,to{background:var(--privy-color-foreground-4);color:var(--privy-color-foreground-4);}50%{background:var(--privy-color-foreground-accent);color:var(--privy-color-foreground-accent);}"]);const Tne=la(["",""],t=>t.$isLoading?la(["width:35%;animation:"," 2s linear infinite;border-radius:var(--privy-border-radius-sm);"],VDe):""),Sc=({children:t,color:e,isLoading:r,isPulsing:n,...i})=>d.jsx(YDe,{$color:e,$isLoading:r,$isPulsing:n,...i,children:t});let YDe=fe.span.withConfig({displayName:"StyledSpan",componentId:"sc-eba15c9-0"})(["padding:0.125rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);display:flex;align-items:center;"," ",""],t=>{let e,r;t.$color==="green"&&(e="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),t.$color==="red"&&(e="var(--privy-color-error)",r="var(--privy-color-error-light)"),t.$color==="gray"&&(e="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let n=rne(["from,to{background-color:",";}50%{background-color:rgba(",",0.8);}"],r,r);return la(["color:",";background-color:",";",";"],e,r,t.$isPulsing&&la(["animation:"," 3s linear infinite;"],n))},Tne);const KDe=({...t})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...t,children:[d.jsx("defs",{children:d.jsxs("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{offset:"0",stopColor:"#f1562b"}),d.jsx("stop",{offset:"0.3",stopColor:"#f1542b"}),d.jsx("stop",{offset:"0.41",stopColor:"#f04d2a"}),d.jsx("stop",{offset:"0.49",stopColor:"#ef4229"}),d.jsx("stop",{offset:"0.5",stopColor:"#ef4029"}),d.jsx("stop",{offset:"0.56",stopColor:"#e83e28"}),d.jsx("stop",{offset:"0.67",stopColor:"#e13c26"}),d.jsx("stop",{offset:"1",stopColor:"#df3c26"})]})}),d.jsx("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),d.jsx("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]}),JDe=({style:t,...e})=>d.jsxs("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("path",{d:"M0 10.2C0 4.56669 4.5667 0 10.2 0H37.8C43.4333 0 48 4.5667 48 10.2V37.8C48 43.4333 43.4333 48 37.8 48H10.2C4.56669 48 0 43.4333 0 37.8V10.2Z",fill:"#604E93"}),d.jsx("path",{d:"M4.13353 14.6218C3.70207 13.1338 4.62517 11.5926 6.14065 11.2707L31.424 5.90036C32.6242 5.64544 33.8434 6.24236 34.3782 7.34668L45.7343 30.7995L13.7343 47.7328L4.13353 14.6218Z",fill:"url(#paint0_linear_362_37285)"}),d.jsx("path",{d:"M4.46332 16.4519C4.00953 14.8821 5.06159 13.277 6.68213 13.0669L40.1928 8.72077C41.5851 8.5402 42.879 9.47008 43.1517 10.8473L48.0004 35.333L13.467 47.5999L4.46332 16.4519Z",fill:"white"}),d.jsx("path",{d:"M0 18.6666C0 15.7211 2.38781 13.3333 5.33333 13.3333H37.3333C43.2244 13.3333 48 18.1089 48 24V37.3333C48 43.2243 43.2244 48 37.3333 48H10.6667C4.77563 48 0 43.2243 0 37.3333V18.6666Z",fill:"black"}),d.jsx("path",{d:"M31.7559 33.3796V23.3867H33.7051V33.3796H31.7559Z",fill:"#F7A600"}),d.jsx("path",{d:"M9.51303 36.362H5.33398V26.3691H9.3449C11.2941 26.3691 12.4301 27.4639 12.4301 29.176C12.4301 30.2844 11.7008 31.0006 11.1964 31.2393C11.7996 31.5201 12.5709 32.1511 12.5709 33.4846C12.5709 35.3513 11.2941 36.362 9.51303 36.362ZM9.19043 28.1096H7.28322V30.4117H9.19043C10.0174 30.4117 10.4808 29.9489 10.4808 29.2612C10.4808 28.5723 10.0185 28.1096 9.19043 28.1096ZM9.31653 32.1658H7.28322V34.6215H9.31653C10.2003 34.6215 10.6206 34.0599 10.6206 33.3868C10.6216 32.7127 10.2003 32.1658 9.31653 32.1658Z",fill:"white"}),d.jsx("path",{d:"M17.9425 32.2637V36.362H16.007V32.2637L13.0059 26.3691H15.1232L16.9884 30.3969L18.8252 26.3691H20.9426L17.9425 32.2637Z",fill:"white"}),d.jsx("path",{d:"M26.4896 36.362H22.3105V26.3691H26.3215C28.2707 26.3691 29.4066 27.4639 29.4066 29.176C29.4066 30.2844 28.6774 31.0006 28.173 31.2393C28.7761 31.5201 29.5474 32.1511 29.5474 33.4846C29.5464 35.3513 28.2696 36.362 26.4896 36.362ZM26.167 28.1096H24.2598V30.4117H26.167C26.994 30.4117 27.4574 29.9489 27.4574 29.2612C27.4563 28.5723 26.994 28.1096 26.167 28.1096ZM26.2931 32.1658H24.2598V34.6215H26.2931C27.1768 34.6215 27.5971 34.0599 27.5971 33.3868C27.5971 32.7127 27.1758 32.1658 26.2931 32.1658Z",fill:"white"}),d.jsx("path",{d:"M40.0573 28.1096V36.362H38.1081V28.1096H35.5V26.3691H42.6665V28.1096H40.0573Z",fill:"white"}),d.jsx("defs",{children:d.jsxs("linearGradient",{id:"paint0_linear_362_37285",x1:"4.00094",y1:"13.9604",x2:"46.1673",y2:"11.8482",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{"stop-color":"#FFD748"}),d.jsx("stop",{offset:"1","stop-color":"#F7A600"})]})})]}),QDe=({style:t,...e})=>d.jsxs("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),d.jsx("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),d.jsxs("g",{mask:"url(#mask0_16909_31415)",children:[d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#002D72"}),d.jsx("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),d.jsxs("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),d.jsx("stop",{offset:"1",stopColor:"#002D72"})]})]})]}),kne=({style:t,...e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),d.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),d.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),d.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),d.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),d.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),d.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),d.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),d.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),d.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),d.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),d.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),d.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),ZDe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfoDAIVMQ8VNW19AAAGKUlEQVRYw+2WTWxcVxXHf+feN98Tf43j2KmduMEibZOilEjNl9KmImrCoipSkSohIQQSQkJhSdmAAEV0ka742CF11WURsEJRHSg4TWooUhPagkgcO/6IY8ffnhk/z8y9h8Wbsd/4AwEbFnCkJ7173zn/c87/nHPfhf91kcbLt892cX9RebrbcOaA4ViPoVyNvvVemfqPwMdfewyAbAI+nPbcGPfcnvYc6hCuDM0CEDSUDeAUkw54wRqW2gvmL+WHvgIwWQdCofeNqX/JaVwKnSZpZ/zTaUtbpaa/FUSbGPjOc3tRFbyyNzC809sifSf77FBvq/zKKb+rOR23ZtNoJ1a2Oq45SAQctMILk8v6heEJd3ZqRe87z4sizKkqb1x/FDGgGlXCCMe9cvj+sqbLVffyyT7z0uMd5l5gZVCVXwPDmTSL6SSUf9TsUBXWKlAOaQdOJAJe9sr5kXl/aHjCm7myIpAR4ThwVUSaSyARwxeAtACPSso7d515Zj8Dx3rMQCrgK6rcdo5rIsxvayaBmqMAfE6Ez4Q1MremPR8+cKzXou9ABriIcJU6nxsBKKSBo3HA0MHwhGO2pJzuM5lCVk54zwnVDcAmBryPEpkvKTfHPaOLHmWb7lGUNBA2BYBoiMpYU1ZRYIzMexbXlFN9hoGCadR3W81rDu7Oe96f8CyWFZHYmG3KmKoPRUwzA0R9cGunzhaBhbIyOBKxcarfUtjTrLO8BjfHHbcfeiq17QzF5FbDOUTTF5ePgPJuQaw7+NOkZ/COI6xG2QkQVmHwjuODSU/F/VPn5bqPRgvUA9Ami9qu5gq5JPS2CFYiEAWsRHu5ZAx5Z6k1NER1swQi2rAL60/LFr+oQmdWeK7fcrBdmrIUgSNdhlxC+MOYY373+jfwN2ja0kpMAbNAl2rk2EiUdXdeONlr2ZuPUtdYplqnor9dyCYsw5OOh0WlXAGv9VJF/maBB02lbby8drYLIKnws8Dw9da0sL9VeLxD6GkRkgg2xnA+C8lE9F6pQrG8CeiAKsqDFWV0QXmwrCyHSs3zc4FLQGXbvwDgVL+pAD/p75CXulukuyUlGAOlMoSV5vJuYyBWLgO0poT9B4TP9sLKuvJwRadH5/XHCJX3x/yG/kYAP7iYwER89AGtjbo7B0urnnBdMUJDh0RgSCejRbWqFIsRqNfoSaeEdNJgDLRlhPaMtD25jz7g44tPWK4MRThNY1g3ftErmUZWxsCenMU7KK55xpYDZouCd2zMofPwqCiMLgcUyx7vIhtjNhnySqaO3SQGYOX1g411AXh+a+vmMlBoS7AY5Hlrro+bqwWsFbTejNYIN1Y7eGuuj4VEnkJbglyGneQc0AkQvt6zWYJa6AhSABwDDm+1MkbJZoVn81UGuqdZWrMYa4CIdmMN5w+FfDFToiPhEB/Z7CCH6z4GS2uxo9iYOv2e5wWycQvntd5knkDgsaxnf6ZKpbo55QmrPNURIgLVWnTarFeis8CaptMgq3DOGgatjTVhzUVjZAwl3RJ4qayU1xxGhEK7pWWPYA0EwWZDBkHU/TUHK0VlftHhVclmLLls83EkQsl7SKdiATRUvOc6sAps/GpSKWEtFJxXqg6KJU86JcyEUK5E0eaS0JVWwnWlWhOcU4wVUilhS0Krqgxta8LC5cnG+hPg73EFa4R8zmINGBFq+QOMdFzg0rUcr75d5dW3q1y6luNexwVq+QMYI1gL+ZzZSj917E8AOi9PbTIQk0XgPeB4fDOVIHRtbQvhk5/fJ33P2kezZSZX32O1GhVyYhVmO0/R8tR5dOKPLv3X38ykKHYQXXLicgNYiG9sDQDg98A3gCXg48hIr7Pv06NLPWe+msR+K591uW9++RV8fajFCLlsmhLpUqXnzE/bFu69ycwHh0DOAKeBI0A78O5WZ7ErmSDRYTsEfAn4GzBG/X5QDfKMTdz/7r7Ozj9bY77/zNHDRzfOZgFBP1peXfnhzPzcL48EeQfcAa4STVU/8EQdu7kp44vJHe70Dbl74jKqSmAtNec+JSKngfow4VT1RmDtSM05RISB4e/tihW/0u9+d9lB3v3Fm6gooruZRbfIc6987d+B/b/8d+UfeVGT8xvC5akAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMTItMDJUMjE6NDk6MTArMDA6MDB60KjYAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI0LTEyLTAyVDIxOjQ5OjEwKzAwOjAwC40QZAAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNC0xMi0wMlQyMTo0OToxNSswMDowMA6gHhwAAAAASUVORK5CYII=",Gx=({style:t,...e})=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]}),Nne="data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyB2aWV3Qm94PScwIDAgMTA4IDEwOCcgZmlsbD0nbm9uZScgc3R5bGU9J2hlaWdodDoyOHB4O3dpZHRoOjI4cHgnPjxyZWN0IHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyByeD0nMjMnIGZpbGw9JyNBQjlGRjInPjwvcmVjdD48cGF0aCBmaWxsLXJ1bGU9J2V2ZW5vZGQnIGNsaXAtcnVsZT0nZXZlbm9kZCcgZD0nTTQ2LjUyNjcgNjkuOTIyOUM0Mi4wMDU0IDc2Ljg1MDkgMzQuNDI5MiA4NS42MTgyIDI0LjM0OCA4NS42MTgyQzE5LjU4MjQgODUuNjE4MiAxNSA4My42NTYzIDE1IDc1LjEzNDJDMTUgNTMuNDMwNSA0NC42MzI2IDE5LjgzMjcgNzIuMTI2OCAxOS44MzI3Qzg3Ljc2OCAxOS44MzI3IDk0IDMwLjY4NDYgOTQgNDMuMDA3OUM5NCA1OC44MjU4IDgzLjczNTUgNzYuOTEyMiA3My41MzIxIDc2LjkxMjJDNzAuMjkzOSA3Ni45MTIyIDY4LjcwNTMgNzUuMTM0MiA2OC43MDUzIDcyLjMxNEM2OC43MDUzIDcxLjU3ODMgNjguODI3NSA3MC43ODEyIDY5LjA3MTkgNjkuOTIyOUM2NS41ODkzIDc1Ljg2OTkgNTguODY4NSA4MS4zODc4IDUyLjU3NTQgODEuMzg3OEM0Ny45OTMgODEuMzg3OCA0NS42NzEzIDc4LjUwNjMgNDUuNjcxMyA3NC40NTk4QzQ1LjY3MTMgNzIuOTg4NCA0NS45NzY4IDcxLjQ1NTYgNDYuNTI2NyA2OS45MjI5Wk04My42NzYxIDQyLjU3OTRDODMuNjc2MSA0Ni4xNzA0IDgxLjU1NzUgNDcuOTY1OCA3OS4xODc1IDQ3Ljk2NThDNzYuNzgxNiA0Ny45NjU4IDc0LjY5ODkgNDYuMTcwNCA3NC42OTg5IDQyLjU3OTRDNzQuNjk4OSAzOC45ODg1IDc2Ljc4MTYgMzcuMTkzMSA3OS4xODc1IDM3LjE5MzFDODEuNTU3NSAzNy4xOTMxIDgzLjY3NjEgMzguOTg4NSA4My42NzYxIDQyLjU3OTRaTTcwLjIxMDMgNDIuNTc5NUM3MC4yMTAzIDQ2LjE3MDQgNjguMDkxNiA0Ny45NjU4IDY1LjcyMTYgNDcuOTY1OEM2My4zMTU3IDQ3Ljk2NTggNjEuMjMzIDQ2LjE3MDQgNjEuMjMzIDQyLjU3OTVDNjEuMjMzIDM4Ljk4ODUgNjMuMzE1NyAzNy4xOTMxIDY1LjcyMTYgMzcuMTkzMUM2OC4wOTE2IDM3LjE5MzEgNzAuMjEwMyAzOC45ODg1IDcwLjIxMDMgNDIuNTc5NVonIGZpbGw9JyNGRkZERjgnPjwvcGF0aD48L3N2Zz4=",XDe=t=>d.jsxs("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),d.jsx("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),d.jsx("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"white"}),d.jsx("stop",{offset:"1",stopColor:"white"})]}),d.jsxs("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8697FF"}),d.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),d.jsxs("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8697FF"}),d.jsx("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),d.jsxs("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"white"}),d.jsx("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]}),eOe=({style:t,...e})=>d.jsxs("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("g",{clipPath:"url(#clip0_5_32)",children:d.jsxs("g",{clipPath:"url(#clip1_5_32)",children:[d.jsx("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:d.jsx("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),d.jsx("g",{mask:"url(#mask0_5_32)",children:d.jsx("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),d.jsx("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),d.jsx("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),d.jsx("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),d.jsx("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),d.jsx("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),d.jsx("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),d.jsx("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),d.jsx("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),d.jsx("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),d.jsxs("defs",{children:[d.jsxs("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#174299"}),d.jsx("stop",{offset:"1",stopColor:"#001E59"})]}),d.jsxs("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[d.jsx("stop",{offset:"0.770277",stopColor:"#FF4000"}),d.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),d.jsxs("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FF4000"}),d.jsx("stop",{offset:"1",stopColor:"#8754C9"})]}),d.jsxs("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#8754C9"}),d.jsx("stop",{offset:"1",stopColor:"#FF4000"})]}),d.jsxs("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[d.jsx("stop",{offset:"0.723929",stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[d.jsx("stop",{stopColor:"#FFF700"}),d.jsx("stop",{offset:"1",stopColor:"#FF9901"})]}),d.jsxs("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[d.jsx("stop",{offset:"0.59513",stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsxs("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[d.jsx("stop",{stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsxs("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[d.jsx("stop",{stopColor:"#00AAFF"}),d.jsx("stop",{offset:"1",stopColor:"#01DA40"})]}),d.jsx("clipPath",{id:"clip0_5_32",children:d.jsx("rect",{width:"120",height:"120",fill:"white"})}),d.jsx("clipPath",{id:"clip1_5_32",children:d.jsx("rect",{width:"120",height:"120",fill:"white"})})]})]}),tOe=({style:t,...e})=>d.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),d.jsx("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),d.jsx("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),d.jsx("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]}),rOe=({style:t,...e})=>d.jsxs("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsx("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),d.jsxs("g",{children:[d.jsx("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),d.jsx("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),d.jsx("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),d.jsx("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),d.jsx("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),d.jsx("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),d.jsx("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]}),nOe=({style:t,...e})=>d.jsxs("svg",{fill:"none",height:"1024",width:"1024",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsxs("filter",{id:"a","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"1228",width:"1244",x:"-72",y:"-72",children:[d.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),d.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"-72",dy:"-72"}),d.jsx("feGaussianBlur",{stdDeviation:"54"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),d.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"152",dy:"132"}),d.jsx("feGaussianBlur",{stdDeviation:"74"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),d.jsx("feBlend",{in2:"effect1_innerShadow_3981_20791",mode:"normal",result:"effect2_innerShadow_3981_20791"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"32",dy:"20"}),d.jsx("feGaussianBlur",{stdDeviation:"50"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),d.jsx("feBlend",{in2:"effect2_innerShadow_3981_20791",mode:"normal",result:"effect3_innerShadow_3981_20791"})]}),d.jsxs("filter",{id:"b","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"352",width:"747",x:"142",y:"352",children:[d.jsx("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),d.jsx("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),d.jsx("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),d.jsx("feOffset",{dx:"8",dy:"12"}),d.jsx("feGaussianBlur",{stdDeviation:"5"}),d.jsx("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),d.jsx("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0.69 0"}),d.jsx("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"})]}),d.jsxs("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:"0",x2:"1024",y1:"0",y2:"1024",children:[d.jsx("stop",{offset:"0",stopColor:"#8992d1"}),d.jsx("stop",{offset:"1",stopColor:"#646c9f"})]}),d.jsx("clipPath",{id:"d",children:d.jsx("path",{d:"m0 0h1024v1024h-1024z"})}),d.jsxs("g",{"clip-path":"url(#d)",children:[d.jsx("g",{filter:"url(#a)",children:d.jsx("rect",{fill:"url(#c)",height:"1024",rx:"230",width:"1024"})}),d.jsxs("g",{fill:"#fff",filter:"url(#b)",children:[d.jsx("path",{d:"m212.459 354h-54.459c-8.837 0-16 7.163-16 16v203c0 66.826 54.174 121 121 121h44c66.826 0 121-54.174 121-121v-203c0-8.837-7.163-16-16-16h-56.548c-8.837 0-16 7.163-16 16v198.829c0 28.607-23.19 51.797-51.797 51.797-32.693 0-59.196-26.503-59.196-59.196v-191.43c0-8.837-7.163-16-16-16z"}),d.jsx("path",{d:"m868.426 352h-68.495c-6.98 0-12.487 5.934-11.967 12.895l14.206 190c.468 6.263 5.686 11.105 11.966 11.105h45.412c6.409 0 11.687-5.037 11.987-11.44l8.878-190c.32-6.84-5.14-12.56-11.987-12.56z"}),d.jsx("ellipse",{cx:"834",cy:"649.5",rx:"47",ry:"44.5"}),d.jsx("path",{clipRule:"evenodd",d:"m522 687h50c8.837 0 16-7.163 16-16v-80c0-8.837 7.163-16 16-16h33.5c61.58 0 111.5-49.92 111.5-111.5s-49.92-111.5-111.5-111.5h-115.5c-8.837 0-16 7.163-16 16v303c0 8.837 7.163 16 16 16zm70-252v58c0 6.627 5.373 12 12 12h14c20.987 0 38-17.013 38-38v-6c0-20.987-17.013-38-38-38h-14c-6.627 0-12 5.373-12 12z",fillRule:"evenodd"})]})]})]}),Lne=({style:t,...e})=>{let{app:r}=wt();return d.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...t},...e,children:[d.jsx("rect",{width:"28",height:"28",rx:"3",fill:(r==null?void 0:r.appearance.palette.colorScheme)==="dark"?"#3396ff":"#141414"}),d.jsx("g",{clipPath:"url(#clip0_1765_9946)",children:d.jsx("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_1765_9946",children:d.jsx("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},iOe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",aOe=({style:t,...e})=>d.jsxs("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...t},...e,children:[d.jsxs("g",{clipPath:"url(#clip0_1704_1423)",children:[d.jsx("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_1704_1423",children:d.jsx("rect",{width:"176",height:"176",fill:"white"})})})]}),vu={coinbase_wallet:{logo:GM,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:GM,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:kne,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:Gx,displayName:"Phantom"},rainbow:{logo:eOe,displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:Lne,displayName:"WalletConnect"},zerion:{logo:aOe,displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:KDe,displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:QDe,displayName:"Crypto.com Onchain",rdns:"com.crypto.wallet"},uniswap:{logo:rOe,displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:XDe,displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:tOe},universal_profile:{displayName:"Universal Profile",logo:nOe},bybit_wallet:{displayName:"Bybit Wallet",logo:JDe}},Fm=(t,e,r)=>{var n;return(n=vu[t])!=null&&n.displayName?t==="coinbase_wallet"?vu[r].displayName:vu[t].displayName:e==="wallet_connect_v2"&&t==="wallet_connect"?"Wallet Connect":void 0},jne=(t,e,r)=>{var n;return(n=vu[t])!=null&&n.logo?t==="coinbase_wallet"?vu[r].logo:vu[t].logo:e==="wallet_connect_v2"&&t==="wallet_connect"?Lne:void 0};function lT(t){var r,n;let e=t.toLowerCase();return!!((n=(r=window==null?void 0:window.webkit)==null?void 0:r.messageHandlers)!=null&&n.ReactNativeWebView)||!!(window!=null&&window.ReactNativeWebView)||["fbav","fban","instagram","snapchat","linkedinapp"].some(i=>e.includes(i))}let $ne=_.createContext({});const sOe=({children:t})=>{let e=Ai(),[r,n]=_.useState({});return aj("login",{onComplete:(i,a,s,o,l)=>{l&&l.type!=="passkey"&&l.type!=="cross_app"&&(l.type!=="wallet"||l.walletClientType!=="privy")&&(Dt.put(Iz(e.id),l.type),l.type==="wallet"?(Dt.put(yS(e.id),l.walletClientType),Dt.put(wS(e.id),l.chainType),n({accountType:l.type,walletClientType:l.walletClientType,chainType:l.chainType})):(Dt.del(yS(e.id)),Dt.del(wS(e.id)),n({accountType:l.type})))}}),_.useEffect(()=>{if(!e.id)return;let i=Dt.get(Iz(e.id)),a=Dt.get(yS(e.id)),s=Dt.get(wS(e.id));i&&n(i==="wallet"?{accountType:i,walletClientType:a,chainType:s}:{accountType:i})},[e.id]),d.jsx($ne.Provider,{value:r,children:t})};let Iz=t=>`privy:${t}:recent-login-method`,yS=t=>`privy:${t}:recent-login-wallet-client`,wS=t=>`privy:${t}:recent-login-chain-type`;const Th=()=>_.useContext($ne),rd=({provider:t,displayName:e,logo:r,connectOnly:n,connector:i})=>{let{navigate:a}=wt(),{connectWallet:s}=_t(),o=Th(),l=i.connectorType==="wallet_connect_v2"?t:i.walletClientType,c=window.matchMedia("(display-mode: standalone)").matches;return d.jsxs(oOe,{onClick:i.connectorType==="phantom"||i.connectorType==="solana_adapter"&&i.walletClientType==="phantom"?()=>{Z9()||i.chainType==="solana"&&"isInstalled"in i&&i.isInstalled?(s(i,l),a(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION)):a(ya?ye.PHANTOM_INTERSTITIAL_SCREEN:ye.INSTALL_PHANTOM_SCREEN)}:i.connectorType!=="coinbase_wallet"||i.connectionOptions!=="eoaOnly"||!ya||c||Cee()?()=>{(!lT(window.navigator.userAgent)||event!=null&&event.isTrusted)&&(s(i,l),a(n?ye.AWAITING_CONNECT_ONLY_CONNECTION:ye.AWAITING_CONNECTION))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`},children:[d.jsx(Mne,{icon:jne(t,i.connectorType,i.walletClientType)??r,name:i.walletClientType}),d.jsx("span",{children:Fm(t,i.connectorType,i.walletClientType)||e||i.walletClientType}),d.jsxs(lOe,{id:"chip-container",children:[(o==null?void 0:o.walletClientType)===l&&(o==null?void 0:o.chainType)===i.chainType?d.jsx(Mz,{color:"gray",children:"Recent"}):d.jsx("span",{id:"connect-text",children:"Connect"}),i.connectorType==="solana_adapter"&&d.jsx(Mz,{color:"gray",children:"Solana"})]})]})};let oOe=fe(Jn).withConfig({displayName:"ConnectWalletButton",componentId:"sc-b6343d12-0"})(["> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),Mz=fe(Sc).withConfig({displayName:"StyledChip",componentId:"sc-b6343d12-1"})(["margin-left:auto;"]),lOe=fe.div.withConfig({displayName:"ChipContainer",componentId:"sc-b6343d12-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const cOe=["coinbase_wallet"];let uOe=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];const dOe=["safe"],fOe=["phantom","universal_profile"],gj=({wallets:t})=>{let{app:e}=wt();return t.length===0?d.jsx(U6,{chainType:e.appearance.walletChainType,withPadding:!0}):d.jsx(d.Fragment,{children:t})},o1=({walletList:t,walletChainType:e,connectors:r,connectOnly:n,ignore:i,walletConnectEnabled:a,forceWallet:s})=>{var h,g;let o=[],l=[],c=[],u=r.filter(m=>e==="ethereum-only"?m.chainType==="ethereum":e!=="solana-only"||m.chainType==="solana"),f=u.find(m=>m.connectorType==="wallet_connect_v2");for(let[m,w]of(s?[s.wallet]:t).entries()){if(w==="detected_ethereum_wallets"||w==="detected_wallets")for(let[C,v]of u.filter(({chainType:b,connectorType:A,walletClientType:S})=>b!=="solana"&&(S==="uniswap_wallet_extension"||S==="uniswap_extension"?!i.includes("uniswap"):S==="crypto.com_wallet_extension"||S==="crypto.com_onchain"?!i.includes("cryptocom"):A==="injected"&&!i.includes(S))).entries()){let{walletClientType:b,walletBranding:A,chainType:S}=v;(b==="unknown"?l:o).push(d.jsx(rd,{connectOnly:n,provider:b,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${b}-${S}-${C}`))}if(w==="detected_solana_wallets"||w==="detected_wallets")for(let[C,v]of u.filter(({chainType:b,walletClientType:A})=>{if(b==="solana")return e!=="ethereum-only"&&!i.includes(A)}).entries()){let{walletClientType:b,walletBranding:A,chainType:S}=v;(b==="unknown"?l:o).push(d.jsx(rd,{connectOnly:n,provider:b,logo:A.icon,displayName:A.name,connector:v},`${m}-${w}-${b}-${S}-${C}`))}if(fOe.includes(w)){let C=u.find(v=>v.connectorType==="injected"&&v.walletClientType===w||v.connectorType===w);if(C&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:C},`${m}-${w}`)),e==="solana-only"||e==="ethereum-and-solana"){let v=u.find(({chainType:b,connectorType:A,walletClientType:S})=>b==="solana"&&A==="solana_adapter"&&S===w);v&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:v},`${w}-solana`))}}else if(uOe.includes(w)){let C=u.find(v=>w==="uniswap"?v.walletClientType==="uniswap_wallet_extension"||v.walletClientType==="uniswap_extension":w==="cryptocom"?v.walletClientType==="crypto.com_wallet_extension"||v.walletClientType==="crypto.com_onchain":v.connectorType==="injected"&&v.walletClientType===w);a&&!C&&(C=f),C&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:C,logo:C.connectorType==="injected"?C.walletBranding.icon:void 0,displayName:C.connectorType==="injected"?C.walletBranding.name:void 0},`${m}-${w}`))}else if(cOe.includes(w)){let C=u.find(({connectorType:v})=>v===w);C&&o.push(d.jsx(rd,{connectOnly:n,provider:w,connector:C},`${m}-${w}`))}else if(dOe.includes(w))f&&c.push(d.jsx(rd,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w==="wallet_connect")f&&c.push(d.jsx(rd,{connectOnly:n,provider:w,connector:f},`${m}-${w}`));else if(w===(s==null?void 0:s.wallet)){let C=s.chainType==="ethereum"&&t.includes("detected_ethereum_wallets"),v=s.chainType==="solana"&&t.includes("detected_solana_wallets");if(t.includes("detected_wallets")||C||v){let b=u.find(({walletClientType:A})=>A===w);b&&o.push(d.jsx(rd,{connectOnly:n,provider:w,displayName:(h=b.walletBranding)==null?void 0:h.name,logo:(g=b.walletBranding)==null?void 0:g.icon,connector:b},`${m}-${w}`))}}}return[...l,...o,...c]},hOe=()=>{var s,o;let{app:t,data:e}=wt(),r=(s=e==null?void 0:e.externalConnectWallet)==null?void 0:s.suggestedAddress,n=r?`Connect the wallet with address ${as(r)} ${t!=null&&t.name?`to ${t.name}.`:"."}`:`Connect a wallet to ${t==null?void 0:t.name}`,{connectors:i}=_t(),a=o1({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{},"header"),a.length>0&&d.jsx(lv,{title:"Connect your wallet",description:n}),d.jsx(fh,{children:d.jsx(gj,{wallets:a})}),d.jsx(Qt,{})]})},pOe=()=>{var s,o;let{app:t,data:e}=wt(),r=(s=e==null?void 0:e.externalConnectWallet)==null?void 0:s.suggestedAddress,n=r?d.jsxs("span",{children:["Connect the wallet with address ",d.jsx(bo,{showCopyIcon:!1,address:r})," ",t!=null&&t.name?`to ${t.name}.`:"."]}):`Connect a wallet to your ${t==null?void 0:t.name} account`,{connectors:i}=_t(),a=o1({walletList:((o=e==null?void 0:e.externalConnectWallet)==null?void 0:o.walletList)??t.appearance.walletList,walletChainType:t.appearance.walletChainType,connectors:i,connectOnly:!0,ignore:t.appearance.walletList,walletConnectEnabled:t.externalWallets.walletConnect.enabled});return d.jsxs(d.Fragment,{children:[d.jsx(ft,{},"header"),a.length>0&&d.jsx(Wx,{title:"Connect your wallet",description:n}),d.jsx(fh,{children:d.jsx(gj,{wallets:a})}),t&&d.jsx(dj,{app:t,alwaysShowImplicitConsent:!0}),d.jsx(Qt,{})]})},mj=({style:t,...e})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...t},...e,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),Tz=t=>{var r;let e=(r=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses"))==null?void 0:r.split(" ").filter(n=>wc(n,{strict:!0})).map(n=>HN(n));return!!(e!=null&&e.length)&&!!(t!=null&&t.linkedAccounts.filter(n=>n.type=="wallet"&&e.includes(n.address)).length)};var kz=function(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,a;n"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new vOe:typeof navigator<"u"?SOe(navigator.userAgent):IOe()}function COe(t){return t!==""&&EOe.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 SOe(t){var e=COe(t);if(!e)return null;var r=e[0],n=e[1];if(r==="searchbot")return new wOe;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function oOe(t,e){return function(r,n){e(r,n,t)}}function lOe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function cOe(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function uOe(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function hne(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function hOe(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(a[0][3],m)}}function l(h){h.value instanceof H3?Promise.resolve(h.value.v).then(c,u):f(a[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),a.shift(),a.length&&o(a[0][0],a[0][1])}}function mOe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(s){return(r=!r)?{value:H3(t[i](s)),done:i==="return"}:a?a(s):s}:a}}function yOe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof eT=="function"?eT(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,l){s=t[a](s),i(o,l,s.done,s.value)})}}function i(a,s,o,l){Promise.resolve(l).then(function(c){a({value:c,done:o})},s)}}function wOe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function vOe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function bOe(t){return t&&t.__esModule?t:{default:t}}function xOe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function EOe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const _Oe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return XM},__asyncDelegator:mOe,__asyncGenerator:gOe,__asyncValues:yOe,__await:H3,__awaiter:cOe,__classPrivateFieldGet:xOe,__classPrivateFieldSet:EOe,__createBinding:dOe,__decorate:sOe,__exportStar:fOe,__extends:iOe,__generator:uOe,__importDefault:bOe,__importStar:vOe,__makeTemplateObject:wOe,__metadata:lOe,__param:oOe,__read:hne,__rest:aOe,__spread:hOe,__spreadArrays:pOe,__values:eT},Symbol.toStringTag,{value:"Module"})),Dx=fh(_Oe);var uS={},R2={},bz;function COe(){if(bz)return R2;bz=1,Object.defineProperty(R2,"__esModule",{value:!0}),R2.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return R2.delay=t,R2}var Vh={},dS={},Yh={},xz;function SOe(){return xz||(xz=1,Object.defineProperty(Yh,"__esModule",{value:!0}),Yh.ONE_THOUSAND=Yh.ONE_HUNDRED=void 0,Yh.ONE_HUNDRED=100,Yh.ONE_THOUSAND=1e3),Yh}var fS={},Ez;function AOe(){return Ez||(Ez=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(fS)),fS}var _z;function pne(){return _z||(_z=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Dx;e.__exportStar(SOe(),t),e.__exportStar(AOe(),t)}(dS)),dS}var Cz;function IOe(){if(Cz)return Vh;Cz=1,Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.fromMiliseconds=Vh.toMiliseconds=void 0;const t=pne();function e(n){return n*t.ONE_THOUSAND}Vh.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Vh.fromMiliseconds=r,Vh}var Sz;function MOe(){return Sz||(Sz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Dx;e.__exportStar(COe(),t),e.__exportStar(IOe(),t)}(uS)),uS}var mp={},Az;function TOe(){if(Az)return mp;Az=1,Object.defineProperty(mp,"__esModule",{value:!0}),mp.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return mp.Watch=t,mp.default=t,mp}var hS={},D2={},Iz;function kOe(){if(Iz)return D2;Iz=1,Object.defineProperty(D2,"__esModule",{value:!0}),D2.IWatch=void 0;class t{}return D2.IWatch=t,D2}var Mz;function NOe(){return Mz||(Mz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Dx.__exportStar(kOe(),t)}(hS)),hS}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=Dx;e.__exportStar(MOe(),t),e.__exportStar(TOe(),t),e.__exportStar(NOe(),t),e.__exportStar(pne(),t)})(ct);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getLocalStorage=Sn.getLocalStorageOrThrow=Sn.getCrypto=Sn.getCryptoOrThrow=gne=Sn.getLocation=Sn.getLocationOrThrow=sj=Sn.getNavigator=Sn.getNavigatorOrThrow=tv=Sn.getDocument=Sn.getDocumentOrThrow=Sn.getFromWindowOrThrow=Sn.getFromWindow=void 0;function S1(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Sn.getFromWindow=S1;function Lm(t){const e=S1(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Sn.getFromWindowOrThrow=Lm;function LOe(){return Lm("document")}Sn.getDocumentOrThrow=LOe;function jOe(){return S1("document")}var tv=Sn.getDocument=jOe;function $Oe(){return Lm("navigator")}Sn.getNavigatorOrThrow=$Oe;function POe(){return S1("navigator")}var sj=Sn.getNavigator=POe;function ROe(){return Lm("location")}Sn.getLocationOrThrow=ROe;function DOe(){return S1("location")}var gne=Sn.getLocation=DOe;function OOe(){return Lm("crypto")}Sn.getCryptoOrThrow=OOe;function FOe(){return S1("crypto")}Sn.getCrypto=FOe;function UOe(){return Lm("localStorage")}Sn.getLocalStorageOrThrow=UOe;function BOe(){return S1("localStorage")}Sn.getLocalStorage=BOe;var oj={};Object.defineProperty(oj,"__esModule",{value:!0});var mne=oj.getWindowMetadata=void 0;const Tz=Sn;function zOe(){let t,e;try{t=Tz.getDocumentOrThrow(),e=Tz.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),h=[];for(let g=0;g-1){const _=m.getAttribute("href");if(_)if(_.toLowerCase().indexOf("https:")===-1&&_.toLowerCase().indexOf("http:")===-1&&_.indexOf("//")!==0){let v=e.protocol+"//"+e.host;if(_.indexOf("/")===0)v+=_;else{const b=e.pathname.split("/");b.pop();const A=b.join("/");v+=A+"/"+_}h.push(v)}else if(_.indexOf("//")===0){const v=e.protocol+_;h.push(v)}else h.push(_)}}return h}function n(...f){const h=t.getElementsByTagName("meta");for(let g=0;gm.getAttribute(_)).filter(_=>_?f.includes(_):!1);if(w.length&&w){const _=m.getAttribute("content");if(_)return _}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function a(){return n("description","og:description","twitter:description","keywords")}const s=i(),o=a(),l=e.origin,c=r();return{description:o,url:l,icons:c,name:s}}mne=oj.getWindowMetadata=zOe;var G3={},WOe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),yne="%[a-f0-9]{2}",kz=new RegExp("("+yne+")|([^%]+?)","gi"),Nz=new RegExp("("+yne+")+","gi");function tT(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],tT(r),tT(n))}function HOe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(kz)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},YOe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),a=0;ab==null,s=Symbol("encodeFragmentIdentifier");function o(b){switch(b.arrayFormat){case"index":return A=>(S,j)=>{const U=S.length;return j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),"[",U,"]"].join("")]:[...S,[u(A,b),"[",u(U,b),"]=",u(j,b)].join("")]};case"bracket":return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),"[]"].join("")]:[...S,[u(A,b),"[]=",u(j,b)].join("")];case"colon-list-separator":return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),":list="].join("")]:[...S,[u(A,b),":list=",u(j,b)].join("")];case"comma":case"separator":case"bracket-separator":{const A=b.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(j,U)=>U===void 0||b.skipNull&&U===null||b.skipEmptyString&&U===""?j:(U=U===null?"":U,j.length===0?[[u(S,b),A,u(U,b)].join("")]:[[j,u(U,b)].join(b.arrayFormatSeparator)])}default:return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,u(A,b)]:[...S,[u(A,b),"=",u(j,b)].join("")]}}function l(b){let A;switch(b.arrayFormat){case"index":return(S,j,U)=>{if(A=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!A){U[S]=j;return}U[S]===void 0&&(U[S]={}),U[S][A[1]]=j};case"bracket":return(S,j,U)=>{if(A=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!A){U[S]=j;return}if(U[S]===void 0){U[S]=[j];return}U[S]=[].concat(U[S],j)};case"colon-list-separator":return(S,j,U)=>{if(A=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!A){U[S]=j;return}if(U[S]===void 0){U[S]=[j];return}U[S]=[].concat(U[S],j)};case"comma":case"separator":return(S,j,U)=>{const I=typeof j=="string"&&j.includes(b.arrayFormatSeparator),B=typeof j=="string"&&!I&&f(j,b).includes(b.arrayFormatSeparator);j=B?f(j,b):j;const V=I||B?j.split(b.arrayFormatSeparator).map(se=>f(se,b)):j===null?j:f(j,b);U[S]=V};case"bracket-separator":return(S,j,U)=>{const I=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!I){U[S]=j&&f(j,b);return}const B=j===null?[]:j.split(b.arrayFormatSeparator).map(V=>f(V,b));if(U[S]===void 0){U[S]=B;return}U[S]=[].concat(U[S],B)};default:return(S,j,U)=>{if(U[S]===void 0){U[S]=j;return}U[S]=[].concat(U[S],j)}}}function c(b){if(typeof b!="string"||b.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(b,A){return A.encode?A.strict?e(b):encodeURIComponent(b):b}function f(b,A){return A.decode?r(b):b}function h(b){return Array.isArray(b)?b.sort():typeof b=="object"?h(Object.keys(b)).sort((A,S)=>Number(A)-Number(S)).map(A=>b[A]):b}function g(b){const A=b.indexOf("#");return A!==-1&&(b=b.slice(0,A)),b}function m(b){let A="";const S=b.indexOf("#");return S!==-1&&(A=b.slice(S)),A}function w(b){b=g(b);const A=b.indexOf("?");return A===-1?"":b.slice(A+1)}function _(b,A){return A.parseNumbers&&!Number.isNaN(Number(b))&&typeof b=="string"&&b.trim()!==""?b=Number(b):A.parseBooleans&&b!==null&&(b.toLowerCase()==="true"||b.toLowerCase()==="false")&&(b=b.toLowerCase()==="true"),b}function v(b,A){A=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},A),c(A.arrayFormatSeparator);const S=l(A),j=Object.create(null);if(typeof b!="string"||(b=b.trim().replace(/^[?#&]/,""),!b))return j;for(const U of b.split("&")){if(U==="")continue;let[I,B]=n(A.decode?U.replace(/\+/g," "):U,"=");B=B===void 0?null:["comma","separator","bracket-separator"].includes(A.arrayFormat)?B:f(B,A),S(f(I,A),B,j)}for(const U of Object.keys(j)){const I=j[U];if(typeof I=="object"&&I!==null)for(const B of Object.keys(I))I[B]=_(I[B],A);else j[U]=_(I,A)}return A.sort===!1?j:(A.sort===!0?Object.keys(j).sort():Object.keys(j).sort(A.sort)).reduce((U,I)=>{const B=j[I];return B&&typeof B=="object"&&!Array.isArray(B)?U[I]=h(B):U[I]=B,U},Object.create(null))}t.extract=w,t.parse=v,t.stringify=(b,A)=>{if(!b)return"";A=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},A),c(A.arrayFormatSeparator);const S=B=>A.skipNull&&a(b[B])||A.skipEmptyString&&b[B]==="",j=o(A),U={};for(const B of Object.keys(b))S(B)||(U[B]=b[B]);const I=Object.keys(U);return A.sort!==!1&&I.sort(A.sort),I.map(B=>{const V=b[B];return V===void 0?"":V===null?u(B,A):Array.isArray(V)?V.length===0&&A.arrayFormat==="bracket-separator"?u(B,A)+"[]":V.reduce(j(B),[]).join("&"):u(B,A)+"="+u(V,A)}).filter(B=>B.length>0).join("&")},t.parseUrl=(b,A)=>{A=Object.assign({decode:!0},A);const[S,j]=n(b,"#");return Object.assign({url:S.split("?")[0]||"",query:v(w(b),A)},A&&A.parseFragmentIdentifier&&j?{fragmentIdentifier:f(j,A)}:{})},t.stringifyUrl=(b,A)=>{A=Object.assign({encode:!0,strict:!0,[s]:!0},A);const S=g(b.url).split("?")[0]||"",j=t.extract(b.url),U=t.parse(j,{sort:!1}),I=Object.assign(U,b.query);let B=t.stringify(I,A);B&&(B=`?${B}`);let V=m(b.url);return b.fragmentIdentifier&&(V=`#${A[s]?u(b.fragmentIdentifier,A):b.fragmentIdentifier}`),`${S}${B}${V}`},t.pick=(b,A,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[s]:!1},S);const{url:j,query:U,fragmentIdentifier:I}=t.parseUrl(b,S);return t.stringifyUrl({url:j,query:i(U,A),fragmentIdentifier:I},S)},t.exclude=(b,A,S)=>{const j=Array.isArray(A)?U=>!A.includes(U):(U,I)=>!A(U,I);return t.pick(b,j,S)}})(G3);var lj={},Ox={},wr={},wne={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,l){var c=o>>>16&65535,u=o&65535,f=l>>>16&65535,h=l&65535;return u*h+(c*h+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(o,l){return o+l|0}t.add=r;function n(o,l){return o-l|0}t.sub=n;function i(o,l){return o<>>32-l}t.rotl=i;function a(o,l){return o<<32-l|o>>>l}t.rotr=a;function s(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}t.isInteger=Number.isInteger||s,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(o){return t.isInteger(o)&&o>=-t.MAX_SAFE_INTEGER&&o<=t.MAX_SAFE_INTEGER}})(wne);Object.defineProperty(wr,"__esModule",{value:!0});var vne=wne;function KOe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}wr.readInt16BE=KOe;function JOe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}wr.readUint16BE=JOe;function ZOe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}wr.readInt16LE=ZOe;function QOe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}wr.readUint16LE=QOe;function bne(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}wr.writeUint16BE=bne;wr.writeInt16BE=bne;function xne(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}wr.writeUint16LE=xne;wr.writeInt16LE=xne;function rT(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}wr.readInt32BE=rT;function nT(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}wr.readUint32BE=nT;function iT(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}wr.readInt32LE=iT;function aT(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}wr.readUint32LE=aT;function t8(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}wr.writeUint32BE=t8;wr.writeInt32BE=t8;function r8(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}wr.writeUint32LE=r8;wr.writeInt32LE=r8;function XOe(t,e){e===void 0&&(e=0);var r=rT(t,e),n=rT(t,e+4);return r*4294967296+n-(n>>31)*4294967296}wr.readInt64BE=XOe;function eFe(t,e){e===void 0&&(e=0);var r=nT(t,e),n=nT(t,e+4);return r*4294967296+n}wr.readUint64BE=eFe;function tFe(t,e){e===void 0&&(e=0);var r=iT(t,e),n=iT(t,e+4);return n*4294967296+r-(r>>31)*4294967296}wr.readInt64LE=tFe;function rFe(t,e){e===void 0&&(e=0);var r=aT(t,e),n=aT(t,e+4);return n*4294967296+r}wr.readUint64LE=rFe;function Ene(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),t8(t/4294967296>>>0,e,r),t8(t>>>0,e,r+4),e}wr.writeUint64BE=Ene;wr.writeInt64BE=Ene;function _ne(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),r8(t>>>0,e,r),r8(t/4294967296>>>0,e,r+4),e}wr.writeUint64LE=_ne;wr.writeInt64LE=_ne;function nFe(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}wr.readUintBE=nFe;function iFe(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=n;a--)r[a]=e/i&255,i*=256;return r}wr.writeUintBE=aFe;function sFe(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(!vne.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a>>16|E<<16,Y=Y+E|0,I^=Y,I=I>>>20|I<<12,S=S+B|0,L^=S,L=L>>>16|L<<16,N=N+L|0,B^=N,B=B>>>20|B<<12,j=j+V|0,O^=j,O=O>>>16|O<<16,k=k+O|0,V^=k,V=V>>>20|V<<12,U=U+se|0,P^=U,P=P>>>16|P<<16,x=x+P|0,se^=x,se=se>>>20|se<<12,j=j+V|0,O^=j,O=O>>>24|O<<8,k=k+O|0,V^=k,V=V>>>25|V<<7,U=U+se|0,P^=U,P=P>>>24|P<<8,x=x+P|0,se^=x,se=se>>>25|se<<7,S=S+B|0,L^=S,L=L>>>24|L<<8,N=N+L|0,B^=N,B=B>>>25|B<<7,A=A+I|0,E^=A,E=E>>>24|E<<8,Y=Y+E|0,I^=Y,I=I>>>25|I<<7,A=A+B|0,P^=A,P=P>>>16|P<<16,k=k+P|0,B^=k,B=B>>>20|B<<12,S=S+V|0,E^=S,E=E>>>16|E<<16,x=x+E|0,V^=x,V=V>>>20|V<<12,j=j+se|0,L^=j,L=L>>>16|L<<16,Y=Y+L|0,se^=Y,se=se>>>20|se<<12,U=U+I|0,O^=U,O=O>>>16|O<<16,N=N+O|0,I^=N,I=I>>>20|I<<12,j=j+se|0,L^=j,L=L>>>24|L<<8,Y=Y+L|0,se^=Y,se=se>>>25|se<<7,U=U+I|0,O^=U,O=O>>>24|O<<8,N=N+O|0,I^=N,I=I>>>25|I<<7,S=S+V|0,E^=S,E=E>>>24|E<<8,x=x+E|0,V^=x,V=V>>>25|V<<7,A=A+B|0,P^=A,P=P>>>24|P<<8,k=k+P|0,B^=k,B=B>>>25|B<<7;Ia.writeUint32LE(A+n|0,t,0),Ia.writeUint32LE(S+i|0,t,4),Ia.writeUint32LE(j+a|0,t,8),Ia.writeUint32LE(U+s|0,t,12),Ia.writeUint32LE(I+o|0,t,16),Ia.writeUint32LE(B+l|0,t,20),Ia.writeUint32LE(V+c|0,t,24),Ia.writeUint32LE(se+u|0,t,28),Ia.writeUint32LE(Y+f|0,t,32),Ia.writeUint32LE(N+h|0,t,36),Ia.writeUint32LE(k+g|0,t,40),Ia.writeUint32LE(x+m|0,t,44),Ia.writeUint32LE(E+w|0,t,48),Ia.writeUint32LE(L+_|0,t,52),Ia.writeUint32LE(O+v|0,t,56),Ia.writeUint32LE(P+b|0,t,60)}function Cne(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>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Sne={},Ch={};Object.defineProperty(Ch,"__esModule",{value:!0});function bFe(t,e,r){return~(t-1)&e|t-1&r}Ch.select=bFe;function xFe(t,e){return(t|0)-(e|0)-1>>>31&1}Ch.lessOrEqual=xFe;function Ane(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}Ch.compare=Ane;function EFe(t,e){return t.length===0||e.length===0?!1:Ane(t,e)!==0}Ch.equal=EFe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ch,r=Po;t.DIGEST_LENGTH=16;var n=function(){function s(o){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 l=o[0]|o[1]<<8;this._r[0]=l&8191;var c=o[2]|o[3]<<8;this._r[1]=(l>>>13|c<<3)&8191;var u=o[4]|o[5]<<8;this._r[2]=(c>>>10|u<<6)&7939;var f=o[6]|o[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var h=o[8]|o[9]<<8;this._r[4]=(f>>>4|h<<12)&255,this._r[5]=h>>>1&8190;var g=o[10]|o[11]<<8;this._r[6]=(h>>>14|g<<2)&8191;var m=o[12]|o[13]<<8;this._r[7]=(g>>>11|m<<5)&8065;var w=o[14]|o[15]<<8;this._r[8]=(m>>>8|w<<8)&8191,this._r[9]=w>>>5&127,this._pad[0]=o[16]|o[17]<<8,this._pad[1]=o[18]|o[19]<<8,this._pad[2]=o[20]|o[21]<<8,this._pad[3]=o[22]|o[23]<<8,this._pad[4]=o[24]|o[25]<<8,this._pad[5]=o[26]|o[27]<<8,this._pad[6]=o[28]|o[29]<<8,this._pad[7]=o[30]|o[31]<<8}return s.prototype._blocks=function(o,l,c){for(var u=this._fin?0:2048,f=this._h[0],h=this._h[1],g=this._h[2],m=this._h[3],w=this._h[4],_=this._h[5],v=this._h[6],b=this._h[7],A=this._h[8],S=this._h[9],j=this._r[0],U=this._r[1],I=this._r[2],B=this._r[3],V=this._r[4],se=this._r[5],Y=this._r[6],N=this._r[7],k=this._r[8],x=this._r[9];c>=16;){var E=o[l+0]|o[l+1]<<8;f+=E&8191;var L=o[l+2]|o[l+3]<<8;h+=(E>>>13|L<<3)&8191;var O=o[l+4]|o[l+5]<<8;g+=(L>>>10|O<<6)&8191;var P=o[l+6]|o[l+7]<<8;m+=(O>>>7|P<<9)&8191;var R=o[l+8]|o[l+9]<<8;w+=(P>>>4|R<<12)&8191,_+=R>>>1&8191;var M=o[l+10]|o[l+11]<<8;v+=(R>>>14|M<<2)&8191;var D=o[l+12]|o[l+13]<<8;b+=(M>>>11|D<<5)&8191;var $=o[l+14]|o[l+15]<<8;A+=(D>>>8|$<<8)&8191,S+=$>>>5|u;var X=0,le=X;le+=f*j,le+=h*(5*x),le+=g*(5*k),le+=m*(5*N),le+=w*(5*Y),X=le>>>13,le&=8191,le+=_*(5*se),le+=v*(5*V),le+=b*(5*B),le+=A*(5*I),le+=S*(5*U),X+=le>>>13,le&=8191;var H=X;H+=f*U,H+=h*j,H+=g*(5*x),H+=m*(5*k),H+=w*(5*N),X=H>>>13,H&=8191,H+=_*(5*Y),H+=v*(5*se),H+=b*(5*V),H+=A*(5*B),H+=S*(5*I),X+=H>>>13,H&=8191;var ee=X;ee+=f*I,ee+=h*U,ee+=g*j,ee+=m*(5*x),ee+=w*(5*k),X=ee>>>13,ee&=8191,ee+=_*(5*N),ee+=v*(5*Y),ee+=b*(5*se),ee+=A*(5*V),ee+=S*(5*B),X+=ee>>>13,ee&=8191;var J=X;J+=f*B,J+=h*I,J+=g*U,J+=m*j,J+=w*(5*x),X=J>>>13,J&=8191,J+=_*(5*k),J+=v*(5*N),J+=b*(5*Y),J+=A*(5*se),J+=S*(5*V),X+=J>>>13,J&=8191;var te=X;te+=f*V,te+=h*B,te+=g*I,te+=m*U,te+=w*j,X=te>>>13,te&=8191,te+=_*(5*x),te+=v*(5*k),te+=b*(5*N),te+=A*(5*Y),te+=S*(5*se),X+=te>>>13,te&=8191;var re=X;re+=f*se,re+=h*V,re+=g*B,re+=m*I,re+=w*U,X=re>>>13,re&=8191,re+=_*j,re+=v*(5*x),re+=b*(5*k),re+=A*(5*N),re+=S*(5*Y),X+=re>>>13,re&=8191;var z=X;z+=f*Y,z+=h*se,z+=g*V,z+=m*B,z+=w*I,X=z>>>13,z&=8191,z+=_*U,z+=v*j,z+=b*(5*x),z+=A*(5*k),z+=S*(5*N),X+=z>>>13,z&=8191;var G=X;G+=f*N,G+=h*Y,G+=g*se,G+=m*V,G+=w*B,X=G>>>13,G&=8191,G+=_*I,G+=v*U,G+=b*j,G+=A*(5*x),G+=S*(5*k),X+=G>>>13,G&=8191;var Z=X;Z+=f*k,Z+=h*N,Z+=g*Y,Z+=m*se,Z+=w*V,X=Z>>>13,Z&=8191,Z+=_*B,Z+=v*I,Z+=b*U,Z+=A*j,Z+=S*(5*x),X+=Z>>>13,Z&=8191;var me=X;me+=f*x,me+=h*k,me+=g*N,me+=m*Y,me+=w*se,X=me>>>13,me&=8191,me+=_*V,me+=v*B,me+=b*I,me+=A*U,me+=S*j,X+=me>>>13,me&=8191,X=(X<<2)+X|0,X=X+le|0,le=X&8191,X=X>>>13,H+=X,f=le,h=H,g=ee,m=J,w=te,_=re,v=z,b=G,A=Z,S=me,l+=16,c-=16}this._h[0]=f,this._h[1]=h,this._h[2]=g,this._h[3]=m,this._h[4]=w,this._h[5]=_,this._h[6]=v,this._h[7]=b,this._h[8]=A,this._h[9]=S},s.prototype.finish=function(o,l){l===void 0&&(l=0);var c=new Uint16Array(10),u,f,h,g;if(this._leftover){for(g=this._leftover,this._buffer[g++]=1;g<16;g++)this._buffer[g]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,g=2;g<10;g++)this._h[g]+=u,u=this._h[g]>>>13,this._h[g]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,c[0]=this._h[0]+5,u=c[0]>>>13,c[0]&=8191,g=1;g<10;g++)c[g]=this._h[g]+u,u=c[g]>>>13,c[g]&=8191;for(c[9]-=8192,f=(u^1)-1,g=0;g<10;g++)c[g]&=f;for(f=~f,g=0;g<10;g++)this._h[g]=this._h[g]&f|c[g];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,h=this._h[0]+this._pad[0],this._h[0]=h&65535,g=1;g<8;g++)h=(this._h[g]+this._pad[g]|0)+(h>>>16)|0,this._h[g]=h&65535;return o[l+0]=this._h[0]>>>0,o[l+1]=this._h[0]>>>8,o[l+2]=this._h[1]>>>0,o[l+3]=this._h[1]>>>8,o[l+4]=this._h[2]>>>0,o[l+5]=this._h[2]>>>8,o[l+6]=this._h[3]>>>0,o[l+7]=this._h[3]>>>8,o[l+8]=this._h[4]>>>0,o[l+9]=this._h[4]>>>8,o[l+10]=this._h[5]>>>0,o[l+11]=this._h[5]>>>8,o[l+12]=this._h[6]>>>0,o[l+13]=this._h[6]>>>8,o[l+14]=this._h[7]>>>0,o[l+15]=this._h[7]>>>8,this._finished=!0,this},s.prototype.update=function(o){var l=0,c=o.length,u;if(this._leftover){u=16-this._leftover,u>c&&(u=c);for(var f=0;f=16&&(u=c-c%16,this._blocks(o,l,u),l+=u,c-=u),c){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var g=new Uint8Array(16);g.set(c,g.length-c.length);var m=new Uint8Array(32);e.stream(this._key,g,m,4);var w=u.length+this.tagLength,_;if(h){if(h.length!==w)throw new Error("ChaCha20Poly1305: incorrect destination length");_=h}else _=new Uint8Array(w);return e.streamXOR(this._key,g,u,_,4),this._authenticate(_.subarray(_.length-this.tagLength,_.length),m,_.subarray(0,_.length-this.tagLength),f),n.wipe(g),_},l.prototype.open=function(c,u,f,h){if(c.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&g.update(s.subarray(h.length%16))),g.update(f),f.length%16>0&&g.update(s.subarray(f.length%16));var m=new Uint8Array(8);h&&i.writeUint64LE(h.length,m),g.update(m),i.writeUint64LE(f.length,m),g.update(m);for(var w=g.digest(),_=0;_this.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&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;n256)throw new Error("randomString charset is too long");let h="";const g=u.length,m=256-256%g;for(;c>0;){const w=i(Math.ceil(c*256/m),f);for(let _=0;_0;_++){const v=w[_];v0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._temp,this._state,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},o.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,h=c<<3,g=c%64<56?64:128;this._buffer[u]=128;for(var m=u+1;m0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},o}();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(o,l,c,u,f){for(;f>=64;){for(var h=l[0],g=l[1],m=l[2],w=l[3],_=l[4],v=l[5],b=l[6],A=l[7],S=0;S<16;S++){var j=u+S*4;o[S]=e.readUint32BE(c,j)}for(var S=16;S<64;S++){var U=o[S-2],I=(U>>>17|U<<15)^(U>>>19|U<<13)^U>>>10;U=o[S-15];var B=(U>>>7|U<<25)^(U>>>18|U<<14)^U>>>3;o[S]=(I+o[S-7]|0)+(B+o[S-16]|0)}for(var S=0;S<64;S++){var I=(((_>>>6|_<<26)^(_>>>11|_<<21)^(_>>>25|_<<7))+(_&v^~_&b)|0)+(A+(i[S]+o[S]|0)|0)|0,B=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&g^h&m^g&m)|0;A=b,b=v,v=_,_=w+I|0,w=m,m=g,g=h,h=I+B|0}l[0]+=h,l[1]+=g,l[2]+=m,l[3]+=w,l[4]+=_,l[5]+=v,l[6]+=b,l[7]+=A,u+=64,f-=64}return u}function s(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=s})(nv);var uj={};(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=Sh,r=Po;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(S){const j=new Float64Array(16);if(S)for(let U=0;U>16&1),U[se-1]&=65535;U[15]=I[15]-32767-(U[14]>>16&1);const V=U[15]>>16&1;U[14]&=65535,o(I,U,1-V)}for(let B=0;B<16;B++)S[2*B]=I[B]&255,S[2*B+1]=I[B]>>8}function c(S,j){for(let U=0;U<16;U++)S[U]=j[2*U]+(j[2*U+1]<<8);S[15]&=32767}function u(S,j,U){for(let I=0;I<16;I++)S[I]=j[I]+U[I]}function f(S,j,U){for(let I=0;I<16;I++)S[I]=j[I]-U[I]}function h(S,j,U){let I,B,V=0,se=0,Y=0,N=0,k=0,x=0,E=0,L=0,O=0,P=0,R=0,M=0,D=0,$=0,X=0,le=0,H=0,ee=0,J=0,te=0,re=0,z=0,G=0,Z=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ke=0,lt=0,Ee=U[0],He=U[1],qe=U[2],Ie=U[3],Ne=U[4],Pe=U[5],$e=U[6],K=U[7],F=U[8],W=U[9],ie=U[10],pe=U[11],we=U[12],he=U[13],De=U[14],Je=U[15];I=j[0],V+=I*Ee,se+=I*He,Y+=I*qe,N+=I*Ie,k+=I*Ne,x+=I*Pe,E+=I*$e,L+=I*K,O+=I*F,P+=I*W,R+=I*ie,M+=I*pe,D+=I*we,$+=I*he,X+=I*De,le+=I*Je,I=j[1],se+=I*Ee,Y+=I*He,N+=I*qe,k+=I*Ie,x+=I*Ne,E+=I*Pe,L+=I*$e,O+=I*K,P+=I*F,R+=I*W,M+=I*ie,D+=I*pe,$+=I*we,X+=I*he,le+=I*De,H+=I*Je,I=j[2],Y+=I*Ee,N+=I*He,k+=I*qe,x+=I*Ie,E+=I*Ne,L+=I*Pe,O+=I*$e,P+=I*K,R+=I*F,M+=I*W,D+=I*ie,$+=I*pe,X+=I*we,le+=I*he,H+=I*De,ee+=I*Je,I=j[3],N+=I*Ee,k+=I*He,x+=I*qe,E+=I*Ie,L+=I*Ne,O+=I*Pe,P+=I*$e,R+=I*K,M+=I*F,D+=I*W,$+=I*ie,X+=I*pe,le+=I*we,H+=I*he,ee+=I*De,J+=I*Je,I=j[4],k+=I*Ee,x+=I*He,E+=I*qe,L+=I*Ie,O+=I*Ne,P+=I*Pe,R+=I*$e,M+=I*K,D+=I*F,$+=I*W,X+=I*ie,le+=I*pe,H+=I*we,ee+=I*he,J+=I*De,te+=I*Je,I=j[5],x+=I*Ee,E+=I*He,L+=I*qe,O+=I*Ie,P+=I*Ne,R+=I*Pe,M+=I*$e,D+=I*K,$+=I*F,X+=I*W,le+=I*ie,H+=I*pe,ee+=I*we,J+=I*he,te+=I*De,re+=I*Je,I=j[6],E+=I*Ee,L+=I*He,O+=I*qe,P+=I*Ie,R+=I*Ne,M+=I*Pe,D+=I*$e,$+=I*K,X+=I*F,le+=I*W,H+=I*ie,ee+=I*pe,J+=I*we,te+=I*he,re+=I*De,z+=I*Je,I=j[7],L+=I*Ee,O+=I*He,P+=I*qe,R+=I*Ie,M+=I*Ne,D+=I*Pe,$+=I*$e,X+=I*K,le+=I*F,H+=I*W,ee+=I*ie,J+=I*pe,te+=I*we,re+=I*he,z+=I*De,G+=I*Je,I=j[8],O+=I*Ee,P+=I*He,R+=I*qe,M+=I*Ie,D+=I*Ne,$+=I*Pe,X+=I*$e,le+=I*K,H+=I*F,ee+=I*W,J+=I*ie,te+=I*pe,re+=I*we,z+=I*he,G+=I*De,Z+=I*Je,I=j[9],P+=I*Ee,R+=I*He,M+=I*qe,D+=I*Ie,$+=I*Ne,X+=I*Pe,le+=I*$e,H+=I*K,ee+=I*F,J+=I*W,te+=I*ie,re+=I*pe,z+=I*we,G+=I*he,Z+=I*De,me+=I*Je,I=j[10],R+=I*Ee,M+=I*He,D+=I*qe,$+=I*Ie,X+=I*Ne,le+=I*Pe,H+=I*$e,ee+=I*K,J+=I*F,te+=I*W,re+=I*ie,z+=I*pe,G+=I*we,Z+=I*he,me+=I*De,be+=I*Je,I=j[11],M+=I*Ee,D+=I*He,$+=I*qe,X+=I*Ie,le+=I*Ne,H+=I*Pe,ee+=I*$e,J+=I*K,te+=I*F,re+=I*W,z+=I*ie,G+=I*pe,Z+=I*we,me+=I*he,be+=I*De,Ce+=I*Je,I=j[12],D+=I*Ee,$+=I*He,X+=I*qe,le+=I*Ie,H+=I*Ne,ee+=I*Pe,J+=I*$e,te+=I*K,re+=I*F,z+=I*W,G+=I*ie,Z+=I*pe,me+=I*we,be+=I*he,Ce+=I*De,Fe+=I*Je,I=j[13],$+=I*Ee,X+=I*He,le+=I*qe,H+=I*Ie,ee+=I*Ne,J+=I*Pe,te+=I*$e,re+=I*K,z+=I*F,G+=I*W,Z+=I*ie,me+=I*pe,be+=I*we,Ce+=I*he,Fe+=I*De,Ue+=I*Je,I=j[14],X+=I*Ee,le+=I*He,H+=I*qe,ee+=I*Ie,J+=I*Ne,te+=I*Pe,re+=I*$e,z+=I*K,G+=I*F,Z+=I*W,me+=I*ie,be+=I*pe,Ce+=I*we,Fe+=I*he,Ue+=I*De,Ke+=I*Je,I=j[15],le+=I*Ee,H+=I*He,ee+=I*qe,J+=I*Ie,te+=I*Ne,re+=I*Pe,z+=I*$e,G+=I*K,Z+=I*F,me+=I*W,be+=I*ie,Ce+=I*pe,Fe+=I*we,Ue+=I*he,Ke+=I*De,lt+=I*Je,V+=38*H,se+=38*ee,Y+=38*J,N+=38*te,k+=38*re,x+=38*z,E+=38*G,L+=38*Z,O+=38*me,P+=38*be,R+=38*Ce,M+=38*Fe,D+=38*Ue,$+=38*Ke,X+=38*lt,B=1,I=V+B+65535,B=Math.floor(I/65536),V=I-B*65536,I=se+B+65535,B=Math.floor(I/65536),se=I-B*65536,I=Y+B+65535,B=Math.floor(I/65536),Y=I-B*65536,I=N+B+65535,B=Math.floor(I/65536),N=I-B*65536,I=k+B+65535,B=Math.floor(I/65536),k=I-B*65536,I=x+B+65535,B=Math.floor(I/65536),x=I-B*65536,I=E+B+65535,B=Math.floor(I/65536),E=I-B*65536,I=L+B+65535,B=Math.floor(I/65536),L=I-B*65536,I=O+B+65535,B=Math.floor(I/65536),O=I-B*65536,I=P+B+65535,B=Math.floor(I/65536),P=I-B*65536,I=R+B+65535,B=Math.floor(I/65536),R=I-B*65536,I=M+B+65535,B=Math.floor(I/65536),M=I-B*65536,I=D+B+65535,B=Math.floor(I/65536),D=I-B*65536,I=$+B+65535,B=Math.floor(I/65536),$=I-B*65536,I=X+B+65535,B=Math.floor(I/65536),X=I-B*65536,I=le+B+65535,B=Math.floor(I/65536),le=I-B*65536,V+=B-1+37*(B-1),B=1,I=V+B+65535,B=Math.floor(I/65536),V=I-B*65536,I=se+B+65535,B=Math.floor(I/65536),se=I-B*65536,I=Y+B+65535,B=Math.floor(I/65536),Y=I-B*65536,I=N+B+65535,B=Math.floor(I/65536),N=I-B*65536,I=k+B+65535,B=Math.floor(I/65536),k=I-B*65536,I=x+B+65535,B=Math.floor(I/65536),x=I-B*65536,I=E+B+65535,B=Math.floor(I/65536),E=I-B*65536,I=L+B+65535,B=Math.floor(I/65536),L=I-B*65536,I=O+B+65535,B=Math.floor(I/65536),O=I-B*65536,I=P+B+65535,B=Math.floor(I/65536),P=I-B*65536,I=R+B+65535,B=Math.floor(I/65536),R=I-B*65536,I=M+B+65535,B=Math.floor(I/65536),M=I-B*65536,I=D+B+65535,B=Math.floor(I/65536),D=I-B*65536,I=$+B+65535,B=Math.floor(I/65536),$=I-B*65536,I=X+B+65535,B=Math.floor(I/65536),X=I-B*65536,I=le+B+65535,B=Math.floor(I/65536),le=I-B*65536,V+=B-1+37*(B-1),S[0]=V,S[1]=se,S[2]=Y,S[3]=N,S[4]=k,S[5]=x,S[6]=E,S[7]=L,S[8]=O,S[9]=P,S[10]=R,S[11]=M,S[12]=D,S[13]=$,S[14]=X,S[15]=le}function g(S,j){h(S,j,j)}function m(S,j){const U=n();for(let I=0;I<16;I++)U[I]=j[I];for(let I=253;I>=0;I--)g(U,U),I!==2&&I!==4&&h(U,U,j);for(let I=0;I<16;I++)S[I]=U[I]}function w(S,j){const U=new Uint8Array(32),I=new Float64Array(80),B=n(),V=n(),se=n(),Y=n(),N=n(),k=n();for(let O=0;O<31;O++)U[O]=S[O];U[31]=S[31]&127|64,U[0]&=248,c(I,j);for(let O=0;O<16;O++)V[O]=I[O];B[0]=Y[0]=1;for(let O=254;O>=0;--O){const P=U[O>>>3]>>>(O&7)&1;o(B,V,P),o(se,Y,P),u(N,B,se),f(B,B,se),u(se,V,Y),f(V,V,Y),g(Y,N),g(k,B),h(B,se,B),h(se,V,N),u(N,B,se),f(B,B,se),g(V,B),f(se,Y,k),h(B,se,a),u(B,B,Y),h(se,se,B),h(B,Y,k),h(Y,V,I),g(V,N),o(B,V,P),o(se,Y,P)}for(let O=0;O<16;O++)I[O+16]=B[O],I[O+32]=se[O],I[O+48]=V[O],I[O+64]=Y[O];const x=I.subarray(32),E=I.subarray(16);m(x,x),h(E,E,x);const L=new Uint8Array(32);return l(L,E),L}t.scalarMult=w;function _(S){return w(S,i)}t.scalarMultBase=_;function v(S){if(S.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const j=new Uint8Array(S);return{publicKey:_(j),secretKey:j}}t.generateKeyPairFromSeed=v;function b(S){const j=(0,e.randomBytes)(32,S),U=v(j);return(0,r.wipe)(j),U}t.generateKeyPair=b;function A(S,j,U=!1){if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(j.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const I=w(S,j);if(U){let B=0;for(let V=0;Vi+a.length,0));const r=Tne(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function RFe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(A);v!==b;){for(var j=m[v],U=0,I=A-1;(j!==0||U<_)&&I!==-1;I--,U++)j+=256*S[I]>>>0,S[I]=j%o>>>0,j=j/o>>>0;if(j!==0)throw new Error("Non-zero carry");_=U,v++}for(var B=A-_;B!==A&&S[B]===0;)B++;for(var V=l.repeat(w);B>>0,A=new Uint8Array(b);m[w];){var S=r[m.charCodeAt(w)];if(S===255)return;for(var j=0,U=b-1;(S!==0||j>>0,A[U]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");v=j,w++}if(m[w]!==" "){for(var I=b-v;I!==b&&A[I]===0;)I++;for(var B=new Uint8Array(_+(b-I)),V=_;I!==b;)B[V++]=A[I++];return B}}}function g(m){var w=h(m);if(w)return w;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:g}}var DFe=RFe,OFe=DFe;const FFe=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")},UFe=t=>new TextEncoder().encode(t),BFe=t=>new TextDecoder().decode(t);class zFe{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 WFe{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 kne(this,e)}}class HFe{constructor(e){this.decoders=e}or(e){return kne(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 kne=(t,e)=>new HFe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class GFe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new zFe(e,r,n),this.decoder=new WFe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const zx=({name:t,prefix:e,encode:r,decode:n})=>new GFe(t,e,r,n),iv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=OFe(r,e);return zx({prefix:t,name:e,encode:n,decode:a=>FFe(i(a))})},qFe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,s[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return s},VFe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<zx({prefix:e,name:t,encode(i){return VFe(i,n,r)},decode(i){return qFe(i,n,r,t)}}),YFe=zx({prefix:"\0",name:"identity",encode:t=>BFe(t),decode:t=>UFe(t)}),KFe=Object.freeze(Object.defineProperty({__proto__:null,identity:YFe},Symbol.toStringTag,{value:"Module"})),JFe=ba({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),ZFe=Object.freeze(Object.defineProperty({__proto__:null,base2:JFe},Symbol.toStringTag,{value:"Module"})),QFe=ba({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),XFe=Object.freeze(Object.defineProperty({__proto__:null,base8:QFe},Symbol.toStringTag,{value:"Module"})),eUe=iv({prefix:"9",name:"base10",alphabet:"0123456789"}),tUe=Object.freeze(Object.defineProperty({__proto__:null,base10:eUe},Symbol.toStringTag,{value:"Module"})),rUe=ba({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),nUe=ba({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),iUe=Object.freeze(Object.defineProperty({__proto__:null,base16:rUe,base16upper:nUe},Symbol.toStringTag,{value:"Module"})),aUe=ba({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),sUe=ba({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),oUe=ba({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),lUe=ba({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),cUe=ba({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),uUe=ba({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),dUe=ba({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),fUe=ba({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),hUe=ba({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),pUe=Object.freeze(Object.defineProperty({__proto__:null,base32:aUe,base32hex:cUe,base32hexpad:dUe,base32hexpadupper:fUe,base32hexupper:uUe,base32pad:oUe,base32padupper:lUe,base32upper:sUe,base32z:hUe},Symbol.toStringTag,{value:"Module"})),gUe=iv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),mUe=iv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),yUe=Object.freeze(Object.defineProperty({__proto__:null,base36:gUe,base36upper:mUe},Symbol.toStringTag,{value:"Module"})),wUe=iv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),vUe=iv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),bUe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:wUe,base58flickr:vUe},Symbol.toStringTag,{value:"Module"})),xUe=ba({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),EUe=ba({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_Ue=ba({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),CUe=ba({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),SUe=Object.freeze(Object.defineProperty({__proto__:null,base64:xUe,base64pad:EUe,base64url:_Ue,base64urlpad:CUe},Symbol.toStringTag,{value:"Module"})),Nne=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),AUe=Nne.reduce((t,e,r)=>(t[r]=e,t),[]),IUe=Nne.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function MUe(t){return t.reduce((e,r)=>(e+=AUe[r],e),"")}function TUe(t){const e=[];for(const r of t){const n=IUe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const kUe=zx({prefix:"🚀",name:"base256emoji",encode:MUe,decode:TUe}),NUe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:kUe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Pz={...KFe,...ZFe,...XFe,...tUe,...iUe,...pUe,...yUe,...bUe,...SUe,...NUe};function Lne(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Rz=Lne("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),pS=Lne("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=Tne(t.length);for(let r=0;r",BUe="MIT",zUe={url:"https://github.com/indutny/elliptic/issues"},WUe="https://github.com/indutny/elliptic",HUe={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},GUe={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},qUe={name:LUe,version:jUe,description:$Ue,main:PUe,files:RUe,scripts:DUe,repository:OUe,keywords:FUe,author:UUe,license:BUe,bugs:zUe,homepage:WUe,devDependencies:HUe,dependencies:GUe};var Ro={},dj={exports:{}};dj.exports;(function(t){(function(e,r){function n(Y,N){if(!Y)throw new Error(N||"Assertion failed")}function i(Y,N){Y.super_=N;var k=function(){};k.prototype=N.prototype,Y.prototype=new k,Y.prototype.constructor=Y}function a(Y,N,k){if(a.isBN(Y))return Y;this.negative=0,this.words=null,this.length=0,this.red=null,Y!==null&&((N==="le"||N==="be")&&(k=N,N=10),this._init(Y||0,N||10,k||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=um.Buffer}catch{}a.isBN=function(N){return N instanceof a?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===a.wordSize&&Array.isArray(N.words)},a.max=function(N,k){return N.cmp(k)>0?N:k},a.min=function(N,k){return N.cmp(k)<0?N:k},a.prototype._init=function(N,k,x){if(typeof N=="number")return this._initNumber(N,k,x);if(typeof N=="object")return this._initArray(N,k,x);k==="hex"&&(k=16),n(k===(k|0)&&k>=2&&k<=36),N=N.toString().replace(/\s+/g,"");var E=0;N[0]==="-"&&(E++,this.negative=1),E=0;E-=3)O=N[E]|N[E-1]<<8|N[E-2]<<16,this.words[L]|=O<>>26-P&67108863,P+=24,P>=26&&(P-=26,L++);else if(x==="le")for(E=0,L=0;E>>26-P&67108863,P+=24,P>=26&&(P-=26,L++);return this.strip()};function o(Y,N){var k=Y.charCodeAt(N);return k>=65&&k<=70?k-55:k>=97&&k<=102?k-87:k-48&15}function l(Y,N,k){var x=o(Y,k);return k-1>=N&&(x|=o(Y,k-1)<<4),x}a.prototype._parseHex=function(N,k,x){this.length=Math.ceil((N.length-k)/6),this.words=new Array(this.length);for(var E=0;E=k;E-=2)P=l(N,k,E)<=18?(L-=18,O+=1,this.words[O]|=P>>>26):L+=8;else{var R=N.length-k;for(E=R%2===0?k+1:k;E=18?(L-=18,O+=1,this.words[O]|=P>>>26):L+=8}this.strip()};function c(Y,N,k,x){for(var E=0,L=Math.min(Y.length,k),O=N;O=49?E+=P-49+10:P>=17?E+=P-17+10:E+=P}return E}a.prototype._parseBase=function(N,k,x){this.words=[0],this.length=1;for(var E=0,L=1;L<=67108863;L*=k)E++;E--,L=L/k|0;for(var O=N.length-x,P=O%E,R=Math.min(O,O-P)+x,M=0,D=x;D1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(N,k){N=N||10,k=k|0||1;var x;if(N===16||N==="hex"){x="";for(var E=0,L=0,O=0;O>>24-E&16777215,E+=2,E>=26&&(E-=26,O--),L!==0||O!==this.length-1?x=u[6-R.length]+R+x:x=R+x}for(L!==0&&(x=L.toString(16)+x);x.length%k!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(N===(N|0)&&N>=2&&N<=36){var M=f[N],D=h[N];x="";var $=this.clone();for($.negative=0;!$.isZero();){var X=$.modn(D).toString(N);$=$.idivn(D),$.isZero()?x=X+x:x=u[M-X.length]+X+x}for(this.isZero()&&(x="0"+x);x.length%k!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var N=this.words[0];return this.length===2?N+=this.words[1]*67108864:this.length===3&&this.words[2]===1?N+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-N:N},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(N,k){return n(typeof s<"u"),this.toArrayLike(s,N,k)},a.prototype.toArray=function(N,k){return this.toArrayLike(Array,N,k)},a.prototype.toArrayLike=function(N,k,x){var E=this.byteLength(),L=x||Math.max(1,E);n(E<=L,"byte array longer than desired length"),n(L>0,"Requested array length <= 0"),this.strip();var O=k==="le",P=new N(L),R,M,D=this.clone();if(O){for(M=0;!D.isZero();M++)R=D.andln(255),D.iushrn(8),P[M]=R;for(;M=4096&&(x+=13,k>>>=13),k>=64&&(x+=7,k>>>=7),k>=8&&(x+=4,k>>>=4),k>=2&&(x+=2,k>>>=2),x+k},a.prototype._zeroBits=function(N){if(N===0)return 26;var k=N,x=0;return k&8191||(x+=13,k>>>=13),k&127||(x+=7,k>>>=7),k&15||(x+=4,k>>>=4),k&3||(x+=2,k>>>=2),k&1||x++,x},a.prototype.bitLength=function(){var N=this.words[this.length-1],k=this._countBits(N);return(this.length-1)*26+k};function g(Y){for(var N=new Array(Y.bitLength()),k=0;k>>E}return N}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,k=0;kN.length?this.clone().ior(N):N.clone().ior(this)},a.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},a.prototype.iuand=function(N){var k;this.length>N.length?k=N:k=this;for(var x=0;xN.length?this.clone().iand(N):N.clone().iand(this)},a.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},a.prototype.iuxor=function(N){var k,x;this.length>N.length?(k=this,x=N):(k=N,x=this);for(var E=0;EN.length?this.clone().ixor(N):N.clone().ixor(this)},a.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},a.prototype.inotn=function(N){n(typeof N=="number"&&N>=0);var k=Math.ceil(N/26)|0,x=N%26;this._expand(k),x>0&&k--;for(var E=0;E0&&(this.words[E]=~this.words[E]&67108863>>26-x),this.strip()},a.prototype.notn=function(N){return this.clone().inotn(N)},a.prototype.setn=function(N,k){n(typeof N=="number"&&N>=0);var x=N/26|0,E=N%26;return this._expand(x+1),k?this.words[x]=this.words[x]|1<N.length?(x=this,E=N):(x=N,E=this);for(var L=0,O=0;O>>26;for(;L!==0&&O>>26;if(this.length=x.length,L!==0)this.words[this.length]=L,this.length++;else if(x!==this)for(;ON.length?this.clone().iadd(N):N.clone().iadd(this)},a.prototype.isub=function(N){if(N.negative!==0){N.negative=0;var k=this.iadd(N);return N.negative=1,k._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(N),this.negative=1,this._normSign();var x=this.cmp(N);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,L;x>0?(E=this,L=N):(E=N,L=this);for(var O=0,P=0;P>26,this.words[P]=k&67108863;for(;O!==0&&P>26,this.words[P]=k&67108863;if(O===0&&P>>26,$=R&67108863,X=Math.min(M,N.length-1),le=Math.max(0,M-Y.length+1);le<=X;le++){var H=M-le|0;E=Y.words[H]|0,L=N.words[le]|0,O=E*L+$,D+=O/67108864|0,$=O&67108863}k.words[M]=$|0,R=D|0}return R!==0?k.words[M]=R|0:k.length--,k.strip()}var w=function(N,k,x){var E=N.words,L=k.words,O=x.words,P=0,R,M,D,$=E[0]|0,X=$&8191,le=$>>>13,H=E[1]|0,ee=H&8191,J=H>>>13,te=E[2]|0,re=te&8191,z=te>>>13,G=E[3]|0,Z=G&8191,me=G>>>13,be=E[4]|0,Ce=be&8191,Fe=be>>>13,Ue=E[5]|0,Ke=Ue&8191,lt=Ue>>>13,Ee=E[6]|0,He=Ee&8191,qe=Ee>>>13,Ie=E[7]|0,Ne=Ie&8191,Pe=Ie>>>13,$e=E[8]|0,K=$e&8191,F=$e>>>13,W=E[9]|0,ie=W&8191,pe=W>>>13,we=L[0]|0,he=we&8191,De=we>>>13,Je=L[1]|0,et=Je&8191,it=Je>>>13,ut=L[2]|0,pt=ut&8191,tr=ut>>>13,zt=L[3]|0,At=zt&8191,mt=zt>>>13,St=L[4]|0,dt=St&8191,Nt=St>>>13,Rt=L[5]|0,gt=Rt&8191,qt=Rt>>>13,Wt=L[6]|0,ot=Wt&8191,Vt=Wt>>>13,Ft=L[7]|0,yt=Ft&8191,Qe=Ft>>>13,Pt=L[8]|0,xt=Pt&8191,Jt=Pt>>>13,Cr=L[9]|0,Gt=Cr&8191,Sr=Cr>>>13;x.negative=N.negative^k.negative,x.length=19,R=Math.imul(X,he),M=Math.imul(X,De),M=M+Math.imul(le,he)|0,D=Math.imul(le,De);var cr=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(cr>>>26)|0,cr&=67108863,R=Math.imul(ee,he),M=Math.imul(ee,De),M=M+Math.imul(J,he)|0,D=Math.imul(J,De),R=R+Math.imul(X,et)|0,M=M+Math.imul(X,it)|0,M=M+Math.imul(le,et)|0,D=D+Math.imul(le,it)|0;var br=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(br>>>26)|0,br&=67108863,R=Math.imul(re,he),M=Math.imul(re,De),M=M+Math.imul(z,he)|0,D=Math.imul(z,De),R=R+Math.imul(ee,et)|0,M=M+Math.imul(ee,it)|0,M=M+Math.imul(J,et)|0,D=D+Math.imul(J,it)|0,R=R+Math.imul(X,pt)|0,M=M+Math.imul(X,tr)|0,M=M+Math.imul(le,pt)|0,D=D+Math.imul(le,tr)|0;var Q=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Q>>>26)|0,Q&=67108863,R=Math.imul(Z,he),M=Math.imul(Z,De),M=M+Math.imul(me,he)|0,D=Math.imul(me,De),R=R+Math.imul(re,et)|0,M=M+Math.imul(re,it)|0,M=M+Math.imul(z,et)|0,D=D+Math.imul(z,it)|0,R=R+Math.imul(ee,pt)|0,M=M+Math.imul(ee,tr)|0,M=M+Math.imul(J,pt)|0,D=D+Math.imul(J,tr)|0,R=R+Math.imul(X,At)|0,M=M+Math.imul(X,mt)|0,M=M+Math.imul(le,At)|0,D=D+Math.imul(le,mt)|0;var ae=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ae>>>26)|0,ae&=67108863,R=Math.imul(Ce,he),M=Math.imul(Ce,De),M=M+Math.imul(Fe,he)|0,D=Math.imul(Fe,De),R=R+Math.imul(Z,et)|0,M=M+Math.imul(Z,it)|0,M=M+Math.imul(me,et)|0,D=D+Math.imul(me,it)|0,R=R+Math.imul(re,pt)|0,M=M+Math.imul(re,tr)|0,M=M+Math.imul(z,pt)|0,D=D+Math.imul(z,tr)|0,R=R+Math.imul(ee,At)|0,M=M+Math.imul(ee,mt)|0,M=M+Math.imul(J,At)|0,D=D+Math.imul(J,mt)|0,R=R+Math.imul(X,dt)|0,M=M+Math.imul(X,Nt)|0,M=M+Math.imul(le,dt)|0,D=D+Math.imul(le,Nt)|0;var de=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(de>>>26)|0,de&=67108863,R=Math.imul(Ke,he),M=Math.imul(Ke,De),M=M+Math.imul(lt,he)|0,D=Math.imul(lt,De),R=R+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,it)|0,M=M+Math.imul(Fe,et)|0,D=D+Math.imul(Fe,it)|0,R=R+Math.imul(Z,pt)|0,M=M+Math.imul(Z,tr)|0,M=M+Math.imul(me,pt)|0,D=D+Math.imul(me,tr)|0,R=R+Math.imul(re,At)|0,M=M+Math.imul(re,mt)|0,M=M+Math.imul(z,At)|0,D=D+Math.imul(z,mt)|0,R=R+Math.imul(ee,dt)|0,M=M+Math.imul(ee,Nt)|0,M=M+Math.imul(J,dt)|0,D=D+Math.imul(J,Nt)|0,R=R+Math.imul(X,gt)|0,M=M+Math.imul(X,qt)|0,M=M+Math.imul(le,gt)|0,D=D+Math.imul(le,qt)|0;var ue=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ue>>>26)|0,ue&=67108863,R=Math.imul(He,he),M=Math.imul(He,De),M=M+Math.imul(qe,he)|0,D=Math.imul(qe,De),R=R+Math.imul(Ke,et)|0,M=M+Math.imul(Ke,it)|0,M=M+Math.imul(lt,et)|0,D=D+Math.imul(lt,it)|0,R=R+Math.imul(Ce,pt)|0,M=M+Math.imul(Ce,tr)|0,M=M+Math.imul(Fe,pt)|0,D=D+Math.imul(Fe,tr)|0,R=R+Math.imul(Z,At)|0,M=M+Math.imul(Z,mt)|0,M=M+Math.imul(me,At)|0,D=D+Math.imul(me,mt)|0,R=R+Math.imul(re,dt)|0,M=M+Math.imul(re,Nt)|0,M=M+Math.imul(z,dt)|0,D=D+Math.imul(z,Nt)|0,R=R+Math.imul(ee,gt)|0,M=M+Math.imul(ee,qt)|0,M=M+Math.imul(J,gt)|0,D=D+Math.imul(J,qt)|0,R=R+Math.imul(X,ot)|0,M=M+Math.imul(X,Vt)|0,M=M+Math.imul(le,ot)|0,D=D+Math.imul(le,Vt)|0;var ve=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ve>>>26)|0,ve&=67108863,R=Math.imul(Ne,he),M=Math.imul(Ne,De),M=M+Math.imul(Pe,he)|0,D=Math.imul(Pe,De),R=R+Math.imul(He,et)|0,M=M+Math.imul(He,it)|0,M=M+Math.imul(qe,et)|0,D=D+Math.imul(qe,it)|0,R=R+Math.imul(Ke,pt)|0,M=M+Math.imul(Ke,tr)|0,M=M+Math.imul(lt,pt)|0,D=D+Math.imul(lt,tr)|0,R=R+Math.imul(Ce,At)|0,M=M+Math.imul(Ce,mt)|0,M=M+Math.imul(Fe,At)|0,D=D+Math.imul(Fe,mt)|0,R=R+Math.imul(Z,dt)|0,M=M+Math.imul(Z,Nt)|0,M=M+Math.imul(me,dt)|0,D=D+Math.imul(me,Nt)|0,R=R+Math.imul(re,gt)|0,M=M+Math.imul(re,qt)|0,M=M+Math.imul(z,gt)|0,D=D+Math.imul(z,qt)|0,R=R+Math.imul(ee,ot)|0,M=M+Math.imul(ee,Vt)|0,M=M+Math.imul(J,ot)|0,D=D+Math.imul(J,Vt)|0,R=R+Math.imul(X,yt)|0,M=M+Math.imul(X,Qe)|0,M=M+Math.imul(le,yt)|0,D=D+Math.imul(le,Qe)|0;var je=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(je>>>26)|0,je&=67108863,R=Math.imul(K,he),M=Math.imul(K,De),M=M+Math.imul(F,he)|0,D=Math.imul(F,De),R=R+Math.imul(Ne,et)|0,M=M+Math.imul(Ne,it)|0,M=M+Math.imul(Pe,et)|0,D=D+Math.imul(Pe,it)|0,R=R+Math.imul(He,pt)|0,M=M+Math.imul(He,tr)|0,M=M+Math.imul(qe,pt)|0,D=D+Math.imul(qe,tr)|0,R=R+Math.imul(Ke,At)|0,M=M+Math.imul(Ke,mt)|0,M=M+Math.imul(lt,At)|0,D=D+Math.imul(lt,mt)|0,R=R+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,Nt)|0,M=M+Math.imul(Fe,dt)|0,D=D+Math.imul(Fe,Nt)|0,R=R+Math.imul(Z,gt)|0,M=M+Math.imul(Z,qt)|0,M=M+Math.imul(me,gt)|0,D=D+Math.imul(me,qt)|0,R=R+Math.imul(re,ot)|0,M=M+Math.imul(re,Vt)|0,M=M+Math.imul(z,ot)|0,D=D+Math.imul(z,Vt)|0,R=R+Math.imul(ee,yt)|0,M=M+Math.imul(ee,Qe)|0,M=M+Math.imul(J,yt)|0,D=D+Math.imul(J,Qe)|0,R=R+Math.imul(X,xt)|0,M=M+Math.imul(X,Jt)|0,M=M+Math.imul(le,xt)|0,D=D+Math.imul(le,Jt)|0;var Ge=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,R=Math.imul(ie,he),M=Math.imul(ie,De),M=M+Math.imul(pe,he)|0,D=Math.imul(pe,De),R=R+Math.imul(K,et)|0,M=M+Math.imul(K,it)|0,M=M+Math.imul(F,et)|0,D=D+Math.imul(F,it)|0,R=R+Math.imul(Ne,pt)|0,M=M+Math.imul(Ne,tr)|0,M=M+Math.imul(Pe,pt)|0,D=D+Math.imul(Pe,tr)|0,R=R+Math.imul(He,At)|0,M=M+Math.imul(He,mt)|0,M=M+Math.imul(qe,At)|0,D=D+Math.imul(qe,mt)|0,R=R+Math.imul(Ke,dt)|0,M=M+Math.imul(Ke,Nt)|0,M=M+Math.imul(lt,dt)|0,D=D+Math.imul(lt,Nt)|0,R=R+Math.imul(Ce,gt)|0,M=M+Math.imul(Ce,qt)|0,M=M+Math.imul(Fe,gt)|0,D=D+Math.imul(Fe,qt)|0,R=R+Math.imul(Z,ot)|0,M=M+Math.imul(Z,Vt)|0,M=M+Math.imul(me,ot)|0,D=D+Math.imul(me,Vt)|0,R=R+Math.imul(re,yt)|0,M=M+Math.imul(re,Qe)|0,M=M+Math.imul(z,yt)|0,D=D+Math.imul(z,Qe)|0,R=R+Math.imul(ee,xt)|0,M=M+Math.imul(ee,Jt)|0,M=M+Math.imul(J,xt)|0,D=D+Math.imul(J,Jt)|0,R=R+Math.imul(X,Gt)|0,M=M+Math.imul(X,Sr)|0,M=M+Math.imul(le,Gt)|0,D=D+Math.imul(le,Sr)|0;var Be=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Be>>>26)|0,Be&=67108863,R=Math.imul(ie,et),M=Math.imul(ie,it),M=M+Math.imul(pe,et)|0,D=Math.imul(pe,it),R=R+Math.imul(K,pt)|0,M=M+Math.imul(K,tr)|0,M=M+Math.imul(F,pt)|0,D=D+Math.imul(F,tr)|0,R=R+Math.imul(Ne,At)|0,M=M+Math.imul(Ne,mt)|0,M=M+Math.imul(Pe,At)|0,D=D+Math.imul(Pe,mt)|0,R=R+Math.imul(He,dt)|0,M=M+Math.imul(He,Nt)|0,M=M+Math.imul(qe,dt)|0,D=D+Math.imul(qe,Nt)|0,R=R+Math.imul(Ke,gt)|0,M=M+Math.imul(Ke,qt)|0,M=M+Math.imul(lt,gt)|0,D=D+Math.imul(lt,qt)|0,R=R+Math.imul(Ce,ot)|0,M=M+Math.imul(Ce,Vt)|0,M=M+Math.imul(Fe,ot)|0,D=D+Math.imul(Fe,Vt)|0,R=R+Math.imul(Z,yt)|0,M=M+Math.imul(Z,Qe)|0,M=M+Math.imul(me,yt)|0,D=D+Math.imul(me,Qe)|0,R=R+Math.imul(re,xt)|0,M=M+Math.imul(re,Jt)|0,M=M+Math.imul(z,xt)|0,D=D+Math.imul(z,Jt)|0,R=R+Math.imul(ee,Gt)|0,M=M+Math.imul(ee,Sr)|0,M=M+Math.imul(J,Gt)|0,D=D+Math.imul(J,Sr)|0;var tt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(tt>>>26)|0,tt&=67108863,R=Math.imul(ie,pt),M=Math.imul(ie,tr),M=M+Math.imul(pe,pt)|0,D=Math.imul(pe,tr),R=R+Math.imul(K,At)|0,M=M+Math.imul(K,mt)|0,M=M+Math.imul(F,At)|0,D=D+Math.imul(F,mt)|0,R=R+Math.imul(Ne,dt)|0,M=M+Math.imul(Ne,Nt)|0,M=M+Math.imul(Pe,dt)|0,D=D+Math.imul(Pe,Nt)|0,R=R+Math.imul(He,gt)|0,M=M+Math.imul(He,qt)|0,M=M+Math.imul(qe,gt)|0,D=D+Math.imul(qe,qt)|0,R=R+Math.imul(Ke,ot)|0,M=M+Math.imul(Ke,Vt)|0,M=M+Math.imul(lt,ot)|0,D=D+Math.imul(lt,Vt)|0,R=R+Math.imul(Ce,yt)|0,M=M+Math.imul(Ce,Qe)|0,M=M+Math.imul(Fe,yt)|0,D=D+Math.imul(Fe,Qe)|0,R=R+Math.imul(Z,xt)|0,M=M+Math.imul(Z,Jt)|0,M=M+Math.imul(me,xt)|0,D=D+Math.imul(me,Jt)|0,R=R+Math.imul(re,Gt)|0,M=M+Math.imul(re,Sr)|0,M=M+Math.imul(z,Gt)|0,D=D+Math.imul(z,Sr)|0;var vt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(vt>>>26)|0,vt&=67108863,R=Math.imul(ie,At),M=Math.imul(ie,mt),M=M+Math.imul(pe,At)|0,D=Math.imul(pe,mt),R=R+Math.imul(K,dt)|0,M=M+Math.imul(K,Nt)|0,M=M+Math.imul(F,dt)|0,D=D+Math.imul(F,Nt)|0,R=R+Math.imul(Ne,gt)|0,M=M+Math.imul(Ne,qt)|0,M=M+Math.imul(Pe,gt)|0,D=D+Math.imul(Pe,qt)|0,R=R+Math.imul(He,ot)|0,M=M+Math.imul(He,Vt)|0,M=M+Math.imul(qe,ot)|0,D=D+Math.imul(qe,Vt)|0,R=R+Math.imul(Ke,yt)|0,M=M+Math.imul(Ke,Qe)|0,M=M+Math.imul(lt,yt)|0,D=D+Math.imul(lt,Qe)|0,R=R+Math.imul(Ce,xt)|0,M=M+Math.imul(Ce,Jt)|0,M=M+Math.imul(Fe,xt)|0,D=D+Math.imul(Fe,Jt)|0,R=R+Math.imul(Z,Gt)|0,M=M+Math.imul(Z,Sr)|0,M=M+Math.imul(me,Gt)|0,D=D+Math.imul(me,Sr)|0;var Lt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,R=Math.imul(ie,dt),M=Math.imul(ie,Nt),M=M+Math.imul(pe,dt)|0,D=Math.imul(pe,Nt),R=R+Math.imul(K,gt)|0,M=M+Math.imul(K,qt)|0,M=M+Math.imul(F,gt)|0,D=D+Math.imul(F,qt)|0,R=R+Math.imul(Ne,ot)|0,M=M+Math.imul(Ne,Vt)|0,M=M+Math.imul(Pe,ot)|0,D=D+Math.imul(Pe,Vt)|0,R=R+Math.imul(He,yt)|0,M=M+Math.imul(He,Qe)|0,M=M+Math.imul(qe,yt)|0,D=D+Math.imul(qe,Qe)|0,R=R+Math.imul(Ke,xt)|0,M=M+Math.imul(Ke,Jt)|0,M=M+Math.imul(lt,xt)|0,D=D+Math.imul(lt,Jt)|0,R=R+Math.imul(Ce,Gt)|0,M=M+Math.imul(Ce,Sr)|0,M=M+Math.imul(Fe,Gt)|0,D=D+Math.imul(Fe,Sr)|0;var Ct=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,R=Math.imul(ie,gt),M=Math.imul(ie,qt),M=M+Math.imul(pe,gt)|0,D=Math.imul(pe,qt),R=R+Math.imul(K,ot)|0,M=M+Math.imul(K,Vt)|0,M=M+Math.imul(F,ot)|0,D=D+Math.imul(F,Vt)|0,R=R+Math.imul(Ne,yt)|0,M=M+Math.imul(Ne,Qe)|0,M=M+Math.imul(Pe,yt)|0,D=D+Math.imul(Pe,Qe)|0,R=R+Math.imul(He,xt)|0,M=M+Math.imul(He,Jt)|0,M=M+Math.imul(qe,xt)|0,D=D+Math.imul(qe,Jt)|0,R=R+Math.imul(Ke,Gt)|0,M=M+Math.imul(Ke,Sr)|0,M=M+Math.imul(lt,Gt)|0,D=D+Math.imul(lt,Sr)|0;var ir=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ir>>>26)|0,ir&=67108863,R=Math.imul(ie,ot),M=Math.imul(ie,Vt),M=M+Math.imul(pe,ot)|0,D=Math.imul(pe,Vt),R=R+Math.imul(K,yt)|0,M=M+Math.imul(K,Qe)|0,M=M+Math.imul(F,yt)|0,D=D+Math.imul(F,Qe)|0,R=R+Math.imul(Ne,xt)|0,M=M+Math.imul(Ne,Jt)|0,M=M+Math.imul(Pe,xt)|0,D=D+Math.imul(Pe,Jt)|0,R=R+Math.imul(He,Gt)|0,M=M+Math.imul(He,Sr)|0,M=M+Math.imul(qe,Gt)|0,D=D+Math.imul(qe,Sr)|0;var Qt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Qt>>>26)|0,Qt&=67108863,R=Math.imul(ie,yt),M=Math.imul(ie,Qe),M=M+Math.imul(pe,yt)|0,D=Math.imul(pe,Qe),R=R+Math.imul(K,xt)|0,M=M+Math.imul(K,Jt)|0,M=M+Math.imul(F,xt)|0,D=D+Math.imul(F,Jt)|0,R=R+Math.imul(Ne,Gt)|0,M=M+Math.imul(Ne,Sr)|0,M=M+Math.imul(Pe,Gt)|0,D=D+Math.imul(Pe,Sr)|0;var sn=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(sn>>>26)|0,sn&=67108863,R=Math.imul(ie,xt),M=Math.imul(ie,Jt),M=M+Math.imul(pe,xt)|0,D=Math.imul(pe,Jt),R=R+Math.imul(K,Gt)|0,M=M+Math.imul(K,Sr)|0,M=M+Math.imul(F,Gt)|0,D=D+Math.imul(F,Sr)|0;var Rr=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,R=Math.imul(ie,Gt),M=Math.imul(ie,Sr),M=M+Math.imul(pe,Gt)|0,D=Math.imul(pe,Sr);var dn=(P+R|0)+((M&8191)<<13)|0;return P=(D+(M>>>13)|0)+(dn>>>26)|0,dn&=67108863,O[0]=cr,O[1]=br,O[2]=Q,O[3]=ae,O[4]=de,O[5]=ue,O[6]=ve,O[7]=je,O[8]=Ge,O[9]=Be,O[10]=tt,O[11]=vt,O[12]=Lt,O[13]=Ct,O[14]=ir,O[15]=Qt,O[16]=sn,O[17]=Rr,O[18]=dn,P!==0&&(O[19]=P,x.length++),x};Math.imul||(w=m);function _(Y,N,k){k.negative=N.negative^Y.negative,k.length=Y.length+N.length;for(var x=0,E=0,L=0;L>>26)|0,E+=O>>>26,O&=67108863}k.words[L]=P,x=O,O=E}return x!==0?k.words[L]=x:k.length--,k.strip()}function v(Y,N,k){var x=new b;return x.mulp(Y,N,k)}a.prototype.mulTo=function(N,k){var x,E=this.length+N.length;return this.length===10&&N.length===10?x=w(this,N,k):E<63?x=m(this,N,k):E<1024?x=_(this,N,k):x=v(this,N,k),x};function b(Y,N){this.x=Y,this.y=N}b.prototype.makeRBT=function(N){for(var k=new Array(N),x=a.prototype._countBits(N)-1,E=0;E>=1;return E},b.prototype.permute=function(N,k,x,E,L,O){for(var P=0;P>>1)L++;return 1<>>13,x[2*O+1]=L&8191,L=L>>>13;for(O=2*k;O>=26,k+=E/67108864|0,k+=L>>>26,this.words[x]=L&67108863}return k!==0&&(this.words[x]=k,this.length++),this},a.prototype.muln=function(N){return this.clone().imuln(N)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(N){var k=g(N);if(k.length===0)return new a(1);for(var x=this,E=0;E=0);var k=N%26,x=(N-k)/26,E=67108863>>>26-k<<26-k,L;if(k!==0){var O=0;for(L=0;L>>26-k}O&&(this.words[L]=O,this.length++)}if(x!==0){for(L=this.length-1;L>=0;L--)this.words[L+x]=this.words[L];for(L=0;L=0);var E;k?E=(k-k%26)/26:E=0;var L=N%26,O=Math.min((N-L)/26,this.length),P=67108863^67108863>>>L<O)for(this.length-=O,M=0;M=0&&(D!==0||M>=E);M--){var $=this.words[M]|0;this.words[M]=D<<26-L|$>>>L,D=$&P}return R&&D!==0&&(R.words[R.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(N,k,x){return n(this.negative===0),this.iushrn(N,k,x)},a.prototype.shln=function(N){return this.clone().ishln(N)},a.prototype.ushln=function(N){return this.clone().iushln(N)},a.prototype.shrn=function(N){return this.clone().ishrn(N)},a.prototype.ushrn=function(N){return this.clone().iushrn(N)},a.prototype.testn=function(N){n(typeof N=="number"&&N>=0);var k=N%26,x=(N-k)/26,E=1<=0);var k=N%26,x=(N-k)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(k!==0&&x++,this.length=Math.min(x,this.length),k!==0){var E=67108863^67108863>>>k<=67108864;k++)this.words[k]-=67108864,k===this.length-1?this.words[k+1]=1:this.words[k+1]++;return this.length=Math.max(this.length,k+1),this},a.prototype.isubn=function(N){if(n(typeof N=="number"),n(N<67108864),N<0)return this.iaddn(-N);if(this.negative!==0)return this.negative=0,this.iaddn(N),this.negative=1,this;if(this.words[0]-=N,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var k=0;k>26)-(R/67108864|0),this.words[L+x]=O&67108863}for(;L>26,this.words[L+x]=O&67108863;if(P===0)return this.strip();for(n(P===-1),P=0,L=0;L>26,this.words[L]=O&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(N,k){var x=this.length-N.length,E=this.clone(),L=N,O=L.words[L.length-1]|0,P=this._countBits(O);x=26-P,x!==0&&(L=L.ushln(x),E.iushln(x),O=L.words[L.length-1]|0);var R=E.length-L.length,M;if(k!=="mod"){M=new a(null),M.length=R+1,M.words=new Array(M.length);for(var D=0;D=0;X--){var le=(E.words[L.length+X]|0)*67108864+(E.words[L.length+X-1]|0);for(le=Math.min(le/O|0,67108863),E._ishlnsubmul(L,le,X);E.negative!==0;)le--,E.negative=0,E._ishlnsubmul(L,1,X),E.isZero()||(E.negative^=1);M&&(M.words[X]=le)}return M&&M.strip(),E.strip(),k!=="div"&&x!==0&&E.iushrn(x),{div:M||null,mod:E}},a.prototype.divmod=function(N,k,x){if(n(!N.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var E,L,O;return this.negative!==0&&N.negative===0?(O=this.neg().divmod(N,k),k!=="mod"&&(E=O.div.neg()),k!=="div"&&(L=O.mod.neg(),x&&L.negative!==0&&L.iadd(N)),{div:E,mod:L}):this.negative===0&&N.negative!==0?(O=this.divmod(N.neg(),k),k!=="mod"&&(E=O.div.neg()),{div:E,mod:O.mod}):this.negative&N.negative?(O=this.neg().divmod(N.neg(),k),k!=="div"&&(L=O.mod.neg(),x&&L.negative!==0&&L.isub(N)),{div:O.div,mod:L}):N.length>this.length||this.cmp(N)<0?{div:new a(0),mod:this}:N.length===1?k==="div"?{div:this.divn(N.words[0]),mod:null}:k==="mod"?{div:null,mod:new a(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new a(this.modn(N.words[0]))}:this._wordDiv(N,k)},a.prototype.div=function(N){return this.divmod(N,"div",!1).div},a.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},a.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},a.prototype.divRound=function(N){var k=this.divmod(N);if(k.mod.isZero())return k.div;var x=k.div.negative!==0?k.mod.isub(N):k.mod,E=N.ushrn(1),L=N.andln(1),O=x.cmp(E);return O<0||L===1&&O===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},a.prototype.modn=function(N){n(N<=67108863);for(var k=(1<<26)%N,x=0,E=this.length-1;E>=0;E--)x=(k*x+(this.words[E]|0))%N;return x},a.prototype.idivn=function(N){n(N<=67108863);for(var k=0,x=this.length-1;x>=0;x--){var E=(this.words[x]|0)+k*67108864;this.words[x]=E/N|0,k=E%N}return this.strip()},a.prototype.divn=function(N){return this.clone().idivn(N)},a.prototype.egcd=function(N){n(N.negative===0),n(!N.isZero());var k=this,x=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var E=new a(1),L=new a(0),O=new a(0),P=new a(1),R=0;k.isEven()&&x.isEven();)k.iushrn(1),x.iushrn(1),++R;for(var M=x.clone(),D=k.clone();!k.isZero();){for(var $=0,X=1;!(k.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(k.iushrn($);$-- >0;)(E.isOdd()||L.isOdd())&&(E.iadd(M),L.isub(D)),E.iushrn(1),L.iushrn(1);for(var le=0,H=1;!(x.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(x.iushrn(le);le-- >0;)(O.isOdd()||P.isOdd())&&(O.iadd(M),P.isub(D)),O.iushrn(1),P.iushrn(1);k.cmp(x)>=0?(k.isub(x),E.isub(O),L.isub(P)):(x.isub(k),O.isub(E),P.isub(L))}return{a:O,b:P,gcd:x.iushln(R)}},a.prototype._invmp=function(N){n(N.negative===0),n(!N.isZero());var k=this,x=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var E=new a(1),L=new a(0),O=x.clone();k.cmpn(1)>0&&x.cmpn(1)>0;){for(var P=0,R=1;!(k.words[0]&R)&&P<26;++P,R<<=1);if(P>0)for(k.iushrn(P);P-- >0;)E.isOdd()&&E.iadd(O),E.iushrn(1);for(var M=0,D=1;!(x.words[0]&D)&&M<26;++M,D<<=1);if(M>0)for(x.iushrn(M);M-- >0;)L.isOdd()&&L.iadd(O),L.iushrn(1);k.cmp(x)>=0?(k.isub(x),E.isub(L)):(x.isub(k),L.isub(E))}var $;return k.cmpn(1)===0?$=E:$=L,$.cmpn(0)<0&&$.iadd(N),$},a.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var k=this.clone(),x=N.clone();k.negative=0,x.negative=0;for(var E=0;k.isEven()&&x.isEven();E++)k.iushrn(1),x.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;x.isEven();)x.iushrn(1);var L=k.cmp(x);if(L<0){var O=k;k=x,x=O}else if(L===0||x.cmpn(1)===0)break;k.isub(x)}while(!0);return x.iushln(E)},a.prototype.invm=function(N){return this.egcd(N).a.umod(N)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(N){return this.words[0]&N},a.prototype.bincn=function(N){n(typeof N=="number");var k=N%26,x=(N-k)/26,E=1<>>26,P&=67108863,this.words[O]=P}return L!==0&&(this.words[O]=L,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(N){var k=N<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;this.strip();var x;if(this.length>1)x=1;else{k&&(N=-N),n(N<=67108863,"Number is too big");var E=this.words[0]|0;x=E===N?0:EN.length)return 1;if(this.length=0;x--){var E=this.words[x]|0,L=N.words[x]|0;if(E!==L){EL&&(k=1);break}}return k},a.prototype.gtn=function(N){return this.cmpn(N)===1},a.prototype.gt=function(N){return this.cmp(N)===1},a.prototype.gten=function(N){return this.cmpn(N)>=0},a.prototype.gte=function(N){return this.cmp(N)>=0},a.prototype.ltn=function(N){return this.cmpn(N)===-1},a.prototype.lt=function(N){return this.cmp(N)===-1},a.prototype.lten=function(N){return this.cmpn(N)<=0},a.prototype.lte=function(N){return this.cmp(N)<=0},a.prototype.eqn=function(N){return this.cmpn(N)===0},a.prototype.eq=function(N){return this.cmp(N)===0},a.red=function(N){return new V(N)},a.prototype.toRed=function(N){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),N.convertTo(this)._forceRed(N)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(N){return this.red=N,this},a.prototype.forceRed=function(N){return n(!this.red,"Already a number in reduction context"),this._forceRed(N)},a.prototype.redAdd=function(N){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},a.prototype.redIAdd=function(N){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},a.prototype.redSub=function(N){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},a.prototype.redISub=function(N){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},a.prototype.redShl=function(N){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},a.prototype.redMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},a.prototype.redIMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(N){return n(this.red&&!N.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,N)};var A={k256:null,p224:null,p192:null,p25519:null};function S(Y,N){this.name=Y,this.p=new a(N,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var N=new a(null);return N.words=new Array(Math.ceil(this.n/13)),N},S.prototype.ireduce=function(N){var k=N,x;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),x=k.bitLength();while(x>this.n);var E=x0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},S.prototype.split=function(N,k){N.iushrn(this.n,0,k)},S.prototype.imulK=function(N){return N.imul(this.k)};function j(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,S),j.prototype.split=function(N,k){for(var x=4194303,E=Math.min(N.length,9),L=0;L>>22,O=P}O>>>=22,N.words[L-10]=O,O===0&&N.length>10?N.length-=10:N.length-=9},j.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var k=0,x=0;x>>=26,N.words[x]=L,k=E}return k!==0&&(N.words[N.length++]=k),N},a._prime=function(N){if(A[N])return A[N];var k;if(N==="k256")k=new j;else if(N==="p224")k=new U;else if(N==="p192")k=new I;else if(N==="p25519")k=new B;else throw new Error("Unknown prime "+N);return A[N]=k,k};function V(Y){if(typeof Y=="string"){var N=a._prime(Y);this.m=N.p,this.prime=N}else n(Y.gtn(1),"modulus must be greater than 1"),this.m=Y,this.prime=null}V.prototype._verify1=function(N){n(N.negative===0,"red works only with positives"),n(N.red,"red works only with red numbers")},V.prototype._verify2=function(N,k){n((N.negative|k.negative)===0,"red works only with positives"),n(N.red&&N.red===k.red,"red works only with red numbers")},V.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},V.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},V.prototype.add=function(N,k){this._verify2(N,k);var x=N.add(k);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},V.prototype.iadd=function(N,k){this._verify2(N,k);var x=N.iadd(k);return x.cmp(this.m)>=0&&x.isub(this.m),x},V.prototype.sub=function(N,k){this._verify2(N,k);var x=N.sub(k);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},V.prototype.isub=function(N,k){this._verify2(N,k);var x=N.isub(k);return x.cmpn(0)<0&&x.iadd(this.m),x},V.prototype.shl=function(N,k){return this._verify1(N),this.imod(N.ushln(k))},V.prototype.imul=function(N,k){return this._verify2(N,k),this.imod(N.imul(k))},V.prototype.mul=function(N,k){return this._verify2(N,k),this.imod(N.mul(k))},V.prototype.isqr=function(N){return this.imul(N,N.clone())},V.prototype.sqr=function(N){return this.mul(N,N)},V.prototype.sqrt=function(N){if(N.isZero())return N.clone();var k=this.m.andln(3);if(n(k%2===1),k===3){var x=this.m.add(new a(1)).iushrn(2);return this.pow(N,x)}for(var E=this.m.subn(1),L=0;!E.isZero()&&E.andln(1)===0;)L++,E.iushrn(1);n(!E.isZero());var O=new a(1).toRed(this),P=O.redNeg(),R=this.m.subn(1).iushrn(1),M=this.m.bitLength();for(M=new a(2*M*M).toRed(this);this.pow(M,R).cmp(P)!==0;)M.redIAdd(P);for(var D=this.pow(M,E),$=this.pow(N,E.addn(1).iushrn(1)),X=this.pow(N,E),le=L;X.cmp(O)!==0;){for(var H=X,ee=0;H.cmp(O)!==0;ee++)H=H.redSqr();n(ee=0;L--){for(var D=k.words[L],$=M-1;$>=0;$--){var X=D>>$&1;if(O!==E[0]&&(O=this.sqr(O)),X===0&&P===0){R=0;continue}P<<=1,P|=X,R++,!(R!==x&&(L!==0||$!==0))&&(O=this.mul(O,E[P]),R=0,P=0)}M=26}return O},V.prototype.convertTo=function(N){var k=N.umod(this.m);return k===N?k.clone():k},V.prototype.convertFrom=function(N){var k=N.clone();return k.red=null,k},a.mont=function(N){return new se(N)};function se(Y){V.call(this,Y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(se,V),se.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},se.prototype.convertFrom=function(N){var k=this.imod(N.mul(this.rinv));return k.red=null,k},se.prototype.imul=function(N,k){if(N.isZero()||k.isZero())return N.words[0]=0,N.length=1,N;var x=N.imul(k),E=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=x.isub(E).iushrn(this.shift),O=L;return L.cmp(this.m)>=0?O=L.isub(this.m):L.cmpn(0)<0&&(O=L.iadd(this.m)),O._forceRed(this)},se.prototype.mul=function(N,k){if(N.isZero()||k.isZero())return new a(0)._forceRed(this);var x=N.mul(k),E=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=x.isub(E).iushrn(this.shift),O=L;return L.cmp(this.m)>=0?O=L.isub(this.m):L.cmpn(0)<0&&(O=L.iadd(this.m)),O._forceRed(this)},se.prototype.invm=function(N){var k=this.imod(N._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,Xt)})(dj);var Qd=dj.exports,fj={};(function(t){var e=t;function r(a,s){if(Array.isArray(a))return a.slice();if(!a)return[];var o=[];if(typeof a!="string"){for(var l=0;l>8,f=c&255;u?o.push(u,f):o.push(f)}return o}e.toArray=r;function n(a){return a.length===1?"0"+a:a}e.zero2=n;function i(a){for(var s="",o=0;o(w>>1)-1?v=(w>>1)-b:v=b,_.isubn(v)):v=0,g[m]=v,_.iushrn(1)}return g}e.getNAF=a;function s(u,f){var h=[[],[]];u=u.clone(),f=f.clone();for(var g=0,m=0,w;u.cmpn(-g)>0||f.cmpn(-m)>0;){var _=u.andln(3)+g&3,v=f.andln(3)+m&3;_===3&&(_=-1),v===3&&(v=-1);var b;_&1?(w=u.andln(7)+g&7,(w===3||w===5)&&v===2?b=-_:b=_):b=0,h[0].push(b);var A;v&1?(w=f.andln(7)+m&7,(w===3||w===5)&&_===2?A=-v:A=v):A=0,h[1].push(A),2*g===b+1&&(g=1-g),2*m===A+1&&(m=1-m),u.iushrn(1),f.iushrn(1)}return h}e.getJSF=s;function o(u,f,h){var g="_"+f;u.prototype[f]=function(){return this[g]!==void 0?this[g]:this[g]=h.call(this)}}e.cachedProperty=o;function l(u){return typeof u=="string"?e.toArray(u,"hex"):u}e.parseBytes=l;function c(u){return new r(u,"hex","le")}e.intFromLE=c})(Ro);var hj={exports:{}},gS;hj.exports=function(e){return gS||(gS=new $f(null)),gS.generate(e)};function $f(t){this.rand=t}hj.exports.Rand=$f;$f.prototype.generate=function(e){return this._rand(e)};$f.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Wx=Ah;Ah.prototype.point=function(){throw new Error("Not implemented")};Ah.prototype.validate=function(){throw new Error("Not implemented")};Ah.prototype._fixedNafMul=function(e,r){i8(e.precomputed);var n=e._getDoubles(),i=n8(r,1,this._bitLength),a=(1<=o;c--)l=(l<<1)+i[c];s.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&s[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=s[l];i8(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(a[u-1>>1]):o=o.mixedAdd(a[-u-1>>1].neg()):u>0?o=o.add(a[u-1>>1]):o=o.add(a[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};Ah.prototype._wnafMulAdd=function(e,r,n,i,a){var s=this._wnafT1,o=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(s[m]!==1||s[w]!==1){l[m]=n8(n[m],s[m],this._bitLength),l[w]=n8(n[w],s[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var _=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(_[1]=r[m].add(r[w]),_[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(_[1]=r[m].toJ().mixedAdd(r[w]),_[2]=r[m].add(r[w].neg())):(_[1]=r[m].toJ().mixedAdd(r[w]),_[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=VUe(n[m],n[w]);for(c=Math.max(b[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var I=0;u>=0;){var B=!0;for(f=0;f=0&&I++,j=j.dblp(I),u<0)break;for(f=0;f0?h=o[f][V-1>>1]:V<0&&(h=o[f][-V-1>>1].neg()),h.type==="affine"?j=j.mixedAdd(h):j=j.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};_l.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a=0&&(g=c,m=u),f.negative&&(f=f.neg(),h=h.neg()),g.negative&&(g=g.neg(),m=m.neg()),[{a:f,b:h},{a:g,b:m}]};Cl.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),o=a.mul(n.a),l=s.mul(i.a),c=a.mul(n.b),u=s.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};Cl.prototype.pointFromX=function(e,r){e=new si(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)};Cl.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};Cl.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,s=0;s":""};ua.prototype.isInfinity=function(){return this.inf};ua.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};ua.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)};ua.prototype.getX=function(){return this.x.fromRed()};ua.prototype.getY=function(){return this.y.fromRed()};ua.prototype.mul=function(e){return e=new si(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};ua.prototype.mulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};ua.prototype.jmulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};ua.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};ua.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(a){return a.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};ua.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function xa(t,e,r,n){jm.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new si(0)):(this.x=new si(e,16),this.y=new si(r,16),this.z=new si(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}gj(xa,jm.BasePoint);Cl.prototype.jpoint=function(e,r,n){return new xa(this,e,r,n)};xa.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};xa.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};xa.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(a),c=s.redSub(o);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),f=u.redMul(l),h=i.redMul(u),g=c.redSqr().redIAdd(f).redISub(h).redISub(h),m=c.redMul(h.redISub(g)).redISub(s.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};xa.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,s=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=a.redSub(s);if(o.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(a.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};xa.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}};xa.prototype.inspect=function(){return this.isInfinity()?"":""};xa.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Zp=Qd,Rne=hs,Hx=Wx,ZUe=Ro;function $m(t){Hx.call(this,"mont",t),this.a=new Zp(t.a,16).toRed(this.red),this.b=new Zp(t.b,16).toRed(this.red),this.i4=new Zp(4).toRed(this.red).redInvm(),this.two=new Zp(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}Rne($m,Hx);var QUe=$m;$m.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),a=i.redSqrt();return a.redSqr().cmp(i)===0};function la(t,e,r){Hx.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Zp(e,16),this.z=new Zp(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}Rne(la,Hx.BasePoint);$m.prototype.decodePoint=function(e,r){return this.point(ZUe.toArray(e,r),1)};$m.prototype.point=function(e,r){return new la(this,e,r)};$m.prototype.pointFromJSON=function(e){return la.fromJSON(this,e)};la.prototype.precompute=function(){};la.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};la.fromJSON=function(e,r){return new la(e,r[0],r[1]||e.one)};la.prototype.inspect=function(){return this.isInfinity()?"":""};la.prototype.isInfinity=function(){return this.z.cmpn(0)===0};la.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),a=r.redSub(i),s=r.redMul(i),o=a.redMul(i.redAdd(this.curve.a24.redMul(a)));return this.curve.point(s,o)};la.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};la.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),s=e.x.redSub(e.z),o=s.redMul(n),l=a.redMul(i),c=r.z.redMul(o.redAdd(l).redSqr()),u=r.x.redMul(o.redISub(l).redSqr());return this.curve.point(c,u)};la.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),a=this,s=[];r.cmpn(0)!==0;r.iushrn(1))s.push(r.andln(1));for(var o=s.length-1;o>=0;o--)s[o]===0?(n=n.diffAdd(i,a),i=i.dbl()):(i=n.diffAdd(i,a),n=n.dbl());return i};la.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};la.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};la.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};la.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};la.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var XUe=Ro,Ed=Qd,Dne=hs,Gx=Wx,eBe=XUe.assert;function Lu(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Gx.call(this,"edwards",t),this.a=new Ed(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Ed(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Ed(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),eBe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}Dne(Lu,Gx);var tBe=Lu;Lu.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Lu.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Lu.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};Lu.prototype.pointFromX=function(e,r){e=new Ed(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),s=i.redMul(a.redInvm()),o=s.redSqrt();if(o.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");var l=o.fromRed().isOdd();return(r&&!l||!r&&l)&&(o=o.redNeg()),this.point(e,o)};Lu.prototype.pointFromY=function(e,r){e=new Ed(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(a.redInvm());if(s.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var o=s.redSqrt();if(o.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");return o.fromRed().isOdd()!==r&&(o=o.redNeg()),this.point(o,e)};Lu.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(a)===0};function kn(t,e,r,n,i){Gx.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Ed(e,16),this.y=new Ed(r,16),this.z=n?new Ed(n,16):this.curve.one,this.t=i&&new Ed(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}Dne(kn,Gx.BasePoint);Lu.prototype.pointFromJSON=function(e){return kn.fromJSON(this,e)};Lu.prototype.point=function(e,r,n,i){return new kn(this,e,r,n,i)};kn.fromJSON=function(e,r){return new kn(e,r[0],r[1],r[2])};kn.prototype.inspect=function(){return this.isInfinity()?"":""};kn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};kn.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),s=i.redAdd(r),o=s.redSub(n),l=i.redSub(r),c=a.redMul(o),u=s.redMul(l),f=a.redMul(l),h=o.redMul(s);return this.curve.point(c,u,h,f)};kn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,a,s,o,l,c;if(this.curve.twisted){o=this.curve._mulA(r);var u=o.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(u.redSub(this.curve.two)),a=u.redMul(o.redSub(n)),s=u.redSqr().redSub(u).redSub(u)):(l=this.z.redSqr(),c=u.redSub(l).redISub(l),i=e.redSub(r).redISub(n).redMul(c),a=u.redMul(o.redSub(n)),s=u.redMul(c))}else o=r.redAdd(n),l=this.curve._mulC(this.z).redSqr(),c=o.redSub(l).redSub(l),i=this.curve._mulC(e.redISub(o)).redMul(c),a=this.curve._mulC(o).redMul(r.redISub(n)),s=o.redMul(c);return this.curve.point(i,a,s)};kn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};kn.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),s=n.redSub(r),o=a.redSub(i),l=a.redAdd(i),c=n.redAdd(r),u=s.redMul(o),f=l.redMul(c),h=s.redMul(c),g=o.redMul(l);return this.curve.point(u,f,g,h)};kn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),o=n.redSub(s),l=n.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),u=r.redMul(o).redMul(c),f,h;return this.curve.twisted?(f=r.redMul(l).redMul(a.redSub(this.curve._mulA(i))),h=o.redMul(l)):(f=r.redMul(l).redMul(a.redSub(i)),h=this.curve._mulC(o).redMul(l)),this.curve.point(u,f,h)};kn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};kn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};kn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};kn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};kn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};kn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};kn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};kn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};kn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};kn.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};kn.prototype.toP=kn.prototype.normalize;kn.prototype.mixedAdd=kn.prototype.add;(function(t){var e=t;e.base=Wx,e.short=JUe,e.mont=QUe,e.edwards=tBe})(pj);var qx={},mS,Oz;function rBe(){return Oz||(Oz=1,mS={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),mS}(function(t){var e=t,r=vw,n=pj,i=Ro,a=i.assert;function s(c){c.type==="short"?this.curve=new n.short(c):c.type==="edwards"?this.curve=new n.edwards(c):this.curve=new n.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=s;function o(c,u){Object.defineProperty(e,c,{configurable:!0,enumerable:!0,get:function(){var f=new s(u);return Object.defineProperty(e,c,{configurable:!0,enumerable:!0,value:f}),f}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=rBe()}catch{l=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})})(qx);var nBe=vw,k0=fj,One=f1;function oh(t){if(!(this instanceof oh))return new oh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=k0.toArray(t.entropy,t.entropyEnc||"hex"),r=k0.toArray(t.nonce,t.nonceEnc||"hex"),n=k0.toArray(t.pers,t.persEnc||"hex");One(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var iBe=oh;oh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};oh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=k0.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length"};var a8=Qd,mj=Ro,lBe=mj.assert;function Vx(t,e){if(t instanceof Vx)return t;this._importDER(t,e)||(lBe(t.r&&t.s,"Signature without r or s"),this.r=new a8(t.r,16),this.s=new a8(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var cBe=Vx;function uBe(){this.place=0}function yS(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,a=0,s=e.place;a>>=0;return i<=127?!1:(e.place=s,i)}function Fz(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}Vx.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Fz(r),n=Fz(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];wS(i,r.length),i=i.concat(r),i.push(2),wS(i,n.length);var a=i.concat(n),s=[48];return wS(s,a.length),s=s.concat(a),mj.encode(s,e)};var nc=Qd,Fne=iBe,dBe=Ro,vS=qx,fBe=Pne,c0=dBe.assert,yj=oBe,Yx=cBe;function yl(t){if(!(this instanceof yl))return new yl(t);typeof t=="string"&&(c0(Object.prototype.hasOwnProperty.call(vS,t),"Unknown curve "+t),t=vS[t]),t instanceof vS.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var hBe=yl;yl.prototype.keyPair=function(e){return new yj(this,e)};yl.prototype.keyFromPrivate=function(e,r){return yj.fromPrivate(this,e,r)};yl.prototype.keyFromPublic=function(e,r){return yj.fromPublic(this,e,r)};yl.prototype.genKeyPair=function(e){e||(e={});for(var r=new Fne({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||fBe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new nc(2));;){var a=new nc(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};yl.prototype._truncateToN=function(e,r,n){var i;if(nc.isBN(e)||typeof e=="number")e=new nc(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new nc(e,16);else{var a=e.toString();i=a.length+1>>>1,e=new nc(a,16)}typeof n!="number"&&(n=i*8);var s=n-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};yl.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!nc.isBN(e)){c0(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),c0(e.length>>>0===e.length);for(var a=0;a=0)){var g=this.g.mul(h);if(!g.isInfinity()){var m=g.getX(),w=m.umod(this.n);if(w.cmpn(0)!==0){var _=h.invm(this.n).mul(w.mul(r.getPrivate()).iadd(e));if(_=_.umod(this.n),_.cmpn(0)!==0){var v=(g.getY().isOdd()?1:0)|(m.cmp(w)!==0?2:0);return i.canonical&&_.cmp(this.nh)>0&&(_=this.n.sub(_),v^=1),new Yx({r:w,s:_,recoveryParam:v})}}}}}};yl.prototype.verify=function(e,r,n,i,a){a||(a={}),e=this._truncateToN(e,!1,a.msgBitLength),n=this.keyFromPublic(n,i),r=new Yx(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var l=o.invm(this.n),c=l.mul(e).umod(this.n),u=l.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};yl.prototype.recoverPubKey=function(t,e,r,n){c0((3&r)===r,"The recovery param is more than two bits"),e=new Yx(e,n);var i=this.n,a=new nc(t),s=e.r,o=e.s,l=r&1,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,s,h)};yl.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new Yx(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var sv=Ro,Une=sv.assert,Uz=sv.parseBytes,Pm=sv.cachedProperty;function aa(t,e){this.eddsa=t,this._secret=Uz(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Uz(e.pub)}aa.fromPublic=function(e,r){return r instanceof aa?r:new aa(e,{pub:r})};aa.fromSecret=function(e,r){return r instanceof aa?r:new aa(e,{secret:r})};aa.prototype.secret=function(){return this._secret};Pm(aa,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Pm(aa,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Pm(aa,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Pm(aa,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Pm(aa,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Pm(aa,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});aa.prototype.sign=function(e){return Une(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};aa.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};aa.prototype.getSecret=function(e){return Une(this._secret,"KeyPair is public only"),sv.encode(this.secret(),e)};aa.prototype.getPublic=function(e){return sv.encode(this.pubBytes(),e)};var pBe=aa,gBe=Qd,Kx=Ro,Bz=Kx.assert,Jx=Kx.cachedProperty,mBe=Kx.parseBytes;function A1(t,e){this.eddsa=t,typeof e!="object"&&(e=mBe(e)),Array.isArray(e)&&(Bz(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),Bz(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof gBe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Jx(A1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});Jx(A1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});Jx(A1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});Jx(A1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});A1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};A1.prototype.toHex=function(){return Kx.encode(this.toBytes(),"hex").toUpperCase()};var yBe=A1,wBe=vw,vBe=qx,Yg=Ro,bBe=Yg.assert,Bne=Yg.parseBytes,zne=pBe,zz=yBe;function Ys(t){if(bBe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Ys))return new Ys(t);t=vBe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=wBe.sha512}var xBe=Ys;Ys.prototype.sign=function(e,r){e=Bne(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),a=this.g.mul(i),s=this.encodePoint(a),o=this.hashInt(s,n.pubBytes(),e).mul(n.priv()),l=i.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:l,Rencoded:s})};Ys.prototype.verify=function(e,r,n){if(e=Bne(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),i.pubBytes(),e),s=this.g.mul(r.S()),o=r.R().add(i.pub().mul(a));return o.eq(s)};Ys.prototype.hashInt=function(){for(var e=this.hash(),r=0;r0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},o.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,h=c<<3,g=c%128<112?128:256;this._buffer[u]=128;for(var m=u+1;m0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},o}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(o,l,c,u,f,h,g){for(var m=c[0],w=c[1],_=c[2],v=c[3],b=c[4],A=c[5],S=c[6],j=c[7],U=u[0],I=u[1],B=u[2],V=u[3],se=u[4],Y=u[5],N=u[6],k=u[7],x,E,L,O,P,R,M,D;g>=128;){for(var $=0;$<16;$++){var X=8*$+h;o[$]=e.readUint32BE(f,X),l[$]=e.readUint32BE(f,X+4)}for(var $=0;$<80;$++){var le=m,H=w,ee=_,J=v,te=b,re=A,z=S,G=j,Z=U,me=I,be=B,Ce=V,Fe=se,Ue=Y,Ke=N,lt=k;if(x=j,E=k,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=(b>>>14|se<<18)^(b>>>18|se<<14)^(se>>>9|b<<23),E=(se>>>14|b<<18)^(se>>>18|b<<14)^(b>>>9|se<<23),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=b&A^~b&S,E=se&Y^~se&N,P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=i[$*2],E=i[$*2+1],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=o[$%16],E=l[$%16],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,L=M&65535|D<<16,O=P&65535|R<<16,x=L,E=O,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=(m>>>28|U<<4)^(U>>>2|m<<30)^(U>>>7|m<<25),E=(U>>>28|m<<4)^(m>>>2|U<<30)^(m>>>7|U<<25),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=m&w^m&_^w&_,E=U&I^U&B^I&B,P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,G=M&65535|D<<16,lt=P&65535|R<<16,x=J,E=Ce,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=L,E=O,P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,J=M&65535|D<<16,Ce=P&65535|R<<16,w=le,_=H,v=ee,b=J,A=te,S=re,j=z,m=G,I=Z,B=me,V=be,se=Ce,Y=Fe,N=Ue,k=Ke,U=lt,$%16===15)for(var X=0;X<16;X++)x=o[X],E=l[X],P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=o[(X+9)%16],E=l[(X+9)%16],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,L=o[(X+1)%16],O=l[(X+1)%16],x=(L>>>1|O<<31)^(L>>>8|O<<24)^L>>>7,E=(O>>>1|L<<31)^(O>>>8|L<<24)^(O>>>7|L<<25),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,L=o[(X+14)%16],O=l[(X+14)%16],x=(L>>>19|O<<13)^(O>>>29|L<<3)^L>>>6,E=(O>>>19|L<<13)^(L>>>29|O<<3)^(O>>>6|L<<26),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,o[X]=M&65535|D<<16,l[X]=P&65535|R<<16}x=m,E=U,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[0],E=u[0],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[0]=m=M&65535|D<<16,u[0]=U=P&65535|R<<16,x=w,E=I,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[1],E=u[1],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[1]=w=M&65535|D<<16,u[1]=I=P&65535|R<<16,x=_,E=B,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[2],E=u[2],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[2]=_=M&65535|D<<16,u[2]=B=P&65535|R<<16,x=v,E=V,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[3],E=u[3],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[3]=v=M&65535|D<<16,u[3]=V=P&65535|R<<16,x=b,E=se,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[4],E=u[4],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[4]=b=M&65535|D<<16,u[4]=se=P&65535|R<<16,x=A,E=Y,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[5],E=u[5],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[5]=A=M&65535|D<<16,u[5]=Y=P&65535|R<<16,x=S,E=N,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[6],E=u[6],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[6]=S=M&65535|D<<16,u[6]=N=P&65535|R<<16,x=j,E=k,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[7],E=u[7],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[7]=j=M&65535|D<<16,u[7]=k=P&65535|R<<16,h+=128,g-=128}return h}function s(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=s})(Wne);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Sh,r=Wne,n=Po;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(J){const te=new Float64Array(16);if(J)for(let re=0;re>16&1),re[me-1]&=65535;re[15]=z[15]-32767-(re[14]>>16&1);const Z=re[15]>>16&1;re[14]&=65535,w(z,re,1-Z)}for(let G=0;G<16;G++)J[2*G]=z[G]&255,J[2*G+1]=z[G]>>8}function v(J,te){let re=0;for(let z=0;z<32;z++)re|=J[z]^te[z];return(1&re-1>>>8)-1}function b(J,te){const re=new Uint8Array(32),z=new Uint8Array(32);return _(re,J),_(z,te),v(re,z)}function A(J){const te=new Uint8Array(32);return _(te,J),te[0]&1}function S(J,te){for(let re=0;re<16;re++)J[re]=te[2*re]+(te[2*re+1]<<8);J[15]&=32767}function j(J,te,re){for(let z=0;z<16;z++)J[z]=te[z]+re[z]}function U(J,te,re){for(let z=0;z<16;z++)J[z]=te[z]-re[z]}function I(J,te,re){let z,G,Z=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ke=0,lt=0,Ee=0,He=0,qe=0,Ie=0,Ne=0,Pe=0,$e=0,K=0,F=0,W=0,ie=0,pe=0,we=0,he=0,De=0,Je=0,et=0,it=0,ut=0,pt=0,tr=0,zt=0,At=0,mt=re[0],St=re[1],dt=re[2],Nt=re[3],Rt=re[4],gt=re[5],qt=re[6],Wt=re[7],ot=re[8],Vt=re[9],Ft=re[10],yt=re[11],Qe=re[12],Pt=re[13],xt=re[14],Jt=re[15];z=te[0],Z+=z*mt,me+=z*St,be+=z*dt,Ce+=z*Nt,Fe+=z*Rt,Ue+=z*gt,Ke+=z*qt,lt+=z*Wt,Ee+=z*ot,He+=z*Vt,qe+=z*Ft,Ie+=z*yt,Ne+=z*Qe,Pe+=z*Pt,$e+=z*xt,K+=z*Jt,z=te[1],me+=z*mt,be+=z*St,Ce+=z*dt,Fe+=z*Nt,Ue+=z*Rt,Ke+=z*gt,lt+=z*qt,Ee+=z*Wt,He+=z*ot,qe+=z*Vt,Ie+=z*Ft,Ne+=z*yt,Pe+=z*Qe,$e+=z*Pt,K+=z*xt,F+=z*Jt,z=te[2],be+=z*mt,Ce+=z*St,Fe+=z*dt,Ue+=z*Nt,Ke+=z*Rt,lt+=z*gt,Ee+=z*qt,He+=z*Wt,qe+=z*ot,Ie+=z*Vt,Ne+=z*Ft,Pe+=z*yt,$e+=z*Qe,K+=z*Pt,F+=z*xt,W+=z*Jt,z=te[3],Ce+=z*mt,Fe+=z*St,Ue+=z*dt,Ke+=z*Nt,lt+=z*Rt,Ee+=z*gt,He+=z*qt,qe+=z*Wt,Ie+=z*ot,Ne+=z*Vt,Pe+=z*Ft,$e+=z*yt,K+=z*Qe,F+=z*Pt,W+=z*xt,ie+=z*Jt,z=te[4],Fe+=z*mt,Ue+=z*St,Ke+=z*dt,lt+=z*Nt,Ee+=z*Rt,He+=z*gt,qe+=z*qt,Ie+=z*Wt,Ne+=z*ot,Pe+=z*Vt,$e+=z*Ft,K+=z*yt,F+=z*Qe,W+=z*Pt,ie+=z*xt,pe+=z*Jt,z=te[5],Ue+=z*mt,Ke+=z*St,lt+=z*dt,Ee+=z*Nt,He+=z*Rt,qe+=z*gt,Ie+=z*qt,Ne+=z*Wt,Pe+=z*ot,$e+=z*Vt,K+=z*Ft,F+=z*yt,W+=z*Qe,ie+=z*Pt,pe+=z*xt,we+=z*Jt,z=te[6],Ke+=z*mt,lt+=z*St,Ee+=z*dt,He+=z*Nt,qe+=z*Rt,Ie+=z*gt,Ne+=z*qt,Pe+=z*Wt,$e+=z*ot,K+=z*Vt,F+=z*Ft,W+=z*yt,ie+=z*Qe,pe+=z*Pt,we+=z*xt,he+=z*Jt,z=te[7],lt+=z*mt,Ee+=z*St,He+=z*dt,qe+=z*Nt,Ie+=z*Rt,Ne+=z*gt,Pe+=z*qt,$e+=z*Wt,K+=z*ot,F+=z*Vt,W+=z*Ft,ie+=z*yt,pe+=z*Qe,we+=z*Pt,he+=z*xt,De+=z*Jt,z=te[8],Ee+=z*mt,He+=z*St,qe+=z*dt,Ie+=z*Nt,Ne+=z*Rt,Pe+=z*gt,$e+=z*qt,K+=z*Wt,F+=z*ot,W+=z*Vt,ie+=z*Ft,pe+=z*yt,we+=z*Qe,he+=z*Pt,De+=z*xt,Je+=z*Jt,z=te[9],He+=z*mt,qe+=z*St,Ie+=z*dt,Ne+=z*Nt,Pe+=z*Rt,$e+=z*gt,K+=z*qt,F+=z*Wt,W+=z*ot,ie+=z*Vt,pe+=z*Ft,we+=z*yt,he+=z*Qe,De+=z*Pt,Je+=z*xt,et+=z*Jt,z=te[10],qe+=z*mt,Ie+=z*St,Ne+=z*dt,Pe+=z*Nt,$e+=z*Rt,K+=z*gt,F+=z*qt,W+=z*Wt,ie+=z*ot,pe+=z*Vt,we+=z*Ft,he+=z*yt,De+=z*Qe,Je+=z*Pt,et+=z*xt,it+=z*Jt,z=te[11],Ie+=z*mt,Ne+=z*St,Pe+=z*dt,$e+=z*Nt,K+=z*Rt,F+=z*gt,W+=z*qt,ie+=z*Wt,pe+=z*ot,we+=z*Vt,he+=z*Ft,De+=z*yt,Je+=z*Qe,et+=z*Pt,it+=z*xt,ut+=z*Jt,z=te[12],Ne+=z*mt,Pe+=z*St,$e+=z*dt,K+=z*Nt,F+=z*Rt,W+=z*gt,ie+=z*qt,pe+=z*Wt,we+=z*ot,he+=z*Vt,De+=z*Ft,Je+=z*yt,et+=z*Qe,it+=z*Pt,ut+=z*xt,pt+=z*Jt,z=te[13],Pe+=z*mt,$e+=z*St,K+=z*dt,F+=z*Nt,W+=z*Rt,ie+=z*gt,pe+=z*qt,we+=z*Wt,he+=z*ot,De+=z*Vt,Je+=z*Ft,et+=z*yt,it+=z*Qe,ut+=z*Pt,pt+=z*xt,tr+=z*Jt,z=te[14],$e+=z*mt,K+=z*St,F+=z*dt,W+=z*Nt,ie+=z*Rt,pe+=z*gt,we+=z*qt,he+=z*Wt,De+=z*ot,Je+=z*Vt,et+=z*Ft,it+=z*yt,ut+=z*Qe,pt+=z*Pt,tr+=z*xt,zt+=z*Jt,z=te[15],K+=z*mt,F+=z*St,W+=z*dt,ie+=z*Nt,pe+=z*Rt,we+=z*gt,he+=z*qt,De+=z*Wt,Je+=z*ot,et+=z*Vt,it+=z*Ft,ut+=z*yt,pt+=z*Qe,tr+=z*Pt,zt+=z*xt,At+=z*Jt,Z+=38*F,me+=38*W,be+=38*ie,Ce+=38*pe,Fe+=38*we,Ue+=38*he,Ke+=38*De,lt+=38*Je,Ee+=38*et,He+=38*it,qe+=38*ut,Ie+=38*pt,Ne+=38*tr,Pe+=38*zt,$e+=38*At,G=1,z=Z+G+65535,G=Math.floor(z/65536),Z=z-G*65536,z=me+G+65535,G=Math.floor(z/65536),me=z-G*65536,z=be+G+65535,G=Math.floor(z/65536),be=z-G*65536,z=Ce+G+65535,G=Math.floor(z/65536),Ce=z-G*65536,z=Fe+G+65535,G=Math.floor(z/65536),Fe=z-G*65536,z=Ue+G+65535,G=Math.floor(z/65536),Ue=z-G*65536,z=Ke+G+65535,G=Math.floor(z/65536),Ke=z-G*65536,z=lt+G+65535,G=Math.floor(z/65536),lt=z-G*65536,z=Ee+G+65535,G=Math.floor(z/65536),Ee=z-G*65536,z=He+G+65535,G=Math.floor(z/65536),He=z-G*65536,z=qe+G+65535,G=Math.floor(z/65536),qe=z-G*65536,z=Ie+G+65535,G=Math.floor(z/65536),Ie=z-G*65536,z=Ne+G+65535,G=Math.floor(z/65536),Ne=z-G*65536,z=Pe+G+65535,G=Math.floor(z/65536),Pe=z-G*65536,z=$e+G+65535,G=Math.floor(z/65536),$e=z-G*65536,z=K+G+65535,G=Math.floor(z/65536),K=z-G*65536,Z+=G-1+37*(G-1),G=1,z=Z+G+65535,G=Math.floor(z/65536),Z=z-G*65536,z=me+G+65535,G=Math.floor(z/65536),me=z-G*65536,z=be+G+65535,G=Math.floor(z/65536),be=z-G*65536,z=Ce+G+65535,G=Math.floor(z/65536),Ce=z-G*65536,z=Fe+G+65535,G=Math.floor(z/65536),Fe=z-G*65536,z=Ue+G+65535,G=Math.floor(z/65536),Ue=z-G*65536,z=Ke+G+65535,G=Math.floor(z/65536),Ke=z-G*65536,z=lt+G+65535,G=Math.floor(z/65536),lt=z-G*65536,z=Ee+G+65535,G=Math.floor(z/65536),Ee=z-G*65536,z=He+G+65535,G=Math.floor(z/65536),He=z-G*65536,z=qe+G+65535,G=Math.floor(z/65536),qe=z-G*65536,z=Ie+G+65535,G=Math.floor(z/65536),Ie=z-G*65536,z=Ne+G+65535,G=Math.floor(z/65536),Ne=z-G*65536,z=Pe+G+65535,G=Math.floor(z/65536),Pe=z-G*65536,z=$e+G+65535,G=Math.floor(z/65536),$e=z-G*65536,z=K+G+65535,G=Math.floor(z/65536),K=z-G*65536,Z+=G-1+37*(G-1),J[0]=Z,J[1]=me,J[2]=be,J[3]=Ce,J[4]=Fe,J[5]=Ue,J[6]=Ke,J[7]=lt,J[8]=Ee,J[9]=He,J[10]=qe,J[11]=Ie,J[12]=Ne,J[13]=Pe,J[14]=$e,J[15]=K}function B(J,te){I(J,te,te)}function V(J,te){const re=i();let z;for(z=0;z<16;z++)re[z]=te[z];for(z=253;z>=0;z--)B(re,re),z!==2&&z!==4&&I(re,re,te);for(z=0;z<16;z++)J[z]=re[z]}function se(J,te){const re=i();let z;for(z=0;z<16;z++)re[z]=te[z];for(z=250;z>=0;z--)B(re,re),z!==1&&I(re,re,te);for(z=0;z<16;z++)J[z]=re[z]}function Y(J,te){const re=i(),z=i(),G=i(),Z=i(),me=i(),be=i(),Ce=i(),Fe=i(),Ue=i();U(re,J[1],J[0]),U(Ue,te[1],te[0]),I(re,re,Ue),j(z,J[0],J[1]),j(Ue,te[0],te[1]),I(z,z,Ue),I(G,J[3],te[3]),I(G,G,c),I(Z,J[2],te[2]),j(Z,Z,Z),U(me,z,re),U(be,Z,G),j(Ce,Z,G),j(Fe,z,re),I(J[0],me,be),I(J[1],Fe,Ce),I(J[2],Ce,be),I(J[3],me,Fe)}function N(J,te,re){for(let z=0;z<4;z++)w(J[z],te[z],re)}function k(J,te){const re=i(),z=i(),G=i();V(G,te[2]),I(re,te[0],G),I(z,te[1],G),_(J,z),J[31]^=A(re)<<7}function x(J,te,re){g(J[0],s),g(J[1],o),g(J[2],o),g(J[3],s);for(let z=255;z>=0;--z){const G=re[z/8|0]>>(z&7)&1;N(J,te,G),Y(te,J),Y(J,J),N(J,te,G)}}function E(J,te){const re=[i(),i(),i(),i()];g(re[0],u),g(re[1],f),g(re[2],o),I(re[3],u,f),x(J,re,te)}function L(J){if(J.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const te=(0,r.hash)(J);te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(32),z=[i(),i(),i(),i()];E(z,te),k(re,z);const G=new Uint8Array(64);return G.set(J),G.set(re,32),{publicKey:re,secretKey:G}}t.generateKeyPairFromSeed=L;function O(J){const te=(0,e.randomBytes)(32,J),re=L(te);return(0,n.wipe)(te),re}t.generateKeyPair=O;function P(J){if(J.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(J.subarray(32))}t.extractPublicKeyFromSecretKey=P;const R=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function M(J,te){let re,z,G,Z;for(z=63;z>=32;--z){for(re=0,G=z-32,Z=z-12;G>4)*R[G],re=te[G]>>8,te[G]&=255;for(G=0;G<32;G++)te[G]-=re*R[G];for(z=0;z<32;z++)te[z+1]+=te[z]>>8,J[z]=te[z]&255}function D(J){const te=new Float64Array(64);for(let re=0;re<64;re++)te[re]=J[re];for(let re=0;re<64;re++)J[re]=0;M(J,te)}function $(J,te){const re=new Float64Array(64),z=[i(),i(),i(),i()],G=(0,r.hash)(J.subarray(0,32));G[0]&=248,G[31]&=127,G[31]|=64;const Z=new Uint8Array(64);Z.set(G.subarray(32),32);const me=new r.SHA512;me.update(Z.subarray(32)),me.update(te);const be=me.digest();me.clean(),D(be),E(z,be),k(Z,z),me.reset(),me.update(Z.subarray(0,32)),me.update(J.subarray(32)),me.update(te);const Ce=me.digest();D(Ce);for(let Fe=0;Fe<32;Fe++)re[Fe]=be[Fe];for(let Fe=0;Fe<32;Fe++)for(let Ue=0;Ue<32;Ue++)re[Fe+Ue]+=Ce[Fe]*G[Ue];return M(Z.subarray(32),re),Z}t.sign=$;function X(J,te){const re=i(),z=i(),G=i(),Z=i(),me=i(),be=i(),Ce=i();return g(J[2],o),S(J[1],te),B(G,J[1]),I(Z,G,l),U(G,G,J[2]),j(Z,J[2],Z),B(me,Z),B(be,me),I(Ce,be,me),I(re,Ce,G),I(re,re,Z),se(re,re),I(re,re,G),I(re,re,Z),I(re,re,Z),I(J[0],re,Z),B(z,J[0]),I(z,z,Z),b(z,G)&&I(J[0],J[0],h),B(z,J[0]),I(z,z,Z),b(z,G)?-1:(A(J[0])===te[31]>>7&&U(J[0],s,J[0]),I(J[3],J[0],J[1]),0)}function le(J,te,re){const z=new Uint8Array(32),G=[i(),i(),i(),i()],Z=[i(),i(),i(),i()];if(re.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(Z,J))return!1;const me=new r.SHA512;me.update(re.subarray(0,32)),me.update(J),me.update(te);const be=me.digest();return D(be),x(G,Z,be),E(Z,re.subarray(32)),Y(G,Z),k(z,G),!v(re,z)}t.verify=le;function H(J){let te=[i(),i(),i(),i()];if(X(te,J))throw new Error("Ed25519: invalid public key");let re=i(),z=i(),G=te[1];j(re,o,G),U(z,o,G),V(z,z),I(re,re,z);let Z=new Uint8Array(32);return _(Z,re),Z}t.convertPublicKeyToX25519=H;function ee(J){const te=(0,r.hash)(J.subarray(0,32));te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(te.subarray(0,32));return(0,n.wipe)(te),re}t.convertSecretKeyToX25519=ee})(wj);const EBe="EdDSA",_Be="JWT",s8=".",Zx="base64url",Hne="utf8",Gne="utf8",CBe=":",SBe="did",ABe="key",Wz="base58btc",IBe="z",MBe="K36",TBe=32,kBe=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),NBe=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function t1(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return NBe(t)}catch{return t}}function Wd(t){return typeof t=="string"?t:kBe(t)||""}function Hz(t){return t1(ia(ta(t,Zx),Hne))}function o8(t){return ia(ta(Wd(t),Hne),Zx)}function qne(t){const e=ta(MBe,Wz),r=IBe+ia(L6([e,t]),Wz);return[SBe,ABe,r].join(CBe)}function LBe(t){return ia(t,Zx)}function jBe(t){return ta(t,Zx)}function $Be(t){return ta([o8(t.header),o8(t.payload)].join(s8),Gne)}function PBe(t){return[o8(t.header),o8(t.payload),LBe(t.signature)].join(s8)}function lT(t){const e=t.split(s8),r=Hz(e[0]),n=Hz(e[1]),i=jBe(e[2]),a=ta(e.slice(0,2).join(s8),Gne);return{header:r,payload:n,signature:i,data:a}}function Gz(t=Sh.randomBytes(TBe)){return wj.generateKeyPairFromSeed(t)}async function RBe(t,e,r,n,i=ct.fromMiliseconds(Date.now())){const a={alg:EBe,typ:_Be},s=qne(n.publicKey),o=i+r,l={iss:s,sub:t,aud:e,iat:i,exp:o},c=$Be({header:a,payload:l}),u=wj.sign(n.secretKey,c);return PBe({header:a,payload:l,signature:u})}const DBe={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var OBe={};const FBe=":";function fg(t){const[e,r]=t.split(FBe);return{namespace:e,reference:r}}function qz(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function Vne(t,e){return t.includes(":")?[t]:e.chains||[]}var UBe=Object.defineProperty,Vz=Object.getOwnPropertySymbols,BBe=Object.prototype.hasOwnProperty,zBe=Object.prototype.propertyIsEnumerable,Yz=(t,e,r)=>e in t?UBe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Kz=(t,e)=>{for(var r in e||(e={}))BBe.call(e,r)&&Yz(t,r,e[r]);if(Vz)for(var r of Vz(e))zBe.call(e,r)&&Yz(t,r,e[r]);return t};const WBe="ReactNative",xo={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},HBe="js";function l8(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function Ih(){return!tv()&&!!sj()&&navigator.product===WBe}function GBe(){return Ih()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function qBe(){return Ih()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function ov(){return!l8()&&!!sj()&&!!tv()}function lv(){return Ih()?xo.reactNative:l8()?xo.node:ov()?xo.browser:xo.unknown}function Jz(){var t;try{return Ih()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function VBe(t,e){let r=G3.parse(t);return r=Kz(Kz({},r),e),t=G3.stringify(r),t}function Yne(){return mne()||{name:"",description:"",url:"",icons:[""]}}function YBe(){if(lv()===xo.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=QDe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function KBe(){var t;const e=lv();return e===xo.browser?[e,((t=gne())==null?void 0:t.host)||"unknown"].join(":"):e}function Kne(t,e,r){const n=YBe(),i=KBe();return[[t,e].join("-"),[HBe,r].join("-"),n,i].join("/")}function JBe({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:s,bundleId:o,packageName:l}){const c=r.split("?"),u=Kne(t,e,n),f={auth:i,ua:u,projectId:a,useOnCloseEvent:s||void 0,packageName:l||void 0,bundleId:o||void 0},h=VBe(c[1]||"",f);return c[0]+"?"+h}function w0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Jne(t){return Object.fromEntries(t.entries())}function Zne(t){return new Map(Object.entries(t))}function r0(t=ct.FIVE_MINUTES,e){const r=ct.toMiliseconds(t||ct.FIVE_MINUTES);let n,i,a,s;return{resolve:o=>{a&&n&&(clearTimeout(a),n(o),s=Promise.resolve(o))},reject:o=>{a&&i&&(clearTimeout(a),i(o))},done:()=>new Promise((o,l)=>{if(s)return o(s);a=setTimeout(()=>{const c=new Error(e);s=Promise.reject(c),l(c)},r),n=o,i=l})}}function Pf(t,e,r){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(r)),e);try{const s=await t;n(s)}catch(s){i(s)}clearTimeout(a)})}function Qne(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function ZBe(t){return Qne("topic",t)}function QBe(t){return Qne("id",t)}function Xne(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Ni(t,e){return ct.fromMiliseconds(Date.now()+ct.toMiliseconds(t))}function Cf(t){return Date.now()>=ct.toMiliseconds(t)}function jr(t,e){return`${t}${e?`:${e}`:""}`}function j6(t=[],e=[]){return[...new Set([...t,...e])]}async function XBe({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,a=i==null?void 0:i.href;if(typeof a!="string")return;const s=eze(a,t,e),o=lv();if(o===xo.browser){if(!((n=tv())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}s.startsWith("https://")||s.startsWith("http://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,rze()?"_blank":"_self","noreferrer noopener")}else o===xo.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(i){console.error(i)}}function eze(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const a=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${a}${nze(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function tze(t,e){let r="";try{if(ov()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function Zz(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function Qz(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function vj(){return typeof process<"u"&&OBe.IS_VITEST==="true"}function rze(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function nze(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function eie(t){return Buffer.from(t,"base64").toString("utf-8")}function ize(t){return new Promise(e=>setTimeout(e,t))}const aze="https://rpc.walletconnect.org/v1";async function sze(t,e,r,n,i,a){switch(r.t){case"eip191":return oze(t,e,r.s);case"eip1271":return await lze(t,e,r.s,n,i,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function oze(t,e,r){return vN(AK(e),r).toLowerCase()===t.toLowerCase()}async function lze(t,e,r,n,i,a){const s=fg(n);if(!s.namespace||!s.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const o="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",u=r.substring(2),f=AK(e).substring(2),h=o+f+l+c+u,g=await fetch(`${a||aze}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:cze(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:m}=await g.json();return m?m.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function cze(){return Date.now()+Math.floor(Math.random()*1e3)}var uze=Object.defineProperty,dze=Object.defineProperties,fze=Object.getOwnPropertyDescriptors,Xz=Object.getOwnPropertySymbols,hze=Object.prototype.hasOwnProperty,pze=Object.prototype.propertyIsEnumerable,eW=(t,e,r)=>e in t?uze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,gze=(t,e)=>{for(var r in e||(e={}))hze.call(e,r)&&eW(t,r,e[r]);if(Xz)for(var r of Xz(e))pze.call(e,r)&&eW(t,r,e[r]);return t},mze=(t,e)=>dze(t,fze(e));const yze="did:pkh:",bj=t=>t==null?void 0:t.split(":"),wze=t=>{const e=t&&bj(t);if(e)return t.includes(yze)?e[3]:e[1]},cT=t=>{const e=t&&bj(t);if(e)return e[2]+":"+e[3]},c8=t=>{const e=t&&bj(t);if(e)return e.pop()};async function tW(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,a=tie(i,i.iss),s=c8(i.iss);return await sze(s,a,n,cT(i.iss),r)}const tie=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=c8(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const a=`URI: ${t.aud||t.uri}`,s=`Version: ${t.version}`,o=`Chain ID: ${wze(e)}`,l=`Nonce: ${t.nonce}`,c=`Issued At: ${t.iat}`,u=t.exp?`Expiration Time: ${t.exp}`:void 0,f=t.nbf?`Not Before: ${t.nbf}`:void 0,h=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(w=>` -- ${w}`).join("")}`:void 0,m=$6(t.resources);if(m){const w=q3(m);i=Ize(i,w)}return[r,n,"",i,"",a,s,o,l,c,u,f,h,g].filter(w=>w!=null).join(` -`)};function vze(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function bze(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function r1(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const a=n[i];if(!Array.isArray(a))throw new Error(`Ability limits ${i} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);a.forEach(s=>{if(typeof s!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${s}`)})})})}function xze(t,e,r,n={}){return r==null||r.sort((i,a)=>i.localeCompare(a)),{att:{[t]:Eze(e,r,n)}}}function Eze(t,e,r={}){e=e==null?void 0:e.sort((i,a)=>i.localeCompare(a));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function rie(t){return r1(t),`urn:recap:${vze(t).replace(/=/g,"")}`}function q3(t){const e=bze(t.replace("urn:recap:",""));return r1(e),e}function _ze(t,e,r){const n=xze(t,e,r);return rie(n)}function Cze(t){return t&&t.includes("urn:recap:")}function Sze(t,e){const r=q3(t),n=q3(e),i=Aze(r,n);return rie(i)}function Aze(t,e){r1(t),r1(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,a)=>i.localeCompare(a)),n={att:{}};return r.forEach(i=>{var a,s;Object.keys(((a=t.att)==null?void 0:a[i])||{}).concat(Object.keys(((s=e.att)==null?void 0:s[i])||{})).sort((o,l)=>o.localeCompare(l)).forEach(o=>{var l,c;n.att[i]=mze(gze({},n.att[i]),{[o]:((l=t.att[i])==null?void 0:l[o])||((c=e.att[i])==null?void 0:c[o])})})}),n}function Ize(t="",e){r1(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(o=>{const l=Object.keys(e.att[o]).map(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));l.sort((f,h)=>f.action.localeCompare(h.action));const c={};l.forEach(f=>{c[f.ability]||(c[f.ability]=[]),c[f.ability].push(f.action)});const u=Object.keys(c).map(f=>(i++,`(${i}) '${f}': '${c[f].join("', '")}' for '${o}'.`));n.push(u.join(", ").replace(".,","."))});const a=n.join(" "),s=`${r}${a}`;return`${t?t+" ":""}${s}`}function rW(t){var e;const r=q3(t);r1(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function nW(t){const e=q3(t);r1(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var a;(a=i==null?void 0:i[0])!=null&&a.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function $6(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return Cze(e)?e:void 0}const nie="base10",os="base16",Rf="base64pad",O2="base64url",cv="utf8",iie=0,Ad=1,uv=2,Mze=0,iW=1,$y=12,xj=32;function Tze(){const t=uj.generateKeyPair();return{privateKey:ia(t.secretKey,os),publicKey:ia(t.publicKey,os)}}function uT(){const t=Sh.randomBytes(xj);return ia(t,os)}function kze(t,e){const r=uj.sharedKey(ta(t,os),ta(e,os),!0),n=new MFe(nv.SHA256,r).expand(xj);return ia(n,os)}function P6(t){const e=nv.hash(ta(t,os));return ia(e,os)}function gd(t){const e=nv.hash(ta(t,cv));return ia(e,os)}function aie(t){return ta(`${t}`,nie)}function n1(t){return Number(ia(t,nie))}function Nze(t){const e=aie(typeof t.type<"u"?t.type:iie);if(n1(e)===Ad&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?ta(t.senderPublicKey,os):void 0,n=typeof t.iv<"u"?ta(t.iv,os):Sh.randomBytes($y),i=new lj.ChaCha20Poly1305(ta(t.symKey,os)).seal(n,ta(t.message,cv));return sie({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function Lze(t,e){const r=aie(uv),n=Sh.randomBytes($y),i=ta(t,cv);return sie({type:r,sealed:i,iv:n,encoding:e})}function jze(t){const e=new lj.ChaCha20Poly1305(ta(t.symKey,os)),{sealed:r,iv:n}=V3({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return ia(i,cv)}function $ze(t,e){const{sealed:r}=V3({encoded:t,encoding:e});return ia(r,cv)}function sie(t){const{encoding:e=Rf}=t;if(n1(t.type)===uv)return ia(L6([t.type,t.sealed]),e);if(n1(t.type)===Ad){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return ia(L6([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return ia(L6([t.type,t.iv,t.sealed]),e)}function V3(t){const{encoded:e,encoding:r=Rf}=t,n=ta(e,r),i=n.slice(Mze,iW),a=iW;if(n1(i)===Ad){const c=a+xj,u=c+$y,f=n.slice(a,c),h=n.slice(c,u),g=n.slice(u);return{type:i,sealed:g,iv:h,senderPublicKey:f}}if(n1(i)===uv){const c=n.slice(a),u=Sh.randomBytes($y);return{type:i,sealed:c,iv:u}}const s=a+$y,o=n.slice(a,s),l=n.slice(s);return{type:i,sealed:l,iv:o}}function Pze(t,e){const r=V3({encoded:t,encoding:e==null?void 0:e.encoding});return oie({type:n1(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?ia(r.senderPublicKey,os):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function oie(t){const e=(t==null?void 0:t.type)||iie;if(e===Ad){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function aW(t){return t.type===Ad&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function sW(t){return t.type===uv}function Rze(t){return new $ne.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function Dze(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function Oze(t){return Buffer.from(Dze(t),"base64")}function Fze(t,e){const[r,n,i]=t.split("."),a=Oze(i);if(a.length!==64)throw new Error("Invalid signature length");const s=a.slice(0,32).toString("hex"),o=a.slice(32,64).toString("hex"),l=`${r}.${n}`,c=new nv.SHA256().update(Buffer.from(l)).digest(),u=Rze(e),f=Buffer.from(c).toString("hex");if(!u.verify(f,{r:s,s:o}))throw new Error("Invalid signature");return lT(t).payload}const Uze="irn";function u8(t){return(t==null?void 0:t.relay)||{protocol:Uze}}function ly(t){const e=DBe[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var Bze=Object.defineProperty,zze=Object.defineProperties,Wze=Object.getOwnPropertyDescriptors,oW=Object.getOwnPropertySymbols,Hze=Object.prototype.hasOwnProperty,Gze=Object.prototype.propertyIsEnumerable,lW=(t,e,r)=>e in t?Bze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,cW=(t,e)=>{for(var r in e||(e={}))Hze.call(e,r)&&lW(t,r,e[r]);if(oW)for(var r of oW(e))Gze.call(e,r)&&lW(t,r,e[r]);return t},qze=(t,e)=>zze(t,Wze(e));function Vze(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),s=t[i];r[a]=s}}),r}function uW(t){if(!t.includes("wc:")){const l=eie(t);l!=null&&l.includes("wc:")&&(t=l)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),a=typeof r<"u"?t.substring(r):"",s=G3.parse(a),o=typeof s.methods=="string"?s.methods.split(","):void 0;return{protocol:n,topic:Yze(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:Vze(s),methods:o,expiryTimestamp:s.expiryTimestamp?parseInt(s.expiryTimestamp,10):void 0}}function Yze(t){return t.startsWith("//")?t.substring(2):t}function Kze(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const a=r+e+i;t[i]&&(n[a]=t[i])}),n}function dW(t){return`${t.protocol}:${t.topic}@${t.version}?`+G3.stringify(cW(qze(cW({symKey:t.symKey},Kze(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function k4(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function Rm(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function Jze(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Rm(r.accounts))}),e}function Zze(t,e){const r=[];return Object.values(t).forEach(n=>{Rm(n.accounts).includes(e)&&r.push(...n.methods)}),r}function Qze(t,e){const r=[];return Object.values(t).forEach(n=>{Rm(n.accounts).includes(e)&&r.push(...n.events)}),r}function Ej(t){return t.includes(":")}function cy(t){return Ej(t)?t.split(":")[0]:t}function Xze(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function fW(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=Xze(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=j6(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const eWe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},tWe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ht(t,e){const{message:r,code:n}=tWe[t];return{message:e?`${r} ${e}`:r,code:n}}function ln(t,e){const{message:r,code:n}=eWe[t];return{message:e?`${r} ${e}`:r,code:n}}function Hd(t,e){return!!Array.isArray(t)}function Y3(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Ps(t){return typeof t>"u"}function pi(t,e){return e&&Ps(t)?!0:typeof t=="string"&&!!t.trim().length}function _j(t,e){return typeof t=="number"&&!isNaN(t)}function rWe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let a=!0;return w0(i,n)?(n.forEach(s=>{const{accounts:o,methods:l,events:c}=t.namespaces[s],u=Rm(o),f=r[s];(!w0(Vne(s,f),u)||!w0(f.methods,l)||!w0(f.events,c))&&(a=!1)}),a):!1}function d8(t){return pi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function nWe(t){if(pi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&d8(r)}}return!1}function iWe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(pi(t,!1)){if(e(t))return!0;const r=eie(t);return e(r)}}catch{}return!1}function aWe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function sWe(t){return t==null?void 0:t.topic}function oWe(t,e){let r=null;return pi(t==null?void 0:t.publicKey,!1)||(r=ht("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function hW(t){let e=!0;return Hd(t)?t.length&&(e=t.every(r=>pi(r,!1))):e=!1,e}function lWe(t,e,r){let n=null;return Hd(e)&&e.length?e.forEach(i=>{n||d8(i)||(n=ln("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):d8(t)||(n=ln("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function cWe(t,e,r){let n=null;return Object.entries(t).forEach(([i,a])=>{if(n)return;const s=lWe(i,Vne(i,a),`${e} ${r}`);s&&(n=s)}),n}function uWe(t,e){let r=null;return Hd(t)?t.forEach(n=>{r||nWe(n)||(r=ln("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=ln("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function dWe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=uWe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function fWe(t,e){let r=null;return hW(t==null?void 0:t.methods)?hW(t==null?void 0:t.events)||(r=ln("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=ln("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function lie(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=fWe(n,`${e}, namespace`);i&&(r=i)}),r}function hWe(t,e,r){let n=null;if(t&&Y3(t)){const i=lie(t,e);i&&(n=i);const a=cWe(t,e,r);a&&(n=a)}else n=ht("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function bS(t,e){let r=null;if(t&&Y3(t)){const n=lie(t,e);n&&(r=n);const i=dWe(t,e);i&&(r=i)}else r=ht("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function cie(t){return pi(t.protocol,!0)}function pWe(t,e){let r=!1;return t?t&&Hd(t)&&t.length&&t.forEach(n=>{r=cie(n)}):r=!0,r}function gWe(t){return typeof t=="number"}function Ts(t){return typeof t<"u"&&typeof t!==null}function mWe(t){return!(!t||typeof t!="object"||!t.code||!_j(t.code)||!t.message||!pi(t.message,!1))}function yWe(t){return!(Ps(t)||!pi(t.method,!1))}function wWe(t){return!(Ps(t)||Ps(t.result)&&Ps(t.error)||!_j(t.id)||!pi(t.jsonrpc,!1))}function vWe(t){return!(Ps(t)||!pi(t.name,!1))}function pW(t,e){return!(!d8(e)||!Jze(t).includes(e))}function bWe(t,e,r){return pi(r,!1)?Zze(t,e).includes(r):!1}function xWe(t,e,r){return pi(r,!1)?Qze(t,e).includes(r):!1}function gW(t,e,r){let n=null;const i=EWe(t),a=_We(e),s=Object.keys(i),o=Object.keys(a),l=mW(Object.keys(t)),c=mW(Object.keys(e)),u=l.filter(f=>!c.includes(f));return u.length&&(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. +***************************************************************************** */var cT=function(t,e){return cT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},cT(t,e)};function TOe(t,e){cT(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var uT=function(){return uT=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function LOe(t,e){return function(r,n){e(r,n,t)}}function jOe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function $Oe(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function POe(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Pne(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function OOe(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(a[0][3],m)}}function l(h){h.value instanceof X3?Promise.resolve(h.value.v).then(c,u):f(a[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),a.shift(),a.length&&o(a[0][0],a[0][1])}}function BOe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(s){return(r=!r)?{value:X3(t[i](s)),done:i==="return"}:a?a(s):s}:a}}function zOe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof dT=="function"?dT(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,l){s=t[a](s),i(o,l,s.done,s.value)})}}function i(a,s,o,l){Promise.resolve(l).then(function(c){a({value:c,done:o})},s)}}function WOe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function HOe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function GOe(t){return t&&t.__esModule?t:{default:t}}function qOe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function VOe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const YOe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return uT},__asyncDelegator:BOe,__asyncGenerator:UOe,__asyncValues:zOe,__await:X3,__awaiter:$Oe,__classPrivateFieldGet:qOe,__classPrivateFieldSet:VOe,__createBinding:ROe,__decorate:NOe,__exportStar:DOe,__extends:TOe,__generator:POe,__importDefault:GOe,__importStar:HOe,__makeTemplateObject:WOe,__metadata:jOe,__param:LOe,__read:Pne,__rest:kOe,__spread:OOe,__spreadArrays:FOe,__values:dT},Symbol.toStringTag,{value:"Module"})),qx=wh(YOe);var vS={},H2={},jz;function KOe(){if(jz)return H2;jz=1,Object.defineProperty(H2,"__esModule",{value:!0}),H2.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return H2.delay=t,H2}var Xh={},bS={},e0={},$z;function JOe(){return $z||($z=1,Object.defineProperty(e0,"__esModule",{value:!0}),e0.ONE_THOUSAND=e0.ONE_HUNDRED=void 0,e0.ONE_HUNDRED=100,e0.ONE_THOUSAND=1e3),e0}var xS={},Pz;function QOe(){return Pz||(Pz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(xS)),xS}var Rz;function Rne(){return Rz||(Rz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qx;e.__exportStar(JOe(),t),e.__exportStar(QOe(),t)}(bS)),bS}var Dz;function ZOe(){if(Dz)return Xh;Dz=1,Object.defineProperty(Xh,"__esModule",{value:!0}),Xh.fromMiliseconds=Xh.toMiliseconds=void 0;const t=Rne();function e(n){return n*t.ONE_THOUSAND}Xh.toMiliseconds=e;function r(n){return Math.floor(n/t.ONE_THOUSAND)}return Xh.fromMiliseconds=r,Xh}var Oz;function XOe(){return Oz||(Oz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qx;e.__exportStar(KOe(),t),e.__exportStar(ZOe(),t)}(vS)),vS}var _p={},Fz;function eFe(){if(Fz)return _p;Fz=1,Object.defineProperty(_p,"__esModule",{value:!0}),_p.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return _p.Watch=t,_p.default=t,_p}var ES={},G2={},Uz;function tFe(){if(Uz)return G2;Uz=1,Object.defineProperty(G2,"__esModule",{value:!0}),G2.IWatch=void 0;class t{}return G2.IWatch=t,G2}var Bz;function rFe(){return Bz||(Bz=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),qx.__exportStar(tFe(),t)}(ES)),ES}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=qx;e.__exportStar(XOe(),t),e.__exportStar(eFe(),t),e.__exportStar(rFe(),t),e.__exportStar(Rne(),t)})(ct);var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0});Sn.getLocalStorage=Sn.getLocalStorageOrThrow=Sn.getCrypto=Sn.getCryptoOrThrow=Dne=Sn.getLocation=Sn.getLocationOrThrow=yj=Sn.getNavigator=Sn.getNavigatorOrThrow=cv=Sn.getDocument=Sn.getDocumentOrThrow=Sn.getFromWindowOrThrow=Sn.getFromWindow=void 0;function L1(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}Sn.getFromWindow=L1;function Um(t){const e=L1(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}Sn.getFromWindowOrThrow=Um;function nFe(){return Um("document")}Sn.getDocumentOrThrow=nFe;function iFe(){return L1("document")}var cv=Sn.getDocument=iFe;function aFe(){return Um("navigator")}Sn.getNavigatorOrThrow=aFe;function sFe(){return L1("navigator")}var yj=Sn.getNavigator=sFe;function oFe(){return Um("location")}Sn.getLocationOrThrow=oFe;function lFe(){return L1("location")}var Dne=Sn.getLocation=lFe;function cFe(){return Um("crypto")}Sn.getCryptoOrThrow=cFe;function uFe(){return L1("crypto")}Sn.getCrypto=uFe;function dFe(){return Um("localStorage")}Sn.getLocalStorageOrThrow=dFe;function fFe(){return L1("localStorage")}Sn.getLocalStorage=fFe;var wj={};Object.defineProperty(wj,"__esModule",{value:!0});var One=wj.getWindowMetadata=void 0;const zz=Sn;function hFe(){let t,e;try{t=zz.getDocumentOrThrow(),e=zz.getLocationOrThrow()}catch{return null}function r(){const f=t.getElementsByTagName("link"),h=[];for(let g=0;g-1){const C=m.getAttribute("href");if(C)if(C.toLowerCase().indexOf("https:")===-1&&C.toLowerCase().indexOf("http:")===-1&&C.indexOf("//")!==0){let v=e.protocol+"//"+e.host;if(C.indexOf("/")===0)v+=C;else{const b=e.pathname.split("/");b.pop();const A=b.join("/");v+=A+"/"+C}h.push(v)}else if(C.indexOf("//")===0){const v=e.protocol+C;h.push(v)}else h.push(C)}}return h}function n(...f){const h=t.getElementsByTagName("meta");for(let g=0;gm.getAttribute(C)).filter(C=>C?f.includes(C):!1);if(w.length&&w){const C=m.getAttribute("content");if(C)return C}}return""}function i(){let f=n("name","og:site_name","og:title","twitter:title");return f||(f=t.title),f}function a(){return n("description","og:description","twitter:description","keywords")}const s=i(),o=a(),l=e.origin,c=r();return{description:o,url:l,icons:c,name:s}}One=wj.getWindowMetadata=hFe;var ew={},pFe=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),Fne="%[a-f0-9]{2}",Wz=new RegExp("("+Fne+")|([^%]+?)","gi"),Hz=new RegExp("("+Fne+")+","gi");function fT(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),n=t.slice(e);return Array.prototype.concat.call([],fT(r),fT(n))}function gFe(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(Wz)||[],r=1;r{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},vFe=function(t,e){for(var r={},n=Object.keys(t),i=Array.isArray(e),a=0;ab==null,s=Symbol("encodeFragmentIdentifier");function o(b){switch(b.arrayFormat){case"index":return A=>(S,j)=>{const F=S.length;return j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),"[",F,"]"].join("")]:[...S,[u(A,b),"[",u(F,b),"]=",u(j,b)].join("")]};case"bracket":return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),"[]"].join("")]:[...S,[u(A,b),"[]=",u(j,b)].join("")];case"colon-list-separator":return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,[u(A,b),":list="].join("")]:[...S,[u(A,b),":list=",u(j,b)].join("")];case"comma":case"separator":case"bracket-separator":{const A=b.arrayFormat==="bracket-separator"?"[]=":"=";return S=>(j,F)=>F===void 0||b.skipNull&&F===null||b.skipEmptyString&&F===""?j:(F=F===null?"":F,j.length===0?[[u(S,b),A,u(F,b)].join("")]:[[j,u(F,b)].join(b.arrayFormatSeparator)])}default:return A=>(S,j)=>j===void 0||b.skipNull&&j===null||b.skipEmptyString&&j===""?S:j===null?[...S,u(A,b)]:[...S,[u(A,b),"=",u(j,b)].join("")]}}function l(b){let A;switch(b.arrayFormat){case"index":return(S,j,F)=>{if(A=/\[(\d*)\]$/.exec(S),S=S.replace(/\[\d*\]$/,""),!A){F[S]=j;return}F[S]===void 0&&(F[S]={}),F[S][A[1]]=j};case"bracket":return(S,j,F)=>{if(A=/(\[\])$/.exec(S),S=S.replace(/\[\]$/,""),!A){F[S]=j;return}if(F[S]===void 0){F[S]=[j];return}F[S]=[].concat(F[S],j)};case"colon-list-separator":return(S,j,F)=>{if(A=/(:list)$/.exec(S),S=S.replace(/:list$/,""),!A){F[S]=j;return}if(F[S]===void 0){F[S]=[j];return}F[S]=[].concat(F[S],j)};case"comma":case"separator":return(S,j,F)=>{const I=typeof j=="string"&&j.includes(b.arrayFormatSeparator),B=typeof j=="string"&&!I&&f(j,b).includes(b.arrayFormatSeparator);j=B?f(j,b):j;const V=I||B?j.split(b.arrayFormatSeparator).map(se=>f(se,b)):j===null?j:f(j,b);F[S]=V};case"bracket-separator":return(S,j,F)=>{const I=/(\[\])$/.test(S);if(S=S.replace(/\[\]$/,""),!I){F[S]=j&&f(j,b);return}const B=j===null?[]:j.split(b.arrayFormatSeparator).map(V=>f(V,b));if(F[S]===void 0){F[S]=B;return}F[S]=[].concat(F[S],B)};default:return(S,j,F)=>{if(F[S]===void 0){F[S]=j;return}F[S]=[].concat(F[S],j)}}}function c(b){if(typeof b!="string"||b.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function u(b,A){return A.encode?A.strict?e(b):encodeURIComponent(b):b}function f(b,A){return A.decode?r(b):b}function h(b){return Array.isArray(b)?b.sort():typeof b=="object"?h(Object.keys(b)).sort((A,S)=>Number(A)-Number(S)).map(A=>b[A]):b}function g(b){const A=b.indexOf("#");return A!==-1&&(b=b.slice(0,A)),b}function m(b){let A="";const S=b.indexOf("#");return S!==-1&&(A=b.slice(S)),A}function w(b){b=g(b);const A=b.indexOf("?");return A===-1?"":b.slice(A+1)}function C(b,A){return A.parseNumbers&&!Number.isNaN(Number(b))&&typeof b=="string"&&b.trim()!==""?b=Number(b):A.parseBooleans&&b!==null&&(b.toLowerCase()==="true"||b.toLowerCase()==="false")&&(b=b.toLowerCase()==="true"),b}function v(b,A){A=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},A),c(A.arrayFormatSeparator);const S=l(A),j=Object.create(null);if(typeof b!="string"||(b=b.trim().replace(/^[?#&]/,""),!b))return j;for(const F of b.split("&")){if(F==="")continue;let[I,B]=n(A.decode?F.replace(/\+/g," "):F,"=");B=B===void 0?null:["comma","separator","bracket-separator"].includes(A.arrayFormat)?B:f(B,A),S(f(I,A),B,j)}for(const F of Object.keys(j)){const I=j[F];if(typeof I=="object"&&I!==null)for(const B of Object.keys(I))I[B]=C(I[B],A);else j[F]=C(I,A)}return A.sort===!1?j:(A.sort===!0?Object.keys(j).sort():Object.keys(j).sort(A.sort)).reduce((F,I)=>{const B=j[I];return B&&typeof B=="object"&&!Array.isArray(B)?F[I]=h(B):F[I]=B,F},Object.create(null))}t.extract=w,t.parse=v,t.stringify=(b,A)=>{if(!b)return"";A=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},A),c(A.arrayFormatSeparator);const S=B=>A.skipNull&&a(b[B])||A.skipEmptyString&&b[B]==="",j=o(A),F={};for(const B of Object.keys(b))S(B)||(F[B]=b[B]);const I=Object.keys(F);return A.sort!==!1&&I.sort(A.sort),I.map(B=>{const V=b[B];return V===void 0?"":V===null?u(B,A):Array.isArray(V)?V.length===0&&A.arrayFormat==="bracket-separator"?u(B,A)+"[]":V.reduce(j(B),[]).join("&"):u(B,A)+"="+u(V,A)}).filter(B=>B.length>0).join("&")},t.parseUrl=(b,A)=>{A=Object.assign({decode:!0},A);const[S,j]=n(b,"#");return Object.assign({url:S.split("?")[0]||"",query:v(w(b),A)},A&&A.parseFragmentIdentifier&&j?{fragmentIdentifier:f(j,A)}:{})},t.stringifyUrl=(b,A)=>{A=Object.assign({encode:!0,strict:!0,[s]:!0},A);const S=g(b.url).split("?")[0]||"",j=t.extract(b.url),F=t.parse(j,{sort:!1}),I=Object.assign(F,b.query);let B=t.stringify(I,A);B&&(B=`?${B}`);let V=m(b.url);return b.fragmentIdentifier&&(V=`#${A[s]?u(b.fragmentIdentifier,A):b.fragmentIdentifier}`),`${S}${B}${V}`},t.pick=(b,A,S)=>{S=Object.assign({parseFragmentIdentifier:!0,[s]:!1},S);const{url:j,query:F,fragmentIdentifier:I}=t.parseUrl(b,S);return t.stringifyUrl({url:j,query:i(F,A),fragmentIdentifier:I},S)},t.exclude=(b,A,S)=>{const j=Array.isArray(A)?F=>!A.includes(F):(F,I)=>!A(F,I);return t.pick(b,j,S)}})(ew);var vj={},Vx={},wr={},Une={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(o,l){var c=o>>>16&65535,u=o&65535,f=l>>>16&65535,h=l&65535;return u*h+(c*h+u*f<<16>>>0)|0}t.mul=Math.imul||e;function r(o,l){return o+l|0}t.add=r;function n(o,l){return o-l|0}t.sub=n;function i(o,l){return o<>>32-l}t.rotl=i;function a(o,l){return o<<32-l|o>>>l}t.rotr=a;function s(o){return typeof o=="number"&&isFinite(o)&&Math.floor(o)===o}t.isInteger=Number.isInteger||s,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(o){return t.isInteger(o)&&o>=-t.MAX_SAFE_INTEGER&&o<=t.MAX_SAFE_INTEGER}})(Une);Object.defineProperty(wr,"__esModule",{value:!0});var Bne=Une;function bFe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}wr.readInt16BE=bFe;function xFe(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}wr.readUint16BE=xFe;function EFe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}wr.readInt16LE=EFe;function _Fe(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}wr.readUint16LE=_Fe;function zne(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}wr.writeUint16BE=zne;wr.writeInt16BE=zne;function Wne(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}wr.writeUint16LE=Wne;wr.writeInt16LE=Wne;function hT(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}wr.readInt32BE=hT;function pT(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}wr.readUint32BE=pT;function gT(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}wr.readInt32LE=gT;function mT(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}wr.readUint32LE=mT;function u8(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}wr.writeUint32BE=u8;wr.writeInt32BE=u8;function d8(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}wr.writeUint32LE=d8;wr.writeInt32LE=d8;function CFe(t,e){e===void 0&&(e=0);var r=hT(t,e),n=hT(t,e+4);return r*4294967296+n-(n>>31)*4294967296}wr.readInt64BE=CFe;function SFe(t,e){e===void 0&&(e=0);var r=pT(t,e),n=pT(t,e+4);return r*4294967296+n}wr.readUint64BE=SFe;function AFe(t,e){e===void 0&&(e=0);var r=gT(t,e),n=gT(t,e+4);return n*4294967296+r-(r>>31)*4294967296}wr.readInt64LE=AFe;function IFe(t,e){e===void 0&&(e=0);var r=mT(t,e),n=mT(t,e+4);return n*4294967296+r}wr.readUint64LE=IFe;function Hne(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),u8(t/4294967296>>>0,e,r),u8(t>>>0,e,r+4),e}wr.writeUint64BE=Hne;wr.writeInt64BE=Hne;function Gne(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),d8(t>>>0,e,r),d8(t/4294967296>>>0,e,r+4),e}wr.writeUint64LE=Gne;wr.writeInt64LE=Gne;function MFe(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}wr.readUintBE=MFe;function TFe(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=n;a--)r[a]=e/i&255,i*=256;return r}wr.writeUintBE=kFe;function NFe(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(!Bne.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var i=1,a=n;a>>16|E<<16,Y=Y+E|0,I^=Y,I=I>>>20|I<<12,S=S+B|0,L^=S,L=L>>>16|L<<16,N=N+L|0,B^=N,B=B>>>20|B<<12,j=j+V|0,O^=j,O=O>>>16|O<<16,k=k+O|0,V^=k,V=V>>>20|V<<12,F=F+se|0,P^=F,P=P>>>16|P<<16,x=x+P|0,se^=x,se=se>>>20|se<<12,j=j+V|0,O^=j,O=O>>>24|O<<8,k=k+O|0,V^=k,V=V>>>25|V<<7,F=F+se|0,P^=F,P=P>>>24|P<<8,x=x+P|0,se^=x,se=se>>>25|se<<7,S=S+B|0,L^=S,L=L>>>24|L<<8,N=N+L|0,B^=N,B=B>>>25|B<<7,A=A+I|0,E^=A,E=E>>>24|E<<8,Y=Y+E|0,I^=Y,I=I>>>25|I<<7,A=A+B|0,P^=A,P=P>>>16|P<<16,k=k+P|0,B^=k,B=B>>>20|B<<12,S=S+V|0,E^=S,E=E>>>16|E<<16,x=x+E|0,V^=x,V=V>>>20|V<<12,j=j+se|0,L^=j,L=L>>>16|L<<16,Y=Y+L|0,se^=Y,se=se>>>20|se<<12,F=F+I|0,O^=F,O=O>>>16|O<<16,N=N+O|0,I^=N,I=I>>>20|I<<12,j=j+se|0,L^=j,L=L>>>24|L<<8,Y=Y+L|0,se^=Y,se=se>>>25|se<<7,F=F+I|0,O^=F,O=O>>>24|O<<8,N=N+O|0,I^=N,I=I>>>25|I<<7,S=S+V|0,E^=S,E=E>>>24|E<<8,x=x+E|0,V^=x,V=V>>>25|V<<7,A=A+B|0,P^=A,P=P>>>24|P<<8,k=k+P|0,B^=k,B=B>>>25|B<<7;Ma.writeUint32LE(A+n|0,t,0),Ma.writeUint32LE(S+i|0,t,4),Ma.writeUint32LE(j+a|0,t,8),Ma.writeUint32LE(F+s|0,t,12),Ma.writeUint32LE(I+o|0,t,16),Ma.writeUint32LE(B+l|0,t,20),Ma.writeUint32LE(V+c|0,t,24),Ma.writeUint32LE(se+u|0,t,28),Ma.writeUint32LE(Y+f|0,t,32),Ma.writeUint32LE(N+h|0,t,36),Ma.writeUint32LE(k+g|0,t,40),Ma.writeUint32LE(x+m|0,t,44),Ma.writeUint32LE(E+w|0,t,48),Ma.writeUint32LE(L+C|0,t,52),Ma.writeUint32LE(O+v|0,t,56),Ma.writeUint32LE(P+b|0,t,60)}function qne(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>>=8,e++;if(n>0)throw new Error("ChaCha: counter overflow")}var Vne={},kh={};Object.defineProperty(kh,"__esModule",{value:!0});function GFe(t,e,r){return~(t-1)&e|t-1&r}kh.select=GFe;function qFe(t,e){return(t|0)-(e|0)-1>>>31&1}kh.lessOrEqual=qFe;function Yne(t,e){if(t.length!==e.length)return 0;for(var r=0,n=0;n>>8}kh.compare=Yne;function VFe(t,e){return t.length===0||e.length===0?!1:Yne(t,e)!==0}kh.equal=VFe;(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=kh,r=Do;t.DIGEST_LENGTH=16;var n=function(){function s(o){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 l=o[0]|o[1]<<8;this._r[0]=l&8191;var c=o[2]|o[3]<<8;this._r[1]=(l>>>13|c<<3)&8191;var u=o[4]|o[5]<<8;this._r[2]=(c>>>10|u<<6)&7939;var f=o[6]|o[7]<<8;this._r[3]=(u>>>7|f<<9)&8191;var h=o[8]|o[9]<<8;this._r[4]=(f>>>4|h<<12)&255,this._r[5]=h>>>1&8190;var g=o[10]|o[11]<<8;this._r[6]=(h>>>14|g<<2)&8191;var m=o[12]|o[13]<<8;this._r[7]=(g>>>11|m<<5)&8065;var w=o[14]|o[15]<<8;this._r[8]=(m>>>8|w<<8)&8191,this._r[9]=w>>>5&127,this._pad[0]=o[16]|o[17]<<8,this._pad[1]=o[18]|o[19]<<8,this._pad[2]=o[20]|o[21]<<8,this._pad[3]=o[22]|o[23]<<8,this._pad[4]=o[24]|o[25]<<8,this._pad[5]=o[26]|o[27]<<8,this._pad[6]=o[28]|o[29]<<8,this._pad[7]=o[30]|o[31]<<8}return s.prototype._blocks=function(o,l,c){for(var u=this._fin?0:2048,f=this._h[0],h=this._h[1],g=this._h[2],m=this._h[3],w=this._h[4],C=this._h[5],v=this._h[6],b=this._h[7],A=this._h[8],S=this._h[9],j=this._r[0],F=this._r[1],I=this._r[2],B=this._r[3],V=this._r[4],se=this._r[5],Y=this._r[6],N=this._r[7],k=this._r[8],x=this._r[9];c>=16;){var E=o[l+0]|o[l+1]<<8;f+=E&8191;var L=o[l+2]|o[l+3]<<8;h+=(E>>>13|L<<3)&8191;var O=o[l+4]|o[l+5]<<8;g+=(L>>>10|O<<6)&8191;var P=o[l+6]|o[l+7]<<8;m+=(O>>>7|P<<9)&8191;var R=o[l+8]|o[l+9]<<8;w+=(P>>>4|R<<12)&8191,C+=R>>>1&8191;var M=o[l+10]|o[l+11]<<8;v+=(R>>>14|M<<2)&8191;var D=o[l+12]|o[l+13]<<8;b+=(M>>>11|D<<5)&8191;var $=o[l+14]|o[l+15]<<8;A+=(D>>>8|$<<8)&8191,S+=$>>>5|u;var X=0,le=X;le+=f*j,le+=h*(5*x),le+=g*(5*k),le+=m*(5*N),le+=w*(5*Y),X=le>>>13,le&=8191,le+=C*(5*se),le+=v*(5*V),le+=b*(5*B),le+=A*(5*I),le+=S*(5*F),X+=le>>>13,le&=8191;var H=X;H+=f*F,H+=h*j,H+=g*(5*x),H+=m*(5*k),H+=w*(5*N),X=H>>>13,H&=8191,H+=C*(5*Y),H+=v*(5*se),H+=b*(5*V),H+=A*(5*B),H+=S*(5*I),X+=H>>>13,H&=8191;var ee=X;ee+=f*I,ee+=h*F,ee+=g*j,ee+=m*(5*x),ee+=w*(5*k),X=ee>>>13,ee&=8191,ee+=C*(5*N),ee+=v*(5*Y),ee+=b*(5*se),ee+=A*(5*V),ee+=S*(5*B),X+=ee>>>13,ee&=8191;var J=X;J+=f*B,J+=h*I,J+=g*F,J+=m*j,J+=w*(5*x),X=J>>>13,J&=8191,J+=C*(5*k),J+=v*(5*N),J+=b*(5*Y),J+=A*(5*se),J+=S*(5*V),X+=J>>>13,J&=8191;var te=X;te+=f*V,te+=h*B,te+=g*I,te+=m*F,te+=w*j,X=te>>>13,te&=8191,te+=C*(5*x),te+=v*(5*k),te+=b*(5*N),te+=A*(5*Y),te+=S*(5*se),X+=te>>>13,te&=8191;var re=X;re+=f*se,re+=h*V,re+=g*B,re+=m*I,re+=w*F,X=re>>>13,re&=8191,re+=C*j,re+=v*(5*x),re+=b*(5*k),re+=A*(5*N),re+=S*(5*Y),X+=re>>>13,re&=8191;var z=X;z+=f*Y,z+=h*se,z+=g*V,z+=m*B,z+=w*I,X=z>>>13,z&=8191,z+=C*F,z+=v*j,z+=b*(5*x),z+=A*(5*k),z+=S*(5*N),X+=z>>>13,z&=8191;var G=X;G+=f*N,G+=h*Y,G+=g*se,G+=m*V,G+=w*B,X=G>>>13,G&=8191,G+=C*I,G+=v*F,G+=b*j,G+=A*(5*x),G+=S*(5*k),X+=G>>>13,G&=8191;var Q=X;Q+=f*k,Q+=h*N,Q+=g*Y,Q+=m*se,Q+=w*V,X=Q>>>13,Q&=8191,Q+=C*B,Q+=v*I,Q+=b*F,Q+=A*j,Q+=S*(5*x),X+=Q>>>13,Q&=8191;var me=X;me+=f*x,me+=h*k,me+=g*N,me+=m*Y,me+=w*se,X=me>>>13,me&=8191,me+=C*V,me+=v*B,me+=b*I,me+=A*F,me+=S*j,X+=me>>>13,me&=8191,X=(X<<2)+X|0,X=X+le|0,le=X&8191,X=X>>>13,H+=X,f=le,h=H,g=ee,m=J,w=te,C=re,v=z,b=G,A=Q,S=me,l+=16,c-=16}this._h[0]=f,this._h[1]=h,this._h[2]=g,this._h[3]=m,this._h[4]=w,this._h[5]=C,this._h[6]=v,this._h[7]=b,this._h[8]=A,this._h[9]=S},s.prototype.finish=function(o,l){l===void 0&&(l=0);var c=new Uint16Array(10),u,f,h,g;if(this._leftover){for(g=this._leftover,this._buffer[g++]=1;g<16;g++)this._buffer[g]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(u=this._h[1]>>>13,this._h[1]&=8191,g=2;g<10;g++)this._h[g]+=u,u=this._h[g]>>>13,this._h[g]&=8191;for(this._h[0]+=u*5,u=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=u,u=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=u,c[0]=this._h[0]+5,u=c[0]>>>13,c[0]&=8191,g=1;g<10;g++)c[g]=this._h[g]+u,u=c[g]>>>13,c[g]&=8191;for(c[9]-=8192,f=(u^1)-1,g=0;g<10;g++)c[g]&=f;for(f=~f,g=0;g<10;g++)this._h[g]=this._h[g]&f|c[g];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,h=this._h[0]+this._pad[0],this._h[0]=h&65535,g=1;g<8;g++)h=(this._h[g]+this._pad[g]|0)+(h>>>16)|0,this._h[g]=h&65535;return o[l+0]=this._h[0]>>>0,o[l+1]=this._h[0]>>>8,o[l+2]=this._h[1]>>>0,o[l+3]=this._h[1]>>>8,o[l+4]=this._h[2]>>>0,o[l+5]=this._h[2]>>>8,o[l+6]=this._h[3]>>>0,o[l+7]=this._h[3]>>>8,o[l+8]=this._h[4]>>>0,o[l+9]=this._h[4]>>>8,o[l+10]=this._h[5]>>>0,o[l+11]=this._h[5]>>>8,o[l+12]=this._h[6]>>>0,o[l+13]=this._h[6]>>>8,o[l+14]=this._h[7]>>>0,o[l+15]=this._h[7]>>>8,this._finished=!0,this},s.prototype.update=function(o){var l=0,c=o.length,u;if(this._leftover){u=16-this._leftover,u>c&&(u=c);for(var f=0;f=16&&(u=c-c%16,this._blocks(o,l,u),l+=u,c-=u),c){for(var f=0;f16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var g=new Uint8Array(16);g.set(c,g.length-c.length);var m=new Uint8Array(32);e.stream(this._key,g,m,4);var w=u.length+this.tagLength,C;if(h){if(h.length!==w)throw new Error("ChaCha20Poly1305: incorrect destination length");C=h}else C=new Uint8Array(w);return e.streamXOR(this._key,g,u,C,4),this._authenticate(C.subarray(C.length-this.tagLength,C.length),m,C.subarray(0,C.length-this.tagLength),f),n.wipe(g),C},l.prototype.open=function(c,u,f,h){if(c.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(u.length0&&g.update(s.subarray(h.length%16))),g.update(f),f.length%16>0&&g.update(s.subarray(f.length%16));var m=new Uint8Array(8);h&&i.writeUint64LE(h.length,m),g.update(m),i.writeUint64LE(f.length,m),g.update(m);for(var w=g.digest(),C=0;Cthis.blockSize?this._inner.update(r).finish(n).clean():n.set(r);for(var i=0;i1&&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;n256)throw new Error("randomString charset is too long");let h="";const g=u.length,m=256-256%g;for(;c>0;){const w=i(Math.ceil(c*256/m),f);for(let C=0;C0;C++){const v=w[C];v0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._temp,this._state,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},o.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,h=c<<3,g=c%64<56?64:128;this._buffer[u]=128;for(var m=u+1;m0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},o}();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(o,l,c,u,f){for(;f>=64;){for(var h=l[0],g=l[1],m=l[2],w=l[3],C=l[4],v=l[5],b=l[6],A=l[7],S=0;S<16;S++){var j=u+S*4;o[S]=e.readUint32BE(c,j)}for(var S=16;S<64;S++){var F=o[S-2],I=(F>>>17|F<<15)^(F>>>19|F<<13)^F>>>10;F=o[S-15];var B=(F>>>7|F<<25)^(F>>>18|F<<14)^F>>>3;o[S]=(I+o[S-7]|0)+(B+o[S-16]|0)}for(var S=0;S<64;S++){var I=(((C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7))+(C&v^~C&b)|0)+(A+(i[S]+o[S]|0)|0)|0,B=((h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10))+(h&g^h&m^g&m)|0;A=b,b=v,v=C,C=w+I|0,w=m,m=g,g=h,h=I+B|0}l[0]+=h,l[1]+=g,l[2]+=m,l[3]+=w,l[4]+=C,l[5]+=v,l[6]+=b,l[7]+=A,u+=64,f-=64}return u}function s(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=s})(dv);var xj={};(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=Nh,r=Do;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function n(S){const j=new Float64Array(16);if(S)for(let F=0;F>16&1),F[se-1]&=65535;F[15]=I[15]-32767-(F[14]>>16&1);const V=F[15]>>16&1;F[14]&=65535,o(I,F,1-V)}for(let B=0;B<16;B++)S[2*B]=I[B]&255,S[2*B+1]=I[B]>>8}function c(S,j){for(let F=0;F<16;F++)S[F]=j[2*F]+(j[2*F+1]<<8);S[15]&=32767}function u(S,j,F){for(let I=0;I<16;I++)S[I]=j[I]+F[I]}function f(S,j,F){for(let I=0;I<16;I++)S[I]=j[I]-F[I]}function h(S,j,F){let I,B,V=0,se=0,Y=0,N=0,k=0,x=0,E=0,L=0,O=0,P=0,R=0,M=0,D=0,$=0,X=0,le=0,H=0,ee=0,J=0,te=0,re=0,z=0,G=0,Q=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ke=0,lt=0,Ee=F[0],He=F[1],qe=F[2],Ie=F[3],Ne=F[4],$e=F[5],je=F[6],K=F[7],U=F[8],W=F[9],ie=F[10],pe=F[11],we=F[12],he=F[13],Re=F[14],Je=F[15];I=j[0],V+=I*Ee,se+=I*He,Y+=I*qe,N+=I*Ie,k+=I*Ne,x+=I*$e,E+=I*je,L+=I*K,O+=I*U,P+=I*W,R+=I*ie,M+=I*pe,D+=I*we,$+=I*he,X+=I*Re,le+=I*Je,I=j[1],se+=I*Ee,Y+=I*He,N+=I*qe,k+=I*Ie,x+=I*Ne,E+=I*$e,L+=I*je,O+=I*K,P+=I*U,R+=I*W,M+=I*ie,D+=I*pe,$+=I*we,X+=I*he,le+=I*Re,H+=I*Je,I=j[2],Y+=I*Ee,N+=I*He,k+=I*qe,x+=I*Ie,E+=I*Ne,L+=I*$e,O+=I*je,P+=I*K,R+=I*U,M+=I*W,D+=I*ie,$+=I*pe,X+=I*we,le+=I*he,H+=I*Re,ee+=I*Je,I=j[3],N+=I*Ee,k+=I*He,x+=I*qe,E+=I*Ie,L+=I*Ne,O+=I*$e,P+=I*je,R+=I*K,M+=I*U,D+=I*W,$+=I*ie,X+=I*pe,le+=I*we,H+=I*he,ee+=I*Re,J+=I*Je,I=j[4],k+=I*Ee,x+=I*He,E+=I*qe,L+=I*Ie,O+=I*Ne,P+=I*$e,R+=I*je,M+=I*K,D+=I*U,$+=I*W,X+=I*ie,le+=I*pe,H+=I*we,ee+=I*he,J+=I*Re,te+=I*Je,I=j[5],x+=I*Ee,E+=I*He,L+=I*qe,O+=I*Ie,P+=I*Ne,R+=I*$e,M+=I*je,D+=I*K,$+=I*U,X+=I*W,le+=I*ie,H+=I*pe,ee+=I*we,J+=I*he,te+=I*Re,re+=I*Je,I=j[6],E+=I*Ee,L+=I*He,O+=I*qe,P+=I*Ie,R+=I*Ne,M+=I*$e,D+=I*je,$+=I*K,X+=I*U,le+=I*W,H+=I*ie,ee+=I*pe,J+=I*we,te+=I*he,re+=I*Re,z+=I*Je,I=j[7],L+=I*Ee,O+=I*He,P+=I*qe,R+=I*Ie,M+=I*Ne,D+=I*$e,$+=I*je,X+=I*K,le+=I*U,H+=I*W,ee+=I*ie,J+=I*pe,te+=I*we,re+=I*he,z+=I*Re,G+=I*Je,I=j[8],O+=I*Ee,P+=I*He,R+=I*qe,M+=I*Ie,D+=I*Ne,$+=I*$e,X+=I*je,le+=I*K,H+=I*U,ee+=I*W,J+=I*ie,te+=I*pe,re+=I*we,z+=I*he,G+=I*Re,Q+=I*Je,I=j[9],P+=I*Ee,R+=I*He,M+=I*qe,D+=I*Ie,$+=I*Ne,X+=I*$e,le+=I*je,H+=I*K,ee+=I*U,J+=I*W,te+=I*ie,re+=I*pe,z+=I*we,G+=I*he,Q+=I*Re,me+=I*Je,I=j[10],R+=I*Ee,M+=I*He,D+=I*qe,$+=I*Ie,X+=I*Ne,le+=I*$e,H+=I*je,ee+=I*K,J+=I*U,te+=I*W,re+=I*ie,z+=I*pe,G+=I*we,Q+=I*he,me+=I*Re,be+=I*Je,I=j[11],M+=I*Ee,D+=I*He,$+=I*qe,X+=I*Ie,le+=I*Ne,H+=I*$e,ee+=I*je,J+=I*K,te+=I*U,re+=I*W,z+=I*ie,G+=I*pe,Q+=I*we,me+=I*he,be+=I*Re,Ce+=I*Je,I=j[12],D+=I*Ee,$+=I*He,X+=I*qe,le+=I*Ie,H+=I*Ne,ee+=I*$e,J+=I*je,te+=I*K,re+=I*U,z+=I*W,G+=I*ie,Q+=I*pe,me+=I*we,be+=I*he,Ce+=I*Re,Fe+=I*Je,I=j[13],$+=I*Ee,X+=I*He,le+=I*qe,H+=I*Ie,ee+=I*Ne,J+=I*$e,te+=I*je,re+=I*K,z+=I*U,G+=I*W,Q+=I*ie,me+=I*pe,be+=I*we,Ce+=I*he,Fe+=I*Re,Ue+=I*Je,I=j[14],X+=I*Ee,le+=I*He,H+=I*qe,ee+=I*Ie,J+=I*Ne,te+=I*$e,re+=I*je,z+=I*K,G+=I*U,Q+=I*W,me+=I*ie,be+=I*pe,Ce+=I*we,Fe+=I*he,Ue+=I*Re,Ke+=I*Je,I=j[15],le+=I*Ee,H+=I*He,ee+=I*qe,J+=I*Ie,te+=I*Ne,re+=I*$e,z+=I*je,G+=I*K,Q+=I*U,me+=I*W,be+=I*ie,Ce+=I*pe,Fe+=I*we,Ue+=I*he,Ke+=I*Re,lt+=I*Je,V+=38*H,se+=38*ee,Y+=38*J,N+=38*te,k+=38*re,x+=38*z,E+=38*G,L+=38*Q,O+=38*me,P+=38*be,R+=38*Ce,M+=38*Fe,D+=38*Ue,$+=38*Ke,X+=38*lt,B=1,I=V+B+65535,B=Math.floor(I/65536),V=I-B*65536,I=se+B+65535,B=Math.floor(I/65536),se=I-B*65536,I=Y+B+65535,B=Math.floor(I/65536),Y=I-B*65536,I=N+B+65535,B=Math.floor(I/65536),N=I-B*65536,I=k+B+65535,B=Math.floor(I/65536),k=I-B*65536,I=x+B+65535,B=Math.floor(I/65536),x=I-B*65536,I=E+B+65535,B=Math.floor(I/65536),E=I-B*65536,I=L+B+65535,B=Math.floor(I/65536),L=I-B*65536,I=O+B+65535,B=Math.floor(I/65536),O=I-B*65536,I=P+B+65535,B=Math.floor(I/65536),P=I-B*65536,I=R+B+65535,B=Math.floor(I/65536),R=I-B*65536,I=M+B+65535,B=Math.floor(I/65536),M=I-B*65536,I=D+B+65535,B=Math.floor(I/65536),D=I-B*65536,I=$+B+65535,B=Math.floor(I/65536),$=I-B*65536,I=X+B+65535,B=Math.floor(I/65536),X=I-B*65536,I=le+B+65535,B=Math.floor(I/65536),le=I-B*65536,V+=B-1+37*(B-1),B=1,I=V+B+65535,B=Math.floor(I/65536),V=I-B*65536,I=se+B+65535,B=Math.floor(I/65536),se=I-B*65536,I=Y+B+65535,B=Math.floor(I/65536),Y=I-B*65536,I=N+B+65535,B=Math.floor(I/65536),N=I-B*65536,I=k+B+65535,B=Math.floor(I/65536),k=I-B*65536,I=x+B+65535,B=Math.floor(I/65536),x=I-B*65536,I=E+B+65535,B=Math.floor(I/65536),E=I-B*65536,I=L+B+65535,B=Math.floor(I/65536),L=I-B*65536,I=O+B+65535,B=Math.floor(I/65536),O=I-B*65536,I=P+B+65535,B=Math.floor(I/65536),P=I-B*65536,I=R+B+65535,B=Math.floor(I/65536),R=I-B*65536,I=M+B+65535,B=Math.floor(I/65536),M=I-B*65536,I=D+B+65535,B=Math.floor(I/65536),D=I-B*65536,I=$+B+65535,B=Math.floor(I/65536),$=I-B*65536,I=X+B+65535,B=Math.floor(I/65536),X=I-B*65536,I=le+B+65535,B=Math.floor(I/65536),le=I-B*65536,V+=B-1+37*(B-1),S[0]=V,S[1]=se,S[2]=Y,S[3]=N,S[4]=k,S[5]=x,S[6]=E,S[7]=L,S[8]=O,S[9]=P,S[10]=R,S[11]=M,S[12]=D,S[13]=$,S[14]=X,S[15]=le}function g(S,j){h(S,j,j)}function m(S,j){const F=n();for(let I=0;I<16;I++)F[I]=j[I];for(let I=253;I>=0;I--)g(F,F),I!==2&&I!==4&&h(F,F,j);for(let I=0;I<16;I++)S[I]=F[I]}function w(S,j){const F=new Uint8Array(32),I=new Float64Array(80),B=n(),V=n(),se=n(),Y=n(),N=n(),k=n();for(let O=0;O<31;O++)F[O]=S[O];F[31]=S[31]&127|64,F[0]&=248,c(I,j);for(let O=0;O<16;O++)V[O]=I[O];B[0]=Y[0]=1;for(let O=254;O>=0;--O){const P=F[O>>>3]>>>(O&7)&1;o(B,V,P),o(se,Y,P),u(N,B,se),f(B,B,se),u(se,V,Y),f(V,V,Y),g(Y,N),g(k,B),h(B,se,B),h(se,V,N),u(N,B,se),f(B,B,se),g(V,B),f(se,Y,k),h(B,se,a),u(B,B,Y),h(se,se,B),h(B,Y,k),h(Y,V,I),g(V,N),o(B,V,P),o(se,Y,P)}for(let O=0;O<16;O++)I[O+16]=B[O],I[O+32]=se[O],I[O+48]=V[O],I[O+64]=Y[O];const x=I.subarray(32),E=I.subarray(16);m(x,x),h(E,E,x);const L=new Uint8Array(32);return l(L,E),L}t.scalarMult=w;function C(S){return w(S,i)}t.scalarMultBase=C;function v(S){if(S.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const j=new Uint8Array(S);return{publicKey:C(j),secretKey:j}}t.generateKeyPairFromSeed=v;function b(S){const j=(0,e.randomBytes)(32,S),F=v(j);return(0,r.wipe)(j),F}t.generateKeyPair=b;function A(S,j,F=!1){if(S.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(j.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const I=w(S,j);if(F){let B=0;for(let V=0;Vi+a.length,0));const r=Qne(e);let n=0;for(const i of t)r.set(i,n),n+=i.length;return r}function oUe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(A);v!==b;){for(var j=m[v],F=0,I=A-1;(j!==0||F>>0,S[I]=j%o>>>0,j=j/o>>>0;if(j!==0)throw new Error("Non-zero carry");C=F,v++}for(var B=A-C;B!==A&&S[B]===0;)B++;for(var V=l.repeat(w);B>>0,A=new Uint8Array(b);m[w];){var S=r[m.charCodeAt(w)];if(S===255)return;for(var j=0,F=b-1;(S!==0||j>>0,A[F]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");v=j,w++}if(m[w]!==" "){for(var I=b-v;I!==b&&A[I]===0;)I++;for(var B=new Uint8Array(C+(b-I)),V=C;I!==b;)B[V++]=A[I++];return B}}}function g(m){var w=h(m);if(w)return w;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:g}}var lUe=oUe,cUe=lUe;const uUe=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")},dUe=t=>new TextEncoder().encode(t),fUe=t=>new TextDecoder().decode(t);class hUe{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 pUe{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 Zne(this,e)}}class gUe{constructor(e){this.decoders=e}or(e){return Zne(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 Zne=(t,e)=>new gUe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class mUe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new hUe(e,r,n),this.decoder=new pUe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Qx=({name:t,prefix:e,encode:r,decode:n})=>new mUe(t,e,r,n),fv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=cUe(r,e);return Qx({prefix:t,name:e,encode:n,decode:a=>uUe(i(a))})},yUe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,s[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return s},wUe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<Qx({prefix:e,name:t,encode(i){return wUe(i,n,r)},decode(i){return yUe(i,n,r,t)}}),vUe=Qx({prefix:"\0",name:"identity",encode:t=>fUe(t),decode:t=>dUe(t)}),bUe=Object.freeze(Object.defineProperty({__proto__:null,identity:vUe},Symbol.toStringTag,{value:"Module"})),xUe=xa({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),EUe=Object.freeze(Object.defineProperty({__proto__:null,base2:xUe},Symbol.toStringTag,{value:"Module"})),_Ue=xa({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),CUe=Object.freeze(Object.defineProperty({__proto__:null,base8:_Ue},Symbol.toStringTag,{value:"Module"})),SUe=fv({prefix:"9",name:"base10",alphabet:"0123456789"}),AUe=Object.freeze(Object.defineProperty({__proto__:null,base10:SUe},Symbol.toStringTag,{value:"Module"})),IUe=xa({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),MUe=xa({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),TUe=Object.freeze(Object.defineProperty({__proto__:null,base16:IUe,base16upper:MUe},Symbol.toStringTag,{value:"Module"})),kUe=xa({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),NUe=xa({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),LUe=xa({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),jUe=xa({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),$Ue=xa({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),PUe=xa({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),RUe=xa({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),DUe=xa({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),OUe=xa({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),FUe=Object.freeze(Object.defineProperty({__proto__:null,base32:kUe,base32hex:$Ue,base32hexpad:RUe,base32hexpadupper:DUe,base32hexupper:PUe,base32pad:LUe,base32padupper:jUe,base32upper:NUe,base32z:OUe},Symbol.toStringTag,{value:"Module"})),UUe=fv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),BUe=fv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),zUe=Object.freeze(Object.defineProperty({__proto__:null,base36:UUe,base36upper:BUe},Symbol.toStringTag,{value:"Module"})),WUe=fv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),HUe=fv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),GUe=Object.freeze(Object.defineProperty({__proto__:null,base58btc:WUe,base58flickr:HUe},Symbol.toStringTag,{value:"Module"})),qUe=xa({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),VUe=xa({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),YUe=xa({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),KUe=xa({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),JUe=Object.freeze(Object.defineProperty({__proto__:null,base64:qUe,base64pad:VUe,base64url:YUe,base64urlpad:KUe},Symbol.toStringTag,{value:"Module"})),Xne=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),QUe=Xne.reduce((t,e,r)=>(t[r]=e,t),[]),ZUe=Xne.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function XUe(t){return t.reduce((e,r)=>(e+=QUe[r],e),"")}function eBe(t){const e=[];for(const r of t){const n=ZUe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const tBe=Qx({prefix:"🚀",name:"base256emoji",encode:XUe,decode:eBe}),rBe=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:tBe},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const Yz={...bUe,...EUe,...CUe,...AUe,...TUe,...FUe,...zUe,...GUe,...JUe,...rBe};function eie(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const Kz=eie("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),_S=eie("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=Qne(t.length);for(let r=0;r",fBe="MIT",hBe={url:"https://github.com/indutny/elliptic/issues"},pBe="https://github.com/indutny/elliptic",gBe={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},mBe={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},yBe={name:nBe,version:iBe,description:aBe,main:sBe,files:oBe,scripts:lBe,repository:cBe,keywords:uBe,author:dBe,license:fBe,bugs:hBe,homepage:pBe,devDependencies:gBe,dependencies:mBe};var Oo={},Ej={exports:{}};Ej.exports;(function(t){(function(e,r){function n(Y,N){if(!Y)throw new Error(N||"Assertion failed")}function i(Y,N){Y.super_=N;var k=function(){};k.prototype=N.prototype,Y.prototype=new k,Y.prototype.constructor=Y}function a(Y,N,k){if(a.isBN(Y))return Y;this.negative=0,this.words=null,this.length=0,this.red=null,Y!==null&&((N==="le"||N==="be")&&(k=N,N=10),this._init(Y||0,N||10,k||"be"))}typeof e=="object"?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=wm.Buffer}catch{}a.isBN=function(N){return N instanceof a?!0:N!==null&&typeof N=="object"&&N.constructor.wordSize===a.wordSize&&Array.isArray(N.words)},a.max=function(N,k){return N.cmp(k)>0?N:k},a.min=function(N,k){return N.cmp(k)<0?N:k},a.prototype._init=function(N,k,x){if(typeof N=="number")return this._initNumber(N,k,x);if(typeof N=="object")return this._initArray(N,k,x);k==="hex"&&(k=16),n(k===(k|0)&&k>=2&&k<=36),N=N.toString().replace(/\s+/g,"");var E=0;N[0]==="-"&&(E++,this.negative=1),E=0;E-=3)O=N[E]|N[E-1]<<8|N[E-2]<<16,this.words[L]|=O<>>26-P&67108863,P+=24,P>=26&&(P-=26,L++);else if(x==="le")for(E=0,L=0;E>>26-P&67108863,P+=24,P>=26&&(P-=26,L++);return this.strip()};function o(Y,N){var k=Y.charCodeAt(N);return k>=65&&k<=70?k-55:k>=97&&k<=102?k-87:k-48&15}function l(Y,N,k){var x=o(Y,k);return k-1>=N&&(x|=o(Y,k-1)<<4),x}a.prototype._parseHex=function(N,k,x){this.length=Math.ceil((N.length-k)/6),this.words=new Array(this.length);for(var E=0;E=k;E-=2)P=l(N,k,E)<=18?(L-=18,O+=1,this.words[O]|=P>>>26):L+=8;else{var R=N.length-k;for(E=R%2===0?k+1:k;E=18?(L-=18,O+=1,this.words[O]|=P>>>26):L+=8}this.strip()};function c(Y,N,k,x){for(var E=0,L=Math.min(Y.length,k),O=N;O=49?E+=P-49+10:P>=17?E+=P-17+10:E+=P}return E}a.prototype._parseBase=function(N,k,x){this.words=[0],this.length=1;for(var E=0,L=1;L<=67108863;L*=k)E++;E--,L=L/k|0;for(var O=N.length-x,P=O%E,R=Math.min(O,O-P)+x,M=0,D=x;D1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},a.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];a.prototype.toString=function(N,k){N=N||10,k=k|0||1;var x;if(N===16||N==="hex"){x="";for(var E=0,L=0,O=0;O>>24-E&16777215,E+=2,E>=26&&(E-=26,O--),L!==0||O!==this.length-1?x=u[6-R.length]+R+x:x=R+x}for(L!==0&&(x=L.toString(16)+x);x.length%k!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(N===(N|0)&&N>=2&&N<=36){var M=f[N],D=h[N];x="";var $=this.clone();for($.negative=0;!$.isZero();){var X=$.modn(D).toString(N);$=$.idivn(D),$.isZero()?x=X+x:x=u[M-X.length]+X+x}for(this.isZero()&&(x="0"+x);x.length%k!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var N=this.words[0];return this.length===2?N+=this.words[1]*67108864:this.length===3&&this.words[2]===1?N+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-N:N},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(N,k){return n(typeof s<"u"),this.toArrayLike(s,N,k)},a.prototype.toArray=function(N,k){return this.toArrayLike(Array,N,k)},a.prototype.toArrayLike=function(N,k,x){var E=this.byteLength(),L=x||Math.max(1,E);n(E<=L,"byte array longer than desired length"),n(L>0,"Requested array length <= 0"),this.strip();var O=k==="le",P=new N(L),R,M,D=this.clone();if(O){for(M=0;!D.isZero();M++)R=D.andln(255),D.iushrn(8),P[M]=R;for(;M=4096&&(x+=13,k>>>=13),k>=64&&(x+=7,k>>>=7),k>=8&&(x+=4,k>>>=4),k>=2&&(x+=2,k>>>=2),x+k},a.prototype._zeroBits=function(N){if(N===0)return 26;var k=N,x=0;return k&8191||(x+=13,k>>>=13),k&127||(x+=7,k>>>=7),k&15||(x+=4,k>>>=4),k&3||(x+=2,k>>>=2),k&1||x++,x},a.prototype.bitLength=function(){var N=this.words[this.length-1],k=this._countBits(N);return(this.length-1)*26+k};function g(Y){for(var N=new Array(Y.bitLength()),k=0;k>>E}return N}a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var N=0,k=0;kN.length?this.clone().ior(N):N.clone().ior(this)},a.prototype.uor=function(N){return this.length>N.length?this.clone().iuor(N):N.clone().iuor(this)},a.prototype.iuand=function(N){var k;this.length>N.length?k=N:k=this;for(var x=0;xN.length?this.clone().iand(N):N.clone().iand(this)},a.prototype.uand=function(N){return this.length>N.length?this.clone().iuand(N):N.clone().iuand(this)},a.prototype.iuxor=function(N){var k,x;this.length>N.length?(k=this,x=N):(k=N,x=this);for(var E=0;EN.length?this.clone().ixor(N):N.clone().ixor(this)},a.prototype.uxor=function(N){return this.length>N.length?this.clone().iuxor(N):N.clone().iuxor(this)},a.prototype.inotn=function(N){n(typeof N=="number"&&N>=0);var k=Math.ceil(N/26)|0,x=N%26;this._expand(k),x>0&&k--;for(var E=0;E0&&(this.words[E]=~this.words[E]&67108863>>26-x),this.strip()},a.prototype.notn=function(N){return this.clone().inotn(N)},a.prototype.setn=function(N,k){n(typeof N=="number"&&N>=0);var x=N/26|0,E=N%26;return this._expand(x+1),k?this.words[x]=this.words[x]|1<N.length?(x=this,E=N):(x=N,E=this);for(var L=0,O=0;O>>26;for(;L!==0&&O>>26;if(this.length=x.length,L!==0)this.words[this.length]=L,this.length++;else if(x!==this)for(;ON.length?this.clone().iadd(N):N.clone().iadd(this)},a.prototype.isub=function(N){if(N.negative!==0){N.negative=0;var k=this.iadd(N);return N.negative=1,k._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(N),this.negative=1,this._normSign();var x=this.cmp(N);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,L;x>0?(E=this,L=N):(E=N,L=this);for(var O=0,P=0;P>26,this.words[P]=k&67108863;for(;O!==0&&P>26,this.words[P]=k&67108863;if(O===0&&P>>26,$=R&67108863,X=Math.min(M,N.length-1),le=Math.max(0,M-Y.length+1);le<=X;le++){var H=M-le|0;E=Y.words[H]|0,L=N.words[le]|0,O=E*L+$,D+=O/67108864|0,$=O&67108863}k.words[M]=$|0,R=D|0}return R!==0?k.words[M]=R|0:k.length--,k.strip()}var w=function(N,k,x){var E=N.words,L=k.words,O=x.words,P=0,R,M,D,$=E[0]|0,X=$&8191,le=$>>>13,H=E[1]|0,ee=H&8191,J=H>>>13,te=E[2]|0,re=te&8191,z=te>>>13,G=E[3]|0,Q=G&8191,me=G>>>13,be=E[4]|0,Ce=be&8191,Fe=be>>>13,Ue=E[5]|0,Ke=Ue&8191,lt=Ue>>>13,Ee=E[6]|0,He=Ee&8191,qe=Ee>>>13,Ie=E[7]|0,Ne=Ie&8191,$e=Ie>>>13,je=E[8]|0,K=je&8191,U=je>>>13,W=E[9]|0,ie=W&8191,pe=W>>>13,we=L[0]|0,he=we&8191,Re=we>>>13,Je=L[1]|0,et=Je&8191,it=Je>>>13,ut=L[2]|0,pt=ut&8191,tr=ut>>>13,zt=L[3]|0,At=zt&8191,mt=zt>>>13,St=L[4]|0,dt=St&8191,Nt=St>>>13,Rt=L[5]|0,gt=Rt&8191,qt=Rt>>>13,Wt=L[6]|0,ot=Wt&8191,Vt=Wt>>>13,Ft=L[7]|0,yt=Ft&8191,Ze=Ft>>>13,Pt=L[8]|0,xt=Pt&8191,Jt=Pt>>>13,Cr=L[9]|0,Gt=Cr&8191,Sr=Cr>>>13;x.negative=N.negative^k.negative,x.length=19,R=Math.imul(X,he),M=Math.imul(X,Re),M=M+Math.imul(le,he)|0,D=Math.imul(le,Re);var cr=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(cr>>>26)|0,cr&=67108863,R=Math.imul(ee,he),M=Math.imul(ee,Re),M=M+Math.imul(J,he)|0,D=Math.imul(J,Re),R=R+Math.imul(X,et)|0,M=M+Math.imul(X,it)|0,M=M+Math.imul(le,et)|0,D=D+Math.imul(le,it)|0;var br=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(br>>>26)|0,br&=67108863,R=Math.imul(re,he),M=Math.imul(re,Re),M=M+Math.imul(z,he)|0,D=Math.imul(z,Re),R=R+Math.imul(ee,et)|0,M=M+Math.imul(ee,it)|0,M=M+Math.imul(J,et)|0,D=D+Math.imul(J,it)|0,R=R+Math.imul(X,pt)|0,M=M+Math.imul(X,tr)|0,M=M+Math.imul(le,pt)|0,D=D+Math.imul(le,tr)|0;var Z=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Z>>>26)|0,Z&=67108863,R=Math.imul(Q,he),M=Math.imul(Q,Re),M=M+Math.imul(me,he)|0,D=Math.imul(me,Re),R=R+Math.imul(re,et)|0,M=M+Math.imul(re,it)|0,M=M+Math.imul(z,et)|0,D=D+Math.imul(z,it)|0,R=R+Math.imul(ee,pt)|0,M=M+Math.imul(ee,tr)|0,M=M+Math.imul(J,pt)|0,D=D+Math.imul(J,tr)|0,R=R+Math.imul(X,At)|0,M=M+Math.imul(X,mt)|0,M=M+Math.imul(le,At)|0,D=D+Math.imul(le,mt)|0;var ae=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ae>>>26)|0,ae&=67108863,R=Math.imul(Ce,he),M=Math.imul(Ce,Re),M=M+Math.imul(Fe,he)|0,D=Math.imul(Fe,Re),R=R+Math.imul(Q,et)|0,M=M+Math.imul(Q,it)|0,M=M+Math.imul(me,et)|0,D=D+Math.imul(me,it)|0,R=R+Math.imul(re,pt)|0,M=M+Math.imul(re,tr)|0,M=M+Math.imul(z,pt)|0,D=D+Math.imul(z,tr)|0,R=R+Math.imul(ee,At)|0,M=M+Math.imul(ee,mt)|0,M=M+Math.imul(J,At)|0,D=D+Math.imul(J,mt)|0,R=R+Math.imul(X,dt)|0,M=M+Math.imul(X,Nt)|0,M=M+Math.imul(le,dt)|0,D=D+Math.imul(le,Nt)|0;var de=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(de>>>26)|0,de&=67108863,R=Math.imul(Ke,he),M=Math.imul(Ke,Re),M=M+Math.imul(lt,he)|0,D=Math.imul(lt,Re),R=R+Math.imul(Ce,et)|0,M=M+Math.imul(Ce,it)|0,M=M+Math.imul(Fe,et)|0,D=D+Math.imul(Fe,it)|0,R=R+Math.imul(Q,pt)|0,M=M+Math.imul(Q,tr)|0,M=M+Math.imul(me,pt)|0,D=D+Math.imul(me,tr)|0,R=R+Math.imul(re,At)|0,M=M+Math.imul(re,mt)|0,M=M+Math.imul(z,At)|0,D=D+Math.imul(z,mt)|0,R=R+Math.imul(ee,dt)|0,M=M+Math.imul(ee,Nt)|0,M=M+Math.imul(J,dt)|0,D=D+Math.imul(J,Nt)|0,R=R+Math.imul(X,gt)|0,M=M+Math.imul(X,qt)|0,M=M+Math.imul(le,gt)|0,D=D+Math.imul(le,qt)|0;var ue=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ue>>>26)|0,ue&=67108863,R=Math.imul(He,he),M=Math.imul(He,Re),M=M+Math.imul(qe,he)|0,D=Math.imul(qe,Re),R=R+Math.imul(Ke,et)|0,M=M+Math.imul(Ke,it)|0,M=M+Math.imul(lt,et)|0,D=D+Math.imul(lt,it)|0,R=R+Math.imul(Ce,pt)|0,M=M+Math.imul(Ce,tr)|0,M=M+Math.imul(Fe,pt)|0,D=D+Math.imul(Fe,tr)|0,R=R+Math.imul(Q,At)|0,M=M+Math.imul(Q,mt)|0,M=M+Math.imul(me,At)|0,D=D+Math.imul(me,mt)|0,R=R+Math.imul(re,dt)|0,M=M+Math.imul(re,Nt)|0,M=M+Math.imul(z,dt)|0,D=D+Math.imul(z,Nt)|0,R=R+Math.imul(ee,gt)|0,M=M+Math.imul(ee,qt)|0,M=M+Math.imul(J,gt)|0,D=D+Math.imul(J,qt)|0,R=R+Math.imul(X,ot)|0,M=M+Math.imul(X,Vt)|0,M=M+Math.imul(le,ot)|0,D=D+Math.imul(le,Vt)|0;var ve=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ve>>>26)|0,ve&=67108863,R=Math.imul(Ne,he),M=Math.imul(Ne,Re),M=M+Math.imul($e,he)|0,D=Math.imul($e,Re),R=R+Math.imul(He,et)|0,M=M+Math.imul(He,it)|0,M=M+Math.imul(qe,et)|0,D=D+Math.imul(qe,it)|0,R=R+Math.imul(Ke,pt)|0,M=M+Math.imul(Ke,tr)|0,M=M+Math.imul(lt,pt)|0,D=D+Math.imul(lt,tr)|0,R=R+Math.imul(Ce,At)|0,M=M+Math.imul(Ce,mt)|0,M=M+Math.imul(Fe,At)|0,D=D+Math.imul(Fe,mt)|0,R=R+Math.imul(Q,dt)|0,M=M+Math.imul(Q,Nt)|0,M=M+Math.imul(me,dt)|0,D=D+Math.imul(me,Nt)|0,R=R+Math.imul(re,gt)|0,M=M+Math.imul(re,qt)|0,M=M+Math.imul(z,gt)|0,D=D+Math.imul(z,qt)|0,R=R+Math.imul(ee,ot)|0,M=M+Math.imul(ee,Vt)|0,M=M+Math.imul(J,ot)|0,D=D+Math.imul(J,Vt)|0,R=R+Math.imul(X,yt)|0,M=M+Math.imul(X,Ze)|0,M=M+Math.imul(le,yt)|0,D=D+Math.imul(le,Ze)|0;var Le=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Le>>>26)|0,Le&=67108863,R=Math.imul(K,he),M=Math.imul(K,Re),M=M+Math.imul(U,he)|0,D=Math.imul(U,Re),R=R+Math.imul(Ne,et)|0,M=M+Math.imul(Ne,it)|0,M=M+Math.imul($e,et)|0,D=D+Math.imul($e,it)|0,R=R+Math.imul(He,pt)|0,M=M+Math.imul(He,tr)|0,M=M+Math.imul(qe,pt)|0,D=D+Math.imul(qe,tr)|0,R=R+Math.imul(Ke,At)|0,M=M+Math.imul(Ke,mt)|0,M=M+Math.imul(lt,At)|0,D=D+Math.imul(lt,mt)|0,R=R+Math.imul(Ce,dt)|0,M=M+Math.imul(Ce,Nt)|0,M=M+Math.imul(Fe,dt)|0,D=D+Math.imul(Fe,Nt)|0,R=R+Math.imul(Q,gt)|0,M=M+Math.imul(Q,qt)|0,M=M+Math.imul(me,gt)|0,D=D+Math.imul(me,qt)|0,R=R+Math.imul(re,ot)|0,M=M+Math.imul(re,Vt)|0,M=M+Math.imul(z,ot)|0,D=D+Math.imul(z,Vt)|0,R=R+Math.imul(ee,yt)|0,M=M+Math.imul(ee,Ze)|0,M=M+Math.imul(J,yt)|0,D=D+Math.imul(J,Ze)|0,R=R+Math.imul(X,xt)|0,M=M+Math.imul(X,Jt)|0,M=M+Math.imul(le,xt)|0,D=D+Math.imul(le,Jt)|0;var Ge=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Ge>>>26)|0,Ge&=67108863,R=Math.imul(ie,he),M=Math.imul(ie,Re),M=M+Math.imul(pe,he)|0,D=Math.imul(pe,Re),R=R+Math.imul(K,et)|0,M=M+Math.imul(K,it)|0,M=M+Math.imul(U,et)|0,D=D+Math.imul(U,it)|0,R=R+Math.imul(Ne,pt)|0,M=M+Math.imul(Ne,tr)|0,M=M+Math.imul($e,pt)|0,D=D+Math.imul($e,tr)|0,R=R+Math.imul(He,At)|0,M=M+Math.imul(He,mt)|0,M=M+Math.imul(qe,At)|0,D=D+Math.imul(qe,mt)|0,R=R+Math.imul(Ke,dt)|0,M=M+Math.imul(Ke,Nt)|0,M=M+Math.imul(lt,dt)|0,D=D+Math.imul(lt,Nt)|0,R=R+Math.imul(Ce,gt)|0,M=M+Math.imul(Ce,qt)|0,M=M+Math.imul(Fe,gt)|0,D=D+Math.imul(Fe,qt)|0,R=R+Math.imul(Q,ot)|0,M=M+Math.imul(Q,Vt)|0,M=M+Math.imul(me,ot)|0,D=D+Math.imul(me,Vt)|0,R=R+Math.imul(re,yt)|0,M=M+Math.imul(re,Ze)|0,M=M+Math.imul(z,yt)|0,D=D+Math.imul(z,Ze)|0,R=R+Math.imul(ee,xt)|0,M=M+Math.imul(ee,Jt)|0,M=M+Math.imul(J,xt)|0,D=D+Math.imul(J,Jt)|0,R=R+Math.imul(X,Gt)|0,M=M+Math.imul(X,Sr)|0,M=M+Math.imul(le,Gt)|0,D=D+Math.imul(le,Sr)|0;var Be=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Be>>>26)|0,Be&=67108863,R=Math.imul(ie,et),M=Math.imul(ie,it),M=M+Math.imul(pe,et)|0,D=Math.imul(pe,it),R=R+Math.imul(K,pt)|0,M=M+Math.imul(K,tr)|0,M=M+Math.imul(U,pt)|0,D=D+Math.imul(U,tr)|0,R=R+Math.imul(Ne,At)|0,M=M+Math.imul(Ne,mt)|0,M=M+Math.imul($e,At)|0,D=D+Math.imul($e,mt)|0,R=R+Math.imul(He,dt)|0,M=M+Math.imul(He,Nt)|0,M=M+Math.imul(qe,dt)|0,D=D+Math.imul(qe,Nt)|0,R=R+Math.imul(Ke,gt)|0,M=M+Math.imul(Ke,qt)|0,M=M+Math.imul(lt,gt)|0,D=D+Math.imul(lt,qt)|0,R=R+Math.imul(Ce,ot)|0,M=M+Math.imul(Ce,Vt)|0,M=M+Math.imul(Fe,ot)|0,D=D+Math.imul(Fe,Vt)|0,R=R+Math.imul(Q,yt)|0,M=M+Math.imul(Q,Ze)|0,M=M+Math.imul(me,yt)|0,D=D+Math.imul(me,Ze)|0,R=R+Math.imul(re,xt)|0,M=M+Math.imul(re,Jt)|0,M=M+Math.imul(z,xt)|0,D=D+Math.imul(z,Jt)|0,R=R+Math.imul(ee,Gt)|0,M=M+Math.imul(ee,Sr)|0,M=M+Math.imul(J,Gt)|0,D=D+Math.imul(J,Sr)|0;var tt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(tt>>>26)|0,tt&=67108863,R=Math.imul(ie,pt),M=Math.imul(ie,tr),M=M+Math.imul(pe,pt)|0,D=Math.imul(pe,tr),R=R+Math.imul(K,At)|0,M=M+Math.imul(K,mt)|0,M=M+Math.imul(U,At)|0,D=D+Math.imul(U,mt)|0,R=R+Math.imul(Ne,dt)|0,M=M+Math.imul(Ne,Nt)|0,M=M+Math.imul($e,dt)|0,D=D+Math.imul($e,Nt)|0,R=R+Math.imul(He,gt)|0,M=M+Math.imul(He,qt)|0,M=M+Math.imul(qe,gt)|0,D=D+Math.imul(qe,qt)|0,R=R+Math.imul(Ke,ot)|0,M=M+Math.imul(Ke,Vt)|0,M=M+Math.imul(lt,ot)|0,D=D+Math.imul(lt,Vt)|0,R=R+Math.imul(Ce,yt)|0,M=M+Math.imul(Ce,Ze)|0,M=M+Math.imul(Fe,yt)|0,D=D+Math.imul(Fe,Ze)|0,R=R+Math.imul(Q,xt)|0,M=M+Math.imul(Q,Jt)|0,M=M+Math.imul(me,xt)|0,D=D+Math.imul(me,Jt)|0,R=R+Math.imul(re,Gt)|0,M=M+Math.imul(re,Sr)|0,M=M+Math.imul(z,Gt)|0,D=D+Math.imul(z,Sr)|0;var vt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(vt>>>26)|0,vt&=67108863,R=Math.imul(ie,At),M=Math.imul(ie,mt),M=M+Math.imul(pe,At)|0,D=Math.imul(pe,mt),R=R+Math.imul(K,dt)|0,M=M+Math.imul(K,Nt)|0,M=M+Math.imul(U,dt)|0,D=D+Math.imul(U,Nt)|0,R=R+Math.imul(Ne,gt)|0,M=M+Math.imul(Ne,qt)|0,M=M+Math.imul($e,gt)|0,D=D+Math.imul($e,qt)|0,R=R+Math.imul(He,ot)|0,M=M+Math.imul(He,Vt)|0,M=M+Math.imul(qe,ot)|0,D=D+Math.imul(qe,Vt)|0,R=R+Math.imul(Ke,yt)|0,M=M+Math.imul(Ke,Ze)|0,M=M+Math.imul(lt,yt)|0,D=D+Math.imul(lt,Ze)|0,R=R+Math.imul(Ce,xt)|0,M=M+Math.imul(Ce,Jt)|0,M=M+Math.imul(Fe,xt)|0,D=D+Math.imul(Fe,Jt)|0,R=R+Math.imul(Q,Gt)|0,M=M+Math.imul(Q,Sr)|0,M=M+Math.imul(me,Gt)|0,D=D+Math.imul(me,Sr)|0;var Lt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,R=Math.imul(ie,dt),M=Math.imul(ie,Nt),M=M+Math.imul(pe,dt)|0,D=Math.imul(pe,Nt),R=R+Math.imul(K,gt)|0,M=M+Math.imul(K,qt)|0,M=M+Math.imul(U,gt)|0,D=D+Math.imul(U,qt)|0,R=R+Math.imul(Ne,ot)|0,M=M+Math.imul(Ne,Vt)|0,M=M+Math.imul($e,ot)|0,D=D+Math.imul($e,Vt)|0,R=R+Math.imul(He,yt)|0,M=M+Math.imul(He,Ze)|0,M=M+Math.imul(qe,yt)|0,D=D+Math.imul(qe,Ze)|0,R=R+Math.imul(Ke,xt)|0,M=M+Math.imul(Ke,Jt)|0,M=M+Math.imul(lt,xt)|0,D=D+Math.imul(lt,Jt)|0,R=R+Math.imul(Ce,Gt)|0,M=M+Math.imul(Ce,Sr)|0,M=M+Math.imul(Fe,Gt)|0,D=D+Math.imul(Fe,Sr)|0;var Ct=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,R=Math.imul(ie,gt),M=Math.imul(ie,qt),M=M+Math.imul(pe,gt)|0,D=Math.imul(pe,qt),R=R+Math.imul(K,ot)|0,M=M+Math.imul(K,Vt)|0,M=M+Math.imul(U,ot)|0,D=D+Math.imul(U,Vt)|0,R=R+Math.imul(Ne,yt)|0,M=M+Math.imul(Ne,Ze)|0,M=M+Math.imul($e,yt)|0,D=D+Math.imul($e,Ze)|0,R=R+Math.imul(He,xt)|0,M=M+Math.imul(He,Jt)|0,M=M+Math.imul(qe,xt)|0,D=D+Math.imul(qe,Jt)|0,R=R+Math.imul(Ke,Gt)|0,M=M+Math.imul(Ke,Sr)|0,M=M+Math.imul(lt,Gt)|0,D=D+Math.imul(lt,Sr)|0;var ir=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(ir>>>26)|0,ir&=67108863,R=Math.imul(ie,ot),M=Math.imul(ie,Vt),M=M+Math.imul(pe,ot)|0,D=Math.imul(pe,Vt),R=R+Math.imul(K,yt)|0,M=M+Math.imul(K,Ze)|0,M=M+Math.imul(U,yt)|0,D=D+Math.imul(U,Ze)|0,R=R+Math.imul(Ne,xt)|0,M=M+Math.imul(Ne,Jt)|0,M=M+Math.imul($e,xt)|0,D=D+Math.imul($e,Jt)|0,R=R+Math.imul(He,Gt)|0,M=M+Math.imul(He,Sr)|0,M=M+Math.imul(qe,Gt)|0,D=D+Math.imul(qe,Sr)|0;var Zt=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,R=Math.imul(ie,yt),M=Math.imul(ie,Ze),M=M+Math.imul(pe,yt)|0,D=Math.imul(pe,Ze),R=R+Math.imul(K,xt)|0,M=M+Math.imul(K,Jt)|0,M=M+Math.imul(U,xt)|0,D=D+Math.imul(U,Jt)|0,R=R+Math.imul(Ne,Gt)|0,M=M+Math.imul(Ne,Sr)|0,M=M+Math.imul($e,Gt)|0,D=D+Math.imul($e,Sr)|0;var sn=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(sn>>>26)|0,sn&=67108863,R=Math.imul(ie,xt),M=Math.imul(ie,Jt),M=M+Math.imul(pe,xt)|0,D=Math.imul(pe,Jt),R=R+Math.imul(K,Gt)|0,M=M+Math.imul(K,Sr)|0,M=M+Math.imul(U,Gt)|0,D=D+Math.imul(U,Sr)|0;var Rr=(P+R|0)+((M&8191)<<13)|0;P=(D+(M>>>13)|0)+(Rr>>>26)|0,Rr&=67108863,R=Math.imul(ie,Gt),M=Math.imul(ie,Sr),M=M+Math.imul(pe,Gt)|0,D=Math.imul(pe,Sr);var dn=(P+R|0)+((M&8191)<<13)|0;return P=(D+(M>>>13)|0)+(dn>>>26)|0,dn&=67108863,O[0]=cr,O[1]=br,O[2]=Z,O[3]=ae,O[4]=de,O[5]=ue,O[6]=ve,O[7]=Le,O[8]=Ge,O[9]=Be,O[10]=tt,O[11]=vt,O[12]=Lt,O[13]=Ct,O[14]=ir,O[15]=Zt,O[16]=sn,O[17]=Rr,O[18]=dn,P!==0&&(O[19]=P,x.length++),x};Math.imul||(w=m);function C(Y,N,k){k.negative=N.negative^Y.negative,k.length=Y.length+N.length;for(var x=0,E=0,L=0;L>>26)|0,E+=O>>>26,O&=67108863}k.words[L]=P,x=O,O=E}return x!==0?k.words[L]=x:k.length--,k.strip()}function v(Y,N,k){var x=new b;return x.mulp(Y,N,k)}a.prototype.mulTo=function(N,k){var x,E=this.length+N.length;return this.length===10&&N.length===10?x=w(this,N,k):E<63?x=m(this,N,k):E<1024?x=C(this,N,k):x=v(this,N,k),x};function b(Y,N){this.x=Y,this.y=N}b.prototype.makeRBT=function(N){for(var k=new Array(N),x=a.prototype._countBits(N)-1,E=0;E>=1;return E},b.prototype.permute=function(N,k,x,E,L,O){for(var P=0;P>>1)L++;return 1<>>13,x[2*O+1]=L&8191,L=L>>>13;for(O=2*k;O>=26,k+=E/67108864|0,k+=L>>>26,this.words[x]=L&67108863}return k!==0&&(this.words[x]=k,this.length++),this},a.prototype.muln=function(N){return this.clone().imuln(N)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(N){var k=g(N);if(k.length===0)return new a(1);for(var x=this,E=0;E=0);var k=N%26,x=(N-k)/26,E=67108863>>>26-k<<26-k,L;if(k!==0){var O=0;for(L=0;L>>26-k}O&&(this.words[L]=O,this.length++)}if(x!==0){for(L=this.length-1;L>=0;L--)this.words[L+x]=this.words[L];for(L=0;L=0);var E;k?E=(k-k%26)/26:E=0;var L=N%26,O=Math.min((N-L)/26,this.length),P=67108863^67108863>>>L<O)for(this.length-=O,M=0;M=0&&(D!==0||M>=E);M--){var $=this.words[M]|0;this.words[M]=D<<26-L|$>>>L,D=$&P}return R&&D!==0&&(R.words[R.length++]=D),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(N,k,x){return n(this.negative===0),this.iushrn(N,k,x)},a.prototype.shln=function(N){return this.clone().ishln(N)},a.prototype.ushln=function(N){return this.clone().iushln(N)},a.prototype.shrn=function(N){return this.clone().ishrn(N)},a.prototype.ushrn=function(N){return this.clone().iushrn(N)},a.prototype.testn=function(N){n(typeof N=="number"&&N>=0);var k=N%26,x=(N-k)/26,E=1<=0);var k=N%26,x=(N-k)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(k!==0&&x++,this.length=Math.min(x,this.length),k!==0){var E=67108863^67108863>>>k<=67108864;k++)this.words[k]-=67108864,k===this.length-1?this.words[k+1]=1:this.words[k+1]++;return this.length=Math.max(this.length,k+1),this},a.prototype.isubn=function(N){if(n(typeof N=="number"),n(N<67108864),N<0)return this.iaddn(-N);if(this.negative!==0)return this.negative=0,this.iaddn(N),this.negative=1,this;if(this.words[0]-=N,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var k=0;k>26)-(R/67108864|0),this.words[L+x]=O&67108863}for(;L>26,this.words[L+x]=O&67108863;if(P===0)return this.strip();for(n(P===-1),P=0,L=0;L>26,this.words[L]=O&67108863;return this.negative=1,this.strip()},a.prototype._wordDiv=function(N,k){var x=this.length-N.length,E=this.clone(),L=N,O=L.words[L.length-1]|0,P=this._countBits(O);x=26-P,x!==0&&(L=L.ushln(x),E.iushln(x),O=L.words[L.length-1]|0);var R=E.length-L.length,M;if(k!=="mod"){M=new a(null),M.length=R+1,M.words=new Array(M.length);for(var D=0;D=0;X--){var le=(E.words[L.length+X]|0)*67108864+(E.words[L.length+X-1]|0);for(le=Math.min(le/O|0,67108863),E._ishlnsubmul(L,le,X);E.negative!==0;)le--,E.negative=0,E._ishlnsubmul(L,1,X),E.isZero()||(E.negative^=1);M&&(M.words[X]=le)}return M&&M.strip(),E.strip(),k!=="div"&&x!==0&&E.iushrn(x),{div:M||null,mod:E}},a.prototype.divmod=function(N,k,x){if(n(!N.isZero()),this.isZero())return{div:new a(0),mod:new a(0)};var E,L,O;return this.negative!==0&&N.negative===0?(O=this.neg().divmod(N,k),k!=="mod"&&(E=O.div.neg()),k!=="div"&&(L=O.mod.neg(),x&&L.negative!==0&&L.iadd(N)),{div:E,mod:L}):this.negative===0&&N.negative!==0?(O=this.divmod(N.neg(),k),k!=="mod"&&(E=O.div.neg()),{div:E,mod:O.mod}):this.negative&N.negative?(O=this.neg().divmod(N.neg(),k),k!=="div"&&(L=O.mod.neg(),x&&L.negative!==0&&L.isub(N)),{div:O.div,mod:L}):N.length>this.length||this.cmp(N)<0?{div:new a(0),mod:this}:N.length===1?k==="div"?{div:this.divn(N.words[0]),mod:null}:k==="mod"?{div:null,mod:new a(this.modn(N.words[0]))}:{div:this.divn(N.words[0]),mod:new a(this.modn(N.words[0]))}:this._wordDiv(N,k)},a.prototype.div=function(N){return this.divmod(N,"div",!1).div},a.prototype.mod=function(N){return this.divmod(N,"mod",!1).mod},a.prototype.umod=function(N){return this.divmod(N,"mod",!0).mod},a.prototype.divRound=function(N){var k=this.divmod(N);if(k.mod.isZero())return k.div;var x=k.div.negative!==0?k.mod.isub(N):k.mod,E=N.ushrn(1),L=N.andln(1),O=x.cmp(E);return O<0||L===1&&O===0?k.div:k.div.negative!==0?k.div.isubn(1):k.div.iaddn(1)},a.prototype.modn=function(N){n(N<=67108863);for(var k=(1<<26)%N,x=0,E=this.length-1;E>=0;E--)x=(k*x+(this.words[E]|0))%N;return x},a.prototype.idivn=function(N){n(N<=67108863);for(var k=0,x=this.length-1;x>=0;x--){var E=(this.words[x]|0)+k*67108864;this.words[x]=E/N|0,k=E%N}return this.strip()},a.prototype.divn=function(N){return this.clone().idivn(N)},a.prototype.egcd=function(N){n(N.negative===0),n(!N.isZero());var k=this,x=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var E=new a(1),L=new a(0),O=new a(0),P=new a(1),R=0;k.isEven()&&x.isEven();)k.iushrn(1),x.iushrn(1),++R;for(var M=x.clone(),D=k.clone();!k.isZero();){for(var $=0,X=1;!(k.words[0]&X)&&$<26;++$,X<<=1);if($>0)for(k.iushrn($);$-- >0;)(E.isOdd()||L.isOdd())&&(E.iadd(M),L.isub(D)),E.iushrn(1),L.iushrn(1);for(var le=0,H=1;!(x.words[0]&H)&&le<26;++le,H<<=1);if(le>0)for(x.iushrn(le);le-- >0;)(O.isOdd()||P.isOdd())&&(O.iadd(M),P.isub(D)),O.iushrn(1),P.iushrn(1);k.cmp(x)>=0?(k.isub(x),E.isub(O),L.isub(P)):(x.isub(k),O.isub(E),P.isub(L))}return{a:O,b:P,gcd:x.iushln(R)}},a.prototype._invmp=function(N){n(N.negative===0),n(!N.isZero());var k=this,x=N.clone();k.negative!==0?k=k.umod(N):k=k.clone();for(var E=new a(1),L=new a(0),O=x.clone();k.cmpn(1)>0&&x.cmpn(1)>0;){for(var P=0,R=1;!(k.words[0]&R)&&P<26;++P,R<<=1);if(P>0)for(k.iushrn(P);P-- >0;)E.isOdd()&&E.iadd(O),E.iushrn(1);for(var M=0,D=1;!(x.words[0]&D)&&M<26;++M,D<<=1);if(M>0)for(x.iushrn(M);M-- >0;)L.isOdd()&&L.iadd(O),L.iushrn(1);k.cmp(x)>=0?(k.isub(x),E.isub(L)):(x.isub(k),L.isub(E))}var $;return k.cmpn(1)===0?$=E:$=L,$.cmpn(0)<0&&$.iadd(N),$},a.prototype.gcd=function(N){if(this.isZero())return N.abs();if(N.isZero())return this.abs();var k=this.clone(),x=N.clone();k.negative=0,x.negative=0;for(var E=0;k.isEven()&&x.isEven();E++)k.iushrn(1),x.iushrn(1);do{for(;k.isEven();)k.iushrn(1);for(;x.isEven();)x.iushrn(1);var L=k.cmp(x);if(L<0){var O=k;k=x,x=O}else if(L===0||x.cmpn(1)===0)break;k.isub(x)}while(!0);return x.iushln(E)},a.prototype.invm=function(N){return this.egcd(N).a.umod(N)},a.prototype.isEven=function(){return(this.words[0]&1)===0},a.prototype.isOdd=function(){return(this.words[0]&1)===1},a.prototype.andln=function(N){return this.words[0]&N},a.prototype.bincn=function(N){n(typeof N=="number");var k=N%26,x=(N-k)/26,E=1<>>26,P&=67108863,this.words[O]=P}return L!==0&&(this.words[O]=L,this.length++),this},a.prototype.isZero=function(){return this.length===1&&this.words[0]===0},a.prototype.cmpn=function(N){var k=N<0;if(this.negative!==0&&!k)return-1;if(this.negative===0&&k)return 1;this.strip();var x;if(this.length>1)x=1;else{k&&(N=-N),n(N<=67108863,"Number is too big");var E=this.words[0]|0;x=E===N?0:EN.length)return 1;if(this.length=0;x--){var E=this.words[x]|0,L=N.words[x]|0;if(E!==L){EL&&(k=1);break}}return k},a.prototype.gtn=function(N){return this.cmpn(N)===1},a.prototype.gt=function(N){return this.cmp(N)===1},a.prototype.gten=function(N){return this.cmpn(N)>=0},a.prototype.gte=function(N){return this.cmp(N)>=0},a.prototype.ltn=function(N){return this.cmpn(N)===-1},a.prototype.lt=function(N){return this.cmp(N)===-1},a.prototype.lten=function(N){return this.cmpn(N)<=0},a.prototype.lte=function(N){return this.cmp(N)<=0},a.prototype.eqn=function(N){return this.cmpn(N)===0},a.prototype.eq=function(N){return this.cmp(N)===0},a.red=function(N){return new V(N)},a.prototype.toRed=function(N){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),N.convertTo(this)._forceRed(N)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(N){return this.red=N,this},a.prototype.forceRed=function(N){return n(!this.red,"Already a number in reduction context"),this._forceRed(N)},a.prototype.redAdd=function(N){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,N)},a.prototype.redIAdd=function(N){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,N)},a.prototype.redSub=function(N){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,N)},a.prototype.redISub=function(N){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,N)},a.prototype.redShl=function(N){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,N)},a.prototype.redMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.mul(this,N)},a.prototype.redIMul=function(N){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,N),this.red.imul(this,N)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(N){return n(this.red&&!N.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,N)};var A={k256:null,p224:null,p192:null,p25519:null};function S(Y,N){this.name=Y,this.p=new a(N,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}S.prototype._tmp=function(){var N=new a(null);return N.words=new Array(Math.ceil(this.n/13)),N},S.prototype.ireduce=function(N){var k=N,x;do this.split(k,this.tmp),k=this.imulK(k),k=k.iadd(this.tmp),x=k.bitLength();while(x>this.n);var E=x0?k.isub(this.p):k.strip!==void 0?k.strip():k._strip(),k},S.prototype.split=function(N,k){N.iushrn(this.n,0,k)},S.prototype.imulK=function(N){return N.imul(this.k)};function j(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(j,S),j.prototype.split=function(N,k){for(var x=4194303,E=Math.min(N.length,9),L=0;L>>22,O=P}O>>>=22,N.words[L-10]=O,O===0&&N.length>10?N.length-=10:N.length-=9},j.prototype.imulK=function(N){N.words[N.length]=0,N.words[N.length+1]=0,N.length+=2;for(var k=0,x=0;x>>=26,N.words[x]=L,k=E}return k!==0&&(N.words[N.length++]=k),N},a._prime=function(N){if(A[N])return A[N];var k;if(N==="k256")k=new j;else if(N==="p224")k=new F;else if(N==="p192")k=new I;else if(N==="p25519")k=new B;else throw new Error("Unknown prime "+N);return A[N]=k,k};function V(Y){if(typeof Y=="string"){var N=a._prime(Y);this.m=N.p,this.prime=N}else n(Y.gtn(1),"modulus must be greater than 1"),this.m=Y,this.prime=null}V.prototype._verify1=function(N){n(N.negative===0,"red works only with positives"),n(N.red,"red works only with red numbers")},V.prototype._verify2=function(N,k){n((N.negative|k.negative)===0,"red works only with positives"),n(N.red&&N.red===k.red,"red works only with red numbers")},V.prototype.imod=function(N){return this.prime?this.prime.ireduce(N)._forceRed(this):N.umod(this.m)._forceRed(this)},V.prototype.neg=function(N){return N.isZero()?N.clone():this.m.sub(N)._forceRed(this)},V.prototype.add=function(N,k){this._verify2(N,k);var x=N.add(k);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},V.prototype.iadd=function(N,k){this._verify2(N,k);var x=N.iadd(k);return x.cmp(this.m)>=0&&x.isub(this.m),x},V.prototype.sub=function(N,k){this._verify2(N,k);var x=N.sub(k);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},V.prototype.isub=function(N,k){this._verify2(N,k);var x=N.isub(k);return x.cmpn(0)<0&&x.iadd(this.m),x},V.prototype.shl=function(N,k){return this._verify1(N),this.imod(N.ushln(k))},V.prototype.imul=function(N,k){return this._verify2(N,k),this.imod(N.imul(k))},V.prototype.mul=function(N,k){return this._verify2(N,k),this.imod(N.mul(k))},V.prototype.isqr=function(N){return this.imul(N,N.clone())},V.prototype.sqr=function(N){return this.mul(N,N)},V.prototype.sqrt=function(N){if(N.isZero())return N.clone();var k=this.m.andln(3);if(n(k%2===1),k===3){var x=this.m.add(new a(1)).iushrn(2);return this.pow(N,x)}for(var E=this.m.subn(1),L=0;!E.isZero()&&E.andln(1)===0;)L++,E.iushrn(1);n(!E.isZero());var O=new a(1).toRed(this),P=O.redNeg(),R=this.m.subn(1).iushrn(1),M=this.m.bitLength();for(M=new a(2*M*M).toRed(this);this.pow(M,R).cmp(P)!==0;)M.redIAdd(P);for(var D=this.pow(M,E),$=this.pow(N,E.addn(1).iushrn(1)),X=this.pow(N,E),le=L;X.cmp(O)!==0;){for(var H=X,ee=0;H.cmp(O)!==0;ee++)H=H.redSqr();n(ee=0;L--){for(var D=k.words[L],$=M-1;$>=0;$--){var X=D>>$&1;if(O!==E[0]&&(O=this.sqr(O)),X===0&&P===0){R=0;continue}P<<=1,P|=X,R++,!(R!==x&&(L!==0||$!==0))&&(O=this.mul(O,E[P]),R=0,P=0)}M=26}return O},V.prototype.convertTo=function(N){var k=N.umod(this.m);return k===N?k.clone():k},V.prototype.convertFrom=function(N){var k=N.clone();return k.red=null,k},a.mont=function(N){return new se(N)};function se(Y){V.call(this,Y),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(se,V),se.prototype.convertTo=function(N){return this.imod(N.ushln(this.shift))},se.prototype.convertFrom=function(N){var k=this.imod(N.mul(this.rinv));return k.red=null,k},se.prototype.imul=function(N,k){if(N.isZero()||k.isZero())return N.words[0]=0,N.length=1,N;var x=N.imul(k),E=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=x.isub(E).iushrn(this.shift),O=L;return L.cmp(this.m)>=0?O=L.isub(this.m):L.cmpn(0)<0&&(O=L.iadd(this.m)),O._forceRed(this)},se.prototype.mul=function(N,k){if(N.isZero()||k.isZero())return new a(0)._forceRed(this);var x=N.mul(k),E=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),L=x.isub(E).iushrn(this.shift),O=L;return L.cmp(this.m)>=0?O=L.isub(this.m):L.cmpn(0)<0&&(O=L.iadd(this.m)),O._forceRed(this)},se.prototype.invm=function(N){var k=this.imod(N._invmp(this.m).mul(this.r2));return k._forceRed(this)}})(t,Xt)})(Ej);var af=Ej.exports,_j={};(function(t){var e=t;function r(a,s){if(Array.isArray(a))return a.slice();if(!a)return[];var o=[];if(typeof a!="string"){for(var l=0;l>8,f=c&255;u?o.push(u,f):o.push(f)}return o}e.toArray=r;function n(a){return a.length===1?"0"+a:a}e.zero2=n;function i(a){for(var s="",o=0;o(w>>1)-1?v=(w>>1)-b:v=b,C.isubn(v)):v=0,g[m]=v,C.iushrn(1)}return g}e.getNAF=a;function s(u,f){var h=[[],[]];u=u.clone(),f=f.clone();for(var g=0,m=0,w;u.cmpn(-g)>0||f.cmpn(-m)>0;){var C=u.andln(3)+g&3,v=f.andln(3)+m&3;C===3&&(C=-1),v===3&&(v=-1);var b;C&1?(w=u.andln(7)+g&7,(w===3||w===5)&&v===2?b=-C:b=C):b=0,h[0].push(b);var A;v&1?(w=f.andln(7)+m&7,(w===3||w===5)&&C===2?A=-v:A=v):A=0,h[1].push(A),2*g===b+1&&(g=1-g),2*m===A+1&&(m=1-m),u.iushrn(1),f.iushrn(1)}return h}e.getJSF=s;function o(u,f,h){var g="_"+f;u.prototype[f]=function(){return this[g]!==void 0?this[g]:this[g]=h.call(this)}}e.cachedProperty=o;function l(u){return typeof u=="string"?e.toArray(u,"hex"):u}e.parseBytes=l;function c(u){return new r(u,"hex","le")}e.intFromLE=c})(Oo);var Cj={exports:{}},CS;Cj.exports=function(e){return CS||(CS=new Uf(null)),CS.generate(e)};function Uf(t){this.rand=t}Cj.exports.Rand=Uf;Uf.prototype.generate=function(e){return this._rand(e)};Uf.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),n=0;n0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Zx=Lh;Lh.prototype.point=function(){throw new Error("Not implemented")};Lh.prototype.validate=function(){throw new Error("Not implemented")};Lh.prototype._fixedNafMul=function(e,r){h8(e.precomputed);var n=e._getDoubles(),i=f8(r,1,this._bitLength),a=(1<=o;c--)l=(l<<1)+i[c];s.push(l)}for(var u=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=a;h>0;h--){for(o=0;o=0;l--){for(var c=0;l>=0&&s[l]===0;l--)c++;if(l>=0&&c++,o=o.dblp(c),l<0)break;var u=s[l];h8(u!==0),e.type==="affine"?u>0?o=o.mixedAdd(a[u-1>>1]):o=o.mixedAdd(a[-u-1>>1].neg()):u>0?o=o.add(a[u-1>>1]):o=o.add(a[-u-1>>1].neg())}return e.type==="affine"?o.toP():o};Lh.prototype._wnafMulAdd=function(e,r,n,i,a){var s=this._wnafT1,o=this._wnafT2,l=this._wnafT3,c=0,u,f,h;for(u=0;u=1;u-=2){var m=u-1,w=u;if(s[m]!==1||s[w]!==1){l[m]=f8(n[m],s[m],this._bitLength),l[w]=f8(n[w],s[w],this._bitLength),c=Math.max(l[m].length,c),c=Math.max(l[w].length,c);continue}var C=[r[m],null,null,r[w]];r[m].y.cmp(r[w].y)===0?(C[1]=r[m].add(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg())):r[m].y.cmp(r[w].y.redNeg())===0?(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].add(r[w].neg())):(C[1]=r[m].toJ().mixedAdd(r[w]),C[2]=r[m].toJ().mixedAdd(r[w].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=wBe(n[m],n[w]);for(c=Math.max(b[0].length,c),l[m]=new Array(c),l[w]=new Array(c),f=0;f=0;u--){for(var I=0;u>=0;){var B=!0;for(f=0;f=0&&I++,j=j.dblp(I),u<0)break;for(f=0;f0?h=o[f][V-1>>1]:V<0&&(h=o[f][-V-1>>1].neg()),h.type==="affine"?j=j.mixedAdd(h):j=j.add(h))}}for(u=0;u=Math.ceil((e.bitLength()+1)/r.step):!1};Il.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,a=0;a=0&&(g=c,m=u),f.negative&&(f=f.neg(),h=h.neg()),g.negative&&(g=g.neg(),m=m.neg()),[{a:f,b:h},{a:g,b:m}]};Ml.prototype._endoSplit=function(e){var r=this.endo.basis,n=r[0],i=r[1],a=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),o=a.mul(n.a),l=s.mul(i.a),c=a.mul(n.b),u=s.mul(i.b),f=e.sub(o).sub(l),h=c.add(u).neg();return{k1:f,k2:h}};Ml.prototype.pointFromX=function(e,r){e=new si(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(i.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var a=i.fromRed().isOdd();return(r&&!a||!r&&a)&&(i=i.redNeg()),this.point(e,i)};Ml.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,n=e.y,i=this.a.redMul(r),a=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return n.redSqr().redISub(a).cmpn(0)===0};Ml.prototype._endoWnafMulAdd=function(e,r,n){for(var i=this._endoWnafT1,a=this._endoWnafT2,s=0;s":""};da.prototype.isInfinity=function(){return this.inf};da.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)};da.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),a=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),s=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)};da.prototype.getX=function(){return this.x.fromRed()};da.prototype.getY=function(){return this.y.fromRed()};da.prototype.mul=function(e){return e=new si(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};da.prototype.mulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a):this.curve._wnafMulAdd(1,i,a,2)};da.prototype.jmulAdd=function(e,r,n){var i=[this,r],a=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,a,!0):this.curve._wnafMulAdd(1,i,a,2,!0)};da.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};da.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(a){return a.neg()};r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return r};da.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Ea(t,e,r,n){Bm.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new si(0)):(this.x=new si(e,16),this.y=new si(r,16),this.z=new si(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Aj(Ea,Bm.BasePoint);Ml.prototype.jpoint=function(e,r,n){return new Ea(this,e,r,n)};Ea.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),n=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(n,i)};Ea.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};Ea.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(r),a=e.x.redMul(n),s=this.y.redMul(r.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),l=i.redSub(a),c=s.redSub(o);if(l.cmpn(0)===0)return c.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var u=l.redSqr(),f=u.redMul(l),h=i.redMul(u),g=c.redSqr().redIAdd(f).redISub(h).redISub(h),m=c.redMul(h.redISub(g)).redISub(s.redMul(f)),w=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(g,m,w)};Ea.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),n=this.x,i=e.x.redMul(r),a=this.y,s=e.y.redMul(r).redMul(this.z),o=n.redSub(i),l=a.redSub(s);if(o.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),f=n.redMul(c),h=l.redSqr().redIAdd(u).redISub(f).redISub(f),g=l.redMul(f.redISub(h)).redISub(a.redMul(u)),m=this.z.redMul(o);return this.curve.jpoint(h,g,m)};Ea.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r=0)return!1;if(n.redIAdd(a),this.x.cmp(n)===0)return!0}};Ea.prototype.inspect=function(){return this.isInfinity()?"":""};Ea.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var ig=af,iie=gs,Xx=Zx,EBe=Oo;function zm(t){Xx.call(this,"mont",t),this.a=new ig(t.a,16).toRed(this.red),this.b=new ig(t.b,16).toRed(this.red),this.i4=new ig(4).toRed(this.red).redInvm(),this.two=new ig(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}iie(zm,Xx);var _Be=zm;zm.prototype.validate=function(e){var r=e.normalize().x,n=r.redSqr(),i=n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),a=i.redSqrt();return a.redSqr().cmp(i)===0};function ca(t,e,r){Xx.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new ig(e,16),this.z=new ig(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}iie(ca,Xx.BasePoint);zm.prototype.decodePoint=function(e,r){return this.point(EBe.toArray(e,r),1)};zm.prototype.point=function(e,r){return new ca(this,e,r)};zm.prototype.pointFromJSON=function(e){return ca.fromJSON(this,e)};ca.prototype.precompute=function(){};ca.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())};ca.fromJSON=function(e,r){return new ca(e,r[0],r[1]||e.one)};ca.prototype.inspect=function(){return this.isInfinity()?"":""};ca.prototype.isInfinity=function(){return this.z.cmpn(0)===0};ca.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),n=this.x.redSub(this.z),i=n.redSqr(),a=r.redSub(i),s=r.redMul(i),o=a.redMul(i.redAdd(this.curve.a24.redMul(a)));return this.curve.point(s,o)};ca.prototype.add=function(){throw new Error("Not supported on Montgomery curve")};ca.prototype.diffAdd=function(e,r){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),a=e.x.redAdd(e.z),s=e.x.redSub(e.z),o=s.redMul(n),l=a.redMul(i),c=r.z.redMul(o.redAdd(l).redSqr()),u=r.x.redMul(o.redISub(l).redSqr());return this.curve.point(c,u)};ca.prototype.mul=function(e){for(var r=e.clone(),n=this,i=this.curve.point(null,null),a=this,s=[];r.cmpn(0)!==0;r.iushrn(1))s.push(r.andln(1));for(var o=s.length-1;o>=0;o--)s[o]===0?(n=n.diffAdd(i,a),i=i.dbl()):(i=n.diffAdd(i,a),n=n.dbl());return i};ca.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")};ca.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")};ca.prototype.eq=function(e){return this.getX().cmp(e.getX())===0};ca.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};ca.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var CBe=Oo,Md=af,aie=gs,e7=Zx,SBe=CBe.assert;function Du(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,e7.call(this,"edwards",t),this.a=new Md(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new Md(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new Md(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),SBe(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}aie(Du,e7);var ABe=Du;Du.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)};Du.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)};Du.prototype.jpoint=function(e,r,n,i){return this.point(e,r,n,i)};Du.prototype.pointFromX=function(e,r){e=new Md(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=this.c2.redSub(this.a.redMul(n)),a=this.one.redSub(this.c2.redMul(this.d).redMul(n)),s=i.redMul(a.redInvm()),o=s.redSqrt();if(o.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");var l=o.fromRed().isOdd();return(r&&!l||!r&&l)&&(o=o.redNeg()),this.point(e,o)};Du.prototype.pointFromY=function(e,r){e=new Md(e,16),e.red||(e=e.toRed(this.red));var n=e.redSqr(),i=n.redSub(this.c2),a=n.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(a.redInvm());if(s.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var o=s.redSqrt();if(o.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");return o.fromRed().isOdd()!==r&&(o=o.redNeg()),this.point(o,e)};Du.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),n=e.y.redSqr(),i=r.redMul(this.a).redAdd(n),a=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));return i.cmp(a)===0};function kn(t,e,r,n,i){e7.BasePoint.call(this,t,"projective"),e===null&&r===null&&n===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new Md(e,16),this.y=new Md(r,16),this.z=n?new Md(n,16):this.curve.one,this.t=i&&new Md(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}aie(kn,e7.BasePoint);Du.prototype.pointFromJSON=function(e){return kn.fromJSON(this,e)};Du.prototype.point=function(e,r,n,i){return new kn(this,e,r,n,i)};kn.fromJSON=function(e,r){return new kn(e,r[0],r[1],r[2])};kn.prototype.inspect=function(){return this.isInfinity()?"":""};kn.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};kn.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),s=i.redAdd(r),o=s.redSub(n),l=i.redSub(r),c=a.redMul(o),u=s.redMul(l),f=a.redMul(l),h=o.redMul(s);return this.curve.point(c,u,h,f)};kn.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),n=this.y.redSqr(),i,a,s,o,l,c;if(this.curve.twisted){o=this.curve._mulA(r);var u=o.redAdd(n);this.zOne?(i=e.redSub(r).redSub(n).redMul(u.redSub(this.curve.two)),a=u.redMul(o.redSub(n)),s=u.redSqr().redSub(u).redSub(u)):(l=this.z.redSqr(),c=u.redSub(l).redISub(l),i=e.redSub(r).redISub(n).redMul(c),a=u.redMul(o.redSub(n)),s=u.redMul(c))}else o=r.redAdd(n),l=this.curve._mulC(this.z).redSqr(),c=o.redSub(l).redSub(l),i=this.curve._mulC(e.redISub(o)).redMul(c),a=this.curve._mulC(o).redMul(r.redISub(n)),s=o.redMul(c);return this.curve.point(i,a,s)};kn.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};kn.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),s=n.redSub(r),o=a.redSub(i),l=a.redAdd(i),c=n.redAdd(r),u=s.redMul(o),f=l.redMul(c),h=s.redMul(c),g=o.redMul(l);return this.curve.point(u,f,g,h)};kn.prototype._projAdd=function(e){var r=this.z.redMul(e.z),n=r.redSqr(),i=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(i).redMul(a),o=n.redSub(s),l=n.redAdd(s),c=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(a),u=r.redMul(o).redMul(c),f,h;return this.curve.twisted?(f=r.redMul(l).redMul(a.redSub(this.curve._mulA(i))),h=o.redMul(l)):(f=r.redMul(l).redMul(a.redSub(i)),h=this.curve._mulC(o).redMul(l)),this.curve.point(u,f,h)};kn.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)};kn.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)};kn.prototype.mulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!1)};kn.prototype.jmulAdd=function(e,r,n){return this.curve._wnafMulAdd(1,[this,r],[e,n],2,!0)};kn.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this};kn.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};kn.prototype.getX=function(){return this.normalize(),this.x.fromRed()};kn.prototype.getY=function(){return this.normalize(),this.y.fromRed()};kn.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0};kn.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),this.x.cmp(r)===0)return!0}};kn.prototype.toP=kn.prototype.normalize;kn.prototype.mixedAdd=kn.prototype.add;(function(t){var e=t;e.base=Zx,e.short=xBe,e.mont=_Be,e.edwards=ABe})(Sj);var t7={},SS,Qz;function IBe(){return Qz||(Qz=1,SS={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),SS}(function(t){var e=t,r=Iw,n=Sj,i=Oo,a=i.assert;function s(c){c.type==="short"?this.curve=new n.short(c):c.type==="edwards"?this.curve=new n.edwards(c):this.curve=new n.mont(c),this.g=this.curve.g,this.n=this.curve.n,this.hash=c.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=s;function o(c,u){Object.defineProperty(e,c,{configurable:!0,enumerable:!0,get:function(){var f=new s(u);return Object.defineProperty(e,c,{configurable:!0,enumerable:!0,value:f}),f}})}o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=IBe()}catch{l=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})})(t7);var MBe=Iw,D0=_j,sie=v1;function hh(t){if(!(this instanceof hh))return new hh(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=D0.toArray(t.entropy,t.entropyEnc||"hex"),r=D0.toArray(t.nonce,t.nonceEnc||"hex"),n=D0.toArray(t.pers,t.persEnc||"hex");sie(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,n)}var TBe=hh;hh.prototype._init=function(e,r,n){var i=e.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1};hh.prototype.generate=function(e,r,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=n,n=r,r=null),n&&(n=D0.toArray(n,i||"hex"),this._update(n));for(var a=[];a.length"};var p8=af,Ij=Oo,jBe=Ij.assert;function r7(t,e){if(t instanceof r7)return t;this._importDER(t,e)||(jBe(t.r&&t.s,"Signature without r or s"),this.r=new p8(t.r,16),this.s=new p8(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var $Be=r7;function PBe(){this.place=0}function AS(t,e){var r=t[e.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||t[e.place]===0)return!1;for(var i=0,a=0,s=e.place;a>>=0;return i<=127?!1:(e.place=s,i)}function Zz(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}r7.prototype.toDER=function(e){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Zz(r),n=Zz(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var i=[2];IS(i,r.length),i=i.concat(r),i.push(2),IS(i,n.length);var a=i.concat(n),s=[48];return IS(s,a.length),s=s.concat(a),Ij.encode(s,e)};var oc=af,oie=TBe,RBe=Oo,MS=t7,DBe=nie,m0=RBe.assert,Mj=LBe,n7=$Be;function xl(t){if(!(this instanceof xl))return new xl(t);typeof t=="string"&&(m0(Object.prototype.hasOwnProperty.call(MS,t),"Unknown curve "+t),t=MS[t]),t instanceof MS.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var OBe=xl;xl.prototype.keyPair=function(e){return new Mj(this,e)};xl.prototype.keyFromPrivate=function(e,r){return Mj.fromPrivate(this,e,r)};xl.prototype.keyFromPublic=function(e,r){return Mj.fromPublic(this,e,r)};xl.prototype.genKeyPair=function(e){e||(e={});for(var r=new oie({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||DBe(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),i=this.n.sub(new oc(2));;){var a=new oc(r.generate(n));if(!(a.cmp(i)>0))return a.iaddn(1),this.keyFromPrivate(a)}};xl.prototype._truncateToN=function(e,r,n){var i;if(oc.isBN(e)||typeof e=="number")e=new oc(e,16),i=e.byteLength();else if(typeof e=="object")i=e.length,e=new oc(e,16);else{var a=e.toString();i=a.length+1>>>1,e=new oc(a,16)}typeof n!="number"&&(n=i*8);var s=n-this.n.bitLength();return s>0&&(e=e.ushrn(s)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};xl.prototype.sign=function(e,r,n,i){if(typeof n=="object"&&(i=n,n=null),i||(i={}),typeof e!="string"&&typeof e!="number"&&!oc.isBN(e)){m0(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),m0(e.length>>>0===e.length);for(var a=0;a=0)){var g=this.g.mul(h);if(!g.isInfinity()){var m=g.getX(),w=m.umod(this.n);if(w.cmpn(0)!==0){var C=h.invm(this.n).mul(w.mul(r.getPrivate()).iadd(e));if(C=C.umod(this.n),C.cmpn(0)!==0){var v=(g.getY().isOdd()?1:0)|(m.cmp(w)!==0?2:0);return i.canonical&&C.cmp(this.nh)>0&&(C=this.n.sub(C),v^=1),new n7({r:w,s:C,recoveryParam:v})}}}}}};xl.prototype.verify=function(e,r,n,i,a){a||(a={}),e=this._truncateToN(e,!1,a.msgBitLength),n=this.keyFromPublic(n,i),r=new n7(r,"hex");var s=r.r,o=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var l=o.invm(this.n),c=l.mul(e).umod(this.n),u=l.mul(s).umod(this.n),f;return this.curve._maxwellTrick?(f=this.g.jmulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.eqXToP(s)):(f=this.g.mulAdd(c,n.getPublic(),u),f.isInfinity()?!1:f.getX().umod(this.n).cmp(s)===0)};xl.prototype.recoverPubKey=function(t,e,r,n){m0((3&r)===r,"The recovery param is more than two bits"),e=new n7(e,n);var i=this.n,a=new oc(t),s=e.r,o=e.s,l=r&1,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");c?s=this.curve.pointFromX(s.add(this.curve.n),l):s=this.curve.pointFromX(s,l);var u=e.r.invm(i),f=i.sub(a).mul(u).umod(i),h=o.mul(u).umod(i);return this.g.mulAdd(f,s,h)};xl.prototype.getKeyRecoveryParam=function(t,e,r,n){if(e=new n7(e,n),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(t,e,i)}catch{continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var pv=Oo,lie=pv.assert,Xz=pv.parseBytes,Wm=pv.cachedProperty;function sa(t,e){this.eddsa=t,this._secret=Xz(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=Xz(e.pub)}sa.fromPublic=function(e,r){return r instanceof sa?r:new sa(e,{pub:r})};sa.fromSecret=function(e,r){return r instanceof sa?r:new sa(e,{secret:r})};sa.prototype.secret=function(){return this._secret};Wm(sa,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())});Wm(sa,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});Wm(sa,"privBytes",function(){var e=this.eddsa,r=this.hash(),n=e.encodingLength-1,i=r.slice(0,e.encodingLength);return i[0]&=248,i[n]&=127,i[n]|=64,i});Wm(sa,"priv",function(){return this.eddsa.decodeInt(this.privBytes())});Wm(sa,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()});Wm(sa,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)});sa.prototype.sign=function(e){return lie(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)};sa.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)};sa.prototype.getSecret=function(e){return lie(this._secret,"KeyPair is public only"),pv.encode(this.secret(),e)};sa.prototype.getPublic=function(e){return pv.encode(this.pubBytes(),e)};var FBe=sa,UBe=af,i7=Oo,eW=i7.assert,a7=i7.cachedProperty,BBe=i7.parseBytes;function j1(t,e){this.eddsa=t,typeof e!="object"&&(e=BBe(e)),Array.isArray(e)&&(eW(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),eW(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof UBe&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}a7(j1,"S",function(){return this.eddsa.decodeInt(this.Sencoded())});a7(j1,"R",function(){return this.eddsa.decodePoint(this.Rencoded())});a7(j1,"Rencoded",function(){return this.eddsa.encodePoint(this.R())});a7(j1,"Sencoded",function(){return this.eddsa.encodeInt(this.S())});j1.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())};j1.prototype.toHex=function(){return i7.encode(this.toBytes(),"hex").toUpperCase()};var zBe=j1,WBe=Iw,HBe=t7,tm=Oo,GBe=tm.assert,cie=tm.parseBytes,uie=FBe,tW=zBe;function Qs(t){if(GBe(t==="ed25519","only tested with ed25519 so far"),!(this instanceof Qs))return new Qs(t);t=HBe[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=WBe.sha512}var qBe=Qs;Qs.prototype.sign=function(e,r){e=cie(e);var n=this.keyFromSecret(r),i=this.hashInt(n.messagePrefix(),e),a=this.g.mul(i),s=this.encodePoint(a),o=this.hashInt(s,n.pubBytes(),e).mul(n.priv()),l=i.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:l,Rencoded:s})};Qs.prototype.verify=function(e,r,n){if(e=cie(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var i=this.keyFromPublic(n),a=this.hashInt(r.Rencoded(),i.pubBytes(),e),s=this.g.mul(r.S()),o=r.R().add(i.pub().mul(a));return o.eq(s)};Qs.prototype.hashInt=function(){for(var e=this.hash(),r=0;r0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=l[u++],c--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(c>=this.blockSize&&(u=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,u,c),c%=this.blockSize);c>0;)this._buffer[this._bufferLength++]=l[u++],c--;return this},o.prototype.finish=function(l){if(!this._finished){var c=this._bytesHashed,u=this._bufferLength,f=c/536870912|0,h=c<<3,g=c%128<112?128:256;this._buffer[u]=128;for(var m=u+1;m0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},o.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},o.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},o}();t.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(o,l,c,u,f,h,g){for(var m=c[0],w=c[1],C=c[2],v=c[3],b=c[4],A=c[5],S=c[6],j=c[7],F=u[0],I=u[1],B=u[2],V=u[3],se=u[4],Y=u[5],N=u[6],k=u[7],x,E,L,O,P,R,M,D;g>=128;){for(var $=0;$<16;$++){var X=8*$+h;o[$]=e.readUint32BE(f,X),l[$]=e.readUint32BE(f,X+4)}for(var $=0;$<80;$++){var le=m,H=w,ee=C,J=v,te=b,re=A,z=S,G=j,Q=F,me=I,be=B,Ce=V,Fe=se,Ue=Y,Ke=N,lt=k;if(x=j,E=k,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=(b>>>14|se<<18)^(b>>>18|se<<14)^(se>>>9|b<<23),E=(se>>>14|b<<18)^(se>>>18|b<<14)^(b>>>9|se<<23),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=b&A^~b&S,E=se&Y^~se&N,P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=i[$*2],E=i[$*2+1],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=o[$%16],E=l[$%16],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,L=M&65535|D<<16,O=P&65535|R<<16,x=L,E=O,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=(m>>>28|F<<4)^(F>>>2|m<<30)^(F>>>7|m<<25),E=(F>>>28|m<<4)^(m>>>2|F<<30)^(m>>>7|F<<25),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,x=m&w^m&C^w&C,E=F&I^F&B^I&B,P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,G=M&65535|D<<16,lt=P&65535|R<<16,x=J,E=Ce,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=L,E=O,P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,J=M&65535|D<<16,Ce=P&65535|R<<16,w=le,C=H,v=ee,b=J,A=te,S=re,j=z,m=G,I=Q,B=me,V=be,se=Ce,Y=Fe,N=Ue,k=Ke,F=lt,$%16===15)for(var X=0;X<16;X++)x=o[X],E=l[X],P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=o[(X+9)%16],E=l[(X+9)%16],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,L=o[(X+1)%16],O=l[(X+1)%16],x=(L>>>1|O<<31)^(L>>>8|O<<24)^L>>>7,E=(O>>>1|L<<31)^(O>>>8|L<<24)^(O>>>7|L<<25),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,L=o[(X+14)%16],O=l[(X+14)%16],x=(L>>>19|O<<13)^(O>>>29|L<<3)^L>>>6,E=(O>>>19|L<<13)^(L>>>29|O<<3)^(O>>>6|L<<26),P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,o[X]=M&65535|D<<16,l[X]=P&65535|R<<16}x=m,E=F,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[0],E=u[0],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[0]=m=M&65535|D<<16,u[0]=F=P&65535|R<<16,x=w,E=I,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[1],E=u[1],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[1]=w=M&65535|D<<16,u[1]=I=P&65535|R<<16,x=C,E=B,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[2],E=u[2],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[2]=C=M&65535|D<<16,u[2]=B=P&65535|R<<16,x=v,E=V,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[3],E=u[3],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[3]=v=M&65535|D<<16,u[3]=V=P&65535|R<<16,x=b,E=se,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[4],E=u[4],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[4]=b=M&65535|D<<16,u[4]=se=P&65535|R<<16,x=A,E=Y,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[5],E=u[5],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[5]=A=M&65535|D<<16,u[5]=Y=P&65535|R<<16,x=S,E=N,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[6],E=u[6],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[6]=S=M&65535|D<<16,u[6]=N=P&65535|R<<16,x=j,E=k,P=E&65535,R=E>>>16,M=x&65535,D=x>>>16,x=c[7],E=u[7],P+=E&65535,R+=E>>>16,M+=x&65535,D+=x>>>16,R+=P>>>16,M+=R>>>16,D+=M>>>16,c[7]=j=M&65535|D<<16,u[7]=k=P&65535|R<<16,h+=128,g-=128}return h}function s(o){var l=new n;l.update(o);var c=l.digest();return l.clean(),c}t.hash=s})(die);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Nh,r=die,n=Do;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function i(J){const te=new Float64Array(16);if(J)for(let re=0;re>16&1),re[me-1]&=65535;re[15]=z[15]-32767-(re[14]>>16&1);const Q=re[15]>>16&1;re[14]&=65535,w(z,re,1-Q)}for(let G=0;G<16;G++)J[2*G]=z[G]&255,J[2*G+1]=z[G]>>8}function v(J,te){let re=0;for(let z=0;z<32;z++)re|=J[z]^te[z];return(1&re-1>>>8)-1}function b(J,te){const re=new Uint8Array(32),z=new Uint8Array(32);return C(re,J),C(z,te),v(re,z)}function A(J){const te=new Uint8Array(32);return C(te,J),te[0]&1}function S(J,te){for(let re=0;re<16;re++)J[re]=te[2*re]+(te[2*re+1]<<8);J[15]&=32767}function j(J,te,re){for(let z=0;z<16;z++)J[z]=te[z]+re[z]}function F(J,te,re){for(let z=0;z<16;z++)J[z]=te[z]-re[z]}function I(J,te,re){let z,G,Q=0,me=0,be=0,Ce=0,Fe=0,Ue=0,Ke=0,lt=0,Ee=0,He=0,qe=0,Ie=0,Ne=0,$e=0,je=0,K=0,U=0,W=0,ie=0,pe=0,we=0,he=0,Re=0,Je=0,et=0,it=0,ut=0,pt=0,tr=0,zt=0,At=0,mt=re[0],St=re[1],dt=re[2],Nt=re[3],Rt=re[4],gt=re[5],qt=re[6],Wt=re[7],ot=re[8],Vt=re[9],Ft=re[10],yt=re[11],Ze=re[12],Pt=re[13],xt=re[14],Jt=re[15];z=te[0],Q+=z*mt,me+=z*St,be+=z*dt,Ce+=z*Nt,Fe+=z*Rt,Ue+=z*gt,Ke+=z*qt,lt+=z*Wt,Ee+=z*ot,He+=z*Vt,qe+=z*Ft,Ie+=z*yt,Ne+=z*Ze,$e+=z*Pt,je+=z*xt,K+=z*Jt,z=te[1],me+=z*mt,be+=z*St,Ce+=z*dt,Fe+=z*Nt,Ue+=z*Rt,Ke+=z*gt,lt+=z*qt,Ee+=z*Wt,He+=z*ot,qe+=z*Vt,Ie+=z*Ft,Ne+=z*yt,$e+=z*Ze,je+=z*Pt,K+=z*xt,U+=z*Jt,z=te[2],be+=z*mt,Ce+=z*St,Fe+=z*dt,Ue+=z*Nt,Ke+=z*Rt,lt+=z*gt,Ee+=z*qt,He+=z*Wt,qe+=z*ot,Ie+=z*Vt,Ne+=z*Ft,$e+=z*yt,je+=z*Ze,K+=z*Pt,U+=z*xt,W+=z*Jt,z=te[3],Ce+=z*mt,Fe+=z*St,Ue+=z*dt,Ke+=z*Nt,lt+=z*Rt,Ee+=z*gt,He+=z*qt,qe+=z*Wt,Ie+=z*ot,Ne+=z*Vt,$e+=z*Ft,je+=z*yt,K+=z*Ze,U+=z*Pt,W+=z*xt,ie+=z*Jt,z=te[4],Fe+=z*mt,Ue+=z*St,Ke+=z*dt,lt+=z*Nt,Ee+=z*Rt,He+=z*gt,qe+=z*qt,Ie+=z*Wt,Ne+=z*ot,$e+=z*Vt,je+=z*Ft,K+=z*yt,U+=z*Ze,W+=z*Pt,ie+=z*xt,pe+=z*Jt,z=te[5],Ue+=z*mt,Ke+=z*St,lt+=z*dt,Ee+=z*Nt,He+=z*Rt,qe+=z*gt,Ie+=z*qt,Ne+=z*Wt,$e+=z*ot,je+=z*Vt,K+=z*Ft,U+=z*yt,W+=z*Ze,ie+=z*Pt,pe+=z*xt,we+=z*Jt,z=te[6],Ke+=z*mt,lt+=z*St,Ee+=z*dt,He+=z*Nt,qe+=z*Rt,Ie+=z*gt,Ne+=z*qt,$e+=z*Wt,je+=z*ot,K+=z*Vt,U+=z*Ft,W+=z*yt,ie+=z*Ze,pe+=z*Pt,we+=z*xt,he+=z*Jt,z=te[7],lt+=z*mt,Ee+=z*St,He+=z*dt,qe+=z*Nt,Ie+=z*Rt,Ne+=z*gt,$e+=z*qt,je+=z*Wt,K+=z*ot,U+=z*Vt,W+=z*Ft,ie+=z*yt,pe+=z*Ze,we+=z*Pt,he+=z*xt,Re+=z*Jt,z=te[8],Ee+=z*mt,He+=z*St,qe+=z*dt,Ie+=z*Nt,Ne+=z*Rt,$e+=z*gt,je+=z*qt,K+=z*Wt,U+=z*ot,W+=z*Vt,ie+=z*Ft,pe+=z*yt,we+=z*Ze,he+=z*Pt,Re+=z*xt,Je+=z*Jt,z=te[9],He+=z*mt,qe+=z*St,Ie+=z*dt,Ne+=z*Nt,$e+=z*Rt,je+=z*gt,K+=z*qt,U+=z*Wt,W+=z*ot,ie+=z*Vt,pe+=z*Ft,we+=z*yt,he+=z*Ze,Re+=z*Pt,Je+=z*xt,et+=z*Jt,z=te[10],qe+=z*mt,Ie+=z*St,Ne+=z*dt,$e+=z*Nt,je+=z*Rt,K+=z*gt,U+=z*qt,W+=z*Wt,ie+=z*ot,pe+=z*Vt,we+=z*Ft,he+=z*yt,Re+=z*Ze,Je+=z*Pt,et+=z*xt,it+=z*Jt,z=te[11],Ie+=z*mt,Ne+=z*St,$e+=z*dt,je+=z*Nt,K+=z*Rt,U+=z*gt,W+=z*qt,ie+=z*Wt,pe+=z*ot,we+=z*Vt,he+=z*Ft,Re+=z*yt,Je+=z*Ze,et+=z*Pt,it+=z*xt,ut+=z*Jt,z=te[12],Ne+=z*mt,$e+=z*St,je+=z*dt,K+=z*Nt,U+=z*Rt,W+=z*gt,ie+=z*qt,pe+=z*Wt,we+=z*ot,he+=z*Vt,Re+=z*Ft,Je+=z*yt,et+=z*Ze,it+=z*Pt,ut+=z*xt,pt+=z*Jt,z=te[13],$e+=z*mt,je+=z*St,K+=z*dt,U+=z*Nt,W+=z*Rt,ie+=z*gt,pe+=z*qt,we+=z*Wt,he+=z*ot,Re+=z*Vt,Je+=z*Ft,et+=z*yt,it+=z*Ze,ut+=z*Pt,pt+=z*xt,tr+=z*Jt,z=te[14],je+=z*mt,K+=z*St,U+=z*dt,W+=z*Nt,ie+=z*Rt,pe+=z*gt,we+=z*qt,he+=z*Wt,Re+=z*ot,Je+=z*Vt,et+=z*Ft,it+=z*yt,ut+=z*Ze,pt+=z*Pt,tr+=z*xt,zt+=z*Jt,z=te[15],K+=z*mt,U+=z*St,W+=z*dt,ie+=z*Nt,pe+=z*Rt,we+=z*gt,he+=z*qt,Re+=z*Wt,Je+=z*ot,et+=z*Vt,it+=z*Ft,ut+=z*yt,pt+=z*Ze,tr+=z*Pt,zt+=z*xt,At+=z*Jt,Q+=38*U,me+=38*W,be+=38*ie,Ce+=38*pe,Fe+=38*we,Ue+=38*he,Ke+=38*Re,lt+=38*Je,Ee+=38*et,He+=38*it,qe+=38*ut,Ie+=38*pt,Ne+=38*tr,$e+=38*zt,je+=38*At,G=1,z=Q+G+65535,G=Math.floor(z/65536),Q=z-G*65536,z=me+G+65535,G=Math.floor(z/65536),me=z-G*65536,z=be+G+65535,G=Math.floor(z/65536),be=z-G*65536,z=Ce+G+65535,G=Math.floor(z/65536),Ce=z-G*65536,z=Fe+G+65535,G=Math.floor(z/65536),Fe=z-G*65536,z=Ue+G+65535,G=Math.floor(z/65536),Ue=z-G*65536,z=Ke+G+65535,G=Math.floor(z/65536),Ke=z-G*65536,z=lt+G+65535,G=Math.floor(z/65536),lt=z-G*65536,z=Ee+G+65535,G=Math.floor(z/65536),Ee=z-G*65536,z=He+G+65535,G=Math.floor(z/65536),He=z-G*65536,z=qe+G+65535,G=Math.floor(z/65536),qe=z-G*65536,z=Ie+G+65535,G=Math.floor(z/65536),Ie=z-G*65536,z=Ne+G+65535,G=Math.floor(z/65536),Ne=z-G*65536,z=$e+G+65535,G=Math.floor(z/65536),$e=z-G*65536,z=je+G+65535,G=Math.floor(z/65536),je=z-G*65536,z=K+G+65535,G=Math.floor(z/65536),K=z-G*65536,Q+=G-1+37*(G-1),G=1,z=Q+G+65535,G=Math.floor(z/65536),Q=z-G*65536,z=me+G+65535,G=Math.floor(z/65536),me=z-G*65536,z=be+G+65535,G=Math.floor(z/65536),be=z-G*65536,z=Ce+G+65535,G=Math.floor(z/65536),Ce=z-G*65536,z=Fe+G+65535,G=Math.floor(z/65536),Fe=z-G*65536,z=Ue+G+65535,G=Math.floor(z/65536),Ue=z-G*65536,z=Ke+G+65535,G=Math.floor(z/65536),Ke=z-G*65536,z=lt+G+65535,G=Math.floor(z/65536),lt=z-G*65536,z=Ee+G+65535,G=Math.floor(z/65536),Ee=z-G*65536,z=He+G+65535,G=Math.floor(z/65536),He=z-G*65536,z=qe+G+65535,G=Math.floor(z/65536),qe=z-G*65536,z=Ie+G+65535,G=Math.floor(z/65536),Ie=z-G*65536,z=Ne+G+65535,G=Math.floor(z/65536),Ne=z-G*65536,z=$e+G+65535,G=Math.floor(z/65536),$e=z-G*65536,z=je+G+65535,G=Math.floor(z/65536),je=z-G*65536,z=K+G+65535,G=Math.floor(z/65536),K=z-G*65536,Q+=G-1+37*(G-1),J[0]=Q,J[1]=me,J[2]=be,J[3]=Ce,J[4]=Fe,J[5]=Ue,J[6]=Ke,J[7]=lt,J[8]=Ee,J[9]=He,J[10]=qe,J[11]=Ie,J[12]=Ne,J[13]=$e,J[14]=je,J[15]=K}function B(J,te){I(J,te,te)}function V(J,te){const re=i();let z;for(z=0;z<16;z++)re[z]=te[z];for(z=253;z>=0;z--)B(re,re),z!==2&&z!==4&&I(re,re,te);for(z=0;z<16;z++)J[z]=re[z]}function se(J,te){const re=i();let z;for(z=0;z<16;z++)re[z]=te[z];for(z=250;z>=0;z--)B(re,re),z!==1&&I(re,re,te);for(z=0;z<16;z++)J[z]=re[z]}function Y(J,te){const re=i(),z=i(),G=i(),Q=i(),me=i(),be=i(),Ce=i(),Fe=i(),Ue=i();F(re,J[1],J[0]),F(Ue,te[1],te[0]),I(re,re,Ue),j(z,J[0],J[1]),j(Ue,te[0],te[1]),I(z,z,Ue),I(G,J[3],te[3]),I(G,G,c),I(Q,J[2],te[2]),j(Q,Q,Q),F(me,z,re),F(be,Q,G),j(Ce,Q,G),j(Fe,z,re),I(J[0],me,be),I(J[1],Fe,Ce),I(J[2],Ce,be),I(J[3],me,Fe)}function N(J,te,re){for(let z=0;z<4;z++)w(J[z],te[z],re)}function k(J,te){const re=i(),z=i(),G=i();V(G,te[2]),I(re,te[0],G),I(z,te[1],G),C(J,z),J[31]^=A(re)<<7}function x(J,te,re){g(J[0],s),g(J[1],o),g(J[2],o),g(J[3],s);for(let z=255;z>=0;--z){const G=re[z/8|0]>>(z&7)&1;N(J,te,G),Y(te,J),Y(J,J),N(J,te,G)}}function E(J,te){const re=[i(),i(),i(),i()];g(re[0],u),g(re[1],f),g(re[2],o),I(re[3],u,f),x(J,re,te)}function L(J){if(J.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const te=(0,r.hash)(J);te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(32),z=[i(),i(),i(),i()];E(z,te),k(re,z);const G=new Uint8Array(64);return G.set(J),G.set(re,32),{publicKey:re,secretKey:G}}t.generateKeyPairFromSeed=L;function O(J){const te=(0,e.randomBytes)(32,J),re=L(te);return(0,n.wipe)(te),re}t.generateKeyPair=O;function P(J){if(J.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(J.subarray(32))}t.extractPublicKeyFromSecretKey=P;const R=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function M(J,te){let re,z,G,Q;for(z=63;z>=32;--z){for(re=0,G=z-32,Q=z-12;G>4)*R[G],re=te[G]>>8,te[G]&=255;for(G=0;G<32;G++)te[G]-=re*R[G];for(z=0;z<32;z++)te[z+1]+=te[z]>>8,J[z]=te[z]&255}function D(J){const te=new Float64Array(64);for(let re=0;re<64;re++)te[re]=J[re];for(let re=0;re<64;re++)J[re]=0;M(J,te)}function $(J,te){const re=new Float64Array(64),z=[i(),i(),i(),i()],G=(0,r.hash)(J.subarray(0,32));G[0]&=248,G[31]&=127,G[31]|=64;const Q=new Uint8Array(64);Q.set(G.subarray(32),32);const me=new r.SHA512;me.update(Q.subarray(32)),me.update(te);const be=me.digest();me.clean(),D(be),E(z,be),k(Q,z),me.reset(),me.update(Q.subarray(0,32)),me.update(J.subarray(32)),me.update(te);const Ce=me.digest();D(Ce);for(let Fe=0;Fe<32;Fe++)re[Fe]=be[Fe];for(let Fe=0;Fe<32;Fe++)for(let Ue=0;Ue<32;Ue++)re[Fe+Ue]+=Ce[Fe]*G[Ue];return M(Q.subarray(32),re),Q}t.sign=$;function X(J,te){const re=i(),z=i(),G=i(),Q=i(),me=i(),be=i(),Ce=i();return g(J[2],o),S(J[1],te),B(G,J[1]),I(Q,G,l),F(G,G,J[2]),j(Q,J[2],Q),B(me,Q),B(be,me),I(Ce,be,me),I(re,Ce,G),I(re,re,Q),se(re,re),I(re,re,G),I(re,re,Q),I(re,re,Q),I(J[0],re,Q),B(z,J[0]),I(z,z,Q),b(z,G)&&I(J[0],J[0],h),B(z,J[0]),I(z,z,Q),b(z,G)?-1:(A(J[0])===te[31]>>7&&F(J[0],s,J[0]),I(J[3],J[0],J[1]),0)}function le(J,te,re){const z=new Uint8Array(32),G=[i(),i(),i(),i()],Q=[i(),i(),i(),i()];if(re.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(X(Q,J))return!1;const me=new r.SHA512;me.update(re.subarray(0,32)),me.update(J),me.update(te);const be=me.digest();return D(be),x(G,Q,be),E(Q,re.subarray(32)),Y(G,Q),k(z,G),!v(re,z)}t.verify=le;function H(J){let te=[i(),i(),i(),i()];if(X(te,J))throw new Error("Ed25519: invalid public key");let re=i(),z=i(),G=te[1];j(re,o,G),F(z,o,G),V(z,z),I(re,re,z);let Q=new Uint8Array(32);return C(Q,re),Q}t.convertPublicKeyToX25519=H;function ee(J){const te=(0,r.hash)(J.subarray(0,32));te[0]&=248,te[31]&=127,te[31]|=64;const re=new Uint8Array(te.subarray(0,32));return(0,n.wipe)(te),re}t.convertSecretKeyToX25519=ee})(Tj);const VBe="EdDSA",YBe="JWT",g8=".",s7="base64url",fie="utf8",hie="utf8",KBe=":",JBe="did",QBe="key",rW="base58btc",ZBe="z",XBe="K36",eze=32,tze=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),rze=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function l1(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return rze(t)}catch{return t}}function Kd(t){return typeof t=="string"?t:tze(t)||""}function nW(t){return l1(aa(ra(t,s7),fie))}function m8(t){return aa(ra(Kd(t),fie),s7)}function pie(t){const e=ra(XBe,rW),r=ZBe+aa(B6([e,t]),rW);return[JBe,QBe,r].join(KBe)}function nze(t){return aa(t,s7)}function ize(t){return ra(t,s7)}function aze(t){return ra([m8(t.header),m8(t.payload)].join(g8),hie)}function sze(t){return[m8(t.header),m8(t.payload),nze(t.signature)].join(g8)}function vT(t){const e=t.split(g8),r=nW(e[0]),n=nW(e[1]),i=ize(e[2]),a=ra(e.slice(0,2).join(g8),hie);return{header:r,payload:n,signature:i,data:a}}function iW(t=Nh.randomBytes(eze)){return Tj.generateKeyPairFromSeed(t)}async function oze(t,e,r,n,i=ct.fromMiliseconds(Date.now())){const a={alg:VBe,typ:YBe},s=pie(n.publicKey),o=i+r,l={iss:s,sub:t,aud:e,iat:i,exp:o},c=aze({header:a,payload:l}),u=Tj.sign(n.secretKey,c);return sze({header:a,payload:l,signature:u})}const lze={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};var cze={};const uze=":";function vg(t){const[e,r]=t.split(uze);return{namespace:e,reference:r}}function aW(t,e=[]){const r=[];return Object.keys(t).forEach(n=>{if(e.length&&!e.includes(n))return;const i=t[n];r.push(...i.accounts)}),r}function gie(t,e){return t.includes(":")?[t]:e.chains||[]}var dze=Object.defineProperty,sW=Object.getOwnPropertySymbols,fze=Object.prototype.hasOwnProperty,hze=Object.prototype.propertyIsEnumerable,oW=(t,e,r)=>e in t?dze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,lW=(t,e)=>{for(var r in e||(e={}))fze.call(e,r)&&oW(t,r,e[r]);if(sW)for(var r of sW(e))hze.call(e,r)&&oW(t,r,e[r]);return t};const pze="ReactNative",_o={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},gze="js";function y8(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function jh(){return!cv()&&!!yj()&&navigator.product===pze}function mze(){return jh()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="android"}function yze(){return jh()&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"&&(global==null?void 0:global.Platform.OS)==="ios"}function gv(){return!y8()&&!!yj()&&!!cv()}function mv(){return jh()?_o.reactNative:y8()?_o.node:gv()?_o.browser:_o.unknown}function cW(){var t;try{return jh()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function wze(t,e){let r=ew.parse(t);return r=lW(lW({},r),e),t=ew.stringify(r),t}function mie(){return One()||{name:"",description:"",url:"",icons:[""]}}function vze(){if(mv()===_o.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:n}=global.Platform;return[r,n].join("-")}const t=_Oe();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function bze(){var t;const e=mv();return e===_o.browser?[e,((t=Dne())==null?void 0:t.host)||"unknown"].join(":"):e}function yie(t,e,r){const n=vze(),i=bze();return[[t,e].join("-"),[gze,r].join("-"),n,i].join("/")}function xze({protocol:t,version:e,relayUrl:r,sdkVersion:n,auth:i,projectId:a,useOnCloseEvent:s,bundleId:o,packageName:l}){const c=r.split("?"),u=yie(t,e,n),f={auth:i,ua:u,projectId:a,useOnCloseEvent:s||void 0,packageName:l||void 0,bundleId:o||void 0},h=wze(c[1]||"",f);return c[0]+"?"+h}function S0(t,e){return t.filter(r=>e.includes(r)).length===t.length}function wie(t){return Object.fromEntries(t.entries())}function vie(t){return new Map(Object.entries(t))}function c0(t=ct.FIVE_MINUTES,e){const r=ct.toMiliseconds(t||ct.FIVE_MINUTES);let n,i,a,s;return{resolve:o=>{a&&n&&(clearTimeout(a),n(o),s=Promise.resolve(o))},reject:o=>{a&&i&&(clearTimeout(a),i(o))},done:()=>new Promise((o,l)=>{if(s)return o(s);a=setTimeout(()=>{const c=new Error(e);s=Promise.reject(c),l(c)},r),n=o,i=l})}}function Bf(t,e,r){return new Promise(async(n,i)=>{const a=setTimeout(()=>i(new Error(r)),e);try{const s=await t;n(s)}catch(s){i(s)}clearTimeout(a)})}function bie(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function Eze(t){return bie("topic",t)}function _ze(t){return bie("id",t)}function xie(t){const[e,r]=t.split(":"),n={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")n.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))n.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return n}function Li(t,e){return ct.fromMiliseconds(Date.now()+ct.toMiliseconds(t))}function kf(t){return Date.now()>=ct.toMiliseconds(t)}function jr(t,e){return`${t}${e?`:${e}`:""}`}function z6(t=[],e=[]){return[...new Set([...t,...e])]}async function Cze({id:t,topic:e,wcDeepLink:r}){var n;try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r,a=i==null?void 0:i.href;if(typeof a!="string")return;const s=Sze(a,t,e),o=mv();if(o===_o.browser){if(!((n=cv())!=null&&n.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}s.startsWith("https://")||s.startsWith("http://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,Ize()?"_blank":"_self","noreferrer noopener")}else o===_o.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(i){console.error(i)}}function Sze(t,e,r){const n=`requestId=${e}&sessionTopic=${r}`;t.endsWith("/")&&(t=t.slice(0,-1));let i=`${t}`;if(t.startsWith("https://t.me")){const a=t.includes("?")?"&startapp=":"?startapp=";i=`${i}${a}${Mze(n,!0)}`}else i=`${i}/wc?${n}`;return i}async function Aze(t,e){let r="";try{if(gv()&&(r=localStorage.getItem(e),r))return r;r=await t.getItem(e)}catch(n){console.error(n)}return r}function uW(t,e){if(!t.includes(e))return null;const r=t.split(/([&,?,=])/),n=r.indexOf(e);return r[n+2]}function dW(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function kj(){return typeof process<"u"&&cze.IS_VITEST==="true"}function Ize(){return typeof window<"u"&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function Mze(t,e=!1){const r=Buffer.from(t).toString("base64");return e?r.replace(/[=]/g,""):r}function Eie(t){return Buffer.from(t,"base64").toString("utf-8")}function Tze(t){return new Promise(e=>setTimeout(e,t))}const kze="https://rpc.walletconnect.org/v1";async function Nze(t,e,r,n,i,a){switch(r.t){case"eip191":return Lze(t,e,r.s);case"eip1271":return await jze(t,e,r.s,n,i,a);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function Lze(t,e,r){return kN(VK(e),r).toLowerCase()===t.toLowerCase()}async function jze(t,e,r,n,i,a){const s=vg(n);if(!s.namespace||!s.reference)throw new Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{const o="0x1626ba7e",l="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",u=r.substring(2),f=VK(e).substring(2),h=o+f+l+c+u,g=await fetch(`${a||kze}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:$ze(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:h},"latest"]})}),{result:m}=await g.json();return m?m.slice(0,o.length).toLowerCase()===o.toLowerCase():!1}catch(o){return console.error("isValidEip1271Signature: ",o),!1}}function $ze(){return Date.now()+Math.floor(Math.random()*1e3)}var Pze=Object.defineProperty,Rze=Object.defineProperties,Dze=Object.getOwnPropertyDescriptors,fW=Object.getOwnPropertySymbols,Oze=Object.prototype.hasOwnProperty,Fze=Object.prototype.propertyIsEnumerable,hW=(t,e,r)=>e in t?Pze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Uze=(t,e)=>{for(var r in e||(e={}))Oze.call(e,r)&&hW(t,r,e[r]);if(fW)for(var r of fW(e))Fze.call(e,r)&&hW(t,r,e[r]);return t},Bze=(t,e)=>Rze(t,Dze(e));const zze="did:pkh:",Nj=t=>t==null?void 0:t.split(":"),Wze=t=>{const e=t&&Nj(t);if(e)return t.includes(zze)?e[3]:e[1]},bT=t=>{const e=t&&Nj(t);if(e)return e[2]+":"+e[3]},w8=t=>{const e=t&&Nj(t);if(e)return e.pop()};async function pW(t){const{cacao:e,projectId:r}=t,{s:n,p:i}=e,a=_ie(i,i.iss),s=w8(i.iss);return await Nze(s,a,n,bT(i.iss),r)}const _ie=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,n=w8(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let i=t.statement||void 0;const a=`URI: ${t.aud||t.uri}`,s=`Version: ${t.version}`,o=`Chain ID: ${Wze(e)}`,l=`Nonce: ${t.nonce}`,c=`Issued At: ${t.iat}`,u=t.exp?`Expiration Time: ${t.exp}`:void 0,f=t.nbf?`Not Before: ${t.nbf}`:void 0,h=t.requestId?`Request ID: ${t.requestId}`:void 0,g=t.resources?`Resources:${t.resources.map(w=>` +- ${w}`).join("")}`:void 0,m=W6(t.resources);if(m){const w=tw(m);i=Zze(i,w)}return[r,n,"",i,"",a,s,o,l,c,u,f,h,g].filter(w=>w!=null).join(` +`)};function Hze(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function Gze(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function c1(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const n=t.att[r];if(Array.isArray(n))throw new Error(`Resource must be an object: ${r}`);if(typeof n!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(n).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(n).forEach(i=>{const a=n[i];if(!Array.isArray(a))throw new Error(`Ability limits ${i} must be an array of objects, found: ${a}`);if(!a.length)throw new Error(`Value of ${i} is empty array, must be an array with objects`);a.forEach(s=>{if(typeof s!="object")throw new Error(`Ability limits (${i}) must be an array of objects, found: ${s}`)})})})}function qze(t,e,r,n={}){return r==null||r.sort((i,a)=>i.localeCompare(a)),{att:{[t]:Vze(e,r,n)}}}function Vze(t,e,r={}){e=e==null?void 0:e.sort((i,a)=>i.localeCompare(a));const n=e.map(i=>({[`${t}/${i}`]:[r]}));return Object.assign({},...n)}function Cie(t){return c1(t),`urn:recap:${Hze(t).replace(/=/g,"")}`}function tw(t){const e=Gze(t.replace("urn:recap:",""));return c1(e),e}function Yze(t,e,r){const n=qze(t,e,r);return Cie(n)}function Kze(t){return t&&t.includes("urn:recap:")}function Jze(t,e){const r=tw(t),n=tw(e),i=Qze(r,n);return Cie(i)}function Qze(t,e){c1(t),c1(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((i,a)=>i.localeCompare(a)),n={att:{}};return r.forEach(i=>{var a,s;Object.keys(((a=t.att)==null?void 0:a[i])||{}).concat(Object.keys(((s=e.att)==null?void 0:s[i])||{})).sort((o,l)=>o.localeCompare(l)).forEach(o=>{var l,c;n.att[i]=Bze(Uze({},n.att[i]),{[o]:((l=t.att[i])==null?void 0:l[o])||((c=e.att[i])==null?void 0:c[o])})})}),n}function Zze(t="",e){c1(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const n=[];let i=0;Object.keys(e.att).forEach(o=>{const l=Object.keys(e.att[o]).map(f=>({ability:f.split("/")[0],action:f.split("/")[1]}));l.sort((f,h)=>f.action.localeCompare(h.action));const c={};l.forEach(f=>{c[f.ability]||(c[f.ability]=[]),c[f.ability].push(f.action)});const u=Object.keys(c).map(f=>(i++,`(${i}) '${f}': '${c[f].join("', '")}' for '${o}'.`));n.push(u.join(", ").replace(".,","."))});const a=n.join(" "),s=`${r}${a}`;return`${t?t+" ":""}${s}`}function gW(t){var e;const r=tw(t);c1(r);const n=(e=r.att)==null?void 0:e.eip155;return n?Object.keys(n).map(i=>i.split("/")[1]):[]}function mW(t){const e=tw(t);c1(e);const r=[];return Object.values(e.att).forEach(n=>{Object.values(n).forEach(i=>{var a;(a=i==null?void 0:i[0])!=null&&a.chains&&r.push(i[0].chains)})}),[...new Set(r.flat())]}function W6(t){if(!t)return;const e=t==null?void 0:t[t.length-1];return Kze(e)?e:void 0}const Sie="base10",cs="base16",zf="base64pad",q2="base64url",yv="utf8",Aie=0,Ld=1,wv=2,Xze=0,yW=1,Wy=12,Lj=32;function eWe(){const t=xj.generateKeyPair();return{privateKey:aa(t.secretKey,cs),publicKey:aa(t.publicKey,cs)}}function xT(){const t=Nh.randomBytes(Lj);return aa(t,cs)}function tWe(t,e){const r=xj.sharedKey(ra(t,cs),ra(e,cs),!0),n=new XFe(dv.SHA256,r).expand(Lj);return aa(n,cs)}function H6(t){const e=dv.hash(ra(t,cs));return aa(e,cs)}function xd(t){const e=dv.hash(ra(t,yv));return aa(e,cs)}function Iie(t){return ra(`${t}`,Sie)}function u1(t){return Number(aa(t,Sie))}function rWe(t){const e=Iie(typeof t.type<"u"?t.type:Aie);if(u1(e)===Ld&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?ra(t.senderPublicKey,cs):void 0,n=typeof t.iv<"u"?ra(t.iv,cs):Nh.randomBytes(Wy),i=new vj.ChaCha20Poly1305(ra(t.symKey,cs)).seal(n,ra(t.message,yv));return Mie({type:e,sealed:i,iv:n,senderPublicKey:r,encoding:t.encoding})}function nWe(t,e){const r=Iie(wv),n=Nh.randomBytes(Wy),i=ra(t,yv);return Mie({type:r,sealed:i,iv:n,encoding:e})}function iWe(t){const e=new vj.ChaCha20Poly1305(ra(t.symKey,cs)),{sealed:r,iv:n}=rw({encoded:t.encoded,encoding:t==null?void 0:t.encoding}),i=e.open(n,r);if(i===null)throw new Error("Failed to decrypt");return aa(i,yv)}function aWe(t,e){const{sealed:r}=rw({encoded:t,encoding:e});return aa(r,yv)}function Mie(t){const{encoding:e=zf}=t;if(u1(t.type)===wv)return aa(B6([t.type,t.sealed]),e);if(u1(t.type)===Ld){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return aa(B6([t.type,t.senderPublicKey,t.iv,t.sealed]),e)}return aa(B6([t.type,t.iv,t.sealed]),e)}function rw(t){const{encoded:e,encoding:r=zf}=t,n=ra(e,r),i=n.slice(Xze,yW),a=yW;if(u1(i)===Ld){const c=a+Lj,u=c+Wy,f=n.slice(a,c),h=n.slice(c,u),g=n.slice(u);return{type:i,sealed:g,iv:h,senderPublicKey:f}}if(u1(i)===wv){const c=n.slice(a),u=Nh.randomBytes(Wy);return{type:i,sealed:c,iv:u}}const s=a+Wy,o=n.slice(a,s),l=n.slice(s);return{type:i,sealed:l,iv:o}}function sWe(t,e){const r=rw({encoded:t,encoding:e==null?void 0:e.encoding});return Tie({type:u1(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?aa(r.senderPublicKey,cs):void 0,receiverPublicKey:e==null?void 0:e.receiverPublicKey})}function Tie(t){const e=(t==null?void 0:t.type)||Aie;if(e===Ld){if(typeof(t==null?void 0:t.senderPublicKey)>"u")throw new Error("missing sender public key");if(typeof(t==null?void 0:t.receiverPublicKey)>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t==null?void 0:t.senderPublicKey,receiverPublicKey:t==null?void 0:t.receiverPublicKey}}function wW(t){return t.type===Ld&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function vW(t){return t.type===wv}function oWe(t){return new rie.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function lWe(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function cWe(t){return Buffer.from(lWe(t),"base64")}function uWe(t,e){const[r,n,i]=t.split("."),a=cWe(i);if(a.length!==64)throw new Error("Invalid signature length");const s=a.slice(0,32).toString("hex"),o=a.slice(32,64).toString("hex"),l=`${r}.${n}`,c=new dv.SHA256().update(Buffer.from(l)).digest(),u=oWe(e),f=Buffer.from(c).toString("hex");if(!u.verify(f,{r:s,s:o}))throw new Error("Invalid signature");return vT(t).payload}const dWe="irn";function v8(t){return(t==null?void 0:t.relay)||{protocol:dWe}}function my(t){const e=lze[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var fWe=Object.defineProperty,hWe=Object.defineProperties,pWe=Object.getOwnPropertyDescriptors,bW=Object.getOwnPropertySymbols,gWe=Object.prototype.hasOwnProperty,mWe=Object.prototype.propertyIsEnumerable,xW=(t,e,r)=>e in t?fWe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,EW=(t,e)=>{for(var r in e||(e={}))gWe.call(e,r)&&xW(t,r,e[r]);if(bW)for(var r of bW(e))mWe.call(e,r)&&xW(t,r,e[r]);return t},yWe=(t,e)=>hWe(t,pWe(e));function wWe(t,e="-"){const r={},n="relay"+e;return Object.keys(t).forEach(i=>{if(i.startsWith(n)){const a=i.replace(n,""),s=t[i];r[a]=s}}),r}function _W(t){if(!t.includes("wc:")){const l=Eie(t);l!=null&&l.includes("wc:")&&(t=l)}t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,n=t.substring(0,e),i=t.substring(e+1,r).split("@"),a=typeof r<"u"?t.substring(r):"",s=ew.parse(a),o=typeof s.methods=="string"?s.methods.split(","):void 0;return{protocol:n,topic:vWe(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:wWe(s),methods:o,expiryTimestamp:s.expiryTimestamp?parseInt(s.expiryTimestamp,10):void 0}}function vWe(t){return t.startsWith("//")?t.substring(2):t}function bWe(t,e="-"){const r="relay",n={};return Object.keys(t).forEach(i=>{const a=r+e+i;t[i]&&(n[a]=t[i])}),n}function CW(t){return`${t.protocol}:${t.topic}@${t.version}?`+ew.stringify(EW(yWe(EW({symKey:t.symKey},bWe(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function O4(t,e,r){return`${t}?wc_ev=${r}&topic=${e}`}function Hm(t){const e=[];return t.forEach(r=>{const[n,i]=r.split(":");e.push(`${n}:${i}`)}),e}function xWe(t){const e=[];return Object.values(t).forEach(r=>{e.push(...Hm(r.accounts))}),e}function EWe(t,e){const r=[];return Object.values(t).forEach(n=>{Hm(n.accounts).includes(e)&&r.push(...n.methods)}),r}function _We(t,e){const r=[];return Object.values(t).forEach(n=>{Hm(n.accounts).includes(e)&&r.push(...n.events)}),r}function jj(t){return t.includes(":")}function yy(t){return jj(t)?t.split(":")[0]:t}function CWe(t){const e={};return t==null||t.forEach(r=>{const[n,i]=r.split(":");e[n]||(e[n]={accounts:[],chains:[],events:[]}),e[n].accounts.push(r),e[n].chains.push(`${n}:${i}`)}),e}function SW(t,e){e=e.map(n=>n.replace("did:pkh:",""));const r=CWe(e);for(const[n,i]of Object.entries(r))i.methods?i.methods=z6(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}const SWe={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},AWe={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function ht(t,e){const{message:r,code:n}=AWe[t];return{message:e?`${r} ${e}`:r,code:n}}function ln(t,e){const{message:r,code:n}=SWe[t];return{message:e?`${r} ${e}`:r,code:n}}function Jd(t,e){return!!Array.isArray(t)}function nw(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function Os(t){return typeof t>"u"}function pi(t,e){return e&&Os(t)?!0:typeof t=="string"&&!!t.trim().length}function $j(t,e){return typeof t=="number"&&!isNaN(t)}function IWe(t,e){const{requiredNamespaces:r}=e,n=Object.keys(t.namespaces),i=Object.keys(r);let a=!0;return S0(i,n)?(n.forEach(s=>{const{accounts:o,methods:l,events:c}=t.namespaces[s],u=Hm(o),f=r[s];(!S0(gie(s,f),u)||!S0(f.methods,l)||!S0(f.events,c))&&(a=!1)}),a):!1}function b8(t){return pi(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function MWe(t){if(pi(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&b8(r)}}return!1}function TWe(t){function e(r){try{return typeof new URL(r)<"u"}catch{return!1}}try{if(pi(t,!1)){if(e(t))return!0;const r=Eie(t);return e(r)}}catch{}return!1}function kWe(t){var e;return(e=t==null?void 0:t.proposer)==null?void 0:e.publicKey}function NWe(t){return t==null?void 0:t.topic}function LWe(t,e){let r=null;return pi(t==null?void 0:t.publicKey,!1)||(r=ht("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function AW(t){let e=!0;return Jd(t)?t.length&&(e=t.every(r=>pi(r,!1))):e=!1,e}function jWe(t,e,r){let n=null;return Jd(e)&&e.length?e.forEach(i=>{n||b8(i)||(n=ln("UNSUPPORTED_CHAINS",`${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))}):b8(t)||(n=ln("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function $We(t,e,r){let n=null;return Object.entries(t).forEach(([i,a])=>{if(n)return;const s=jWe(i,gie(i,a),`${e} ${r}`);s&&(n=s)}),n}function PWe(t,e){let r=null;return Jd(t)?t.forEach(n=>{r||MWe(n)||(r=ln("UNSUPPORTED_ACCOUNTS",`${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))}):r=ln("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function RWe(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=PWe(n==null?void 0:n.accounts,`${e} namespace`);i&&(r=i)}),r}function DWe(t,e){let r=null;return AW(t==null?void 0:t.methods)?AW(t==null?void 0:t.events)||(r=ln("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=ln("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function kie(t,e){let r=null;return Object.values(t).forEach(n=>{if(r)return;const i=DWe(n,`${e}, namespace`);i&&(r=i)}),r}function OWe(t,e,r){let n=null;if(t&&nw(t)){const i=kie(t,e);i&&(n=i);const a=$We(t,e,r);a&&(n=a)}else n=ht("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return n}function TS(t,e){let r=null;if(t&&nw(t)){const n=kie(t,e);n&&(r=n);const i=RWe(t,e);i&&(r=i)}else r=ht("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function Nie(t){return pi(t.protocol,!0)}function FWe(t,e){let r=!1;return t?t&&Jd(t)&&t.length&&t.forEach(n=>{r=Nie(n)}):r=!0,r}function UWe(t){return typeof t=="number"}function Ls(t){return typeof t<"u"&&typeof t!==null}function BWe(t){return!(!t||typeof t!="object"||!t.code||!$j(t.code)||!t.message||!pi(t.message,!1))}function zWe(t){return!(Os(t)||!pi(t.method,!1))}function WWe(t){return!(Os(t)||Os(t.result)&&Os(t.error)||!$j(t.id)||!pi(t.jsonrpc,!1))}function HWe(t){return!(Os(t)||!pi(t.name,!1))}function IW(t,e){return!(!b8(e)||!xWe(t).includes(e))}function GWe(t,e,r){return pi(r,!1)?EWe(t,e).includes(r):!1}function qWe(t,e,r){return pi(r,!1)?_We(t,e).includes(r):!1}function MW(t,e,r){let n=null;const i=VWe(t),a=YWe(e),s=Object.keys(i),o=Object.keys(a),l=TW(Object.keys(t)),c=TW(Object.keys(e)),u=l.filter(f=>!c.includes(f));return u.length&&(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. Required: ${u.toString()} - Received: ${Object.keys(e).toString()}`)),w0(s,o)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. + Received: ${Object.keys(e).toString()}`)),S0(s,o)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. Required: ${s.toString()} - Approved: ${o.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const h=Rm(e[f].accounts);h.includes(f)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} + Approved: ${o.toString()}`)),Object.keys(e).forEach(f=>{if(!f.includes(":")||n)return;const h=Hm(e[f].accounts);h.includes(f)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${f} Required: ${f} - Approved: ${h.toString()}`))}),s.forEach(f=>{n||(w0(i[f].methods,a[f].methods)?w0(i[f].events,a[f].events)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function EWe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function mW(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function _We(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Rm(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(a=>a.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function CWe(t,e){return _j(t)&&t<=e.max&&t>=e.min}function yW(){const t=lv();return new Promise(e=>{switch(t){case xo.browser:e(SWe());break;case xo.reactNative:e(AWe());break;case xo.node:e(IWe());break;default:e(!0)}})}function SWe(){return ov()&&(navigator==null?void 0:navigator.onLine)}async function AWe(){if(Ih()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function IWe(){return!0}function MWe(t){switch(lv()){case xo.browser:TWe(t);break;case xo.reactNative:kWe(t);break}}function TWe(t){!Ih()&&ov()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function kWe(t){Ih()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const xS={};class F2{static get(e){return xS[e]}static set(e,r){xS[e]=r}static delete(e){delete xS[e]}}class I1{}let NWe=class extends I1{constructor(e){super()}};const wW=ct.FIVE_SECONDS,Dm={pulse:"heartbeat_pulse"};let LWe=class uie extends NWe{constructor(e){super(e),this.events=new gs.EventEmitter,this.interval=wW,this.interval=(e==null?void 0:e.interval)||wW}static async init(e){const r=new uie(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ct.toMiliseconds(this.interval))}pulse(){this.events.emit(Dm.pulse)}};function jWe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Wi(t,...e){try{return jWe(t(...e))}catch(r){return Promise.reject(r)}}function $We(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function PWe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function R6(t){if($We(t))return String(t);if(PWe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return R6(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const dT="base64:";function RWe(t){return typeof t=="string"?t:dT+FWe(t)}function DWe(t){return typeof t!="string"||!t.startsWith(dT)?t:OWe(t.slice(dT.length))}function OWe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function FWe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Ms(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function UWe(...t){return Ms(t.join(":"))}function N4(t){return t=Ms(t),t?t+":":""}const BWe="memory",zWe=()=>{const t=new Map;return{name:BWe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function WWe(t={}){const e={mounts:{"":t.driver||zWe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=c=>{for(const u of e.mountpoints)if(c.startsWith(u))return{base:u,relativeKey:c.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:c,driver:e.mounts[""]}},n=(c,u)=>e.mountpoints.filter(f=>f.startsWith(c)||u&&c.startsWith(f)).map(f=>({relativeBase:c.length>f.length?c.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(c,u)=>{if(e.watching){u=Ms(u);for(const f of e.watchListeners)f(c,u)}},a=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await vW(e.mounts[c],i,c)}},s=async()=>{if(e.watching){for(const c in e.unwatch)await e.unwatch[c]();e.unwatch={},e.watching=!1}},o=(c,u,f)=>{const h=new Map,g=m=>{let w=h.get(m.base);return w||(w={driver:m.driver,base:m.base,items:[]},h.set(m.base,w)),w};for(const m of c){const w=typeof m=="string",_=Ms(w?m:m.key),v=w?void 0:m.value,b=w||!m.options?u:{...u,...m.options},A=r(_);g(A).items.push({key:_,value:v,relativeKey:A.relativeKey,options:b})}return Promise.all([...h.values()].map(m=>f(m))).then(m=>m.flat())},l={hasItem(c,u={}){c=Ms(c);const{relativeKey:f,driver:h}=r(c);return Wi(h.hasItem,f,u)},getItem(c,u={}){c=Ms(c);const{relativeKey:f,driver:h}=r(c);return Wi(h.getItem,f,u).then(g=>ny(g))},getItems(c,u={}){return o(c,u,f=>f.driver.getItems?Wi(f.driver.getItems,f.items.map(h=>({key:h.relativeKey,options:h.options})),u).then(h=>h.map(g=>({key:UWe(f.base,g.key),value:ny(g.value)}))):Promise.all(f.items.map(h=>Wi(f.driver.getItem,h.relativeKey,h.options).then(g=>({key:h.key,value:ny(g)})))))},getItemRaw(c,u={}){c=Ms(c);const{relativeKey:f,driver:h}=r(c);return h.getItemRaw?Wi(h.getItemRaw,f,u):Wi(h.getItem,f,u).then(g=>DWe(g))},async setItem(c,u,f={}){if(u===void 0)return l.removeItem(c);c=Ms(c);const{relativeKey:h,driver:g}=r(c);g.setItem&&(await Wi(g.setItem,h,R6(u),f),g.watch||i("update",c))},async setItems(c,u){await o(c,u,async f=>{if(f.driver.setItems)return Wi(f.driver.setItems,f.items.map(h=>({key:h.relativeKey,value:R6(h.value),options:h.options})),u);f.driver.setItem&&await Promise.all(f.items.map(h=>Wi(f.driver.setItem,h.relativeKey,R6(h.value),h.options)))})},async setItemRaw(c,u,f={}){if(u===void 0)return l.removeItem(c,f);c=Ms(c);const{relativeKey:h,driver:g}=r(c);if(g.setItemRaw)await Wi(g.setItemRaw,h,u,f);else if(g.setItem)await Wi(g.setItem,h,RWe(u),f);else return;g.watch||i("update",c)},async removeItem(c,u={}){typeof u=="boolean"&&(u={removeMeta:u}),c=Ms(c);const{relativeKey:f,driver:h}=r(c);h.removeItem&&(await Wi(h.removeItem,f,u),(u.removeMeta||u.removeMata)&&await Wi(h.removeItem,f+"$",u),h.watch||i("remove",c))},async getMeta(c,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),c=Ms(c);const{relativeKey:f,driver:h}=r(c),g=Object.create(null);if(h.getMeta&&Object.assign(g,await Wi(h.getMeta,f,u)),!u.nativeOnly){const m=await Wi(h.getItem,f+"$",u).then(w=>ny(w));m&&typeof m=="object"&&(typeof m.atime=="string"&&(m.atime=new Date(m.atime)),typeof m.mtime=="string"&&(m.mtime=new Date(m.mtime)),Object.assign(g,m))}return g},setMeta(c,u,f={}){return this.setItem(c+"$",u,f)},removeMeta(c,u={}){return this.removeItem(c+"$",u)},async getKeys(c,u={}){c=N4(c);const f=n(c,!0);let h=[];const g=[];for(const m of f){const w=await Wi(m.driver.getKeys,m.relativeBase,u);for(const _ of w){const v=m.mountpoint+Ms(_);h.some(b=>v.startsWith(b))||g.push(v)}h=[m.mountpoint,...h.filter(_=>!_.startsWith(m.mountpoint))]}return c?g.filter(m=>m.startsWith(c)&&m[m.length-1]!=="$"):g.filter(m=>m[m.length-1]!=="$")},async clear(c,u={}){c=N4(c),await Promise.all(n(c,!1).map(async f=>{if(f.driver.clear)return Wi(f.driver.clear,f.relativeBase,u);if(f.driver.removeItem){const h=await f.driver.getKeys(f.relativeBase||"",u);return Promise.all(h.map(g=>f.driver.removeItem(g,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(c=>bW(c)))},async watch(c){return await a(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==c),e.watchListeners.length===0&&await s()}},async unwatch(){e.watchListeners=[],await s()},mount(c,u){if(c=N4(c),c&&e.mounts[c])throw new Error(`already mounted at ${c}`);return c&&(e.mountpoints.push(c),e.mountpoints.sort((f,h)=>h.length-f.length)),e.mounts[c]=u,e.watching&&Promise.resolve(vW(u,i,c)).then(f=>{e.unwatch[c]=f}).catch(console.error),l},async unmount(c,u=!0){var f,h;c=N4(c),!(!c||!e.mounts[c])&&(e.watching&&c in e.unwatch&&((h=(f=e.unwatch)[c])==null||h.call(f),delete e.unwatch[c]),u&&await bW(e.mounts[c]),e.mountpoints=e.mountpoints.filter(g=>g!==c),delete e.mounts[c])},getMount(c=""){c=Ms(c)+":";const u=r(c);return{driver:u.driver,base:u.base}},getMounts(c="",u={}){return c=Ms(c),n(c,u.parents).map(h=>({driver:h.driver,base:h.mountpoint}))},keys:(c,u={})=>l.getKeys(c,u),get:(c,u={})=>l.getItem(c,u),set:(c,u,f={})=>l.setItem(c,u,f),has:(c,u={})=>l.hasItem(c,u),del:(c,u={})=>l.removeItem(c,u),remove:(c,u={})=>l.removeItem(c,u)};return l}function vW(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function bW(t){typeof t.dispose=="function"&&await Wi(t.dispose)}function M1(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function die(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=M1(r);return(i,a)=>n.then(s=>a(s.transaction(e,i).objectStore(e)))}let ES;function dv(){return ES||(ES=die("keyval-store","keyval")),ES}function xW(t,e=dv()){return e("readonly",r=>M1(r.get(t)))}function HWe(t,e,r=dv()){return r("readwrite",n=>(n.put(e,t),M1(n.transaction)))}function GWe(t,e=dv()){return e("readwrite",r=>(r.delete(t),M1(r.transaction)))}function qWe(t=dv()){return t("readwrite",e=>(e.clear(),M1(e.transaction)))}function VWe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},M1(t.transaction)}function YWe(t=dv()){return t("readonly",e=>{if(e.getAllKeys)return M1(e.getAllKeys());const r=[];return VWe(e,n=>r.push(n.key)).then(()=>r)})}const KWe="idb-keyval";var JWe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=die(t.dbName,t.storeName)),{name:KWe,options:t,async hasItem(i){return!(typeof await xW(r(i),n)>"u")},async getItem(i){return await xW(r(i),n)??null},setItem(i,a){return HWe(r(i),a,n)},removeItem(i){return GWe(r(i),n)},getKeys(){return YWe(n)},clear(){return qWe(n)}}};const ZWe="WALLET_CONNECT_V2_INDEXED_DB",QWe="keyvaluestorage";let XWe=class{constructor(){this.indexedDb=WWe({driver:JWe({dbName:ZWe,storeName:QWe})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Wd(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var _S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},D6={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof _S<"u"&&_S.localStorage?D6.exports=_S.localStorage:typeof window<"u"&&window.localStorage?D6.exports=window.localStorage:D6.exports=new e})();function eHe(t){var e;return[t[0],t1((e=t[1])!=null?e:"")]}let tHe=class{constructor(){this.localStorage=D6.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(eHe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return t1(r)}async setItem(e,r){this.localStorage.setItem(e,Wd(r))}async removeItem(e){this.localStorage.removeItem(e)}};const rHe="wc_storage_version",EW=1,nHe=async(t,e,r)=>{const n=rHe,i=await e.getItem(n);if(i&&i>=EW){r(e);return}const a=await t.getKeys();if(!a.length){r(e);return}const s=[];for(;a.length;){const o=a.shift();if(!o)continue;const l=o.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const c=await t.getItem(o);await e.setItem(o,c),s.push(o)}}await e.setItem(n,EW),r(e),iHe(t,s)},iHe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let aHe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new tHe;this.storage=e;try{const r=new XWe;nHe(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};function sHe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var oHe=lHe;function lHe(t,e,r){var n=r&&r.stringify||sHe,i=1;if(typeof t=="object"&&t!==null){var a=e.length+i;if(a===1)return t;var s=new Array(a);s[0]=n(t);for(var o=1;o-1?f:0,t.charCodeAt(g+1)){case 100:case 102:if(u>=l||e[u]==null)break;f=l||e[u]==null)break;f=l||e[u]===void 0)break;f",f=g+2,g++;break}c+=n(e[u]),f=g+2,g++;break;case 115:if(u>=l)break;f-1&&(a=!1);const s=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const o=t.level||"info",l=Object.create(r);l.log||(l.log=J3),Object.defineProperty(l,"levelVal",{get:u}),Object.defineProperty(l,"level",{get:f,set:h});const c={transmit:e,serialize:i,asObject:t.browser.asObject,levels:s,timestamp:gHe(t)};l.levels=gu.levels,l.level=o,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=J3,l.serializers=n,l._serialize=i,l._stdErrSerialize=a,l.child=g,e&&(l._logEvent=fT());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function f(){return this._level}function h(m){if(m!=="silent"&&!this.levels.values[m])throw Error("unknown level "+m);this._level=m,yp(c,l,"error","log"),yp(c,l,"fatal","error"),yp(c,l,"warn","error"),yp(c,l,"info","log"),yp(c,l,"debug","log"),yp(c,l,"trace","log")}function g(m,w){if(!m)throw new Error("missing bindings for child Pino");w=w||{},i&&m.serializers&&(w.serializers=m.serializers);const _=w.serializers;if(i&&_){var v=Object.assign({},n,_),b=t.browser.serialize===!0?Object.keys(v):i;delete m.serializers,Qx([m],b,v,this._stdErrSerialize)}function A(S){this._childLevel=(S._childLevel|0)+1,this.error=wp(S,m,"error"),this.fatal=wp(S,m,"fatal"),this.warn=wp(S,m,"warn"),this.info=wp(S,m,"info"),this.debug=wp(S,m,"debug"),this.trace=wp(S,m,"trace"),v&&(this.serializers=v,this._serialize=b),e&&(this._logEvent=fT([].concat(S._logEvent.bindings,m)))}return A.prototype=this,new A(this)}return l}gu.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};gu.stdSerializers=cHe;gu.stdTimeFunctions=Object.assign({},{nullTime:fie,epochTime:hie,unixTime:mHe,isoTime:yHe});function yp(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?J3:i[r]?i[r]:K3[r]||K3[n]||J3,dHe(t,e,r)}function dHe(t,e,r){!t.transmit&&e[r]===J3||(e[r]=function(n){return function(){const a=t.timestamp(),s=new Array(arguments.length),o=Object.getPrototypeOf&&Object.getPrototypeOf(this)===K3?K3:this;for(var l=0;l-1&&a in r&&(t[i][a]=r[a](t[i][a]))}function wp(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;ithis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},pie=class{constructor(e,r=Cj){this.level=e??"error",this.levelValue=Ap.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new CW(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===Ap.levels.values.error?console.error(e):r===Ap.levels.values.warn?console.warn(e):r===Ap.levels.values.debug?console.debug(e):r===Ap.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Wd({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new CW(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Wd({extraMetadata:e})),new Blob(r,{type:"application/json"})}},xHe=class{constructor(e,r=Cj){this.baseChunkLogger=new pie(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},EHe=class{constructor(e,r=Cj){this.baseChunkLogger=new pie(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var _He=Object.defineProperty,CHe=Object.defineProperties,SHe=Object.getOwnPropertyDescriptors,SW=Object.getOwnPropertySymbols,AHe=Object.prototype.hasOwnProperty,IHe=Object.prototype.propertyIsEnumerable,AW=(t,e,r)=>e in t?_He(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,f8=(t,e)=>{for(var r in e||(e={}))AHe.call(e,r)&&AW(t,r,e[r]);if(SW)for(var r of SW(e))IHe.call(e,r)&&AW(t,r,e[r]);return t},h8=(t,e)=>CHe(t,SHe(e));function Xx(t){return h8(f8({},t),{level:(t==null?void 0:t.level)||vHe.level})}function MHe(t,e=hv){return t[e]||""}function THe(t,e,r=hv){return t[r]=e,t}function Zs(t,e=hv){let r="";return typeof t.bindings>"u"?r=MHe(t,e):r=t.bindings().context||"",r}function kHe(t,e,r=hv){const n=Zs(t,r);return n.trim()?`${n}/${e}`:e}function ms(t,e,r=hv){const n=kHe(t,e,r),i=t.child({context:n});return THe(i,n,r)}function NHe(t){var e,r;const n=new xHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:fv(h8(f8({},t.opts),{level:"trace",browser:h8(f8({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function LHe(t){var e;const r=new EHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:fv(h8(f8({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function jHe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?NHe(t):LHe(t)}let $He=class extends I1{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},PHe=class extends I1{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},RHe=class{constructor(e,r){this.logger=e,this.core=r}},DHe=class extends I1{constructor(e,r){super(),this.relayer=e,this.logger=r}},OHe=class extends I1{constructor(e){super()}},FHe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},UHe=class extends I1{constructor(e,r){super(),this.relayer=e,this.logger=r}},BHe=class extends I1{constructor(e,r){super(),this.core=e,this.logger=r}},zHe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},WHe=class{constructor(e,r){this.projectId=e,this.logger=r}},HHe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},GHe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},qHe=class{constructor(e){this.client=e}};const VHe="PARSE_ERROR",YHe="INVALID_REQUEST",KHe="METHOD_NOT_FOUND",JHe="INVALID_PARAMS",gie="INTERNAL_ERROR",Sj="SERVER_ERROR",ZHe=[-32700,-32600,-32601,-32602,-32603],Py={[VHe]:{code:-32700,message:"Parse error"},[YHe]:{code:-32600,message:"Invalid Request"},[KHe]:{code:-32601,message:"Method not found"},[JHe]:{code:-32602,message:"Invalid params"},[gie]:{code:-32603,message:"Internal error"},[Sj]:{code:-32e3,message:"Server error"}},mie=Sj;function QHe(t){return ZHe.includes(t)}function IW(t){return Object.keys(Py).includes(t)?Py[t]:Py[mie]}function XHe(t){const e=Object.values(Py).find(r=>r.code===t);return e||Py[mie]}function yie(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var wie={};/*! ***************************************************************************** + Approved: ${h.toString()}`))}),s.forEach(f=>{n||(S0(i[f].methods,a[f].methods)?S0(i[f].events,a[f].events)||(n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${f}`)):n=ht("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${f}`))}),n}function VWe(t){const e={};return Object.keys(t).forEach(r=>{var n;r.includes(":")?e[r]=t[r]:(n=t[r].chains)==null||n.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}function TW(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function YWe(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const n=Hm(t[r].accounts);n==null||n.forEach(i=>{e[i]={accounts:t[r].accounts.filter(a=>a.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function KWe(t,e){return $j(t)&&t<=e.max&&t>=e.min}function kW(){const t=mv();return new Promise(e=>{switch(t){case _o.browser:e(JWe());break;case _o.reactNative:e(QWe());break;case _o.node:e(ZWe());break;default:e(!0)}})}function JWe(){return gv()&&(navigator==null?void 0:navigator.onLine)}async function QWe(){if(jh()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t==null?void 0:t.isConnected}return!0}function ZWe(){return!0}function XWe(t){switch(mv()){case _o.browser:eHe(t);break;case _o.reactNative:tHe(t);break}}function eHe(t){!jh()&&gv()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function tHe(t){jh()&&typeof global<"u"&&global!=null&&global.NetInfo&&(global==null||global.NetInfo.addEventListener(e=>t(e==null?void 0:e.isConnected)))}const kS={};class V2{static get(e){return kS[e]}static set(e,r){kS[e]=r}static delete(e){delete kS[e]}}class $1{}let rHe=class extends $1{constructor(e){super()}};const NW=ct.FIVE_SECONDS,Gm={pulse:"heartbeat_pulse"};let nHe=class Lie extends rHe{constructor(e){super(e),this.events=new ys.EventEmitter,this.interval=NW,this.interval=(e==null?void 0:e.interval)||NW}static async init(e){const r=new Lie(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),ct.toMiliseconds(this.interval))}pulse(){this.events.emit(Gm.pulse)}};function iHe(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Hi(t,...e){try{return iHe(t(...e))}catch(r){return Promise.reject(r)}}function aHe(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function sHe(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function G6(t){if(aHe(t))return String(t);if(sHe(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return G6(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}const ET="base64:";function oHe(t){return typeof t=="string"?t:ET+uHe(t)}function lHe(t){return typeof t!="string"||!t.startsWith(ET)?t:cHe(t.slice(ET.length))}function cHe(t){return globalThis.Buffer?Buffer.from(t,"base64"):Uint8Array.from(globalThis.atob(t),e=>e.codePointAt(0))}function uHe(t){return globalThis.Buffer?Buffer.from(t).toString("base64"):globalThis.btoa(String.fromCodePoint(...t))}function Ns(t){var e;return t&&((e=t.split("?")[0])==null?void 0:e.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""))||""}function dHe(...t){return Ns(t.join(":"))}function F4(t){return t=Ns(t),t?t+":":""}const fHe="memory",hHe=()=>{const t=new Map;return{name:fHe,getInstance:()=>t,hasItem(e){return t.has(e)},getItem(e){return t.get(e)??null},getItemRaw(e){return t.get(e)??null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return[...t.keys()]},clear(){t.clear()},dispose(){t.clear()}}};function pHe(t={}){const e={mounts:{"":t.driver||hHe()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=c=>{for(const u of e.mountpoints)if(c.startsWith(u))return{base:u,relativeKey:c.slice(u.length),driver:e.mounts[u]};return{base:"",relativeKey:c,driver:e.mounts[""]}},n=(c,u)=>e.mountpoints.filter(f=>f.startsWith(c)||u&&c.startsWith(f)).map(f=>({relativeBase:c.length>f.length?c.slice(f.length):void 0,mountpoint:f,driver:e.mounts[f]})),i=(c,u)=>{if(e.watching){u=Ns(u);for(const f of e.watchListeners)f(c,u)}},a=async()=>{if(!e.watching){e.watching=!0;for(const c in e.mounts)e.unwatch[c]=await LW(e.mounts[c],i,c)}},s=async()=>{if(e.watching){for(const c in e.unwatch)await e.unwatch[c]();e.unwatch={},e.watching=!1}},o=(c,u,f)=>{const h=new Map,g=m=>{let w=h.get(m.base);return w||(w={driver:m.driver,base:m.base,items:[]},h.set(m.base,w)),w};for(const m of c){const w=typeof m=="string",C=Ns(w?m:m.key),v=w?void 0:m.value,b=w||!m.options?u:{...u,...m.options},A=r(C);g(A).items.push({key:C,value:v,relativeKey:A.relativeKey,options:b})}return Promise.all([...h.values()].map(m=>f(m))).then(m=>m.flat())},l={hasItem(c,u={}){c=Ns(c);const{relativeKey:f,driver:h}=r(c);return Hi(h.hasItem,f,u)},getItem(c,u={}){c=Ns(c);const{relativeKey:f,driver:h}=r(c);return Hi(h.getItem,f,u).then(g=>dy(g))},getItems(c,u={}){return o(c,u,f=>f.driver.getItems?Hi(f.driver.getItems,f.items.map(h=>({key:h.relativeKey,options:h.options})),u).then(h=>h.map(g=>({key:dHe(f.base,g.key),value:dy(g.value)}))):Promise.all(f.items.map(h=>Hi(f.driver.getItem,h.relativeKey,h.options).then(g=>({key:h.key,value:dy(g)})))))},getItemRaw(c,u={}){c=Ns(c);const{relativeKey:f,driver:h}=r(c);return h.getItemRaw?Hi(h.getItemRaw,f,u):Hi(h.getItem,f,u).then(g=>lHe(g))},async setItem(c,u,f={}){if(u===void 0)return l.removeItem(c);c=Ns(c);const{relativeKey:h,driver:g}=r(c);g.setItem&&(await Hi(g.setItem,h,G6(u),f),g.watch||i("update",c))},async setItems(c,u){await o(c,u,async f=>{if(f.driver.setItems)return Hi(f.driver.setItems,f.items.map(h=>({key:h.relativeKey,value:G6(h.value),options:h.options})),u);f.driver.setItem&&await Promise.all(f.items.map(h=>Hi(f.driver.setItem,h.relativeKey,G6(h.value),h.options)))})},async setItemRaw(c,u,f={}){if(u===void 0)return l.removeItem(c,f);c=Ns(c);const{relativeKey:h,driver:g}=r(c);if(g.setItemRaw)await Hi(g.setItemRaw,h,u,f);else if(g.setItem)await Hi(g.setItem,h,oHe(u),f);else return;g.watch||i("update",c)},async removeItem(c,u={}){typeof u=="boolean"&&(u={removeMeta:u}),c=Ns(c);const{relativeKey:f,driver:h}=r(c);h.removeItem&&(await Hi(h.removeItem,f,u),(u.removeMeta||u.removeMata)&&await Hi(h.removeItem,f+"$",u),h.watch||i("remove",c))},async getMeta(c,u={}){typeof u=="boolean"&&(u={nativeOnly:u}),c=Ns(c);const{relativeKey:f,driver:h}=r(c),g=Object.create(null);if(h.getMeta&&Object.assign(g,await Hi(h.getMeta,f,u)),!u.nativeOnly){const m=await Hi(h.getItem,f+"$",u).then(w=>dy(w));m&&typeof m=="object"&&(typeof m.atime=="string"&&(m.atime=new Date(m.atime)),typeof m.mtime=="string"&&(m.mtime=new Date(m.mtime)),Object.assign(g,m))}return g},setMeta(c,u,f={}){return this.setItem(c+"$",u,f)},removeMeta(c,u={}){return this.removeItem(c+"$",u)},async getKeys(c,u={}){c=F4(c);const f=n(c,!0);let h=[];const g=[];for(const m of f){const w=await Hi(m.driver.getKeys,m.relativeBase,u);for(const C of w){const v=m.mountpoint+Ns(C);h.some(b=>v.startsWith(b))||g.push(v)}h=[m.mountpoint,...h.filter(C=>!C.startsWith(m.mountpoint))]}return c?g.filter(m=>m.startsWith(c)&&m[m.length-1]!=="$"):g.filter(m=>m[m.length-1]!=="$")},async clear(c,u={}){c=F4(c),await Promise.all(n(c,!1).map(async f=>{if(f.driver.clear)return Hi(f.driver.clear,f.relativeBase,u);if(f.driver.removeItem){const h=await f.driver.getKeys(f.relativeBase||"",u);return Promise.all(h.map(g=>f.driver.removeItem(g,u)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(c=>jW(c)))},async watch(c){return await a(),e.watchListeners.push(c),async()=>{e.watchListeners=e.watchListeners.filter(u=>u!==c),e.watchListeners.length===0&&await s()}},async unwatch(){e.watchListeners=[],await s()},mount(c,u){if(c=F4(c),c&&e.mounts[c])throw new Error(`already mounted at ${c}`);return c&&(e.mountpoints.push(c),e.mountpoints.sort((f,h)=>h.length-f.length)),e.mounts[c]=u,e.watching&&Promise.resolve(LW(u,i,c)).then(f=>{e.unwatch[c]=f}).catch(console.error),l},async unmount(c,u=!0){var f,h;c=F4(c),!(!c||!e.mounts[c])&&(e.watching&&c in e.unwatch&&((h=(f=e.unwatch)[c])==null||h.call(f),delete e.unwatch[c]),u&&await jW(e.mounts[c]),e.mountpoints=e.mountpoints.filter(g=>g!==c),delete e.mounts[c])},getMount(c=""){c=Ns(c)+":";const u=r(c);return{driver:u.driver,base:u.base}},getMounts(c="",u={}){return c=Ns(c),n(c,u.parents).map(h=>({driver:h.driver,base:h.mountpoint}))},keys:(c,u={})=>l.getKeys(c,u),get:(c,u={})=>l.getItem(c,u),set:(c,u,f={})=>l.setItem(c,u,f),has:(c,u={})=>l.hasItem(c,u),del:(c,u={})=>l.removeItem(c,u),remove:(c,u={})=>l.removeItem(c,u)};return l}function LW(t,e,r){return t.watch?t.watch((n,i)=>e(n,r+i)):()=>{}}async function jW(t){typeof t.dispose=="function"&&await Hi(t.dispose)}function P1(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function jie(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const n=P1(r);return(i,a)=>n.then(s=>a(s.transaction(e,i).objectStore(e)))}let NS;function vv(){return NS||(NS=jie("keyval-store","keyval")),NS}function $W(t,e=vv()){return e("readonly",r=>P1(r.get(t)))}function gHe(t,e,r=vv()){return r("readwrite",n=>(n.put(e,t),P1(n.transaction)))}function mHe(t,e=vv()){return e("readwrite",r=>(r.delete(t),P1(r.transaction)))}function yHe(t=vv()){return t("readwrite",e=>(e.clear(),P1(e.transaction)))}function wHe(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},P1(t.transaction)}function vHe(t=vv()){return t("readonly",e=>{if(e.getAllKeys)return P1(e.getAllKeys());const r=[];return wHe(e,n=>r.push(n.key)).then(()=>r)})}const bHe="idb-keyval";var xHe=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=i=>e+i;let n;return t.dbName&&t.storeName&&(n=jie(t.dbName,t.storeName)),{name:bHe,options:t,async hasItem(i){return!(typeof await $W(r(i),n)>"u")},async getItem(i){return await $W(r(i),n)??null},setItem(i,a){return gHe(r(i),a,n)},removeItem(i){return mHe(r(i),n)},getKeys(){return vHe(n)},clear(){return yHe(n)}}};const EHe="WALLET_CONNECT_V2_INDEXED_DB",_He="keyvaluestorage";let CHe=class{constructor(){this.indexedDb=pHe({driver:xHe({dbName:EHe,storeName:_He})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Kd(r))}async removeItem(e){await this.indexedDb.removeItem(e)}};var LS=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},q6={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,n){this[r]=String(n)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(n){r[n]=void 0,delete r[n]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof LS<"u"&&LS.localStorage?q6.exports=LS.localStorage:typeof window<"u"&&window.localStorage?q6.exports=window.localStorage:q6.exports=new e})();function SHe(t){var e;return[t[0],l1((e=t[1])!=null?e:"")]}let AHe=class{constructor(){this.localStorage=q6.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(SHe)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return l1(r)}async setItem(e,r){this.localStorage.setItem(e,Kd(r))}async removeItem(e){this.localStorage.removeItem(e)}};const IHe="wc_storage_version",PW=1,MHe=async(t,e,r)=>{const n=IHe,i=await e.getItem(n);if(i&&i>=PW){r(e);return}const a=await t.getKeys();if(!a.length){r(e);return}const s=[];for(;a.length;){const o=a.shift();if(!o)continue;const l=o.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const c=await t.getItem(o);await e.setItem(o,c),s.push(o)}}await e.setItem(n,PW),r(e),THe(t,s)},THe=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};let kHe=class{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new AHe;this.storage=e;try{const r=new CHe;MHe(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}};function NHe(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var LHe=jHe;function jHe(t,e,r){var n=r&&r.stringify||NHe,i=1;if(typeof t=="object"&&t!==null){var a=e.length+i;if(a===1)return t;var s=new Array(a);s[0]=n(t);for(var o=1;o-1?f:0,t.charCodeAt(g+1)){case 100:case 102:if(u>=l||e[u]==null)break;f=l||e[u]==null)break;f=l||e[u]===void 0)break;f",f=g+2,g++;break}c+=n(e[u]),f=g+2,g++;break;case 115:if(u>=l)break;f-1&&(a=!1);const s=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const o=t.level||"info",l=Object.create(r);l.log||(l.log=aw),Object.defineProperty(l,"levelVal",{get:u}),Object.defineProperty(l,"level",{get:f,set:h});const c={transmit:e,serialize:i,asObject:t.browser.asObject,levels:s,timestamp:UHe(t)};l.levels=bu.levels,l.level=o,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=aw,l.serializers=n,l._serialize=i,l._stdErrSerialize=a,l.child=g,e&&(l._logEvent=_T());function u(){return this.level==="silent"?1/0:this.levels.values[this.level]}function f(){return this._level}function h(m){if(m!=="silent"&&!this.levels.values[m])throw Error("unknown level "+m);this._level=m,Cp(c,l,"error","log"),Cp(c,l,"fatal","error"),Cp(c,l,"warn","error"),Cp(c,l,"info","log"),Cp(c,l,"debug","log"),Cp(c,l,"trace","log")}function g(m,w){if(!m)throw new Error("missing bindings for child Pino");w=w||{},i&&m.serializers&&(w.serializers=m.serializers);const C=w.serializers;if(i&&C){var v=Object.assign({},n,C),b=t.browser.serialize===!0?Object.keys(v):i;delete m.serializers,o7([m],b,v,this._stdErrSerialize)}function A(S){this._childLevel=(S._childLevel|0)+1,this.error=Sp(S,m,"error"),this.fatal=Sp(S,m,"fatal"),this.warn=Sp(S,m,"warn"),this.info=Sp(S,m,"info"),this.debug=Sp(S,m,"debug"),this.trace=Sp(S,m,"trace"),v&&(this.serializers=v,this._serialize=b),e&&(this._logEvent=_T([].concat(S._logEvent.bindings,m)))}return A.prototype=this,new A(this)}return l}bu.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}};bu.stdSerializers=$He;bu.stdTimeFunctions=Object.assign({},{nullTime:$ie,epochTime:Pie,unixTime:BHe,isoTime:zHe});function Cp(t,e,r,n){const i=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?aw:i[r]?i[r]:iw[r]||iw[n]||aw,RHe(t,e,r)}function RHe(t,e,r){!t.transmit&&e[r]===aw||(e[r]=function(n){return function(){const a=t.timestamp(),s=new Array(arguments.length),o=Object.getPrototypeOf&&Object.getPrototypeOf(this)===iw?iw:this;for(var l=0;l-1&&a in r&&(t[i][a]=r[a](t[i][a]))}function Sp(t,e,r){return function(){const n=new Array(1+arguments.length);n[0]=e;for(var i=1;ithis.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}},Rie=class{constructor(e,r=Pj){this.level=e??"error",this.levelValue=jp.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new DW(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===jp.levels.values.error?console.error(e):r===jp.levels.values.warn?console.warn(e):r===jp.levels.values.debug?console.debug(e):r===jp.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Kd({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new DW(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Kd({extraMetadata:e})),new Blob(r,{type:"application/json"})}},qHe=class{constructor(e,r=Pj){this.baseChunkLogger=new Rie(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),n=document.createElement("a");n.href=r,n.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}},VHe=class{constructor(e,r=Pj){this.baseChunkLogger=new Rie(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}};var YHe=Object.defineProperty,KHe=Object.defineProperties,JHe=Object.getOwnPropertyDescriptors,OW=Object.getOwnPropertySymbols,QHe=Object.prototype.hasOwnProperty,ZHe=Object.prototype.propertyIsEnumerable,FW=(t,e,r)=>e in t?YHe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x8=(t,e)=>{for(var r in e||(e={}))QHe.call(e,r)&&FW(t,r,e[r]);if(OW)for(var r of OW(e))ZHe.call(e,r)&&FW(t,r,e[r]);return t},E8=(t,e)=>KHe(t,JHe(e));function l7(t){return E8(x8({},t),{level:(t==null?void 0:t.level)||HHe.level})}function XHe(t,e=xv){return t[e]||""}function eGe(t,e,r=xv){return t[r]=e,t}function eo(t,e=xv){let r="";return typeof t.bindings>"u"?r=XHe(t,e):r=t.bindings().context||"",r}function tGe(t,e,r=xv){const n=eo(t,r);return n.trim()?`${n}/${e}`:e}function ws(t,e,r=xv){const n=tGe(t,e,r),i=t.child({context:n});return eGe(i,n,r)}function rGe(t){var e,r;const n=new qHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:bv(E8(x8({},t.opts),{level:"trace",browser:E8(x8({},(r=t.opts)==null?void 0:r.browser),{write:i=>n.write(i)})})),chunkLoggerController:n}}function nGe(t){var e;const r=new VHe((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:bv(E8(x8({},t.opts),{level:"trace"}),r),chunkLoggerController:r}}function iGe(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?rGe(t):nGe(t)}let aGe=class extends $1{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}},sGe=class extends $1{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}},oGe=class{constructor(e,r){this.logger=e,this.core=r}},lGe=class extends $1{constructor(e,r){super(),this.relayer=e,this.logger=r}},cGe=class extends $1{constructor(e){super()}},uGe=class{constructor(e,r,n,i){this.core=e,this.logger=r,this.name=n}},dGe=class extends $1{constructor(e,r){super(),this.relayer=e,this.logger=r}},fGe=class extends $1{constructor(e,r){super(),this.core=e,this.logger=r}},hGe=class{constructor(e,r,n){this.core=e,this.logger=r,this.store=n}},pGe=class{constructor(e,r){this.projectId=e,this.logger=r}},gGe=class{constructor(e,r,n){this.core=e,this.logger=r,this.telemetryEnabled=n}},mGe=class{constructor(e){this.opts=e,this.protocol="wc",this.version=2}},yGe=class{constructor(e){this.client=e}};const wGe="PARSE_ERROR",vGe="INVALID_REQUEST",bGe="METHOD_NOT_FOUND",xGe="INVALID_PARAMS",Die="INTERNAL_ERROR",Rj="SERVER_ERROR",EGe=[-32700,-32600,-32601,-32602,-32603],Hy={[wGe]:{code:-32700,message:"Parse error"},[vGe]:{code:-32600,message:"Invalid Request"},[bGe]:{code:-32601,message:"Method not found"},[xGe]:{code:-32602,message:"Invalid params"},[Die]:{code:-32603,message:"Internal error"},[Rj]:{code:-32e3,message:"Server error"}},Oie=Rj;function _Ge(t){return EGe.includes(t)}function UW(t){return Object.keys(Hy).includes(t)?Hy[t]:Hy[Oie]}function CGe(t){const e=Object.values(Hy).find(r=>r.code===t);return e||Hy[Oie]}function Fie(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Uie={};/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -189,23 +189,23 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var hT=function(t,e){return hT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},hT(t,e)};function eGe(t,e){hT(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var pT=function(){return pT=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function nGe(t,e){return function(r,n){e(r,n,t)}}function iGe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function aGe(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function sGe(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function vie(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function cGe(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(a[0][3],m)}}function l(h){h.value instanceof Z3?Promise.resolve(h.value.v).then(c,u):f(a[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),a.shift(),a.length&&o(a[0][0],a[0][1])}}function fGe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(s){return(r=!r)?{value:Z3(t[i](s)),done:i==="return"}:a?a(s):s}:a}}function hGe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof gT=="function"?gT(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,l){s=t[a](s),i(o,l,s.done,s.value)})}}function i(a,s,o,l){Promise.resolve(l).then(function(c){a({value:c,done:o})},s)}}function pGe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function gGe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function mGe(t){return t&&t.__esModule?t:{default:t}}function yGe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function wGe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const vGe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return pT},__asyncDelegator:fGe,__asyncGenerator:dGe,__asyncValues:hGe,__await:Z3,__awaiter:aGe,__classPrivateFieldGet:yGe,__classPrivateFieldSet:wGe,__createBinding:oGe,__decorate:rGe,__exportStar:lGe,__extends:eGe,__generator:sGe,__importDefault:mGe,__importStar:gGe,__makeTemplateObject:pGe,__metadata:iGe,__param:nGe,__read:vie,__rest:tGe,__spread:cGe,__spreadArrays:uGe,__values:gT},Symbol.toStringTag,{value:"Module"})),bGe=fh(vGe);var Qu={},MW;function xGe(){if(MW)return Qu;MW=1,Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.isBrowserCryptoAvailable=Qu.getSubtleCrypto=Qu.getBrowerCrypto=void 0;function t(){return(Xt==null?void 0:Xt.crypto)||(Xt==null?void 0:Xt.msCrypto)||{}}Qu.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}Qu.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Qu.isBrowserCryptoAvailable=r,Qu}var Xu={},TW;function EGe(){if(TW)return Xu;TW=1,Object.defineProperty(Xu,"__esModule",{value:!0}),Xu.isBrowser=Xu.isNode=Xu.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Xu.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Xu.isNode=e;function r(){return!t()&&!e()}return Xu.isBrowser=r,Xu}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=bGe;e.__exportStar(xGe(),t),e.__exportStar(EGe(),t)})(wie);function sd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function v0(t=6){return BigInt(sd(t))}function Df(t,e,r){return{id:r||sd(),jsonrpc:"2.0",method:t,params:e}}function e7(t,e){return{id:t,jsonrpc:"2.0",result:e}}function t7(t,e,r){return{id:t,jsonrpc:"2.0",error:_Ge(e)}}function _Ge(t,e){return typeof t>"u"?IW(gie):(typeof t=="string"&&(t=Object.assign(Object.assign({},IW(Sj)),{message:t})),QHe(t.code)&&(t=XHe(t.code)),t)}let CGe=class{},SGe=class extends CGe{constructor(){super()}},AGe=class extends SGe{constructor(e){super()}};const IGe="^https?:",MGe="^wss?:";function TGe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function bie(t,e){const r=TGe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function kW(t){return bie(t,IGe)}function NW(t){return bie(t,MGe)}function kGe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function xie(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Aj(t){return xie(t)&&"method"in t}function r7(t){return xie(t)&&(Gc(t)||tl(t))}function Gc(t){return"result"in t}function tl(t){return"error"in t}let Sl=class extends AGe{constructor(e){super(e),this.events=new gs.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Df(e.method,e.params||[],e.id||v0().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{tl(a)?i(a.error):n(a.result)});try{await this.connection.send(e,r)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),r7(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const NGe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),LGe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",LW=t=>t.split("?")[0],jW=10,jGe=NGe();let $Ge=class{constructor(e){if(this.url=e,this.events=new gs.EventEmitter,this.registering=!1,!NW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Wd(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!NW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=wie.isReactNative()?void 0:{rejectUnauthorized:!kGe(e)},a=new jGe(e,[],i);LGe()?a.onerror=s=>{const o=s;n(this.emitError(o.error))}:a.on("error",s=>{n(this.emitError(s))}),a.onopen=()=>{this.onOpen(a),r(a)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?t1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=t7(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return yie(e,LW(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>jW&&this.events.setMaxListeners(jW)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${LW(this.url)}`));return this.events.emit("register_error",r),r}};var p8={exports:{}};p8.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,o="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Function]",m="[object GeneratorFunction]",w="[object Map]",_="[object Number]",v="[object Null]",b="[object Object]",A="[object Promise]",S="[object Proxy]",j="[object RegExp]",U="[object Set]",I="[object String]",B="[object Symbol]",V="[object Undefined]",se="[object WeakMap]",Y="[object ArrayBuffer]",N="[object DataView]",k="[object Float32Array]",x="[object Float64Array]",E="[object Int8Array]",L="[object Int16Array]",O="[object Int32Array]",P="[object Uint8Array]",R="[object Uint8ClampedArray]",M="[object Uint16Array]",D="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,H={};H[k]=H[x]=H[E]=H[L]=H[O]=H[P]=H[R]=H[M]=H[D]=!0,H[o]=H[l]=H[Y]=H[u]=H[N]=H[f]=H[h]=H[g]=H[w]=H[_]=H[b]=H[j]=H[U]=H[I]=H[se]=!1;var ee=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,J=typeof self=="object"&&self&&self.Object===Object&&self,te=ee||J||Function("return this")(),re=e&&!e.nodeType&&e,z=re&&!0&&t&&!t.nodeType&&t,G=z&&z.exports===re,Z=G&&ee.process,me=function(){try{return Z&&Z.binding&&Z.binding("util")}catch{}}(),be=me&&me.isTypedArray;function Ce(ge,Te){for(var Xe=-1,It=ge==null?0:ge.length,yn=0,gr=[];++Xe-1}function ue(ge,Te){var Xe=this.__data__,It=Ic(Xe,ge);return It<0?(++this.size,Xe.push([ge,Te])):Xe[It][1]=Te,this}cr.prototype.clear=br,cr.prototype.delete=Q,cr.prototype.get=ae,cr.prototype.has=de,cr.prototype.set=ue;function ve(ge){var Te=-1,Xe=ge==null?0:ge.length;for(this.clear();++Teyi))return!1;var wn=gr.get(ge);if(wn&&gr.get(Te))return wn==Te;var ci=-1,vs=!0,wi=Xe&a?new Lt:void 0;for(gr.set(ge,Te),gr.set(Te,ge);++ci-1&&ge%1==0&&ge-1&&ge%1==0&&ge<=s}function Kv(ge){var Te=typeof ge;return ge!=null&&(Te=="object"||Te=="function")}function Rh(ge){return ge!=null&&typeof ge=="object"}var Jv=be?lt(be):Dv;function fE(ge){return uE(ge)?Qs(ge):Ov(ge)}function mn(){return[]}function fn(){return!1}t.exports=dE})(p8,p8.exports);var PGe=p8.exports;const RGe=To(PGe),Eie="wc",_ie=2,g8="core",Cu=`${Eie}@2:${g8}:`,DGe={name:g8,logger:"error"},OGe={database:":memory:"},FGe="crypto",$W="client_ed25519_seed",UGe=ct.ONE_DAY,BGe="keychain",zGe="0.3",WGe="messages",HGe="0.3",PW=ct.SIX_HOURS,GGe="publisher",Cie="irn",qGe="error",Sie="wss://relay.walletconnect.org",VGe="relayer",Zi={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},YGe="_subscription",Jo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},KGe=.1,mT="2.17.3",Cn={link_mode:"link_mode",relay:"relay"},JGe="0.3",ZGe="WALLETCONNECT_CLIENT_ID",RW="WALLETCONNECT_LINK_MODE_APPS",oo={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},QGe="subscription",XGe="0.3",eqe=ct.FIVE_SECONDS*1e3,tqe="pairing",rqe="0.3",U2={wc_pairingDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:0},res:{ttl:ct.ONE_DAY,prompt:!1,tag:0}}},u0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Ol={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},nqe="history",iqe="0.3",aqe="expirer",Xo={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},sqe="0.3",oqe="verify-api",lqe="https://verify.walletconnect.com",Aie="https://verify.walletconnect.org",Ry=Aie,cqe=`${Ry}/v3`,uqe=[lqe,Aie],dqe="echo",fqe="https://echo.walletconnect.com",Uc={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},td={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Fl={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Jh={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},Zh={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},B2={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},hqe=.1,pqe="event-client",gqe=86400,mqe="https://pulse.walletconnect.org/batch";function yqe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(A);v!==b;){for(var j=m[v],U=0,I=A-1;(j!==0||U<_)&&I!==-1;I--,U++)j+=256*S[I]>>>0,S[I]=j%o>>>0,j=j/o>>>0;if(j!==0)throw new Error("Non-zero carry");_=U,v++}for(var B=A-_;B!==A&&S[B]===0;)B++;for(var V=l.repeat(w);B>>0,A=new Uint8Array(b);m[w];){var S=r[m.charCodeAt(w)];if(S===255)return;for(var j=0,U=b-1;(S!==0||j>>0,A[U]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");v=j,w++}if(m[w]!==" "){for(var I=b-v;I!==b&&A[I]===0;)I++;for(var B=new Uint8Array(_+(b-I)),V=_;I!==b;)B[V++]=A[I++];return B}}}function g(m){var w=h(m);if(w)return w;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:g}}var wqe=yqe,vqe=wqe;const Iie=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")},bqe=t=>new TextEncoder().encode(t),xqe=t=>new TextDecoder().decode(t);class Eqe{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 _qe{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 Mie(this,e)}}class Cqe{constructor(e){this.decoders=e}or(e){return Mie(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 Mie=(t,e)=>new Cqe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Sqe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Eqe(e,r,n),this.decoder=new _qe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const n7=({name:t,prefix:e,encode:r,decode:n})=>new Sqe(t,e,r,n),pv=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=vqe(r,e);return n7({prefix:t,name:e,encode:n,decode:a=>Iie(i(a))})},Aqe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,s[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return s},Iqe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<n7({prefix:e,name:t,encode(i){return Iqe(i,n,r)},decode(i){return Aqe(i,n,r,t)}}),Mqe=n7({prefix:"\0",name:"identity",encode:t=>xqe(t),decode:t=>bqe(t)});var Tqe=Object.freeze({__proto__:null,identity:Mqe});const kqe=Ea({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Nqe=Object.freeze({__proto__:null,base2:kqe});const Lqe=Ea({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var jqe=Object.freeze({__proto__:null,base8:Lqe});const $qe=pv({prefix:"9",name:"base10",alphabet:"0123456789"});var Pqe=Object.freeze({__proto__:null,base10:$qe});const Rqe=Ea({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Dqe=Ea({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Oqe=Object.freeze({__proto__:null,base16:Rqe,base16upper:Dqe});const Fqe=Ea({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Uqe=Ea({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Bqe=Ea({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),zqe=Ea({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Wqe=Ea({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Hqe=Ea({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Gqe=Ea({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),qqe=Ea({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Vqe=Ea({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Yqe=Object.freeze({__proto__:null,base32:Fqe,base32upper:Uqe,base32pad:Bqe,base32padupper:zqe,base32hex:Wqe,base32hexupper:Hqe,base32hexpad:Gqe,base32hexpadupper:qqe,base32z:Vqe});const Kqe=pv({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Jqe=pv({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var Zqe=Object.freeze({__proto__:null,base36:Kqe,base36upper:Jqe});const Qqe=pv({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Xqe=pv({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var eVe=Object.freeze({__proto__:null,base58btc:Qqe,base58flickr:Xqe});const tVe=Ea({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),rVe=Ea({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),nVe=Ea({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),iVe=Ea({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var aVe=Object.freeze({__proto__:null,base64:tVe,base64pad:rVe,base64url:nVe,base64urlpad:iVe});const Tie=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),sVe=Tie.reduce((t,e,r)=>(t[r]=e,t),[]),oVe=Tie.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function lVe(t){return t.reduce((e,r)=>(e+=sVe[r],e),"")}function cVe(t){const e=[];for(const r of t){const n=oVe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const uVe=n7({prefix:"🚀",name:"base256emoji",encode:lVe,decode:cVe});var dVe=Object.freeze({__proto__:null,base256emoji:uVe}),fVe=kie,DW=128,hVe=127,pVe=~hVe,gVe=Math.pow(2,31);function kie(t,e,r){e=e||[],r=r||0;for(var n=r;t>=gVe;)e[r++]=t&255|DW,t/=128;for(;t&pVe;)e[r++]=t&255|DW,t>>>=7;return e[r]=t|0,kie.bytes=r-n+1,e}var mVe=yT,yVe=128,OW=127;function yT(t,n){var r=0,n=n||0,i=0,a=n,s,o=t.length;do{if(a>=o)throw yT.bytes=0,new RangeError("Could not decode varint");s=t[a++],r+=i<28?(s&OW)<=yVe);return yT.bytes=a-n,r}var wVe=Math.pow(2,7),vVe=Math.pow(2,14),bVe=Math.pow(2,21),xVe=Math.pow(2,28),EVe=Math.pow(2,35),_Ve=Math.pow(2,42),CVe=Math.pow(2,49),SVe=Math.pow(2,56),AVe=Math.pow(2,63),IVe=function(t){return t(Nie.encode(t,e,r),e),UW=t=>Nie.encodingLength(t),wT=(t,e)=>{const r=e.byteLength,n=UW(t),i=n+UW(r),a=new Uint8Array(i+r);return FW(t,a,0),FW(r,a,n),a.set(e,i),new TVe(t,r,e,a)};let TVe=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const Lie=({name:t,code:e,encode:r})=>new kVe(t,e,r);let kVe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?wT(this.code,r):r.then(n=>wT(this.code,n))}else throw Error("Unknown type, must be binary type")}};const jie=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),NVe=Lie({name:"sha2-256",code:18,encode:jie("SHA-256")}),LVe=Lie({name:"sha2-512",code:19,encode:jie("SHA-512")});var jVe=Object.freeze({__proto__:null,sha256:NVe,sha512:LVe});const $ie=0,$Ve="identity",Pie=Iie,PVe=t=>wT($ie,Pie(t)),RVe={code:$ie,name:$Ve,encode:Pie,digest:PVe};var DVe=Object.freeze({__proto__:null,identity:RVe});new TextEncoder,new TextDecoder;const BW={...Tqe,...Nqe,...jqe,...Pqe,...Oqe,...Yqe,...Zqe,...eVe,...aVe,...dVe};({...jVe,...DVe});function OVe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Rie(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const zW=Rie("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),SS=Rie("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=OVe(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:a}=ht("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=ms(r,this.name)}get context(){return Zs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Jne(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Zne(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}};class zVe{constructor(e,r,n){this.core=e,this.logger=r,this.name=FGe,this.randomSessionIdentifier=uT(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),a=Gz(i);return qne(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=Tze();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),s=Gz(a),o=this.randomSessionIdentifier;return await RBe(o,i,UGe,s)},this.generateSharedKey=(i,a,s)=>{this.isInitialized();const o=this.getPrivateKey(i),l=kze(o,a);return this.setSymKey(l,s)},this.setSymKey=async(i,a)=>{this.isInitialized();const s=a||P6(i);return await this.keychain.set(s,i),s},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,a,s)=>{this.isInitialized();const o=oie(s),l=Wd(a);if(sW(o))return Lze(l,s==null?void 0:s.encoding);if(aW(o)){const h=o.senderPublicKey,g=o.receiverPublicKey;i=await this.generateSharedKey(h,g)}const c=this.getSymKey(i),{type:u,senderPublicKey:f}=o;return Nze({type:u,symKey:c,message:l,senderPublicKey:f,encoding:s==null?void 0:s.encoding})},this.decode=async(i,a,s)=>{this.isInitialized();const o=Pze(a,s);if(sW(o)){const l=$ze(a,s==null?void 0:s.encoding);return t1(l)}if(aW(o)){const l=o.receiverPublicKey,c=o.senderPublicKey;i=await this.generateSharedKey(l,c)}try{const l=this.getSymKey(i),c=jze({symKey:l,encoded:a,encoding:s==null?void 0:s.encoding});return t1(c)}catch(l){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=(i,a=Rf)=>{const s=V3({encoded:i,encoding:a});return n1(s.type)},this.getPayloadSenderPublicKey=(i,a=Rf)=>{const s=V3({encoded:i,encoding:a});return s.senderPublicKey?ia(s.senderPublicKey,os):void 0},this.core=e,this.logger=ms(r,this.name),this.keychain=n||new BVe(this.core,this.logger)}get context(){return Zs(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get($W)}catch{e=uT(),await this.keychain.set($W,e)}return UVe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class WVe extends RHe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=WGe,this.version=HGe,this.initialized=!1,this.storagePrefix=Cu,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const a=gd(i);let s=this.messages.get(n);return typeof s>"u"&&(s={}),typeof s[a]<"u"||(s[a]=i,this.messages.set(n,s),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),s=gd(i);return typeof a[s]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=ms(e,this.name),this.core=r}get context(){return Zs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Jne(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Zne(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}var HVe=Object.defineProperty,GVe=Object.defineProperties,qVe=Object.getOwnPropertyDescriptors,WW=Object.getOwnPropertySymbols,VVe=Object.prototype.hasOwnProperty,YVe=Object.prototype.propertyIsEnumerable,HW=(t,e,r)=>e in t?HVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,GW=(t,e)=>{for(var r in e||(e={}))VVe.call(e,r)&&HW(t,r,e[r]);if(WW)for(var r of WW(e))YVe.call(e,r)&&HW(t,r,e[r]);return t},qW=(t,e)=>GVe(t,qVe(e));class KVe extends DHe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new gs.EventEmitter,this.name=GGe,this.queue=new Map,this.publishTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.initialPublishTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var s;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});const o=(a==null?void 0:a.ttl)||PW,l=u8(a),c=(a==null?void 0:a.prompt)||!1,u=(a==null?void 0:a.tag)||0,f=(a==null?void 0:a.id)||v0().toString(),h={topic:n,message:i,opts:{ttl:o,relay:l,prompt:c,tag:u,id:f,attestation:a==null?void 0:a.attestation}},g=`Failed to publish payload, please try again. id:${f} tag:${u}`;try{const m=new Promise(async w=>{const _=({id:b})=>{h.opts.id===b&&(this.removeRequestFromQueue(b),this.relayer.events.removeListener(Zi.publish,_),w(h))};this.relayer.events.on(Zi.publish,_);const v=Pf(new Promise((b,A)=>{this.rpcPublish({topic:n,message:i,ttl:o,prompt:c,tag:u,id:f,attestation:a==null?void 0:a.attestation}).then(b).catch(S=>{this.logger.warn(S,S==null?void 0:S.message),A(S)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${u}`);try{await v,this.events.removeListener(Zi.publish,_)}catch(b){this.queue.set(f,qW(GW({},h),{attempt:1})),this.logger.warn(b,b==null?void 0:b.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:n,message:i,opts:a}}),await Pf(m,this.publishTimeout,g)}catch(m){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(m),(s=a==null?void 0:a.internal)!=null&&s.throwOnFailedPublish)throw m}finally{this.queue.delete(f)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=ms(r,this.name),this.registerEventListeners()}get context(){return Zs(this.logger)}async rpcPublish(e){var r,n,i,a;const{topic:s,message:o,ttl:l=PW,prompt:c,tag:u,id:f,attestation:h}=e,g={method:ly(u8().protocol).publish,params:{topic:s,message:o,ttl:l,prompt:c,tag:u,attestation:h},id:f};Ps((r=g.params)==null?void 0:r.prompt)&&((n=g.params)==null||delete n.prompt),Ps((i=g.params)==null?void 0:i.tag)&&((a=g.params)==null||delete a.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g});const m=await this.relayer.request(g);return this.relayer.events.emit(Zi.publish,e),this.logger.debug("Successfully Published Payload"),m}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,r)=>{const n=e.attempt+1;this.queue.set(r,qW(GW({},e),{attempt:n}));const{topic:i,message:a,opts:s,attestation:o}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${n}`),await this.rpcPublish({topic:i,message:a,ttl:s.ttl,prompt:s.prompt,tag:s.tag,id:s.id,attestation:o}),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Dm.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Zi.connection_stalled);return}this.checkQueue()}),this.relayer.on(Zi.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class JVe{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(a=>a!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var ZVe=Object.defineProperty,QVe=Object.defineProperties,XVe=Object.getOwnPropertyDescriptors,VW=Object.getOwnPropertySymbols,eYe=Object.prototype.hasOwnProperty,tYe=Object.prototype.propertyIsEnumerable,YW=(t,e,r)=>e in t?ZVe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,z2=(t,e)=>{for(var r in e||(e={}))eYe.call(e,r)&&YW(t,r,e[r]);if(VW)for(var r of VW(e))tYe.call(e,r)&&YW(t,r,e[r]);return t},AS=(t,e)=>QVe(t,XVe(e));class rYe extends UHe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new JVe,this.events=new gs.EventEmitter,this.name=QGe,this.version=XGe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Cu,this.subscribeTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.initialSubscribeTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const a=u8(i),s={topic:n,relay:a,transportType:i==null?void 0:i.transportType};this.pending.set(n,s);const o=await this.rpcSubscribe(n,a,i);return typeof o=="string"&&(this.onSubscribe(o,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),o}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((a,s)=>{const o=new ct.Watch;o.start(i);const l=setInterval(()=>{(!this.pending.has(n)&&this.topics.includes(n)||this.cached.some(c=>c.topic===n))&&(clearInterval(l),o.stop(i),a(!0)),o.elapsed(i)>=eqe&&(clearInterval(l),o.stop(i),s(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const n=[];this.pending.forEach(i=>{n.push(i)}),await this.batchSubscribe(n)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(Dm.pulse,async()=>{await this.checkPending()}),this.events.on(oo.created,async n=>{const i=oo.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(oo.deleted,async n=>{const i=oo.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})},this.relayer=e,this.logger=ms(r,this.name),this.clientId=""}get context(){return Zs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=u8(n);await this.rpcUnsubscribe(e,r,i);const a=ln("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(n==null?void 0:n.transportType)===Cn.relay&&await this.restartToComplete();const a={method:ly(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});const s=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const o=this.getSubscriptionId(e);if((n==null?void 0:n.transportType)===Cn.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch(u=>this.logger.warn(u))},ct.toMiliseconds(ct.ONE_SECOND)),o;const l=new Promise(async u=>{const f=h=>{h.topic===e&&(this.events.removeListener(oo.created,f),u(h.id))};this.events.on(oo.created,f);try{const h=await Pf(new Promise((g,m)=>{this.relayer.request(a).catch(w=>{this.logger.warn(w,w==null?void 0:w.message),m(w)}).then(g)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(oo.created,f),u(h)}catch{}}),c=await Pf(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&s)throw new Error(`Subscribing to ${e} failed, please try again`);return c?o:null}catch(o){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Zi.connection_stalled),s)throw o}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:ly(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Pf(new Promise(i=>{this.relayer.request(n).catch(a=>this.logger.warn(a)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Zi.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:ly(r.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Pf(new Promise((a,s)=>{this.relayer.request(n).catch(o=>{this.logger.warn(o),s(o)}).then(a)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Zi.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:ly(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,AS(z2({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,z2({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,z2({},r)),this.topicMap.set(r.topic,e),this.events.emit(oo.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(oo.deleted,AS(z2({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(oo.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(e.map(r=>AS(z2({},r),{id:this.getSubscriptionId(r.topic)}))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(await ize(ct.toMiliseconds(ct.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen()}getSubscriptionId(e){return gd(e+this.clientId)}}var nYe=Object.defineProperty,KW=Object.getOwnPropertySymbols,iYe=Object.prototype.hasOwnProperty,aYe=Object.prototype.propertyIsEnumerable,JW=(t,e,r)=>e in t?nYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ZW=(t,e)=>{for(var r in e||(e={}))iYe.call(e,r)&&JW(t,r,e[r]);if(KW)for(var r of KW(e))aYe.call(e,r)&&JW(t,r,e[r]);return t};class sYe extends OHe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new gs.EventEmitter,this.name=VGe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=ct.toMiliseconds(ct.THIRTY_SECONDS+ct.FIVE_SECONDS),this.requestsInFlight=[],this.connectTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const a=r.id||v0().toString();await this.toEstablishConnection();try{this.logger.trace({id:a,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - publishing...");const s=`${a}:${((i=r.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(s);const o=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==s),o}catch(s){throw this.logger.debug(`Failed to Publish Request: ${a}`),s}},this.resetPingTimeout=()=>{if(l8())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r,r==null?void 0:r.message)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(Zi.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.fatal(r,`Fatal socket error: ${r==null?void 0:r.message}`),this.events.emit(Zi.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Jo.payload,this.onPayloadHandler),this.provider.on(Jo.connect,this.onConnectHandler),this.provider.on(Jo.disconnect,this.onDisconnectHandler),this.provider.on(Jo.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ms(e.logger,this.name):fv(Xx({level:e.logger||qGe})),this.messages=new WVe(this.logger,e.core),this.subscriber=new rYe(this,this.logger),this.publisher=new KVe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Sie,this.projectId=e.projectId,GBe()?this.packageName=Jz():qBe()&&(this.bundleId=Jz()),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e,e==null?void 0:e.message)}}get context(){return Zs(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:Cn.relay})}async subscribe(e,r){var n,i,a;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const s=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let o=((a=this.subscriber.topicMap.get(e))==null?void 0:a[0])||"",l;const c=u=>{u.topic===e&&(this.subscriber.off(oo.created,c),l())};return await Promise.all([new Promise(u=>{l=u,this.subscriber.on(oo.created,c)}),new Promise(async(u,f)=>{o=await this.subscriber.subscribe(e,ZW({internal:{throwOnFailedPublish:s}},r)).catch(h=>{s&&f(h)})||o,u()})]),o}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Pf(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(r,n)=>{await this.connect(e).then(r).catch(n).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await yW())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=Ni(ct.FIVE_MINUTES),a={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,a)}this.events.emit(Zi.message,e),await this.recordMessageEvent(e)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let r=1;for(;r<6;){try{this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${r}...`),await this.createProvider(),await new Promise(async(n,i)=>{const a=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Jo.disconnect,a),await Pf(new Promise((s,o)=>{this.provider.connect().then(s).catch(o)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{i(s)}).finally(()=>{this.provider.off(Jo.disconnect,a),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),await new Promise(async(s,o)=>{const l=()=>{o(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Jo.disconnect,l),await this.subscriber.start().then(s).catch(o).finally(()=>{this.provider.off(Jo.disconnect,l)})}),this.hasExperiencedNetworkDisruption=!1,n()})}catch(n){await this.subscriber.stop();const i=n;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${r}`);break}await new Promise(n=>setTimeout(n,ct.toMiliseconds(r*1))),r++}}startPingTimeout(){var e,r,n,i,a;if(l8())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((a=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||a.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(s){this.logger.warn(s,s==null?void 0:s.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Sl(new $Ge(JBe({sdkVersion:mT,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.warn(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.warn(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Aj(e)){if(!e.method.endsWith(YGe))return;const r=e.params,{topic:n,message:i,publishedAt:a,attestation:s}=r.data,o={topic:n,message:i,publishedAt:a,transportType:Cn.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(ZW({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else r7(e)&&this.events.emit(Zi.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Zi.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=e7(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Jo.payload,this.onPayloadHandler),this.provider.off(Jo.connect,this.onConnectHandler),this.provider.off(Jo.disconnect,this.onDisconnectHandler),this.provider.off(Jo.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await yW();MWe(async r=>{e!==r&&(e=r,r?await this.transportOpen().catch(n=>this.logger.error(n,n==null?void 0:n.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),clearTimeout(this.pingTimeout),this.events.emit(Zi.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||this.connectPromise||(this.reconnectTimeout=setTimeout(async()=>{clearTimeout(this.reconnectTimeout),await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message))},ct.toMiliseconds(KGe))))}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&await this.transportOpen()}}var oYe=Object.defineProperty,QW=Object.getOwnPropertySymbols,lYe=Object.prototype.hasOwnProperty,cYe=Object.prototype.propertyIsEnumerable,XW=(t,e,r)=>e in t?oYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,eH=(t,e)=>{for(var r in e||(e={}))lYe.call(e,r)&&XW(t,r,e[r]);if(QW)for(var r of QW(e))cYe.call(e,r)&&XW(t,r,e[r]);return t};class T1 extends FHe{constructor(e,r,n,i=Cu,a=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=JGe,this.cached=[],this.initialized=!1,this.storagePrefix=Cu,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{this.getKey&&s!==null&&!Ps(s)?this.map.set(this.getKey(s),s):aWe(s)?this.map.set(s.id,s):sWe(s)&&this.map.set(s.topic,s)}),this.cached=[],this.initialized=!0)},this.set=async(s,o)=>{this.isInitialized(),this.map.has(s)?await this.update(s,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:o}),this.map.set(s,o),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(o=>Object.keys(s).every(l=>RGe(o[l],s[l]))):this.values),this.update=async(s,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:o});const l=eH(eH({},this.getData(s)),o);this.map.set(s,l),await this.persist()},this.delete=async(s,o)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:o}),this.map.delete(s),this.addToRecentlyDeleted(s),await this.persist())},this.logger=ms(r,this.name),this.storagePrefix=i,this.getKey=a}get context(){return Zs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=ht("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class uYe{constructor(e,r){this.core=e,this.logger=r,this.name=tqe,this.version=rqe,this.events=new xL,this.initialized=!1,this.storagePrefix=Cu,this.ignoredPayloadTypes=[Ad],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=uT(),a=await this.core.crypto.setSymKey(i),s=Ni(ct.FIVE_MINUTES),o={protocol:Cie},l={topic:a,expiry:s,relay:o,active:!1,methods:n==null?void 0:n.methods},c=dW({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:i,relay:o,expiryTimestamp:s,methods:n==null?void 0:n.methods});return this.events.emit(u0.create,l),this.core.expirer.set(a,s),await this.pairings.set(a,l),await this.core.relayer.subscribe(a,{transportType:n==null?void 0:n.transportType}),{topic:a,uri:c}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[Uc.pairing_started]}});this.isValidPair(n,i);const{topic:a,symKey:s,relay:o,expiryTimestamp:l,methods:c}=uW(n.uri);i.props.properties.topic=a,i.addTrace(Uc.pairing_uri_validation_success),i.addTrace(Uc.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(a)){if(u=this.pairings.get(a),i.addTrace(Uc.existing_pairing),u.active)throw i.setError(td.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);i.addTrace(Uc.pairing_not_expired)}const f=l||Ni(ct.FIVE_MINUTES),h={topic:a,relay:o,expiry:f,active:!1,methods:c};this.core.expirer.set(a,f),await this.pairings.set(a,h),i.addTrace(Uc.store_new_pairing),n.activatePairing&&await this.activate({topic:a}),this.events.emit(u0.create,h),i.addTrace(Uc.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(s,a),i.addTrace(Uc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(td.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:o})}catch(g){throw i.setError(td.subscribe_pairing_topic_failure),g}return i.addTrace(Uc.subscribe_pairing_topic_success),h},this.activate=async({topic:n})=>{this.isInitialized();const i=Ni(ct.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:o,reject:l}=r0();this.events.once(jr("pairing_ping",a),({error:c})=>{c?l(c):o()}),await s()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",ln("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:a,expiry:s,methods:o}=n,l=this.core.crypto.keychain.get(i);return dW({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:l,relay:a,expiryTimestamp:s,methods:o})},this.sendRequest=async(n,i,a)=>{const s=Df(i,a),o=await this.core.crypto.encode(n,s),l=U2[i].req;return this.core.history.set(n,s),this.core.relayer.publish(n,o,l),s.id},this.sendResult=async(n,i,a)=>{const s=e7(n,a),o=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),c=U2[l.request.method].res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(s)},this.sendError=async(n,i,a)=>{const s=t7(n,a),o=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),c=U2[l.request.method]?U2[l.request.method].res:U2.unregistered_method.res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(s)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,ln("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>Cf(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,s=(await this.core.history.get(i,a.id)).request.method;switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit(u0.ping,{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{Gc(i)?this.events.emit(jr("pairing_ping",a),{}):tl(i)&&this.events.emit(jr("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(u0.delete,{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:s}=i;try{if(this.registeredMethods.includes(s))return;const o=ln("WC_METHOD_UNSUPPORTED",s);await this.sendError(a,n,o),this.logger.error(o)}catch(o){await this.sendError(a,n,o),this.logger.error(o)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(ln("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var a;if(!Ts(n)){const{message:o}=ht("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(td.malformed_pairing_uri),new Error(o)}if(!iWe(n.uri)){const{message:o}=ht("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(td.malformed_pairing_uri),new Error(o)}const s=uW(n==null?void 0:n.uri);if(!((a=s==null?void 0:s.relay)!=null&&a.protocol)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(td.malformed_pairing_uri),new Error(o)}if(!(s!=null&&s.symKey)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(td.malformed_pairing_uri),new Error(o)}if(s!=null&&s.expiryTimestamp&&ct.toMiliseconds(s==null?void 0:s.expiryTimestamp){if(!Ts(n)){const{message:a}=ht("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Ts(n)){const{message:a}=ht("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!pi(n,!1)){const{message:i}=ht("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ht("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(Cf(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ht("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=ms(r,this.name),this.pairings=new T1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return Zs(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Zi.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===Cn.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const a=await this.core.crypto.decode(r,n);try{Aj(a)?(this.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a})):r7(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a}),this.core.history.delete(r,a.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(Xo.expired,async e=>{const{topic:r}=Xne(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(u0.expire,{topic:r}))})}}class dYe extends PHe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new gs.EventEmitter,this.name=nqe,this.version=iqe,this.cached=[],this.initialized=!1,this.storagePrefix=Cu,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const s={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Ni(ct.THIRTY_DAYS)};this.records.set(s.id,s),this.persist(),this.events.emit(Ol.created,s)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=tl(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Ol.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(Ol.deleted,a)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ms(r,this.name)}get context(){return Zs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Df(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Ol.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Ol.created,e=>{const r=Ol.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Ol.updated,e=>{const r=Ol.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Ol.deleted,e=>{const r=Ol.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(Dm.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{ct.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Ol.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class fYe extends BHe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new gs.EventEmitter,this.name=aqe,this.version=sqe,this.cached=[],this.initialized=!1,this.storagePrefix=Cu,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const a=this.formatTarget(n),s={target:a,expiry:i};this.expirations.set(a,s),this.checkExpiry(a,s),this.events.emit(Xo.created,{target:a,expiration:s})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(Xo.deleted,{target:i,expiration:a})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ms(r,this.name)}get context(){return Zs(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return ZBe(e);if(typeof e=="number")return QBe(e);const{message:r}=ht("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(Xo.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ct.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(Xo.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Dm.pulse,()=>this.checkExpirations()),this.events.on(Xo.created,e=>{const r=Xo.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Xo.expired,e=>{const r=Xo.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(Xo.deleted,e=>{const r=Xo.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class hYe extends zHe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=oqe,this.verifyUrlV3=cqe,this.storagePrefix=Cu,this.version=_ie,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&ct.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!ov()||this.isDevEnv)return;const a=window.location.origin,{id:s,decryptedId:o}=i,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${s}&decryptedId=${o}`;try{const c=tv(),u=this.startAbortTimer(ct.ONE_SECOND*5),f=await new Promise((h,g)=>{const m=()=>{window.removeEventListener("message",_),c.body.removeChild(w),g("attestation aborted")};this.abortController.signal.addEventListener("abort",m);const w=c.createElement("iframe");w.src=l,w.style.display="none",w.addEventListener("error",m,{signal:this.abortController.signal});const _=v=>{if(v.data&&typeof v.data=="string")try{const b=JSON.parse(v.data);if(b.type==="verify_attestation"){if(lT(b.attestation).payload.id!==s)return;clearInterval(u),c.body.removeChild(w),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",_),h(b.attestation===null?"":b.attestation)}}catch(b){this.logger.warn(b)}};c.body.appendChild(w),window.addEventListener("message",_,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",f),f}catch(c){this.logger.warn(c)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:a,hash:s,encryptedId:o}=i;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(lT(a).payload.id!==o)return;const c=await this.isValidJwtAttestation(a);if(c){if(!c.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return c}}if(!s)return;const l=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(s,l)},this.fetchAttestation=async(i,a)=>{this.logger.debug(`resolving attestation: ${i} from url: ${a}`);const s=this.startAbortTimer(ct.ONE_SECOND*5),o=await fetch(`${a}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(s),o.status===200?await o.json():void 0},this.getVerifyUrl=i=>{let a=i||Ry;return uqe.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${Ry}`),a=Ry),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(ct.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await a.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(i,a)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}const s=await this.fetchAndPersistPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const s=await this.fetchPublicKey();s&&(await this.persistPublicKey(s),a(s))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,a)=>{const s=Fze(i,a.publicKey),o={hasExpired:ct.toMiliseconds(s.exp)this.abortController.abort(),ct.toMiliseconds(e))}}class pYe extends WHe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=dqe,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:s,enableEncrypted:o=!1}=n,l=`${fqe}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:s,token:a,always_raw:o})})},this.logger=ms(r,this.context)}}var gYe=Object.defineProperty,tH=Object.getOwnPropertySymbols,mYe=Object.prototype.hasOwnProperty,yYe=Object.prototype.propertyIsEnumerable,rH=(t,e,r)=>e in t?gYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,W2=(t,e)=>{for(var r in e||(e={}))mYe.call(e,r)&&rH(t,r,e[r]);if(tH)for(var r of tH(e))yYe.call(e,r)&&rH(t,r,e[r]);return t};class wYe extends HHe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=pqe,this.storagePrefix=Cu,this.storageVersion=hqe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!vj())try{const i={eventId:Qz(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:Kne(this.core.relayer.protocol,this.core.relayer.version,mT)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:a="ERROR",type:s="",properties:{topic:o,trace:l}}=i,c=Qz(),u=this.core.projectId||"",f=Date.now(),h=W2({eventId:c,timestamp:f,props:{event:a,type:s,properties:{topic:o,trace:l}},bundleId:u,domain:this.getAppDomain()},this.setMethods(c));return this.telemetryEnabled&&(this.events.set(c,h),this.shouldPersist=!0),h},this.getEvent=i=>{const{eventId:a,topic:s}=i;if(a)return this.events.get(a);const o=Array.from(this.events.values()).find(l=>l.props.properties.topic===s);if(o)return W2(W2({},o),this.setMethods(o.eventId))},this.deleteEvent=i=>{const{eventId:a}=i;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Dm.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{ct.fromMiliseconds(Date.now())-ct.fromMiliseconds(i.timestamp)>gqe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:a=>this.addTrace(i,a),setError:a=>this.setError(i,a)}),this.addTrace=(i,a)=>{const s=this.events.get(i);s&&(s.props.properties.trace.push(a),this.events.set(i,s),this.shouldPersist=!0)},this.setError=(i,a)=>{const s=this.events.get(i);s&&(s.props.type=a,s.timestamp=Date.now(),this.events.set(i,s),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(a=>{this.events.set(a.eventId,W2(W2({},a),this.setMethods(a.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[a,s]of this.events)s.props.type&&i.push(s);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const a of i)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async i=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${mqe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${mT}${a}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>Yne().url,this.logger=ms(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var vYe=Object.defineProperty,nH=Object.getOwnPropertySymbols,bYe=Object.prototype.hasOwnProperty,xYe=Object.prototype.propertyIsEnumerable,iH=(t,e,r)=>e in t?vYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,aH=(t,e)=>{for(var r in e||(e={}))bYe.call(e,r)&&iH(t,r,e[r]);if(nH)for(var r of nH(e))xYe.call(e,r)&&iH(t,r,e[r]);return t};let EYe=class Die extends $He{constructor(e){var r;super(e),this.protocol=Eie,this.version=_ie,this.name=g8,this.events=new gs.EventEmitter,this.initialized=!1,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.dispatchEnvelope=({topic:s,message:o,sessionExists:l})=>{if(!s||!o)return;const c={topic:s,message:o,publishedAt:Date.now(),transportType:Cn.link_mode};this.relayer.onLinkMessageEvent(c,{sessionExists:l})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Sie,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=Xx({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:DGe.logger,name:g8}),{logger:i,chunkLoggerController:a}=jHe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var s,o;(s=this.logChunkController)!=null&&s.downloadLogsBlobInBrowser&&((o=this.logChunkController)==null||o.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=ms(i,this.name),this.heartbeat=new LWe,this.crypto=new zVe(this,this.logger,e==null?void 0:e.keychain),this.history=new dYe(this,this.logger),this.expirer=new fYe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new aHe(aH(aH({},OGe),e==null?void 0:e.storageOptions)),this.relayer=new sYe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new uYe(this,this.logger),this.verify=new hYe(this,this.logger,this.storage),this.echoClient=new pYe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new wYe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new Die(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(ZGe,n),r}get context(){return Zs(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(RW,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(RW)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const _Ye=EYe,Oie="wc",Fie=2,Uie="client",Ij=`${Oie}@${Fie}:${Uie}:`,IS={name:Uie,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},sH="WALLETCONNECT_DEEPLINK_CHOICE",CYe="proposal",Bie="Proposal expired",SYe="session",vp=ct.SEVEN_DAYS,AYe="engine",Ui={wc_sessionPropose:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ct.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ct.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1119}}},MS={min:ct.FIVE_MINUTES,max:ct.SEVEN_DAYS},Oc={idle:"IDLE",active:"ACTIVE"},IYe="request",MYe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],TYe="wc",kYe="auth",NYe="authKeys",LYe="pairingTopics",jYe="requests",i7=`${TYe}@${1.5}:${kYe}:`,O6=`${i7}:PUB_KEY`;var $Ye=Object.defineProperty,PYe=Object.defineProperties,RYe=Object.getOwnPropertyDescriptors,oH=Object.getOwnPropertySymbols,DYe=Object.prototype.hasOwnProperty,OYe=Object.prototype.propertyIsEnumerable,lH=(t,e,r)=>e in t?$Ye(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ti=(t,e)=>{for(var r in e||(e={}))DYe.call(e,r)&&lH(t,r,e[r]);if(oH)for(var r of oH(e))OYe.call(e,r)&&lH(t,r,e[r]);return t},Ul=(t,e)=>PYe(t,RYe(e));class FYe extends qHe{constructor(e){super(e),this.name=AYe,this.events=new xL,this.initialized=!1,this.requestQueue={state:Oc.idle,queue:[]},this.sessionRequestQueue={state:Oc.idle,queue:[]},this.requestQueueDelay=ct.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Ui)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=Ul(ti({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:s,sessionProperties:o,relays:l}=n;let c=i,u,f=!1;try{c&&(f=this.client.core.pairing.pairings.get(c).active)}catch(S){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),S}if(!c||!f){const{topic:S,uri:j}=await this.client.core.pairing.create();c=S,u=j}if(!c){const{message:S}=ht("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(S)}const h=await this.client.core.crypto.generateKeyPair(),g=Ui.wc_sessionPropose.req.ttl||ct.FIVE_MINUTES,m=Ni(g),w=ti({requiredNamespaces:a,optionalNamespaces:s,relays:l??[{protocol:Cie}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:m,pairingTopic:c},o&&{sessionProperties:o}),{reject:_,resolve:v,done:b}=r0(g,Bie);this.events.once(jr("session_connect"),async({error:S,session:j})=>{if(S)_(S);else if(j){j.self.publicKey=h;const U=Ul(ti({},j),{pairingTopic:w.pairingTopic,requiredNamespaces:w.requiredNamespaces,optionalNamespaces:w.optionalNamespaces,transportType:Cn.relay});await this.client.session.set(j.topic,U),await this.setExpiry(j.topic,j.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:j.peer.metadata}),this.cleanupDuplicatePairings(U),v(U)}});const A=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:w,throwOnFailedPublish:!0});return await this.setProposal(A,ti({id:A},w)),{uri:u,approval:b}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,a;const s=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[Fl.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(B){throw s.setError(Jh.no_internet_connection),B}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(B){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),s.setError(Jh.proposal_not_found),B}try{await this.isValidApprove(r)}catch(B){throw this.client.logger.error("approve() -> isValidApprove() failed"),s.setError(Jh.session_approve_namespace_validation_failure),B}const{id:o,relayProtocol:l,namespaces:c,sessionProperties:u,sessionConfig:f}=r,h=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:s.eventId});const{pairingTopic:g,proposer:m,requiredNamespaces:w,optionalNamespaces:_}=h;let v=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});v||(v=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:Fl.session_approve_started,properties:{topic:g,trace:[Fl.session_approve_started,Fl.session_namespaces_validation_success]}}));const b=await this.client.core.crypto.generateKeyPair(),A=m.publicKey,S=await this.client.core.crypto.generateSharedKey(b,A),j=ti(ti({relay:{protocol:l??"irn"},namespaces:c,controller:{publicKey:b,metadata:this.client.metadata},expiry:Ni(vp)},u&&{sessionProperties:u}),f&&{sessionConfig:f}),U=Cn.relay;v.addTrace(Fl.subscribing_session_topic);try{await this.client.core.relayer.subscribe(S,{transportType:U})}catch(B){throw v.setError(Jh.subscribe_session_topic_failure),B}v.addTrace(Fl.subscribe_session_topic_success);const I=Ul(ti({},j),{topic:S,requiredNamespaces:w,optionalNamespaces:_,pairingTopic:g,acknowledged:!1,self:j.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:b,transportType:Cn.relay});await this.client.session.set(S,I),v.addTrace(Fl.store_session);try{v.addTrace(Fl.publishing_session_settle),await this.sendRequest({topic:S,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0}).catch(B=>{throw v==null||v.setError(Jh.session_settle_publish_failure),B}),v.addTrace(Fl.session_settle_publish_success),v.addTrace(Fl.publishing_session_approve),await this.sendResult({id:o,topic:g,result:{relay:{protocol:l??"irn"},responderPublicKey:b},throwOnFailedPublish:!0}).catch(B=>{throw v==null||v.setError(Jh.session_approve_publish_failure),B}),v.addTrace(Fl.session_approve_publish_success)}catch(B){throw this.client.logger.error(B),this.client.session.delete(S,ln("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(S),B}return this.client.core.eventClient.deleteEvent({eventId:v.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:m.metadata}),await this.client.proposal.delete(o,ln("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(S,Ni(vp)),{topic:S,acknowledged:()=>Promise.resolve(this.client.session.get(S))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(s){throw this.client.logger.error("reject() -> isValidReject() failed"),s}const{id:n,reason:i}=r;let a;try{a=this.client.proposal.get(n).pairingTopic}catch(s){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),s}a&&(await this.sendError({id:n,topic:a,error:i,rpcOpts:Ui.wc_sessionPropose.reject}),await this.client.proposal.delete(n,ln("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:n,namespaces:i}=r,{done:a,resolve:s,reject:o}=r0(),l=sd(),c=v0().toString(),u=this.client.session.get(n).namespaces;return this.events.once(jr("session_update",l),({error:f})=>{f?o(f):s()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:c}).catch(f=>{this.client.logger.error(f),this.client.session.update(n,{namespaces:u}),o(f)}),{acknowledged:a}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:n}=r,i=sd(),{done:a,resolve:s,reject:o}=r0();return this.events.once(jr("session_extend",i),({error:l})=>{l?o(l):s()}),await this.setExpiry(n,Ni(vp)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(l=>{o(l)}),{acknowledged:a}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(m){throw this.client.logger.error("request() -> isValidRequest() failed"),m}const{chainId:n,request:i,topic:a,expiry:s=Ui.wc_sessionRequest.req.ttl}=r,o=this.client.session.get(a);(o==null?void 0:o.transportType)===Cn.relay&&await this.confirmOnlineStateOrThrow();const l=sd(),c=v0().toString(),{done:u,resolve:f,reject:h}=r0(s,"Request expired. Please try again.");this.events.once(jr("session_request",l),({error:m,result:w})=>{m?h(m):f(w)});const g=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);return g?(await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:Ul(ti({},i),{expiryTimestamp:Ni(s)}),chainId:n},expiry:s,throwOnFailedPublish:!0,appLink:g}).catch(m=>h(m)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),await u()):await Promise.all([new Promise(async m=>{await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:Ul(ti({},i),{expiryTimestamp:Ni(s)}),chainId:n},expiry:s,throwOnFailedPublish:!0}).catch(w=>h(w)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),m()}),new Promise(async m=>{var w;if(!((w=o.sessionConfig)!=null&&w.disableDeepLink)){const _=await tze(this.client.core.storage,sH);await XBe({id:l,topic:a,wcDeepLink:_})}m()}),u()]).then(m=>m[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:a}=i,s=this.client.session.get(n);s.transportType===Cn.relay&&await this.confirmOnlineStateOrThrow();const o=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);Gc(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:o}):tl(i)&&await this.sendError({id:a,topic:n,error:i.error,appLink:o}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=sd(),a=v0().toString(),{done:s,resolve:o,reject:l}=r0();this.events.once(jr("session_ping",i),({error:c})=>{c?l(c):o()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:a}),s()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:a}=r,s=v0().toString(),o=sd();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a},throwOnFailedPublish:!0,relayRpcId:s,clientRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:ln("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=ht("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>rWe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const a=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),s=a?Cn.link_mode:Cn.relay;s===Cn.relay&&await this.confirmOnlineStateOrThrow();const{chains:o,statement:l="",uri:c,domain:u,nonce:f,type:h,exp:g,nbf:m,methods:w=[],expiry:_}=r,v=[...r.resources||[]],{topic:b,uri:A}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});this.client.logger.info({message:"Generated new pairing",pairing:{topic:b,uri:A}});const S=await this.client.core.crypto.generateKeyPair(),j=P6(S);if(await Promise.all([this.client.auth.authKeys.set(O6,{responseTopic:j,publicKey:S}),this.client.auth.pairingTopics.set(j,{topic:j,pairingTopic:b})]),await this.client.core.relayer.subscribe(j,{transportType:s}),this.client.logger.info(`sending request to new pairing topic: ${b}`),w.length>0){const{namespace:P}=fg(o[0]);let R=_ze(P,"request",w);$6(v)&&(R=Sze(R,v.pop())),v.push(R)}const U=_&&_>Ui.wc_sessionAuthenticate.req.ttl?_:Ui.wc_sessionAuthenticate.req.ttl,I={authPayload:{type:h??"caip122",chains:o,statement:l,aud:c,domain:u,version:"1",nonce:f,iat:new Date().toISOString(),exp:g,nbf:m,resources:v},requester:{publicKey:S,metadata:this.client.metadata},expiryTimestamp:Ni(U)},B={eip155:{chains:o,methods:[...new Set(["personal_sign",...w])],events:["chainChanged","accountsChanged"]}},V={requiredNamespaces:{},optionalNamespaces:B,relays:[{protocol:"irn"}],pairingTopic:b,proposer:{publicKey:S,metadata:this.client.metadata},expiryTimestamp:Ni(Ui.wc_sessionPropose.req.ttl)},{done:se,resolve:Y,reject:N}=r0(U,"Request expired"),k=async({error:P,session:R})=>{if(this.events.off(jr("session_request",E),x),P)N(P);else if(R){R.self.publicKey=S,await this.client.session.set(R.topic,R),await this.setExpiry(R.topic,R.expiry),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:R.peer.metadata});const M=this.client.session.get(R.topic);await this.deleteProposal(L),Y({session:M})}},x=async P=>{var R,M,D;if(await this.deletePendingAuthRequest(E,{message:"fulfilled",code:0}),P.error){const te=ln("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return P.error.code===te.code?void 0:(this.events.off(jr("session_connect"),k),N(P.error.message))}await this.deleteProposal(L),this.events.off(jr("session_connect"),k);const{cacaos:$,responder:X}=P.result,le=[],H=[];for(const te of $){await tW({cacao:te,projectId:this.client.core.projectId})||(this.client.logger.error(te,"Signature verification failed"),N(ln("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:re}=te,z=$6(re.resources),G=[cT(re.iss)],Z=c8(re.iss);if(z){const me=rW(z),be=nW(z);le.push(...me),G.push(...be)}for(const me of G)H.push(`${me}:${Z}`)}const ee=await this.client.core.crypto.generateSharedKey(S,X.publicKey);let J;le.length>0&&(J={topic:ee,acknowledged:!0,self:{publicKey:S,metadata:this.client.metadata},peer:X,controller:X.publicKey,expiry:Ni(vp),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:b,namespaces:fW([...new Set(le)],[...new Set(H)]),transportType:s},await this.client.core.relayer.subscribe(ee,{transportType:s}),await this.client.session.set(ee,J),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:X.metadata}),J=this.client.session.get(ee)),(R=this.client.metadata.redirect)!=null&&R.linkMode&&(M=X.metadata.redirect)!=null&&M.linkMode&&(D=X.metadata.redirect)!=null&&D.universal&&n&&(this.client.core.addLinkModeSupportedApp(X.metadata.redirect.universal),this.client.session.update(ee,{transportType:Cn.link_mode})),Y({auths:$,session:J})},E=sd(),L=sd();this.events.once(jr("session_connect"),k),this.events.once(jr("session_request",E),x);let O;try{if(a){const P=Df("wc_sessionAuthenticate",I,E);this.client.core.history.set(b,P);const R=await this.client.core.crypto.encode("",P,{type:uv,encoding:O2});O=k4(n,b,R)}else await Promise.all([this.sendRequest({topic:b,method:"wc_sessionAuthenticate",params:I,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:E}),this.sendRequest({topic:b,method:"wc_sessionPropose",params:V,expiry:Ui.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:L})])}catch(P){throw this.events.off(jr("session_connect"),k),this.events.off(jr("session_request",E),x),P}return await this.setProposal(L,ti({id:L},V)),await this.setAuthRequest(E,{request:Ul(ti({},I),{verifyContext:{}}),pairingTopic:b,transportType:s}),{uri:O??A,response:se}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,a=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[Zh.authenticated_session_approve_started]}});try{this.isInitialized()}catch(_){throw a.setError(B2.no_internet_connection),_}const s=this.getPendingAuthRequest(n);if(!s)throw a.setError(B2.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const o=s.transportType||Cn.relay;o===Cn.relay&&await this.confirmOnlineStateOrThrow();const l=s.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=P6(l),f={type:Ad,receiverPublicKey:l,senderPublicKey:c},h=[],g=[];for(const _ of i){if(!await tW({cacao:_,projectId:this.client.core.projectId})){a.setError(B2.invalid_cacao);const j=ln("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:j,encodeOpts:f}),new Error(j.message)}a.addTrace(Zh.cacaos_verified);const{p:v}=_,b=$6(v.resources),A=[cT(v.iss)],S=c8(v.iss);if(b){const j=rW(b),U=nW(b);h.push(...j),A.push(...U)}for(const j of A)g.push(`${j}:${S}`)}const m=await this.client.core.crypto.generateSharedKey(c,l);a.addTrace(Zh.create_authenticated_session_topic);let w;if((h==null?void 0:h.length)>0){w={topic:m,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:l,metadata:s.requester.metadata},controller:l,expiry:Ni(vp),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:fW([...new Set(h)],[...new Set(g)]),transportType:o},a.addTrace(Zh.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:o})}catch(_){throw a.setError(B2.subscribe_authenticated_session_topic_failure),_}a.addTrace(Zh.subscribe_authenticated_session_topic_success),await this.client.session.set(m,w),a.addTrace(Zh.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}a.addTrace(Zh.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:i,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,o)})}catch(_){throw a.setError(B2.authenticated_session_approve_publish_failure),_}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:w}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,a=this.getPendingAuthRequest(n);if(!a)throw new Error(`Could not find pending auth request with id ${n}`);a.transportType===Cn.relay&&await this.confirmOnlineStateOrThrow();const s=a.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),l=P6(s),c={type:Ad,receiverPublicKey:s,senderPublicKey:o};await this.sendError({id:n,topic:l,error:i,encodeOpts:c,rpcOpts:Ui.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,ln("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return tie(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var s,o;return((s=a.peerMetadata)==null?void 0:s.url)&&((o=a.peerMetadata)==null?void 0:o.url)===r.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:a=!1,emitEvent:s=!0,id:o=0}=r,{self:l}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,ln("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),a||this.client.core.expirer.del(i),this.client.core.storage.removeItem(sH).catch(c=>this.client.logger.warn(c)),this.getPendingSessionRequests().forEach(c=>{c.topic===i&&this.deletePendingSessionRequest(c.id,ln("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=Oc.idle),s&&this.client.events.emit("session_delete",{id:o,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),a=this.client.core.eventClient.getEvent({topic:i.pairingTopic});a==null||a.setError(Jh.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,ln("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==r),i&&(this.sessionRequestQueue.state=Oc.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Ni(Ui.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:a,transportType:s=Cn.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:a,verifyContext:i.verifyContext,transportType:s})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:a,verifyContext:s}=r,o=a.request.expiryTimestamp||Ni(Ui.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,o),await this.client.pendingRequest.set(n,{id:n,topic:i,params:a,verifyContext:s})},this.sendRequest=async r=>{const{topic:n,method:i,params:a,expiry:s,relayRpcId:o,clientRpcId:l,throwOnFailedPublish:c,appLink:u}=r,f=Df(i,a,l);let h;const g=!!u;try{const _=g?O2:Rf;h=await this.client.core.crypto.encode(n,f,{encoding:_})}catch(_){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),_}let m;if(MYe.includes(i)){const _=gd(JSON.stringify(f)),v=gd(h);m=await this.client.core.verify.register({id:v,decryptedId:_})}const w=Ui[i].req;if(w.attestation=m,s&&(w.ttl=s),o&&(w.id=o),this.client.core.history.set(n,f),g){const _=k4(u,n,h);await global.Linking.openURL(_,this.client.name)}else{const _=Ui[i].req;s&&(_.ttl=s),o&&(_.id=o),c?(_.internal=Ul(ti({},_.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,h,_)):this.client.core.relayer.publish(n,h,_).catch(v=>this.client.logger.error(v))}return f.id},this.sendResult=async r=>{const{id:n,topic:i,result:a,throwOnFailedPublish:s,encodeOpts:o,appLink:l}=r,c=e7(n,a);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?O2:Rf;u=await this.client.core.crypto.encode(i,c,Ul(ti({},o||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let h;try{h=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(f){const g=k4(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=Ui[h.request.method].res;s?(g.internal=Ul(ti({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,u,g)):this.client.core.relayer.publish(i,u,g).catch(m=>this.client.logger.error(m))}await this.client.core.history.resolve(c)},this.sendError=async r=>{const{id:n,topic:i,error:a,encodeOpts:s,rpcOpts:o,appLink:l}=r,c=t7(n,a);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?O2:Rf;u=await this.client.core.crypto.encode(i,c,Ul(ti({},s||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let h;try{h=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),g}if(f){const g=k4(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=o||Ui[h.request.method].res;this.client.core.relayer.publish(i,u,g)}await this.client.core.history.resolve(c)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let a=!1;Cf(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{Cf(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===Oc.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=Oc.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=Oc.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:a,transportType:s,encryptedId:o}=r,l=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:l}))switch(l){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:a,encryptedId:o});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:a,encryptedId:o,transportType:s});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:a,encryptedId:o,transportType:s});default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:a}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,a);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=ht("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,a=this.expectedPairingMethodMap.get(n);return!a||a.includes(i)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:a,encryptedId:s}=r,{params:o,id:l}=i;try{const c=this.client.core.eventClient.getEvent({topic:n});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),c==null||c.setError(td.proposal_listener_not_found)),this.isValidConnect(ti({},i.params));const u=o.expiryTimestamp||Ni(Ui.wc_sessionPropose.req.ttl),f=ti({id:l,pairingTopic:n,expiryTimestamp:u},o);await this.setProposal(l,f);const h=await this.getVerifyContext({attestationId:a,hash:gd(JSON.stringify(i)),encryptedId:s,metadata:f.proposer.metadata});c==null||c.addTrace(Uc.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:f,verifyContext:h})}catch(c){await this.sendError({id:l,topic:n,error:c,rpcOpts:Ui.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:a}=n;if(Gc(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const l=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const u=await this.client.core.crypto.generateSharedKey(l,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});const f=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:r})}else if(tl(n)){await this.client.proposal.delete(a,ln("USER_DISCONNECTED"));const s=jr("session_connect");if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners, 954`);this.events.emit(jr("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:s,controller:o,expiry:l,namespaces:c,sessionProperties:u,sessionConfig:f}=n.params,h=Ul(ti(ti({topic:r,relay:s,expiry:l,namespaces:c,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:o.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},u&&{sessionProperties:u}),f&&{sessionConfig:f}),{transportType:Cn.relay}),g=jr("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(jr("session_connect"),{session:h}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Gc(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(jr("session_approve",i),{})):tl(n)&&(await this.client.session.delete(r,ln("USER_DISCONNECTED")),this.events.emit(jr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:a}=n;try{const s=`${r}_session_update`,o=F2.get(s);if(o&&this.isRequestOutOfSync(o,a)){this.client.logger.warn(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:r,error:ln("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(ti({topic:r},i));try{F2.set(s,a),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw F2.delete(s),l}this.client.events.emit("session_update",{id:a,topic:r,params:i})}catch(s){await this.sendError({id:a,topic:r,error:s}),this.client.logger.error(s)}},this.isRequestOutOfSync=(r,n)=>n.toString().slice(0,-3){const{id:i}=n,a=jr("session_update",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Gc(n)?this.events.emit(jr("session_update",i),{}):tl(n)&&this.events.emit(jr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Ni(vp)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,a=jr("session_extend",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Gc(n)?this.events.emit(jr("session_extend",i),{}):tl(n)&&this.events.emit(jr("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,a=jr("session_ping",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{Gc(n)?this.events.emit(jr("session_ping",i),{}):tl(n)&&this.events.emit(jr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(Zi.publish,async()=>{a(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:ln("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async r=>{var n,i,a;const{topic:s,payload:o,attestation:l,encryptedId:c,transportType:u}=r,{id:f,params:h}=o;try{await this.isValidRequest(ti({topic:s},h));const g=this.client.session.get(s),m=await this.getVerifyContext({attestationId:l,hash:gd(JSON.stringify(Df("wc_sessionRequest",h,f))),encryptedId:c,metadata:g.peer.metadata,transportType:u}),w={id:f,topic:s,params:h,verifyContext:m};await this.setPendingSessionRequest(w),u===Cn.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(w):(this.addSessionRequestToSessionRequestQueue(w),this.processSessionRequestQueue())}catch(g){await this.sendError({id:f,topic:s,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,a=jr("session_request",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Gc(n)?this.events.emit(jr("session_request",i),{result:n.result}):tl(n)&&this.events.emit(jr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:a}=n;try{const s=`${r}_session_event_${a.event.name}`,o=F2.get(s);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(ti({topic:r},a)),this.client.events.emit("session_event",{id:i,topic:r,params:a}),F2.set(s,i)}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Gc(n)?this.events.emit(jr("session_request",i),{result:n.result}):tl(n)&&this.events.emit(jr("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:a,attestation:s,encryptedId:o,transportType:l}=r;try{const{requester:c,authPayload:u,expiryTimestamp:f}=a.params,h=await this.getVerifyContext({attestationId:s,hash:gd(JSON.stringify(a)),encryptedId:o,metadata:c.metadata,transportType:l}),g={requester:c,pairingTopic:i,id:a.id,authPayload:u,verifyContext:h,expiryTimestamp:f};await this.setAuthRequest(a.id,{request:g,pairingTopic:i,transportType:l}),l===Cn.link_mode&&(n=c.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:a.params,id:a.id,verifyContext:h})}catch(c){this.client.logger.error(c);const u=a.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),h=this.getAppLinkIfEnabled(a.params.requester.metadata,l),g={type:Ad,receiverPublicKey:u,senderPublicKey:f};await this.sendError({id:a.id,topic:i,error:c,encodeOpts:g,rpcOpts:Ui.wc_sessionAuthenticate.autoReject,appLink:h})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=Oc.idle,this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===r&&a.request.method==="wc_sessionRequest").forEach(a=>{const s=a.request.id,o=jr("session_request",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);this.events.emit(jr("session_request",a.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===Oc.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=Oc.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:Df("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Ts(r)){const{message:l}=ht("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:s,relays:o}=r;if(Ps(n)||await this.isValidPairingTopic(n),!pWe(o)){const{message:l}=ht("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(l)}!Ps(i)&&Y3(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Ps(a)&&Y3(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),Ps(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=hWe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Ts(r))throw new Error(ht("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:s}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const o=this.client.proposal.get(n),l=bS(i,"approve()");if(l)throw new Error(l.message);const c=gW(o.requiredNamespaces,i,"approve()");if(c)throw new Error(c.message);if(!pi(a,!0)){const{message:u}=ht("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(u)}Ps(s)||this.validateSessionProps(s,"sessionProperties")},this.isValidReject=async r=>{if(!Ts(r)){const{message:a}=ht("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(a)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!mWe(i)){const{message:a}=ht("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=r=>{if(!Ts(r)){const{message:c}=ht("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(c)}const{relay:n,controller:i,namespaces:a,expiry:s}=r;if(!cie(n)){const{message:c}=ht("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(c)}const o=oWe(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const l=bS(a,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(Cf(s)){const{message:c}=ht("EXPIRED","onSessionSettleRequest()");throw new Error(c)}},this.isValidUpdate=async r=>{if(!Ts(r)){const{message:l}=ht("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(l)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const a=this.client.session.get(n),s=bS(i,"update()");if(s)throw new Error(s.message);const o=gW(a.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async r=>{if(!Ts(r)){const{message:i}=ht("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Ts(r)){const{message:l}=ht("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:n,request:i,chainId:a,expiry:s}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!pW(o,a)){const{message:l}=ht("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(l)}if(!yWe(i)){const{message:l}=ht("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!bWe(o,a,i.method)){const{message:l}=ht("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(s&&!CWe(s,MS)){const{message:l}=ht("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${MS.min} and ${MS.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var n;if(!Ts(r)){const{message:s}=ht("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:i,response:a}=r;try{await this.isValidSessionTopic(i)}catch(s){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),s}if(!wWe(a)){const{message:s}=ht("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!Ts(r)){const{message:i}=ht("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Ts(r)){const{message:o}=ht("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(o)}const{topic:n,event:i,chainId:a}=r;await this.isValidSessionTopic(n);const{namespaces:s}=this.client.session.get(n);if(!pW(s,a)){const{message:o}=ht("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(o)}if(!vWe(i)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!xWe(s,a,i.name)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidDisconnect=async r=>{if(!Ts(r)){const{message:i}=ht("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:a,nonce:s}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!pi(i,!1))throw new Error("uri is required parameter");if(!pi(a,!1))throw new Error("domain is required parameter");if(!pi(s,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(l=>fg(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:o}=fg(n[0]);if(o!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:a,metadata:s,transportType:o}=r,l={verified:{verifyUrl:s.verifyUrl||Ry,validation:"UNKNOWN",origin:s.url||""}};try{if(o===Cn.link_mode){const u=this.getAppLinkIfEnabled(s,o);return l.verified.validation=u&&new URL(u).origin===new URL(s.url).origin?"VALID":"INVALID",l}const c=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:a,verifyUrl:s.verifyUrl});c&&(l.verified.origin=c.origin,l.verified.isScam=c.isScam,l.verified.validation=c.origin===new URL(s.url).origin?"VALID":"INVALID")}catch(c){this.client.logger.warn(c)}return this.client.logger.debug(`Verify context: ${JSON.stringify(l)}`),l},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!pi(i,!1)){const{message:a}=ht("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const a=this.recentlyDeletedLimit/2;for(const s of this.recentlyDeletedMap.keys()){if(i++>=a)break;this.recentlyDeletedMap.delete(s)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=ht("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,a,s,o,l,c,u,f,h;return!r||n!==Cn.link_mode?!1:((a=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:a.linkMode)===!0&&((o=(s=this.client.metadata)==null?void 0:s.redirect)==null?void 0:o.universal)!==void 0&&((c=(l=this.client.metadata)==null?void 0:l.redirect)==null?void 0:c.universal)!==""&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==void 0&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==""&&((h=r==null?void 0:r.redirect)==null?void 0:h.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=Zz(r,"topic")||"",i=decodeURIComponent(Zz(r,"wc_ev")||""),a=this.client.session.keys.includes(n);a&&this.client.session.update(n,{transportType:Cn.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:a})},this.registerLinkModeListeners=async()=>{var r;if(vj()||Ih()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Zi.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:a}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(O6)?this.client.auth.authKeys.get(O6):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:s,encoding:a===Cn.link_mode?O2:Rf});try{Aj(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o,attestation:i,transportType:a,encryptedId:gd(n)})):r7(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o,transportType:a}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o,transportType:a})}catch(l){this.client.logger.error(l)}}registerExpirerEvents(){this.client.core.expirer.on(Xo.expired,async e=>{const{topic:r,id:n}=Xne(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ht("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,ht("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(u0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(u0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!pi(e,!1)){const{message:r}=ht("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(Cf(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ht("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!pi(e,!1)){const{message:r}=ht("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(Cf(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=ht("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=ht("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(pi(e,!1)){const{message:r}=ht("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ht("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!gWe(e)){const{message:r}=ht("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(Cf(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=ht("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class UYe extends T1{constructor(e,r){super(e,r,CYe,Ij),this.core=e,this.logger=r}}let BYe=class extends T1{constructor(e,r){super(e,r,SYe,Ij),this.core=e,this.logger=r}};class zYe extends T1{constructor(e,r){super(e,r,IYe,Ij,n=>n.id),this.core=e,this.logger=r}}class WYe extends T1{constructor(e,r){super(e,r,NYe,i7,()=>O6),this.core=e,this.logger=r}}class HYe extends T1{constructor(e,r){super(e,r,LYe,i7),this.core=e,this.logger=r}}class GYe extends T1{constructor(e,r){super(e,r,jYe,i7,n=>n.id),this.core=e,this.logger=r}}class qYe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new WYe(this.core,this.logger),this.pairingTopics=new HYe(this.core,this.logger),this.requests=new GYe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let VYe=class zie extends GHe{constructor(e){super(e),this.protocol=Oie,this.version=Fie,this.name=IS.name,this.events=new gs.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||IS.name,this.metadata=(e==null?void 0:e.metadata)||Yne(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:fv(Xx({level:(e==null?void 0:e.logger)||IS.logger}));this.core=(e==null?void 0:e.core)||new _Ye(e),this.logger=ms(r,this.name),this.session=new BYe(this.core,this.logger),this.proposal=new UYe(this.core,this.logger),this.pendingRequest=new zYe(this.core,this.logger),this.engine=new FYe(this),this.auth=new qYe(this.core,this.logger)}static async init(e){const r=new zie(e);return await r.initialize(),r}get context(){return Zs(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),setTimeout(()=>{this.engine.processRelayMessageCache()},ct.toMiliseconds(ct.ONE_SECOND))}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var m8={exports:{}};/** +***************************************************************************** */var CT=function(t,e){return CT=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},CT(t,e)};function SGe(t,e){CT(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ST=function(){return ST=Object.assign||function(e){for(var r,n=1,i=arguments.length;n=0;o--)(s=t[o])&&(a=(i<3?s(a):i>3?s(e,r,a):s(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a}function MGe(t,e){return function(r,n){e(r,n,t)}}function TGe(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function kGe(t,e,r,n){function i(a){return a instanceof r?a:new r(function(s){s(a)})}return new(r||(r=Promise))(function(a,s){function o(u){try{c(n.next(u))}catch(f){s(f)}}function l(u){try{c(n.throw(u))}catch(f){s(f)}}function c(u){u.done?a(u.value):i(u.value).then(o,l)}c((n=n.apply(t,e||[])).next())})}function NGe(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,i,a,s;return s={next:o(0),throw:o(1),return:o(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function o(c){return function(u){return l([c,u])}}function l(c){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(a=c[0]&2?i.return:c[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,c[1])).done)return a;switch(i=0,a&&(c=[c[0]&2,a.value]),c[0]){case 0:case 1:a=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,i=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Bie(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,a=[],s;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(o){s={error:o}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return a}function $Ge(){for(var t=[],e=0;e1||o(h,g)})})}function o(h,g){try{l(n[h](g))}catch(m){f(a[0][3],m)}}function l(h){h.value instanceof sw?Promise.resolve(h.value.v).then(c,u):f(a[0][2],h)}function c(h){o("next",h)}function u(h){o("throw",h)}function f(h,g){h(g),a.shift(),a.length&&o(a[0][0],a[0][1])}}function DGe(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,a){e[i]=t[i]?function(s){return(r=!r)?{value:sw(t[i](s)),done:i==="return"}:a?a(s):s}:a}}function OGe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof AT=="function"?AT(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=t[a]&&function(s){return new Promise(function(o,l){s=t[a](s),i(o,l,s.done,s.value)})}}function i(a,s,o,l){Promise.resolve(l).then(function(c){a({value:c,done:o})},s)}}function FGe(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function UGe(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function BGe(t){return t&&t.__esModule?t:{default:t}}function zGe(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function WGe(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}const HGe=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return ST},__asyncDelegator:DGe,__asyncGenerator:RGe,__asyncValues:OGe,__await:sw,__awaiter:kGe,__classPrivateFieldGet:zGe,__classPrivateFieldSet:WGe,__createBinding:LGe,__decorate:IGe,__exportStar:jGe,__extends:SGe,__generator:NGe,__importDefault:BGe,__importStar:UGe,__makeTemplateObject:FGe,__metadata:TGe,__param:MGe,__read:Bie,__rest:AGe,__spread:$Ge,__spreadArrays:PGe,__values:AT},Symbol.toStringTag,{value:"Module"})),GGe=wh(HGe);var nd={},BW;function qGe(){if(BW)return nd;BW=1,Object.defineProperty(nd,"__esModule",{value:!0}),nd.isBrowserCryptoAvailable=nd.getSubtleCrypto=nd.getBrowerCrypto=void 0;function t(){return(Xt==null?void 0:Xt.crypto)||(Xt==null?void 0:Xt.msCrypto)||{}}nd.getBrowerCrypto=t;function e(){const n=t();return n.subtle||n.webkitSubtle}nd.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return nd.isBrowserCryptoAvailable=r,nd}var id={},zW;function VGe(){if(zW)return id;zW=1,Object.defineProperty(id,"__esModule",{value:!0}),id.isBrowser=id.isNode=id.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}id.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}id.isNode=e;function r(){return!t()&&!e()}return id.isBrowser=r,id}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=GGe;e.__exportStar(qGe(),t),e.__exportStar(VGe(),t)})(Uie);function fd(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function A0(t=6){return BigInt(fd(t))}function Wf(t,e,r){return{id:r||fd(),jsonrpc:"2.0",method:t,params:e}}function c7(t,e){return{id:t,jsonrpc:"2.0",result:e}}function u7(t,e,r){return{id:t,jsonrpc:"2.0",error:YGe(e)}}function YGe(t,e){return typeof t>"u"?UW(Die):(typeof t=="string"&&(t=Object.assign(Object.assign({},UW(Rj)),{message:t})),_Ge(t.code)&&(t=CGe(t.code)),t)}let KGe=class{},JGe=class extends KGe{constructor(){super()}},QGe=class extends JGe{constructor(e){super()}};const ZGe="^https?:",XGe="^wss?:";function eqe(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function zie(t,e){const r=eqe(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function WW(t){return zie(t,ZGe)}function HW(t){return zie(t,XGe)}function tqe(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Wie(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Dj(t){return Wie(t)&&"method"in t}function d7(t){return Wie(t)&&(Kc(t)||al(t))}function Kc(t){return"result"in t}function al(t){return"error"in t}let Tl=class extends QGe{constructor(e){super(e),this.events=new ys.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(Wf(e.method,e.params||[],e.id||A0().toString()),r)}async requestStrict(e,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(a){i(a)}this.events.on(`${e.id}`,a=>{al(a)?i(a.error):n(a.result)});try{await this.connection.send(e,r)}catch(a){i(a)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),d7(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}};const rqe=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),nqe=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",GW=t=>t.split("?")[0],qW=10,iqe=rqe();let aqe=class{constructor(e){if(this.url=e,this.events=new ys.EventEmitter,this.registering=!1,!HW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Kd(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!HW(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,n)=>{const i=Uie.isReactNative()?void 0:{rejectUnauthorized:!tqe(e)},a=new iqe(e,[],i);nqe()?a.onerror=s=>{const o=s;n(this.emitError(o.error))}:a.on("error",s=>{n(this.emitError(s))}),a.onopen=()=>{this.onOpen(a),r(a)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?l1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=u7(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return Fie(e,GW(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>qW&&this.events.setMaxListeners(qW)}emitError(e){const r=this.parseError(new Error((e==null?void 0:e.message)||`WebSocket connection failed for host: ${GW(this.url)}`));return this.events.emit("register_error",r),r}};var _8={exports:{}};_8.exports;(function(t,e){var r=200,n="__lodash_hash_undefined__",i=1,a=2,s=9007199254740991,o="[object Arguments]",l="[object Array]",c="[object AsyncFunction]",u="[object Boolean]",f="[object Date]",h="[object Error]",g="[object Function]",m="[object GeneratorFunction]",w="[object Map]",C="[object Number]",v="[object Null]",b="[object Object]",A="[object Promise]",S="[object Proxy]",j="[object RegExp]",F="[object Set]",I="[object String]",B="[object Symbol]",V="[object Undefined]",se="[object WeakMap]",Y="[object ArrayBuffer]",N="[object DataView]",k="[object Float32Array]",x="[object Float64Array]",E="[object Int8Array]",L="[object Int16Array]",O="[object Int32Array]",P="[object Uint8Array]",R="[object Uint8ClampedArray]",M="[object Uint16Array]",D="[object Uint32Array]",$=/[\\^$.*+?()[\]{}|]/g,X=/^\[object .+?Constructor\]$/,le=/^(?:0|[1-9]\d*)$/,H={};H[k]=H[x]=H[E]=H[L]=H[O]=H[P]=H[R]=H[M]=H[D]=!0,H[o]=H[l]=H[Y]=H[u]=H[N]=H[f]=H[h]=H[g]=H[w]=H[C]=H[b]=H[j]=H[F]=H[I]=H[se]=!1;var ee=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,J=typeof self=="object"&&self&&self.Object===Object&&self,te=ee||J||Function("return this")(),re=e&&!e.nodeType&&e,z=re&&!0&&t&&!t.nodeType&&t,G=z&&z.exports===re,Q=G&&ee.process,me=function(){try{return Q&&Q.binding&&Q.binding("util")}catch{}}(),be=me&&me.isTypedArray;function Ce(ge,Te){for(var Xe=-1,It=ge==null?0:ge.length,yn=0,gr=[];++Xe-1}function ue(ge,Te){var Xe=this.__data__,It=Nc(Xe,ge);return It<0?(++this.size,Xe.push([ge,Te])):Xe[It][1]=Te,this}cr.prototype.clear=br,cr.prototype.delete=Z,cr.prototype.get=ae,cr.prototype.has=de,cr.prototype.set=ue;function ve(ge){var Te=-1,Xe=ge==null?0:ge.length;for(this.clear();++Teyi))return!1;var wn=gr.get(ge);if(wn&&gr.get(Te))return wn==Te;var ci=-1,xs=!0,wi=Xe&a?new Lt:void 0;for(gr.set(ge,Te),gr.set(Te,ge);++ci-1&&ge%1==0&&ge-1&&ge%1==0&&ge<=s}function nb(ge){var Te=typeof ge;return ge!=null&&(Te=="object"||Te=="function")}function zh(ge){return ge!=null&&typeof ge=="object"}var ib=be?lt(be):Gv;function xE(ge){return vE(ge)?to(ge):qv(ge)}function mn(){return[]}function fn(){return!1}t.exports=bE})(_8,_8.exports);var sqe=_8.exports;const oqe=No(sqe),Hie="wc",Gie=2,C8="core",Tu=`${Hie}@2:${C8}:`,lqe={name:C8,logger:"error"},cqe={database:":memory:"},uqe="crypto",VW="client_ed25519_seed",dqe=ct.ONE_DAY,fqe="keychain",hqe="0.3",pqe="messages",gqe="0.3",YW=ct.SIX_HOURS,mqe="publisher",qie="irn",yqe="error",Vie="wss://relay.walletconnect.org",wqe="relayer",Zi={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},vqe="_subscription",Xo={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},bqe=.1,IT="2.17.3",Cn={link_mode:"link_mode",relay:"relay"},xqe="0.3",Eqe="WALLETCONNECT_CLIENT_ID",KW="WALLETCONNECT_LINK_MODE_APPS",uo={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},_qe="subscription",Cqe="0.3",Sqe=ct.FIVE_SECONDS*1e3,Aqe="pairing",Iqe="0.3",Y2={wc_pairingDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:ct.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:0},res:{ttl:ct.ONE_DAY,prompt:!1,tag:0}}},y0={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},Bl={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},Mqe="history",Tqe="0.3",kqe="expirer",nl={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},Nqe="0.3",Lqe="verify-api",jqe="https://verify.walletconnect.com",Yie="https://verify.walletconnect.org",Gy=Yie,$qe=`${Gy}/v3`,Pqe=[jqe,Yie],Rqe="echo",Dqe="https://echo.walletconnect.com",Hc={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},od={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},zl={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},r0={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},n0={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},K2={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},Oqe=.1,Fqe="event-client",Uqe=86400,Bqe="https://pulse.walletconnect.org/batch";function zqe(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,S=new Uint8Array(A);v!==b;){for(var j=m[v],F=0,I=A-1;(j!==0||F>>0,S[I]=j%o>>>0,j=j/o>>>0;if(j!==0)throw new Error("Non-zero carry");C=F,v++}for(var B=A-C;B!==A&&S[B]===0;)B++;for(var V=l.repeat(w);B>>0,A=new Uint8Array(b);m[w];){var S=r[m.charCodeAt(w)];if(S===255)return;for(var j=0,F=b-1;(S!==0||j>>0,A[F]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");v=j,w++}if(m[w]!==" "){for(var I=b-v;I!==b&&A[I]===0;)I++;for(var B=new Uint8Array(C+(b-I)),V=C;I!==b;)B[V++]=A[I++];return B}}}function g(m){var w=h(m);if(w)return w;throw new Error(`Non-${e} character`)}return{encode:f,decodeUnsafe:h,decode:g}}var Wqe=zqe,Hqe=Wqe;const Kie=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")},Gqe=t=>new TextEncoder().encode(t),qqe=t=>new TextDecoder().decode(t);class Vqe{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 Yqe{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 Jie(this,e)}}class Kqe{constructor(e){this.decoders=e}or(e){return Jie(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 Jie=(t,e)=>new Kqe({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class Jqe{constructor(e,r,n,i){this.name=e,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Vqe(e,r,n),this.decoder=new Yqe(e,r,i)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const f7=({name:t,prefix:e,encode:r,decode:n})=>new Jqe(t,e,r,n),Ev=({prefix:t,name:e,alphabet:r})=>{const{encode:n,decode:i}=Hqe(r,e);return f7({prefix:t,name:e,encode:n,decode:a=>Kie(i(a))})},Qqe=(t,e,r,n)=>{const i={};for(let u=0;u=8&&(o-=8,s[c++]=255&l>>o)}if(o>=r||255&l<<8-o)throw new SyntaxError("Unexpected end of data");return s},Zqe=(t,e,r)=>{const n=e[e.length-1]==="=",i=(1<r;)s-=r,a+=e[i&o>>s];if(s&&(a+=e[i&o<f7({prefix:e,name:t,encode(i){return Zqe(i,n,r)},decode(i){return Qqe(i,n,r,t)}}),Xqe=f7({prefix:"\0",name:"identity",encode:t=>qqe(t),decode:t=>Gqe(t)});var eVe=Object.freeze({__proto__:null,identity:Xqe});const tVe=_a({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var rVe=Object.freeze({__proto__:null,base2:tVe});const nVe=_a({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var iVe=Object.freeze({__proto__:null,base8:nVe});const aVe=Ev({prefix:"9",name:"base10",alphabet:"0123456789"});var sVe=Object.freeze({__proto__:null,base10:aVe});const oVe=_a({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),lVe=_a({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var cVe=Object.freeze({__proto__:null,base16:oVe,base16upper:lVe});const uVe=_a({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),dVe=_a({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),fVe=_a({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),hVe=_a({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),pVe=_a({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),gVe=_a({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),mVe=_a({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),yVe=_a({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),wVe=_a({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var vVe=Object.freeze({__proto__:null,base32:uVe,base32upper:dVe,base32pad:fVe,base32padupper:hVe,base32hex:pVe,base32hexupper:gVe,base32hexpad:mVe,base32hexpadupper:yVe,base32z:wVe});const bVe=Ev({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),xVe=Ev({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var EVe=Object.freeze({__proto__:null,base36:bVe,base36upper:xVe});const _Ve=Ev({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),CVe=Ev({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var SVe=Object.freeze({__proto__:null,base58btc:_Ve,base58flickr:CVe});const AVe=_a({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),IVe=_a({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),MVe=_a({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),TVe=_a({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var kVe=Object.freeze({__proto__:null,base64:AVe,base64pad:IVe,base64url:MVe,base64urlpad:TVe});const Qie=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),NVe=Qie.reduce((t,e,r)=>(t[r]=e,t),[]),LVe=Qie.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function jVe(t){return t.reduce((e,r)=>(e+=NVe[r],e),"")}function $Ve(t){const e=[];for(const r of t){const n=LVe[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(n)}return new Uint8Array(e)}const PVe=f7({prefix:"🚀",name:"base256emoji",encode:jVe,decode:$Ve});var RVe=Object.freeze({__proto__:null,base256emoji:PVe}),DVe=Zie,JW=128,OVe=127,FVe=~OVe,UVe=Math.pow(2,31);function Zie(t,e,r){e=e||[],r=r||0;for(var n=r;t>=UVe;)e[r++]=t&255|JW,t/=128;for(;t&FVe;)e[r++]=t&255|JW,t>>>=7;return e[r]=t|0,Zie.bytes=r-n+1,e}var BVe=MT,zVe=128,QW=127;function MT(t,n){var r=0,n=n||0,i=0,a=n,s,o=t.length;do{if(a>=o)throw MT.bytes=0,new RangeError("Could not decode varint");s=t[a++],r+=i<28?(s&QW)<=zVe);return MT.bytes=a-n,r}var WVe=Math.pow(2,7),HVe=Math.pow(2,14),GVe=Math.pow(2,21),qVe=Math.pow(2,28),VVe=Math.pow(2,35),YVe=Math.pow(2,42),KVe=Math.pow(2,49),JVe=Math.pow(2,56),QVe=Math.pow(2,63),ZVe=function(t){return t(Xie.encode(t,e,r),e),XW=t=>Xie.encodingLength(t),TT=(t,e)=>{const r=e.byteLength,n=XW(t),i=n+XW(r),a=new Uint8Array(i+r);return ZW(t,a,0),ZW(r,a,n),a.set(e,i),new eYe(t,r,e,a)};let eYe=class{constructor(e,r,n,i){this.code=e,this.size=r,this.digest=n,this.bytes=i}};const eae=({name:t,code:e,encode:r})=>new tYe(t,e,r);let tYe=class{constructor(e,r,n){this.name=e,this.code=r,this.encode=n}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?TT(this.code,r):r.then(n=>TT(this.code,n))}else throw Error("Unknown type, must be binary type")}};const tae=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),rYe=eae({name:"sha2-256",code:18,encode:tae("SHA-256")}),nYe=eae({name:"sha2-512",code:19,encode:tae("SHA-512")});var iYe=Object.freeze({__proto__:null,sha256:rYe,sha512:nYe});const rae=0,aYe="identity",nae=Kie,sYe=t=>TT(rae,nae(t)),oYe={code:rae,name:aYe,encode:nae,digest:sYe};var lYe=Object.freeze({__proto__:null,identity:oYe});new TextEncoder,new TextDecoder;const eH={...eVe,...rVe,...iVe,...sVe,...cVe,...vVe,...EVe,...SVe,...kVe,...RVe};({...iYe,...lYe});function cYe(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function iae(t,e,r,n){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:n}}}const tH=iae("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),$S=iae("ascii","a",t=>{let e="a";for(let r=0;r{t=t.substring(1);const e=cYe(t.length);for(let r=0;r{if(!this.initialized){const n=await this.getKeyChain();typeof n<"u"&&(this.keychain=n),this.initialized=!0}},this.has=n=>(this.isInitialized(),this.keychain.has(n)),this.set=async(n,i)=>{this.isInitialized(),this.keychain.set(n,i),await this.persist()},this.get=n=>{this.isInitialized();const i=this.keychain.get(n);if(typeof i>"u"){const{message:a}=ht("NO_MATCHING_KEY",`${this.name}: ${n}`);throw new Error(a)}return i},this.del=async n=>{this.isInitialized(),this.keychain.delete(n),await this.persist()},this.core=e,this.logger=ws(r,this.name)}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,wie(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?vie(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}};class hYe{constructor(e,r,n){this.core=e,this.logger=r,this.name=uqe,this.randomSessionIdentifier=xT(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=i=>(this.isInitialized(),this.keychain.has(i)),this.getClientId=async()=>{this.isInitialized();const i=await this.getClientSeed(),a=iW(i);return pie(a.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const i=eWe();return this.setPrivateKey(i.publicKey,i.privateKey)},this.signJWT=async i=>{this.isInitialized();const a=await this.getClientSeed(),s=iW(a),o=this.randomSessionIdentifier;return await oze(o,i,dqe,s)},this.generateSharedKey=(i,a,s)=>{this.isInitialized();const o=this.getPrivateKey(i),l=tWe(o,a);return this.setSymKey(l,s)},this.setSymKey=async(i,a)=>{this.isInitialized();const s=a||H6(i);return await this.keychain.set(s,i),s},this.deleteKeyPair=async i=>{this.isInitialized(),await this.keychain.del(i)},this.deleteSymKey=async i=>{this.isInitialized(),await this.keychain.del(i)},this.encode=async(i,a,s)=>{this.isInitialized();const o=Tie(s),l=Kd(a);if(vW(o))return nWe(l,s==null?void 0:s.encoding);if(wW(o)){const h=o.senderPublicKey,g=o.receiverPublicKey;i=await this.generateSharedKey(h,g)}const c=this.getSymKey(i),{type:u,senderPublicKey:f}=o;return rWe({type:u,symKey:c,message:l,senderPublicKey:f,encoding:s==null?void 0:s.encoding})},this.decode=async(i,a,s)=>{this.isInitialized();const o=sWe(a,s);if(vW(o)){const l=aWe(a,s==null?void 0:s.encoding);return l1(l)}if(wW(o)){const l=o.receiverPublicKey,c=o.senderPublicKey;i=await this.generateSharedKey(l,c)}try{const l=this.getSymKey(i),c=iWe({symKey:l,encoded:a,encoding:s==null?void 0:s.encoding});return l1(c)}catch(l){this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=(i,a=zf)=>{const s=rw({encoded:i,encoding:a});return u1(s.type)},this.getPayloadSenderPublicKey=(i,a=zf)=>{const s=rw({encoded:i,encoding:a});return s.senderPublicKey?aa(s.senderPublicKey,cs):void 0},this.core=e,this.logger=ws(r,this.name),this.keychain=n||new fYe(this.core,this.logger)}get context(){return eo(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(VW)}catch{e=xT(),await this.keychain.set(VW,e)}return dYe(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class pYe extends oGe{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=pqe,this.version=gqe,this.initialized=!1,this.storagePrefix=Tu,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const n=await this.getRelayerMessages();typeof n<"u"&&(this.messages=n),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(n){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(n)}finally{this.initialized=!0}}},this.set=async(n,i)=>{this.isInitialized();const a=xd(i);let s=this.messages.get(n);return typeof s>"u"&&(s={}),typeof s[a]<"u"||(s[a]=i,this.messages.set(n,s),await this.persist()),a},this.get=n=>{this.isInitialized();let i=this.messages.get(n);return typeof i>"u"&&(i={}),i},this.has=(n,i)=>{this.isInitialized();const a=this.get(n),s=xd(i);return typeof a[s]<"u"},this.del=async n=>{this.isInitialized(),this.messages.delete(n),await this.persist()},this.logger=ws(e,this.name),this.core=r}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,wie(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?vie(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}var gYe=Object.defineProperty,mYe=Object.defineProperties,yYe=Object.getOwnPropertyDescriptors,rH=Object.getOwnPropertySymbols,wYe=Object.prototype.hasOwnProperty,vYe=Object.prototype.propertyIsEnumerable,nH=(t,e,r)=>e in t?gYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,iH=(t,e)=>{for(var r in e||(e={}))wYe.call(e,r)&&nH(t,r,e[r]);if(rH)for(var r of rH(e))vYe.call(e,r)&&nH(t,r,e[r]);return t},aH=(t,e)=>mYe(t,yYe(e));class bYe extends lGe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new ys.EventEmitter,this.name=mqe,this.queue=new Map,this.publishTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.initialPublishTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.needsTransportRestart=!1,this.publish=async(n,i,a)=>{var s;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:n,message:i,opts:a}});const o=(a==null?void 0:a.ttl)||YW,l=v8(a),c=(a==null?void 0:a.prompt)||!1,u=(a==null?void 0:a.tag)||0,f=(a==null?void 0:a.id)||A0().toString(),h={topic:n,message:i,opts:{ttl:o,relay:l,prompt:c,tag:u,id:f,attestation:a==null?void 0:a.attestation}},g=`Failed to publish payload, please try again. id:${f} tag:${u}`;try{const m=new Promise(async w=>{const C=({id:b})=>{h.opts.id===b&&(this.removeRequestFromQueue(b),this.relayer.events.removeListener(Zi.publish,C),w(h))};this.relayer.events.on(Zi.publish,C);const v=Bf(new Promise((b,A)=>{this.rpcPublish({topic:n,message:i,ttl:o,prompt:c,tag:u,id:f,attestation:a==null?void 0:a.attestation}).then(b).catch(S=>{this.logger.warn(S,S==null?void 0:S.message),A(S)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${f} tag:${u}`);try{await v,this.events.removeListener(Zi.publish,C)}catch(b){this.queue.set(f,aH(iH({},h),{attempt:1})),this.logger.warn(b,b==null?void 0:b.message)}});this.logger.trace({type:"method",method:"publish",params:{id:f,topic:n,message:i,opts:a}}),await Bf(m,this.publishTimeout,g)}catch(m){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(m),(s=a==null?void 0:a.internal)!=null&&s.throwOnFailedPublish)throw m}finally{this.queue.delete(f)}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.relayer=e,this.logger=ws(r,this.name),this.registerEventListeners()}get context(){return eo(this.logger)}async rpcPublish(e){var r,n,i,a;const{topic:s,message:o,ttl:l=YW,prompt:c,tag:u,id:f,attestation:h}=e,g={method:my(v8().protocol).publish,params:{topic:s,message:o,ttl:l,prompt:c,tag:u,attestation:h},id:f};Os((r=g.params)==null?void 0:r.prompt)&&((n=g.params)==null||delete n.prompt),Os((i=g.params)==null?void 0:i.tag)&&((a=g.params)==null||delete a.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:g});const m=await this.relayer.request(g);return this.relayer.events.emit(Zi.publish,e),this.logger.debug("Successfully Published Payload"),m}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,r)=>{const n=e.attempt+1;this.queue.set(r,aH(iH({},e),{attempt:n}));const{topic:i,message:a,opts:s,attestation:o}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${n}`),await this.rpcPublish({topic:i,message:a,ttl:s.ttl,prompt:s.prompt,tag:s.tag,id:s.id,attestation:o}),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(Gm.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Zi.connection_stalled);return}this.checkQueue()}),this.relayer.on(Zi.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class xYe{constructor(){this.map=new Map,this.set=(e,r)=>{const n=this.get(e);this.exists(e,r)||this.map.set(e,[...n,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const n=this.get(e);if(!this.exists(e,r))return;const i=n.filter(a=>a!==r);if(!i.length){this.map.delete(e);return}this.map.set(e,i)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var EYe=Object.defineProperty,_Ye=Object.defineProperties,CYe=Object.getOwnPropertyDescriptors,sH=Object.getOwnPropertySymbols,SYe=Object.prototype.hasOwnProperty,AYe=Object.prototype.propertyIsEnumerable,oH=(t,e,r)=>e in t?EYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,J2=(t,e)=>{for(var r in e||(e={}))SYe.call(e,r)&&oH(t,r,e[r]);if(sH)for(var r of sH(e))AYe.call(e,r)&&oH(t,r,e[r]);return t},PS=(t,e)=>_Ye(t,CYe(e));class IYe extends dGe{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new xYe,this.events=new ys.EventEmitter,this.name=_qe,this.version=Cqe,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=Tu,this.subscribeTimeout=ct.toMiliseconds(ct.ONE_MINUTE),this.initialSubscribeTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.batchSubscribeTopicsLimit=500,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId(),await this.restore()),this.initialized=!0},this.subscribe=async(n,i)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}});try{const a=v8(i),s={topic:n,relay:a,transportType:i==null?void 0:i.transportType};this.pending.set(n,s);const o=await this.rpcSubscribe(n,a,i);return typeof o=="string"&&(this.onSubscribe(o,s),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:n,opts:i}})),o}catch(a){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(a),a}},this.unsubscribe=async(n,i)=>{await this.restartToComplete(),this.isInitialized(),typeof(i==null?void 0:i.id)<"u"?await this.unsubscribeById(n,i.id,i):await this.unsubscribeByTopic(n,i)},this.isSubscribed=async n=>{if(this.topics.includes(n))return!0;const i=`${this.pendingSubscriptionWatchLabel}_${n}`;return await new Promise((a,s)=>{const o=new ct.Watch;o.start(i);const l=setInterval(()=>{(!this.pending.has(n)&&this.topics.includes(n)||this.cached.some(c=>c.topic===n))&&(clearInterval(l),o.stop(i),a(!0)),o.elapsed(i)>=Sqe&&(clearInterval(l),o.stop(i),s(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{await this.restore(),await this.onRestart()},this.checkPending=async()=>{if(this.pending.size===0&&(!this.initialized||!this.relayer.connected))return;const n=[];this.pending.forEach(i=>{n.push(i)}),await this.batchSubscribe(n)},this.registerEventListeners=()=>{this.relayer.core.heartbeat.on(Gm.pulse,async()=>{await this.checkPending()}),this.events.on(uo.created,async n=>{const i=uo.created;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()}),this.events.on(uo.deleted,async n=>{const i=uo.deleted;this.logger.info(`Emitting ${i}`),this.logger.debug({type:"event",event:i,data:n}),await this.persist()})},this.relayer=e,this.logger=ws(r,this.name),this.clientId=""}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let n=!1;try{n=this.getSubscription(e).topic===r}catch{}return n}reset(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const n=this.topicMap.get(e);await Promise.all(n.map(async i=>await this.unsubscribeById(e,i,r)))}async unsubscribeById(e,r,n){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}});try{const i=v8(n);await this.rpcUnsubscribe(e,r,i);const a=ln("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,a),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:n}})}catch(i){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(i),i}}async rpcSubscribe(e,r,n){var i;(n==null?void 0:n.transportType)===Cn.relay&&await this.restartToComplete();const a={method:my(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:a});const s=(i=n==null?void 0:n.internal)==null?void 0:i.throwOnFailedPublish;try{const o=this.getSubscriptionId(e);if((n==null?void 0:n.transportType)===Cn.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(a).catch(u=>this.logger.warn(u))},ct.toMiliseconds(ct.ONE_SECOND)),o;const l=new Promise(async u=>{const f=h=>{h.topic===e&&(this.events.removeListener(uo.created,f),u(h.id))};this.events.on(uo.created,f);try{const h=await Bf(new Promise((g,m)=>{this.relayer.request(a).catch(w=>{this.logger.warn(w,w==null?void 0:w.message),m(w)}).then(g)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(uo.created,f),u(h)}catch{}}),c=await Bf(l,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!c&&s)throw new Error(`Subscribing to ${e} failed, please try again`);return c?o:null}catch(o){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Zi.connection_stalled),s)throw o}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,n={method:my(r.protocol).batchSubscribe,params:{topics:e.map(i=>i.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{await await Bf(new Promise(i=>{this.relayer.request(n).catch(a=>this.logger.warn(a)).then(i)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(Zi.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,n={method:my(r.protocol).batchFetchMessages,params:{topics:e.map(a=>a.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});let i;try{i=await await Bf(new Promise((a,s)=>{this.relayer.request(n).catch(o=>{this.logger.warn(o),s(o)}).then(a)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(Zi.connection_stalled)}return i}rpcUnsubscribe(e,r,n){const i={method:my(n.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i}),this.relayer.request(i)}onSubscribe(e,r){this.setSubscription(e,PS(J2({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,J2({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,n){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,n),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,J2({},r)),this.topicMap.set(r.topic,e),this.events.emit(uo.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const n=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(n.topic,e),this.events.emit(uo.deleted,PS(J2({},n),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(uo.sync)}async onRestart(){if(this.cached.length){const e=[...this.cached],r=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let n=0;n"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(e.map(r=>PS(J2({},r),{id:this.getSubscriptionId(r.topic)}))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(await Tze(ct.toMiliseconds(ct.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(r.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){!this.relayer.connected&&!this.relayer.connecting&&await this.relayer.transportOpen()}getSubscriptionId(e){return xd(e+this.clientId)}}var MYe=Object.defineProperty,lH=Object.getOwnPropertySymbols,TYe=Object.prototype.hasOwnProperty,kYe=Object.prototype.propertyIsEnumerable,cH=(t,e,r)=>e in t?MYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,uH=(t,e)=>{for(var r in e||(e={}))TYe.call(e,r)&&cH(t,r,e[r]);if(lH)for(var r of lH(e))kYe.call(e,r)&&cH(t,r,e[r]);return t};class NYe extends cGe{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new ys.EventEmitter,this.name=wqe,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.hasExperiencedNetworkDisruption=!1,this.heartBeatTimeout=ct.toMiliseconds(ct.THIRTY_SECONDS+ct.FIVE_SECONDS),this.requestsInFlight=[],this.connectTimeout=ct.toMiliseconds(ct.ONE_SECOND*15),this.request=async r=>{var n,i;this.logger.debug("Publishing Request Payload");const a=r.id||A0().toString();await this.toEstablishConnection();try{this.logger.trace({id:a,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - publishing...");const s=`${a}:${((i=r.params)==null?void 0:i.tag)||""}`;this.requestsInFlight.push(s);const o=await this.provider.request(r);return this.requestsInFlight=this.requestsInFlight.filter(l=>l!==s),o}catch(s){throw this.logger.debug(`Failed to Publish Request: ${a}`),s}},this.resetPingTimeout=()=>{if(y8())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,n,i;this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),(i=(n=(r=this.provider)==null?void 0:r.connection)==null?void 0:n.socket)==null||i.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r,r==null?void 0:r.message)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.warn({},"Relayer connected 🛜"),this.startPingTimeout(),this.events.emit(Zi.connect)},this.onDisconnectHandler=()=>{this.logger.warn({},"Relayer disconnected 🛑"),this.requestsInFlight=[],this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.fatal(r,`Fatal socket error: ${r==null?void 0:r.message}`),this.events.emit(Zi.error,r),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(Xo.payload,this.onPayloadHandler),this.provider.on(Xo.connect,this.onConnectHandler),this.provider.on(Xo.disconnect,this.onDisconnectHandler),this.provider.on(Xo.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ws(e.logger,this.name):bv(l7({level:e.logger||yqe})),this.messages=new pYe(this.logger,e.core),this.subscriber=new IYe(this,this.logger),this.publisher=new bYe(this,this.logger),this.relayUrl=(e==null?void 0:e.relayUrl)||Vie,this.projectId=e.projectId,mze()?this.packageName=cW():yze()&&(this.bundleId=cW()),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.cached.length>0)try{await this.transportOpen()}catch(e){this.logger.warn(e,e==null?void 0:e.message)}}get context(){return eo(this.logger)}get connected(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===1}get connecting(){var e,r,n;return((n=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:n.readyState)===0}async publish(e,r,n){this.isInitialized(),await this.publisher.publish(e,r,n),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now(),transportType:Cn.relay})}async subscribe(e,r){var n,i,a;this.isInitialized(),(!(r!=null&&r.transportType)||(r==null?void 0:r.transportType)==="relay")&&await this.toEstablishConnection();const s=typeof((n=r==null?void 0:r.internal)==null?void 0:n.throwOnFailedPublish)>"u"?!0:(i=r==null?void 0:r.internal)==null?void 0:i.throwOnFailedPublish;let o=((a=this.subscriber.topicMap.get(e))==null?void 0:a[0])||"",l;const c=u=>{u.topic===e&&(this.subscriber.off(uo.created,c),l())};return await Promise.all([new Promise(u=>{l=u,this.subscriber.on(uo.created,c)}),new Promise(async(u,f)=>{o=await this.subscriber.subscribe(e,uH({internal:{throwOnFailedPublish:s}},r)).catch(h=>{s&&f(h)})||o,u()})]),o}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await Bf(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(r,n)=>{await this.connect(e).then(r).catch(n).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw new Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),!this.connectionAttemptInProgress&&(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await kW())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if((e==null?void 0:e.length)===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((n,i)=>n.publishedAt-i.publishedAt);this.logger.debug(`Batch of ${r.length} message events sorted`);for(const n of r)try{await this.onMessageEvent(n)}catch(i){this.logger.warn(i,"Error while processing batch message event: "+(i==null?void 0:i.message))}this.logger.trace(`Batch of ${r.length} message events processed`)}async onLinkMessageEvent(e,r){const{topic:n}=e;if(!r.sessionExists){const i=Li(ct.FIVE_MINUTES),a={topic:n,expiry:i,relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(n,a)}this.events.emit(Zi.message,e),await this.recordMessageEvent(e)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let r=1;for(;r<6;){try{this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${r}...`),await this.createProvider(),await new Promise(async(n,i)=>{const a=()=>{i(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Xo.disconnect,a),await Bf(new Promise((s,o)=>{this.provider.connect().then(s).catch(o)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{i(s)}).finally(()=>{this.provider.off(Xo.disconnect,a),clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),await new Promise(async(s,o)=>{const l=()=>{o(new Error("Connection interrupted while trying to subscribe"))};this.provider.once(Xo.disconnect,l),await this.subscriber.start().then(s).catch(o).finally(()=>{this.provider.off(Xo.disconnect,l)})}),this.hasExperiencedNetworkDisruption=!1,n()})}catch(n){await this.subscriber.stop();const i=n;this.logger.warn({},i.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${r}`);break}await new Promise(n=>setTimeout(n,ct.toMiliseconds(r*1))),r++}}startPingTimeout(){var e,r,n,i,a;if(y8())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((a=(i=(n=this.provider)==null?void 0:n.connection)==null?void 0:i.socket)==null||a.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(s){this.logger.warn(s,s==null?void 0:s.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new Tl(new aqe(xze({sdkVersion:IT,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:n}=e;await this.messages.set(r,n)}async shouldIgnoreMessageEvent(e){const{topic:r,message:n}=e;if(!n||n.length===0)return this.logger.warn(`Ignoring invalid/empty message: ${n}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.warn(`Ignoring message for non-subscribed topic ${r}`),!0;const i=this.messages.has(r,n);return i&&this.logger.warn(`Ignoring duplicate message: ${n}`),i}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Dj(e)){if(!e.method.endsWith(vqe))return;const r=e.params,{topic:n,message:i,publishedAt:a,attestation:s}=r.data,o={topic:n,message:i,publishedAt:a,transportType:Cn.relay,attestation:s};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(uH({type:"event",event:r.id},o)),this.events.emit(r.id,o),await this.acknowledgePayload(e),await this.onMessageEvent(o)}else d7(e)&&this.events.emit(Zi.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Zi.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=c7(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(Xo.payload,this.onPayloadHandler),this.provider.off(Xo.connect,this.onConnectHandler),this.provider.off(Xo.disconnect,this.onDisconnectHandler),this.provider.off(Xo.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await kW();XWe(async r=>{e!==r&&(e=r,r?await this.transportOpen().catch(n=>this.logger.error(n,n==null?void 0:n.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),clearTimeout(this.pingTimeout),this.events.emit(Zi.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||this.connectPromise||(this.reconnectTimeout=setTimeout(async()=>{clearTimeout(this.reconnectTimeout),await this.transportOpen().catch(e=>this.logger.error(e,e==null?void 0:e.message))},ct.toMiliseconds(bqe))))}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&await this.transportOpen()}}var LYe=Object.defineProperty,dH=Object.getOwnPropertySymbols,jYe=Object.prototype.hasOwnProperty,$Ye=Object.prototype.propertyIsEnumerable,fH=(t,e,r)=>e in t?LYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,hH=(t,e)=>{for(var r in e||(e={}))jYe.call(e,r)&&fH(t,r,e[r]);if(dH)for(var r of dH(e))$Ye.call(e,r)&&fH(t,r,e[r]);return t};class R1 extends uGe{constructor(e,r,n,i=Tu,a=void 0){super(e,r,n,i),this.core=e,this.logger=r,this.name=n,this.map=new Map,this.version=xqe,this.cached=[],this.initialized=!1,this.storagePrefix=Tu,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(s=>{this.getKey&&s!==null&&!Os(s)?this.map.set(this.getKey(s),s):kWe(s)?this.map.set(s.id,s):NWe(s)&&this.map.set(s.topic,s)}),this.cached=[],this.initialized=!0)},this.set=async(s,o)=>{this.isInitialized(),this.map.has(s)?await this.update(s,o):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:s,value:o}),this.map.set(s,o),await this.persist())},this.get=s=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:s}),this.getData(s)),this.getAll=s=>(this.isInitialized(),s?this.values.filter(o=>Object.keys(s).every(l=>oqe(o[l],s[l]))):this.values),this.update=async(s,o)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:s,update:o});const l=hH(hH({},this.getData(s)),o);this.map.set(s,l),await this.persist()},this.delete=async(s,o)=>{this.isInitialized(),this.map.has(s)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:s,reason:o}),this.map.delete(s),this.addToRecentlyDeleted(s),await this.persist())},this.logger=ws(r,this.name),this.storagePrefix=i,this.getKey=a}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:i}=ht("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class PYe{constructor(e,r){this.core=e,this.logger=r,this.name=Aqe,this.version=Iqe,this.events=new LL,this.initialized=!1,this.storagePrefix=Tu,this.ignoredPayloadTypes=[Ld],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:n})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...n])]},this.create=async n=>{this.isInitialized();const i=xT(),a=await this.core.crypto.setSymKey(i),s=Li(ct.FIVE_MINUTES),o={protocol:qie},l={topic:a,expiry:s,relay:o,active:!1,methods:n==null?void 0:n.methods},c=CW({protocol:this.core.protocol,version:this.core.version,topic:a,symKey:i,relay:o,expiryTimestamp:s,methods:n==null?void 0:n.methods});return this.events.emit(y0.create,l),this.core.expirer.set(a,s),await this.pairings.set(a,l),await this.core.relayer.subscribe(a,{transportType:n==null?void 0:n.transportType}),{topic:a,uri:c}},this.pair=async n=>{this.isInitialized();const i=this.core.eventClient.createEvent({properties:{topic:n==null?void 0:n.uri,trace:[Hc.pairing_started]}});this.isValidPair(n,i);const{topic:a,symKey:s,relay:o,expiryTimestamp:l,methods:c}=_W(n.uri);i.props.properties.topic=a,i.addTrace(Hc.pairing_uri_validation_success),i.addTrace(Hc.pairing_uri_not_expired);let u;if(this.pairings.keys.includes(a)){if(u=this.pairings.get(a),i.addTrace(Hc.existing_pairing),u.active)throw i.setError(od.active_pairing_already_exists),new Error(`Pairing already exists: ${a}. Please try again with a new connection URI.`);i.addTrace(Hc.pairing_not_expired)}const f=l||Li(ct.FIVE_MINUTES),h={topic:a,relay:o,expiry:f,active:!1,methods:c};this.core.expirer.set(a,f),await this.pairings.set(a,h),i.addTrace(Hc.store_new_pairing),n.activatePairing&&await this.activate({topic:a}),this.events.emit(y0.create,h),i.addTrace(Hc.emit_inactive_pairing),this.core.crypto.keychain.has(a)||await this.core.crypto.setSymKey(s,a),i.addTrace(Hc.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{i.setError(od.no_internet_connection)}try{await this.core.relayer.subscribe(a,{relay:o})}catch(g){throw i.setError(od.subscribe_pairing_topic_failure),g}return i.addTrace(Hc.subscribe_pairing_topic_success),h},this.activate=async({topic:n})=>{this.isInitialized();const i=Li(ct.THIRTY_DAYS);this.core.expirer.set(n,i),await this.pairings.update(n,{active:!0,expiry:i})},this.ping=async n=>{this.isInitialized(),await this.isValidPing(n);const{topic:i}=n;if(this.pairings.keys.includes(i)){const a=await this.sendRequest(i,"wc_pairingPing",{}),{done:s,resolve:o,reject:l}=c0();this.events.once(jr("pairing_ping",a),({error:c})=>{c?l(c):o()}),await s()}},this.updateExpiry=async({topic:n,expiry:i})=>{this.isInitialized(),await this.pairings.update(n,{expiry:i})},this.updateMetadata=async({topic:n,metadata:i})=>{this.isInitialized(),await this.pairings.update(n,{peerMetadata:i})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async n=>{this.isInitialized(),await this.isValidDisconnect(n);const{topic:i}=n;this.pairings.keys.includes(i)&&(await this.sendRequest(i,"wc_pairingDelete",ln("USER_DISCONNECTED")),await this.deletePairing(i))},this.formatUriFromPairing=n=>{this.isInitialized();const{topic:i,relay:a,expiry:s,methods:o}=n,l=this.core.crypto.keychain.get(i);return CW({protocol:this.core.protocol,version:this.core.version,topic:i,symKey:l,relay:a,expiryTimestamp:s,methods:o})},this.sendRequest=async(n,i,a)=>{const s=Wf(i,a),o=await this.core.crypto.encode(n,s),l=Y2[i].req;return this.core.history.set(n,s),this.core.relayer.publish(n,o,l),s.id},this.sendResult=async(n,i,a)=>{const s=c7(n,a),o=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),c=Y2[l.request.method].res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(s)},this.sendError=async(n,i,a)=>{const s=u7(n,a),o=await this.core.crypto.encode(i,s),l=await this.core.history.get(i,n),c=Y2[l.request.method]?Y2[l.request.method].res:Y2.unregistered_method.res;await this.core.relayer.publish(i,o,c),await this.core.history.resolve(s)},this.deletePairing=async(n,i)=>{await this.core.relayer.unsubscribe(n),await Promise.all([this.pairings.delete(n,ln("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(n),i?Promise.resolve():this.core.expirer.del(n)])},this.cleanup=async()=>{const n=this.pairings.getAll().filter(i=>kf(i.expiry));await Promise.all(n.map(i=>this.deletePairing(i.topic)))},this.onRelayEventRequest=n=>{const{topic:i,payload:a}=n;switch(a.method){case"wc_pairingPing":return this.onPairingPingRequest(i,a);case"wc_pairingDelete":return this.onPairingDeleteRequest(i,a);default:return this.onUnknownRpcMethodRequest(i,a)}},this.onRelayEventResponse=async n=>{const{topic:i,payload:a}=n,s=(await this.core.history.get(i,a.id)).request.method;switch(s){case"wc_pairingPing":return this.onPairingPingResponse(i,a);default:return this.onUnknownRpcMethodResponse(s)}},this.onPairingPingRequest=async(n,i)=>{const{id:a}=i;try{this.isValidPing({topic:n}),await this.sendResult(a,n,!0),this.events.emit(y0.ping,{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onPairingPingResponse=(n,i)=>{const{id:a}=i;setTimeout(()=>{Kc(i)?this.events.emit(jr("pairing_ping",a),{}):al(i)&&this.events.emit(jr("pairing_ping",a),{error:i.error})},500)},this.onPairingDeleteRequest=async(n,i)=>{const{id:a}=i;try{this.isValidDisconnect({topic:n}),await this.deletePairing(n),this.events.emit(y0.delete,{id:a,topic:n})}catch(s){await this.sendError(a,n,s),this.logger.error(s)}},this.onUnknownRpcMethodRequest=async(n,i)=>{const{id:a,method:s}=i;try{if(this.registeredMethods.includes(s))return;const o=ln("WC_METHOD_UNSUPPORTED",s);await this.sendError(a,n,o),this.logger.error(o)}catch(o){await this.sendError(a,n,o),this.logger.error(o)}},this.onUnknownRpcMethodResponse=n=>{this.registeredMethods.includes(n)||this.logger.error(ln("WC_METHOD_UNSUPPORTED",n))},this.isValidPair=(n,i)=>{var a;if(!Ls(n)){const{message:o}=ht("MISSING_OR_INVALID",`pair() params: ${n}`);throw i.setError(od.malformed_pairing_uri),new Error(o)}if(!TWe(n.uri)){const{message:o}=ht("MISSING_OR_INVALID",`pair() uri: ${n.uri}`);throw i.setError(od.malformed_pairing_uri),new Error(o)}const s=_W(n==null?void 0:n.uri);if(!((a=s==null?void 0:s.relay)!=null&&a.protocol)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#relay-protocol");throw i.setError(od.malformed_pairing_uri),new Error(o)}if(!(s!=null&&s.symKey)){const{message:o}=ht("MISSING_OR_INVALID","pair() uri#symKey");throw i.setError(od.malformed_pairing_uri),new Error(o)}if(s!=null&&s.expiryTimestamp&&ct.toMiliseconds(s==null?void 0:s.expiryTimestamp){if(!Ls(n)){const{message:a}=ht("MISSING_OR_INVALID",`ping() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidDisconnect=async n=>{if(!Ls(n)){const{message:a}=ht("MISSING_OR_INVALID",`disconnect() params: ${n}`);throw new Error(a)}const{topic:i}=n;await this.isValidPairingTopic(i)},this.isValidPairingTopic=async n=>{if(!pi(n,!1)){const{message:i}=ht("MISSING_OR_INVALID",`pairing topic should be a string: ${n}`);throw new Error(i)}if(!this.pairings.keys.includes(n)){const{message:i}=ht("NO_MATCHING_KEY",`pairing topic doesn't exist: ${n}`);throw new Error(i)}if(kf(this.pairings.get(n).expiry)){await this.deletePairing(n);const{message:i}=ht("EXPIRED",`pairing topic: ${n}`);throw new Error(i)}},this.core=e,this.logger=ws(r,this.name),this.pairings=new R1(this.core,this.logger,this.name,this.storagePrefix)}get context(){return eo(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Zi.message,async e=>{const{topic:r,message:n,transportType:i}=e;if(!this.pairings.keys.includes(r)||i===Cn.link_mode||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n)))return;const a=await this.core.crypto.decode(r,n);try{Dj(a)?(this.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a})):d7(a)&&(await this.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a}),this.core.history.delete(r,a.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(nl.expired,async e=>{const{topic:r}=xie(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(y0.expire,{topic:r}))})}}class RYe extends sGe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new ys.EventEmitter,this.name=Mqe,this.version=Tqe,this.cached=[],this.initialized=!1,this.storagePrefix=Tu,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.records.set(n.id,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(n,i,a)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:n,request:i,chainId:a}),this.records.has(i.id))return;const s={id:i.id,topic:n,request:{method:i.method,params:i.params||null},chainId:a,expiry:Li(ct.THIRTY_DAYS)};this.records.set(s.id,s),this.persist(),this.events.emit(Bl.created,s)},this.resolve=async n=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:n}),!this.records.has(n.id))return;const i=await this.getRecord(n.id);typeof i.response>"u"&&(i.response=al(n)?{error:n.error}:{result:n.result},this.records.set(i.id,i),this.persist(),this.events.emit(Bl.updated,i))},this.get=async(n,i)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:n,id:i}),await this.getRecord(i)),this.delete=(n,i)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:i}),this.values.forEach(a=>{if(a.topic===n){if(typeof i<"u"&&a.id!==i)return;this.records.delete(a.id),this.events.emit(Bl.deleted,a)}}),this.persist()},this.exists=async(n,i)=>(this.isInitialized(),this.records.has(i)?(await this.getRecord(i)).topic===n:!1),this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ws(r,this.name)}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const n={topic:r.topic,request:Wf(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(n)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(n)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(Bl.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(Bl.created,e=>{const r=Bl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Bl.updated,e=>{const r=Bl.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(Bl.deleted,e=>{const r=Bl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(Gm.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{ct.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(Bl.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class DYe extends fGe{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new ys.EventEmitter,this.name=kqe,this.version=Nqe,this.cached=[],this.initialized=!1,this.storagePrefix=Tu,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(n=>this.expirations.set(n.target,n)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=n=>{try{const i=this.formatTarget(n);return typeof this.getExpiration(i)<"u"}catch{return!1}},this.set=(n,i)=>{this.isInitialized();const a=this.formatTarget(n),s={target:a,expiry:i};this.expirations.set(a,s),this.checkExpiry(a,s),this.events.emit(nl.created,{target:a,expiration:s})},this.get=n=>{this.isInitialized();const i=this.formatTarget(n);return this.getExpiration(i)},this.del=n=>{if(this.isInitialized(),this.has(n)){const i=this.formatTarget(n),a=this.getExpiration(i);this.expirations.delete(i),this.events.emit(nl.deleted,{target:i,expiration:a})}},this.on=(n,i)=>{this.events.on(n,i)},this.once=(n,i)=>{this.events.once(n,i)},this.off=(n,i)=>{this.events.off(n,i)},this.removeListener=(n,i)=>{this.events.removeListener(n,i)},this.logger=ws(r,this.name)}get context(){return eo(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return Eze(e);if(typeof e=="number")return _ze(e);const{message:r}=ht("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(nl.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=ht("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:n}=ht("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(n),new Error(n)}return r}checkExpiry(e,r){const{expiry:n}=r;ct.toMiliseconds(n)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(nl.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(Gm.pulse,()=>this.checkExpirations()),this.events.on(nl.created,e=>{const r=nl.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(nl.expired,e=>{const r=nl.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(nl.deleted,e=>{const r=nl.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}}class OYe extends hGe{constructor(e,r,n){super(e,r,n),this.core=e,this.logger=r,this.store=n,this.name=Lqe,this.verifyUrlV3=$qe,this.storagePrefix=Tu,this.version=Gie,this.init=async()=>{var i;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&ct.toMiliseconds((i=this.publicKey)==null?void 0:i.expiresAt){if(!gv()||this.isDevEnv)return;const a=window.location.origin,{id:s,decryptedId:o}=i,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${a}&id=${s}&decryptedId=${o}`;try{const c=cv(),u=this.startAbortTimer(ct.ONE_SECOND*5),f=await new Promise((h,g)=>{const m=()=>{window.removeEventListener("message",C),c.body.removeChild(w),g("attestation aborted")};this.abortController.signal.addEventListener("abort",m);const w=c.createElement("iframe");w.src=l,w.style.display="none",w.addEventListener("error",m,{signal:this.abortController.signal});const C=v=>{if(v.data&&typeof v.data=="string")try{const b=JSON.parse(v.data);if(b.type==="verify_attestation"){if(vT(b.attestation).payload.id!==s)return;clearInterval(u),c.body.removeChild(w),this.abortController.signal.removeEventListener("abort",m),window.removeEventListener("message",C),h(b.attestation===null?"":b.attestation)}}catch(b){this.logger.warn(b)}};c.body.appendChild(w),window.addEventListener("message",C,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",f),f}catch(c){this.logger.warn(c)}return""},this.resolve=async i=>{if(this.isDevEnv)return"";const{attestationId:a,hash:s,encryptedId:o}=i;if(a===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(a){if(vT(a).payload.id!==o)return;const c=await this.isValidJwtAttestation(a);if(c){if(!c.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return c}}if(!s)return;const l=this.getVerifyUrl(i==null?void 0:i.verifyUrl);return this.fetchAttestation(s,l)},this.fetchAttestation=async(i,a)=>{this.logger.debug(`resolving attestation: ${i} from url: ${a}`);const s=this.startAbortTimer(ct.ONE_SECOND*5),o=await fetch(`${a}/attestation/${i}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(s),o.status===200?await o.json():void 0},this.getVerifyUrl=i=>{let a=i||Gy;return Pqe.includes(a)||(this.logger.info(`verify url: ${a}, not included in trusted list, assigning default: ${Gy}`),a=Gy),a},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const i=this.startAbortTimer(ct.FIVE_SECONDS),a=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(i),await a.json()}catch(i){this.logger.warn(i)}},this.persistPublicKey=async i=>{this.logger.debug("persisting public key to local storage",i),await this.store.setItem(this.storeKey,i),this.publicKey=i},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async i=>{const a=await this.getPublicKey();try{if(a)return this.validateAttestation(i,a)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}const s=await this.fetchAndPersistPublicKey();try{if(s)return this.validateAttestation(i,s)}catch(o){this.logger.error(o),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async a=>{const s=await this.fetchPublicKey();s&&(await this.persistPublicKey(s),a(s))});const i=await this.fetchPromise;return this.fetchPromise=void 0,i},this.validateAttestation=(i,a)=>{const s=uWe(i,a.publicKey),o={hasExpired:ct.toMiliseconds(s.exp)this.abortController.abort(),ct.toMiliseconds(e))}}class FYe extends pGe{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=Rqe,this.registerDeviceToken=async n=>{const{clientId:i,token:a,notificationType:s,enableEncrypted:o=!1}=n,l=`${Dqe}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:i,type:s,token:a,always_raw:o})})},this.logger=ws(r,this.context)}}var UYe=Object.defineProperty,pH=Object.getOwnPropertySymbols,BYe=Object.prototype.hasOwnProperty,zYe=Object.prototype.propertyIsEnumerable,gH=(t,e,r)=>e in t?UYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Q2=(t,e)=>{for(var r in e||(e={}))BYe.call(e,r)&&gH(t,r,e[r]);if(pH)for(var r of pH(e))zYe.call(e,r)&&gH(t,r,e[r]);return t};class WYe extends gGe{constructor(e,r,n=!0){super(e,r,n),this.core=e,this.logger=r,this.context=Fqe,this.storagePrefix=Tu,this.storageVersion=Oqe,this.events=new Map,this.shouldPersist=!1,this.init=async()=>{if(!kj())try{const i={eventId:dW(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:yie(this.core.relayer.protocol,this.core.relayer.version,IT)}}};await this.sendEvent([i])}catch(i){this.logger.warn(i)}},this.createEvent=i=>{const{event:a="ERROR",type:s="",properties:{topic:o,trace:l}}=i,c=dW(),u=this.core.projectId||"",f=Date.now(),h=Q2({eventId:c,timestamp:f,props:{event:a,type:s,properties:{topic:o,trace:l}},bundleId:u,domain:this.getAppDomain()},this.setMethods(c));return this.telemetryEnabled&&(this.events.set(c,h),this.shouldPersist=!0),h},this.getEvent=i=>{const{eventId:a,topic:s}=i;if(a)return this.events.get(a);const o=Array.from(this.events.values()).find(l=>l.props.properties.topic===s);if(o)return Q2(Q2({},o),this.setMethods(o.eventId))},this.deleteEvent=i=>{const{eventId:a}=i;this.events.delete(a),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(Gm.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(i=>{ct.fromMiliseconds(Date.now())-ct.fromMiliseconds(i.timestamp)>Uqe&&(this.events.delete(i.eventId),this.shouldPersist=!0)})})},this.setMethods=i=>({addTrace:a=>this.addTrace(i,a),setError:a=>this.setError(i,a)}),this.addTrace=(i,a)=>{const s=this.events.get(i);s&&(s.props.properties.trace.push(a),this.events.set(i,s),this.shouldPersist=!0)},this.setError=(i,a)=>{const s=this.events.get(i);s&&(s.props.type=a,s.timestamp=Date.now(),this.events.set(i,s),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const i=await this.core.storage.getItem(this.storageKey)||[];if(!i.length)return;i.forEach(a=>{this.events.set(a.eventId,Q2(Q2({},a),this.setMethods(a.eventId)))})}catch(i){this.logger.warn(i)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const i=[];for(const[a,s]of this.events)s.props.type&&i.push(s);if(i.length!==0)try{if((await this.sendEvent(i)).ok)for(const a of i)this.events.delete(a.eventId),this.shouldPersist=!0}catch(a){this.logger.warn(a)}},this.sendEvent=async i=>{const a=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${Bqe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${IT}${a}`,{method:"POST",body:JSON.stringify(i)})},this.getAppDomain=()=>mie().url,this.logger=ws(r,this.context),this.telemetryEnabled=n,n?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var HYe=Object.defineProperty,mH=Object.getOwnPropertySymbols,GYe=Object.prototype.hasOwnProperty,qYe=Object.prototype.propertyIsEnumerable,yH=(t,e,r)=>e in t?HYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wH=(t,e)=>{for(var r in e||(e={}))GYe.call(e,r)&&yH(t,r,e[r]);if(mH)for(var r of mH(e))qYe.call(e,r)&&yH(t,r,e[r]);return t};let VYe=class aae extends aGe{constructor(e){var r;super(e),this.protocol=Hie,this.version=Gie,this.name=C8,this.events=new ys.EventEmitter,this.initialized=!1,this.on=(s,o)=>this.events.on(s,o),this.once=(s,o)=>this.events.once(s,o),this.off=(s,o)=>this.events.off(s,o),this.removeListener=(s,o)=>this.events.removeListener(s,o),this.dispatchEnvelope=({topic:s,message:o,sessionExists:l})=>{if(!s||!o)return;const c={topic:s,message:o,publishedAt:Date.now(),transportType:Cn.link_mode};this.relayer.onLinkMessageEvent(c,{sessionExists:l})},this.projectId=e==null?void 0:e.projectId,this.relayUrl=(e==null?void 0:e.relayUrl)||Vie,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const n=l7({level:typeof(e==null?void 0:e.logger)=="string"&&e.logger?e.logger:lqe.logger,name:C8}),{logger:i,chunkLoggerController:a}=iGe({opts:n,maxSizeInBytes:e==null?void 0:e.maxLogBlobSizeInBytes,loggerOverride:e==null?void 0:e.logger});this.logChunkController=a,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var s,o;(s=this.logChunkController)!=null&&s.downloadLogsBlobInBrowser&&((o=this.logChunkController)==null||o.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=ws(i,this.name),this.heartbeat=new nHe,this.crypto=new hYe(this,this.logger,e==null?void 0:e.keychain),this.history=new RYe(this,this.logger),this.expirer=new DYe(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new kHe(wH(wH({},cqe),e==null?void 0:e.storageOptions)),this.relayer=new NYe({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new PYe(this,this.logger),this.verify=new OYe(this,this.logger,this.storage),this.echoClient=new FYe(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new WYe(this,this.logger,e==null?void 0:e.telemetryEnabled)}static async init(e){const r=new aae(e);await r.initialize();const n=await r.crypto.getClientId();return await r.storage.setItem(Eqe,n),r}get context(){return eo(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(KW,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.eventClient.init(),this.linkModeSupportedApps=await this.storage.getItem(KW)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}};const YYe=VYe,sae="wc",oae=2,lae="client",Oj=`${sae}@${oae}:${lae}:`,RS={name:lae,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.org"},vH="WALLETCONNECT_DEEPLINK_CHOICE",KYe="proposal",cae="Proposal expired",JYe="session",Ap=ct.SEVEN_DAYS,QYe="engine",Bi={wc_sessionPropose:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1104},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1106},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:ct.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1112},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:ct.ONE_DAY,prompt:!1,tag:1114},res:{ttl:ct.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:ct.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:ct.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:ct.FIVE_MINUTES,prompt:!1,tag:1119}}},DS={min:ct.FIVE_MINUTES,max:ct.SEVEN_DAYS},zc={idle:"IDLE",active:"ACTIVE"},ZYe="request",XYe=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],eKe="wc",tKe="auth",rKe="authKeys",nKe="pairingTopics",iKe="requests",h7=`${eKe}@${1.5}:${tKe}:`,V6=`${h7}:PUB_KEY`;var aKe=Object.defineProperty,sKe=Object.defineProperties,oKe=Object.getOwnPropertyDescriptors,bH=Object.getOwnPropertySymbols,lKe=Object.prototype.hasOwnProperty,cKe=Object.prototype.propertyIsEnumerable,xH=(t,e,r)=>e in t?aKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ti=(t,e)=>{for(var r in e||(e={}))lKe.call(e,r)&&xH(t,r,e[r]);if(bH)for(var r of bH(e))cKe.call(e,r)&&xH(t,r,e[r]);return t},Wl=(t,e)=>sKe(t,oKe(e));class uKe extends yGe{constructor(e){super(e),this.name=QYe,this.events=new LL,this.initialized=!1,this.requestQueue={state:zc.idle,queue:[]},this.sessionRequestQueue={state:zc.idle,queue:[]},this.requestQueueDelay=ct.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(Bi)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();const n=Wl(ti({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(n);const{pairingTopic:i,requiredNamespaces:a,optionalNamespaces:s,sessionProperties:o,relays:l}=n;let c=i,u,f=!1;try{c&&(f=this.client.core.pairing.pairings.get(c).active)}catch(S){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),S}if(!c||!f){const{topic:S,uri:j}=await this.client.core.pairing.create();c=S,u=j}if(!c){const{message:S}=ht("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw new Error(S)}const h=await this.client.core.crypto.generateKeyPair(),g=Bi.wc_sessionPropose.req.ttl||ct.FIVE_MINUTES,m=Li(g),w=ti({requiredNamespaces:a,optionalNamespaces:s,relays:l??[{protocol:qie}],proposer:{publicKey:h,metadata:this.client.metadata},expiryTimestamp:m,pairingTopic:c},o&&{sessionProperties:o}),{reject:C,resolve:v,done:b}=c0(g,cae);this.events.once(jr("session_connect"),async({error:S,session:j})=>{if(S)C(S);else if(j){j.self.publicKey=h;const F=Wl(ti({},j),{pairingTopic:w.pairingTopic,requiredNamespaces:w.requiredNamespaces,optionalNamespaces:w.optionalNamespaces,transportType:Cn.relay});await this.client.session.set(j.topic,F),await this.setExpiry(j.topic,j.expiry),c&&await this.client.core.pairing.updateMetadata({topic:c,metadata:j.peer.metadata}),this.cleanupDuplicatePairings(F),v(F)}});const A=await this.sendRequest({topic:c,method:"wc_sessionPropose",params:w,throwOnFailedPublish:!0});return await this.setProposal(A,ti({id:A},w)),{uri:u,approval:b}},this.pair=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(r)}catch(n){throw this.client.logger.error("pair() failed"),n}},this.approve=async r=>{var n,i,a;const s=this.client.core.eventClient.createEvent({properties:{topic:(n=r==null?void 0:r.id)==null?void 0:n.toString(),trace:[zl.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(B){throw s.setError(r0.no_internet_connection),B}try{await this.isValidProposalId(r==null?void 0:r.id)}catch(B){throw this.client.logger.error(`approve() -> proposal.get(${r==null?void 0:r.id}) failed`),s.setError(r0.proposal_not_found),B}try{await this.isValidApprove(r)}catch(B){throw this.client.logger.error("approve() -> isValidApprove() failed"),s.setError(r0.session_approve_namespace_validation_failure),B}const{id:o,relayProtocol:l,namespaces:c,sessionProperties:u,sessionConfig:f}=r,h=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:s.eventId});const{pairingTopic:g,proposer:m,requiredNamespaces:w,optionalNamespaces:C}=h;let v=(i=this.client.core.eventClient)==null?void 0:i.getEvent({topic:g});v||(v=(a=this.client.core.eventClient)==null?void 0:a.createEvent({type:zl.session_approve_started,properties:{topic:g,trace:[zl.session_approve_started,zl.session_namespaces_validation_success]}}));const b=await this.client.core.crypto.generateKeyPair(),A=m.publicKey,S=await this.client.core.crypto.generateSharedKey(b,A),j=ti(ti({relay:{protocol:l??"irn"},namespaces:c,controller:{publicKey:b,metadata:this.client.metadata},expiry:Li(Ap)},u&&{sessionProperties:u}),f&&{sessionConfig:f}),F=Cn.relay;v.addTrace(zl.subscribing_session_topic);try{await this.client.core.relayer.subscribe(S,{transportType:F})}catch(B){throw v.setError(r0.subscribe_session_topic_failure),B}v.addTrace(zl.subscribe_session_topic_success);const I=Wl(ti({},j),{topic:S,requiredNamespaces:w,optionalNamespaces:C,pairingTopic:g,acknowledged:!1,self:j.controller,peer:{publicKey:m.publicKey,metadata:m.metadata},controller:b,transportType:Cn.relay});await this.client.session.set(S,I),v.addTrace(zl.store_session);try{v.addTrace(zl.publishing_session_settle),await this.sendRequest({topic:S,method:"wc_sessionSettle",params:j,throwOnFailedPublish:!0}).catch(B=>{throw v==null||v.setError(r0.session_settle_publish_failure),B}),v.addTrace(zl.session_settle_publish_success),v.addTrace(zl.publishing_session_approve),await this.sendResult({id:o,topic:g,result:{relay:{protocol:l??"irn"},responderPublicKey:b},throwOnFailedPublish:!0}).catch(B=>{throw v==null||v.setError(r0.session_approve_publish_failure),B}),v.addTrace(zl.session_approve_publish_success)}catch(B){throw this.client.logger.error(B),this.client.session.delete(S,ln("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(S),B}return this.client.core.eventClient.deleteEvent({eventId:v.eventId}),await this.client.core.pairing.updateMetadata({topic:g,metadata:m.metadata}),await this.client.proposal.delete(o,ln("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:g}),await this.setExpiry(S,Li(Ap)),{topic:S,acknowledged:()=>Promise.resolve(this.client.session.get(S))}},this.reject=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(r)}catch(s){throw this.client.logger.error("reject() -> isValidReject() failed"),s}const{id:n,reason:i}=r;let a;try{a=this.client.proposal.get(n).pairingTopic}catch(s){throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`),s}a&&(await this.sendError({id:n,topic:a,error:i,rpcOpts:Bi.wc_sessionPropose.reject}),await this.client.proposal.delete(n,ln("USER_DISCONNECTED")))},this.update=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(r)}catch(f){throw this.client.logger.error("update() -> isValidUpdate() failed"),f}const{topic:n,namespaces:i}=r,{done:a,resolve:s,reject:o}=c0(),l=fd(),c=A0().toString(),u=this.client.session.get(n).namespaces;return this.events.once(jr("session_update",l),({error:f})=>{f?o(f):s()}),await this.client.session.update(n,{namespaces:i}),await this.sendRequest({topic:n,method:"wc_sessionUpdate",params:{namespaces:i},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:c}).catch(f=>{this.client.logger.error(f),this.client.session.update(n,{namespaces:u}),o(f)}),{acknowledged:a}},this.extend=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(r)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:n}=r,i=fd(),{done:a,resolve:s,reject:o}=c0();return this.events.once(jr("session_extend",i),({error:l})=>{l?o(l):s()}),await this.setExpiry(n,Li(Ap)),this.sendRequest({topic:n,method:"wc_sessionExtend",params:{},clientRpcId:i,throwOnFailedPublish:!0}).catch(l=>{o(l)}),{acknowledged:a}},this.request=async r=>{this.isInitialized();try{await this.isValidRequest(r)}catch(m){throw this.client.logger.error("request() -> isValidRequest() failed"),m}const{chainId:n,request:i,topic:a,expiry:s=Bi.wc_sessionRequest.req.ttl}=r,o=this.client.session.get(a);(o==null?void 0:o.transportType)===Cn.relay&&await this.confirmOnlineStateOrThrow();const l=fd(),c=A0().toString(),{done:u,resolve:f,reject:h}=c0(s,"Request expired. Please try again.");this.events.once(jr("session_request",l),({error:m,result:w})=>{m?h(m):f(w)});const g=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);return g?(await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:Wl(ti({},i),{expiryTimestamp:Li(s)}),chainId:n},expiry:s,throwOnFailedPublish:!0,appLink:g}).catch(m=>h(m)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),await u()):await Promise.all([new Promise(async m=>{await this.sendRequest({clientRpcId:l,relayRpcId:c,topic:a,method:"wc_sessionRequest",params:{request:Wl(ti({},i),{expiryTimestamp:Li(s)}),chainId:n},expiry:s,throwOnFailedPublish:!0}).catch(w=>h(w)),this.client.events.emit("session_request_sent",{topic:a,request:i,chainId:n,id:l}),m()}),new Promise(async m=>{var w;if(!((w=o.sessionConfig)!=null&&w.disableDeepLink)){const C=await Aze(this.client.core.storage,vH);await Cze({id:l,topic:a,wcDeepLink:C})}m()}),u()]).then(m=>m[2])},this.respond=async r=>{this.isInitialized(),await this.isValidRespond(r);const{topic:n,response:i}=r,{id:a}=i,s=this.client.session.get(n);s.transportType===Cn.relay&&await this.confirmOnlineStateOrThrow();const o=this.getAppLinkIfEnabled(s.peer.metadata,s.transportType);Kc(i)?await this.sendResult({id:a,topic:n,result:i.result,throwOnFailedPublish:!0,appLink:o}):al(i)&&await this.sendError({id:a,topic:n,error:i.error,appLink:o}),this.cleanupAfterResponse(r)},this.ping=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(r)}catch(i){throw this.client.logger.error("ping() -> isValidPing() failed"),i}const{topic:n}=r;if(this.client.session.keys.includes(n)){const i=fd(),a=A0().toString(),{done:s,resolve:o,reject:l}=c0();this.events.once(jr("session_ping",i),({error:c})=>{c?l(c):o()}),await Promise.all([this.sendRequest({topic:n,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:i,relayRpcId:a}),s()])}else this.client.core.pairing.pairings.keys.includes(n)&&await this.client.core.pairing.ping({topic:n})},this.emit=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(r);const{topic:n,event:i,chainId:a}=r,s=A0().toString(),o=fd();await this.sendRequest({topic:n,method:"wc_sessionEvent",params:{event:i,chainId:a},throwOnFailedPublish:!0,relayRpcId:s,clientRpcId:o})},this.disconnect=async r=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(r);const{topic:n}=r;if(this.client.session.keys.includes(n))await this.sendRequest({topic:n,method:"wc_sessionDelete",params:ln("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:n,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(n))await this.client.core.pairing.disconnect({topic:n});else{const{message:i}=ht("MISMATCHED_TOPIC",`Session or pairing topic not found: ${n}`);throw new Error(i)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(n=>IWe(n,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async(r,n)=>{var i;this.isInitialized(),this.isValidAuthenticate(r);const a=n&&this.client.core.linkModeSupportedApps.includes(n)&&((i=this.client.metadata.redirect)==null?void 0:i.linkMode),s=a?Cn.link_mode:Cn.relay;s===Cn.relay&&await this.confirmOnlineStateOrThrow();const{chains:o,statement:l="",uri:c,domain:u,nonce:f,type:h,exp:g,nbf:m,methods:w=[],expiry:C}=r,v=[...r.resources||[]],{topic:b,uri:A}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:s});this.client.logger.info({message:"Generated new pairing",pairing:{topic:b,uri:A}});const S=await this.client.core.crypto.generateKeyPair(),j=H6(S);if(await Promise.all([this.client.auth.authKeys.set(V6,{responseTopic:j,publicKey:S}),this.client.auth.pairingTopics.set(j,{topic:j,pairingTopic:b})]),await this.client.core.relayer.subscribe(j,{transportType:s}),this.client.logger.info(`sending request to new pairing topic: ${b}`),w.length>0){const{namespace:P}=vg(o[0]);let R=Yze(P,"request",w);W6(v)&&(R=Jze(R,v.pop())),v.push(R)}const F=C&&C>Bi.wc_sessionAuthenticate.req.ttl?C:Bi.wc_sessionAuthenticate.req.ttl,I={authPayload:{type:h??"caip122",chains:o,statement:l,aud:c,domain:u,version:"1",nonce:f,iat:new Date().toISOString(),exp:g,nbf:m,resources:v},requester:{publicKey:S,metadata:this.client.metadata},expiryTimestamp:Li(F)},B={eip155:{chains:o,methods:[...new Set(["personal_sign",...w])],events:["chainChanged","accountsChanged"]}},V={requiredNamespaces:{},optionalNamespaces:B,relays:[{protocol:"irn"}],pairingTopic:b,proposer:{publicKey:S,metadata:this.client.metadata},expiryTimestamp:Li(Bi.wc_sessionPropose.req.ttl)},{done:se,resolve:Y,reject:N}=c0(F,"Request expired"),k=async({error:P,session:R})=>{if(this.events.off(jr("session_request",E),x),P)N(P);else if(R){R.self.publicKey=S,await this.client.session.set(R.topic,R),await this.setExpiry(R.topic,R.expiry),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:R.peer.metadata});const M=this.client.session.get(R.topic);await this.deleteProposal(L),Y({session:M})}},x=async P=>{var R,M,D;if(await this.deletePendingAuthRequest(E,{message:"fulfilled",code:0}),P.error){const te=ln("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return P.error.code===te.code?void 0:(this.events.off(jr("session_connect"),k),N(P.error.message))}await this.deleteProposal(L),this.events.off(jr("session_connect"),k);const{cacaos:$,responder:X}=P.result,le=[],H=[];for(const te of $){await pW({cacao:te,projectId:this.client.core.projectId})||(this.client.logger.error(te,"Signature verification failed"),N(ln("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:re}=te,z=W6(re.resources),G=[bT(re.iss)],Q=w8(re.iss);if(z){const me=gW(z),be=mW(z);le.push(...me),G.push(...be)}for(const me of G)H.push(`${me}:${Q}`)}const ee=await this.client.core.crypto.generateSharedKey(S,X.publicKey);let J;le.length>0&&(J={topic:ee,acknowledged:!0,self:{publicKey:S,metadata:this.client.metadata},peer:X,controller:X.publicKey,expiry:Li(Ap),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:b,namespaces:SW([...new Set(le)],[...new Set(H)]),transportType:s},await this.client.core.relayer.subscribe(ee,{transportType:s}),await this.client.session.set(ee,J),b&&await this.client.core.pairing.updateMetadata({topic:b,metadata:X.metadata}),J=this.client.session.get(ee)),(R=this.client.metadata.redirect)!=null&&R.linkMode&&(M=X.metadata.redirect)!=null&&M.linkMode&&(D=X.metadata.redirect)!=null&&D.universal&&n&&(this.client.core.addLinkModeSupportedApp(X.metadata.redirect.universal),this.client.session.update(ee,{transportType:Cn.link_mode})),Y({auths:$,session:J})},E=fd(),L=fd();this.events.once(jr("session_connect"),k),this.events.once(jr("session_request",E),x);let O;try{if(a){const P=Wf("wc_sessionAuthenticate",I,E);this.client.core.history.set(b,P);const R=await this.client.core.crypto.encode("",P,{type:wv,encoding:q2});O=O4(n,b,R)}else await Promise.all([this.sendRequest({topic:b,method:"wc_sessionAuthenticate",params:I,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:E}),this.sendRequest({topic:b,method:"wc_sessionPropose",params:V,expiry:Bi.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:L})])}catch(P){throw this.events.off(jr("session_connect"),k),this.events.off(jr("session_request",E),x),P}return await this.setProposal(L,ti({id:L},V)),await this.setAuthRequest(E,{request:Wl(ti({},I),{verifyContext:{}}),pairingTopic:b,transportType:s}),{uri:O??A,response:se}},this.approveSessionAuthenticate=async r=>{const{id:n,auths:i}=r,a=this.client.core.eventClient.createEvent({properties:{topic:n.toString(),trace:[n0.authenticated_session_approve_started]}});try{this.isInitialized()}catch(C){throw a.setError(K2.no_internet_connection),C}const s=this.getPendingAuthRequest(n);if(!s)throw a.setError(K2.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${n}`);const o=s.transportType||Cn.relay;o===Cn.relay&&await this.confirmOnlineStateOrThrow();const l=s.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=H6(l),f={type:Ld,receiverPublicKey:l,senderPublicKey:c},h=[],g=[];for(const C of i){if(!await pW({cacao:C,projectId:this.client.core.projectId})){a.setError(K2.invalid_cacao);const j=ln("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:n,topic:u,error:j,encodeOpts:f}),new Error(j.message)}a.addTrace(n0.cacaos_verified);const{p:v}=C,b=W6(v.resources),A=[bT(v.iss)],S=w8(v.iss);if(b){const j=gW(b),F=mW(b);h.push(...j),A.push(...F)}for(const j of A)g.push(`${j}:${S}`)}const m=await this.client.core.crypto.generateSharedKey(c,l);a.addTrace(n0.create_authenticated_session_topic);let w;if((h==null?void 0:h.length)>0){w={topic:m,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:l,metadata:s.requester.metadata},controller:l,expiry:Li(Ap),authentication:i,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:s.pairingTopic,namespaces:SW([...new Set(h)],[...new Set(g)]),transportType:o},a.addTrace(n0.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(m,{transportType:o})}catch(C){throw a.setError(K2.subscribe_authenticated_session_topic_failure),C}a.addTrace(n0.subscribe_authenticated_session_topic_success),await this.client.session.set(m,w),a.addTrace(n0.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:s.pairingTopic,metadata:s.requester.metadata})}a.addTrace(n0.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:n,result:{cacaos:i,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:f,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(s.requester.metadata,o)})}catch(C){throw a.setError(K2.authenticated_session_approve_publish_failure),C}return await this.client.auth.requests.delete(n,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:s.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:a.eventId}),{session:w}},this.rejectSessionAuthenticate=async r=>{this.isInitialized();const{id:n,reason:i}=r,a=this.getPendingAuthRequest(n);if(!a)throw new Error(`Could not find pending auth request with id ${n}`);a.transportType===Cn.relay&&await this.confirmOnlineStateOrThrow();const s=a.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),l=H6(s),c={type:Ld,receiverPublicKey:s,senderPublicKey:o};await this.sendError({id:n,topic:l,error:i,encodeOpts:c,rpcOpts:Bi.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(a.requester.metadata,a.transportType)}),await this.client.auth.requests.delete(n,{message:"rejected",code:0}),await this.client.proposal.delete(n,ln("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:n,iss:i}=r;return _ie(n,i)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const n=this.client.core.pairing.pairings.get(r.pairingTopic),i=this.client.core.pairing.pairings.getAll().filter(a=>{var s,o;return((s=a.peerMetadata)==null?void 0:s.url)&&((o=a.peerMetadata)==null?void 0:o.url)===r.peer.metadata.url&&a.topic&&a.topic!==n.topic});if(i.length===0)return;this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`),await Promise.all(i.map(a=>this.client.core.pairing.disconnect({topic:a.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(n){this.client.logger.error(n)}},this.deleteSession=async r=>{var n;const{topic:i,expirerHasDeleted:a=!1,emitEvent:s=!0,id:o=0}=r,{self:l}=this.client.session.get(i);await this.client.core.relayer.unsubscribe(i),await this.client.session.delete(i,ln("USER_DISCONNECTED")),this.addToRecentlyDeleted(i,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(i)&&await this.client.core.crypto.deleteSymKey(i),a||this.client.core.expirer.del(i),this.client.core.storage.removeItem(vH).catch(c=>this.client.logger.warn(c)),this.getPendingSessionRequests().forEach(c=>{c.topic===i&&this.deletePendingSessionRequest(c.id,ln("USER_DISCONNECTED"))}),i===((n=this.sessionRequestQueue.queue[0])==null?void 0:n.topic)&&(this.sessionRequestQueue.state=zc.idle),s&&this.client.events.emit("session_delete",{id:o,topic:i})},this.deleteProposal=async(r,n)=>{if(n)try{const i=this.client.proposal.get(r),a=this.client.core.eventClient.getEvent({topic:i.pairingTopic});a==null||a.setError(r0.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,ln("USER_DISCONNECTED")),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,n,i=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(a=>a.id!==r),i&&(this.sessionRequestQueue.state=zc.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,n,i=!1)=>{await Promise.all([this.client.auth.requests.delete(r,n),i?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,n)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,n),await this.client.session.update(r,{expiry:n}))},this.setProposal=async(r,n)=>{this.client.core.expirer.set(r,Li(Bi.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,n)},this.setAuthRequest=async(r,n)=>{const{request:i,pairingTopic:a,transportType:s=Cn.relay}=n;this.client.core.expirer.set(r,i.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:i.authPayload,requester:i.requester,expiryTimestamp:i.expiryTimestamp,id:r,pairingTopic:a,verifyContext:i.verifyContext,transportType:s})},this.setPendingSessionRequest=async r=>{const{id:n,topic:i,params:a,verifyContext:s}=r,o=a.request.expiryTimestamp||Li(Bi.wc_sessionRequest.req.ttl);this.client.core.expirer.set(n,o),await this.client.pendingRequest.set(n,{id:n,topic:i,params:a,verifyContext:s})},this.sendRequest=async r=>{const{topic:n,method:i,params:a,expiry:s,relayRpcId:o,clientRpcId:l,throwOnFailedPublish:c,appLink:u}=r,f=Wf(i,a,l);let h;const g=!!u;try{const C=g?q2:zf;h=await this.client.core.crypto.encode(n,f,{encoding:C})}catch(C){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`),C}let m;if(XYe.includes(i)){const C=xd(JSON.stringify(f)),v=xd(h);m=await this.client.core.verify.register({id:v,decryptedId:C})}const w=Bi[i].req;if(w.attestation=m,s&&(w.ttl=s),o&&(w.id=o),this.client.core.history.set(n,f),g){const C=O4(u,n,h);await global.Linking.openURL(C,this.client.name)}else{const C=Bi[i].req;s&&(C.ttl=s),o&&(C.id=o),c?(C.internal=Wl(ti({},C.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,h,C)):this.client.core.relayer.publish(n,h,C).catch(v=>this.client.logger.error(v))}return f.id},this.sendResult=async r=>{const{id:n,topic:i,result:a,throwOnFailedPublish:s,encodeOpts:o,appLink:l}=r,c=c7(n,a);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?q2:zf;u=await this.client.core.crypto.encode(i,c,Wl(ti({},o||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),g}let h;try{h=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),g}if(f){const g=O4(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=Bi[h.request.method].res;s?(g.internal=Wl(ti({},g.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,u,g)):this.client.core.relayer.publish(i,u,g).catch(m=>this.client.logger.error(m))}await this.client.core.history.resolve(c)},this.sendError=async r=>{const{id:n,topic:i,error:a,encodeOpts:s,rpcOpts:o,appLink:l}=r,c=u7(n,a);let u;const f=l&&typeof(global==null?void 0:global.Linking)<"u";try{const g=f?q2:zf;u=await this.client.core.crypto.encode(i,c,Wl(ti({},s||{}),{encoding:g}))}catch(g){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),g}let h;try{h=await this.client.core.history.get(i,n)}catch(g){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),g}if(f){const g=O4(l,i,u);await global.Linking.openURL(g,this.client.name)}else{const g=o||Bi[h.request.method].res;this.client.core.relayer.publish(i,u,g)}await this.client.core.history.resolve(c)},this.cleanup=async()=>{const r=[],n=[];this.client.session.getAll().forEach(i=>{let a=!1;kf(i.expiry)&&(a=!0),this.client.core.crypto.keychain.has(i.topic)||(a=!0),a&&r.push(i.topic)}),this.client.proposal.getAll().forEach(i=>{kf(i.expiryTimestamp)&&n.push(i.id)}),await Promise.all([...r.map(i=>this.deleteSession({topic:i})),...n.map(i=>this.deleteProposal(i))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===zc.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=zc.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(n){this.client.logger.warn(n)}}this.requestQueue.state=zc.idle},this.processRequest=async r=>{const{topic:n,payload:i,attestation:a,transportType:s,encryptedId:o}=r,l=i.method;if(!this.shouldIgnorePairingRequest({topic:n,requestMethod:l}))switch(l){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:n,payload:i,attestation:a,encryptedId:o});case"wc_sessionSettle":return await this.onSessionSettleRequest(n,i);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(n,i);case"wc_sessionExtend":return await this.onSessionExtendRequest(n,i);case"wc_sessionPing":return await this.onSessionPingRequest(n,i);case"wc_sessionDelete":return await this.onSessionDeleteRequest(n,i);case"wc_sessionRequest":return await this.onSessionRequest({topic:n,payload:i,attestation:a,encryptedId:o,transportType:s});case"wc_sessionEvent":return await this.onSessionEventRequest(n,i);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:n,payload:i,attestation:a,encryptedId:o,transportType:s});default:return this.client.logger.info(`Unsupported request method ${l}`)}},this.onRelayEventResponse=async r=>{const{topic:n,payload:i,transportType:a}=r,s=(await this.client.core.history.get(n,i.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(n,i,a);case"wc_sessionSettle":return this.onSessionSettleResponse(n,i);case"wc_sessionUpdate":return this.onSessionUpdateResponse(n,i);case"wc_sessionExtend":return this.onSessionExtendResponse(n,i);case"wc_sessionPing":return this.onSessionPingResponse(n,i);case"wc_sessionRequest":return this.onSessionRequestResponse(n,i);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(n,i);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:n}=r,{message:i}=ht("MISSING_OR_INVALID",`Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);throw new Error(i)},this.shouldIgnorePairingRequest=r=>{const{topic:n,requestMethod:i}=r,a=this.expectedPairingMethodMap.get(n);return!a||a.includes(i)?!1:!!(a.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:n,payload:i,attestation:a,encryptedId:s}=r,{params:o,id:l}=i;try{const c=this.client.core.eventClient.getEvent({topic:n});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),c==null||c.setError(od.proposal_listener_not_found)),this.isValidConnect(ti({},i.params));const u=o.expiryTimestamp||Li(Bi.wc_sessionPropose.req.ttl),f=ti({id:l,pairingTopic:n,expiryTimestamp:u},o);await this.setProposal(l,f);const h=await this.getVerifyContext({attestationId:a,hash:xd(JSON.stringify(i)),encryptedId:s,metadata:f.proposer.metadata});c==null||c.addTrace(Hc.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:f,verifyContext:h})}catch(c){await this.sendError({id:l,topic:n,error:c,rpcOpts:Bi.wc_sessionPropose.autoReject}),this.client.logger.error(c)}},this.onSessionProposeResponse=async(r,n,i)=>{const{id:a}=n;if(Kc(n)){const{result:s}=n;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const o=this.client.proposal.get(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});const l=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:l});const c=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:c});const u=await this.client.core.crypto.generateSharedKey(l,c);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:u});const f=await this.client.core.relayer.subscribe(u,{transportType:i});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:f}),await this.client.core.pairing.activate({topic:r})}else if(al(n)){await this.client.proposal.delete(a,ln("USER_DISCONNECTED"));const s=jr("session_connect");if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners, 954`);this.events.emit(jr("session_connect"),{error:n.error})}},this.onSessionSettleRequest=async(r,n)=>{const{id:i,params:a}=n;try{this.isValidSessionSettleRequest(a);const{relay:s,controller:o,expiry:l,namespaces:c,sessionProperties:u,sessionConfig:f}=n.params,h=Wl(ti(ti({topic:r,relay:s,expiry:l,namespaces:c,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:o.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:o.publicKey,metadata:o.metadata}},u&&{sessionProperties:u}),f&&{sessionConfig:f}),{transportType:Cn.relay}),g=jr("session_connect");if(this.events.listenerCount(g)===0)throw new Error(`emitting ${g} without any listeners 997`);this.events.emit(jr("session_connect"),{session:h}),await this.sendResult({id:n.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionSettleResponse=async(r,n)=>{const{id:i}=n;Kc(n)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(jr("session_approve",i),{})):al(n)&&(await this.client.session.delete(r,ln("USER_DISCONNECTED")),this.events.emit(jr("session_approve",i),{error:n.error}))},this.onSessionUpdateRequest=async(r,n)=>{const{params:i,id:a}=n;try{const s=`${r}_session_update`,o=V2.get(s);if(o&&this.isRequestOutOfSync(o,a)){this.client.logger.warn(`Discarding out of sync request - ${a}`),this.sendError({id:a,topic:r,error:ln("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(ti({topic:r},i));try{V2.set(s,a),await this.client.session.update(r,{namespaces:i.namespaces}),await this.sendResult({id:a,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw V2.delete(s),l}this.client.events.emit("session_update",{id:a,topic:r,params:i})}catch(s){await this.sendError({id:a,topic:r,error:s}),this.client.logger.error(s)}},this.isRequestOutOfSync=(r,n)=>n.toString().slice(0,-3){const{id:i}=n,a=jr("session_update",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Kc(n)?this.events.emit(jr("session_update",i),{}):al(n)&&this.events.emit(jr("session_update",i),{error:n.error})},this.onSessionExtendRequest=async(r,n)=>{const{id:i}=n;try{this.isValidExtend({topic:r}),await this.setExpiry(r,Li(Ap)),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionExtendResponse=(r,n)=>{const{id:i}=n,a=jr("session_extend",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Kc(n)?this.events.emit(jr("session_extend",i),{}):al(n)&&this.events.emit(jr("session_extend",i),{error:n.error})},this.onSessionPingRequest=async(r,n)=>{const{id:i}=n;try{this.isValidPing({topic:r}),await this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:i,topic:r})}catch(a){await this.sendError({id:i,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionPingResponse=(r,n)=>{const{id:i}=n,a=jr("session_ping",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);setTimeout(()=>{Kc(n)?this.events.emit(jr("session_ping",i),{}):al(n)&&this.events.emit(jr("session_ping",i),{error:n.error})},500)},this.onSessionDeleteRequest=async(r,n)=>{const{id:i}=n;try{this.isValidDisconnect({topic:r,reason:n.params}),Promise.all([new Promise(a=>{this.client.core.relayer.once(Zi.publish,async()=>{a(await this.deleteSession({topic:r,id:i}))})}),this.sendResult({id:i,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:ln("USER_DISCONNECTED")})]).catch(a=>this.client.logger.error(a))}catch(a){this.client.logger.error(a)}},this.onSessionRequest=async r=>{var n,i,a;const{topic:s,payload:o,attestation:l,encryptedId:c,transportType:u}=r,{id:f,params:h}=o;try{await this.isValidRequest(ti({topic:s},h));const g=this.client.session.get(s),m=await this.getVerifyContext({attestationId:l,hash:xd(JSON.stringify(Wf("wc_sessionRequest",h,f))),encryptedId:c,metadata:g.peer.metadata,transportType:u}),w={id:f,topic:s,params:h,verifyContext:m};await this.setPendingSessionRequest(w),u===Cn.link_mode&&(n=g.peer.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp((i=g.peer.metadata.redirect)==null?void 0:i.universal),(a=this.client.signConfig)!=null&&a.disableRequestQueue?this.emitSessionRequest(w):(this.addSessionRequestToSessionRequestQueue(w),this.processSessionRequestQueue())}catch(g){await this.sendError({id:f,topic:s,error:g}),this.client.logger.error(g)}},this.onSessionRequestResponse=(r,n)=>{const{id:i}=n,a=jr("session_request",i);if(this.events.listenerCount(a)===0)throw new Error(`emitting ${a} without any listeners`);Kc(n)?this.events.emit(jr("session_request",i),{result:n.result}):al(n)&&this.events.emit(jr("session_request",i),{error:n.error})},this.onSessionEventRequest=async(r,n)=>{const{id:i,params:a}=n;try{const s=`${r}_session_event_${a.event.name}`,o=V2.get(s);if(o&&this.isRequestOutOfSync(o,i)){this.client.logger.info(`Discarding out of sync request - ${i}`);return}this.isValidEmit(ti({topic:r},a)),this.client.events.emit("session_event",{id:i,topic:r,params:a}),V2.set(s,i)}catch(s){await this.sendError({id:i,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionAuthenticateResponse=(r,n)=>{const{id:i}=n;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:n}),Kc(n)?this.events.emit(jr("session_request",i),{result:n.result}):al(n)&&this.events.emit(jr("session_request",i),{error:n.error})},this.onSessionAuthenticateRequest=async r=>{var n;const{topic:i,payload:a,attestation:s,encryptedId:o,transportType:l}=r;try{const{requester:c,authPayload:u,expiryTimestamp:f}=a.params,h=await this.getVerifyContext({attestationId:s,hash:xd(JSON.stringify(a)),encryptedId:o,metadata:c.metadata,transportType:l}),g={requester:c,pairingTopic:i,id:a.id,authPayload:u,verifyContext:h,expiryTimestamp:f};await this.setAuthRequest(a.id,{request:g,pairingTopic:i,transportType:l}),l===Cn.link_mode&&(n=c.metadata.redirect)!=null&&n.universal&&this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:i,params:a.params,id:a.id,verifyContext:h})}catch(c){this.client.logger.error(c);const u=a.params.requester.publicKey,f=await this.client.core.crypto.generateKeyPair(),h=this.getAppLinkIfEnabled(a.params.requester.metadata,l),g={type:Ld,receiverPublicKey:u,senderPublicKey:f};await this.sendError({id:a.id,topic:i,error:c,encodeOpts:g,rpcOpts:Bi.wc_sessionAuthenticate.autoReject,appLink:h})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=zc.idle,this.processSessionRequestQueue()},ct.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:n})=>{const i=this.client.core.history.pending;i.length>0&&i.filter(a=>a.topic===r&&a.request.method==="wc_sessionRequest").forEach(a=>{const s=a.request.id,o=jr("session_request",s);if(this.events.listenerCount(o)===0)throw new Error(`emitting ${o} without any listeners`);this.events.emit(jr("session_request",a.request.id),{error:n})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===zc.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=zc.active,this.emitSessionRequest(r)}catch(n){this.client.logger.error(n)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const n=this.client.proposal.getAll().find(i=>i.pairingTopic===r.topic);n&&this.onSessionProposeRequest({topic:r.topic,payload:Wf("wc_sessionPropose",{requiredNamespaces:n.requiredNamespaces,optionalNamespaces:n.optionalNamespaces,relays:n.relays,proposer:n.proposer,sessionProperties:n.sessionProperties},n.id)})},this.isValidConnect=async r=>{if(!Ls(r)){const{message:l}=ht("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:n,requiredNamespaces:i,optionalNamespaces:a,sessionProperties:s,relays:o}=r;if(Os(n)||await this.isValidPairingTopic(n),!FWe(o)){const{message:l}=ht("MISSING_OR_INVALID",`connect() relays: ${o}`);throw new Error(l)}!Os(i)&&nw(i)!==0&&this.validateNamespaces(i,"requiredNamespaces"),!Os(a)&&nw(a)!==0&&this.validateNamespaces(a,"optionalNamespaces"),Os(s)||this.validateSessionProps(s,"sessionProperties")},this.validateNamespaces=(r,n)=>{const i=OWe(r,"connect()",n);if(i)throw new Error(i.message)},this.isValidApprove=async r=>{if(!Ls(r))throw new Error(ht("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:n,namespaces:i,relayProtocol:a,sessionProperties:s}=r;this.checkRecentlyDeleted(n),await this.isValidProposalId(n);const o=this.client.proposal.get(n),l=TS(i,"approve()");if(l)throw new Error(l.message);const c=MW(o.requiredNamespaces,i,"approve()");if(c)throw new Error(c.message);if(!pi(a,!0)){const{message:u}=ht("MISSING_OR_INVALID",`approve() relayProtocol: ${a}`);throw new Error(u)}Os(s)||this.validateSessionProps(s,"sessionProperties")},this.isValidReject=async r=>{if(!Ls(r)){const{message:a}=ht("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(a)}const{id:n,reason:i}=r;if(this.checkRecentlyDeleted(n),await this.isValidProposalId(n),!BWe(i)){const{message:a}=ht("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(i)}`);throw new Error(a)}},this.isValidSessionSettleRequest=r=>{if(!Ls(r)){const{message:c}=ht("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(c)}const{relay:n,controller:i,namespaces:a,expiry:s}=r;if(!Nie(n)){const{message:c}=ht("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(c)}const o=LWe(i,"onSessionSettleRequest()");if(o)throw new Error(o.message);const l=TS(a,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(kf(s)){const{message:c}=ht("EXPIRED","onSessionSettleRequest()");throw new Error(c)}},this.isValidUpdate=async r=>{if(!Ls(r)){const{message:l}=ht("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(l)}const{topic:n,namespaces:i}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const a=this.client.session.get(n),s=TS(i,"update()");if(s)throw new Error(s.message);const o=MW(a.requiredNamespaces,i,"update()");if(o)throw new Error(o.message)},this.isValidExtend=async r=>{if(!Ls(r)){const{message:i}=ht("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(i)}const{topic:n}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n)},this.isValidRequest=async r=>{if(!Ls(r)){const{message:l}=ht("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:n,request:i,chainId:a,expiry:s}=r;this.checkRecentlyDeleted(n),await this.isValidSessionTopic(n);const{namespaces:o}=this.client.session.get(n);if(!IW(o,a)){const{message:l}=ht("MISSING_OR_INVALID",`request() chainId: ${a}`);throw new Error(l)}if(!zWe(i)){const{message:l}=ht("MISSING_OR_INVALID",`request() ${JSON.stringify(i)}`);throw new Error(l)}if(!GWe(o,a,i.method)){const{message:l}=ht("MISSING_OR_INVALID",`request() method: ${i.method}`);throw new Error(l)}if(s&&!KWe(s,DS)){const{message:l}=ht("MISSING_OR_INVALID",`request() expiry: ${s}. Expiry must be a number (in seconds) between ${DS.min} and ${DS.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var n;if(!Ls(r)){const{message:s}=ht("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(s)}const{topic:i,response:a}=r;try{await this.isValidSessionTopic(i)}catch(s){throw(n=r==null?void 0:r.response)!=null&&n.id&&this.cleanupAfterResponse(r),s}if(!WWe(a)){const{message:s}=ht("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(a)}`);throw new Error(s)}},this.isValidPing=async r=>{if(!Ls(r)){const{message:i}=ht("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidEmit=async r=>{if(!Ls(r)){const{message:o}=ht("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(o)}const{topic:n,event:i,chainId:a}=r;await this.isValidSessionTopic(n);const{namespaces:s}=this.client.session.get(n);if(!IW(s,a)){const{message:o}=ht("MISSING_OR_INVALID",`emit() chainId: ${a}`);throw new Error(o)}if(!HWe(i)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}if(!qWe(s,a,i.name)){const{message:o}=ht("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(i)}`);throw new Error(o)}},this.isValidDisconnect=async r=>{if(!Ls(r)){const{message:i}=ht("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(i)}const{topic:n}=r;await this.isValidSessionOrPairingTopic(n)},this.isValidAuthenticate=r=>{const{chains:n,uri:i,domain:a,nonce:s}=r;if(!Array.isArray(n)||n.length===0)throw new Error("chains is required and must be a non-empty array");if(!pi(i,!1))throw new Error("uri is required parameter");if(!pi(a,!1))throw new Error("domain is required parameter");if(!pi(s,!1))throw new Error("nonce is required parameter");if([...new Set(n.map(l=>vg(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:o}=vg(n[0]);if(o!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:n,hash:i,encryptedId:a,metadata:s,transportType:o}=r,l={verified:{verifyUrl:s.verifyUrl||Gy,validation:"UNKNOWN",origin:s.url||""}};try{if(o===Cn.link_mode){const u=this.getAppLinkIfEnabled(s,o);return l.verified.validation=u&&new URL(u).origin===new URL(s.url).origin?"VALID":"INVALID",l}const c=await this.client.core.verify.resolve({attestationId:n,hash:i,encryptedId:a,verifyUrl:s.verifyUrl});c&&(l.verified.origin=c.origin,l.verified.isScam=c.isScam,l.verified.validation=c.origin===new URL(s.url).origin?"VALID":"INVALID")}catch(c){this.client.logger.warn(c)}return this.client.logger.debug(`Verify context: ${JSON.stringify(l)}`),l},this.validateSessionProps=(r,n)=>{Object.values(r).forEach(i=>{if(!pi(i,!1)){const{message:a}=ht("MISSING_OR_INVALID",`${n} must be in Record format. Received: ${JSON.stringify(i)}`);throw new Error(a)}})},this.getPendingAuthRequest=r=>{const n=this.client.auth.requests.get(r);return typeof n=="object"?n:void 0},this.addToRecentlyDeleted=(r,n)=>{if(this.recentlyDeletedMap.set(r,n),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let i=0;const a=this.recentlyDeletedLimit/2;for(const s of this.recentlyDeletedMap.keys()){if(i++>=a)break;this.recentlyDeletedMap.delete(s)}}},this.checkRecentlyDeleted=r=>{const n=this.recentlyDeletedMap.get(r);if(n){const{message:i}=ht("MISSING_OR_INVALID",`Record was recently deleted - ${n}: ${r}`);throw new Error(i)}},this.isLinkModeEnabled=(r,n)=>{var i,a,s,o,l,c,u,f,h;return!r||n!==Cn.link_mode?!1:((a=(i=this.client.metadata)==null?void 0:i.redirect)==null?void 0:a.linkMode)===!0&&((o=(s=this.client.metadata)==null?void 0:s.redirect)==null?void 0:o.universal)!==void 0&&((c=(l=this.client.metadata)==null?void 0:l.redirect)==null?void 0:c.universal)!==""&&((u=r==null?void 0:r.redirect)==null?void 0:u.universal)!==void 0&&((f=r==null?void 0:r.redirect)==null?void 0:f.universal)!==""&&((h=r==null?void 0:r.redirect)==null?void 0:h.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(r.redirect.universal)&&typeof(global==null?void 0:global.Linking)<"u"},this.getAppLinkIfEnabled=(r,n)=>{var i;return this.isLinkModeEnabled(r,n)?(i=r==null?void 0:r.redirect)==null?void 0:i.universal:void 0},this.handleLinkModeMessage=({url:r})=>{if(!r||!r.includes("wc_ev")||!r.includes("topic"))return;const n=uW(r,"topic")||"",i=decodeURIComponent(uW(r,"wc_ev")||""),a=this.client.session.keys.includes(n);a&&this.client.session.update(n,{transportType:Cn.link_mode}),this.client.core.dispatchEnvelope({topic:n,message:i,sessionExists:a})},this.registerLinkModeListeners=async()=>{var r;if(kj()||jh()&&(r=this.client.metadata.redirect)!=null&&r.linkMode){const n=global==null?void 0:global.Linking;if(typeof n<"u"){n.addEventListener("url",this.handleLinkModeMessage,this.client.name);const i=await n.getInitialURL();i&&setTimeout(()=>{this.handleLinkModeMessage({url:i})},50)}}}}isInitialized(){if(!this.initialized){const{message:e}=ht("NOT_INITIALIZED",this.name);throw new Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Zi.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:n,attestation:i,transportType:a}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(V6)?this.client.auth.authKeys.get(V6):{responseTopic:void 0,publicKey:void 0},o=await this.client.core.crypto.decode(r,n,{receiverPublicKey:s,encoding:a===Cn.link_mode?q2:zf});try{Dj(o)?(this.client.core.history.set(r,o),this.onRelayEventRequest({topic:r,payload:o,attestation:i,transportType:a,encryptedId:xd(n)})):d7(o)?(await this.client.core.history.resolve(o),await this.onRelayEventResponse({topic:r,payload:o,transportType:a}),this.client.core.history.delete(r,o.id)):this.onRelayEventUnknownPayload({topic:r,payload:o,transportType:a})}catch(l){this.client.logger.error(l)}}registerExpirerEvents(){this.client.core.expirer.on(nl.expired,async e=>{const{topic:r,id:n}=xie(e.target);if(n&&this.client.pendingRequest.keys.includes(n))return await this.deletePendingSessionRequest(n,ht("EXPIRED"),!0);if(n&&this.client.auth.requests.keys.includes(n))return await this.deletePendingAuthRequest(n,ht("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):n&&(await this.deleteProposal(n,!0),this.client.events.emit("proposal_expire",{id:n}))})}registerPairingEvents(){this.client.core.pairing.events.on(y0.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(y0.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!pi(e,!1)){const{message:r}=ht("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(kf(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=ht("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!pi(e,!1)){const{message:r}=ht("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(kf(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=ht("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=ht("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(pi(e,!1)){const{message:r}=ht("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=ht("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!UWe(e)){const{message:r}=ht("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=ht("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(kf(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=ht("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class dKe extends R1{constructor(e,r){super(e,r,KYe,Oj),this.core=e,this.logger=r}}let fKe=class extends R1{constructor(e,r){super(e,r,JYe,Oj),this.core=e,this.logger=r}};class hKe extends R1{constructor(e,r){super(e,r,ZYe,Oj,n=>n.id),this.core=e,this.logger=r}}class pKe extends R1{constructor(e,r){super(e,r,rKe,h7,()=>V6),this.core=e,this.logger=r}}class gKe extends R1{constructor(e,r){super(e,r,nKe,h7),this.core=e,this.logger=r}}class mKe extends R1{constructor(e,r){super(e,r,iKe,h7,n=>n.id),this.core=e,this.logger=r}}class yKe{constructor(e,r){this.core=e,this.logger=r,this.authKeys=new pKe(this.core,this.logger),this.pairingTopics=new gKe(this.core,this.logger),this.requests=new mKe(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}let wKe=class uae extends mGe{constructor(e){super(e),this.protocol=sae,this.version=oae,this.name=RS.name,this.events=new ys.EventEmitter,this.on=(n,i)=>this.events.on(n,i),this.once=(n,i)=>this.events.once(n,i),this.off=(n,i)=>this.events.off(n,i),this.removeListener=(n,i)=>this.events.removeListener(n,i),this.removeAllListeners=n=>this.events.removeAllListeners(n),this.connect=async n=>{try{return await this.engine.connect(n)}catch(i){throw this.logger.error(i.message),i}},this.pair=async n=>{try{return await this.engine.pair(n)}catch(i){throw this.logger.error(i.message),i}},this.approve=async n=>{try{return await this.engine.approve(n)}catch(i){throw this.logger.error(i.message),i}},this.reject=async n=>{try{return await this.engine.reject(n)}catch(i){throw this.logger.error(i.message),i}},this.update=async n=>{try{return await this.engine.update(n)}catch(i){throw this.logger.error(i.message),i}},this.extend=async n=>{try{return await this.engine.extend(n)}catch(i){throw this.logger.error(i.message),i}},this.request=async n=>{try{return await this.engine.request(n)}catch(i){throw this.logger.error(i.message),i}},this.respond=async n=>{try{return await this.engine.respond(n)}catch(i){throw this.logger.error(i.message),i}},this.ping=async n=>{try{return await this.engine.ping(n)}catch(i){throw this.logger.error(i.message),i}},this.emit=async n=>{try{return await this.engine.emit(n)}catch(i){throw this.logger.error(i.message),i}},this.disconnect=async n=>{try{return await this.engine.disconnect(n)}catch(i){throw this.logger.error(i.message),i}},this.find=n=>{try{return this.engine.find(n)}catch(i){throw this.logger.error(i.message),i}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(n){throw this.logger.error(n.message),n}},this.authenticate=async(n,i)=>{try{return await this.engine.authenticate(n,i)}catch(a){throw this.logger.error(a.message),a}},this.formatAuthMessage=n=>{try{return this.engine.formatAuthMessage(n)}catch(i){throw this.logger.error(i.message),i}},this.approveSessionAuthenticate=async n=>{try{return await this.engine.approveSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.rejectSessionAuthenticate=async n=>{try{return await this.engine.rejectSessionAuthenticate(n)}catch(i){throw this.logger.error(i.message),i}},this.name=(e==null?void 0:e.name)||RS.name,this.metadata=(e==null?void 0:e.metadata)||mie(),this.signConfig=e==null?void 0:e.signConfig;const r=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:bv(l7({level:(e==null?void 0:e.logger)||RS.logger}));this.core=(e==null?void 0:e.core)||new YYe(e),this.logger=ws(r,this.name),this.session=new fKe(this.core,this.logger),this.proposal=new dKe(this.core,this.logger),this.pendingRequest=new hKe(this.core,this.logger),this.engine=new uKe(this),this.auth=new yKe(this.core,this.logger)}static async init(e){const r=new uae(e);return await r.initialize(),r}get context(){return eo(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),setTimeout(()=>{this.engine.processRelayMessageCache()},ct.toMiliseconds(ct.ONE_SECOND))}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}};var S8={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */m8.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,h=2,g=4,m=1,w=2,_=1,v=2,b=4,A=8,S=16,j=32,U=64,I=128,B=256,V=512,se=30,Y="...",N=800,k=16,x=1,E=2,L=3,O=1/0,P=9007199254740991,R=17976931348623157e292,M=NaN,D=4294967295,$=D-1,X=D>>>1,le=[["ary",I],["bind",_],["bindKey",v],["curry",A],["curryRight",S],["flip",V],["partial",j],["partialRight",U],["rearg",B]],H="[object Arguments]",ee="[object Array]",J="[object AsyncFunction]",te="[object Boolean]",re="[object Date]",z="[object DOMException]",G="[object Error]",Z="[object Function]",me="[object GeneratorFunction]",be="[object Map]",Ce="[object Number]",Fe="[object Null]",Ue="[object Object]",Ke="[object Promise]",lt="[object Proxy]",Ee="[object RegExp]",He="[object Set]",qe="[object String]",Ie="[object Symbol]",Ne="[object Undefined]",Pe="[object WeakMap]",$e="[object WeakSet]",K="[object ArrayBuffer]",F="[object DataView]",W="[object Float32Array]",ie="[object Float64Array]",pe="[object Int8Array]",we="[object Int16Array]",he="[object Int32Array]",De="[object Uint8Array]",Je="[object Uint8ClampedArray]",et="[object Uint16Array]",it="[object Uint32Array]",ut=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,tr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,mt=RegExp(zt.source),St=RegExp(At.source),dt=/<%-([\s\S]+?)%>/g,Nt=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qt=/^\w*$/,Wt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/[\\^$.*+?()[\]{}|]/g,Vt=RegExp(ot.source),Ft=/^\s+/,yt=/\s/,Qe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,xt=/,? & /,Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cr=/[()=,{}\[\]\/\s]/,Gt=/\\(\\)?/g,Sr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cr=/\w*$/,br=/^[-+]0x[0-9a-f]+$/i,Q=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,de=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,je=/($^)/,Ge=/['\n\r\u2028\u2029\\]/g,Be="\\ud800-\\udfff",tt="\\u0300-\\u036f",vt="\\ufe20-\\ufe2f",Lt="\\u20d0-\\u20ff",Ct=tt+vt+Lt,ir="\\u2700-\\u27bf",Qt="a-z\\xdf-\\xf6\\xf8-\\xff",sn="\\xac\\xb1\\xd7\\xf7",Rr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",dn="\\u2000-\\u206f",Ga=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ws="A-Z\\xc0-\\xd6\\xd8-\\xde",Qs="\\ufe0e\\ufe0f",Ic=sn+Rr+dn+Ga,$h="['’]",Ru="["+Be+"]",Zm="["+Ic+"]",Ph="["+Ct+"]",Rv="\\d+",oE="["+ir+"]",Dv="["+Qt+"]",Ov="[^"+Be+Ic+Rv+ir+Qt+ws+"]",z1="\\ud83c[\\udffb-\\udfff]",lE="(?:"+Ph+"|"+z1+")",Fv="[^"+Be+"]",W1="(?:\\ud83c[\\udde6-\\uddff]){2}",Xd="[\\ud800-\\udbff][\\udc00-\\udfff]",Xs="["+ws+"]",Uv="\\u200d",Bv="(?:"+Dv+"|"+Ov+")",Mc="(?:"+Xs+"|"+Ov+")",zv="(?:"+$h+"(?:d|ll|m|re|s|t|ve))?",Wv="(?:"+$h+"(?:D|LL|M|RE|S|T|VE))?",Hv=lE+"?",Gv="["+Qs+"]?",cE="(?:"+Uv+"(?:"+[Fv,W1,Xd].join("|")+")"+Gv+Hv+")*",Du="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",qv="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vv=Gv+Hv+cE,H1="(?:"+[oE,W1,Xd].join("|")+")"+Vv,uE="(?:"+[Fv+Ph+"?",Ph,W1,Xd,Ru].join("|")+")",Qm=RegExp($h,"g"),dE=RegExp(Ph,"g"),G1=RegExp(z1+"(?="+z1+")|"+uE+Vv,"g"),Yv=RegExp([Xs+"?"+Dv+"+"+zv+"(?="+[Zm,Xs,"$"].join("|")+")",Mc+"+"+Wv+"(?="+[Zm,Xs+Bv,"$"].join("|")+")",Xs+"?"+Bv+"+"+zv,Xs+"+"+Wv,qv,Du,Rv,H1].join("|"),"g"),Kv=RegExp("["+Uv+Be+Ct+Qs+"]"),Rh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Jv=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],fE=-1,mn={};mn[W]=mn[ie]=mn[pe]=mn[we]=mn[he]=mn[De]=mn[Je]=mn[et]=mn[it]=!0,mn[H]=mn[ee]=mn[K]=mn[te]=mn[F]=mn[re]=mn[G]=mn[Z]=mn[be]=mn[Ce]=mn[Ue]=mn[Ee]=mn[He]=mn[qe]=mn[Pe]=!1;var fn={};fn[H]=fn[ee]=fn[K]=fn[F]=fn[te]=fn[re]=fn[W]=fn[ie]=fn[pe]=fn[we]=fn[he]=fn[be]=fn[Ce]=fn[Ue]=fn[Ee]=fn[He]=fn[qe]=fn[Ie]=fn[De]=fn[Je]=fn[et]=fn[it]=!0,fn[G]=fn[Z]=fn[Pe]=!1;var ge={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Te={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe={"&":"&","<":"<",">":">",""":'"',"'":"'"},It={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},yn=parseFloat,gr=parseInt,Nn=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,yi=typeof self=="object"&&self&&self.Object===Object&&self,Br=Nn||yi||Function("return this")(),wn=e&&!e.nodeType&&e,ci=wn&&!0&&t&&!t.nodeType&&t,vs=ci&&ci.exports===wn,wi=vs&&Nn.process,Ln=function(){try{var Me=ci&&ci.require&&ci.require("util").types;return Me||wi&&wi.binding&&wi.binding("util")}catch{}}(),qa=Ln&&Ln.isArrayBuffer,kl=Ln&&Ln.isDate,Fo=Ln&&Ln.isMap,Tc=Ln&&Ln.isRegExp,Xm=Ln&&Ln.isSet,Dh=Ln&&Ln.isTypedArray;function Ri(Me,We,Oe){switch(Oe.length){case 0:return Me.call(We);case 1:return Me.call(We,Oe[0]);case 2:return Me.call(We,Oe[0],Oe[1]);case 3:return Me.call(We,Oe[0],Oe[1],Oe[2])}return Me.apply(We,Oe)}function Aue(Me,We,Oe,Mt){for(var fr=-1,en=Me==null?0:Me.length;++fr-1}function hE(Me,We,Oe){for(var Mt=-1,fr=Me==null?0:Me.length;++Mt-1;);return Oe}function H$(Me,We){for(var Oe=Me.length;Oe--&&q1(We,Me[Oe],0)>-1;);return Oe}function Pue(Me,We){for(var Oe=Me.length,Mt=0;Oe--;)Me[Oe]===We&&++Mt;return Mt}var Rue=yE(ge),Due=yE(Te);function Oue(Me){return"\\"+It[Me]}function Fue(Me,We){return Me==null?r:Me[We]}function V1(Me){return Kv.test(Me)}function Uue(Me){return Rh.test(Me)}function Bue(Me){for(var We,Oe=[];!(We=Me.next()).done;)Oe.push(We.value);return Oe}function xE(Me){var We=-1,Oe=Array(Me.size);return Me.forEach(function(Mt,fr){Oe[++We]=[fr,Mt]}),Oe}function G$(Me,We){return function(Oe){return Me(We(Oe))}}function rf(Me,We){for(var Oe=-1,Mt=Me.length,fr=0,en=[];++Oe-1}function Mde(p,y){var T=this.__data__,q=pb(T,p);return q<0?(++this.size,T.push([p,y])):T[q][1]=y,this}Ou.prototype.clear=Cde,Ou.prototype.delete=Sde,Ou.prototype.get=Ade,Ou.prototype.has=Ide,Ou.prototype.set=Mde;function Fu(p){var y=-1,T=p==null?0:p.length;for(this.clear();++y=y?p:y)),p}function Wo(p,y,T,q,ne,ce){var xe,Se=y&f,ke=y&h,Ve=y&g;if(T&&(xe=ne?T(p,q,ne,ce):T(p)),xe!==r)return xe;if(!Hn(p))return p;var Ye=mr(p);if(Ye){if(xe=Lfe(p),!Se)return bs(p,xe)}else{var rt=Ca(p),bt=rt==Z||rt==me;if(cf(p))return IP(p,Se);if(rt==Ue||rt==H||bt&&!ne){if(xe=ke||bt?{}:qP(p),!Se)return ke?xfe(p,Hde(xe,p)):bfe(p,nP(xe,p))}else{if(!fn[rt])return ne?p:{};xe=jfe(p,rt,Se)}}ce||(ce=new Ll);var Ut=ce.get(p);if(Ut)return Ut;ce.set(p,xe),xR(p)?p.forEach(function(sr){xe.add(Wo(sr,y,T,sr,p,ce))}):vR(p)&&p.forEach(function(sr,Lr){xe.set(Lr,Wo(sr,y,T,Lr,p,ce))});var ar=Ve?ke?VE:qE:ke?Es:Di,xr=Ye?r:ar(p);return Uo(xr||p,function(sr,Lr){xr&&(Lr=sr,sr=p[Lr]),s2(xe,Lr,Wo(sr,y,T,Lr,p,ce))}),xe}function Gde(p){var y=Di(p);return function(T){return iP(T,p,y)}}function iP(p,y,T){var q=T.length;if(p==null)return!q;for(p=vn(p);q--;){var ne=T[q],ce=y[ne],xe=p[ne];if(xe===r&&!(ne in p)||!ce(xe))return!1}return!0}function aP(p,y,T){if(typeof p!="function")throw new Bo(s);return h2(function(){p.apply(r,T)},y)}function o2(p,y,T,q){var ne=-1,ce=Zv,xe=!0,Se=p.length,ke=[],Ve=y.length;if(!Se)return ke;T&&(y=On(y,eo(T))),q?(ce=hE,xe=!1):y.length>=i&&(ce=e2,xe=!1,y=new Uh(y));e:for(;++nene?0:ne+T),q=q===r||q>ne?ne:vr(q),q<0&&(q+=ne),q=T>q?0:_R(q);T0&&T(Se)?y>1?da(Se,y-1,T,q,ne):tf(ne,Se):q||(ne[ne.length]=Se)}return ne}var ME=jP(),lP=jP(!0);function kc(p,y){return p&&ME(p,y,Di)}function TE(p,y){return p&&lP(p,y,Di)}function mb(p,y){return ef(y,function(T){return Hu(p[T])})}function zh(p,y){y=of(y,p);for(var T=0,q=y.length;p!=null&&Ty}function Yde(p,y){return p!=null&&on.call(p,y)}function Kde(p,y){return p!=null&&y in vn(p)}function Jde(p,y,T){return p>=_a(y,T)&&p=120&&Ye.length>=120)?new Uh(xe&&Ye):r}Ye=p[0];var rt=-1,bt=Se[0];e:for(;++rt-1;)Se!==p&&ob.call(Se,ke,1),ob.call(p,ke,1);return p}function vP(p,y){for(var T=p?y.length:0,q=T-1;T--;){var ne=y[T];if(T==q||ne!==ce){var ce=ne;Wu(ne)?ob.call(p,ne,1):FE(p,ne)}}return p}function RE(p,y){return p+ub(X$()*(y-p+1))}function cfe(p,y,T,q){for(var ne=-1,ce=Ti(cb((y-p)/(T||1)),0),xe=Oe(ce);ce--;)xe[q?ce:++ne]=p,p+=T;return xe}function DE(p,y){var T="";if(!p||y<1||y>P)return T;do y%2&&(T+=p),y=ub(y/2),y&&(p+=p);while(y);return T}function Ar(p,y){return e_(KP(p,y,_s),p+"")}function ufe(p){return rP(ip(p))}function dfe(p,y){var T=ip(p);return Ib(T,Bh(y,0,T.length))}function u2(p,y,T,q){if(!Hn(p))return p;y=of(y,p);for(var ne=-1,ce=y.length,xe=ce-1,Se=p;Se!=null&&++nene?0:ne+y),T=T>ne?ne:T,T<0&&(T+=ne),ne=y>T?0:T-y>>>0,y>>>=0;for(var ce=Oe(ne);++q>>1,xe=p[ce];xe!==null&&!ro(xe)&&(T?xe<=y:xe=i){var Ve=y?null:Sfe(p);if(Ve)return Xv(Ve);xe=!1,ne=e2,ke=new Uh}else ke=y?[]:Se;e:for(;++q=q?p:Ho(p,y,T)}var AP=rde||function(p){return Br.clearTimeout(p)};function IP(p,y){if(y)return p.slice();var T=p.length,q=Y$?Y$(T):new p.constructor(T);return p.copy(q),q}function WE(p){var y=new p.constructor(p.byteLength);return new ab(y).set(new ab(p)),y}function mfe(p,y){var T=y?WE(p.buffer):p.buffer;return new p.constructor(T,p.byteOffset,p.byteLength)}function yfe(p){var y=new p.constructor(p.source,cr.exec(p));return y.lastIndex=p.lastIndex,y}function wfe(p){return a2?vn(a2.call(p)):{}}function MP(p,y){var T=y?WE(p.buffer):p.buffer;return new p.constructor(T,p.byteOffset,p.length)}function TP(p,y){if(p!==y){var T=p!==r,q=p===null,ne=p===p,ce=ro(p),xe=y!==r,Se=y===null,ke=y===y,Ve=ro(y);if(!Se&&!Ve&&!ce&&p>y||ce&&xe&&ke&&!Se&&!Ve||q&&xe&&ke||!T&&ke||!ne)return 1;if(!q&&!ce&&!Ve&&p=Se)return ke;var Ve=T[q];return ke*(Ve=="desc"?-1:1)}}return p.index-y.index}function kP(p,y,T,q){for(var ne=-1,ce=p.length,xe=T.length,Se=-1,ke=y.length,Ve=Ti(ce-xe,0),Ye=Oe(ke+Ve),rt=!q;++Se1?T[ne-1]:r,xe=ne>2?T[2]:r;for(ce=p.length>3&&typeof ce=="function"?(ne--,ce):r,xe&&Ya(T[0],T[1],xe)&&(ce=ne<3?r:ce,ne=1),y=vn(y);++q-1?ne[ce?y[xe]:xe]:r}}function RP(p){return zu(function(y){var T=y.length,q=T,ne=zo.prototype.thru;for(p&&y.reverse();q--;){var ce=y[q];if(typeof ce!="function")throw new Bo(s);if(ne&&!xe&&Sb(ce)=="wrapper")var xe=new zo([],!0)}for(q=xe?q:T;++q1&&zr.reverse(),Ye&&keSe))return!1;var Ve=ce.get(p),Ye=ce.get(y);if(Ve&&Ye)return Ve==y&&Ye==p;var rt=-1,bt=!0,Ut=T&w?new Uh:r;for(ce.set(p,y),ce.set(y,p);++rt1?"& ":"")+y[q],y=y.join(T>2?", ":" "),p.replace(Qe,`{ + */S8.exports;(function(t,e){(function(){var r,n="4.17.21",i=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",o="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",c=500,u="__lodash_placeholder__",f=1,h=2,g=4,m=1,w=2,C=1,v=2,b=4,A=8,S=16,j=32,F=64,I=128,B=256,V=512,se=30,Y="...",N=800,k=16,x=1,E=2,L=3,O=1/0,P=9007199254740991,R=17976931348623157e292,M=NaN,D=4294967295,$=D-1,X=D>>>1,le=[["ary",I],["bind",C],["bindKey",v],["curry",A],["curryRight",S],["flip",V],["partial",j],["partialRight",F],["rearg",B]],H="[object Arguments]",ee="[object Array]",J="[object AsyncFunction]",te="[object Boolean]",re="[object Date]",z="[object DOMException]",G="[object Error]",Q="[object Function]",me="[object GeneratorFunction]",be="[object Map]",Ce="[object Number]",Fe="[object Null]",Ue="[object Object]",Ke="[object Promise]",lt="[object Proxy]",Ee="[object RegExp]",He="[object Set]",qe="[object String]",Ie="[object Symbol]",Ne="[object Undefined]",$e="[object WeakMap]",je="[object WeakSet]",K="[object ArrayBuffer]",U="[object DataView]",W="[object Float32Array]",ie="[object Float64Array]",pe="[object Int8Array]",we="[object Int16Array]",he="[object Int32Array]",Re="[object Uint8Array]",Je="[object Uint8ClampedArray]",et="[object Uint16Array]",it="[object Uint32Array]",ut=/\b__p \+= '';/g,pt=/\b(__p \+=) '' \+/g,tr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,mt=RegExp(zt.source),St=RegExp(At.source),dt=/<%-([\s\S]+?)%>/g,Nt=/<%([\s\S]+?)%>/g,Rt=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qt=/^\w*$/,Wt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/[\\^$.*+?()[\]{}|]/g,Vt=RegExp(ot.source),Ft=/^\s+/,yt=/\s/,Ze=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Pt=/\{\n\/\* \[wrapped with (.+)\] \*/,xt=/,? & /,Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Cr=/[()=,{}\[\]\/\s]/,Gt=/\\(\\)?/g,Sr=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,cr=/\w*$/,br=/^[-+]0x[0-9a-f]+$/i,Z=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,de=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,ve=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Le=/($^)/,Ge=/['\n\r\u2028\u2029\\]/g,Be="\\ud800-\\udfff",tt="\\u0300-\\u036f",vt="\\ufe20-\\ufe2f",Lt="\\u20d0-\\u20ff",Ct=tt+vt+Lt,ir="\\u2700-\\u27bf",Zt="a-z\\xdf-\\xf6\\xf8-\\xff",sn="\\xac\\xb1\\xd7\\xf7",Rr="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",dn="\\u2000-\\u206f",qa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",bs="A-Z\\xc0-\\xd6\\xd8-\\xde",to="\\ufe0e\\ufe0f",Nc=sn+Rr+dn+qa,Uh="['’]",Bu="["+Be+"]",a2="["+Nc+"]",Bh="["+Ct+"]",Hv="\\d+",mE="["+ir+"]",Gv="["+Zt+"]",qv="[^"+Be+Nc+Hv+ir+Zt+bs+"]",K1="\\ud83c[\\udffb-\\udfff]",yE="(?:"+Bh+"|"+K1+")",Vv="[^"+Be+"]",J1="(?:\\ud83c[\\udde6-\\uddff]){2}",sf="[\\ud800-\\udbff][\\udc00-\\udfff]",ro="["+bs+"]",Yv="\\u200d",Kv="(?:"+Gv+"|"+qv+")",Lc="(?:"+ro+"|"+qv+")",Jv="(?:"+Uh+"(?:d|ll|m|re|s|t|ve))?",Qv="(?:"+Uh+"(?:D|LL|M|RE|S|T|VE))?",Zv=yE+"?",Xv="["+to+"]?",wE="(?:"+Yv+"(?:"+[Vv,J1,sf].join("|")+")"+Xv+Zv+")*",zu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",eb="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",tb=Xv+Zv+wE,Q1="(?:"+[mE,J1,sf].join("|")+")"+tb,vE="(?:"+[Vv+Bh+"?",Bh,J1,sf,Bu].join("|")+")",s2=RegExp(Uh,"g"),bE=RegExp(Bh,"g"),Z1=RegExp(K1+"(?="+K1+")|"+vE+tb,"g"),rb=RegExp([ro+"?"+Gv+"+"+Jv+"(?="+[a2,ro,"$"].join("|")+")",Lc+"+"+Qv+"(?="+[a2,ro+Kv,"$"].join("|")+")",ro+"?"+Kv+"+"+Jv,ro+"+"+Qv,eb,zu,Hv,Q1].join("|"),"g"),nb=RegExp("["+Yv+Be+Ct+to+"]"),zh=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ib=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xE=-1,mn={};mn[W]=mn[ie]=mn[pe]=mn[we]=mn[he]=mn[Re]=mn[Je]=mn[et]=mn[it]=!0,mn[H]=mn[ee]=mn[K]=mn[te]=mn[U]=mn[re]=mn[G]=mn[Q]=mn[be]=mn[Ce]=mn[Ue]=mn[Ee]=mn[He]=mn[qe]=mn[$e]=!1;var fn={};fn[H]=fn[ee]=fn[K]=fn[U]=fn[te]=fn[re]=fn[W]=fn[ie]=fn[pe]=fn[we]=fn[he]=fn[be]=fn[Ce]=fn[Ue]=fn[Ee]=fn[He]=fn[qe]=fn[Ie]=fn[Re]=fn[Je]=fn[et]=fn[it]=!0,fn[G]=fn[Q]=fn[$e]=!1;var ge={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Te={"&":"&","<":"<",">":">",'"':""","'":"'"},Xe={"&":"&","<":"<",">":">",""":'"',"'":"'"},It={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},yn=parseFloat,gr=parseInt,Nn=typeof Xt=="object"&&Xt&&Xt.Object===Object&&Xt,yi=typeof self=="object"&&self&&self.Object===Object&&self,Br=Nn||yi||Function("return this")(),wn=e&&!e.nodeType&&e,ci=wn&&!0&&t&&!t.nodeType&&t,xs=ci&&ci.exports===wn,wi=xs&&Nn.process,Ln=function(){try{var Me=ci&&ci.require&&ci.require("util").types;return Me||wi&&wi.binding&&wi.binding("util")}catch{}}(),Va=Ln&&Ln.isArrayBuffer,jl=Ln&&Ln.isDate,zo=Ln&&Ln.isMap,jc=Ln&&Ln.isRegExp,o2=Ln&&Ln.isSet,Wh=Ln&&Ln.isTypedArray;function Di(Me,We,Oe){switch(Oe.length){case 0:return Me.call(We);case 1:return Me.call(We,Oe[0]);case 2:return Me.call(We,Oe[0],Oe[1]);case 3:return Me.call(We,Oe[0],Oe[1],Oe[2])}return Me.apply(We,Oe)}function Zue(Me,We,Oe,Mt){for(var fr=-1,en=Me==null?0:Me.length;++fr-1}function EE(Me,We,Oe){for(var Mt=-1,fr=Me==null?0:Me.length;++Mt-1;);return Oe}function nP(Me,We){for(var Oe=Me.length;Oe--&&X1(We,Me[Oe],0)>-1;);return Oe}function ode(Me,We){for(var Oe=Me.length,Mt=0;Oe--;)Me[Oe]===We&&++Mt;return Mt}var lde=AE(ge),cde=AE(Te);function ude(Me){return"\\"+It[Me]}function dde(Me,We){return Me==null?r:Me[We]}function ep(Me){return nb.test(Me)}function fde(Me){return zh.test(Me)}function hde(Me){for(var We,Oe=[];!(We=Me.next()).done;)Oe.push(We.value);return Oe}function kE(Me){var We=-1,Oe=Array(Me.size);return Me.forEach(function(Mt,fr){Oe[++We]=[fr,Mt]}),Oe}function iP(Me,We){return function(Oe){return Me(We(Oe))}}function cf(Me,We){for(var Oe=-1,Mt=Me.length,fr=0,en=[];++Oe-1}function efe(p,y){var T=this.__data__,q=Eb(T,p);return q<0?(++this.size,T.push([p,y])):T[q][1]=y,this}Wu.prototype.clear=Jde,Wu.prototype.delete=Qde,Wu.prototype.get=Zde,Wu.prototype.has=Xde,Wu.prototype.set=efe;function Hu(p){var y=-1,T=p==null?0:p.length;for(this.clear();++y=y?p:y)),p}function qo(p,y,T,q,ne,ce){var xe,Se=y&f,ke=y&h,Ve=y&g;if(T&&(xe=ne?T(p,q,ne,ce):T(p)),xe!==r)return xe;if(!Hn(p))return p;var Ye=mr(p);if(Ye){if(xe=ihe(p),!Se)return Es(p,xe)}else{var rt=Sa(p),bt=rt==Q||rt==me;if(gf(p))return UP(p,Se);if(rt==Ue||rt==H||bt&&!ne){if(xe=ke||bt?{}:aR(p),!Se)return ke?Vfe(p,mfe(xe,p)):qfe(p,mP(xe,p))}else{if(!fn[rt])return ne?p:{};xe=ahe(p,rt,Se)}}ce||(ce=new Pl);var Ut=ce.get(p);if(Ut)return Ut;ce.set(p,xe),$R(p)?p.forEach(function(sr){xe.add(qo(sr,y,T,sr,p,ce))}):LR(p)&&p.forEach(function(sr,Lr){xe.set(Lr,qo(sr,y,T,Lr,p,ce))});var ar=Ve?ke?r_:t_:ke?Cs:Oi,xr=Ye?r:ar(p);return Wo(xr||p,function(sr,Lr){xr&&(Lr=sr,sr=p[Lr]),p2(xe,Lr,qo(sr,y,T,Lr,p,ce))}),xe}function yfe(p){var y=Oi(p);return function(T){return yP(T,p,y)}}function yP(p,y,T){var q=T.length;if(p==null)return!q;for(p=vn(p);q--;){var ne=T[q],ce=y[ne],xe=p[ne];if(xe===r&&!(ne in p)||!ce(xe))return!1}return!0}function wP(p,y,T){if(typeof p!="function")throw new Ho(s);return x2(function(){p.apply(r,T)},y)}function g2(p,y,T,q){var ne=-1,ce=ab,xe=!0,Se=p.length,ke=[],Ve=y.length;if(!Se)return ke;T&&(y=On(y,no(T))),q?(ce=EE,xe=!1):y.length>=i&&(ce=l2,xe=!1,y=new qh(y));e:for(;++nene?0:ne+T),q=q===r||q>ne?ne:vr(q),q<0&&(q+=ne),q=T>q?0:RR(q);T0&&T(Se)?y>1?fa(Se,y-1,T,q,ne):lf(ne,Se):q||(ne[ne.length]=Se)}return ne}var DE=qP(),xP=qP(!0);function $c(p,y){return p&&DE(p,y,Oi)}function OE(p,y){return p&&xP(p,y,Oi)}function Cb(p,y){return of(y,function(T){return Ku(p[T])})}function Yh(p,y){y=hf(y,p);for(var T=0,q=y.length;p!=null&&Ty}function bfe(p,y){return p!=null&&on.call(p,y)}function xfe(p,y){return p!=null&&y in vn(p)}function Efe(p,y,T){return p>=Ca(y,T)&&p=120&&Ye.length>=120)?new qh(xe&&Ye):r}Ye=p[0];var rt=-1,bt=Se[0];e:for(;++rt-1;)Se!==p&&gb.call(Se,ke,1),gb.call(p,ke,1);return p}function LP(p,y){for(var T=p?y.length:0,q=T-1;T--;){var ne=y[T];if(T==q||ne!==ce){var ce=ne;Yu(ne)?gb.call(p,ne,1):YE(p,ne)}}return p}function GE(p,y){return p+wb(fP()*(y-p+1))}function Pfe(p,y,T,q){for(var ne=-1,ce=Ti(yb((y-p)/(T||1)),0),xe=Oe(ce);ce--;)xe[q?ce:++ne]=p,p+=T;return xe}function qE(p,y){var T="";if(!p||y<1||y>P)return T;do y%2&&(T+=p),y=wb(y/2),y&&(p+=p);while(y);return T}function Ar(p,y){return c_(lR(p,y,Ss),p+"")}function Rfe(p){return gP(dp(p))}function Dfe(p,y){var T=dp(p);return Pb(T,Vh(y,0,T.length))}function w2(p,y,T,q){if(!Hn(p))return p;y=hf(y,p);for(var ne=-1,ce=y.length,xe=ce-1,Se=p;Se!=null&&++nene?0:ne+y),T=T>ne?ne:T,T<0&&(T+=ne),ne=y>T?0:T-y>>>0,y>>>=0;for(var ce=Oe(ne);++q>>1,xe=p[ce];xe!==null&&!ao(xe)&&(T?xe<=y:xe=i){var Ve=y?null:Qfe(p);if(Ve)return ob(Ve);xe=!1,ne=l2,ke=new qh}else ke=y?[]:Se;e:for(;++q=q?p:Vo(p,y,T)}var FP=Mde||function(p){return Br.clearTimeout(p)};function UP(p,y){if(y)return p.slice();var T=p.length,q=oP?oP(T):new p.constructor(T);return p.copy(q),q}function ZE(p){var y=new p.constructor(p.byteLength);return new hb(y).set(new hb(p)),y}function zfe(p,y){var T=y?ZE(p.buffer):p.buffer;return new p.constructor(T,p.byteOffset,p.byteLength)}function Wfe(p){var y=new p.constructor(p.source,cr.exec(p));return y.lastIndex=p.lastIndex,y}function Hfe(p){return h2?vn(h2.call(p)):{}}function BP(p,y){var T=y?ZE(p.buffer):p.buffer;return new p.constructor(T,p.byteOffset,p.length)}function zP(p,y){if(p!==y){var T=p!==r,q=p===null,ne=p===p,ce=ao(p),xe=y!==r,Se=y===null,ke=y===y,Ve=ao(y);if(!Se&&!Ve&&!ce&&p>y||ce&&xe&&ke&&!Se&&!Ve||q&&xe&&ke||!T&&ke||!ne)return 1;if(!q&&!ce&&!Ve&&p=Se)return ke;var Ve=T[q];return ke*(Ve=="desc"?-1:1)}}return p.index-y.index}function WP(p,y,T,q){for(var ne=-1,ce=p.length,xe=T.length,Se=-1,ke=y.length,Ve=Ti(ce-xe,0),Ye=Oe(ke+Ve),rt=!q;++Se1?T[ne-1]:r,xe=ne>2?T[2]:r;for(ce=p.length>3&&typeof ce=="function"?(ne--,ce):r,xe&&Ka(T[0],T[1],xe)&&(ce=ne<3?r:ce,ne=1),y=vn(y);++q-1?ne[ce?y[xe]:xe]:r}}function KP(p){return Vu(function(y){var T=y.length,q=T,ne=Go.prototype.thru;for(p&&y.reverse();q--;){var ce=y[q];if(typeof ce!="function")throw new Ho(s);if(ne&&!xe&&jb(ce)=="wrapper")var xe=new Go([],!0)}for(q=xe?q:T;++q1&&zr.reverse(),Ye&&keSe))return!1;var Ve=ce.get(p),Ye=ce.get(y);if(Ve&&Ye)return Ve==y&&Ye==p;var rt=-1,bt=!0,Ut=T&w?new qh:r;for(ce.set(p,y),ce.set(y,p);++rt1?"& ":"")+y[q],y=y.join(T>2?", ":" "),p.replace(Ze,`{ /* [wrapped with `+y+`] */ -`)}function Pfe(p){return mr(p)||Gh(p)||!!(Z$&&p&&p[Z$])}function Wu(p,y){var T=typeof p;return y=y??P,!!y&&(T=="number"||T!="symbol"&&ue.test(p))&&p>-1&&p%1==0&&p0){if(++y>=N)return arguments[0]}else y=0;return p.apply(r,arguments)}}function Ib(p,y){var T=-1,q=p.length,ne=q-1;for(y=y===r?q:y;++T1?p[y-1]:r;return T=typeof T=="function"?(p.pop(),T):r,oR(p,T)});function lR(p){var y=oe(p);return y.__chain__=!0,y}function qhe(p,y){return y(p),p}function Mb(p,y){return y(p)}var Vhe=zu(function(p){var y=p.length,T=y?p[0]:0,q=this.__wrapped__,ne=function(ce){return IE(ce,p)};return y>1||this.__actions__.length||!(q instanceof Dr)||!Wu(T)?this.thru(ne):(q=q.slice(T,+T+(y?1:0)),q.__actions__.push({func:Mb,args:[ne],thisArg:r}),new zo(q,this.__chain__).thru(function(ce){return y&&!ce.length&&ce.push(r),ce}))});function Yhe(){return lR(this)}function Khe(){return new zo(this.value(),this.__chain__)}function Jhe(){this.__values__===r&&(this.__values__=ER(this.value()));var p=this.__index__>=this.__values__.length,y=p?r:this.__values__[this.__index__++];return{done:p,value:y}}function Zhe(){return this}function Qhe(p){for(var y,T=this;T instanceof hb;){var q=tR(T);q.__index__=0,q.__values__=r,y?ne.__wrapped__=q:y=q;var ne=q;T=T.__wrapped__}return ne.__wrapped__=p,y}function Xhe(){var p=this.__wrapped__;if(p instanceof Dr){var y=p;return this.__actions__.length&&(y=new Dr(this)),y=y.reverse(),y.__actions__.push({func:Mb,args:[t_],thisArg:r}),new zo(y,this.__chain__)}return this.thru(t_)}function e0e(){return CP(this.__wrapped__,this.__actions__)}var t0e=bb(function(p,y,T){on.call(p,T)?++p[T]:Uu(p,T,1)});function r0e(p,y,T){var q=mr(p)?D$:qde;return T&&Ya(p,y,T)&&(y=r),q(p,rr(y,3))}function n0e(p,y){var T=mr(p)?ef:oP;return T(p,rr(y,3))}var i0e=PP(rR),a0e=PP(nR);function s0e(p,y){return da(Tb(p,y),1)}function o0e(p,y){return da(Tb(p,y),O)}function l0e(p,y,T){return T=T===r?1:vr(T),da(Tb(p,y),T)}function cR(p,y){var T=mr(p)?Uo:af;return T(p,rr(y,3))}function uR(p,y){var T=mr(p)?Iue:sP;return T(p,rr(y,3))}var c0e=bb(function(p,y,T){on.call(p,T)?p[T].push(y):Uu(p,T,[y])});function u0e(p,y,T,q){p=xs(p)?p:ip(p),T=T&&!q?vr(T):0;var ne=p.length;return T<0&&(T=Ti(ne+T,0)),$b(p)?T<=ne&&p.indexOf(y,T)>-1:!!ne&&q1(p,y,T)>-1}var d0e=Ar(function(p,y,T){var q=-1,ne=typeof y=="function",ce=xs(p)?Oe(p.length):[];return af(p,function(xe){ce[++q]=ne?Ri(y,xe,T):l2(xe,y,T)}),ce}),f0e=bb(function(p,y,T){Uu(p,T,y)});function Tb(p,y){var T=mr(p)?On:hP;return T(p,rr(y,3))}function h0e(p,y,T,q){return p==null?[]:(mr(y)||(y=y==null?[]:[y]),T=q?r:T,mr(T)||(T=T==null?[]:[T]),yP(p,y,T))}var p0e=bb(function(p,y,T){p[T?0:1].push(y)},function(){return[[],[]]});function g0e(p,y,T){var q=mr(p)?pE:B$,ne=arguments.length<3;return q(p,rr(y,4),T,ne,af)}function m0e(p,y,T){var q=mr(p)?Mue:B$,ne=arguments.length<3;return q(p,rr(y,4),T,ne,sP)}function y0e(p,y){var T=mr(p)?ef:oP;return T(p,Lb(rr(y,3)))}function w0e(p){var y=mr(p)?rP:ufe;return y(p)}function v0e(p,y,T){(T?Ya(p,y,T):y===r)?y=1:y=vr(y);var q=mr(p)?Bde:dfe;return q(p,y)}function b0e(p){var y=mr(p)?zde:hfe;return y(p)}function x0e(p){if(p==null)return 0;if(xs(p))return $b(p)?Y1(p):p.length;var y=Ca(p);return y==be||y==He?p.size:jE(p).length}function E0e(p,y,T){var q=mr(p)?gE:pfe;return T&&Ya(p,y,T)&&(y=r),q(p,rr(y,3))}var _0e=Ar(function(p,y){if(p==null)return[];var T=y.length;return T>1&&Ya(p,y[0],y[1])?y=[]:T>2&&Ya(y[0],y[1],y[2])&&(y=[y[0]]),yP(p,da(y,1),[])}),kb=nde||function(){return Br.Date.now()};function C0e(p,y){if(typeof y!="function")throw new Bo(s);return p=vr(p),function(){if(--p<1)return y.apply(this,arguments)}}function dR(p,y,T){return y=T?r:y,y=p&&y==null?p.length:y,Bu(p,I,r,r,r,r,y)}function fR(p,y){var T;if(typeof y!="function")throw new Bo(s);return p=vr(p),function(){return--p>0&&(T=y.apply(this,arguments)),p<=1&&(y=r),T}}var n_=Ar(function(p,y,T){var q=_;if(T.length){var ne=rf(T,rp(n_));q|=j}return Bu(p,q,y,T,ne)}),hR=Ar(function(p,y,T){var q=_|v;if(T.length){var ne=rf(T,rp(hR));q|=j}return Bu(y,q,p,T,ne)});function pR(p,y,T){y=T?r:y;var q=Bu(p,A,r,r,r,r,r,y);return q.placeholder=pR.placeholder,q}function gR(p,y,T){y=T?r:y;var q=Bu(p,S,r,r,r,r,r,y);return q.placeholder=gR.placeholder,q}function mR(p,y,T){var q,ne,ce,xe,Se,ke,Ve=0,Ye=!1,rt=!1,bt=!0;if(typeof p!="function")throw new Bo(s);y=qo(y)||0,Hn(T)&&(Ye=!!T.leading,rt="maxWait"in T,ce=rt?Ti(qo(T.maxWait)||0,y):ce,bt="trailing"in T?!!T.trailing:bt);function Ut(di){var $l=q,qu=ne;return q=ne=r,Ve=di,xe=p.apply(qu,$l),xe}function ar(di){return Ve=di,Se=h2(Lr,y),Ye?Ut(di):xe}function xr(di){var $l=di-ke,qu=di-Ve,PR=y-$l;return rt?_a(PR,ce-qu):PR}function sr(di){var $l=di-ke,qu=di-Ve;return ke===r||$l>=y||$l<0||rt&&qu>=ce}function Lr(){var di=kb();if(sr(di))return zr(di);Se=h2(Lr,xr(di))}function zr(di){return Se=r,bt&&q?Ut(di):(q=ne=r,xe)}function no(){Se!==r&&AP(Se),Ve=0,q=ke=ne=Se=r}function Ka(){return Se===r?xe:zr(kb())}function io(){var di=kb(),$l=sr(di);if(q=arguments,ne=this,ke=di,$l){if(Se===r)return ar(ke);if(rt)return AP(Se),Se=h2(Lr,y),Ut(ke)}return Se===r&&(Se=h2(Lr,y)),xe}return io.cancel=no,io.flush=Ka,io}var S0e=Ar(function(p,y){return aP(p,1,y)}),A0e=Ar(function(p,y,T){return aP(p,qo(y)||0,T)});function I0e(p){return Bu(p,V)}function Nb(p,y){if(typeof p!="function"||y!=null&&typeof y!="function")throw new Bo(s);var T=function(){var q=arguments,ne=y?y.apply(this,q):q[0],ce=T.cache;if(ce.has(ne))return ce.get(ne);var xe=p.apply(this,q);return T.cache=ce.set(ne,xe)||ce,xe};return T.cache=new(Nb.Cache||Fu),T}Nb.Cache=Fu;function Lb(p){if(typeof p!="function")throw new Bo(s);return function(){var y=arguments;switch(y.length){case 0:return!p.call(this);case 1:return!p.call(this,y[0]);case 2:return!p.call(this,y[0],y[1]);case 3:return!p.call(this,y[0],y[1],y[2])}return!p.apply(this,y)}}function M0e(p){return fR(2,p)}var T0e=gfe(function(p,y){y=y.length==1&&mr(y[0])?On(y[0],eo(rr())):On(da(y,1),eo(rr()));var T=y.length;return Ar(function(q){for(var ne=-1,ce=_a(q.length,T);++ne=y}),Gh=uP(function(){return arguments}())?uP:function(p){return ei(p)&&on.call(p,"callee")&&!J$.call(p,"callee")},mr=Oe.isArray,H0e=qa?eo(qa):Qde;function xs(p){return p!=null&&jb(p.length)&&!Hu(p)}function ui(p){return ei(p)&&xs(p)}function G0e(p){return p===!0||p===!1||ei(p)&&Va(p)==te}var cf=ade||g_,q0e=kl?eo(kl):Xde;function V0e(p){return ei(p)&&p.nodeType===1&&!p2(p)}function Y0e(p){if(p==null)return!0;if(xs(p)&&(mr(p)||typeof p=="string"||typeof p.splice=="function"||cf(p)||np(p)||Gh(p)))return!p.length;var y=Ca(p);if(y==be||y==He)return!p.size;if(f2(p))return!jE(p).length;for(var T in p)if(on.call(p,T))return!1;return!0}function K0e(p,y){return c2(p,y)}function J0e(p,y,T){T=typeof T=="function"?T:r;var q=T?T(p,y):r;return q===r?c2(p,y,r,T):!!q}function a_(p){if(!ei(p))return!1;var y=Va(p);return y==G||y==z||typeof p.message=="string"&&typeof p.name=="string"&&!p2(p)}function Z0e(p){return typeof p=="number"&&Q$(p)}function Hu(p){if(!Hn(p))return!1;var y=Va(p);return y==Z||y==me||y==J||y==lt}function wR(p){return typeof p=="number"&&p==vr(p)}function jb(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=P}function Hn(p){var y=typeof p;return p!=null&&(y=="object"||y=="function")}function ei(p){return p!=null&&typeof p=="object"}var vR=Fo?eo(Fo):tfe;function Q0e(p,y){return p===y||LE(p,y,KE(y))}function X0e(p,y,T){return T=typeof T=="function"?T:r,LE(p,y,KE(y),T)}function e1e(p){return bR(p)&&p!=+p}function t1e(p){if(Ofe(p))throw new fr(a);return dP(p)}function r1e(p){return p===null}function n1e(p){return p==null}function bR(p){return typeof p=="number"||ei(p)&&Va(p)==Ce}function p2(p){if(!ei(p)||Va(p)!=Ue)return!1;var y=sb(p);if(y===null)return!0;var T=on.call(y,"constructor")&&y.constructor;return typeof T=="function"&&T instanceof T&&rb.call(T)==Xue}var s_=Tc?eo(Tc):rfe;function i1e(p){return wR(p)&&p>=-P&&p<=P}var xR=Xm?eo(Xm):nfe;function $b(p){return typeof p=="string"||!mr(p)&&ei(p)&&Va(p)==qe}function ro(p){return typeof p=="symbol"||ei(p)&&Va(p)==Ie}var np=Dh?eo(Dh):ife;function a1e(p){return p===r}function s1e(p){return ei(p)&&Ca(p)==Pe}function o1e(p){return ei(p)&&Va(p)==$e}var l1e=Cb($E),c1e=Cb(function(p,y){return p<=y});function ER(p){if(!p)return[];if(xs(p))return $b(p)?Nl(p):bs(p);if(t2&&p[t2])return Bue(p[t2]());var y=Ca(p),T=y==be?xE:y==He?Xv:ip;return T(p)}function Gu(p){if(!p)return p===0?p:0;if(p=qo(p),p===O||p===-O){var y=p<0?-1:1;return y*R}return p===p?p:0}function vr(p){var y=Gu(p),T=y%1;return y===y?T?y-T:y:0}function _R(p){return p?Bh(vr(p),0,D):0}function qo(p){if(typeof p=="number")return p;if(ro(p))return M;if(Hn(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=Hn(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=z$(p);var T=Q.test(p);return T||de.test(p)?gr(p.slice(2),T?2:8):br.test(p)?M:+p}function CR(p){return Nc(p,Es(p))}function u1e(p){return p?Bh(vr(p),-P,P):p===0?p:0}function rn(p){return p==null?"":to(p)}var d1e=ep(function(p,y){if(f2(y)||xs(y)){Nc(y,Di(y),p);return}for(var T in y)on.call(y,T)&&s2(p,T,y[T])}),SR=ep(function(p,y){Nc(y,Es(y),p)}),Pb=ep(function(p,y,T,q){Nc(y,Es(y),p,q)}),f1e=ep(function(p,y,T,q){Nc(y,Di(y),p,q)}),h1e=zu(IE);function p1e(p,y){var T=X1(p);return y==null?T:nP(T,y)}var g1e=Ar(function(p,y){p=vn(p);var T=-1,q=y.length,ne=q>2?y[2]:r;for(ne&&Ya(y[0],y[1],ne)&&(q=1);++T1),ce}),Nc(p,VE(p),T),q&&(T=Wo(T,f|h|g,Afe));for(var ne=y.length;ne--;)FE(T,y[ne]);return T});function j1e(p,y){return IR(p,Lb(rr(y)))}var $1e=zu(function(p,y){return p==null?{}:ofe(p,y)});function IR(p,y){if(p==null)return{};var T=On(VE(p),function(q){return[q]});return y=rr(y),wP(p,T,function(q,ne){return y(q,ne[0])})}function P1e(p,y,T){y=of(y,p);var q=-1,ne=y.length;for(ne||(ne=1,p=r);++qy){var q=p;p=y,y=q}if(T||p%1||y%1){var ne=X$();return _a(p+ne*(y-p+yn("1e-"+((ne+"").length-1))),y)}return RE(p,y)}var q1e=tp(function(p,y,T){return y=y.toLowerCase(),p+(T?kR(y):y)});function kR(p){return c_(rn(p).toLowerCase())}function NR(p){return p=rn(p),p&&p.replace(ve,Rue).replace(dE,"")}function V1e(p,y,T){p=rn(p),y=to(y);var q=p.length;T=T===r?q:Bh(vr(T),0,q);var ne=T;return T-=y.length,T>=0&&p.slice(T,ne)==y}function Y1e(p){return p=rn(p),p&&St.test(p)?p.replace(At,Due):p}function K1e(p){return p=rn(p),p&&Vt.test(p)?p.replace(ot,"\\$&"):p}var J1e=tp(function(p,y,T){return p+(T?"-":"")+y.toLowerCase()}),Z1e=tp(function(p,y,T){return p+(T?" ":"")+y.toLowerCase()}),Q1e=$P("toLowerCase");function X1e(p,y,T){p=rn(p),y=vr(y);var q=y?Y1(p):0;if(!y||q>=y)return p;var ne=(y-q)/2;return _b(ub(ne),T)+p+_b(cb(ne),T)}function epe(p,y,T){p=rn(p),y=vr(y);var q=y?Y1(p):0;return y&&q>>0,T?(p=rn(p),p&&(typeof y=="string"||y!=null&&!s_(y))&&(y=to(y),!y&&V1(p))?lf(Nl(p),0,T):p.split(y,T)):[]}var ope=tp(function(p,y,T){return p+(T?" ":"")+c_(y)});function lpe(p,y,T){return p=rn(p),T=T==null?0:Bh(vr(T),0,p.length),y=to(y),p.slice(T,T+y.length)==y}function cpe(p,y,T){var q=oe.templateSettings;T&&Ya(p,y,T)&&(y=r),p=rn(p),y=Pb({},y,q,BP);var ne=Pb({},y.imports,q.imports,BP),ce=Di(ne),xe=bE(ne,ce),Se,ke,Ve=0,Ye=y.interpolate||je,rt="__p += '",bt=EE((y.escape||je).source+"|"+Ye.source+"|"+(Ye===Rt?Sr:je).source+"|"+(y.evaluate||je).source+"|$","g"),Ut="//# sourceURL="+(on.call(y,"sourceURL")?(y.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++fE+"]")+` -`;p.replace(bt,function(sr,Lr,zr,no,Ka,io){return zr||(zr=no),rt+=p.slice(Ve,io).replace(Ge,Oue),Lr&&(Se=!0,rt+=`' + +`)}function ohe(p){return mr(p)||Qh(p)||!!(uP&&p&&p[uP])}function Yu(p,y){var T=typeof p;return y=y??P,!!y&&(T=="number"||T!="symbol"&&ue.test(p))&&p>-1&&p%1==0&&p0){if(++y>=N)return arguments[0]}else y=0;return p.apply(r,arguments)}}function Pb(p,y){var T=-1,q=p.length,ne=q-1;for(y=y===r?q:y;++T1?p[y-1]:r;return T=typeof T=="function"?(p.pop(),T):r,bR(p,T)});function xR(p){var y=oe(p);return y.__chain__=!0,y}function w0e(p,y){return y(p),p}function Rb(p,y){return y(p)}var v0e=Vu(function(p){var y=p.length,T=y?p[0]:0,q=this.__wrapped__,ne=function(ce){return RE(ce,p)};return y>1||this.__actions__.length||!(q instanceof Dr)||!Yu(T)?this.thru(ne):(q=q.slice(T,+T+(y?1:0)),q.__actions__.push({func:Rb,args:[ne],thisArg:r}),new Go(q,this.__chain__).thru(function(ce){return y&&!ce.length&&ce.push(r),ce}))});function b0e(){return xR(this)}function x0e(){return new Go(this.value(),this.__chain__)}function E0e(){this.__values__===r&&(this.__values__=PR(this.value()));var p=this.__index__>=this.__values__.length,y=p?r:this.__values__[this.__index__++];return{done:p,value:y}}function _0e(){return this}function C0e(p){for(var y,T=this;T instanceof xb;){var q=pR(T);q.__index__=0,q.__values__=r,y?ne.__wrapped__=q:y=q;var ne=q;T=T.__wrapped__}return ne.__wrapped__=p,y}function S0e(){var p=this.__wrapped__;if(p instanceof Dr){var y=p;return this.__actions__.length&&(y=new Dr(this)),y=y.reverse(),y.__actions__.push({func:Rb,args:[u_],thisArg:r}),new Go(y,this.__chain__)}return this.thru(u_)}function A0e(){return DP(this.__wrapped__,this.__actions__)}var I0e=Mb(function(p,y,T){on.call(p,T)?++p[T]:Gu(p,T,1)});function M0e(p,y,T){var q=mr(p)?J$:wfe;return T&&Ka(p,y,T)&&(y=r),q(p,rr(y,3))}function T0e(p,y){var T=mr(p)?of:bP;return T(p,rr(y,3))}var k0e=YP(gR),N0e=YP(mR);function L0e(p,y){return fa(Db(p,y),1)}function j0e(p,y){return fa(Db(p,y),O)}function $0e(p,y,T){return T=T===r?1:vr(T),fa(Db(p,y),T)}function ER(p,y){var T=mr(p)?Wo:df;return T(p,rr(y,3))}function _R(p,y){var T=mr(p)?Xue:vP;return T(p,rr(y,3))}var P0e=Mb(function(p,y,T){on.call(p,T)?p[T].push(y):Gu(p,T,[y])});function R0e(p,y,T,q){p=_s(p)?p:dp(p),T=T&&!q?vr(T):0;var ne=p.length;return T<0&&(T=Ti(ne+T,0)),zb(p)?T<=ne&&p.indexOf(y,T)>-1:!!ne&&X1(p,y,T)>-1}var D0e=Ar(function(p,y,T){var q=-1,ne=typeof y=="function",ce=_s(p)?Oe(p.length):[];return df(p,function(xe){ce[++q]=ne?Di(y,xe,T):m2(xe,y,T)}),ce}),O0e=Mb(function(p,y,T){Gu(p,T,y)});function Db(p,y){var T=mr(p)?On:AP;return T(p,rr(y,3))}function F0e(p,y,T,q){return p==null?[]:(mr(y)||(y=y==null?[]:[y]),T=q?r:T,mr(T)||(T=T==null?[]:[T]),kP(p,y,T))}var U0e=Mb(function(p,y,T){p[T?0:1].push(y)},function(){return[[],[]]});function B0e(p,y,T){var q=mr(p)?_E:eP,ne=arguments.length<3;return q(p,rr(y,4),T,ne,df)}function z0e(p,y,T){var q=mr(p)?ede:eP,ne=arguments.length<3;return q(p,rr(y,4),T,ne,vP)}function W0e(p,y){var T=mr(p)?of:bP;return T(p,Ub(rr(y,3)))}function H0e(p){var y=mr(p)?gP:Rfe;return y(p)}function G0e(p,y,T){(T?Ka(p,y,T):y===r)?y=1:y=vr(y);var q=mr(p)?hfe:Dfe;return q(p,y)}function q0e(p){var y=mr(p)?pfe:Ffe;return y(p)}function V0e(p){if(p==null)return 0;if(_s(p))return zb(p)?tp(p):p.length;var y=Sa(p);return y==be||y==He?p.size:zE(p).length}function Y0e(p,y,T){var q=mr(p)?CE:Ufe;return T&&Ka(p,y,T)&&(y=r),q(p,rr(y,3))}var K0e=Ar(function(p,y){if(p==null)return[];var T=y.length;return T>1&&Ka(p,y[0],y[1])?y=[]:T>2&&Ka(y[0],y[1],y[2])&&(y=[y[0]]),kP(p,fa(y,1),[])}),Ob=Tde||function(){return Br.Date.now()};function J0e(p,y){if(typeof y!="function")throw new Ho(s);return p=vr(p),function(){if(--p<1)return y.apply(this,arguments)}}function CR(p,y,T){return y=T?r:y,y=p&&y==null?p.length:y,qu(p,I,r,r,r,r,y)}function SR(p,y){var T;if(typeof y!="function")throw new Ho(s);return p=vr(p),function(){return--p>0&&(T=y.apply(this,arguments)),p<=1&&(y=r),T}}var f_=Ar(function(p,y,T){var q=C;if(T.length){var ne=cf(T,cp(f_));q|=j}return qu(p,q,y,T,ne)}),AR=Ar(function(p,y,T){var q=C|v;if(T.length){var ne=cf(T,cp(AR));q|=j}return qu(y,q,p,T,ne)});function IR(p,y,T){y=T?r:y;var q=qu(p,A,r,r,r,r,r,y);return q.placeholder=IR.placeholder,q}function MR(p,y,T){y=T?r:y;var q=qu(p,S,r,r,r,r,r,y);return q.placeholder=MR.placeholder,q}function TR(p,y,T){var q,ne,ce,xe,Se,ke,Ve=0,Ye=!1,rt=!1,bt=!0;if(typeof p!="function")throw new Ho(s);y=Ko(y)||0,Hn(T)&&(Ye=!!T.leading,rt="maxWait"in T,ce=rt?Ti(Ko(T.maxWait)||0,y):ce,bt="trailing"in T?!!T.trailing:bt);function Ut(di){var Dl=q,Qu=ne;return q=ne=r,Ve=di,xe=p.apply(Qu,Dl),xe}function ar(di){return Ve=di,Se=x2(Lr,y),Ye?Ut(di):xe}function xr(di){var Dl=di-ke,Qu=di-Ve,YR=y-Dl;return rt?Ca(YR,ce-Qu):YR}function sr(di){var Dl=di-ke,Qu=di-Ve;return ke===r||Dl>=y||Dl<0||rt&&Qu>=ce}function Lr(){var di=Ob();if(sr(di))return zr(di);Se=x2(Lr,xr(di))}function zr(di){return Se=r,bt&&q?Ut(di):(q=ne=r,xe)}function so(){Se!==r&&FP(Se),Ve=0,q=ke=ne=Se=r}function Ja(){return Se===r?xe:zr(Ob())}function oo(){var di=Ob(),Dl=sr(di);if(q=arguments,ne=this,ke=di,Dl){if(Se===r)return ar(ke);if(rt)return FP(Se),Se=x2(Lr,y),Ut(ke)}return Se===r&&(Se=x2(Lr,y)),xe}return oo.cancel=so,oo.flush=Ja,oo}var Q0e=Ar(function(p,y){return wP(p,1,y)}),Z0e=Ar(function(p,y,T){return wP(p,Ko(y)||0,T)});function X0e(p){return qu(p,V)}function Fb(p,y){if(typeof p!="function"||y!=null&&typeof y!="function")throw new Ho(s);var T=function(){var q=arguments,ne=y?y.apply(this,q):q[0],ce=T.cache;if(ce.has(ne))return ce.get(ne);var xe=p.apply(this,q);return T.cache=ce.set(ne,xe)||ce,xe};return T.cache=new(Fb.Cache||Hu),T}Fb.Cache=Hu;function Ub(p){if(typeof p!="function")throw new Ho(s);return function(){var y=arguments;switch(y.length){case 0:return!p.call(this);case 1:return!p.call(this,y[0]);case 2:return!p.call(this,y[0],y[1]);case 3:return!p.call(this,y[0],y[1],y[2])}return!p.apply(this,y)}}function e1e(p){return SR(2,p)}var t1e=Bfe(function(p,y){y=y.length==1&&mr(y[0])?On(y[0],no(rr())):On(fa(y,1),no(rr()));var T=y.length;return Ar(function(q){for(var ne=-1,ce=Ca(q.length,T);++ne=y}),Qh=_P(function(){return arguments}())?_P:function(p){return ei(p)&&on.call(p,"callee")&&!cP.call(p,"callee")},mr=Oe.isArray,m1e=Va?no(Va):Cfe;function _s(p){return p!=null&&Bb(p.length)&&!Ku(p)}function ui(p){return ei(p)&&_s(p)}function y1e(p){return p===!0||p===!1||ei(p)&&Ya(p)==te}var gf=Nde||C_,w1e=jl?no(jl):Sfe;function v1e(p){return ei(p)&&p.nodeType===1&&!E2(p)}function b1e(p){if(p==null)return!0;if(_s(p)&&(mr(p)||typeof p=="string"||typeof p.splice=="function"||gf(p)||up(p)||Qh(p)))return!p.length;var y=Sa(p);if(y==be||y==He)return!p.size;if(b2(p))return!zE(p).length;for(var T in p)if(on.call(p,T))return!1;return!0}function x1e(p,y){return y2(p,y)}function E1e(p,y,T){T=typeof T=="function"?T:r;var q=T?T(p,y):r;return q===r?y2(p,y,r,T):!!q}function p_(p){if(!ei(p))return!1;var y=Ya(p);return y==G||y==z||typeof p.message=="string"&&typeof p.name=="string"&&!E2(p)}function _1e(p){return typeof p=="number"&&dP(p)}function Ku(p){if(!Hn(p))return!1;var y=Ya(p);return y==Q||y==me||y==J||y==lt}function NR(p){return typeof p=="number"&&p==vr(p)}function Bb(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=P}function Hn(p){var y=typeof p;return p!=null&&(y=="object"||y=="function")}function ei(p){return p!=null&&typeof p=="object"}var LR=zo?no(zo):Ife;function C1e(p,y){return p===y||BE(p,y,i_(y))}function S1e(p,y,T){return T=typeof T=="function"?T:r,BE(p,y,i_(y),T)}function A1e(p){return jR(p)&&p!=+p}function I1e(p){if(uhe(p))throw new fr(a);return CP(p)}function M1e(p){return p===null}function T1e(p){return p==null}function jR(p){return typeof p=="number"||ei(p)&&Ya(p)==Ce}function E2(p){if(!ei(p)||Ya(p)!=Ue)return!1;var y=pb(p);if(y===null)return!0;var T=on.call(y,"constructor")&&y.constructor;return typeof T=="function"&&T instanceof T&&ub.call(T)==Sde}var g_=jc?no(jc):Mfe;function k1e(p){return NR(p)&&p>=-P&&p<=P}var $R=o2?no(o2):Tfe;function zb(p){return typeof p=="string"||!mr(p)&&ei(p)&&Ya(p)==qe}function ao(p){return typeof p=="symbol"||ei(p)&&Ya(p)==Ie}var up=Wh?no(Wh):kfe;function N1e(p){return p===r}function L1e(p){return ei(p)&&Sa(p)==$e}function j1e(p){return ei(p)&&Ya(p)==je}var $1e=Lb(WE),P1e=Lb(function(p,y){return p<=y});function PR(p){if(!p)return[];if(_s(p))return zb(p)?$l(p):Es(p);if(c2&&p[c2])return hde(p[c2]());var y=Sa(p),T=y==be?kE:y==He?ob:dp;return T(p)}function Ju(p){if(!p)return p===0?p:0;if(p=Ko(p),p===O||p===-O){var y=p<0?-1:1;return y*R}return p===p?p:0}function vr(p){var y=Ju(p),T=y%1;return y===y?T?y-T:y:0}function RR(p){return p?Vh(vr(p),0,D):0}function Ko(p){if(typeof p=="number")return p;if(ao(p))return M;if(Hn(p)){var y=typeof p.valueOf=="function"?p.valueOf():p;p=Hn(y)?y+"":y}if(typeof p!="string")return p===0?p:+p;p=tP(p);var T=Z.test(p);return T||de.test(p)?gr(p.slice(2),T?2:8):br.test(p)?M:+p}function DR(p){return Pc(p,Cs(p))}function R1e(p){return p?Vh(vr(p),-P,P):p===0?p:0}function rn(p){return p==null?"":io(p)}var D1e=op(function(p,y){if(b2(y)||_s(y)){Pc(y,Oi(y),p);return}for(var T in y)on.call(y,T)&&p2(p,T,y[T])}),OR=op(function(p,y){Pc(y,Cs(y),p)}),Wb=op(function(p,y,T,q){Pc(y,Cs(y),p,q)}),O1e=op(function(p,y,T,q){Pc(y,Oi(y),p,q)}),F1e=Vu(RE);function U1e(p,y){var T=sp(p);return y==null?T:mP(T,y)}var B1e=Ar(function(p,y){p=vn(p);var T=-1,q=y.length,ne=q>2?y[2]:r;for(ne&&Ka(y[0],y[1],ne)&&(q=1);++T1),ce}),Pc(p,r_(p),T),q&&(T=qo(T,f|h|g,Zfe));for(var ne=y.length;ne--;)YE(T,y[ne]);return T});function ape(p,y){return UR(p,Ub(rr(y)))}var spe=Vu(function(p,y){return p==null?{}:jfe(p,y)});function UR(p,y){if(p==null)return{};var T=On(r_(p),function(q){return[q]});return y=rr(y),NP(p,T,function(q,ne){return y(q,ne[0])})}function ope(p,y,T){y=hf(y,p);var q=-1,ne=y.length;for(ne||(ne=1,p=r);++qy){var q=p;p=y,y=q}if(T||p%1||y%1){var ne=fP();return Ca(p+ne*(y-p+yn("1e-"+((ne+"").length-1))),y)}return GE(p,y)}var wpe=lp(function(p,y,T){return y=y.toLowerCase(),p+(T?WR(y):y)});function WR(p){return w_(rn(p).toLowerCase())}function HR(p){return p=rn(p),p&&p.replace(ve,lde).replace(bE,"")}function vpe(p,y,T){p=rn(p),y=io(y);var q=p.length;T=T===r?q:Vh(vr(T),0,q);var ne=T;return T-=y.length,T>=0&&p.slice(T,ne)==y}function bpe(p){return p=rn(p),p&&St.test(p)?p.replace(At,cde):p}function xpe(p){return p=rn(p),p&&Vt.test(p)?p.replace(ot,"\\$&"):p}var Epe=lp(function(p,y,T){return p+(T?"-":"")+y.toLowerCase()}),_pe=lp(function(p,y,T){return p+(T?" ":"")+y.toLowerCase()}),Cpe=VP("toLowerCase");function Spe(p,y,T){p=rn(p),y=vr(y);var q=y?tp(p):0;if(!y||q>=y)return p;var ne=(y-q)/2;return Nb(wb(ne),T)+p+Nb(yb(ne),T)}function Ape(p,y,T){p=rn(p),y=vr(y);var q=y?tp(p):0;return y&&q>>0,T?(p=rn(p),p&&(typeof y=="string"||y!=null&&!g_(y))&&(y=io(y),!y&&ep(p))?pf($l(p),0,T):p.split(y,T)):[]}var jpe=lp(function(p,y,T){return p+(T?" ":"")+w_(y)});function $pe(p,y,T){return p=rn(p),T=T==null?0:Vh(vr(T),0,p.length),y=io(y),p.slice(T,T+y.length)==y}function Ppe(p,y,T){var q=oe.templateSettings;T&&Ka(p,y,T)&&(y=r),p=rn(p),y=Wb({},y,q,eR);var ne=Wb({},y.imports,q.imports,eR),ce=Oi(ne),xe=TE(ne,ce),Se,ke,Ve=0,Ye=y.interpolate||Le,rt="__p += '",bt=NE((y.escape||Le).source+"|"+Ye.source+"|"+(Ye===Rt?Sr:Le).source+"|"+(y.evaluate||Le).source+"|$","g"),Ut="//# sourceURL="+(on.call(y,"sourceURL")?(y.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xE+"]")+` +`;p.replace(bt,function(sr,Lr,zr,so,Ja,oo){return zr||(zr=so),rt+=p.slice(Ve,oo).replace(Ge,ude),Lr&&(Se=!0,rt+=`' + __e(`+Lr+`) + -'`),Ka&&(ke=!0,rt+=`'; -`+Ka+`; +'`),Ja&&(ke=!0,rt+=`'; +`+Ja+`; __p += '`),zr&&(rt+=`' + ((__t = (`+zr+`)) == null ? '' : __t) + -'`),Ve=io+sr.length,sr}),rt+=`'; +'`),Ve=oo+sr.length,sr}),rt+=`'; `;var ar=on.call(y,"variable")&&y.variable;if(!ar)rt=`with (obj) { `+rt+` } @@ -215,32 +215,32 @@ __p += '`),zr&&(rt+=`' + function print() { __p += __j.call(arguments, '') } `:`; `)+rt+`return __p -}`;var xr=jR(function(){return en(ce,Ut+"return "+rt).apply(r,xe)});if(xr.source=rt,a_(xr))throw xr;return xr}function upe(p){return rn(p).toLowerCase()}function dpe(p){return rn(p).toUpperCase()}function fpe(p,y,T){if(p=rn(p),p&&(T||y===r))return z$(p);if(!p||!(y=to(y)))return p;var q=Nl(p),ne=Nl(y),ce=W$(q,ne),xe=H$(q,ne)+1;return lf(q,ce,xe).join("")}function hpe(p,y,T){if(p=rn(p),p&&(T||y===r))return p.slice(0,q$(p)+1);if(!p||!(y=to(y)))return p;var q=Nl(p),ne=H$(q,Nl(y))+1;return lf(q,0,ne).join("")}function ppe(p,y,T){if(p=rn(p),p&&(T||y===r))return p.replace(Ft,"");if(!p||!(y=to(y)))return p;var q=Nl(p),ne=W$(q,Nl(y));return lf(q,ne).join("")}function gpe(p,y){var T=se,q=Y;if(Hn(y)){var ne="separator"in y?y.separator:ne;T="length"in y?vr(y.length):T,q="omission"in y?to(y.omission):q}p=rn(p);var ce=p.length;if(V1(p)){var xe=Nl(p);ce=xe.length}if(T>=ce)return p;var Se=T-Y1(q);if(Se<1)return q;var ke=xe?lf(xe,0,Se).join(""):p.slice(0,Se);if(ne===r)return ke+q;if(xe&&(Se+=ke.length-Se),s_(ne)){if(p.slice(Se).search(ne)){var Ve,Ye=ke;for(ne.global||(ne=EE(ne.source,rn(cr.exec(ne))+"g")),ne.lastIndex=0;Ve=ne.exec(Ye);)var rt=Ve.index;ke=ke.slice(0,rt===r?Se:rt)}}else if(p.indexOf(to(ne),Se)!=Se){var bt=ke.lastIndexOf(ne);bt>-1&&(ke=ke.slice(0,bt))}return ke+q}function mpe(p){return p=rn(p),p&&mt.test(p)?p.replace(zt,Gue):p}var ype=tp(function(p,y,T){return p+(T?" ":"")+y.toUpperCase()}),c_=$P("toUpperCase");function LR(p,y,T){return p=rn(p),y=T?r:y,y===r?Uue(p)?Yue(p):Nue(p):p.match(y)||[]}var jR=Ar(function(p,y){try{return Ri(p,r,y)}catch(T){return a_(T)?T:new fr(T)}}),wpe=zu(function(p,y){return Uo(y,function(T){T=Lc(T),Uu(p,T,n_(p[T],p))}),p});function vpe(p){var y=p==null?0:p.length,T=rr();return p=y?On(p,function(q){if(typeof q[1]!="function")throw new Bo(s);return[T(q[0]),q[1]]}):[],Ar(function(q){for(var ne=-1;++neP)return[];var T=D,q=_a(p,D);y=rr(y),p-=D;for(var ne=vE(q,y);++T0||y<0)?new Dr(T):(p<0?T=T.takeRight(-p):p&&(T=T.drop(p)),y!==r&&(y=vr(y),T=y<0?T.dropRight(-y):T.take(y-p)),T)},Dr.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},Dr.prototype.toArray=function(){return this.take(D)},kc(Dr.prototype,function(p,y){var T=/^(?:filter|find|map|reject)|While$/.test(y),q=/^(?:head|last)$/.test(y),ne=oe[q?"take"+(y=="last"?"Right":""):y],ce=q||/^find/.test(y);ne&&(oe.prototype[y]=function(){var xe=this.__wrapped__,Se=q?[1]:arguments,ke=xe instanceof Dr,Ve=Se[0],Ye=ke||mr(xe),rt=function(Lr){var zr=ne.apply(oe,tf([Lr],Se));return q&&bt?zr[0]:zr};Ye&&T&&typeof Ve=="function"&&Ve.length!=1&&(ke=Ye=!1);var bt=this.__chain__,Ut=!!this.__actions__.length,ar=ce&&!bt,xr=ke&&!Ut;if(!ce&&Ye){xe=xr?xe:new Dr(this);var sr=p.apply(xe,Se);return sr.__actions__.push({func:Mb,args:[rt],thisArg:r}),new zo(sr,bt)}return ar&&xr?p.apply(this,Se):(sr=this.thru(rt),ar?q?sr.value()[0]:sr.value():sr)})}),Uo(["pop","push","shift","sort","splice","unshift"],function(p){var y=eb[p],T=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",q=/^(?:pop|shift)$/.test(p);oe.prototype[p]=function(){var ne=arguments;if(q&&!this.__chain__){var ce=this.value();return y.apply(mr(ce)?ce:[],ne)}return this[T](function(xe){return y.apply(mr(xe)?xe:[],ne)})}}),kc(Dr.prototype,function(p,y){var T=oe[y];if(T){var q=T.name+"";on.call(Q1,q)||(Q1[q]=[]),Q1[q].push({name:y,func:T})}}),Q1[xb(r,v).name]=[{name:"wrapper",func:r}],Dr.prototype.clone=mde,Dr.prototype.reverse=yde,Dr.prototype.value=wde,oe.prototype.at=Vhe,oe.prototype.chain=Yhe,oe.prototype.commit=Khe,oe.prototype.next=Jhe,oe.prototype.plant=Qhe,oe.prototype.reverse=Xhe,oe.prototype.toJSON=oe.prototype.valueOf=oe.prototype.value=e0e,oe.prototype.first=oe.prototype.head,t2&&(oe.prototype[t2]=Zhe),oe},K1=Kue();ci?((ci.exports=K1)._=K1,wn._=K1):Br._=K1}).call(Xt)})(m8,m8.exports);var YYe=m8.exports,vT={exports:{}};(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Xt<"u"&&Xt,n=function(){function a(){this.fetch=!1,this.DOMException=r.DOMException}return a.prototype=r,new a}();(function(a){(function(s){var o=typeof a<"u"&&a||typeof self<"u"&&self||typeof Xt<"u"&&Xt||{},l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function c(E){return E&&DataView.prototype.isPrototypeOf(E)}if(l.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function h(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(E)||E==="")throw new TypeError('Invalid character in header field name: "'+E+'"');return E.toLowerCase()}function g(E){return typeof E!="string"&&(E=String(E)),E}function m(E){var L={next:function(){var O=E.shift();return{done:O===void 0,value:O}}};return l.iterable&&(L[Symbol.iterator]=function(){return L}),L}function w(E){this.map={},E instanceof w?E.forEach(function(L,O){this.append(O,L)},this):Array.isArray(E)?E.forEach(function(L){if(L.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+L.length);this.append(L[0],L[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(L){this.append(L,E[L])},this)}w.prototype.append=function(E,L){E=h(E),L=g(L);var O=this.map[E];this.map[E]=O?O+", "+L:L},w.prototype.delete=function(E){delete this.map[h(E)]},w.prototype.get=function(E){return E=h(E),this.has(E)?this.map[E]:null},w.prototype.has=function(E){return this.map.hasOwnProperty(h(E))},w.prototype.set=function(E,L){this.map[h(E)]=g(L)},w.prototype.forEach=function(E,L){for(var O in this.map)this.map.hasOwnProperty(O)&&E.call(L,this.map[O],O,this)},w.prototype.keys=function(){var E=[];return this.forEach(function(L,O){E.push(O)}),m(E)},w.prototype.values=function(){var E=[];return this.forEach(function(L){E.push(L)}),m(E)},w.prototype.entries=function(){var E=[];return this.forEach(function(L,O){E.push([O,L])}),m(E)},l.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function _(E){if(!E._noBody){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}}function v(E){return new Promise(function(L,O){E.onload=function(){L(E.result)},E.onerror=function(){O(E.error)}})}function b(E){var L=new FileReader,O=v(L);return L.readAsArrayBuffer(E),O}function A(E){var L=new FileReader,O=v(L),P=/charset=([A-Za-z0-9_-]+)/.exec(E.type),R=P?P[1]:"utf-8";return L.readAsText(E,R),O}function S(E){for(var L=new Uint8Array(E),O=new Array(L.length),P=0;P-1?L:E}function V(E,L){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L=L||{};var O=L.body;if(E instanceof V){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,L.headers||(this.headers=new w(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!O&&E._bodyInit!=null&&(O=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new w(L.headers)),this.method=B(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal||function(){if("AbortController"in o){var M=new AbortController;return M.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(O),(this.method==="GET"||this.method==="HEAD")&&(L.cache==="no-store"||L.cache==="no-cache")){var P=/([?&])_=[^&]*/;if(P.test(this.url))this.url=this.url.replace(P,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}V.prototype.clone=function(){return new V(this,{body:this._bodyInit})};function se(E){var L=new FormData;return E.trim().split("&").forEach(function(O){if(O){var P=O.split("="),R=P.shift().replace(/\+/g," "),M=P.join("=").replace(/\+/g," ");L.append(decodeURIComponent(R),decodeURIComponent(M))}}),L}function Y(E){var L=new w,O=E.replace(/\r?\n[\t ]+/g," ");return O.split("\r").map(function(P){return P.indexOf(` -`)===0?P.substr(1,P.length):P}).forEach(function(P){var R=P.split(":"),M=R.shift().trim();if(M){var D=R.join(":").trim();try{L.append(M,D)}catch($){console.warn("Response "+$.message)}}}),L}U.call(V.prototype);function N(E,L){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new w(L.headers),this.url=L.url||"",this._initBody(E)}U.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},N.error=function(){var E=new N(null,{status:200,statusText:""});return E.ok=!1,E.status=0,E.type="error",E};var k=[301,302,303,307,308];N.redirect=function(E,L){if(k.indexOf(L)===-1)throw new RangeError("Invalid status code");return new N(null,{status:L,headers:{location:E}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(L,O){this.message=L,this.name=O;var P=Error(L);this.stack=P.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function x(E,L){return new Promise(function(O,P){var R=new V(E,L);if(R.signal&&R.signal.aborted)return P(new s.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function D(){M.abort()}M.onload=function(){var le={statusText:M.statusText,headers:Y(M.getAllResponseHeaders()||"")};R.url.indexOf("file://")===0&&(M.status<200||M.status>599)?le.status=200:le.status=M.status,le.url="responseURL"in M?M.responseURL:le.headers.get("X-Request-URL");var H="response"in M?M.response:M.responseText;setTimeout(function(){O(new N(H,le))},0)},M.onerror=function(){setTimeout(function(){P(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){P(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){P(new s.DOMException("Aborted","AbortError"))},0)};function $(le){try{return le===""&&o.location.href?o.location.href:le}catch{return le}}if(M.open(R.method,$(R.url),!0),R.credentials==="include"?M.withCredentials=!0:R.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&(l.blob?M.responseType="blob":l.arrayBuffer&&(M.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof w||o.Headers&&L.headers instanceof o.Headers)){var X=[];Object.getOwnPropertyNames(L.headers).forEach(function(le){X.push(h(le)),M.setRequestHeader(le,g(L.headers[le]))}),R.headers.forEach(function(le,H){X.indexOf(H)===-1&&M.setRequestHeader(H,le)})}else R.headers.forEach(function(le,H){M.setRequestHeader(H,le)});R.signal&&(R.signal.addEventListener("abort",D),M.onreadystatechange=function(){M.readyState===4&&R.signal.removeEventListener("abort",D)}),M.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return x.polyfill=!0,o.fetch||(o.fetch=x,o.Headers=w,o.Request=V,o.Response=N),s.Headers=w,s.Request=V,s.Response=N,s.fetch=x,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(vT,vT.exports);var KYe=vT.exports;const cH=To(KYe);var JYe=Object.defineProperty,ZYe=Object.defineProperties,QYe=Object.getOwnPropertyDescriptors,uH=Object.getOwnPropertySymbols,XYe=Object.prototype.hasOwnProperty,eKe=Object.prototype.propertyIsEnumerable,dH=(t,e,r)=>e in t?JYe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fH=(t,e)=>{for(var r in e||(e={}))XYe.call(e,r)&&dH(t,r,e[r]);if(uH)for(var r of uH(e))eKe.call(e,r)&&dH(t,r,e[r]);return t},hH=(t,e)=>ZYe(t,QYe(e));const tKe={Accept:"application/json","Content-Type":"application/json"},rKe="POST",pH={headers:tKe,method:rKe},gH=10;let Sc=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new gs.EventEmitter,this.isAvailable=!1,this.registering=!1,!kW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Wd(e),n=await(await cH(this.url,hH(fH({},pH),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!kW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Wd({id:1,jsonrpc:"2.0",method:"test",params:[]});await cH(e,hH(fH({},pH),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?t1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=t7(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return yie(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>gH&&this.events.setMaxListeners(gH)}};const mH="error",nKe="wss://relay.walletconnect.org",iKe="wc",aKe="universal_provider",yH=`${iKe}@2:${aKe}:`,Wie="https://rpc.walletconnect.org/v1/",Ip="generic",sKe=`${Wie}bundler`,Al={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var oKe=Object.defineProperty,lKe=Object.defineProperties,cKe=Object.getOwnPropertyDescriptors,wH=Object.getOwnPropertySymbols,uKe=Object.prototype.hasOwnProperty,dKe=Object.prototype.propertyIsEnumerable,vH=(t,e,r)=>e in t?oKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j4=(t,e)=>{for(var r in e||(e={}))uKe.call(e,r)&&vH(t,r,e[r]);if(wH)for(var r of wH(e))dKe.call(e,r)&&vH(t,r,e[r]);return t},fKe=(t,e)=>lKe(t,cKe(e));function Mo(t,e,r){var n;const i=fg(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${Wie}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function k1(t){return t.includes(":")?t.split(":")[1]:t}function Hie(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function hKe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function TS(t={},e={}){const r=bH(t),n=bH(e);return YYe.merge(r,n)}function bH(t){var e,r,n,i;const a={};if(!Y3(t))return a;for(const[s,o]of Object.entries(t)){const l=Ej(s)?[s]:o.chains,c=o.methods||[],u=o.events||[],f=o.rpcMap||{},h=cy(s);a[h]=fKe(j4(j4({},a[h]),o),{chains:j6(l,(e=a[h])==null?void 0:e.chains),methods:j6(c,(r=a[h])==null?void 0:r.methods),events:j6(u,(n=a[h])==null?void 0:n.events),rpcMap:j4(j4({},f),(i=a[h])==null?void 0:i.rpcMap)})}return a}function pKe(t){return t.includes(":")?t.split(":")[2]:t}function xH(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],a=n.events||[],s=n.accounts||[],o=Ej(r)?[r]:n.chains?n.chains:Hie(n.accounts);e[r]={chains:o,methods:i,events:a,accounts:s}}return e}function kS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Gie={},Xr=t=>Gie[t],NS=(t,e)=>{Gie[t]=e};let gKe=class{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=k1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}};var mKe=Object.defineProperty,yKe=Object.defineProperties,wKe=Object.getOwnPropertyDescriptors,EH=Object.getOwnPropertySymbols,vKe=Object.prototype.hasOwnProperty,bKe=Object.prototype.propertyIsEnumerable,_H=(t,e,r)=>e in t?mKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,CH=(t,e)=>{for(var r in e||(e={}))vKe.call(e,r)&&_H(t,r,e[r]);if(EH)for(var r of EH(e))bKe.call(e,r)&&_H(t,r,e[r]);return t},SH=(t,e)=>yKe(t,wKe(e));class xKe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||Mo(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(k1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const a=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const s=this.client.session.get(e.topic),o=((i=s==null?void 0:s.sessionProperties)==null?void 0:i.capabilities)||{};if(o!=null&&o[a])return o==null?void 0:o[a];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:SH(CH({},s.sessionProperties||{}),{capabilities:SH(CH({},o||{}),{[a]:l})})})}catch(c){console.warn("Failed to update session with capabilities",c)}return l}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),a=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(a){const o=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(o,e)}catch(l){console.warn("Failed to fetch call status from bundler",l,o)}}const s=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(s)try{return await this.getUserOperationReceipt(s,e)}catch(o){console.warn("Failed to fetch call status from custom bundler",o,s)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Df("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}getBundlerUrl(e,r){return`${sKe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class EKe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=k1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}}let _Ke=class{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=k1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}};class CKe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||Mo(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Sl(new Sc(n,Xr("disableProviderPing")))}}let SKe=class{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=k1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}};class AKe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=k1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}}let IKe=class{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=k1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}};class MKe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||Mo(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace);return typeof n>"u"?void 0:new Sl(new Sc(n,Xr("disableProviderPing")))}}class TKe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||Mo(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace);return typeof n>"u"?void 0:new Sl(new Sc(n))}}class kKe{constructor(e){this.name=Ip,this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(Al.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const a=fg(i);n[`${a.namespace}:${a.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||Mo(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Sl(new Sc(n,Xr("disableProviderPing")))}}var NKe=Object.defineProperty,LKe=Object.defineProperties,jKe=Object.getOwnPropertyDescriptors,AH=Object.getOwnPropertySymbols,$Ke=Object.prototype.hasOwnProperty,PKe=Object.prototype.propertyIsEnumerable,IH=(t,e,r)=>e in t?NKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$4=(t,e)=>{for(var r in e||(e={}))$Ke.call(e,r)&&IH(t,r,e[r]);if(AH)for(var r of AH(e))PKe.call(e,r)&&IH(t,r,e[r]);return t},LS=(t,e)=>LKe(t,jKe(e));let RKe=class qie{constructor(e){this.events=new xL,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:fv(Xx({level:(e==null?void 0:e.logger)||mH})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new qie(e);return await r.initialize(),r}async request(e,r,n){const[i,a]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:$4({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const a=new Date().getTime();this.request(e,n,i).then(s=>r(null,e7(a,s))).catch(s=>r(s,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:ln("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const a=await i();if(this.session=a.session,this.session){const s=xH(this.session.namespaces);this.namespaces=TS(this.namespaces,s),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a;const s=xH(a.namespaces);this.namespaces=TS(this.namespaces,s),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==Bie)throw a;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),a=this.getProvider(n);a.name===Ip?a.setDefaultChain(`${n}:${i}`,r):a.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Hd(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await VYe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||mH,relayUrl:this.providerOpts.relayUrl||nKe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>cy(r)))];NS("client",this.client),NS("events",this.events),NS("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=hKe(r,this.session),i=Hie(n),a=TS(this.namespaces,this.optionalNamespaces),s=LS($4({},a[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new xKe({namespace:s});break;case"algorand":this.rpcProviders[r]=new CKe({namespace:s});break;case"solana":this.rpcProviders[r]=new EKe({namespace:s});break;case"cosmos":this.rpcProviders[r]=new _Ke({namespace:s});break;case"polkadot":this.rpcProviders[r]=new gKe({namespace:s});break;case"cip34":this.rpcProviders[r]=new SKe({namespace:s});break;case"elrond":this.rpcProviders[r]=new AKe({namespace:s});break;case"multiversx":this.rpcProviders[r]=new IKe({namespace:s});break;case"near":this.rpcProviders[r]=new MKe({namespace:s});break;case"tezos":this.rpcProviders[r]=new TKe({namespace:s});break;default:this.rpcProviders[Ip]?this.rpcProviders[Ip].updateNamespace(s):this.rpcProviders[Ip]=new kKe({namespace:s})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Hd(i)&&this.events.emit("accountsChanged",i.map(pKe))}else if(n.name==="chainChanged"){const i=r.chainId,a=r.event.data,s=cy(i),o=kS(i)!==kS(a)?`${s}:${kS(a)}`:i;this.onChainChanged(o)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,a=(n=this.client)==null?void 0:n.session.get(e);this.session=LS($4({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",LS($4({},ln("USER_DISCONNECTED")),{data:e.topic}))}),this.on(Al.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[Ip]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(s=>cy(s)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=cy(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${yH}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${yH}/${e}`)}};const DKe=RKe,OKe="wc",FKe="ethereum_provider",UKe=`${OKe}@2:${FKe}:`,BKe="https://rpc.walletconnect.org/v1/",bT=["eth_sendTransaction","personal_sign"],Vie=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],xT=["chainChanged","accountsChanged"],Yie=["chainChanged","accountsChanged","message","disconnect","connect"];var zKe=Object.defineProperty,WKe=Object.defineProperties,HKe=Object.getOwnPropertyDescriptors,MH=Object.getOwnPropertySymbols,GKe=Object.prototype.hasOwnProperty,qKe=Object.prototype.propertyIsEnumerable,TH=(t,e,r)=>e in t?zKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Mp=(t,e)=>{for(var r in e||(e={}))GKe.call(e,r)&&TH(t,r,e[r]);if(MH)for(var r of MH(e))qKe.call(e,r)&&TH(t,r,e[r]);return t},jS=(t,e)=>WKe(t,HKe(e));function y8(t){return Number(t[0].split(":")[1])}function P4(t){return`0x${t.toString(16)}`}function VKe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:a,optionalEvents:s,rpcMap:o}=t;if(!Hd(e))throw new Error("Invalid chains");const l={chains:e,methods:n||bT,events:a||xT,rpcMap:Mp({},e.length?{[y8(e)]:o[y8(e)]}:{})},c=a==null?void 0:a.filter(g=>!xT.includes(g)),u=n==null?void 0:n.filter(g=>!bT.includes(g));if(!r&&!s&&!i&&!(c!=null&&c.length)&&!(u!=null&&u.length))return{required:e.length?l:void 0};const f=(c==null?void 0:c.length)&&(u==null?void 0:u.length)||!r,h={chains:[...new Set(f?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(i!=null&&i.length?i:Vie))],events:[...new Set(l.events.concat(s!=null&&s.length?s:Yie))],rpcMap:o};return{required:e.length?l:void 0,optional:r.length?h:void 0}}let YKe=class Kie{constructor(){this.events=new gs.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=UKe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Kie;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=VKe(this.rpc);try{const i=await new Promise(async(s,o)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(jS(Mp({namespaces:Mp({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})});if(!i)return;const a=qz(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:P4(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(a,s)=>{var o;this.rpc.showQrModal&&((o=this.modal)==null||o.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(jS(Mp({},e),{chains:this.rpc.chains}),r).then(l=>{a(l)}).catch(l=>{s(new Error(l.message))})}),i=n.session;if(i){const a=qz(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:P4(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",P4(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",jS(Mp({},ln("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",P4(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],a=(n=e==null?void 0:e.optionalChains)!=null?n:[],s=i.concat(a);if(!s.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?(e==null?void 0:e.methods)||bT:[],l=i.length?(e==null?void 0:e.events)||xT:[],c=(e==null?void 0:e.optionalMethods)||[],u=(e==null?void 0:e.optionalEvents)||[],f=(e==null?void 0:e.rpcMap)||this.buildRpcMap(s,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:a.map(g=>this.formatChainId(g)),methods:o,events:l,optionalMethods:c,optionalEvents:u,rpcMap:f,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:h,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?y8(this.rpc.chains):y8(this.rpc.optionalChains),this.signer=await DKe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await Ws(()=>import("./index-CDACDQ7U.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Mp({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Hd(r)&&(this.rpc.chains=r.map(a=>this.formatChainId(a)),r.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)})),n&&Hd(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${BKe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};const KKe=YKe;let hg=class extends Mm{async initialize(){var n,i,a,s;let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if((i=(n=this.walletProvider)==null?void 0:n.session)!=null&&i.peer.metadata.url){let o=NC((s=(a=this.walletProvider)==null?void 0:a.session)==null?void 0:s.peer.metadata.url);this.walletEntry=o==null?void 0:o.entry,this.walletClientType=(o==null?void 0:o.walletClientType)||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:r}=await Ws(()=>import("./index-CDACDQ7U.js").then(o=>o.i),[]);this.modal=new r({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(o=>{var l;o.open||(l=this.walletProvider)!=null&&l.session||!this.onQrModalClosed||this.onQrModalClosed()})}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){var e;return!!((e=this.walletProvider)!=null&&e.connected)}get walletBranding(){var r,n,i,a,s,o,l;if(this.walletClientType==="metamask")return{name:"MetaMask",icon:IDe,id:"io.metamask"};let e=(i=(n=(r=this.walletProvider)==null?void 0:r.session)==null?void 0:n.peer.metadata.icons)==null?void 0:i[0];return{name:xMe(((s=(a=this.walletProvider)==null?void 0:a.session)==null?void 0:s.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:jDe,id:((l=(o=this.walletProvider)==null?void 0:o.session)==null?void 0:l.peer.metadata.name.toLowerCase())||"wallet_connect_v2"}}async resetConnection(e){var r;this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,(r=this.walletEntry)!=null&&r.isWalletEntryOverriden||(this.walletEntry=wM[e]),this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,MMe(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,r)=>{this.onQrModalClosed=()=>{r(new ire)},(async()=>{var a,s,o,l,c;let n="",i=await Promise.race([(a=this.walletProvider)==null?void 0:a.enable(),this.proxyProvider.walletTimeout()]);if(i!=null&&i.length&&(n=i[0]),!n||n==="")throw new Pn("Unable to retrieve address");if((o=(s=this.walletProvider)==null?void 0:s.session)!=null&&o.peer.metadata.url){let u=NC((c=(l=this.walletProvider)==null?void 0:l.session)==null?void 0:c.peer.metadata.url);this.walletEntry=u==null?void 0:u.entry,this.walletClientType=(u==null?void 0:u.walletClientType)||"unknown",this.proxyProvider.rpcTimeoutDuration=DL(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(i),e()})().catch(n=>{r(n?E1(n):new Pn("Unknown error during connection"))}).finally(()=>{var n;return(n=this.modal)==null?void 0:n.closeModal()})})}disconnect(){var e;(e=this.walletProvider)==null||e.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let a of this.chains){let s=_Me(a.id,this.chains,this.rpcConfig,this.privyAppId);s&&(e[a.id]=s)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await KKe.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:Yie,optionalMethods:Vie,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{var s,o;if(i.signer.abortPairingAttempt(),this.walletEntry){let{redirect:l,href:c}=AMe(a,this.walletEntry);TMe({href:c,name:this.walletEntry.displayName}),this.redirectUri=l;let u=IMe(a,this.walletEntry);u!=null&&u.redirect&&(this.fallbackUniversalRedirectUri=u.redirect),ma&&uee(l,"_self"),(s=this.showPrivyQrModal)==null||s.call(this,{native:l,universal:this.fallbackUniversalRedirectUri})}else(o=this.modal)==null||o.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{var a,s,o;if((a=this.modal)==null||a.closeModal(),(s=i.session)==null?void 0:s.peer.metadata.url){let l=NC((o=i.session)==null?void 0:o.peer.metadata.url);this.walletEntry=l==null?void 0:l.entry,this.walletClientType=(l==null?void 0:l.walletClientType)||"unknown"}}),i}async enableProvider(){var e,r;return(e=this.walletProvider)!=null&&e.connected?Promise.resolve(this.walletProvider.accounts):await((r=this.walletProvider)==null?void 0:r.enable())}setWalletEntry(e,r){this.walletEntry=e,this.showPrivyQrModal=r}constructor(e,r,n,i,a,s,o,l){super(l||"unknown",n,i,r),this.connectorType="wallet_connect_v2",this.privyAppId=s,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new es(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=wM[l],this.walletClientType=l)}};var JKe=(t,e)=>{let r=C.useRef(()=>{});C.useEffect(()=>{r.current=t}),C.useEffect(()=>{if(e!==null){let n=setInterval(()=>r.current(),e||0);return()=>clearInterval(n)}},[e])};function ZKe(){let[t,e]=C.useState(!1),r=C.useCallback(()=>{document.hidden&&e(!0)},[]);return C.useEffect(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:t,reset:()=>e(!1)}}const Jie=t=>(t==null?void 0:t.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER?Tf.ERROR_USER_EXISTS:t instanceof cc&&!t.details.default?t.details:t instanceof nre?Tf.ERROR_TIMED_OUT:t instanceof ire?Tf.ERROR_USER_REJECTED_CONNECTION:(t==null?void 0:t.privyErrorCode)===Ae.CANNOT_LINK_MORE_OF_TYPE?Tf.ERROR_USER_LIMIT_REACHED:Tf.ERROR_WALLET_CONNECTION,QKe=()=>{var be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne;let t,[e,r]=C.useState(!1),[n,i]=C.useState(!1),[a,s]=C.useState(void 0),{authenticated:o,logout:l}=$r(),{app:c,navigate:u,navigateBack:f,lastScreen:h,currentScreen:g,setModalData:m,data:w}=wt(),{getAuthFlow:_,walletConnectionStatus:v,closePrivyModal:b,initLoginWithWallet:A,loginWithWallet:S,updateWallets:j,createAnalyticsEvent:U}=_t(),{walletConnectors:I}=$r(),[B,V]=C.useState(0),{user:se}=$r(),[Y]=C.useState((se==null?void 0:se.linkedAccounts.length)||0),[N,k]=C.useState(""),[x,E]=C.useState(""),[L,O]=C.useState(!1),{hasTabbedAway:P}=ZKe(),{enabled:R,token:M}=$o(),D=ma&&((be=v==null?void 0:v.connector)==null?void 0:be.connectorType)==="wallet_connect_v2"||ma&&((Ce=v==null?void 0:v.connector)==null?void 0:Ce.connectorType)==="coinbase_wallet"||ma&&((Fe=v==null?void 0:v.connector)==null?void 0:Fe.connectorType)==="injected"&&((Ue=v==null?void 0:v.connector)==null?void 0:Ue.walletClientType)==="phantom",$=(v==null?void 0:v.status)==="connected",X=(v==null?void 0:v.status)==="switching_to_supported_chain";C.useEffect(()=>{var K;let Pe=_(),$e=Pe instanceof F5||Pe instanceof CM?Pe:void 0;$&&!$e&&(!R||M||o?A(v.connectedWallet,M,(K=w==null?void 0:w.login)==null?void 0:K.disableSignup).then(()=>{O(!0)}):(m({captchaModalData:{callback:F=>{var W;return A(v.connectedWallet,F,(W=w==null?void 0:w.login)==null?void 0:W.disableSignup).then(()=>{O(!0)})},userIntentRequired:!1,onSuccessNavigateTo:ye.AWAITING_CONNECTION,onErrorNavigateTo:ye.ERROR_SCREEN}}),u(ye.CAPTCHA_SCREEN,!1))),$e&&D&&$&&!$e.preparedMessage?$e.buildMessage():$e&&!D&&$&&(n||(async()=>{var F,W;i(!0),s(void 0);try{((F=v==null?void 0:v.connector)==null?void 0:F.connectorType)==="wallet_connect_v2"&&((W=v==null?void 0:v.connector)==null?void 0:W.walletClientType)==="metamask"&&await iee(2500),await H()}catch(ie){console.warn("Auto-prompted signature failed",ie)}finally{i(!1)}})())},[B,$,L]),C.useEffect(()=>{var Pe;if(se&&e){let $e=Dn-500;if(c!=null&&c.legal.requireUsersAcceptTerms&&!se.hasAcceptedTerms){let F=setTimeout(()=>{u(ye.AFFIRMATIVE_CONSENT_SCREEN)},$e);return()=>clearTimeout(F)}if(Od(se,(Pe=c==null?void 0:c.embeddedWallets)==null?void 0:Pe.createOnLogin)){let F=setTimeout(()=>{m({createWallet:{onSuccess:()=>{},onFailure:W=>{console.error(W),U({eventName:"embedded_wallet_creation_failure_logout",payload:{error:W,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),u(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},$e);return()=>clearTimeout(F)}j();let K=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn);return()=>clearTimeout(K)}},[se,e]);let le=Pe=>{var $e,K,F,W,ie,pe,we,he,De,Je,et,it,ut,pt;if((Pe==null?void 0:Pe.privyErrorCode)!==Ae.ALLOWLIST_REJECTED){if((Pe==null?void 0:Pe.privyErrorCode)===Ae.USER_LIMIT_REACHED)return console.error(new Fw(Pe).toString()),void u(ye.USER_LIMIT_REACHED_SCREEN);if((Pe==null?void 0:Pe.privyErrorCode)!==Ae.USER_DOES_NOT_EXIST)return(Pe==null?void 0:Pe.privyErrorCode)===Ae.ACCOUNT_TRANSFER_REQUIRED&&((K=($e=Pe.data)==null?void 0:$e.data)!=null&&K.nonce)?(m({accountTransfer:{nonce:(W=(F=Pe.data)==null?void 0:F.data)==null?void 0:W.nonce,account:(ie=_())==null?void 0:ie.meta.address,displayName:(he=(we=(pe=Pe.data)==null?void 0:pe.data)==null?void 0:we.account)==null?void 0:he.displayName,externalWalletMetadata:{walletClientType:(De=_())==null?void 0:De.meta.walletClientType,chainId:(Je=_())==null?void 0:Je.meta.chainId,connectorType:(et=_())==null?void 0:et.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:(pt=(ut=(it=Pe.data)==null?void 0:it.data)==null?void 0:ut.otherUser)==null?void 0:pt.embeddedWalletAddress}}),void u(ye.LINK_CONFLICT_SCREEN)):void s(Jie(Pe));u(ye.ACCOUNT_NOT_FOUND_SCREEN)}else u(ye.ALLOWLIST_REJECTION_SCREEN)};async function H(){try{await S(),r(!0)}catch(Pe){le(Pe)}finally{i(!1)}}C.useEffect(()=>{v!=null&&v.connectError&&le(v==null?void 0:v.connectError)},[v]),JKe(()=>{let Pe=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof hg?v.connector.redirectUri:void 0;Pe&&k(Pe);let $e=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof hg?v.connector.fallbackUniversalRedirectUri:void 0;$e&&E($e)},(v==null?void 0:v.connector)instanceof hg&&!N?500:null);let ee=((Ke=v==null?void 0:v.connector)==null?void 0:Ke.connectorType)||"injected",J=((lt=v==null?void 0:v.connector)==null?void 0:lt.walletClientType)||"unknown",te=((Ee=pu[J])==null?void 0:Ee.displayName)||((He=v==null?void 0:v.connector)==null?void 0:He.walletBranding.name)||"Browser Extension",re=((qe=pu[J])==null?void 0:qe.logo)||((Ie=v==null?void 0:v.connector)==null?void 0:Ie.walletBranding.icon)||(Pe=>d.jsx(aj,{...Pe})),z=te==="Browser Extension"?te.toLowerCase():te;t=e?`Successfully connected with ${z}`:a?a.message:X?"Switching networks":$?n&&D?"Signing":"Sign to verify":`Waiting for ${z}`;let G="Don’t see your wallet? Check your other browser windows.";e?G=Y===((se==null?void 0:se.linkedAccounts.length)||0)?"Wallet was already linked.":"You’re good to go!":B>=2&&a?G="Unable to connect wallet":a?G=a.detail:X?G="Switch your wallet to the requested network.":$&&D?G="Sign the message in your wallet to verify it belongs to you.":J==="metamask"&&ma?G="Click continue to open and connect MetaMask.":J==="metamask"?G="For the best experience, connect only one wallet at a time.":ee==="wallet_connect"?G="Open your mobile wallet app to continue":ee!=="coinbase_wallet"||ree()||(G=mz(se)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let Z=(Ne=I==null?void 0:I.walletConnectors)==null?void 0:Ne.find(Pe=>Pe.walletClientType==="coinbase_wallet"),me=J==="coinbase_wallet"&&(mz(se)||a===Tf.ERROR_USER_EXISTS);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:h&&g!==h?f:void 0}),d.jsxs(XKe,{children:[d.jsx(Zie,{walletLogo:re,success:e,fail:!!a}),d.jsxs(Io,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:G}),$||!N||P?null:d.jsxs("p",{children:["Still here?"," ",d.jsx("a",{href:N,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),x&&d.jsxs(d.Fragment,{children:[" ","or"," ",d.jsx("a",{href:x,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),me?d.jsx(Ot,{onClick:()=>Z&&(Z==null?void 0:Z.disconnect()),disabled:e,children:"Use a different wallet"}):a==Tf.ERROR_USER_EXISTS&&g!==h?d.jsx(Ot,{onClick:f,children:"Use a different wallet"}):$&&!e&&D?d.jsx(Ot,{onClick:()=>{i(!0),H()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!e&&(a!=null&&a.retryable)&&B<2?d.jsx(Ot,{onClick:()=>{V(B+1),s(void 0),$?(i(!0),H()):v==null||v.connectRetry()},disabled:!e&&(!(a!=null&&a.retryable)||B>=2),children:"Retry"}):e||a?null:d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),d.jsx(kr,{})]})};let XKe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-afad057-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),eJe=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-afad057-1"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const Zie=t=>{let e=t.walletLogo;return d.jsx(d.Fragment,{children:d.jsx(eJe,{children:d.jsxs("div",{children:[d.jsx(wc,{success:t.success,fail:t.fail}),typeof e=="string"?d.jsx("span",{style:{background:`url('${e}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):d.jsx(e,{style:{width:"38px",height:"38px"}})]})})})},tJe=()=>{var j,U,I,B,V,se;let t,{navigateBack:e,navigate:r,lastScreen:n,currentScreen:i,data:a,setModalData:s}=wt(),{walletConnectionStatus:o,closePrivyModal:l}=_t(),[c,u]=C.useState(void 0),[f,h]=C.useState(0),g=(o==null?void 0:o.status)==="connected",m=(o==null?void 0:o.status)==="switching_to_supported_chain";C.useEffect(()=>{var Y,N;if(g){let k;if((Y=a==null?void 0:a.externalConnectWallet)!=null&&Y.onCompleteNavigateTo){let x=a.externalConnectWallet.onCompleteNavigateTo,E=(N=o.connectedWallet)==null?void 0:N.address;k=setTimeout(()=>{var L;a.funding&&s({...a,funding:{...a.funding,connectedWalletAddress:E}}),r(x({walletChainType:(L=o.connector)==null?void 0:L.chainType}))},Dn)}else k=setTimeout(l,Dn);return()=>clearTimeout(k)}},[g]),C.useEffect(()=>{var Y;o!=null&&o.connectError&&(Y=o==null?void 0:o.connectError,u(Jie(Y)))},[o]);let w=((j=o==null?void 0:o.connector)==null?void 0:j.connectorType)||"injected",_=((U=o==null?void 0:o.connector)==null?void 0:U.walletClientType)||"unknown",v=((I=pu[_])==null?void 0:I.displayName)||((B=o==null?void 0:o.connector)==null?void 0:B.walletBranding.name)||"Browser Extension",b=((V=pu[_])==null?void 0:V.logo)||((se=o==null?void 0:o.connector)==null?void 0:se.walletBranding.icon)||(Y=>d.jsx(aj,{...Y})),A=v==="Browser Extension"?v.toLowerCase():v;t=g?`Successfully connected with ${A}`:c?c.message:m?"Switching networks":`Waiting for ${A}`;let S="Don’t see your wallet? Check your other browser windows.";return g?S="You’re good to go!":f>=2&&c?S="Unable to connect wallet":c?S=c.detail:m?S="Switch your wallet to the requested network.":_==="metamask"&&ma?S="Click to continue to open and connect MetaMask.":_==="metamask"?S="For the best experience, connect only one wallet at a time.":w==="wallet_connect_v2"?S="Open your mobile wallet app to continue":w==="coinbase_wallet"&&(S="Open the Coinbase app on your phone to continue."),d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:i===n?void 0:e}),d.jsxs(rJe,{children:[d.jsx(Zie,{walletLogo:b,success:g,fail:!!c}),d.jsxs(Io,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:S})]}),c==Tf.ERROR_USER_EXISTS?d.jsx(Ot,{onClick:e,children:"Use a different wallet"}):!g&&(c!=null&&c.retryable)&&f<2?d.jsx(Ot,{onClick:()=>{h(f+1),u(void 0),o==null||o.connectRetry()},disabled:!g&&(!(c!=null&&c.retryable)||f>=2),children:"Retry"}):!g&&c&&f>=2?d.jsx(Ot,{onClick:e,children:"Use a different wallet"}):null]}),d.jsx(kr,{})]})};let rJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1346f57-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const Qie=({name:t,logoUrl:e,size:r="38px"})=>typeof e=="string"?d.jsx("img",{src:e,alt:`${t??"Provider app"} logo`,style:{width:r,height:r,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):d.jsx("span",{});function nJe(t){let{logout:e}=C.useContext(km);return YL("logout",t),{logout:e}}const iJe=()=>{let t=Ai(),{data:e,navigate:r,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),{crossAppAuthFlow:a,updateWallets:s,closePrivyModal:o,createAnalyticsEvent:l}=_t(),{logout:c}=nJe(),[u,f]=C.useState({}),h=e==null?void 0:e.crossAppAuth,g={id:h.appId,name:h.name,logoUrl:h.logoUrl},m=new _e(`There was an issue connecting your ${g.name} account. Please try again.`),w=new rs(async A=>{if(h.popup)try{let S=await a({appId:A,popup:h.popup,action:h.action});f({data:S})}catch(S){S instanceof _e?f({error:S}):(S instanceof rl&&h.popup&&h.popup.close(),f({error:m}))}else f({error:m})}),_=()=>{u.data&&(s(),h.onSuccess(u.data),o({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h.onError(u.error??new _e("User canceled flow")),o({shouldCallAuthOnSuccess:!1,isSuccess:!1})};i.current=_,C.useEffect(()=>{g.id.length&&w.execute(g.id)},[g.id]),C.useEffect(()=>{var j;if(!u.data)return;let A=u.data;if(t.legal.requireUsersAcceptTerms&&!A.hasAcceptedTerms){let U=setTimeout(()=>{r(ye.AFFIRMATIVE_CONSENT_SCREEN)},Dn);return()=>clearTimeout(U)}if(Od(A,(j=t.embeddedWallets)==null?void 0:j.createOnLogin)){let U=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:I=>{console.error(I),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:I,provider:`privy:${g.id}`,screen:"CrossAppAuthScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),r(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Dn);return()=>clearTimeout(U)}let S=setTimeout(_,Dn);return()=>clearTimeout(S)},[u.data]);let{title:v,subtitle:b}=C.useMemo(()=>u.data?{title:`Successfully connected with ${g.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${g.name}`,subtitle:`Please check the pop-up from ${g.name} to continue`},[u,g.name]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:_}),d.jsx(tn,{}),d.jsxs(aJe,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(wc,{success:!!u.data,fail:!!u.error}),d.jsx(Qie,{name:g.name,logoUrl:g.logoUrl})]})}),d.jsxs(Io,{children:[d.jsx("h3",{children:v}),d.jsx("p",{children:b})]})]}),d.jsx(an,{}),d.jsx(kr,{})]})};let aJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-2ae0702a-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);function sJe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Ac=C.forwardRef(sJe);function oJe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const lJe=C.forwardRef(oJe),cJe=fe.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),i1=fe.span.withConfig({displayName:"ErrorMessage",componentId:"sc-fcb8cd50-0"})(["text-align:left;font-size:0.75rem;font-weight:500;line-height:1.125rem;color:var(--privy-color-error);"]),uJe=fe.span.withConfig({displayName:"LabelXs",componentId:"sc-4c43f9fd-0"})(["color:var(--privy-color-foreground-3);font-size:0.75rem;font-weight:500;line-height:1.125rem;"]),Xie=oa(["&&{border-width:1px;padding:0.5rem 1rem;}width:100%;text-align:left;border:solid 1px var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);display:flex;justify-content:space-between;align-items:center;",""],t=>t.$state==="error"?"border-color: var(--privy-color-error);":""),Mj=fe.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],Xie),a7=({errMsg:t,balance:e,address:r,isLoading:n,className:i,title:a,isPulsing:s,showIcon:o,statusColor:l="green"})=>{let c;return c=l||(t?"red":"green"),d.jsxs(d.Fragment,{children:[d.jsxs(Mj,{className:i,$state:t?"error":void 0,children:[d.jsxs(cJe,{children:[d.jsx(uJe,{children:a||"Pay with"}),d.jsx(wo,{address:r,showCopyIcon:o||!!t})]}),e!==void 0&&d.jsx(xc,{isLoading:n,isPulsing:s,color:c,children:e})]}),t&&d.jsx(i1,{style:{marginTop:"0.25rem"},children:t})]})},dJe=()=>{let{app:t,data:e}=wt(),{closePrivyModal:r}=_t(),[n,i]=C.useState(!1),[a,s]=C.useState(),{address:o,onDelegate:l,onSuccess:c,onError:u}=e.delegatedActions.consent,f=async()=>{n?c():u(a??new _e("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return C.useEffect(()=>{if(!n&&!a)return;let h=setTimeout(f,mL);return()=>clearTimeout(h)},[n,a]),d.jsxs(d.Fragment,n||a?{children:[d.jsx(ft,{onClose:f}),d.jsx(tn,{}),d.jsxs(tj,{children:[a?d.jsx(kx,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(Ac,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(nj,{height:20}),d.jsx(zn,{title:a?"Something went wrong":"Success!",description:a?"Please try again.":`You’ve successfully granted delegated action permissions to ${t.name}.`})]}),d.jsx(an,{}),d.jsx(Zt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:f}),d.jsx(lJe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable offline access"}),d.jsxs(pn,{style:{marginBottom:24,textWrap:"pretty"},children:["By confirming, ",t.name," will be able to use your wallet for you even when you're not around. You can revoke this later."]}),d.jsx(hJe,{showIcon:!0,address:o,title:"Wallet",isLoading:!1}),d.jsxs(fJe,{style:{marginTop:24},children:[d.jsx(zd,{onClick:f,children:"Not now"}),d.jsx(Ot,{onClick:async()=>{try{await l(),i(!0)}catch(h){s(h)}},children:"Accept"})]}),d.jsx(Zt,{})]})};let fJe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-b99bc0c0-0"})(["display:flex;gap:10px;"]),hJe=fe(a7).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-b99bc0c0-1"})(["margin-top:1.5rem;"]);function pJe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const gJe=C.forwardRef(pJe),mJe=()=>{let{app:t,data:e}=wt(),{closePrivyModal:r}=_t(),[n,i]=C.useState(!1),[a,s]=C.useState(),{onRevoke:o,onSuccess:l,onError:c}=e.delegatedActions.revoke,u=async()=>{n?l():c(a??new _e("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return C.useEffect(()=>{if(!n&&!a)return;let f=setTimeout(u,mL);return()=>clearTimeout(f)},[n,a]),d.jsxs(d.Fragment,n||a?{children:[d.jsx(ft,{onClose:u}),d.jsx(tn,{}),d.jsxs(tj,{children:[a?d.jsx(kx,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(Ac,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(nj,{height:20}),d.jsx(zn,{title:a?"Something went wrong":"Success!",description:a?"Please try again.":"You've successfully revoked permissions."})]}),d.jsx(an,{}),d.jsx(Zt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:u}),d.jsx(gJe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24},children:"Revoke offline access to wallet"}),d.jsxs(pn,{children:["By confirming, ",t.name," will no longer be able to use this wallet on your behalf when you are not online."]}),d.jsxs(yJe,{style:{marginTop:24},children:[d.jsx(zd,{onClick:u,children:"Deny"}),d.jsx(Ot,{onClick:async()=>{try{await o(),i(!0)}catch(f){s(f)}},children:"Confirm"})]}),d.jsx(Zt,{})]})};let yJe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-8ff214d7-0"})(["display:flex;gap:10px;"]);const eae=()=>d.jsx(wJe,{children:d.jsxs(vJe,{children:[d.jsx(bJe,{}),d.jsx(xJe,{})]})});let wJe=fe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-85b54ede-0"})(["display:flex;justify-content:center;align-items:center;flex-grow:1;margin:12px;padding:16px;@media all and (display-mode:standalone){margin-bottom:30px;}"]),vJe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-85b54ede-1"})(["position:relative;height:140px;width:140px;opacity:1;animation:fadein 200ms ease;"]),bJe=fe.div.withConfig({displayName:"CircleFixed",componentId:"sc-85b54ede-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;&&{border:4px solid var(--privy-color-accent-light);border-radius:50%;}"]),xJe=fe.div.withConfig({displayName:"CircleRotate",componentId:"sc-85b54ede-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:var(--privy-color-accent) transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const EJe=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];let ri=class extends Error{constructor(e,r){super(r),this.type=e}};function Om(t){let e=t.type;return typeof e=="string"&&EJe.includes(e)}function w8(t){return Om(t)&&t.type==="wallet_not_on_device"}function _Je(t){return Om(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function Tj(t){return!!Om(t)&&t.type==="mfa_timeout"}function kj(t){return!!Om(t)&&t.type==="missing_or_invalid_mfa"}function CJe(t){return!!Om(t)&&t.type==="mfa_verification_max_attempts_reached"}function tae(t){return!(!Om(t)||!t.message.includes("code 429"))}function rae(t){return!!function(e){let r=e.type;return typeof r=="string"&&r==="client_error"}(t)&&t.message==="MFA canceled"}function s7(){return k5(EM(36))}function Nj(){return s7()}async function Lj(t,e="S256"){if(e!="S256")return t;{let r=await FMe(t);return k5(r)}}function SJe(){let t=Dt.get(ay);if(!t)throw new _e("Authentication error.");return t}function nae({isCreatingWallet:t,skipSplashScreen:e}){return t?ye.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:e?ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN}function iae({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?ye.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||e.length===1?nae({isCreatingWallet:t==="create",skipSplashScreen:n}):ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function aae(t){switch(t){case"user-passcode":return ye.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN;case"google-drive":case"icloud":return ye.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN;default:throw Error("Recovery method not supported")}}async function kH({api:t,provider:e}){let r=s7(),n=Nj(),i=await Lj(r);try{return e==="icloud"?{url:(await t.post(KIe,{client_type:"web"})).url}:{url:(await t.post(YIe,{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:e}}catch(a){throw Vr(a)}}async function AJe({api:t,provider:e,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new _e("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(i==="undefined")throw new _e("User denied confirmation during OAuth flow");try{return(await t.post(JIe,{authorization_code:i,state_code:r,code_verifier:n,provider:e})).access_token}catch(a){let s=Vr(a);throw s.privyErrorCode?new _e(s.message||"Invalid code during OAuth flow.",void 0,s.privyErrorCode):s.message==="User denied confirmation during OAuth flow"?new _e("Invalid code during oauth flow.",void 0,Ae.OAUTH_USER_DENIED):new _e("Invalid code during OAuth flow.",void 0,Ae.UNKNOWN_AUTH_ERROR)}}const IJe=()=>{let{authenticated:t,user:e,getAccessToken:r}=$r(),{closePrivyModal:n,createAnalyticsEvent:i,walletProxy:a}=_t(),{navigate:s,data:o,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=wt(),u=C.useMemo(()=>Date.now(),[]),[f,h]=C.useState(!1),{onCompleteNavigateTo:g,onFailure:m,shouldForceMFA:w,entropyId:_,entropyIdVerifier:v}=o==null?void 0:o.connectWallet,b=S=>{f||(h(!0),m(typeof S=="string"?Error(S):S))};C.useEffect(()=>{let S,j=B5(e,_);return t&&j?a?((async()=>{let U=await r();if(!U)return b("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:U,entropyId:_,entropyIdVerifier:v}),w&&await a.verifyMfa({accessToken:U});let I=(Date.now()-u)/1e3;g===ye.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&I<1?S=setTimeout(()=>{s(g,!1)},1e3*(1-I)):s(g,!1)}catch(I){if(w8(I)&&j.recoveryMethod==="privy"){let B=await r();if(!B)return b("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:j.address}});let V=await(a==null?void 0:a.recover({accessToken:B,entropyId:_,entropyIdVerifier:v}));V!=null&&V.entropyId||b(Error("Unable to recover wallet")),g?s(g):n({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:j.address}}),s(g)}catch{b("An error has occurred, please try again.")}}else w8(I)&&j.recoveryMethod!=="privy"?(l({...o,recoverWallet:{entropyId:_,entropyIdVerifier:v,onCompleteNavigateTo:g,onFailure:m},recoveryOAuthStatus:{provider:j.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),s(aae(j.recoveryMethod))):b(I)}})(),()=>clearTimeout(S)):void 0:b("User must be authenticated and have a Privy wallet before it can be connected")},[t,e,a]);let A=()=>{b("User exited before wallet could be connected"),n({shouldCallAuthOnSuccess:!1})};return c.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),f?d.jsxs(d.Fragment,{children:[d.jsxs(Zd,{children:[d.jsx(Px,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),d.jsx(Ot,{onClick:()=>n({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):d.jsx(eae,{}),d.jsx(MJe,{})]})};let MJe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-124dbb1c-0"})(["height:44px;"]);const TJe=()=>{let{user:t}=$r(),{closePrivyModal:e,isNewUserThisSession:r,updateWallets:n}=_t(),{app:i,data:a,onUserCloseViaDialogOrKeybindRef:s}=wt(),{onSuccess:o,onFailure:l,callAuthOnSuccessOnClose:c}=a.createWallet,u=()=>{let f=ks(t);f?(n(),o(f)):l(Error("Failed to create wallet")),e({shouldCallAuthOnSuccess:c})};return C.useEffect(()=>{let f=setTimeout(u,mL);return()=>clearTimeout(f)},[]),s.current=u,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:u}),d.jsx(tn,{}),d.jsxs(Zd,{children:[d.jsx(X0,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(zn,{title:r?"Welcome"+(i!=null&&i.name?` to ${i==null?void 0:i.name}`:""):"All set!",description:r?"You’ve successfully created an account.":"Your account is secured."})]}),d.jsx(an,{}),d.jsx(Zt,{})]})},kJe=({children:t,theme:e})=>d.jsxs(NJe,{$theme:e,children:[d.jsx(Jd,{width:"1.25rem",color:e==="dark"?"#FDE68A":"var(--privy-color-warn)"}),t]});let NJe=fe.div.withConfig({displayName:"Container",componentId:"sc-97f152b3-0"})(["display:flex;gap:0.5rem;background-color:",";"," align-items:flex-start;text-align:left;padding:0.5rem 0.75rem;font-size:0.8125rem;font-weight:400;line-height:1.125rem;padding:0.75rem;&&{border-radius:var(--privy-border-radius-sm);}"],t=>t.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-warn-light)",t=>t.$theme==="dark"?"color: #FDE68A;":"");const N1=fe.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]),lh=fe.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]),LJe=()=>{let[t,e]=C.useState(null),{authenticated:r,user:n,getAccessToken:i}=$r(),{closePrivyModal:a,createAnalyticsEvent:s,clientAnalyticsId:o}=_t(),l=Ai(),{data:c,onUserCloseViaDialogOrKeybindRef:u}=wt(),{onFailure:f,onSuccess:h,origin:g,appId:m,appClientId:w,walletToExport:_,primaryWallet:v}=c.keyExport,b=S=>{a({shouldCallAuthOnSuccess:!1}),f(typeof S=="string"?Error(S):S)},A=()=>{a({shouldCallAuthOnSuccess:!1}),h(),s({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:_.address}})};return C.useEffect(()=>{if(!r||!_)return b("User must be authenticated before exporting their wallet");i().then(e,b)},[r,n]),u.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),d.jsxs($Je,{children:[d.jsx(lh,{children:"Transfer wallet"}),d.jsxs(N1,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",d.jsx("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),d.jsx(kJe,{theme:l.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),d.jsx(a7,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:_.address,showIcon:!0}),d.jsx("div",{style:{width:"100%"},children:t&&d.jsx(jJe,{origin:g,appId:m,appClientId:w,accessToken:t,clientAnalyticsId:o,walletToExport:_,primaryWallet:v,dimensions:{height:"44px"}})})]}),d.jsx(Zt,{})]})};function jJe(t){let[e,r]=C.useState(t.dimensions.width),[n,i]=C.useState(void 0),a=C.useRef(null);C.useEffect(()=>{if(a.current&&e===void 0){let{width:l}=a.current.getBoundingClientRect();r(l)}let o=getComputedStyle(document.documentElement);i({background:o.getPropertyValue("--privy-color-background"),background2:o.getPropertyValue("--privy-color-background-2"),foreground3:o.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:o.getPropertyValue("--privy-color-foreground-accent"),accent:o.getPropertyValue("--privy-color-accent"),accentDark:o.getPropertyValue("--privy-color-accent-dark"),success:o.getPropertyValue("--privy-color-success")})},[]);let s=t.walletToExport.chainType==="ethereum"&&!t.walletToExport.imported;return d.jsx("div",{ref:a,children:e&&d.jsxs(PJe,{children:[d.jsx("iframe",{style:{position:"absolute",zIndex:1},width:e,height:t.dimensions.height,allow:"clipboard-write self *",src:aee(t.origin,`/apps/${t.appId}/embedded-wallets/export`,{client_id:t.appClientId,primaryAddress:t.primaryWallet.address,address:t.walletToExport.address,walletIndex:t.walletToExport.walletIndex,width:`${e}px`,caid:t.clientAnalyticsId,phrase_export:s,...n},{token:t.accessToken})}),d.jsx(NH,{children:"Loading..."}),s&&d.jsx(NH,{children:"Loading..."})]})})}let $Je=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-eaab13a9-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),PJe=fe.div.withConfig({displayName:"ButtonContainer",componentId:"sc-eaab13a9-1"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),NH=fe.div.withConfig({displayName:"LoadingButton",componentId:"sc-eaab13a9-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function sae(){let{getAccessToken:t}=$r(),{refreshUser:e,createAnalyticsEvent:r,initializeWalletProxy:n}=_t(),i=C.useRef(!1);return{createWallet:C.useCallback(async({user:a,recoveryPassword:s})=>{let o=await t();if(!o)throw r({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{r({eventName:"embedded_wallet_creation_started"});let l=await n(yL);if(!l)throw Error("walletProxy does not exist.");let c=new Promise((g,m)=>{setTimeout(()=>{m(Error("walletProxy.create timed out."))},2e4)}),u=Xc(a);if(!await Promise.race([l.create({accessToken:o,recoveryPassword:s,recoveryMethod:s?"user-passcode":void 0,solanaAddress:u==null?void 0:u.address}),c]))throw Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw Error("Failed to refresh user.");let h=ks(f);if(!h)throw Error("Updated user is missing embedded wallet.");return r({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:h.address}}),i.current=!0,h}catch(l){if(i.current)return;throw r({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}const RJe=()=>{let{app:t,setModalData:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),[a,s]=C.useState(""),{embeddedWallets:o}=Ai(),{authenticated:l,user:c}=$r(),{closePrivyModal:u}=_t(),{onSuccess:f,onFailure:h,callAuthOnSuccessOnClose:g}=n.createWallet,m=(t==null?void 0:t.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,{createWallet:w}=sae(),[_,v]=C.useState(null),b=new rs(async()=>{try{let A=await w({user:c});if(!A)return;v(A),r(ye.EMBEDDED_WALLET_CREATED_SCREEN)}catch(A){s(A.message)}});return C.useEffect(()=>l&&c?m?(e({...n,recoverySelection:{...n==null?void 0:n.recoverySelection,isInAccountCreateFlow:!0}}),r(iae({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:o.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void b.execute():(r(ye.LANDING),void h(Error("User must be authenticated before creating a Privy wallet"))),[m,l]),i.current=()=>null,a?d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsxs(Zd,{children:[d.jsx(Px,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:a})]}),d.jsx(Ot,{onClick:()=>{_?(f(_),u({shouldCallAuthOnSuccess:g})):(h(new Kf("User wallet creation failed")),u({shouldCallAuthOnSuccess:!1}))},children:"Close"}),d.jsx(DJe,{})]}):d.jsx(eae,{})};let DJe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-eabafbf4-0"})(["height:44px;"]);var OJe=function(e,r){return Math.round(r*Math.log(e)/Math.LN2)},FJe=[{name:"lowercase",re:/[a-z]/,length:26},{name:"uppercase",re:/[A-Z]/,length:26},{name:"numbers",re:/[0-9]/,length:10},{name:"symbols",re:/[^a-zA-Z0-9]/,length:33}],UJe=function(e){return function(r){return e.reduce(function(n,i){return n+(i.re.test(r)?i.length:0)},0)}},BJe=UJe(FJe),zJe=function(e){return e?OJe(BJe(e),e.length):0},WJe=zJe;const HJe=To(WJe);function oae(t){return crypto.getRandomValues(new Uint8Array(t))}const GJe=256,Dy=65536;function qJe(){const[t]=oae(1);return t}function VJe(){const[t,e]=oae(2);return(t<<8)+e}function YJe(t){if(typeof t!="number"||t<2||t>Dy)throw new Error(`Invalid number: number must be at least two and at most ${Dy}`);const e=t>256,r=e?Dy:GJe,n=e?VJe:qJe,i=t*Math.floor(r/t);for(;;){const a=n();if(aDy)throw new Error(`Invalid argument: end must be a number less than or equal to ${Dy}`);if(r-e<2)throw new Error("Invalid range: range must contain at least two values");const n=[];for(let i=0;i{const s=e[i];return n+(a===0?s:r+s)},"")}const ZJe=Object.freeze(["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]),QJe=Object.freeze(ZJe.filter(t=>!t.includes("-")));let XJe=/[a-z]/,eZe=/[A-Z]/,tZe=/[0-9]/,lae="!@#$%^&*()\\-_+.",cae=`a-zA-Z0-9${lae}`,rZe=RegExp(`[${lae}]`),nZe=RegExp(`[${cae}]`);const iZe=RegExp(`^[${cae}]{6,}$`),aZe=(t="")=>[...new Set(t.split("").filter(e=>!nZe.test(e)).map(e=>e.replace(" ","SPACE")))],uae=()=>JJe(4,QJe);function sZe(t){return t>.9?"Strong":t>.5?"Medium":"Weak"}function oZe(t){if(t.length<8)return 0;let e=0;return XJe.test(t)&&(e+=1),eZe.test(t)&&(e+=1),tZe.test(t)&&(e+=1),rZe.test(t)&&(e+=1),Math.max(0,Math.min(1,e/3))}function lZe(t=""){return(.3*oZe(t)+HJe(t)/95)/2}function cZe(t=""){let e=lZe(t);return{value:e,label:sZe(e)}}function uZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const dZe=C.forwardRef(uZe);function fZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const hZe=C.forwardRef(fZe);function pZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const gZe=C.forwardRef(pZe);let mZe=oa(["font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;text-align:left;transition:color 0.1s ease-in;"]);const dae=fe.span.withConfig({displayName:"StatusText",componentId:"sc-3f6866a9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],mZe,({error:t})=>t?"var(--privy-color-error)":"var(--privy-color-foreground-3)",({error:t})=>t?"":"capitalize"),o7=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-3f6866a9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),l7=fe(Ot).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-3f6866a9-2"})(["",""],t=>t.hideAnimations&&oa(["&&{transition:none;}"]));let fae=oa(["&&{width:100%;border-width:1px;border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);background:var(--privy-color-background);color:var(--privy-color-foreground);padding:12px;font-size:16px;font-style:normal;font-weight:300;line-height:22px;}"]);const jj=fe.input.withConfig({displayName:"PasswordInput",componentId:"sc-3f6866a9-3"})([""," &::placeholder{color:var(--privy-color-foreground-3);font-style:italic;font-size:14px;}overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],fae),yZe=fe.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-3f6866a9-4"})(["",""],fae),c7=fe.div.withConfig({displayName:"PasswordContainer",componentId:"sc-3f6866a9-5"})(["position:relative;width:100%;display:flex;align-items:center;justify-content:",";"],({centered:t})=>t?"center":"space-between"),u7=fe.div.withConfig({displayName:"Header",componentId:"sc-3f6866a9-6"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:32px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),$j=fe.div.withConfig({displayName:"Details",componentId:"sc-3f6866a9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),ET=fe.div.withConfig({displayName:"DetailItem",componentId:"sc-3f6866a9-8"})(["display:flex;text-align:left;align-items:center;gap:8px;max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;margin:0 8px;color:var(--privy-color-foreground-2);> :first-child{min-width:24px;}"]),LH=fe(Mx).withConfig({displayName:"ExportButton",componentId:"sc-3f6866a9-10"})(["display:flex;flex:1;gap:4px;justify-content:center;&&{background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);border-width:1px;}"]),Pj=fe.div.withConfig({displayName:"InputRightIcons",componentId:"sc-3f6866a9-11"})(["position:absolute;right:0.5rem;display:flex;flex-direction:row;justify-content:space-around;align-items:center;"]),wZe=fe(dZe).withConfig({displayName:"RegenerateIcon",componentId:"sc-3f6866a9-12"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),Rj=fe(gZe).withConfig({displayName:"HiddenIcon",componentId:"sc-3f6866a9-13"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),Dj=fe(hZe).withConfig({displayName:"ShownIcon",componentId:"sc-3f6866a9-14"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),vZe=fe.progress.withConfig({displayName:"StrengthMeter",componentId:"sc-3f6866a9-15"})(["height:4px;width:100%;margin:8px 0;::-webkit-progress-bar{border-radius:8px;background:var(--privy-color-foreground-4);}::-webkit-progress-value{border-radius:8px;transition:all 0.1s ease-out;background:",";}"],({label:t})=>(t==="Strong"?"#78dca6":t==="Medium"&&"var(--privy-color-warn)")||"var(--privy-color-error)"),bZe=({buttonHideAnimations:t,buttonLoading:e,password:r,onSubmit:n,onBack:i})=>{let[a,s]=C.useState(!0),[o,l]=C.useState(!1),[c,u]=C.useState(""),f=r===c;return C.useEffect(()=>{c&&!o&&l(!0)},[c]),d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:i}),d.jsx(tn,{}),d.jsxs(o7,{children:[d.jsxs(u7,{children:[d.jsx(Jd,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),d.jsxs(c7,{children:[d.jsx(jj,{value:c,onChange:h=>u(h.target.value),onKeyUp:h=>{h.key==="Enter"&&n()},onBlur:()=>l(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),d.jsx(Pj,{style:{right:"0.75rem"},children:a?d.jsx(Rj,{onClick:()=>s(!1)}):d.jsx(Dj,{onClick:()=>s(!0)})})]}),d.jsx(dae,{"aria-hidden":!o||f,error:!0,children:"Passwords do not match"})]}),d.jsx(l7,{onClick:n,loading:e,disabled:!f,hideAnimations:t,children:"Continue"}),d.jsx(an,{}),d.jsx(Zt,{})]})},xZe=({className:t,checked:e,color:r="var(--privy-color-accent)",...n})=>d.jsx("label",{children:d.jsxs(EZe,{className:t,children:[d.jsx(pae,{checked:e,...n}),d.jsx(_Ze,{color:r,checked:e,children:d.jsx(hae,{viewBox:"0 0 24 24",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});let EZe=fe.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),hae=fe.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),pae=fe.input.attrs({type:"checkbox"}).withConfig({displayName:"HiddenCheckbox",componentId:"sc-db51b935-3"})(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]),_Ze=fe.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-db51b935-4"})(["display:inline-block;width:18px;height:18px;transition:all 150ms;cursor:pointer;border-color:",";border-radius:3px;background:",";&&{border-width:1px;}",":focus + &{box-shadow:0 0 0 1px ",";}","{visibility:",";}"],t=>t.color,t=>t.checked?t.color:"var(--privy-color-background)",pae,t=>t.color,hae,t=>t.checked?"visible":"hidden");const CZe=({buttonHideAnimations:t,buttonLoading:e,onSubmit:r,onBack:n,config:i})=>{let[a,s]=C.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:n}),d.jsx(tn,{}),d.jsxs(o7,{children:[d.jsxs(u7,{children:[d.jsx(Jd,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),d.jsx($j,{children:d.jsxs(ET,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:o=>{o.preventDefault(),s(l=>!l)},children:[d.jsx(xZe,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),d.jsx(d.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),d.jsxs(SZe,{children:[i.initiatedBy==="user"&&d.jsx(zd,{onClick:i.onCancel,disabled:e,children:"Cancel"}),d.jsx(l7,{onClick:r,loading:e,hideAnimations:t,disabled:!a,children:"Set Password"})]}),d.jsx(an,{}),d.jsx(Zt,{})]})};let SZe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-eb601350-0"})(["display:flex;gap:10px;"]);function AZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const IZe=C.forwardRef(AZe),MZe=({buttonHideAnimations:t,buttonLoading:e,password:r="",config:n,isResettingPassword:i,onSubmit:a,onClose:s,onBack:o,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,f]=C.useState(!1),[h,g]=C.useState(!1);C.useEffect(()=>{r&&!h&&g(!0)},[r]);let m=C.useMemo(()=>h?6>((r==null?void 0:r.length)||0)?"Password must be at least 6 characters":iZe.test(r||"")?null:`Invalid characters used ( ${aZe(r).join(" ")} )`:null,[r,h]),w=C.useMemo(()=>m?{value:0,label:"Weak"}:cZe(r),[r,m]),_=C.useMemo(()=>!(r!=null&&r.length)||!!m,[m,r]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:s,closeable:n.initiatedBy==="user",backFn:o}),d.jsx(tn,{}),d.jsxs(o7,{children:[d.jsxs(u7,{children:[d.jsx(IZe,{height:48,width:48,stroke:"var(--privy-color-accent)"}),d.jsxs("h3",{style:{color:"var(--privy-color-foreground)"},children:[i?"Reset":"Set"," your password"]}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),d.jsxs(c7,{children:[d.jsx(jj,{value:r,onChange:v=>l(v.target.value),onKeyUp:v=>{v.key==="Enter"&&a()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),d.jsxs(Pj,{style:{width:"3.5rem"},children:[u?d.jsx(Rj,{onClick:()=>f(!1)}):d.jsx(Dj,{onClick:()=>f(!0)}),d.jsx(wZe,{onClick:c})]})]}),d.jsx(vZe,{value:w.value===0?.01:w.value,label:w.label}),d.jsx(dae,{error:!!m,children:m||`Password Strength: ${h?w.label:"--"}`}),d.jsxs(kZe,{children:[d.jsx(TZe,{children:d.jsxs($j,{children:[d.jsxs(ET,{children:[d.jsx(X0,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),d.jsxs(ET,{children:[d.jsx(X0,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),d.jsx(l7,{onClick:a,loading:e,disabled:_,hideAnimations:t,children:"Continue"})]})]}),d.jsx(an,{}),d.jsx(Zt,{})]})};let TZe=fe($j).withConfig({displayName:"DetailsContainer",componentId:"sc-7b3b7727-0"})(["flex:1;padding-top:1rem;"]),kZe=fe.div.withConfig({displayName:"LowerContainer",componentId:"sc-7b3b7727-1"})(["display:flex;flex-direction:column;height:100%;"]);function NZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const LZe=C.forwardRef(NZe);function jZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}))}const gae=C.forwardRef(jZe);function $Ze({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const PZe=C.forwardRef($Ze),RZe=({buttonHideAnimations:t,buttonLoading:e,appName:r,password:n,onSubmit:i,onBack:a})=>{let[s,o]=C.useState(!1),l=C.useCallback(()=>{o(!0),n&&navigator.clipboard.writeText(n)},[n]),c=C.useCallback(()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([DZe(r,n)],{type:"text/plain"}),g=URL.createObjectURL(h);u.href=g,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(g)},5e3)},[n]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:a,closeable:!1}),d.jsx(tn,{}),d.jsxs(o7,{children:[d.jsxs(u7,{children:[d.jsx(Jd,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),d.jsx(c7,{centered:!0,children:d.jsx(yZe,{children:n})}),d.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[d.jsx(LH,{onClick:l,children:d.jsxs(d.Fragment,s?{children:[d.jsx(gae,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[d.jsx(PZe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),d.jsxs(LH,{onClick:c,children:[d.jsx(LZe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),d.jsx(l7,{onClick:i,loading:e,hideAnimations:t,children:"Continue"}),d.jsx(an,{}),d.jsx(Zt,{})]})};let DZe=(t,e)=>`Your wallet recovery password for ${t} is +}`;var xr=qR(function(){return en(ce,Ut+"return "+rt).apply(r,xe)});if(xr.source=rt,p_(xr))throw xr;return xr}function Rpe(p){return rn(p).toLowerCase()}function Dpe(p){return rn(p).toUpperCase()}function Ope(p,y,T){if(p=rn(p),p&&(T||y===r))return tP(p);if(!p||!(y=io(y)))return p;var q=$l(p),ne=$l(y),ce=rP(q,ne),xe=nP(q,ne)+1;return pf(q,ce,xe).join("")}function Fpe(p,y,T){if(p=rn(p),p&&(T||y===r))return p.slice(0,aP(p)+1);if(!p||!(y=io(y)))return p;var q=$l(p),ne=nP(q,$l(y))+1;return pf(q,0,ne).join("")}function Upe(p,y,T){if(p=rn(p),p&&(T||y===r))return p.replace(Ft,"");if(!p||!(y=io(y)))return p;var q=$l(p),ne=rP(q,$l(y));return pf(q,ne).join("")}function Bpe(p,y){var T=se,q=Y;if(Hn(y)){var ne="separator"in y?y.separator:ne;T="length"in y?vr(y.length):T,q="omission"in y?io(y.omission):q}p=rn(p);var ce=p.length;if(ep(p)){var xe=$l(p);ce=xe.length}if(T>=ce)return p;var Se=T-tp(q);if(Se<1)return q;var ke=xe?pf(xe,0,Se).join(""):p.slice(0,Se);if(ne===r)return ke+q;if(xe&&(Se+=ke.length-Se),g_(ne)){if(p.slice(Se).search(ne)){var Ve,Ye=ke;for(ne.global||(ne=NE(ne.source,rn(cr.exec(ne))+"g")),ne.lastIndex=0;Ve=ne.exec(Ye);)var rt=Ve.index;ke=ke.slice(0,rt===r?Se:rt)}}else if(p.indexOf(io(ne),Se)!=Se){var bt=ke.lastIndexOf(ne);bt>-1&&(ke=ke.slice(0,bt))}return ke+q}function zpe(p){return p=rn(p),p&&mt.test(p)?p.replace(zt,yde):p}var Wpe=lp(function(p,y,T){return p+(T?" ":"")+y.toUpperCase()}),w_=VP("toUpperCase");function GR(p,y,T){return p=rn(p),y=T?r:y,y===r?fde(p)?bde(p):nde(p):p.match(y)||[]}var qR=Ar(function(p,y){try{return Di(p,r,y)}catch(T){return p_(T)?T:new fr(T)}}),Hpe=Vu(function(p,y){return Wo(y,function(T){T=Rc(T),Gu(p,T,f_(p[T],p))}),p});function Gpe(p){var y=p==null?0:p.length,T=rr();return p=y?On(p,function(q){if(typeof q[1]!="function")throw new Ho(s);return[T(q[0]),q[1]]}):[],Ar(function(q){for(var ne=-1;++neP)return[];var T=D,q=Ca(p,D);y=rr(y),p-=D;for(var ne=ME(q,y);++T0||y<0)?new Dr(T):(p<0?T=T.takeRight(-p):p&&(T=T.drop(p)),y!==r&&(y=vr(y),T=y<0?T.dropRight(-y):T.take(y-p)),T)},Dr.prototype.takeRightWhile=function(p){return this.reverse().takeWhile(p).reverse()},Dr.prototype.toArray=function(){return this.take(D)},$c(Dr.prototype,function(p,y){var T=/^(?:filter|find|map|reject)|While$/.test(y),q=/^(?:head|last)$/.test(y),ne=oe[q?"take"+(y=="last"?"Right":""):y],ce=q||/^find/.test(y);ne&&(oe.prototype[y]=function(){var xe=this.__wrapped__,Se=q?[1]:arguments,ke=xe instanceof Dr,Ve=Se[0],Ye=ke||mr(xe),rt=function(Lr){var zr=ne.apply(oe,lf([Lr],Se));return q&&bt?zr[0]:zr};Ye&&T&&typeof Ve=="function"&&Ve.length!=1&&(ke=Ye=!1);var bt=this.__chain__,Ut=!!this.__actions__.length,ar=ce&&!bt,xr=ke&&!Ut;if(!ce&&Ye){xe=xr?xe:new Dr(this);var sr=p.apply(xe,Se);return sr.__actions__.push({func:Rb,args:[rt],thisArg:r}),new Go(sr,bt)}return ar&&xr?p.apply(this,Se):(sr=this.thru(rt),ar?q?sr.value()[0]:sr.value():sr)})}),Wo(["pop","push","shift","sort","splice","unshift"],function(p){var y=lb[p],T=/^(?:push|sort|unshift)$/.test(p)?"tap":"thru",q=/^(?:pop|shift)$/.test(p);oe.prototype[p]=function(){var ne=arguments;if(q&&!this.__chain__){var ce=this.value();return y.apply(mr(ce)?ce:[],ne)}return this[T](function(xe){return y.apply(mr(xe)?xe:[],ne)})}}),$c(Dr.prototype,function(p,y){var T=oe[y];if(T){var q=T.name+"";on.call(ap,q)||(ap[q]=[]),ap[q].push({name:y,func:T})}}),ap[Tb(r,v).name]=[{name:"wrapper",func:r}],Dr.prototype.clone=zde,Dr.prototype.reverse=Wde,Dr.prototype.value=Hde,oe.prototype.at=v0e,oe.prototype.chain=b0e,oe.prototype.commit=x0e,oe.prototype.next=E0e,oe.prototype.plant=C0e,oe.prototype.reverse=S0e,oe.prototype.toJSON=oe.prototype.valueOf=oe.prototype.value=A0e,oe.prototype.first=oe.prototype.head,c2&&(oe.prototype[c2]=_0e),oe},rp=xde();ci?((ci.exports=rp)._=rp,wn._=rp):Br._=rp}).call(Xt)})(S8,S8.exports);var vKe=S8.exports,kT={exports:{}};(function(t,e){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof Xt<"u"&&Xt,n=function(){function a(){this.fetch=!1,this.DOMException=r.DOMException}return a.prototype=r,new a}();(function(a){(function(s){var o=typeof a<"u"&&a||typeof self<"u"&&self||typeof Xt<"u"&&Xt||{},l={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function c(E){return E&&DataView.prototype.isPrototypeOf(E)}if(l.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(E){return E&&u.indexOf(Object.prototype.toString.call(E))>-1};function h(E){if(typeof E!="string"&&(E=String(E)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(E)||E==="")throw new TypeError('Invalid character in header field name: "'+E+'"');return E.toLowerCase()}function g(E){return typeof E!="string"&&(E=String(E)),E}function m(E){var L={next:function(){var O=E.shift();return{done:O===void 0,value:O}}};return l.iterable&&(L[Symbol.iterator]=function(){return L}),L}function w(E){this.map={},E instanceof w?E.forEach(function(L,O){this.append(O,L)},this):Array.isArray(E)?E.forEach(function(L){if(L.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+L.length);this.append(L[0],L[1])},this):E&&Object.getOwnPropertyNames(E).forEach(function(L){this.append(L,E[L])},this)}w.prototype.append=function(E,L){E=h(E),L=g(L);var O=this.map[E];this.map[E]=O?O+", "+L:L},w.prototype.delete=function(E){delete this.map[h(E)]},w.prototype.get=function(E){return E=h(E),this.has(E)?this.map[E]:null},w.prototype.has=function(E){return this.map.hasOwnProperty(h(E))},w.prototype.set=function(E,L){this.map[h(E)]=g(L)},w.prototype.forEach=function(E,L){for(var O in this.map)this.map.hasOwnProperty(O)&&E.call(L,this.map[O],O,this)},w.prototype.keys=function(){var E=[];return this.forEach(function(L,O){E.push(O)}),m(E)},w.prototype.values=function(){var E=[];return this.forEach(function(L){E.push(L)}),m(E)},w.prototype.entries=function(){var E=[];return this.forEach(function(L,O){E.push([O,L])}),m(E)},l.iterable&&(w.prototype[Symbol.iterator]=w.prototype.entries);function C(E){if(!E._noBody){if(E.bodyUsed)return Promise.reject(new TypeError("Already read"));E.bodyUsed=!0}}function v(E){return new Promise(function(L,O){E.onload=function(){L(E.result)},E.onerror=function(){O(E.error)}})}function b(E){var L=new FileReader,O=v(L);return L.readAsArrayBuffer(E),O}function A(E){var L=new FileReader,O=v(L),P=/charset=([A-Za-z0-9_-]+)/.exec(E.type),R=P?P[1]:"utf-8";return L.readAsText(E,R),O}function S(E){for(var L=new Uint8Array(E),O=new Array(L.length),P=0;P-1?L:E}function V(E,L){if(!(this instanceof V))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');L=L||{};var O=L.body;if(E instanceof V){if(E.bodyUsed)throw new TypeError("Already read");this.url=E.url,this.credentials=E.credentials,L.headers||(this.headers=new w(E.headers)),this.method=E.method,this.mode=E.mode,this.signal=E.signal,!O&&E._bodyInit!=null&&(O=E._bodyInit,E.bodyUsed=!0)}else this.url=String(E);if(this.credentials=L.credentials||this.credentials||"same-origin",(L.headers||!this.headers)&&(this.headers=new w(L.headers)),this.method=B(L.method||this.method||"GET"),this.mode=L.mode||this.mode||null,this.signal=L.signal||this.signal||function(){if("AbortController"in o){var M=new AbortController;return M.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&O)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(O),(this.method==="GET"||this.method==="HEAD")&&(L.cache==="no-store"||L.cache==="no-cache")){var P=/([?&])_=[^&]*/;if(P.test(this.url))this.url=this.url.replace(P,"$1_="+new Date().getTime());else{var R=/\?/;this.url+=(R.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}V.prototype.clone=function(){return new V(this,{body:this._bodyInit})};function se(E){var L=new FormData;return E.trim().split("&").forEach(function(O){if(O){var P=O.split("="),R=P.shift().replace(/\+/g," "),M=P.join("=").replace(/\+/g," ");L.append(decodeURIComponent(R),decodeURIComponent(M))}}),L}function Y(E){var L=new w,O=E.replace(/\r?\n[\t ]+/g," ");return O.split("\r").map(function(P){return P.indexOf(` +`)===0?P.substr(1,P.length):P}).forEach(function(P){var R=P.split(":"),M=R.shift().trim();if(M){var D=R.join(":").trim();try{L.append(M,D)}catch($){console.warn("Response "+$.message)}}}),L}F.call(V.prototype);function N(E,L){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(L||(L={}),this.type="default",this.status=L.status===void 0?200:L.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=L.statusText===void 0?"":""+L.statusText,this.headers=new w(L.headers),this.url=L.url||"",this._initBody(E)}F.call(N.prototype),N.prototype.clone=function(){return new N(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new w(this.headers),url:this.url})},N.error=function(){var E=new N(null,{status:200,statusText:""});return E.ok=!1,E.status=0,E.type="error",E};var k=[301,302,303,307,308];N.redirect=function(E,L){if(k.indexOf(L)===-1)throw new RangeError("Invalid status code");return new N(null,{status:L,headers:{location:E}})},s.DOMException=o.DOMException;try{new s.DOMException}catch{s.DOMException=function(L,O){this.message=L,this.name=O;var P=Error(L);this.stack=P.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function x(E,L){return new Promise(function(O,P){var R=new V(E,L);if(R.signal&&R.signal.aborted)return P(new s.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function D(){M.abort()}M.onload=function(){var le={statusText:M.statusText,headers:Y(M.getAllResponseHeaders()||"")};R.url.indexOf("file://")===0&&(M.status<200||M.status>599)?le.status=200:le.status=M.status,le.url="responseURL"in M?M.responseURL:le.headers.get("X-Request-URL");var H="response"in M?M.response:M.responseText;setTimeout(function(){O(new N(H,le))},0)},M.onerror=function(){setTimeout(function(){P(new TypeError("Network request failed"))},0)},M.ontimeout=function(){setTimeout(function(){P(new TypeError("Network request timed out"))},0)},M.onabort=function(){setTimeout(function(){P(new s.DOMException("Aborted","AbortError"))},0)};function $(le){try{return le===""&&o.location.href?o.location.href:le}catch{return le}}if(M.open(R.method,$(R.url),!0),R.credentials==="include"?M.withCredentials=!0:R.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&(l.blob?M.responseType="blob":l.arrayBuffer&&(M.responseType="arraybuffer")),L&&typeof L.headers=="object"&&!(L.headers instanceof w||o.Headers&&L.headers instanceof o.Headers)){var X=[];Object.getOwnPropertyNames(L.headers).forEach(function(le){X.push(h(le)),M.setRequestHeader(le,g(L.headers[le]))}),R.headers.forEach(function(le,H){X.indexOf(H)===-1&&M.setRequestHeader(H,le)})}else R.headers.forEach(function(le,H){M.setRequestHeader(H,le)});R.signal&&(R.signal.addEventListener("abort",D),M.onreadystatechange=function(){M.readyState===4&&R.signal.removeEventListener("abort",D)}),M.send(typeof R._bodyInit>"u"?null:R._bodyInit)})}return x.polyfill=!0,o.fetch||(o.fetch=x,o.Headers=w,o.Request=V,o.Response=N),s.Headers=w,s.Request=V,s.Response=N,s.fetch=x,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=r.fetch?r:n;e=i.fetch,e.default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e})(kT,kT.exports);var bKe=kT.exports;const EH=No(bKe);var xKe=Object.defineProperty,EKe=Object.defineProperties,_Ke=Object.getOwnPropertyDescriptors,_H=Object.getOwnPropertySymbols,CKe=Object.prototype.hasOwnProperty,SKe=Object.prototype.propertyIsEnumerable,CH=(t,e,r)=>e in t?xKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,SH=(t,e)=>{for(var r in e||(e={}))CKe.call(e,r)&&CH(t,r,e[r]);if(_H)for(var r of _H(e))SKe.call(e,r)&&CH(t,r,e[r]);return t},AH=(t,e)=>EKe(t,_Ke(e));const AKe={Accept:"application/json","Content-Type":"application/json"},IKe="POST",IH={headers:AKe,method:IKe},MH=10;let Tc=class{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new ys.EventEmitter,this.isAvailable=!1,this.registering=!1,!WW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Kd(e),n=await(await EH(this.url,AH(SH({},IH),{body:r}))).json();this.onPayload({data:n})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!WW(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((n,i)=>{this.events.once("register_error",a=>{this.resetMaxListeners(),i(a)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return i(new Error("HTTP connection is missing or invalid"));n()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Kd({id:1,jsonrpc:"2.0",method:"test",params:[]});await EH(e,AH(SH({},IH),{body:r}))}this.onOpen()}catch(r){const n=this.parseError(r);throw this.events.emit("register_error",n),this.onClose(),n}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?l1(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const n=this.parseError(r),i=n.message||n.toString(),a=u7(e,i);this.events.emit("payload",a)}parseError(e,r=this.url){return Fie(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>MH&&this.events.setMaxListeners(MH)}};const TH="error",MKe="wss://relay.walletconnect.org",TKe="wc",kKe="universal_provider",kH=`${TKe}@2:${kKe}:`,dae="https://rpc.walletconnect.org/v1/",$p="generic",NKe=`${dae}bundler`,kl={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var LKe=Object.defineProperty,jKe=Object.defineProperties,$Ke=Object.getOwnPropertyDescriptors,NH=Object.getOwnPropertySymbols,PKe=Object.prototype.hasOwnProperty,RKe=Object.prototype.propertyIsEnumerable,LH=(t,e,r)=>e in t?LKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,B4=(t,e)=>{for(var r in e||(e={}))PKe.call(e,r)&&LH(t,r,e[r]);if(NH)for(var r of NH(e))RKe.call(e,r)&&LH(t,r,e[r]);return t},DKe=(t,e)=>jKe(t,$Ke(e));function ko(t,e,r){var n;const i=vg(t);return((n=e.rpcMap)==null?void 0:n[i.reference])||`${dae}?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function D1(t){return t.includes(":")?t.split(":")[1]:t}function fae(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function OKe(t,e){const r=Object.keys(e.namespaces).filter(i=>i.includes(t));if(!r.length)return[];const n=[];return r.forEach(i=>{const a=e.namespaces[i].accounts;n.push(...a)}),n}function OS(t={},e={}){const r=jH(t),n=jH(e);return vKe.merge(r,n)}function jH(t){var e,r,n,i;const a={};if(!nw(t))return a;for(const[s,o]of Object.entries(t)){const l=jj(s)?[s]:o.chains,c=o.methods||[],u=o.events||[],f=o.rpcMap||{},h=yy(s);a[h]=DKe(B4(B4({},a[h]),o),{chains:z6(l,(e=a[h])==null?void 0:e.chains),methods:z6(c,(r=a[h])==null?void 0:r.methods),events:z6(u,(n=a[h])==null?void 0:n.events),rpcMap:B4(B4({},f),(i=a[h])==null?void 0:i.rpcMap)})}return a}function FKe(t){return t.includes(":")?t.split(":")[2]:t}function $H(t){const e={};for(const[r,n]of Object.entries(t)){const i=n.methods||[],a=n.events||[],s=n.accounts||[],o=jj(r)?[r]:n.chains?n.chains:fae(n.accounts);e[r]={chains:o,methods:i,events:a,accounts:s}}return e}function FS(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const hae={},Xr=t=>hae[t],US=(t,e)=>{hae[t]=e};let UKe=class{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=D1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}};var BKe=Object.defineProperty,zKe=Object.defineProperties,WKe=Object.getOwnPropertyDescriptors,PH=Object.getOwnPropertySymbols,HKe=Object.prototype.hasOwnProperty,GKe=Object.prototype.propertyIsEnumerable,RH=(t,e,r)=>e in t?BKe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,DH=(t,e)=>{for(var r in e||(e={}))HKe.call(e,r)&&RH(t,r,e[r]);if(PH)for(var r of PH(e))GKe.call(e,r)&&RH(t,r,e[r]);return t},OH=(t,e)=>zKe(t,WKe(e));class qKe{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e);case"wallet_getCallsStatus":return await this.getCallStatus(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const n=r||ko(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=parseInt(D1(r));e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,n;let i=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";i=i.startsWith("0x")?i:`0x${i}`;const a=parseInt(i,16);if(this.isChainApproved(a))this.setDefaultChain(`${a}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:i}]},chainId:(n=this.namespace.chains)==null?void 0:n[0]}),this.setDefaultChain(`${a}`);else throw new Error(`Failed to switch to chain 'eip155:${a}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,n,i;const a=(n=(r=e.request)==null?void 0:r.params)==null?void 0:n[0];if(!a)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const s=this.client.session.get(e.topic),o=((i=s==null?void 0:s.sessionProperties)==null?void 0:i.capabilities)||{};if(o!=null&&o[a])return o==null?void 0:o[a];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:OH(DH({},s.sessionProperties||{}),{capabilities:OH(DH({},o||{}),{[a]:l})})})}catch(c){console.warn("Failed to update session with capabilities",c)}return l}async getCallStatus(e){var r,n;const i=this.client.session.get(e.topic),a=(r=i.sessionProperties)==null?void 0:r.bundler_name;if(a){const o=this.getBundlerUrl(e.chainId,a);try{return await this.getUserOperationReceipt(o,e)}catch(l){console.warn("Failed to fetch call status from bundler",l,o)}}const s=(n=i.sessionProperties)==null?void 0:n.bundler_url;if(s)try{return await this.getUserOperationReceipt(s,e)}catch(o){console.warn("Failed to fetch call status from custom bundler",o,s)}if(this.namespace.methods.includes(e.request.method))return await this.client.request(e);throw new Error("Fetching call status not approved by the wallet.")}async getUserOperationReceipt(e,r){var n;const i=new URL(e),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Wf("eth_getUserOperationReceipt",[(n=r.request.params)==null?void 0:n[0]]))});if(!a.ok)throw new Error(`Failed to fetch user operation receipt - ${a.status}`);return await a.json()}getBundlerUrl(e,r){return`${NKe}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`}}class VKe{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=D1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}}let YKe=class{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=D1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}};class KKe{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const n=r||ko(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace,this.client.core.projectId);return typeof n>"u"?void 0:new Tl(new Tc(n,Xr("disableProviderPing")))}}let JKe=class{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const n=this.getCardanoRPCUrl(r),i=D1(r);e[i]=this.createHttpProvider(i,n)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||this.getCardanoRPCUrl(e);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}};class QKe{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=D1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}}let ZKe=class{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;const i=D1(r);e[i]=this.createHttpProvider(i,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}};class XKe{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ko(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var n;e[r]=this.createHttpProvider(r,(n=this.namespace.rpcMap)==null?void 0:n[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace);return typeof n>"u"?void 0:new Tl(new Tc(n,Xr("disableProviderPing")))}}class eJe{constructor(e){this.name="tezos",this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const n=r||ko(`${this.name}:${e}`,this.namespace);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,n)}this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{e[r]=this.createHttpProvider(r)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace);return typeof n>"u"?void 0:new Tl(new Tc(n))}}class tJe{constructor(e){this.name=$p,this.namespace=e.namespace,this.events=Xr("events"),this.client=Xr("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(kl.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const n={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(i=>{const a=vg(i);n[`${a.namespace}:${a.reference}`]=this.createHttpProvider(i)}),n}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const n=this.createHttpProvider(e,r);n&&(this.httpProviders[e]=n)}createHttpProvider(e,r){const n=r||ko(e,this.namespace,this.client.core.projectId);if(!n)throw new Error(`No RPC url provided for chainId: ${e}`);return new Tl(new Tc(n,Xr("disableProviderPing")))}}var rJe=Object.defineProperty,nJe=Object.defineProperties,iJe=Object.getOwnPropertyDescriptors,FH=Object.getOwnPropertySymbols,aJe=Object.prototype.hasOwnProperty,sJe=Object.prototype.propertyIsEnumerable,UH=(t,e,r)=>e in t?rJe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,z4=(t,e)=>{for(var r in e||(e={}))aJe.call(e,r)&&UH(t,r,e[r]);if(FH)for(var r of FH(e))sJe.call(e,r)&&UH(t,r,e[r]);return t},BS=(t,e)=>nJe(t,iJe(e));let oJe=class pae{constructor(e){this.events=new LL,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof(e==null?void 0:e.logger)<"u"&&typeof(e==null?void 0:e.logger)!="string"?e.logger:bv(l7({level:(e==null?void 0:e.logger)||TH})),this.disableProviderPing=(e==null?void 0:e.disableProviderPing)||!1}static async init(e){const r=new pae(e);return await r.initialize(),r}async request(e,r,n){const[i,a]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(i).request({request:z4({},e),chainId:`${i}:${a}`,topic:this.session.topic,expiry:n})}sendAsync(e,r,n,i){const a=new Date().getTime();this.request(e,n,i).then(s=>r(null,c7(a,s))).catch(s=>r(s,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:ln("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e,r){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:n,response:i}=await this.client.authenticate(e,r);n&&(this.uri=n,this.events.emit("display_uri",n));const a=await i();if(this.session=a.session,this.session){const s=$H(this.session.namespaces);this.namespaces=OS(this.namespaces,s),this.persist("namespaces",this.namespaces),this.onConnect()}return a}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:n,approval:i}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});n&&(this.uri=n,this.events.emit("display_uri",n)),await i().then(a=>{this.session=a;const s=$H(a.namespaces);this.namespaces=OS(this.namespaces,s),this.persist("namespaces",this.namespaces)}).catch(a=>{if(a.message!==cae)throw a;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[n,i]=this.validateChain(e),a=this.getProvider(n);a.name===$p?a.setDefaultChain(`${n}:${i}`,r):a.setDefaultChain(i,r)}catch(n){if(!/Please call connect/.test(n.message))throw n}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(Jd(r)){for(const n of r)e.deletePairings?this.client.core.expirer.set(n.topic,0):await this.client.core.relayer.subscriber.unsubscribe(n.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await wKe.init({core:this.providerOpts.core,logger:this.providerOpts.logger||TH,relayUrl:this.providerOpts.relayUrl||MKe,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>yy(r)))];US("client",this.client),US("events",this.events),US("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const n=OKe(r,this.session),i=fae(n),a=OS(this.namespaces,this.optionalNamespaces),s=BS(z4({},a[r]),{accounts:n,chains:i});switch(r){case"eip155":this.rpcProviders[r]=new qKe({namespace:s});break;case"algorand":this.rpcProviders[r]=new KKe({namespace:s});break;case"solana":this.rpcProviders[r]=new VKe({namespace:s});break;case"cosmos":this.rpcProviders[r]=new YKe({namespace:s});break;case"polkadot":this.rpcProviders[r]=new UKe({namespace:s});break;case"cip34":this.rpcProviders[r]=new JKe({namespace:s});break;case"elrond":this.rpcProviders[r]=new QKe({namespace:s});break;case"multiversx":this.rpcProviders[r]=new ZKe({namespace:s});break;case"near":this.rpcProviders[r]=new XKe({namespace:s});break;case"tezos":this.rpcProviders[r]=new eJe({namespace:s});break;default:this.rpcProviders[$p]?this.rpcProviders[$p].updateNamespace(s):this.rpcProviders[$p]=new tJe({namespace:s})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:n}=r;if(n.name==="accountsChanged"){const i=n.data;i&&Jd(i)&&this.events.emit("accountsChanged",i.map(FKe))}else if(n.name==="chainChanged"){const i=r.chainId,a=r.event.data,s=yy(i),o=FS(i)!==FS(a)?`${s}:${FS(a)}`:i;this.onChainChanged(o)}else this.events.emit(n.name,n.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var n;const{namespaces:i}=r,a=(n=this.client)==null?void 0:n.session.get(e);this.session=BS(z4({},a),{namespaces:i}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",BS(z4({},ln("USER_DISCONNECTED")),{data:e.topic}))}),this.on(kl.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[$p]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:n,sessionProperties:i}=e;r&&Object.keys(r).length&&(this.namespaces=r),n&&Object.keys(n).length&&(this.optionalNamespaces=n),this.sessionProperties=i,this.persist("namespaces",r),this.persist("optionalNamespaces",n)}validateChain(e){const[r,n]=(e==null?void 0:e.split(":"))||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,n];if(r&&!Object.keys(this.namespaces||{}).map(s=>yy(s)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&n)return[r,n];const i=yy(Object.keys(this.namespaces)[0]),a=this.rpcProviders[i].getDefaultChain();return[i,a]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[n,i]=this.validateChain(e);i&&(r||this.getProvider(n).setDefaultChain(i),this.namespaces[n]?this.namespaces[n].defaultChain=i:this.namespaces[`${n}:${i}`]?this.namespaces[`${n}:${i}`].defaultChain=i:this.namespaces[`${n}:${i}`]={defaultChain:i},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",i))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${kH}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${kH}/${e}`)}};const lJe=oJe,cJe="wc",uJe="ethereum_provider",dJe=`${cJe}@2:${uJe}:`,fJe="https://rpc.walletconnect.org/v1/",NT=["eth_sendTransaction","personal_sign"],gae=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],LT=["chainChanged","accountsChanged"],mae=["chainChanged","accountsChanged","message","disconnect","connect"];var hJe=Object.defineProperty,pJe=Object.defineProperties,gJe=Object.getOwnPropertyDescriptors,BH=Object.getOwnPropertySymbols,mJe=Object.prototype.hasOwnProperty,yJe=Object.prototype.propertyIsEnumerable,zH=(t,e,r)=>e in t?hJe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pp=(t,e)=>{for(var r in e||(e={}))mJe.call(e,r)&&zH(t,r,e[r]);if(BH)for(var r of BH(e))yJe.call(e,r)&&zH(t,r,e[r]);return t},zS=(t,e)=>pJe(t,gJe(e));function A8(t){return Number(t[0].split(":")[1])}function W4(t){return`0x${t.toString(16)}`}function wJe(t){const{chains:e,optionalChains:r,methods:n,optionalMethods:i,events:a,optionalEvents:s,rpcMap:o}=t;if(!Jd(e))throw new Error("Invalid chains");const l={chains:e,methods:n||NT,events:a||LT,rpcMap:Pp({},e.length?{[A8(e)]:o[A8(e)]}:{})},c=a==null?void 0:a.filter(g=>!LT.includes(g)),u=n==null?void 0:n.filter(g=>!NT.includes(g));if(!r&&!s&&!i&&!(c!=null&&c.length)&&!(u!=null&&u.length))return{required:e.length?l:void 0};const f=(c==null?void 0:c.length)&&(u==null?void 0:u.length)||!r,h={chains:[...new Set(f?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(i!=null&&i.length?i:gae))],events:[...new Set(l.events.concat(s!=null&&s.length?s:mae))],rpcMap:o};return{required:e.length?l:void 0,optional:r.length?h:void 0}}let vJe=class yae{constructor(){this.events=new ys.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=dJe,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new yae;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,n){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),n)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:n}=wJe(this.rpc);try{const i=await new Promise(async(s,o)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(c=>{!c.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),o(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(zS(Pp({namespaces:Pp({},r&&{[this.namespace]:r})},n&&{optionalNamespaces:{[this.namespace]:n}}),{pairingTopic:e==null?void 0:e.pairingTopic})).then(c=>{s(c)}).catch(c=>{o(new Error(c.message))})});if(!i)return;const a=aW(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:W4(this.chainId)})}catch(i){throw this.signer.logger.error(i),i}finally{this.modal&&this.modal.closeModal()}}async authenticate(e,r){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e==null?void 0:e.chains});try{const n=await new Promise(async(a,s)=>{var o;this.rpc.showQrModal&&((o=this.modal)==null||o.subscribeModal(l=>{!l.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(zS(Pp({},e),{chains:this.rpc.chains}),r).then(l=>{a(l)}).catch(l=>{s(new Error(l.message))})}),i=n.session;if(i){const a=aW(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:a),this.setAccounts(a),this.events.emit("connect",{chainId:W4(this.chainId)})}return n}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:n}=r;n.name==="accountsChanged"?(this.accounts=this.parseAccounts(n.data),this.events.emit("accountsChanged",this.accounts)):n.name==="chainChanged"?this.setChainId(this.formatChainId(n.data)):this.events.emit(n.name,n.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",W4(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",zS(Pp({},ln("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,n;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(n=this.modal)==null||n.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(n=>this.isCompatibleChainId(n)).map(n=>this.parseChainId(n));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",W4(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,n,i]=e.split(":");return{chainId:`${r}:${n}`,address:i}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,n;const i=(r=e==null?void 0:e.chains)!=null?r:[],a=(n=e==null?void 0:e.optionalChains)!=null?n:[],s=i.concat(a);if(!s.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const o=i.length?(e==null?void 0:e.methods)||NT:[],l=i.length?(e==null?void 0:e.events)||LT:[],c=(e==null?void 0:e.optionalMethods)||[],u=(e==null?void 0:e.optionalEvents)||[],f=(e==null?void 0:e.rpcMap)||this.buildRpcMap(s,e.projectId),h=(e==null?void 0:e.qrModalOptions)||void 0;return{chains:i==null?void 0:i.map(g=>this.formatChainId(g)),optionalChains:a.map(g=>this.formatChainId(g)),methods:o,events:l,optionalMethods:c,optionalEvents:u,rpcMap:f,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:h,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const n={};return e.forEach(i=>{n[i]=this.getRpcUrl(i,r)}),n}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?A8(this.rpc.chains):A8(this.rpc.optionalChains),this.signer=await lJe.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled,logger:e.logger}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:n}=await qs(()=>import("./index-PHYEp1d6.js").then(i=>i.i),[]);r=n}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(Pp({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(n){throw this.signer.logger.error(n),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:n,rpcMap:i}=e;r&&Jd(r)&&(this.rpc.chains=r.map(a=>this.formatChainId(a)),r.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)})),n&&Jd(n)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=n==null?void 0:n.map(a=>this.formatChainId(a)),n.forEach(a=>{this.rpc.rpcMap[a]=(i==null?void 0:i[a])||this.getRpcUrl(a)}))}getRpcUrl(e,r){var n;return((n=this.rpc.rpcMap)==null?void 0:n[e])||`${fJe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r==null?void 0:r.accounts),this.setAccounts(r==null?void 0:r.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}};const bJe=vJe;let bg=class extends Rm{async initialize(){var n,i,a,s;let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if((i=(n=this.walletProvider)==null?void 0:n.session)!=null&&i.peer.metadata.url){let o=UC((s=(a=this.walletProvider)==null?void 0:a.session)==null?void 0:s.peer.metadata.url);this.walletEntry=o==null?void 0:o.entry,this.walletClientType=(o==null?void 0:o.walletClientType)||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:r}=await qs(()=>import("./index-PHYEp1d6.js").then(o=>o.i),[]);this.modal=new r({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(o=>{var l;o.open||(l=this.walletProvider)!=null&&l.session||!this.onQrModalClosed||this.onQrModalClosed()})}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){var e;return!!((e=this.walletProvider)!=null&&e.connected)}get walletBranding(){var r,n,i,a,s,o,l;if(this.walletClientType==="metamask")return{name:"MetaMask",icon:ZDe,id:"io.metamask"};let e=(i=(n=(r=this.walletProvider)==null?void 0:r.session)==null?void 0:n.peer.metadata.icons)==null?void 0:i[0];return{name:qMe(((s=(a=this.walletProvider)==null?void 0:a.session)==null?void 0:s.peer.metadata.name)||"")||"WalletConnect",icon:typeof e=="string"?e:iOe,id:((l=(o=this.walletProvider)==null?void 0:o.session)==null?void 0:l.peer.metadata.name.toLowerCase())||"wallet_connect_v2"}}async resetConnection(e){var r;this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,(r=this.walletEntry)!=null&&r.isWalletEntryOverriden||(this.walletEntry=TM[e]),this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,XMe(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,r)=>{this.onQrModalClosed=()=>{r(new Are)},(async()=>{var a,s,o,l,c;let n="",i=await Promise.race([(a=this.walletProvider)==null?void 0:a.enable(),this.proxyProvider.walletTimeout()]);if(i!=null&&i.length&&(n=i[0]),!n||n==="")throw new Pn("Unable to retrieve address");if((o=(s=this.walletProvider)==null?void 0:s.session)!=null&&o.peer.metadata.url){let u=UC((c=(l=this.walletProvider)==null?void 0:l.session)==null?void 0:c.peer.metadata.url);this.walletEntry=u==null?void 0:u.entry,this.walletClientType=(u==null?void 0:u.walletClientType)||"unknown",this.proxyProvider.rpcTimeoutDuration=YL(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(i),e()})().catch(n=>{r(n?T1(n):new Pn("Unknown error during connection"))}).finally(()=>{var n;return(n=this.modal)==null?void 0:n.closeModal()})})}disconnect(){var e;(e=this.walletProvider)==null||e.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let a of this.chains){let s=YMe(a.id,this.chains,this.rpcConfig,this.privyAppId);s&&(e[a.id]=s)}let r=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],n=this.chains.map(a=>a.id),i=await bJe.init({projectId:this.walletConnectCloudProjectId,chains:r,optionalChains:n,optionalEvents:mae,optionalMethods:gae,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return i.on("display_uri",a=>{var s,o;if(i.signer.abortPairingAttempt(),this.walletEntry){let{redirect:l,href:c}=QMe(a,this.walletEntry);eTe({href:c,name:this.walletEntry.displayName}),this.redirectUri=l;let u=ZMe(a,this.walletEntry);u!=null&&u.redirect&&(this.fallbackUniversalRedirectUri=u.redirect),ya&&Lee(l,"_self"),(s=this.showPrivyQrModal)==null||s.call(this,{native:l,universal:this.fallbackUniversalRedirectUri})}else(o=this.modal)==null||o.openModal({uri:a,chains:[this.defaultChain.id]})}),i.on("connect",()=>{var a,s,o;if((a=this.modal)==null||a.closeModal(),(s=i.session)==null?void 0:s.peer.metadata.url){let l=UC((o=i.session)==null?void 0:o.peer.metadata.url);this.walletEntry=l==null?void 0:l.entry,this.walletClientType=(l==null?void 0:l.walletClientType)||"unknown"}}),i}async enableProvider(){var e,r;return(e=this.walletProvider)!=null&&e.connected?Promise.resolve(this.walletProvider.accounts):await((r=this.walletProvider)==null?void 0:r.enable())}setWalletEntry(e,r){this.walletEntry=e,this.showPrivyQrModal=r}constructor(e,r,n,i,a,s,o,l){super(l||"unknown",n,i,r),this.connectorType="wallet_connect_v2",this.privyAppId=s,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=r,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new rs(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=TM[l],this.walletClientType=l)}};var xJe=(t,e)=>{let r=_.useRef(()=>{});_.useEffect(()=>{r.current=t}),_.useEffect(()=>{if(e!==null){let n=setInterval(()=>r.current(),e||0);return()=>clearInterval(n)}},[e])};function EJe(){let[t,e]=_.useState(!1),r=_.useCallback(()=>{document.hidden&&e(!0)},[]);return _.useEffect(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:t,reset:()=>e(!1)}}const wae=t=>(t==null?void 0:t.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER?Pf.ERROR_USER_EXISTS:t instanceof hc&&!t.details.default?t.details:t instanceof Sre?Pf.ERROR_TIMED_OUT:t instanceof Are?Pf.ERROR_USER_REJECTED_CONNECTION:(t==null?void 0:t.privyErrorCode)===Ae.CANNOT_LINK_MORE_OF_TYPE?Pf.ERROR_USER_LIMIT_REACHED:Pf.ERROR_WALLET_CONNECTION,_Je=()=>{var be,Ce,Fe,Ue,Ke,lt,Ee,He,qe,Ie,Ne;let t,[e,r]=_.useState(!1),[n,i]=_.useState(!1),[a,s]=_.useState(void 0),{authenticated:o,logout:l}=$r(),{app:c,navigate:u,navigateBack:f,lastScreen:h,currentScreen:g,setModalData:m,data:w}=wt(),{getAuthFlow:C,walletConnectionStatus:v,closePrivyModal:b,initLoginWithWallet:A,loginWithWallet:S,updateWallets:j,createAnalyticsEvent:F}=_t(),{walletConnectors:I}=$r(),[B,V]=_.useState(0),{user:se}=$r(),[Y]=_.useState((se==null?void 0:se.linkedAccounts.length)||0),[N,k]=_.useState(""),[x,E]=_.useState(""),[L,O]=_.useState(!1),{hasTabbedAway:P}=EJe(),{enabled:R,token:M}=Ro(),D=ya&&((be=v==null?void 0:v.connector)==null?void 0:be.connectorType)==="wallet_connect_v2"||ya&&((Ce=v==null?void 0:v.connector)==null?void 0:Ce.connectorType)==="coinbase_wallet"||ya&&((Fe=v==null?void 0:v.connector)==null?void 0:Fe.connectorType)==="injected"&&((Ue=v==null?void 0:v.connector)==null?void 0:Ue.walletClientType)==="phantom",$=(v==null?void 0:v.status)==="connected",X=(v==null?void 0:v.status)==="switching_to_supported_chain";_.useEffect(()=>{var K;let $e=C(),je=$e instanceof Y5||$e instanceof PM?$e:void 0;$&&!je&&(!R||M||o?A(v.connectedWallet,M,(K=w==null?void 0:w.login)==null?void 0:K.disableSignup).then(()=>{O(!0)}):(m({captchaModalData:{callback:U=>{var W;return A(v.connectedWallet,U,(W=w==null?void 0:w.login)==null?void 0:W.disableSignup).then(()=>{O(!0)})},userIntentRequired:!1,onSuccessNavigateTo:ye.AWAITING_CONNECTION,onErrorNavigateTo:ye.ERROR_SCREEN}}),u(ye.CAPTCHA_SCREEN,!1))),je&&D&&$&&!je.preparedMessage?je.buildMessage():je&&!D&&$&&(n||(async()=>{var U,W;i(!0),s(void 0);try{((U=v==null?void 0:v.connector)==null?void 0:U.connectorType)==="wallet_connect_v2"&&((W=v==null?void 0:v.connector)==null?void 0:W.walletClientType)==="metamask"&&await Aee(2500),await H()}catch(ie){console.warn("Auto-prompted signature failed",ie)}finally{i(!1)}})())},[B,$,L]),_.useEffect(()=>{var $e;if(se&&e){let je=Dn-500;if(c!=null&&c.legal.requireUsersAcceptTerms&&!se.hasAcceptedTerms){let U=setTimeout(()=>{u(ye.AFFIRMATIVE_CONSENT_SCREEN)},je);return()=>clearTimeout(U)}if(Hd(se,($e=c==null?void 0:c.embeddedWallets)==null?void 0:$e.createOnLogin)){let U=setTimeout(()=>{m({createWallet:{onSuccess:()=>{},onFailure:W=>{console.error(W),F({eventName:"embedded_wallet_creation_failure_logout",payload:{error:W,screen:"ConnectionStatusScreen"}}),l()},callAuthOnSuccessOnClose:!0}}),u(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},je);return()=>clearTimeout(U)}j();let K=setTimeout(()=>b({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn);return()=>clearTimeout(K)}},[se,e]);let le=$e=>{var je,K,U,W,ie,pe,we,he,Re,Je,et,it,ut,pt;if(($e==null?void 0:$e.privyErrorCode)!==Ae.ALLOWLIST_REJECTED){if(($e==null?void 0:$e.privyErrorCode)===Ae.USER_LIMIT_REACHED)return console.error(new Vw($e).toString()),void u(ye.USER_LIMIT_REACHED_SCREEN);if(($e==null?void 0:$e.privyErrorCode)!==Ae.USER_DOES_NOT_EXIST)return($e==null?void 0:$e.privyErrorCode)===Ae.ACCOUNT_TRANSFER_REQUIRED&&((K=(je=$e.data)==null?void 0:je.data)!=null&&K.nonce)?(m({accountTransfer:{nonce:(W=(U=$e.data)==null?void 0:U.data)==null?void 0:W.nonce,account:(ie=C())==null?void 0:ie.meta.address,displayName:(he=(we=(pe=$e.data)==null?void 0:pe.data)==null?void 0:we.account)==null?void 0:he.displayName,externalWalletMetadata:{walletClientType:(Re=C())==null?void 0:Re.meta.walletClientType,chainId:(Je=C())==null?void 0:Je.meta.chainId,connectorType:(et=C())==null?void 0:et.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:(pt=(ut=(it=$e.data)==null?void 0:it.data)==null?void 0:ut.otherUser)==null?void 0:pt.embeddedWalletAddress}}),void u(ye.LINK_CONFLICT_SCREEN)):void s(wae($e));u(ye.ACCOUNT_NOT_FOUND_SCREEN)}else u(ye.ALLOWLIST_REJECTION_SCREEN)};async function H(){try{await S(),r(!0)}catch($e){le($e)}finally{i(!1)}}_.useEffect(()=>{v!=null&&v.connectError&&le(v==null?void 0:v.connectError)},[v]),xJe(()=>{let $e=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof bg?v.connector.redirectUri:void 0;$e&&k($e);let je=ee==="wallet_connect_v2"&&(v==null?void 0:v.connector)instanceof bg?v.connector.fallbackUniversalRedirectUri:void 0;je&&E(je)},(v==null?void 0:v.connector)instanceof bg&&!N?500:null);let ee=((Ke=v==null?void 0:v.connector)==null?void 0:Ke.connectorType)||"injected",J=((lt=v==null?void 0:v.connector)==null?void 0:lt.walletClientType)||"unknown",te=((Ee=vu[J])==null?void 0:Ee.displayName)||((He=v==null?void 0:v.connector)==null?void 0:He.walletBranding.name)||"Browser Extension",re=((qe=vu[J])==null?void 0:qe.logo)||((Ie=v==null?void 0:v.connector)==null?void 0:Ie.walletBranding.icon)||($e=>d.jsx(mj,{...$e})),z=te==="Browser Extension"?te.toLowerCase():te;t=e?`Successfully connected with ${z}`:a?a.message:X?"Switching networks":$?n&&D?"Signing":"Sign to verify":`Waiting for ${z}`;let G="Don’t see your wallet? Check your other browser windows.";e?G=Y===((se==null?void 0:se.linkedAccounts.length)||0)?"Wallet was already linked.":"You’re good to go!":B>=2&&a?G="Unable to connect wallet":a?G=a.detail:X?G="Switch your wallet to the requested network.":$&&D?G="Sign the message in your wallet to verify it belongs to you.":J==="metamask"&&ya?G="Click continue to open and connect MetaMask.":J==="metamask"?G="For the best experience, connect only one wallet at a time.":ee==="wallet_connect"?G="Open your mobile wallet app to continue":ee!=="coinbase_wallet"||Cee()||(G=Tz(se)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let Q=(Ne=I==null?void 0:I.walletConnectors)==null?void 0:Ne.find($e=>$e.walletClientType==="coinbase_wallet"),me=J==="coinbase_wallet"&&(Tz(se)||a===Pf.ERROR_USER_EXISTS);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:h&&g!==h?f:void 0}),d.jsxs(CJe,{children:[d.jsx(vae,{walletLogo:re,success:e,fail:!!a}),d.jsxs(To,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:G}),$||!N||P?null:d.jsxs("p",{children:["Still here?"," ",d.jsx("a",{href:N,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),x&&d.jsxs(d.Fragment,{children:[" ","or"," ",d.jsx("a",{href:x,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),me?d.jsx(Ot,{onClick:()=>Q&&(Q==null?void 0:Q.disconnect()),disabled:e,children:"Use a different wallet"}):a==Pf.ERROR_USER_EXISTS&&g!==h?d.jsx(Ot,{onClick:f,children:"Use a different wallet"}):$&&!e&&D?d.jsx(Ot,{onClick:()=>{i(!0),H()},disabled:n,children:n?"Signing":"Sign with your wallet"}):!e&&(a!=null&&a.retryable)&&B<2?d.jsx(Ot,{onClick:()=>{V(B+1),s(void 0),$?(i(!0),H()):v==null||v.connectRetry()},disabled:!e&&(!(a!=null&&a.retryable)||B>=2),children:"Retry"}):e||a?null:d.jsx(Ot,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),d.jsx(kr,{})]})};let CJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-afad057-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),SJe=fe.div.withConfig({displayName:"StackedContainer",componentId:"sc-afad057-1"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);const vae=t=>{let e=t.walletLogo;return d.jsx(d.Fragment,{children:d.jsx(SJe,{children:d.jsxs("div",{children:[d.jsx(Ec,{success:t.success,fail:t.fail}),typeof e=="string"?d.jsx("span",{style:{background:`url('${e}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):d.jsx(e,{style:{width:"38px",height:"38px"}})]})})})},AJe=()=>{var j,F,I,B,V,se;let t,{navigateBack:e,navigate:r,lastScreen:n,currentScreen:i,data:a,setModalData:s}=wt(),{walletConnectionStatus:o,closePrivyModal:l}=_t(),[c,u]=_.useState(void 0),[f,h]=_.useState(0),g=(o==null?void 0:o.status)==="connected",m=(o==null?void 0:o.status)==="switching_to_supported_chain";_.useEffect(()=>{var Y,N;if(g){let k;if((Y=a==null?void 0:a.externalConnectWallet)!=null&&Y.onCompleteNavigateTo){let x=a.externalConnectWallet.onCompleteNavigateTo,E=(N=o.connectedWallet)==null?void 0:N.address;k=setTimeout(()=>{var L;a.funding&&s({...a,funding:{...a.funding,connectedWalletAddress:E}}),r(x({walletChainType:(L=o.connector)==null?void 0:L.chainType}))},Dn)}else k=setTimeout(l,Dn);return()=>clearTimeout(k)}},[g]),_.useEffect(()=>{var Y;o!=null&&o.connectError&&(Y=o==null?void 0:o.connectError,u(wae(Y)))},[o]);let w=((j=o==null?void 0:o.connector)==null?void 0:j.connectorType)||"injected",C=((F=o==null?void 0:o.connector)==null?void 0:F.walletClientType)||"unknown",v=((I=vu[C])==null?void 0:I.displayName)||((B=o==null?void 0:o.connector)==null?void 0:B.walletBranding.name)||"Browser Extension",b=((V=vu[C])==null?void 0:V.logo)||((se=o==null?void 0:o.connector)==null?void 0:se.walletBranding.icon)||(Y=>d.jsx(mj,{...Y})),A=v==="Browser Extension"?v.toLowerCase():v;t=g?`Successfully connected with ${A}`:c?c.message:m?"Switching networks":`Waiting for ${A}`;let S="Don’t see your wallet? Check your other browser windows.";return g?S="You’re good to go!":f>=2&&c?S="Unable to connect wallet":c?S=c.detail:m?S="Switch your wallet to the requested network.":C==="metamask"&&ya?S="Click to continue to open and connect MetaMask.":C==="metamask"?S="For the best experience, connect only one wallet at a time.":w==="wallet_connect_v2"?S="Open your mobile wallet app to continue":w==="coinbase_wallet"&&(S="Open the Coinbase app on your phone to continue."),d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:i===n?void 0:e}),d.jsxs(IJe,{children:[d.jsx(vae,{walletLogo:b,success:g,fail:!!c}),d.jsxs(To,{children:[d.jsx("h3",{children:t}),d.jsx("p",{children:S})]}),c==Pf.ERROR_USER_EXISTS?d.jsx(Ot,{onClick:e,children:"Use a different wallet"}):!g&&(c!=null&&c.retryable)&&f<2?d.jsx(Ot,{onClick:()=>{h(f+1),u(void 0),o==null||o.connectRetry()},disabled:!g&&(!(c!=null&&c.retryable)||f>=2),children:"Retry"}):!g&&c&&f>=2?d.jsx(Ot,{onClick:e,children:"Use a different wallet"}):null]}),d.jsx(kr,{})]})};let IJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1346f57-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);const bae=({name:t,logoUrl:e,size:r="38px"})=>typeof e=="string"?d.jsx("img",{src:e,alt:`${t??"Provider app"} logo`,style:{width:r,height:r,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):d.jsx("span",{});function MJe(t){let{logout:e}=_.useContext(Om);return aj("logout",t),{logout:e}}const TJe=()=>{let t=Ai(),{data:e,navigate:r,setModalData:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),{crossAppAuthFlow:a,updateWallets:s,closePrivyModal:o,createAnalyticsEvent:l}=_t(),{logout:c}=MJe(),[u,f]=_.useState({}),h=e==null?void 0:e.crossAppAuth,g={id:h.appId,name:h.name,logoUrl:h.logoUrl},m=new _e(`There was an issue connecting your ${g.name} account. Please try again.`),w=new is(async A=>{if(h.popup)try{let S=await a({appId:A,popup:h.popup,action:h.action});f({data:S})}catch(S){S instanceof _e?f({error:S}):(S instanceof sl&&h.popup&&h.popup.close(),f({error:m}))}else f({error:m})}),C=()=>{u.data&&(s(),h.onSuccess(u.data),o({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h.onError(u.error??new _e("User canceled flow")),o({shouldCallAuthOnSuccess:!1,isSuccess:!1})};i.current=C,_.useEffect(()=>{g.id.length&&w.execute(g.id)},[g.id]),_.useEffect(()=>{var j;if(!u.data)return;let A=u.data;if(t.legal.requireUsersAcceptTerms&&!A.hasAcceptedTerms){let F=setTimeout(()=>{r(ye.AFFIRMATIVE_CONSENT_SCREEN)},Dn);return()=>clearTimeout(F)}if(Hd(A,(j=t.embeddedWallets)==null?void 0:j.createOnLogin)){let F=setTimeout(()=>{n({createWallet:{onSuccess:()=>{},onFailure:I=>{console.error(I),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:I,provider:`privy:${g.id}`,screen:"CrossAppAuthScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),r(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Dn);return()=>clearTimeout(F)}let S=setTimeout(C,Dn);return()=>clearTimeout(S)},[u.data]);let{title:v,subtitle:b}=_.useMemo(()=>u.data?{title:`Successfully connected with ${g.name}`,subtitle:"You're good to go!"}:u.error?{title:"Authentication failed",subtitle:u.error.message}:{title:`Connecting to ${g.name}`,subtitle:`Please check the pop-up from ${g.name} to continue`},[u,g.name]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:C}),d.jsx(tn,{}),d.jsxs(kJe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(Ec,{success:!!u.data,fail:!!u.error}),d.jsx(bae,{name:g.name,logoUrl:g.logoUrl})]})}),d.jsxs(To,{children:[d.jsx("h3",{children:v}),d.jsx("p",{children:b})]})]}),d.jsx(an,{}),d.jsx(kr,{})]})};let kJe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-2ae0702a-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]);function NJe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const kc=_.forwardRef(NJe);function LJe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const jJe=_.forwardRef(LJe),$Je=fe.div.withConfig({displayName:"Column",componentId:"sc-cfc52180-0"})(["display:flex;flex-direction:column;"]),d1=fe.span.withConfig({displayName:"ErrorMessage",componentId:"sc-fcb8cd50-0"})(["text-align:left;font-size:0.75rem;font-weight:500;line-height:1.125rem;color:var(--privy-color-error);"]),PJe=fe.span.withConfig({displayName:"LabelXs",componentId:"sc-4c43f9fd-0"})(["color:var(--privy-color-foreground-3);font-size:0.75rem;font-weight:500;line-height:1.125rem;"]),xae=la(["&&{border-width:1px;padding:0.5rem 1rem;}width:100%;text-align:left;border:solid 1px var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);display:flex;justify-content:space-between;align-items:center;",""],t=>t.$state==="error"?"border-color: var(--privy-color-error);":""),Fj=fe.div.withConfig({displayName:"Box",componentId:"sc-1660059c-0"})(["",""],xae),p7=({errMsg:t,balance:e,address:r,isLoading:n,className:i,title:a,isPulsing:s,showIcon:o,statusColor:l="green"})=>{let c;return c=l||(t?"red":"green"),d.jsxs(d.Fragment,{children:[d.jsxs(Fj,{className:i,$state:t?"error":void 0,children:[d.jsxs($Je,{children:[d.jsx(PJe,{children:a||"Pay with"}),d.jsx(bo,{address:r,showCopyIcon:o||!!t})]}),e!==void 0&&d.jsx(Sc,{isLoading:n,isPulsing:s,color:c,children:e})]}),t&&d.jsx(d1,{style:{marginTop:"0.25rem"},children:t})]})},RJe=()=>{let{app:t,data:e}=wt(),{closePrivyModal:r}=_t(),[n,i]=_.useState(!1),[a,s]=_.useState(),{address:o,onDelegate:l,onSuccess:c,onError:u}=e.delegatedActions.consent,f=async()=>{n?c():u(a??new _e("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return _.useEffect(()=>{if(!n&&!a)return;let h=setTimeout(f,IL);return()=>clearTimeout(h)},[n,a]),d.jsxs(d.Fragment,n||a?{children:[d.jsx(ft,{onClose:f}),d.jsx(tn,{}),d.jsxs(fj,{children:[a?d.jsx(Fx,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(kc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(pj,{height:20}),d.jsx(zn,{title:a?"Something went wrong":"Success!",description:a?"Please try again.":`You’ve successfully granted delegated action permissions to ${t.name}.`})]}),d.jsx(an,{}),d.jsx(Qt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:f}),d.jsx(jJe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable offline access"}),d.jsxs(pn,{style:{marginBottom:24,textWrap:"pretty"},children:["By confirming, ",t.name," will be able to use your wallet for you even when you're not around. You can revoke this later."]}),d.jsx(OJe,{showIcon:!0,address:o,title:"Wallet",isLoading:!1}),d.jsxs(DJe,{style:{marginTop:24},children:[d.jsx(Yd,{onClick:f,children:"Not now"}),d.jsx(Ot,{onClick:async()=>{try{await l(),i(!0)}catch(h){s(h)}},children:"Accept"})]}),d.jsx(Qt,{})]})};let DJe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-b99bc0c0-0"})(["display:flex;gap:10px;"]),OJe=fe(p7).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-b99bc0c0-1"})(["margin-top:1.5rem;"]);function FJe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const UJe=_.forwardRef(FJe),BJe=()=>{let{app:t,data:e}=wt(),{closePrivyModal:r}=_t(),[n,i]=_.useState(!1),[a,s]=_.useState(),{onRevoke:o,onSuccess:l,onError:c}=e.delegatedActions.revoke,u=async()=>{n?l():c(a??new _e("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return _.useEffect(()=>{if(!n&&!a)return;let f=setTimeout(u,IL);return()=>clearTimeout(f)},[n,a]),d.jsxs(d.Fragment,n||a?{children:[d.jsx(ft,{onClose:u}),d.jsx(tn,{}),d.jsxs(fj,{children:[a?d.jsx(Fx,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):d.jsx(kc,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(pj,{height:20}),d.jsx(zn,{title:a?"Something went wrong":"Success!",description:a?"Please try again.":"You've successfully revoked permissions."})]}),d.jsx(an,{}),d.jsx(Qt,{})]}:{children:[d.jsx(ft,{closeable:!0,onClose:u}),d.jsx(UJe,{width:56,height:56,style:{margin:"auto"}}),d.jsx(hn,{style:{marginTop:24},children:"Revoke offline access to wallet"}),d.jsxs(pn,{children:["By confirming, ",t.name," will no longer be able to use this wallet on your behalf when you are not online."]}),d.jsxs(zJe,{style:{marginTop:24},children:[d.jsx(Yd,{onClick:u,children:"Deny"}),d.jsx(Ot,{onClick:async()=>{try{await o(),i(!0)}catch(f){s(f)}},children:"Confirm"})]}),d.jsx(Qt,{})]})};let zJe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-8ff214d7-0"})(["display:flex;gap:10px;"]);const Eae=()=>d.jsx(WJe,{children:d.jsxs(HJe,{children:[d.jsx(GJe,{}),d.jsx(qJe,{})]})});let WJe=fe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-85b54ede-0"})(["display:flex;justify-content:center;align-items:center;flex-grow:1;margin:12px;padding:16px;@media all and (display-mode:standalone){margin-bottom:30px;}"]),HJe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-85b54ede-1"})(["position:relative;height:140px;width:140px;opacity:1;animation:fadein 200ms ease;"]),GJe=fe.div.withConfig({displayName:"CircleFixed",componentId:"sc-85b54ede-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;&&{border:4px solid var(--privy-color-accent-light);border-radius:50%;}"]),qJe=fe.div.withConfig({displayName:"CircleRotate",componentId:"sc-85b54ede-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:140px;height:140px;animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:var(--privy-color-accent) transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const VJe=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];let ri=class extends Error{constructor(e,r){super(r),this.type=e}};function qm(t){let e=t.type;return typeof e=="string"&&VJe.includes(e)}function I8(t){return qm(t)&&t.type==="wallet_not_on_device"}function YJe(t){return qm(t)&&(t.type==="invalid_recovery_pin"||t.type==="invalid_request_arguments")}function Uj(t){return!!qm(t)&&t.type==="mfa_timeout"}function Bj(t){return!!qm(t)&&t.type==="missing_or_invalid_mfa"}function KJe(t){return!!qm(t)&&t.type==="mfa_verification_max_attempts_reached"}function _ae(t){return!(!qm(t)||!t.message.includes("code 429"))}function Cae(t){return!!function(e){let r=e.type;return typeof r=="string"&&r==="client_error"}(t)&&t.message==="MFA canceled"}function g7(){return F5(jM(36))}function zj(){return g7()}async function Wj(t,e="S256"){if(e!="S256")return t;{let r=await uTe(t);return F5(r)}}function JJe(){let t=Dt.get(hy);if(!t)throw new _e("Authentication error.");return t}function Sae({isCreatingWallet:t,skipSplashScreen:e}){return t?ye.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:e?ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN}function Aae({walletAction:t,availableRecoveryMethods:e,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?ye.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||e.length===1?Sae({isCreatingWallet:t==="create",skipSplashScreen:n}):ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function Iae(t){switch(t){case"user-passcode":return ye.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN;case"google-drive":case"icloud":return ye.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN;default:throw Error("Recovery method not supported")}}async function WH({api:t,provider:e}){let r=g7(),n=zj(),i=await Wj(r);try{return e==="icloud"?{url:(await t.post(bMe,{client_type:"web"})).url}:{url:(await t.post(vMe,{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:e}}catch(a){throw Vr(a)}}async function QJe({api:t,provider:e,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new _e("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if(i==="undefined")throw new _e("User denied confirmation during OAuth flow");try{return(await t.post(xMe,{authorization_code:i,state_code:r,code_verifier:n,provider:e})).access_token}catch(a){let s=Vr(a);throw s.privyErrorCode?new _e(s.message||"Invalid code during OAuth flow.",void 0,s.privyErrorCode):s.message==="User denied confirmation during OAuth flow"?new _e("Invalid code during oauth flow.",void 0,Ae.OAUTH_USER_DENIED):new _e("Invalid code during OAuth flow.",void 0,Ae.UNKNOWN_AUTH_ERROR)}}const ZJe=()=>{let{authenticated:t,user:e,getAccessToken:r}=$r(),{closePrivyModal:n,createAnalyticsEvent:i,walletProxy:a}=_t(),{navigate:s,data:o,setModalData:l,onUserCloseViaDialogOrKeybindRef:c}=wt(),u=_.useMemo(()=>Date.now(),[]),[f,h]=_.useState(!1),{onCompleteNavigateTo:g,onFailure:m,shouldForceMFA:w,entropyId:C,entropyIdVerifier:v}=o==null?void 0:o.connectWallet,b=S=>{f||(h(!0),m(typeof S=="string"?Error(S):S))};_.useEffect(()=>{let S,j=J5(e,C);return t&&j?a?((async()=>{let F=await r();if(!F)return b("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:F,entropyId:C,entropyIdVerifier:v}),w&&await a.verifyMfa({accessToken:F});let I=(Date.now()-u)/1e3;g===ye.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&I<1?S=setTimeout(()=>{s(g,!1)},1e3*(1-I)):s(g,!1)}catch(I){if(I8(I)&&j.recoveryMethod==="privy"){let B=await r();if(!B)return b("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:j.address}});let V=await(a==null?void 0:a.recover({accessToken:B,entropyId:C,entropyIdVerifier:v}));V!=null&&V.entropyId||b(Error("Unable to recover wallet")),g?s(g):n({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:j.address}}),s(g)}catch{b("An error has occurred, please try again.")}}else I8(I)&&j.recoveryMethod!=="privy"?(l({...o,recoverWallet:{entropyId:C,entropyIdVerifier:v,onCompleteNavigateTo:g,onFailure:m},recoveryOAuthStatus:{provider:j.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),s(Iae(j.recoveryMethod))):b(I)}})(),()=>clearTimeout(S)):void 0:b("User must be authenticated and have a Privy wallet before it can be connected")},[t,e,a]);let A=()=>{b("User exited before wallet could be connected"),n({shouldCallAuthOnSuccess:!1})};return c.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),f?d.jsxs(d.Fragment,{children:[d.jsxs(nf,{children:[d.jsx(Hx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),d.jsx(Ot,{onClick:()=>n({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):d.jsx(Eae,{}),d.jsx(XJe,{})]})};let XJe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-124dbb1c-0"})(["height:44px;"]);const eQe=()=>{let{user:t}=$r(),{closePrivyModal:e,isNewUserThisSession:r,updateWallets:n}=_t(),{app:i,data:a,onUserCloseViaDialogOrKeybindRef:s}=wt(),{onSuccess:o,onFailure:l,callAuthOnSuccessOnClose:c}=a.createWallet,u=()=>{let f=js(t);f?(n(),o(f)):l(Error("Failed to create wallet")),e({shouldCallAuthOnSuccess:c})};return _.useEffect(()=>{let f=setTimeout(u,IL);return()=>clearTimeout(f)},[]),s.current=u,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:u}),d.jsx(tn,{}),d.jsxs(nf,{children:[d.jsx(s1,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(zn,{title:r?"Welcome"+(i!=null&&i.name?` to ${i==null?void 0:i.name}`:""):"All set!",description:r?"You’ve successfully created an account.":"Your account is secured."})]}),d.jsx(an,{}),d.jsx(Qt,{})]})},tQe=({children:t,theme:e})=>d.jsxs(rQe,{$theme:e,children:[d.jsx(rf,{width:"1.25rem",color:e==="dark"?"#FDE68A":"var(--privy-color-warn)"}),t]});let rQe=fe.div.withConfig({displayName:"Container",componentId:"sc-97f152b3-0"})(["display:flex;gap:0.5rem;background-color:",";"," align-items:flex-start;text-align:left;padding:0.5rem 0.75rem;font-size:0.8125rem;font-weight:400;line-height:1.125rem;padding:0.75rem;&&{border-radius:var(--privy-border-radius-sm);}"],t=>t.$theme==="dark"?"var(--privy-color-background-2)":"var(--privy-color-warn-light)",t=>t.$theme==="dark"?"color: #FDE68A;":"");const O1=fe.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]),ph=fe.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]),nQe=()=>{let[t,e]=_.useState(null),{authenticated:r,user:n,getAccessToken:i}=$r(),{closePrivyModal:a,createAnalyticsEvent:s,clientAnalyticsId:o}=_t(),l=Ai(),{data:c,onUserCloseViaDialogOrKeybindRef:u}=wt(),{onFailure:f,onSuccess:h,origin:g,appId:m,appClientId:w,walletToExport:C,primaryWallet:v}=c.keyExport,b=S=>{a({shouldCallAuthOnSuccess:!1}),f(typeof S=="string"?Error(S):S)},A=()=>{a({shouldCallAuthOnSuccess:!1}),h(),s({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:C.address}})};return _.useEffect(()=>{if(!r||!C)return b("User must be authenticated before exporting their wallet");i().then(e,b)},[r,n]),u.current=A,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:A}),d.jsxs(aQe,{children:[d.jsx(ph,{children:"Transfer wallet"}),d.jsxs(O1,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",d.jsx("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),d.jsx(tQe,{theme:l.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),d.jsx(p7,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:C.address,showIcon:!0}),d.jsx("div",{style:{width:"100%"},children:t&&d.jsx(iQe,{origin:g,appId:m,appClientId:w,accessToken:t,clientAnalyticsId:o,walletToExport:C,primaryWallet:v,dimensions:{height:"44px"}})})]}),d.jsx(Qt,{})]})};function iQe(t){let[e,r]=_.useState(t.dimensions.width),[n,i]=_.useState(void 0),a=_.useRef(null);_.useEffect(()=>{if(a.current&&e===void 0){let{width:l}=a.current.getBoundingClientRect();r(l)}let o=getComputedStyle(document.documentElement);i({background:o.getPropertyValue("--privy-color-background"),background2:o.getPropertyValue("--privy-color-background-2"),foreground3:o.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:o.getPropertyValue("--privy-color-foreground-accent"),accent:o.getPropertyValue("--privy-color-accent"),accentDark:o.getPropertyValue("--privy-color-accent-dark"),success:o.getPropertyValue("--privy-color-success")})},[]);let s=t.walletToExport.chainType==="ethereum"&&!t.walletToExport.imported;return d.jsx("div",{ref:a,children:e&&d.jsxs(sQe,{children:[d.jsx("iframe",{style:{position:"absolute",zIndex:1},width:e,height:t.dimensions.height,allow:"clipboard-write self *",src:Iee(t.origin,`/apps/${t.appId}/embedded-wallets/export`,{client_id:t.appClientId,primaryAddress:t.primaryWallet.address,address:t.walletToExport.address,walletIndex:t.walletToExport.walletIndex,width:`${e}px`,caid:t.clientAnalyticsId,phrase_export:s,...n},{token:t.accessToken})}),d.jsx(HH,{children:"Loading..."}),s&&d.jsx(HH,{children:"Loading..."})]})})}let aQe=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-eaab13a9-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),sQe=fe.div.withConfig({displayName:"ButtonContainer",componentId:"sc-eaab13a9-1"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),HH=fe.div.withConfig({displayName:"LoadingButton",componentId:"sc-eaab13a9-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function Mae(){let{getAccessToken:t}=$r(),{refreshUser:e,createAnalyticsEvent:r,initializeWalletProxy:n}=_t(),i=_.useRef(!1);return{createWallet:_.useCallback(async({user:a,recoveryPassword:s})=>{let o=await t();if(!o)throw r({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{r({eventName:"embedded_wallet_creation_started"});let l=await n(ML);if(!l)throw Error("walletProxy does not exist.");let c=new Promise((g,m)=>{setTimeout(()=>{m(Error("walletProxy.create timed out."))},2e4)}),u=iu(a);if(!await Promise.race([l.create({accessToken:o,recoveryPassword:s,recoveryMethod:s?"user-passcode":void 0,solanaAddress:u==null?void 0:u.address}),c]))throw Error("walletProxy.create did not send a response.");let f=await e();if(!f)throw Error("Failed to refresh user.");let h=js(f);if(!h)throw Error("Updated user is missing embedded wallet.");return r({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:h.address}}),i.current=!0,h}catch(l){if(i.current)return;throw r({eventName:"embedded_wallet_creation_failed",payload:{error:l.toString()}}),console.warn(l),l}},[])}}const oQe=()=>{let{app:t,setModalData:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),[a,s]=_.useState(""),{embeddedWallets:o}=Ai(),{authenticated:l,user:c}=$r(),{closePrivyModal:u}=_t(),{onSuccess:f,onFailure:h,callAuthOnSuccessOnClose:g}=n.createWallet,m=(t==null?void 0:t.embeddedWallets.requireUserOwnedRecoveryOnCreate)===!0,{createWallet:w}=Mae(),[C,v]=_.useState(null),b=new is(async()=>{try{let A=await w({user:c});if(!A)return;v(A),r(ye.EMBEDDED_WALLET_CREATED_SCREEN)}catch(A){s(A.message)}});return _.useEffect(()=>l&&c?m?(e({...n,recoverySelection:{...n==null?void 0:n.recoverySelection,isInAccountCreateFlow:!0}}),r(Aae({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:o.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void b.execute():(r(ye.LANDING),void h(Error("User must be authenticated before creating a Privy wallet"))),[m,l]),i.current=()=>null,a?d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsxs(nf,{children:[d.jsx(Hx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:a})]}),d.jsx(Ot,{onClick:()=>{C?(f(C),u({shouldCallAuthOnSuccess:g})):(h(new th("User wallet creation failed")),u({shouldCallAuthOnSuccess:!1}))},children:"Close"}),d.jsx(lQe,{})]}):d.jsx(Eae,{})};let lQe=fe.div.withConfig({displayName:"BottomSpacing",componentId:"sc-eabafbf4-0"})(["height:44px;"]);var cQe=function(e,r){return Math.round(r*Math.log(e)/Math.LN2)},uQe=[{name:"lowercase",re:/[a-z]/,length:26},{name:"uppercase",re:/[A-Z]/,length:26},{name:"numbers",re:/[0-9]/,length:10},{name:"symbols",re:/[^a-zA-Z0-9]/,length:33}],dQe=function(e){return function(r){return e.reduce(function(n,i){return n+(i.re.test(r)?i.length:0)},0)}},fQe=dQe(uQe),hQe=function(e){return e?cQe(fQe(e),e.length):0},pQe=hQe;const gQe=No(pQe);function Tae(t){return crypto.getRandomValues(new Uint8Array(t))}const mQe=256,qy=65536;function yQe(){const[t]=Tae(1);return t}function wQe(){const[t,e]=Tae(2);return(t<<8)+e}function vQe(t){if(typeof t!="number"||t<2||t>qy)throw new Error(`Invalid number: number must be at least two and at most ${qy}`);const e=t>256,r=e?qy:mQe,n=e?wQe:yQe,i=t*Math.floor(r/t);for(;;){const a=n();if(aqy)throw new Error(`Invalid argument: end must be a number less than or equal to ${qy}`);if(r-e<2)throw new Error("Invalid range: range must contain at least two values");const n=[];for(let i=0;i{const s=e[i];return n+(a===0?s:r+s)},"")}const EQe=Object.freeze(["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]),_Qe=Object.freeze(EQe.filter(t=>!t.includes("-")));let CQe=/[a-z]/,SQe=/[A-Z]/,AQe=/[0-9]/,kae="!@#$%^&*()\\-_+.",Nae=`a-zA-Z0-9${kae}`,IQe=RegExp(`[${kae}]`),MQe=RegExp(`[${Nae}]`);const TQe=RegExp(`^[${Nae}]{6,}$`),kQe=(t="")=>[...new Set(t.split("").filter(e=>!MQe.test(e)).map(e=>e.replace(" ","SPACE")))],Lae=()=>xQe(4,_Qe);function NQe(t){return t>.9?"Strong":t>.5?"Medium":"Weak"}function LQe(t){if(t.length<8)return 0;let e=0;return CQe.test(t)&&(e+=1),SQe.test(t)&&(e+=1),AQe.test(t)&&(e+=1),IQe.test(t)&&(e+=1),Math.max(0,Math.min(1,e/3))}function jQe(t=""){return(.3*LQe(t)+gQe(t)/95)/2}function $Qe(t=""){let e=jQe(t);return{value:e,label:NQe(e)}}function PQe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}const RQe=_.forwardRef(PQe);function DQe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const OQe=_.forwardRef(DQe);function FQe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const UQe=_.forwardRef(FQe);let BQe=la(["font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;text-align:left;transition:color 0.1s ease-in;"]);const jae=fe.span.withConfig({displayName:"StatusText",componentId:"sc-3f6866a9-0"})([""," transition:color 0.1s ease-in;color:",";text-transform:",";&[aria-hidden='true']{visibility:hidden;}"],BQe,({error:t})=>t?"var(--privy-color-error)":"var(--privy-color-foreground-3)",({error:t})=>t?"":"capitalize"),m7=fe.div.withConfig({displayName:"EmbeddedWalletScreenContainer",componentId:"sc-3f6866a9-1"})(["display:flex;flex-direction:column;justify-content:center;flex-grow:1;"]),y7=fe(Ot).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-3f6866a9-2"})(["",""],t=>t.hideAnimations&&la(["&&{transition:none;}"]));let $ae=la(["&&{width:100%;border-width:1px;border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);background:var(--privy-color-background);color:var(--privy-color-foreground);padding:12px;font-size:16px;font-style:normal;font-weight:300;line-height:22px;}"]);const Hj=fe.input.withConfig({displayName:"PasswordInput",componentId:"sc-3f6866a9-3"})([""," &::placeholder{color:var(--privy-color-foreground-3);font-style:italic;font-size:14px;}overflow:hidden;text-overflow:ellipsis;white-space:nowrap;"],$ae),zQe=fe.div.withConfig({displayName:"PasswordDisplay",componentId:"sc-3f6866a9-4"})(["",""],$ae),w7=fe.div.withConfig({displayName:"PasswordContainer",componentId:"sc-3f6866a9-5"})(["position:relative;width:100%;display:flex;align-items:center;justify-content:",";"],({centered:t})=>t?"center":"space-between"),v7=fe.div.withConfig({displayName:"Header",componentId:"sc-3f6866a9-6"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:32px 0;gap:4px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]),Gj=fe.div.withConfig({displayName:"Details",componentId:"sc-3f6866a9-7"})(["display:flex;flex-direction:column;gap:10px;padding-bottom:1rem;"]),jT=fe.div.withConfig({displayName:"DetailItem",componentId:"sc-3f6866a9-8"})(["display:flex;text-align:left;align-items:center;gap:8px;max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;margin:0 8px;color:var(--privy-color-foreground-2);> :first-child{min-width:24px;}"]),GH=fe(Dx).withConfig({displayName:"ExportButton",componentId:"sc-3f6866a9-10"})(["display:flex;flex:1;gap:4px;justify-content:center;&&{background:var(--privy-color-background);border-radius:var(--privy-border-radius-md);border-color:var(--privy-color-foreground-3);border-width:1px;}"]),qj=fe.div.withConfig({displayName:"InputRightIcons",componentId:"sc-3f6866a9-11"})(["position:absolute;right:0.5rem;display:flex;flex-direction:row;justify-content:space-around;align-items:center;"]),WQe=fe(RQe).withConfig({displayName:"RegenerateIcon",componentId:"sc-3f6866a9-12"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),Vj=fe(UQe).withConfig({displayName:"HiddenIcon",componentId:"sc-3f6866a9-13"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),Yj=fe(OQe).withConfig({displayName:"ShownIcon",componentId:"sc-3f6866a9-14"})(["height:1.25rem;width:1.25rem;stroke:var(--privy-color-accent);cursor:pointer;:active{stroke:var(--privy-color-accent-light);}"]),HQe=fe.progress.withConfig({displayName:"StrengthMeter",componentId:"sc-3f6866a9-15"})(["height:4px;width:100%;margin:8px 0;::-webkit-progress-bar{border-radius:8px;background:var(--privy-color-foreground-4);}::-webkit-progress-value{border-radius:8px;transition:all 0.1s ease-out;background:",";}"],({label:t})=>(t==="Strong"?"#78dca6":t==="Medium"&&"var(--privy-color-warn)")||"var(--privy-color-error)"),GQe=({buttonHideAnimations:t,buttonLoading:e,password:r,onSubmit:n,onBack:i})=>{let[a,s]=_.useState(!0),[o,l]=_.useState(!1),[c,u]=_.useState(""),f=r===c;return _.useEffect(()=>{c&&!o&&l(!0)},[c]),d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:i}),d.jsx(tn,{}),d.jsxs(m7,{children:[d.jsxs(v7,{children:[d.jsx(rf,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),d.jsxs(w7,{children:[d.jsx(Hj,{value:c,onChange:h=>u(h.target.value),onKeyUp:h=>{h.key==="Enter"&&n()},onBlur:()=>l(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),d.jsx(qj,{style:{right:"0.75rem"},children:a?d.jsx(Vj,{onClick:()=>s(!1)}):d.jsx(Yj,{onClick:()=>s(!0)})})]}),d.jsx(jae,{"aria-hidden":!o||f,error:!0,children:"Passwords do not match"})]}),d.jsx(y7,{onClick:n,loading:e,disabled:!f,hideAnimations:t,children:"Continue"}),d.jsx(an,{}),d.jsx(Qt,{})]})},qQe=({className:t,checked:e,color:r="var(--privy-color-accent)",...n})=>d.jsx("label",{children:d.jsxs(VQe,{className:t,children:[d.jsx(Rae,{checked:e,...n}),d.jsx(YQe,{color:r,checked:e,children:d.jsx(Pae,{viewBox:"0 0 24 24",children:d.jsx("polyline",{points:"20 6 9 17 4 12"})})})]})});let VQe=fe.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-db51b935-1"})(["display:inline-block;vertical-align:middle;"]),Pae=fe.svg.withConfig({displayName:"Icon",componentId:"sc-db51b935-2"})(["fill:none;stroke:white;stroke-width:3px;"]),Rae=fe.input.attrs({type:"checkbox"}).withConfig({displayName:"HiddenCheckbox",componentId:"sc-db51b935-3"})(["border:0;clip:rect(0 0 0 0);clippath:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px;"]),YQe=fe.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-db51b935-4"})(["display:inline-block;width:18px;height:18px;transition:all 150ms;cursor:pointer;border-color:",";border-radius:3px;background:",";&&{border-width:1px;}",":focus + &{box-shadow:0 0 0 1px ",";}","{visibility:",";}"],t=>t.color,t=>t.checked?t.color:"var(--privy-color-background)",Rae,t=>t.color,Pae,t=>t.checked?"visible":"hidden");const KQe=({buttonHideAnimations:t,buttonLoading:e,onSubmit:r,onBack:n,config:i})=>{let[a,s]=_.useState(!1);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1,backFn:n}),d.jsx(tn,{}),d.jsxs(m7,{children:[d.jsxs(v7,{children:[d.jsx(rf,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),d.jsx(Gj,{children:d.jsxs(jT,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:o=>{o.preventDefault(),s(l=>!l)},children:[d.jsx(qQe,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),d.jsx(d.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),d.jsxs(JQe,{children:[i.initiatedBy==="user"&&d.jsx(Yd,{onClick:i.onCancel,disabled:e,children:"Cancel"}),d.jsx(y7,{onClick:r,loading:e,hideAnimations:t,disabled:!a,children:"Set Password"})]}),d.jsx(an,{}),d.jsx(Qt,{})]})};let JQe=fe.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-eb601350-0"})(["display:flex;gap:10px;"]);function QQe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const ZQe=_.forwardRef(QQe),XQe=({buttonHideAnimations:t,buttonLoading:e,password:r="",config:n,isResettingPassword:i,onSubmit:a,onClose:s,onBack:o,onPasswordChange:l,onPasswordGenerate:c})=>{let[u,f]=_.useState(!1),[h,g]=_.useState(!1);_.useEffect(()=>{r&&!h&&g(!0)},[r]);let m=_.useMemo(()=>h?6>((r==null?void 0:r.length)||0)?"Password must be at least 6 characters":TQe.test(r||"")?null:`Invalid characters used ( ${kQe(r).join(" ")} )`:null,[r,h]),w=_.useMemo(()=>m?{value:0,label:"Weak"}:$Qe(r),[r,m]),C=_.useMemo(()=>!(r!=null&&r.length)||!!m,[m,r]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:s,closeable:n.initiatedBy==="user",backFn:o}),d.jsx(tn,{}),d.jsxs(m7,{children:[d.jsxs(v7,{children:[d.jsx(ZQe,{height:48,width:48,stroke:"var(--privy-color-accent)"}),d.jsxs("h3",{style:{color:"var(--privy-color-foreground)"},children:[i?"Reset":"Set"," your password"]}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),d.jsxs(w7,{children:[d.jsx(Hj,{value:r,onChange:v=>l(v.target.value),onKeyUp:v=>{v.key==="Enter"&&a()},placeholder:"enter or generate a strong password",type:u?"password":"text",style:{paddingRight:"3.8rem"}}),d.jsxs(qj,{style:{width:"3.5rem"},children:[u?d.jsx(Vj,{onClick:()=>f(!1)}):d.jsx(Yj,{onClick:()=>f(!0)}),d.jsx(WQe,{onClick:c})]})]}),d.jsx(HQe,{value:w.value===0?.01:w.value,label:w.label}),d.jsx(jae,{error:!!m,children:m||`Password Strength: ${h?w.label:"--"}`}),d.jsxs(tZe,{children:[d.jsx(eZe,{children:d.jsxs(Gj,{children:[d.jsxs(jT,{children:[d.jsx(s1,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),d.jsxs(jT,{children:[d.jsx(s1,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),d.jsx(y7,{onClick:a,loading:e,disabled:C,hideAnimations:t,children:"Continue"})]})]}),d.jsx(an,{}),d.jsx(Qt,{})]})};let eZe=fe(Gj).withConfig({displayName:"DetailsContainer",componentId:"sc-7b3b7727-0"})(["flex:1;padding-top:1rem;"]),tZe=fe.div.withConfig({displayName:"LowerContainer",componentId:"sc-7b3b7727-1"})(["display:flex;flex-direction:column;height:100%;"]);function rZe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const nZe=_.forwardRef(rZe);function iZe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}))}const Dae=_.forwardRef(iZe);function aZe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const sZe=_.forwardRef(aZe),oZe=({buttonHideAnimations:t,buttonLoading:e,appName:r,password:n,onSubmit:i,onBack:a})=>{let[s,o]=_.useState(!1),l=_.useCallback(()=>{o(!0),n&&navigator.clipboard.writeText(n)},[n]),c=_.useCallback(()=>{let u=document.createElement("a"),f=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),h=new Blob([lZe(r,n)],{type:"text/plain"}),g=URL.createObjectURL(h);u.href=g,u.target="_blank",u.download=`${f}-privy-wallet-recovery.txt`,document.body.appendChild(u),u.click(),setTimeout(()=>{u.remove(),URL.revokeObjectURL(g)},5e3)},[n]);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:a,closeable:!1}),d.jsx(tn,{}),d.jsxs(m7,{children:[d.jsxs(v7,{children:[d.jsx(rf,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),d.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),d.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),d.jsx(w7,{centered:!0,children:d.jsx(zQe,{children:n})}),d.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[d.jsx(GH,{onClick:l,children:d.jsxs(d.Fragment,s?{children:[d.jsx(Dae,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[d.jsx(sZe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),d.jsxs(GH,{onClick:c,children:[d.jsx(nZe,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),d.jsx(y7,{onClick:i,loading:e,hideAnimations:t,children:"Continue"}),d.jsx(an,{}),d.jsx(Qt,{})]})};let lZe=(t,e)=>`Your wallet recovery password for ${t} is ${e} -You will need this password to access your ${t} wallet on a new device. Please keep it somewhere safe.`;const OZe=({error:t,onClose:e})=>d.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(tn,{}),d.jsxs(Zd,t?{children:[d.jsx(Px,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:t})]}:{children:[d.jsx(X0,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Success"})]}),d.jsx(Ot,{onClick:e,children:"Close"}),d.jsx(an,{}),d.jsx(Zt,{})]});let FZe=(t,e)=>{switch(t){case"creating":return e==="back"?t:"saving";case"saving":return e==="back"?"creating":"confirming";case"confirming":return e==="back"?"saving":"finalizing";case"finalizing":return e==="back"?"confirming":"done";default:return t}};const UZe=()=>{let[t,e]=C.useReducer(FZe,"creating");return{send:e,state:t}},mae=({onSubmit:t,...e})=>{let{lastScreen:r,navigate:n}=wt(),{send:i,state:a}=UZe(),s=C.useCallback(async()=>{a==="finalizing"&&await t(),i("next")},[a,i,t]);C.useEffect(()=>{let c;return a==="done"&&e.config.initiatedBy==="automatic"&&(c=setTimeout(()=>{var u;return(u=e.onClose)==null?void 0:u.call(e)},Dn)),()=>{c&&clearTimeout(c)}},[a,e.config.initiatedBy,e.onClose]);let o=C.useCallback(()=>{i("back")},[i]),l=C.useCallback(()=>{n(ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)},[r,n]);return a==="creating"?d.jsx(MZe,{...e,onSubmit:s,onBack:r===ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?l:void 0}):a==="saving"?d.jsx(RZe,{...e,onSubmit:s,onBack:o}):a==="confirming"?d.jsx(bZe,{...e,onSubmit:s,onBack:o}):a==="finalizing"?d.jsx(CZe,{...e,onSubmit:s,onBack:o}):a==="done"?d.jsx(OZe,{...e,onSubmit:s}):null},BZe=()=>{let[t,e]=C.useState(null),[r,n]=C.useState(!1),[i,a]=C.useState(null),[s,o]=C.useState(""),{authenticated:l,getAccessToken:c,user:u}=$r(),{walletProxy:f,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:m}=_t(),{app:w,navigate:_,data:v,onUserCloseViaDialogOrKeybindRef:b}=wt(),{onSuccess:A,onFailure:S}=v.createWallet,j=ho(u),U=(t==null?void 0:t.recoveryMethod)==="user-passcode",I=(j==null?void 0:j.recoveryMethod)==="user-passcode";C.useEffect(()=>{l||(_(ye.LANDING),S(new mIe("User must be authenticated before setting a password on a Privy wallet")))},[l]);let B=()=>i?(S(i),void g({shouldCallAuthOnSuccess:!1})):U?(A(t),void g({shouldCallAuthOnSuccess:!1})):(S(new Kf("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));return b.current=B,d.jsx(mae,{appName:(w==null?void 0:w.name)||"privy",config:{initiatedBy:"user",onCancel:B},error:i?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:s,isResettingPassword:I,onPasswordGenerate:()=>o(uae()),onPasswordChange:o,onSubmit:async()=>{U?(A(t),g({shouldCallAuthOnSuccess:!1})):(n(!0),a(null),await(async()=>{let V=await c();if(V&&(j!=null&&j.address)&&s&&f)try{m({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I}});let{entropyId:se,entropyIdVerifier:Y}=qn(j);if(!(await f.setRecovery({accessToken:V,entropyId:se,entropyIdVerifier:Y,recoveryPassword:s,recoveryMethod:"user-passcode"})).entropyId)return a(new Kf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I,reason:"error setting password"}});let N=await h(),k=ho(N);if(!k)return a(new Kf("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I,reason:"wallet disconnected"}});e(k),m({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I}})}catch(se){console.warn(se),a(se instanceof Error?se:Error("Error setting password on privy wallet")),m({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:j.address,reason:se}})}})(),n(!1))},onClose:B})};function zZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Oj=C.forwardRef(zZe);function WZe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z",clipRule:"evenodd"}))}const yae=C.forwardRef(WZe),HZe=()=>{let{closePrivyModal:t}=_t(),{data:e,setModalData:r,navigate:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),{onSuccess:a,onFailure:s}=e.setWalletPassword,o=()=>{s(new Kf("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=o,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:o}),d.jsx(tn,{}),d.jsxs(Zd,{children:[d.jsxs(iDe,{children:[d.jsx(Oj,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(aDe,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:d.jsx(yae,{width:"12px",height:"12px",fill:"white"})})]}),d.jsxs(zn,{title:"Secure Your Account",children:["Please set a password to secure your account.",d.jsx("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),d.jsx(Ot,{onClick:()=>{r({createWallet:{onFailure:s,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),n(ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),d.jsx(an,{}),d.jsx(Zt,{})]})};let GZe=(t,e)=>{let r=d.jsx(Jd,{height:38,width:38,stroke:"var(--privy-color-error)"});if(t instanceof _e)switch(t.privyErrorCode){case Ae.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:t.message,ctaText:"Try again",icon:r};case Ae.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:t.message,ctaText:"Try again",icon:r};case Ae.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:t.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(t instanceof ri&&t.type==="twilio_verification_failed")return{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:d.jsx(vc,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(t instanceof qs))return t instanceof rl&&t.status&&[400,422].includes(t.status)?{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r};switch(t.privyErrorCode){case Ae.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case Ae.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:t.message,ctaText:"Try another method",icon:r};case Ae.ALLOWLIST_REJECTED:return{title:e.errorTitle||"You don't have access to this app",detail:e.errorDetail||"Have you been invited?",ctaText:e.errorCtaText||"Try another account",icon:d.jsx(ine,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case Ae.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:d.jsx("span",{})};case Ae.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:d.jsx("span",{})};case Ae.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case Ae.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case Ae.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}}};const qZe=()=>{var s,o;let{navigate:t,navigateBack:e,data:r,lastScreen:n,currentScreen:i}=wt(),a=((s=r==null?void 0:r.errorModalData)==null?void 0:s.previousScreen)||(n===i?void 0:n);return d.jsx(gv,{error:((o=r==null?void 0:r.errorModalData)==null?void 0:o.error)||Error(),backFn:()=>a?t(a,!1):e(),onClick:()=>t(a||ye.LANDING,!1)})},gv=({error:t,backFn:e,onClick:r})=>{let{reset:n}=$o(),{app:i}=wt(),a=GZe(t,i.allowlistConfig);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:e}),d.jsxs(VZe,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(XL,{color:"var(--privy-color-error)"}),a.icon]})}),d.jsxs(YZe,{children:[d.jsx("h3",{children:a.title}),d.jsx("p",{children:a.detail})]}),d.jsx(Ot,{color:"var(--privy-color-error)",onClick:()=>{t instanceof qs&&(t.privyErrorCode===Ae.INVALID_CAPTCHA&&n(),t.privyErrorCode===Ae.ALLOWLIST_REJECTED&&i.allowlistConfig.errorCtaLink)?window.location.href=i.allowlistConfig.errorCtaLink:r==null||r()},children:a.ctaText})]})]})};let VZe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1d84a574-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),YZe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-1d84a574-1"})(["display:flex;flex-direction:column;gap:8px;"]);const wae=({style:t,color:e,...r})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:e||"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...r,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),KZe=({color:t,...e})=>d.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:d.jsx("g",{children:d.jsx("path",{fill:t||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),d7=t=>{let[e,r]=C.useState(!1);return d.jsxs(JZe,{color:t.color,onClick:()=>{r(!0),navigator.clipboard.writeText(t.text),setTimeout(()=>r(!1),1500)},justCopied:e,children:[e?d.jsx(wae,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):d.jsx(KZe,{style:{height:"14px",width:"14px"}}),e?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let JZe=fe.button.withConfig({displayName:"StyledCopytoClipboardButton",componentId:"sc-9c2ee64b-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],t=>t.justCopied?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.justCopied?"medium":"normal",t=>t.justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");const vae=t=>{let[e,r]=C.useState(!1);return d.jsx(ZZe,{color:t.color,href:t.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:e,children:t.text})};let ZZe=fe.a.withConfig({displayName:"StyledOpenLinkButton",componentId:"sc-4e695c83-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],t=>t.justOpened?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.justOpened?"medium":"normal",t=>t.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");var mv={},QZe=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},bae={},Do={};let Fj;const XZe=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Do.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Do.getSymbolTotalCodewords=function(e){return XZe[e]};Do.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Do.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Fj=e};Do.isKanjiModeEnabled=function(){return typeof Fj<"u"};Do.toSJIS=function(e){return Fj(e)};var f7={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(f7);function xae(){this.buffer=[],this.length=0}xae.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var eQe=xae;function yv(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}yv.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};yv.prototype.get=function(t,e){return this.data[t*this.size+e]};yv.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};yv.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var tQe=yv,Eae={};(function(t){const e=Do.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),s=a===145?26:Math.ceil((a-13)/(2*i-2))*2,o=[a-7];for(let l=1;l=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const a=i.size;let s=0,o=0,l=0,c=null,u=null;for(let f=0;f=5&&(s+=e.N1+(o-5)),c=g,o=1),g=i.get(h,f),g===u?l++:(l>=5&&(s+=e.N1+(l-5)),u=g,l=1)}o>=5&&(s+=e.N1+(o-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(i){const a=i.size;let s=0;for(let o=0;o=10&&(o===1488||o===93)&&s++,l=l<<1&2047|i.get(u,c),u>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let a=0;const s=i.data.length;for(let l=0;l=0;){const s=a[0];for(let l=0;l0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var nQe=Uj,Iae={},Mh={},Bj={};Bj.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var ju={};const Mae="[0-9]+",iQe="[A-Z $%*+\\-./:]+";let Q3="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Q3=Q3.replace(/u/g,"\\u");const aQe="(?:(?![A-Z0-9 $%*+\\-./:]|"+Q3+`)(?:.|[\r -]))+`;ju.KANJI=new RegExp(Q3,"g");ju.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ju.BYTE=new RegExp(aQe,"g");ju.NUMERIC=new RegExp(Mae,"g");ju.ALPHANUMERIC=new RegExp(iQe,"g");const sQe=new RegExp("^"+Q3+"$"),oQe=new RegExp("^"+Mae+"$"),lQe=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ju.testKanji=function(e){return sQe.test(e)};ju.testNumeric=function(e){return oQe.test(e)};ju.testAlphanumeric=function(e){return lQe.test(e)};(function(t){const e=Bj,r=ju;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(a,s){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?a.ccBits[0]:s<27?a.ccBits[1]:a.ccBits[2]},t.getBestModeForData=function(a){return r.testNumeric(a)?t.NUMERIC:r.testAlphanumeric(a)?t.ALPHANUMERIC:r.testKanji(a)?t.KANJI:t.BYTE},t.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},t.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(a,s){if(t.isValid(a))return a;try{return n(a)}catch{return s}}})(Mh);(function(t){const e=Do,r=h7,n=f7,i=Mh,a=Bj,s=7973,o=e.getBCHDigit(s);function l(h,g,m){for(let w=1;w<=40;w++)if(g<=t.getCapacity(w,m,h))return w}function c(h,g){return i.getCharCountIndicator(h,g)+4}function u(h,g){let m=0;return h.forEach(function(w){const _=c(w.mode,g);m+=_+w.getBitsLength()}),m}function f(h,g){for(let m=1;m<=40;m++)if(u(h,m)<=t.getCapacity(m,g,i.MIXED))return m}t.from=function(g,m){return a.isValid(g)?parseInt(g,10):m},t.getCapacity=function(g,m,w){if(!a.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=i.BYTE);const _=e.getSymbolTotalCodewords(g),v=r.getTotalCodewordsCount(g,m),b=(_-v)*8;if(w===i.MIXED)return b;const A=b-c(w,g);switch(w){case i.NUMERIC:return Math.floor(A/10*3);case i.ALPHANUMERIC:return Math.floor(A/11*2);case i.KANJI:return Math.floor(A/13);case i.BYTE:default:return Math.floor(A/8)}},t.getBestVersionForData=function(g,m){let w;const _=n.from(m,n.M);if(Array.isArray(g)){if(g.length>1)return f(g,_);if(g.length===0)return 1;w=g[0]}else w=g;return l(w.mode,w.getLength(),_)},t.getEncodedBits=function(g){if(!a.isValid(g)||g<7)throw new Error("Invalid QR Code version");let m=g<<12;for(;e.getBCHDigit(m)-o>=0;)m^=s<=0;)i^=kae<<_T.getBCHDigit(i)-$H;return(n<<10|i)^cQe};var Nae={};const uQe=Mh;function Kg(t){this.mode=uQe.NUMERIC,this.data=t.toString()}Kg.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};Kg.prototype.getLength=function(){return this.data.length};Kg.prototype.getBitsLength=function(){return Kg.getBitsLength(this.data.length)};Kg.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const a=this.data.length-r;a>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,a*3+1))};var dQe=Kg;const fQe=Mh,$S=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Jg(t){this.mode=fQe.ALPHANUMERIC,this.data=t}Jg.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};Jg.prototype.getLength=function(){return this.data.length};Jg.prototype.getBitsLength=function(){return Jg.getBitsLength(this.data.length)};Jg.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=$S.indexOf(this.data[r])*45;n+=$S.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put($S.indexOf(this.data[r]),6)};var hQe=Jg;const pQe=Mh;function Zg(t){this.mode=pQe.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}Zg.getBitsLength=function(e){return e*8};Zg.prototype.getLength=function(){return this.data.length};Zg.prototype.getBitsLength=function(){return Zg.getBitsLength(this.data.length)};Zg.prototype.write=function(t){for(let e=0,r=this.data.length;e=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` -Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var wQe=Qg,Lae={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var a={},s={};s[n]=0;var o=e.PriorityQueue.make();o.push(n,0);for(var l,c,u,f,h,g,m,w,_;!o.empty();){l=o.pop(),c=l.value,f=l.cost,h=r[c]||{};for(u in h)h.hasOwnProperty(u)&&(g=h[u],m=f+g,w=s[u],_=typeof s[u]>"u",(_||w>m)&&(s[u]=m,o.push(u,m),a[u]=c))}if(typeof i<"u"&&typeof s[i]>"u"){var v=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(v)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],a=n;a;)i.push(a),r[a],a=r[a];return i.reverse(),i},find_path:function(r,n,i){var a=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},a;r=r||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Lae);var vQe=Lae.exports;(function(t){const e=Mh,r=dQe,n=hQe,i=gQe,a=wQe,s=ju,o=Do,l=vQe;function c(v){return unescape(encodeURIComponent(v)).length}function u(v,b,A){const S=[];let j;for(;(j=v.exec(A))!==null;)S.push({data:j[0],index:j.index,mode:b,length:j[0].length});return S}function f(v){const b=u(s.NUMERIC,e.NUMERIC,v),A=u(s.ALPHANUMERIC,e.ALPHANUMERIC,v);let S,j;return o.isKanjiModeEnabled()?(S=u(s.BYTE,e.BYTE,v),j=u(s.KANJI,e.KANJI,v)):(S=u(s.BYTE_KANJI,e.BYTE,v),j=[]),b.concat(A,S,j).sort(function(I,B){return I.index-B.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function h(v,b){switch(b){case e.NUMERIC:return r.getBitsLength(v);case e.ALPHANUMERIC:return n.getBitsLength(v);case e.KANJI:return a.getBitsLength(v);case e.BYTE:return i.getBitsLength(v)}}function g(v){return v.reduce(function(b,A){const S=b.length-1>=0?b[b.length-1]:null;return S&&S.mode===A.mode?(b[b.length-1].data+=A.data,b):(b.push(A),b)},[])}function m(v){const b=[];for(let A=0;A=0&&o<=6&&(l===0||l===6)||l>=0&&l<=6&&(o===0||o===6)||o>=2&&o<=4&&l>=2&&l<=4?t.set(a+o,s+l,!0,!0):t.set(a+o,s+l,!1,!0))}}function MQe(t){const e=t.size;for(let r=8;r>o&1)===1,t.set(i,a,s,!0),t.set(a,i,s,!0)}function DS(t,e,r){const n=t.size,i=SQe.getEncodedBits(e,r);let a,s;for(a=0;a<15;a++)s=(i>>a&1)===1,a<6?t.set(a,8,s,!0):a<8?t.set(a+1,8,s,!0):t.set(n-15+a,8,s,!0),a<8?t.set(8,n-a-1,s,!0):a<9?t.set(8,15-a-1+1,s,!0):t.set(8,15-a-1,s,!0);t.set(n-8,8,1,!0)}function NQe(t,e){const r=t.size;let n=-1,i=r-1,a=7,s=0;for(let o=r-1;o>0;o-=2)for(o===6&&o--;;){for(let l=0;l<2;l++)if(!t.isReserved(i,o-l)){let c=!1;s>>a&1)===1),t.set(i,o-l,c),a--,a===-1&&(s++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function LQe(t,e,r){const n=new bQe;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),AQe.getCharCountIndicator(l.mode,t)),l.write(n)});const i=g7.getSymbolTotalCodewords(t),a=ST.getTotalCodewordsCount(t,e),s=(i-a)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const o=(s-n.getLengthInBits())/8;for(let l=0;ld.jsxs(d.Fragment,{children:[d.jsx(ft,{closeable:!1}),d.jsx(tn,{}),d.jsxs(nf,t?{children:[d.jsx(Hx,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Something went wrong",description:t})]}:{children:[d.jsx(s1,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),d.jsx(zn,{title:"Success"})]}),d.jsx(Ot,{onClick:e,children:"Close"}),d.jsx(an,{}),d.jsx(Qt,{})]});let uZe=(t,e)=>{switch(t){case"creating":return e==="back"?t:"saving";case"saving":return e==="back"?"creating":"confirming";case"confirming":return e==="back"?"saving":"finalizing";case"finalizing":return e==="back"?"confirming":"done";default:return t}};const dZe=()=>{let[t,e]=_.useReducer(uZe,"creating");return{send:e,state:t}},Oae=({onSubmit:t,...e})=>{let{lastScreen:r,navigate:n}=wt(),{send:i,state:a}=dZe(),s=_.useCallback(async()=>{a==="finalizing"&&await t(),i("next")},[a,i,t]);_.useEffect(()=>{let c;return a==="done"&&e.config.initiatedBy==="automatic"&&(c=setTimeout(()=>{var u;return(u=e.onClose)==null?void 0:u.call(e)},Dn)),()=>{c&&clearTimeout(c)}},[a,e.config.initiatedBy,e.onClose]);let o=_.useCallback(()=>{i("back")},[i]),l=_.useCallback(()=>{n(ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)},[r,n]);return a==="creating"?d.jsx(XQe,{...e,onSubmit:s,onBack:r===ye.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?l:void 0}):a==="saving"?d.jsx(oZe,{...e,onSubmit:s,onBack:o}):a==="confirming"?d.jsx(GQe,{...e,onSubmit:s,onBack:o}):a==="finalizing"?d.jsx(KQe,{...e,onSubmit:s,onBack:o}):a==="done"?d.jsx(cZe,{...e,onSubmit:s}):null},fZe=()=>{let[t,e]=_.useState(null),[r,n]=_.useState(!1),[i,a]=_.useState(null),[s,o]=_.useState(""),{authenticated:l,getAccessToken:c,user:u}=$r(),{walletProxy:f,refreshUser:h,closePrivyModal:g,createAnalyticsEvent:m}=_t(),{app:w,navigate:C,data:v,onUserCloseViaDialogOrKeybindRef:b}=wt(),{onSuccess:A,onFailure:S}=v.createWallet,j=mo(u),F=(t==null?void 0:t.recoveryMethod)==="user-passcode",I=(j==null?void 0:j.recoveryMethod)==="user-passcode";_.useEffect(()=>{l||(C(ye.LANDING),S(new BIe("User must be authenticated before setting a password on a Privy wallet")))},[l]);let B=()=>i?(S(i),void g({shouldCallAuthOnSuccess:!1})):F?(A(t),void g({shouldCallAuthOnSuccess:!1})):(S(new th("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));return b.current=B,d.jsx(Oae,{appName:(w==null?void 0:w.name)||"privy",config:{initiatedBy:"user",onCancel:B},error:i?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:s,isResettingPassword:I,onPasswordGenerate:()=>o(Lae()),onPasswordChange:o,onSubmit:async()=>{F?(A(t),g({shouldCallAuthOnSuccess:!1})):(n(!0),a(null),await(async()=>{let V=await c();if(V&&(j!=null&&j.address)&&s&&f)try{m({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I}});let{entropyId:se,entropyIdVerifier:Y}=qn(j);if(!(await f.setRecovery({accessToken:V,entropyId:se,entropyIdVerifier:Y,recoveryPassword:s,recoveryMethod:"user-passcode"})).entropyId)return a(new th("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I,reason:"error setting password"}});let N=await h(),k=mo(N);if(!k)return a(new th("Error setting password on privy wallet")),void m({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I,reason:"wallet disconnected"}});e(k),m({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:j.address,existingRecoveryMethod:j.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:I}})}catch(se){console.warn(se),a(se instanceof Error?se:Error("Error setting password on privy wallet")),m({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:j.address,reason:se}})}})(),n(!1))},onClose:B})};function hZe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Kj=_.forwardRef(hZe);function pZe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z",clipRule:"evenodd"}))}const Fae=_.forwardRef(pZe),gZe=()=>{let{closePrivyModal:t}=_t(),{data:e,setModalData:r,navigate:n,onUserCloseViaDialogOrKeybindRef:i}=wt(),{onSuccess:a,onFailure:s}=e.setWalletPassword,o=()=>{s(new th("Exited before password was added to wallet")),t({shouldCallAuthOnSuccess:!1})};return i.current=o,d.jsxs(d.Fragment,{children:[d.jsx(ft,{onClose:o}),d.jsx(tn,{}),d.jsxs(nf,{children:[d.jsxs(TDe,{children:[d.jsx(Kj,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),d.jsx(kDe,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:d.jsx(Fae,{width:"12px",height:"12px",fill:"white"})})]}),d.jsxs(zn,{title:"Secure Your Account",children:["Please set a password to secure your account.",d.jsx("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),d.jsx(Ot,{onClick:()=>{r({createWallet:{onFailure:s,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),n(ye.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),d.jsx(an,{}),d.jsx(Qt,{})]})};let mZe=(t,e)=>{let r=d.jsx(rf,{height:38,width:38,stroke:"var(--privy-color-error)"});if(t instanceof _e)switch(t.privyErrorCode){case Ae.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:t.message,ctaText:"Try again",icon:r};case Ae.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:t.message,ctaText:"Try again",icon:r};case Ae.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:t.message,ctaText:"Try again",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}else{if(t instanceof ri&&t.type==="twilio_verification_failed")return{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:d.jsx(_c,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(t instanceof Ks))return t instanceof sl&&t.status&&[400,422].includes(t.status)?{title:"Something went wrong",detail:t.message,ctaText:"Try again",icon:r}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r};switch(t.privyErrorCode){case Ae.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:r};case Ae.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:t.message,ctaText:"Try another method",icon:r};case Ae.ALLOWLIST_REJECTED:return{title:e.errorTitle||"You don't have access to this app",detail:e.errorDetail||"Have you been invited?",ctaText:e.errorCtaText||"Try another account",icon:d.jsx(Ane,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case Ae.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:d.jsx("span",{})};case Ae.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:d.jsx("span",{})};case Ae.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:r};case Ae.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:r};case Ae.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:r};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:r}}}};const yZe=()=>{var s,o;let{navigate:t,navigateBack:e,data:r,lastScreen:n,currentScreen:i}=wt(),a=((s=r==null?void 0:r.errorModalData)==null?void 0:s.previousScreen)||(n===i?void 0:n);return d.jsx(_v,{error:((o=r==null?void 0:r.errorModalData)==null?void 0:o.error)||Error(),backFn:()=>a?t(a,!1):e(),onClick:()=>t(a||ye.LANDING,!1)})},_v=({error:t,backFn:e,onClick:r})=>{let{reset:n}=Ro(),{app:i}=wt(),a=mZe(t,i.allowlistConfig);return d.jsxs(d.Fragment,{children:[d.jsx(ft,{backFn:e}),d.jsxs(wZe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(uj,{color:"var(--privy-color-error)"}),a.icon]})}),d.jsxs(vZe,{children:[d.jsx("h3",{children:a.title}),d.jsx("p",{children:a.detail})]}),d.jsx(Ot,{color:"var(--privy-color-error)",onClick:()=>{t instanceof Ks&&(t.privyErrorCode===Ae.INVALID_CAPTCHA&&n(),t.privyErrorCode===Ae.ALLOWLIST_REJECTED&&i.allowlistConfig.errorCtaLink)?window.location.href=i.allowlistConfig.errorCtaLink:r==null||r()},children:a.ctaText})]})]})};let wZe=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-1d84a574-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;padding-bottom:16px;"]),vZe=fe.div.withConfig({displayName:"GappedContainer",componentId:"sc-1d84a574-1"})(["display:flex;flex-direction:column;gap:8px;"]);const Uae=({style:t,color:e,...r})=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:e||"currentColor",style:{height:"1.5rem",width:"1.5rem",...t},...r,children:d.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),bZe=({color:t,...e})=>d.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...e,children:d.jsx("g",{children:d.jsx("path",{fill:t||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),b7=t=>{let[e,r]=_.useState(!1);return d.jsxs(xZe,{color:t.color,onClick:()=>{r(!0),navigator.clipboard.writeText(t.text),setTimeout(()=>r(!1),1500)},justCopied:e,children:[e?d.jsx(Uae,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):d.jsx(bZe,{style:{height:"14px",width:"14px"}}),e?"Copied":"Copy"," ",t.itemName?t.itemName:"to Clipboard"]})};let xZe=fe.button.withConfig({displayName:"StyledCopytoClipboardButton",componentId:"sc-9c2ee64b-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],t=>t.justCopied?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.justCopied?"medium":"normal",t=>t.justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");const Bae=t=>{let[e,r]=_.useState(!1);return d.jsx(EZe,{color:t.color,href:t.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:e,children:t.text})};let EZe=fe.a.withConfig({displayName:"StyledOpenLinkButton",componentId:"sc-4e695c83-0"})(["display:flex;align-items:center;gap:6px;&&{margin:8px 2px;font-size:14px;color:",";font-weight:",";transition:color 350ms ease;:focus,:active{background-color:transparent;border:none;outline:none;box-shadow:none;}:hover{color:",";}:active{color:'var(--privy-color-foreground)';font-weight:medium;}@media (max-width:440px){margin:12px 2px;}}svg{width:14px;height:14px;}"],t=>t.justOpened?"var(--privy-color-foreground)":t.color||"var(--privy-color-foreground-3)",t=>t.justOpened?"medium":"normal",t=>t.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)");var Cv={},_Ze=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},zae={},Fo={};let Jj;const CZe=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Fo.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17};Fo.getSymbolTotalCodewords=function(e){return CZe[e]};Fo.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e};Fo.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');Jj=e};Fo.isKanjiModeEnabled=function(){return typeof Jj<"u"};Fo.toSJIS=function(e){return Jj(e)};var x7={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,i){if(t.isValid(n))return n;try{return e(n)}catch{return i}}})(x7);function Wae(){this.buffer=[],this.length=0}Wae.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var SZe=Wae;function Sv(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Sv.prototype.set=function(t,e,r,n){const i=t*this.size+e;this.data[i]=r,n&&(this.reservedBit[i]=!0)};Sv.prototype.get=function(t,e){return this.data[t*this.size+e]};Sv.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r};Sv.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var AZe=Sv,Hae={};(function(t){const e=Fo.getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const i=Math.floor(n/7)+2,a=e(n),s=a===145?26:Math.ceil((a-13)/(2*i-2))*2,o=[a-7];for(let l=1;l=0&&i<=7},t.from=function(i){return t.isValid(i)?parseInt(i,10):void 0},t.getPenaltyN1=function(i){const a=i.size;let s=0,o=0,l=0,c=null,u=null;for(let f=0;f=5&&(s+=e.N1+(o-5)),c=g,o=1),g=i.get(h,f),g===u?l++:(l>=5&&(s+=e.N1+(l-5)),u=g,l=1)}o>=5&&(s+=e.N1+(o-5)),l>=5&&(s+=e.N1+(l-5))}return s},t.getPenaltyN2=function(i){const a=i.size;let s=0;for(let o=0;o=10&&(o===1488||o===93)&&s++,l=l<<1&2047|i.get(u,c),u>=10&&(l===1488||l===93)&&s++}return s*e.N3},t.getPenaltyN4=function(i){let a=0;const s=i.data.length;for(let l=0;l=0;){const s=a[0];for(let l=0;l0){const a=new Uint8Array(this.degree);return a.set(n,i),a}return n};var MZe=Qj,Kae={},$h={},Zj={};Zj.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var Ou={};const Jae="[0-9]+",TZe="[A-Z $%*+\\-./:]+";let ow="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";ow=ow.replace(/u/g,"\\u");const kZe="(?:(?![A-Z0-9 $%*+\\-./:]|"+ow+`)(?:.|[\r +]))+`;Ou.KANJI=new RegExp(ow,"g");Ou.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Ou.BYTE=new RegExp(kZe,"g");Ou.NUMERIC=new RegExp(Jae,"g");Ou.ALPHANUMERIC=new RegExp(TZe,"g");const NZe=new RegExp("^"+ow+"$"),LZe=new RegExp("^"+Jae+"$"),jZe=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Ou.testKanji=function(e){return NZe.test(e)};Ou.testNumeric=function(e){return LZe.test(e)};Ou.testAlphanumeric=function(e){return jZe.test(e)};(function(t){const e=Zj,r=Ou;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(a,s){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!e.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?a.ccBits[0]:s<27?a.ccBits[1]:a.ccBits[2]},t.getBestModeForData=function(a){return r.testNumeric(a)?t.NUMERIC:r.testAlphanumeric(a)?t.ALPHANUMERIC:r.testKanji(a)?t.KANJI:t.BYTE},t.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},t.isValid=function(a){return a&&a.bit&&a.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+i)}}t.from=function(a,s){if(t.isValid(a))return a;try{return n(a)}catch{return s}}})($h);(function(t){const e=Fo,r=E7,n=x7,i=$h,a=Zj,s=7973,o=e.getBCHDigit(s);function l(h,g,m){for(let w=1;w<=40;w++)if(g<=t.getCapacity(w,m,h))return w}function c(h,g){return i.getCharCountIndicator(h,g)+4}function u(h,g){let m=0;return h.forEach(function(w){const C=c(w.mode,g);m+=C+w.getBitsLength()}),m}function f(h,g){for(let m=1;m<=40;m++)if(u(h,m)<=t.getCapacity(m,g,i.MIXED))return m}t.from=function(g,m){return a.isValid(g)?parseInt(g,10):m},t.getCapacity=function(g,m,w){if(!a.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=i.BYTE);const C=e.getSymbolTotalCodewords(g),v=r.getTotalCodewordsCount(g,m),b=(C-v)*8;if(w===i.MIXED)return b;const A=b-c(w,g);switch(w){case i.NUMERIC:return Math.floor(A/10*3);case i.ALPHANUMERIC:return Math.floor(A/11*2);case i.KANJI:return Math.floor(A/13);case i.BYTE:default:return Math.floor(A/8)}},t.getBestVersionForData=function(g,m){let w;const C=n.from(m,n.M);if(Array.isArray(g)){if(g.length>1)return f(g,C);if(g.length===0)return 1;w=g[0]}else w=g;return l(w.mode,w.getLength(),C)},t.getEncodedBits=function(g){if(!a.isValid(g)||g<7)throw new Error("Invalid QR Code version");let m=g<<12;for(;e.getBCHDigit(m)-o>=0;)m^=s<=0;)i^=Zae<<$T.getBCHDigit(i)-VH;return(n<<10|i)^$Ze};var Xae={};const PZe=$h;function rm(t){this.mode=PZe.NUMERIC,this.data=t.toString()}rm.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)};rm.prototype.getLength=function(){return this.data.length};rm.prototype.getBitsLength=function(){return rm.getBitsLength(this.data.length)};rm.prototype.write=function(e){let r,n,i;for(r=0;r+3<=this.data.length;r+=3)n=this.data.substr(r,3),i=parseInt(n,10),e.put(i,10);const a=this.data.length-r;a>0&&(n=this.data.substr(r),i=parseInt(n,10),e.put(i,a*3+1))};var RZe=rm;const DZe=$h,WS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function nm(t){this.mode=DZe.ALPHANUMERIC,this.data=t}nm.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)};nm.prototype.getLength=function(){return this.data.length};nm.prototype.getBitsLength=function(){return nm.getBitsLength(this.data.length)};nm.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let n=WS.indexOf(this.data[r])*45;n+=WS.indexOf(this.data[r+1]),e.put(n,11)}this.data.length%2&&e.put(WS.indexOf(this.data[r]),6)};var OZe=nm;const FZe=$h;function im(t){this.mode=FZe.BYTE,typeof t=="string"?this.data=new TextEncoder().encode(t):this.data=new Uint8Array(t)}im.getBitsLength=function(e){return e*8};im.prototype.getLength=function(){return this.data.length};im.prototype.getBitsLength=function(){return im.getBitsLength(this.data.length)};im.prototype.write=function(t){for(let e=0,r=this.data.length;e=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+` +Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var WZe=am,ese={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,n,i){var a={},s={};s[n]=0;var o=e.PriorityQueue.make();o.push(n,0);for(var l,c,u,f,h,g,m,w,C;!o.empty();){l=o.pop(),c=l.value,f=l.cost,h=r[c]||{};for(u in h)h.hasOwnProperty(u)&&(g=h[u],m=f+g,w=s[u],C=typeof s[u]>"u",(C||w>m)&&(s[u]=m,o.push(u,m),a[u]=c))}if(typeof i<"u"&&typeof s[i]>"u"){var v=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(v)}return a},extract_shortest_path_from_predecessor_list:function(r,n){for(var i=[],a=n;a;)i.push(a),r[a],a=r[a];return i.reverse(),i},find_path:function(r,n,i){var a=e.single_source_shortest_paths(r,n,i);return e.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(r){var n=e.PriorityQueue,i={},a;r=r||{};for(a in n)n.hasOwnProperty(a)&&(i[a]=n[a]);return i.queue=[],i.sorter=r.sorter||n.default_sorter,i},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var i={value:r,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(ese);var HZe=ese.exports;(function(t){const e=$h,r=RZe,n=OZe,i=UZe,a=WZe,s=Ou,o=Fo,l=HZe;function c(v){return unescape(encodeURIComponent(v)).length}function u(v,b,A){const S=[];let j;for(;(j=v.exec(A))!==null;)S.push({data:j[0],index:j.index,mode:b,length:j[0].length});return S}function f(v){const b=u(s.NUMERIC,e.NUMERIC,v),A=u(s.ALPHANUMERIC,e.ALPHANUMERIC,v);let S,j;return o.isKanjiModeEnabled()?(S=u(s.BYTE,e.BYTE,v),j=u(s.KANJI,e.KANJI,v)):(S=u(s.BYTE_KANJI,e.BYTE,v),j=[]),b.concat(A,S,j).sort(function(I,B){return I.index-B.index}).map(function(I){return{data:I.data,mode:I.mode,length:I.length}})}function h(v,b){switch(b){case e.NUMERIC:return r.getBitsLength(v);case e.ALPHANUMERIC:return n.getBitsLength(v);case e.KANJI:return a.getBitsLength(v);case e.BYTE:return i.getBitsLength(v)}}function g(v){return v.reduce(function(b,A){const S=b.length-1>=0?b[b.length-1]:null;return S&&S.mode===A.mode?(b[b.length-1].data+=A.data,b):(b.push(A),b)},[])}function m(v){const b=[];for(let A=0;A=0&&o<=6&&(l===0||l===6)||l>=0&&l<=6&&(o===0||o===6)||o>=2&&o<=4&&l>=2&&l<=4?t.set(a+o,s+l,!0,!0):t.set(a+o,s+l,!1,!0))}}function XZe(t){const e=t.size;for(let r=8;r>o&1)===1,t.set(i,a,s,!0),t.set(a,i,s,!0)}function qS(t,e,r){const n=t.size,i=JZe.getEncodedBits(e,r);let a,s;for(a=0;a<15;a++)s=(i>>a&1)===1,a<6?t.set(a,8,s,!0):a<8?t.set(a+1,8,s,!0):t.set(n-15+a,8,s,!0),a<8?t.set(8,n-a-1,s,!0):a<9?t.set(8,15-a-1+1,s,!0):t.set(8,15-a-1,s,!0);t.set(n-8,8,1,!0)}function rXe(t,e){const r=t.size;let n=-1,i=r-1,a=7,s=0;for(let o=r-1;o>0;o-=2)for(o===6&&o--;;){for(let l=0;l<2;l++)if(!t.isReserved(i,o-l)){let c=!1;s>>a&1)===1),t.set(i,o-l,c),a--,a===-1&&(s++,a=7)}if(i+=n,i<0||r<=i){i-=n,n=-n;break}}}function nXe(t,e,r){const n=new GZe;r.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),QZe.getCharCountIndicator(l.mode,t)),l.write(n)});const i=C7.getSymbolTotalCodewords(t),a=RT.getTotalCodewordsCount(t,e),s=(i-a)*8;for(n.getLengthInBits()+4<=s&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const o=(s-n.getLengthInBits())/8;for(let l=0;l=7&&kQe(l,e),NQe(l,s),isNaN(n)&&(n=CT.getBestMask(l,DS.bind(null,l,r))),CT.applyMask(n,l),DS(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}bae.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=PS.M,i,a;return typeof r<"u"&&(n=PS.from(r.errorCorrectionLevel,PS.M),i=b8.from(r.version),a=CT.from(r.maskPattern),r.toSJISFunc&&g7.setToSJISFunction(r.toSJISFunc)),$Qe(e,i,n,a)};var jae={},zj={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:a,scale:a?4:s,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const a=t.getScale(n,i);return Math.floor((n+i.margin*2)*a)},t.qrToImageData=function(n,i,a){const s=i.modules.size,o=i.modules.data,l=t.getScale(s,a),c=Math.floor((s+a.margin*2)*l),u=a.margin*l,f=[a.color.light,a.color.dark];for(let h=0;h=u&&g>=u&&h"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=n()),l=e.getOptions(l);const u=e.getImageWidth(a.modules.size,l),f=c.getContext("2d"),h=f.createImageData(u,u);return e.qrToImageData(h.data,a,l),r(f,c,u),f.putImageData(h,0,0),c},t.renderToDataURL=function(a,s,o){let l=o;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=t.render(a,s,l),u=l.type||"image/png",f=l.rendererOpts||{};return c.toDataURL(u,f.quality)}})(jae);var $ae={};const PQe=zj;function PH(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function OS(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function RQe(t,e,r){let n="",i=0,a=!1,s=0;for(let o=0;o0&&l>0&&t[o-1]||(n+=a?OS("M",l+r,.5+c+r):OS("m",i,0),i=0,a=!1),l+1':"",c="',u='viewBox="0 0 '+o+" "+o+'"',h=''+l+c+` -`;return typeof n=="function"&&n(null,h),h};const DQe=QZe,AT=bae,Pae=jae,OQe=$ae;function Wj(t,e,r,n,i){const a=[].slice.call(arguments,1),s=a.length,o=typeof a[s-1]=="function";if(!o&&!DQe())throw new Error("Callback required as last argument");if(o){if(s<2)throw new Error("Too few arguments provided");s===2?(i=r,r=e,e=n=void 0):s===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=e,e=n=void 0):s===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(l,c){try{const u=AT.create(r,n);l(t(u,e,n))}catch(u){c(u)}})}try{const l=AT.create(r,n);i(null,t(l,e,n))}catch(l){i(l)}}mv.create=AT.create;mv.toCanvas=Wj.bind(null,Pae.render);mv.toDataURL=Wj.bind(null,Pae.renderToDataURL);mv.toString=Wj.bind(null,function(t,e,r){return OQe.render(t,r)});const FQe=()=>d.jsx("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:d.jsx("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let FS=(t,e,r,n,i)=>{for(let a=e;a{let r=mv.create(t,{errorCorrectionLevel:e}).modules,n=vMe(Array.from(r.data),r.size);return n=FS(n,0,0,7,7),n=FS(n,n.length-7,0,7,7),FS(n,0,n.length-7,7,7)},BQe=({x:t,y:e,cellSize:r,bgColor:n,fgColor:i})=>d.jsx(d.Fragment,{children:[0,1,2].map(a=>d.jsx("circle",{r:r*(7-2*a)/2,cx:t+7*r/2,cy:e+7*r/2,fill:a%2!=0?n:i},`finder-${t}-${e}-${a}`))}),zQe=({cellSize:t,matrixSize:e,bgColor:r,fgColor:n})=>d.jsx(d.Fragment,{children:[[0,0],[(e-7)*t,0],[0,(e-7)*t]].map(([i,a])=>d.jsx(BQe,{x:i,y:a,cellSize:t,bgColor:r,fgColor:n},`finder-${i}-${a}`))}),WQe=({matrix:t,cellSize:e,color:r})=>d.jsx(d.Fragment,{children:t.map((n,i)=>n.map((a,s)=>a?d.jsx("rect",{height:e-.4,width:e-.4,x:i*e+.1*e,y:s*e+.1*e,rx:.5*e,ry:.5*e,fill:r},`cell-${i}-${s}`):d.jsx(Et.Fragment,{},`circle-${i}-${s}`)))}),HQe=({cellSize:t,matrixSize:e,element:r,sizePercentage:n,bgColor:i})=>{if(!r)return d.jsx(d.Fragment,{});let a=e*(n||.14),s=Math.floor(e/2-a/2),o=Math.floor(e/2+a/2);(o-s)%2!=e%2&&(o+=1);let l=(o-s)*t,c=l-.2*l,u=s*t;return d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:s*t,y:s*t,width:l,height:l,fill:i}),d.jsx(r,{x:u+.1*l,y:u+.1*l,height:c,width:c})]})},GQe=t=>{var a;let e=t.outputSize,r=UQe(t.url,t.errorCorrectionLevel),n=e/r.length,i=SMe(2*n,{min:.025*e,max:.036*e});return d.jsxs("svg",{height:t.outputSize,width:t.outputSize,viewBox:`0 0 ${t.outputSize} ${t.outputSize}`,style:{height:"100%",width:"100%",padding:`${i}px`},children:[d.jsx(WQe,{matrix:r,cellSize:n,color:t.fgColor}),d.jsx(zQe,{cellSize:n,matrixSize:r.length,fgColor:t.fgColor,bgColor:t.bgColor}),d.jsx(HQe,{cellSize:n,element:(a=t.logo)==null?void 0:a.element,bgColor:t.bgColor,matrixSize:r.length})]})},qQe=fe.div.withConfig({displayName:"QrContainer",componentId:"sc-aa6883ae-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],t=>`${t.$size}px`,t=>`${t.$size}px`,t=>t.$bgColor,t=>t.$borderColor);const m7=t=>{let{appearance:e}=Ai(),r=t.bgColor||"#FFFFFF",n=t.fgColor||"#000000",i=t.size||160,a=e.palette.colorScheme==="dark"?r:n;return d.jsx(qQe,{$size:i,$bgColor:r,$fgColor:n,$borderColor:a,children:d.jsx(GQe,{url:t.url,logo:{element:t.squareLogoElement??FQe},outputSize:i,bgColor:r,fgColor:n,errorCorrectionLevel:t.errorCorrectionLevel||"Q"})})},N0=({style:t,...e})=>d.jsxs("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...t},...e,children:[d.jsx("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),d.jsx("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),d.jsx("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),d.jsx("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});let RH="#8a63d2";const VQe=()=>{let{authenticated:t,logout:e,ready:r,user:n}=$r(),{lastScreen:i,navigate:a,navigateBack:s,setModalData:o,app:l}=wt(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:f,createAnalyticsEvent:h}=_t(),[g,m]=C.useState(void 0),[w,_]=C.useState(!1),[v,b]=C.useState(!1),A=C.useRef([]),S=c(),j=S==null?void 0:S.meta.connectUri;return C.useEffect(()=>{let U=Date.now(),I=setInterval(async()=>{var se,Y,N,k,x,E,L,O,P,R,M,D,$,X,le;let B=await S.pollForReady.execute(),V=Date.now()-U;if(B){clearInterval(I),_(!0);try{await u(),b(!0)}catch(H){let ee={retryable:!1,message:"Authentication failed"};if((H==null?void 0:H.privyErrorCode)===Ae.ALLOWLIST_REJECTED)return void a(ye.ALLOWLIST_REJECTION_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.USER_LIMIT_REACHED)return console.error(new Fw(H).toString()),void a(ye.USER_LIMIT_REACHED_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.USER_DOES_NOT_EXIST)return void a(ye.ACCOUNT_NOT_FOUND_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER)ee.detail=H.message??"This account has already been linked to another user.";else{if((H==null?void 0:H.privyErrorCode)===Ae.ACCOUNT_TRANSFER_REQUIRED&&((Y=(se=H.data)==null?void 0:se.data)!=null&&Y.nonce))return o({accountTransfer:{nonce:(k=(N=H.data)==null?void 0:N.data)==null?void 0:k.nonce,account:(E=(x=H.data)==null?void 0:x.data)==null?void 0:E.subject,displayName:(P=(O=(L=H.data)==null?void 0:L.data)==null?void 0:O.account)==null?void 0:P.displayName,linkMethod:"farcaster",embeddedWalletAddress:(D=(M=(R=H.data)==null?void 0:R.data)==null?void 0:M.otherUser)==null?void 0:D.embeddedWalletAddress,farcasterEmbeddedAddress:(le=(X=($=H.data)==null?void 0:$.data)==null?void 0:X.otherUser)==null?void 0:le.farcasterEmbeddedAddress}}),void a(ye.LINK_CONFLICT_SCREEN);(H==null?void 0:H.privyErrorCode)===Ae.INVALID_CREDENTIALS?(ee.retryable=!0,ee.detail="Something went wrong. Try again."):(H==null?void 0:H.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&(ee.detail="Too many requests. Please wait before trying again.")}m(ee)}}else V>12e4&&(clearInterval(I),m({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},2e3);return()=>{clearInterval(I),A.current.forEach(B=>clearTimeout(B))}},[]),C.useEffect(()=>{if(r&&t&&v&&n){if(l!=null&&l.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let U=setTimeout(()=>{a(ye.AFFIRMATIVE_CONSENT_SCREEN)},Dn);return()=>clearTimeout(U)}v&&(Od(n,l==null?void 0:l.embeddedWallets.createOnLogin)?A.current.push(setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:U=>{console.error(U),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:U,screen:"FarcasterConnectStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Dn)):A.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn)))}},[v,r,t,n]),d.jsxs(d.Fragment,ma||w?{children:[d.jsx(ft,{backFn:i?s:void 0,onClose:f},"header"),d.jsx(tn,{}),d.jsx(d.Fragment,_N?{children:d.jsxs(YQe,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(wc,{success:v,fail:!!g}),d.jsx(N0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(Io,{children:[d.jsx(hn,{children:g?g.message:"Sign in with Farcaster"}),d.jsx(pn,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),j&&d.jsx(Ot,{onClick:U=>{U.preventDefault(),window.location.href=j},children:"Open Warpcast app"})]})}:{children:d.jsxs(DH,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(wc,{success:v,fail:!!g}),d.jsx(N0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(Io,{children:[d.jsx(hn,{children:g?g.message:"Signing in with Farcaster"}),d.jsx(pn,{children:g?g.detail:"This should only take a moment"}),d.jsx(bc,{children:j&&ma&&d.jsx(vae,{text:"Take me to Warpcast",url:j,color:RH})})]})]})}),d.jsx(kr,{})]}:{children:[d.jsx(ft,{backFn:i?s:void 0,onClose:f},"header"),d.jsx(tn,{}),d.jsx(DH,{children:d.jsxs("div",{children:[d.jsx(hn,{children:"Sign in with Farcaster"}),d.jsx(pn,{children:"Scan with your phone's camera to continue."}),d.jsx(rj,{children:j?d.jsx(m7,{url:j,size:275,squareLogoElement:N0}):d.jsx(ml,{})}),d.jsxs(bc,{children:[d.jsx(pn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),j&&d.jsx(d7,{text:j,itemName:"link",color:RH})]})]})}),d.jsx(kr,{})]})};let DH=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-5a361367-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),YQe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-5a361367-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),OH="#8a63d2";const KQe=()=>{let{lastScreen:t,navigateBack:e,data:r,app:n}=wt(),{requestFarcasterSignerStatus:i,closePrivyModal:a}=_t(),[s,o]=C.useState(void 0),[l,c]=C.useState(!1),[u,f]=C.useState(!1),h=C.useRef([]),g=r==null?void 0:r.farcasterSigner;C.useEffect(()=>{let w=Date.now(),_=setInterval(async()=>{if(!(g!=null&&g.public_key))return clearInterval(_),void o({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});g.status==="approved"&&(clearInterval(_),c(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Dn)));let v=await i(g==null?void 0:g.public_key),b=Date.now()-w;v.status==="approved"?(clearInterval(_),c(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Dn))):b>3e5?(clearInterval(_),o({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):v.status==="revoked"&&(clearInterval(_),o({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},2e3);return()=>{clearInterval(_),h.current.forEach(v=>clearTimeout(v))}},[]);let m=(g==null?void 0:g.status)==="pending_approval"?g.signer_approval_url:void 0;return d.jsxs(d.Fragment,ma||l?{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:a},"header"),d.jsx(tn,{}),d.jsx(d.Fragment,_N?{children:d.jsxs(JQe,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(wc,{success:u,fail:!!s}),d.jsx(N0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(Io,{children:[d.jsx(hn,{children:s?s.message:"Add a signer to Farcaster"}),d.jsx(pn,{children:s?s.detail:"This will allow "+n.name+" to add casts, likes, follows, and more on your behalf."})]}),m&&d.jsx(Ot,{onClick:w=>{w.preventDefault(),window.location.href=m},children:"Open Warpcast app"})]})}:{children:d.jsxs(FH,{children:[d.jsx(Vs,{children:d.jsxs("div",{children:[d.jsx(wc,{success:u,fail:!!s}),d.jsx(N0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(Io,{children:[d.jsx(hn,{children:s?s.message:"Requesting signer from Farcaster"}),d.jsx(pn,{children:s?s.detail:"This should only take a moment"}),d.jsx(bc,{children:m&&ma&&d.jsx(vae,{text:"Take me to Warpcast",url:m,color:OH})})]})]})}),d.jsx(kr,{})]}:{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:a},"header"),d.jsx(tn,{}),d.jsx(FH,{children:d.jsxs("div",{children:[d.jsx(hn,{children:"Add a signer to Farcaster"}),d.jsxs(pn,{children:["This will allow ",n.name," to add casts, likes, follows, and more on your behalf."]}),d.jsx(rj,{children:(g==null?void 0:g.status)==="pending_approval"?d.jsx(m7,{url:g.signer_approval_url,size:275,squareLogoElement:N0}):d.jsx(ml,{})}),d.jsxs(bc,{children:[d.jsx(pn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),(g==null?void 0:g.status)==="pending_approval"&&d.jsx(d7,{text:g.signer_approval_url,itemName:"link",color:OH})]})]})}),d.jsx(kr,{})]})};let FH=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-6e2c96cd-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),JQe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-6e2c96cd-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);function Ks({title:t}){var s,o;let{currentScreen:e,navigateBack:r,navigate:n,data:i,setModalData:a}=wt();return d.jsx(ft,{title:t,backFn:e===ye.FUNDING_MANUAL_TRANSFER_SCREEN?r:e===((s=i==null?void 0:i.funding)==null?void 0:s.methodScreen)?i.funding.comingFromSendTransactionScreen?()=>n(ye.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN):void 0:(o=i==null?void 0:i.funding)!=null&&o.methodScreen?()=>{let l=i.funding;l.usingDefaultFundingMethod&&(l.usingDefaultFundingMethod=!1),a({funding:l}),n(l.methodScreen)}:void 0})}const Fm=({size:t})=>d.jsx(ZQe,{$size:t,children:d.jsxs(QQe,{children:[d.jsx(XQe,{}),d.jsx(eXe,{})]})});let ZQe=fe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-3ddaba1c-0"})(["--spinner-size:",";display:flex;justify-content:center;align-items:center;flex-grow:1;@media all and (display-mode:standalone){margin-bottom:30px;}"],t=>t.$size?t.$size:"96px"),QQe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-3ddaba1c-1"})(["position:relative;height:var(--spinner-size);width:var(--spinner-size);opacity:1;animation:fadein 200ms ease;"]),XQe=fe.div.withConfig({displayName:"CircleFixed",componentId:"sc-3ddaba1c-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);&&{border:4px solid #f1f2f9;border-radius:50%;}"]),eXe=fe.div.withConfig({displayName:"CircleRotate",componentId:"sc-3ddaba1c-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:#cbcde1 transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const Rae=({enabled:t=!0}={})=>{let{showFiatPrices:e,getUsdPriceForSol:r}=_t(),[n,i]=C.useState(!0),[a,s]=C.useState(void 0),[o,l]=C.useState(void 0);return C.useEffect(()=>{(async()=>{if(e&&t)try{i(!0);let c=await r();c?l(c):s(Error("Unable to fetch SOL price"))}catch(c){s(c)}finally{i(!1)}else i(!1)})()},[]),{solPrice:o,isSolPriceLoading:n,solPriceError:a}};function Um(t){let{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}=(o=>{let{showFiatPrices:l,getUsdTokenPrice:c,chains:u}=_t(),[f,h]=C.useState(!0),[g,m]=C.useState(void 0),[w,_]=C.useState(void 0);return C.useEffect(()=>{o||(o=O3);let v=GL(u).find(b=>b.id===Number(o));(async()=>{if(l){if(!v)return h(!1),void m(Error(`Unable to fetch token price on chain id ${o}`));try{h(!0);let b=await c(v);b?_(b):m(Error(`Unable to fetch token price on chain id ${v.id}`))}catch(b){m(b)}finally{h(!1)}}else h(!1)})()},[o]),{tokenPrice:w,isTokenPriceLoading:f,tokenPriceError:g}})(t==="solana"?-1:t),{solPrice:i,isSolPriceLoading:a,solPriceError:s}=Rae({enabled:t==="solana"});return t==="solana"?{tokenPrice:i,isTokenPriceLoading:a,tokenPriceError:s}:{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}}const Dae=C.createContext(null);function L1(){let t=C.useContext(Dae);return t===null?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):t}const Gd="sdk_fiat_on_ramp_completed_with_status";let UH="0x0000000000000000000000000000000000000000";const X3=({destinationCurrency:t,...e})=>({tradeType:"EXACT_OUTPUT",originCurrency:UH,destinationCurrency:t??UH,...e}),ew=async({input:t,isTestnet:e})=>{let r=await fetch(e?"https://api.testnets.relay.link/execute/swap":"https://api.relay.link/execute/swap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json();if(!(r.ok||typeof n.message=="string"&&n.message.startsWith("Invalid address")))throw console.error("Relay error:",n),Error(n.message??"Error fetching quote from relay");return n},x8=t=>{var r,n;let e=(n=(r=t.steps[0])==null?void 0:r.items)==null?void 0:n[0];if(e)return{from:e.data.from,to:e.data.to,value:Number(e.data.value),chainId:Number(e.data.chainId),data:e.data.data}},tXe=(t,e=0)=>{let r=t[e],n=t[e+7];if(!r||!n)throw Error(`Buffer offset out of range: first: ${r}, last: ${n}.`);return(BigInt(t[e+4]+256*t[e+5]+65536*t[e+6]+(n<<24))<<32n)+BigInt(r+256*t[++e]+65536*t[++e]+16777216*t[++e])};let rXe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function Zf(t,e=6,r=!1,n=!1){let i=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),a=n?"":" SOL";return r?`${i}${a}`:`${i==="0"?"<0.001":i}${a}`}function L0(t,e){let r=parseFloat(t.toString())/1e9,n=rXe.format(e*r);return n==="$0.00"?"<$0.01":n}function Oae({amount:t,fee:e,tokenPrice:r}){let n=BigInt(1e9*parseFloat(t)),i=n+e;return{fundingAmountInBaseUnit:n,fundingAmountInUsd:r?L0(n,r):void 0,totalPriceInUsd:r?L0(i,r):void 0,totalPriceInNativeCurrency:Zf(i),feePriceInNativeCurrency:Zf(e),feePriceInUsd:r?L0(e,r):void 0}}function Th(t){return"version"in t}function US(t,e,r=0){var a,s,o;let n=e==="from"?0:e==="to"?1:2;if(Th(t)){let l=t.message.getAccountKeys(),c=(a=t.message.compiledInstructions.at(r))==null?void 0:a.accountKeyIndexes[n];return c&&l.get(c)||null}let i=(o=(s=t.instructions.at(r))==null?void 0:s.keys.at(n))==null?void 0:o.pubkey;if(i==null)throw Error(`Transaction does not contain a "${e}" public key`);return i}function nXe(t,e=!1,r=0){var a,s;let n=e?1:4;if(Th(t)){let o=(a=t.message.compiledInstructions.at(r))==null?void 0:a.data;if(!o)return 0n;try{return tXe(Buffer.from(o),n)}catch{return 0n}}let i=(s=t.instructions.at(r))==null?void 0:s.data.readBigInt64LE(n);return i??0n}function iXe(t,e){if(Th(t)){let n=t.message.staticAccountKeys.find(i=>i.toBase58()===e);if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}let r=t.compileMessage().accountKeys.find(n=>n.toBase58()===e);if(!r)throw Error(`Transaction does not contain public key ${e}`);return r}function aXe(t,e=0){var n,i,a;let r;if(Th(t)){let s=(n=t.message.compiledInstructions.at(e))==null?void 0:n.programIdIndex;if(s==null)throw Error("Transaction does not contain a Program ID");r=(i=t.message.getAccountKeys().get(s))==null?void 0:i.toBase58()}else r=(a=t.instructions.at(e))==null?void 0:a.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");return r==="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"?"approve":r==="11111111111111111111111111111111"?"transfer":"instruction"}async function sXe(t,e){return Th(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e)}function Fae(t,e){var r;return{signature:t,parsedTransaction:e,fees:BigInt(((r=e==null?void 0:e.meta)==null?void 0:r.fee)||0)}}async function Uae(t,e){let r=[],n=Th(t)?t.message.compiledInstructions.length:t.instructions.length,i={},a=BigInt(await sXe(t,e)||0);for(let s=0;s=u})}return{fees:a,instructions:r}}const Bae=({chains:t,appId:e,address:r,rpcConfig:n})=>Promise.all(t.map(async i=>({balance:await yc({chain:i,transport:mc(ih(i,n,e))}).getBalance({address:r}).catch(()=>0n),chain:i})));let zae=C.createContext({plugins:{current:{}}});const oXe=({children:t})=>{let e=C.useRef({});return d.jsx(zae.Provider,{value:{plugins:e},children:t})},wv=()=>{let{plugins:t}=C.useContext(zae);return C.useCallback(e=>t.current[e],[t])},vv=Symbol("solana-funding-plugin"),bv=fe.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),Yr=fe.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),qr=fe.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),lXe=fe(qr).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),cn=fe.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],one);function cXe({title:t,titleId:e,...r},n){return C.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?C.createElement("title",{id:e},t):null,C.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const Wae=C.forwardRef(cXe),uXe=t=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...t,children:d.jsx("g",{id:"Layer_x0020_1",children:d.jsxs("g",{id:"_2405588477232",children:[d.jsx("rect",{fill:"none",width:"2500",height:"2500"}),d.jsx("g",{children:d.jsxs("g",{children:[d.jsx("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),d.jsx("g",{children:d.jsxs("g",{children:[d.jsx("g",{children:d.jsx("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),d.jsx("g",{children:d.jsx("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),d.jsx("g",{children:d.jsx("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),d.jsx("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),d.jsxs("g",{children:[d.jsx("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),d.jsx("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),dXe=t=>d.jsxs("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),fXe=t=>d.jsxs("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),d.jsx("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),hXe=t=>d.jsxs("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),d.jsx("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),pXe=t=>d.jsxs("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"199.4",height:"207.623",fill:"#121212"}),d.jsxs("g",{"clip-path":"url(#clip0_2303_643)",children:[d.jsx("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),d.jsx("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_2303_643",children:d.jsx("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),gXe=t=>d.jsxs("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...t,children:[d.jsx("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),d.jsx("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),d.jsx("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),d.jsx("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),d.jsx("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),mXe=t=>d.jsxs("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),d.jsx("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),d.jsx("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),yXe=t=>d.jsxs("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),d.jsx("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),wXe=t=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...t,children:[d.jsxs("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),d.jsxs("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),d.jsxs("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]}),vXe=t=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...t,children:[d.jsx("g",{clipPath:"url(#clip0)",children:d.jsx("g",{clipPath:"url(#clip1)",children:d.jsx("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),d.jsxs("defs",{children:[d.jsxs("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[d.jsx("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),d.jsx("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),d.jsx("stop",{offset:"0.4982",stopColor:"#4281D3"}),d.jsx("stop",{offset:"0.666667",stopColor:"#2E427D"}),d.jsx("stop",{offset:"0.822917",stopColor:"#230101"}),d.jsx("stop",{offset:"1",stopColor:"#8F6B40"})]}),d.jsx("clipPath",{id:"clip0",children:d.jsx("rect",{width:"30",height:"30",fill:"white"})}),d.jsx("clipPath",{id:"clip1",children:d.jsx("rect",{width:"30",height:"30",fill:"white"})})]})]});let bXe={[xh.id]:uXe,[PL.id]:dXe,[Yd.id]:fXe,[RL.id]:hXe,[Zte.id]:pXe,[Nu.id]:gXe,[x1.id]:mXe,[Kd.id]:yXe,[tre.id]:vXe};const Hae=({chainId:t,...e})=>{if(t==="solana")return d.jsx(wXe,{...e});let r=bXe[t];return d.jsx(r||Wae,{...e})},xXe=({balance:t,className:e,chain:r})=>d.jsx(Mj,{className:e,$state:void 0,children:d.jsx(IT,{balance:t,chain:r})}),IT=({balance:t,chain:e})=>d.jsxs(d.Fragment,{children:[d.jsxs(EXe,{children:[d.jsx(CXe,{chainId:"id"in e?e.id:"solana"}),d.jsx(cn,{children:e.name})]}),d.jsxs(xc,{isLoading:!1,isPulsing:!1,color:"gray",children:[d.jsx(_Xe,{children:d.jsx(Xw,{})}),t]})]});let EXe=fe.div.withConfig({displayName:"Container",componentId:"sc-6d3c340d-0"})(["display:flex;align-items:center;"]),_Xe=fe.div.withConfig({displayName:"IconContainer",componentId:"sc-6d3c340d-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),CXe=fe(Hae).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-6d3c340d-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const Gae=typeof document<"u"?Et.useLayoutEffect:()=>{};function SXe(t){const e=C.useRef(null);return Gae(()=>{e.current=t},[t]),C.useCallback((...r)=>{const n=e.current;return n==null?void 0:n(...r)},[])}const xv=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},b0=t=>t&&"window"in t&&t.window===t?t:xv(t).defaultView||window;function AXe(t){var e;return typeof window>"u"||window.navigator==null?!1:((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands.some(r=>t.test(r.brand)))||t.test(window.navigator.userAgent)}function IXe(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function qae(t){let e=null;return()=>(e==null&&(e=t()),e)}const MXe=qae(function(){return IXe(/^Mac/i)}),TXe=qae(function(){return AXe(/Android/i)});function kXe(t){return t.mozInputSource===0&&t.isTrusted?!0:TXe()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}class NXe{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,r){this.nativeEvent=r,this.target=r.target,this.currentTarget=r.currentTarget,this.relatedTarget=r.relatedTarget,this.bubbles=r.bubbles,this.cancelable=r.cancelable,this.defaultPrevented=r.defaultPrevented,this.eventPhase=r.eventPhase,this.isTrusted=r.isTrusted,this.timeStamp=r.timeStamp,this.type=e}}function Vae(t){let e=C.useRef({isFocused:!1,observer:null});Gae(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=SXe(n=>{t==null||t(n)});return C.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){e.current.isFocused=!0;let i=n.target,a=s=>{e.current.isFocused=!1,i.disabled&&r(new NXe("blur",s)),e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",a,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var s;(s=e.current.observer)===null||s===void 0||s.disconnect();let o=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[r])}function LXe(t){let{isDisabled:e,onFocus:r,onBlur:n,onFocusChange:i}=t;const a=C.useCallback(l=>{if(l.target===l.currentTarget)return n&&n(l),i&&i(!1),!0},[n,i]),s=Vae(a),o=C.useCallback(l=>{const c=xv(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(r&&r(l),i&&i(!0),s(l))},[i,r,s]);return{focusProps:{onFocus:!e&&(r||i||n)?o:void 0,onBlur:!e&&(n||i)?a:void 0}}}let Ev=null,MT=new Set,Fy=new Map,a1=!1,TT=!1;const jXe={Tab:!0,Escape:!0};function Hj(t,e){for(let r of MT)r(t,e)}function $Xe(t){return!(t.metaKey||!MXe()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function E8(t){a1=!0,$Xe(t)&&(Ev="keyboard",Hj("keyboard",t))}function al(t){Ev="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(a1=!0,Hj("pointer",t))}function Yae(t){kXe(t)&&(a1=!0,Ev="virtual")}function Kae(t){t.target===window||t.target===document||(!a1&&!TT&&(Ev="virtual",Hj("virtual",t)),a1=!1,TT=!1)}function Jae(){a1=!1,TT=!0}function kT(t){if(typeof window>"u"||Fy.get(b0(t)))return;const e=b0(t),r=xv(t);let n=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){a1=!0,n.apply(this,arguments)},r.addEventListener("keydown",E8,!0),r.addEventListener("keyup",E8,!0),r.addEventListener("click",Yae,!0),e.addEventListener("focus",Kae,!0),e.addEventListener("blur",Jae,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",al,!0),r.addEventListener("pointermove",al,!0),r.addEventListener("pointerup",al,!0)):(r.addEventListener("mousedown",al,!0),r.addEventListener("mousemove",al,!0),r.addEventListener("mouseup",al,!0)),e.addEventListener("beforeunload",()=>{Zae(t)},{once:!0}),Fy.set(e,{focus:n})}const Zae=(t,e)=>{const r=b0(t),n=xv(t);e&&n.removeEventListener("DOMContentLoaded",e),Fy.has(r)&&(r.HTMLElement.prototype.focus=Fy.get(r).focus,n.removeEventListener("keydown",E8,!0),n.removeEventListener("keyup",E8,!0),n.removeEventListener("click",Yae,!0),r.removeEventListener("focus",Kae,!0),r.removeEventListener("blur",Jae,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",al,!0),n.removeEventListener("pointermove",al,!0),n.removeEventListener("pointerup",al,!0)):(n.removeEventListener("mousedown",al,!0),n.removeEventListener("mousemove",al,!0),n.removeEventListener("mouseup",al,!0)),Fy.delete(r))};function PXe(t){const e=xv(t);let r;return e.readyState!=="loading"?kT(t):(r=()=>{kT(t)},e.addEventListener("DOMContentLoaded",r)),()=>Zae(t,r)}typeof document<"u"&&PXe();function Qae(){return Ev!=="pointer"}const RXe=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function DXe(t,e,r){var n;const i=typeof window<"u"?b0(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?b0(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?b0(r==null?void 0:r.target).HTMLElement:HTMLElement,o=typeof window<"u"?b0(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return t=t||(r==null?void 0:r.target)instanceof i&&!RXe.has(r==null||(n=r.target)===null||n===void 0?void 0:n.type)||(r==null?void 0:r.target)instanceof a||(r==null?void 0:r.target)instanceof s&&(r==null?void 0:r.target.isContentEditable),!(t&&e==="keyboard"&&r instanceof o&&!jXe[r.key])}function OXe(t,e,r){kT(),C.useEffect(()=>{let n=(i,a)=>{DXe(!!(r!=null&&r.isTextInput),i,a)&&t(Qae())};return MT.add(n),()=>{MT.delete(n)}},e)}function FXe(t){let{isDisabled:e,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=t,a=C.useRef({isFocusWithin:!1}),s=C.useCallback(c=>{a.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(a.current.isFocusWithin=!1,r&&r(c),i&&i(!1))},[r,i,a]),o=Vae(s),l=C.useCallback(c=>{!a.current.isFocusWithin&&document.activeElement===c.target&&(n&&n(c),i&&i(!0),a.current.isFocusWithin=!0,o(c))},[n,i,o]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let _8=!1,BS=0;function NT(){_8=!0,setTimeout(()=>{_8=!1},50)}function BH(t){t.pointerType==="touch"&&NT()}function UXe(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",BH):document.addEventListener("touchend",NT),BS++,()=>{BS--,!(BS>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",BH):document.removeEventListener("touchend",NT))}}function BXe(t){let{onHoverStart:e,onHoverChange:r,onHoverEnd:n,isDisabled:i}=t,[a,s]=C.useState(!1),o=C.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;C.useEffect(UXe,[]);let{hoverProps:l,triggerHoverEnd:c}=C.useMemo(()=>{let u=(g,m)=>{if(o.pointerType=m,i||m==="touch"||o.isHovered||!g.currentTarget.contains(g.target))return;o.isHovered=!0;let w=g.currentTarget;o.target=w,e&&e({type:"hoverstart",target:w,pointerType:m}),r&&r(!0),s(!0)},f=(g,m)=>{if(o.pointerType="",o.target=null,m==="touch"||!o.isHovered)return;o.isHovered=!1;let w=g.currentTarget;n&&n({type:"hoverend",target:w,pointerType:m}),r&&r(!1),s(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=g=>{_8&&g.pointerType==="mouse"||u(g,g.pointerType)},h.onPointerLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,g.pointerType)}):(h.onTouchStart=()=>{o.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=g=>{!o.ignoreEmulatedMouseEvents&&!_8&&u(g,"mouse"),o.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[e,r,n,i,o]);return C.useEffect(()=>{i&&c({currentTarget:o.target},o.pointerType)},[i]),{hoverProps:l,isHovered:a}}function zXe(t={}){let{autoFocus:e=!1,isTextInput:r,within:n}=t,i=C.useRef({isFocused:!1,isFocusVisible:e||Qae()}),[a,s]=C.useState(!1),[o,l]=C.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=C.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),u=C.useCallback(g=>{i.current.isFocused=g,s(g),c()},[c]);OXe(g=>{i.current.isFocusVisible=g,c()},[],{isTextInput:r});let{focusProps:f}=LXe({isDisabled:n,onFocusChange:u}),{focusWithinProps:h}=FXe({isDisabled:!n,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:o,focusProps:n?h:f}}var WXe=Object.defineProperty,HXe=(t,e,r)=>e in t?WXe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,zS=(t,e,r)=>(HXe(t,typeof e!="symbol"?e+"":e,r),r);let GXe=class{constructor(){zS(this,"current",this.detect()),zS(this,"handoffState","pending"),zS(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},j0=new GXe;function j1(t){return j0.isServer?null:t instanceof Node?t.ownerDocument:t!=null&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function y7(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function $u(){let t=[],e={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),e.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return e.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return y7(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=$u();return r(n),this.add(()=>n.dispose())},add(r){return t.includes(r)||t.push(r),()=>{let n=t.indexOf(r);if(n>=0)for(let i of t.splice(n,1))i()}},dispose(){for(let r of t.splice(0))r()}};return e}function Bm(){let[t]=C.useState($u);return C.useEffect(()=>()=>t.dispose(),[t]),t}let xn=(t,e)=>{j0.isServer?C.useEffect(t,e):C.useLayoutEffect(t,e)};function $1(t){let e=C.useRef(t);return xn(()=>{e.current=t},[t]),e}let pr=function(t){let e=$1(t);return Et.useCallback((...r)=>e.current(...r),[e])};function qXe(t){let e=t.width/2,r=t.height/2;return{top:t.clientY-r,right:t.clientX+e,bottom:t.clientY+r,left:t.clientX-e}}function VXe(t,e){return!(!t||!e||t.righte.right||t.bottome.bottom)}function YXe({disabled:t=!1}={}){let e=C.useRef(null),[r,n]=C.useState(!1),i=Bm(),a=pr(()=>{e.current=null,n(!1),i.dispose()}),s=pr(o=>{if(i.dispose(),e.current===null){e.current=o.currentTarget,n(!0);{let l=j1(o.currentTarget);i.addEventListener(l,"pointerup",a,!1),i.addEventListener(l,"pointermove",c=>{if(e.current){let u=qXe(c);n(VXe(u,e.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:r,pressProps:t?{}:{onPointerDown:s,onPointerUp:a,onClick:a}}}let KXe=C.createContext(void 0);function Xae(){return C.useContext(KXe)}function LT(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function Su(t,e,...r){if(t in e){let i=e[t];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,Su),n}var Xg=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(Xg||{}),Ff=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(Ff||{});function Ii(){let t=ZXe();return C.useCallback(e=>JXe({mergeRefs:t,...e}),[t])}function JXe({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:a=!0,name:s,mergeRefs:o}){o=o??QXe;let l=ese(e,t);if(a)return O4(l,r,n,s,o);let c=i??0;if(c&2){let{static:u=!1,...f}=l;if(u)return O4(f,r,n,s,o)}if(c&1){let{unmount:u=!0,...f}=l;return Su(u?0:1,{0(){return null},1(){return O4({...f,hidden:!0,style:{display:"none"}},r,n,s,o)}})}return O4(l,r,n,s,o)}function O4(t,e={},r,n,i){let{as:a=r,children:s,refName:o="ref",...l}=WS(t,["unmount","static"]),c=t.ref!==void 0?{[o]:t.ref}:{},u=typeof s=="function"?s(e):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(e){let h=!1,g=[];for(let[m,w]of Object.entries(e))typeof w=="boolean"&&(h=!0),w===!0&&g.push(m.replace(/([A-Z])/g,_=>`-${_.toLowerCase()}`));if(h){f["data-headlessui-state"]=g.join(" ");for(let m of g)f[`data-${m}`]=""}}if(a===C.Fragment&&(Object.keys(n0(l)).length>0||Object.keys(n0(f)).length>0))if(!C.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(n0(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(n0(l)).concat(Object.keys(n0(f))).map(h=>` - ${h}`).join(` +`);const s=nXe(e,r,i),o=C7.getSymbolSize(e),l=new qZe(o);return ZZe(l,e),XZe(l),eXe(l,e),qS(l,r,0),e>=7&&tXe(l,e),rXe(l,s),isNaN(n)&&(n=PT.getBestMask(l,qS.bind(null,l,r))),PT.applyMask(n,l),qS(l,r,n),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:n,segments:i}}zae.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let n=HS.M,i,a;return typeof r<"u"&&(n=HS.from(r.errorCorrectionLevel,HS.M),i=T8.from(r.version),a=PT.from(r.maskPattern),r.toSJISFunc&&C7.setToSJISFunction(r.toSJISFunc)),aXe(e,i,n,a)};var tse={},Xj={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:a,scale:a?4:s,margin:i,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},t.getImageWidth=function(n,i){const a=t.getScale(n,i);return Math.floor((n+i.margin*2)*a)},t.qrToImageData=function(n,i,a){const s=i.modules.size,o=i.modules.data,l=t.getScale(s,a),c=Math.floor((s+a.margin*2)*l),u=a.margin*l,f=[a.color.light,a.color.dark];for(let h=0;h=u&&g>=u&&h"u"&&(!s||!s.getContext)&&(l=s,s=void 0),s||(c=n()),l=e.getOptions(l);const u=e.getImageWidth(a.modules.size,l),f=c.getContext("2d"),h=f.createImageData(u,u);return e.qrToImageData(h.data,a,l),r(f,c,u),f.putImageData(h,0,0),c},t.renderToDataURL=function(a,s,o){let l=o;typeof l>"u"&&(!s||!s.getContext)&&(l=s,s=void 0),l||(l={});const c=t.render(a,s,l),u=l.type||"image/png",f=l.rendererOpts||{};return c.toDataURL(u,f.quality)}})(tse);var rse={};const sXe=Xj;function YH(t,e){const r=t.a/255,n=e+'="'+t.hex+'"';return r<1?n+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function VS(t,e,r){let n=t+e;return typeof r<"u"&&(n+=" "+r),n}function oXe(t,e,r){let n="",i=0,a=!1,s=0;for(let o=0;o0&&l>0&&t[o-1]||(n+=a?VS("M",l+r,.5+c+r):VS("m",i,0),i=0,a=!1),l+1':"",c="',u='viewBox="0 0 '+o+" "+o+'"',h=''+l+c+` +`;return typeof n=="function"&&n(null,h),h};const lXe=_Ze,DT=zae,nse=tse,cXe=rse;function e$(t,e,r,n,i){const a=[].slice.call(arguments,1),s=a.length,o=typeof a[s-1]=="function";if(!o&&!lXe())throw new Error("Callback required as last argument");if(o){if(s<2)throw new Error("Too few arguments provided");s===2?(i=r,r=e,e=n=void 0):s===3&&(e.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=r,r=e,e=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(r=e,e=n=void 0):s===2&&!e.getContext&&(n=r,r=e,e=void 0),new Promise(function(l,c){try{const u=DT.create(r,n);l(t(u,e,n))}catch(u){c(u)}})}try{const l=DT.create(r,n);i(null,t(l,e,n))}catch(l){i(l)}}Cv.create=DT.create;Cv.toCanvas=e$.bind(null,nse.render);Cv.toDataURL=e$.bind(null,nse.renderToDataURL);Cv.toString=e$.bind(null,function(t,e,r){return cXe.render(t,r)});const uXe=()=>d.jsx("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:d.jsx("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let YS=(t,e,r,n,i)=>{for(let a=e;a{let r=Cv.create(t,{errorCorrectionLevel:e}).modules,n=HMe(Array.from(r.data),r.size);return n=YS(n,0,0,7,7),n=YS(n,n.length-7,0,7,7),YS(n,0,n.length-7,7,7)},fXe=({x:t,y:e,cellSize:r,bgColor:n,fgColor:i})=>d.jsx(d.Fragment,{children:[0,1,2].map(a=>d.jsx("circle",{r:r*(7-2*a)/2,cx:t+7*r/2,cy:e+7*r/2,fill:a%2!=0?n:i},`finder-${t}-${e}-${a}`))}),hXe=({cellSize:t,matrixSize:e,bgColor:r,fgColor:n})=>d.jsx(d.Fragment,{children:[[0,0],[(e-7)*t,0],[0,(e-7)*t]].map(([i,a])=>d.jsx(fXe,{x:i,y:a,cellSize:t,bgColor:r,fgColor:n},`finder-${i}-${a}`))}),pXe=({matrix:t,cellSize:e,color:r})=>d.jsx(d.Fragment,{children:t.map((n,i)=>n.map((a,s)=>a?d.jsx("rect",{height:e-.4,width:e-.4,x:i*e+.1*e,y:s*e+.1*e,rx:.5*e,ry:.5*e,fill:r},`cell-${i}-${s}`):d.jsx(Et.Fragment,{},`circle-${i}-${s}`)))}),gXe=({cellSize:t,matrixSize:e,element:r,sizePercentage:n,bgColor:i})=>{if(!r)return d.jsx(d.Fragment,{});let a=e*(n||.14),s=Math.floor(e/2-a/2),o=Math.floor(e/2+a/2);(o-s)%2!=e%2&&(o+=1);let l=(o-s)*t,c=l-.2*l,u=s*t;return d.jsxs(d.Fragment,{children:[d.jsx("rect",{x:s*t,y:s*t,width:l,height:l,fill:i}),d.jsx(r,{x:u+.1*l,y:u+.1*l,height:c,width:c})]})},mXe=t=>{var a;let e=t.outputSize,r=dXe(t.url,t.errorCorrectionLevel),n=e/r.length,i=JMe(2*n,{min:.025*e,max:.036*e});return d.jsxs("svg",{height:t.outputSize,width:t.outputSize,viewBox:`0 0 ${t.outputSize} ${t.outputSize}`,style:{height:"100%",width:"100%",padding:`${i}px`},children:[d.jsx(pXe,{matrix:r,cellSize:n,color:t.fgColor}),d.jsx(hXe,{cellSize:n,matrixSize:r.length,fgColor:t.fgColor,bgColor:t.bgColor}),d.jsx(gXe,{cellSize:n,element:(a=t.logo)==null?void 0:a.element,bgColor:t.bgColor,matrixSize:r.length})]})},yXe=fe.div.withConfig({displayName:"QrContainer",componentId:"sc-aa6883ae-0"})(["display:flex;justify-content:center;align-items:center;height:",";width:",";margin:auto;background-color:",";&&{border-width:2px;border-color:",";border-radius:var(--privy-border-radius-md);}"],t=>`${t.$size}px`,t=>`${t.$size}px`,t=>t.$bgColor,t=>t.$borderColor);const S7=t=>{let{appearance:e}=Ai(),r=t.bgColor||"#FFFFFF",n=t.fgColor||"#000000",i=t.size||160,a=e.palette.colorScheme==="dark"?r:n;return d.jsx(yXe,{$size:i,$bgColor:r,$fgColor:n,$borderColor:a,children:d.jsx(mXe,{url:t.url,logo:{element:t.squareLogoElement??uXe},outputSize:i,bgColor:r,fgColor:n,errorCorrectionLevel:t.errorCorrectionLevel||"Q"})})},O0=({style:t,...e})=>d.jsxs("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...t},...e,children:[d.jsx("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),d.jsx("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),d.jsx("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),d.jsx("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});let KH="#8a63d2";const wXe=()=>{let{authenticated:t,logout:e,ready:r,user:n}=$r(),{lastScreen:i,navigate:a,navigateBack:s,setModalData:o,app:l}=wt(),{getAuthFlow:c,loginWithFarcaster:u,closePrivyModal:f,createAnalyticsEvent:h}=_t(),[g,m]=_.useState(void 0),[w,C]=_.useState(!1),[v,b]=_.useState(!1),A=_.useRef([]),S=c(),j=S==null?void 0:S.meta.connectUri;return _.useEffect(()=>{let F=Date.now(),I=setInterval(async()=>{var se,Y,N,k,x,E,L,O,P,R,M,D,$,X,le;let B=await S.pollForReady.execute(),V=Date.now()-F;if(B){clearInterval(I),C(!0);try{await u(),b(!0)}catch(H){let ee={retryable:!1,message:"Authentication failed"};if((H==null?void 0:H.privyErrorCode)===Ae.ALLOWLIST_REJECTED)return void a(ye.ALLOWLIST_REJECTION_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.USER_LIMIT_REACHED)return console.error(new Vw(H).toString()),void a(ye.USER_LIMIT_REACHED_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.USER_DOES_NOT_EXIST)return void a(ye.ACCOUNT_NOT_FOUND_SCREEN);if((H==null?void 0:H.privyErrorCode)===Ae.LINKED_TO_ANOTHER_USER)ee.detail=H.message??"This account has already been linked to another user.";else{if((H==null?void 0:H.privyErrorCode)===Ae.ACCOUNT_TRANSFER_REQUIRED&&((Y=(se=H.data)==null?void 0:se.data)!=null&&Y.nonce))return o({accountTransfer:{nonce:(k=(N=H.data)==null?void 0:N.data)==null?void 0:k.nonce,account:(E=(x=H.data)==null?void 0:x.data)==null?void 0:E.subject,displayName:(P=(O=(L=H.data)==null?void 0:L.data)==null?void 0:O.account)==null?void 0:P.displayName,linkMethod:"farcaster",embeddedWalletAddress:(D=(M=(R=H.data)==null?void 0:R.data)==null?void 0:M.otherUser)==null?void 0:D.embeddedWalletAddress,farcasterEmbeddedAddress:(le=(X=($=H.data)==null?void 0:$.data)==null?void 0:X.otherUser)==null?void 0:le.farcasterEmbeddedAddress}}),void a(ye.LINK_CONFLICT_SCREEN);(H==null?void 0:H.privyErrorCode)===Ae.INVALID_CREDENTIALS?(ee.retryable=!0,ee.detail="Something went wrong. Try again."):(H==null?void 0:H.privyErrorCode)===Ae.TOO_MANY_REQUESTS&&(ee.detail="Too many requests. Please wait before trying again.")}m(ee)}}else V>12e4&&(clearInterval(I),m({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},2e3);return()=>{clearInterval(I),A.current.forEach(B=>clearTimeout(B))}},[]),_.useEffect(()=>{if(r&&t&&v&&n){if(l!=null&&l.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let F=setTimeout(()=>{a(ye.AFFIRMATIVE_CONSENT_SCREEN)},Dn);return()=>clearTimeout(F)}v&&(Hd(n,l==null?void 0:l.embeddedWallets.createOnLogin)?A.current.push(setTimeout(()=>{o({createWallet:{onSuccess:()=>{},onFailure:F=>{console.error(F),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:F,screen:"FarcasterConnectStatusScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),a(ye.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)},Dn)):A.current.push(setTimeout(()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0}),Dn)))}},[v,r,t,n]),d.jsxs(d.Fragment,ya||w?{children:[d.jsx(ft,{backFn:i?s:void 0,onClose:f},"header"),d.jsx(tn,{}),d.jsx(d.Fragment,$N?{children:d.jsxs(vXe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(Ec,{success:v,fail:!!g}),d.jsx(O0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(To,{children:[d.jsx(hn,{children:g?g.message:"Sign in with Farcaster"}),d.jsx(pn,{children:g?g.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),j&&d.jsx(Ot,{onClick:F=>{F.preventDefault(),window.location.href=j},children:"Open Warpcast app"})]})}:{children:d.jsxs(JH,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(Ec,{success:v,fail:!!g}),d.jsx(O0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(To,{children:[d.jsx(hn,{children:g?g.message:"Signing in with Farcaster"}),d.jsx(pn,{children:g?g.detail:"This should only take a moment"}),d.jsx(Cc,{children:j&&ya&&d.jsx(Bae,{text:"Take me to Warpcast",url:j,color:KH})})]})]})}),d.jsx(kr,{})]}:{children:[d.jsx(ft,{backFn:i?s:void 0,onClose:f},"header"),d.jsx(tn,{}),d.jsx(JH,{children:d.jsxs("div",{children:[d.jsx(hn,{children:"Sign in with Farcaster"}),d.jsx(pn,{children:"Scan with your phone's camera to continue."}),d.jsx(hj,{children:j?d.jsx(S7,{url:j,size:275,squareLogoElement:O0}):d.jsx(bl,{})}),d.jsxs(Cc,{children:[d.jsx(pn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),j&&d.jsx(b7,{text:j,itemName:"link",color:KH})]})]})}),d.jsx(kr,{})]})};let JH=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-5a361367-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),vXe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-5a361367-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]),QH="#8a63d2";const bXe=()=>{let{lastScreen:t,navigateBack:e,data:r,app:n}=wt(),{requestFarcasterSignerStatus:i,closePrivyModal:a}=_t(),[s,o]=_.useState(void 0),[l,c]=_.useState(!1),[u,f]=_.useState(!1),h=_.useRef([]),g=r==null?void 0:r.farcasterSigner;_.useEffect(()=>{let w=Date.now(),C=setInterval(async()=>{if(!(g!=null&&g.public_key))return clearInterval(C),void o({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});g.status==="approved"&&(clearInterval(C),c(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Dn)));let v=await i(g==null?void 0:g.public_key),b=Date.now()-w;v.status==="approved"?(clearInterval(C),c(!1),f(!0),h.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),Dn))):b>3e5?(clearInterval(C),o({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):v.status==="revoked"&&(clearInterval(C),o({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},2e3);return()=>{clearInterval(C),h.current.forEach(v=>clearTimeout(v))}},[]);let m=(g==null?void 0:g.status)==="pending_approval"?g.signer_approval_url:void 0;return d.jsxs(d.Fragment,ya||l?{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:a},"header"),d.jsx(tn,{}),d.jsx(d.Fragment,$N?{children:d.jsxs(xXe,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(Ec,{success:u,fail:!!s}),d.jsx(O0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(To,{children:[d.jsx(hn,{children:s?s.message:"Add a signer to Farcaster"}),d.jsx(pn,{children:s?s.detail:"This will allow "+n.name+" to add casts, likes, follows, and more on your behalf."})]}),m&&d.jsx(Ot,{onClick:w=>{w.preventDefault(),window.location.href=m},children:"Open Warpcast app"})]})}:{children:d.jsxs(ZH,{children:[d.jsx(Js,{children:d.jsxs("div",{children:[d.jsx(Ec,{success:u,fail:!!s}),d.jsx(O0,{style:{width:"38px",height:"38px"}})]})}),d.jsxs(To,{children:[d.jsx(hn,{children:s?s.message:"Requesting signer from Farcaster"}),d.jsx(pn,{children:s?s.detail:"This should only take a moment"}),d.jsx(Cc,{children:m&&ya&&d.jsx(Bae,{text:"Take me to Warpcast",url:m,color:QH})})]})]})}),d.jsx(kr,{})]}:{children:[d.jsx(ft,{backFn:t?e:void 0,onClose:a},"header"),d.jsx(tn,{}),d.jsx(ZH,{children:d.jsxs("div",{children:[d.jsx(hn,{children:"Add a signer to Farcaster"}),d.jsxs(pn,{children:["This will allow ",n.name," to add casts, likes, follows, and more on your behalf."]}),d.jsx(hj,{children:(g==null?void 0:g.status)==="pending_approval"?d.jsx(S7,{url:g.signer_approval_url,size:275,squareLogoElement:O0}):d.jsx(bl,{})}),d.jsxs(Cc,{children:[d.jsx(pn,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),(g==null?void 0:g.status)==="pending_approval"&&d.jsx(b7,{text:g.signer_approval_url,itemName:"link",color:QH})]})]})}),d.jsx(kr,{})]})};let ZH=fe.div.withConfig({displayName:"ConnectContainer",componentId:"sc-6e2c96cd-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:27px;margin-right:27px;gap:24px;"]),xXe=fe.div.withConfig({displayName:"ConnectContainerButton",componentId:"sc-6e2c96cd-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;gap:24px;width:100%;"]);function Zs({title:t}){var s,o;let{currentScreen:e,navigateBack:r,navigate:n,data:i,setModalData:a}=wt();return d.jsx(ft,{title:t,backFn:e===ye.FUNDING_MANUAL_TRANSFER_SCREEN?r:e===((s=i==null?void 0:i.funding)==null?void 0:s.methodScreen)?i.funding.comingFromSendTransactionScreen?()=>n(ye.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN):void 0:(o=i==null?void 0:i.funding)!=null&&o.methodScreen?()=>{let l=i.funding;l.usingDefaultFundingMethod&&(l.usingDefaultFundingMethod=!1),a({funding:l}),n(l.methodScreen)}:void 0})}const Vm=({size:t})=>d.jsx(EXe,{$size:t,children:d.jsxs(_Xe,{children:[d.jsx(CXe,{}),d.jsx(SXe,{})]})});let EXe=fe.div.withConfig({displayName:"LoadingContainer",componentId:"sc-3ddaba1c-0"})(["--spinner-size:",";display:flex;justify-content:center;align-items:center;flex-grow:1;@media all and (display-mode:standalone){margin-bottom:30px;}"],t=>t.$size?t.$size:"96px"),_Xe=fe.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-3ddaba1c-1"})(["position:relative;height:var(--spinner-size);width:var(--spinner-size);opacity:1;animation:fadein 200ms ease;"]),CXe=fe.div.withConfig({displayName:"CircleFixed",componentId:"sc-3ddaba1c-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);&&{border:4px solid #f1f2f9;border-radius:50%;}"]),SXe=fe.div.withConfig({displayName:"CircleRotate",componentId:"sc-3ddaba1c-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:#cbcde1 transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);const ise=({enabled:t=!0}={})=>{let{showFiatPrices:e,getUsdPriceForSol:r}=_t(),[n,i]=_.useState(!0),[a,s]=_.useState(void 0),[o,l]=_.useState(void 0);return _.useEffect(()=>{(async()=>{if(e&&t)try{i(!0);let c=await r();c?l(c):s(Error("Unable to fetch SOL price"))}catch(c){s(c)}finally{i(!1)}else i(!1)})()},[]),{solPrice:o,isSolPriceLoading:n,solPriceError:a}};function Ym(t){let{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}=(o=>{let{showFiatPrices:l,getUsdTokenPrice:c,chains:u}=_t(),[f,h]=_.useState(!0),[g,m]=_.useState(void 0),[w,C]=_.useState(void 0);return _.useEffect(()=>{o||(o=V3);let v=rj(u).find(b=>b.id===Number(o));(async()=>{if(l){if(!v)return h(!1),void m(Error(`Unable to fetch token price on chain id ${o}`));try{h(!0);let b=await c(v);b?C(b):m(Error(`Unable to fetch token price on chain id ${v.id}`))}catch(b){m(b)}finally{h(!1)}}else h(!1)})()},[o]),{tokenPrice:w,isTokenPriceLoading:f,tokenPriceError:g}})(t==="solana"?-1:t),{solPrice:i,isSolPriceLoading:a,solPriceError:s}=ise({enabled:t==="solana"});return t==="solana"?{tokenPrice:i,isTokenPriceLoading:a,tokenPriceError:s}:{tokenPrice:e,isTokenPriceLoading:r,tokenPriceError:n}}const ase=_.createContext(null);function F1(){let t=_.useContext(ase);return t===null?(console.warn("`useWallets` was called outside the PrivyProvider component"),{wallets:[],ready:!1}):t}const Qd="sdk_fiat_on_ramp_completed_with_status";let XH="0x0000000000000000000000000000000000000000";const lw=({destinationCurrency:t,...e})=>({tradeType:"EXACT_OUTPUT",originCurrency:XH,destinationCurrency:t??XH,...e}),cw=async({input:t,isTestnet:e})=>{let r=await fetch(e?"https://api.testnets.relay.link/execute/swap":"https://api.relay.link/execute/swap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json();if(!(r.ok||typeof n.message=="string"&&n.message.startsWith("Invalid address")))throw console.error("Relay error:",n),Error(n.message??"Error fetching quote from relay");return n},k8=t=>{var r,n;let e=(n=(r=t.steps[0])==null?void 0:r.items)==null?void 0:n[0];if(e)return{from:e.data.from,to:e.data.to,value:Number(e.data.value),chainId:Number(e.data.chainId),data:e.data.data}},AXe=(t,e=0)=>{let r=t[e],n=t[e+7];if(!r||!n)throw Error(`Buffer offset out of range: first: ${r}, last: ${n}.`);return(BigInt(t[e+4]+256*t[e+5]+65536*t[e+6]+(n<<24))<<32n)+BigInt(r+256*t[++e]+65536*t[++e]+16777216*t[++e])};let IXe=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function nh(t,e=6,r=!1,n=!1){let i=(parseFloat(t.toString())/1e9).toFixed(e).replace(/0+$/,"").replace(/\.$/,""),a=n?"":" SOL";return r?`${i}${a}`:`${i==="0"?"<0.001":i}${a}`}function F0(t,e){let r=parseFloat(t.toString())/1e9,n=IXe.format(e*r);return n==="$0.00"?"<$0.01":n}function sse({amount:t,fee:e,tokenPrice:r}){let n=BigInt(1e9*parseFloat(t)),i=n+e;return{fundingAmountInBaseUnit:n,fundingAmountInUsd:r?F0(n,r):void 0,totalPriceInUsd:r?F0(i,r):void 0,totalPriceInNativeCurrency:nh(i),feePriceInNativeCurrency:nh(e),feePriceInUsd:r?F0(e,r):void 0}}function Ph(t){return"version"in t}function KS(t,e,r=0){var a,s,o;let n=e==="from"?0:e==="to"?1:2;if(Ph(t)){let l=t.message.getAccountKeys(),c=(a=t.message.compiledInstructions.at(r))==null?void 0:a.accountKeyIndexes[n];return c&&l.get(c)||null}let i=(o=(s=t.instructions.at(r))==null?void 0:s.keys.at(n))==null?void 0:o.pubkey;if(i==null)throw Error(`Transaction does not contain a "${e}" public key`);return i}function MXe(t,e=!1,r=0){var a,s;let n=e?1:4;if(Ph(t)){let o=(a=t.message.compiledInstructions.at(r))==null?void 0:a.data;if(!o)return 0n;try{return AXe(Buffer.from(o),n)}catch{return 0n}}let i=(s=t.instructions.at(r))==null?void 0:s.data.readBigInt64LE(n);return i??0n}function TXe(t,e){if(Ph(t)){let n=t.message.staticAccountKeys.find(i=>i.toBase58()===e);if(!n)throw Error(`Transaction does not contain public key ${e}`);return n}let r=t.compileMessage().accountKeys.find(n=>n.toBase58()===e);if(!r)throw Error(`Transaction does not contain public key ${e}`);return r}function kXe(t,e=0){var n,i,a;let r;if(Ph(t)){let s=(n=t.message.compiledInstructions.at(e))==null?void 0:n.programIdIndex;if(s==null)throw Error("Transaction does not contain a Program ID");r=(i=t.message.getAccountKeys().get(s))==null?void 0:i.toBase58()}else r=(a=t.instructions.at(e))==null?void 0:a.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");return r==="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"?"approve":r==="11111111111111111111111111111111"?"transfer":"instruction"}async function NXe(t,e){return Ph(t)?(await e.getFeeForMessage(t.message)).value:await t.getEstimatedFee(e)}function ose(t,e){var r;return{signature:t,parsedTransaction:e,fees:BigInt(((r=e==null?void 0:e.meta)==null?void 0:r.fee)||0)}}async function lse(t,e){let r=[],n=Ph(t)?t.message.compiledInstructions.length:t.instructions.length,i={},a=BigInt(await NXe(t,e)||0);for(let s=0;s=u})}return{fees:a,instructions:r}}const cse=({chains:t,appId:e,address:r,rpcConfig:n})=>Promise.all(t.map(async i=>({balance:await xc({chain:i,transport:bc(uh(i,n,e))}).getBalance({address:r}).catch(()=>0n),chain:i})));let use=_.createContext({plugins:{current:{}}});const LXe=({children:t})=>{let e=_.useRef({});return d.jsx(use.Provider,{value:{plugins:e},children:t})},Av=()=>{let{plugins:t}=_.useContext(use);return _.useCallback(e=>t.current[e],[t])},Iv=Symbol("solana-funding-plugin"),Mv=fe.span.withConfig({displayName:"Rows",componentId:"sc-b764aab6-0"})(["display:flex;flex-direction:column;gap:0.35rem;width:100%;"]),Yr=fe.span.withConfig({displayName:"Row",componentId:"sc-b764aab6-1"})(["display:flex;width:100%;justify-content:space-between;gap:0.5rem;"]),qr=fe.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),jXe=fe(qr).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),cn=fe.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],Tne);function $Xe({title:t,titleId:e,...r},n){return _.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":e},r),t?_.createElement("title",{id:e},t):null,_.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))}const dse=_.forwardRef($Xe),PXe=t=>d.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...t,children:d.jsx("g",{id:"Layer_x0020_1",children:d.jsxs("g",{id:"_2405588477232",children:[d.jsx("rect",{fill:"none",width:"2500",height:"2500"}),d.jsx("g",{children:d.jsxs("g",{children:[d.jsx("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),d.jsx("g",{children:d.jsxs("g",{children:[d.jsx("g",{children:d.jsx("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),d.jsx("g",{children:d.jsx("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),d.jsx("g",{children:d.jsx("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),d.jsx("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),d.jsxs("g",{children:[d.jsx("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),d.jsx("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),RXe=t=>d.jsxs("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),d.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),DXe=t=>d.jsxs("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),d.jsx("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),OXe=t=>d.jsxs("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),d.jsx("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),FXe=t=>d.jsxs("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"199.4",height:"207.623",fill:"#121212"}),d.jsxs("g",{"clip-path":"url(#clip0_2303_643)",children:[d.jsx("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),d.jsx("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),d.jsx("defs",{children:d.jsx("clipPath",{id:"clip0_2303_643",children:d.jsx("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),UXe=t=>d.jsxs("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...t,children:[d.jsx("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),d.jsx("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),d.jsx("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),d.jsx("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),d.jsx("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),BXe=t=>d.jsxs("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),d.jsx("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),d.jsx("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),zXe=t=>d.jsxs("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[d.jsx("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),d.jsx("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),WXe=t=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...t,children:[d.jsxs("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),d.jsxs("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),d.jsxs("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[d.jsx("stop",{offset:"0",stopColor:"#00FFA3"}),d.jsx("stop",{offset:"1",stopColor:"#DC1FFF"})]}),d.jsx("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]}),HXe=t=>d.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...t,children:[d.jsx("g",{clipPath:"url(#clip0)",children:d.jsx("g",{clipPath:"url(#clip1)",children:d.jsx("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),d.jsxs("defs",{children:[d.jsxs("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[d.jsx("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),d.jsx("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),d.jsx("stop",{offset:"0.4982",stopColor:"#4281D3"}),d.jsx("stop",{offset:"0.666667",stopColor:"#2E427D"}),d.jsx("stop",{offset:"0.822917",stopColor:"#230101"}),d.jsx("stop",{offset:"1",stopColor:"#8F6B40"})]}),d.jsx("clipPath",{id:"clip0",children:d.jsx("rect",{width:"30",height:"30",fill:"white"})}),d.jsx("clipPath",{id:"clip1",children:d.jsx("rect",{width:"30",height:"30",fill:"white"})})]})]});let GXe={[Ih.id]:PXe,[qL.id]:RXe,[ef.id]:DXe,[VL.id]:OXe,[vre.id]:FXe,[Ru.id]:UXe,[M1.id]:BXe,[tf.id]:zXe,[_re.id]:HXe};const fse=({chainId:t,...e})=>{if(t==="solana")return d.jsx(WXe,{...e});let r=GXe[t];return d.jsx(r||dse,{...e})},qXe=({balance:t,className:e,chain:r})=>d.jsx(Fj,{className:e,$state:void 0,children:d.jsx(OT,{balance:t,chain:r})}),OT=({balance:t,chain:e})=>d.jsxs(d.Fragment,{children:[d.jsxs(VXe,{children:[d.jsx(KXe,{chainId:"id"in e?e.id:"solana"}),d.jsx(cn,{children:e.name})]}),d.jsxs(Sc,{isLoading:!1,isPulsing:!1,color:"gray",children:[d.jsx(YXe,{children:d.jsx(ov,{})}),t]})]});let VXe=fe.div.withConfig({displayName:"Container",componentId:"sc-6d3c340d-0"})(["display:flex;align-items:center;"]),YXe=fe.div.withConfig({displayName:"IconContainer",componentId:"sc-6d3c340d-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),KXe=fe(fse).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-6d3c340d-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const hse=typeof document<"u"?Et.useLayoutEffect:()=>{};function JXe(t){const e=_.useRef(null);return hse(()=>{e.current=t},[t]),_.useCallback((...r)=>{const n=e.current;return n==null?void 0:n(...r)},[])}const Tv=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},I0=t=>t&&"window"in t&&t.window===t?t:Tv(t).defaultView||window;function QXe(t){var e;return typeof window>"u"||window.navigator==null?!1:((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands.some(r=>t.test(r.brand)))||t.test(window.navigator.userAgent)}function ZXe(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function pse(t){let e=null;return()=>(e==null&&(e=t()),e)}const XXe=pse(function(){return ZXe(/^Mac/i)}),eet=pse(function(){return QXe(/Android/i)});function tet(t){return t.mozInputSource===0&&t.isTrusted?!0:eet()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}class ret{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,r){this.nativeEvent=r,this.target=r.target,this.currentTarget=r.currentTarget,this.relatedTarget=r.relatedTarget,this.bubbles=r.bubbles,this.cancelable=r.cancelable,this.defaultPrevented=r.defaultPrevented,this.eventPhase=r.eventPhase,this.isTrusted=r.isTrusted,this.timeStamp=r.timeStamp,this.type=e}}function gse(t){let e=_.useRef({isFocused:!1,observer:null});hse(()=>{const n=e.current;return()=>{n.observer&&(n.observer.disconnect(),n.observer=null)}},[]);let r=JXe(n=>{t==null||t(n)});return _.useCallback(n=>{if(n.target instanceof HTMLButtonElement||n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement||n.target instanceof HTMLSelectElement){e.current.isFocused=!0;let i=n.target,a=s=>{e.current.isFocused=!1,i.disabled&&r(new ret("blur",s)),e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",a,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var s;(s=e.current.observer)===null||s===void 0||s.disconnect();let o=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[r])}function net(t){let{isDisabled:e,onFocus:r,onBlur:n,onFocusChange:i}=t;const a=_.useCallback(l=>{if(l.target===l.currentTarget)return n&&n(l),i&&i(!1),!0},[n,i]),s=gse(a),o=_.useCallback(l=>{const c=Tv(l.target);l.target===l.currentTarget&&c.activeElement===l.target&&(r&&r(l),i&&i(!0),s(l))},[i,r,s]);return{focusProps:{onFocus:!e&&(r||i||n)?o:void 0,onBlur:!e&&(n||i)?a:void 0}}}let kv=null,FT=new Set,Yy=new Map,f1=!1,UT=!1;const iet={Tab:!0,Escape:!0};function t$(t,e){for(let r of FT)r(t,e)}function aet(t){return!(t.metaKey||!XXe()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function N8(t){f1=!0,aet(t)&&(kv="keyboard",t$("keyboard",t))}function cl(t){kv="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(f1=!0,t$("pointer",t))}function mse(t){tet(t)&&(f1=!0,kv="virtual")}function yse(t){t.target===window||t.target===document||(!f1&&!UT&&(kv="virtual",t$("virtual",t)),f1=!1,UT=!1)}function wse(){f1=!1,UT=!0}function BT(t){if(typeof window>"u"||Yy.get(I0(t)))return;const e=I0(t),r=Tv(t);let n=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){f1=!0,n.apply(this,arguments)},r.addEventListener("keydown",N8,!0),r.addEventListener("keyup",N8,!0),r.addEventListener("click",mse,!0),e.addEventListener("focus",yse,!0),e.addEventListener("blur",wse,!1),typeof PointerEvent<"u"?(r.addEventListener("pointerdown",cl,!0),r.addEventListener("pointermove",cl,!0),r.addEventListener("pointerup",cl,!0)):(r.addEventListener("mousedown",cl,!0),r.addEventListener("mousemove",cl,!0),r.addEventListener("mouseup",cl,!0)),e.addEventListener("beforeunload",()=>{vse(t)},{once:!0}),Yy.set(e,{focus:n})}const vse=(t,e)=>{const r=I0(t),n=Tv(t);e&&n.removeEventListener("DOMContentLoaded",e),Yy.has(r)&&(r.HTMLElement.prototype.focus=Yy.get(r).focus,n.removeEventListener("keydown",N8,!0),n.removeEventListener("keyup",N8,!0),n.removeEventListener("click",mse,!0),r.removeEventListener("focus",yse,!0),r.removeEventListener("blur",wse,!1),typeof PointerEvent<"u"?(n.removeEventListener("pointerdown",cl,!0),n.removeEventListener("pointermove",cl,!0),n.removeEventListener("pointerup",cl,!0)):(n.removeEventListener("mousedown",cl,!0),n.removeEventListener("mousemove",cl,!0),n.removeEventListener("mouseup",cl,!0)),Yy.delete(r))};function set(t){const e=Tv(t);let r;return e.readyState!=="loading"?BT(t):(r=()=>{BT(t)},e.addEventListener("DOMContentLoaded",r)),()=>vse(t,r)}typeof document<"u"&&set();function bse(){return kv!=="pointer"}const oet=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function cet(t,e,r){var n;const i=typeof window<"u"?I0(r==null?void 0:r.target).HTMLInputElement:HTMLInputElement,a=typeof window<"u"?I0(r==null?void 0:r.target).HTMLTextAreaElement:HTMLTextAreaElement,s=typeof window<"u"?I0(r==null?void 0:r.target).HTMLElement:HTMLElement,o=typeof window<"u"?I0(r==null?void 0:r.target).KeyboardEvent:KeyboardEvent;return t=t||(r==null?void 0:r.target)instanceof i&&!oet.has(r==null||(n=r.target)===null||n===void 0?void 0:n.type)||(r==null?void 0:r.target)instanceof a||(r==null?void 0:r.target)instanceof s&&(r==null?void 0:r.target.isContentEditable),!(t&&e==="keyboard"&&r instanceof o&&!iet[r.key])}function uet(t,e,r){BT(),_.useEffect(()=>{let n=(i,a)=>{cet(!!(r!=null&&r.isTextInput),i,a)&&t(bse())};return FT.add(n),()=>{FT.delete(n)}},e)}function det(t){let{isDisabled:e,onBlurWithin:r,onFocusWithin:n,onFocusWithinChange:i}=t,a=_.useRef({isFocusWithin:!1}),s=_.useCallback(c=>{a.current.isFocusWithin&&!c.currentTarget.contains(c.relatedTarget)&&(a.current.isFocusWithin=!1,r&&r(c),i&&i(!1))},[r,i,a]),o=gse(s),l=_.useCallback(c=>{!a.current.isFocusWithin&&document.activeElement===c.target&&(n&&n(c),i&&i(!0),a.current.isFocusWithin=!0,o(c))},[n,i,o]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:s}}}let L8=!1,JS=0;function zT(){L8=!0,setTimeout(()=>{L8=!1},50)}function eG(t){t.pointerType==="touch"&&zT()}function fet(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",eG):document.addEventListener("touchend",zT),JS++,()=>{JS--,!(JS>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",eG):document.removeEventListener("touchend",zT))}}function het(t){let{onHoverStart:e,onHoverChange:r,onHoverEnd:n,isDisabled:i}=t,[a,s]=_.useState(!1),o=_.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;_.useEffect(fet,[]);let{hoverProps:l,triggerHoverEnd:c}=_.useMemo(()=>{let u=(g,m)=>{if(o.pointerType=m,i||m==="touch"||o.isHovered||!g.currentTarget.contains(g.target))return;o.isHovered=!0;let w=g.currentTarget;o.target=w,e&&e({type:"hoverstart",target:w,pointerType:m}),r&&r(!0),s(!0)},f=(g,m)=>{if(o.pointerType="",o.target=null,m==="touch"||!o.isHovered)return;o.isHovered=!1;let w=g.currentTarget;n&&n({type:"hoverend",target:w,pointerType:m}),r&&r(!1),s(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=g=>{L8&&g.pointerType==="mouse"||u(g,g.pointerType)},h.onPointerLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,g.pointerType)}):(h.onTouchStart=()=>{o.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=g=>{!o.ignoreEmulatedMouseEvents&&!L8&&u(g,"mouse"),o.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=g=>{!i&&g.currentTarget.contains(g.target)&&f(g,"mouse")}),{hoverProps:h,triggerHoverEnd:f}},[e,r,n,i,o]);return _.useEffect(()=>{i&&c({currentTarget:o.target},o.pointerType)},[i]),{hoverProps:l,isHovered:a}}function pet(t={}){let{autoFocus:e=!1,isTextInput:r,within:n}=t,i=_.useRef({isFocused:!1,isFocusVisible:e||bse()}),[a,s]=_.useState(!1),[o,l]=_.useState(()=>i.current.isFocused&&i.current.isFocusVisible),c=_.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),u=_.useCallback(g=>{i.current.isFocused=g,s(g),c()},[c]);uet(g=>{i.current.isFocusVisible=g,c()},[],{isTextInput:r});let{focusProps:f}=net({isDisabled:n,onFocusChange:u}),{focusWithinProps:h}=det({isDisabled:!n,onFocusWithinChange:u});return{isFocused:a,isFocusVisible:o,focusProps:n?h:f}}var get=Object.defineProperty,met=(t,e,r)=>e in t?get(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,QS=(t,e,r)=>(met(t,typeof e!="symbol"?e+"":e,r),r);let yet=class{constructor(){QS(this,"current",this.detect()),QS(this,"handoffState","pending"),QS(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},U0=new yet;function U1(t){return U0.isServer?null:t instanceof Node?t.ownerDocument:t!=null&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}function A7(t){typeof queueMicrotask=="function"?queueMicrotask(t):Promise.resolve().then(t).catch(e=>setTimeout(()=>{throw e}))}function Fu(){let t=[],e={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),e.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return e.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return e.requestAnimationFrame(()=>e.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return e.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return A7(()=>{n.current&&r[0]()}),e.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=Fu();return r(n),this.add(()=>n.dispose())},add(r){return t.includes(r)||t.push(r),()=>{let n=t.indexOf(r);if(n>=0)for(let i of t.splice(n,1))i()}},dispose(){for(let r of t.splice(0))r()}};return e}function Km(){let[t]=_.useState(Fu);return _.useEffect(()=>()=>t.dispose(),[t]),t}let xn=(t,e)=>{U0.isServer?_.useEffect(t,e):_.useLayoutEffect(t,e)};function B1(t){let e=_.useRef(t);return xn(()=>{e.current=t},[t]),e}let pr=function(t){let e=B1(t);return Et.useCallback((...r)=>e.current(...r),[e])};function wet(t){let e=t.width/2,r=t.height/2;return{top:t.clientY-r,right:t.clientX+e,bottom:t.clientY+r,left:t.clientX-e}}function vet(t,e){return!(!t||!e||t.righte.right||t.bottome.bottom)}function bet({disabled:t=!1}={}){let e=_.useRef(null),[r,n]=_.useState(!1),i=Km(),a=pr(()=>{e.current=null,n(!1),i.dispose()}),s=pr(o=>{if(i.dispose(),e.current===null){e.current=o.currentTarget,n(!0);{let l=U1(o.currentTarget);i.addEventListener(l,"pointerup",a,!1),i.addEventListener(l,"pointermove",c=>{if(e.current){let u=wet(c);n(vet(u,e.current.getBoundingClientRect()))}},!1),i.addEventListener(l,"pointercancel",a,!1)}}});return{pressed:r,pressProps:t?{}:{onPointerDown:s,onPointerUp:a,onClick:a}}}let xet=_.createContext(void 0);function xse(){return _.useContext(xet)}function WT(...t){return Array.from(new Set(t.flatMap(e=>typeof e=="string"?e.split(" "):[]))).filter(Boolean).join(" ")}function ku(t,e,...r){if(t in e){let i=e[t];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ku),n}var sm=(t=>(t[t.None=0]="None",t[t.RenderStrategy=1]="RenderStrategy",t[t.Static=2]="Static",t))(sm||{}),Gf=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(Gf||{});function Ii(){let t=_et();return _.useCallback(e=>Eet({mergeRefs:t,...e}),[t])}function Eet({ourProps:t,theirProps:e,slot:r,defaultTag:n,features:i,visible:a=!0,name:s,mergeRefs:o}){o=o??Cet;let l=Ese(e,t);if(a)return q4(l,r,n,s,o);let c=i??0;if(c&2){let{static:u=!1,...f}=l;if(u)return q4(f,r,n,s,o)}if(c&1){let{unmount:u=!0,...f}=l;return ku(u?0:1,{0(){return null},1(){return q4({...f,hidden:!0,style:{display:"none"}},r,n,s,o)}})}return q4(l,r,n,s,o)}function q4(t,e={},r,n,i){let{as:a=r,children:s,refName:o="ref",...l}=ZS(t,["unmount","static"]),c=t.ref!==void 0?{[o]:t.ref}:{},u=typeof s=="function"?s(e):s;"className"in l&&l.className&&typeof l.className=="function"&&(l.className=l.className(e)),l["aria-labelledby"]&&l["aria-labelledby"]===l.id&&(l["aria-labelledby"]=void 0);let f={};if(e){let h=!1,g=[];for(let[m,w]of Object.entries(e))typeof w=="boolean"&&(h=!0),w===!0&&g.push(m.replace(/([A-Z])/g,C=>`-${C.toLowerCase()}`));if(h){f["data-headlessui-state"]=g.join(" ");for(let m of g)f[`data-${m}`]=""}}if(a===_.Fragment&&(Object.keys(u0(l)).length>0||Object.keys(u0(f)).length>0))if(!_.isValidElement(u)||Array.isArray(u)&&u.length>1){if(Object.keys(u0(l)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(u0(l)).concat(Object.keys(u0(f))).map(h=>` - ${h}`).join(` `),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(h=>` - ${h}`).join(` `)].join(` -`))}else{let h=u.props,g=h==null?void 0:h.className,m=typeof g=="function"?(...v)=>LT(g(...v),l.className):LT(g,l.className),w=m?{className:m}:{},_=ese(u.props,n0(WS(l,["ref"])));for(let v in f)v in _&&delete f[v];return C.cloneElement(u,Object.assign({},_,f,c,{ref:i(XXe(u),c.ref)},w))}return C.createElement(a,Object.assign({},WS(l,["ref"]),a!==C.Fragment&&c,a!==C.Fragment&&f),u)}function ZXe(){let t=C.useRef([]),e=C.useCallback(r=>{for(let n of t.current)n!=null&&(typeof n=="function"?n(r):n.current=r)},[]);return(...r)=>{if(!r.every(n=>n==null))return t.current=r,e}}function QXe(...t){return t.every(e=>e==null)?void 0:e=>{for(let r of t)r!=null&&(typeof r=="function"?r(e):r.current=e)}}function ese(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];if(e.disabled||e["aria-disabled"])for(let n in r)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(n)&&(r[n]=[i=>{var a;return(a=i==null?void 0:i.preventDefault)==null?void 0:a.call(i)}]);for(let n in r)Object.assign(e,{[n](i,...a){let s=r[n];for(let o of s){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;o(i,...a)}}});return e}function tse(...t){if(t.length===0)return{};if(t.length===1)return t[0];let e={},r={};for(let n of t)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):e[i]=n[i];for(let n in r)Object.assign(e,{[n](...i){let a=r[n];for(let s of a)s==null||s(...i)}});return e}function oi(t){var e;return Object.assign(C.forwardRef(t),{displayName:(e=t.displayName)!=null?e:t.name})}function n0(t){let e=Object.assign({},t);for(let r in e)e[r]===void 0&&delete e[r];return e}function WS(t,e=[]){let r=Object.assign({},t);for(let n of e)n in r&&delete r[n];return r}function XXe(t){return Et.version.split(".")[0]>="19"?t.props.ref:t.ref}let eet="span";var C8=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(C8||{});function tet(t,e){var r;let{features:n=1,...i}=t,a={ref:e,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Ii()({ourProps:a,theirProps:i,slot:{},defaultTag:eet,name:"Hidden"})}let jT=oi(tet),ret=C.createContext(void 0);function net(){return C.useContext(ret)}function iet(t){let e=t.parentElement,r=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(r=e),e=e.parentElement;let n=(e==null?void 0:e.getAttribute("disabled"))==="";return n&&aet(r)?!1:n}function aet(t){if(!t)return!1;let e=t.previousElementSibling;for(;e!==null;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}let rse=Symbol();function set(t,e=!0){return Object.assign(t,{[rse]:e})}function ys(...t){let e=C.useRef(t);C.useEffect(()=>{e.current=t},[t]);let r=pr(n=>{for(let i of e.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return t.every(n=>n==null||(n==null?void 0:n[rse]))?void 0:r}let Gj=C.createContext(null);Gj.displayName="DescriptionContext";function nse(){let t=C.useContext(Gj);if(t===null){let e=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,nse),e}return t}function ise(){let[t,e]=C.useState([]);return[t.length>0?t.join(" "):void 0,C.useMemo(()=>function(r){let n=pr(a=>(e(s=>[...s,a]),()=>e(s=>{let o=s.slice(),l=o.indexOf(a);return l!==-1&&o.splice(l,1),o}))),i=C.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props,value:r.value}),[n,r.slot,r.name,r.props,r.value]);return Et.createElement(Gj.Provider,{value:i},r.children)},[e])]}let oet="p";function cet(t,e){let r=C.useId(),n=Xae(),{id:i=`headlessui-description-${r}`,...a}=t,s=nse(),o=ys(e);xn(()=>s.register(i),[i,s.register]);let l=n||!1,c=C.useMemo(()=>({...s.slot,disabled:l}),[s.slot,l]),u={ref:o,...s.props,id:i};return Ii()({ourProps:u,theirProps:a,slot:c,defaultTag:oet,name:s.name||"Description"})}let uet=oi(cet),det=Object.assign(uet,{});var qi=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(qi||{});let w7=C.createContext(null);w7.displayName="LabelContext";function qj(){let t=C.useContext(w7);if(t===null){let e=new Error("You used a